From ba11040d6b5363789535d8693a1e675301e8c32e Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 21 Nov 2023 10:30:47 +0000 Subject: [PATCH 001/130] s3: detect looping when using gcs and versions Apparently gcs doesn't return an S3 compatible result when using versions. In particular it doesn't return a NextKeyMarker - this means rclone loops and fetches the same page over and over again. This patch detects the problem and stops the infinite retries but it doesn't fix the underlying problem. See: https://forum.rclone.org/t/list-s3-versions-files-looping-bug/42974 See: https://issuetracker.google.com/u/0/issues/312292516 --- backend/s3/s3.go | 3 +++ docs/content/s3.md | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/backend/s3/s3.go b/backend/s3/s3.go index d4f6867358cd9..bb4e97c61dd4e 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -3721,6 +3721,9 @@ func (ls *versionsList) List(ctx context.Context) (resp *s3.ListObjectsV2Output, // Set up the request for next time ls.req.KeyMarker = respVersions.NextKeyMarker ls.req.VersionIdMarker = respVersions.NextVersionIdMarker + if aws.BoolValue(respVersions.IsTruncated) && ls.req.KeyMarker == nil { + return nil, nil, errors.New("s3 protocol error: received versions listing with IsTruncated set with no NextKeyMarker") + } // If we are URL encoding then must decode the marker if ls.req.KeyMarker != nil && ls.req.EncodingType != nil { diff --git a/docs/content/s3.md b/docs/content/s3.md index b1853b3e6d22e..b4bdf10f89d45 100644 --- a/docs/content/s3.md +++ b/docs/content/s3.md @@ -3685,6 +3685,12 @@ secret_access_key = your_secret_key endpoint = https://storage.googleapis.com ``` +**Note** that `--s3-versions` does not work with GCS when it needs to do directory paging. Rclone will return the error: + + s3 protocol error: received versions listing with IsTruncated set with no NextKeyMarker + +This is Google bug [#312292516](https://issuetracker.google.com/u/0/issues/312292516). + ### DigitalOcean Spaces [Spaces](https://www.digitalocean.com/products/object-storage/) is an [S3-interoperable](https://developers.digitalocean.com/documentation/spaces/) object storage service from cloud provider DigitalOcean. From 5fba5025168aac0c9aa5dd767e51e0ee264ebbe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alen=20=C5=A0iljak?= Date: Wed, 22 Nov 2023 13:23:34 +0100 Subject: [PATCH 002/130] http: enable methods used with WebDAV - fixes #7444 Without this, requests like PROPFIND, issued from a browser, fail. --- lib/http/middleware.go | 2 +- lib/http/middleware_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/http/middleware.go b/lib/http/middleware.go index e7e4582b3c757..3ee5c0cdc2020 100644 --- a/lib/http/middleware.go +++ b/lib/http/middleware.go @@ -183,8 +183,8 @@ func MiddlewareCORS(allowOrigin string) Middleware { if allowOrigin != "" { w.Header().Add("Access-Control-Allow-Origin", allowOrigin) - w.Header().Add("Access-Control-Request-Method", "POST, OPTIONS, GET, HEAD") w.Header().Add("Access-Control-Allow-Headers", "authorization, Content-Type") + w.Header().Add("Access-Control-Allow-Methods", "COPY, DELETE, GET, HEAD, LOCK, MKCOL, MOVE, OPTIONS, POST, PROPFIND, PROPPATCH, PUT, TRACE, UNLOCK") } next.ServeHTTP(w, r) diff --git a/lib/http/middleware_test.go b/lib/http/middleware_test.go index 283848f94c46c..15d0b0525d663 100644 --- a/lib/http/middleware_test.go +++ b/lib/http/middleware_test.go @@ -323,8 +323,8 @@ func TestMiddlewareAuthCertificateUser(t *testing.T) { var _testCORSHeaderKeys = []string{ "Access-Control-Allow-Origin", - "Access-Control-Request-Method", "Access-Control-Allow-Headers", + "Access-Control-Allow-Methods", } func TestMiddlewareCORS(t *testing.T) { From a259226eb2a82f4d4aeaa0f34fb98dd865834132 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 24 Nov 2023 11:19:46 +0000 Subject: [PATCH 003/130] =?UTF-8?q?Add=20Alen=20=C5=A0iljak=20to=20contrib?= =?UTF-8?q?utors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/content/authors.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/content/authors.md b/docs/content/authors.md index 90d0240c58568..ffb586ea076ca 100644 --- a/docs/content/authors.md +++ b/docs/content/authors.md @@ -802,3 +802,4 @@ put them back in again.` >}} * viktor * moongdal * Mina Galić + * Alen Šiljak From 251a8e3c394f30c0975ce73e819134f4a64f8aac Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 23 Nov 2023 19:56:13 +0000 Subject: [PATCH 004/130] hash: allow runtime configuration of supported hashes for testing --- fs/hash/hash.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fs/hash/hash.go b/fs/hash/hash.go index 4540b40cf49c4..23956cee68cf4 100644 --- a/fs/hash/hash.go +++ b/fs/hash/hash.go @@ -55,6 +55,16 @@ func RegisterHash(name, alias string, width int, newFunc func() hash.Hash) Type return hashType } +// SupportOnly makes the hash package only support the types passed +// in. Used for testing. +// +// It returns the previously supported types. +func SupportOnly(new []Type) (old []Type) { + old = supported + supported = new + return old +} + // ErrUnsupported should be returned by filesystem, // if it is requested to deliver an unsupported hash type. var ErrUnsupported = errors.New("hash type not supported") From 5d5473c8a5765a569388bac7eb597a3799a7fdbd Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 23 Nov 2023 19:58:22 +0000 Subject: [PATCH 005/130] random: speed up String function for generating larger blocks --- cmd/test/makefiles/makefiles.go | 2 +- lib/random/random.go | 23 +++++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/cmd/test/makefiles/makefiles.go b/cmd/test/makefiles/makefiles.go index 4b9f8227c6d39..f48778cb03830 100644 --- a/cmd/test/makefiles/makefiles.go +++ b/cmd/test/makefiles/makefiles.go @@ -224,7 +224,7 @@ func (r *chargenReader) Read(p []byte) (n int, err error) { func fileName() (name string) { for { length := randSource.Intn(maxFileNameLength-minFileNameLength) + minFileNameLength - name = random.StringFn(length, randSource.Intn) + name = random.StringFn(length, randSource) if _, found := fileNames[name]; !found { break } diff --git a/lib/random/random.go b/lib/random/random.go index 08e752b8458f6..19ed44458dfd8 100644 --- a/lib/random/random.go +++ b/lib/random/random.go @@ -4,28 +4,35 @@ package random import ( cryptorand "crypto/rand" "encoding/base64" - "encoding/binary" "fmt" - mathrand "math/rand" + "io" ) // StringFn create a random string for test purposes using the random // number generator function passed in. // // Do not use these for passwords. -func StringFn(n int, randIntn func(n int) int) string { +func StringFn(n int, randReader io.Reader) string { const ( vowel = "aeiou" consonant = "bcdfghjklmnpqrstvwxyz" digit = "0123456789" ) - pattern := []string{consonant, vowel, consonant, vowel, consonant, vowel, consonant, digit} - out := make([]byte, n) - p := 0 + var ( + pattern = []string{consonant, vowel, consonant, vowel, consonant, vowel, consonant, digit} + out = make([]byte, n) + p = 0 + ) + _, err := io.ReadFull(randReader, out) + if err != nil { + panic(fmt.Sprintf("internal error: failed to read from random reader: %v", err)) + } for i := range out { source := pattern[p] p = (p + 1) % len(pattern) - out[i] = source[randIntn(len(source))] + // this generation method means the distribution is slightly biased. However these + // strings are not for passwords so this is deemed OK. + out[i] = source[out[i]%byte(len(source))] } return string(out) } @@ -34,7 +41,7 @@ func StringFn(n int, randIntn func(n int) int) string { // // Do not use these for passwords. func String(n int) string { - return StringFn(n, mathrand.Intn) + return StringFn(n, cryptorand.Reader) } // Password creates a crypto strong password which is just about From 94ccc95515981cdbf44251b7abed13c57a089146 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 24 Nov 2023 10:05:53 +0000 Subject: [PATCH 006/130] random: stop using deprecated rand.Seed in go1.20 and later --- lib/random/random.go | 16 ---------------- lib/random/random_seed.go | 17 +++++++++++++++++ lib/random/random_seed_old.go | 29 +++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 16 deletions(-) create mode 100644 lib/random/random_seed.go create mode 100644 lib/random/random_seed_old.go diff --git a/lib/random/random.go b/lib/random/random.go index 19ed44458dfd8..8a7dfa077fce0 100644 --- a/lib/random/random.go +++ b/lib/random/random.go @@ -67,19 +67,3 @@ func Password(bits int) (password string, err error) { password = base64.RawURLEncoding.EncodeToString(pw) return password, nil } - -// Seed the global math/rand with crypto strong data -// -// This doesn't make it OK to use math/rand in crypto sensitive -// environments - don't do that! However it does help to mitigate the -// problem if that happens accidentally. This would have helped with -// CVE-2020-28924 - #4783 -func Seed() error { - var seed int64 - err := binary.Read(cryptorand.Reader, binary.LittleEndian, &seed) - if err != nil { - return fmt.Errorf("failed to read random seed: %w", err) - } - mathrand.Seed(seed) - return nil -} diff --git a/lib/random/random_seed.go b/lib/random/random_seed.go new file mode 100644 index 0000000000000..c0c165779ce7e --- /dev/null +++ b/lib/random/random_seed.go @@ -0,0 +1,17 @@ +//go:build go1.20 + +package random + +// Seed the global math/rand with crypto strong data +// +// This doesn't make it OK to use math/rand in crypto sensitive +// environments - don't do that! However it does help to mitigate the +// problem if that happens accidentally. This would have helped with +// CVE-2020-28924 - #4783 +// +// As of Go 1.20 there is no reason to call math/rand.Seed with a +// random value as it is self seeded to a random 64 bit number so this +// does nothing. +func Seed() error { + return nil +} diff --git a/lib/random/random_seed_old.go b/lib/random/random_seed_old.go new file mode 100644 index 0000000000000..8fce03ec3b4c4 --- /dev/null +++ b/lib/random/random_seed_old.go @@ -0,0 +1,29 @@ +//go:build !go1.20 + +package random + +import ( + cryptorand "crypto/rand" + "encoding/binary" + "fmt" + mathrand "math/rand" +) + +// Seed the global math/rand with crypto strong data +// +// This doesn't make it OK to use math/rand in crypto sensitive +// environments - don't do that! However it does help to mitigate the +// problem if that happens accidentally. This would have helped with +// CVE-2020-28924 - #4783 +// +// As of Go 1.20 there is no reason to call math/rand.Seed with a +// random value as it is self seeded to a random 64 bit number. +func Seed() error { + var seed int64 + err := binary.Read(cryptorand.Reader, binary.LittleEndian, &seed) + if err != nil { + return fmt.Errorf("failed to read random seed: %w", err) + } + mathrand.Seed(seed) + return nil +} From d5d28a7513b0970196a5f99eb6a0856fa4ec09e6 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 22 Nov 2023 15:05:44 +0000 Subject: [PATCH 007/130] operations: fix overwrite of destination when multi-thread transfer fails Before this change, if a multithread upload failed (let's say the source became unavailable) rclone would finalise the file first before aborting the transfer. This caused the partial file to be written which would overwrite any existing files. This was fixed by making sure we Abort the transfer before Close-ing it. This updates the docs to encourage calling of Abort before Close and updates writerAtChunkWriter to make sure that works properly. This also reworks the tests to detect this and to make sure we upload and download to each multi-thread capable backend (we were only downloading before which isn't a full test). Fixes #7071 --- fs/features.go | 4 +- fs/operations/multithread.go | 25 +++- fs/operations/multithread_test.go | 222 +++++++++++++++++++++++++----- 3 files changed, 209 insertions(+), 42 deletions(-) diff --git a/fs/features.go b/fs/features.go index 991b0aceb4188..060c4cc37a4c8 100644 --- a/fs/features.go +++ b/fs/features.go @@ -664,10 +664,12 @@ type ChunkWriter interface { // WriteChunk will write chunk number with reader bytes, where chunk number >= 0 WriteChunk(ctx context.Context, chunkNumber int, reader io.ReadSeeker) (bytesWritten int64, err error) - // Close complete chunked writer + // Close complete chunked writer finalising the file. Close(ctx context.Context) error // Abort chunk write + // + // You can and should call Abort without calling Close. Abort(ctx context.Context) error } diff --git a/fs/operations/multithread.go b/fs/operations/multithread.go index d9e83be423d6f..46e66dfa40fa6 100644 --- a/fs/operations/multithread.go +++ b/fs/operations/multithread.go @@ -165,9 +165,10 @@ func multiThreadCopy(ctx context.Context, f fs.Fs, remote string, src fs.Object, uploadCtx, cancel := context.WithCancel(ctx) defer cancel() + uploadedOK := false defer atexit.OnError(&err, func() { cancel() - if info.LeavePartsOnError { + if info.LeavePartsOnError || uploadedOK { return } fs.Debugf(src, "multi-thread copy: cancelling transfer on exit") @@ -226,13 +227,14 @@ func multiThreadCopy(ctx context.Context, f fs.Fs, remote string, src fs.Object, } err = g.Wait() - closeErr := chunkWriter.Close(ctx) if err != nil { return nil, err } - if closeErr != nil { - return nil, fmt.Errorf("multi-thread copy: failed to close object after copy: %w", closeErr) + err = chunkWriter.Close(ctx) + if err != nil { + return nil, fmt.Errorf("multi-thread copy: failed to close object after copy: %w", err) } + uploadedOK = true // file is definitely uploaded OK so no need to abort obj, err := f.NewObject(ctx, remote) if err != nil { @@ -282,10 +284,11 @@ type writerAtChunkWriter struct { chunks int writeBufferSize int64 f fs.Fs + closed bool } // WriteChunk writes chunkNumber from reader -func (w writerAtChunkWriter) WriteChunk(ctx context.Context, chunkNumber int, reader io.ReadSeeker) (int64, error) { +func (w *writerAtChunkWriter) WriteChunk(ctx context.Context, chunkNumber int, reader io.ReadSeeker) (int64, error) { fs.Debugf(w.remote, "writing chunk %v", chunkNumber) bytesToWrite := w.chunkSize @@ -316,12 +319,20 @@ func (w writerAtChunkWriter) WriteChunk(ctx context.Context, chunkNumber int, re } // Close the chunk writing -func (w writerAtChunkWriter) Close(ctx context.Context) error { +func (w *writerAtChunkWriter) Close(ctx context.Context) error { + if w.closed { + return nil + } + w.closed = true return w.writerAt.Close() } // Abort the chunk writing -func (w writerAtChunkWriter) Abort(ctx context.Context) error { +func (w *writerAtChunkWriter) Abort(ctx context.Context) error { + err := w.Close(ctx) + if err != nil { + fs.Errorf(w.remote, "multi-thread copy: failed to close file before aborting: %v", err) + } obj, err := w.f.NewObject(ctx, w.remote) if err != nil { return fmt.Errorf("multi-thread copy: failed to find temp file when aborting chunk writer: %w", err) diff --git a/fs/operations/multithread_test.go b/fs/operations/multithread_test.go index cd5f430f8a9ab..a61f3433195b0 100644 --- a/fs/operations/multithread_test.go +++ b/fs/operations/multithread_test.go @@ -2,10 +2,16 @@ package operations import ( "context" + "errors" "fmt" + "io" + "sync" "testing" + "time" "github.com/rclone/rclone/fs/accounting" + "github.com/rclone/rclone/fs/hash" + "github.com/rclone/rclone/fs/object" "github.com/rclone/rclone/fstest/mockfs" "github.com/rclone/rclone/fstest/mockobject" "github.com/rclone/rclone/lib/random" @@ -108,45 +114,193 @@ func TestMultithreadCalculateNumChunks(t *testing.T) { } } +// Skip if not multithread, returning the chunkSize otherwise +func skipIfNotMultithread(ctx context.Context, t *testing.T, r *fstest.Run) int { + features := r.Fremote.Features() + if features.OpenChunkWriter == nil && features.OpenWriterAt == nil { + t.Skip("multithread writing not supported") + } + + // Only support one hash otherwise we end up spending a huge amount of CPU on hashing! + oldHashes := hash.SupportOnly([]hash.Type{r.Fremote.Hashes().GetOne()}) + t.Cleanup(func() { + _ = hash.SupportOnly(oldHashes) + }) + + ci := fs.GetConfig(ctx) + chunkSize := int(ci.MultiThreadChunkSize) + if features.OpenChunkWriter != nil { + //OpenChunkWriter func(ctx context.Context, remote string, src ObjectInfo, options ...OpenOption) (info ChunkWriterInfo, writer ChunkWriter, err error) + const fileName = "chunksize-probe" + src := object.NewStaticObjectInfo(fileName, time.Now(), int64(100*fs.Mebi), true, nil, nil) + info, writer, err := features.OpenChunkWriter(ctx, fileName, src) + require.NoError(t, err) + chunkSize = int(info.ChunkSize) + err = writer.Abort(ctx) + require.NoError(t, err) + } + return chunkSize +} + func TestMultithreadCopy(t *testing.T) { r := fstest.NewRun(t) ctx := context.Background() + chunkSize := skipIfNotMultithread(ctx, t, r) - for _, test := range []struct { - size int - streams int - }{ - {size: multithreadChunkSize*2 - 1, streams: 2}, - {size: multithreadChunkSize * 2, streams: 2}, - {size: multithreadChunkSize*2 + 1, streams: 2}, - } { - t.Run(fmt.Sprintf("%+v", test), func(t *testing.T) { - if *fstest.SizeLimit > 0 && int64(test.size) > *fstest.SizeLimit { - t.Skipf("exceeded file size limit %d > %d", test.size, *fstest.SizeLimit) + for _, upload := range []bool{false, true} { + for _, test := range []struct { + size int + streams int + }{ + {size: chunkSize*2 - 1, streams: 2}, + {size: chunkSize * 2, streams: 2}, + {size: chunkSize*2 + 1, streams: 2}, + } { + fileName := fmt.Sprintf("test-multithread-copy-%v-%d-%d", upload, test.size, test.streams) + t.Run(fmt.Sprintf("upload=%v,size=%v,streams=%v", upload, test.size, test.streams), func(t *testing.T) { + if *fstest.SizeLimit > 0 && int64(test.size) > *fstest.SizeLimit { + t.Skipf("exceeded file size limit %d > %d", test.size, *fstest.SizeLimit) + } + var ( + contents = random.String(test.size) + t1 = fstest.Time("2001-02-03T04:05:06.499999999Z") + file1 fstest.Item + src, dst fs.Object + err error + ) + + if upload { + file1 = r.WriteFile(fileName, contents, t1) + r.CheckRemoteItems(t) + r.CheckLocalItems(t, file1) + src, err = r.Flocal.NewObject(ctx, fileName) + } else { + file1 = r.WriteObject(ctx, fileName, contents, t1) + r.CheckRemoteItems(t, file1) + r.CheckLocalItems(t) + src, err = r.Fremote.NewObject(ctx, fileName) + } + require.NoError(t, err) + + accounting.GlobalStats().ResetCounters() + tr := accounting.GlobalStats().NewTransfer(src) + + defer func() { + tr.Done(ctx, err) + }() + + if upload { + dst, err = multiThreadCopy(ctx, r.Fremote, fileName, src, test.streams, tr) + } else { + dst, err = multiThreadCopy(ctx, r.Flocal, fileName, src, test.streams, tr) + } + + require.NoError(t, err) + assert.Equal(t, src.Size(), dst.Size()) + assert.Equal(t, fileName, dst.Remote()) + fstest.CheckListingWithPrecision(t, r.Fremote, []fstest.Item{file1}, nil, fs.GetModifyWindow(ctx, r.Flocal, r.Fremote)) + fstest.CheckListingWithPrecision(t, r.Flocal, []fstest.Item{file1}, nil, fs.GetModifyWindow(ctx, r.Flocal, r.Fremote)) + require.NoError(t, dst.Remove(ctx)) + require.NoError(t, src.Remove(ctx)) + }) + } + } +} + +type errorObject struct { + fs.Object + size int64 + wg *sync.WaitGroup +} + +// Open opens the file for read. Call Close() on the returned io.ReadCloser +// +// Remember this is called multiple times whenever the backend seeks (eg having read checksum) +func (o errorObject) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadCloser, error) { + fs.Debugf(nil, "Open with options = %v", options) + rc, err := o.Object.Open(ctx, options...) + if err != nil { + return nil, err + } + // Return an error reader for the second segment + for _, option := range options { + if ropt, ok := option.(*fs.RangeOption); ok { + end := ropt.End + 1 + if end >= o.size { + // Give the other chunks a chance to start + time.Sleep(time.Second) + // Wait for chunks to upload first + o.wg.Wait() + fs.Debugf(nil, "Returning error reader") + return errorReadCloser{rc}, nil } - var err error - contents := random.String(test.size) - t1 := fstest.Time("2001-02-03T04:05:06.499999999Z") - file1 := r.WriteObject(ctx, "file1", contents, t1) - r.CheckRemoteItems(t, file1) - r.CheckLocalItems(t) - - src, err := r.Fremote.NewObject(ctx, "file1") - require.NoError(t, err) - accounting.GlobalStats().ResetCounters() - tr := accounting.GlobalStats().NewTransfer(src) - - defer func() { - tr.Done(ctx, err) - }() - dst, err := multiThreadCopy(ctx, r.Flocal, "file1", src, 2, tr) - require.NoError(t, err) - assert.Equal(t, src.Size(), dst.Size()) - assert.Equal(t, "file1", dst.Remote()) - - fstest.CheckListingWithPrecision(t, r.Flocal, []fstest.Item{file1}, nil, fs.GetModifyWindow(ctx, r.Flocal, r.Fremote)) - require.NoError(t, dst.Remove(ctx)) - }) + } } + o.wg.Add(1) + return wgReadCloser{rc, o.wg}, nil +} + +type errorReadCloser struct { + io.ReadCloser +} + +func (rc errorReadCloser) Read(p []byte) (n int, err error) { + fs.Debugf(nil, "BOOM: simulated read failure") + return 0, errors.New("BOOM: simulated read failure") +} + +type wgReadCloser struct { + io.ReadCloser + wg *sync.WaitGroup +} + +func (rc wgReadCloser) Close() (err error) { + rc.wg.Done() + return rc.ReadCloser.Close() +} + +// Make sure aborting the multi-thread copy doesn't overwrite an existing file. +func TestMultithreadCopyAbort(t *testing.T) { + r := fstest.NewRun(t) + ctx := context.Background() + chunkSize := skipIfNotMultithread(ctx, t, r) + size := 2*chunkSize + 1 + if *fstest.SizeLimit > 0 && int64(size) > *fstest.SizeLimit { + t.Skipf("exceeded file size limit %d > %d", size, *fstest.SizeLimit) + } + + // first write a canary file which we are trying not to overwrite + const fileName = "test-multithread-abort" + contents := random.String(100) + t1 := fstest.Time("2001-02-03T04:05:06.499999999Z") + canary := r.WriteObject(ctx, fileName, contents, t1) + r.CheckRemoteItems(t, canary) + + // Now write a local file to upload + file1 := r.WriteFile(fileName, random.String(size), t1) + r.CheckLocalItems(t, file1) + + src, err := r.Flocal.NewObject(ctx, fileName) + require.NoError(t, err) + accounting.GlobalStats().ResetCounters() + tr := accounting.GlobalStats().NewTransfer(src) + + defer func() { + tr.Done(ctx, err) + }() + wg := new(sync.WaitGroup) + dst, err := multiThreadCopy(ctx, r.Fremote, fileName, errorObject{src, int64(size), wg}, 1, tr) + assert.Error(t, err) + assert.Nil(t, dst) + + if r.Fremote.Features().PartialUploads { + r.CheckRemoteItems(t) + + } else { + r.CheckRemoteItems(t, canary) + o, err := r.Fremote.NewObject(ctx, fileName) + require.NoError(t, err) + require.NoError(t, o.Remove(ctx)) + } } From c27977d4d5269ef0317edc13659718e09bcd7266 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 24 Nov 2023 12:36:48 +0000 Subject: [PATCH 008/130] fstest: factor chunked copy tests from b2 and use them in s3 and oos --- backend/b2/b2.go | 8 ++ backend/b2/b2_internal_test.go | 43 ---------- backend/b2/b2_test.go | 5 ++ .../oracleobjectstorage.go | 8 ++ .../oracleobjectstorage_test.go | 10 ++- backend/s3/s3.go | 8 ++ backend/s3/s3_test.go | 10 ++- fstest/fstests/fstests.go | 86 +++++++++++++++++++ 8 files changed, 133 insertions(+), 45 deletions(-) diff --git a/backend/b2/b2.go b/backend/b2/b2.go index 6c83c5895b79d..870a8178e2c7d 100644 --- a/backend/b2/b2.go +++ b/backend/b2/b2.go @@ -455,6 +455,14 @@ func (f *Fs) setUploadCutoff(cs fs.SizeSuffix) (old fs.SizeSuffix, err error) { return } +func (f *Fs) setCopyCutoff(cs fs.SizeSuffix) (old fs.SizeSuffix, err error) { + err = checkUploadChunkSize(cs) + if err == nil { + old, f.opt.CopyCutoff = f.opt.CopyCutoff, cs + } + return +} + // setRoot changes the root of the Fs func (f *Fs) setRoot(root string) { f.root = parsePath(root) diff --git a/backend/b2/b2_internal_test.go b/backend/b2/b2_internal_test.go index f5f0f33ff12b9..a2211fd8c07f8 100644 --- a/backend/b2/b2_internal_test.go +++ b/backend/b2/b2_internal_test.go @@ -178,48 +178,6 @@ func TestParseTimeString(t *testing.T) { } -// The integration tests do a reasonable job of testing the normal -// copy but don't test the chunked copy. -func (f *Fs) InternalTestChunkedCopy(t *testing.T) { - ctx := context.Background() - - contents := random.String(8 * 1024 * 1024) - item := fstest.NewItem("chunked-copy", contents, fstest.Time("2001-05-06T04:05:06.499999999Z")) - src := fstests.PutTestContents(ctx, t, f, &item, contents, true) - defer func() { - assert.NoError(t, src.Remove(ctx)) - }() - - var itemCopy = item - itemCopy.Path += ".copy" - - // Set copy cutoff to mininum value so we make chunks - origCutoff := f.opt.CopyCutoff - f.opt.CopyCutoff = minChunkSize - defer func() { - f.opt.CopyCutoff = origCutoff - }() - - // Do the copy - dst, err := f.Copy(ctx, src, itemCopy.Path) - require.NoError(t, err) - defer func() { - assert.NoError(t, dst.Remove(ctx)) - }() - - // Check size - assert.Equal(t, src.Size(), dst.Size()) - - // Check modtime - srcModTime := src.ModTime(ctx) - dstModTime := dst.ModTime(ctx) - assert.True(t, srcModTime.Equal(dstModTime)) - - // Make sure contents are correct - gotContents := fstests.ReadObject(ctx, t, dst, -1) - assert.Equal(t, contents, gotContents) -} - // The integration tests do a reasonable job of testing the normal // streaming upload but don't test the chunked streaming upload. func (f *Fs) InternalTestChunkedStreamingUpload(t *testing.T, size int) { @@ -259,7 +217,6 @@ func (f *Fs) InternalTestChunkedStreamingUpload(t *testing.T, size int) { // -run TestIntegration/FsMkdir/FsPutFiles/Internal func (f *Fs) InternalTest(t *testing.T) { - t.Run("ChunkedCopy", f.InternalTestChunkedCopy) for _, size := range []fs.SizeSuffix{ minChunkSize - 1, minChunkSize, diff --git a/backend/b2/b2_test.go b/backend/b2/b2_test.go index 6437d2adc3799..43e28e5b1ab9c 100644 --- a/backend/b2/b2_test.go +++ b/backend/b2/b2_test.go @@ -28,7 +28,12 @@ func (f *Fs) SetUploadCutoff(cs fs.SizeSuffix) (fs.SizeSuffix, error) { return f.setUploadCutoff(cs) } +func (f *Fs) SetCopyCutoff(cs fs.SizeSuffix) (fs.SizeSuffix, error) { + return f.setCopyCutoff(cs) +} + var ( _ fstests.SetUploadChunkSizer = (*Fs)(nil) _ fstests.SetUploadCutoffer = (*Fs)(nil) + _ fstests.SetCopyCutoffer = (*Fs)(nil) ) diff --git a/backend/oracleobjectstorage/oracleobjectstorage.go b/backend/oracleobjectstorage/oracleobjectstorage.go index e1cc2980d6e83..2133ebc09dec4 100644 --- a/backend/oracleobjectstorage/oracleobjectstorage.go +++ b/backend/oracleobjectstorage/oracleobjectstorage.go @@ -138,6 +138,14 @@ func (f *Fs) setUploadCutoff(cs fs.SizeSuffix) (old fs.SizeSuffix, err error) { return } +func (f *Fs) setCopyCutoff(cs fs.SizeSuffix) (old fs.SizeSuffix, err error) { + err = checkUploadChunkSize(cs) + if err == nil { + old, f.opt.CopyCutoff = f.opt.CopyCutoff, cs + } + return +} + // ------------------------------------------------------------ // Implement backed that represents a remote object storage server // Fs is the interface a cloud storage system must provide diff --git a/backend/oracleobjectstorage/oracleobjectstorage_test.go b/backend/oracleobjectstorage/oracleobjectstorage_test.go index 479da7b5ba9f7..daccfaeed1cf5 100644 --- a/backend/oracleobjectstorage/oracleobjectstorage_test.go +++ b/backend/oracleobjectstorage/oracleobjectstorage_test.go @@ -30,4 +30,12 @@ func (f *Fs) SetUploadCutoff(cs fs.SizeSuffix) (fs.SizeSuffix, error) { return f.setUploadCutoff(cs) } -var _ fstests.SetUploadChunkSizer = (*Fs)(nil) +func (f *Fs) SetCopyCutoff(cs fs.SizeSuffix) (fs.SizeSuffix, error) { + return f.setCopyCutoff(cs) +} + +var ( + _ fstests.SetUploadChunkSizer = (*Fs)(nil) + _ fstests.SetUploadCutoffer = (*Fs)(nil) + _ fstests.SetCopyCutoffer = (*Fs)(nil) +) diff --git a/backend/s3/s3.go b/backend/s3/s3.go index bb4e97c61dd4e..42526100e775d 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -3011,6 +3011,14 @@ func (f *Fs) setUploadCutoff(cs fs.SizeSuffix) (old fs.SizeSuffix, err error) { return } +func (f *Fs) setCopyCutoff(cs fs.SizeSuffix) (old fs.SizeSuffix, err error) { + err = checkUploadChunkSize(cs) + if err == nil { + old, f.opt.CopyCutoff = f.opt.CopyCutoff, cs + } + return +} + // setEndpointValueForIDriveE2 gets user region endpoint against the Access Key details by calling the API func setEndpointValueForIDriveE2(m configmap.Mapper) (err error) { value, ok := m.Get(fs.ConfigProvider) diff --git a/backend/s3/s3_test.go b/backend/s3/s3_test.go index 2cec88185be87..3415bebf2eef9 100644 --- a/backend/s3/s3_test.go +++ b/backend/s3/s3_test.go @@ -47,4 +47,12 @@ func (f *Fs) SetUploadCutoff(cs fs.SizeSuffix) (fs.SizeSuffix, error) { return f.setUploadCutoff(cs) } -var _ fstests.SetUploadChunkSizer = (*Fs)(nil) +func (f *Fs) SetCopyCutoff(cs fs.SizeSuffix) (fs.SizeSuffix, error) { + return f.setCopyCutoff(cs) +} + +var ( + _ fstests.SetUploadChunkSizer = (*Fs)(nil) + _ fstests.SetUploadCutoffer = (*Fs)(nil) + _ fstests.SetCopyCutoffer = (*Fs)(nil) +) diff --git a/fstest/fstests/fstests.go b/fstest/fstests/fstests.go index 9ffbca3c755c7..700aad41a9202 100644 --- a/fstest/fstests/fstests.go +++ b/fstest/fstests/fstests.go @@ -78,6 +78,13 @@ type SetUploadCutoffer interface { SetUploadCutoff(fs.SizeSuffix) (fs.SizeSuffix, error) } +// SetCopyCutoffer is a test only interface to change the copy cutoff size at runtime +type SetCopyCutoffer interface { + // Change the configured CopyCutoff. + // Will only be called while no transfer is in progress. + SetCopyCutoff(fs.SizeSuffix) (fs.SizeSuffix, error) +} + // NextPowerOfTwo returns the current or next bigger power of two. // All values less or equal 0 will return 0 func NextPowerOfTwo(i fs.SizeSuffix) fs.SizeSuffix { @@ -2096,6 +2103,85 @@ func Run(t *testing.T, opt *Opt) { } }) + // Copy files with chunked copy if available + t.Run("FsCopyChunked", func(t *testing.T) { + skipIfNotOk(t) + if testing.Short() { + t.Skip("not running with -short") + } + + // Check have Copy + doCopy := f.Features().Copy + if doCopy == nil { + t.Skip("FS has no Copier interface") + } + + if opt.ChunkedUpload.Skip { + t.Skip("skipping as ChunkedUpload.Skip is set") + } + + do, _ := f.(SetCopyCutoffer) + if do == nil { + t.Skipf("%T does not implement SetCopyCutoff", f) + } + + minChunkSize := opt.ChunkedUpload.MinChunkSize + if minChunkSize < 100 { + minChunkSize = 100 + } + if opt.ChunkedUpload.CeilChunkSize != nil { + minChunkSize = opt.ChunkedUpload.CeilChunkSize(minChunkSize) + } + + chunkSizes := fs.SizeSuffixList{ + minChunkSize, + minChunkSize + 1, + 2*minChunkSize - 1, + 2 * minChunkSize, + 2*minChunkSize + 1, + } + for _, chunkSize := range chunkSizes { + t.Run(fmt.Sprintf("%d", chunkSize), func(t *testing.T) { + contents := random.String(int(chunkSize)) + item := fstest.NewItem("chunked-copy", contents, fstest.Time("2001-05-06T04:05:06.499999999Z")) + src := PutTestContents(ctx, t, f, &item, contents, true) + defer func() { + assert.NoError(t, src.Remove(ctx)) + }() + + var itemCopy = item + itemCopy.Path += ".copy" + + // Set copy cutoff to mininum value so we make chunks + origCutoff, err := do.SetCopyCutoff(minChunkSize) + require.NoError(t, err) + defer func() { + _, err = do.SetCopyCutoff(origCutoff) + require.NoError(t, err) + }() + + // Do the copy + dst, err := doCopy(ctx, src, itemCopy.Path) + require.NoError(t, err) + defer func() { + assert.NoError(t, dst.Remove(ctx)) + }() + + // Check size + assert.Equal(t, src.Size(), dst.Size()) + + // Check modtime + srcModTime := src.ModTime(ctx) + dstModTime := dst.ModTime(ctx) + assert.True(t, srcModTime.Equal(dstModTime)) + + // Make sure contents are correct + gotContents := ReadObject(ctx, t, dst, -1) + assert.Equal(t, contents, gotContents) + }) + } + }) + // TestFsUploadUnknownSize ensures Fs.Put() and Object.Update() don't panic when // src.Size() == -1 // From fabeb8e44e5f6c64736957a8c03661d1bf7590f4 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 24 Nov 2023 12:35:35 +0000 Subject: [PATCH 009/130] b2: fix server side chunked copy when file size was exactly --b2-copy-cutoff Before this change the b2 servers would complain as this was only a single part transfer. This was noticed by the new integration tests for server side chunked copy. --- backend/b2/b2.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/b2/b2.go b/backend/b2/b2.go index 870a8178e2c7d..778d856f187df 100644 --- a/backend/b2/b2.go +++ b/backend/b2/b2.go @@ -1338,7 +1338,7 @@ func (f *Fs) CleanUp(ctx context.Context) error { // If newInfo is nil then the metadata will be copied otherwise it // will be replaced with newInfo func (f *Fs) copy(ctx context.Context, dstObj *Object, srcObj *Object, newInfo *api.File) (err error) { - if srcObj.size >= int64(f.opt.CopyCutoff) { + if srcObj.size > int64(f.opt.CopyCutoff) { if newInfo == nil { newInfo, err = srcObj.getMetaData(ctx) if err != nil { From cc2a4c2e20a57360dce39f7a2f8ff872b9325b7e Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 24 Nov 2023 12:58:40 +0000 Subject: [PATCH 010/130] fstest: factor chunked streaming tests from b2 and use in all backends --- backend/b2/b2_internal_test.go | 57 +--------------------------------- fstest/fstests/fstests.go | 32 +++++++++++++++++-- 2 files changed, 30 insertions(+), 59 deletions(-) diff --git a/backend/b2/b2_internal_test.go b/backend/b2/b2_internal_test.go index a2211fd8c07f8..8253ca167754c 100644 --- a/backend/b2/b2_internal_test.go +++ b/backend/b2/b2_internal_test.go @@ -1,19 +1,11 @@ package b2 import ( - "bytes" - "context" - "fmt" "testing" "time" - "github.com/rclone/rclone/fs" - "github.com/rclone/rclone/fs/object" "github.com/rclone/rclone/fstest" "github.com/rclone/rclone/fstest/fstests" - "github.com/rclone/rclone/lib/random" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) // Test b2 string encoding @@ -178,56 +170,9 @@ func TestParseTimeString(t *testing.T) { } -// The integration tests do a reasonable job of testing the normal -// streaming upload but don't test the chunked streaming upload. -func (f *Fs) InternalTestChunkedStreamingUpload(t *testing.T, size int) { - ctx := context.Background() - contents := random.String(size) - item := fstest.NewItem(fmt.Sprintf("chunked-streaming-upload-%d", size), contents, fstest.Time("2001-05-06T04:05:06.499Z")) - - // Set chunk size to mininum value so we make chunks - origOpt := f.opt - f.opt.ChunkSize = minChunkSize - f.opt.UploadCutoff = 0 - defer func() { - f.opt = origOpt - }() - - // Do the streaming upload - src := object.NewStaticObjectInfo(item.Path, item.ModTime, -1, true, item.Hashes, f) - in := bytes.NewBufferString(contents) - dst, err := f.PutStream(ctx, in, src) - require.NoError(t, err) - defer func() { - assert.NoError(t, dst.Remove(ctx)) - }() - - // Check size - assert.Equal(t, int64(size), dst.Size()) - - // Check modtime - srcModTime := src.ModTime(ctx) - dstModTime := dst.ModTime(ctx) - assert.Equal(t, srcModTime, dstModTime) - - // Make sure contents are correct - gotContents := fstests.ReadObject(ctx, t, dst, -1) - assert.Equal(t, contents, gotContents, "Contents incorrect") -} - // -run TestIntegration/FsMkdir/FsPutFiles/Internal func (f *Fs) InternalTest(t *testing.T) { - for _, size := range []fs.SizeSuffix{ - minChunkSize - 1, - minChunkSize, - minChunkSize + 1, - (3 * minChunkSize) / 2, - (5 * minChunkSize) / 2, - } { - t.Run(fmt.Sprintf("ChunkedStreamingUpload/%d", size), func(t *testing.T) { - f.InternalTestChunkedStreamingUpload(t, int(size)) - }) - } + // Internal tests go here } var _ fstests.InternalTester = (*Fs)(nil) diff --git a/fstest/fstests/fstests.go b/fstest/fstests/fstests.go index 700aad41a9202..0eae78fd3138a 100644 --- a/fstest/fstests/fstests.go +++ b/fstest/fstests/fstests.go @@ -230,8 +230,10 @@ func testPutMimeType(ctx context.Context, t *testing.T, f fs.Fs, file *fstest.It return contents, PutTestContentsMetadata(ctx, t, f, file, contents, true, mimeType, metadata) } -// TestPutLarge puts file to the remote, checks it and removes it on success. -func TestPutLarge(ctx context.Context, t *testing.T, f fs.Fs, file *fstest.Item) { +// testPutLarge puts file to the remote, checks it and removes it on success. +// +// If stream is set, then it uploads the file with size -1 +func testPutLarge(ctx context.Context, t *testing.T, f fs.Fs, file *fstest.Item, stream bool) { var ( err error obj fs.Object @@ -242,7 +244,11 @@ func TestPutLarge(ctx context.Context, t *testing.T, f fs.Fs, file *fstest.Item) uploadHash = hash.NewMultiHasher() in := io.TeeReader(r, uploadHash) - obji := object.NewStaticObjectInfo(file.Path, file.ModTime, file.Size, true, nil, nil) + size := file.Size + if stream { + size = -1 + } + obji := object.NewStaticObjectInfo(file.Path, file.ModTime, size, true, nil, nil) obj, err = f.Put(ctx, in, obji) if file.Size == 0 && err == fs.ErrorCantUploadEmptyFiles { t.Skip("Can't upload zero length files") @@ -270,6 +276,16 @@ func TestPutLarge(ctx context.Context, t *testing.T, f fs.Fs, file *fstest.Item) require.NoError(t, obj.Remove(ctx)) } +// TestPutLarge puts file to the remote, checks it and removes it on success. +func TestPutLarge(ctx context.Context, t *testing.T, f fs.Fs, file *fstest.Item) { + testPutLarge(ctx, t, f, file, false) +} + +// TestPutLargeStreamed puts file of unknown size to the remote, checks it and removes it on success. +func TestPutLargeStreamed(ctx context.Context, t *testing.T, f fs.Fs, file *fstest.Item) { + testPutLarge(ctx, t, f, file, true) +} + // ReadObject reads the contents of an object as a string func ReadObject(ctx context.Context, t *testing.T, obj fs.Object, limit int64, options ...fs.OpenOption) string { what := fmt.Sprintf("readObject(%q) limit=%d, options=%+v", obj, limit, options) @@ -2097,6 +2113,16 @@ func Run(t *testing.T, opt *Opt) { Path: fmt.Sprintf("chunked-%s-%s.bin", cs.String(), fileSize.String()), Size: int64(fileSize), }) + t.Run("Streamed", func(t *testing.T) { + if f.Features().PutStream == nil { + t.Skip("FS has no PutStream interface") + } + TestPutLargeStreamed(ctx, t, f, &fstest.Item{ + ModTime: fstest.Time("2001-02-03T04:05:06.499999999Z"), + Path: fmt.Sprintf("chunked-%s-%s-streamed.bin", cs.String(), fileSize.String()), + Size: int64(fileSize), + }) + }) }) } }) From 8f47b6746d0b81bb597ad330cb700559f1674fbc Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 24 Nov 2023 14:30:46 +0000 Subject: [PATCH 011/130] b2: fix streaming chunked files an exact multiple of chunk size Before this change, streaming files an exact multiple of the chunk size would cause rclone to attempt to stream a 0 sized chunk which was rejected by the b2 servers. This bug was noticed by the new integration tests for chunked streaming. --- backend/b2/upload.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/b2/upload.go b/backend/b2/upload.go index ef01023479b35..777852b1a502f 100644 --- a/backend/b2/upload.go +++ b/backend/b2/upload.go @@ -417,7 +417,13 @@ func (up *largeUpload) Stream(ctx context.Context, initialUploadBlock *pool.RW) } else { n, err = io.CopyN(rw, up.in, up.chunkSize) if err == io.EOF { - fs.Debugf(up.o, "Read less than a full chunk, making this the last one.") + if n == 0 { + fs.Debugf(up.o, "Not sending empty chunk after EOF - ending.") + up.f.putRW(rw) + break + } else { + fs.Debugf(up.o, "Read less than a full chunk %d, making this the last one.", n) + } hasMoreParts = false } else if err != nil { // other kinds of errors indicate failure From d8855b21ebd72734c960964c164979ca1947796e Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 24 Nov 2023 15:49:33 +0000 Subject: [PATCH 012/130] serve s3: document multipart copy doesn't work #7454 This puts in a workaround for the tests also --- cmd/serve/s3/s3_test.go | 2 +- cmd/serve/s3/serve_s3.md | 15 +++++++++++++-- fstest/fstests/fstests.go | 4 ++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/cmd/serve/s3/s3_test.go b/cmd/serve/s3/s3_test.go index a28e9929e2de0..2622d5fbcd0f0 100644 --- a/cmd/serve/s3/s3_test.go +++ b/cmd/serve/s3/s3_test.go @@ -113,7 +113,7 @@ func RunS3UnitTests(t *testing.T, name string, start servetest.StartFn) { if *fstest.Verbose { args = append(args, "-verbose") } - remoteName := name + "test:" + remoteName := "serve" + name + ":" args = append(args, "-remote", remoteName) args = append(args, "-run", "^TestIntegration$") args = append(args, "-list-retries", fmt.Sprint(*fstest.ListRetries)) diff --git a/cmd/serve/s3/serve_s3.md b/cmd/serve/s3/serve_s3.md index c74b7bf435de7..65445ff1cea61 100644 --- a/cmd/serve/s3/serve_s3.md +++ b/cmd/serve/s3/serve_s3.md @@ -55,8 +55,19 @@ Note that setting `disable_multipart_uploads = true` is to work around ### Bugs When uploading multipart files `serve s3` holds all the parts in -memory. This is a limitaton of the library rclone uses for serving S3 -and will hopefully be fixed at some point. +memory (see [#7453](https://github.com/rclone/rclone/issues/7453)). +This is a limitaton of the library rclone uses for serving S3 and will +hopefully be fixed at some point. + +Multipart server side copies do not work (see +[#7454](https://github.com/rclone/rclone/issues/7454)). These take a +very long time and eventually fail. The default threshold for +multipart server side copies is 5G which is the maximum it can be, so +files above this side will fail to be server side copied. + +For a current list of `serve s3` bugs see the [serve +s3](https://github.com/rclone/rclone/labels/serve%20s3) bug category +on GitHub. ### Limitations diff --git a/fstest/fstests/fstests.go b/fstest/fstests/fstests.go index 0eae78fd3138a..80cc712c71cff 100644 --- a/fstest/fstests/fstests.go +++ b/fstest/fstests/fstests.go @@ -2146,6 +2146,10 @@ func Run(t *testing.T, opt *Opt) { t.Skip("skipping as ChunkedUpload.Skip is set") } + if strings.HasPrefix(f.Name(), "serves3") { + t.Skip("FIXME skip test - see #7454") + } + do, _ := f.(SetCopyCutoffer) if do == nil { t.Skipf("%T does not implement SetCopyCutoff", f) From 4eed3ae99ad6c0fdd7609ac0c85bcccdc179fb1f Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 24 Nov 2023 16:32:06 +0000 Subject: [PATCH 013/130] s3: ensure we can set upload cutoff that we use for Rclone provider This is a workaround to make the new multipart upload integration tests pass. --- backend/s3/s3.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/s3/s3.go b/backend/s3/s3.go index 42526100e775d..8f690b38dc1f8 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -3004,7 +3004,9 @@ func checkUploadCutoff(cs fs.SizeSuffix) error { } func (f *Fs) setUploadCutoff(cs fs.SizeSuffix) (old fs.SizeSuffix, err error) { - err = checkUploadCutoff(cs) + if f.opt.Provider != "Rclone" { + err = checkUploadCutoff(cs) + } if err == nil { old, f.opt.UploadCutoff = f.opt.UploadCutoff, cs } From fd2322cb41d6e06882c23b8ffac2ef992853b813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=A0=E7=9F=A5=E9=81=93=E6=9C=AA=E6=9D=A5=E5=90=97?= Date: Sat, 25 Nov 2023 01:53:33 +0800 Subject: [PATCH 014/130] fs/fshttp: fix --contimeout being ignored The following command will block for 60s(default) when the network is slow or unavailable: ``` rclone --contimeout 10s --low-level-retries 0 lsd dropbox: ``` This change will make it timeout after the expected 10s. Signed-off-by: rkonfj --- fs/fshttp/dialer.go | 4 ---- fs/fshttp/http.go | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/fs/fshttp/dialer.go b/fs/fshttp/dialer.go index a41b478b8f767..a8ff67bc6c758 100644 --- a/fs/fshttp/dialer.go +++ b/fs/fshttp/dialer.go @@ -14,10 +14,6 @@ import ( "golang.org/x/net/ipv6" ) -func dialContext(ctx context.Context, network, address string, ci *fs.ConfigInfo) (net.Conn, error) { - return NewDialer(ctx).DialContext(ctx, network, address) -} - // Dialer structure contains default dialer and timeout, tclass support type Dialer struct { net.Dialer diff --git a/fs/fshttp/http.go b/fs/fshttp/http.go index f17c8298ec6a6..498714dfd30c9 100644 --- a/fs/fshttp/http.go +++ b/fs/fshttp/http.go @@ -91,8 +91,8 @@ func NewTransportCustom(ctx context.Context, customize func(*http.Transport)) ht } t.DisableCompression = ci.NoGzip - t.DialContext = func(ctx context.Context, network, addr string) (net.Conn, error) { - return dialContext(ctx, network, addr, ci) + t.DialContext = func(reqCtx context.Context, network, addr string) (net.Conn, error) { + return NewDialer(ctx).DialContext(reqCtx, network, addr) } t.IdleConnTimeout = 60 * time.Second t.ExpectContinueTimeout = ci.ExpectContinueTimeout From 36eb3cd6601825816f6850445f7cc4674e826c02 Mon Sep 17 00:00:00 2001 From: Abhinav Dhiman <8640877+ahnv@users.noreply.github.com> Date: Fri, 24 Nov 2023 23:48:01 +0530 Subject: [PATCH 015/130] imagekit: Added ImageKit backend --- backend/all/all.go | 1 + backend/imagekit/client/client.go | 66 +++ backend/imagekit/client/media.go | 252 +++++++++ backend/imagekit/client/upload.go | 96 ++++ backend/imagekit/client/url.go | 72 +++ backend/imagekit/imagekit.go | 828 ++++++++++++++++++++++++++++++ backend/imagekit/imagekit_test.go | 18 + backend/imagekit/util.go | 193 +++++++ bin/make_manual.py | 1 + docs/content/imagekit.md | 205 ++++++++ fstest/test_all/config.yaml | 3 + go.mod | 1 + go.sum | 2 + 13 files changed, 1738 insertions(+) create mode 100644 backend/imagekit/client/client.go create mode 100644 backend/imagekit/client/media.go create mode 100644 backend/imagekit/client/upload.go create mode 100644 backend/imagekit/client/url.go create mode 100644 backend/imagekit/imagekit.go create mode 100644 backend/imagekit/imagekit_test.go create mode 100644 backend/imagekit/util.go create mode 100644 docs/content/imagekit.md diff --git a/backend/all/all.go b/backend/all/all.go index 85009d7359f0b..8afb991bba4cf 100644 --- a/backend/all/all.go +++ b/backend/all/all.go @@ -25,6 +25,7 @@ import ( _ "github.com/rclone/rclone/backend/hdfs" _ "github.com/rclone/rclone/backend/hidrive" _ "github.com/rclone/rclone/backend/http" + _ "github.com/rclone/rclone/backend/imagekit" _ "github.com/rclone/rclone/backend/internetarchive" _ "github.com/rclone/rclone/backend/jottacloud" _ "github.com/rclone/rclone/backend/koofr" diff --git a/backend/imagekit/client/client.go b/backend/imagekit/client/client.go new file mode 100644 index 0000000000000..2b10c669d047d --- /dev/null +++ b/backend/imagekit/client/client.go @@ -0,0 +1,66 @@ +// Package client provides a client for interacting with the ImageKit API. +package client + +import ( + "context" + "fmt" + + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/fshttp" + "github.com/rclone/rclone/lib/rest" +) + +// ImageKit main struct +type ImageKit struct { + Prefix string + UploadPrefix string + Timeout int64 + UploadTimeout int64 + PrivateKey string + PublicKey string + URLEndpoint string + HTTPClient *rest.Client +} + +// NewParams is a struct to define parameters to imagekit +type NewParams struct { + PrivateKey string + PublicKey string + URLEndpoint string +} + +// New returns ImageKit object from environment variables +func New(ctx context.Context, params NewParams) (*ImageKit, error) { + + privateKey := params.PrivateKey + publicKey := params.PublicKey + endpointURL := params.URLEndpoint + + switch { + case privateKey == "": + return nil, fmt.Errorf("ImageKit.io URL endpoint is required") + case publicKey == "": + return nil, fmt.Errorf("ImageKit.io public key is required") + case endpointURL == "": + return nil, fmt.Errorf("ImageKit.io private key is required") + } + + cliCtx, cliCfg := fs.AddConfig(ctx) + + cliCfg.UserAgent = "rclone/imagekit" + client := rest.NewClient(fshttp.NewClient(cliCtx)) + + client.SetUserPass(privateKey, "") + client.SetHeader("Accept", "application/json") + + return &ImageKit{ + Prefix: "https://api.imagekit.io/v2", + UploadPrefix: "https://upload.imagekit.io/api/v2", + Timeout: 60, + UploadTimeout: 3600, + PrivateKey: params.PrivateKey, + PublicKey: params.PublicKey, + URLEndpoint: params.URLEndpoint, + HTTPClient: client, + }, nil +} diff --git a/backend/imagekit/client/media.go b/backend/imagekit/client/media.go new file mode 100644 index 0000000000000..d495b713b152e --- /dev/null +++ b/backend/imagekit/client/media.go @@ -0,0 +1,252 @@ +package client + +import ( + "context" + "errors" + "fmt" + "net/http" + "net/url" + "time" + + "github.com/rclone/rclone/lib/rest" + "gopkg.in/validator.v2" +) + +// FilesOrFolderParam struct is a parameter type to ListFiles() function to search / list media library files. +type FilesOrFolderParam struct { + Path string `json:"path,omitempty"` + Limit int `json:"limit,omitempty"` + Skip int `json:"skip,omitempty"` + SearchQuery string `json:"searchQuery,omitempty"` +} + +// AITag represents an AI tag for a media library file. +type AITag struct { + Name string `json:"name"` + Confidence float32 `json:"confidence"` + Source string `json:"source"` +} + +// File represents media library File details. +type File struct { + FileID string `json:"fileId"` + Name string `json:"name"` + FilePath string `json:"filePath"` + Type string `json:"type"` + VersionInfo map[string]string `json:"versionInfo"` + IsPrivateFile *bool `json:"isPrivateFile"` + CustomCoordinates *string `json:"customCoordinates"` + URL string `json:"url"` + Thumbnail string `json:"thumbnail"` + FileType string `json:"fileType"` + Mime string `json:"mime"` + Height int `json:"height"` + Width int `json:"Width"` + Size uint64 `json:"size"` + HasAlpha bool `json:"hasAlpha"` + CustomMetadata map[string]any `json:"customMetadata,omitempty"` + EmbeddedMetadata map[string]any `json:"embeddedMetadata"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` + Tags []string `json:"tags"` + AITags []AITag `json:"AITags"` +} + +// Folder represents media library Folder details. +type Folder struct { + *File + FolderPath string `json:"folderPath"` +} + +// CreateFolderParam represents parameter to create folder api +type CreateFolderParam struct { + FolderName string `validate:"nonzero" json:"folderName"` + ParentFolderPath string `validate:"nonzero" json:"parentFolderPath"` +} + +// DeleteFolderParam represents parameter to delete folder api +type DeleteFolderParam struct { + FolderPath string `validate:"nonzero" json:"folderPath"` +} + +// MoveFolderParam represents parameter to move folder api +type MoveFolderParam struct { + SourceFolderPath string `validate:"nonzero" json:"sourceFolderPath"` + DestinationPath string `validate:"nonzero" json:"destinationPath"` +} + +// JobIDResponse respresents response struct with JobID for folder operations +type JobIDResponse struct { + JobID string `json:"jobId"` +} + +// JobStatus represents response Data to job status api +type JobStatus struct { + JobID string `json:"jobId"` + Type string `json:"type"` + Status string `json:"status"` +} + +// File represents media library File details. +func (ik *ImageKit) File(ctx context.Context, fileID string) (*http.Response, *File, error) { + data := &File{} + response, err := ik.HTTPClient.CallJSON(ctx, &rest.Opts{ + Method: "GET", + Path: fmt.Sprintf("/files/%s/details", fileID), + RootURL: ik.Prefix, + IgnoreStatus: true, + }, nil, data) + + return response, data, err +} + +// Files retrieves media library files. Filter options can be supplied as FilesOrFolderParam. +func (ik *ImageKit) Files(ctx context.Context, params FilesOrFolderParam, includeVersion bool) (*http.Response, *[]File, error) { + var SearchQuery = `type = "file"` + + if includeVersion { + SearchQuery = `type IN ["file", "file-version"]` + } + if params.SearchQuery != "" { + SearchQuery = params.SearchQuery + } + + parameters := url.Values{} + + parameters.Set("skip", fmt.Sprintf("%d", params.Skip)) + parameters.Set("limit", fmt.Sprintf("%d", params.Limit)) + parameters.Set("path", params.Path) + parameters.Set("searchQuery", SearchQuery) + + data := &[]File{} + + response, err := ik.HTTPClient.CallJSON(ctx, &rest.Opts{ + Method: "GET", + Path: "/files", + RootURL: ik.Prefix, + Parameters: parameters, + }, nil, data) + + return response, data, err +} + +// DeleteFile removes file by FileID from media library +func (ik *ImageKit) DeleteFile(ctx context.Context, fileID string) (*http.Response, error) { + var err error + + if fileID == "" { + return nil, errors.New("fileID can not be empty") + } + + response, err := ik.HTTPClient.CallJSON(ctx, &rest.Opts{ + Method: "DELETE", + Path: fmt.Sprintf("/files/%s", fileID), + RootURL: ik.Prefix, + NoResponse: true, + }, nil, nil) + + return response, err +} + +// Folders retrieves media library files. Filter options can be supplied as FilesOrFolderParam. +func (ik *ImageKit) Folders(ctx context.Context, params FilesOrFolderParam) (*http.Response, *[]Folder, error) { + var SearchQuery = `type = "folder"` + + if params.SearchQuery != "" { + SearchQuery = params.SearchQuery + } + + parameters := url.Values{} + + parameters.Set("skip", fmt.Sprintf("%d", params.Skip)) + parameters.Set("limit", fmt.Sprintf("%d", params.Limit)) + parameters.Set("path", params.Path) + parameters.Set("searchQuery", SearchQuery) + + data := &[]Folder{} + + resp, err := ik.HTTPClient.CallJSON(ctx, &rest.Opts{ + Method: "GET", + Path: "/files", + RootURL: ik.Prefix, + Parameters: parameters, + }, nil, data) + + if err != nil { + return resp, data, err + } + + return resp, data, err +} + +// CreateFolder creates a new folder in media library +func (ik *ImageKit) CreateFolder(ctx context.Context, param CreateFolderParam) (*http.Response, error) { + var err error + + if err = validator.Validate(¶m); err != nil { + return nil, err + } + + response, err := ik.HTTPClient.CallJSON(ctx, &rest.Opts{ + Method: "POST", + Path: "/folder", + RootURL: ik.Prefix, + NoResponse: true, + }, param, nil) + + return response, err +} + +// DeleteFolder removes the folder from media library +func (ik *ImageKit) DeleteFolder(ctx context.Context, param DeleteFolderParam) (*http.Response, error) { + var err error + + if err = validator.Validate(¶m); err != nil { + return nil, err + } + + response, err := ik.HTTPClient.CallJSON(ctx, &rest.Opts{ + Method: "DELETE", + Path: "/folder", + RootURL: ik.Prefix, + NoResponse: true, + }, param, nil) + + return response, err +} + +// MoveFolder moves given folder to new path in media library +func (ik *ImageKit) MoveFolder(ctx context.Context, param MoveFolderParam) (*http.Response, *JobIDResponse, error) { + var err error + var response = &JobIDResponse{} + + if err = validator.Validate(¶m); err != nil { + return nil, nil, err + } + + resp, err := ik.HTTPClient.CallJSON(ctx, &rest.Opts{ + Method: "PUT", + Path: "bulkJobs/moveFolder", + RootURL: ik.Prefix, + }, param, response) + + return resp, response, err +} + +// BulkJobStatus retrieves the status of a bulk job by job ID. +func (ik *ImageKit) BulkJobStatus(ctx context.Context, jobID string) (*http.Response, *JobStatus, error) { + var err error + var response = &JobStatus{} + + if jobID == "" { + return nil, nil, errors.New("jobId can not be blank") + } + + resp, err := ik.HTTPClient.CallJSON(ctx, &rest.Opts{ + Method: "GET", + Path: "bulkJobs/" + jobID, + RootURL: ik.Prefix, + }, nil, response) + + return resp, response, err +} diff --git a/backend/imagekit/client/upload.go b/backend/imagekit/client/upload.go new file mode 100644 index 0000000000000..7964f8c460349 --- /dev/null +++ b/backend/imagekit/client/upload.go @@ -0,0 +1,96 @@ +package client + +import ( + "context" + "errors" + "fmt" + "io" + "net/http" + "net/url" + + "github.com/rclone/rclone/lib/rest" +) + +// UploadParam defines upload parameters +type UploadParam struct { + FileName string `json:"fileName"` + Folder string `json:"folder,omitempty"` // default value: / + Tags string `json:"tags,omitempty"` + IsPrivateFile *bool `json:"isPrivateFile,omitempty"` // default: false +} + +// UploadResult defines the response structure for the upload API +type UploadResult struct { + FileID string `json:"fileId"` + Name string `json:"name"` + URL string `json:"url"` + ThumbnailURL string `json:"thumbnailUrl"` + Height int `json:"height"` + Width int `json:"Width"` + Size uint64 `json:"size"` + FilePath string `json:"filePath"` + AITags []map[string]any `json:"AITags"` + VersionInfo map[string]string `json:"versionInfo"` +} + +// Upload uploads an asset to a imagekit account. +// +// The asset can be: +// - the actual data (io.Reader) +// - the Data URI (Base64 encoded), max ~60 MB (62,910,000 chars) +// - the remote FTP, HTTP or HTTPS URL address of an existing file +// +// https://docs.imagekit.io/api-reference/upload-file-api/server-side-file-upload +func (ik *ImageKit) Upload(ctx context.Context, file io.Reader, param UploadParam) (*http.Response, *UploadResult, error) { + var err error + + if param.FileName == "" { + return nil, nil, errors.New("Upload: Filename is required") + } + + // Initialize URL values + formParams := url.Values{} + + formParams.Add("useUniqueFileName", fmt.Sprint(false)) + + // Add individual fields to URL values + if param.FileName != "" { + formParams.Add("fileName", param.FileName) + } + + if param.Tags != "" { + formParams.Add("tags", param.Tags) + } + + if param.Folder != "" { + formParams.Add("folder", param.Folder) + } + + if param.IsPrivateFile != nil { + formParams.Add("isPrivateFile", fmt.Sprintf("%v", *param.IsPrivateFile)) + } + + response := &UploadResult{} + + formReader, contentType, _, err := rest.MultipartUpload(ctx, file, formParams, "file", param.FileName) + + if err != nil { + return nil, nil, fmt.Errorf("failed to make multipart upload: %w", err) + } + + opts := rest.Opts{ + Method: "POST", + Path: "/files/upload", + RootURL: ik.UploadPrefix, + Body: formReader, + ContentType: contentType, + } + + resp, err := ik.HTTPClient.CallJSON(ctx, &opts, nil, response) + + if err != nil { + return resp, response, err + } + + return resp, response, err +} diff --git a/backend/imagekit/client/url.go b/backend/imagekit/client/url.go new file mode 100644 index 0000000000000..4589c525ddc67 --- /dev/null +++ b/backend/imagekit/client/url.go @@ -0,0 +1,72 @@ +package client + +import ( + "crypto/hmac" + "crypto/sha1" + "encoding/hex" + "fmt" + neturl "net/url" + "strconv" + "strings" + "time" +) + +// URLParam represents parameters for generating url +type URLParam struct { + Path string + Src string + URLEndpoint string + Signed bool + ExpireSeconds int64 + QueryParameters map[string]string +} + +// URL generates url from URLParam +func (ik *ImageKit) URL(params URLParam) (string, error) { + var resultURL string + var url *neturl.URL + var err error + var endpoint = params.URLEndpoint + + if endpoint == "" { + endpoint = ik.URLEndpoint + } + + endpoint = strings.TrimRight(endpoint, "/") + "/" + + if params.QueryParameters == nil { + params.QueryParameters = make(map[string]string) + } + + if url, err = neturl.Parse(params.Src); err != nil { + return "", err + } + + query := url.Query() + + for k, v := range params.QueryParameters { + query.Set(k, v) + } + url.RawQuery = query.Encode() + resultURL = url.String() + + if params.Signed { + now := time.Now().Unix() + + var expires = strconv.FormatInt(now+params.ExpireSeconds, 10) + var path = strings.Replace(resultURL, endpoint, "", 1) + + path = path + expires + mac := hmac.New(sha1.New, []byte(ik.PrivateKey)) + mac.Write([]byte(path)) + signature := hex.EncodeToString(mac.Sum(nil)) + + if strings.Contains(resultURL, "?") { + resultURL = resultURL + "&" + fmt.Sprintf("ik-t=%s&ik-s=%s", expires, signature) + } else { + resultURL = resultURL + "?" + fmt.Sprintf("ik-t=%s&ik-s=%s", expires, signature) + } + } + + return resultURL, nil +} diff --git a/backend/imagekit/imagekit.go b/backend/imagekit/imagekit.go new file mode 100644 index 0000000000000..02b35bb941f4b --- /dev/null +++ b/backend/imagekit/imagekit.go @@ -0,0 +1,828 @@ +// Package imagekit provides an interface to the ImageKit.io media library. +package imagekit + +import ( + "context" + "errors" + "fmt" + "io" + "math" + "net/http" + "path" + "strconv" + "strings" + "time" + + "github.com/rclone/rclone/backend/imagekit/client" + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/config" + "github.com/rclone/rclone/fs/config/configmap" + "github.com/rclone/rclone/fs/config/configstruct" + "github.com/rclone/rclone/fs/hash" + "github.com/rclone/rclone/lib/encoder" + "github.com/rclone/rclone/lib/pacer" + "github.com/rclone/rclone/lib/readers" + "github.com/rclone/rclone/lib/version" +) + +const ( + minSleep = 1 * time.Millisecond + maxSleep = 100 * time.Millisecond + decayConstant = 2 +) + +var systemMetadataInfo = map[string]fs.MetadataHelp{ + "btime": { + Help: "Time of file birth (creation) read from Last-Modified header", + Type: "RFC 3339", + Example: "2006-01-02T15:04:05.999999999Z07:00", + ReadOnly: true, + }, + "size": { + Help: "Size of the object in bytes", + Type: "int64", + ReadOnly: true, + }, + "file-type": { + Help: "Type of the file", + Type: "string", + Example: "image", + ReadOnly: true, + }, + "height": { + Help: "Height of the image or video in pixels", + Type: "int", + ReadOnly: true, + }, + "width": { + Help: "Width of the image or video in pixels", + Type: "int", + ReadOnly: true, + }, + "has-alpha": { + Help: "Whether the image has alpha channel or not", + Type: "bool", + ReadOnly: true, + }, + "tags": { + Help: "Tags associated with the file", + Type: "string", + Example: "tag1,tag2", + ReadOnly: true, + }, + "google-tags": { + Help: "AI generated tags by Google Cloud Vision associated with the image", + Type: "string", + Example: "tag1,tag2", + ReadOnly: true, + }, + "aws-tags": { + Help: "AI generated tags by AWS Rekognition associated with the image", + Type: "string", + Example: "tag1,tag2", + ReadOnly: true, + }, + "is-private-file": { + Help: "Whether the file is private or not", + Type: "bool", + ReadOnly: true, + }, + "custom-coordinates": { + Help: "Custom coordinates of the file", + Type: "string", + Example: "0,0,100,100", + ReadOnly: true, + }, +} + +// Register with Fs +func init() { + fs.Register(&fs.RegInfo{ + Name: "imagekit", + Description: "ImageKit.io", + NewFs: NewFs, + MetadataInfo: &fs.MetadataInfo{ + System: systemMetadataInfo, + Help: `Any metadata supported by the underlying remote is read and written.`, + }, + Options: []fs.Option{ + { + Name: "endpoint", + Help: "You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys)", + Required: true, + }, + { + Name: "public_key", + Help: "You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys)", + Required: true, + Sensitive: true, + }, + { + Name: "private_key", + Help: "You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys)", + Required: true, + Sensitive: true, + }, + { + Name: "only_signed", + Help: "If you have configured `Restrict unsigned image URLs` in your dashboard settings, set this to true.", + Default: false, + Advanced: true, + }, + { + Name: "versions", + Help: "Include old versions in directory listings.", + Default: false, + Advanced: true, + }, + { + Name: "upload_tags", + Help: "Tags to add to the uploaded files, e.g. \"tag1,tag2\".", + Default: "", + Advanced: true, + }, + { + Name: config.ConfigEncoding, + Help: config.ConfigEncodingHelp, + Advanced: true, + Default: (encoder.EncodeZero | + encoder.EncodeSlash | + encoder.EncodeQuestion | + encoder.EncodeHashPercent | + encoder.EncodeCtl | + encoder.EncodeDel | + encoder.EncodeDot | + encoder.EncodeDoubleQuote | + encoder.EncodePercent | + encoder.EncodeBackSlash | + encoder.EncodeDollar | + encoder.EncodeLtGt | + encoder.EncodeSquareBracket | + encoder.EncodeInvalidUtf8), + }, + }, + }) +} + +// Options defines the configuration for this backend +type Options struct { + Endpoint string `config:"endpoint"` + PublicKey string `config:"public_key"` + PrivateKey string `config:"private_key"` + OnlySigned bool `config:"only_signed"` + Versions bool `config:"versions"` + Enc encoder.MultiEncoder `config:"encoding"` +} + +// Fs represents a remote to ImageKit +type Fs struct { + name string // name of remote + root string // root path + opt Options // parsed options + features *fs.Features // optional features + ik *client.ImageKit // ImageKit client + pacer *fs.Pacer // pacer for API calls +} + +// Object describes a ImageKit file +type Object struct { + fs *Fs // The Fs this object is part of + remote string // The remote path + filePath string // The path to the file + contentType string // The content type of the object if known - may be "" + timestamp time.Time // The timestamp of the object if known - may be zero + file client.File // The media file if known - may be nil + versionID string // If present this points to an object version +} + +// NewFs constructs an Fs from the path, container:path +func NewFs(ctx context.Context, name string, root string, m configmap.Mapper) (fs.Fs, error) { + opt := new(Options) + err := configstruct.Set(m, opt) + + if err != nil { + return nil, err + } + + ik, err := client.New(ctx, client.NewParams{ + URLEndpoint: opt.Endpoint, + PublicKey: opt.PublicKey, + PrivateKey: opt.PrivateKey, + }) + + if err != nil { + return nil, err + } + + f := &Fs{ + name: name, + opt: *opt, + ik: ik, + pacer: fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(minSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant))), + } + + f.root = path.Join("/", root) + + f.features = (&fs.Features{ + CaseInsensitive: false, + DuplicateFiles: false, + ReadMimeType: true, + WriteMimeType: false, + CanHaveEmptyDirectories: true, + BucketBased: false, + ServerSideAcrossConfigs: false, + IsLocal: false, + SlowHash: true, + ReadMetadata: true, + WriteMetadata: false, + UserMetadata: false, + FilterAware: true, + PartialUploads: false, + NoMultiThreading: false, + }).Fill(ctx, f) + + if f.root != "/" { + + r := f.root + + folderPath := f.EncodePath(r[:strings.LastIndex(r, "/")+1]) + fileName := f.EncodeFileName(r[strings.LastIndex(r, "/")+1:]) + + file := f.getFileByName(ctx, folderPath, fileName) + + if file != nil { + newRoot := path.Dir(f.root) + f.root = newRoot + return f, fs.ErrorIsFile + } + + } + return f, nil +} + +// Name of the remote (as passed into NewFs) +func (f *Fs) Name() string { + return f.name +} + +// Root of the remote (as passed into NewFs) +func (f *Fs) Root() string { + return strings.TrimLeft(f.root, "/") +} + +// String returns a description of the FS +func (f *Fs) String() string { + return fmt.Sprintf("FS imagekit: %s", f.root) +} + +// Precision of the ModTimes in this Fs +func (f *Fs) Precision() time.Duration { + return fs.ModTimeNotSupported +} + +// Hashes returns the supported hash types of the filesystem. +func (f *Fs) Hashes() hash.Set { + return hash.NewHashSet() +} + +// Features returns the optional features of this Fs. +func (f *Fs) Features() *fs.Features { + return f.features +} + +// List the objects and directories in dir into entries. The +// entries can be returned in any order but should be for a +// complete directory. +// +// dir should be "" to list the root, and should not have +// trailing slashes. +// +// This should return ErrDirNotFound if the directory isn't +// found. +func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err error) { + + remote := path.Join(f.root, dir) + + remote = f.EncodePath(remote) + + if remote != "/" { + parentFolderPath, folderName := path.Split(remote) + folderExists, err := f.getFolderByName(ctx, parentFolderPath, folderName) + + if err != nil { + return make(fs.DirEntries, 0), err + } + + if folderExists == nil { + return make(fs.DirEntries, 0), fs.ErrorDirNotFound + } + } + + folders, folderError := f.getFolders(ctx, remote) + + if folderError != nil { + return make(fs.DirEntries, 0), folderError + } + + files, fileError := f.getFiles(ctx, remote, f.opt.Versions) + + if fileError != nil { + return make(fs.DirEntries, 0), fileError + } + + res := make([]fs.DirEntry, 0, len(folders)+len(files)) + + for _, folder := range folders { + folderPath := f.DecodePath(strings.TrimLeft(strings.Replace(folder.FolderPath, f.EncodePath(f.root), "", 1), "/")) + res = append(res, fs.NewDir(folderPath, folder.UpdatedAt)) + } + + for _, file := range files { + res = append(res, f.newObject(ctx, remote, file)) + } + + return res, nil +} + +func (f *Fs) newObject(ctx context.Context, remote string, file client.File) *Object { + remoteFile := strings.TrimLeft(strings.Replace(file.FilePath, f.EncodePath(f.root), "", 1), "/") + + folderPath, fileName := path.Split(remoteFile) + + folderPath = f.DecodePath(folderPath) + fileName = f.DecodeFileName(fileName) + + remoteFile = path.Join(folderPath, fileName) + + if file.Type == "file-version" { + remoteFile = version.Add(remoteFile, file.UpdatedAt) + + return &Object{ + fs: f, + remote: remoteFile, + filePath: file.FilePath, + contentType: file.Mime, + timestamp: file.UpdatedAt, + file: file, + versionID: file.VersionInfo["id"], + } + } + + return &Object{ + fs: f, + remote: remoteFile, + filePath: file.FilePath, + contentType: file.Mime, + timestamp: file.UpdatedAt, + file: file, + } +} + +// NewObject finds the Object at remote. If it can't be found +// it returns the error ErrorObjectNotFound. +// +// If remote points to a directory then it should return +// ErrorIsDir if possible without doing any extra work, +// otherwise ErrorObjectNotFound. +func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error) { + r := path.Join(f.root, remote) + + folderPath, fileName := path.Split(r) + + folderPath = f.EncodePath(folderPath) + fileName = f.EncodeFileName(fileName) + + isFolder, err := f.getFolderByName(ctx, folderPath, fileName) + + if err != nil { + return nil, err + } + + if isFolder != nil { + return nil, fs.ErrorIsDir + } + + file := f.getFileByName(ctx, folderPath, fileName) + + if file == nil { + return nil, fs.ErrorObjectNotFound + } + + return f.newObject(ctx, r, *file), nil +} + +// Put in to the remote path with the modTime given of the given size +// +// When called from outside an Fs by rclone, src.Size() will always be >= 0. +// But for unknown-sized objects (indicated by src.Size() == -1), Put should either +// return an error or upload it properly (rather than e.g. calling panic). +// +// May create the object even if it returns an error - if so +// will return the object and the error, otherwise will return +// nil and the error +func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { + return uploadFile(ctx, f, in, src.Remote(), options...) +} + +// Mkdir makes the directory (container, bucket) +// +// Shouldn't return an error if it already exists +func (f *Fs) Mkdir(ctx context.Context, dir string) (err error) { + remote := path.Join(f.root, dir) + parentFolderPath, folderName := path.Split(remote) + + parentFolderPath = f.EncodePath(parentFolderPath) + folderName = f.EncodeFileName(folderName) + + err = f.pacer.Call(func() (bool, error) { + var res *http.Response + res, err = f.ik.CreateFolder(ctx, client.CreateFolderParam{ + ParentFolderPath: parentFolderPath, + FolderName: folderName, + }) + + return f.shouldRetry(ctx, res, err) + }) + + return err +} + +// Rmdir removes the directory (container, bucket) if empty +// +// Return an error if it doesn't exist or isn't empty +func (f *Fs) Rmdir(ctx context.Context, dir string) (err error) { + + entries, err := f.List(ctx, dir) + + if err != nil { + return err + } + + if len(entries) > 0 { + return errors.New("directory is not empty") + } + + err = f.pacer.Call(func() (bool, error) { + var res *http.Response + res, err = f.ik.DeleteFolder(ctx, client.DeleteFolderParam{ + FolderPath: f.EncodePath(path.Join(f.root, dir)), + }) + + if res.StatusCode == http.StatusNotFound { + return false, fs.ErrorDirNotFound + } + + return f.shouldRetry(ctx, res, err) + }) + + return err +} + +// Purge deletes all the files and the container +// +// Optional interface: Only implement this if you have a way of +// deleting all the files quicker than just running Remove() on the +// result of List() +func (f *Fs) Purge(ctx context.Context, dir string) (err error) { + + remote := path.Join(f.root, dir) + + err = f.pacer.Call(func() (bool, error) { + var res *http.Response + res, err = f.ik.DeleteFolder(ctx, client.DeleteFolderParam{ + FolderPath: f.EncodePath(remote), + }) + + if res.StatusCode == http.StatusNotFound { + return false, fs.ErrorDirNotFound + } + + return f.shouldRetry(ctx, res, err) + }) + + return err +} + +// PublicLink generates a public link to the remote path (usually readable by anyone) +func (f *Fs) PublicLink(ctx context.Context, remote string, expire fs.Duration, unlink bool) (string, error) { + + duration := time.Duration(math.Abs(float64(expire))) + + expireSeconds := duration.Seconds() + + fileRemote := path.Join(f.root, remote) + + folderPath, fileName := path.Split(fileRemote) + folderPath = f.EncodePath(folderPath) + fileName = f.EncodeFileName(fileName) + + file := f.getFileByName(ctx, folderPath, fileName) + + if file == nil { + return "", fs.ErrorObjectNotFound + } + + // Pacer not needed as this doesn't use the API + url, err := f.ik.URL(client.URLParam{ + Src: file.URL, + Signed: *file.IsPrivateFile || f.opt.OnlySigned, + ExpireSeconds: int64(expireSeconds), + QueryParameters: map[string]string{ + "updatedAt": file.UpdatedAt.String(), + }, + }) + + if err != nil { + return "", err + } + + return url, nil +} + +// Fs returns read only access to the Fs that this object is part of +func (o *Object) Fs() fs.Info { + return o.fs +} + +// Hash returns the selected checksum of the file +// If no checksum is available it returns "" +func (o *Object) Hash(ctx context.Context, ty hash.Type) (string, error) { + return "", hash.ErrUnsupported +} + +// Storable says whether this object can be stored +func (o *Object) Storable() bool { + return true +} + +// String returns a description of the Object +func (o *Object) String() string { + if o == nil { + return "" + } + return o.file.Name +} + +// Remote returns the remote path +func (o *Object) Remote() string { + return o.remote +} + +// ModTime returns the modification date of the file +// It should return a best guess if one isn't available +func (o *Object) ModTime(context.Context) time.Time { + return o.file.UpdatedAt +} + +// Size returns the size of the file +func (o *Object) Size() int64 { + return int64(o.file.Size) +} + +// MimeType returns the MIME type of the file +func (o *Object) MimeType(context.Context) string { + return o.contentType +} + +// Open opens the file for read. Call Close() on the returned io.ReadCloser +func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadCloser, error) { + // Offset and Count for range download + var offset int64 + var count int64 + + fs.FixRangeOption(options, -1) + partialContent := false + for _, option := range options { + switch x := option.(type) { + case *fs.RangeOption: + offset, count = x.Decode(-1) + partialContent = true + case *fs.SeekOption: + offset = x.Offset + partialContent = true + default: + if option.Mandatory() { + fs.Logf(o, "Unsupported mandatory option: %v", option) + } + } + } + + // Pacer not needed as this doesn't use the API + url, err := o.fs.ik.URL(client.URLParam{ + Src: o.file.URL, + Signed: *o.file.IsPrivateFile || o.fs.opt.OnlySigned, + QueryParameters: map[string]string{ + "tr": "orig-true", + "updatedAt": o.file.UpdatedAt.String(), + }, + }) + + if err != nil { + return nil, err + } + + client := &http.Client{} + req, _ := http.NewRequest("GET", url, nil) + req.Header.Set("Range", fmt.Sprintf("bytes=%d-%d", offset, offset+count-1)) + resp, err := client.Do(req) + + if err != nil { + return nil, err + } + + end := resp.ContentLength + + if partialContent && resp.StatusCode == http.StatusOK { + skip := offset + + if offset < 0 { + skip = end + offset + 1 + } + + _, err = io.CopyN(io.Discard, resp.Body, skip) + if err != nil { + if resp != nil { + _ = resp.Body.Close() + } + return nil, err + } + + return readers.NewLimitedReadCloser(resp.Body, end-skip), nil + } + + return resp.Body, nil +} + +// Update in to the object with the modTime given of the given size +// +// When called from outside an Fs by rclone, src.Size() will always be >= 0. +// But for unknown-sized objects (indicated by src.Size() == -1), Upload should either +// return an error or update the object properly (rather than e.g. calling panic). +func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { + + srcRemote := o.Remote() + + remote := path.Join(o.fs.root, srcRemote) + folderPath, fileName := path.Split(remote) + + UseUniqueFileName := new(bool) + *UseUniqueFileName = false + + var resp *client.UploadResult + + err = o.fs.pacer.Call(func() (bool, error) { + var res *http.Response + res, resp, err = o.fs.ik.Upload(ctx, in, client.UploadParam{ + FileName: fileName, + Folder: folderPath, + IsPrivateFile: o.file.IsPrivateFile, + }) + + return o.fs.shouldRetry(ctx, res, err) + }) + + if err != nil { + return err + } + + fileID := resp.FileID + + _, file, err := o.fs.ik.File(ctx, fileID) + + if err != nil { + return err + } + + o.file = *file + + return nil +} + +// Remove this object +func (o *Object) Remove(ctx context.Context) (err error) { + err = o.fs.pacer.Call(func() (bool, error) { + var res *http.Response + res, err = o.fs.ik.DeleteFile(ctx, o.file.FileID) + + return o.fs.shouldRetry(ctx, res, err) + }) + + return err +} + +// SetModTime sets the metadata on the object to set the modification date +func (o *Object) SetModTime(ctx context.Context, t time.Time) error { + return fs.ErrorCantSetModTime +} + +func uploadFile(ctx context.Context, f *Fs, in io.Reader, srcRemote string, options ...fs.OpenOption) (fs.Object, error) { + remote := path.Join(f.root, srcRemote) + folderPath, fileName := path.Split(remote) + + folderPath = f.EncodePath(folderPath) + fileName = f.EncodeFileName(fileName) + + UseUniqueFileName := new(bool) + *UseUniqueFileName = false + + err := f.pacer.Call(func() (bool, error) { + var res *http.Response + var err error + res, _, err = f.ik.Upload(ctx, in, client.UploadParam{ + FileName: fileName, + Folder: folderPath, + IsPrivateFile: &f.opt.OnlySigned, + }) + + return f.shouldRetry(ctx, res, err) + }) + + if err != nil { + return nil, err + } + + return f.NewObject(ctx, srcRemote) +} + +// Metadata returns the metadata for the object +func (o *Object) Metadata(ctx context.Context) (metadata fs.Metadata, err error) { + + metadata.Set("btime", o.file.CreatedAt.Format(time.RFC3339)) + metadata.Set("size", strconv.FormatUint(o.file.Size, 10)) + metadata.Set("file-type", o.file.FileType) + metadata.Set("height", strconv.Itoa(o.file.Height)) + metadata.Set("width", strconv.Itoa(o.file.Width)) + metadata.Set("has-alpha", strconv.FormatBool(o.file.HasAlpha)) + + for k, v := range o.file.EmbeddedMetadata { + metadata.Set(k, fmt.Sprint(v)) + } + + if o.file.Tags != nil { + metadata.Set("tags", strings.Join(o.file.Tags, ",")) + } + + if o.file.CustomCoordinates != nil { + metadata.Set("custom-coordinates", *o.file.CustomCoordinates) + } + + if o.file.IsPrivateFile != nil { + metadata.Set("is-private-file", strconv.FormatBool(*o.file.IsPrivateFile)) + } + + if o.file.AITags != nil { + googleTags := []string{} + awsTags := []string{} + + for _, tag := range o.file.AITags { + if tag.Source == "google-auto-tagging" { + googleTags = append(googleTags, tag.Name) + } else if tag.Source == "aws-auto-tagging" { + awsTags = append(awsTags, tag.Name) + } + } + + if len(googleTags) > 0 { + metadata.Set("google-tags", strings.Join(googleTags, ",")) + } + + if len(awsTags) > 0 { + metadata.Set("aws-tags", strings.Join(awsTags, ",")) + } + } + + return metadata, nil +} + +// Copy src to this remote using server-side move operations. +// +// This is stored with the remote path given. +// +// It returns the destination Object and a possible error. +// +// Will only be called if src.Fs().Name() == f.Name() +// +// If it isn't possible then return fs.ErrorCantMove +func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, error) { + srcObj, ok := src.(*Object) + if !ok { + return nil, fs.ErrorCantMove + } + + file, err := srcObj.Open(ctx) + + if err != nil { + return nil, err + } + + return uploadFile(ctx, f, file, remote) +} + +// Check the interfaces are satisfied. +var ( + _ fs.Fs = &Fs{} + _ fs.Purger = &Fs{} + _ fs.PublicLinker = &Fs{} + _ fs.Object = &Object{} + _ fs.Copier = &Fs{} +) diff --git a/backend/imagekit/imagekit_test.go b/backend/imagekit/imagekit_test.go new file mode 100644 index 0000000000000..686976322e116 --- /dev/null +++ b/backend/imagekit/imagekit_test.go @@ -0,0 +1,18 @@ +package imagekit + +import ( + "testing" + + "github.com/rclone/rclone/fstest" + "github.com/rclone/rclone/fstest/fstests" +) + +func TestIntegration(t *testing.T) { + debug := true + fstest.Verbose = &debug + fstests.Run(t, &fstests.Opt{ + RemoteName: "TestImageKit:", + NilObject: (*Object)(nil), + SkipFsCheckWrap: true, + }) +} diff --git a/backend/imagekit/util.go b/backend/imagekit/util.go new file mode 100644 index 0000000000000..fea67f3ac1c14 --- /dev/null +++ b/backend/imagekit/util.go @@ -0,0 +1,193 @@ +package imagekit + +import ( + "context" + "fmt" + "net/http" + "strconv" + "time" + + "github.com/rclone/rclone/backend/imagekit/client" + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/fserrors" + "github.com/rclone/rclone/lib/pacer" +) + +func (f *Fs) getFiles(ctx context.Context, path string, includeVersions bool) (files []client.File, err error) { + + files = make([]client.File, 0) + + var hasMore = true + + for hasMore { + err = f.pacer.Call(func() (bool, error) { + var data *[]client.File + var res *http.Response + res, data, err = f.ik.Files(ctx, client.FilesOrFolderParam{ + Skip: len(files), + Limit: 100, + Path: path, + }, includeVersions) + + hasMore = !(len(*data) == 0 || len(*data) < 100) + + if len(*data) > 0 { + files = append(files, *data...) + } + + return f.shouldRetry(ctx, res, err) + }) + } + + if err != nil { + return make([]client.File, 0), err + } + + return files, nil +} + +func (f *Fs) getFolders(ctx context.Context, path string) (folders []client.Folder, err error) { + + folders = make([]client.Folder, 0) + + var hasMore = true + + for hasMore { + err = f.pacer.Call(func() (bool, error) { + var data *[]client.Folder + var res *http.Response + res, data, err = f.ik.Folders(ctx, client.FilesOrFolderParam{ + Skip: len(folders), + Limit: 100, + Path: path, + }) + + hasMore = !(len(*data) == 0 || len(*data) < 100) + + if len(*data) > 0 { + folders = append(folders, *data...) + } + + return f.shouldRetry(ctx, res, err) + }) + } + + if err != nil { + return make([]client.Folder, 0), err + } + + return folders, nil +} + +func (f *Fs) getFileByName(ctx context.Context, path string, name string) (file *client.File) { + + err := f.pacer.Call(func() (bool, error) { + res, data, err := f.ik.Files(ctx, client.FilesOrFolderParam{ + Limit: 1, + Path: path, + SearchQuery: fmt.Sprintf(`type = "file" AND name = %s`, strconv.Quote(name)), + }, false) + + if len(*data) == 0 { + file = nil + } else { + file = &(*data)[0] + } + + return f.shouldRetry(ctx, res, err) + }) + + if err != nil { + return nil + } + + return file +} + +func (f *Fs) getFolderByName(ctx context.Context, path string, name string) (folder *client.Folder, err error) { + err = f.pacer.Call(func() (bool, error) { + res, data, err := f.ik.Folders(ctx, client.FilesOrFolderParam{ + Limit: 1, + Path: path, + SearchQuery: fmt.Sprintf(`type = "folder" AND name = %s`, strconv.Quote(name)), + }) + + if len(*data) == 0 { + folder = nil + } else { + folder = &(*data)[0] + } + + return f.shouldRetry(ctx, res, err) + }) + + if err != nil { + return nil, err + } + + return folder, nil +} + +// retryErrorCodes is a slice of error codes that we will retry +var retryErrorCodes = []int{ + 401, // Unauthorized (e.g. "Token has expired") + 408, // Request Timeout + 429, // Rate exceeded. + 500, // Get occasional 500 Internal Server Error + 503, // Service Unavailable + 504, // Gateway Time-out +} + +func shouldRetryHTTP(resp *http.Response, retryErrorCodes []int) bool { + if resp == nil { + return false + } + for _, e := range retryErrorCodes { + if resp.StatusCode == e { + return true + } + } + return false +} + +func (f *Fs) shouldRetry(ctx context.Context, resp *http.Response, err error) (bool, error) { + if fserrors.ContextError(ctx, &err) { + return false, err + } + + if resp != nil && (resp.StatusCode == 429 || resp.StatusCode == 503) { + var retryAfter = 1 + retryAfterString := resp.Header.Get("X-RateLimit-Reset") + if retryAfterString != "" { + var err error + retryAfter, err = strconv.Atoi(retryAfterString) + if err != nil { + fs.Errorf(f, "Malformed %s header %q: %v", "X-RateLimit-Reset", retryAfterString, err) + } + } + + return true, pacer.RetryAfterError(err, time.Duration(retryAfter)*time.Millisecond) + } + + return fserrors.ShouldRetry(err) || shouldRetryHTTP(resp, retryErrorCodes), err +} + +// EncodePath encapsulates the logic for encoding a path +func (f *Fs) EncodePath(str string) string { + return f.opt.Enc.FromStandardPath(str) +} + +// DecodePath encapsulates the logic for decoding a path +func (f *Fs) DecodePath(str string) string { + return f.opt.Enc.ToStandardPath(str) +} + +// EncodeFileName encapsulates the logic for encoding a file name +func (f *Fs) EncodeFileName(str string) string { + return f.opt.Enc.FromStandardName(str) +} + +// DecodeFileName encapsulates the logic for decoding a file name +func (f *Fs) DecodeFileName(str string) string { + return f.opt.Enc.ToStandardName(str) +} diff --git a/bin/make_manual.py b/bin/make_manual.py index 9e8557cbf296f..9c5866325e587 100755 --- a/bin/make_manual.py +++ b/bin/make_manual.py @@ -50,6 +50,7 @@ "hdfs.md", "hidrive.md", "http.md", + "imagekit.md", "internetarchive.md", "jottacloud.md", "koofr.md", diff --git a/docs/content/imagekit.md b/docs/content/imagekit.md new file mode 100644 index 0000000000000..1f85db5526a64 --- /dev/null +++ b/docs/content/imagekit.md @@ -0,0 +1,205 @@ +--- +title: "ImageKit" +description: "Rclone docs for ImageKit backend." +versionIntroduced: "v1.63" + +--- +# {{< icon "fa fa-cloud" >}} ImageKit +This is a backend for the [ImageKit.io](https://imagekit.io/) storage service. + +#### About ImageKit +[ImageKit.io](https://imagekit.io/) provides real-time image and video optimizations, transformations, and CDN delivery. Over 1,000 businesses and 70,000 developers trust ImageKit with their images and videos on the web. + + +#### Accounts & Pricing + +To use this backend, you need to [create an account](https://imagekit.io/registration/) on ImageKit. Start with a free plan with generous usage limits. Then, as your requirements grow, upgrade to a plan that best fits your needs. See [the pricing details](https://imagekit.io/plans). + +## Configuration + +Here is an example of making an imagekit configuration. + +Firstly create a [ImageKit.io](https://imagekit.io/) account and choose a plan. + +You will need to log in and get the `publicKey` and `privateKey` for your account from the developer section. + +Now run +``` +rclone config +``` + +This will guide you through an interactive setup process: + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n + +Enter the name for the new remote. +name> imagekit-media-library + +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] +XX / ImageKit.io +\ (imagekit) +[snip] +Storage> imagekit + +Option endpoint. +You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) +Enter a value. +endpoint> https://ik.imagekit.io/imagekit_id + +Option public_key. +You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) +Enter a value. +public_key> public_**************************** + +Option private_key. +You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) +Enter a value. +private_key> private_**************************** + +Edit advanced config? +y) Yes +n) No (default) +y/n> n + +Configuration complete. +Options: +- type: imagekit +- endpoint: https://ik.imagekit.io/imagekit_id +- public_key: public_**************************** +- private_key: private_**************************** + +Keep this "imagekit-media-library" remote? +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` +List directories in the top level of your Media Library +``` +rclone lsd imagekit-media-library: +``` +Make a new directory. +``` +rclone mkdir imagekit-media-library:directory +``` +List the contents of a directory. +``` +rclone ls imagekit-media-library:directory +``` + +### Modified time and hashes + +ImageKit does not support modification times or hashes yet. + +### Checksums + +No checksums are supported. + +{{< rem autogenerated options start" - DO NOT EDIT - instead edit fs.RegInfo in backend/imagekit/imagekit.go then run make backenddocs" >}} +### Standard options + +Here are the Standard options specific to imagekit (ImageKit.io). + +#### --imagekit-endpoint + +You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + +Properties: + +- Config: endpoint +- Env Var: RCLONE_IMAGEKIT_ENDPOINT +- Type: string +- Required: true + +#### --imagekit-public-key + +You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + +Properties: + +- Config: public_key +- Env Var: RCLONE_IMAGEKIT_PUBLIC_KEY +- Type: string +- Required: true + +#### --imagekit-private-key + +You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + +Properties: + +- Config: private_key +- Env Var: RCLONE_IMAGEKIT_PRIVATE_KEY +- Type: string +- Required: true + +### Advanced options + +Here are the Advanced options specific to imagekit (ImageKit.io). + +#### --imagekit-only-signed + +If you have configured `Restrict unsigned image URLs` in your dashboard settings, set this to true. + +Properties: + +- Config: only_signed +- Env Var: RCLONE_IMAGEKIT_ONLY_SIGNED +- Type: bool +- Default: false + +#### --imagekit-versions + +Include old versions in directory listings. + +Properties: + +- Config: versions +- Env Var: RCLONE_IMAGEKIT_VERSIONS +- Type: bool +- Default: false + +#### --imagekit-encoding + +The encoding for the backend. + +See the [encoding section in the overview](/overview/#encoding) for more info. + +Properties: + +- Config: encoding +- Env Var: RCLONE_IMAGEKIT_ENCODING +- Type: Encoding +- Default: Slash,LtGt,DoubleQuote,Dollar,Question,Hash,Percent,BackSlash,Del,Ctl,InvalidUtf8,Dot,SquareBracket + +### Metadata + +Any metadata supported by the underlying remote is read and written. + +Here are the possible system metadata items for the imagekit backend. + +| Name | Help | Type | Example | Read Only | +|------|------|------|---------|-----------| +| aws-tags | AI generated tags by AWS Rekognition associated with the file | string | tag1,tag2 | **Y** | +| btime | Time of file birth (creation) read from Last-Modified header | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** | +| custom-coordinates | Custom coordinates of the file | string | 0,0,100,100 | **Y** | +| file-type | Type of the file | string | image | **Y** | +| google-tags | AI generated tags by Google Cloud Vision associated with the file | string | tag1,tag2 | **Y** | +| has-alpha | Whether the image has alpha channel or not | bool | | **Y** | +| height | Height of the image or video in pixels | int | | **Y** | +| is-private-file | Whether the file is private or not | bool | | **Y** | +| size | Size of the object in bytes | int64 | | **Y** | +| tags | Tags associated with the file | string | tag1,tag2 | **Y** | +| width | Width of the image or video in pixels | int | | **Y** | + +See the [metadata](/docs/#metadata) docs for more info. + +{{< rem autogenerated options stop >}} diff --git a/fstest/test_all/config.yaml b/fstest/test_all/config.yaml index 0e7f922fc9f61..153396f0a7b0c 100644 --- a/fstest/test_all/config.yaml +++ b/fstest/test_all/config.yaml @@ -148,6 +148,9 @@ backends: - backend: "hidrive" remote: "TestHiDrive:" fastlist: false + - backend: "imagekit" + remote: "TestImageKit:" + fastlist: false - backend: "internetarchive" remote: "TestIA:rclone-integration-test" fastlist: true diff --git a/go.mod b/go.mod index e63a50322773b..69f278a9918ef 100644 --- a/go.mod +++ b/go.mod @@ -79,6 +79,7 @@ require ( golang.org/x/text v0.13.0 golang.org/x/time v0.3.0 google.golang.org/api v0.148.0 + gopkg.in/validator.v2 v2.0.1 gopkg.in/yaml.v2 v2.4.0 storj.io/uplink v1.12.1 ) diff --git a/go.sum b/go.sum index 16017f64e6b15..43a8e313100f7 100644 --- a/go.sum +++ b/go.sum @@ -935,6 +935,8 @@ gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/validator.v2 v2.0.1 h1:xF0KWyGWXm/LM2G1TrEjqOu4pa6coO9AlWSf3msVfDY= +gopkg.in/validator.v2 v2.0.1/go.mod h1:lIUZBlB3Im4s/eYp39Ry/wkR02yOPhZ9IwIRBjuPuG8= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= From a10abf9934c3bec6d3e0daa8c22a361d513d6506 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 24 Nov 2023 20:46:52 +0000 Subject: [PATCH 016/130] =?UTF-8?q?Add=20=E4=BD=A0=E7=9F=A5=E9=81=93?= =?UTF-8?q?=E6=9C=AA=E6=9D=A5=E5=90=97=20to=20contributors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/content/authors.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/content/authors.md b/docs/content/authors.md index ffb586ea076ca..cc93ee34e19e8 100644 --- a/docs/content/authors.md +++ b/docs/content/authors.md @@ -803,3 +803,4 @@ put them back in again.` >}} * moongdal * Mina Galić * Alen Šiljak + * 你知道未来吗 From 9e62a74a2337eaf30c035eebde3336c19c959be2 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 24 Nov 2023 20:46:52 +0000 Subject: [PATCH 017/130] Add Abhinav Dhiman to contributors --- docs/content/authors.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/content/authors.md b/docs/content/authors.md index cc93ee34e19e8..447fac7b84d15 100644 --- a/docs/content/authors.md +++ b/docs/content/authors.md @@ -804,3 +804,4 @@ put them back in again.` >}} * Mina Galić * Alen Šiljak * 你知道未来吗 + * Abhinav Dhiman <8640877+ahnv@users.noreply.github.com> From e7c002adef57dd17da1bedec5cf71a3dd2f9b281 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 24 Nov 2023 17:08:04 +0000 Subject: [PATCH 018/130] test_all: make integration test for serve s3 --- fstest/fstests/fstests.go | 2 +- fstest/test_all/config.yaml | 3 +++ fstest/testserver/init.d/TestS3Rclone | 22 ++++++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100755 fstest/testserver/init.d/TestS3Rclone diff --git a/fstest/fstests/fstests.go b/fstest/fstests/fstests.go index 80cc712c71cff..7ab03dd60541d 100644 --- a/fstest/fstests/fstests.go +++ b/fstest/fstests/fstests.go @@ -2146,7 +2146,7 @@ func Run(t *testing.T, opt *Opt) { t.Skip("skipping as ChunkedUpload.Skip is set") } - if strings.HasPrefix(f.Name(), "serves3") { + if strings.HasPrefix(f.Name(), "serves3") || strings.HasPrefix(f.Name(), "TestS3Rclone") { t.Skip("FIXME skip test - see #7454") } diff --git a/fstest/test_all/config.yaml b/fstest/test_all/config.yaml index 153396f0a7b0c..0e79602aa772a 100644 --- a/fstest/test_all/config.yaml +++ b/fstest/test_all/config.yaml @@ -185,6 +185,9 @@ backends: - backend: "s3" remote: "TestS3,directory_markers:" fastlist: true + - backend: "s3" + remote: "TestS3Rclone:" + fastlist: true - backend: "s3" remote: "TestS3Minio:" fastlist: true diff --git a/fstest/testserver/init.d/TestS3Rclone b/fstest/testserver/init.d/TestS3Rclone new file mode 100755 index 0000000000000..13c94fc6021bc --- /dev/null +++ b/fstest/testserver/init.d/TestS3Rclone @@ -0,0 +1,22 @@ +#!/bin/bash + +set -e + +NAME=rclone-serve-s3 +ACCESS_KEY_ID=rclone +SECRET_ACCESS_KEY=JoltRogueVerde5 +IP=127.0.0.1 +PORT=28624 + +start() { + run rclone serve s3 --auth-key ${ACCESS_KEY_ID},${SECRET_ACCESS_KEY} --addr ${IP}:${PORT} ${DATADIR} + + echo type=s3 + echo provider=Rclone + echo endpoint=http://${IP}:${PORT}/ + echo access_key_id=${ACCESS_KEY_ID} + echo secret_access_key=${SECRET_ACCESS_KEY} + echo _connect=${IP}:${PORT} +} + +. $(dirname "$0")/rclone-serve.bash From aaa897337d19ebc2428f7fd233de536a4112f2be Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 24 Nov 2023 17:14:40 +0000 Subject: [PATCH 019/130] serve s3: fix error handling for listing non-existent prefix - fixes #7455 Before this change serve s3 would return NoSuchKey errors when a non existent prefix was listed. This change fixes it to return an empty list like AWS does. This was discovered by the full integration tests. --- cmd/serve/s3/backend.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/serve/s3/backend.go b/cmd/serve/s3/backend.go index 55c63ce1b5d45..305012f34eca2 100644 --- a/cmd/serve/s3/backend.go +++ b/cmd/serve/s3/backend.go @@ -84,7 +84,10 @@ func (b *s3Backend) ListBucket(bucket string, prefix *gofakes3.Prefix, page gofa err = b.entryListR(bucket, path, remaining, prefix.HasDelimiter, response) } - if err != nil { + if err == gofakes3.ErrNoSuchKey { + // AWS just returns an empty list + response = gofakes3.NewObjectList() + } else if err != nil { return nil, err } From 0244caf13adc5584bcde1356486b2cc8bfe7a433 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 24 Nov 2023 17:43:06 +0000 Subject: [PATCH 020/130] serve s3: fix overwrite of files with 0 length file Before this change overwriting an existing file with a 0 length file didn't update the file size. This change corrects the issue and makes sure the file is truncated properly. This was discovered by the full integration tests. --- cmd/serve/s3/backend.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cmd/serve/s3/backend.go b/cmd/serve/s3/backend.go index 305012f34eca2..397760102b40b 100644 --- a/cmd/serve/s3/backend.go +++ b/cmd/serve/s3/backend.go @@ -282,11 +282,6 @@ func (b *s3Backend) PutObject( } } - if size == 0 { - // maybe a touch operation - return b.TouchObject(fp, meta) - } - f, err := b.vfs.Create(fp) if err != nil { return result, err From edb5ccdd0b0e6915eaf6ed38dc5a8c55c6dd8adc Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 20 Nov 2023 16:34:07 +0000 Subject: [PATCH 021/130] smb: fix about size wrong by switching to github.com/cloudsoda/go-smb2/ fork Before this change smb drives sometimes showed a fraction of the correct size using `rclone about`. This fixes the problem by switching the upstream library from github.com/hirochachacha/go-smb2 to github.com/cloudsoda/go-smb2 which has a fix for the problem. The new library passes the integration tests. Fixes #6733 --- backend/smb/connpool.go | 2 +- go.mod | 3 +-- go.sum | 5 ++--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/backend/smb/connpool.go b/backend/smb/connpool.go index 5b8caef03f2e3..a34e84f291d73 100644 --- a/backend/smb/connpool.go +++ b/backend/smb/connpool.go @@ -6,7 +6,7 @@ import ( "net" "time" - smb2 "github.com/hirochachacha/go-smb2" + smb2 "github.com/cloudsoda/go-smb2" "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/accounting" "github.com/rclone/rclone/fs/config/obscure" diff --git a/go.mod b/go.mod index 69f278a9918ef..eb5d6ebfea15e 100644 --- a/go.mod +++ b/go.mod @@ -20,6 +20,7 @@ require ( github.com/atotto/clipboard v0.1.4 github.com/aws/aws-sdk-go v1.46.6 github.com/buengese/sgzip v0.1.1 + github.com/cloudsoda/go-smb2 v0.0.0-20231106205947-b0758ecc4c67 github.com/colinmarc/hdfs/v2 v2.4.0 github.com/coreos/go-semver v0.3.1 github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf @@ -33,7 +34,6 @@ require ( github.com/hanwen/go-fuse/v2 v2.4.0 github.com/henrybear327/Proton-API-Bridge v1.0.0 github.com/henrybear327/go-proton-api v1.0.0 - github.com/hirochachacha/go-smb2 v1.1.0 github.com/iguanesolutions/go-systemd/v5 v5.1.1 github.com/jcmturner/gokrb5/v8 v8.4.4 github.com/jlaffaye/ftp v0.2.0 @@ -88,7 +88,6 @@ require ( cloud.google.com/go/compute v1.23.2 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.4.0 // indirect - github.com/Azure/azure-sdk-for-go/sdk/storage/azfile v1.1.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.2.0 // indirect github.com/ProtonMail/bcrypt v0.0.0-20211005172633-e235017c1baf // indirect github.com/ProtonMail/gluon v0.17.1-0.20230724134000-308be39be96e // indirect diff --git a/go.sum b/go.sum index 43a8e313100f7..0196db684a53a 100644 --- a/go.sum +++ b/go.sum @@ -133,6 +133,8 @@ github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtM github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/circl v1.3.6 h1:/xbKIqSHbZXHwkhbrhrt2YOHIwYJlXH94E3tI/gDlUg= github.com/cloudflare/circl v1.3.6/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= +github.com/cloudsoda/go-smb2 v0.0.0-20231106205947-b0758ecc4c67 h1:KzZU0EMkUm4vX/jPp5d/VttocDpocL/8QP0zyiI9Xiw= +github.com/cloudsoda/go-smb2 v0.0.0-20231106205947-b0758ecc4c67/go.mod h1:xFxVVe3plxwhM+6BgTTPByEgG8hggo8+gtRUkbc5W8Q= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/colinmarc/hdfs/v2 v2.4.0 h1:v6R8oBx/Wu9fHpdPoJJjpGSUxo8NhHIwrwsfhFvU9W0= github.com/colinmarc/hdfs/v2 v2.4.0/go.mod h1:0NAO+/3knbMx6+5pCv+Hcbaz4xn/Zzbn9+WIib2rKVI= @@ -311,8 +313,6 @@ github.com/henrybear327/Proton-API-Bridge v1.0.0 h1:gjKAaWfKu++77WsZTHg6FUyPC5W0 github.com/henrybear327/Proton-API-Bridge v1.0.0/go.mod h1:gunH16hf6U74W2b9CGDaWRadiLICsoJ6KRkSt53zLts= github.com/henrybear327/go-proton-api v1.0.0 h1:zYi/IbjLwFAW7ltCeqXneUGJey0TN//Xo851a/BgLXw= github.com/henrybear327/go-proton-api v1.0.0/go.mod h1:w63MZuzufKcIZ93pwRgiOtxMXYafI8H74D77AxytOBc= -github.com/hirochachacha/go-smb2 v1.1.0 h1:b6hs9qKIql9eVXAiN0M2wSFY5xnhbHAQoCwRKbaRTZI= -github.com/hirochachacha/go-smb2 v1.1.0/go.mod h1:8F1A4d5EZzrGu5R7PU163UcMRDJQl4FtcxjBfsY8TZE= github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/iguanesolutions/go-systemd/v5 v5.1.1 h1:Hs0Z16knPGCBFnKECrICPh+RQ89Sgy0xyzcalrHMKdw= @@ -585,7 +585,6 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= From b5857f0bf82238ea0b4a0a63825d3dd9c893668e Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 25 Nov 2023 18:24:20 +0000 Subject: [PATCH 022/130] smb: fix modtime of multithread uploads by setting PartialUploads Before this change PartialUploads was not set. This is clearly wrong since incoming files are visible on the smb server. Setting PartialUploads fixes the multithread upload modtime problem as it uses the PartialUploads flag as an indication that it needs to set the modtime explicitly. This problem was detected by the new TestMultithreadCopy integration tests Fixes #7411 --- backend/smb/smb.go | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/smb/smb.go b/backend/smb/smb.go index 704c998f9b7e6..37ac065545a64 100644 --- a/backend/smb/smb.go +++ b/backend/smb/smb.go @@ -177,6 +177,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e CaseInsensitive: opt.CaseInsensitive, CanHaveEmptyDirectories: true, BucketBased: true, + PartialUploads: true, }).Fill(ctx, f) f.pacer = fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(minSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant))) From 74d5477fadfdd9f309d242894f39f6fa332b523f Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 26 Nov 2023 15:54:13 +0000 Subject: [PATCH 023/130] onedrive: add --onedrive-delta flag to enable ListR Before this change ListR was unconditionally enabled on onedrive. This caused performance problems for some uses, so now the --onedrive-delta flag has to be supplied. Fixes #7362 --- backend/onedrive/onedrive.go | 37 ++++++++++++++++++++++++++++++++++++ docs/content/onedrive.md | 3 +++ docs/content/overview.md | 4 +++- 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.go index 7a90e28ad7d99..fbbdcac474cdd 100644 --- a/backend/onedrive/onedrive.go +++ b/backend/onedrive/onedrive.go @@ -324,6 +324,37 @@ the --onedrive-av-override flag, or av_override = true in the config file. `, Advanced: true, + }, { + Name: "delta", + Default: false, + Help: strings.ReplaceAll(`If set rclone will use delta listing to implement recursive listings. + +If this flag is set the the onedrive backend will advertise |ListR| +support for recursive listings. + +Setting this flag speeds up these things greatly: + + rclone lsf -R onedrive: + rclone size onedrive: + rclone rc vfs/refresh recursive=true + +**However** the delta listing API **only** works at the root of the +drive. If you use it not at the root then it recurses from the root +and discards all the data that is not under the directory you asked +for. So it will be correct but may not be very efficient. + +This is why this flag is not set as the default. + +As a rule of thumb if nearly all of your data is under rclone's root +directory (the |root/directory| in |onedrive:root/directory|) then +using this flag will be be a big performance win. If your data is +mostly not under the root then using this flag will be a big +performance loss. + +It is recommended if you are mounting your onedrive at the root +(or near the root when using crypt) and using rclone |rc vfs/refresh|. +`, "|", "`"), + Advanced: true, }, { Name: config.ConfigEncoding, Help: config.ConfigEncodingHelp, @@ -645,6 +676,7 @@ type Options struct { LinkPassword string `config:"link_password"` HashType string `config:"hash_type"` AVOverride bool `config:"av_override"` + Delta bool `config:"delta"` Enc encoder.MultiEncoder `config:"encoding"` } @@ -976,6 +1008,11 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e f.dirCache = dircache.New(root, rootID, f) + // ListR only supported if delta set + if !f.opt.Delta { + f.features.ListR = nil + } + // Find the current root err = f.dirCache.FindRoot(ctx, false) if err != nil { diff --git a/docs/content/onedrive.md b/docs/content/onedrive.md index da83f448af9c3..a57db07640a84 100644 --- a/docs/content/onedrive.md +++ b/docs/content/onedrive.md @@ -189,6 +189,9 @@ This remote supports `--fast-list` which allows you to use fewer transactions in exchange for more memory. See the [rclone docs](/docs/#fast-list) for more details. +This must be enabled with the `--onedrive-delta` flag (or `delta = +true` in the config file) as it can cause performance degradation. + It does this by using the delta listing facilities of OneDrive which returns all the files in the remote very efficiently. This is much more efficient than listing directories recursively and is Microsoft's diff --git a/docs/content/overview.md b/docs/content/overview.md index d3dffb083df87..7a05c39122539 100644 --- a/docs/content/overview.md +++ b/docs/content/overview.md @@ -493,7 +493,7 @@ upon backend-specific capabilities. | Memory | No | Yes | No | No | No | Yes | Yes | No | No | No | No | | Microsoft Azure Blob Storage | Yes | Yes | No | No | No | Yes | Yes | Yes | No | No | No | | Microsoft Azure Files Storage | No | Yes | Yes | Yes | No | No | Yes | Yes | No | Yes | Yes | -| Microsoft OneDrive | Yes | Yes | Yes | Yes | Yes | Yes | No | No | Yes | Yes | Yes | +| Microsoft OneDrive | Yes | Yes | Yes | Yes | Yes | Yes ⁵ | No | No | Yes | Yes | Yes | | OpenDrive | Yes | Yes | Yes | Yes | No | No | No | No | No | No | Yes | | OpenStack Swift | Yes ¹ | Yes | No | No | No | Yes | Yes | No | No | Yes | No | | Oracle Object Storage | No | Yes | No | No | Yes | Yes | Yes | Yes | No | No | No | @@ -527,6 +527,8 @@ purging a directory inside a bucket, files are deleted individually. ⁴ Use the `--sftp-copy-is-hardlink` flag to enable. +⁵ Use the `--onedrive-delta` flag to enable. + ### Purge ### This deletes a directory quicker than just deleting all the files in From 82b963e37239e4fb0779973667e7b873d5b5dadc Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 26 Nov 2023 15:59:12 +0000 Subject: [PATCH 024/130] Version v1.65.0 --- MANUAL.html | 24614 ++++----- MANUAL.md | 43905 ++++++++-------- MANUAL.txt | 41988 ++++++++------- bin/make_manual.py | 2 +- docs/content/amazonclouddrive.md | 2 +- docs/content/azureblob.md | 2 +- docs/content/b2.md | 102 +- docs/content/box.md | 2 +- docs/content/changelog.md | 102 + docs/content/commands/rclone.md | 155 +- docs/content/commands/rclone_bisync.md | 9 +- docs/content/commands/rclone_checksum.md | 15 +- docs/content/commands/rclone_copy.md | 9 +- docs/content/commands/rclone_copyto.md | 9 +- docs/content/commands/rclone_hashsum.md | 6 +- docs/content/commands/rclone_mount.md | 13 +- docs/content/commands/rclone_move.md | 9 +- docs/content/commands/rclone_moveto.md | 9 +- docs/content/commands/rclone_rcd.md | 11 + docs/content/commands/rclone_selfupdate.md | 1 - docs/content/commands/rclone_serve.md | 2 + docs/content/commands/rclone_serve_dlna.md | 2 +- docs/content/commands/rclone_serve_docker.md | 3 +- docs/content/commands/rclone_serve_ftp.md | 2 +- docs/content/commands/rclone_serve_http.md | 13 +- docs/content/commands/rclone_serve_nfs.md | 450 + docs/content/commands/rclone_serve_s3.md | 15 +- docs/content/commands/rclone_serve_sftp.md | 2 +- docs/content/commands/rclone_serve_webdav.md | 13 +- docs/content/commands/rclone_sync.md | 9 +- docs/content/drive.md | 142 +- docs/content/dropbox.md | 48 +- docs/content/fichier.md | 2 +- docs/content/filefabric.md | 2 +- docs/content/flags.md | 153 +- docs/content/ftp.md | 2 +- docs/content/googlecloudstorage.md | 2 +- docs/content/googlephotos.md | 86 +- docs/content/hdfs.md | 10 +- docs/content/hidrive.md | 2 +- docs/content/http.md | 40 + docs/content/imagekit.md | 15 +- docs/content/internetarchive.md | 2 +- docs/content/jottacloud.md | 17 +- docs/content/koofr.md | 30 +- docs/content/local.md | 7 +- docs/content/mailru.md | 2 +- docs/content/mega.md | 2 +- docs/content/onedrive.md | 39 +- docs/content/opendrive.md | 2 +- docs/content/oracleobjectstorage.md | 2 +- docs/content/pcloud.md | 2 +- docs/content/pikpak.md | 2 +- docs/content/premiumizeme.md | 2 +- docs/content/protondrive.md | 2 +- docs/content/putio.md | 2 +- docs/content/qingstor.md | 2 +- docs/content/quatrix.md | 2 +- docs/content/rc.md | 50 + docs/content/s3.md | 1434 +- docs/content/seafile.md | 2 +- docs/content/sftp.md | 26 + docs/content/sharefile.md | 2 +- docs/content/sia.md | 2 +- docs/content/smb.md | 2 +- docs/content/sugarsync.md | 2 +- docs/content/swift.md | 2 +- docs/content/uptobox.md | 2 +- docs/content/webdav.md | 4 +- docs/content/yandex.md | 2 +- docs/content/zoho.md | 2 +- rclone.1 | 46227 +++++++++-------- 72 files changed, 82262 insertions(+), 77594 deletions(-) create mode 100644 docs/content/commands/rclone_serve_nfs.md diff --git a/MANUAL.html b/MANUAL.html index 73fda273168a9..d16296fa0acd4 100644 --- a/MANUAL.html +++ b/MANUAL.html @@ -81,7 +81,7 @@

rclone(1) User Manual

Nick Craig-Wood

-

Sep 11, 2023

+

Nov 26, 2023

Rclone syncs your files to cloud storage

rclone logo

@@ -170,11 +170,14 @@

Supported providers

  • Koofr
  • Leviia Object Storage
  • Liara Object Storage
  • +
  • Linkbox
  • +
  • Linode Object Storage
  • Mail.ru Cloud
  • Memset Memstore
  • Mega
  • Memory
  • Microsoft Azure Blob Storage
  • +
  • Microsoft Azure Files Storage
  • Microsoft OneDrive
  • Minio
  • Nextcloud
  • @@ -275,6 +278,12 @@

    Installation with brew

    NOTE: This version of rclone will not support mount any more (see #5373). If mounting is wanted on macOS, either install a precompiled binary or enable the relevant option when installing from source.

    Note that this is a third party installer not controlled by the rclone developers so it may be out of date. Its current version is as below.

    Homebrew package

    +

    Installation with MacPorts (#macos-macports)

    +

    On macOS, rclone can also be installed via MacPorts:

    +
    sudo port install rclone
    +

    Note that this is a third party installer not controlled by the rclone developers so it may be out of date. Its current version is as below.

    +

    MacPorts port

    +

    More information here.

    Precompiled binary, using curl

    To avoid problems with macOS gatekeeper enforcing the binary to be signed and notarized it is enough to download with curl.

    Download the latest version of rclone.

    @@ -392,8 +401,8 @@

    Docker installation

    Snap installation

    Get it from the Snap Store

    Make sure you have Snapd installed

    -
    $ sudo snap install rclone
    -

    Due to the strict confinement of Snap, rclone snap cannot acess real /home/$USER/.config/rclone directory, default config path is as below.

    +
    $ sudo snap install rclone
    +

    Due to the strict confinement of Snap, rclone snap cannot access real /home/$USER/.config/rclone directory, default config path is as below.

    • Default config directory:
        @@ -405,7 +414,7 @@

        Snap installation

        Note that this is controlled by community maintainer not the rclone developers so it may be out of date. Its current version is as below.

        rclone

        Source installation

        -

        Make sure you have git and Go installed. Go version 1.17 or newer is required, latest release is recommended. You can get it from your package manager, or download it from golang.org/dl. Then you can run the following:

        +

        Make sure you have git and Go installed. Go version 1.18 or newer is required, the latest release is recommended. You can get it from your package manager, or download it from golang.org/dl. Then you can run the following:

        git clone https://github.com/rclone/rclone.git
         cd rclone
         go build
        @@ -413,19 +422,22 @@

        Source installation

        Note that on macOS and Windows the mount command will not be available unless you specify an additional build tag cmount.

        go build -tags cmount

        This assumes you have a GCC compatible C compiler (GCC or Clang) in your PATH, as it uses cgo. But on Windows, the cgofuse library that the cmount implementation is based on, also supports building without cgo, i.e. by setting environment variable CGO_ENABLED to value 0 (static linking). This is how the official Windows release of rclone is being built, starting with version 1.59. It is still possible to build with cgo on Windows as well, by using the MinGW port of GCC, e.g. by installing it in a MSYS2 distribution (make sure you install it in the classic mingw64 subsystem, the ucrt64 version is not compatible).

        -

        Additionally, on Windows, you must install the third party utility WinFsp, with the "Developer" feature selected. If building with cgo, you must also set environment variable CPATH pointing to the fuse include directory within the WinFsp installation (normally C:\Program Files (x86)\WinFsp\inc\fuse).

        -

        You may also add arguments -ldflags -s (with or without -tags cmount), to omit symbol table and debug information, making the executable file smaller, and -trimpath to remove references to local file system paths. This is how the official rclone releases are built.

        +

        Additionally, to build with mount on Windows, you must install the third party utility WinFsp, with the "Developer" feature selected. If building with cgo, you must also set environment variable CPATH pointing to the fuse include directory within the WinFsp installation (normally C:\Program Files (x86)\WinFsp\inc\fuse).

        +

        You may add arguments -ldflags -s to omit symbol table and debug information, making the executable file smaller, and -trimpath to remove references to local file system paths. The official rclone releases are built with both of these.

        go build -trimpath -ldflags -s -tags cmount
        -

        Instead of executing the go build command directly, you can run it via the Makefile. It changes the version number suffix from "-DEV" to "-beta" and appends commit details. It also copies the resulting rclone executable into your GOPATH bin folder ($(go env GOPATH)/bin, which corresponds to ~/go/bin/rclone by default).

        +

        If you want to customize the version string, as reported by the rclone version command, you can set one of the variables fs.Version, fs.VersionTag (to keep default suffix but customize the number), or fs.VersionSuffix (to keep default number but customize the suffix). This can be done from the build command, by adding to the -ldflags argument value as shown below.

        +
        go build -trimpath -ldflags "-s -X github.com/rclone/rclone/fs.Version=v9.9.9-test" -tags cmount
        +

        On Windows, the official executables also have the version information, as well as a file icon, embedded as binary resources. To get that with your own build you need to run the following command before the build command. It generates a Windows resource system object file, with extension .syso, e.g. resource_windows_amd64.syso, that will be automatically picked up by future build commands.

        +
        go run bin/resource_windows.go
        +

        The above command will generate a resource file containing version information based on the fs.Version variable in source at the time you run the command, which means if the value of this variable changes you need to re-run the command for it to be reflected in the version information. Also, if you override this version variable in the build command as described above, you need to do that also when generating the resource file, or else it will still use the value from the source.

        +
        go run bin/resource_windows.go -version v9.9.9-test
        +

        Instead of executing the go build command directly, you can run it via the Makefile. The default target changes the version suffix from "-DEV" to "-beta" followed by additional commit details, embeds version information binary resources on Windows, and copies the resulting rclone executable into your GOPATH bin folder ($(go env GOPATH)/bin, which corresponds to ~/go/bin/rclone by default).

        make

        To include mount command on macOS and Windows with Makefile build:

        make GOTAGS=cmount
        -

        There are other make targets that can be used for more advanced builds, such as cross-compiling for all supported os/architectures, embedding icon and version info resources into windows executable, and packaging results into release artifacts. See Makefile and cross-compile.go for details.

        -

        Another alternative is to download the source, build and install rclone in one operation, as a regular Go package. The source will be stored it in the Go module cache, and the resulting executable will be in your GOPATH bin folder ($(go env GOPATH)/bin, which corresponds to ~/go/bin/rclone by default).

        -

        With Go version 1.17 or newer:

        +

        There are other make targets that can be used for more advanced builds, such as cross-compiling for all supported os/architectures, and packaging results into release artifacts. See Makefile and cross-compile.go for details.

        +

        Another alternative method for source installation is to download the source, build and install rclone - all in one operation, as a regular Go package. The source will be stored it in the Go module cache, and the resulting executable will be in your GOPATH bin folder ($(go env GOPATH)/bin, which corresponds to ~/go/bin/rclone by default).

        go install github.com/rclone/rclone@latest
        -

        With Go versions older than 1.17 (do not use the -u flag, it causes Go to try to update the dependencies that rclone uses and sometimes these don't work with the current version):

        -
        go get github.com/rclone/rclone

        Ansible installation

        This can be done with Stefan Weichinger's ansible role.

        Instructions

        @@ -466,7 +478,7 @@
        Mount command built-in servi

        The WinFsp service infrastructure supports incorporating services for file system implementations, such as rclone, into its own launcher service, as kind of "child services". This has the additional advantage that it also implements a network provider that integrates into Windows standard methods for managing network drives. This is currently not officially supported by Rclone, but with WinFsp version 2019.3 B2 / v1.5B2 or later it should be possible through path rewriting as described here.

        Third-party service integration

        To Windows service running any rclone command, the excellent third-party utility NSSM, the "Non-Sucking Service Manager", can be used. It includes some advanced features such as adjusting process priority, defining process environment variables, redirect to file anything written to stdout, and customized response to different exit codes, with a GUI to configure everything from (although it can also be used from command line ).

        -

        There are also several other alternatives. To mention one more, WinSW, "Windows Service Wrapper", is worth checking out. It requires .NET Framework, but it is preinstalled on newer versions of Windows, and it also provides alternative standalone distributions which includes necessary runtime (.NET 5). WinSW is a command-line only utility, where you have to manually create an XML file with service configuration. This may be a drawback for some, but it can also be an advantage as it is easy to back up and re-use the configuration settings, without having go through manual steps in a GUI. One thing to note is that by default it does not restart the service on error, one have to explicit enable this in the configuration file (via the "onfailure" parameter).

        +

        There are also several other alternatives. To mention one more, WinSW, "Windows Service Wrapper", is worth checking out. It requires .NET Framework, but it is preinstalled on newer versions of Windows, and it also provides alternative standalone distributions which includes necessary runtime (.NET 5). WinSW is a command-line only utility, where you have to manually create an XML file with service configuration. This may be a drawback for some, but it can also be an advantage as it is easy to back up and reuse the configuration settings, without having go through manual steps in a GUI. One thing to note is that by default it does not restart the service on error, one have to explicit enable this in the configuration file (via the "onfailure" parameter).

        Autostart on Linux

        Start as a service

        To always run rclone in background, relevant for mount commands etc, you can use systemd to set up rclone as a system or user service. Running as a system service ensures that it is run at startup even if the user it is running as has no active session. Running rclone as a user service ensures that it only starts after the configured user has logged into the system.

        @@ -507,10 +519,12 @@

        Configure

      • Internet Archive
      • Jottacloud
      • Koofr
      • +
      • Linkbox
      • Mail.ru Cloud
      • Mega
      • Memory
      • Microsoft Azure Blob Storage
      • +
      • Microsoft Azure Files Storage
      • Microsoft OneDrive
      • OpenStack Swift / Rackspace Cloudfiles / Blomp Cloud Storage / Memset Memstore
      • OpenDrive
      • @@ -608,11 +622,11 @@

        Copy Options

        -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -627,11 +641,12 @@

        Copy Options

        --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination

        Important Options

        @@ -694,11 +709,11 @@

        Copy Options

        -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -713,11 +728,12 @@

        Copy Options

        --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination

        Sync Options

        @@ -793,11 +809,11 @@

        Copy Options

        -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -812,11 +828,12 @@

        Copy Options

        --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination

        Important Options

        @@ -1607,11 +1624,11 @@

        Copy Options

        -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -1626,11 +1643,12 @@

        Copy Options

        --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination

        Important Options

        @@ -1728,10 +1746,11 @@

        SEE ALSO

      • rclone - Show help for rclone commands, flags and backends.

      rclone checksum

      -

      Checks the files in the source against a SUM file.

      +

      Checks the files in the destination against a SUM file.

      Synopsis

      -

      Checks that hashsums of source files match the SUM file. It compares hashes (MD5, SHA1, etc) and logs a report of files which don't match. It doesn't alter the file system.

      -

      If you supply the --download flag, it will download the data from remote and calculate the contents hash on the fly. This can be useful for remotes that don't support hashes or if you really want to check all the data.

      +

      Checks that hashsums of destination files match the SUM file. It compares hashes (MD5, SHA1, etc) and logs a report of files which don't match. It doesn't alter the file system.

      +

      The sumfile is treated as the source and the dst:path is treated as the destination for the purposes of the output.

      +

      If you supply the --download flag, it will download the data from the remote and calculate the content hash on the fly. This can be useful for remotes that don't support hashes or if you really want to check all the data.

      Note that hash values in the SUM file are treated as case insensitive.

      If you supply the --one-way flag, it will only check that files in the source match the files in the destination, not the other way around. This means that extra files in the destination that are not in the source will not be detected.

      The --differ, --missing-on-dst, --missing-on-src, --match and --error flags write paths, one per line, to the file name (or stdout if it is -) supplied. What they write is described in the help below. For example --differ will write all paths which are present on both the source and destination but different.

      @@ -1744,7 +1763,7 @@

      Synopsis

    • ! path means there was an error reading or hashing the source or dest.

    The default number of parallel checks is 8. See the --checkers=N option for more information.

    -
    rclone checksum <hash> sumfile src:path [flags]
    +
    rclone checksum <hash> sumfile dst:path [flags]

    Options

          --combined string         Make a combined report of changes to this file
           --differ string           Report all non-matching files to this file
    @@ -2194,11 +2213,11 @@ 

    Copy Options

    -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -2213,11 +2232,12 @@

    Copy Options

    --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination

    Important Options

    @@ -2481,15 +2501,11 @@

    Synopsis

    * sha1 * whirlpool * crc32 - * sha256 - * dropbox - * hidrive - * mailru - * quickxor + * sha256

    Then

    $ rclone hashsum MD5 remote:path

    Note that hash names are case insensitive and values are output in lower case.

    -
    rclone hashsum <hash> remote:path [flags]
    +
    rclone hashsum [<hash> remote:path] [flags]

    Options

          --base64               Output base64 encoded hashsum
       -C, --checkfile string     Validate hashes against a given SUM file instead of printing them
    @@ -2840,7 +2856,9 @@ 

    Windows caveats

    It is also possible to make a drive mount available to everyone on the system, by running the process creating it as the built-in SYSTEM account. There are several ways to do this: One is to use the command-line utility PsExec, from Microsoft's Sysinternals suite, which has option -s to start processes as the SYSTEM account. Another alternative is to run the mount command from a Windows Scheduled Task, or a Windows Service, configured to run as the SYSTEM account. A third alternative is to use the WinFsp.Launcher infrastructure). Read more in the install documentation. Note that when running rclone as another user, it will not use the configuration file from your profile unless you tell it to with the --config option. Note also that it is now the SYSTEM account that will have the owner permissions, and other accounts will have permissions according to the group or others scopes. As mentioned above, these will then not get the "write extended attributes" permission, and this may prevent writing to files. You can work around this with the FileSecurity option, see example above.

    Note that mapping to a directory path, instead of a drive letter, does not suffer from the same limitations.

    Mounting on macOS

    -

    Mounting on macOS can be done either via macFUSE (also known as osxfuse) or FUSE-T. macFUSE is a traditional FUSE driver utilizing a macOS kernel extension (kext). FUSE-T is an alternative FUSE system which "mounts" via an NFSv4 local server.

    +

    Mounting on macOS can be done either via built-in NFS server, macFUSE (also known as osxfuse) or FUSE-T. macFUSE is a traditional FUSE driver utilizing a macOS kernel extension (kext). FUSE-T is an alternative FUSE system which "mounts" via an NFSv4 local server.

    +

    NFS mount

    +

    This method spins up an NFS server using serve nfs command and mounts it to the specified mountpoint. If you run this in background mode using |--daemon|, you will need to send SIGTERM signal to the rclone process using |kill| command to stop the mount.

    macFUSE Notes

    If installing macFUSE using dmg packages from the website, rclone will locate the macFUSE libraries without any further intervention. If however, macFUSE is installed using the macports package manager, the following addition steps are required.

    sudo mkdir /usr/local/lib
    @@ -2860,7 +2878,7 @@ 

    Unicode Normalization

    Read Only mounts

    When mounting with --read-only, attempts to write to files will fail silently as opposed to with a clear warning as in macFUSE.

    Limitations

    -

    Without the use of --vfs-cache-mode this can only write files sequentially, it can only seek when reading. This means that many applications won't work with their files on an rclone mount without --vfs-cache-mode writes or --vfs-cache-mode full. See the VFS File Caching section for more info.

    +

    Without the use of --vfs-cache-mode this can only write files sequentially, it can only seek when reading. This means that many applications won't work with their files on an rclone mount without --vfs-cache-mode writes or --vfs-cache-mode full. See the VFS File Caching section for more info. When using NFS mount on macOS, if you don't specify |--vfs-cache-mode| the mount point will be read-only.

    The bucket-based remotes (e.g. Swift, S3, Google Compute Storage, B2) do not support the concept of empty directories, so empty directories will have a tendency to disappear once they fall out of the directory cache.

    When rclone mount is invoked on Unix with --daemon flag, the main rclone program will wait for the background mount to become ready or until the timeout specified by the --daemon-wait flag. On Linux it can check mount status using ProcFS so the flag in fact sets maximum time to wait, while the real wait can be less. On macOS / BSD the time to wait is constant and the check is performed only at the end. We advise you to set wait time on macOS reasonably.

    Only supported on Linux, FreeBSD, OS X and Windows at the moment.

    @@ -2912,9 +2930,8 @@

    Rclone as Unix mount helper

  • command=cmount can be used to run cmount or any other rclone command rather than the default mount.
  • args2env will pass mount options to the mount helper running in background via environment variables instead of command line arguments. This allows to hide secrets from such commands as ps or pgrep.
  • vv... will be transformed into appropriate --verbose=N
  • -
  • standard mount options like x-systemd.automount, _netdev, nosuid and alike are intended only for Automountd and ignored by rclone.
  • +
  • standard mount options like x-systemd.automount, _netdev, nosuid and alike are intended only for Automountd and ignored by rclone. ## VFS - Virtual File System
  • -

    VFS - Virtual File System

    This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing system.

    Cloud storage objects have lots of properties which aren't like disk files - you can't extend them or write to the middle of them, so the VFS layer has to deal with that. Because there is no one right way of doing this there are various options explained below.

    The VFS layer also implements a directory cache - this caches info about files and directories (but not the data) in memory.

    @@ -3075,6 +3092,7 @@

    Options

    --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -3135,11 +3153,11 @@

    Copy Options

    -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -3154,11 +3172,12 @@

    Copy Options

    --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination

    Important Options

    @@ -3451,6 +3470,37 @@

    Template

    +

    The server also makes the following functions available so that they can be used within the template. These functions help extend the options for dynamic rendering of HTML. They can be used to render HTML based on specific conditions.

    + ++++ + + + + + + + + + + + + + + + + + + + + + + + + +
    FunctionDescription
    afterEpochReturns the time since the epoch for the given time.
    containsChecks whether a given substring is present or not in a given string.
    hasPrefixChecks whether the given string begins with the specified prefix.
    hasSuffixChecks whether the given string end with the specified suffix.

    Authentication

    By default this will serve files without needing a login.

    You can either use an htpasswd file which can take lots of users, or set a single username and password with the --rc-user and --rc-pass flags.

    @@ -3565,7 +3615,9 @@

    SEE ALSO

  • rclone serve docker - Serve any remote on docker's volume plugin API.
  • rclone serve ftp - Serve remote:path over FTP.
  • rclone serve http - Serve the remote over HTTP.
  • +
  • rclone serve nfs - Serve the remote as an NFS mount
  • rclone serve restic - Serve the remote for restic's REST API.
  • +
  • rclone serve s3 - Serve remote:path over s3.
  • rclone serve sftp - Serve the remote over SFTP.
  • rclone serve webdav - Serve remote:path over WebDAV.
  • @@ -3577,8 +3629,7 @@

    Synopsis

    Server options

    Use --addr to specify which IP address and port the server should listen on, e.g. --addr 1.2.3.4:8000 or --addr :8080 to listen to all IPs.

    Use --name to choose the friendly server name, which is by default "rclone (hostname)".

    -

    Use --log-trace in conjunction with -vv to enable additional debug logging of all UPNP traffic.

    -

    VFS - Virtual File System

    +

    Use --log-trace in conjunction with -vv to enable additional debug logging of all UPNP traffic. ## VFS - Virtual File System

    This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing system.

    Cloud storage objects have lots of properties which aren't like disk files - you can't extend them or write to the middle of them, so the VFS layer has to deal with that. Because there is no one right way of doing this there are various options explained below.

    The VFS layer also implements a directory cache - this caches info about files and directories (but not the data) in memory.

    @@ -3726,6 +3777,7 @@

    Options

    --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s)
    @@ -3767,8 +3819,7 @@

    Synopsis

    Running rclone serve docker will create the said socket, listening for commands from Docker to create the necessary Volumes. Normally you need not give the --socket-addr flag. The API will listen on the unix domain socket at /run/docker/plugins/rclone.sock. In the example above rclone will create a TCP socket and a small file /etc/docker/plugins/rclone.spec containing the socket address. We use sudo because both paths are writeable only by the root user.

    If you later decide to change listening socket, the docker daemon must be restarted to reconnect to /run/docker/plugins/rclone.sock or parse new /etc/docker/plugins/rclone.spec. Until you restart, any volume related docker commands will timeout trying to access the old socket. Running directly is supported on Linux only, not on Windows or MacOS. This is not a problem with managed plugin mode described in details in the full documentation.

    The command will create volume mounts under the path given by --base-dir (by default /var/lib/docker-volumes/rclone available only to root) and maintain the JSON formatted file docker-plugin.state in the rclone cache directory with book-keeping records of created and mounted volumes.

    -

    All mount and VFS options are submitted by the docker daemon via API, but you can also provide defaults on the command line as well as set path to the config file and cache directory or adjust logging verbosity.

    -

    VFS - Virtual File System

    +

    All mount and VFS options are submitted by the docker daemon via API, but you can also provide defaults on the command line as well as set path to the config file and cache directory or adjust logging verbosity. ## VFS - Virtual File System

    This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing system.

    Cloud storage objects have lots of properties which aren't like disk files - you can't extend them or write to the middle of them, so the VFS layer has to deal with that. Because there is no one right way of doing this there are various options explained below.

    The VFS layer also implements a directory cache - this caches info about files and directories (but not the data) in memory.

    @@ -3934,6 +3985,7 @@

    Options

    --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -3977,8 +4029,7 @@

    Server options

    If you set --addr to listen on a public or LAN accessible IP address then using Authentication is advised - see the next section for info.

    Authentication

    By default this will serve files without needing a login.

    -

    You can set a single username and password with the --user and --pass flags.

    -

    VFS - Virtual File System

    +

    You can set a single username and password with the --user and --pass flags. ## VFS - Virtual File System

    This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing system.

    Cloud storage objects have lots of properties which aren't like disk files - you can't extend them or write to the middle of them, so the VFS layer has to deal with that. Because there is no one right way of doing this there are various options explained below.

    The VFS layer also implements a directory cache - this caches info about files and directories (but not the data) in memory.

    @@ -4159,6 +4210,7 @@

    Options

    --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -4290,6 +4342,37 @@

    Template

    +

    The server also makes the following functions available so that they can be used within the template. These functions help extend the options for dynamic rendering of HTML. They can be used to render HTML based on specific conditions.

    + ++++ + + + + + + + + + + + + + + + + + + + + + + + + +
    FunctionDescription
    afterEpochReturns the time since the epoch for the given time.
    containsChecks whether a given substring is present or not in a given string.
    hasPrefixChecks whether the given string begins with the specified prefix.
    hasSuffixChecks whether the given string end with the specified suffix.

    Authentication

    By default this will serve files without needing a login.

    You can either use an htpasswd file which can take lots of users, or set a single username and password with the --user and --pass flags.

    @@ -4301,8 +4384,7 @@

    Authentication

    htpasswd -B htpasswd anotherUser

    The password file can be updated while rclone is running.

    Use --realm to set the authentication realm.

    -

    Use --salt to change the password hashing salt from the default.

    -

    VFS - Virtual File System

    +

    Use --salt to change the password hashing salt from the default. ## VFS - Virtual File System

    This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing system.

    Cloud storage objects have lots of properties which aren't like disk files - you can't extend them or write to the middle of them, so the VFS layer has to deal with that. Because there is no one right way of doing this there are various options explained below.

    The VFS layer also implements a directory cache - this caches info about files and directories (but not the data) in memory.

    @@ -4492,6 +4574,7 @@

    Options

    --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -4524,9 +4607,200 @@

    SEE ALSO

    +

    rclone serve nfs

    +

    Serve the remote as an NFS mount

    +

    Synopsis

    +

    Create an NFS server that serves the given remote over the network.

    +

    The primary purpose for this command is to enable mount command on recent macOS versions where installing FUSE is very cumbersome.

    +

    Since this is running on NFSv3, no authentication method is available. Any client will be able to access the data. To limit access, you can use serve NFS on loopback address and rely on secure tunnels (such as SSH). For this reason, by default, a random TCP port is chosen and loopback interface is used for the listening address; meaning that it is only available to the local machine. If you want other machines to access the NFS mount over local network, you need to specify the listening address and port using --addr flag.

    +

    Modifying files through NFS protocol requires VFS caching. Usually you will need to specify --vfs-cache-mode in order to be able to write to the mountpoint (full is recommended). If you don't specify VFS cache mode, the mount will be read-only.

    +

    To serve NFS over the network use following command:

    +
    rclone serve nfs remote: --addr 0.0.0.0:$PORT --vfs-cache-mode=full
    +

    We specify a specific port that we can use in the mount command:

    +

    To mount the server under Linux/macOS, use the following command:

    +
    mount -oport=$PORT,mountport=$PORT $HOSTNAME: path/to/mountpoint
    +

    Where $PORT is the same port number we used in the serve nfs command.

    +

    This feature is only available on Unix platforms.

    +

    VFS - Virtual File System

    +

    This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing system.

    +

    Cloud storage objects have lots of properties which aren't like disk files - you can't extend them or write to the middle of them, so the VFS layer has to deal with that. Because there is no one right way of doing this there are various options explained below.

    +

    The VFS layer also implements a directory cache - this caches info about files and directories (but not the data) in memory.

    +

    VFS Directory Cache

    +

    Using the --dir-cache-time flag, you can control how long a directory should be considered up to date and not refreshed from the backend. Changes made through the VFS will appear immediately or invalidate the cache.

    +
    --dir-cache-time duration   Time to cache directory entries for (default 5m0s)
    +--poll-interval duration    Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable (default 1m0s)
    +

    However, changes made directly on the cloud storage by the web interface or a different copy of rclone will only be picked up once the directory cache expires if the backend configured does not support polling for changes. If the backend supports polling, changes will be picked up within the polling interval.

    +

    You can send a SIGHUP signal to rclone for it to flush all directory caches, regardless of how old they are. Assuming only one rclone instance is running, you can reset the cache like this:

    +
    kill -SIGHUP $(pidof rclone)
    +

    If you configure rclone with a remote control then you can use rclone rc to flush the whole directory cache:

    +
    rclone rc vfs/forget
    +

    Or individual files or directories:

    +
    rclone rc vfs/forget file=path/to/file dir=path/to/dir
    +

    VFS File Buffering

    +

    The --buffer-size flag determines the amount of memory, that will be used to buffer data in advance.

    +

    Each open file will try to keep the specified amount of data in memory at all times. The buffered data is bound to one open file and won't be shared.

    +

    This flag is a upper limit for the used memory per open file. The buffer will only use memory for data that is downloaded but not not yet read. If the buffer is empty, only a small amount of memory will be used.

    +

    The maximum memory used by rclone for buffering can be up to --buffer-size * open files.

    +

    VFS File Caching

    +

    These flags control the VFS file caching options. File caching is necessary to make the VFS layer appear compatible with a normal file system. It can be disabled at the cost of some compatibility.

    +

    For example you'll need to enable VFS caching if you want to read and write simultaneously to a file. See below for more details.

    +

    Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both.

    +
    --cache-dir string                     Directory rclone will use for caching.
    +--vfs-cache-mode CacheMode             Cache mode off|minimal|writes|full (default off)
    +--vfs-cache-max-age duration           Max time since last access of objects in the cache (default 1h0m0s)
    +--vfs-cache-max-size SizeSuffix        Max total size of objects in the cache (default off)
    +--vfs-cache-min-free-space SizeSuffix  Target minimum free space on the disk containing the cache (default off)
    +--vfs-cache-poll-interval duration     Interval to poll the cache for stale objects (default 1m0s)
    +--vfs-write-back duration              Time to writeback files after last use when using cache (default 5s)
    +

    If run with -vv rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but can be controlled with --cache-dir or setting the appropriate environment variable.

    +

    The cache has 4 different modes selected by --vfs-cache-mode. The higher the cache mode the more compatible rclone becomes at the cost of using disk space.

    +

    Note that files are written back to the remote only when they are closed and if they haven't been accessed for --vfs-write-back seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags.

    +

    If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the cache may exceed these quotas for two reasons. Firstly because it is only checked every --vfs-cache-poll-interval. Secondly because open files cannot be evicted from the cache. When --vfs-cache-max-size or --vfs-cache-min-free-size is exceeded, rclone will attempt to evict the least accessed files from the cache first. rclone will start with files that haven't been accessed for the longest. This cache flushing strategy is efficient and more relevant files are likely to remain cached.

    +

    The --vfs-cache-max-age will evict files from the cache after the set time since last access has passed. The default value of 1 hour will start evicting files from cache that haven't been accessed for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 and will wait for 1 more hour before evicting. Specify the time with standard notation, s, m, h, d, w .

    +

    You should not run two copies of rclone using the same VFS cache with the same or overlapping remotes if using --vfs-cache-mode > off. This can potentially cause data corruption if you do. You can work around this by giving each rclone its own cache hierarchy with --cache-dir. You don't need to worry about this if the remotes in use don't overlap.

    +

    --vfs-cache-mode off

    +

    In this mode (the default) the cache will read directly from the remote and write directly to the remote without caching anything on disk.

    +

    This will mean some operations are not possible

    +
      +
    • Files can't be opened for both read AND write
    • +
    • Files opened for write can't be seeked
    • +
    • Existing files opened for write must have O_TRUNC set
    • +
    • Files open for read with O_TRUNC will be opened write only
    • +
    • Files open for write only will behave as if O_TRUNC was supplied
    • +
    • Open modes O_APPEND, O_TRUNC are ignored
    • +
    • If an upload fails it can't be retried
    • +
    +

    --vfs-cache-mode minimal

    +

    This is very similar to "off" except that files opened for read AND write will be buffered to disk. This means that files opened for write will be a lot more compatible, but uses the minimal disk space.

    +

    These operations are not possible

    +
      +
    • Files opened for write only can't be seeked
    • +
    • Existing files opened for write must have O_TRUNC set
    • +
    • Files opened for write only will ignore O_APPEND, O_TRUNC
    • +
    • If an upload fails it can't be retried
    • +
    +

    --vfs-cache-mode writes

    +

    In this mode files opened for read only are still read directly from the remote, write only and read/write files are buffered to disk first.

    +

    This mode should support all normal file system operations.

    +

    If an upload fails it will be retried at exponentially increasing intervals up to 1 minute.

    +

    --vfs-cache-mode full

    +

    In this mode all reads and writes are buffered to and from disk. When data is read from the remote this is buffered to disk as well.

    +

    In this mode the files in the cache will be sparse files and rclone will keep track of which bits of the files it has downloaded.

    +

    So if an application only reads the starts of each file, then rclone will only buffer the start of the file. These files will appear to be their full size in the cache, but they will be sparse files with only the data that has been downloaded present in them.

    +

    This mode should support all normal file system operations and is otherwise identical to --vfs-cache-mode writes.

    +

    When reading a file rclone will read --buffer-size plus --vfs-read-ahead bytes ahead. The --buffer-size is buffered in memory whereas the --vfs-read-ahead is buffered on disk.

    +

    When using this mode it is recommended that --buffer-size is not set too large and --vfs-read-ahead is set large if required.

    +

    IMPORTANT not all file systems support sparse files. In particular FAT/exFAT do not. Rclone will perform very badly if the cache directory is on a filesystem which doesn't support sparse files and it will log an ERROR message if one is detected.

    +

    Fingerprinting

    +

    Various parts of the VFS use fingerprinting to see if a local file copy has changed relative to a remote file. Fingerprints are made from:

    +
      +
    • size
    • +
    • modification time
    • +
    • hash
    • +
    +

    where available on an object.

    +

    On some backends some of these attributes are slow to read (they take an extra API call per object, or extra work per object).

    +

    For example hash is slow with the local and sftp backends as they have to read the entire file and hash it, and modtime is slow with the s3, swift, ftp and qinqstor backends because they need to do an extra API call to fetch it.

    +

    If you use the --vfs-fast-fingerprint flag then rclone will not include the slow operations in the fingerprint. This makes the fingerprinting less accurate but much faster and will improve the opening time of cached files.

    +

    If you are running a vfs cache over local, s3 or swift backends then using this flag is recommended.

    +

    Note that if you change the value of this flag, the fingerprints of the files in the cache may be invalidated and the files will need to be downloaded again.

    +

    VFS Chunked Reading

    +

    When rclone reads files from a remote it reads them in chunks. This means that rather than requesting the whole file rclone reads the chunk specified. This can reduce the used download quota for some remotes by requesting only chunks from the remote that are actually read, at the cost of an increased number of requests.

    +

    These flags control the chunking:

    +
    --vfs-read-chunk-size SizeSuffix        Read the source objects in chunks (default 128M)
    +--vfs-read-chunk-size-limit SizeSuffix  Max chunk doubling size (default off)
    +

    Rclone will start reading a chunk of size --vfs-read-chunk-size, and then double the size for each read. When --vfs-read-chunk-size-limit is specified, and greater than --vfs-read-chunk-size, the chunk size for each open file will get doubled only until the specified value is reached. If the value is "off", which is the default, the limit is disabled and the chunk size will grow indefinitely.

    +

    With --vfs-read-chunk-size 100M and --vfs-read-chunk-size-limit 0 the following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on. When --vfs-read-chunk-size-limit 500M is specified, the result would be 0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on.

    +

    Setting --vfs-read-chunk-size to 0 or "off" disables chunked reading.

    +

    VFS Performance

    +

    These flags may be used to enable/disable features of the VFS for performance or other reasons. See also the chunked reading feature.

    +

    In particular S3 and Swift benefit hugely from the --no-modtime flag (or use --use-server-modtime for a slightly different effect) as each read of the modification time takes a transaction.

    +
    --no-checksum     Don't compare checksums on up/download.
    +--no-modtime      Don't read/write the modification time (can speed things up).
    +--no-seek         Don't allow seeking in files.
    +--read-only       Only allow read-only access.
    +

    Sometimes rclone is delivered reads or writes out of order. Rather than seeking rclone will wait a short time for the in sequence read or write to come in. These flags only come into effect when not using an on disk cache file.

    +
    --vfs-read-wait duration   Time to wait for in-sequence read before seeking (default 20ms)
    +--vfs-write-wait duration  Time to wait for in-sequence write before giving error (default 1s)
    +

    When using VFS write caching (--vfs-cache-mode with value writes or full), the global flag --transfers can be set to adjust the number of parallel uploads of modified files from the cache (the related global flag --checkers has no effect on the VFS).

    +
    --transfers int  Number of file transfers to run in parallel (default 4)
    +

    VFS Case Sensitivity

    +

    Linux file systems are case-sensitive: two files can differ only by case, and the exact case must be used when opening a file.

    +

    File systems in modern Windows are case-insensitive but case-preserving: although existing files can be opened using any case, the exact case used to create the file is preserved and available for programs to query. It is not allowed for two files in the same directory to differ only by case.

    +

    Usually file systems on macOS are case-insensitive. It is possible to make macOS file systems case-sensitive but that is not the default.

    +

    The --vfs-case-insensitive VFS flag controls how rclone handles these two cases. If its value is "false", rclone passes file names to the remote as-is. If the flag is "true" (or appears without a value on the command line), rclone may perform a "fixup" as explained below.

    +

    The user may specify a file name to open/delete/rename/etc with a case different than what is stored on the remote. If an argument refers to an existing file with exactly the same name, then the case of the existing file on the disk will be used. However, if a file name with exactly the same name is not found but a name differing only by case exists, rclone will transparently fixup the name. This fixup happens only when an existing file is requested. Case sensitivity of file names created anew by rclone is controlled by the underlying remote.

    +

    Note that case sensitivity of the operating system running rclone (the target) may differ from case sensitivity of a file system presented by rclone (the source). The flag controls whether "fixup" is performed to satisfy the target.

    +

    If the flag is not provided on the command line, then its default value depends on the operating system where rclone runs: "true" on Windows and macOS, "false" otherwise. If the flag is provided without a value, then it is "true".

    +

    VFS Disk Options

    +

    This flag allows you to manually set the statistics about the filing system. It can be useful when those statistics cannot be read correctly automatically.

    +
    --vfs-disk-space-total-size    Manually set the total disk space size (example: 256G, default: -1)
    +

    Alternate report of used bytes

    +

    Some backends, most notably S3, do not report the amount of bytes used. If you need this information to be available when running df on the filesystem, then pass the flag --vfs-used-is-size to rclone. With this flag set, instead of relying on the backend to report this information, rclone will scan the whole remote similar to rclone size and compute the total used space itself.

    +

    WARNING. Contrary to rclone size, this flag ignores filters so that the result is accurate. However, this is very inefficient and may cost lots of API calls resulting in extra charges. Use it as a last resort and only with caching.

    +
    rclone serve nfs remote:path [flags]
    +

    Options

    +
          --addr string                            IPaddress:Port or :Port to bind server to
    +      --dir-cache-time Duration                Time to cache directory entries for (default 5m0s)
    +      --dir-perms FileMode                     Directory permissions (default 0777)
    +      --file-perms FileMode                    File permissions (default 0666)
    +      --gid uint32                             Override the gid field set by the filesystem (not supported on Windows) (default 1000)
    +  -h, --help                                   help for nfs
    +      --no-checksum                            Don't compare checksums on up/download
    +      --no-modtime                             Don't read/write the modification time (can speed things up)
    +      --no-seek                                Don't allow seeking in files
    +      --poll-interval Duration                 Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s)
    +      --read-only                              Only allow read-only access
    +      --uid uint32                             Override the uid field set by the filesystem (not supported on Windows) (default 1000)
    +      --umask int                              Override the permission bits set by the filesystem (not supported on Windows) (default 2)
    +      --vfs-cache-max-age Duration             Max time since last access of objects in the cache (default 1h0m0s)
    +      --vfs-cache-max-size SizeSuffix          Max total size of objects in the cache (default off)
    +      --vfs-cache-min-free-space SizeSuffix    Target minimum free space on the disk containing the cache (default off)
    +      --vfs-cache-mode CacheMode               Cache mode off|minimal|writes|full (default off)
    +      --vfs-cache-poll-interval Duration       Interval to poll the cache for stale objects (default 1m0s)
    +      --vfs-case-insensitive                   If a file name not found, find a case insensitive match
    +      --vfs-disk-space-total-size SizeSuffix   Specify the total space of disk (default off)
    +      --vfs-fast-fingerprint                   Use fast (less accurate) fingerprints for change detection
    +      --vfs-read-ahead SizeSuffix              Extra read ahead over --buffer-size when using cache-mode full
    +      --vfs-read-chunk-size SizeSuffix         Read the source objects in chunks (default 128Mi)
    +      --vfs-read-chunk-size-limit SizeSuffix   If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off)
    +      --vfs-read-wait Duration                 Time to wait for in-sequence read before seeking (default 20ms)
    +      --vfs-refresh                            Refreshes the directory cache recursively on start
    +      --vfs-used-is-size rclone size           Use the rclone size algorithm for Used size
    +      --vfs-write-back Duration                Time to writeback files after last use when using cache (default 5s)
    +      --vfs-write-wait Duration                Time to wait for in-sequence write before giving error (default 1s)
    +

    Filter Options

    +

    Flags for filtering directory listings.

    +
          --delete-excluded                     Delete files on dest excluded from sync
    +      --exclude stringArray                 Exclude files matching pattern
    +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
    +      --exclude-if-present stringArray      Exclude directories if filename is present
    +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
    +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
    +  -f, --filter stringArray                  Add a file filtering rule
    +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
    +      --ignore-case                         Ignore case in filters (case insensitive)
    +      --include stringArray                 Include files matching pattern
    +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
    +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --max-depth int                       If set limits the recursion depth to this (default -1)
    +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
    +      --metadata-exclude stringArray        Exclude metadatas matching pattern
    +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
    +      --metadata-filter stringArray         Add a metadata filtering rule
    +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
    +      --metadata-include stringArray        Include metadatas matching pattern
    +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
    +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
    +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
    +

    See the global flags page for global options not listed here.

    +

    SEE ALSO

    +

    rclone serve restic

    Serve the remote for restic's REST API.

    -

    Synopsis

    +

    Synopsis

    Run a basic web server to serve a remote over restic's REST backend API over HTTP. This allows restic to use rclone as a data storage mechanism for cloud providers that restic does not support directly.

    Restic is a command-line program for doing backups.

    The server will log errors. Use -v to see access logs.

    @@ -4592,7 +4866,7 @@

    Authentication

    Use --realm to set the authentication realm.

    Use --salt to change the password hashing salt from the default.

    rclone serve restic remote:path [flags]
    -

    Options

    +

    Options

          --addr stringArray                IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080])
           --allow-origin string             Origin which cross-domain request (CORS) can be executed from
           --append-only                     Disallow deletion of repository data
    @@ -4614,32 +4888,84 @@ 

    Options

    --stdio Run an HTTP2 server on stdin/stdout --user string User name for authentication

    See the global flags page for global options not listed here.

    -

    SEE ALSO

    +

    SEE ALSO

    -

    rclone serve sftp

    -

    Serve the remote over SFTP.

    -

    Synopsis

    -

    Run an SFTP server to serve a remote over SFTP. This can be used with an SFTP client or you can make a remote of type sftp to use with it.

    -

    You can use the filter flags (e.g. --include, --exclude) to control what is served.

    -

    The server will respond to a small number of shell commands, mainly md5sum, sha1sum and df, which enable it to provide support for checksums and the about feature when accessed from an sftp remote.

    -

    Note that this server uses standard 32 KiB packet payload size, which means you must not configure the client to expect anything else, e.g. with the chunk_size option on an sftp remote.

    -

    The server will log errors. Use -v to see access logs.

    -

    --bwlimit will be respected for file transfers. Use --stats to control the stats printing.

    -

    You must provide some means of authentication, either with --user/--pass, an authorized keys file (specify location with --authorized-keys - the default is the same as ssh), an --auth-proxy, or set the --no-auth flag for no authentication when logging in.

    -

    If you don't supply a host --key then rclone will generate rsa, ecdsa and ed25519 variants, and cache them for later use in rclone's cache directory (see rclone help flags cache-dir) in the "serve-sftp" directory.

    -

    By default the server binds to localhost:2022 - if you want it to be reachable externally then supply --addr :2022 for example.

    -

    Note that the default of --vfs-cache-mode off is fine for the rclone sftp backend, but it may not be with other SFTP clients.

    -

    If --stdio is specified, rclone will serve SFTP over stdio, which can be used with sshd via ~/.ssh/authorized_keys, for example:

    -
    restrict,command="rclone serve sftp --stdio ./photos" ssh-rsa ...
    -

    On the client you need to set --transfers 1 when using --stdio. Otherwise multiple instances of the rclone server are started by OpenSSH which can lead to "corrupted on transfer" errors. This is the case because the client chooses indiscriminately which server to send commands to while the servers all have different views of the state of the filing system.

    -

    The "restrict" in authorized_keys prevents SHA1SUMs and MD5SUMs from being used. Omitting "restrict" and using --sftp-path-override to enable checksumming is possible but less secure and you could use the SFTP server provided by OpenSSH in this case.

    -

    VFS - Virtual File System

    +

    rclone serve s3

    +

    Serve remote:path over s3.

    +

    Synopsis

    +

    serve s3 implements a basic s3 server that serves a remote via s3. This can be viewed with an s3 client, or you can make an s3 type remote to read and write to it with rclone.

    +

    serve s3 is considered Experimental so use with care.

    +

    S3 server supports Signature Version 4 authentication. Just use --auth-key accessKey,secretKey and set the Authorization header correctly in the request. (See the AWS docs).

    +

    --auth-key can be repeated for multiple auth pairs. If --auth-key is not provided then serve s3 will allow anonymous access.

    +

    Please note that some clients may require HTTPS endpoints. See the SSL docs for more information.

    +

    This command uses the VFS directory cache. All the functionality will work with --vfs-cache-mode off. Using --vfs-cache-mode full (or writes) can be used to cache objects locally to improve performance.

    +

    Use --force-path-style=false if you want to use the bucket name as a part of the hostname (such as mybucket.local)

    +

    Use --etag-hash if you want to change the hash uses for the ETag. Note that using anything other than MD5 (the default) is likely to cause problems for S3 clients which rely on the Etag being the MD5.

    +

    Quickstart

    +

    For a simple set up, to serve remote:path over s3, run the server like this:

    +
    rclone serve s3 --auth-key ACCESS_KEY_ID,SECRET_ACCESS_KEY remote:path
    +

    This will be compatible with an rclone remote which is defined like this:

    +
    [serves3]
    +type = s3
    +provider = Rclone
    +endpoint = http://127.0.0.1:8080/
    +access_key_id = ACCESS_KEY_ID
    +secret_access_key = SECRET_ACCESS_KEY
    +use_multipart_uploads = false
    +

    Note that setting disable_multipart_uploads = true is to work around a bug which will be fixed in due course.

    +

    Bugs

    +

    When uploading multipart files serve s3 holds all the parts in memory (see #7453). This is a limitaton of the library rclone uses for serving S3 and will hopefully be fixed at some point.

    +

    Multipart server side copies do not work (see #7454). These take a very long time and eventually fail. The default threshold for multipart server side copies is 5G which is the maximum it can be, so files above this side will fail to be server side copied.

    +

    For a current list of serve s3 bugs see the serve s3 bug category on GitHub.

    +

    Limitations

    +

    serve s3 will treat all directories in the root as buckets and ignore all files in the root. You can use CreateBucket to create folders under the root, but you can't create empty folders under other folders not in the root.

    +

    When using PutObject or DeleteObject, rclone will automatically create or clean up empty folders. If you don't want to clean up empty folders automatically, use --no-cleanup.

    +

    When using ListObjects, rclone will use / when the delimiter is empty. This reduces backend requests with no effect on most operations, but if the delimiter is something other than / and empty, rclone will do a full recursive search of the backend, which can take some time.

    +

    Versioning is not currently supported.

    +

    Metadata will only be saved in memory other than the rclone mtime metadata which will be set as the modification time of the file.

    +

    Supported operations

    +

    serve s3 currently supports the following operations.

    +
      +
    • Bucket +
        +
      • ListBuckets
      • +
      • CreateBucket
      • +
      • DeleteBucket
      • +
    • +
    • Object +
        +
      • HeadObject
      • +
      • ListObjects
      • +
      • GetObject
      • +
      • PutObject
      • +
      • DeleteObject
      • +
      • DeleteObjects
      • +
      • CreateMultipartUpload
      • +
      • CompleteMultipartUpload
      • +
      • AbortMultipartUpload
      • +
      • CopyObject
      • +
      • UploadPart
      • +
    • +
    +

    Other operations will return error Unimplemented.

    +

    Server options

    +

    Use --addr to specify which IP address and port the server should listen on, eg --addr 1.2.3.4:8000 or --addr :8080 to listen to all IPs. By default it only listens on localhost. You can use port :0 to let the OS choose an available port.

    +

    If you set --addr to listen on a public or LAN accessible IP address then using Authentication is advised - see the next section for info.

    +

    You can use a unix socket by setting the url to unix:///path/to/socket or just by using an absolute path name. Note that unix sockets bypass the authentication - this is expected to be done with file system permissions.

    +

    --addr may be repeated to listen on multiple IPs/ports/sockets.

    +

    --server-read-timeout and --server-write-timeout can be used to control the timeouts on the server. Note that this is the total time for a transfer.

    +

    --max-header-bytes controls the maximum number of bytes the server will accept in the HTTP header.

    +

    --baseurl controls the URL prefix that rclone serves from. By default rclone will serve from the root. If you used --baseurl "/rclone" then rclone would serve from a URL starting with "/rclone/". This is useful if you wish to proxy rclone serve. Rclone automatically inserts leading and trailing "/" on --baseurl, so --baseurl "rclone", --baseurl "/rclone" and --baseurl "/rclone/" are all treated identically.

    +

    TLS (SSL)

    +

    By default this will serve over http. If you want you can serve over https. You will need to supply the --cert and --key flags. If you wish to do client side certificate validation then you will need to supply --client-ca also.

    +

    --cert should be a either a PEM encoded certificate or a concatenation of that with the CA certificate. --key should be the PEM encoded private key and --client-ca should be the PEM encoded client certificate authority certificate.

    +

    --min-tls-version is minimum TLS version that is acceptable. Valid values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default "tls1.0"). ## VFS - Virtual File System

    This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing system.

    Cloud storage objects have lots of properties which aren't like disk files - you can't extend them or write to the middle of them, so the VFS layer has to deal with that. Because there is no one right way of doing this there are various options explained below.

    The VFS layer also implements a directory cache - this caches info about files and directories (but not the data) in memory.

    -

    VFS Directory Cache

    +

    VFS Directory Cache

    Using the --dir-cache-time flag, you can control how long a directory should be considered up to date and not refreshed from the backend. Changes made through the VFS will appear immediately or invalidate the cache.

    --dir-cache-time duration   Time to cache directory entries for (default 5m0s)
     --poll-interval duration    Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable (default 1m0s)
    @@ -4650,12 +4976,12 @@

    VFS Directory Cache

    rclone rc vfs/forget

    Or individual files or directories:

    rclone rc vfs/forget file=path/to/file dir=path/to/dir
    -

    VFS File Buffering

    +

    VFS File Buffering

    The --buffer-size flag determines the amount of memory, that will be used to buffer data in advance.

    Each open file will try to keep the specified amount of data in memory at all times. The buffered data is bound to one open file and won't be shared.

    This flag is a upper limit for the used memory per open file. The buffer will only use memory for data that is downloaded but not not yet read. If the buffer is empty, only a small amount of memory will be used.

    The maximum memory used by rclone for buffering can be up to --buffer-size * open files.

    -

    VFS File Caching

    +

    VFS File Caching

    These flags control the VFS file caching options. File caching is necessary to make the VFS layer appear compatible with a normal file system. It can be disabled at the cost of some compatibility.

    For example you'll need to enable VFS caching if you want to read and write simultaneously to a file. See below for more details.

    Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both.

    @@ -4672,7 +4998,7 @@

    VFS File Caching

    If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the cache may exceed these quotas for two reasons. Firstly because it is only checked every --vfs-cache-poll-interval. Secondly because open files cannot be evicted from the cache. When --vfs-cache-max-size or --vfs-cache-min-free-size is exceeded, rclone will attempt to evict the least accessed files from the cache first. rclone will start with files that haven't been accessed for the longest. This cache flushing strategy is efficient and more relevant files are likely to remain cached.

    The --vfs-cache-max-age will evict files from the cache after the set time since last access has passed. The default value of 1 hour will start evicting files from cache that haven't been accessed for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 and will wait for 1 more hour before evicting. Specify the time with standard notation, s, m, h, d, w .

    You should not run two copies of rclone using the same VFS cache with the same or overlapping remotes if using --vfs-cache-mode > off. This can potentially cause data corruption if you do. You can work around this by giving each rclone its own cache hierarchy with --cache-dir. You don't need to worry about this if the remotes in use don't overlap.

    -

    --vfs-cache-mode off

    +

    --vfs-cache-mode off

    In this mode (the default) the cache will read directly from the remote and write directly to the remote without caching anything on disk.

    This will mean some operations are not possible

      @@ -4684,7 +5010,7 @@

      --vfs-cache-mode off

    • Open modes O_APPEND, O_TRUNC are ignored
    • If an upload fails it can't be retried
    -

    --vfs-cache-mode minimal

    +

    --vfs-cache-mode minimal

    This is very similar to "off" except that files opened for read AND write will be buffered to disk. This means that files opened for write will be a lot more compatible, but uses the minimal disk space.

    These operations are not possible

      @@ -4693,11 +5019,11 @@

      --vfs-cache-mode minimal

    • Files opened for write only will ignore O_APPEND, O_TRUNC
    • If an upload fails it can't be retried
    -

    --vfs-cache-mode writes

    +

    --vfs-cache-mode writes

    In this mode files opened for read only are still read directly from the remote, write only and read/write files are buffered to disk first.

    This mode should support all normal file system operations.

    If an upload fails it will be retried at exponentially increasing intervals up to 1 minute.

    -

    --vfs-cache-mode full

    +

    --vfs-cache-mode full

    In this mode all reads and writes are buffered to and from disk. When data is read from the remote this is buffered to disk as well.

    In this mode the files in the cache will be sparse files and rclone will keep track of which bits of the files it has downloaded.

    So if an application only reads the starts of each file, then rclone will only buffer the start of the file. These files will appear to be their full size in the cache, but they will be sparse files with only the data that has been downloaded present in them.

    @@ -4705,7 +5031,7 @@

    --vfs-cache-mode full

    When reading a file rclone will read --buffer-size plus --vfs-read-ahead bytes ahead. The --buffer-size is buffered in memory whereas the --vfs-read-ahead is buffered on disk.

    When using this mode it is recommended that --buffer-size is not set too large and --vfs-read-ahead is set large if required.

    IMPORTANT not all file systems support sparse files. In particular FAT/exFAT do not. Rclone will perform very badly if the cache directory is on a filesystem which doesn't support sparse files and it will log an ERROR message if one is detected.

    -

    Fingerprinting

    +

    Fingerprinting

    Various parts of the VFS use fingerprinting to see if a local file copy has changed relative to a remote file. Fingerprints are made from:

    • size
    • @@ -4718,7 +5044,7 @@

      Fingerprinting

      If you use the --vfs-fast-fingerprint flag then rclone will not include the slow operations in the fingerprint. This makes the fingerprinting less accurate but much faster and will improve the opening time of cached files.

      If you are running a vfs cache over local, s3 or swift backends then using this flag is recommended.

      Note that if you change the value of this flag, the fingerprints of the files in the cache may be invalidated and the files will need to be downloaded again.

      -

      VFS Chunked Reading

      +

      VFS Chunked Reading

      When rclone reads files from a remote it reads them in chunks. This means that rather than requesting the whole file rclone reads the chunk specified. This can reduce the used download quota for some remotes by requesting only chunks from the remote that are actually read, at the cost of an increased number of requests.

      These flags control the chunking:

      --vfs-read-chunk-size SizeSuffix        Read the source objects in chunks (default 128M)
      @@ -4726,7 +5052,7 @@ 

      VFS Chunked Reading

      Rclone will start reading a chunk of size --vfs-read-chunk-size, and then double the size for each read. When --vfs-read-chunk-size-limit is specified, and greater than --vfs-read-chunk-size, the chunk size for each open file will get doubled only until the specified value is reached. If the value is "off", which is the default, the limit is disabled and the chunk size will grow indefinitely.

      With --vfs-read-chunk-size 100M and --vfs-read-chunk-size-limit 0 the following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on. When --vfs-read-chunk-size-limit 500M is specified, the result would be 0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on.

      Setting --vfs-read-chunk-size to 0 or "off" disables chunked reading.

      -

      VFS Performance

      +

      VFS Performance

      These flags may be used to enable/disable features of the VFS for performance or other reasons. See also the chunked reading feature.

      In particular S3 and Swift benefit hugely from the --no-modtime flag (or use --use-server-modtime for a slightly different effect) as each read of the modification time takes a transaction.

      --no-checksum     Don't compare checksums on up/download.
      @@ -4738,7 +5064,7 @@ 

      VFS Performance

      --vfs-write-wait duration Time to wait for in-sequence write before giving error (default 1s)

      When using VFS write caching (--vfs-cache-mode with value writes or full), the global flag --transfers can be set to adjust the number of parallel uploads of modified files from the cache (the related global flag --checkers has no effect on the VFS).

      --transfers int  Number of file transfers to run in parallel (default 4)
      -

      VFS Case Sensitivity

      +

      VFS Case Sensitivity

      Linux file systems are case-sensitive: two files can differ only by case, and the exact case must be used when opening a file.

      File systems in modern Windows are case-insensitive but case-preserving: although existing files can be opened using any case, the exact case used to create the file is preserved and available for programs to query. It is not allowed for two files in the same directory to differ only by case.

      Usually file systems on macOS are case-insensitive. It is possible to make macOS file systems case-sensitive but that is not the default.

      @@ -4746,64 +5072,40 @@

      VFS Case Sensitivity

      The user may specify a file name to open/delete/rename/etc with a case different than what is stored on the remote. If an argument refers to an existing file with exactly the same name, then the case of the existing file on the disk will be used. However, if a file name with exactly the same name is not found but a name differing only by case exists, rclone will transparently fixup the name. This fixup happens only when an existing file is requested. Case sensitivity of file names created anew by rclone is controlled by the underlying remote.

      Note that case sensitivity of the operating system running rclone (the target) may differ from case sensitivity of a file system presented by rclone (the source). The flag controls whether "fixup" is performed to satisfy the target.

      If the flag is not provided on the command line, then its default value depends on the operating system where rclone runs: "true" on Windows and macOS, "false" otherwise. If the flag is provided without a value, then it is "true".

      -

      VFS Disk Options

      +

      VFS Disk Options

      This flag allows you to manually set the statistics about the filing system. It can be useful when those statistics cannot be read correctly automatically.

      --vfs-disk-space-total-size    Manually set the total disk space size (example: 256G, default: -1)
      -

      Alternate report of used bytes

      +

      Alternate report of used bytes

      Some backends, most notably S3, do not report the amount of bytes used. If you need this information to be available when running df on the filesystem, then pass the flag --vfs-used-is-size to rclone. With this flag set, instead of relying on the backend to report this information, rclone will scan the whole remote similar to rclone size and compute the total used space itself.

      WARNING. Contrary to rclone size, this flag ignores filters so that the result is accurate. However, this is very inefficient and may cost lots of API calls resulting in extra charges. Use it as a last resort and only with caching.

      -

      Auth Proxy

      -

      If you supply the parameter --auth-proxy /path/to/program then rclone will use that program to generate backends on the fly which then are used to authenticate incoming requests. This uses a simple JSON based protocol with input on STDIN and output on STDOUT.

      -

      PLEASE NOTE: --auth-proxy and --authorized-keys cannot be used together, if --auth-proxy is set the authorized keys option will be ignored.

      -

      There is an example program bin/test_proxy.py in the rclone source code.

      -

      The program's job is to take a user and pass on the input and turn those into the config for a backend on STDOUT in JSON format. This config will have any default parameters for the backend added, but it won't use configuration from environment variables or command line options - it is the job of the proxy program to make a complete config.

      -

      This config generated must have this extra parameter - _root - root to use for the backend

      -

      And it may have this parameter - _obscure - comma separated strings for parameters to obscure

      -

      If password authentication was used by the client, input to the proxy process (on STDIN) would look similar to this:

      -
      {
      -    "user": "me",
      -    "pass": "mypassword"
      -}
      -

      If public-key authentication was used by the client, input to the proxy process (on STDIN) would look similar to this:

      -
      {
      -    "user": "me",
      -    "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDuwESFdAe14hVS6omeyX7edc...JQdf"
      -}
      -

      And as an example return this on STDOUT

      -
      {
      -    "type": "sftp",
      -    "_root": "",
      -    "_obscure": "pass",
      -    "user": "me",
      -    "pass": "mypassword",
      -    "host": "sftp.example.com"
      -}
      -

      This would mean that an SFTP backend would be created on the fly for the user and pass/public_key returned in the output to the host given. Note that since _obscure is set to pass, rclone will obscure the pass parameter before creating the backend (which is required for sftp backends).

      -

      The program can manipulate the supplied user in any way, for example to make proxy to many different sftp backends, you could make the user be user@example.com and then set the host to example.com in the output and the user to user. For security you'd probably want to restrict the host to a limited list.

      -

      Note that an internal cache is keyed on user so only use that for configuration, don't use pass or public_key. This also means that if a user's password or public-key is changed the cache will need to expire (which takes 5 mins) before it takes effect.

      -

      This can be used to build general purpose proxies to any kind of backend that rclone supports.

      -
      rclone serve sftp remote:path [flags]
      -

      Options

      -
            --addr string                            IPaddress:Port or :Port to bind server to (default "localhost:2022")
      -      --auth-proxy string                      A program to use to create the backend from the auth
      -      --authorized-keys string                 Authorized keys file (default "~/.ssh/authorized_keys")
      +
      rclone serve s3 remote:path [flags]
      +

      Options

      +
            --addr stringArray                       IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080])
      +      --allow-origin string                    Origin which cross-domain request (CORS) can be executed from
      +      --auth-key stringArray                   Set key pair for v4 authorization: access_key_id,secret_access_key
      +      --baseurl string                         Prefix for URLs - leave blank for root
      +      --cert string                            TLS PEM key (concatenation of certificate and CA certificate)
      +      --client-ca string                       Client certificate authority to verify clients with
             --dir-cache-time Duration                Time to cache directory entries for (default 5m0s)
             --dir-perms FileMode                     Directory permissions (default 0777)
      +      --etag-hash string                       Which hash to use for the ETag, or auto or blank for off (default "MD5")
             --file-perms FileMode                    File permissions (default 0666)
      +      --force-path-style                       If true use path style access if false use virtual hosted style (default true) (default true)
             --gid uint32                             Override the gid field set by the filesystem (not supported on Windows) (default 1000)
      -  -h, --help                                   help for sftp
      -      --key stringArray                        SSH private host key file (Can be multi-valued, leave blank to auto generate)
      -      --no-auth                                Allow connections with no authentication if set
      +  -h, --help                                   help for s3
      +      --key string                             TLS PEM Private key
      +      --max-header-bytes int                   Maximum size of request header (default 4096)
      +      --min-tls-version string                 Minimum TLS version that is acceptable (default "tls1.0")
             --no-checksum                            Don't compare checksums on up/download
      +      --no-cleanup                             Not to cleanup empty folder after object is deleted
             --no-modtime                             Don't read/write the modification time (can speed things up)
             --no-seek                                Don't allow seeking in files
      -      --pass string                            Password for authentication
             --poll-interval Duration                 Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s)
             --read-only                              Only allow read-only access
      -      --stdio                                  Run an sftp server on stdin/stdout
      +      --server-read-timeout Duration           Timeout for server reading data (default 1h0m0s)
      +      --server-write-timeout Duration          Timeout for server writing data (default 1h0m0s)
             --uid uint32                             Override the uid field set by the filesystem (not supported on Windows) (default 1000)
             --umask int                              Override the permission bits set by the filesystem (not supported on Windows) (default 2)
      -      --user string                            User name for authentication
             --vfs-cache-max-age Duration             Max time since last access of objects in the cache (default 1h0m0s)
             --vfs-cache-max-size SizeSuffix          Max total size of objects in the cache (default off)
             --vfs-cache-min-free-space SizeSuffix    Target minimum free space on the disk containing the cache (default off)
      @@ -4816,10 +5118,11 @@ 

      Options

      --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s)
      -

      Filter Options

      +

      Filter Options

      Flags for filtering directory listings.

            --delete-excluded                     Delete files on dest excluded from sync
             --exclude stringArray                 Exclude files matching pattern
      @@ -4844,13 +5147,244 @@ 

      Filter Options

      --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)

      See the global flags page for global options not listed here.

      -

      SEE ALSO

      +

      SEE ALSO

      + +

      rclone serve sftp

      +

      Serve the remote over SFTP.

      +

      Synopsis

      +

      Run an SFTP server to serve a remote over SFTP. This can be used with an SFTP client or you can make a remote of type sftp to use with it.

      +

      You can use the filter flags (e.g. --include, --exclude) to control what is served.

      +

      The server will respond to a small number of shell commands, mainly md5sum, sha1sum and df, which enable it to provide support for checksums and the about feature when accessed from an sftp remote.

      +

      Note that this server uses standard 32 KiB packet payload size, which means you must not configure the client to expect anything else, e.g. with the chunk_size option on an sftp remote.

      +

      The server will log errors. Use -v to see access logs.

      +

      --bwlimit will be respected for file transfers. Use --stats to control the stats printing.

      +

      You must provide some means of authentication, either with --user/--pass, an authorized keys file (specify location with --authorized-keys - the default is the same as ssh), an --auth-proxy, or set the --no-auth flag for no authentication when logging in.

      +

      If you don't supply a host --key then rclone will generate rsa, ecdsa and ed25519 variants, and cache them for later use in rclone's cache directory (see rclone help flags cache-dir) in the "serve-sftp" directory.

      +

      By default the server binds to localhost:2022 - if you want it to be reachable externally then supply --addr :2022 for example.

      +

      Note that the default of --vfs-cache-mode off is fine for the rclone sftp backend, but it may not be with other SFTP clients.

      +

      If --stdio is specified, rclone will serve SFTP over stdio, which can be used with sshd via ~/.ssh/authorized_keys, for example:

      +
      restrict,command="rclone serve sftp --stdio ./photos" ssh-rsa ...
      +

      On the client you need to set --transfers 1 when using --stdio. Otherwise multiple instances of the rclone server are started by OpenSSH which can lead to "corrupted on transfer" errors. This is the case because the client chooses indiscriminately which server to send commands to while the servers all have different views of the state of the filing system.

      +

      The "restrict" in authorized_keys prevents SHA1SUMs and MD5SUMs from being used. Omitting "restrict" and using --sftp-path-override to enable checksumming is possible but less secure and you could use the SFTP server provided by OpenSSH in this case.

      +

      VFS - Virtual File System

      +

      This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing system.

      +

      Cloud storage objects have lots of properties which aren't like disk files - you can't extend them or write to the middle of them, so the VFS layer has to deal with that. Because there is no one right way of doing this there are various options explained below.

      +

      The VFS layer also implements a directory cache - this caches info about files and directories (but not the data) in memory.

      +

      VFS Directory Cache

      +

      Using the --dir-cache-time flag, you can control how long a directory should be considered up to date and not refreshed from the backend. Changes made through the VFS will appear immediately or invalidate the cache.

      +
      --dir-cache-time duration   Time to cache directory entries for (default 5m0s)
      +--poll-interval duration    Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable (default 1m0s)
      +

      However, changes made directly on the cloud storage by the web interface or a different copy of rclone will only be picked up once the directory cache expires if the backend configured does not support polling for changes. If the backend supports polling, changes will be picked up within the polling interval.

      +

      You can send a SIGHUP signal to rclone for it to flush all directory caches, regardless of how old they are. Assuming only one rclone instance is running, you can reset the cache like this:

      +
      kill -SIGHUP $(pidof rclone)
      +

      If you configure rclone with a remote control then you can use rclone rc to flush the whole directory cache:

      +
      rclone rc vfs/forget
      +

      Or individual files or directories:

      +
      rclone rc vfs/forget file=path/to/file dir=path/to/dir
      +

      VFS File Buffering

      +

      The --buffer-size flag determines the amount of memory, that will be used to buffer data in advance.

      +

      Each open file will try to keep the specified amount of data in memory at all times. The buffered data is bound to one open file and won't be shared.

      +

      This flag is a upper limit for the used memory per open file. The buffer will only use memory for data that is downloaded but not not yet read. If the buffer is empty, only a small amount of memory will be used.

      +

      The maximum memory used by rclone for buffering can be up to --buffer-size * open files.

      +

      VFS File Caching

      +

      These flags control the VFS file caching options. File caching is necessary to make the VFS layer appear compatible with a normal file system. It can be disabled at the cost of some compatibility.

      +

      For example you'll need to enable VFS caching if you want to read and write simultaneously to a file. See below for more details.

      +

      Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both.

      +
      --cache-dir string                     Directory rclone will use for caching.
      +--vfs-cache-mode CacheMode             Cache mode off|minimal|writes|full (default off)
      +--vfs-cache-max-age duration           Max time since last access of objects in the cache (default 1h0m0s)
      +--vfs-cache-max-size SizeSuffix        Max total size of objects in the cache (default off)
      +--vfs-cache-min-free-space SizeSuffix  Target minimum free space on the disk containing the cache (default off)
      +--vfs-cache-poll-interval duration     Interval to poll the cache for stale objects (default 1m0s)
      +--vfs-write-back duration              Time to writeback files after last use when using cache (default 5s)
      +

      If run with -vv rclone will print the location of the file cache. The files are stored in the user cache file area which is OS dependent but can be controlled with --cache-dir or setting the appropriate environment variable.

      +

      The cache has 4 different modes selected by --vfs-cache-mode. The higher the cache mode the more compatible rclone becomes at the cost of using disk space.

      +

      Note that files are written back to the remote only when they are closed and if they haven't been accessed for --vfs-write-back seconds. If rclone is quit or dies with files that haven't been uploaded, these will be uploaded next time rclone is run with the same flags.

      +

      If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the cache may exceed these quotas for two reasons. Firstly because it is only checked every --vfs-cache-poll-interval. Secondly because open files cannot be evicted from the cache. When --vfs-cache-max-size or --vfs-cache-min-free-size is exceeded, rclone will attempt to evict the least accessed files from the cache first. rclone will start with files that haven't been accessed for the longest. This cache flushing strategy is efficient and more relevant files are likely to remain cached.

      +

      The --vfs-cache-max-age will evict files from the cache after the set time since last access has passed. The default value of 1 hour will start evicting files from cache that haven't been accessed for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 and will wait for 1 more hour before evicting. Specify the time with standard notation, s, m, h, d, w .

      +

      You should not run two copies of rclone using the same VFS cache with the same or overlapping remotes if using --vfs-cache-mode > off. This can potentially cause data corruption if you do. You can work around this by giving each rclone its own cache hierarchy with --cache-dir. You don't need to worry about this if the remotes in use don't overlap.

      +

      --vfs-cache-mode off

      +

      In this mode (the default) the cache will read directly from the remote and write directly to the remote without caching anything on disk.

      +

      This will mean some operations are not possible

      +
        +
      • Files can't be opened for both read AND write
      • +
      • Files opened for write can't be seeked
      • +
      • Existing files opened for write must have O_TRUNC set
      • +
      • Files open for read with O_TRUNC will be opened write only
      • +
      • Files open for write only will behave as if O_TRUNC was supplied
      • +
      • Open modes O_APPEND, O_TRUNC are ignored
      • +
      • If an upload fails it can't be retried
      • +
      +

      --vfs-cache-mode minimal

      +

      This is very similar to "off" except that files opened for read AND write will be buffered to disk. This means that files opened for write will be a lot more compatible, but uses the minimal disk space.

      +

      These operations are not possible

      +
        +
      • Files opened for write only can't be seeked
      • +
      • Existing files opened for write must have O_TRUNC set
      • +
      • Files opened for write only will ignore O_APPEND, O_TRUNC
      • +
      • If an upload fails it can't be retried
      • +
      +

      --vfs-cache-mode writes

      +

      In this mode files opened for read only are still read directly from the remote, write only and read/write files are buffered to disk first.

      +

      This mode should support all normal file system operations.

      +

      If an upload fails it will be retried at exponentially increasing intervals up to 1 minute.

      +

      --vfs-cache-mode full

      +

      In this mode all reads and writes are buffered to and from disk. When data is read from the remote this is buffered to disk as well.

      +

      In this mode the files in the cache will be sparse files and rclone will keep track of which bits of the files it has downloaded.

      +

      So if an application only reads the starts of each file, then rclone will only buffer the start of the file. These files will appear to be their full size in the cache, but they will be sparse files with only the data that has been downloaded present in them.

      +

      This mode should support all normal file system operations and is otherwise identical to --vfs-cache-mode writes.

      +

      When reading a file rclone will read --buffer-size plus --vfs-read-ahead bytes ahead. The --buffer-size is buffered in memory whereas the --vfs-read-ahead is buffered on disk.

      +

      When using this mode it is recommended that --buffer-size is not set too large and --vfs-read-ahead is set large if required.

      +

      IMPORTANT not all file systems support sparse files. In particular FAT/exFAT do not. Rclone will perform very badly if the cache directory is on a filesystem which doesn't support sparse files and it will log an ERROR message if one is detected.

      +

      Fingerprinting

      +

      Various parts of the VFS use fingerprinting to see if a local file copy has changed relative to a remote file. Fingerprints are made from:

      +
        +
      • size
      • +
      • modification time
      • +
      • hash
      • +
      +

      where available on an object.

      +

      On some backends some of these attributes are slow to read (they take an extra API call per object, or extra work per object).

      +

      For example hash is slow with the local and sftp backends as they have to read the entire file and hash it, and modtime is slow with the s3, swift, ftp and qinqstor backends because they need to do an extra API call to fetch it.

      +

      If you use the --vfs-fast-fingerprint flag then rclone will not include the slow operations in the fingerprint. This makes the fingerprinting less accurate but much faster and will improve the opening time of cached files.

      +

      If you are running a vfs cache over local, s3 or swift backends then using this flag is recommended.

      +

      Note that if you change the value of this flag, the fingerprints of the files in the cache may be invalidated and the files will need to be downloaded again.

      +

      VFS Chunked Reading

      +

      When rclone reads files from a remote it reads them in chunks. This means that rather than requesting the whole file rclone reads the chunk specified. This can reduce the used download quota for some remotes by requesting only chunks from the remote that are actually read, at the cost of an increased number of requests.

      +

      These flags control the chunking:

      +
      --vfs-read-chunk-size SizeSuffix        Read the source objects in chunks (default 128M)
      +--vfs-read-chunk-size-limit SizeSuffix  Max chunk doubling size (default off)
      +

      Rclone will start reading a chunk of size --vfs-read-chunk-size, and then double the size for each read. When --vfs-read-chunk-size-limit is specified, and greater than --vfs-read-chunk-size, the chunk size for each open file will get doubled only until the specified value is reached. If the value is "off", which is the default, the limit is disabled and the chunk size will grow indefinitely.

      +

      With --vfs-read-chunk-size 100M and --vfs-read-chunk-size-limit 0 the following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on. When --vfs-read-chunk-size-limit 500M is specified, the result would be 0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on.

      +

      Setting --vfs-read-chunk-size to 0 or "off" disables chunked reading.

      +

      VFS Performance

      +

      These flags may be used to enable/disable features of the VFS for performance or other reasons. See also the chunked reading feature.

      +

      In particular S3 and Swift benefit hugely from the --no-modtime flag (or use --use-server-modtime for a slightly different effect) as each read of the modification time takes a transaction.

      +
      --no-checksum     Don't compare checksums on up/download.
      +--no-modtime      Don't read/write the modification time (can speed things up).
      +--no-seek         Don't allow seeking in files.
      +--read-only       Only allow read-only access.
      +

      Sometimes rclone is delivered reads or writes out of order. Rather than seeking rclone will wait a short time for the in sequence read or write to come in. These flags only come into effect when not using an on disk cache file.

      +
      --vfs-read-wait duration   Time to wait for in-sequence read before seeking (default 20ms)
      +--vfs-write-wait duration  Time to wait for in-sequence write before giving error (default 1s)
      +

      When using VFS write caching (--vfs-cache-mode with value writes or full), the global flag --transfers can be set to adjust the number of parallel uploads of modified files from the cache (the related global flag --checkers has no effect on the VFS).

      +
      --transfers int  Number of file transfers to run in parallel (default 4)
      +

      VFS Case Sensitivity

      +

      Linux file systems are case-sensitive: two files can differ only by case, and the exact case must be used when opening a file.

      +

      File systems in modern Windows are case-insensitive but case-preserving: although existing files can be opened using any case, the exact case used to create the file is preserved and available for programs to query. It is not allowed for two files in the same directory to differ only by case.

      +

      Usually file systems on macOS are case-insensitive. It is possible to make macOS file systems case-sensitive but that is not the default.

      +

      The --vfs-case-insensitive VFS flag controls how rclone handles these two cases. If its value is "false", rclone passes file names to the remote as-is. If the flag is "true" (or appears without a value on the command line), rclone may perform a "fixup" as explained below.

      +

      The user may specify a file name to open/delete/rename/etc with a case different than what is stored on the remote. If an argument refers to an existing file with exactly the same name, then the case of the existing file on the disk will be used. However, if a file name with exactly the same name is not found but a name differing only by case exists, rclone will transparently fixup the name. This fixup happens only when an existing file is requested. Case sensitivity of file names created anew by rclone is controlled by the underlying remote.

      +

      Note that case sensitivity of the operating system running rclone (the target) may differ from case sensitivity of a file system presented by rclone (the source). The flag controls whether "fixup" is performed to satisfy the target.

      +

      If the flag is not provided on the command line, then its default value depends on the operating system where rclone runs: "true" on Windows and macOS, "false" otherwise. If the flag is provided without a value, then it is "true".

      +

      VFS Disk Options

      +

      This flag allows you to manually set the statistics about the filing system. It can be useful when those statistics cannot be read correctly automatically.

      +
      --vfs-disk-space-total-size    Manually set the total disk space size (example: 256G, default: -1)
      +

      Alternate report of used bytes

      +

      Some backends, most notably S3, do not report the amount of bytes used. If you need this information to be available when running df on the filesystem, then pass the flag --vfs-used-is-size to rclone. With this flag set, instead of relying on the backend to report this information, rclone will scan the whole remote similar to rclone size and compute the total used space itself.

      +

      WARNING. Contrary to rclone size, this flag ignores filters so that the result is accurate. However, this is very inefficient and may cost lots of API calls resulting in extra charges. Use it as a last resort and only with caching.

      +

      Auth Proxy

      +

      If you supply the parameter --auth-proxy /path/to/program then rclone will use that program to generate backends on the fly which then are used to authenticate incoming requests. This uses a simple JSON based protocol with input on STDIN and output on STDOUT.

      +

      PLEASE NOTE: --auth-proxy and --authorized-keys cannot be used together, if --auth-proxy is set the authorized keys option will be ignored.

      +

      There is an example program bin/test_proxy.py in the rclone source code.

      +

      The program's job is to take a user and pass on the input and turn those into the config for a backend on STDOUT in JSON format. This config will have any default parameters for the backend added, but it won't use configuration from environment variables or command line options - it is the job of the proxy program to make a complete config.

      +

      This config generated must have this extra parameter - _root - root to use for the backend

      +

      And it may have this parameter - _obscure - comma separated strings for parameters to obscure

      +

      If password authentication was used by the client, input to the proxy process (on STDIN) would look similar to this:

      +
      {
      +    "user": "me",
      +    "pass": "mypassword"
      +}
      +

      If public-key authentication was used by the client, input to the proxy process (on STDIN) would look similar to this:

      +
      {
      +    "user": "me",
      +    "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDuwESFdAe14hVS6omeyX7edc...JQdf"
      +}
      +

      And as an example return this on STDOUT

      +
      {
      +    "type": "sftp",
      +    "_root": "",
      +    "_obscure": "pass",
      +    "user": "me",
      +    "pass": "mypassword",
      +    "host": "sftp.example.com"
      +}
      +

      This would mean that an SFTP backend would be created on the fly for the user and pass/public_key returned in the output to the host given. Note that since _obscure is set to pass, rclone will obscure the pass parameter before creating the backend (which is required for sftp backends).

      +

      The program can manipulate the supplied user in any way, for example to make proxy to many different sftp backends, you could make the user be user@example.com and then set the host to example.com in the output and the user to user. For security you'd probably want to restrict the host to a limited list.

      +

      Note that an internal cache is keyed on user so only use that for configuration, don't use pass or public_key. This also means that if a user's password or public-key is changed the cache will need to expire (which takes 5 mins) before it takes effect.

      +

      This can be used to build general purpose proxies to any kind of backend that rclone supports.

      +
      rclone serve sftp remote:path [flags]
      +

      Options

      +
            --addr string                            IPaddress:Port or :Port to bind server to (default "localhost:2022")
      +      --auth-proxy string                      A program to use to create the backend from the auth
      +      --authorized-keys string                 Authorized keys file (default "~/.ssh/authorized_keys")
      +      --dir-cache-time Duration                Time to cache directory entries for (default 5m0s)
      +      --dir-perms FileMode                     Directory permissions (default 0777)
      +      --file-perms FileMode                    File permissions (default 0666)
      +      --gid uint32                             Override the gid field set by the filesystem (not supported on Windows) (default 1000)
      +  -h, --help                                   help for sftp
      +      --key stringArray                        SSH private host key file (Can be multi-valued, leave blank to auto generate)
      +      --no-auth                                Allow connections with no authentication if set
      +      --no-checksum                            Don't compare checksums on up/download
      +      --no-modtime                             Don't read/write the modification time (can speed things up)
      +      --no-seek                                Don't allow seeking in files
      +      --pass string                            Password for authentication
      +      --poll-interval Duration                 Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s)
      +      --read-only                              Only allow read-only access
      +      --stdio                                  Run an sftp server on stdin/stdout
      +      --uid uint32                             Override the uid field set by the filesystem (not supported on Windows) (default 1000)
      +      --umask int                              Override the permission bits set by the filesystem (not supported on Windows) (default 2)
      +      --user string                            User name for authentication
      +      --vfs-cache-max-age Duration             Max time since last access of objects in the cache (default 1h0m0s)
      +      --vfs-cache-max-size SizeSuffix          Max total size of objects in the cache (default off)
      +      --vfs-cache-min-free-space SizeSuffix    Target minimum free space on the disk containing the cache (default off)
      +      --vfs-cache-mode CacheMode               Cache mode off|minimal|writes|full (default off)
      +      --vfs-cache-poll-interval Duration       Interval to poll the cache for stale objects (default 1m0s)
      +      --vfs-case-insensitive                   If a file name not found, find a case insensitive match
      +      --vfs-disk-space-total-size SizeSuffix   Specify the total space of disk (default off)
      +      --vfs-fast-fingerprint                   Use fast (less accurate) fingerprints for change detection
      +      --vfs-read-ahead SizeSuffix              Extra read ahead over --buffer-size when using cache-mode full
      +      --vfs-read-chunk-size SizeSuffix         Read the source objects in chunks (default 128Mi)
      +      --vfs-read-chunk-size-limit SizeSuffix   If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off)
      +      --vfs-read-wait Duration                 Time to wait for in-sequence read before seeking (default 20ms)
      +      --vfs-refresh                            Refreshes the directory cache recursively on start
      +      --vfs-used-is-size rclone size           Use the rclone size algorithm for Used size
      +      --vfs-write-back Duration                Time to writeback files after last use when using cache (default 5s)
      +      --vfs-write-wait Duration                Time to wait for in-sequence write before giving error (default 1s)
      +

      Filter Options

      +

      Flags for filtering directory listings.

      +
            --delete-excluded                     Delete files on dest excluded from sync
      +      --exclude stringArray                 Exclude files matching pattern
      +      --exclude-from stringArray            Read file exclude patterns from file (use - to read from stdin)
      +      --exclude-if-present stringArray      Exclude directories if filename is present
      +      --files-from stringArray              Read list of source-file names from file (use - to read from stdin)
      +      --files-from-raw stringArray          Read list of source-file names from file without any processing of lines (use - to read from stdin)
      +  -f, --filter stringArray                  Add a file filtering rule
      +      --filter-from stringArray             Read file filtering patterns from a file (use - to read from stdin)
      +      --ignore-case                         Ignore case in filters (case insensitive)
      +      --include stringArray                 Include files matching pattern
      +      --include-from stringArray            Read file include patterns from file (use - to read from stdin)
      +      --max-age Duration                    Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
      +      --max-depth int                       If set limits the recursion depth to this (default -1)
      +      --max-size SizeSuffix                 Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
      +      --metadata-exclude stringArray        Exclude metadatas matching pattern
      +      --metadata-exclude-from stringArray   Read metadata exclude patterns from file (use - to read from stdin)
      +      --metadata-filter stringArray         Add a metadata filtering rule
      +      --metadata-filter-from stringArray    Read metadata filtering patterns from a file (use - to read from stdin)
      +      --metadata-include stringArray        Include metadatas matching pattern
      +      --metadata-include-from stringArray   Read metadata include patterns from file (use - to read from stdin)
      +      --min-age Duration                    Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
      +      --min-size SizeSuffix                 Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
      +

      See the global flags page for global options not listed here.

      +

      SEE ALSO

      rclone serve webdav

      Serve remote:path over WebDAV.

      -

      Synopsis

      +

      Synopsis

      Run a basic WebDAV server to serve a remote over HTTP via the WebDAV protocol. This can be viewed with a WebDAV client, through a web browser, or you can make a remote of type WebDAV to read and write it.

      WebDAV options

      --etag-hash

      @@ -4861,7 +5395,7 @@

      Access WebDAV on Windows

      Access Office applications on WebDAV

      Navigate to following registry HKEY_CURRENT_USER[14.0/15.0/16.0] Create a new DWORD BasicAuthLevel with value 2. 0 - Basic authentication disabled 1 - Basic authentication enabled for SSL connections only 2 - Basic authentication enabled for SSL and for non-SSL connections

      https://learn.microsoft.com/en-us/office/troubleshoot/powerpoint/office-opens-blank-from-sharepoint

      -

      Server options

      +

      Server options

      Use --addr to specify which IP address and port the server should listen on, eg --addr 1.2.3.4:8000 or --addr :8080 to listen to all IPs. By default it only listens on localhost. You can use port :0 to let the OS choose an available port.

      If you set --addr to listen on a public or LAN accessible IP address then using Authentication is advised - see the next section for info.

      You can use a unix socket by setting the url to unix:///path/to/socket or just by using an absolute path name. Note that unix sockets bypass the authentication - this is expected to be done with file system permissions.

      @@ -4869,7 +5403,7 @@

      Server options

      --server-read-timeout and --server-write-timeout can be used to control the timeouts on the server. Note that this is the total time for a transfer.

      --max-header-bytes controls the maximum number of bytes the server will accept in the HTTP header.

      --baseurl controls the URL prefix that rclone serves from. By default rclone will serve from the root. If you used --baseurl "/rclone" then rclone would serve from a URL starting with "/rclone/". This is useful if you wish to proxy rclone serve. Rclone automatically inserts leading and trailing "/" on --baseurl, so --baseurl "rclone", --baseurl "/rclone" and --baseurl "/rclone/" are all treated identically.

      -

      TLS (SSL)

      +

      TLS (SSL)

      By default this will serve over http. If you want you can serve over https. You will need to supply the --cert and --key flags. If you wish to do client side certificate validation then you will need to supply --client-ca also.

      --cert should be a either a PEM encoded certificate or a concatenation of that with the CA certificate. --key should be the PEM encoded private key and --client-ca should be the PEM encoded client certificate authority certificate.

      --min-tls-version is minimum TLS version that is acceptable. Valid values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default "tls1.0").

      @@ -4953,6 +5487,37 @@

      Template

      +

      The server also makes the following functions available so that they can be used within the template. These functions help extend the options for dynamic rendering of HTML. They can be used to render HTML based on specific conditions.

      + ++++ + + + + + + + + + + + + + + + + + + + + + + + + +
      FunctionDescription
      afterEpochReturns the time since the epoch for the given time.
      containsChecks whether a given substring is present or not in a given string.
      hasPrefixChecks whether the given string begins with the specified prefix.
      hasSuffixChecks whether the given string end with the specified suffix.

      Authentication

      By default this will serve files without needing a login.

      You can either use an htpasswd file which can take lots of users, or set a single username and password with the --user and --pass flags.

      @@ -4964,12 +5529,11 @@

      Authentication

      htpasswd -B htpasswd anotherUser

      The password file can be updated while rclone is running.

      Use --realm to set the authentication realm.

      -

      Use --salt to change the password hashing salt from the default.

      -

      VFS - Virtual File System

      +

      Use --salt to change the password hashing salt from the default. ## VFS - Virtual File System

      This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing system.

      Cloud storage objects have lots of properties which aren't like disk files - you can't extend them or write to the middle of them, so the VFS layer has to deal with that. Because there is no one right way of doing this there are various options explained below.

      The VFS layer also implements a directory cache - this caches info about files and directories (but not the data) in memory.

      -

      VFS Directory Cache

      +

      VFS Directory Cache

      Using the --dir-cache-time flag, you can control how long a directory should be considered up to date and not refreshed from the backend. Changes made through the VFS will appear immediately or invalidate the cache.

      --dir-cache-time duration   Time to cache directory entries for (default 5m0s)
       --poll-interval duration    Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable (default 1m0s)
      @@ -4980,12 +5544,12 @@

      VFS Directory Cache

      rclone rc vfs/forget

      Or individual files or directories:

      rclone rc vfs/forget file=path/to/file dir=path/to/dir
      -

      VFS File Buffering

      +

      VFS File Buffering

      The --buffer-size flag determines the amount of memory, that will be used to buffer data in advance.

      Each open file will try to keep the specified amount of data in memory at all times. The buffered data is bound to one open file and won't be shared.

      This flag is a upper limit for the used memory per open file. The buffer will only use memory for data that is downloaded but not not yet read. If the buffer is empty, only a small amount of memory will be used.

      The maximum memory used by rclone for buffering can be up to --buffer-size * open files.

      -

      VFS File Caching

      +

      VFS File Caching

      These flags control the VFS file caching options. File caching is necessary to make the VFS layer appear compatible with a normal file system. It can be disabled at the cost of some compatibility.

      For example you'll need to enable VFS caching if you want to read and write simultaneously to a file. See below for more details.

      Note that the VFS cache is separate from the cache backend and you may find that you need one or the other or both.

      @@ -5002,7 +5566,7 @@

      VFS File Caching

      If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the cache may exceed these quotas for two reasons. Firstly because it is only checked every --vfs-cache-poll-interval. Secondly because open files cannot be evicted from the cache. When --vfs-cache-max-size or --vfs-cache-min-free-size is exceeded, rclone will attempt to evict the least accessed files from the cache first. rclone will start with files that haven't been accessed for the longest. This cache flushing strategy is efficient and more relevant files are likely to remain cached.

      The --vfs-cache-max-age will evict files from the cache after the set time since last access has passed. The default value of 1 hour will start evicting files from cache that haven't been accessed for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 and will wait for 1 more hour before evicting. Specify the time with standard notation, s, m, h, d, w .

      You should not run two copies of rclone using the same VFS cache with the same or overlapping remotes if using --vfs-cache-mode > off. This can potentially cause data corruption if you do. You can work around this by giving each rclone its own cache hierarchy with --cache-dir. You don't need to worry about this if the remotes in use don't overlap.

      -

      --vfs-cache-mode off

      +

      --vfs-cache-mode off

      In this mode (the default) the cache will read directly from the remote and write directly to the remote without caching anything on disk.

      This will mean some operations are not possible

        @@ -5014,7 +5578,7 @@

        --vfs-cache-mode off

      • Open modes O_APPEND, O_TRUNC are ignored
      • If an upload fails it can't be retried
      -

      --vfs-cache-mode minimal

      +

      --vfs-cache-mode minimal

      This is very similar to "off" except that files opened for read AND write will be buffered to disk. This means that files opened for write will be a lot more compatible, but uses the minimal disk space.

      These operations are not possible

        @@ -5023,11 +5587,11 @@

        --vfs-cache-mode minimal

      • Files opened for write only will ignore O_APPEND, O_TRUNC
      • If an upload fails it can't be retried
      -

      --vfs-cache-mode writes

      +

      --vfs-cache-mode writes

      In this mode files opened for read only are still read directly from the remote, write only and read/write files are buffered to disk first.

      This mode should support all normal file system operations.

      If an upload fails it will be retried at exponentially increasing intervals up to 1 minute.

      -

      --vfs-cache-mode full

      +

      --vfs-cache-mode full

      In this mode all reads and writes are buffered to and from disk. When data is read from the remote this is buffered to disk as well.

      In this mode the files in the cache will be sparse files and rclone will keep track of which bits of the files it has downloaded.

      So if an application only reads the starts of each file, then rclone will only buffer the start of the file. These files will appear to be their full size in the cache, but they will be sparse files with only the data that has been downloaded present in them.

      @@ -5035,7 +5599,7 @@

      --vfs-cache-mode full

      When reading a file rclone will read --buffer-size plus --vfs-read-ahead bytes ahead. The --buffer-size is buffered in memory whereas the --vfs-read-ahead is buffered on disk.

      When using this mode it is recommended that --buffer-size is not set too large and --vfs-read-ahead is set large if required.

      IMPORTANT not all file systems support sparse files. In particular FAT/exFAT do not. Rclone will perform very badly if the cache directory is on a filesystem which doesn't support sparse files and it will log an ERROR message if one is detected.

      -

      Fingerprinting

      +

      Fingerprinting

      Various parts of the VFS use fingerprinting to see if a local file copy has changed relative to a remote file. Fingerprints are made from:

      • size
      • @@ -5048,7 +5612,7 @@

        Fingerprinting

        If you use the --vfs-fast-fingerprint flag then rclone will not include the slow operations in the fingerprint. This makes the fingerprinting less accurate but much faster and will improve the opening time of cached files.

        If you are running a vfs cache over local, s3 or swift backends then using this flag is recommended.

        Note that if you change the value of this flag, the fingerprints of the files in the cache may be invalidated and the files will need to be downloaded again.

        -

        VFS Chunked Reading

        +

        VFS Chunked Reading

        When rclone reads files from a remote it reads them in chunks. This means that rather than requesting the whole file rclone reads the chunk specified. This can reduce the used download quota for some remotes by requesting only chunks from the remote that are actually read, at the cost of an increased number of requests.

        These flags control the chunking:

        --vfs-read-chunk-size SizeSuffix        Read the source objects in chunks (default 128M)
        @@ -5056,7 +5620,7 @@ 

        VFS Chunked Reading

        Rclone will start reading a chunk of size --vfs-read-chunk-size, and then double the size for each read. When --vfs-read-chunk-size-limit is specified, and greater than --vfs-read-chunk-size, the chunk size for each open file will get doubled only until the specified value is reached. If the value is "off", which is the default, the limit is disabled and the chunk size will grow indefinitely.

        With --vfs-read-chunk-size 100M and --vfs-read-chunk-size-limit 0 the following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on. When --vfs-read-chunk-size-limit 500M is specified, the result would be 0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on.

        Setting --vfs-read-chunk-size to 0 or "off" disables chunked reading.

        -

        VFS Performance

        +

        VFS Performance

        These flags may be used to enable/disable features of the VFS for performance or other reasons. See also the chunked reading feature.

        In particular S3 and Swift benefit hugely from the --no-modtime flag (or use --use-server-modtime for a slightly different effect) as each read of the modification time takes a transaction.

        --no-checksum     Don't compare checksums on up/download.
        @@ -5068,7 +5632,7 @@ 

        VFS Performance

        --vfs-write-wait duration Time to wait for in-sequence write before giving error (default 1s)

        When using VFS write caching (--vfs-cache-mode with value writes or full), the global flag --transfers can be set to adjust the number of parallel uploads of modified files from the cache (the related global flag --checkers has no effect on the VFS).

        --transfers int  Number of file transfers to run in parallel (default 4)
        -

        VFS Case Sensitivity

        +

        VFS Case Sensitivity

        Linux file systems are case-sensitive: two files can differ only by case, and the exact case must be used when opening a file.

        File systems in modern Windows are case-insensitive but case-preserving: although existing files can be opened using any case, the exact case used to create the file is preserved and available for programs to query. It is not allowed for two files in the same directory to differ only by case.

        Usually file systems on macOS are case-insensitive. It is possible to make macOS file systems case-sensitive but that is not the default.

        @@ -5076,10 +5640,10 @@

        VFS Case Sensitivity

        The user may specify a file name to open/delete/rename/etc with a case different than what is stored on the remote. If an argument refers to an existing file with exactly the same name, then the case of the existing file on the disk will be used. However, if a file name with exactly the same name is not found but a name differing only by case exists, rclone will transparently fixup the name. This fixup happens only when an existing file is requested. Case sensitivity of file names created anew by rclone is controlled by the underlying remote.

        Note that case sensitivity of the operating system running rclone (the target) may differ from case sensitivity of a file system presented by rclone (the source). The flag controls whether "fixup" is performed to satisfy the target.

        If the flag is not provided on the command line, then its default value depends on the operating system where rclone runs: "true" on Windows and macOS, "false" otherwise. If the flag is provided without a value, then it is "true".

        -

        VFS Disk Options

        +

        VFS Disk Options

        This flag allows you to manually set the statistics about the filing system. It can be useful when those statistics cannot be read correctly automatically.

        --vfs-disk-space-total-size    Manually set the total disk space size (example: 256G, default: -1)
        -

        Alternate report of used bytes

        +

        Alternate report of used bytes

        Some backends, most notably S3, do not report the amount of bytes used. If you need this information to be available when running df on the filesystem, then pass the flag --vfs-used-is-size to rclone. With this flag set, instead of relying on the backend to report this information, rclone will scan the whole remote similar to rclone size and compute the total used space itself.

        WARNING. Contrary to rclone size, this flag ignores filters so that the result is accurate. However, this is very inefficient and may cost lots of API calls resulting in extra charges. Use it as a last resort and only with caching.

        Auth Proxy

        @@ -5113,7 +5677,7 @@

        Auth Proxy

        Note that an internal cache is keyed on user so only use that for configuration, don't use pass or public_key. This also means that if a user's password or public-key is changed the cache will need to expire (which takes 5 mins) before it takes effect.

        This can be used to build general purpose proxies to any kind of backend that rclone supports.

        rclone serve webdav remote:path [flags]
        -

        Options

        +

        Options

              --addr stringArray                       IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080])
               --allow-origin string                    Origin which cross-domain request (CORS) can be executed from
               --auth-proxy string                      A program to use to create the backend from the auth
        @@ -5157,10 +5721,11 @@ 

        Options

        --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s)
        -

        Filter Options

        +

        Filter Options

        Flags for filtering directory listings.

              --delete-excluded                     Delete files on dest excluded from sync
               --exclude stringArray                 Exclude files matching pattern
        @@ -5185,13 +5750,13 @@ 

        Filter Options

        --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)

        See the global flags page for global options not listed here.

        -

        SEE ALSO

        +

        SEE ALSO

        rclone settier

        Changes storage class/tier of objects in remote.

        -

        Synopsis

        +

        Synopsis

        rclone settier changes storage tier or class at remote if supported. Few cloud storage services provides different storage classes on objects, for example AWS S3 and Glacier, Azure Blob storage - Hot, Cool and Archive, Google Cloud Storage, Regional Storage, Nearline, Coldline etc.

        Note that, certain tier changes make objects not available to access immediately. For example tiering to archive in azure blob storage makes objects in frozen state, user can restore by setting tier to Hot/Cool, similarly S3 to Glacier makes object inaccessible.true

        You can use it to tier single object

        @@ -5201,25 +5766,25 @@

        Synopsis

        Or just provide remote directory and all files in directory will be tiered

        rclone settier tier remote:path/dir
        rclone settier tier remote:path [flags]
        -

        Options

        +

        Options

          -h, --help   help for settier

        See the global flags page for global options not listed here.

        -

        SEE ALSO

        +

        SEE ALSO

        • rclone - Show help for rclone commands, flags and backends.

        rclone test

        Run a test command

        -

        Synopsis

        +

        Synopsis

        Rclone test is used to run test commands.

        Select which test command you want with the subcommand, eg

        rclone test memory remote:

        Each subcommand has its own options which you can see in their help.

        NB Be careful running these commands, they may do strange things so reading their documentation first is recommended.

        -

        Options

        +

        Options

          -h, --help   help for test

        See the global flags page for global options not listed here.

        -

        SEE ALSO

        +

        SEE ALSO

        • rclone - Show help for rclone commands, flags and backends.
        • rclone test changenotify - Log any change notify requests for the remote passed in.
        • @@ -5232,34 +5797,34 @@

          SEE ALSO

          rclone test changenotify

          Log any change notify requests for the remote passed in.

          rclone test changenotify remote: [flags]
          -

          Options

          +

          Options

            -h, --help                     help for changenotify
                 --poll-interval Duration   Time to wait between polling for changes (default 10s)

          See the global flags page for global options not listed here.

          -

          SEE ALSO

          +

          SEE ALSO

          rclone test histogram

          Makes a histogram of file name characters.

          -

          Synopsis

          +

          Synopsis

          This command outputs JSON which shows the histogram of characters used in filenames in the remote:path specified.

          The data doesn't contain any identifying information but is useful for the rclone developers when developing filename compression.

          rclone test histogram [remote:path] [flags]
          -

          Options

          +

          Options

            -h, --help   help for histogram

          See the global flags page for global options not listed here.

          -

          SEE ALSO

          +

          SEE ALSO

          rclone test info

          Discovers file name or other limitations for paths.

          -

          Synopsis

          +

          Synopsis

          rclone info discovers what filenames and upload methods are possible to write to the paths passed in and how long they can be. It can take some time. It will write test files into the remote:path passed in. It outputs a bit of go code for each one.

          NB this can create undeletable files and other hazards - use with care

          rclone test info [remote:path]+ [flags]
          -

          Options

          +

          Options

                --all                    Run all tests
                 --check-base32768        Check can store all possible base32768 characters
                 --check-control          Check control characters
          @@ -5270,14 +5835,14 @@ 

          Options

          --upload-wait Duration Wait after writing a file (default 0s) --write-json string Write results to file

          See the global flags page for global options not listed here.

          -

          SEE ALSO

          +

          SEE ALSO

          rclone test makefile

          Make files with random contents of the size given

          rclone test makefile <size> [<file>]+ [flags]
          -

          Options

          +

          Options

                --ascii      Fill files with random ASCII printable bytes only
                 --chargen    Fill files with a ASCII chargen pattern
             -h, --help       help for makefile
          @@ -5286,14 +5851,14 @@ 

          Options

          --sparse Make the files sparse (appear to be filled with ASCII 0x00) --zero Fill files with ASCII 0x00

          See the global flags page for global options not listed here.

          -

          SEE ALSO

          +

          SEE ALSO

          rclone test makefiles

          Make a random file hierarchy in a directory

          rclone test makefiles <dir> [flags]
          -

          Options

          +

          Options

                --ascii                      Fill files with random ASCII printable bytes only
                 --chargen                    Fill files with a ASCII chargen pattern
                 --files int                  Number of files to create (default 1000)
          @@ -5309,23 +5874,23 @@ 

          Options

          --sparse Make the files sparse (appear to be filled with ASCII 0x00) --zero Fill files with ASCII 0x00

          See the global flags page for global options not listed here.

          -

          SEE ALSO

          +

          SEE ALSO

          rclone test memory

          Load all the objects at remote:path into memory and report memory stats.

          rclone test memory remote:path [flags]
          -

          Options

          +

          Options

            -h, --help   help for memory

          See the global flags page for global options not listed here.

          -

          SEE ALSO

          +

          SEE ALSO

          rclone touch

          Create new file or change file modification time.

          -

          Synopsis

          +

          Synopsis

          Set the modification time on file(s) as specified by remote:path to have the current time.

          If remote:path does not exist then a zero sized file will be created, unless --no-create or --recursive is provided.

          If --recursive is used then recursively sets the modification time on all existing files that is found under the path. Filters are supported, and you can test with the --dry-run or the --interactive/-i flag.

          @@ -5337,7 +5902,7 @@

          Synopsis

        Note that value of --timestamp is in UTC. If you want local time then add the --localtime flag.

        rclone touch remote:path [flags]
        -

        Options

        +

        Options

          -h, --help               help for touch
               --localtime          Use localtime for timestamp, not UTC
           -C, --no-create          Do not create the file if it does not exist (implied with --recursive)
        @@ -5348,7 +5913,7 @@ 

        Important Options

          -n, --dry-run         Do a trial run with no permanent changes
           -i, --interactive     Enable interactive mode
           -v, --verbose count   Print lots more stuff (repeat for more)
        -

        Filter Options

        +

        Filter Options

        Flags for filtering directory listings.

              --delete-excluded                     Delete files on dest excluded from sync
               --exclude stringArray                 Exclude files matching pattern
        @@ -5377,13 +5942,13 @@ 

        Listing Options

              --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
               --fast-list           Use recursive list if available; uses more memory but fewer transactions

        See the global flags page for global options not listed here.

        -

        SEE ALSO

        +

        SEE ALSO

        • rclone - Show help for rclone commands, flags and backends.

        rclone tree

        List the contents of the remote in a tree like fashion.

        -

        Synopsis

        +

        Synopsis

        rclone tree lists the contents of a remote in a similar way to the unix tree command.

        For example

        $ rclone tree remote:path
        @@ -5400,7 +5965,7 @@ 

        Synopsis

        The tree command has many options for controlling the listing which are compatible with the tree command, for example you can include file sizes with --size. Note that not all of them have short options as they conflict with rclone's short options.

        For a more interactive navigation of the remote see the ncdu command.

        rclone tree remote:path [flags]
        -

        Options

        +

        Options

          -a, --all             All files are listed (list . files too)
           -d, --dirs-only       List directories only
               --dirsfirst       List directories before files (-U disables)
        @@ -5420,7 +5985,7 @@ 

        Options

        -r, --sort-reverse Reverse the order of the sort -U, --unsorted Leave files unsorted --version Sort files alphanumerically by version
        -

        Filter Options

        +

        Filter Options

        Flags for filtering directory listings.

              --delete-excluded                     Delete files on dest excluded from sync
               --exclude stringArray                 Exclude files matching pattern
        @@ -5449,7 +6014,7 @@ 

        Listing Options

              --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
               --fast-list           Use recursive list if available; uses more memory but fewer transactions

        See the global flags page for global options not listed here.

        -

        SEE ALSO

        +

        SEE ALSO

        • rclone - Show help for rclone commands, flags and backends.
        @@ -5570,6 +6135,7 @@

        Metadata support

        Rclone only supports a one-time sync of metadata. This means that metadata will be synced from the source object to the destination object only when the source object has changed and needs to be re-uploaded. If the metadata subsequently changes on the source object without changing the object itself then it won't be synced to the destination object. This is in line with the way rclone syncs Content-Type without the --metadata flag.

        Using --metadata when syncing from local to local will preserve file attributes such as file mode, owner, extended attributes (not Windows).

        Note that arbitrary metadata may be added to objects using the --metadata-set key=value flag when the object is first uploaded. This flag can be repeated as many times as necessary.

        +

        The --metadata-mapper flag can be used to pass the name of a program in which can transform metadata when it is being copied from source to destination.

        Types of metadata

        Metadata is divided into two type. System metadata and User metadata.

        Metadata which the backend uses itself is called system metadata. For example on the local backend the system metadata uid will store the user ID of the file when used on a unix based platform.

        @@ -5647,26 +6213,31 @@

        Standard system metadata

        2006-01-02T15:04:05.999999999Z07:00 +utime +Time of file upload: RFC 3339 +2006-01-02T15:04:05.999999999Z07:00 + + cache-control Cache-Control header no-cache - + content-disposition Content-Disposition header inline - + content-encoding Content-Encoding header gzip - + content-language Content-Language header en-US - + content-type Content-Type header text/plain @@ -5675,7 +6246,7 @@

        Standard system metadata

        The metadata keys mtime and content-type will take precedence if supplied in the metadata over reading the Content-Type or modification time of the source object.

        Hashes are not included in system metadata as there is a well defined way of reading those already.

        -

        Options

        +

        Options

        Rclone has a number of options to control its behaviour.

        Options that take parameters can have the values passed in two ways, --option=value or --option value. However boolean (true/false) options behave slightly differently to the other options in that --boolean sets the option to true and the absence of the flag sets it to false. It is also possible to specify --boolean=false or --boolean=true. Note that --boolean false is not valid - this is parsed as --boolean and the false is parsed as an extra command line argument for rclone.

        Time or duration options

        @@ -5925,7 +6496,7 @@

        --inplace

      • ftp
      • sftp
      -

      Without --inplace (the default) rclone will first upload to a temporary file with an extension like this where XXXXXX represents a random string.

      +

      Without --inplace (the default) rclone will first upload to a temporary file with an extension like this, where XXXXXX represents a random string and .partial is --partial-suffix value (.partial by default).

      original-file-name.XXXXXX.partial

      (rclone will make sure the final name is no longer than 100 characters by truncating the original-file-name part if necessary).

      When the upload is complete, rclone will rename the .partial file to the correct name, overwriting any existing file at that point. If the upload fails then the .partial file will be deleted.

      @@ -6006,9 +6577,81 @@

      --cutoff-mode=hard|soft|cautious

      Specifying --cutoff-mode=soft will stop starting new transfers when Rclone reaches the limit.

      Specifying --cutoff-mode=cautious will try to prevent Rclone from reaching the limit. Only applicable for --max-transfer

      -M, --metadata

      -

      Setting this flag enables rclone to copy the metadata from the source to the destination. For local backends this is ownership, permissions, xattr etc. See the #metadata for more info.

      +

      Setting this flag enables rclone to copy the metadata from the source to the destination. For local backends this is ownership, permissions, xattr etc. See the metadata section for more info.

      +

      --metadata-mapper SpaceSepList

      +

      If you supply the parameter --metadata-mapper /path/to/program then rclone will use that program to map metadata from source object to destination object.

      +

      The argument to this flag should be a command with an optional space separated list of arguments. If one of the arguments has a space in then enclose it in ", if you want a literal " in an argument then enclose the argument in " and double the ". See CSV encoding for more info.

      +
      --metadata-mapper "python bin/test_metadata_mapper.py"
      +--metadata-mapper 'python bin/test_metadata_mapper.py "argument with a space"'
      +--metadata-mapper 'python bin/test_metadata_mapper.py "argument with ""two"" quotes"'
      +

      This uses a simple JSON based protocol with input on STDIN and output on STDOUT. This will be called for every file and directory copied and may be called concurrently.

      +

      The program's job is to take a metadata blob on the input and turn it into a metadata blob on the output suitable for the destination backend.

      +

      Input to the program (via STDIN) might look like this. This provides some context for the Metadata which may be important.

      +
        +
      • SrcFs is the config string for the remote that the object is currently on.
      • +
      • SrcFsType is the name of the source backend.
      • +
      • DstFs is the config string for the remote that the object is being copied to
      • +
      • DstFsType is the name of the destination backend.
      • +
      • Remote is the path of the file relative to the root.
      • +
      • Size, MimeType, ModTime are attributes of the file.
      • +
      • IsDir is true if this is a directory (not yet implemented).
      • +
      • ID is the source ID of the file if known.
      • +
      • Metadata is the backend specific metadata as described in the backend docs.
      • +
      +
      {
      +    "SrcFs": "gdrive:",
      +    "SrcFsType": "drive",
      +    "DstFs": "newdrive:user",
      +    "DstFsType": "onedrive",
      +    "Remote": "test.txt",
      +    "Size": 6,
      +    "MimeType": "text/plain; charset=utf-8",
      +    "ModTime": "2022-10-11T17:53:10.286745272+01:00",
      +    "IsDir": false,
      +    "ID": "xyz",
      +    "Metadata": {
      +        "btime": "2022-10-11T16:53:11Z",
      +        "content-type": "text/plain; charset=utf-8",
      +        "mtime": "2022-10-11T17:53:10.286745272+01:00",
      +        "owner": "user1@domain1.com",
      +        "permissions": "...",
      +        "description": "my nice file",
      +        "starred": "false"
      +    }
      +}
      +

      The program should then modify the input as desired and send it to STDOUT. The returned Metadata field will be used in its entirety for the destination object. Any other fields will be ignored. Note in this example we translate user names and permissions and add something to the description:

      +
      {
      +    "Metadata": {
      +        "btime": "2022-10-11T16:53:11Z",
      +        "content-type": "text/plain; charset=utf-8",
      +        "mtime": "2022-10-11T17:53:10.286745272+01:00",
      +        "owner": "user1@domain2.com",
      +        "permissions": "...",
      +        "description": "my nice file [migrated from domain1]",
      +        "starred": "false"
      +    }
      +}
      +

      Metadata can be removed here too.

      +

      An example python program might look something like this to implement the above transformations.

      +
      import sys, json
      +
      +i = json.load(sys.stdin)
      +metadata = i["Metadata"]
      +# Add tag to description
      +if "description" in metadata:
      +    metadata["description"] += " [migrated from domain1]"
      +else:
      +    metadata["description"] = "[migrated from domain1]"
      +# Modify owner
      +if "owner" in metadata:
      +    metadata["owner"] = metadata["owner"].replace("domain1.com", "domain2.com")
      +o = { "Metadata": metadata }
      +json.dump(o, sys.stdout, indent="\t")
      +

      You can find this example (slightly expanded) in the rclone source code at bin/test_metadata_mapper.py.

      +

      If you want to see the input to the metadata mapper and the output returned from it in the log you can use -vv --dump mapper.

      +

      See the metadata section for more info.

      --metadata-set key=value

      -

      Add metadata key = value when uploading. This can be repeated as many times as required. See the #metadata for more info.

      +

      Add metadata key = value when uploading. This can be repeated as many times as required. See the metadata section for more info.

      --modify-window=TIME

      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.

      The default is 1ns 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 1s by default.

      @@ -6083,7 +6726,7 @@

      --order-by string

    • --order-by name - send the files with alphabetically by path first

    If the --order-by flag is not supplied or it is supplied with an empty string then the default ordering will be used which is as scanned. With --checkers 1 this is mostly alphabetical, however with the default --checkers 8 it is somewhat random.

    -

    Limitations

    +

    Limitations

    The --order-by flag does not do a separate pass over the data. This means that it may transfer some files out of the order specified if

    • there are no files in the backlog or the source has not been fully scanned yet
    • @@ -6091,13 +6734,17 @@

      Limitations

    Rclone will do its best to transfer the best file it has so in practice this should not cause a problem. Think of --order-by as being more of a best efforts flag rather than a perfect ordering.

    If you want perfect ordering then you will need to specify --check-first which will find all the files which need transferring first before transferring any.

    +

    --partial-suffix

    +

    When --inplace is not used, it causes rclone to use the --partial-suffix as suffix for temporary files.

    +

    Suffix length limit is 16 characters.

    +

    The default is .partial.

    --password-command SpaceSepList

    This flag supplies a program which should supply the config password when run. This is an alternative to rclone prompting for the password or setting the RCLONE_CONFIG_PASS variable.

    The argument to this should be a command with a space separated list of arguments. If one of the arguments has a space in then enclose it in ", if you want a literal " in an argument then enclose the argument in " and double the ". See CSV encoding for more info.

    Eg

    -
    --password-command echo hello
    ---password-command echo "hello with space"
    ---password-command echo "hello with ""quotes"" and space"
    +
    --password-command "echo hello"
    +--password-command 'echo "hello with space"'
    +--password-command 'echo "hello with ""quotes"" and space"'

    See the Configuration Encryption for more info.

    See a Windows PowerShell example on the Wiki.

    -P, --progress

    @@ -6220,18 +6867,12 @@

    --delete-(before,during,after)

    Specifying --delete-during will delete files while checking and uploading files. This is the fastest option and uses the least memory.

    Specifying --delete-after (the default value) will delay deletion of files until all new/updated files have been successfully transferred. The files to be deleted are collected in the copy pass then deleted after the copy pass has completed successfully. The files to be deleted are held in memory so this mode may use more memory. This is the safest mode as it will only delete files if there have been no errors subsequent to that. If there have been errors before the deletions start then you will get the message not deleting files as there were IO errors.

    --fast-list

    -

    When doing anything which involves a directory listing (e.g. sync, copy, ls - in fact nearly every command), rclone normally lists a directory and processes it before using more directory lists to process any subdirectories. This can be parallelised and works very quickly using the least amount of memory.

    -

    However, some remotes have a way of listing all files beneath a directory in one (or a small number) of transactions. These tend to be the bucket-based remotes (e.g. S3, B2, GCS, Swift).

    -

    If you use the --fast-list flag then rclone will use this method for listing directories. This will have the following consequences for the listing:

    -
      -
    • It will use fewer transactions (important if you pay for them)
    • -
    • It will use more memory. Rclone has to load the whole listing into memory.
    • -
    • It may be faster because it uses fewer transactions
    • -
    • It may be slower because it can't be parallelized
    • -
    -

    rclone should always give identical results with and without --fast-list.

    -

    If you pay for transactions and can fit your entire sync listing into memory then --fast-list is recommended. If you have a very big sync to do then don't use --fast-list otherwise you will run out of memory.

    -

    If you use --fast-list on a remote which doesn't support it, then rclone will just ignore it.

    +

    When doing anything which involves a directory listing (e.g. sync, copy, ls - in fact nearly every command), rclone has different strategies to choose from.

    +

    The basic strategy is to list one directory and processes it before using more directory lists to process any subdirectories. This is a mandatory backend feature, called List, which means it is supported by all backends. This strategy uses small amount of memory, and because it can be parallelised it is fast for operations involving processing of the list results.

    +

    Some backends provide the support for an alternative strategy, where all files beneath a directory can be listed in one (or a small number) of transactions. Rclone supports this alternative strategy through an optional backend feature called ListR. You can see in the storage system overview documentation's optional features section which backends it is enabled for (these tend to be the bucket-based ones, e.g. S3, B2, GCS, Swift). This strategy requires fewer transactions for highly recursive operations, which is important on backends where this is charged or heavily rate limited. It may be faster (due to fewer transactions) or slower (because it can't be parallelized) depending on different parameters, and may require more memory if rclone has to keep the whole listing in memory.

    +

    Which listing strategy rclone picks for a given operation is complicated, but in general it tries to choose the best possible. It will prefer ListR in situations where it doesn't need to store the listed files in memory, e.g. for unlimited recursive ls command variants. In other situations it will prefer List, e.g. for sync and copy, where it needs to keep the listed files in memory, and is performing operations on them where parallelization may be a huge advantage.

    +

    Rclone is not able to take all relevant parameters into account for deciding the best strategy, and therefore allows you to influence the choice in two ways: You can stop rclone from using ListR by disabling the feature, using the --disable option (--disable ListR), or you can allow rclone to use ListR where it would normally choose not to do so due to higher memory usage, using the --fast-list option. Rclone should always produce identical results either way. Using --disable ListR or --fast-list on a remote which doesn't support ListR does nothing, rclone will just ignore it.

    +

    A rule of thumb is that if you pay for transactions and can fit your entire sync listing into memory, then --fast-list is recommended. If you have a very big sync to do, then don't use --fast-list, otherwise you will run out of memory. Run some tests and compare before you decide, and if in doubt then just leave the default, let rclone decide, i.e. not use --fast-list.

    --timeout=TIME

    This sets the IO idle timeout. If a transfer has started but then becomes idle for this long it is considered broken and disconnected.

    The default is 5m. Set to 0 to disable.

    @@ -6348,6 +6989,8 @@

    --dump goroutines

    This dumps a list of the running go-routines at the end of the command to standard output.

    --dump openfiles

    This dumps a list of the open files at the end of the command. It uses the lsof command to do that so you'll need that installed to use it.

    +

    --dump mapper

    +

    This shows the JSON blobs being sent to the program supplied with --metadata-mapper and received from it. It can be useful for debugging the metadata mapper interface.

    --memprofile=FILE

    Write memory profile to file. This can be analysed with go tool pprof.

    Filtering

    @@ -6414,7 +7057,7 @@

    List of exit codes

    Environment Variables

    Rclone can be configured entirely using environment variables. These can be used to set defaults for options or config file entries.

    -

    Options

    +

    Options

    Every option in rclone can have its default set by environment variable.

    To find the name of the environment variable, first, take the long option name, strip the leading --, change - to _, make upper case and prepend RCLONE_.

    For example, to always set --stats 5s, set the environment variable RCLONE_STATS=5s. If you set stats on the command line this will override the environment variable setting.

    @@ -7777,6 +8420,40 @@

    operations/about: Return the space used on the remote<

    The result is as returned from rclone about --json

    See the about command for more information on the above.

    Authentication is required for this call.

    +

    operations/check: check the source and destination are the same

    +

    Checks the files in the source and destination match. It compares sizes and hashes and logs a report of files that don't match. It doesn't alter the source or destination.

    +

    This takes the following parameters:

    +
      +
    • srcFs - a remote name string e.g. "drive:" for the source, "/" for local filesystem
    • +
    • dstFs - a remote name string e.g. "drive2:" for the destination, "/" for local filesystem
    • +
    • download - check by downloading rather than with hash
    • +
    • checkFileHash - treat checkFileFs:checkFileRemote as a SUM file with hashes of given type
    • +
    • checkFileFs - treat checkFileFs:checkFileRemote as a SUM file with hashes of given type
    • +
    • checkFileRemote - treat checkFileFs:checkFileRemote as a SUM file with hashes of given type
    • +
    • oneWay - check one way only, source files must exist on remote
    • +
    • combined - make a combined report of changes (default false)
    • +
    • missingOnSrc - report all files missing from the source (default true)
    • +
    • missingOnDst - report all files missing from the destination (default true)
    • +
    • match - report all matching files (default false)
    • +
    • differ - report all non-matching files (default true)
    • +
    • error - report all files with errors (hashing or reading) (default true)
    • +
    +

    If you supply the download flag, it will download the data from both remotes and check them against each other on the fly. This can be useful for remotes that don't support hashes or if you really want to check all the data.

    +

    If you supply the size-only global flag, it will only compare the sizes not the hashes as well. Use this for a quick check.

    +

    If you supply the checkFileHash option with a valid hash name, the checkFileFs:checkFileRemote must point to a text file in the SUM format. This treats the checksum file as the source and dstFs as the destination. Note that srcFs is not used and should not be supplied in this case.

    +

    Returns:

    +
      +
    • success - true if no error, false otherwise
    • +
    • status - textual summary of check, OK or text string
    • +
    • hashType - hash used in check, may be missing
    • +
    • combined - array of strings of combined report of changes
    • +
    • missingOnSrc - array of strings of all files missing from the source
    • +
    • missingOnDst - array of strings of all files missing from the destination
    • +
    • match - array of strings of all matching files
    • +
    • differ - array of strings of all non-matching files
    • +
    • error - array of strings of all files with errors (hashing or reading)
    • +
    +

    Authentication is required for this call.

    operations/cleanup: Remove trashed files in the remote or path

    This takes the following parameters:

      @@ -8505,7 +9182,7 @@

      Features

      Google Drive -MD5 +MD5, SHA1, SHA256 R/W No Yes @@ -8564,7 +9241,7 @@

      Features

      Yes No R -- +RW Koofr @@ -8576,6 +9253,15 @@

      Features

      - +Linkbox +- +R +No +No +- +- + + Mail.ru Cloud Mailru ⁶ R/W @@ -8584,7 +9270,7 @@

      Features

      - - - + Mega - - @@ -8593,7 +9279,7 @@

      Features

      - - - + Memory MD5 R/W @@ -8602,7 +9288,7 @@

      Features

      - - - + Microsoft Azure Blob Storage MD5 R/W @@ -8611,6 +9297,15 @@

      Features

      R/W - + +Microsoft Azure Files Storage +MD5 +R/W +Yes +No +R/W +- + Microsoft OneDrive QuickXorHash ⁵ @@ -8740,7 +9435,7 @@

      Features

      SMB - -- +R/W Yes No - @@ -8811,7 +9506,6 @@

      Features

      -

      Notes

      ¹ Dropbox supports its own custom hash. This is an SHA256 sum of all the 4 MiB block SHA256s.

      ² SFTP supports checksums if the same login has shell access and md5sum or sha1sum as well as echo are in the remote's PATH.

      ³ WebDAV supports hashes when used with Fastmail Files, Owncloud and Nextcloud only.

      @@ -8821,7 +9515,7 @@

      Notes

      ⁷ pCloud only supports SHA1 (not MD5) in its EU region

      ⁸ Opendrive does not support creation of duplicate files using their web client interface or other stock clients, but the underlying storage platform has been determined to allow duplicate files, and it is possible to create them with rclone. It may be that this is a mistake or an unsupported feature.

      ⁹ QingStor does not support SetModTime for objects bigger than 5 GiB.

      -

      ¹⁰ FTP supports modtimes for the major FTP servers, and also others if they advertised required protocol extensions. See this for more details.

      +

      ¹⁰ FTP supports modtimes for the major FTP servers, and also others if they advertised required protocol extensions. See this for more details.

      ¹¹ Internet Archive requires option wait_archive to be set to a non-zero value for full modtime support.

      ¹² HiDrive supports its own custom hash. It combines SHA1 sums for each 4 KiB block hierarchically to a single top-level sum.

      Hash

      @@ -9385,7 +10079,7 @@

      Optional Features

      Yes Yes Yes -Yes ‡‡ +Yes No Yes No @@ -9632,20 +10326,34 @@

      Optional Features

      No +Microsoft Azure Files Storage +No +Yes +Yes +Yes +No +No +Yes +Yes +No +Yes +Yes + + Microsoft OneDrive Yes Yes Yes Yes Yes -No +Yes ⁵ No No Yes Yes Yes - + OpenDrive Yes Yes @@ -9659,9 +10367,9 @@

      Optional Features

      No Yes - + OpenStack Swift -Yes † +Yes ¹ Yes No No @@ -9673,7 +10381,7 @@

      Optional Features

      Yes No - + Oracle Object Storage No Yes @@ -9682,12 +10390,12 @@

      Optional Features

      Yes Yes Yes -No +Yes No No No - + pCloud Yes Yes @@ -9701,7 +10409,7 @@

      Optional Features

      Yes Yes - + PikPak Yes Yes @@ -9715,7 +10423,7 @@

      Optional Features

      Yes Yes - + premiumize.me Yes No @@ -9729,7 +10437,7 @@

      Optional Features

      Yes Yes - + put.io Yes No @@ -9743,7 +10451,7 @@

      Optional Features

      Yes Yes - + Proton Drive Yes No @@ -9757,7 +10465,7 @@

      Optional Features

      Yes Yes - + QingStor No Yes @@ -9771,7 +10479,7 @@

      Optional Features

      No No - + Quatrix by Maytech Yes Yes @@ -9785,7 +10493,7 @@

      Optional Features

      Yes Yes - + Seafile Yes Yes @@ -9799,10 +10507,10 @@

      Optional Features

      Yes Yes - + SFTP No -No +Yes ⁴ Yes Yes No @@ -9813,7 +10521,7 @@

      Optional Features

      Yes Yes - + Sia No No @@ -9827,7 +10535,7 @@

      Optional Features

      No Yes - + SMB No No @@ -9841,7 +10549,7 @@

      Optional Features

      No Yes - + SugarSync Yes Yes @@ -9855,9 +10563,9 @@

      Optional Features

      No Yes - + Storj -Yes ☨ +Yes ² Yes Yes No @@ -9869,7 +10577,7 @@

      Optional Features

      No No - + Uptobox No Yes @@ -9883,7 +10591,7 @@

      Optional Features

      No No - + WebDAV Yes Yes @@ -9891,13 +10599,13 @@

      Optional Features

      Yes No No -Yes ‡ +Yes ³ No No Yes Yes - + Yandex Disk Yes Yes @@ -9911,7 +10619,7 @@

      Optional Features

      Yes Yes - + Zoho WorkDrive Yes Yes @@ -9925,7 +10633,7 @@

      Optional Features

      Yes Yes - + The local filesystem Yes No @@ -9941,11 +10649,13 @@

      Optional Features

      +

      ¹ Note Swift implements this in order to delete directory markers but it doesn't actually have a quicker way of deleting files other than deleting them individually.

      +

      ² Storj implements this efficiently only for entire buckets. If purging a directory inside a bucket, files are deleted individually.

      +

      ³ StreamUpload is not supported with Nextcloud

      +

      ⁴ Use the --sftp-copy-is-hardlink flag to enable.

      +

      ⁵ Use the --onedrive-delta flag to enable.

      Purge

      This deletes a directory quicker than just deleting all the files in the directory.

      -

      † Note Swift implements this in order to delete directory markers but they don't actually have a quicker way of deleting files other than deleting them individually.

      -

      ☨ Storj implements this efficiently only for entire buckets. If purging a directory inside a bucket, files are deleted individually.

      -

      ‡ StreamUpload is not supported with Nextcloud

      Copy

      Used when copying an object to and from the same remote. This known as a server-side copy so you can copy a file without downloading it and uploading it again. It is used if you use rclone copy or rclone move if the remote doesn't support Move directly.

      If the server doesn't support Copy directly then for copy operations the file is downloaded then re-uploaded.

      @@ -9981,11 +10691,11 @@

      Copy

      -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -10000,11 +10710,12 @@

      Copy

      --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination

      Sync

      @@ -10050,7 +10761,7 @@

      Networking

      --tpslimit float Limit HTTP transactions per second to this --tpslimit-burst int Max burst of transactions for --tpslimit (default 1) --use-cookies Enable session cookiejar - --user-agent string Set the user-agent to a specified string (default "rclone/v1.64.0")
      + --user-agent string Set the user-agent to a specified string (default "rclone/v1.65.0")

      Performance

      Flags helpful for increasing performance.

            --buffer-size SizeSuffix   In memory buffer size when reading files for each --transfer (default 16Mi)
      @@ -10061,7 +10772,7 @@ 

      Config

            --ask-password                        Allow prompt for password for encrypted configuration (default true)
             --auto-confirm                        If enabled, do not request console confirmation
             --cache-dir string                    Directory rclone will use for caching (default "$HOME/.cache/rclone")
      -      --color string                        When to show colors (and other ANSI codes) AUTO|NEVER|ALWAYS (default "AUTO")
      +      --color AUTO|NEVER|ALWAYS             When to show colors (and other ANSI codes) AUTO|NEVER|ALWAYS (default AUTO)
             --config string                       Config file (default "$HOME/.config/rclone/rclone.conf")
             --default-time Time                   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
             --disable string                      Disable a comma separated list of features (use --disable help to see a list)
      @@ -10084,7 +10795,7 @@ 

      Config

      Debugging

      Flags for developers.

            --cpuprofile string   Write cpu profile to file
      -      --dump DumpFlags      List of items to dump from: headers,bodies,requests,responses,auth,filters,goroutines,openfiles
      +      --dump DumpFlags      List of items to dump from: headers, bodies, requests, responses, auth, filters, goroutines, openfiles, mapper
             --dump-bodies         Dump HTTP headers and bodies - may contain sensitive info
             --dump-headers        Dump HTTP headers - may contain sensitive info
             --memprofile string   Write memory profile to file
      @@ -10120,7 +10831,7 @@

      Logging

      Logging and statistics.

            --log-file string                     Log everything to this file
             --log-format string                   Comma separated list of log format options (default "date,time")
      -      --log-level string                    Log level DEBUG|INFO|NOTICE|ERROR (default "NOTICE")
      +      --log-level LogLevel                  Log level DEBUG|INFO|NOTICE|ERROR (default NOTICE)
             --log-systemd                         Activate systemd integration for the logger
             --max-stats-groups int                Maximum number of stats groups to keep in memory, on max oldest is discarded (default 1000)
         -P, --progress                            Show progress during transfer
      @@ -10128,7 +10839,7 @@ 

      Logging

      -q, --quiet Print as little stuff as possible --stats Duration Interval between printing stats, e.g. 500ms, 60s, 5m (0 to disable) (default 1m0s) --stats-file-name-length int Max file name length in stats (0 for no limit) (default 45) - --stats-log-level string Log level to show --stats output DEBUG|INFO|NOTICE|ERROR (default "INFO") + --stats-log-level LogLevel Log level to show --stats output DEBUG|INFO|NOTICE|ERROR (default INFO) --stats-one-line Make the stats fit on one line --stats-one-line-date Enable --stats-one-line and add current date/time prefix --stats-one-line-date-format string Enable --stats-one-line-date and use custom formatted date: Enclose date string in double quotes ("), see https://golang.org/pkg/time/#Time.Format @@ -10146,6 +10857,7 @@

      Metadata

      --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) --metadata-include stringArray Include metadatas matching pattern --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --metadata-mapper SpaceSepList Program to run to transforming metadata before upload --metadata-set stringArray Add metadata key=value when uploading

      RC

      Flags to control the Remote Control API.

      @@ -10182,13 +10894,13 @@

      Backend

            --acd-auth-url string                                 Auth server URL
             --acd-client-id string                                OAuth Client Id
             --acd-client-secret string                            OAuth Client Secret
      -      --acd-encoding MultiEncoder                           The encoding for the backend (default Slash,InvalidUtf8,Dot)
      +      --acd-encoding Encoding                               The encoding for the backend (default Slash,InvalidUtf8,Dot)
             --acd-templink-threshold SizeSuffix                   Files >= this size will be downloaded via their tempLink (default 9Gi)
             --acd-token string                                    OAuth Access Token as a JSON blob
             --acd-token-url string                                Token server url
             --acd-upload-wait-per-gb Duration                     Additional time per GiB to wait after a failed complete upload to see if it appears (default 3m0s)
             --alias-remote string                                 Remote or path to alias
      -      --azureblob-access-tier string                        Access tier of blob: hot, cool or archive
      +      --azureblob-access-tier string                        Access tier of blob: hot, cool, cold or archive
             --azureblob-account string                            Azure Storage Account Name
             --azureblob-archive-tier-delete                       Delete archive tier blobs before overwriting
             --azureblob-chunk-size SizeSuffix                     Upload chunk size (default 4Mi)
      @@ -10199,7 +10911,7 @@ 

      Backend

      --azureblob-client-send-certificate-chain Send the certificate chain when using certificate auth --azureblob-directory-markers Upload an empty object with a trailing slash when a new directory is created --azureblob-disable-checksum Don't store MD5 checksum with object metadata - --azureblob-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8) + --azureblob-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8) --azureblob-endpoint string Endpoint for the service --azureblob-env-auth Read credentials from runtime (environment variables, CLI or MSI) --azureblob-key string Storage Account Shared Key @@ -10219,18 +10931,43 @@

      Backend

      --azureblob-use-emulator Uses local storage emulator if provided as 'true' --azureblob-use-msi Use a managed service identity to authenticate (only works in Azure) --azureblob-username string User name (usually an email address) + --azurefiles-account string Azure Storage Account Name + --azurefiles-chunk-size SizeSuffix Upload chunk size (default 4Mi) + --azurefiles-client-certificate-password string Password for the certificate file (optional) (obscured) + --azurefiles-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key + --azurefiles-client-id string The ID of the client in use + --azurefiles-client-secret string One of the service principal's client secrets + --azurefiles-client-send-certificate-chain Send the certificate chain when using certificate auth + --azurefiles-connection-string string Azure Files Connection String + --azurefiles-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8,Dot) + --azurefiles-endpoint string Endpoint for the service + --azurefiles-env-auth Read credentials from runtime (environment variables, CLI or MSI) + --azurefiles-key string Storage Account Shared Key + --azurefiles-max-stream-size SizeSuffix Max size for streamed files (default 10Gi) + --azurefiles-msi-client-id string Object ID of the user-assigned MSI to use, if any + --azurefiles-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any + --azurefiles-msi-object-id string Object ID of the user-assigned MSI to use, if any + --azurefiles-password string The user's password (obscured) + --azurefiles-sas-url string SAS URL + --azurefiles-service-principal-file string Path to file containing credentials for use with a service principal + --azurefiles-share-name string Azure Files Share Name + --azurefiles-tenant string ID of the service principal's tenant. Also called its directory ID + --azurefiles-upload-concurrency int Concurrency for multipart uploads (default 16) + --azurefiles-use-msi Use a managed service identity to authenticate (only works in Azure) + --azurefiles-username string User name (usually an email address) --b2-account string Account ID or Application Key ID --b2-chunk-size SizeSuffix Upload chunk size (default 96Mi) --b2-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4Gi) --b2-disable-checksum Disable checksums for large (> upload cutoff) files --b2-download-auth-duration Duration Time before the authorization token will expire in s or suffix ms|s|m|h|d (default 1w) --b2-download-url string Custom endpoint for downloads - --b2-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --b2-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) --b2-endpoint string Endpoint for the service --b2-hard-delete Permanently delete files on remote removal, otherwise hide files --b2-key string Application Key + --b2-lifecycle int Set the number of days deleted files should be kept when creating a bucket --b2-test-mode string A flag string for X-Bz-Test-Mode header for debugging - --b2-upload-concurrency int Concurrency for multipart uploads (default 16) + --b2-upload-concurrency int Concurrency for multipart uploads (default 4) --b2-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) --b2-version-at Time Show file versions as they were at the specified time (default off) --b2-versions Include old versions in directory listings @@ -10241,7 +10978,7 @@

      Backend

      --box-client-id string OAuth Client Id --box-client-secret string OAuth Client Secret --box-commit-retries int Max number of times to try committing a multipart file (default 100) - --box-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot) + --box-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot) --box-impersonate string Impersonate this user ID when using a service account --box-list-chunk int Size of listing chunk 1-1000 (default 1000) --box-owned-by string Only show items owned by the login (email address) passed in @@ -10299,7 +11036,7 @@

      Backend

      --drive-client-secret string OAuth Client Secret --drive-copy-shortcut-content Server side copy contents of shortcuts instead of the shortcut --drive-disable-http2 Disable drive using http2 (default true) - --drive-encoding MultiEncoder The encoding for the backend (default InvalidUtf8) + --drive-encoding Encoding The encoding for the backend (default InvalidUtf8) --drive-env-auth Get IAM credentials from runtime (environment variables or instance meta data if no env vars) --drive-export-formats string Comma separated list of preferred formats for downloading Google docs (default "docx,xlsx,pptx,svg") --drive-fast-list-bug-fix Work around a bug in Google Drive listing (default true) @@ -10308,17 +11045,21 @@

      Backend

      --drive-import-formats string Comma separated list of preferred formats for uploading Google docs --drive-keep-revision-forever Keep new head revision of each file forever --drive-list-chunk int Size of listing chunk 100-1000, 0 to disable (default 1000) + --drive-metadata-labels Bits Control whether labels should be read or written in metadata (default off) + --drive-metadata-owner Bits Control whether owner should be read or written in metadata (default read) + --drive-metadata-permissions Bits Control whether permissions should be read or written in metadata (default off) --drive-pacer-burst int Number of API calls to allow without sleeping (default 100) --drive-pacer-min-sleep Duration Minimum time to sleep between API calls (default 100ms) --drive-resource-key string Resource key for accessing a link-shared file --drive-root-folder-id string ID of the root folder - --drive-scope string Scope that rclone should use when requesting access from drive + --drive-scope string Comma separated list of scopes that rclone should use when requesting access from drive --drive-server-side-across-configs Deprecated: use --server-side-across-configs instead --drive-service-account-credentials string Service Account Credentials JSON blob --drive-service-account-file string Service Account Credentials JSON file path --drive-shared-with-me Only show files that are shared with me + --drive-show-all-gdocs Show all Google Docs including non-exportable ones in listings --drive-size-as-quota Show sizes as storage quota usage, not actual size - --drive-skip-checksum-gphotos Skip MD5 checksum on Google photos and videos only + --drive-skip-checksum-gphotos Skip checksums on Google photos and videos only --drive-skip-dangling-shortcuts If set skip dangling shortcut files --drive-skip-gdocs Skip google documents in all listings --drive-skip-shortcuts If set skip shortcut files @@ -10342,7 +11083,7 @@

      Backend

      --dropbox-chunk-size SizeSuffix Upload chunk size (< 150Mi) (default 48Mi) --dropbox-client-id string OAuth Client Id --dropbox-client-secret string OAuth Client Secret - --dropbox-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot) + --dropbox-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot) --dropbox-impersonate string Impersonate this user when using a business account --dropbox-pacer-min-sleep Duration Minimum time to sleep between API calls (default 10ms) --dropbox-shared-files Instructs rclone to work on individual shared files @@ -10351,11 +11092,11 @@

      Backend

      --dropbox-token-url string Token server url --fichier-api-key string Your API Key, get it from https://1fichier.com/console/params.pl --fichier-cdn Set if you wish to use CDN download links - --fichier-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot) + --fichier-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot) --fichier-file-password string If you want to download a shared file that is password protected, add this parameter (obscured) --fichier-folder-password string If you want to list the files in a shared folder that is password protected, add this parameter (obscured) --fichier-shared-folder string If you want to download a shared folder, add this parameter - --filefabric-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) + --filefabric-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) --filefabric-permanent-token string Permanent Authentication Token --filefabric-root-folder-id string ID of the root folder --filefabric-token string Session Token @@ -10369,7 +11110,7 @@

      Backend

      --ftp-disable-mlsd Disable using MLSD even if server advertises support --ftp-disable-tls13 Disable TLS 1.3 (workaround for FTP servers with buggy TLS) --ftp-disable-utf8 Disable using UTF-8 even if server advertises support - --ftp-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,RightSpace,Dot) + --ftp-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,RightSpace,Dot) --ftp-explicit-tls Use Explicit FTPS (FTP over TLS) --ftp-force-list-hidden Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD --ftp-host string FTP host to connect to @@ -10391,7 +11132,7 @@

      Backend

      --gcs-client-secret string OAuth Client Secret --gcs-decompress If set this will decompress gzip encoded objects --gcs-directory-markers Upload an empty object with a trailing slash when a new directory is created - --gcs-encoding MultiEncoder The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) + --gcs-encoding Encoding The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) --gcs-endpoint string Endpoint for the service --gcs-env-auth Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars) --gcs-location string Location for the newly created buckets @@ -10404,9 +11145,13 @@

      Backend

      --gcs-token-url string Token server url --gcs-user-project string User project --gphotos-auth-url string Auth server URL + --gphotos-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) + --gphotos-batch-mode string Upload file batching sync|async|off (default "sync") + --gphotos-batch-size int Max number of files in upload batch + --gphotos-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) --gphotos-client-id string OAuth Client Id --gphotos-client-secret string OAuth Client Secret - --gphotos-encoding MultiEncoder The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) + --gphotos-encoding Encoding The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) --gphotos-include-archived Also view and download archived media --gphotos-read-only Set to make the Google Photos backend read only --gphotos-read-size Set to read the size of media items @@ -10418,8 +11163,8 @@

      Backend

      --hasher-max-age Duration Maximum time to keep checksums in cache (0 = no cache, off = cache forever) (default off) --hasher-remote string Remote to cache checksums for (e.g. myRemote:path) --hdfs-data-transfer-protection string Kerberos data transfer protection: authentication|integrity|privacy - --hdfs-encoding MultiEncoder The encoding for the backend (default Slash,Colon,Del,Ctl,InvalidUtf8,Dot) - --hdfs-namenode string Hadoop name node and port + --hdfs-encoding Encoding The encoding for the backend (default Slash,Colon,Del,Ctl,InvalidUtf8,Dot) + --hdfs-namenode CommaSepList Hadoop name nodes and ports --hdfs-service-principal-name string Kerberos service principal name for the namenode --hdfs-username string Hadoop user name --hidrive-auth-url string Auth server URL @@ -10427,7 +11172,7 @@

      Backend

      --hidrive-client-id string OAuth Client Id --hidrive-client-secret string OAuth Client Secret --hidrive-disable-fetching-member-count Do not fetch number of objects in directories unless it is absolutely necessary - --hidrive-encoding MultiEncoder The encoding for the backend (default Slash,Dot) + --hidrive-encoding Encoding The encoding for the backend (default Slash,Dot) --hidrive-endpoint string Endpoint for the service (default "https://api.hidrive.strato.com/2.1") --hidrive-root-prefix string The root/parent folder for all paths (default "/") --hidrive-scope-access string Access permissions that rclone should use when requesting access from HiDrive (default "rw") @@ -10440,9 +11185,16 @@

      Backend

      --http-no-head Don't use HEAD requests --http-no-slash Set this if the site doesn't end directories with / --http-url string URL of HTTP host to connect to + --imagekit-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Dollar,Question,Hash,Percent,BackSlash,Del,Ctl,InvalidUtf8,Dot,SquareBracket) + --imagekit-endpoint string You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-only-signed Restrict unsigned image URLs If you have configured Restrict unsigned image URLs in your dashboard settings, set this to true + --imagekit-private-key string You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-public-key string You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-upload-tags string Tags to add to the uploaded files, e.g. "tag1,tag2" + --imagekit-versions Include old versions in directory listings --internetarchive-access-key-id string IAS3 Access Key --internetarchive-disable-checksum Don't ask the server to test against MD5 checksum calculated by rclone (default true) - --internetarchive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot) + --internetarchive-encoding Encoding The encoding for the backend (default Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot) --internetarchive-endpoint string IAS3 Endpoint (default "https://s3.us.archive.org") --internetarchive-front-endpoint string Host of InternetArchive Frontend (default "https://archive.org") --internetarchive-secret-access-key string IAS3 Secret Key (password) @@ -10450,7 +11202,7 @@

      Backend

      --jottacloud-auth-url string Auth server URL --jottacloud-client-id string OAuth Client Id --jottacloud-client-secret string OAuth Client Secret - --jottacloud-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot) + --jottacloud-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot) --jottacloud-hard-delete Delete files permanently rather than putting them into the trash --jottacloud-md5-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate the MD5 if required (default 10Mi) --jottacloud-no-versions Avoid server side versioning by deleting files and recreating files instead of overwriting them @@ -10458,17 +11210,18 @@

      Backend

      --jottacloud-token-url string Token server url --jottacloud-trashed-only Only show files that are in the trash --jottacloud-upload-resume-limit SizeSuffix Files bigger than this can be resumed if the upload fail's (default 10Mi) - --koofr-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --koofr-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) --koofr-endpoint string The Koofr API endpoint to use --koofr-mountid string Mount ID of the mount to use --koofr-password string Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password) (obscured) --koofr-provider string Choose your storage provider --koofr-setmtime Does the backend support setting modification time (default true) --koofr-user string Your user name + --linkbox-token string Token from https://www.linkbox.to/admin/account -l, --links Translate symlinks to/from regular files with a '.rclonelink' extension --local-case-insensitive Force the filesystem to report itself as case insensitive --local-case-sensitive Force the filesystem to report itself as case sensitive - --local-encoding MultiEncoder The encoding for the backend (default Slash,Dot) + --local-encoding Encoding The encoding for the backend (default Slash,Dot) --local-no-check-updated Don't check to see if the files change during upload --local-no-preallocate Disable preallocation of disk space for transferred files --local-no-set-modtime Disable setting modtime @@ -10480,7 +11233,7 @@

      Backend

      --mailru-check-hash What should copy do if file checksum is mismatched or invalid (default true) --mailru-client-id string OAuth Client Id --mailru-client-secret string OAuth Client Secret - --mailru-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --mailru-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot) --mailru-pass string Password (obscured) --mailru-speedup-enable Skip full upload if there is another file with same data hash (default true) --mailru-speedup-file-patterns string Comma separated list of file name patterns eligible for speedup (put by hash) (default "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf") @@ -10490,7 +11243,7 @@

      Backend

      --mailru-token-url string Token server url --mailru-user string User name (usually email) --mega-debug Output more debug from Mega - --mega-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) + --mega-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) --mega-hard-delete Delete files permanently rather than putting them into the trash --mega-pass string Password (obscured) --mega-use-https Use HTTPS for transfers @@ -10506,9 +11259,10 @@

      Backend

      --onedrive-chunk-size SizeSuffix Chunk size to upload files with - must be multiple of 320k (327,680 bytes) (default 10Mi) --onedrive-client-id string OAuth Client Id --onedrive-client-secret string OAuth Client Secret + --onedrive-delta If set rclone will use delta listing to implement recursive listings --onedrive-drive-id string The ID of the drive to use --onedrive-drive-type string The type of the drive (personal | business | documentLibrary) - --onedrive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot) + --onedrive-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot) --onedrive-expose-onenote-files Set to make OneNote files show up in directory listings --onedrive-hash-type string Specify the hash in use for the backend (default "auto") --onedrive-link-password string Set the password for links created by the link command @@ -10529,7 +11283,7 @@

      Backend

      --oos-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) --oos-copy-timeout Duration Timeout for copy (default 1m0s) --oos-disable-checksum Don't store MD5 checksum with object metadata - --oos-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) + --oos-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) --oos-endpoint string Endpoint for Object storage API --oos-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts for manual recovery --oos-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) @@ -10546,13 +11300,13 @@

      Backend

      --oos-upload-concurrency int Concurrency for multipart uploads (default 10) --oos-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) --opendrive-chunk-size SizeSuffix Files will be uploaded in chunks this size (default 10Mi) - --opendrive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot) + --opendrive-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot) --opendrive-password string Password (obscured) --opendrive-username string Username --pcloud-auth-url string Auth server URL --pcloud-client-id string OAuth Client Id --pcloud-client-secret string OAuth Client Secret - --pcloud-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --pcloud-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) --pcloud-hostname string Hostname to connect to (default "api.pcloud.com") --pcloud-password string Your pcloud password (obscured) --pcloud-root-folder-id string Fill in for rclone to use a non root folder as its starting point (default "d0") @@ -10562,7 +11316,7 @@

      Backend

      --pikpak-auth-url string Auth server URL --pikpak-client-id string OAuth Client Id --pikpak-client-secret string OAuth Client Secret - --pikpak-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot) + --pikpak-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot) --pikpak-hash-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate hash if required (default 10Mi) --pikpak-pass string Pikpak password (obscured) --pikpak-root-folder-id string ID of the root folder @@ -10574,13 +11328,13 @@

      Backend

      --premiumizeme-auth-url string Auth server URL --premiumizeme-client-id string OAuth Client Id --premiumizeme-client-secret string OAuth Client Secret - --premiumizeme-encoding MultiEncoder The encoding for the backend (default Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --premiumizeme-encoding Encoding The encoding for the backend (default Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot) --premiumizeme-token string OAuth Access Token as a JSON blob --premiumizeme-token-url string Token server url --protondrive-2fa string The 2FA code --protondrive-app-version string The app version string (default "macos-drive@1.0.0-alpha.1+rclone") --protondrive-enable-caching Caches the files and folders metadata to reduce API calls (default true) - --protondrive-encoding MultiEncoder The encoding for the backend (default Slash,LeftSpace,RightSpace,InvalidUtf8,Dot) + --protondrive-encoding Encoding The encoding for the backend (default Slash,LeftSpace,RightSpace,InvalidUtf8,Dot) --protondrive-mailbox-password string The mailbox password of your two-password proton account (obscured) --protondrive-original-file-size Return the file size before encryption (default true) --protondrive-password string The password of your proton account (obscured) @@ -10589,13 +11343,13 @@

      Backend

      --putio-auth-url string Auth server URL --putio-client-id string OAuth Client Id --putio-client-secret string OAuth Client Secret - --putio-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --putio-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) --putio-token string OAuth Access Token as a JSON blob --putio-token-url string Token server url --qingstor-access-key-id string QingStor Access Key ID --qingstor-chunk-size SizeSuffix Chunk size to use for uploading (default 4Mi) --qingstor-connection-retries int Number of connection retries (default 3) - --qingstor-encoding MultiEncoder The encoding for the backend (default Slash,Ctl,InvalidUtf8) + --qingstor-encoding Encoding The encoding for the backend (default Slash,Ctl,InvalidUtf8) --qingstor-endpoint string Enter an endpoint URL to connection QingStor API --qingstor-env-auth Get QingStor credentials from runtime --qingstor-secret-access-key string QingStor Secret Access Key (password) @@ -10604,7 +11358,7 @@

      Backend

      --qingstor-zone string Zone to connect to --quatrix-api-key string API key for accessing Quatrix account --quatrix-effective-upload-time string Wanted upload time for one chunk (default "4s") - --quatrix-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --quatrix-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) --quatrix-hard-delete Delete files permanently rather than putting them into the trash --quatrix-host string Host name of Quatrix account --quatrix-maximal-summary-chunk-size SizeSuffix The maximal summary for all chunks. It should not be less than 'transfers'*'minimal_chunk_size' (default 95.367Mi) @@ -10619,7 +11373,7 @@

      Backend

      --s3-disable-checksum Don't store MD5 checksum with object metadata --s3-disable-http2 Disable usage of http2 for S3 backends --s3-download-url string Custom endpoint for downloads - --s3-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) + --s3-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) --s3-endpoint string Endpoint for S3 API --s3-env-auth Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars) --s3-force-path-style If true use path style access if false use virtual hosted style (default true) @@ -10653,14 +11407,16 @@

      Backend

      --s3-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) --s3-use-accelerate-endpoint If true use the AWS S3 accelerated endpoint --s3-use-accept-encoding-gzip Accept-Encoding: gzip Whether to send Accept-Encoding: gzip header (default unset) + --s3-use-already-exists Tristate Set if rclone should report BucketAlreadyExists errors on bucket creation (default unset) --s3-use-multipart-etag Tristate Whether to use ETag in multipart uploads for verification (default unset) + --s3-use-multipart-uploads Tristate Set if rclone should use multipart uploads (default unset) --s3-use-presigned-request Whether to use a presigned request or PutObject for single part uploads --s3-v2-auth If true use v2 authentication --s3-version-at Time Show file versions as they were at the specified time (default off) --s3-versions Include old versions in directory listings --seafile-2fa Two-factor authentication ('true' if the account has 2FA enabled) --seafile-create-library Should rclone create a library if it doesn't exist - --seafile-encoding MultiEncoder The encoding for the backend (default Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8) + --seafile-encoding Encoding The encoding for the backend (default Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8) --seafile-library string Name of the library --seafile-library-key string Library password (for encrypted libraries only) (obscured) --seafile-pass string Password (obscured) @@ -10670,6 +11426,7 @@

      Backend

      --sftp-chunk-size SizeSuffix Upload and download chunk size (default 32Ki) --sftp-ciphers SpaceSepList Space separated list of ciphers to be used for session encryption, ordered by preference --sftp-concurrency int The maximum number of outstanding requests for one file (default 64) + --sftp-copy-is-hardlink Set to enable server side copies using hardlinks --sftp-disable-concurrent-reads If set don't use concurrent reads --sftp-disable-concurrent-writes If set don't use concurrent writes --sftp-disable-hashcheck Disable the execution of SSH commands to determine if remote file hashing is available @@ -10704,7 +11461,7 @@

      Backend

      --sharefile-chunk-size SizeSuffix Upload chunk size (default 64Mi) --sharefile-client-id string OAuth Client Id --sharefile-client-secret string OAuth Client Secret - --sharefile-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot) + --sharefile-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot) --sharefile-endpoint string Endpoint for API calls --sharefile-root-folder-id string ID of the root folder --sharefile-token string OAuth Access Token as a JSON blob @@ -10712,12 +11469,12 @@

      Backend

      --sharefile-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (default 128Mi) --sia-api-password string Sia Daemon API Password (obscured) --sia-api-url string Sia daemon API URL, like http://sia.daemon.host:9980 (default "http://127.0.0.1:9980") - --sia-encoding MultiEncoder The encoding for the backend (default Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot) + --sia-encoding Encoding The encoding for the backend (default Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot) --sia-user-agent string Siad User Agent (default "Sia-Agent") --skip-links Don't warn about skipped symlinks --smb-case-insensitive Whether the server is configured to be case-insensitive (default true) --smb-domain string Domain name for NTLM authentication (default "WORKGROUP") - --smb-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot) + --smb-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot) --smb-hide-special-share Hide special shares (e.g. print$) which users aren't supposed to access (default true) --smb-host string SMB server hostname to connect to --smb-idle-timeout Duration Max time before closing idle connections (default 1m0s) @@ -10735,7 +11492,7 @@

      Backend

      --sugarsync-authorization string Sugarsync authorization --sugarsync-authorization-expiry string Sugarsync authorization expiry --sugarsync-deleted-id string Sugarsync deleted folder id - --sugarsync-encoding MultiEncoder The encoding for the backend (default Slash,Ctl,InvalidUtf8,Dot) + --sugarsync-encoding Encoding The encoding for the backend (default Slash,Ctl,InvalidUtf8,Dot) --sugarsync-hard-delete Permanently delete files if true --sugarsync-private-access-key string Sugarsync Private Access Key --sugarsync-refresh-token string Sugarsync refresh token @@ -10749,7 +11506,7 @@

      Backend

      --swift-auth-version int AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION) --swift-chunk-size SizeSuffix Above this size files will be chunked into a _segments container (default 5Gi) --swift-domain string User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME) - --swift-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8) + --swift-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8) --swift-endpoint-type string Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE) (default "public") --swift-env-auth Get swift credentials from environment variables in standard OpenStack form --swift-key string API key or password (OS_PASSWORD) @@ -10771,7 +11528,7 @@

      Backend

      --union-search-policy string Policy to choose upstream on SEARCH category (default "ff") --union-upstreams string List of space separated upstreams --uptobox-access-token string Your access token - --uptobox-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot) + --uptobox-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot) --uptobox-private Set to make uploaded files private --webdav-bearer-token string Bearer token instead of user/pass (e.g. a Macaroon) --webdav-bearer-token-command string Command to run to get a bearer token @@ -10786,14 +11543,14 @@

      Backend

      --yandex-auth-url string Auth server URL --yandex-client-id string OAuth Client Id --yandex-client-secret string OAuth Client Secret - --yandex-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) + --yandex-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) --yandex-hard-delete Delete files permanently rather than putting them into the trash --yandex-token string OAuth Access Token as a JSON blob --yandex-token-url string Token server url --zoho-auth-url string Auth server URL --zoho-client-id string OAuth Client Id --zoho-client-secret string OAuth Client Secret - --zoho-encoding MultiEncoder The encoding for the backend (default Del,Ctl,InvalidUtf8) + --zoho-encoding Encoding The encoding for the backend (default Del,Ctl,InvalidUtf8) --zoho-region string Zoho region to connect to --zoho-token string OAuth Access Token as a JSON blob --zoho-token-url string Token server url
      @@ -11113,7 +11870,7 @@

      --ignore-listing-checksum

      • While checksums are (by default) generated and stored in the listing files, they are NOT currently used for determining diffs (deltas). It is anticipated that full checksum support will be added in a future version.
      • --ignore-listing-checksum is NOT the same as --ignore-checksum, and you may wish to use one or the other, or both. In a nutshell: --ignore-listing-checksum controls whether checksums are considered when scanning for diffs, while --ignore-checksum controls whether checksums are considered during the copy/sync operations that follow, if there ARE diffs.
      • -
      • Unless --ignore-listing-checksum is passed, bisync currently computes hashes for one path even when there's no common hash with the other path (for example, a crypt remote.)
      • +
      • Unless --ignore-listing-checksum is passed, bisync currently computes hashes for one path even when there's no common hash with the other path (for example, a crypt remote.)
      • If both paths support checksums and have a common hash, AND --ignore-listing-checksum was not specified when creating the listings, --check-sync=only can be used to compare Path1 vs. Path2 checksums (as of the time the previous listings were created.) However, --check-sync=only will NOT include checksums if the previous listings were generated on a run using --ignore-listing-checksum. For a more robust integrity check of the current state, consider using check (or cryptcheck, if at least one path is a crypt remote.)

      --resilient

      @@ -11261,7 +12018,7 @@

      Unusual sync checks

      As of rclone v1.64, bisync is now better at detecting false positive sync conflicts, which would previously have resulted in unnecessary renames and duplicates. Now, when bisync comes to a file that it wants to rename (because it is new/changed on both sides), it first checks whether the Path1 and Path2 versions are currently identical (using the same underlying function as check.) If bisync concludes that the files are identical, it will skip them and move on. Otherwise, it will create renamed ..Path1 and ..Path2 duplicates, as before. This behavior also improves the experience of renaming directories, as a --resync is no longer required, so long as the same change has been made on both sides.

      All files changed check

      If all prior existing files on either of the filesystems have changed (e.g. timestamps have changed due to changing the system's timezone) then bisync will abort without making any changes. Any new files are not considered for this check. You could use --force to force the sync (whichever side has the changed timestamp files wins). Alternately, a --resync may be used (Path1 versions will be pushed to Path2). Consider the situation carefully and perhaps use --dry-run before you commit to the changes.

      -

      Modification time

      +

      Modification times

      Bisync relies on file timestamps to identify changed files and will refuse to operate if backend lacks the modification time support.

      If you or your application should change the content of a file without changing the modification time then bisync will not notice the change, and thus will not copy it to the other side.

      Note that on some cloud storage systems it is not possible to have file timestamps that match precisely between the local and other filesystems.

      @@ -11277,7 +12034,7 @@

      Lock file

      Note that while concurrent bisync runs are allowed, be very cautious that there is no overlap in the trees being synched between concurrent runs, lest there be replicated files, deleted files and general mayhem.

      Return codes

      rclone bisync returns the following codes to calling program: - 0 on a successful run, - 1 for a non-critical failing run (a rerun may be successful), - 2 for a critically aborted run (requires a --resync to recover).

      -

      Limitations

      +

      Limitations

      Supported backends

      Bisync is considered BETA and has been tested with the following backends: - Local filesystem - Google Drive - Dropbox - OneDrive - S3 - SFTP - Yandex Disk

      It has not been fully tested with other services yet. If it works, or sorta works, please let us know and we'll update the list. Run the test suite to check for proper operation as described below.

      @@ -11835,7 +12592,7 @@

      Configuration

      rclone ls remote:

      To copy a local directory to a 1Fichier directory called backup

      rclone copy /home/source remote:backup
      -

      Modified time and hashes

      +

      Modification times and hashes

      1Fichier does not support modification times. It supports the Whirlpool hash algorithm.

      Duplicated files

      1Fichier can have two files with exactly the same name and path (unlike a normal file system).

      @@ -11964,10 +12721,10 @@

      --fichier-encoding

      • Config: encoding
      • Env Var: RCLONE_FICHIER_ENCODING
      • -
      • Type: MultiEncoder
      • +
      • Type: Encoding
      • Default: Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot
      -

      Limitations

      +

      Limitations

      rclone about is not supported by the 1Fichier backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.

      See List of backends that do not support rclone about and rclone about

      Alias

      @@ -12110,9 +12867,9 @@

      Configuration

      rclone ls remote:

      To copy a local directory to an Amazon Drive directory called backup

      rclone copy /home/source remote:backup
      -

      Modified time and MD5SUMs

      +

      Modification times and hashes

      Amazon Drive doesn't allow modification times to be changed via the API so these won't be accurate or used for syncing.

      -

      It does store MD5SUMs so for a more accurate sync, you can use the --checksum flag.

      +

      It does support the MD5 hash algorithm, so for a more accurate sync, you can use the --checksum flag.

      Restricted filename characters

      @@ -12234,10 +12991,10 @@

      --acd-encoding

      • Config: encoding
      • Env Var: RCLONE_ACD_ENCODING
      • -
      • Type: MultiEncoder
      • +
      • Type: Encoding
      • Default: Slash,InvalidUtf8,Dot
      -

      Limitations

      +

      Limitations

      Note that Amazon Drive is case insensitive so you can't have a file called "Hello.doc" and one called "hello.doc".

      Amazon Drive has rate limiting so you may notice errors in the sync (429 errors). rclone will automatically retry the sync up to 3 times by default (see --retries flag) which should hopefully work around this problem.

      Amazon Drive has an internal limit of file sizes that can be uploaded to the service. This limit is not officially published, but all files larger than this will fail.

      @@ -12263,10 +13020,12 @@

      Amazon S3 Storage Providers

    • IONOS Cloud
    • Leviia Object Storage
    • Liara Object Storage
    • +
    • Linode Object Storage
    • Minio
    • Petabox
    • Qiniu Cloud Object Storage (Kodo)
    • RackCorp Object Storage
    • +
    • Rclone Serve S3
    • Scaleway
    • Seagate Lyve Cloud
    • SeaweedFS
    • @@ -12485,10 +13244,18 @@

      Configuration

      e) Edit this remote d) Delete this remote y/e/d> -

      Modified time

      +

      Modification times and hashes

      +

      Modification times

      The modified time is stored as metadata on the object as X-Amz-Meta-Mtime as floating point since the epoch, accurate to 1 ns.

      If the modification time needs to be updated rclone will attempt to perform a server side copy to update the modification if the object can be copied in a single part. In the case the object is larger than 5Gb or is in Glacier or Glacier Deep Archive storage the object will be uploaded rather than copied.

      Note that reading this from the object takes an additional HEAD request as the metadata isn't returned in object listings.

      +

      Hashes

      +

      For small objects which weren't uploaded as multipart uploads (objects sized below --s3-upload-cutoff if uploaded with rclone) rclone uses the ETag: header as an MD5 checksum.

      +

      However for objects which were uploaded as multipart uploads or with server side encryption (SSE-AWS or SSE-C) the ETag header is no longer the MD5 sum of the data, so rclone adds an additional piece of metadata X-Amz-Meta-Md5chksum which is a base64 encoded MD5 hash (in the same format as is required for Content-MD5). You can use base64 -d and hexdump to check this value manually:

      +
      echo 'VWTGdNx3LyXQDfA0e2Edxw==' | base64 -d | hexdump
      +

      or you can use rclone check to verify the hashes are OK.

      +

      For large objects, calculating this hash can take some time so the addition of this hash can be disabled with --s3-disable-checksum. This will mean that these objects do not have an MD5 checksum.

      +

      Note that reading this from the object takes an additional HEAD request as the metadata isn't returned in object listings.

      Reducing costs

      Avoiding HEAD requests to read the modification time

      By default, rclone will use the modification time of objects stored in S3 for syncing. This is stored in object metadata which unfortunately takes an extra HEAD request to read which can be expensive (in time and money).

      @@ -12535,13 +13302,6 @@

      Avoiding HEAD requests after PUT

      By default, rclone will HEAD every object it uploads. It does this to check the object got uploaded correctly.

      You can disable this with the --s3-no-head option - see there for more details.

      Setting this flag increases the chance for undetected upload failures.

      -

      Hashes

      -

      For small objects which weren't uploaded as multipart uploads (objects sized below --s3-upload-cutoff if uploaded with rclone) rclone uses the ETag: header as an MD5 checksum.

      -

      However for objects which were uploaded as multipart uploads or with server side encryption (SSE-AWS or SSE-C) the ETag header is no longer the MD5 sum of the data, so rclone adds an additional piece of metadata X-Amz-Meta-Md5chksum which is a base64 encoded MD5 hash (in the same format as is required for Content-MD5). You can use base64 -d and hexdump to check this value manually:

      -
      echo 'VWTGdNx3LyXQDfA0e2Edxw==' | base64 -d | hexdump
      -

      or you can use rclone check to verify the hashes are OK.

      -

      For large objects, calculating this hash can take some time so the addition of this hash can be disabled with --s3-disable-checksum. This will mean that these objects do not have an MD5 checksum.

      -

      Note that reading this from the object takes an additional HEAD request as the metadata isn't returned in object listings.

      Versions

      When bucket versioning is enabled (this can be done with rclone with the rclone backend versioning command) when rclone uploads a new version of a file it creates a new version of it Likewise when you delete a file, the old version will be marked hidden and still be available.

      Old versions of files, where available, are visible using the --s3-versions flag.

      @@ -12722,9 +13482,9 @@

      Object-lock enabled S3 bucket

      If you configure a default retention period on a bucket, requests to upload objects in such a bucket must include the Content-MD5 header.

      -

      As mentioned in the Hashes section, small files that are not uploaded as multipart, use a different tag, causing the upload to fail. A simple solution is to set the --s3-upload-cutoff 0 and force all the files to be uploaded as multipart.

      +

      As mentioned in the Modification times and hashes section, small files that are not uploaded as multipart, use a different tag, causing the upload to fail. A simple solution is to set the --s3-upload-cutoff 0 and force all the files to be uploaded as multipart.

      Standard options

      -

      Here are the Standard options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, China Mobile, Cloudflare, GCS, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Leviia, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi).

      +

      Here are the Standard options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Minio, Netease, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others).

      --s3-provider

      Choose your S3 provider.

      Properties:

      @@ -12799,6 +13559,10 @@

      --s3-provider

      • Liara Object Storage
      +
    • "Linode" +
        +
      • Linode Object Storage
      • +
    • "Minio"
      • Minio Object Storage
      • @@ -12815,6 +13579,10 @@

        --s3-provider

        • RackCorp Object Storage
        +
      • "Rclone" +
          +
        • Rclone S3 Server
        • +
      • "Scaleway"
        • Scaleway Object Storage
        • @@ -13033,3272 +13801,3162 @@

          --s3-region

    • -

      --s3-region

      -

      region - the location where your bucket will be created and your data stored.

      +

      --s3-endpoint

      +

      Endpoint for S3 API.

      +

      Leave blank if using AWS to use the default endpoint for the region.

      +

      Properties:

      +
        +
      • Config: endpoint
      • +
      • Env Var: RCLONE_S3_ENDPOINT
      • +
      • Provider: AWS
      • +
      • Type: string
      • +
      • Required: false
      • +
      +

      --s3-location-constraint

      +

      Location constraint - must be set to match the Region.

      +

      Used when creating buckets only.

      Properties:

        -
      • Config: region
      • -
      • Env Var: RCLONE_S3_REGION
      • -
      • Provider: RackCorp
      • +
      • Config: location_constraint
      • +
      • Env Var: RCLONE_S3_LOCATION_CONSTRAINT
      • +
      • Provider: AWS
      • Type: string
      • Required: false
      • Examples:
          -
        • "global" +
        • ""
            -
          • Global CDN (All locations) Region
          • +
          • Empty for US Region, Northern Virginia, or Pacific Northwest
        • -
        • "au" +
        • "us-east-2"
            -
          • Australia (All states)
          • +
          • US East (Ohio) Region
        • -
        • "au-nsw" +
        • "us-west-1"
            -
          • NSW (Australia) Region
          • +
          • US West (Northern California) Region
        • -
        • "au-qld" +
        • "us-west-2"
            -
          • QLD (Australia) Region
          • +
          • US West (Oregon) Region
        • -
        • "au-vic" +
        • "ca-central-1"
            -
          • VIC (Australia) Region
          • +
          • Canada (Central) Region
        • -
        • "au-wa" +
        • "eu-west-1"
            -
          • Perth (Australia) Region
          • +
          • EU (Ireland) Region
        • -
        • "ph" +
        • "eu-west-2"
            -
          • Manila (Philippines) Region
          • +
          • EU (London) Region
        • -
        • "th" +
        • "eu-west-3"
            -
          • Bangkok (Thailand) Region
          • +
          • EU (Paris) Region
        • -
        • "hk" +
        • "eu-north-1"
            -
          • HK (Hong Kong) Region
          • +
          • EU (Stockholm) Region
        • -
        • "mn" +
        • "eu-south-1"
            -
          • Ulaanbaatar (Mongolia) Region
          • +
          • EU (Milan) Region
        • -
        • "kg" +
        • "EU"
            -
          • Bishkek (Kyrgyzstan) Region
          • +
          • EU Region
        • -
        • "id" +
        • "ap-southeast-1"
            -
          • Jakarta (Indonesia) Region
          • +
          • Asia Pacific (Singapore) Region
        • -
        • "jp" +
        • "ap-southeast-2"
            -
          • Tokyo (Japan) Region
          • +
          • Asia Pacific (Sydney) Region
        • -
        • "sg" +
        • "ap-northeast-1"
            -
          • SG (Singapore) Region
          • +
          • Asia Pacific (Tokyo) Region
        • -
        • "de" +
        • "ap-northeast-2"
            -
          • Frankfurt (Germany) Region
          • +
          • Asia Pacific (Seoul) Region
        • -
        • "us" +
        • "ap-northeast-3"
            -
          • USA (AnyCast) Region
          • +
          • Asia Pacific (Osaka-Local) Region
        • -
        • "us-east-1" +
        • "ap-south-1"
            -
          • New York (USA) Region
          • +
          • Asia Pacific (Mumbai) Region
        • -
        • "us-west-1" +
        • "ap-east-1"
            -
          • Freemont (USA) Region
          • +
          • Asia Pacific (Hong Kong) Region
        • -
        • "nz" +
        • "sa-east-1"
            -
          • Auckland (New Zealand) Region
          • +
          • South America (Sao Paulo) Region
        • +
        • "me-south-1" +
            +
          • Middle East (Bahrain) Region
        • -
        -

        --s3-region

        -

        Region to connect to.

        -

        Properties:

        +
      • "af-south-1"
          -
        • Config: region
        • -
        • Env Var: RCLONE_S3_REGION
        • -
        • Provider: Scaleway
        • -
        • Type: string
        • -
        • Required: false
        • -
        • Examples: +
        • Africa (Cape Town) Region
        • +
      • +
      • "cn-north-1"
          -
        • "nl-ams" +
        • China (Beijing) Region
        • +
      • +
      • "cn-northwest-1"
          -
        • Amsterdam, The Netherlands
        • +
        • China (Ningxia) Region
      • -
      • "fr-par" +
      • "us-gov-east-1"
          -
        • Paris, France
        • +
        • AWS GovCloud (US-East) Region
      • -
      • "pl-waw" +
      • "us-gov-west-1"
          -
        • Warsaw, Poland
        • +
        • AWS GovCloud (US) Region
      -

      --s3-region

      -

      Region to connect to. - the location where your bucket will be created and your data stored. Need bo be same with your endpoint.

      +

      --s3-acl

      +

      Canned ACL used when creating buckets and storing or copying objects.

      +

      This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.

      +

      For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl

      +

      Note that this ACL is applied when server-side copying objects as S3 doesn't copy the ACL from the source but rather writes a fresh one.

      +

      If the acl is an empty string then no X-Amz-Acl: header is added and the default (private) will be used.

      Properties:

        -
      • Config: region
      • -
      • Env Var: RCLONE_S3_REGION
      • -
      • Provider: HuaweiOBS
      • +
      • Config: acl
      • +
      • Env Var: RCLONE_S3_ACL
      • +
      • Provider: !Storj,Synology,Cloudflare
      • Type: string
      • Required: false
      • Examples:
          -
        • "af-south-1" -
            -
          • AF-Johannesburg
          • -
        • -
        • "ap-southeast-2" -
            -
          • AP-Bangkok
          • -
        • -
        • "ap-southeast-3" -
            -
          • AP-Singapore
          • -
        • -
        • "cn-east-3" -
            -
          • CN East-Shanghai1
          • -
        • -
        • "cn-east-2" +
        • "default"
            -
          • CN East-Shanghai2
          • +
          • Owner gets Full_CONTROL.
          • +
          • No one else has access rights (default).
        • -
        • "cn-north-1" +
        • "private"
            -
          • CN North-Beijing1
          • +
          • Owner gets FULL_CONTROL.
          • +
          • No one else has access rights (default).
        • -
        • "cn-north-4" +
        • "public-read"
            -
          • CN North-Beijing4
          • +
          • Owner gets FULL_CONTROL.
          • +
          • The AllUsers group gets READ access.
        • -
        • "cn-south-1" +
        • "public-read-write"
            -
          • CN South-Guangzhou
          • +
          • Owner gets FULL_CONTROL.
          • +
          • The AllUsers group gets READ and WRITE access.
          • +
          • Granting this on a bucket is generally not recommended.
        • -
        • "ap-southeast-1" +
        • "authenticated-read"
            -
          • CN-Hong Kong
          • +
          • Owner gets FULL_CONTROL.
          • +
          • The AuthenticatedUsers group gets READ access.
        • -
        • "sa-argentina-1" +
        • "bucket-owner-read"
            -
          • LA-Buenos Aires1
          • +
          • Object owner gets FULL_CONTROL.
          • +
          • Bucket owner gets READ access.
          • +
          • If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
        • -
        • "sa-peru-1" +
        • "bucket-owner-full-control"
            -
          • LA-Lima1
          • +
          • Both the object owner and the bucket owner get FULL_CONTROL over the object.
          • +
          • If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
        • -
        • "na-mexico-1" +
        • "private"
            -
          • LA-Mexico City1
          • +
          • Owner gets FULL_CONTROL.
          • +
          • No one else has access rights (default).
          • +
          • This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise COS.
        • -
        • "sa-chile-1" +
        • "public-read"
            -
          • LA-Santiago2
          • +
          • Owner gets FULL_CONTROL.
          • +
          • The AllUsers group gets READ access.
          • +
          • This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise IBM COS.
        • -
        • "sa-brazil-1" +
        • "public-read-write"
            -
          • LA-Sao Paulo1
          • +
          • Owner gets FULL_CONTROL.
          • +
          • The AllUsers group gets READ and WRITE access.
          • +
          • This acl is available on IBM Cloud (Infra), On-Premise IBM COS.
        • -
        • "ru-northwest-2" +
        • "authenticated-read"
            -
          • RU-Moscow2
          • +
          • Owner gets FULL_CONTROL.
          • +
          • The AuthenticatedUsers group gets READ access.
          • +
          • Not supported on Buckets.
          • +
          • This acl is available on IBM Cloud (Infra) and On-Premise IBM COS.
      -

      --s3-region

      -

      Region to connect to.

      +

      --s3-server-side-encryption

      +

      The server-side encryption algorithm used when storing this object in S3.

      Properties:

        -
      • Config: region
      • -
      • Env Var: RCLONE_S3_REGION
      • -
      • Provider: Cloudflare
      • +
      • Config: server_side_encryption
      • +
      • Env Var: RCLONE_S3_SERVER_SIDE_ENCRYPTION
      • +
      • Provider: AWS,Ceph,ChinaMobile,Minio
      • Type: string
      • Required: false
      • Examples:
          -
        • "auto" +
        • "" +
            +
          • None
          • +
        • +
        • "AES256" +
            +
          • AES256
          • +
        • +
        • "aws:kms"
            -
          • R2 buckets are automatically distributed across Cloudflare's data centers for low latency.
          • +
          • aws:kms
      -

      --s3-region

      -

      Region to connect to.

      +

      --s3-sse-kms-key-id

      +

      If using KMS ID you must provide the ARN of Key.

      Properties:

        -
      • Config: region
      • -
      • Env Var: RCLONE_S3_REGION
      • -
      • Provider: Qiniu
      • +
      • Config: sse_kms_key_id
      • +
      • Env Var: RCLONE_S3_SSE_KMS_KEY_ID
      • +
      • Provider: AWS,Ceph,Minio
      • Type: string
      • Required: false
      • Examples:
          -
        • "cn-east-1" -
            -
          • The default endpoint - a good choice if you are unsure.
          • -
          • East China Region 1.
          • -
          • Needs location constraint cn-east-1.
          • -
        • -
        • "cn-east-2" -
            -
          • East China Region 2.
          • -
          • Needs location constraint cn-east-2.
          • -
        • -
        • "cn-north-1" -
            -
          • North China Region 1.
          • -
          • Needs location constraint cn-north-1.
          • -
        • -
        • "cn-south-1" -
            -
          • South China Region 1.
          • -
          • Needs location constraint cn-south-1.
          • -
        • -
        • "us-north-1" -
            -
          • North America Region.
          • -
          • Needs location constraint us-north-1.
          • -
        • -
        • "ap-southeast-1" +
        • ""
            -
          • Southeast Asia Region 1.
          • -
          • Needs location constraint ap-southeast-1.
          • +
          • None
        • -
        • "ap-northeast-1" +
        • "arn:aws:kms:us-east-1:*"
            -
          • Northeast Asia Region 1.
          • -
          • Needs location constraint ap-northeast-1.
          • +
          • arn:aws:kms:*
      -

      --s3-region

      -

      Region where your bucket will be created and your data stored.

      +

      --s3-storage-class

      +

      The storage class to use when storing new objects in S3.

      Properties:

        -
      • Config: region
      • -
      • Env Var: RCLONE_S3_REGION
      • -
      • Provider: IONOS
      • +
      • Config: storage_class
      • +
      • Env Var: RCLONE_S3_STORAGE_CLASS
      • +
      • Provider: AWS
      • Type: string
      • Required: false
      • Examples:
          -
        • "de" +
        • ""
            -
          • Frankfurt, Germany
          • +
          • Default
        • -
        • "eu-central-2" +
        • "STANDARD"
            -
          • Berlin, Germany
          • +
          • Standard storage class
        • -
        • "eu-south-2" +
        • "REDUCED_REDUNDANCY"
            -
          • Logrono, Spain
          • -
        • +
        • Reduced redundancy storage class
      • -
      -

      --s3-region

      -

      Region where your bucket will be created and your data stored.

      -

      Properties:

      -
        -
      • Config: region
      • -
      • Env Var: RCLONE_S3_REGION
      • -
      • Provider: Petabox
      • -
      • Type: string
      • -
      • Required: false
      • -
      • Examples: +
      • "STANDARD_IA"
          -
        • "us-east-1" +
        • Standard Infrequent Access storage class
        • +
      • +
      • "ONEZONE_IA"
          -
        • US East (N. Virginia)
        • +
        • One Zone Infrequent Access storage class
      • -
      • "eu-central-1" +
      • "GLACIER"
          -
        • Europe (Frankfurt)
        • +
        • Glacier storage class
      • -
      • "ap-southeast-1" +
      • "DEEP_ARCHIVE"
          -
        • Asia Pacific (Singapore)
        • +
        • Glacier Deep Archive storage class
      • -
      • "me-south-1" +
      • "INTELLIGENT_TIERING"
          -
        • Middle East (Bahrain)
        • +
        • Intelligent-Tiering storage class
      • -
      • "sa-east-1" +
      • "GLACIER_IR"
          -
        • South America (São Paulo)
        • +
        • Glacier Instant Retrieval storage class
      -

      --s3-region

      -

      Region where your data stored.

      +

      Advanced options

      +

      Here are the Advanced options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Minio, Netease, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others).

      +

      --s3-bucket-acl

      +

      Canned ACL used when creating buckets.

      +

      For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl

      +

      Note that this ACL is applied when only when creating buckets. If it isn't set then "acl" is used instead.

      +

      If the "acl" and "bucket_acl" are empty strings then no X-Amz-Acl: header is added and the default (private) will be used.

      Properties:

        -
      • Config: region
      • -
      • Env Var: RCLONE_S3_REGION
      • -
      • Provider: Synology
      • +
      • Config: bucket_acl
      • +
      • Env Var: RCLONE_S3_BUCKET_ACL
      • Type: string
      • Required: false
      • Examples:
          -
        • "eu-001" -
            -
          • Europe Region 1
          • -
        • -
        • "eu-002" +
        • "private"
            -
          • Europe Region 2
          • +
          • Owner gets FULL_CONTROL.
          • +
          • No one else has access rights (default).
        • -
        • "us-001" +
        • "public-read"
            -
          • US Region 1
          • +
          • Owner gets FULL_CONTROL.
          • +
          • The AllUsers group gets READ access.
        • -
        • "us-002" +
        • "public-read-write"
            -
          • US Region 2
          • +
          • Owner gets FULL_CONTROL.
          • +
          • The AllUsers group gets READ and WRITE access.
          • +
          • Granting this on a bucket is generally not recommended.
        • -
        • "tw-001" +
        • "authenticated-read"
            -
          • Asia (Taiwan)
          • +
          • Owner gets FULL_CONTROL.
          • +
          • The AuthenticatedUsers group gets READ access.
      -

      --s3-region

      -

      Region to connect to.

      -

      Leave blank if you are using an S3 clone and you don't have a region.

      +

      --s3-requester-pays

      +

      Enables requester pays option when interacting with S3 bucket.

      Properties:

        -
      • Config: region
      • -
      • Env Var: RCLONE_S3_REGION
      • -
      • Provider: !AWS,Alibaba,ArvanCloud,ChinaMobile,Cloudflare,IONOS,Petabox,Liara,Qiniu,RackCorp,Scaleway,Storj,Synology,TencentCOS,HuaweiOBS,IDrive
      • +
      • Config: requester_pays
      • +
      • Env Var: RCLONE_S3_REQUESTER_PAYS
      • +
      • Provider: AWS
      • +
      • Type: bool
      • +
      • Default: false
      • +
      +

      --s3-sse-customer-algorithm

      +

      If using SSE-C, the server-side encryption algorithm used when storing this object in S3.

      +

      Properties:

      +
        +
      • Config: sse_customer_algorithm
      • +
      • Env Var: RCLONE_S3_SSE_CUSTOMER_ALGORITHM
      • +
      • Provider: AWS,Ceph,ChinaMobile,Minio
      • Type: string
      • Required: false
      • Examples:
        • ""
            -
          • Use this if unsure.
          • -
          • Will use v4 signatures and an empty region.
          • +
          • None
        • -
        • "other-v2-signature" +
        • "AES256"
            -
          • Use this only if v4 signatures don't work.
          • -
          • E.g. pre Jewel/v10 CEPH.
          • +
          • AES256
      -

      --s3-endpoint

      -

      Endpoint for S3 API.

      -

      Leave blank if using AWS to use the default endpoint for the region.

      -

      Properties:

      -
        -
      • Config: endpoint
      • -
      • Env Var: RCLONE_S3_ENDPOINT
      • -
      • Provider: AWS
      • -
      • Type: string
      • -
      • Required: false
      • -
      -

      --s3-endpoint

      -

      Endpoint for China Mobile Ecloud Elastic Object Storage (EOS) API.

      +

      --s3-sse-customer-key

      +

      To use SSE-C you may provide the secret encryption key used to encrypt/decrypt your data.

      +

      Alternatively you can provide --sse-customer-key-base64.

      Properties:

        -
      • Config: endpoint
      • -
      • Env Var: RCLONE_S3_ENDPOINT
      • -
      • Provider: ChinaMobile
      • +
      • Config: sse_customer_key
      • +
      • Env Var: RCLONE_S3_SSE_CUSTOMER_KEY
      • +
      • Provider: AWS,Ceph,ChinaMobile,Minio
      • Type: string
      • Required: false
      • Examples:
          -
        • "eos-wuxi-1.cmecloud.cn" -
            -
          • The default endpoint - a good choice if you are unsure.
          • -
          • East China (Suzhou)
          • -
        • -
        • "eos-jinan-1.cmecloud.cn" -
            -
          • East China (Jinan)
          • -
        • -
        • "eos-ningbo-1.cmecloud.cn" -
            -
          • East China (Hangzhou)
          • -
        • -
        • "eos-shanghai-1.cmecloud.cn" -
            -
          • East China (Shanghai-1)
          • -
        • -
        • "eos-zhengzhou-1.cmecloud.cn" -
            -
          • Central China (Zhengzhou)
          • -
        • -
        • "eos-hunan-1.cmecloud.cn" -
            -
          • Central China (Changsha-1)
          • -
        • -
        • "eos-zhuzhou-1.cmecloud.cn" -
            -
          • Central China (Changsha-2)
          • -
        • -
        • "eos-guangzhou-1.cmecloud.cn" -
            -
          • South China (Guangzhou-2)
          • -
        • -
        • "eos-dongguan-1.cmecloud.cn" -
            -
          • South China (Guangzhou-3)
          • -
        • -
        • "eos-beijing-1.cmecloud.cn" -
            -
          • North China (Beijing-1)
          • -
        • -
        • "eos-beijing-2.cmecloud.cn" -
            -
          • North China (Beijing-2)
          • -
        • -
        • "eos-beijing-4.cmecloud.cn" -
            -
          • North China (Beijing-3)
          • -
        • -
        • "eos-huhehaote-1.cmecloud.cn" -
            -
          • North China (Huhehaote)
          • -
        • -
        • "eos-chengdu-1.cmecloud.cn" -
            -
          • Southwest China (Chengdu)
          • -
        • -
        • "eos-chongqing-1.cmecloud.cn" -
            -
          • Southwest China (Chongqing)
          • -
        • -
        • "eos-guiyang-1.cmecloud.cn" -
            -
          • Southwest China (Guiyang)
          • -
        • -
        • "eos-xian-1.cmecloud.cn" -
            -
          • Nouthwest China (Xian)
          • -
        • -
        • "eos-yunnan.cmecloud.cn" -
            -
          • Yunnan China (Kunming)
          • -
        • -
        • "eos-yunnan-2.cmecloud.cn" -
            -
          • Yunnan China (Kunming-2)
          • -
        • -
        • "eos-tianjin-1.cmecloud.cn" -
            -
          • Tianjin China (Tianjin)
          • -
        • -
        • "eos-jilin-1.cmecloud.cn" -
            -
          • Jilin China (Changchun)
          • -
        • -
        • "eos-hubei-1.cmecloud.cn" -
            -
          • Hubei China (Xiangyan)
          • -
        • -
        • "eos-jiangxi-1.cmecloud.cn" -
            -
          • Jiangxi China (Nanchang)
          • -
        • -
        • "eos-gansu-1.cmecloud.cn" -
            -
          • Gansu China (Lanzhou)
          • -
        • -
        • "eos-shanxi-1.cmecloud.cn" -
            -
          • Shanxi China (Taiyuan)
          • -
        • -
        • "eos-liaoning-1.cmecloud.cn" -
            -
          • Liaoning China (Shenyang)
          • -
        • -
        • "eos-hebei-1.cmecloud.cn" -
            -
          • Hebei China (Shijiazhuang)
          • -
        • -
        • "eos-fujian-1.cmecloud.cn" -
            -
          • Fujian China (Xiamen)
          • -
        • -
        • "eos-guangxi-1.cmecloud.cn" -
            -
          • Guangxi China (Nanning)
          • -
        • -
        • "eos-anhui-1.cmecloud.cn" +
        • ""
            -
          • Anhui China (Huainan)
          • +
          • None
      -

      --s3-endpoint

      -

      Endpoint for Arvan Cloud Object Storage (AOS) API.

      +

      --s3-sse-customer-key-base64

      +

      If using SSE-C you must provide the secret encryption key encoded in base64 format to encrypt/decrypt your data.

      +

      Alternatively you can provide --sse-customer-key.

      Properties:

        -
      • Config: endpoint
      • -
      • Env Var: RCLONE_S3_ENDPOINT
      • -
      • Provider: ArvanCloud
      • +
      • Config: sse_customer_key_base64
      • +
      • Env Var: RCLONE_S3_SSE_CUSTOMER_KEY_BASE64
      • +
      • Provider: AWS,Ceph,ChinaMobile,Minio
      • Type: string
      • Required: false
      • Examples:
          -
        • "s3.ir-thr-at1.arvanstorage.ir" -
            -
          • The default endpoint - a good choice if you are unsure.
          • -
          • Tehran Iran (Simin)
          • -
        • -
        • "s3.ir-tbz-sh1.arvanstorage.ir" +
        • ""
            -
          • Tabriz Iran (Shahriar)
          • +
          • None
      -

      --s3-endpoint

      -

      Endpoint for IBM COS S3 API.

      -

      Specify if using an IBM COS On Premise.

      +

      --s3-sse-customer-key-md5

      +

      If using SSE-C you may provide the secret encryption key MD5 checksum (optional).

      +

      If you leave it blank, this is calculated automatically from the sse_customer_key provided.

      Properties:

        -
      • Config: endpoint
      • -
      • Env Var: RCLONE_S3_ENDPOINT
      • -
      • Provider: IBMCOS
      • +
      • Config: sse_customer_key_md5
      • +
      • Env Var: RCLONE_S3_SSE_CUSTOMER_KEY_MD5
      • +
      • Provider: AWS,Ceph,ChinaMobile,Minio
      • Type: string
      • Required: false
      • Examples:
          -
        • "s3.us.cloud-object-storage.appdomain.cloud" -
            -
          • US Cross Region Endpoint
          • -
        • -
        • "s3.dal.us.cloud-object-storage.appdomain.cloud" +
        • ""
            -
          • US Cross Region Dallas Endpoint
          • -
        • -
        • "s3.wdc.us.cloud-object-storage.appdomain.cloud" -
            -
          • US Cross Region Washington DC Endpoint
          • -
        • -
        • "s3.sjc.us.cloud-object-storage.appdomain.cloud" -
            -
          • US Cross Region San Jose Endpoint
          • -
        • -
        • "s3.private.us.cloud-object-storage.appdomain.cloud" -
            -
          • US Cross Region Private Endpoint
          • -
        • -
        • "s3.private.dal.us.cloud-object-storage.appdomain.cloud" -
            -
          • US Cross Region Dallas Private Endpoint
          • -
        • -
        • "s3.private.wdc.us.cloud-object-storage.appdomain.cloud" -
            -
          • US Cross Region Washington DC Private Endpoint
          • -
        • -
        • "s3.private.sjc.us.cloud-object-storage.appdomain.cloud" -
            -
          • US Cross Region San Jose Private Endpoint
          • -
        • -
        • "s3.us-east.cloud-object-storage.appdomain.cloud" -
            -
          • US Region East Endpoint
          • -
        • -
        • "s3.private.us-east.cloud-object-storage.appdomain.cloud" -
            -
          • US Region East Private Endpoint
          • -
        • -
        • "s3.us-south.cloud-object-storage.appdomain.cloud" -
            -
          • US Region South Endpoint
          • -
        • -
        • "s3.private.us-south.cloud-object-storage.appdomain.cloud" -
            -
          • US Region South Private Endpoint
          • -
        • -
        • "s3.eu.cloud-object-storage.appdomain.cloud" -
            -
          • EU Cross Region Endpoint
          • -
        • -
        • "s3.fra.eu.cloud-object-storage.appdomain.cloud" -
            -
          • EU Cross Region Frankfurt Endpoint
          • -
        • -
        • "s3.mil.eu.cloud-object-storage.appdomain.cloud" -
            -
          • EU Cross Region Milan Endpoint
          • -
        • -
        • "s3.ams.eu.cloud-object-storage.appdomain.cloud" -
            -
          • EU Cross Region Amsterdam Endpoint
          • -
        • -
        • "s3.private.eu.cloud-object-storage.appdomain.cloud" -
            -
          • EU Cross Region Private Endpoint
          • -
        • -
        • "s3.private.fra.eu.cloud-object-storage.appdomain.cloud" -
            -
          • EU Cross Region Frankfurt Private Endpoint
          • -
        • -
        • "s3.private.mil.eu.cloud-object-storage.appdomain.cloud" -
            -
          • EU Cross Region Milan Private Endpoint
          • -
        • -
        • "s3.private.ams.eu.cloud-object-storage.appdomain.cloud" -
            -
          • EU Cross Region Amsterdam Private Endpoint
          • -
        • -
        • "s3.eu-gb.cloud-object-storage.appdomain.cloud" -
            -
          • Great Britain Endpoint
          • -
        • -
        • "s3.private.eu-gb.cloud-object-storage.appdomain.cloud" -
            -
          • Great Britain Private Endpoint
          • -
        • -
        • "s3.eu-de.cloud-object-storage.appdomain.cloud" -
            -
          • EU Region DE Endpoint
          • -
        • -
        • "s3.private.eu-de.cloud-object-storage.appdomain.cloud" -
            -
          • EU Region DE Private Endpoint
          • -
        • -
        • "s3.ap.cloud-object-storage.appdomain.cloud" -
            -
          • APAC Cross Regional Endpoint
          • -
        • -
        • "s3.tok.ap.cloud-object-storage.appdomain.cloud" -
            -
          • APAC Cross Regional Tokyo Endpoint
          • -
        • -
        • "s3.hkg.ap.cloud-object-storage.appdomain.cloud" -
            -
          • APAC Cross Regional HongKong Endpoint
          • -
        • -
        • "s3.seo.ap.cloud-object-storage.appdomain.cloud" -
            -
          • APAC Cross Regional Seoul Endpoint
          • -
        • -
        • "s3.private.ap.cloud-object-storage.appdomain.cloud" -
            -
          • APAC Cross Regional Private Endpoint
          • -
        • -
        • "s3.private.tok.ap.cloud-object-storage.appdomain.cloud" -
            -
          • APAC Cross Regional Tokyo Private Endpoint
          • -
        • -
        • "s3.private.hkg.ap.cloud-object-storage.appdomain.cloud" -
            -
          • APAC Cross Regional HongKong Private Endpoint
          • -
        • -
        • "s3.private.seo.ap.cloud-object-storage.appdomain.cloud" -
            -
          • APAC Cross Regional Seoul Private Endpoint
          • -
        • -
        • "s3.jp-tok.cloud-object-storage.appdomain.cloud" -
            -
          • APAC Region Japan Endpoint
          • -
        • -
        • "s3.private.jp-tok.cloud-object-storage.appdomain.cloud" -
            -
          • APAC Region Japan Private Endpoint
          • -
        • -
        • "s3.au-syd.cloud-object-storage.appdomain.cloud" -
            -
          • APAC Region Australia Endpoint
          • -
        • -
        • "s3.private.au-syd.cloud-object-storage.appdomain.cloud" -
            -
          • APAC Region Australia Private Endpoint
          • -
        • -
        • "s3.ams03.cloud-object-storage.appdomain.cloud" -
            -
          • Amsterdam Single Site Endpoint
          • -
        • -
        • "s3.private.ams03.cloud-object-storage.appdomain.cloud" -
            -
          • Amsterdam Single Site Private Endpoint
          • -
        • -
        • "s3.che01.cloud-object-storage.appdomain.cloud" -
            -
          • Chennai Single Site Endpoint
          • -
        • -
        • "s3.private.che01.cloud-object-storage.appdomain.cloud" -
            -
          • Chennai Single Site Private Endpoint
          • -
        • -
        • "s3.mel01.cloud-object-storage.appdomain.cloud" -
            -
          • Melbourne Single Site Endpoint
          • -
        • -
        • "s3.private.mel01.cloud-object-storage.appdomain.cloud" -
            -
          • Melbourne Single Site Private Endpoint
          • -
        • -
        • "s3.osl01.cloud-object-storage.appdomain.cloud" -
            -
          • Oslo Single Site Endpoint
          • -
        • -
        • "s3.private.osl01.cloud-object-storage.appdomain.cloud" -
            -
          • Oslo Single Site Private Endpoint
          • -
        • -
        • "s3.tor01.cloud-object-storage.appdomain.cloud" -
            -
          • Toronto Single Site Endpoint
          • -
        • -
        • "s3.private.tor01.cloud-object-storage.appdomain.cloud" -
            -
          • Toronto Single Site Private Endpoint
          • -
        • -
        • "s3.seo01.cloud-object-storage.appdomain.cloud" -
            -
          • Seoul Single Site Endpoint
          • -
        • -
        • "s3.private.seo01.cloud-object-storage.appdomain.cloud" -
            -
          • Seoul Single Site Private Endpoint
          • -
        • -
        • "s3.mon01.cloud-object-storage.appdomain.cloud" -
            -
          • Montreal Single Site Endpoint
          • -
        • -
        • "s3.private.mon01.cloud-object-storage.appdomain.cloud" -
            -
          • Montreal Single Site Private Endpoint
          • -
        • -
        • "s3.mex01.cloud-object-storage.appdomain.cloud" -
            -
          • Mexico Single Site Endpoint
          • -
        • -
        • "s3.private.mex01.cloud-object-storage.appdomain.cloud" -
            -
          • Mexico Single Site Private Endpoint
          • -
        • -
        • "s3.sjc04.cloud-object-storage.appdomain.cloud" -
            -
          • San Jose Single Site Endpoint
          • -
        • -
        • "s3.private.sjc04.cloud-object-storage.appdomain.cloud" -
            -
          • San Jose Single Site Private Endpoint
          • -
        • -
        • "s3.mil01.cloud-object-storage.appdomain.cloud" -
            -
          • Milan Single Site Endpoint
          • -
        • -
        • "s3.private.mil01.cloud-object-storage.appdomain.cloud" -
            -
          • Milan Single Site Private Endpoint
          • -
        • -
        • "s3.hkg02.cloud-object-storage.appdomain.cloud" -
            -
          • Hong Kong Single Site Endpoint
          • -
        • -
        • "s3.private.hkg02.cloud-object-storage.appdomain.cloud" -
            -
          • Hong Kong Single Site Private Endpoint
          • -
        • -
        • "s3.par01.cloud-object-storage.appdomain.cloud" -
            -
          • Paris Single Site Endpoint
          • -
        • -
        • "s3.private.par01.cloud-object-storage.appdomain.cloud" -
            -
          • Paris Single Site Private Endpoint
          • -
        • -
        • "s3.sng01.cloud-object-storage.appdomain.cloud" -
            -
          • Singapore Single Site Endpoint
          • -
        • -
        • "s3.private.sng01.cloud-object-storage.appdomain.cloud" -
            -
          • Singapore Single Site Private Endpoint
          • +
          • None
      -

      --s3-endpoint

      -

      Endpoint for IONOS S3 Object Storage.

      -

      Specify the endpoint from the same region.

      +

      --s3-upload-cutoff

      +

      Cutoff for switching to chunked upload.

      +

      Any files larger than this will be uploaded in chunks of chunk_size. The minimum is 0 and the maximum is 5 GiB.

      Properties:

        -
      • Config: endpoint
      • -
      • Env Var: RCLONE_S3_ENDPOINT
      • -
      • Provider: IONOS
      • -
      • Type: string
      • -
      • Required: false
      • -
      • Examples: -
          -
        • "s3-eu-central-1.ionoscloud.com" -
            -
          • Frankfurt, Germany
          • -
        • -
        • "s3-eu-central-2.ionoscloud.com" -
            -
          • Berlin, Germany
          • -
        • -
        • "s3-eu-south-2.ionoscloud.com" -
            -
          • Logrono, Spain
          • -
        • -
      • +
      • Config: upload_cutoff
      • +
      • Env Var: RCLONE_S3_UPLOAD_CUTOFF
      • +
      • Type: SizeSuffix
      • +
      • Default: 200Mi
      -

      --s3-endpoint

      -

      Endpoint for Petabox S3 Object Storage.

      -

      Specify the endpoint from the same region.

      +

      --s3-chunk-size

      +

      Chunk size to use for uploading.

      +

      When uploading files larger than upload_cutoff or files with unknown size (e.g. from "rclone rcat" or uploaded with "rclone mount" or google photos or google docs) they will be uploaded as multipart uploads using this chunk size.

      +

      Note that "--s3-upload-concurrency" chunks of this size are buffered in memory per transfer.

      +

      If you are transferring large files over high-speed links and you have enough memory, then increasing this will speed up the transfers.

      +

      Rclone will automatically increase the chunk size when uploading a large file of known size to stay below the 10,000 chunks limit.

      +

      Files of unknown size are uploaded with the configured chunk_size. Since the default chunk size is 5 MiB and there can be at most 10,000 chunks, this means that by default the maximum size of a file you can stream upload is 48 GiB. If you wish to stream upload larger files then you will need to increase chunk_size.

      +

      Increasing the chunk size decreases the accuracy of the progress statistics displayed with "-P" flag. Rclone treats chunk as sent when it's buffered by the AWS SDK, when in fact it may still be uploading. A bigger chunk size means a bigger AWS SDK buffer and progress reporting more deviating from the truth.

      Properties:

        -
      • Config: endpoint
      • -
      • Env Var: RCLONE_S3_ENDPOINT
      • -
      • Provider: Petabox
      • -
      • Type: string
      • -
      • Required: true
      • -
      • Examples: -
          -
        • "s3.petabox.io" -
            -
          • US East (N. Virginia)
          • -
        • -
        • "s3.us-east-1.petabox.io" -
            -
          • US East (N. Virginia)
          • -
        • -
        • "s3.eu-central-1.petabox.io" -
            -
          • Europe (Frankfurt)
          • -
        • -
        • "s3.ap-southeast-1.petabox.io" -
            -
          • Asia Pacific (Singapore)
          • -
        • -
        • "s3.me-south-1.petabox.io" -
            -
          • Middle East (Bahrain)
          • -
        • -
        • "s3.sa-east-1.petabox.io" -
            -
          • South America (São Paulo)
          • -
        • -
      • +
      • Config: chunk_size
      • +
      • Env Var: RCLONE_S3_CHUNK_SIZE
      • +
      • Type: SizeSuffix
      • +
      • Default: 5Mi
      -

      --s3-endpoint

      -

      Endpoint for Leviia Object Storage API.

      +

      --s3-max-upload-parts

      +

      Maximum number of parts in a multipart upload.

      +

      This option defines the maximum number of multipart chunks to use when doing a multipart upload.

      +

      This can be useful if a service does not support the AWS S3 specification of 10,000 chunks.

      +

      Rclone will automatically increase the chunk size when uploading a large file of a known size to stay below this number of chunks limit.

      Properties:

        -
      • Config: endpoint
      • -
      • Env Var: RCLONE_S3_ENDPOINT
      • -
      • Provider: Leviia
      • -
      • Type: string
      • -
      • Required: false
      • -
      • Examples: +
      • Config: max_upload_parts
      • +
      • Env Var: RCLONE_S3_MAX_UPLOAD_PARTS
      • +
      • Type: int
      • +
      • Default: 10000
      • +
      +

      --s3-copy-cutoff

      +

      Cutoff for switching to multipart copy.

      +

      Any files larger than this that need to be server-side copied will be copied in chunks of this size.

      +

      The minimum is 0 and the maximum is 5 GiB.

      +

      Properties:

        -
      • "s3.leviia.com" +
      • Config: copy_cutoff
      • +
      • Env Var: RCLONE_S3_COPY_CUTOFF
      • +
      • Type: SizeSuffix
      • +
      • Default: 4.656Gi
      • +
      +

      --s3-disable-checksum

      +

      Don't store MD5 checksum with object metadata.

      +

      Normally rclone will calculate the MD5 checksum of the input before uploading it so it can add it to metadata on the object. This is great for data integrity checking but can cause long delays for large files to start uploading.

      +

      Properties:

        -
      • The default endpoint
      • -
      • Leviia
      • -
      - +
    • Config: disable_checksum
    • +
    • Env Var: RCLONE_S3_DISABLE_CHECKSUM
    • +
    • Type: bool
    • +
    • Default: false
    • -

      --s3-endpoint

      -

      Endpoint for Liara Object Storage API.

      +

      --s3-shared-credentials-file

      +

      Path to the shared credentials file.

      +

      If env_auth = true then rclone can use a shared credentials file.

      +

      If this variable is empty rclone will look for the "AWS_SHARED_CREDENTIALS_FILE" env variable. If the env value is empty it will default to the current user's home directory.

      +
      Linux/OSX: "$HOME/.aws/credentials"
      +Windows:   "%USERPROFILE%\.aws\credentials"

      Properties:

        -
      • Config: endpoint
      • -
      • Env Var: RCLONE_S3_ENDPOINT
      • -
      • Provider: Liara
      • +
      • Config: shared_credentials_file
      • +
      • Env Var: RCLONE_S3_SHARED_CREDENTIALS_FILE
      • Type: string
      • Required: false
      • -
      • Examples: -
          -
        • "storage.iran.liara.space" -
            -
          • The default endpoint
          • -
          • Iran
          • -
        • -
      -

      --s3-endpoint

      -

      Endpoint for OSS API.

      +

      --s3-profile

      +

      Profile to use in the shared credentials file.

      +

      If env_auth = true then rclone can use a shared credentials file. This variable controls which profile is used in that file.

      +

      If empty it will default to the environment variable "AWS_PROFILE" or "default" if that environment variable is also not set.

      Properties:

        -
      • Config: endpoint
      • -
      • Env Var: RCLONE_S3_ENDPOINT
      • -
      • Provider: Alibaba
      • +
      • Config: profile
      • +
      • Env Var: RCLONE_S3_PROFILE
      • Type: string
      • Required: false
      • -
      • Examples: -
          -
        • "oss-accelerate.aliyuncs.com" -
            -
          • Global Accelerate
          • -
        • -
        • "oss-accelerate-overseas.aliyuncs.com" -
            -
          • Global Accelerate (outside mainland China)
          • -
        • -
        • "oss-cn-hangzhou.aliyuncs.com" -
            -
          • East China 1 (Hangzhou)
          • -
        • -
        • "oss-cn-shanghai.aliyuncs.com" -
            -
          • East China 2 (Shanghai)
          • -
        • -
        • "oss-cn-qingdao.aliyuncs.com" -
            -
          • North China 1 (Qingdao)
          • -
        • -
        • "oss-cn-beijing.aliyuncs.com" -
            -
          • North China 2 (Beijing)
          • -
        • -
        • "oss-cn-zhangjiakou.aliyuncs.com" -
            -
          • North China 3 (Zhangjiakou)
          • -
        • -
        • "oss-cn-huhehaote.aliyuncs.com" -
            -
          • North China 5 (Hohhot)
          • -
        • -
        • "oss-cn-wulanchabu.aliyuncs.com" -
            -
          • North China 6 (Ulanqab)
          • -
        • -
        • "oss-cn-shenzhen.aliyuncs.com" -
            -
          • South China 1 (Shenzhen)
          • -
        • -
        • "oss-cn-heyuan.aliyuncs.com" -
            -
          • South China 2 (Heyuan)
          • -
        • -
        • "oss-cn-guangzhou.aliyuncs.com" -
            -
          • South China 3 (Guangzhou)
          • -
        • -
        • "oss-cn-chengdu.aliyuncs.com" -
            -
          • West China 1 (Chengdu)
          • -
        • -
        • "oss-cn-hongkong.aliyuncs.com" -
            -
          • Hong Kong (Hong Kong)
          • -
        • -
        • "oss-us-west-1.aliyuncs.com" -
            -
          • US West 1 (Silicon Valley)
          • -
        • -
        • "oss-us-east-1.aliyuncs.com" -
            -
          • US East 1 (Virginia)
          • -
        • -
        • "oss-ap-southeast-1.aliyuncs.com" -
            -
          • Southeast Asia Southeast 1 (Singapore)
          • -
        • -
        • "oss-ap-southeast-2.aliyuncs.com" -
            -
          • Asia Pacific Southeast 2 (Sydney)
          • -
        • -
        • "oss-ap-southeast-3.aliyuncs.com" -
            -
          • Southeast Asia Southeast 3 (Kuala Lumpur)
          • -
        • -
        • "oss-ap-southeast-5.aliyuncs.com" -
            -
          • Asia Pacific Southeast 5 (Jakarta)
          • -
        • -
        • "oss-ap-northeast-1.aliyuncs.com" -
            -
          • Asia Pacific Northeast 1 (Japan)
          • -
        • -
        • "oss-ap-south-1.aliyuncs.com" -
            -
          • Asia Pacific South 1 (Mumbai)
          • -
        • -
        • "oss-eu-central-1.aliyuncs.com" -
            -
          • Central Europe 1 (Frankfurt)
          • -
        • -
        • "oss-eu-west-1.aliyuncs.com" -
            -
          • West Europe (London)
          • -
        • -
        • "oss-me-east-1.aliyuncs.com" -
            -
          • Middle East 1 (Dubai)
          • -
        • -
      -

      --s3-endpoint

      -

      Endpoint for OBS API.

      +

      --s3-session-token

      +

      An AWS session token.

      Properties:

        -
      • Config: endpoint
      • -
      • Env Var: RCLONE_S3_ENDPOINT
      • -
      • Provider: HuaweiOBS
      • +
      • Config: session_token
      • +
      • Env Var: RCLONE_S3_SESSION_TOKEN
      • Type: string
      • Required: false
      • -
      • Examples: -
          -
        • "obs.af-south-1.myhuaweicloud.com" -
            -
          • AF-Johannesburg
          • -
        • -
        • "obs.ap-southeast-2.myhuaweicloud.com" -
            -
          • AP-Bangkok
          • -
        • -
        • "obs.ap-southeast-3.myhuaweicloud.com" -
            -
          • AP-Singapore
          • -
        • -
        • "obs.cn-east-3.myhuaweicloud.com" -
            -
          • CN East-Shanghai1
          • -
        • -
        • "obs.cn-east-2.myhuaweicloud.com" -
            -
          • CN East-Shanghai2
          • -
        • -
        • "obs.cn-north-1.myhuaweicloud.com" -
            -
          • CN North-Beijing1
          • -
        • -
        • "obs.cn-north-4.myhuaweicloud.com" -
            -
          • CN North-Beijing4
          • -
        • -
        • "obs.cn-south-1.myhuaweicloud.com" -
            -
          • CN South-Guangzhou
          • -
        • -
        • "obs.ap-southeast-1.myhuaweicloud.com" -
            -
          • CN-Hong Kong
          • -
        • -
        • "obs.sa-argentina-1.myhuaweicloud.com" +
        +

        --s3-upload-concurrency

        +

        Concurrency for multipart uploads.

        +

        This is the number of chunks of the same file that are uploaded concurrently.

        +

        If you are uploading small numbers of large files over high-speed links and these uploads do not fully utilize your bandwidth, then increasing this may help to speed up the transfers.

        +

        Properties:

          -
        • LA-Buenos Aires1
        • -
      • -
      • "obs.sa-peru-1.myhuaweicloud.com" +
      • Config: upload_concurrency
      • +
      • Env Var: RCLONE_S3_UPLOAD_CONCURRENCY
      • +
      • Type: int
      • +
      • Default: 4
      • +
      +

      --s3-force-path-style

      +

      If true use path style access if false use virtual hosted style.

      +

      If this is true (the default) then rclone will use path style access, if false then rclone will use virtual path style. See the AWS S3 docs for more info.

      +

      Some providers (e.g. AWS, Aliyun OSS, Netease COS, or Tencent COS) require this set to false - rclone will do this automatically based on the provider setting.

      +

      Properties:

        -
      • LA-Lima1
      • -
      -
    • "obs.na-mexico-1.myhuaweicloud.com" +
    • Config: force_path_style
    • +
    • Env Var: RCLONE_S3_FORCE_PATH_STYLE
    • +
    • Type: bool
    • +
    • Default: true
    • + +

      --s3-v2-auth

      +

      If true use v2 authentication.

      +

      If this is false (the default) then rclone will use v4 authentication. If it is set then rclone will use v2 authentication.

      +

      Use this only if v4 signatures don't work, e.g. pre Jewel/v10 CEPH.

      +

      Properties:

        -
      • LA-Mexico City1
      • -
      -
    • "obs.sa-chile-1.myhuaweicloud.com" +
    • Config: v2_auth
    • +
    • Env Var: RCLONE_S3_V2_AUTH
    • +
    • Type: bool
    • +
    • Default: false
    • + +

      --s3-use-accelerate-endpoint

      +

      If true use the AWS S3 accelerated endpoint.

      +

      See: AWS S3 Transfer acceleration

      +

      Properties:

        -
      • LA-Santiago2
      • -
      -
    • "obs.sa-brazil-1.myhuaweicloud.com" +
    • Config: use_accelerate_endpoint
    • +
    • Env Var: RCLONE_S3_USE_ACCELERATE_ENDPOINT
    • +
    • Provider: AWS
    • +
    • Type: bool
    • +
    • Default: false
    • + +

      --s3-leave-parts-on-error

      +

      If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery.

      +

      It should be set to true for resuming uploads across different sessions.

      +

      WARNING: Storing parts of an incomplete multipart upload counts towards space usage on S3 and will add additional costs if not cleaned up.

      +

      Properties:

        -
      • LA-Sao Paulo1
      • -
      -
    • "obs.ru-northwest-2.myhuaweicloud.com" +
    • Config: leave_parts_on_error
    • +
    • Env Var: RCLONE_S3_LEAVE_PARTS_ON_ERROR
    • +
    • Provider: AWS
    • +
    • Type: bool
    • +
    • Default: false
    • + +

      --s3-list-chunk

      +

      Size of listing chunk (response list for each ListObject S3 request).

      +

      This option is also known as "MaxKeys", "max-items", or "page-size" from the AWS S3 specification. Most services truncate the response list to 1000 objects even if requested more than that. In AWS S3 this is a global maximum and cannot be changed, see AWS S3. In Ceph, this can be increased with the "rgw list buckets max chunk" option.

      +

      Properties:

        -
      • RU-Moscow2
      • -
      - +
    • Config: list_chunk
    • +
    • Env Var: RCLONE_S3_LIST_CHUNK
    • +
    • Type: int
    • +
    • Default: 1000
    • -

      --s3-endpoint

      -

      Endpoint for Scaleway Object Storage.

      +

      --s3-list-version

      +

      Version of ListObjects to use: 1,2 or 0 for auto.

      +

      When S3 originally launched it only provided the ListObjects call to enumerate objects in a bucket.

      +

      However in May 2016 the ListObjectsV2 call was introduced. This is much higher performance and should be used if at all possible.

      +

      If set to the default, 0, rclone will guess according to the provider set which list objects method to call. If it guesses wrong, then it may be set manually here.

      Properties:

        -
      • Config: endpoint
      • -
      • Env Var: RCLONE_S3_ENDPOINT
      • -
      • Provider: Scaleway
      • -
      • Type: string
      • -
      • Required: false
      • -
      • Examples: +
      • Config: list_version
      • +
      • Env Var: RCLONE_S3_LIST_VERSION
      • +
      • Type: int
      • +
      • Default: 0
      • +
      +

      --s3-list-url-encode

      +

      Whether to url encode listings: true/false/unset

      +

      Some providers support URL encoding listings and where this is available this is more reliable when using control characters in file names. If this is set to unset (the default) then rclone will choose according to the provider setting what to apply, but you can override rclone's choice here.

      +

      Properties:

        -
      • "s3.nl-ams.scw.cloud" +
      • Config: list_url_encode
      • +
      • Env Var: RCLONE_S3_LIST_URL_ENCODE
      • +
      • Type: Tristate
      • +
      • Default: unset
      • +
      +

      --s3-no-check-bucket

      +

      If set, don't attempt to check the bucket exists or create it.

      +

      This can be useful when trying to minimise the number of transactions rclone does if you know the bucket exists already.

      +

      It can also be needed if the user you are using does not have bucket creation permissions. Before v1.52.0 this would have passed silently due to a bug.

      +

      Properties:

        -
      • Amsterdam Endpoint
      • -
      -
    • "s3.fr-par.scw.cloud" +
    • Config: no_check_bucket
    • +
    • Env Var: RCLONE_S3_NO_CHECK_BUCKET
    • +
    • Type: bool
    • +
    • Default: false
    • + +

      --s3-no-head

      +

      If set, don't HEAD uploaded objects to check integrity.

      +

      This can be useful when trying to minimise the number of transactions rclone does.

      +

      Setting it means that if rclone receives a 200 OK message after uploading an object with PUT then it will assume that it got uploaded properly.

      +

      In particular it will assume:

        -
      • Paris Endpoint
      • -
      -
    • "s3.pl-waw.scw.cloud" +
    • the metadata, including modtime, storage class and content type was as uploaded
    • +
    • the size was as uploaded
    • + +

      It reads the following items from the response for a single part PUT:

        -
      • Warsaw Endpoint
      • -
      - +
    • the MD5SUM
    • +
    • The uploaded date
    • -

      --s3-endpoint

      -

      Endpoint for StackPath Object Storage.

      +

      For multipart uploads these items aren't read.

      +

      If an source object of unknown length is uploaded then rclone will do a HEAD request.

      +

      Setting this flag increases the chance for undetected upload failures, in particular an incorrect size, so it isn't recommended for normal operation. In practice the chance of an undetected upload failure is very small even with this flag.

      Properties:

        -
      • Config: endpoint
      • -
      • Env Var: RCLONE_S3_ENDPOINT
      • -
      • Provider: StackPath
      • -
      • Type: string
      • -
      • Required: false
      • -
      • Examples: -
          -
        • "s3.us-east-2.stackpathstorage.com" -
            -
          • US East Endpoint
          • -
        • -
        • "s3.us-west-1.stackpathstorage.com" +
        • Config: no_head
        • +
        • Env Var: RCLONE_S3_NO_HEAD
        • +
        • Type: bool
        • +
        • Default: false
        • +
        +

        --s3-no-head-object

        +

        If set, do not do HEAD before GET when getting objects.

        +

        Properties:

          -
        • US West Endpoint
        • -
      • -
      • "s3.eu-central-1.stackpathstorage.com" +
      • Config: no_head_object
      • +
      • Env Var: RCLONE_S3_NO_HEAD_OBJECT
      • +
      • Type: bool
      • +
      • Default: false
      • +
      +

      --s3-encoding

      +

      The encoding for the backend.

      +

      See the encoding section in the overview for more info.

      +

      Properties:

        -
      • EU Endpoint
      • -
      - +
    • Config: encoding
    • +
    • Env Var: RCLONE_S3_ENCODING
    • +
    • Type: Encoding
    • +
    • Default: Slash,InvalidUtf8,Dot
    • -

      --s3-endpoint

      -

      Endpoint for Google Cloud Storage.

      +

      --s3-memory-pool-flush-time

      +

      How often internal memory buffer pools will be flushed. (no longer used)

      Properties:

        -
      • Config: endpoint
      • -
      • Env Var: RCLONE_S3_ENDPOINT
      • -
      • Provider: GCS
      • -
      • Type: string
      • -
      • Required: false
      • -
      • Examples: +
      • Config: memory_pool_flush_time
      • +
      • Env Var: RCLONE_S3_MEMORY_POOL_FLUSH_TIME
      • +
      • Type: Duration
      • +
      • Default: 1m0s
      • +
      +

      --s3-memory-pool-use-mmap

      +

      Whether to use mmap buffers in internal memory pool. (no longer used)

      +

      Properties:

        -
      • "https://storage.googleapis.com" +
      • Config: memory_pool_use_mmap
      • +
      • Env Var: RCLONE_S3_MEMORY_POOL_USE_MMAP
      • +
      • Type: bool
      • +
      • Default: false
      • +
      +

      --s3-disable-http2

      +

      Disable usage of http2 for S3 backends.

      +

      There is currently an unsolved issue with the s3 (specifically minio) backend and HTTP/2. HTTP/2 is enabled by default for the s3 backend but can be disabled here. When the issue is solved this flag will be removed.

      +

      See: https://github.com/rclone/rclone/issues/4673, https://github.com/rclone/rclone/issues/3631

      +

      Properties:

        -
      • Google Cloud Storage endpoint
      • -
      - +
    • Config: disable_http2
    • +
    • Env Var: RCLONE_S3_DISABLE_HTTP2
    • +
    • Type: bool
    • +
    • Default: false
    • -

      --s3-endpoint

      -

      Endpoint for Storj Gateway.

      +

      --s3-download-url

      +

      Custom endpoint for downloads. This is usually set to a CloudFront CDN URL as AWS S3 offers cheaper egress for data downloaded through the CloudFront network.

      Properties:

        -
      • Config: endpoint
      • -
      • Env Var: RCLONE_S3_ENDPOINT
      • -
      • Provider: Storj
      • +
      • Config: download_url
      • +
      • Env Var: RCLONE_S3_DOWNLOAD_URL
      • Type: string
      • Required: false
      • -
      • Examples: -
          -
        • "gateway.storjshare.io" +
        +

        --s3-directory-markers

        +

        Upload an empty object with a trailing slash when a new directory is created

        +

        Empty folders are unsupported for bucket based remotes, this option creates an empty object ending with "/", to persist the folder.

        +

        Properties:

          -
        • Global Hosted Gateway
        • -
      • -
      +
    • Config: directory_markers
    • +
    • Env Var: RCLONE_S3_DIRECTORY_MARKERS
    • +
    • Type: bool
    • +
    • Default: false
    • -

      --s3-endpoint

      -

      Endpoint for Synology C2 Object Storage API.

      +

      --s3-use-multipart-etag

      +

      Whether to use ETag in multipart uploads for verification

      +

      This should be true, false or left unset to use the default for the provider.

      Properties:

        -
      • Config: endpoint
      • -
      • Env Var: RCLONE_S3_ENDPOINT
      • -
      • Provider: Synology
      • -
      • Type: string
      • -
      • Required: false
      • -
      • Examples: -
          -
        • "eu-001.s3.synologyc2.net" -
            -
          • EU Endpoint 1
          • -
        • -
        • "eu-002.s3.synologyc2.net" -
            -
          • EU Endpoint 2
          • -
        • -
        • "us-001.s3.synologyc2.net" -
            -
          • US Endpoint 1
          • -
        • -
        • "us-002.s3.synologyc2.net" -
            -
          • US Endpoint 2
          • -
        • -
        • "tw-001.s3.synologyc2.net" -
            -
          • TW Endpoint 1
          • -
        • -
      • +
      • Config: use_multipart_etag
      • +
      • Env Var: RCLONE_S3_USE_MULTIPART_ETAG
      • +
      • Type: Tristate
      • +
      • Default: unset
      -

      --s3-endpoint

      -

      Endpoint for Tencent COS API.

      +

      --s3-use-presigned-request

      +

      Whether to use a presigned request or PutObject for single part uploads

      +

      If this is false rclone will use PutObject from the AWS SDK to upload an object.

      +

      Versions of rclone < 1.59 use presigned requests to upload a single part object and setting this flag to true will re-enable that functionality. This shouldn't be necessary except in exceptional circumstances or for testing.

      Properties:

        -
      • Config: endpoint
      • -
      • Env Var: RCLONE_S3_ENDPOINT
      • -
      • Provider: TencentCOS
      • -
      • Type: string
      • -
      • Required: false
      • -
      • Examples: -
          -
        • "cos.ap-beijing.myqcloud.com" -
            -
          • Beijing Region
          • -
        • -
        • "cos.ap-nanjing.myqcloud.com" -
            -
          • Nanjing Region
          • -
        • -
        • "cos.ap-shanghai.myqcloud.com" -
            -
          • Shanghai Region
          • -
        • -
        • "cos.ap-guangzhou.myqcloud.com" -
            -
          • Guangzhou Region
          • -
        • -
        • "cos.ap-nanjing.myqcloud.com" -
            -
          • Nanjing Region
          • -
        • -
        • "cos.ap-chengdu.myqcloud.com" -
            -
          • Chengdu Region
          • -
        • -
        • "cos.ap-chongqing.myqcloud.com" -
            -
          • Chongqing Region
          • -
        • -
        • "cos.ap-hongkong.myqcloud.com" -
            -
          • Hong Kong (China) Region
          • -
        • -
        • "cos.ap-singapore.myqcloud.com" -
            -
          • Singapore Region
          • -
        • -
        • "cos.ap-mumbai.myqcloud.com" -
            -
          • Mumbai Region
          • -
        • -
        • "cos.ap-seoul.myqcloud.com" -
            -
          • Seoul Region
          • -
        • -
        • "cos.ap-bangkok.myqcloud.com" -
            -
          • Bangkok Region
          • -
        • -
        • "cos.ap-tokyo.myqcloud.com" -
            -
          • Tokyo Region
          • -
        • -
        • "cos.na-siliconvalley.myqcloud.com" -
            -
          • Silicon Valley Region
          • -
        • -
        • "cos.na-ashburn.myqcloud.com" -
            -
          • Virginia Region
          • -
        • -
        • "cos.na-toronto.myqcloud.com" -
            -
          • Toronto Region
          • -
        • -
        • "cos.eu-frankfurt.myqcloud.com" -
            -
          • Frankfurt Region
          • -
        • -
        • "cos.eu-moscow.myqcloud.com" -
            -
          • Moscow Region
          • -
        • -
        • "cos.accelerate.myqcloud.com" -
            -
          • Use Tencent COS Accelerate Endpoint
          • -
        • -
      • +
      • Config: use_presigned_request
      • +
      • Env Var: RCLONE_S3_USE_PRESIGNED_REQUEST
      • +
      • Type: bool
      • +
      • Default: false
      -

      --s3-endpoint

      -

      Endpoint for RackCorp Object Storage.

      +

      --s3-versions

      +

      Include old versions in directory listings.

      Properties:

        -
      • Config: endpoint
      • -
      • Env Var: RCLONE_S3_ENDPOINT
      • -
      • Provider: RackCorp
      • -
      • Type: string
      • -
      • Required: false
      • -
      • Examples: -
          -
        • "s3.rackcorp.com" -
            -
          • Global (AnyCast) Endpoint
          • -
        • -
        • "au.s3.rackcorp.com" -
            -
          • Australia (Anycast) Endpoint
          • -
        • -
        • "au-nsw.s3.rackcorp.com" -
            -
          • Sydney (Australia) Endpoint
          • -
        • -
        • "au-qld.s3.rackcorp.com" -
            -
          • Brisbane (Australia) Endpoint
          • -
        • -
        • "au-vic.s3.rackcorp.com" -
            -
          • Melbourne (Australia) Endpoint
          • -
        • -
        • "au-wa.s3.rackcorp.com" -
            -
          • Perth (Australia) Endpoint
          • -
        • -
        • "ph.s3.rackcorp.com" -
            -
          • Manila (Philippines) Endpoint
          • -
        • -
        • "th.s3.rackcorp.com" -
            -
          • Bangkok (Thailand) Endpoint
          • -
        • -
        • "hk.s3.rackcorp.com" -
            -
          • HK (Hong Kong) Endpoint
          • -
        • -
        • "mn.s3.rackcorp.com" -
            -
          • Ulaanbaatar (Mongolia) Endpoint
          • -
        • -
        • "kg.s3.rackcorp.com" -
            -
          • Bishkek (Kyrgyzstan) Endpoint
          • -
        • -
        • "id.s3.rackcorp.com" -
            -
          • Jakarta (Indonesia) Endpoint
          • -
        • -
        • "jp.s3.rackcorp.com" -
            -
          • Tokyo (Japan) Endpoint
          • -
        • -
        • "sg.s3.rackcorp.com" -
            -
          • SG (Singapore) Endpoint
          • -
        • -
        • "de.s3.rackcorp.com" -
            -
          • Frankfurt (Germany) Endpoint
          • -
        • -
        • "us.s3.rackcorp.com" -
            -
          • USA (AnyCast) Endpoint
          • -
        • -
        • "us-east-1.s3.rackcorp.com" -
            -
          • New York (USA) Endpoint
          • -
        • -
        • "us-west-1.s3.rackcorp.com" -
            -
          • Freemont (USA) Endpoint
          • -
        • -
        • "nz.s3.rackcorp.com" -
            -
          • Auckland (New Zealand) Endpoint
          • -
        • -
      • +
      • Config: versions
      • +
      • Env Var: RCLONE_S3_VERSIONS
      • +
      • Type: bool
      • +
      • Default: false
      -

      --s3-endpoint

      -

      Endpoint for Qiniu Object Storage.

      +

      --s3-version-at

      +

      Show file versions as they were at the specified time.

      +

      The parameter should be a date, "2006-01-02", datetime "2006-01-02 15:04:05" or a duration for that long ago, eg "100d" or "1h".

      +

      Note that when using this no file write operations are permitted, so you can't upload files or delete them.

      +

      See the time option docs for valid formats.

      Properties:

        -
      • Config: endpoint
      • -
      • Env Var: RCLONE_S3_ENDPOINT
      • -
      • Provider: Qiniu
      • -
      • Type: string
      • -
      • Required: false
      • -
      • Examples: -
          -
        • "s3-cn-east-1.qiniucs.com" -
            -
          • East China Endpoint 1
          • -
        • -
        • "s3-cn-east-2.qiniucs.com" -
            -
          • East China Endpoint 2
          • -
        • -
        • "s3-cn-north-1.qiniucs.com" -
            -
          • North China Endpoint 1
          • -
        • -
        • "s3-cn-south-1.qiniucs.com" -
            -
          • South China Endpoint 1
          • -
        • -
        • "s3-us-north-1.qiniucs.com" -
            -
          • North America Endpoint 1
          • -
        • -
        • "s3-ap-southeast-1.qiniucs.com" -
            -
          • Southeast Asia Endpoint 1
          • -
        • -
        • "s3-ap-northeast-1.qiniucs.com" -
            -
          • Northeast Asia Endpoint 1
          • -
        • -
      • +
      • Config: version_at
      • +
      • Env Var: RCLONE_S3_VERSION_AT
      • +
      • Type: Time
      • +
      • Default: off
      -

      --s3-endpoint

      -

      Endpoint for S3 API.

      -

      Required when using an S3 clone.

      +

      --s3-decompress

      +

      If set this will decompress gzip encoded objects.

      +

      It is possible to upload objects to S3 with "Content-Encoding: gzip" set. Normally rclone will download these files as compressed objects.

      +

      If this flag is set then rclone will decompress these files with "Content-Encoding: gzip" as they are received. This means that rclone can't check the size and hash but the file contents will be decompressed.

      Properties:

        -
      • Config: endpoint
      • -
      • Env Var: RCLONE_S3_ENDPOINT
      • -
      • Provider: !AWS,ArvanCloud,IBMCOS,IDrive,IONOS,TencentCOS,HuaweiOBS,Alibaba,ChinaMobile,GCS,Liara,Scaleway,StackPath,Storj,Synology,RackCorp,Qiniu,Petabox
      • -
      • Type: string
      • -
      • Required: false
      • -
      • Examples: -
          -
        • "objects-us-east-1.dream.io" -
            -
          • Dream Objects endpoint
          • -
        • -
        • "syd1.digitaloceanspaces.com" -
            -
          • DigitalOcean Spaces Sydney 1
          • -
        • -
        • "sfo3.digitaloceanspaces.com" -
            -
          • DigitalOcean Spaces San Francisco 3
          • -
        • -
        • "fra1.digitaloceanspaces.com" -
            -
          • DigitalOcean Spaces Frankfurt 1
          • -
        • -
        • "nyc3.digitaloceanspaces.com" -
            -
          • DigitalOcean Spaces New York 3
          • -
        • -
        • "ams3.digitaloceanspaces.com" -
            -
          • DigitalOcean Spaces Amsterdam 3
          • -
        • -
        • "sgp1.digitaloceanspaces.com" -
            -
          • DigitalOcean Spaces Singapore 1
          • -
        • -
        • "localhost:8333" -
            -
          • SeaweedFS S3 localhost
          • -
        • -
        • "s3.us-east-1.lyvecloud.seagate.com" -
            -
          • Seagate Lyve Cloud US East 1 (Virginia)
          • -
        • -
        • "s3.us-west-1.lyvecloud.seagate.com" -
            -
          • Seagate Lyve Cloud US West 1 (California)
          • -
        • -
        • "s3.ap-southeast-1.lyvecloud.seagate.com" -
            -
          • Seagate Lyve Cloud AP Southeast 1 (Singapore)
          • -
        • -
        • "s3.wasabisys.com" -
            -
          • Wasabi US East 1 (N. Virginia)
          • -
        • -
        • "s3.us-east-2.wasabisys.com" -
            -
          • Wasabi US East 2 (N. Virginia)
          • -
        • -
        • "s3.us-central-1.wasabisys.com" -
            -
          • Wasabi US Central 1 (Texas)
          • -
        • -
        • "s3.us-west-1.wasabisys.com" -
            -
          • Wasabi US West 1 (Oregon)
          • -
        • -
        • "s3.ca-central-1.wasabisys.com" -
            -
          • Wasabi CA Central 1 (Toronto)
          • -
        • -
        • "s3.eu-central-1.wasabisys.com" -
            -
          • Wasabi EU Central 1 (Amsterdam)
          • -
        • -
        • "s3.eu-central-2.wasabisys.com" -
            -
          • Wasabi EU Central 2 (Frankfurt)
          • -
        • -
        • "s3.eu-west-1.wasabisys.com" -
            -
          • Wasabi EU West 1 (London)
          • -
        • -
        • "s3.eu-west-2.wasabisys.com" -
            -
          • Wasabi EU West 2 (Paris)
          • -
        • -
        • "s3.ap-northeast-1.wasabisys.com" -
            -
          • Wasabi AP Northeast 1 (Tokyo) endpoint
          • -
        • -
        • "s3.ap-northeast-2.wasabisys.com" -
            -
          • Wasabi AP Northeast 2 (Osaka) endpoint
          • -
        • -
        • "s3.ap-southeast-1.wasabisys.com" -
            -
          • Wasabi AP Southeast 1 (Singapore)
          • -
        • -
        • "s3.ap-southeast-2.wasabisys.com" -
            -
          • Wasabi AP Southeast 2 (Sydney)
          • -
        • -
        • "storage.iran.liara.space" -
            -
          • Liara Iran endpoint
          • -
        • -
        • "s3.ir-thr-at1.arvanstorage.ir" -
            -
          • ArvanCloud Tehran Iran (Simin) endpoint
          • -
        • -
        • "s3.ir-tbz-sh1.arvanstorage.ir" -
            -
          • ArvanCloud Tabriz Iran (Shahriar) endpoint
          • -
        • -
      • +
      • Config: decompress
      • +
      • Env Var: RCLONE_S3_DECOMPRESS
      • +
      • Type: bool
      • +
      • Default: false
      -

      --s3-location-constraint

      -

      Location constraint - must be set to match the Region.

      -

      Used when creating buckets only.

      +

      --s3-might-gzip

      +

      Set this if the backend might gzip objects.

      +

      Normally providers will not alter objects when they are downloaded. If an object was not uploaded with Content-Encoding: gzip then it won't be set on download.

      +

      However some providers may gzip objects even if they weren't uploaded with Content-Encoding: gzip (eg Cloudflare).

      +

      A symptom of this would be receiving errors like

      +
      ERROR corrupted on transfer: sizes differ NNN vs MMM
      +

      If you set this flag and rclone downloads an object with Content-Encoding: gzip set and chunked transfer encoding, then rclone will decompress the object on the fly.

      +

      If this is set to unset (the default) then rclone will choose according to the provider setting what to apply, but you can override rclone's choice here.

      Properties:

        -
      • Config: location_constraint
      • -
      • Env Var: RCLONE_S3_LOCATION_CONSTRAINT
      • -
      • Provider: AWS
      • -
      • Type: string
      • -
      • Required: false
      • -
      • Examples: -
          -
        • "" -
            -
          • Empty for US Region, Northern Virginia, or Pacific Northwest
          • -
        • -
        • "us-east-2" -
            -
          • US East (Ohio) Region
          • -
        • -
        • "us-west-1" -
            -
          • US West (Northern California) Region
          • -
        • -
        • "us-west-2" -
            -
          • US West (Oregon) Region
          • -
        • -
        • "ca-central-1" -
            -
          • Canada (Central) Region
          • -
        • -
        • "eu-west-1" -
            -
          • EU (Ireland) Region
          • -
        • -
        • "eu-west-2" -
            -
          • EU (London) Region
          • -
        • -
        • "eu-west-3" -
            -
          • EU (Paris) Region
          • -
        • -
        • "eu-north-1" -
            -
          • EU (Stockholm) Region
          • -
        • -
        • "eu-south-1" -
            -
          • EU (Milan) Region
          • -
        • -
        • "EU" -
            -
          • EU Region
          • -
        • -
        • "ap-southeast-1" -
            -
          • Asia Pacific (Singapore) Region
          • -
        • -
        • "ap-southeast-2" -
            -
          • Asia Pacific (Sydney) Region
          • -
        • -
        • "ap-northeast-1" -
            -
          • Asia Pacific (Tokyo) Region
          • -
        • -
        • "ap-northeast-2" -
            -
          • Asia Pacific (Seoul) Region
          • -
        • -
        • "ap-northeast-3" -
            -
          • Asia Pacific (Osaka-Local) Region
          • -
        • -
        • "ap-south-1" -
            -
          • Asia Pacific (Mumbai) Region
          • -
        • -
        • "ap-east-1" -
            -
          • Asia Pacific (Hong Kong) Region
          • -
        • -
        • "sa-east-1" -
            -
          • South America (Sao Paulo) Region
          • -
        • -
        • "me-south-1" -
            -
          • Middle East (Bahrain) Region
          • -
        • -
        • "af-south-1" -
            -
          • Africa (Cape Town) Region
          • -
        • -
        • "cn-north-1" -
            -
          • China (Beijing) Region
          • -
        • -
        • "cn-northwest-1" -
            -
          • China (Ningxia) Region
          • -
        • -
        • "us-gov-east-1" -
            -
          • AWS GovCloud (US-East) Region
          • -
        • -
        • "us-gov-west-1" -
            -
          • AWS GovCloud (US) Region
          • -
        • -
      • +
      • Config: might_gzip
      • +
      • Env Var: RCLONE_S3_MIGHT_GZIP
      • +
      • Type: Tristate
      • +
      • Default: unset
      -

      --s3-location-constraint

      -

      Location constraint - must match endpoint.

      -

      Used when creating buckets only.

      +

      --s3-use-accept-encoding-gzip

      +

      Whether to send Accept-Encoding: gzip header.

      +

      By default, rclone will append Accept-Encoding: gzip to the request to download compressed objects whenever possible.

      +

      However some providers such as Google Cloud Storage may alter the HTTP headers, breaking the signature of the request.

      +

      A symptom of this would be receiving errors like

      +
      SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided.
      +

      In this case, you might want to try disabling this option.

      Properties:

        -
      • Config: location_constraint
      • -
      • Env Var: RCLONE_S3_LOCATION_CONSTRAINT
      • -
      • Provider: ChinaMobile
      • -
      • Type: string
      • -
      • Required: false
      • -
      • Examples: -
          -
        • "wuxi1" -
            -
          • East China (Suzhou)
          • -
        • -
        • "jinan1" -
            -
          • East China (Jinan)
          • -
        • -
        • "ningbo1" -
            -
          • East China (Hangzhou)
          • -
        • -
        • "shanghai1" -
            -
          • East China (Shanghai-1)
          • -
        • -
        • "zhengzhou1" -
            -
          • Central China (Zhengzhou)
          • -
        • -
        • "hunan1" -
            -
          • Central China (Changsha-1)
          • -
        • -
        • "zhuzhou1" -
            -
          • Central China (Changsha-2)
          • -
        • -
        • "guangzhou1" -
            -
          • South China (Guangzhou-2)
          • -
        • -
        • "dongguan1" -
            -
          • South China (Guangzhou-3)
          • -
        • -
        • "beijing1" -
            -
          • North China (Beijing-1)
          • -
        • -
        • "beijing2" -
            -
          • North China (Beijing-2)
          • -
        • -
        • "beijing4" -
            -
          • North China (Beijing-3)
          • -
        • -
        • "huhehaote1" -
            -
          • North China (Huhehaote)
          • -
        • -
        • "chengdu1" -
            -
          • Southwest China (Chengdu)
          • -
        • -
        • "chongqing1" -
            -
          • Southwest China (Chongqing)
          • -
        • -
        • "guiyang1" -
            -
          • Southwest China (Guiyang)
          • -
        • -
        • "xian1" -
            -
          • Nouthwest China (Xian)
          • -
        • -
        • "yunnan" -
            -
          • Yunnan China (Kunming)
          • -
        • -
        • "yunnan2" -
            -
          • Yunnan China (Kunming-2)
          • -
        • -
        • "tianjin1" -
            -
          • Tianjin China (Tianjin)
          • -
        • -
        • "jilin1" -
            -
          • Jilin China (Changchun)
          • -
        • -
        • "hubei1" -
            -
          • Hubei China (Xiangyan)
          • -
        • -
        • "jiangxi1" -
            -
          • Jiangxi China (Nanchang)
          • -
        • -
        • "gansu1" -
            -
          • Gansu China (Lanzhou)
          • -
        • -
        • "shanxi1" -
            -
          • Shanxi China (Taiyuan)
          • -
        • -
        • "liaoning1" -
            -
          • Liaoning China (Shenyang)
          • -
        • -
        • "hebei1" -
            -
          • Hebei China (Shijiazhuang)
          • -
        • -
        • "fujian1" -
            -
          • Fujian China (Xiamen)
          • -
        • -
        • "guangxi1" -
            -
          • Guangxi China (Nanning)
          • -
        • -
        • "anhui1" -
            -
          • Anhui China (Huainan)
          • -
        • -
      • +
      • Config: use_accept_encoding_gzip
      • +
      • Env Var: RCLONE_S3_USE_ACCEPT_ENCODING_GZIP
      • +
      • Type: Tristate
      • +
      • Default: unset
      -

      --s3-location-constraint

      -

      Location constraint - must match endpoint.

      -

      Used when creating buckets only.

      +

      --s3-no-system-metadata

      +

      Suppress setting and reading of system metadata

      Properties:

        -
      • Config: location_constraint
      • -
      • Env Var: RCLONE_S3_LOCATION_CONSTRAINT
      • -
      • Provider: ArvanCloud
      • -
      • Type: string
      • -
      • Required: false
      • -
      • Examples: -
          -
        • "ir-thr-at1" -
            -
          • Tehran Iran (Simin)
          • -
        • -
        • "ir-tbz-sh1" -
            -
          • Tabriz Iran (Shahriar)
          • -
        • -
      • +
      • Config: no_system_metadata
      • +
      • Env Var: RCLONE_S3_NO_SYSTEM_METADATA
      • +
      • Type: bool
      • +
      • Default: false
      -

      --s3-location-constraint

      -

      Location constraint - must match endpoint when using IBM Cloud Public.

      -

      For on-prem COS, do not make a selection from this list, hit enter.

      +

      --s3-sts-endpoint

      +

      Endpoint for STS.

      +

      Leave blank if using AWS to use the default endpoint for the region.

      Properties:

        -
      • Config: location_constraint
      • -
      • Env Var: RCLONE_S3_LOCATION_CONSTRAINT
      • -
      • Provider: IBMCOS
      • +
      • Config: sts_endpoint
      • +
      • Env Var: RCLONE_S3_STS_ENDPOINT
      • +
      • Provider: AWS
      • Type: string
      • Required: false
      • -
      • Examples: -
          -
        • "us-standard" -
            -
          • US Cross Region Standard
          • -
        • -
        • "us-vault" -
            -
          • US Cross Region Vault
          • -
        • -
        • "us-cold" -
            -
          • US Cross Region Cold
          • -
        • -
        • "us-flex" -
            -
          • US Cross Region Flex
          • -
        • -
        • "us-east-standard" -
            -
          • US East Region Standard
          • -
        • -
        • "us-east-vault" -
            -
          • US East Region Vault
          • -
        • -
        • "us-east-cold" -
            -
          • US East Region Cold
          • -
        • -
        • "us-east-flex" -
            -
          • US East Region Flex
          • -
        • -
        • "us-south-standard" -
            -
          • US South Region Standard
          • -
        • -
        • "us-south-vault" -
            -
          • US South Region Vault
          • -
        • -
        • "us-south-cold" -
            -
          • US South Region Cold
          • -
        • -
        • "us-south-flex" -
            -
          • US South Region Flex
          • -
        • -
        • "eu-standard" -
            -
          • EU Cross Region Standard
          • -
        • -
        • "eu-vault" -
            -
          • EU Cross Region Vault
          • -
        • -
        • "eu-cold" -
            -
          • EU Cross Region Cold
          • -
        • -
        • "eu-flex" -
            -
          • EU Cross Region Flex
          • -
        • -
        • "eu-gb-standard" -
            -
          • Great Britain Standard
          • -
        • -
        • "eu-gb-vault" -
            -
          • Great Britain Vault
          • -
        • -
        • "eu-gb-cold" -
            -
          • Great Britain Cold
          • -
        • -
        • "eu-gb-flex" -
            -
          • Great Britain Flex
          • -
        • -
        • "ap-standard" -
            -
          • APAC Standard
          • -
        • -
        • "ap-vault" -
            -
          • APAC Vault
          • -
        • -
        • "ap-cold" -
            -
          • APAC Cold
          • -
        • -
        • "ap-flex" -
            -
          • APAC Flex
          • -
        • -
        • "mel01-standard" -
            -
          • Melbourne Standard
          • -
        • -
        • "mel01-vault" -
            -
          • Melbourne Vault
          • -
        • -
        • "mel01-cold" +
        +

        --s3-use-already-exists

        +

        Set if rclone should report BucketAlreadyExists errors on bucket creation.

        +

        At some point during the evolution of the s3 protocol, AWS started returning an AlreadyOwnedByYou error when attempting to create a bucket that the user already owned, rather than a BucketAlreadyExists error.

        +

        Unfortunately exactly what has been implemented by s3 clones is a little inconsistent, some return AlreadyOwnedByYou, some return BucketAlreadyExists and some return no error at all.

        +

        This is important to rclone because it ensures the bucket exists by creating it on quite a lot of operations (unless --s3-no-check-bucket is used).

        +

        If rclone knows the provider can return AlreadyOwnedByYou or returns no error then it can report BucketAlreadyExists errors when the user attempts to create a bucket not owned by them. Otherwise rclone ignores the BucketAlreadyExists error which can lead to confusion.

        +

        This should be automatically set correctly for all providers rclone knows about - please make a bug report if not.

        +

        Properties:

          -
        • Melbourne Cold
        • -
      • -
      • "mel01-flex" +
      • Config: use_already_exists
      • +
      • Env Var: RCLONE_S3_USE_ALREADY_EXISTS
      • +
      • Type: Tristate
      • +
      • Default: unset
      • +
      +

      --s3-use-multipart-uploads

      +

      Set if rclone should use multipart uploads.

      +

      You can change this if you want to disable the use of multipart uploads. This shouldn't be necessary in normal operation.

      +

      This should be automatically set correctly for all providers rclone knows about - please make a bug report if not.

      +

      Properties:

        -
      • Melbourne Flex
      • -
      -
    • "tor01-standard" -
        -
      • Toronto Standard
      • -
    • -
    • "tor01-vault" -
        -
      • Toronto Vault
      • -
    • -
    • "tor01-cold" -
        -
      • Toronto Cold
      • -
    • -
    • "tor01-flex" -
        -
      • Toronto Flex
      • -
    • - - -

      --s3-location-constraint

      -

      Location constraint - the location where your bucket will be located and your data stored.

      -

      Properties:

      -
        -
      • Config: location_constraint
      • -
      • Env Var: RCLONE_S3_LOCATION_CONSTRAINT
      • -
      • Provider: RackCorp
      • -
      • Type: string
      • -
      • Required: false
      • -
      • Examples: -
          -
        • "global" -
            -
          • Global CDN Region
          • -
        • -
        • "au" -
            -
          • Australia (All locations)
          • -
        • -
        • "au-nsw" -
            -
          • NSW (Australia) Region
          • -
        • -
        • "au-qld" -
            -
          • QLD (Australia) Region
          • -
        • -
        • "au-vic" -
            -
          • VIC (Australia) Region
          • -
        • -
        • "au-wa" -
            -
          • Perth (Australia) Region
          • -
        • -
        • "ph" -
            -
          • Manila (Philippines) Region
          • -
        • -
        • "th" -
            -
          • Bangkok (Thailand) Region
          • -
        • -
        • "hk" -
            -
          • HK (Hong Kong) Region
          • -
        • -
        • "mn" -
            -
          • Ulaanbaatar (Mongolia) Region
          • -
        • -
        • "kg" -
            -
          • Bishkek (Kyrgyzstan) Region
          • -
        • -
        • "id" -
            -
          • Jakarta (Indonesia) Region
          • -
        • -
        • "jp" -
            -
          • Tokyo (Japan) Region
          • -
        • -
        • "sg" -
            -
          • SG (Singapore) Region
          • -
        • -
        • "de" -
            -
          • Frankfurt (Germany) Region
          • -
        • -
        • "us" -
            -
          • USA (AnyCast) Region
          • -
        • -
        • "us-east-1" -
            -
          • New York (USA) Region
          • -
        • -
        • "us-west-1" -
            -
          • Freemont (USA) Region
          • -
        • -
        • "nz" -
            -
          • Auckland (New Zealand) Region
          • -
        • -
      • -
      -

      --s3-location-constraint

      -

      Location constraint - must be set to match the Region.

      -

      Used when creating buckets only.

      -

      Properties:

      -
        -
      • Config: location_constraint
      • -
      • Env Var: RCLONE_S3_LOCATION_CONSTRAINT
      • -
      • Provider: Qiniu
      • -
      • Type: string
      • -
      • Required: false
      • -
      • Examples: -
          -
        • "cn-east-1" -
            -
          • East China Region 1
          • -
        • -
        • "cn-east-2" -
            -
          • East China Region 2
          • -
        • -
        • "cn-north-1" -
            -
          • North China Region 1
          • -
        • -
        • "cn-south-1" -
            -
          • South China Region 1
          • -
        • -
        • "us-north-1" -
            -
          • North America Region 1
          • -
        • -
        • "ap-southeast-1" -
            -
          • Southeast Asia Region 1
          • -
        • -
        • "ap-northeast-1" -
            -
          • Northeast Asia Region 1
          • -
        • -
      • -
      -

      --s3-location-constraint

      -

      Location constraint - must be set to match the Region.

      -

      Leave blank if not sure. Used when creating buckets only.

      -

      Properties:

      -
        -
      • Config: location_constraint
      • -
      • Env Var: RCLONE_S3_LOCATION_CONSTRAINT
      • -
      • Provider: !AWS,Alibaba,ArvanCloud,HuaweiOBS,ChinaMobile,Cloudflare,IBMCOS,IDrive,IONOS,Leviia,Liara,Qiniu,RackCorp,Scaleway,StackPath,Storj,TencentCOS,Petabox
      • -
      • Type: string
      • -
      • Required: false
      • -
      -

      --s3-acl

      -

      Canned ACL used when creating buckets and storing or copying objects.

      -

      This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.

      -

      For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl

      -

      Note that this ACL is applied when server-side copying objects as S3 doesn't copy the ACL from the source but rather writes a fresh one.

      -

      If the acl is an empty string then no X-Amz-Acl: header is added and the default (private) will be used.

      -

      Properties:

      -
        -
      • Config: acl
      • -
      • Env Var: RCLONE_S3_ACL
      • -
      • Provider: !Storj,Synology,Cloudflare
      • -
      • Type: string
      • -
      • Required: false
      • -
      • Examples: -
          -
        • "default" -
            -
          • Owner gets Full_CONTROL.
          • -
          • No one else has access rights (default).
          • -
        • -
        • "private" -
            -
          • Owner gets FULL_CONTROL.
          • -
          • No one else has access rights (default).
          • -
        • -
        • "public-read" -
            -
          • Owner gets FULL_CONTROL.
          • -
          • The AllUsers group gets READ access.
          • -
        • -
        • "public-read-write" -
            -
          • Owner gets FULL_CONTROL.
          • -
          • The AllUsers group gets READ and WRITE access.
          • -
          • Granting this on a bucket is generally not recommended.
          • -
        • -
        • "authenticated-read" -
            -
          • Owner gets FULL_CONTROL.
          • -
          • The AuthenticatedUsers group gets READ access.
          • -
        • -
        • "bucket-owner-read" -
            -
          • Object owner gets FULL_CONTROL.
          • -
          • Bucket owner gets READ access.
          • -
          • If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
          • -
        • -
        • "bucket-owner-full-control" -
            -
          • Both the object owner and the bucket owner get FULL_CONTROL over the object.
          • -
          • If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
          • -
        • -
        • "private" -
            -
          • Owner gets FULL_CONTROL.
          • -
          • No one else has access rights (default).
          • -
          • This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise COS.
          • -
        • -
        • "public-read" -
            -
          • Owner gets FULL_CONTROL.
          • -
          • The AllUsers group gets READ access.
          • -
          • This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise IBM COS.
          • -
        • -
        • "public-read-write" -
            -
          • Owner gets FULL_CONTROL.
          • -
          • The AllUsers group gets READ and WRITE access.
          • -
          • This acl is available on IBM Cloud (Infra), On-Premise IBM COS.
          • -
        • -
        • "authenticated-read" -
            -
          • Owner gets FULL_CONTROL.
          • -
          • The AuthenticatedUsers group gets READ access.
          • -
          • Not supported on Buckets.
          • -
          • This acl is available on IBM Cloud (Infra) and On-Premise IBM COS.
          • -
        • -
      • -
      -

      --s3-server-side-encryption

      -

      The server-side encryption algorithm used when storing this object in S3.

      -

      Properties:

      -
        -
      • Config: server_side_encryption
      • -
      • Env Var: RCLONE_S3_SERVER_SIDE_ENCRYPTION
      • -
      • Provider: AWS,Ceph,ChinaMobile,Minio
      • -
      • Type: string
      • -
      • Required: false
      • -
      • Examples: -
          -
        • "" -
            -
          • None
          • -
        • -
        • "AES256" -
            -
          • AES256
          • -
        • -
        • "aws:kms" -
            -
          • aws:kms
          • -
        • -
      • -
      -

      --s3-sse-kms-key-id

      -

      If using KMS ID you must provide the ARN of Key.

      -

      Properties:

      -
        -
      • Config: sse_kms_key_id
      • -
      • Env Var: RCLONE_S3_SSE_KMS_KEY_ID
      • -
      • Provider: AWS,Ceph,Minio
      • -
      • Type: string
      • -
      • Required: false
      • -
      • Examples: -
          -
        • "" -
            -
          • None
          • -
        • -
        • "arn:aws:kms:us-east-1:*" -
            -
          • arn:aws:kms:*
          • -
        • -
      • +
      • Config: use_multipart_uploads
      • +
      • Env Var: RCLONE_S3_USE_MULTIPART_UPLOADS
      • +
      • Type: Tristate
      • +
      • Default: unset
      -

      --s3-storage-class

      -

      The storage class to use when storing new objects in S3.

      -

      Properties:

      -
        -
      • Config: storage_class
      • -
      • Env Var: RCLONE_S3_STORAGE_CLASS
      • -
      • Provider: AWS
      • -
      • Type: string
      • -
      • Required: false
      • -
      • Examples: -
          -
        • "" -
            -
          • Default
          • -
        • -
        • "STANDARD" -
            -
          • Standard storage class
          • -
        • -
        • "REDUCED_REDUNDANCY" -
            -
          • Reduced redundancy storage class
          • -
        • -
        • "STANDARD_IA" -
            -
          • Standard Infrequent Access storage class
          • -
        • -
        • "ONEZONE_IA" -
            -
          • One Zone Infrequent Access storage class
          • -
        • -
        • "GLACIER" -
            -
          • Glacier storage class
          • -
        • -
        • "DEEP_ARCHIVE" -
            -
          • Glacier Deep Archive storage class
          • -
        • -
        • "INTELLIGENT_TIERING" -
            -
          • Intelligent-Tiering storage class
          • -
        • -
        • "GLACIER_IR" +

          Metadata

          +

          User metadata is stored as x-amz-meta- keys. S3 metadata keys are case insensitive and are always returned in lower case.

          +

          Here are the possible system metadata items for the s3 backend.

          +
      +++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      NameHelpTypeExampleRead Only
      btimeTime of file birth (creation) read from Last-Modified headerRFC 33392006-01-02T15:04:05.999999999Z07:00Y
      cache-controlCache-Control headerstringno-cacheN
      content-dispositionContent-Disposition headerstringinlineN
      content-encodingContent-Encoding headerstringgzipN
      content-languageContent-Language headerstringen-USN
      content-typeContent-Type headerstringtext/plainN
      mtimeTime of last modification, read from rclone metadataRFC 33392006-01-02T15:04:05.999999999Z07:00N
      tierTier of the objectstringGLACIERY
      +

      See the metadata docs for more info.

      +

      Backend commands

      +

      Here are the commands specific to the s3 backend.

      +

      Run them with

      +
      rclone backend COMMAND remote:
      +

      The help below will explain what arguments each command takes.

      +

      See the backend command for more info on how to pass options and arguments.

      +

      These can be run on a running backend using the rc command backend/command.

      +

      restore

      +

      Restore objects from GLACIER to normal storage

      +
      rclone backend restore remote: [options] [<arguments>+]
      +

      This command can be used to restore one or more objects from GLACIER to normal storage.

      +

      Usage Examples:

      +
      rclone backend restore s3:bucket/path/to/object -o priority=PRIORITY -o lifetime=DAYS
      +rclone backend restore s3:bucket/path/to/directory -o priority=PRIORITY -o lifetime=DAYS
      +rclone backend restore s3:bucket -o priority=PRIORITY -o lifetime=DAYS
      +

      This flag also obeys the filters. Test first with --interactive/-i or --dry-run flags

      +
      rclone --interactive backend restore --include "*.txt" s3:bucket/path -o priority=Standard -o lifetime=1
      +

      All the objects shown will be marked for restore, then

      +
      rclone backend restore --include "*.txt" s3:bucket/path -o priority=Standard -o lifetime=1
      +

      It returns a list of status dictionaries with Remote and Status keys. The Status will be OK if it was successful or an error message if not.

      +
      [
      +    {
      +        "Status": "OK",
      +        "Remote": "test.txt"
      +    },
      +    {
      +        "Status": "OK",
      +        "Remote": "test/file4.txt"
      +    }
      +]
      +

      Options:

        -
      • Glacier Instant Retrieval storage class
      • -
      -
    +
  • "description": The optional description for the job.
  • +
  • "lifetime": Lifetime of the active copy in days
  • +
  • "priority": Priority of restore: Standard|Expedited|Bulk
  • -

    --s3-storage-class

    -

    The storage class to use when storing new objects in OSS.

    -

    Properties:

    -
      -
    • Config: storage_class
    • -
    • Env Var: RCLONE_S3_STORAGE_CLASS
    • -
    • Provider: Alibaba
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • Default
        • -
      • -
      • "STANDARD" -
          -
        • Standard storage class
        • -
      • -
      • "GLACIER" -
          -
        • Archive storage mode
        • -
      • -
      • "STANDARD_IA" +

        restore-status

        +

        Show the restore status for objects being restored from GLACIER to normal storage

        +
        rclone backend restore-status remote: [options] [<arguments>+]
        +

        This command can be used to show the status for objects being restored from GLACIER to normal storage.

        +

        Usage Examples:

        +
        rclone backend restore-status s3:bucket/path/to/object
        +rclone backend restore-status s3:bucket/path/to/directory
        +rclone backend restore-status -o all s3:bucket/path/to/directory
        +

        This command does not obey the filters.

        +

        It returns a list of status dictionaries.

        +
        [
        +    {
        +        "Remote": "file.txt",
        +        "VersionID": null,
        +        "RestoreStatus": {
        +            "IsRestoreInProgress": true,
        +            "RestoreExpiryDate": "2023-09-06T12:29:19+01:00"
        +        },
        +        "StorageClass": "GLACIER"
        +    },
        +    {
        +        "Remote": "test.pdf",
        +        "VersionID": null,
        +        "RestoreStatus": {
        +            "IsRestoreInProgress": false,
        +            "RestoreExpiryDate": "2023-09-06T12:29:19+01:00"
        +        },
        +        "StorageClass": "DEEP_ARCHIVE"
        +    }
        +]
        +

        Options:

          -
        • Infrequent access storage mode
        • -
      • -
    • +
    • "all": if set then show all objects, not just ones with restore status
    -

    --s3-storage-class

    -

    The storage class to use when storing new objects in ChinaMobile.

    -

    Properties:

    -
      -
    • Config: storage_class
    • -
    • Env Var: RCLONE_S3_STORAGE_CLASS
    • -
    • Provider: ChinaMobile
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • Default
        • -
      • -
      • "STANDARD" -
          -
        • Standard storage class
        • -
      • -
      • "GLACIER" -
          -
        • Archive storage mode
        • -
      • -
      • "STANDARD_IA" +

        list-multipart-uploads

        +

        List the unfinished multipart uploads

        +
        rclone backend list-multipart-uploads remote: [options] [<arguments>+]
        +

        This command lists the unfinished multipart uploads in JSON format.

        +
        rclone backend list-multipart s3:bucket/path/to/object
        +

        It returns a dictionary of buckets with values as lists of unfinished multipart uploads.

        +

        You can call it with no bucket in which case it lists all bucket, with a bucket or with a bucket and path.

        +
        {
        +  "rclone": [
        +    {
        +      "Initiated": "2020-06-26T14:20:36Z",
        +      "Initiator": {
        +        "DisplayName": "XXX",
        +        "ID": "arn:aws:iam::XXX:user/XXX"
        +      },
        +      "Key": "KEY",
        +      "Owner": {
        +        "DisplayName": null,
        +        "ID": "XXX"
        +      },
        +      "StorageClass": "STANDARD",
        +      "UploadId": "XXX"
        +    }
        +  ],
        +  "rclone-1000files": [],
        +  "rclone-dst": []
        +}
        +

        cleanup

        +

        Remove unfinished multipart uploads.

        +
        rclone backend cleanup remote: [options] [<arguments>+]
        +

        This command removes unfinished multipart uploads of age greater than max-age which defaults to 24 hours.

        +

        Note that you can use --interactive/-i or --dry-run with this command to see what it would do.

        +
        rclone backend cleanup s3:bucket/path/to/object
        +rclone backend cleanup -o max-age=7w s3:bucket/path/to/object
        +

        Durations are parsed as per the rest of rclone, 2h, 7d, 7w etc.

        +

        Options:

          -
        • Infrequent access storage mode
        • -
      • -
    • +
    • "max-age": Max age of upload to delete
    -

    --s3-storage-class

    -

    The storage class to use when storing new objects in Liara

    -

    Properties:

    -
      -
    • Config: storage_class
    • -
    • Env Var: RCLONE_S3_STORAGE_CLASS
    • -
    • Provider: Liara
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "STANDARD" -
          -
        • Standard storage class
        • -
      • -
    • -
    -

    --s3-storage-class

    -

    The storage class to use when storing new objects in ArvanCloud.

    -

    Properties:

    -
      -
    • Config: storage_class
    • -
    • Env Var: RCLONE_S3_STORAGE_CLASS
    • -
    • Provider: ArvanCloud
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "STANDARD" -
          -
        • Standard storage class
        • -
      • -
    • -
    -

    --s3-storage-class

    -

    The storage class to use when storing new objects in Tencent COS.

    -

    Properties:

    -
      -
    • Config: storage_class
    • -
    • Env Var: RCLONE_S3_STORAGE_CLASS
    • -
    • Provider: TencentCOS
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • Default
        • -
      • -
      • "STANDARD" -
          -
        • Standard storage class
        • -
      • -
      • "ARCHIVE" -
          -
        • Archive storage mode
        • -
      • -
      • "STANDARD_IA" -
          -
        • Infrequent access storage mode
        • -
      • -
    • -
    -

    --s3-storage-class

    -

    The storage class to use when storing new objects in S3.

    -

    Properties:

    -
      -
    • Config: storage_class
    • -
    • Env Var: RCLONE_S3_STORAGE_CLASS
    • -
    • Provider: Scaleway
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • Default.
        • -
      • -
      • "STANDARD" -
          -
        • The Standard class for any upload.
        • -
        • Suitable for on-demand content like streaming or CDN.
        • -
        • Available in all regions.
        • -
      • -
      • "GLACIER" -
          -
        • Archived storage.
        • -
        • Prices are lower, but it needs to be restored first to be accessed.
        • -
        • Available in FR-PAR and NL-AMS regions.
        • -
      • -
      • "ONEZONE_IA" -
          -
        • One Zone - Infrequent Access.
        • -
        • A good choice for storing secondary backup copies or easily re-creatable data.
        • -
        • Available in the FR-PAR region only.
        • -
      • -
    • -
    -

    --s3-storage-class

    -

    The storage class to use when storing new objects in Qiniu.

    -

    Properties:

    -
      -
    • Config: storage_class
    • -
    • Env Var: RCLONE_S3_STORAGE_CLASS
    • -
    • Provider: Qiniu
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "STANDARD" -
          -
        • Standard storage class
        • -
      • -
      • "LINE" -
          -
        • Infrequent access storage mode
        • -
      • -
      • "GLACIER" -
          -
        • Archive storage mode
        • -
      • -
      • "DEEP_ARCHIVE" -
          -
        • Deep archive storage mode
        • -
      • -
    • -
    -

    Advanced options

    -

    Here are the Advanced options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, China Mobile, Cloudflare, GCS, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Leviia, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi).

    -

    --s3-bucket-acl

    -

    Canned ACL used when creating buckets.

    -

    For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl

    -

    Note that this ACL is applied when only when creating buckets. If it isn't set then "acl" is used instead.

    -

    If the "acl" and "bucket_acl" are empty strings then no X-Amz-Acl: header is added and the default (private) will be used.

    -

    Properties:

    -
      -
    • Config: bucket_acl
    • -
    • Env Var: RCLONE_S3_BUCKET_ACL
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "private" -
          -
        • Owner gets FULL_CONTROL.
        • -
        • No one else has access rights (default).
        • -
      • -
      • "public-read" -
          -
        • Owner gets FULL_CONTROL.
        • -
        • The AllUsers group gets READ access.
        • -
      • -
      • "public-read-write" -
          -
        • Owner gets FULL_CONTROL.
        • -
        • The AllUsers group gets READ and WRITE access.
        • -
        • Granting this on a bucket is generally not recommended.
        • -
      • -
      • "authenticated-read" -
          -
        • Owner gets FULL_CONTROL.
        • -
        • The AuthenticatedUsers group gets READ access.
        • -
      • -
    • -
    -

    --s3-requester-pays

    -

    Enables requester pays option when interacting with S3 bucket.

    -

    Properties:

    -
      -
    • Config: requester_pays
    • -
    • Env Var: RCLONE_S3_REQUESTER_PAYS
    • -
    • Provider: AWS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-sse-customer-algorithm

    -

    If using SSE-C, the server-side encryption algorithm used when storing this object in S3.

    -

    Properties:

    -
      -
    • Config: sse_customer_algorithm
    • -
    • Env Var: RCLONE_S3_SSE_CUSTOMER_ALGORITHM
    • -
    • Provider: AWS,Ceph,ChinaMobile,Minio
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • None
        • -
      • -
      • "AES256" -
          -
        • AES256
        • -
      • -
    • -
    -

    --s3-sse-customer-key

    -

    To use SSE-C you may provide the secret encryption key used to encrypt/decrypt your data.

    -

    Alternatively you can provide --sse-customer-key-base64.

    -

    Properties:

    -
      -
    • Config: sse_customer_key
    • -
    • Env Var: RCLONE_S3_SSE_CUSTOMER_KEY
    • -
    • Provider: AWS,Ceph,ChinaMobile,Minio
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • None
        • -
      • -
    • -
    -

    --s3-sse-customer-key-base64

    -

    If using SSE-C you must provide the secret encryption key encoded in base64 format to encrypt/decrypt your data.

    -

    Alternatively you can provide --sse-customer-key.

    -

    Properties:

    -
      -
    • Config: sse_customer_key_base64
    • -
    • Env Var: RCLONE_S3_SSE_CUSTOMER_KEY_BASE64
    • -
    • Provider: AWS,Ceph,ChinaMobile,Minio
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • None
        • -
      • -
    • -
    -

    --s3-sse-customer-key-md5

    -

    If using SSE-C you may provide the secret encryption key MD5 checksum (optional).

    -

    If you leave it blank, this is calculated automatically from the sse_customer_key provided.

    -

    Properties:

    -
      -
    • Config: sse_customer_key_md5
    • -
    • Env Var: RCLONE_S3_SSE_CUSTOMER_KEY_MD5
    • -
    • Provider: AWS,Ceph,ChinaMobile,Minio
    • -
    • Type: string
    • -
    • Required: false
    • -
    • Examples: -
        -
      • "" -
          -
        • None
        • -
      • -
    • -
    -

    --s3-upload-cutoff

    -

    Cutoff for switching to chunked upload.

    -

    Any files larger than this will be uploaded in chunks of chunk_size. The minimum is 0 and the maximum is 5 GiB.

    -

    Properties:

    -
      -
    • Config: upload_cutoff
    • -
    • Env Var: RCLONE_S3_UPLOAD_CUTOFF
    • -
    • Type: SizeSuffix
    • -
    • Default: 200Mi
    • -
    -

    --s3-chunk-size

    -

    Chunk size to use for uploading.

    -

    When uploading files larger than upload_cutoff or files with unknown size (e.g. from "rclone rcat" or uploaded with "rclone mount" or google photos or google docs) they will be uploaded as multipart uploads using this chunk size.

    -

    Note that "--s3-upload-concurrency" chunks of this size are buffered in memory per transfer.

    -

    If you are transferring large files over high-speed links and you have enough memory, then increasing this will speed up the transfers.

    -

    Rclone will automatically increase the chunk size when uploading a large file of known size to stay below the 10,000 chunks limit.

    -

    Files of unknown size are uploaded with the configured chunk_size. Since the default chunk size is 5 MiB and there can be at most 10,000 chunks, this means that by default the maximum size of a file you can stream upload is 48 GiB. If you wish to stream upload larger files then you will need to increase chunk_size.

    -

    Increasing the chunk size decreases the accuracy of the progress statistics displayed with "-P" flag. Rclone treats chunk as sent when it's buffered by the AWS SDK, when in fact it may still be uploading. A bigger chunk size means a bigger AWS SDK buffer and progress reporting more deviating from the truth.

    -

    Properties:

    -
      -
    • Config: chunk_size
    • -
    • Env Var: RCLONE_S3_CHUNK_SIZE
    • -
    • Type: SizeSuffix
    • -
    • Default: 5Mi
    • -
    -

    --s3-max-upload-parts

    -

    Maximum number of parts in a multipart upload.

    -

    This option defines the maximum number of multipart chunks to use when doing a multipart upload.

    -

    This can be useful if a service does not support the AWS S3 specification of 10,000 chunks.

    -

    Rclone will automatically increase the chunk size when uploading a large file of a known size to stay below this number of chunks limit.

    -

    Properties:

    -
      -
    • Config: max_upload_parts
    • -
    • Env Var: RCLONE_S3_MAX_UPLOAD_PARTS
    • -
    • Type: int
    • -
    • Default: 10000
    • -
    -

    --s3-copy-cutoff

    -

    Cutoff for switching to multipart copy.

    -

    Any files larger than this that need to be server-side copied will be copied in chunks of this size.

    -

    The minimum is 0 and the maximum is 5 GiB.

    -

    Properties:

    -
      -
    • Config: copy_cutoff
    • -
    • Env Var: RCLONE_S3_COPY_CUTOFF
    • -
    • Type: SizeSuffix
    • -
    • Default: 4.656Gi
    • -
    -

    --s3-disable-checksum

    -

    Don't store MD5 checksum with object metadata.

    -

    Normally rclone will calculate the MD5 checksum of the input before uploading it so it can add it to metadata on the object. This is great for data integrity checking but can cause long delays for large files to start uploading.

    -

    Properties:

    -
      -
    • Config: disable_checksum
    • -
    • Env Var: RCLONE_S3_DISABLE_CHECKSUM
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-shared-credentials-file

    -

    Path to the shared credentials file.

    -

    If env_auth = true then rclone can use a shared credentials file.

    -

    If this variable is empty rclone will look for the "AWS_SHARED_CREDENTIALS_FILE" env variable. If the env value is empty it will default to the current user's home directory.

    -
    Linux/OSX: "$HOME/.aws/credentials"
    -Windows:   "%USERPROFILE%\.aws\credentials"
    -

    Properties:

    -
      -
    • Config: shared_credentials_file
    • -
    • Env Var: RCLONE_S3_SHARED_CREDENTIALS_FILE
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --s3-profile

    -

    Profile to use in the shared credentials file.

    -

    If env_auth = true then rclone can use a shared credentials file. This variable controls which profile is used in that file.

    -

    If empty it will default to the environment variable "AWS_PROFILE" or "default" if that environment variable is also not set.

    -

    Properties:

    -
      -
    • Config: profile
    • -
    • Env Var: RCLONE_S3_PROFILE
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --s3-session-token

    -

    An AWS session token.

    -

    Properties:

    -
      -
    • Config: session_token
    • -
    • Env Var: RCLONE_S3_SESSION_TOKEN
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --s3-upload-concurrency

    -

    Concurrency for multipart uploads.

    -

    This is the number of chunks of the same file that are uploaded concurrently.

    -

    If you are uploading small numbers of large files over high-speed links and these uploads do not fully utilize your bandwidth, then increasing this may help to speed up the transfers.

    -

    Properties:

    -
      -
    • Config: upload_concurrency
    • -
    • Env Var: RCLONE_S3_UPLOAD_CONCURRENCY
    • -
    • Type: int
    • -
    • Default: 4
    • -
    -

    --s3-force-path-style

    -

    If true use path style access if false use virtual hosted style.

    -

    If this is true (the default) then rclone will use path style access, if false then rclone will use virtual path style. See the AWS S3 docs for more info.

    -

    Some providers (e.g. AWS, Aliyun OSS, Netease COS, or Tencent COS) require this set to false - rclone will do this automatically based on the provider setting.

    -

    Properties:

    -
      -
    • Config: force_path_style
    • -
    • Env Var: RCLONE_S3_FORCE_PATH_STYLE
    • -
    • Type: bool
    • -
    • Default: true
    • -
    -

    --s3-v2-auth

    -

    If true use v2 authentication.

    -

    If this is false (the default) then rclone will use v4 authentication. If it is set then rclone will use v2 authentication.

    -

    Use this only if v4 signatures don't work, e.g. pre Jewel/v10 CEPH.

    -

    Properties:

    -
      -
    • Config: v2_auth
    • -
    • Env Var: RCLONE_S3_V2_AUTH
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-use-accelerate-endpoint

    -

    If true use the AWS S3 accelerated endpoint.

    -

    See: AWS S3 Transfer acceleration

    -

    Properties:

    -
      -
    • Config: use_accelerate_endpoint
    • -
    • Env Var: RCLONE_S3_USE_ACCELERATE_ENDPOINT
    • -
    • Provider: AWS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-leave-parts-on-error

    -

    If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery.

    -

    It should be set to true for resuming uploads across different sessions.

    -

    WARNING: Storing parts of an incomplete multipart upload counts towards space usage on S3 and will add additional costs if not cleaned up.

    -

    Properties:

    -
      -
    • Config: leave_parts_on_error
    • -
    • Env Var: RCLONE_S3_LEAVE_PARTS_ON_ERROR
    • -
    • Provider: AWS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-list-chunk

    -

    Size of listing chunk (response list for each ListObject S3 request).

    -

    This option is also known as "MaxKeys", "max-items", or "page-size" from the AWS S3 specification. Most services truncate the response list to 1000 objects even if requested more than that. In AWS S3 this is a global maximum and cannot be changed, see AWS S3. In Ceph, this can be increased with the "rgw list buckets max chunk" option.

    -

    Properties:

    -
      -
    • Config: list_chunk
    • -
    • Env Var: RCLONE_S3_LIST_CHUNK
    • -
    • Type: int
    • -
    • Default: 1000
    • -
    -

    --s3-list-version

    -

    Version of ListObjects to use: 1,2 or 0 for auto.

    -

    When S3 originally launched it only provided the ListObjects call to enumerate objects in a bucket.

    -

    However in May 2016 the ListObjectsV2 call was introduced. This is much higher performance and should be used if at all possible.

    -

    If set to the default, 0, rclone will guess according to the provider set which list objects method to call. If it guesses wrong, then it may be set manually here.

    -

    Properties:

    -
      -
    • Config: list_version
    • -
    • Env Var: RCLONE_S3_LIST_VERSION
    • -
    • Type: int
    • -
    • Default: 0
    • -
    -

    --s3-list-url-encode

    -

    Whether to url encode listings: true/false/unset

    -

    Some providers support URL encoding listings and where this is available this is more reliable when using control characters in file names. If this is set to unset (the default) then rclone will choose according to the provider setting what to apply, but you can override rclone's choice here.

    -

    Properties:

    -
      -
    • Config: list_url_encode
    • -
    • Env Var: RCLONE_S3_LIST_URL_ENCODE
    • -
    • Type: Tristate
    • -
    • Default: unset
    • -
    -

    --s3-no-check-bucket

    -

    If set, don't attempt to check the bucket exists or create it.

    -

    This can be useful when trying to minimise the number of transactions rclone does if you know the bucket exists already.

    -

    It can also be needed if the user you are using does not have bucket creation permissions. Before v1.52.0 this would have passed silently due to a bug.

    -

    Properties:

    -
      -
    • Config: no_check_bucket
    • -
    • Env Var: RCLONE_S3_NO_CHECK_BUCKET
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-no-head

    -

    If set, don't HEAD uploaded objects to check integrity.

    -

    This can be useful when trying to minimise the number of transactions rclone does.

    -

    Setting it means that if rclone receives a 200 OK message after uploading an object with PUT then it will assume that it got uploaded properly.

    -

    In particular it will assume:

    -
      -
    • the metadata, including modtime, storage class and content type was as uploaded
    • -
    • the size was as uploaded
    • -
    -

    It reads the following items from the response for a single part PUT:

    -
      -
    • the MD5SUM
    • -
    • The uploaded date
    • -
    -

    For multipart uploads these items aren't read.

    -

    If an source object of unknown length is uploaded then rclone will do a HEAD request.

    -

    Setting this flag increases the chance for undetected upload failures, in particular an incorrect size, so it isn't recommended for normal operation. In practice the chance of an undetected upload failure is very small even with this flag.

    -

    Properties:

    -
      -
    • Config: no_head
    • -
    • Env Var: RCLONE_S3_NO_HEAD
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-no-head-object

    -

    If set, do not do HEAD before GET when getting objects.

    -

    Properties:

    -
      -
    • Config: no_head_object
    • -
    • Env Var: RCLONE_S3_NO_HEAD_OBJECT
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-encoding

    -

    The encoding for the backend.

    -

    See the encoding section in the overview for more info.

    -

    Properties:

    -
      -
    • Config: encoding
    • -
    • Env Var: RCLONE_S3_ENCODING
    • -
    • Type: MultiEncoder
    • -
    • Default: Slash,InvalidUtf8,Dot
    • -
    -

    --s3-memory-pool-flush-time

    -

    How often internal memory buffer pools will be flushed. (no longer used)

    -

    Properties:

    -
      -
    • Config: memory_pool_flush_time
    • -
    • Env Var: RCLONE_S3_MEMORY_POOL_FLUSH_TIME
    • -
    • Type: Duration
    • -
    • Default: 1m0s
    • -
    -

    --s3-memory-pool-use-mmap

    -

    Whether to use mmap buffers in internal memory pool. (no longer used)

    -

    Properties:

    -
      -
    • Config: memory_pool_use_mmap
    • -
    • Env Var: RCLONE_S3_MEMORY_POOL_USE_MMAP
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-disable-http2

    -

    Disable usage of http2 for S3 backends.

    -

    There is currently an unsolved issue with the s3 (specifically minio) backend and HTTP/2. HTTP/2 is enabled by default for the s3 backend but can be disabled here. When the issue is solved this flag will be removed.

    -

    See: https://github.com/rclone/rclone/issues/4673, https://github.com/rclone/rclone/issues/3631

    -

    Properties:

    -
      -
    • Config: disable_http2
    • -
    • Env Var: RCLONE_S3_DISABLE_HTTP2
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-download-url

    -

    Custom endpoint for downloads. This is usually set to a CloudFront CDN URL as AWS S3 offers cheaper egress for data downloaded through the CloudFront network.

    -

    Properties:

    -
      -
    • Config: download_url
    • -
    • Env Var: RCLONE_S3_DOWNLOAD_URL
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    --s3-directory-markers

    -

    Upload an empty object with a trailing slash when a new directory is created

    -

    Empty folders are unsupported for bucket based remotes, this option creates an empty object ending with "/", to persist the folder.

    -

    Properties:

    -
      -
    • Config: directory_markers
    • -
    • Env Var: RCLONE_S3_DIRECTORY_MARKERS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-use-multipart-etag

    -

    Whether to use ETag in multipart uploads for verification

    -

    This should be true, false or left unset to use the default for the provider.

    -

    Properties:

    -
      -
    • Config: use_multipart_etag
    • -
    • Env Var: RCLONE_S3_USE_MULTIPART_ETAG
    • -
    • Type: Tristate
    • -
    • Default: unset
    • -
    -

    --s3-use-presigned-request

    -

    Whether to use a presigned request or PutObject for single part uploads

    -

    If this is false rclone will use PutObject from the AWS SDK to upload an object.

    -

    Versions of rclone < 1.59 use presigned requests to upload a single part object and setting this flag to true will re-enable that functionality. This shouldn't be necessary except in exceptional circumstances or for testing.

    -

    Properties:

    -
      -
    • Config: use_presigned_request
    • -
    • Env Var: RCLONE_S3_USE_PRESIGNED_REQUEST
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-versions

    -

    Include old versions in directory listings.

    -

    Properties:

    -
      -
    • Config: versions
    • -
    • Env Var: RCLONE_S3_VERSIONS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-version-at

    -

    Show file versions as they were at the specified time.

    -

    The parameter should be a date, "2006-01-02", datetime "2006-01-02 15:04:05" or a duration for that long ago, eg "100d" or "1h".

    -

    Note that when using this no file write operations are permitted, so you can't upload files or delete them.

    -

    See the time option docs for valid formats.

    -

    Properties:

    -
      -
    • Config: version_at
    • -
    • Env Var: RCLONE_S3_VERSION_AT
    • -
    • Type: Time
    • -
    • Default: off
    • -
    -

    --s3-decompress

    -

    If set this will decompress gzip encoded objects.

    -

    It is possible to upload objects to S3 with "Content-Encoding: gzip" set. Normally rclone will download these files as compressed objects.

    -

    If this flag is set then rclone will decompress these files with "Content-Encoding: gzip" as they are received. This means that rclone can't check the size and hash but the file contents will be decompressed.

    -

    Properties:

    -
      -
    • Config: decompress
    • -
    • Env Var: RCLONE_S3_DECOMPRESS
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-might-gzip

    -

    Set this if the backend might gzip objects.

    -

    Normally providers will not alter objects when they are downloaded. If an object was not uploaded with Content-Encoding: gzip then it won't be set on download.

    -

    However some providers may gzip objects even if they weren't uploaded with Content-Encoding: gzip (eg Cloudflare).

    -

    A symptom of this would be receiving errors like

    -
    ERROR corrupted on transfer: sizes differ NNN vs MMM
    -

    If you set this flag and rclone downloads an object with Content-Encoding: gzip set and chunked transfer encoding, then rclone will decompress the object on the fly.

    -

    If this is set to unset (the default) then rclone will choose according to the provider setting what to apply, but you can override rclone's choice here.

    -

    Properties:

    -
      -
    • Config: might_gzip
    • -
    • Env Var: RCLONE_S3_MIGHT_GZIP
    • -
    • Type: Tristate
    • -
    • Default: unset
    • -
    -

    --s3-use-accept-encoding-gzip

    -

    Whether to send Accept-Encoding: gzip header.

    -

    By default, rclone will append Accept-Encoding: gzip to the request to download compressed objects whenever possible.

    -

    However some providers such as Google Cloud Storage may alter the HTTP headers, breaking the signature of the request.

    -

    A symptom of this would be receiving errors like

    -
    SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided.
    -

    In this case, you might want to try disabling this option.

    -

    Properties:

    -
      -
    • Config: use_accept_encoding_gzip
    • -
    • Env Var: RCLONE_S3_USE_ACCEPT_ENCODING_GZIP
    • -
    • Type: Tristate
    • -
    • Default: unset
    • -
    -

    --s3-no-system-metadata

    -

    Suppress setting and reading of system metadata

    -

    Properties:

    -
      -
    • Config: no_system_metadata
    • -
    • Env Var: RCLONE_S3_NO_SYSTEM_METADATA
    • -
    • Type: bool
    • -
    • Default: false
    • -
    -

    --s3-sts-endpoint

    -

    Endpoint for STS.

    -

    Leave blank if using AWS to use the default endpoint for the region.

    -

    Properties:

    -
      -
    • Config: sts_endpoint
    • -
    • Env Var: RCLONE_S3_STS_ENDPOINT
    • -
    • Provider: AWS
    • -
    • Type: string
    • -
    • Required: false
    • -
    -

    Metadata

    -

    User metadata is stored as x-amz-meta- keys. S3 metadata keys are case insensitive and are always returned in lower case.

    -

    Here are the possible system metadata items for the s3 backend.

    - ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameHelpTypeExampleRead Only
    btimeTime of file birth (creation) read from Last-Modified headerRFC 33392006-01-02T15:04:05.999999999Z07:00Y
    cache-controlCache-Control headerstringno-cacheN
    content-dispositionContent-Disposition headerstringinlineN
    content-encodingContent-Encoding headerstringgzipN
    content-languageContent-Language headerstringen-USN
    content-typeContent-Type headerstringtext/plainN
    mtimeTime of last modification, read from rclone metadataRFC 33392006-01-02T15:04:05.999999999Z07:00N
    tierTier of the objectstringGLACIERY
    -

    See the metadata docs for more info.

    -

    Backend commands

    -

    Here are the commands specific to the s3 backend.

    -

    Run them with

    -
    rclone backend COMMAND remote:
    -

    The help below will explain what arguments each command takes.

    -

    See the backend command for more info on how to pass options and arguments.

    -

    These can be run on a running backend using the rc command backend/command.

    -

    restore

    -

    Restore objects from GLACIER to normal storage

    -
    rclone backend restore remote: [options] [<arguments>+]
    -

    This command can be used to restore one or more objects from GLACIER to normal storage.

    -

    Usage Examples:

    -
    rclone backend restore s3:bucket/path/to/object -o priority=PRIORITY -o lifetime=DAYS
    -rclone backend restore s3:bucket/path/to/directory -o priority=PRIORITY -o lifetime=DAYS
    -rclone backend restore s3:bucket -o priority=PRIORITY -o lifetime=DAYS
    -

    This flag also obeys the filters. Test first with --interactive/-i or --dry-run flags

    -
    rclone --interactive backend restore --include "*.txt" s3:bucket/path -o priority=Standard -o lifetime=1
    -

    All the objects shown will be marked for restore, then

    -
    rclone backend restore --include "*.txt" s3:bucket/path -o priority=Standard -o lifetime=1
    -

    It returns a list of status dictionaries with Remote and Status keys. The Status will be OK if it was successful or an error message if not.

    -
    [
    -    {
    -        "Status": "OK",
    -        "Remote": "test.txt"
    -    },
    -    {
    -        "Status": "OK",
    -        "Remote": "test/file4.txt"
    -    }
    -]
    -

    Options:

    -
      -
    • "description": The optional description for the job.
    • -
    • "lifetime": Lifetime of the active copy in days
    • -
    • "priority": Priority of restore: Standard|Expedited|Bulk
    • -
    -

    restore-status

    -

    Show the restore status for objects being restored from GLACIER to normal storage

    -
    rclone backend restore-status remote: [options] [<arguments>+]
    -

    This command can be used to show the status for objects being restored from GLACIER to normal storage.

    +

    cleanup-hidden

    +

    Remove old versions of files.

    +
    rclone backend cleanup-hidden remote: [options] [<arguments>+]
    +

    This command removes any old hidden versions of files on a versions enabled bucket.

    +

    Note that you can use --interactive/-i or --dry-run with this command to see what it would do.

    +
    rclone backend cleanup-hidden s3:bucket/path/to/dir
    +

    versioning

    +

    Set/get versioning support for a bucket.

    +
    rclone backend versioning remote: [options] [<arguments>+]
    +

    This command sets versioning support if a parameter is passed and then returns the current versioning status for the bucket supplied.

    +
    rclone backend versioning s3:bucket # read status only
    +rclone backend versioning s3:bucket Enabled
    +rclone backend versioning s3:bucket Suspended
    +

    It may return "Enabled", "Suspended" or "Unversioned". Note that once versioning has been enabled the status can't be set back to "Unversioned".

    +

    set

    +

    Set command for updating the config parameters.

    +
    rclone backend set remote: [options] [<arguments>+]
    +

    This set command can be used to update the config parameters for a running s3 backend.

    Usage Examples:

    -
    rclone backend restore-status s3:bucket/path/to/object
    -rclone backend restore-status s3:bucket/path/to/directory
    -rclone backend restore-status -o all s3:bucket/path/to/directory
    -

    This command does not obey the filters.

    -

    It returns a list of status dictionaries.

    -
    [
    -    {
    -        "Remote": "file.txt",
    -        "VersionID": null,
    -        "RestoreStatus": {
    -            "IsRestoreInProgress": true,
    -            "RestoreExpiryDate": "2023-09-06T12:29:19+01:00"
    -        },
    -        "StorageClass": "GLACIER"
    -    },
    -    {
    -        "Remote": "test.pdf",
    -        "VersionID": null,
    -        "RestoreStatus": {
    -            "IsRestoreInProgress": false,
    -            "RestoreExpiryDate": "2023-09-06T12:29:19+01:00"
    -        },
    -        "StorageClass": "DEEP_ARCHIVE"
    -    }
    -]
    -

    Options:

    -
      -
    • "all": if set then show all objects, not just ones with restore status
    • -
    -

    list-multipart-uploads

    -

    List the unfinished multipart uploads

    -
    rclone backend list-multipart-uploads remote: [options] [<arguments>+]
    -

    This command lists the unfinished multipart uploads in JSON format.

    -
    rclone backend list-multipart s3:bucket/path/to/object
    -

    It returns a dictionary of buckets with values as lists of unfinished multipart uploads.

    -

    You can call it with no bucket in which case it lists all bucket, with a bucket or with a bucket and path.

    +
    rclone backend set s3: [-o opt_name=opt_value] [-o opt_name2=opt_value2]
    +rclone rc backend/command command=set fs=s3: [-o opt_name=opt_value] [-o opt_name2=opt_value2]
    +rclone rc backend/command command=set fs=s3: -o session_token=X -o access_key_id=X -o secret_access_key=X
    +

    The option keys are named as they are in the config file.

    +

    This rebuilds the connection to the s3 backend when it is called with the new parameters. Only new parameters need be passed as the values will default to those currently in use.

    +

    It doesn't return anything.

    +

    Anonymous access to public buckets

    +

    If you want to use rclone to access a public bucket, configure with a blank access_key_id and secret_access_key. Your config should end up looking like this:

    +
    [anons3]
    +type = s3
    +provider = AWS
    +env_auth = false
    +access_key_id =
    +secret_access_key =
    +region = us-east-1
    +endpoint =
    +location_constraint =
    +acl = private
    +server_side_encryption =
    +storage_class =
    +

    Then use it as normal with the name of the public bucket, e.g.

    +
    rclone lsd anons3:1000genomes
    +

    You will be able to list and copy data but not upload it.

    +

    Providers

    +

    AWS S3

    +

    This is the provider used as main example and described in the configuration section above.

    +

    AWS Snowball Edge

    +

    AWS Snowball is a hardware appliance used for transferring bulk data back to AWS. Its main software interface is S3 object storage.

    +

    To use rclone with AWS Snowball Edge devices, configure as standard for an 'S3 Compatible Service'.

    +

    If using rclone pre v1.59 be sure to set upload_cutoff = 0 otherwise you will run into authentication header issues as the snowball device does not support query parameter based authentication.

    +

    With rclone v1.59 or later setting upload_cutoff should not be necessary.

    +

    eg.

    +
    [snowball]
    +type = s3
    +provider = Other
    +access_key_id = YOUR_ACCESS_KEY
    +secret_access_key = YOUR_SECRET_KEY
    +endpoint = http://[IP of Snowball]:8080
    +upload_cutoff = 0
    +

    Ceph

    +

    Ceph is an open-source, unified, distributed storage system designed for excellent performance, reliability and scalability. It has an S3 compatible object storage interface.

    +

    To use rclone with Ceph, configure as above but leave the region blank and set the endpoint. You should end up with something like this in your config:

    +
    [ceph]
    +type = s3
    +provider = Ceph
    +env_auth = false
    +access_key_id = XXX
    +secret_access_key = YYY
    +region =
    +endpoint = https://ceph.endpoint.example.com
    +location_constraint =
    +acl =
    +server_side_encryption =
    +storage_class =
    +

    If you are using an older version of CEPH (e.g. 10.2.x Jewel) and a version of rclone before v1.59 then you may need to supply the parameter --s3-upload-cutoff 0 or put this in the config file as upload_cutoff 0 to work around a bug which causes uploading of small files to fail.

    +

    Note also that Ceph sometimes puts / in the passwords it gives users. If you read the secret access key using the command line tools you will get a JSON blob with the / escaped as \/. Make sure you only write / in the secret access key.

    +

    Eg the dump from Ceph looks something like this (irrelevant keys removed).

    {
    -  "rclone": [
    +    "user_id": "xxx",
    +    "display_name": "xxxx",
    +    "keys": [
    +        {
    +            "user": "xxx",
    +            "access_key": "xxxxxx",
    +            "secret_key": "xxxxxx\/xxxx"
    +        }
    +    ],
    +}
    +

    Because this is a json dump, it is encoding the / as \/, so if you use the secret key as xxxxxx/xxxx it will work fine.

    +

    Cloudflare R2

    +

    Cloudflare R2 Storage allows developers to store large amounts of unstructured data without the costly egress bandwidth fees associated with typical cloud storage services.

    +

    Here is an example of making a Cloudflare R2 configuration. First run:

    +
    rclone config
    +

    This will guide you through an interactive setup process.

    +

    Note that all buckets are private, and all are stored in the same "auto" region. It is necessary to use Cloudflare workers to share the content of a bucket publicly.

    +
    No remotes found, make a new one?
    +n) New remote
    +s) Set configuration password
    +q) Quit config
    +n/s/q> n
    +name> r2
    +Option Storage.
    +Type of storage to configure.
    +Choose a number from below, or type in your own value.
    +...
    +XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi
    +   \ (s3)
    +...
    +Storage> s3
    +Option provider.
    +Choose your S3 provider.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +...
    +XX / Cloudflare R2 Storage
    +   \ (Cloudflare)
    +...
    +provider> Cloudflare
    +Option env_auth.
    +Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false).
    +Press Enter for the default (false).
    + 1 / Enter AWS credentials in the next step.
    +   \ (false)
    + 2 / Get AWS credentials from the environment (env vars or IAM).
    +   \ (true)
    +env_auth> 1
    +Option access_key_id.
    +AWS Access Key ID.
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +access_key_id> ACCESS_KEY
    +Option secret_access_key.
    +AWS Secret Access Key (password).
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +secret_access_key> SECRET_ACCESS_KEY
    +Option region.
    +Region to connect to.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + 1 / R2 buckets are automatically distributed across Cloudflare's data centers for low latency.
    +   \ (auto)
    +region> 1
    +Option endpoint.
    +Endpoint for S3 API.
    +Required when using an S3 clone.
    +Enter a value. Press Enter to leave empty.
    +endpoint> https://ACCOUNT_ID.r2.cloudflarestorage.com
    +Edit advanced config?
    +y) Yes
    +n) No (default)
    +y/n> n
    +--------------------
    +y) Yes this is OK (default)
    +e) Edit this remote
    +d) Delete this remote
    +y/e/d> y
    +

    This will leave your config looking something like:

    +
    [r2]
    +type = s3
    +provider = Cloudflare
    +access_key_id = ACCESS_KEY
    +secret_access_key = SECRET_ACCESS_KEY
    +region = auto
    +endpoint = https://ACCOUNT_ID.r2.cloudflarestorage.com
    +acl = private
    +

    Now run rclone lsf r2: to see your buckets and rclone lsf r2:bucket to look within a bucket.

    +

    Dreamhost

    +

    Dreamhost DreamObjects is an object storage system based on CEPH.

    +

    To use rclone with Dreamhost, configure as above but leave the region blank and set the endpoint. You should end up with something like this in your config:

    +
    [dreamobjects]
    +type = s3
    +provider = DreamHost
    +env_auth = false
    +access_key_id = your_access_key
    +secret_access_key = your_secret_key
    +region =
    +endpoint = objects-us-west-1.dream.io
    +location_constraint =
    +acl = private
    +server_side_encryption =
    +storage_class =
    +

    Google Cloud Storage

    +

    GoogleCloudStorage is an S3-interoperable object storage service from Google Cloud Platform.

    +

    To connect to Google Cloud Storage you will need an access key and secret key. These can be retrieved by creating an HMAC key.

    +
    [gs]
    +type = s3
    +provider = GCS
    +access_key_id = your_access_key
    +secret_access_key = your_secret_key
    +endpoint = https://storage.googleapis.com
    +

    Note that --s3-versions does not work with GCS when it needs to do directory paging. Rclone will return the error:

    +
    s3 protocol error: received versions listing with IsTruncated set with no NextKeyMarker
    +

    This is Google bug #312292516.

    +

    DigitalOcean Spaces

    +

    Spaces is an S3-interoperable object storage service from cloud provider DigitalOcean.

    +

    To connect to DigitalOcean Spaces you will need an access key and secret key. These can be retrieved on the "Applications & API" page of the DigitalOcean control panel. They will be needed when prompted by rclone config for your access_key_id and secret_access_key.

    +

    When prompted for a region or location_constraint, press enter to use the default value. The region must be included in the endpoint setting (e.g. nyc3.digitaloceanspaces.com). The default values can be used for other settings.

    +

    Going through the whole process of creating a new remote by running rclone config, each prompt should be answered as shown below:

    +
    Storage> s3
    +env_auth> 1
    +access_key_id> YOUR_ACCESS_KEY
    +secret_access_key> YOUR_SECRET_KEY
    +region>
    +endpoint> nyc3.digitaloceanspaces.com
    +location_constraint>
    +acl>
    +storage_class>
    +

    The resulting configuration file should look like:

    +
    [spaces]
    +type = s3
    +provider = DigitalOcean
    +env_auth = false
    +access_key_id = YOUR_ACCESS_KEY
    +secret_access_key = YOUR_SECRET_KEY
    +region =
    +endpoint = nyc3.digitaloceanspaces.com
    +location_constraint =
    +acl =
    +server_side_encryption =
    +storage_class =
    +

    Once configured, you can create a new Space and begin copying files. For example:

    +
    rclone mkdir spaces:my-new-space
    +rclone copy /path/to/files spaces:my-new-space
    +

    Huawei OBS

    +

    Object Storage Service (OBS) provides stable, secure, efficient, and easy-to-use cloud storage that lets you store virtually any volume of unstructured data in any format and access it from anywhere.

    +

    OBS provides an S3 interface, you can copy and modify the following configuration and add it to your rclone configuration file.

    +
    [obs]
    +type = s3
    +provider = HuaweiOBS
    +access_key_id = your-access-key-id
    +secret_access_key = your-secret-access-key
    +region = af-south-1
    +endpoint = obs.af-south-1.myhuaweicloud.com
    +acl = private
    +

    Or you can also configure via the interactive command line:

    +
    No remotes found, make a new one?
    +n) New remote
    +s) Set configuration password
    +q) Quit config
    +n/s/q> n
    +name> obs
    +Option Storage.
    +Type of storage to configure.
    +Choose a number from below, or type in your own value.
    +[snip]
    + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi
    +   \ (s3)
    +[snip]
    +Storage> 5
    +Option provider.
    +Choose your S3 provider.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +[snip]
    + 9 / Huawei Object Storage Service
    +   \ (HuaweiOBS)
    +[snip]
    +provider> 9
    +Option env_auth.
    +Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false).
    +Press Enter for the default (false).
    + 1 / Enter AWS credentials in the next step.
    +   \ (false)
    + 2 / Get AWS credentials from the environment (env vars or IAM).
    +   \ (true)
    +env_auth> 1
    +Option access_key_id.
    +AWS Access Key ID.
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +access_key_id> your-access-key-id
    +Option secret_access_key.
    +AWS Secret Access Key (password).
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +secret_access_key> your-secret-access-key
    +Option region.
    +Region to connect to.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + 1 / AF-Johannesburg
    +   \ (af-south-1)
    + 2 / AP-Bangkok
    +   \ (ap-southeast-2)
    +[snip]
    +region> 1
    +Option endpoint.
    +Endpoint for OBS API.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + 1 / AF-Johannesburg
    +   \ (obs.af-south-1.myhuaweicloud.com)
    + 2 / AP-Bangkok
    +   \ (obs.ap-southeast-2.myhuaweicloud.com)
    +[snip]
    +endpoint> 1
    +Option acl.
    +Canned ACL used when creating buckets and storing or copying objects.
    +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
    +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    +Note that this ACL is applied when server-side copying objects as S3
    +doesn't copy the ACL from the source but rather writes a fresh one.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +   / Owner gets FULL_CONTROL.
    + 1 | No one else has access rights (default).
    +   \ (private)
    +[snip]
    +acl> 1
    +Edit advanced config?
    +y) Yes
    +n) No (default)
    +y/n>
    +--------------------
    +[obs]
    +type = s3
    +provider = HuaweiOBS
    +access_key_id = your-access-key-id
    +secret_access_key = your-secret-access-key
    +region = af-south-1
    +endpoint = obs.af-south-1.myhuaweicloud.com
    +acl = private
    +--------------------
    +y) Yes this is OK (default)
    +e) Edit this remote
    +d) Delete this remote
    +y/e/d> y
    +Current remotes:
    +
    +Name                 Type
    +====                 ====
    +obs                  s3
    +
    +e) Edit existing remote
    +n) New remote
    +d) Delete remote
    +r) Rename remote
    +c) Copy remote
    +s) Set configuration password
    +q) Quit config
    +e/n/d/r/c/s/q> q
    +

    IBM COS (S3)

    +

    Information stored with IBM Cloud Object Storage is encrypted and dispersed across multiple geographic locations, and accessed through an implementation of the S3 API. This service makes use of the distributed storage technologies provided by IBM’s Cloud Object Storage System (formerly Cleversafe). For more information visit: (http://www.ibm.com/cloud/object-storage)

    +

    To configure access to IBM COS S3, follow the steps below:

    +
      +
    1. Run rclone config and select n for a new remote.
    2. +
    +
        2018/02/14 14:13:11 NOTICE: Config file "C:\\Users\\a\\.config\\rclone\\rclone.conf" not found - using defaults
    +    No remotes found, make a new one?
    +    n) New remote
    +    s) Set configuration password
    +    q) Quit config
    +    n/s/q> n
    +
      +
    1. Enter the name for the configuration
    2. +
    +
        name> <YOUR NAME>
    +
      +
    1. Select "s3" storage.
    2. +
    +
    Choose a number from below, or type in your own value
    +    1 / Alias for an existing remote
    +    \ "alias"
    +    2 / Amazon Drive
    +    \ "amazon cloud drive"
    +    3 / Amazon S3 Complaint Storage Providers (Dreamhost, Ceph, ChinaMobile, Liara, ArvanCloud, Minio, IBM COS)
    +    \ "s3"
    +    4 / Backblaze B2
    +    \ "b2"
    +[snip]
    +    23 / HTTP
    +    \ "http"
    +Storage> 3
    +
      +
    1. Select IBM COS as the S3 Storage Provider.
    2. +
    +
    Choose the S3 provider.
    +Choose a number from below, or type in your own value
    +     1 / Choose this option to configure Storage to AWS S3
    +       \ "AWS"
    +     2 / Choose this option to configure Storage to Ceph Systems
    +     \ "Ceph"
    +     3 /  Choose this option to configure Storage to Dreamhost
    +     \ "Dreamhost"
    +   4 / Choose this option to the configure Storage to IBM COS S3
    +     \ "IBMCOS"
    +     5 / Choose this option to the configure Storage to Minio
    +     \ "Minio"
    +     Provider>4
    +
      +
    1. Enter the Access Key and Secret.
    2. +
    +
        AWS Access Key ID - leave blank for anonymous access or runtime credentials.
    +    access_key_id> <>
    +    AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials.
    +    secret_access_key> <>
    +
      +
    1. Specify the endpoint for IBM COS. For Public IBM COS, choose from the option below. For On Premise IBM COS, enter an endpoint address.
    2. +
    +
        Endpoint for IBM COS S3 API.
    +    Specify if using an IBM COS On Premise.
    +    Choose a number from below, or type in your own value
    +     1 / US Cross Region Endpoint
    +       \ "s3-api.us-geo.objectstorage.softlayer.net"
    +     2 / US Cross Region Dallas Endpoint
    +       \ "s3-api.dal.us-geo.objectstorage.softlayer.net"
    +     3 / US Cross Region Washington DC Endpoint
    +       \ "s3-api.wdc-us-geo.objectstorage.softlayer.net"
    +     4 / US Cross Region San Jose Endpoint
    +       \ "s3-api.sjc-us-geo.objectstorage.softlayer.net"
    +     5 / US Cross Region Private Endpoint
    +       \ "s3-api.us-geo.objectstorage.service.networklayer.com"
    +     6 / US Cross Region Dallas Private Endpoint
    +       \ "s3-api.dal-us-geo.objectstorage.service.networklayer.com"
    +     7 / US Cross Region Washington DC Private Endpoint
    +       \ "s3-api.wdc-us-geo.objectstorage.service.networklayer.com"
    +     8 / US Cross Region San Jose Private Endpoint
    +       \ "s3-api.sjc-us-geo.objectstorage.service.networklayer.com"
    +     9 / US Region East Endpoint
    +       \ "s3.us-east.objectstorage.softlayer.net"
    +    10 / US Region East Private Endpoint
    +       \ "s3.us-east.objectstorage.service.networklayer.com"
    +    11 / US Region South Endpoint
    +[snip]
    +    34 / Toronto Single Site Private Endpoint
    +       \ "s3.tor01.objectstorage.service.networklayer.com"
    +    endpoint>1
    +
      +
    1. Specify a IBM COS Location Constraint. The location constraint must match endpoint when using IBM Cloud Public. For on-prem COS, do not make a selection from this list, hit enter
    2. +
    +
         1 / US Cross Region Standard
    +       \ "us-standard"
    +     2 / US Cross Region Vault
    +       \ "us-vault"
    +     3 / US Cross Region Cold
    +       \ "us-cold"
    +     4 / US Cross Region Flex
    +       \ "us-flex"
    +     5 / US East Region Standard
    +       \ "us-east-standard"
    +     6 / US East Region Vault
    +       \ "us-east-vault"
    +     7 / US East Region Cold
    +       \ "us-east-cold"
    +     8 / US East Region Flex
    +       \ "us-east-flex"
    +     9 / US South Region Standard
    +       \ "us-south-standard"
    +    10 / US South Region Vault
    +       \ "us-south-vault"
    +[snip]
    +    32 / Toronto Flex
    +       \ "tor01-flex"
    +location_constraint>1
    +
      +
    1. Specify a canned ACL. IBM Cloud (Storage) supports "public-read" and "private". IBM Cloud(Infra) supports all the canned ACLs. On-Premise COS supports all the canned ACLs.
    2. +
    +
    Canned ACL used when creating buckets and/or storing objects in S3.
    +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    +Choose a number from below, or type in your own value
    +      1 / Owner gets FULL_CONTROL. No one else has access rights (default). This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise COS
    +      \ "private"
    +      2  / Owner gets FULL_CONTROL. The AllUsers group gets READ access. This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise IBM COS
    +      \ "public-read"
    +      3 / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. This acl is available on IBM Cloud (Infra), On-Premise IBM COS
    +      \ "public-read-write"
    +      4  / Owner gets FULL_CONTROL. The AuthenticatedUsers group gets READ access. Not supported on Buckets. This acl is available on IBM Cloud (Infra) and On-Premise IBM COS
    +      \ "authenticated-read"
    +acl> 1
    +
      +
    1. Review the displayed configuration and accept to save the "remote" then quit. The config file should look like this
    2. +
    +
        [xxx]
    +    type = s3
    +    Provider = IBMCOS
    +    access_key_id = xxx
    +    secret_access_key = yyy
    +    endpoint = s3-api.us-geo.objectstorage.softlayer.net
    +    location_constraint = us-standard
    +    acl = private
    +
      +
    1. Execute rclone commands
    2. +
    +
        1)  Create a bucket.
    +        rclone mkdir IBM-COS-XREGION:newbucket
    +    2)  List available buckets.
    +        rclone lsd IBM-COS-XREGION:
    +        -1 2017-11-08 21:16:22        -1 test
    +        -1 2018-02-14 20:16:39        -1 newbucket
    +    3)  List contents of a bucket.
    +        rclone ls IBM-COS-XREGION:newbucket
    +        18685952 test.exe
    +    4)  Copy a file from local to remote.
    +        rclone copy /Users/file.txt IBM-COS-XREGION:newbucket
    +    5)  Copy a file from remote to local.
    +        rclone copy IBM-COS-XREGION:newbucket/file.txt .
    +    6)  Delete a file on remote.
    +        rclone delete IBM-COS-XREGION:newbucket/file.txt
    +

    IDrive e2

    +

    Here is an example of making an IDrive e2 configuration. First run:

    +
    rclone config
    +

    This will guide you through an interactive setup process.

    +
    No remotes found, make a new one?
    +n) New remote
    +s) Set configuration password
    +q) Quit config
    +n/s/q> n
    +
    +Enter name for new remote.
    +name> e2
    +
    +Option Storage.
    +Type of storage to configure.
    +Choose a number from below, or type in your own value.
    +[snip]
    +XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi
    +   \ (s3)
    +[snip]
    +Storage> s3
    +
    +Option provider.
    +Choose your S3 provider.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +[snip]
    +XX / IDrive e2
    +   \ (IDrive)
    +[snip]
    +provider> IDrive
    +
    +Option env_auth.
    +Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false).
    +Press Enter for the default (false).
    + 1 / Enter AWS credentials in the next step.
    +   \ (false)
    + 2 / Get AWS credentials from the environment (env vars or IAM).
    +   \ (true)
    +env_auth> 
    +
    +Option access_key_id.
    +AWS Access Key ID.
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +access_key_id> YOUR_ACCESS_KEY
    +
    +Option secret_access_key.
    +AWS Secret Access Key (password).
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +secret_access_key> YOUR_SECRET_KEY
    +
    +Option acl.
    +Canned ACL used when creating buckets and storing or copying objects.
    +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
    +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    +Note that this ACL is applied when server-side copying objects as S3
    +doesn't copy the ACL from the source but rather writes a fresh one.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +   / Owner gets FULL_CONTROL.
    + 1 | No one else has access rights (default).
    +   \ (private)
    +   / Owner gets FULL_CONTROL.
    + 2 | The AllUsers group gets READ access.
    +   \ (public-read)
    +   / Owner gets FULL_CONTROL.
    + 3 | The AllUsers group gets READ and WRITE access.
    +   | Granting this on a bucket is generally not recommended.
    +   \ (public-read-write)
    +   / Owner gets FULL_CONTROL.
    + 4 | The AuthenticatedUsers group gets READ access.
    +   \ (authenticated-read)
    +   / Object owner gets FULL_CONTROL.
    + 5 | Bucket owner gets READ access.
    +   | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
    +   \ (bucket-owner-read)
    +   / Both the object owner and the bucket owner get FULL_CONTROL over the object.
    + 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
    +   \ (bucket-owner-full-control)
    +acl> 
    +
    +Edit advanced config?
    +y) Yes
    +n) No (default)
    +y/n> 
    +
    +Configuration complete.
    +Options:
    +- type: s3
    +- provider: IDrive
    +- access_key_id: YOUR_ACCESS_KEY
    +- secret_access_key: YOUR_SECRET_KEY
    +- endpoint: q9d9.la12.idrivee2-5.com
    +Keep this "e2" remote?
    +y) Yes this is OK (default)
    +e) Edit this remote
    +d) Delete this remote
    +y/e/d> y
    +

    IONOS Cloud

    +

    IONOS S3 Object Storage is a service offered by IONOS for storing and accessing unstructured data. To connect to the service, you will need an access key and a secret key. These can be found in the Data Center Designer, by selecting Manager resources > Object Storage Key Manager.

    +

    Here is an example of a configuration. First, run rclone config. This will walk you through an interactive setup process. Type n to add the new remote, and then enter a name:

    +
    Enter name for new remote.
    +name> ionos-fra
    +

    Type s3 to choose the connection type:

    +
    Option Storage.
    +Type of storage to configure.
    +Choose a number from below, or type in your own value.
    +[snip]
    +XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi
    +   \ (s3)
    +[snip]
    +Storage> s3
    +

    Type IONOS:

    +
    Option provider.
    +Choose your S3 provider.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +[snip]
    +XX / IONOS Cloud
    +   \ (IONOS)
    +[snip]
    +provider> IONOS
    +

    Press Enter to choose the default option Enter AWS credentials in the next step:

    +
    Option env_auth.
    +Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false).
    +Press Enter for the default (false).
    + 1 / Enter AWS credentials in the next step.
    +   \ (false)
    + 2 / Get AWS credentials from the environment (env vars or IAM).
    +   \ (true)
    +env_auth>
    +

    Enter your Access Key and Secret key. These can be retrieved in the Data Center Designer, click on the menu “Manager resources” / "Object Storage Key Manager".

    +
    Option access_key_id.
    +AWS Access Key ID.
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +access_key_id> YOUR_ACCESS_KEY
    +
    +Option secret_access_key.
    +AWS Secret Access Key (password).
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +secret_access_key> YOUR_SECRET_KEY
    +

    Choose the region where your bucket is located:

    +
    Option region.
    +Region where your bucket will be created and your data stored.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + 1 / Frankfurt, Germany
    +   \ (de)
    + 2 / Berlin, Germany
    +   \ (eu-central-2)
    + 3 / Logrono, Spain
    +   \ (eu-south-2)
    +region> 2
    +

    Choose the endpoint from the same region:

    +
    Option endpoint.
    +Endpoint for IONOS S3 Object Storage.
    +Specify the endpoint from the same region.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + 1 / Frankfurt, Germany
    +   \ (s3-eu-central-1.ionoscloud.com)
    + 2 / Berlin, Germany
    +   \ (s3-eu-central-2.ionoscloud.com)
    + 3 / Logrono, Spain
    +   \ (s3-eu-south-2.ionoscloud.com)
    +endpoint> 1
    +

    Press Enter to choose the default option or choose the desired ACL setting:

    +
    Option acl.
    +Canned ACL used when creating buckets and storing or copying objects.
    +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
    +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    +Note that this ACL is applied when server-side copying objects as S3
    +doesn't copy the ACL from the source but rather writes a fresh one.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +   / Owner gets FULL_CONTROL.
    + 1 | No one else has access rights (default).
    +   \ (private)
    +   / Owner gets FULL_CONTROL.
    +[snip]
    +acl>
    +

    Press Enter to skip the advanced config:

    +
    Edit advanced config?
    +y) Yes
    +n) No (default)
    +y/n>
    +

    Press Enter to save the configuration, and then q to quit the configuration process:

    +
    Configuration complete.
    +Options:
    +- type: s3
    +- provider: IONOS
    +- access_key_id: YOUR_ACCESS_KEY
    +- secret_access_key: YOUR_SECRET_KEY
    +- endpoint: s3-eu-central-1.ionoscloud.com
    +Keep this "ionos-fra" remote?
    +y) Yes this is OK (default)
    +e) Edit this remote
    +d) Delete this remote
    +y/e/d> y
    +

    Done! Now you can try some commands (for macOS, use ./rclone instead of rclone).

    +
      +
    1. Create a bucket (the name must be unique within the whole IONOS S3)
    2. +
    +
    rclone mkdir ionos-fra:my-bucket
    +
      +
    1. List available buckets
    2. +
    +
    rclone lsd ionos-fra:
    +
      +
    1. Copy a file from local to remote
    2. +
    +
    rclone copy /Users/file.txt ionos-fra:my-bucket
    +
      +
    1. List contents of a bucket
    2. +
    +
    rclone ls ionos-fra:my-bucket
    +
      +
    1. Copy a file from remote to local
    2. +
    +
    rclone copy ionos-fra:my-bucket/file.txt
    +

    Minio

    +

    Minio is an object storage server built for cloud application developers and devops.

    +

    It is very easy to install and provides an S3 compatible server which can be used by rclone.

    +

    To use it, install Minio following the instructions here.

    +

    When it configures itself Minio will print something like this

    +
    Endpoint:  http://192.168.1.106:9000  http://172.23.0.1:9000
    +AccessKey: USWUXHGYZQYFYFFIT3RE
    +SecretKey: MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03
    +Region:    us-east-1
    +SQS ARNs:  arn:minio:sqs:us-east-1:1:redis arn:minio:sqs:us-east-1:2:redis
    +
    +Browser Access:
    +   http://192.168.1.106:9000  http://172.23.0.1:9000
    +
    +Command-line Access: https://docs.minio.io/docs/minio-client-quickstart-guide
    +   $ mc config host add myminio http://192.168.1.106:9000 USWUXHGYZQYFYFFIT3RE MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03
    +
    +Object API (Amazon S3 compatible):
    +   Go:         https://docs.minio.io/docs/golang-client-quickstart-guide
    +   Java:       https://docs.minio.io/docs/java-client-quickstart-guide
    +   Python:     https://docs.minio.io/docs/python-client-quickstart-guide
    +   JavaScript: https://docs.minio.io/docs/javascript-client-quickstart-guide
    +   .NET:       https://docs.minio.io/docs/dotnet-client-quickstart-guide
    +
    +Drive Capacity: 26 GiB Free, 165 GiB Total
    +

    These details need to go into rclone config like this. Note that it is important to put the region in as stated above.

    +
    env_auth> 1
    +access_key_id> USWUXHGYZQYFYFFIT3RE
    +secret_access_key> MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03
    +region> us-east-1
    +endpoint> http://192.168.1.106:9000
    +location_constraint>
    +server_side_encryption>
    +

    Which makes the config file look like this

    +
    [minio]
    +type = s3
    +provider = Minio
    +env_auth = false
    +access_key_id = USWUXHGYZQYFYFFIT3RE
    +secret_access_key = MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03
    +region = us-east-1
    +endpoint = http://192.168.1.106:9000
    +location_constraint =
    +server_side_encryption =
    +

    So once set up, for example, to copy files into a bucket

    +
    rclone copy /path/to/files minio:bucket
    +

    Qiniu Cloud Object Storage (Kodo)

    +

    Qiniu Cloud Object Storage (Kodo), a completely independent-researched core technology which is proven by repeated customer experience has occupied absolute leading market leader position. Kodo can be widely applied to mass data management.

    +

    To configure access to Qiniu Kodo, follow the steps below:

    +
      +
    1. Run rclone config and select n for a new remote.
    2. +
    +
    rclone config
    +No remotes found, make a new one?
    +n) New remote
    +s) Set configuration password
    +q) Quit config
    +n/s/q> n
    +
      +
    1. Give the name of the configuration. For example, name it 'qiniu'.
    2. +
    +
    name> qiniu
    +
      +
    1. Select s3 storage.
    2. +
    +
    Choose a number from below, or type in your own value
    + 1 / 1Fichier
    +   \ (fichier)
    + 2 / Akamai NetStorage
    +   \ (netstorage)
    + 3 / Alias for an existing remote
    +   \ (alias)
    + 4 / Amazon Drive
    +   \ (amazon cloud drive)
    + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi
    +   \ (s3)
    +[snip]
    +Storage> s3
    +
      +
    1. Select Qiniu provider.
    2. +
    +
    Choose a number from below, or type in your own value
    +1 / Amazon Web Services (AWS) S3
    +   \ "AWS"
    +[snip]
    +22 / Qiniu Object Storage (Kodo)
    +   \ (Qiniu)
    +[snip]
    +provider> Qiniu
    +
      +
    1. Enter your SecretId and SecretKey of Qiniu Kodo.
    2. +
    +
    Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    +Only applies if access_key_id and secret_access_key is blank.
    +Enter a boolean value (true or false). Press Enter for the default ("false").
    +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.
    +Enter a string value. Press Enter for the default ("").
    +access_key_id> AKIDxxxxxxxxxx
    +AWS Secret Access Key (password)
    +Leave blank for anonymous access or runtime credentials.
    +Enter a string value. Press Enter for the default ("").
    +secret_access_key> xxxxxxxxxxx
    +
      +
    1. Select endpoint for Qiniu Kodo. This is the standard endpoint for different region.
    2. +
    +
       / The default endpoint - a good choice if you are unsure.
    + 1 | East China Region 1.
    +   | Needs location constraint cn-east-1.
    +   \ (cn-east-1)
    +   / East China Region 2.
    + 2 | Needs location constraint cn-east-2.
    +   \ (cn-east-2)
    +   / North China Region 1.
    + 3 | Needs location constraint cn-north-1.
    +   \ (cn-north-1)
    +   / South China Region 1.
    + 4 | Needs location constraint cn-south-1.
    +   \ (cn-south-1)
    +   / North America Region.
    + 5 | Needs location constraint us-north-1.
    +   \ (us-north-1)
    +   / Southeast Asia Region 1.
    + 6 | Needs location constraint ap-southeast-1.
    +   \ (ap-southeast-1)
    +   / Northeast Asia Region 1.
    + 7 | Needs location constraint ap-northeast-1.
    +   \ (ap-northeast-1)
    +[snip]
    +endpoint> 1
    +
    +Option endpoint.
    +Endpoint for Qiniu Object Storage.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + 1 / East China Endpoint 1
    +   \ (s3-cn-east-1.qiniucs.com)
    + 2 / East China Endpoint 2
    +   \ (s3-cn-east-2.qiniucs.com)
    + 3 / North China Endpoint 1
    +   \ (s3-cn-north-1.qiniucs.com)
    + 4 / South China Endpoint 1
    +   \ (s3-cn-south-1.qiniucs.com)
    + 5 / North America Endpoint 1
    +   \ (s3-us-north-1.qiniucs.com)
    + 6 / Southeast Asia Endpoint 1
    +   \ (s3-ap-southeast-1.qiniucs.com)
    + 7 / Northeast Asia Endpoint 1
    +   \ (s3-ap-northeast-1.qiniucs.com)
    +endpoint> 1
    +
    +Option location_constraint.
    +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.
    +Press Enter to leave empty.
    + 1 / East China Region 1
    +   \ (cn-east-1)
    + 2 / East China Region 2
    +   \ (cn-east-2)
    + 3 / North China Region 1
    +   \ (cn-north-1)
    + 4 / South China Region 1
    +   \ (cn-south-1)
    + 5 / North America Region 1
    +   \ (us-north-1)
    + 6 / Southeast Asia Region 1
    +   \ (ap-southeast-1)
    + 7 / Northeast Asia Region 1
    +   \ (ap-northeast-1)
    +location_constraint> 1
    +
      +
    1. Choose acl and storage class.
    2. +
    +
    Note that this ACL is applied when server-side copying objects as S3
    +doesn't copy the ACL from the source but rather writes a fresh one.
    +Enter a string value. Press Enter for the default ("").
    +Choose a number from below, or type in your own value
    +   / Owner gets FULL_CONTROL.
    + 1 | No one else has access rights (default).
    +   \ (private)
    +   / Owner gets FULL_CONTROL.
    + 2 | The AllUsers group gets READ access.
    +   \ (public-read)
    +[snip]
    +acl> 2
    +The storage class to use when storing new objects in Tencent COS.
    +Enter a string value. Press Enter for the default ("").
    +Choose a number from below, or type in your own value
    + 1 / Standard storage class
    +   \ (STANDARD)
    + 2 / Infrequent access storage mode
    +   \ (LINE)
    + 3 / Archive storage mode
    +   \ (GLACIER)
    + 4 / Deep archive storage mode
    +   \ (DEEP_ARCHIVE)
    +[snip]
    +storage_class> 1
    +Edit advanced config? (y/n)
    +y) Yes
    +n) No (default)
    +y/n> n
    +Remote config
    +--------------------
    +[qiniu]
    +- type: s3
    +- provider: Qiniu
    +- access_key_id: xxx
    +- secret_access_key: xxx
    +- region: cn-east-1
    +- endpoint: s3-cn-east-1.qiniucs.com
    +- location_constraint: cn-east-1
    +- acl: public-read
    +- storage_class: STANDARD
    +--------------------
    +y) Yes this is OK (default)
    +e) Edit this remote
    +d) Delete this remote
    +y/e/d> y
    +Current remotes:
    +
    +Name                 Type
    +====                 ====
    +qiniu                s3
    +

    RackCorp

    +

    RackCorp Object Storage is an S3 compatible object storage platform from your friendly cloud provider RackCorp. The service is fast, reliable, well priced and located in many strategic locations unserviced by others, to ensure you can maintain data sovereignty.

    +

    Before you can use RackCorp Object Storage, you'll need to "sign up" for an account on our "portal". Next you can create an access key, a secret key and buckets, in your location of choice with ease. These details are required for the next steps of configuration, when rclone config asks for your access_key_id and secret_access_key.

    +

    Your config should end up looking a bit like this:

    +
    [RCS3-demo-config]
    +type = s3
    +provider = RackCorp
    +env_auth = true
    +access_key_id = YOURACCESSKEY
    +secret_access_key = YOURSECRETACCESSKEY
    +region = au-nsw
    +endpoint = s3.rackcorp.com
    +location_constraint = au-nsw
    +

    Rclone Serve S3

    +

    Rclone can serve any remote over the S3 protocol. For details see the rclone serve s3 documentation.

    +

    For example, to serve remote:path over s3, run the server like this:

    +
    rclone serve s3 --auth-key ACCESS_KEY_ID,SECRET_ACCESS_KEY remote:path
    +

    This will be compatible with an rclone remote which is defined like this:

    +
    [serves3]
    +type = s3
    +provider = Rclone
    +endpoint = http://127.0.0.1:8080/
    +access_key_id = ACCESS_KEY_ID
    +secret_access_key = SECRET_ACCESS_KEY
    +use_multipart_uploads = false
    +

    Note that setting disable_multipart_uploads = true is to work around a bug which will be fixed in due course.

    +

    Scaleway

    +

    Scaleway The Object Storage platform allows you to store anything from backups, logs and web assets to documents and photos. Files can be dropped from the Scaleway console or transferred through our API and CLI or using any S3-compatible tool.

    +

    Scaleway provides an S3 interface which can be configured for use with rclone like this:

    +
    [scaleway]
    +type = s3
    +provider = Scaleway
    +env_auth = false
    +endpoint = s3.nl-ams.scw.cloud
    +access_key_id = SCWXXXXXXXXXXXXXX
    +secret_access_key = 1111111-2222-3333-44444-55555555555555
    +region = nl-ams
    +location_constraint =
    +acl = private
    +server_side_encryption =
    +storage_class =
    +

    C14 Cold Storage is the low-cost S3 Glacier alternative from Scaleway and it works the same way as on S3 by accepting the "GLACIER" storage_class. So you can configure your remote with the storage_class = GLACIER option to upload directly to C14. Don't forget that in this state you can't read files back after, you will need to restore them to "STANDARD" storage_class first before being able to read them (see "restore" section above)

    +

    Seagate Lyve Cloud

    +

    Seagate Lyve Cloud is an S3 compatible object storage platform from Seagate intended for enterprise use.

    +

    Here is a config run through for a remote called remote - you may choose a different name of course. Note that to create an access key and secret key you will need to create a service account first.

    +
    $ rclone config
    +No remotes found, make a new one?
    +n) New remote
    +s) Set configuration password
    +q) Quit config
    +n/s/q> n
    +name> remote
    +

    Choose s3 backend

    +
    Type of storage to configure.
    +Choose a number from below, or type in your own value.
    +[snip]
    +XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS
    +   \ (s3)
    +[snip]
    +Storage> s3
    +

    Choose LyveCloud as S3 provider

    +
    Choose your S3 provider.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +[snip]
    +XX / Seagate Lyve Cloud
    +   \ (LyveCloud)
    +[snip]
    +provider> LyveCloud
    +

    Take the default (just press enter) to enter access key and secret in the config file.

    +
    Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false).
    +Press Enter for the default (false).
    + 1 / Enter AWS credentials in the next step.
    +   \ (false)
    + 2 / Get AWS credentials from the environment (env vars or IAM).
    +   \ (true)
    +env_auth>
    +
    AWS Access Key ID.
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +access_key_id> XXX
    +
    AWS Secret Access Key (password).
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +secret_access_key> YYY
    +

    Leave region blank

    +
    Region to connect to.
    +Leave blank if you are using an S3 clone and you don't have a region.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +   / Use this if unsure.
    + 1 | Will use v4 signatures and an empty region.
    +   \ ()
    +   / Use this only if v4 signatures don't work.
    + 2 | E.g. pre Jewel/v10 CEPH.
    +   \ (other-v2-signature)
    +region>
    +

    Choose an endpoint from the list

    +
    Endpoint for S3 API.
    +Required when using an S3 clone.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + 1 / Seagate Lyve Cloud US East 1 (Virginia)
    +   \ (s3.us-east-1.lyvecloud.seagate.com)
    + 2 / Seagate Lyve Cloud US West 1 (California)
    +   \ (s3.us-west-1.lyvecloud.seagate.com)
    + 3 / Seagate Lyve Cloud AP Southeast 1 (Singapore)
    +   \ (s3.ap-southeast-1.lyvecloud.seagate.com)
    +endpoint> 1
    +

    Leave location constraint blank

    +
    Location constraint - must be set to match the Region.
    +Leave blank if not sure. Used when creating buckets only.
    +Enter a value. Press Enter to leave empty.
    +location_constraint>
    +

    Choose default ACL (private).

    +
    Canned ACL used when creating buckets and storing or copying objects.
    +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
    +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    +Note that this ACL is applied when server-side copying objects as S3
    +doesn't copy the ACL from the source but rather writes a fresh one.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +   / Owner gets FULL_CONTROL.
    + 1 | No one else has access rights (default).
    +   \ (private)
    +[snip]
    +acl>
    +

    And the config file should end up looking like this:

    +
    [remote]
    +type = s3
    +provider = LyveCloud
    +access_key_id = XXX
    +secret_access_key = YYY
    +endpoint = s3.us-east-1.lyvecloud.seagate.com
    +

    SeaweedFS

    +

    SeaweedFS is a distributed storage system for blobs, objects, files, and data lake, with O(1) disk seek and a scalable file metadata store. It has an S3 compatible object storage interface. SeaweedFS can also act as a gateway to remote S3 compatible object store to cache data and metadata with asynchronous write back, for fast local speed and minimize access cost.

    +

    Assuming the SeaweedFS are configured with weed shell as such:

    +
    > s3.bucket.create -name foo
    +> s3.configure -access_key=any -secret_key=any -buckets=foo -user=me -actions=Read,Write,List,Tagging,Admin -apply
    +{
    +  "identities": [
         {
    -      "Initiated": "2020-06-26T14:20:36Z",
    -      "Initiator": {
    -        "DisplayName": "XXX",
    -        "ID": "arn:aws:iam::XXX:user/XXX"
    -      },
    -      "Key": "KEY",
    -      "Owner": {
    -        "DisplayName": null,
    -        "ID": "XXX"
    -      },
    -      "StorageClass": "STANDARD",
    -      "UploadId": "XXX"
    +      "name": "me",
    +      "credentials": [
    +        {
    +          "accessKey": "any",
    +          "secretKey": "any"
    +        }
    +      ],
    +      "actions": [
    +        "Read:foo",
    +        "Write:foo",
    +        "List:foo",
    +        "Tagging:foo",
    +        "Admin:foo"
    +      ]
         }
    -  ],
    -  "rclone-1000files": [],
    -  "rclone-dst": []
    +  ]
     }
    -

    cleanup

    -

    Remove unfinished multipart uploads.

    -
    rclone backend cleanup remote: [options] [<arguments>+]
    -

    This command removes unfinished multipart uploads of age greater than max-age which defaults to 24 hours.

    -

    Note that you can use --interactive/-i or --dry-run with this command to see what it would do.

    -
    rclone backend cleanup s3:bucket/path/to/object
    -rclone backend cleanup -o max-age=7w s3:bucket/path/to/object
    -

    Durations are parsed as per the rest of rclone, 2h, 7d, 7w etc.

    -

    Options:

    -
      -
    • "max-age": Max age of upload to delete
    • -
    -

    cleanup-hidden

    -

    Remove old versions of files.

    -
    rclone backend cleanup-hidden remote: [options] [<arguments>+]
    -

    This command removes any old hidden versions of files on a versions enabled bucket.

    -

    Note that you can use --interactive/-i or --dry-run with this command to see what it would do.

    -
    rclone backend cleanup-hidden s3:bucket/path/to/dir
    -

    versioning

    -

    Set/get versioning support for a bucket.

    -
    rclone backend versioning remote: [options] [<arguments>+]
    -

    This command sets versioning support if a parameter is passed and then returns the current versioning status for the bucket supplied.

    -
    rclone backend versioning s3:bucket # read status only
    -rclone backend versioning s3:bucket Enabled
    -rclone backend versioning s3:bucket Suspended
    -

    It may return "Enabled", "Suspended" or "Unversioned". Note that once versioning has been enabled the status can't be set back to "Unversioned".

    -

    set

    -

    Set command for updating the config parameters.

    -
    rclone backend set remote: [options] [<arguments>+]
    -

    This set command can be used to update the config parameters for a running s3 backend.

    -

    Usage Examples:

    -
    rclone backend set s3: [-o opt_name=opt_value] [-o opt_name2=opt_value2]
    -rclone rc backend/command command=set fs=s3: [-o opt_name=opt_value] [-o opt_name2=opt_value2]
    -rclone rc backend/command command=set fs=s3: -o session_token=X -o access_key_id=X -o secret_access_key=X
    -

    The option keys are named as they are in the config file.

    -

    This rebuilds the connection to the s3 backend when it is called with the new parameters. Only new parameters need be passed as the values will default to those currently in use.

    -

    It doesn't return anything.

    -

    Anonymous access to public buckets

    -

    If you want to use rclone to access a public bucket, configure with a blank access_key_id and secret_access_key. Your config should end up looking like this:

    -
    [anons3]
    +

    To use rclone with SeaweedFS, above configuration should end up with something like this in your config:

    +
    [seaweedfs_s3]
    +type = s3
    +provider = SeaweedFS
    +access_key_id = any
    +secret_access_key = any
    +endpoint = localhost:8333
    +

    So once set up, for example to copy files into a bucket

    +
    rclone copy /path/to/files seaweedfs_s3:foo
    +

    Wasabi

    +

    Wasabi is a cloud-based object storage service for a broad range of applications and use cases. Wasabi is designed for individuals and organizations that require a high-performance, reliable, and secure data storage infrastructure at minimal cost.

    +

    Wasabi provides an S3 interface which can be configured for use with rclone like this.

    +
    No remotes found, make a new one?
    +n) New remote
    +s) Set configuration password
    +n/s> n
    +name> wasabi
    +Type of storage to configure.
    +Choose a number from below, or type in your own value
    +[snip]
    +XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Minio, Liara)
    +   \ "s3"
    +[snip]
    +Storage> s3
    +Get AWS credentials from runtime (environment variables or EC2/ECS 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> YOURACCESSKEY
    +AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials.
    +secret_access_key> YOURSECRETACCESSKEY
    +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"
    +[snip]
    +region> us-east-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> s3.wasabisys.com
    +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.
    +   \ ""
    +[snip]
    +location_constraint>
    +Canned ACL used when creating buckets and/or storing objects in S3.
    +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    +Choose a number from below, or type in your own value
    + 1 / Owner gets FULL_CONTROL. No one else has access rights (default).
    +   \ "private"
    +[snip]
    +acl>
    +The server-side encryption algorithm used when storing this object in S3.
    +Choose a number from below, or type in your own value
    + 1 / None
    +   \ ""
    + 2 / AES256
    +   \ "AES256"
    +server_side_encryption>
    +The storage class to use when storing objects in S3.
    +Choose a number from below, or type in your own value
    + 1 / Default
    +   \ ""
    + 2 / Standard storage class
    +   \ "STANDARD"
    + 3 / Reduced redundancy storage class
    +   \ "REDUCED_REDUNDANCY"
    + 4 / Standard Infrequent Access storage class
    +   \ "STANDARD_IA"
    +storage_class>
    +Remote config
    +--------------------
    +[wasabi]
    +env_auth = false
    +access_key_id = YOURACCESSKEY
    +secret_access_key = YOURSECRETACCESSKEY
    +region = us-east-1
    +endpoint = s3.wasabisys.com
    +location_constraint =
    +acl =
    +server_side_encryption =
    +storage_class =
    +--------------------
    +y) Yes this is OK
    +e) Edit this remote
    +d) Delete this remote
    +y/e/d> y
    +

    This will leave the config file looking like this.

    +
    [wasabi]
    +type = s3
    +provider = Wasabi
    +env_auth = false
    +access_key_id = YOURACCESSKEY
    +secret_access_key = YOURSECRETACCESSKEY
    +region =
    +endpoint = s3.wasabisys.com
    +location_constraint =
    +acl =
    +server_side_encryption =
    +storage_class =
    +

    Alibaba OSS

    +

    Here is an example of making an Alibaba Cloud (Aliyun) OSS configuration. First run:

    +
    rclone config
    +

    This will guide you through an interactive setup process.

    +
    No remotes found, make a new one?
    +n) New remote
    +s) Set configuration password
    +q) Quit config
    +n/s/q> n
    +name> oss
    +Type of storage to configure.
    +Enter a string value. Press Enter for the default ("").
    +Choose a number from below, or type in your own value
    +[snip]
    + 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Minio, and Tencent COS
    +   \ "s3"
    +[snip]
    +Storage> s3
    +Choose your S3 provider.
    +Enter a string value. Press Enter for the default ("").
    +Choose a number from below, or type in your own value
    + 1 / Amazon Web Services (AWS) S3
    +   \ "AWS"
    + 2 / Alibaba Cloud Object Storage System (OSS) formerly Aliyun
    +   \ "Alibaba"
    + 3 / Ceph Object Storage
    +   \ "Ceph"
    +[snip]
    +provider> Alibaba
    +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    +Only applies if access_key_id and secret_access_key is blank.
    +Enter a boolean value (true or false). Press Enter for the default ("false").
    +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.
    +Enter a string value. Press Enter for the default ("").
    +access_key_id> accesskeyid
    +AWS Secret Access Key (password)
    +Leave blank for anonymous access or runtime credentials.
    +Enter a string value. Press Enter for the default ("").
    +secret_access_key> secretaccesskey
    +Endpoint for OSS API.
    +Enter a string value. Press Enter for the default ("").
    +Choose a number from below, or type in your own value
    + 1 / East China 1 (Hangzhou)
    +   \ "oss-cn-hangzhou.aliyuncs.com"
    + 2 / East China 2 (Shanghai)
    +   \ "oss-cn-shanghai.aliyuncs.com"
    + 3 / North China 1 (Qingdao)
    +   \ "oss-cn-qingdao.aliyuncs.com"
    +[snip]
    +endpoint> 1
    +Canned ACL used when creating buckets and storing or copying objects.
    +
    +Note that this ACL is applied when server-side copying objects as S3
    +doesn't copy the ACL from the source but rather writes a fresh one.
    +Enter a string value. Press Enter for the default ("").
    +Choose a number from below, or type in your own value
    + 1 / Owner gets FULL_CONTROL. No one else has access rights (default).
    +   \ "private"
    + 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access.
    +   \ "public-read"
    +   / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access.
    +[snip]
    +acl> 1
    +The storage class to use when storing new objects in OSS.
    +Enter a string value. Press Enter for the default ("").
    +Choose a number from below, or type in your own value
    + 1 / Default
    +   \ ""
    + 2 / Standard storage class
    +   \ "STANDARD"
    + 3 / Archive storage mode.
    +   \ "GLACIER"
    + 4 / Infrequent access storage mode.
    +   \ "STANDARD_IA"
    +storage_class> 1
    +Edit advanced config? (y/n)
    +y) Yes
    +n) No
    +y/n> n
    +Remote config
    +--------------------
    +[oss]
    +type = s3
    +provider = Alibaba
    +env_auth = false
    +access_key_id = accesskeyid
    +secret_access_key = secretaccesskey
    +endpoint = oss-cn-hangzhou.aliyuncs.com
    +acl = private
    +storage_class = Standard
    +--------------------
    +y) Yes this is OK
    +e) Edit this remote
    +d) Delete this remote
    +y/e/d> y
    +

    China Mobile Ecloud Elastic Object Storage (EOS)

    +

    Here is an example of making an China Mobile Ecloud Elastic Object Storage (EOS) configuration. First run:

    +
    rclone config
    +

    This will guide you through an interactive setup process.

    +
    No remotes found, make a new one?
    +n) New remote
    +s) Set configuration password
    +q) Quit config
    +n/s/q> n
    +name> ChinaMobile
    +Option Storage.
    +Type of storage to configure.
    +Choose a number from below, or type in your own value.
    + ...
    + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS
    +   \ (s3)
    + ...
    +Storage> s3
    +Option provider.
    +Choose your S3 provider.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + ...
    + 4 / China Mobile Ecloud Elastic Object Storage (EOS)
    +   \ (ChinaMobile)
    + ...
    +provider> ChinaMobile
    +Option env_auth.
    +Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false).
    +Press Enter for the default (false).
    + 1 / Enter AWS credentials in the next step.
    +   \ (false)
    + 2 / Get AWS credentials from the environment (env vars or IAM).
    +   \ (true)
    +env_auth>
    +Option access_key_id.
    +AWS Access Key ID.
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +access_key_id> accesskeyid
    +Option secret_access_key.
    +AWS Secret Access Key (password).
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +secret_access_key> secretaccesskey
    +Option endpoint.
    +Endpoint for China Mobile Ecloud Elastic Object Storage (EOS) API.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +   / The default endpoint - a good choice if you are unsure.
    + 1 | East China (Suzhou)
    +   \ (eos-wuxi-1.cmecloud.cn)
    + 2 / East China (Jinan)
    +   \ (eos-jinan-1.cmecloud.cn)
    + 3 / East China (Hangzhou)
    +   \ (eos-ningbo-1.cmecloud.cn)
    + 4 / East China (Shanghai-1)
    +   \ (eos-shanghai-1.cmecloud.cn)
    + 5 / Central China (Zhengzhou)
    +   \ (eos-zhengzhou-1.cmecloud.cn)
    + 6 / Central China (Changsha-1)
    +   \ (eos-hunan-1.cmecloud.cn)
    + 7 / Central China (Changsha-2)
    +   \ (eos-zhuzhou-1.cmecloud.cn)
    + 8 / South China (Guangzhou-2)
    +   \ (eos-guangzhou-1.cmecloud.cn)
    + 9 / South China (Guangzhou-3)
    +   \ (eos-dongguan-1.cmecloud.cn)
    +10 / North China (Beijing-1)
    +   \ (eos-beijing-1.cmecloud.cn)
    +11 / North China (Beijing-2)
    +   \ (eos-beijing-2.cmecloud.cn)
    +12 / North China (Beijing-3)
    +   \ (eos-beijing-4.cmecloud.cn)
    +13 / North China (Huhehaote)
    +   \ (eos-huhehaote-1.cmecloud.cn)
    +14 / Southwest China (Chengdu)
    +   \ (eos-chengdu-1.cmecloud.cn)
    +15 / Southwest China (Chongqing)
    +   \ (eos-chongqing-1.cmecloud.cn)
    +16 / Southwest China (Guiyang)
    +   \ (eos-guiyang-1.cmecloud.cn)
    +17 / Nouthwest China (Xian)
    +   \ (eos-xian-1.cmecloud.cn)
    +18 / Yunnan China (Kunming)
    +   \ (eos-yunnan.cmecloud.cn)
    +19 / Yunnan China (Kunming-2)
    +   \ (eos-yunnan-2.cmecloud.cn)
    +20 / Tianjin China (Tianjin)
    +   \ (eos-tianjin-1.cmecloud.cn)
    +21 / Jilin China (Changchun)
    +   \ (eos-jilin-1.cmecloud.cn)
    +22 / Hubei China (Xiangyan)
    +   \ (eos-hubei-1.cmecloud.cn)
    +23 / Jiangxi China (Nanchang)
    +   \ (eos-jiangxi-1.cmecloud.cn)
    +24 / Gansu China (Lanzhou)
    +   \ (eos-gansu-1.cmecloud.cn)
    +25 / Shanxi China (Taiyuan)
    +   \ (eos-shanxi-1.cmecloud.cn)
    +26 / Liaoning China (Shenyang)
    +   \ (eos-liaoning-1.cmecloud.cn)
    +27 / Hebei China (Shijiazhuang)
    +   \ (eos-hebei-1.cmecloud.cn)
    +28 / Fujian China (Xiamen)
    +   \ (eos-fujian-1.cmecloud.cn)
    +29 / Guangxi China (Nanning)
    +   \ (eos-guangxi-1.cmecloud.cn)
    +30 / Anhui China (Huainan)
    +   \ (eos-anhui-1.cmecloud.cn)
    +endpoint> 1
    +Option location_constraint.
    +Location constraint - must match endpoint.
    +Used when creating buckets only.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + 1 / East China (Suzhou)
    +   \ (wuxi1)
    + 2 / East China (Jinan)
    +   \ (jinan1)
    + 3 / East China (Hangzhou)
    +   \ (ningbo1)
    + 4 / East China (Shanghai-1)
    +   \ (shanghai1)
    + 5 / Central China (Zhengzhou)
    +   \ (zhengzhou1)
    + 6 / Central China (Changsha-1)
    +   \ (hunan1)
    + 7 / Central China (Changsha-2)
    +   \ (zhuzhou1)
    + 8 / South China (Guangzhou-2)
    +   \ (guangzhou1)
    + 9 / South China (Guangzhou-3)
    +   \ (dongguan1)
    +10 / North China (Beijing-1)
    +   \ (beijing1)
    +11 / North China (Beijing-2)
    +   \ (beijing2)
    +12 / North China (Beijing-3)
    +   \ (beijing4)
    +13 / North China (Huhehaote)
    +   \ (huhehaote1)
    +14 / Southwest China (Chengdu)
    +   \ (chengdu1)
    +15 / Southwest China (Chongqing)
    +   \ (chongqing1)
    +16 / Southwest China (Guiyang)
    +   \ (guiyang1)
    +17 / Nouthwest China (Xian)
    +   \ (xian1)
    +18 / Yunnan China (Kunming)
    +   \ (yunnan)
    +19 / Yunnan China (Kunming-2)
    +   \ (yunnan2)
    +20 / Tianjin China (Tianjin)
    +   \ (tianjin1)
    +21 / Jilin China (Changchun)
    +   \ (jilin1)
    +22 / Hubei China (Xiangyan)
    +   \ (hubei1)
    +23 / Jiangxi China (Nanchang)
    +   \ (jiangxi1)
    +24 / Gansu China (Lanzhou)
    +   \ (gansu1)
    +25 / Shanxi China (Taiyuan)
    +   \ (shanxi1)
    +26 / Liaoning China (Shenyang)
    +   \ (liaoning1)
    +27 / Hebei China (Shijiazhuang)
    +   \ (hebei1)
    +28 / Fujian China (Xiamen)
    +   \ (fujian1)
    +29 / Guangxi China (Nanning)
    +   \ (guangxi1)
    +30 / Anhui China (Huainan)
    +   \ (anhui1)
    +location_constraint> 1
    +Option acl.
    +Canned ACL used when creating buckets and storing or copying objects.
    +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
    +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    +Note that this ACL is applied when server-side copying objects as S3
    +doesn't copy the ACL from the source but rather writes a fresh one.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +   / Owner gets FULL_CONTROL.
    + 1 | No one else has access rights (default).
    +   \ (private)
    +   / Owner gets FULL_CONTROL.
    + 2 | The AllUsers group gets READ access.
    +   \ (public-read)
    +   / Owner gets FULL_CONTROL.
    + 3 | The AllUsers group gets READ and WRITE access.
    +   | Granting this on a bucket is generally not recommended.
    +   \ (public-read-write)
    +   / Owner gets FULL_CONTROL.
    + 4 | The AuthenticatedUsers group gets READ access.
    +   \ (authenticated-read)
    +   / Object owner gets FULL_CONTROL.
    +acl> private
    +Option server_side_encryption.
    +The server-side encryption algorithm used when storing this object in S3.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + 1 / None
    +   \ ()
    + 2 / AES256
    +   \ (AES256)
    +server_side_encryption>
    +Option storage_class.
    +The storage class to use when storing new objects in ChinaMobile.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + 1 / Default
    +   \ ()
    + 2 / Standard storage class
    +   \ (STANDARD)
    + 3 / Archive storage mode
    +   \ (GLACIER)
    + 4 / Infrequent access storage mode
    +   \ (STANDARD_IA)
    +storage_class>
    +Edit advanced config?
    +y) Yes
    +n) No (default)
    +y/n> n
    +--------------------
    +[ChinaMobile]
     type = s3
    -provider = AWS
    +provider = ChinaMobile
    +access_key_id = accesskeyid
    +secret_access_key = secretaccesskey
    +endpoint = eos-wuxi-1.cmecloud.cn
    +location_constraint = wuxi1
    +acl = private
    +--------------------
    +y) Yes this is OK (default)
    +e) Edit this remote
    +d) Delete this remote
    +y/e/d> y
    +

    Leviia Cloud Object Storage

    +

    Leviia Object Storage, backup and secure your data in a 100% French cloud, independent of GAFAM..

    +

    To configure access to Leviia, follow the steps below:

    +
      +
    1. Run rclone config and select n for a new remote.
    2. +
    +
    rclone config
    +No remotes found, make a new one?
    +n) New remote
    +s) Set configuration password
    +q) Quit config
    +n/s/q> n
    +
      +
    1. Give the name of the configuration. For example, name it 'leviia'.
    2. +
    +
    name> leviia
    +
      +
    1. Select s3 storage.
    2. +
    +
    Choose a number from below, or type in your own value
    + 1 / 1Fichier
    +   \ (fichier)
    + 2 / Akamai NetStorage
    +   \ (netstorage)
    + 3 / Alias for an existing remote
    +   \ (alias)
    + 4 / Amazon Drive
    +   \ (amazon cloud drive)
    + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi
    +   \ (s3)
    +[snip]
    +Storage> s3
    +
      +
    1. Select Leviia provider.
    2. +
    +
    Choose a number from below, or type in your own value
    +1 / Amazon Web Services (AWS) S3
    +   \ "AWS"
    +[snip]
    +15 / Leviia Object Storage
    +   \ (Leviia)
    +[snip]
    +provider> Leviia
    +
      +
    1. Enter your SecretId and SecretKey of Leviia.
    2. +
    +
    Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    +Only applies if access_key_id and secret_access_key is blank.
    +Enter a boolean value (true or false). Press Enter for the default ("false").
    +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.
    +Enter a string value. Press Enter for the default ("").
    +access_key_id> ZnIx.xxxxxxxxxxxxxxx
    +AWS Secret Access Key (password)
    +Leave blank for anonymous access or runtime credentials.
    +Enter a string value. Press Enter for the default ("").
    +secret_access_key> xxxxxxxxxxx
    +
      +
    1. Select endpoint for Leviia.
    2. +
    +
       / The default endpoint
    + 1 | Leviia.
    +   \ (s3.leviia.com)
    +[snip]
    +endpoint> 1
    +
      +
    1. Choose acl.
    2. +
    +
    Note that this ACL is applied when server-side copying objects as S3
    +doesn't copy the ACL from the source but rather writes a fresh one.
    +Enter a string value. Press Enter for the default ("").
    +Choose a number from below, or type in your own value
    +   / Owner gets FULL_CONTROL.
    + 1 | No one else has access rights (default).
    +   \ (private)
    +   / Owner gets FULL_CONTROL.
    + 2 | The AllUsers group gets READ access.
    +   \ (public-read)
    +[snip]
    +acl> 1
    +Edit advanced config? (y/n)
    +y) Yes
    +n) No (default)
    +y/n> n
    +Remote config
    +--------------------
    +[leviia]
    +- type: s3
    +- provider: Leviia
    +- access_key_id: ZnIx.xxxxxxx
    +- secret_access_key: xxxxxxxx
    +- endpoint: s3.leviia.com
    +- acl: private
    +--------------------
    +y) Yes this is OK (default)
    +e) Edit this remote
    +d) Delete this remote
    +y/e/d> y
    +Current remotes:
    +
    +Name                 Type
    +====                 ====
    +leviia                s3
    +

    Liara

    +

    Here is an example of making a Liara Object Storage configuration. First run:

    +
    rclone config
    +

    This will guide you through an interactive setup process.

    +
    No remotes found, make a new one?
    +n) New remote
    +s) Set configuration password
    +n/s> n
    +name> Liara
    +Type of storage to configure.
    +Choose a number from below, or type in your own value
    +[snip]
    +XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Liara, Minio)
    +   \ "s3"
    +[snip]
    +Storage> s3
    +Get AWS credentials from runtime (environment variables or EC2/ECS 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> YOURACCESSKEY
    +AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials.
    +secret_access_key> YOURSECRETACCESSKEY
    +Region to connect to.
    +Choose a number from below, or type in your own value
    +   / The default endpoint
    + 1 | US Region, Northern Virginia, or Pacific Northwest.
    +   | Leave location constraint empty.
    +   \ "us-east-1"
    +[snip]
    +region>
    +Endpoint for S3 API.
    +Leave blank if using Liara to use the default endpoint for the region.
    +Specify if using an S3 clone such as Ceph.
    +endpoint> storage.iran.liara.space
    +Canned ACL used when creating buckets and/or storing objects in S3.
    +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    +Choose a number from below, or type in your own value
    + 1 / Owner gets FULL_CONTROL. No one else has access rights (default).
    +   \ "private"
    +[snip]
    +acl>
    +The server-side encryption algorithm used when storing this object in S3.
    +Choose a number from below, or type in your own value
    + 1 / None
    +   \ ""
    + 2 / AES256
    +   \ "AES256"
    +server_side_encryption>
    +The storage class to use when storing objects in S3.
    +Choose a number from below, or type in your own value
    + 1 / Default
    +   \ ""
    + 2 / Standard storage class
    +   \ "STANDARD"
    +storage_class>
    +Remote config
    +--------------------
    +[Liara]
     env_auth = false
    -access_key_id =
    -secret_access_key =
    -region = us-east-1
    -endpoint =
    +access_key_id = YOURACCESSKEY
    +secret_access_key = YOURSECRETACCESSKEY
    +endpoint = storage.iran.liara.space
    +location_constraint =
    +acl =
    +server_side_encryption =
    +storage_class =
    +--------------------
    +y) Yes this is OK
    +e) Edit this remote
    +d) Delete this remote
    +y/e/d> y
    +

    This will leave the config file looking like this.

    +
    [Liara]
    +type = s3
    +provider = Liara
    +env_auth = false
    +access_key_id = YOURACCESSKEY
    +secret_access_key = YOURSECRETACCESSKEY
    +region =
    +endpoint = storage.iran.liara.space
    +location_constraint =
    +acl =
    +server_side_encryption =
    +storage_class =
    +

    Linode

    +

    Here is an example of making a Linode Object Storage configuration. First run:

    +
    rclone config
    +

    This will guide you through an interactive setup process.

    +
    No remotes found, make a new one?
    +n) New remote
    +s) Set configuration password
    +q) Quit config
    +n/s/q> n
    +
    +Enter name for new remote.
    +name> linode
    +
    +Option Storage.
    +Type of storage to configure.
    +Choose a number from below, or type in your own value.
    +[snip]
    + X / Amazon S3 Compliant Storage Providers including AWS, ...Linode, ...and others
    +   \ (s3)
    +[snip]
    +Storage> s3
    +
    +Option provider.
    +Choose your S3 provider.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +[snip]
    +XX / Linode Object Storage
    +   \ (Linode)
    +[snip]
    +provider> Linode
    +
    +Option env_auth.
    +Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false).
    +Press Enter for the default (false).
    + 1 / Enter AWS credentials in the next step.
    +   \ (false)
    + 2 / Get AWS credentials from the environment (env vars or IAM).
    +   \ (true)
    +env_auth> 
    +
    +Option access_key_id.
    +AWS Access Key ID.
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +access_key_id> ACCESS_KEY
    +
    +Option secret_access_key.
    +AWS Secret Access Key (password).
    +Leave blank for anonymous access or runtime credentials.
    +Enter a value. Press Enter to leave empty.
    +secret_access_key> SECRET_ACCESS_KEY
    +
    +Option endpoint.
    +Endpoint for Linode Object Storage API.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    + 1 / Atlanta, GA (USA), us-southeast-1
    +   \ (us-southeast-1.linodeobjects.com)
    + 2 / Chicago, IL (USA), us-ord-1
    +   \ (us-ord-1.linodeobjects.com)
    + 3 / Frankfurt (Germany), eu-central-1
    +   \ (eu-central-1.linodeobjects.com)
    + 4 / Milan (Italy), it-mil-1
    +   \ (it-mil-1.linodeobjects.com)
    + 5 / Newark, NJ (USA), us-east-1
    +   \ (us-east-1.linodeobjects.com)
    + 6 / Paris (France), fr-par-1
    +   \ (fr-par-1.linodeobjects.com)
    + 7 / Seattle, WA (USA), us-sea-1
    +   \ (us-sea-1.linodeobjects.com)
    + 8 / Singapore ap-south-1
    +   \ (ap-south-1.linodeobjects.com)
    + 9 / Stockholm (Sweden), se-sto-1
    +   \ (se-sto-1.linodeobjects.com)
    +10 / Washington, DC, (USA), us-iad-1
    +   \ (us-iad-1.linodeobjects.com)
    +endpoint> 3
    +
    +Option acl.
    +Canned ACL used when creating buckets and storing or copying objects.
    +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
    +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    +Note that this ACL is applied when server-side copying objects as S3
    +doesn't copy the ACL from the source but rather writes a fresh one.
    +If the acl is an empty string then no X-Amz-Acl: header is added and
    +the default (private) will be used.
    +Choose a number from below, or type in your own value.
    +Press Enter to leave empty.
    +   / Owner gets FULL_CONTROL.
    + 1 | No one else has access rights (default).
    +   \ (private)
    +[snip]
    +acl> 
    +
    +Edit advanced config?
    +y) Yes
    +n) No (default)
    +y/n> n
    +
    +Configuration complete.
    +Options:
    +- type: s3
    +- provider: Linode
    +- access_key_id: ACCESS_KEY
    +- secret_access_key: SECRET_ACCESS_KEY
    +- endpoint: eu-central-1.linodeobjects.com
    +Keep this "linode" remote?
    +y) Yes this is OK (default)
    +e) Edit this remote
    +d) Delete this remote
    +y/e/d> y
    +

    This will leave the config file looking like this.

    +
    [linode]
    +type = s3
    +provider = Linode
    +access_key_id = ACCESS_KEY
    +secret_access_key = SECRET_ACCESS_KEY
    +endpoint = eu-central-1.linodeobjects.com
    +

    ArvanCloud

    +

    ArvanCloud ArvanCloud Object Storage goes beyond the limited traditional file storage. It gives you access to backup and archived files and allows sharing. Files like profile image in the app, images sent by users or scanned documents can be stored securely and easily in our Object Storage service.

    +

    ArvanCloud provides an S3 interface which can be configured for use with rclone like this.

    +
    No remotes found, make a new one?
    +n) New remote
    +s) Set configuration password
    +n/s> n
    +name> ArvanCloud
    +Type of storage to configure.
    +Choose a number from below, or type in your own value
    +[snip]
    +XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Liara, Minio)
    +   \ "s3"
    +[snip]
    +Storage> s3
    +Get AWS credentials from runtime (environment variables or EC2/ECS 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> YOURACCESSKEY
    +AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials.
    +secret_access_key> YOURSECRETACCESSKEY
    +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"
    +[snip]
    +region> 
    +Endpoint for S3 API.
    +Leave blank if using ArvanCloud to use the default endpoint for the region.
    +Specify if using an S3 clone such as Ceph.
    +endpoint> s3.arvanstorage.com
    +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 Iran-Tehran Region.
    +   \ ""
    +[snip]
    +location_constraint>
    +Canned ACL used when creating buckets and/or storing objects in S3.
    +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    +Choose a number from below, or type in your own value
    + 1 / Owner gets FULL_CONTROL. No one else has access rights (default).
    +   \ "private"
    +[snip]
    +acl>
    +The server-side encryption algorithm used when storing this object in S3.
    +Choose a number from below, or type in your own value
    + 1 / None
    +   \ ""
    + 2 / AES256
    +   \ "AES256"
    +server_side_encryption>
    +The storage class to use when storing objects in S3.
    +Choose a number from below, or type in your own value
    + 1 / Default
    +   \ ""
    + 2 / Standard storage class
    +   \ "STANDARD"
    +storage_class>
    +Remote config
    +--------------------
    +[ArvanCloud]
    +env_auth = false
    +access_key_id = YOURACCESSKEY
    +secret_access_key = YOURSECRETACCESSKEY
    +region = ir-thr-at1
    +endpoint = s3.arvanstorage.com
     location_constraint =
    -acl = private
    +acl =
     server_side_encryption =
    -storage_class =
    -

    Then use it as normal with the name of the public bucket, e.g.

    -
    rclone lsd anons3:1000genomes
    -

    You will be able to list and copy data but not upload it.

    -

    Providers

    -

    AWS S3

    -

    This is the provider used as main example and described in the configuration section above.

    -

    AWS Snowball Edge

    -

    AWS Snowball is a hardware appliance used for transferring bulk data back to AWS. Its main software interface is S3 object storage.

    -

    To use rclone with AWS Snowball Edge devices, configure as standard for an 'S3 Compatible Service'.

    -

    If using rclone pre v1.59 be sure to set upload_cutoff = 0 otherwise you will run into authentication header issues as the snowball device does not support query parameter based authentication.

    -

    With rclone v1.59 or later setting upload_cutoff should not be necessary.

    -

    eg.

    -
    [snowball]
    -type = s3
    -provider = Other
    -access_key_id = YOUR_ACCESS_KEY
    -secret_access_key = YOUR_SECRET_KEY
    -endpoint = http://[IP of Snowball]:8080
    -upload_cutoff = 0
    -

    Ceph

    -

    Ceph is an open-source, unified, distributed storage system designed for excellent performance, reliability and scalability. It has an S3 compatible object storage interface.

    -

    To use rclone with Ceph, configure as above but leave the region blank and set the endpoint. You should end up with something like this in your config:

    -
    [ceph]
    +storage_class =
    +--------------------
    +y) Yes this is OK
    +e) Edit this remote
    +d) Delete this remote
    +y/e/d> y
    +

    This will leave the config file looking like this.

    +
    [ArvanCloud]
     type = s3
    -provider = Ceph
    +provider = ArvanCloud
     env_auth = false
    -access_key_id = XXX
    -secret_access_key = YYY
    +access_key_id = YOURACCESSKEY
    +secret_access_key = YOURSECRETACCESSKEY
     region =
    -endpoint = https://ceph.endpoint.example.com
    +endpoint = s3.arvanstorage.com
     location_constraint =
     acl =
     server_side_encryption =
     storage_class =
    -

    If you are using an older version of CEPH (e.g. 10.2.x Jewel) and a version of rclone before v1.59 then you may need to supply the parameter --s3-upload-cutoff 0 or put this in the config file as upload_cutoff 0 to work around a bug which causes uploading of small files to fail.

    -

    Note also that Ceph sometimes puts / in the passwords it gives users. If you read the secret access key using the command line tools you will get a JSON blob with the / escaped as \/. Make sure you only write / in the secret access key.

    -

    Eg the dump from Ceph looks something like this (irrelevant keys removed).

    -
    {
    -    "user_id": "xxx",
    -    "display_name": "xxxx",
    -    "keys": [
    -        {
    -            "user": "xxx",
    -            "access_key": "xxxxxx",
    -            "secret_key": "xxxxxx\/xxxx"
    -        }
    -    ],
    -}
    -

    Because this is a json dump, it is encoding the / as \/, so if you use the secret key as xxxxxx/xxxx it will work fine.

    -

    Cloudflare R2

    -

    Cloudflare R2 Storage allows developers to store large amounts of unstructured data without the costly egress bandwidth fees associated with typical cloud storage services.

    -

    Here is an example of making a Cloudflare R2 configuration. First run:

    -
    rclone config
    +

    Tencent COS

    +

    Tencent Cloud Object Storage (COS) is a distributed storage service offered by Tencent Cloud for unstructured data. It is secure, stable, massive, convenient, low-delay and low-cost.

    +

    To configure access to Tencent COS, follow the steps below:

    +
      +
    1. Run rclone config and select n for a new remote.
    2. +
    +
    rclone config
    +No remotes found, make a new one?
    +n) New remote
    +s) Set configuration password
    +q) Quit config
    +n/s/q> n
    +
      +
    1. Give the name of the configuration. For example, name it 'cos'.
    2. +
    +
    name> cos
    +
      +
    1. Select s3 storage.
    2. +
    +
    Choose a number from below, or type in your own value
    +1 / 1Fichier
    +   \ "fichier"
    + 2 / Alias for an existing remote
    +   \ "alias"
    + 3 / Amazon Drive
    +   \ "amazon cloud drive"
    + 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Minio, and Tencent COS
    +   \ "s3"
    +[snip]
    +Storage> s3
    +
      +
    1. Select TencentCOS provider.
    2. +
    +
    Choose a number from below, or type in your own value
    +1 / Amazon Web Services (AWS) S3
    +   \ "AWS"
    +[snip]
    +11 / Tencent Cloud Object Storage (COS)
    +   \ "TencentCOS"
    +[snip]
    +provider> TencentCOS
    +
      +
    1. Enter your SecretId and SecretKey of Tencent Cloud.
    2. +
    +
    Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    +Only applies if access_key_id and secret_access_key is blank.
    +Enter a boolean value (true or false). Press Enter for the default ("false").
    +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.
    +Enter a string value. Press Enter for the default ("").
    +access_key_id> AKIDxxxxxxxxxx
    +AWS Secret Access Key (password)
    +Leave blank for anonymous access or runtime credentials.
    +Enter a string value. Press Enter for the default ("").
    +secret_access_key> xxxxxxxxxxx
    +
      +
    1. Select endpoint for Tencent COS. This is the standard endpoint for different region.
    2. +
    +
     1 / Beijing Region.
    +   \ "cos.ap-beijing.myqcloud.com"
    + 2 / Nanjing Region.
    +   \ "cos.ap-nanjing.myqcloud.com"
    + 3 / Shanghai Region.
    +   \ "cos.ap-shanghai.myqcloud.com"
    + 4 / Guangzhou Region.
    +   \ "cos.ap-guangzhou.myqcloud.com"
    +[snip]
    +endpoint> 4
    +
      +
    1. Choose acl and storage class.
    2. +
    +
    Note that this ACL is applied when server-side copying objects as S3
    +doesn't copy the ACL from the source but rather writes a fresh one.
    +Enter a string value. Press Enter for the default ("").
    +Choose a number from below, or type in your own value
    + 1 / Owner gets Full_CONTROL. No one else has access rights (default).
    +   \ "default"
    +[snip]
    +acl> 1
    +The storage class to use when storing new objects in Tencent COS.
    +Enter a string value. Press Enter for the default ("").
    +Choose a number from below, or type in your own value
    + 1 / Default
    +   \ ""
    +[snip]
    +storage_class> 1
    +Edit advanced config? (y/n)
    +y) Yes
    +n) No (default)
    +y/n> n
    +Remote config
    +--------------------
    +[cos]
    +type = s3
    +provider = TencentCOS
    +env_auth = false
    +access_key_id = xxx
    +secret_access_key = xxx
    +endpoint = cos.ap-guangzhou.myqcloud.com
    +acl = default
    +--------------------
    +y) Yes this is OK (default)
    +e) Edit this remote
    +d) Delete this remote
    +y/e/d> y
    +Current remotes:
    +
    +Name                 Type
    +====                 ====
    +cos                  s3
    +

    Netease NOS

    +

    For Netease NOS configure as per the configurator rclone config setting the provider Netease. This will automatically set force_path_style = false which is necessary for it to run properly.

    +

    Petabox

    +

    Here is an example of making a Petabox configuration. First run:

    +
    rclone config

    This will guide you through an interactive setup process.

    -

    Note that all buckets are private, and all are stored in the same "auto" region. It is necessary to use Cloudflare workers to share the content of a bucket publicly.

    No remotes found, make a new one?
     n) New remote
     s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> r2
    +n/s> n
    +
    +Enter name for new remote.
    +name> My Petabox Storage
    +
     Option Storage.
     Type of storage to configure.
     Choose a number from below, or type in your own value.
    -...
    -XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi
    -   \ (s3)
    -...
    +[snip]
    +XX / Amazon S3 Compliant Storage Providers including AWS, ...
    +   \ "s3"
    +[snip]
     Storage> s3
    +
     Option provider.
     Choose your S3 provider.
     Choose a number from below, or type in your own value.
     Press Enter to leave empty.
    -...
    -XX / Cloudflare R2 Storage
    -   \ (Cloudflare)
    -...
    -provider> Cloudflare
    +[snip]
    +XX / Petabox Object Storage
    +   \ (Petabox)
    +[snip]
    +provider> Petabox
    +
     Option env_auth.
     Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
     Only applies if access_key_id and secret_access_key is blank.
    @@ -16309,137 +16967,116 @@ 

    Cloudflare R2

    2 / Get AWS credentials from the environment (env vars or IAM). \ (true) env_auth> 1 + Option access_key_id. AWS Access Key ID. Leave blank for anonymous access or runtime credentials. Enter a value. Press Enter to leave empty. -access_key_id> ACCESS_KEY +access_key_id> YOUR_ACCESS_KEY_ID + Option secret_access_key. AWS Secret Access Key (password). Leave blank for anonymous access or runtime credentials. Enter a value. Press Enter to leave empty. -secret_access_key> SECRET_ACCESS_KEY +secret_access_key> YOUR_SECRET_ACCESS_KEY + Option region. -Region to connect to. +Region where your bucket will be created and your data stored. Choose a number from below, or type in your own value. Press Enter to leave empty. - 1 / R2 buckets are automatically distributed across Cloudflare's data centers for low latency. - \ (auto) + 1 / US East (N. Virginia) + \ (us-east-1) + 2 / Europe (Frankfurt) + \ (eu-central-1) + 3 / Asia Pacific (Singapore) + \ (ap-southeast-1) + 4 / Middle East (Bahrain) + \ (me-south-1) + 5 / South America (São Paulo) + \ (sa-east-1) region> 1 + Option endpoint. -Endpoint for S3 API. -Required when using an S3 clone. -Enter a value. Press Enter to leave empty. -endpoint> https://ACCOUNT_ID.r2.cloudflarestorage.com +Endpoint for Petabox S3 Object Storage. +Specify the endpoint from the same region. +Choose a number from below, or type in your own value. + 1 / US East (N. Virginia) + \ (s3.petabox.io) + 2 / US East (N. Virginia) + \ (s3.us-east-1.petabox.io) + 3 / Europe (Frankfurt) + \ (s3.eu-central-1.petabox.io) + 4 / Asia Pacific (Singapore) + \ (s3.ap-southeast-1.petabox.io) + 5 / Middle East (Bahrain) + \ (s3.me-south-1.petabox.io) + 6 / South America (São Paulo) + \ (s3.sa-east-1.petabox.io) +endpoint> 1 + +Option acl. +Canned ACL used when creating buckets and storing or copying objects. +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. +If the acl is an empty string then no X-Amz-Acl: header is added and +the default (private) will be used. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + / Owner gets FULL_CONTROL. + 2 | The AllUsers group gets READ access. + \ (public-read) + / Owner gets FULL_CONTROL. + 3 | The AllUsers group gets READ and WRITE access. + | Granting this on a bucket is generally not recommended. + \ (public-read-write) + / Owner gets FULL_CONTROL. + 4 | The AuthenticatedUsers group gets READ access. + \ (authenticated-read) + / Object owner gets FULL_CONTROL. + 5 | Bucket owner gets READ access. + | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \ (bucket-owner-read) + / Both the object owner and the bucket owner get FULL_CONTROL over the object. + 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \ (bucket-owner-full-control) +acl> 1 + Edit advanced config? y) Yes n) No (default) -y/n> n --------------------- +y/n> No + +Configuration complete. +Options: +- type: s3 +- provider: Petabox +- access_key_id: YOUR_ACCESS_KEY_ID +- secret_access_key: YOUR_SECRET_ACCESS_KEY +- region: us-east-1 +- endpoint: s3.petabox.io +Keep this "My Petabox Storage" remote? y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y
    -

    This will leave your config looking something like:

    -
    [r2]
    -type = s3
    -provider = Cloudflare
    -access_key_id = ACCESS_KEY
    -secret_access_key = SECRET_ACCESS_KEY
    -region = auto
    -endpoint = https://ACCOUNT_ID.r2.cloudflarestorage.com
    -acl = private
    -

    Now run rclone lsf r2: to see your buckets and rclone lsf r2:bucket to look within a bucket.

    -

    Dreamhost

    -

    Dreamhost DreamObjects is an object storage system based on CEPH.

    -

    To use rclone with Dreamhost, configure as above but leave the region blank and set the endpoint. You should end up with something like this in your config:

    -
    [dreamobjects]
    -type = s3
    -provider = DreamHost
    -env_auth = false
    -access_key_id = your_access_key
    -secret_access_key = your_secret_key
    -region =
    -endpoint = objects-us-west-1.dream.io
    -location_constraint =
    -acl = private
    -server_side_encryption =
    -storage_class =
    -

    Google Cloud Storage

    -

    GoogleCloudStorage is an S3-interoperable object storage service from Google Cloud Platform.

    -

    To connect to Google Cloud Storage you will need an access key and secret key. These can be retrieved by creating an HMAC key.

    -
    [gs]
    -type = s3
    -provider = GCS
    -access_key_id = your_access_key
    -secret_access_key = your_secret_key
    -endpoint = https://storage.googleapis.com
    -

    DigitalOcean Spaces

    -

    Spaces is an S3-interoperable object storage service from cloud provider DigitalOcean.

    -

    To connect to DigitalOcean Spaces you will need an access key and secret key. These can be retrieved on the "Applications & API" page of the DigitalOcean control panel. They will be needed when prompted by rclone config for your access_key_id and secret_access_key.

    -

    When prompted for a region or location_constraint, press enter to use the default value. The region must be included in the endpoint setting (e.g. nyc3.digitaloceanspaces.com). The default values can be used for other settings.

    -

    Going through the whole process of creating a new remote by running rclone config, each prompt should be answered as shown below:

    -
    Storage> s3
    -env_auth> 1
    -access_key_id> YOUR_ACCESS_KEY
    -secret_access_key> YOUR_SECRET_KEY
    -region>
    -endpoint> nyc3.digitaloceanspaces.com
    -location_constraint>
    -acl>
    -storage_class>
    -

    The resulting configuration file should look like:

    -
    [spaces]
    -type = s3
    -provider = DigitalOcean
    -env_auth = false
    -access_key_id = YOUR_ACCESS_KEY
    -secret_access_key = YOUR_SECRET_KEY
    -region =
    -endpoint = nyc3.digitaloceanspaces.com
    -location_constraint =
    -acl =
    -server_side_encryption =
    -storage_class =
    -

    Once configured, you can create a new Space and begin copying files. For example:

    -
    rclone mkdir spaces:my-new-space
    -rclone copy /path/to/files spaces:my-new-space
    -

    Huawei OBS

    -

    Object Storage Service (OBS) provides stable, secure, efficient, and easy-to-use cloud storage that lets you store virtually any volume of unstructured data in any format and access it from anywhere.

    -

    OBS provides an S3 interface, you can copy and modify the following configuration and add it to your rclone configuration file.

    -
    [obs]
    +

    This will leave the config file looking like this.

    +
    [My Petabox Storage]
     type = s3
    -provider = HuaweiOBS
    -access_key_id = your-access-key-id
    -secret_access_key = your-secret-access-key
    -region = af-south-1
    -endpoint = obs.af-south-1.myhuaweicloud.com
    -acl = private
    -

    Or you can also configure via the interactive command line:

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> obs
    -Option Storage.
    -Type of storage to configure.
    -Choose a number from below, or type in your own value.
    -[snip]
    - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi
    -   \ (s3)
    -[snip]
    -Storage> 5
    -Option provider.
    -Choose your S3 provider.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -[snip]
    - 9 / Huawei Object Storage Service
    -   \ (HuaweiOBS)
    -[snip]
    -provider> 9
    -Option env_auth.
    +provider = Petabox
    +access_key_id = YOUR_ACCESS_KEY_ID
    +secret_access_key = YOUR_SECRET_ACCESS_KEY
    +region = us-east-1
    +endpoint = s3.petabox.io
    +

    Storj

    +

    Storj is a decentralized cloud storage which can be used through its native protocol or an S3 compatible gateway.

    +

    The S3 compatible gateway is configured using rclone config with a type of s3 and with a provider name of Storj. Here is an example run of the configurator.

    +
    Type of storage to configure.
    +Storage> s3
     Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false).
    @@ -16453,5857 +17090,5131 @@ 

    Huawei OBS

    AWS Access Key ID. Leave blank for anonymous access or runtime credentials. Enter a value. Press Enter to leave empty. -access_key_id> your-access-key-id +access_key_id> XXXX (as shown when creating the access grant) Option secret_access_key. AWS Secret Access Key (password). Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -secret_access_key> your-secret-access-key -Option region. -Region to connect to. +Enter a value. Press Enter to leave empty. +secret_access_key> XXXX (as shown when creating the access grant) +Option endpoint. +Endpoint of the Shared Gateway. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / EU1 Shared Gateway + \ (gateway.eu1.storjshare.io) + 2 / US1 Shared Gateway + \ (gateway.us1.storjshare.io) + 3 / Asia-Pacific Shared Gateway + \ (gateway.ap1.storjshare.io) +endpoint> 1 (as shown when creating the access grant) +Edit advanced config? +y) Yes +n) No (default) +y/n> n
    +

    Note that s3 credentials are generated when you create an access grant.

    +

    Backend quirks

    +
      +
    • --chunk-size is forced to be 64 MiB or greater. This will use more memory than the default of 5 MiB.
    • +
    • Server side copy is disabled as it isn't currently supported in the gateway.
    • +
    • GetTier and SetTier are not supported.
    • +
    +

    Backend bugs

    +

    Due to issue #39 uploading multipart files via the S3 gateway causes them to lose their metadata. For rclone's purpose this means that the modification time is not stored, nor is any MD5SUM (if one is available from the source).

    +

    This has the following consequences:

    +
      +
    • Using rclone rcat will fail as the medatada doesn't match after upload
    • +
    • Uploading files with rclone mount will fail for the same reason +
        +
      • This can worked around by using --vfs-cache-mode writes or --vfs-cache-mode full or setting --s3-upload-cutoff large
      • +
    • +
    • Files uploaded via a multipart upload won't have their modtimes +
        +
      • This will mean that rclone sync will likely keep trying to upload files bigger than --s3-upload-cutoff
      • +
      • This can be worked around with --checksum or --size-only or setting --s3-upload-cutoff large
      • +
      • The maximum value for --s3-upload-cutoff is 5GiB though
      • +
    • +
    +

    One general purpose workaround is to set --s3-upload-cutoff 5G. This means that rclone will upload files smaller than 5GiB as single parts. Note that this can be set in the config file with upload_cutoff = 5G or configured in the advanced settings. If you regularly transfer files larger than 5G then using --checksum or --size-only in rclone sync is the recommended workaround.

    +

    Comparison with the native protocol

    +

    Use the the native protocol to take advantage of client-side encryption as well as to achieve the best possible download performance. Uploads will be erasure-coded locally, thus a 1gb upload will result in 2.68gb of data being uploaded to storage nodes across the network.

    +

    Use this backend and the S3 compatible Hosted Gateway to increase upload performance and reduce the load on your systems and network. Uploads will be encrypted and erasure-coded server-side, thus a 1GB upload will result in only in 1GB of data being uploaded to storage nodes across the network.

    +

    For more detailed comparison please check the documentation of the storj backend.

    +

    Limitations

    +

    rclone about is not supported by the S3 backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.

    +

    See List of backends that do not support rclone about and rclone about

    +

    Synology C2 Object Storage

    +

    Synology C2 Object Storage provides a secure, S3-compatible, and cost-effective cloud storage solution without API request, download fees, and deletion penalty.

    +

    The S3 compatible gateway is configured using rclone config with a type of s3 and with a provider name of Synology. Here is an example run of the configurator.

    +

    First run:

    +
    rclone config
    +

    This will guide you through an interactive setup process.

    +
    No remotes found, make a new one?
    +n) New remote
    +s) Set configuration password
    +q) Quit config
    +
    +n/s/q> n
    +
    +Enter name for new remote.1
    +name> syno
    +
    +Type of storage to configure.
    +Enter a string value. Press Enter for the default ("").
    +Choose a number from below, or type in your own value
    +
    + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, GCS, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi
    +   \ "s3"
    +
    +Storage> s3
    +
    +Choose your S3 provider.
    +Enter a string value. Press Enter for the default ("").
    +Choose a number from below, or type in your own value
    + 24 / Synology C2 Object Storage
    +   \ (Synology)
    +
    +provider> Synology
    +
    +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    +Only applies if access_key_id and secret_access_key is blank.
    +Enter a boolean value (true or false). Press Enter for the default ("false").
    +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.
    +Enter a string value. Press Enter for the default ("").
    +
    +access_key_id> accesskeyid
    +
    +AWS Secret Access Key (password)
    +Leave blank for anonymous access or runtime credentials.
    +Enter a string value. Press Enter for the default ("").
    +
    +secret_access_key> secretaccesskey
    +
    +Region where your data stored.
     Choose a number from below, or type in your own value.
     Press Enter to leave empty.
    - 1 / AF-Johannesburg
    -   \ (af-south-1)
    - 2 / AP-Bangkok
    -   \ (ap-southeast-2)
    -[snip]
    -region> 1
    + 1 / Europe Region 1
    +   \ (eu-001)
    + 2 / Europe Region 2
    +   \ (eu-002)
    + 3 / US Region 1
    +   \ (us-001)
    + 4 / US Region 2
    +   \ (us-002)
    + 5 / Asia (Taiwan)
    +   \ (tw-001)
    +
    +region > 1
    +
     Option endpoint.
    -Endpoint for OBS API.
    +Endpoint for Synology C2 Object Storage API.
     Choose a number from below, or type in your own value.
     Press Enter to leave empty.
    - 1 / AF-Johannesburg
    -   \ (obs.af-south-1.myhuaweicloud.com)
    - 2 / AP-Bangkok
    -   \ (obs.ap-southeast-2.myhuaweicloud.com)
    -[snip]
    + 1 / EU Endpoint 1
    +   \ (eu-001.s3.synologyc2.net)
    + 2 / US Endpoint 1
    +   \ (us-001.s3.synologyc2.net)
    + 3 / TW Endpoint 1
    +   \ (tw-001.s3.synologyc2.net)
    +
     endpoint> 1
    -Option acl.
    -Canned ACL used when creating buckets and storing or copying objects.
    -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
    -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    -Note that this ACL is applied when server-side copying objects as S3
    -doesn't copy the ACL from the source but rather writes a fresh one.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -   / Owner gets FULL_CONTROL.
    - 1 | No one else has access rights (default).
    -   \ (private)
    -[snip]
    -acl> 1
    -Edit advanced config?
    +
    +Option location_constraint.
    +Location constraint - must be set to match the Region.
    +Leave blank if not sure. Used when creating buckets only.
    +Enter a value. Press Enter to leave empty.
    +location_constraint>
    +
    +Edit advanced config? (y/n)
     y) Yes
    -n) No (default)
    -y/n>
    ---------------------
    -[obs]
    -type = s3
    -provider = HuaweiOBS
    -access_key_id = your-access-key-id
    -secret_access_key = your-secret-access-key
    -region = af-south-1
    -endpoint = obs.af-south-1.myhuaweicloud.com
    -acl = private
    ---------------------
    +n) No
    +y/n> y
    +
    +Option no_check_bucket.
    +If set, don't attempt to check the bucket exists or create it.
    +This can be useful when trying to minimise the number of transactions
    +rclone does if you know the bucket exists already.
    +It can also be needed if the user you are using does not have bucket
    +creation permissions. Before v1.52.0 this would have passed silently
    +due to a bug.
    +Enter a boolean value (true or false). Press Enter for the default (true).
    +
    +no_check_bucket> true
    +
    +Configuration complete.
    +Options:
    +- type: s3
    +- provider: Synology
    +- region: eu-001
    +- endpoint: eu-001.s3.synologyc2.net
    +- no_check_bucket: true
    +Keep this "syno" remote?
     y) Yes this is OK (default)
     e) Edit this remote
     d) Delete this remote
    +
     y/e/d> y
    -Current remotes:
     
    -Name                 Type
    -====                 ====
    -obs                  s3
    +#  Backblaze B2
     
    -e) Edit existing remote
    -n) New remote
    -d) Delete remote
    -r) Rename remote
    -c) Copy remote
    -s) Set configuration password
    -q) Quit config
    -e/n/d/r/c/s/q> q
    -

    IBM COS (S3)

    -

    Information stored with IBM Cloud Object Storage is encrypted and dispersed across multiple geographic locations, and accessed through an implementation of the S3 API. This service makes use of the distributed storage technologies provided by IBM’s Cloud Object Storage System (formerly Cleversafe). For more information visit: (http://www.ibm.com/cloud/object-storage)

    -

    To configure access to IBM COS S3, follow the steps below:

    -
      -
    1. Run rclone config and select n for a new remote.
    2. -
    -
        2018/02/14 14:13:11 NOTICE: Config file "C:\\Users\\a\\.config\\rclone\\rclone.conf" not found - using defaults
    -    No remotes found, make a new one?
    -    n) New remote
    -    s) Set configuration password
    -    q) Quit config
    -    n/s/q> n
    -
      -
    1. Enter the name for the configuration
    2. -
    -
        name> <YOUR NAME>
    -
      -
    1. Select "s3" storage.
    2. -
    -
    Choose a number from below, or type in your own value
    -    1 / Alias for an existing remote
    -    \ "alias"
    -    2 / Amazon Drive
    -    \ "amazon cloud drive"
    -    3 / Amazon S3 Complaint Storage Providers (Dreamhost, Ceph, ChinaMobile, Liara, ArvanCloud, Minio, IBM COS)
    -    \ "s3"
    -    4 / Backblaze B2
    -    \ "b2"
    -[snip]
    -    23 / HTTP
    -    \ "http"
    -Storage> 3
    -
      -
    1. Select IBM COS as the S3 Storage Provider.
    2. -
    -
    Choose the S3 provider.
    -Choose a number from below, or type in your own value
    -     1 / Choose this option to configure Storage to AWS S3
    -       \ "AWS"
    -     2 / Choose this option to configure Storage to Ceph Systems
    -     \ "Ceph"
    -     3 /  Choose this option to configure Storage to Dreamhost
    -     \ "Dreamhost"
    -   4 / Choose this option to the configure Storage to IBM COS S3
    -     \ "IBMCOS"
    -     5 / Choose this option to the configure Storage to Minio
    -     \ "Minio"
    -     Provider>4
    -
      -
    1. Enter the Access Key and Secret.
    2. -
    -
        AWS Access Key ID - leave blank for anonymous access or runtime credentials.
    -    access_key_id> <>
    -    AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials.
    -    secret_access_key> <>
    -
      -
    1. Specify the endpoint for IBM COS. For Public IBM COS, choose from the option below. For On Premise IBM COS, enter an endpoint address.
    2. -
    -
        Endpoint for IBM COS S3 API.
    -    Specify if using an IBM COS On Premise.
    -    Choose a number from below, or type in your own value
    -     1 / US Cross Region Endpoint
    -       \ "s3-api.us-geo.objectstorage.softlayer.net"
    -     2 / US Cross Region Dallas Endpoint
    -       \ "s3-api.dal.us-geo.objectstorage.softlayer.net"
    -     3 / US Cross Region Washington DC Endpoint
    -       \ "s3-api.wdc-us-geo.objectstorage.softlayer.net"
    -     4 / US Cross Region San Jose Endpoint
    -       \ "s3-api.sjc-us-geo.objectstorage.softlayer.net"
    -     5 / US Cross Region Private Endpoint
    -       \ "s3-api.us-geo.objectstorage.service.networklayer.com"
    -     6 / US Cross Region Dallas Private Endpoint
    -       \ "s3-api.dal-us-geo.objectstorage.service.networklayer.com"
    -     7 / US Cross Region Washington DC Private Endpoint
    -       \ "s3-api.wdc-us-geo.objectstorage.service.networklayer.com"
    -     8 / US Cross Region San Jose Private Endpoint
    -       \ "s3-api.sjc-us-geo.objectstorage.service.networklayer.com"
    -     9 / US Region East Endpoint
    -       \ "s3.us-east.objectstorage.softlayer.net"
    -    10 / US Region East Private Endpoint
    -       \ "s3.us-east.objectstorage.service.networklayer.com"
    -    11 / US Region South Endpoint
    -[snip]
    -    34 / Toronto Single Site Private Endpoint
    -       \ "s3.tor01.objectstorage.service.networklayer.com"
    -    endpoint>1
    -
      -
    1. Specify a IBM COS Location Constraint. The location constraint must match endpoint when using IBM Cloud Public. For on-prem COS, do not make a selection from this list, hit enter
    2. -
    -
         1 / US Cross Region Standard
    -       \ "us-standard"
    -     2 / US Cross Region Vault
    -       \ "us-vault"
    -     3 / US Cross Region Cold
    -       \ "us-cold"
    -     4 / US Cross Region Flex
    -       \ "us-flex"
    -     5 / US East Region Standard
    -       \ "us-east-standard"
    -     6 / US East Region Vault
    -       \ "us-east-vault"
    -     7 / US East Region Cold
    -       \ "us-east-cold"
    -     8 / US East Region Flex
    -       \ "us-east-flex"
    -     9 / US South Region Standard
    -       \ "us-south-standard"
    -    10 / US South Region Vault
    -       \ "us-south-vault"
    -[snip]
    -    32 / Toronto Flex
    -       \ "tor01-flex"
    -location_constraint>1
    -
      -
    1. Specify a canned ACL. IBM Cloud (Storage) supports "public-read" and "private". IBM Cloud(Infra) supports all the canned ACLs. On-Premise COS supports all the canned ACLs.
    2. -
    -
    Canned ACL used when creating buckets and/or storing objects in S3.
    -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    -Choose a number from below, or type in your own value
    -      1 / Owner gets FULL_CONTROL. No one else has access rights (default). This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise COS
    -      \ "private"
    -      2  / Owner gets FULL_CONTROL. The AllUsers group gets READ access. This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise IBM COS
    -      \ "public-read"
    -      3 / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. This acl is available on IBM Cloud (Infra), On-Premise IBM COS
    -      \ "public-read-write"
    -      4  / Owner gets FULL_CONTROL. The AuthenticatedUsers group gets READ access. Not supported on Buckets. This acl is available on IBM Cloud (Infra) and On-Premise IBM COS
    -      \ "authenticated-read"
    -acl> 1
    -
      -
    1. Review the displayed configuration and accept to save the "remote" then quit. The config file should look like this
    2. -
    -
        [xxx]
    -    type = s3
    -    Provider = IBMCOS
    -    access_key_id = xxx
    -    secret_access_key = yyy
    -    endpoint = s3-api.us-geo.objectstorage.softlayer.net
    -    location_constraint = us-standard
    -    acl = private
    -
      -
    1. Execute rclone commands
    2. -
    -
        1)  Create a bucket.
    -        rclone mkdir IBM-COS-XREGION:newbucket
    -    2)  List available buckets.
    -        rclone lsd IBM-COS-XREGION:
    -        -1 2017-11-08 21:16:22        -1 test
    -        -1 2018-02-14 20:16:39        -1 newbucket
    -    3)  List contents of a bucket.
    -        rclone ls IBM-COS-XREGION:newbucket
    -        18685952 test.exe
    -    4)  Copy a file from local to remote.
    -        rclone copy /Users/file.txt IBM-COS-XREGION:newbucket
    -    5)  Copy a file from remote to local.
    -        rclone copy IBM-COS-XREGION:newbucket/file.txt .
    -    6)  Delete a file on remote.
    -        rclone delete IBM-COS-XREGION:newbucket/file.txt
    -

    IDrive e2

    -

    Here is an example of making an IDrive e2 configuration. First run:

    -
    rclone config
    -

    This will guide you through an interactive setup process.

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    +B2 is [Backblaze's cloud storage system](https://www.backblaze.com/b2/).
    +
    +Paths are specified as `remote:bucket` (or `remote:` for the `lsd`
    +command.)  You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`.
    +
    +## Configuration
    +
    +Here is an example of making a b2 configuration.  First run
    +
    +    rclone config
    +
    +This will guide you through an interactive setup process.  To authenticate
    +you will either need your Account ID (a short hex number) and Master
    +Application Key (a long hex number) OR an Application Key, which is the
    +recommended method. See below for further details on generating and using
    +an Application Key.
    +
    +

    No remotes found, make a new one? n) New remote q) Quit config n/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Backblaze B2  "b2" [snip] Storage> b2 Account ID or Application Key ID account> 123456789abc Application Key key> 0123456789abcdef0123456789abcdef0123456789 Endpoint for the service - leave blank normally. endpoint> Remote config -------------------- [remote] account = 123456789abc key = 0123456789abcdef0123456789abcdef0123456789 endpoint = -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

    +
    
    +This remote is called `remote` and can now be used like this
    +
    +See all buckets
    +
    +    rclone lsd remote:
    +
    +Create a new bucket
    +
    +    rclone mkdir remote:bucket
    +
    +List the contents of a bucket
    +
    +    rclone ls remote:bucket
    +
    +Sync `/home/local/directory` to the remote bucket, deleting any
    +excess files in the bucket.
    +
    +    rclone sync --interactive /home/local/directory remote:bucket
    +
    +### Application Keys
    +
    +B2 supports multiple [Application Keys for different access permission
    +to B2 Buckets](https://www.backblaze.com/b2/docs/application_keys.html).
    +
    +You can use these with rclone too; you will need to use rclone version 1.43
    +or later.
    +
    +Follow Backblaze's docs to create an Application Key with the required
    +permission and add the `applicationKeyId` as the `account` and the
    +`Application Key` itself as the `key`.
    +
    +Note that you must put the _applicationKeyId_ as the `account` – you
    +can't use the master Account ID.  If you try then B2 will return 401
    +errors.
    +
    +### --fast-list
    +
    +This remote supports `--fast-list` which allows you to use fewer
    +transactions in exchange for more memory. See the [rclone
    +docs](https://rclone.org/docs/#fast-list) for more details.
    +
    +### Modification times
    +
    +The modification time is stored as metadata on the object as
    +`X-Bz-Info-src_last_modified_millis` as milliseconds since 1970-01-01
    +in the Backblaze standard.  Other tools should be able to use this as
    +a modified time.
    +
    +Modified times are used in syncing and are fully supported. Note that
    +if a modification time needs to be updated on an object then it will
    +create a new version of the object.
    +
    +### Restricted filename characters
    +
    +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
    +the following characters are also replaced:
    +
    +| Character | Value | Replacement |
    +| --------- |:-----:|:-----------:|
    +| \         | 0x5C  | \           |
    +
    +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
    +as they can't be used in JSON strings.
    +
    +Note that in 2020-05 Backblaze started allowing \ characters in file
    +names. Rclone hasn't changed its encoding as this could cause syncs to
    +re-transfer files. If you want rclone not to replace \ then see the
    +`--b2-encoding` flag below and remove the `BackSlash` from the
    +string. This can be set in the config.
    +
    +### SHA1 checksums
    +
    +The SHA1 checksums of the files are checked on upload and download and
    +will be used in the syncing process.
    +
    +Large files (bigger than the limit in `--b2-upload-cutoff`) which are
    +uploaded in chunks will store their SHA1 on the object as
    +`X-Bz-Info-large_file_sha1` as recommended by Backblaze.
    +
    +For a large file to be uploaded with an SHA1 checksum, the source
    +needs to support SHA1 checksums. The local disk supports SHA1
    +checksums so large file transfers from local disk will have an SHA1.
    +See [the overview](https://rclone.org/overview/#features) for exactly which remotes
    +support SHA1.
    +
    +Sources which don't support SHA1, in particular `crypt` will upload
    +large files without SHA1 checksums.  This may be fixed in the future
    +(see [#1767](https://github.com/rclone/rclone/issues/1767)).
    +
    +Files sizes below `--b2-upload-cutoff` will always have an SHA1
    +regardless of the source.
    +
    +### Transfers
    +
    +Backblaze recommends that you do lots of transfers simultaneously for
    +maximum speed.  In tests from my SSD equipped laptop the optimum
    +setting is about `--transfers 32` though higher numbers may be used
    +for a slight speed improvement. The optimum number for you may vary
    +depending on your hardware, how big the files are, how much you want
    +to load your computer, etc.  The default of `--transfers 4` is
    +definitely too low for Backblaze B2 though.
    +
    +Note that uploading big files (bigger than 200 MiB by default) will use
    +a 96 MiB RAM buffer by default.  There can be at most `--transfers` of
    +these in use at any moment, so this sets the upper limit on the memory
    +used.
    +
    +### Versions
    +
    +When rclone uploads a new version of a file it creates a [new version
    +of it](https://www.backblaze.com/b2/docs/file_versions.html).
    +Likewise when you delete a file, the old version will be marked hidden
    +and still be available.  Conversely, you may opt in to a "hard delete"
    +of files with the `--b2-hard-delete` flag which would permanently remove
    +the file instead of hiding it.
    +
    +Old versions of files, where available, are visible using the 
    +`--b2-versions` flag.
    +
    +It is also possible to view a bucket as it was at a certain point in time,
    +using the `--b2-version-at` flag. This will show the file versions as they
    +were at that time, showing files that have been deleted afterwards, and
    +hiding files that were created since.
    +
    +If you wish to remove all the old versions then you can use the
    +`rclone cleanup remote:bucket` command which will delete all the old
    +versions of files, leaving the current ones intact.  You can also
    +supply a path and only old versions under that path will be deleted,
    +e.g. `rclone cleanup remote:bucket/path/to/stuff`.
    +
    +Note that `cleanup` will remove partially uploaded files from the bucket
    +if they are more than a day old.
    +
    +When you `purge` a bucket, the current and the old versions will be
    +deleted then the bucket will be deleted.
    +
    +However `delete` will cause the current versions of the files to
    +become hidden old versions.
    +
    +Here is a session showing the listing and retrieval of an old
    +version followed by a `cleanup` of the old versions.
    +
    +Show current version and all the versions with `--b2-versions` flag.
    +
    +

    $ rclone -q ls b2:cleanup-test 9 one.txt

    +

    $ rclone -q --b2-versions ls b2:cleanup-test 9 one.txt 8 one-v2016-07-04-141032-000.txt 16 one-v2016-07-04-141003-000.txt 15 one-v2016-07-02-155621-000.txt

    +
    
    +Retrieve an old version
    +
    +

    $ rclone -q --b2-versions copy b2:cleanup-test/one-v2016-07-04-141003-000.txt /tmp

    +

    $ ls -l /tmp/one-v2016-07-04-141003-000.txt -rw-rw-r-- 1 ncw ncw 16 Jul 2 17:46 /tmp/one-v2016-07-04-141003-000.txt

    +
    
    +Clean up all the old versions and show that they've gone.
    +
    +

    $ rclone -q cleanup b2:cleanup-test

    +

    $ rclone -q ls b2:cleanup-test 9 one.txt

    +

    $ rclone -q --b2-versions ls b2:cleanup-test 9 one.txt

    +
    
    +#### Versions naming caveat
    +
    +When using `--b2-versions` flag rclone is relying on the file name
    +to work out whether the objects are versions or not. Versions' names
    +are created by inserting timestamp between file name and its extension.
    +
        9 file.txt
    +    8 file-v2023-07-17-161032-000.txt
    +   16 file-v2023-06-15-141003-000.txt
    +
    If there are real files present with the same names as versions, then
    +behaviour of `--b2-versions` can be unpredictable.
    +
    +### Data usage
    +
    +It is useful to know how many requests are sent to the server in different scenarios.
    +
    +All copy commands send the following 4 requests:
    +
    +

    /b2api/v1/b2_authorize_account /b2api/v1/b2_create_bucket /b2api/v1/b2_list_buckets /b2api/v1/b2_list_file_names

    +
    
    +The `b2_list_file_names` request will be sent once for every 1k files
    +in the remote path, providing the checksum and modification time of
    +the listed files. As of version 1.33 issue
    +[#818](https://github.com/rclone/rclone/issues/818) causes extra requests
    +to be sent when using B2 with Crypt. When a copy operation does not
    +require any files to be uploaded, no more requests will be sent.
    +
    +Uploading files that do not require chunking, will send 2 requests per
    +file upload:
    +
    +

    /b2api/v1/b2_get_upload_url /b2api/v1/b2_upload_file/

    +
    
    +Uploading files requiring chunking, will send 2 requests (one each to
    +start and finish the upload) and another 2 requests for each chunk:
    +
    +

    /b2api/v1/b2_start_large_file /b2api/v1/b2_get_upload_part_url /b2api/v1/b2_upload_part/ /b2api/v1/b2_finish_large_file

    +
    
    +#### Versions
    +
    +Versions can be viewed with the `--b2-versions` flag. When it is set
    +rclone will show and act on older versions of files.  For example
    +
    +Listing without `--b2-versions`
    +
    +

    $ rclone -q ls b2:cleanup-test 9 one.txt

    +
    
    +And with
    +
    +

    $ rclone -q --b2-versions ls b2:cleanup-test 9 one.txt 8 one-v2016-07-04-141032-000.txt 16 one-v2016-07-04-141003-000.txt 15 one-v2016-07-02-155621-000.txt

    +
    
    +Showing that the current version is unchanged but older versions can
    +be seen.  These have the UTC date that they were uploaded to the
    +server to the nearest millisecond appended to them.
    +
    +Note that when using `--b2-versions` no file write operations are
    +permitted, so you can't upload files or delete them.
    +
    +### B2 and rclone link
     
    -Enter name for new remote.
    -name> e2
    +Rclone supports generating file share links for private B2 buckets.
    +They can either be for a file for example:
    +
    +

    ./rclone link B2:bucket/path/to/file.txt https://f002.backblazeb2.com/file/bucket/path/to/file.txt?Authorization=xxxxxxxx

    +
    
    +or if run on a directory you will get:
    +
    +

    ./rclone link B2:bucket/path https://f002.backblazeb2.com/file/bucket/path?Authorization=xxxxxxxx

    +
    
    +you can then use the authorization token (the part of the url from the
    + `?Authorization=` on) on any file path under that directory. For example:
    +
    +

    https://f002.backblazeb2.com/file/bucket/path/to/file1?Authorization=xxxxxxxx https://f002.backblazeb2.com/file/bucket/path/file2?Authorization=xxxxxxxx https://f002.backblazeb2.com/file/bucket/path/folder/file3?Authorization=xxxxxxxx

    +
    
     
    -Option Storage.
    -Type of storage to configure.
    -Choose a number from below, or type in your own value.
    -[snip]
    -XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi
    -   \ (s3)
    -[snip]
    -Storage> s3
    +### Standard options
     
    -Option provider.
    -Choose your S3 provider.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -[snip]
    -XX / IDrive e2
    -   \ (IDrive)
    -[snip]
    -provider> IDrive
    +Here are the Standard options specific to b2 (Backblaze B2).
     
    -Option env_auth.
    -Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false).
    -Press Enter for the default (false).
    - 1 / Enter AWS credentials in the next step.
    -   \ (false)
    - 2 / Get AWS credentials from the environment (env vars or IAM).
    -   \ (true)
    -env_auth> 
    +#### --b2-account
     
    -Option access_key_id.
    -AWS Access Key ID.
    -Leave blank for anonymous access or runtime credentials.
    -Enter a value. Press Enter to leave empty.
    -access_key_id> YOUR_ACCESS_KEY
    +Account ID or Application Key ID.
     
    -Option secret_access_key.
    -AWS Secret Access Key (password).
    -Leave blank for anonymous access or runtime credentials.
    -Enter a value. Press Enter to leave empty.
    -secret_access_key> YOUR_SECRET_KEY
    +Properties:
     
    -Option acl.
    -Canned ACL used when creating buckets and storing or copying objects.
    -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
    -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    -Note that this ACL is applied when server-side copying objects as S3
    -doesn't copy the ACL from the source but rather writes a fresh one.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -   / Owner gets FULL_CONTROL.
    - 1 | No one else has access rights (default).
    -   \ (private)
    -   / Owner gets FULL_CONTROL.
    - 2 | The AllUsers group gets READ access.
    -   \ (public-read)
    -   / Owner gets FULL_CONTROL.
    - 3 | The AllUsers group gets READ and WRITE access.
    -   | Granting this on a bucket is generally not recommended.
    -   \ (public-read-write)
    -   / Owner gets FULL_CONTROL.
    - 4 | The AuthenticatedUsers group gets READ access.
    -   \ (authenticated-read)
    -   / Object owner gets FULL_CONTROL.
    - 5 | Bucket owner gets READ access.
    -   | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
    -   \ (bucket-owner-read)
    -   / Both the object owner and the bucket owner get FULL_CONTROL over the object.
    - 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
    -   \ (bucket-owner-full-control)
    -acl> 
    +- Config:      account
    +- Env Var:     RCLONE_B2_ACCOUNT
    +- Type:        string
    +- Required:    true
     
    -Edit advanced config?
    -y) Yes
    -n) No (default)
    -y/n> 
    +#### --b2-key
     
    -Configuration complete.
    -Options:
    -- type: s3
    -- provider: IDrive
    -- access_key_id: YOUR_ACCESS_KEY
    -- secret_access_key: YOUR_SECRET_KEY
    -- endpoint: q9d9.la12.idrivee2-5.com
    -Keep this "e2" remote?
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    IONOS Cloud

    -

    IONOS S3 Object Storage is a service offered by IONOS for storing and accessing unstructured data. To connect to the service, you will need an access key and a secret key. These can be found in the Data Center Designer, by selecting Manager resources > Object Storage Key Manager.

    -

    Here is an example of a configuration. First, run rclone config. This will walk you through an interactive setup process. Type n to add the new remote, and then enter a name:

    -
    Enter name for new remote.
    -name> ionos-fra
    -

    Type s3 to choose the connection type:

    -
    Option Storage.
    -Type of storage to configure.
    -Choose a number from below, or type in your own value.
    -[snip]
    -XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi
    -   \ (s3)
    -[snip]
    -Storage> s3
    -

    Type IONOS:

    -
    Option provider.
    -Choose your S3 provider.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -[snip]
    -XX / IONOS Cloud
    -   \ (IONOS)
    -[snip]
    -provider> IONOS
    -

    Press Enter to choose the default option Enter AWS credentials in the next step:

    -
    Option env_auth.
    -Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false).
    -Press Enter for the default (false).
    - 1 / Enter AWS credentials in the next step.
    -   \ (false)
    - 2 / Get AWS credentials from the environment (env vars or IAM).
    -   \ (true)
    -env_auth>
    -

    Enter your Access Key and Secret key. These can be retrieved in the Data Center Designer, click on the menu “Manager resources” / "Object Storage Key Manager".

    -
    Option access_key_id.
    -AWS Access Key ID.
    -Leave blank for anonymous access or runtime credentials.
    -Enter a value. Press Enter to leave empty.
    -access_key_id> YOUR_ACCESS_KEY
    +Application Key.
     
    -Option secret_access_key.
    -AWS Secret Access Key (password).
    -Leave blank for anonymous access or runtime credentials.
    -Enter a value. Press Enter to leave empty.
    -secret_access_key> YOUR_SECRET_KEY
    -

    Choose the region where your bucket is located:

    -
    Option region.
    -Region where your bucket will be created and your data stored.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - 1 / Frankfurt, Germany
    -   \ (de)
    - 2 / Berlin, Germany
    -   \ (eu-central-2)
    - 3 / Logrono, Spain
    -   \ (eu-south-2)
    -region> 2
    -

    Choose the endpoint from the same region:

    -
    Option endpoint.
    -Endpoint for IONOS S3 Object Storage.
    -Specify the endpoint from the same region.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - 1 / Frankfurt, Germany
    -   \ (s3-eu-central-1.ionoscloud.com)
    - 2 / Berlin, Germany
    -   \ (s3-eu-central-2.ionoscloud.com)
    - 3 / Logrono, Spain
    -   \ (s3-eu-south-2.ionoscloud.com)
    -endpoint> 1
    -

    Press Enter to choose the default option or choose the desired ACL setting:

    -
    Option acl.
    -Canned ACL used when creating buckets and storing or copying objects.
    -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
    -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    -Note that this ACL is applied when server-side copying objects as S3
    -doesn't copy the ACL from the source but rather writes a fresh one.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -   / Owner gets FULL_CONTROL.
    - 1 | No one else has access rights (default).
    -   \ (private)
    -   / Owner gets FULL_CONTROL.
    -[snip]
    -acl>
    -

    Press Enter to skip the advanced config:

    -
    Edit advanced config?
    -y) Yes
    -n) No (default)
    -y/n>
    -

    Press Enter to save the configuration, and then q to quit the configuration process:

    -
    Configuration complete.
    -Options:
    -- type: s3
    -- provider: IONOS
    -- access_key_id: YOUR_ACCESS_KEY
    -- secret_access_key: YOUR_SECRET_KEY
    -- endpoint: s3-eu-central-1.ionoscloud.com
    -Keep this "ionos-fra" remote?
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    Done! Now you can try some commands (for macOS, use ./rclone instead of rclone).

    -
      -
    1. Create a bucket (the name must be unique within the whole IONOS S3)
    2. -
    -
    rclone mkdir ionos-fra:my-bucket
    -
      -
    1. List available buckets
    2. -
    -
    rclone lsd ionos-fra:
    -
      -
    1. Copy a file from local to remote
    2. -
    -
    rclone copy /Users/file.txt ionos-fra:my-bucket
    -
      -
    1. List contents of a bucket
    2. -
    -
    rclone ls ionos-fra:my-bucket
    -
      -
    1. Copy a file from remote to local
    2. -
    -
    rclone copy ionos-fra:my-bucket/file.txt
    -

    Minio

    -

    Minio is an object storage server built for cloud application developers and devops.

    -

    It is very easy to install and provides an S3 compatible server which can be used by rclone.

    -

    To use it, install Minio following the instructions here.

    -

    When it configures itself Minio will print something like this

    -
    Endpoint:  http://192.168.1.106:9000  http://172.23.0.1:9000
    -AccessKey: USWUXHGYZQYFYFFIT3RE
    -SecretKey: MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03
    -Region:    us-east-1
    -SQS ARNs:  arn:minio:sqs:us-east-1:1:redis arn:minio:sqs:us-east-1:2:redis
    +Properties:
     
    -Browser Access:
    -   http://192.168.1.106:9000  http://172.23.0.1:9000
    +- Config:      key
    +- Env Var:     RCLONE_B2_KEY
    +- Type:        string
    +- Required:    true
     
    -Command-line Access: https://docs.minio.io/docs/minio-client-quickstart-guide
    -   $ mc config host add myminio http://192.168.1.106:9000 USWUXHGYZQYFYFFIT3RE MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03
    +#### --b2-hard-delete
     
    -Object API (Amazon S3 compatible):
    -   Go:         https://docs.minio.io/docs/golang-client-quickstart-guide
    -   Java:       https://docs.minio.io/docs/java-client-quickstart-guide
    -   Python:     https://docs.minio.io/docs/python-client-quickstart-guide
    -   JavaScript: https://docs.minio.io/docs/javascript-client-quickstart-guide
    -   .NET:       https://docs.minio.io/docs/dotnet-client-quickstart-guide
    +Permanently delete files on remote removal, otherwise hide files.
     
    -Drive Capacity: 26 GiB Free, 165 GiB Total
    -

    These details need to go into rclone config like this. Note that it is important to put the region in as stated above.

    -
    env_auth> 1
    -access_key_id> USWUXHGYZQYFYFFIT3RE
    -secret_access_key> MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03
    -region> us-east-1
    -endpoint> http://192.168.1.106:9000
    -location_constraint>
    -server_side_encryption>
    -

    Which makes the config file look like this

    -
    [minio]
    -type = s3
    -provider = Minio
    -env_auth = false
    -access_key_id = USWUXHGYZQYFYFFIT3RE
    -secret_access_key = MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03
    -region = us-east-1
    -endpoint = http://192.168.1.106:9000
    -location_constraint =
    -server_side_encryption =
    -

    So once set up, for example, to copy files into a bucket

    -
    rclone copy /path/to/files minio:bucket
    -

    Qiniu Cloud Object Storage (Kodo)

    -

    Qiniu Cloud Object Storage (Kodo), a completely independent-researched core technology which is proven by repeated customer experience has occupied absolute leading market leader position. Kodo can be widely applied to mass data management.

    -

    To configure access to Qiniu Kodo, follow the steps below:

    -
      -
    1. Run rclone config and select n for a new remote.
    2. -
    -
    rclone config
    -No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -
      -
    1. Give the name of the configuration. For example, name it 'qiniu'.
    2. -
    -
    name> qiniu
    -
      -
    1. Select s3 storage.
    2. -
    -
    Choose a number from below, or type in your own value
    - 1 / 1Fichier
    -   \ (fichier)
    - 2 / Akamai NetStorage
    -   \ (netstorage)
    - 3 / Alias for an existing remote
    -   \ (alias)
    - 4 / Amazon Drive
    -   \ (amazon cloud drive)
    - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi
    -   \ (s3)
    -[snip]
    -Storage> s3
    -
      -
    1. Select Qiniu provider.
    2. -
    -
    Choose a number from below, or type in your own value
    -1 / Amazon Web Services (AWS) S3
    -   \ "AWS"
    -[snip]
    -22 / Qiniu Object Storage (Kodo)
    -   \ (Qiniu)
    -[snip]
    -provider> Qiniu
    -
      -
    1. Enter your SecretId and SecretKey of Qiniu Kodo.
    2. -
    -
    Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    -Only applies if access_key_id and secret_access_key is blank.
    -Enter a boolean value (true or false). Press Enter for the default ("false").
    -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.
    -Enter a string value. Press Enter for the default ("").
    -access_key_id> AKIDxxxxxxxxxx
    -AWS Secret Access Key (password)
    -Leave blank for anonymous access or runtime credentials.
    -Enter a string value. Press Enter for the default ("").
    -secret_access_key> xxxxxxxxxxx
    -
      -
    1. Select endpoint for Qiniu Kodo. This is the standard endpoint for different region.
    2. -
    -
       / The default endpoint - a good choice if you are unsure.
    - 1 | East China Region 1.
    -   | Needs location constraint cn-east-1.
    -   \ (cn-east-1)
    -   / East China Region 2.
    - 2 | Needs location constraint cn-east-2.
    -   \ (cn-east-2)
    -   / North China Region 1.
    - 3 | Needs location constraint cn-north-1.
    -   \ (cn-north-1)
    -   / South China Region 1.
    - 4 | Needs location constraint cn-south-1.
    -   \ (cn-south-1)
    -   / North America Region.
    - 5 | Needs location constraint us-north-1.
    -   \ (us-north-1)
    -   / Southeast Asia Region 1.
    - 6 | Needs location constraint ap-southeast-1.
    -   \ (ap-southeast-1)
    -   / Northeast Asia Region 1.
    - 7 | Needs location constraint ap-northeast-1.
    -   \ (ap-northeast-1)
    -[snip]
    -endpoint> 1
    +Properties:
    +
    +- Config:      hard_delete
    +- Env Var:     RCLONE_B2_HARD_DELETE
    +- Type:        bool
    +- Default:     false
    +
    +### Advanced options
    +
    +Here are the Advanced options specific to b2 (Backblaze B2).
    +
    +#### --b2-endpoint
    +
    +Endpoint for the service.
    +
    +Leave blank normally.
    +
    +Properties:
    +
    +- Config:      endpoint
    +- Env Var:     RCLONE_B2_ENDPOINT
    +- Type:        string
    +- Required:    false
    +
    +#### --b2-test-mode
    +
    +A flag string for X-Bz-Test-Mode header for debugging.
    +
    +This is for debugging purposes only. Setting it to one of the strings
    +below will cause b2 to return specific errors:
    +
    +  * "fail_some_uploads"
    +  * "expire_some_account_authorization_tokens"
    +  * "force_cap_exceeded"
    +
    +These will be set in the "X-Bz-Test-Mode" header which is documented
    +in the [b2 integrations checklist](https://www.backblaze.com/b2/docs/integration_checklist.html).
    +
    +Properties:
    +
    +- Config:      test_mode
    +- Env Var:     RCLONE_B2_TEST_MODE
    +- Type:        string
    +- Required:    false
    +
    +#### --b2-versions
    +
    +Include old versions in directory listings.
    +
    +Note that when using this no file write operations are permitted,
    +so you can't upload files or delete them.
    +
    +Properties:
    +
    +- Config:      versions
    +- Env Var:     RCLONE_B2_VERSIONS
    +- Type:        bool
    +- Default:     false
    +
    +#### --b2-version-at
    +
    +Show file versions as they were at the specified time.
    +
    +Note that when using this no file write operations are permitted,
    +so you can't upload files or delete them.
    +
    +Properties:
    +
    +- Config:      version_at
    +- Env Var:     RCLONE_B2_VERSION_AT
    +- Type:        Time
    +- Default:     off
    +
    +#### --b2-upload-cutoff
    +
    +Cutoff for switching to chunked upload.
    +
    +Files above this size will be uploaded in chunks of "--b2-chunk-size".
    +
    +This value should be set no larger than 4.657 GiB (== 5 GB).
    +
    +Properties:
    +
    +- Config:      upload_cutoff
    +- Env Var:     RCLONE_B2_UPLOAD_CUTOFF
    +- Type:        SizeSuffix
    +- Default:     200Mi
    +
    +#### --b2-copy-cutoff
    +
    +Cutoff for switching to multipart copy.
    +
    +Any files larger than this that need to be server-side copied will be
    +copied in chunks of this size.
    +
    +The minimum is 0 and the maximum is 4.6 GiB.
    +
    +Properties:
    +
    +- Config:      copy_cutoff
    +- Env Var:     RCLONE_B2_COPY_CUTOFF
    +- Type:        SizeSuffix
    +- Default:     4Gi
    +
    +#### --b2-chunk-size
    +
    +Upload chunk size.
    +
    +When uploading large files, chunk the file into this size.
    +
    +Must fit in memory. These chunks are buffered in memory and there
    +might a maximum of "--transfers" chunks in progress at once.
    +
    +5,000,000 Bytes is the minimum size.
    +
    +Properties:
    +
    +- Config:      chunk_size
    +- Env Var:     RCLONE_B2_CHUNK_SIZE
    +- Type:        SizeSuffix
    +- Default:     96Mi
    +
    +#### --b2-upload-concurrency
    +
    +Concurrency for multipart uploads.
    +
    +This is the number of chunks of the same file that are uploaded
    +concurrently.
    +
    +Note that chunks are stored in memory and there may be up to
    +"--transfers" * "--b2-upload-concurrency" chunks stored at once
    +in memory.
    +
    +Properties:
    +
    +- Config:      upload_concurrency
    +- Env Var:     RCLONE_B2_UPLOAD_CONCURRENCY
    +- Type:        int
    +- Default:     4
     
    -Option endpoint.
    -Endpoint for Qiniu Object Storage.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - 1 / East China Endpoint 1
    -   \ (s3-cn-east-1.qiniucs.com)
    - 2 / East China Endpoint 2
    -   \ (s3-cn-east-2.qiniucs.com)
    - 3 / North China Endpoint 1
    -   \ (s3-cn-north-1.qiniucs.com)
    - 4 / South China Endpoint 1
    -   \ (s3-cn-south-1.qiniucs.com)
    - 5 / North America Endpoint 1
    -   \ (s3-us-north-1.qiniucs.com)
    - 6 / Southeast Asia Endpoint 1
    -   \ (s3-ap-southeast-1.qiniucs.com)
    - 7 / Northeast Asia Endpoint 1
    -   \ (s3-ap-northeast-1.qiniucs.com)
    -endpoint> 1
    +#### --b2-disable-checksum
     
    -Option location_constraint.
    -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.
    -Press Enter to leave empty.
    - 1 / East China Region 1
    -   \ (cn-east-1)
    - 2 / East China Region 2
    -   \ (cn-east-2)
    - 3 / North China Region 1
    -   \ (cn-north-1)
    - 4 / South China Region 1
    -   \ (cn-south-1)
    - 5 / North America Region 1
    -   \ (us-north-1)
    - 6 / Southeast Asia Region 1
    -   \ (ap-southeast-1)
    - 7 / Northeast Asia Region 1
    -   \ (ap-northeast-1)
    -location_constraint> 1
    -
      -
    1. Choose acl and storage class.
    2. -
    -
    Note that this ACL is applied when server-side copying objects as S3
    -doesn't copy the ACL from the source but rather writes a fresh one.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    -   / Owner gets FULL_CONTROL.
    - 1 | No one else has access rights (default).
    -   \ (private)
    -   / Owner gets FULL_CONTROL.
    - 2 | The AllUsers group gets READ access.
    -   \ (public-read)
    -[snip]
    -acl> 2
    -The storage class to use when storing new objects in Tencent COS.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    - 1 / Standard storage class
    -   \ (STANDARD)
    - 2 / Infrequent access storage mode
    -   \ (LINE)
    - 3 / Archive storage mode
    -   \ (GLACIER)
    - 4 / Deep archive storage mode
    -   \ (DEEP_ARCHIVE)
    -[snip]
    -storage_class> 1
    -Edit advanced config? (y/n)
    -y) Yes
    -n) No (default)
    -y/n> n
    -Remote config
    ---------------------
    -[qiniu]
    -- type: s3
    -- provider: Qiniu
    -- access_key_id: xxx
    -- secret_access_key: xxx
    -- region: cn-east-1
    -- endpoint: s3-cn-east-1.qiniucs.com
    -- location_constraint: cn-east-1
    -- acl: public-read
    -- storage_class: STANDARD
    ---------------------
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -Current remotes:
    +Disable checksums for large (> upload cutoff) files.
     
    -Name                 Type
    -====                 ====
    -qiniu                s3
    -

    RackCorp

    -

    RackCorp Object Storage is an S3 compatible object storage platform from your friendly cloud provider RackCorp. The service is fast, reliable, well priced and located in many strategic locations unserviced by others, to ensure you can maintain data sovereignty.

    -

    Before you can use RackCorp Object Storage, you'll need to "sign up" for an account on our "portal". Next you can create an access key, a secret key and buckets, in your location of choice with ease. These details are required for the next steps of configuration, when rclone config asks for your access_key_id and secret_access_key.

    -

    Your config should end up looking a bit like this:

    -
    [RCS3-demo-config]
    -type = s3
    -provider = RackCorp
    -env_auth = true
    -access_key_id = YOURACCESSKEY
    -secret_access_key = YOURSECRETACCESSKEY
    -region = au-nsw
    -endpoint = s3.rackcorp.com
    -location_constraint = au-nsw
    -

    Scaleway

    -

    Scaleway The Object Storage platform allows you to store anything from backups, logs and web assets to documents and photos. Files can be dropped from the Scaleway console or transferred through our API and CLI or using any S3-compatible tool.

    -

    Scaleway provides an S3 interface which can be configured for use with rclone like this:

    -
    [scaleway]
    -type = s3
    -provider = Scaleway
    -env_auth = false
    -endpoint = s3.nl-ams.scw.cloud
    -access_key_id = SCWXXXXXXXXXXXXXX
    -secret_access_key = 1111111-2222-3333-44444-55555555555555
    -region = nl-ams
    -location_constraint =
    -acl = private
    -server_side_encryption =
    -storage_class =
    -

    C14 Cold Storage is the low-cost S3 Glacier alternative from Scaleway and it works the same way as on S3 by accepting the "GLACIER" storage_class. So you can configure your remote with the storage_class = GLACIER option to upload directly to C14. Don't forget that in this state you can't read files back after, you will need to restore them to "STANDARD" storage_class first before being able to read them (see "restore" section above)

    -

    Seagate Lyve Cloud

    -

    Seagate Lyve Cloud is an S3 compatible object storage platform from Seagate intended for enterprise use.

    -

    Here is a config run through for a remote called remote - you may choose a different name of course. Note that to create an access key and secret key you will need to create a service account first.

    -
    $ rclone config
    -No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> remote
    -

    Choose s3 backend

    -
    Type of storage to configure.
    -Choose a number from below, or type in your own value.
    -[snip]
    -XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS
    -   \ (s3)
    -[snip]
    -Storage> s3
    -

    Choose LyveCloud as S3 provider

    -
    Choose your S3 provider.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -[snip]
    -XX / Seagate Lyve Cloud
    -   \ (LyveCloud)
    -[snip]
    -provider> LyveCloud
    -

    Take the default (just press enter) to enter access key and secret in the config file.

    -
    Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false).
    -Press Enter for the default (false).
    - 1 / Enter AWS credentials in the next step.
    -   \ (false)
    - 2 / Get AWS credentials from the environment (env vars or IAM).
    -   \ (true)
    -env_auth>
    -
    AWS Access Key ID.
    -Leave blank for anonymous access or runtime credentials.
    -Enter a value. Press Enter to leave empty.
    -access_key_id> XXX
    -
    AWS Secret Access Key (password).
    -Leave blank for anonymous access or runtime credentials.
    -Enter a value. Press Enter to leave empty.
    -secret_access_key> YYY
    -

    Leave region blank

    -
    Region to connect to.
    -Leave blank if you are using an S3 clone and you don't have a region.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -   / Use this if unsure.
    - 1 | Will use v4 signatures and an empty region.
    -   \ ()
    -   / Use this only if v4 signatures don't work.
    - 2 | E.g. pre Jewel/v10 CEPH.
    -   \ (other-v2-signature)
    -region>
    -

    Choose an endpoint from the list

    -
    Endpoint for S3 API.
    -Required when using an S3 clone.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - 1 / Seagate Lyve Cloud US East 1 (Virginia)
    -   \ (s3.us-east-1.lyvecloud.seagate.com)
    - 2 / Seagate Lyve Cloud US West 1 (California)
    -   \ (s3.us-west-1.lyvecloud.seagate.com)
    - 3 / Seagate Lyve Cloud AP Southeast 1 (Singapore)
    -   \ (s3.ap-southeast-1.lyvecloud.seagate.com)
    -endpoint> 1
    -

    Leave location constraint blank

    -
    Location constraint - must be set to match the Region.
    -Leave blank if not sure. Used when creating buckets only.
    -Enter a value. Press Enter to leave empty.
    -location_constraint>
    -

    Choose default ACL (private).

    -
    Canned ACL used when creating buckets and storing or copying objects.
    -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
    -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    -Note that this ACL is applied when server-side copying objects as S3
    -doesn't copy the ACL from the source but rather writes a fresh one.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -   / Owner gets FULL_CONTROL.
    - 1 | No one else has access rights (default).
    -   \ (private)
    -[snip]
    -acl>
    -

    And the config file should end up looking like this:

    -
    [remote]
    -type = s3
    -provider = LyveCloud
    -access_key_id = XXX
    -secret_access_key = YYY
    -endpoint = s3.us-east-1.lyvecloud.seagate.com
    -

    SeaweedFS

    -

    SeaweedFS is a distributed storage system for blobs, objects, files, and data lake, with O(1) disk seek and a scalable file metadata store. It has an S3 compatible object storage interface. SeaweedFS can also act as a gateway to remote S3 compatible object store to cache data and metadata with asynchronous write back, for fast local speed and minimize access cost.

    -

    Assuming the SeaweedFS are configured with weed shell as such:

    -
    > s3.bucket.create -name foo
    -> s3.configure -access_key=any -secret_key=any -buckets=foo -user=me -actions=Read,Write,List,Tagging,Admin -apply
    -{
    -  "identities": [
    -    {
    -      "name": "me",
    -      "credentials": [
    -        {
    -          "accessKey": "any",
    -          "secretKey": "any"
    -        }
    -      ],
    -      "actions": [
    -        "Read:foo",
    -        "Write:foo",
    -        "List:foo",
    -        "Tagging:foo",
    -        "Admin:foo"
    -      ]
    -    }
    -  ]
    -}
    -

    To use rclone with SeaweedFS, above configuration should end up with something like this in your config:

    -
    [seaweedfs_s3]
    -type = s3
    -provider = SeaweedFS
    -access_key_id = any
    -secret_access_key = any
    -endpoint = localhost:8333
    -

    So once set up, for example to copy files into a bucket

    -
    rclone copy /path/to/files seaweedfs_s3:foo
    -

    Wasabi

    -

    Wasabi is a cloud-based object storage service for a broad range of applications and use cases. Wasabi is designed for individuals and organizations that require a high-performance, reliable, and secure data storage infrastructure at minimal cost.

    -

    Wasabi provides an S3 interface which can be configured for use with rclone like this.

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -n/s> n
    -name> wasabi
    -Type of storage to configure.
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Minio, Liara)
    -   \ "s3"
    -[snip]
    -Storage> s3
    -Get AWS credentials from runtime (environment variables or EC2/ECS 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> YOURACCESSKEY
    -AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials.
    -secret_access_key> YOURSECRETACCESSKEY
    -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"
    -[snip]
    -region> us-east-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> s3.wasabisys.com
    -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.
    -   \ ""
    -[snip]
    -location_constraint>
    -Canned ACL used when creating buckets and/or storing objects in S3.
    -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    -Choose a number from below, or type in your own value
    - 1 / Owner gets FULL_CONTROL. No one else has access rights (default).
    -   \ "private"
    -[snip]
    -acl>
    -The server-side encryption algorithm used when storing this object in S3.
    -Choose a number from below, or type in your own value
    - 1 / None
    -   \ ""
    - 2 / AES256
    -   \ "AES256"
    -server_side_encryption>
    -The storage class to use when storing objects in S3.
    -Choose a number from below, or type in your own value
    - 1 / Default
    -   \ ""
    - 2 / Standard storage class
    -   \ "STANDARD"
    - 3 / Reduced redundancy storage class
    -   \ "REDUCED_REDUNDANCY"
    - 4 / Standard Infrequent Access storage class
    -   \ "STANDARD_IA"
    -storage_class>
    -Remote config
    ---------------------
    -[wasabi]
    -env_auth = false
    -access_key_id = YOURACCESSKEY
    -secret_access_key = YOURSECRETACCESSKEY
    -region = us-east-1
    -endpoint = s3.wasabisys.com
    -location_constraint =
    -acl =
    -server_side_encryption =
    -storage_class =
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    This will leave the config file looking like this.

    -
    [wasabi]
    -type = s3
    -provider = Wasabi
    -env_auth = false
    -access_key_id = YOURACCESSKEY
    -secret_access_key = YOURSECRETACCESSKEY
    -region =
    -endpoint = s3.wasabisys.com
    -location_constraint =
    -acl =
    -server_side_encryption =
    -storage_class =
    -

    Alibaba OSS

    -

    Here is an example of making an Alibaba Cloud (Aliyun) OSS configuration. First run:

    -
    rclone config
    -

    This will guide you through an interactive setup process.

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> oss
    -Type of storage to configure.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    -[snip]
    - 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Minio, and Tencent COS
    -   \ "s3"
    -[snip]
    -Storage> s3
    -Choose your S3 provider.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    - 1 / Amazon Web Services (AWS) S3
    -   \ "AWS"
    - 2 / Alibaba Cloud Object Storage System (OSS) formerly Aliyun
    -   \ "Alibaba"
    - 3 / Ceph Object Storage
    -   \ "Ceph"
    -[snip]
    -provider> Alibaba
    -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    -Only applies if access_key_id and secret_access_key is blank.
    -Enter a boolean value (true or false). Press Enter for the default ("false").
    -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.
    -Enter a string value. Press Enter for the default ("").
    -access_key_id> accesskeyid
    -AWS Secret Access Key (password)
    -Leave blank for anonymous access or runtime credentials.
    -Enter a string value. Press Enter for the default ("").
    -secret_access_key> secretaccesskey
    -Endpoint for OSS API.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    - 1 / East China 1 (Hangzhou)
    -   \ "oss-cn-hangzhou.aliyuncs.com"
    - 2 / East China 2 (Shanghai)
    -   \ "oss-cn-shanghai.aliyuncs.com"
    - 3 / North China 1 (Qingdao)
    -   \ "oss-cn-qingdao.aliyuncs.com"
    -[snip]
    -endpoint> 1
    -Canned ACL used when creating buckets and storing or copying objects.
    +Normally rclone will calculate the SHA1 checksum of the input before
    +uploading it so it can add it to metadata on the object. This is great
    +for data integrity checking but can cause long delays for large files
    +to start uploading.
    +
    +Properties:
    +
    +- Config:      disable_checksum
    +- Env Var:     RCLONE_B2_DISABLE_CHECKSUM
    +- Type:        bool
    +- Default:     false
    +
    +#### --b2-download-url
    +
    +Custom endpoint for downloads.
    +
    +This is usually set to a Cloudflare CDN URL as Backblaze offers
    +free egress for data downloaded through the Cloudflare network.
    +Rclone works with private buckets by sending an "Authorization" header.
    +If the custom endpoint rewrites the requests for authentication,
    +e.g., in Cloudflare Workers, this header needs to be handled properly.
    +Leave blank if you want to use the endpoint provided by Backblaze.
    +
    +The URL provided here SHOULD have the protocol and SHOULD NOT have
    +a trailing slash or specify the /file/bucket subpath as rclone will
    +request files with "{download_url}/file/{bucket_name}/{path}".
    +
    +Example:
    +> https://mysubdomain.mydomain.tld
    +(No trailing "/", "file" or "bucket")
    +
    +Properties:
    +
    +- Config:      download_url
    +- Env Var:     RCLONE_B2_DOWNLOAD_URL
    +- Type:        string
    +- Required:    false
    +
    +#### --b2-download-auth-duration
    +
    +Time before the authorization token will expire in s or suffix ms|s|m|h|d.
    +
    +The duration before the download authorization token will expire.
    +The minimum value is 1 second. The maximum value is one week.
    +
    +Properties:
    +
    +- Config:      download_auth_duration
    +- Env Var:     RCLONE_B2_DOWNLOAD_AUTH_DURATION
    +- Type:        Duration
    +- Default:     1w
    +
    +#### --b2-memory-pool-flush-time
    +
    +How often internal memory buffer pools will be flushed. (no longer used)
    +
    +Properties:
    +
    +- Config:      memory_pool_flush_time
    +- Env Var:     RCLONE_B2_MEMORY_POOL_FLUSH_TIME
    +- Type:        Duration
    +- Default:     1m0s
    +
    +#### --b2-memory-pool-use-mmap
    +
    +Whether to use mmap buffers in internal memory pool. (no longer used)
    +
    +Properties:
    +
    +- Config:      memory_pool_use_mmap
    +- Env Var:     RCLONE_B2_MEMORY_POOL_USE_MMAP
    +- Type:        bool
    +- Default:     false
    +
    +#### --b2-lifecycle
    +
    +Set the number of days deleted files should be kept when creating a bucket.
    +
    +On bucket creation, this parameter is used to create a lifecycle rule
    +for the entire bucket.
    +
    +If lifecycle is 0 (the default) it does not create a lifecycle rule so
    +the default B2 behaviour applies. This is to create versions of files
    +on delete and overwrite and to keep them indefinitely.
    +
    +If lifecycle is >0 then it creates a single rule setting the number of
    +days before a file that is deleted or overwritten is deleted
    +permanently. This is known as daysFromHidingToDeleting in the b2 docs.
    +
    +The minimum value for this parameter is 1 day.
    +
    +You can also enable hard_delete in the config also which will mean
    +deletions won't cause versions but overwrites will still cause
    +versions to be made.
    +
    +See: [rclone backend lifecycle](#lifecycle) for setting lifecycles after bucket creation.
    +
    +
    +Properties:
    +
    +- Config:      lifecycle
    +- Env Var:     RCLONE_B2_LIFECYCLE
    +- Type:        int
    +- Default:     0
    +
    +#### --b2-encoding
    +
    +The encoding for the backend.
    +
    +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
    +
    +Properties:
    +
    +- Config:      encoding
    +- Env Var:     RCLONE_B2_ENCODING
    +- Type:        Encoding
    +- Default:     Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot
    +
    +## Backend commands
    +
    +Here are the commands specific to the b2 backend.
    +
    +Run them with
     
    -Note that this ACL is applied when server-side copying objects as S3
    -doesn't copy the ACL from the source but rather writes a fresh one.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    - 1 / Owner gets FULL_CONTROL. No one else has access rights (default).
    -   \ "private"
    - 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access.
    -   \ "public-read"
    -   / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access.
    -[snip]
    -acl> 1
    -The storage class to use when storing new objects in OSS.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    - 1 / Default
    -   \ ""
    - 2 / Standard storage class
    -   \ "STANDARD"
    - 3 / Archive storage mode.
    -   \ "GLACIER"
    - 4 / Infrequent access storage mode.
    -   \ "STANDARD_IA"
    -storage_class> 1
    -Edit advanced config? (y/n)
    -y) Yes
    -n) No
    -y/n> n
    -Remote config
    ---------------------
    -[oss]
    -type = s3
    -provider = Alibaba
    -env_auth = false
    -access_key_id = accesskeyid
    -secret_access_key = secretaccesskey
    -endpoint = oss-cn-hangzhou.aliyuncs.com
    -acl = private
    -storage_class = Standard
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    China Mobile Ecloud Elastic Object Storage (EOS)

    -

    Here is an example of making an China Mobile Ecloud Elastic Object Storage (EOS) configuration. First run:

    -
    rclone config
    -

    This will guide you through an interactive setup process.

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -name> ChinaMobile
    -Option Storage.
    -Type of storage to configure.
    -Choose a number from below, or type in your own value.
    - ...
    - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS
    -   \ (s3)
    - ...
    -Storage> s3
    -Option provider.
    -Choose your S3 provider.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - ...
    - 4 / China Mobile Ecloud Elastic Object Storage (EOS)
    -   \ (ChinaMobile)
    - ...
    -provider> ChinaMobile
    -Option env_auth.
    -Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false).
    -Press Enter for the default (false).
    - 1 / Enter AWS credentials in the next step.
    -   \ (false)
    - 2 / Get AWS credentials from the environment (env vars or IAM).
    -   \ (true)
    -env_auth>
    -Option access_key_id.
    -AWS Access Key ID.
    -Leave blank for anonymous access or runtime credentials.
    -Enter a value. Press Enter to leave empty.
    -access_key_id> accesskeyid
    -Option secret_access_key.
    -AWS Secret Access Key (password).
    -Leave blank for anonymous access or runtime credentials.
    -Enter a value. Press Enter to leave empty.
    -secret_access_key> secretaccesskey
    -Option endpoint.
    -Endpoint for China Mobile Ecloud Elastic Object Storage (EOS) API.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -   / The default endpoint - a good choice if you are unsure.
    - 1 | East China (Suzhou)
    -   \ (eos-wuxi-1.cmecloud.cn)
    - 2 / East China (Jinan)
    -   \ (eos-jinan-1.cmecloud.cn)
    - 3 / East China (Hangzhou)
    -   \ (eos-ningbo-1.cmecloud.cn)
    - 4 / East China (Shanghai-1)
    -   \ (eos-shanghai-1.cmecloud.cn)
    - 5 / Central China (Zhengzhou)
    -   \ (eos-zhengzhou-1.cmecloud.cn)
    - 6 / Central China (Changsha-1)
    -   \ (eos-hunan-1.cmecloud.cn)
    - 7 / Central China (Changsha-2)
    -   \ (eos-zhuzhou-1.cmecloud.cn)
    - 8 / South China (Guangzhou-2)
    -   \ (eos-guangzhou-1.cmecloud.cn)
    - 9 / South China (Guangzhou-3)
    -   \ (eos-dongguan-1.cmecloud.cn)
    -10 / North China (Beijing-1)
    -   \ (eos-beijing-1.cmecloud.cn)
    -11 / North China (Beijing-2)
    -   \ (eos-beijing-2.cmecloud.cn)
    -12 / North China (Beijing-3)
    -   \ (eos-beijing-4.cmecloud.cn)
    -13 / North China (Huhehaote)
    -   \ (eos-huhehaote-1.cmecloud.cn)
    -14 / Southwest China (Chengdu)
    -   \ (eos-chengdu-1.cmecloud.cn)
    -15 / Southwest China (Chongqing)
    -   \ (eos-chongqing-1.cmecloud.cn)
    -16 / Southwest China (Guiyang)
    -   \ (eos-guiyang-1.cmecloud.cn)
    -17 / Nouthwest China (Xian)
    -   \ (eos-xian-1.cmecloud.cn)
    -18 / Yunnan China (Kunming)
    -   \ (eos-yunnan.cmecloud.cn)
    -19 / Yunnan China (Kunming-2)
    -   \ (eos-yunnan-2.cmecloud.cn)
    -20 / Tianjin China (Tianjin)
    -   \ (eos-tianjin-1.cmecloud.cn)
    -21 / Jilin China (Changchun)
    -   \ (eos-jilin-1.cmecloud.cn)
    -22 / Hubei China (Xiangyan)
    -   \ (eos-hubei-1.cmecloud.cn)
    -23 / Jiangxi China (Nanchang)
    -   \ (eos-jiangxi-1.cmecloud.cn)
    -24 / Gansu China (Lanzhou)
    -   \ (eos-gansu-1.cmecloud.cn)
    -25 / Shanxi China (Taiyuan)
    -   \ (eos-shanxi-1.cmecloud.cn)
    -26 / Liaoning China (Shenyang)
    -   \ (eos-liaoning-1.cmecloud.cn)
    -27 / Hebei China (Shijiazhuang)
    -   \ (eos-hebei-1.cmecloud.cn)
    -28 / Fujian China (Xiamen)
    -   \ (eos-fujian-1.cmecloud.cn)
    -29 / Guangxi China (Nanning)
    -   \ (eos-guangxi-1.cmecloud.cn)
    -30 / Anhui China (Huainan)
    -   \ (eos-anhui-1.cmecloud.cn)
    -endpoint> 1
    -Option location_constraint.
    -Location constraint - must match endpoint.
    -Used when creating buckets only.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - 1 / East China (Suzhou)
    -   \ (wuxi1)
    - 2 / East China (Jinan)
    -   \ (jinan1)
    - 3 / East China (Hangzhou)
    -   \ (ningbo1)
    - 4 / East China (Shanghai-1)
    -   \ (shanghai1)
    - 5 / Central China (Zhengzhou)
    -   \ (zhengzhou1)
    - 6 / Central China (Changsha-1)
    -   \ (hunan1)
    - 7 / Central China (Changsha-2)
    -   \ (zhuzhou1)
    - 8 / South China (Guangzhou-2)
    -   \ (guangzhou1)
    - 9 / South China (Guangzhou-3)
    -   \ (dongguan1)
    -10 / North China (Beijing-1)
    -   \ (beijing1)
    -11 / North China (Beijing-2)
    -   \ (beijing2)
    -12 / North China (Beijing-3)
    -   \ (beijing4)
    -13 / North China (Huhehaote)
    -   \ (huhehaote1)
    -14 / Southwest China (Chengdu)
    -   \ (chengdu1)
    -15 / Southwest China (Chongqing)
    -   \ (chongqing1)
    -16 / Southwest China (Guiyang)
    -   \ (guiyang1)
    -17 / Nouthwest China (Xian)
    -   \ (xian1)
    -18 / Yunnan China (Kunming)
    -   \ (yunnan)
    -19 / Yunnan China (Kunming-2)
    -   \ (yunnan2)
    -20 / Tianjin China (Tianjin)
    -   \ (tianjin1)
    -21 / Jilin China (Changchun)
    -   \ (jilin1)
    -22 / Hubei China (Xiangyan)
    -   \ (hubei1)
    -23 / Jiangxi China (Nanchang)
    -   \ (jiangxi1)
    -24 / Gansu China (Lanzhou)
    -   \ (gansu1)
    -25 / Shanxi China (Taiyuan)
    -   \ (shanxi1)
    -26 / Liaoning China (Shenyang)
    -   \ (liaoning1)
    -27 / Hebei China (Shijiazhuang)
    -   \ (hebei1)
    -28 / Fujian China (Xiamen)
    -   \ (fujian1)
    -29 / Guangxi China (Nanning)
    -   \ (guangxi1)
    -30 / Anhui China (Huainan)
    -   \ (anhui1)
    -location_constraint> 1
    -Option acl.
    -Canned ACL used when creating buckets and storing or copying objects.
    -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
    -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    -Note that this ACL is applied when server-side copying objects as S3
    -doesn't copy the ACL from the source but rather writes a fresh one.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    -   / Owner gets FULL_CONTROL.
    - 1 | No one else has access rights (default).
    -   \ (private)
    -   / Owner gets FULL_CONTROL.
    - 2 | The AllUsers group gets READ access.
    -   \ (public-read)
    -   / Owner gets FULL_CONTROL.
    - 3 | The AllUsers group gets READ and WRITE access.
    -   | Granting this on a bucket is generally not recommended.
    -   \ (public-read-write)
    -   / Owner gets FULL_CONTROL.
    - 4 | The AuthenticatedUsers group gets READ access.
    -   \ (authenticated-read)
    -   / Object owner gets FULL_CONTROL.
    -acl> private
    -Option server_side_encryption.
    -The server-side encryption algorithm used when storing this object in S3.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - 1 / None
    -   \ ()
    - 2 / AES256
    -   \ (AES256)
    -server_side_encryption>
    -Option storage_class.
    -The storage class to use when storing new objects in ChinaMobile.
    -Choose a number from below, or type in your own value.
    -Press Enter to leave empty.
    - 1 / Default
    -   \ ()
    - 2 / Standard storage class
    -   \ (STANDARD)
    - 3 / Archive storage mode
    -   \ (GLACIER)
    - 4 / Infrequent access storage mode
    -   \ (STANDARD_IA)
    -storage_class>
    -Edit advanced config?
    -y) Yes
    -n) No (default)
    -y/n> n
    ---------------------
    -[ChinaMobile]
    -type = s3
    -provider = ChinaMobile
    -access_key_id = accesskeyid
    -secret_access_key = secretaccesskey
    -endpoint = eos-wuxi-1.cmecloud.cn
    -location_constraint = wuxi1
    -acl = private
    ---------------------
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    Leviia Cloud Object Storage

    -

    Leviia Object Storage, backup and secure your data in a 100% French cloud, independent of GAFAM..

    -

    To configure access to Leviia, follow the steps below:

    -
      -
    1. Run rclone config and select n for a new remote.
    2. -
    -
    rclone config
    -No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -
      -
    1. Give the name of the configuration. For example, name it 'leviia'.
    2. -
    -
    name> leviia
    -
      -
    1. Select s3 storage.
    2. -
    -
    Choose a number from below, or type in your own value
    - 1 / 1Fichier
    -   \ (fichier)
    - 2 / Akamai NetStorage
    -   \ (netstorage)
    - 3 / Alias for an existing remote
    -   \ (alias)
    - 4 / Amazon Drive
    -   \ (amazon cloud drive)
    - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi
    -   \ (s3)
    -[snip]
    -Storage> s3
    -
      -
    1. Select Leviia provider.
    2. -
    -
    Choose a number from below, or type in your own value
    -1 / Amazon Web Services (AWS) S3
    -   \ "AWS"
    -[snip]
    -15 / Leviia Object Storage
    -   \ (Leviia)
    -[snip]
    -provider> Leviia
    -
      -
    1. Enter your SecretId and SecretKey of Leviia.
    2. -
    -
    Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    -Only applies if access_key_id and secret_access_key is blank.
    -Enter a boolean value (true or false). Press Enter for the default ("false").
    -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.
    -Enter a string value. Press Enter for the default ("").
    -access_key_id> ZnIx.xxxxxxxxxxxxxxx
    -AWS Secret Access Key (password)
    -Leave blank for anonymous access or runtime credentials.
    -Enter a string value. Press Enter for the default ("").
    -secret_access_key> xxxxxxxxxxx
    -
      -
    1. Select endpoint for Leviia.
    2. -
    -
       / The default endpoint
    - 1 | Leviia.
    -   \ (s3.leviia.com)
    -[snip]
    -endpoint> 1
    -
      -
    1. Choose acl.
    2. -
    -
    Note that this ACL is applied when server-side copying objects as S3
    -doesn't copy the ACL from the source but rather writes a fresh one.
    -Enter a string value. Press Enter for the default ("").
    -Choose a number from below, or type in your own value
    -   / Owner gets FULL_CONTROL.
    - 1 | No one else has access rights (default).
    -   \ (private)
    -   / Owner gets FULL_CONTROL.
    - 2 | The AllUsers group gets READ access.
    -   \ (public-read)
    -[snip]
    -acl> 1
    -Edit advanced config? (y/n)
    -y) Yes
    -n) No (default)
    -y/n> n
    -Remote config
    ---------------------
    -[leviia]
    -- type: s3
    -- provider: Leviia
    -- access_key_id: ZnIx.xxxxxxx
    -- secret_access_key: xxxxxxxx
    -- endpoint: s3.leviia.com
    -- acl: private
    ---------------------
    -y) Yes this is OK (default)
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -Current remotes:
    +    rclone backend COMMAND remote:
    +
    +The help below will explain what arguments each command takes.
    +
    +See the [backend](https://rclone.org/commands/rclone_backend/) command for more
    +info on how to pass options and arguments.
    +
    +These can be run on a running backend using the rc command
    +[backend/command](https://rclone.org/rc/#backend-command).
    +
    +### lifecycle
    +
    +Read or set the lifecycle for a bucket
    +
    +    rclone backend lifecycle remote: [options] [<arguments>+]
    +
    +This command can be used to read or set the lifecycle for a bucket.
    +
    +Usage Examples:
    +
    +To show the current lifecycle rules:
    +
    +    rclone backend lifecycle b2:bucket
    +
    +This will dump something like this showing the lifecycle rules.
    +
    +    [
    +        {
    +            "daysFromHidingToDeleting": 1,
    +            "daysFromUploadingToHiding": null,
    +            "fileNamePrefix": ""
    +        }
    +    ]
    +
    +If there are no lifecycle rules (the default) then it will just return [].
    +
    +To reset the current lifecycle rules:
    +
    +    rclone backend lifecycle b2:bucket -o daysFromHidingToDeleting=30
    +    rclone backend lifecycle b2:bucket -o daysFromUploadingToHiding=5 -o daysFromHidingToDeleting=1
    +
    +This will run and then print the new lifecycle rules as above.
    +
    +Rclone only lets you set lifecycles for the whole bucket with the
    +fileNamePrefix = "".
    +
    +You can't disable versioning with B2. The best you can do is to set
    +the daysFromHidingToDeleting to 1 day. You can enable hard_delete in
    +the config also which will mean deletions won't cause versions but
    +overwrites will still cause versions to be made.
    +
    +    rclone backend lifecycle b2:bucket -o daysFromHidingToDeleting=1
    +
    +See: https://www.backblaze.com/docs/cloud-storage-lifecycle-rules
    +
    +
    +Options:
    +
    +- "daysFromHidingToDeleting": After a file has been hidden for this many days it is deleted. 0 is off.
    +- "daysFromUploadingToHiding": This many days after uploading a file is hidden
    +
    +
    +
    +## Limitations
    +
    +`rclone about` is not supported by the B2 backend. Backends without
    +this capability cannot determine free space for an rclone mount or
    +use policy `mfs` (most free space) as a member of an rclone union
    +remote.
    +
    +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/)
    +
    +#  Box
    +
    +Paths are specified as `remote:path`
    +
    +Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
    +
    +The initial setup for Box involves getting a token from Box which you
    +can do either in your browser, or with a config.json downloaded from Box
    +to use JWT authentication.  `rclone config` walks you through it.
    +
    +## Configuration
    +
    +Here is an example of how to make a remote called `remote`.  First run:
    +
    +     rclone config
    +
    +This will guide you through an interactive setup process:
    +
    +

    No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Box  "box" [snip] Storage> box Box App Client Id - leave blank normally. client_id> Box App Client Secret - leave blank normally. client_secret> Box App config.json location Leave blank normally. Enter a string value. Press Enter for the default (""). box_config_file> Box App Primary Access Token Leave blank normally. Enter a string value. Press Enter for the default (""). access_token>

    +

    Enter a string value. Press Enter for the default ("user"). Choose a number from below, or type in your own value 1 / Rclone should act on behalf of a user  "user" 2 / Rclone should act on behalf of a service account  "enterprise" box_sub_type> Remote config Use web browser to automatically authenticate rclone with remote? * Say Y if the machine running rclone has a web browser you can use * Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N. 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 = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"XXX"} -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

    +
    
    +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a
    +machine with no Internet browser available.
    +
    +Note that rclone runs a webserver on your local machine to collect the
    +token as returned from Box. This only runs from the moment it opens
    +your browser to the moment you get back the verification code.  This
    +is on `http://127.0.0.1:53682/` and this it may require you to unblock
    +it temporarily if you are running a host firewall.
    +
    +Once configured you can then use `rclone` like this,
    +
    +List directories in top level of your Box
    +
    +    rclone lsd remote:
    +
    +List all the files in your Box
    +
    +    rclone ls remote:
    +
    +To copy a local directory to an Box directory called backup
    +
    +    rclone copy /home/source remote:backup
    +
    +### Using rclone with an Enterprise account with SSO
    +
    +If you have an "Enterprise" account type with Box with single sign on
    +(SSO), you need to create a password to use Box with rclone. This can
    +be done at your Enterprise Box account by going to Settings, "Account"
    +Tab, and then set the password in the "Authentication" field.
    +
    +Once you have done this, you can setup your Enterprise Box account
    +using the same procedure detailed above in the, using the password you
    +have just set.
    +
    +### Invalid refresh token
    +
    +According to the [box docs](https://developer.box.com/v2.0/docs/oauth-20#section-6-using-the-access-and-refresh-tokens):
    +
    +> Each refresh_token is valid for one use in 60 days.
    +
    +This means that if you
    +
    +  * Don't use the box remote for 60 days
    +  * Copy the config file with a box refresh token in and use it in two places
    +  * Get an error on a token refresh
    +
    +then rclone will return an error which includes the text `Invalid
    +refresh token`.
    +
    +To fix this you will need to use oauth2 again to update the refresh
    +token.  You can use the methods in [the remote setup
    +docs](https://rclone.org/remote_setup/), bearing in mind that if you use the copy the
    +config file method, you should not use that remote on the computer you
    +did the authentication on.
     
    -Name                 Type
    -====                 ====
    -leviia                s3
    -

    Liara

    -

    Here is an example of making a Liara Object Storage configuration. First run:

    -
    rclone config
    -

    This will guide you through an interactive setup process.

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -n/s> n
    -name> Liara
    -Type of storage to configure.
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Liara, Minio)
    -   \ "s3"
    -[snip]
    -Storage> s3
    -Get AWS credentials from runtime (environment variables or EC2/ECS 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> YOURACCESSKEY
    -AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials.
    -secret_access_key> YOURSECRETACCESSKEY
    -Region to connect to.
    -Choose a number from below, or type in your own value
    -   / The default endpoint
    - 1 | US Region, Northern Virginia, or Pacific Northwest.
    -   | Leave location constraint empty.
    -   \ "us-east-1"
    -[snip]
    -region>
    -Endpoint for S3 API.
    -Leave blank if using Liara to use the default endpoint for the region.
    -Specify if using an S3 clone such as Ceph.
    -endpoint> storage.iran.liara.space
    -Canned ACL used when creating buckets and/or storing objects in S3.
    -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    -Choose a number from below, or type in your own value
    - 1 / Owner gets FULL_CONTROL. No one else has access rights (default).
    -   \ "private"
    -[snip]
    -acl>
    -The server-side encryption algorithm used when storing this object in S3.
    -Choose a number from below, or type in your own value
    - 1 / None
    -   \ ""
    - 2 / AES256
    -   \ "AES256"
    -server_side_encryption>
    -The storage class to use when storing objects in S3.
    -Choose a number from below, or type in your own value
    - 1 / Default
    -   \ ""
    - 2 / Standard storage class
    -   \ "STANDARD"
    -storage_class>
    -Remote config
    ---------------------
    -[Liara]
    -env_auth = false
    -access_key_id = YOURACCESSKEY
    -secret_access_key = YOURSECRETACCESSKEY
    -endpoint = storage.iran.liara.space
    -location_constraint =
    -acl =
    -server_side_encryption =
    -storage_class =
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    This will leave the config file looking like this.

    -
    [Liara]
    -type = s3
    -provider = Liara
    -env_auth = false
    -access_key_id = YOURACCESSKEY
    -secret_access_key = YOURSECRETACCESSKEY
    -region =
    -endpoint = storage.iran.liara.space
    -location_constraint =
    -acl =
    -server_side_encryption =
    -storage_class =
    -

    ArvanCloud

    -

    ArvanCloud ArvanCloud Object Storage goes beyond the limited traditional file storage. It gives you access to backup and archived files and allows sharing. Files like profile image in the app, images sent by users or scanned documents can be stored securely and easily in our Object Storage service.

    -

    ArvanCloud provides an S3 interface which can be configured for use with rclone like this.

    -
    No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -n/s> n
    -name> ArvanCloud
    -Type of storage to configure.
    -Choose a number from below, or type in your own value
    -[snip]
    -XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Liara, Minio)
    -   \ "s3"
    -[snip]
    -Storage> s3
    -Get AWS credentials from runtime (environment variables or EC2/ECS 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> YOURACCESSKEY
    -AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials.
    -secret_access_key> YOURSECRETACCESSKEY
    -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"
    -[snip]
    -region> 
    -Endpoint for S3 API.
    -Leave blank if using ArvanCloud to use the default endpoint for the region.
    -Specify if using an S3 clone such as Ceph.
    -endpoint> s3.arvanstorage.com
    -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 Iran-Tehran Region.
    -   \ ""
    -[snip]
    -location_constraint>
    -Canned ACL used when creating buckets and/or storing objects in S3.
    -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
    -Choose a number from below, or type in your own value
    - 1 / Owner gets FULL_CONTROL. No one else has access rights (default).
    -   \ "private"
    -[snip]
    -acl>
    -The server-side encryption algorithm used when storing this object in S3.
    -Choose a number from below, or type in your own value
    - 1 / None
    -   \ ""
    - 2 / AES256
    -   \ "AES256"
    -server_side_encryption>
    -The storage class to use when storing objects in S3.
    -Choose a number from below, or type in your own value
    - 1 / Default
    -   \ ""
    - 2 / Standard storage class
    -   \ "STANDARD"
    -storage_class>
    -Remote config
    ---------------------
    -[ArvanCloud]
    -env_auth = false
    -access_key_id = YOURACCESSKEY
    -secret_access_key = YOURSECRETACCESSKEY
    -region = ir-thr-at1
    -endpoint = s3.arvanstorage.com
    -location_constraint =
    -acl =
    -server_side_encryption =
    -storage_class =
    ---------------------
    -y) Yes this is OK
    -e) Edit this remote
    -d) Delete this remote
    -y/e/d> y
    -

    This will leave the config file looking like this.

    -
    [ArvanCloud]
    -type = s3
    -provider = ArvanCloud
    -env_auth = false
    -access_key_id = YOURACCESSKEY
    -secret_access_key = YOURSECRETACCESSKEY
    -region =
    -endpoint = s3.arvanstorage.com
    -location_constraint =
    -acl =
    -server_side_encryption =
    -storage_class =
    -

    Tencent COS

    -

    Tencent Cloud Object Storage (COS) is a distributed storage service offered by Tencent Cloud for unstructured data. It is secure, stable, massive, convenient, low-delay and low-cost.

    -

    To configure access to Tencent COS, follow the steps below:

    -
      -
    1. Run rclone config and select n for a new remote.
    2. -
    -
    rclone config
    -No remotes found, make a new one?
    -n) New remote
    -s) Set configuration password
    -q) Quit config
    -n/s/q> n
    -
      -
    1. Give the name of the configuration. For example, name it 'cos'.
    2. -
    -
    name> cos
    -
      -
    1. Select s3 storage.
    2. -
    -
    Choose a number from below, or type in your own value
    -1 / 1Fichier
    -   \ "fichier"
    - 2 / Alias for an existing remote
    -   \ "alias"
    - 3 / Amazon Drive
    -   \ "amazon cloud drive"
    - 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Minio, and Tencent COS
    -   \ "s3"
    -[snip]
    -Storage> s3
    -
      -
    1. Select TencentCOS provider.
    2. -
    -
    Choose a number from below, or type in your own value
    -1 / Amazon Web Services (AWS) S3
    -   \ "AWS"
    -[snip]
    -11 / Tencent Cloud Object Storage (COS)
    -   \ "TencentCOS"
    -[snip]
    -provider> TencentCOS
    -
      -
    1. Enter your SecretId and SecretKey of Tencent Cloud.
    2. -
    -
    Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
    -Only applies if access_key_id and secret_access_key is blank.
    -Enter a boolean value (true or false). Press Enter for the default ("false").
    -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.
    -Enter a string value. Press Enter for the default ("").
    -access_key_id> AKIDxxxxxxxxxx
    -AWS Secret Access Key (password)
    -Leave blank for anonymous access or runtime credentials.
    -Enter a string value. Press Enter for the default ("").
    -secret_access_key> xxxxxxxxxxx
    -
      -
    1. Select endpoint for Tencent COS. This is the standard endpoint for different region.
    2. +Here is how to do it. +
    +

    $ rclone config Current remotes:

    +

    Name Type ==== ==== remote box

    +
      +
    1. Edit existing remote
    2. +
    3. New remote
    4. +
    5. Delete remote
    6. +
    7. Rename remote
    8. +
    9. Copy remote
    10. +
    11. Set configuration password
    12. +
    13. Quit config e/n/d/r/c/s/q> e Choose a number from below, or type in an existing value 1 > remote remote> remote -------------------- [remote] type = box token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2017-07-08T23:40:08.059167677+01:00"} -------------------- Edit remote Value "client_id" = "" Edit? (y/n)>
    14. +
    15. Yes
    16. +
    17. No y/n> n Value "client_secret" = "" Edit? (y/n)>
    18. +
    19. Yes
    20. +
    21. No y/n> n Remote config Already have a token - refresh?
    22. +
    23. Yes
    24. +
    25. No y/n> y Use web browser to automatically authenticate rclone with remote?
    -
     1 / Beijing Region.
    -   \ "cos.ap-beijing.myqcloud.com"
    - 2 / Nanjing Region.
    -   \ "cos.ap-nanjing.myqcloud.com"
    - 3 / Shanghai Region.
    -   \ "cos.ap-shanghai.myqcloud.com"
    - 4 / Guangzhou Region.
    -   \ "cos.ap-guangzhou.myqcloud.com"
    -[snip]
    -endpoint> 4
    -
      -
    1. Choose acl and storage class.
    2. +
        +
      • Say Y if the machine running rclone has a web browser you can use
      • +
      • Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N.
      • +
      +
        +
      1. Yes
      2. +
      3. 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] type = box token = {"access_token":"YYY","token_type":"bearer","refresh_token":"YYY","expiry":"2017-07-23T12:22:29.259137901+01:00"} --------------------
      4. +
      5. Yes this is OK
      6. +
      7. Edit this remote
      8. +
      9. Delete this remote y/e/d> y
      -
      Note that this ACL is applied when server-side copying objects as S3
      -doesn't copy the ACL from the source but rather writes a fresh one.
      -Enter a string value. Press Enter for the default ("").
      -Choose a number from below, or type in your own value
      - 1 / Owner gets Full_CONTROL. No one else has access rights (default).
      -   \ "default"
      -[snip]
      -acl> 1
      -The storage class to use when storing new objects in Tencent COS.
      -Enter a string value. Press Enter for the default ("").
      -Choose a number from below, or type in your own value
      - 1 / Default
      -   \ ""
      -[snip]
      -storage_class> 1
      -Edit advanced config? (y/n)
      -y) Yes
      -n) No (default)
      -y/n> n
      -Remote config
      ---------------------
      -[cos]
      -type = s3
      -provider = TencentCOS
      -env_auth = false
      -access_key_id = xxx
      -secret_access_key = xxx
      -endpoint = cos.ap-guangzhou.myqcloud.com
      -acl = default
      ---------------------
      -y) Yes this is OK (default)
      -e) Edit this remote
      -d) Delete this remote
      -y/e/d> y
      -Current remotes:
      +
      
      +### Modification times and hashes
       
      -Name                 Type
      -====                 ====
      -cos                  s3
      -

      Netease NOS

      -

      For Netease NOS configure as per the configurator rclone config setting the provider Netease. This will automatically set force_path_style = false which is necessary for it to run properly.

      -

      Petabox

      -

      Here is an example of making a Petabox configuration. First run:

      -
      rclone config
      -

      This will guide you through an interactive setup process.

      -
      No remotes found, make a new one?
      -n) New remote
      -s) Set configuration password
      -n/s> n
      +Box allows modification times to be set on objects accurate to 1
      +second.  These will be used to detect whether objects need syncing or
      +not.
       
      -Enter name for new remote.
      -name> My Petabox Storage
      +Box supports SHA1 type hashes, so you can use the `--checksum`
      +flag.
       
      -Option Storage.
      -Type of storage to configure.
      -Choose a number from below, or type in your own value.
      -[snip]
      -XX / Amazon S3 Compliant Storage Providers including AWS, ...
      -   \ "s3"
      -[snip]
      -Storage> s3
      +### Restricted filename characters
       
      -Option provider.
      -Choose your S3 provider.
      -Choose a number from below, or type in your own value.
      -Press Enter to leave empty.
      -[snip]
      -XX / Petabox Object Storage
      -   \ (Petabox)
      -[snip]
      -provider> Petabox
      +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
      +the following characters are also replaced:
       
      -Option env_auth.
      -Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false).
      -Press Enter for the default (false).
      - 1 / Enter AWS credentials in the next step.
      -   \ (false)
      - 2 / Get AWS credentials from the environment (env vars or IAM).
      -   \ (true)
      -env_auth> 1
      +| Character | Value | Replacement |
      +| --------- |:-----:|:-----------:|
      +| \         | 0x5C  | \           |
       
      -Option access_key_id.
      -AWS Access Key ID.
      -Leave blank for anonymous access or runtime credentials.
      -Enter a value. Press Enter to leave empty.
      -access_key_id> YOUR_ACCESS_KEY_ID
      +File names can also not end with the following characters.
      +These only get replaced if they are the last character in the name:
       
      -Option secret_access_key.
      -AWS Secret Access Key (password).
      -Leave blank for anonymous access or runtime credentials.
      -Enter a value. Press Enter to leave empty.
      -secret_access_key> YOUR_SECRET_ACCESS_KEY
      +| Character | Value | Replacement |
      +| --------- |:-----:|:-----------:|
      +| SP        | 0x20  | ␠           |
       
      -Option region.
      -Region where your bucket will be created and your data stored.
      -Choose a number from below, or type in your own value.
      -Press Enter to leave empty.
      - 1 / US East (N. Virginia)
      -   \ (us-east-1)
      - 2 / Europe (Frankfurt)
      -   \ (eu-central-1)
      - 3 / Asia Pacific (Singapore)
      -   \ (ap-southeast-1)
      - 4 / Middle East (Bahrain)
      -   \ (me-south-1)
      - 5 / South America (São Paulo)
      -   \ (sa-east-1)
      -region> 1
      +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
      +as they can't be used in JSON strings.
       
      -Option endpoint.
      -Endpoint for Petabox S3 Object Storage.
      -Specify the endpoint from the same region.
      -Choose a number from below, or type in your own value.
      - 1 / US East (N. Virginia)
      -   \ (s3.petabox.io)
      - 2 / US East (N. Virginia)
      -   \ (s3.us-east-1.petabox.io)
      - 3 / Europe (Frankfurt)
      -   \ (s3.eu-central-1.petabox.io)
      - 4 / Asia Pacific (Singapore)
      -   \ (s3.ap-southeast-1.petabox.io)
      - 5 / Middle East (Bahrain)
      -   \ (s3.me-south-1.petabox.io)
      - 6 / South America (São Paulo)
      -   \ (s3.sa-east-1.petabox.io)
      -endpoint> 1
      +### Transfers
      +
      +For files above 50 MiB rclone will use a chunked transfer.  Rclone will
      +upload up to `--transfers` chunks at the same time (shared among all
      +the multipart uploads).  Chunks are buffered in memory and are
      +normally 8 MiB so increasing `--transfers` will increase memory use.
      +
      +### Deleting files
      +
      +Depending on the enterprise settings for your user, the item will
      +either be actually deleted from Box or moved to the trash.
      +
      +Emptying the trash is supported via the rclone however cleanup command
      +however this deletes every trashed file and folder individually so it
      +may take a very long time. 
      +Emptying the trash via the  WebUI does not have this limitation 
      +so it is advised to empty the trash via the WebUI.
      +
      +### Root folder ID
      +
      +You can set the `root_folder_id` for rclone.  This is the directory
      +(identified by its `Folder ID`) that rclone considers to be the root
      +of your Box drive.
      +
      +Normally you will leave this blank and rclone will determine the
      +correct root to use itself.
      +
      +However you can set this to restrict rclone to a specific folder
      +hierarchy.
      +
      +In order to do this you will have to find the `Folder ID` of the
      +directory you wish rclone to display.  This will be the last segment
      +of the URL when you open the relevant folder in the Box web
      +interface.
      +
      +So if the folder you want rclone to use has a URL which looks like
      +`https://app.box.com/folder/11xxxxxxxxx8`
      +in the browser, then you use `11xxxxxxxxx8` as
      +the `root_folder_id` in the config.
      +
      +
      +### Standard options
      +
      +Here are the Standard options specific to box (Box).
      +
      +#### --box-client-id
      +
      +OAuth Client Id.
      +
      +Leave blank normally.
      +
      +Properties:
      +
      +- Config:      client_id
      +- Env Var:     RCLONE_BOX_CLIENT_ID
      +- Type:        string
      +- Required:    false
      +
      +#### --box-client-secret
      +
      +OAuth Client Secret.
      +
      +Leave blank normally.
      +
      +Properties:
      +
      +- Config:      client_secret
      +- Env Var:     RCLONE_BOX_CLIENT_SECRET
      +- Type:        string
      +- Required:    false
      +
      +#### --box-box-config-file
      +
      +Box App config.json location
      +
      +Leave blank normally.
      +
      +Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`.
      +
      +Properties:
      +
      +- Config:      box_config_file
      +- Env Var:     RCLONE_BOX_BOX_CONFIG_FILE
      +- Type:        string
      +- Required:    false
       
      -Option acl.
      -Canned ACL used when creating buckets and storing or copying objects.
      -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
      -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
      -Note that this ACL is applied when server-side copying objects as S3
      -doesn't copy the ACL from the source but rather writes a fresh one.
      -If the acl is an empty string then no X-Amz-Acl: header is added and
      -the default (private) will be used.
      -Choose a number from below, or type in your own value.
      -Press Enter to leave empty.
      -   / Owner gets FULL_CONTROL.
      - 1 | No one else has access rights (default).
      -   \ (private)
      -   / Owner gets FULL_CONTROL.
      - 2 | The AllUsers group gets READ access.
      -   \ (public-read)
      -   / Owner gets FULL_CONTROL.
      - 3 | The AllUsers group gets READ and WRITE access.
      -   | Granting this on a bucket is generally not recommended.
      -   \ (public-read-write)
      -   / Owner gets FULL_CONTROL.
      - 4 | The AuthenticatedUsers group gets READ access.
      -   \ (authenticated-read)
      -   / Object owner gets FULL_CONTROL.
      - 5 | Bucket owner gets READ access.
      -   | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
      -   \ (bucket-owner-read)
      -   / Both the object owner and the bucket owner get FULL_CONTROL over the object.
      - 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
      -   \ (bucket-owner-full-control)
      -acl> 1
      +#### --box-access-token
       
      -Edit advanced config?
      -y) Yes
      -n) No (default)
      -y/n> No
      +Box App Primary Access Token
       
      -Configuration complete.
      -Options:
      -- type: s3
      -- provider: Petabox
      -- access_key_id: YOUR_ACCESS_KEY_ID
      -- secret_access_key: YOUR_SECRET_ACCESS_KEY
      -- region: us-east-1
      -- endpoint: s3.petabox.io
      -Keep this "My Petabox Storage" remote?
      -y) Yes this is OK (default)
      -e) Edit this remote
      -d) Delete this remote
      -y/e/d> y
      -

      This will leave the config file looking like this.

      -
      [My Petabox Storage]
      -type = s3
      -provider = Petabox
      -access_key_id = YOUR_ACCESS_KEY_ID
      -secret_access_key = YOUR_SECRET_ACCESS_KEY
      -region = us-east-1
      -endpoint = s3.petabox.io
      -

      Storj

      -

      Storj is a decentralized cloud storage which can be used through its native protocol or an S3 compatible gateway.

      -

      The S3 compatible gateway is configured using rclone config with a type of s3 and with a provider name of Storj. Here is an example run of the configurator.

      -
      Type of storage to configure.
      -Storage> s3
      -Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false).
      -Press Enter for the default (false).
      - 1 / Enter AWS credentials in the next step.
      -   \ (false)
      - 2 / Get AWS credentials from the environment (env vars or IAM).
      -   \ (true)
      -env_auth> 1
      -Option access_key_id.
      -AWS Access Key ID.
      -Leave blank for anonymous access or runtime credentials.
      -Enter a value. Press Enter to leave empty.
      -access_key_id> XXXX (as shown when creating the access grant)
      -Option secret_access_key.
      -AWS Secret Access Key (password).
      -Leave blank for anonymous access or runtime credentials.
      -Enter a value. Press Enter to leave empty.
      -secret_access_key> XXXX (as shown when creating the access grant)
      -Option endpoint.
      -Endpoint of the Shared Gateway.
      -Choose a number from below, or type in your own value.
      -Press Enter to leave empty.
      - 1 / EU1 Shared Gateway
      -   \ (gateway.eu1.storjshare.io)
      - 2 / US1 Shared Gateway
      -   \ (gateway.us1.storjshare.io)
      - 3 / Asia-Pacific Shared Gateway
      -   \ (gateway.ap1.storjshare.io)
      -endpoint> 1 (as shown when creating the access grant)
      -Edit advanced config?
      -y) Yes
      -n) No (default)
      -y/n> n
      -

      Note that s3 credentials are generated when you create an access grant.

      -

      Backend quirks

      -
        -
      • --chunk-size is forced to be 64 MiB or greater. This will use more memory than the default of 5 MiB.
      • -
      • Server side copy is disabled as it isn't currently supported in the gateway.
      • -
      • GetTier and SetTier are not supported.
      • -
      -

      Backend bugs

      -

      Due to issue #39 uploading multipart files via the S3 gateway causes them to lose their metadata. For rclone's purpose this means that the modification time is not stored, nor is any MD5SUM (if one is available from the source).

      -

      This has the following consequences:

      -
        -
      • Using rclone rcat will fail as the medatada doesn't match after upload
      • -
      • Uploading files with rclone mount will fail for the same reason -
          -
        • This can worked around by using --vfs-cache-mode writes or --vfs-cache-mode full or setting --s3-upload-cutoff large
        • -
      • -
      • Files uploaded via a multipart upload won't have their modtimes -
          -
        • This will mean that rclone sync will likely keep trying to upload files bigger than --s3-upload-cutoff
        • -
        • This can be worked around with --checksum or --size-only or setting --s3-upload-cutoff large
        • -
        • The maximum value for --s3-upload-cutoff is 5GiB though
        • -
      • -
      -

      One general purpose workaround is to set --s3-upload-cutoff 5G. This means that rclone will upload files smaller than 5GiB as single parts. Note that this can be set in the config file with upload_cutoff = 5G or configured in the advanced settings. If you regularly transfer files larger than 5G then using --checksum or --size-only in rclone sync is the recommended workaround.

      -

      Comparison with the native protocol

      -

      Use the the native protocol to take advantage of client-side encryption as well as to achieve the best possible download performance. Uploads will be erasure-coded locally, thus a 1gb upload will result in 2.68gb of data being uploaded to storage nodes across the network.

      -

      Use this backend and the S3 compatible Hosted Gateway to increase upload performance and reduce the load on your systems and network. Uploads will be encrypted and erasure-coded server-side, thus a 1GB upload will result in only in 1GB of data being uploaded to storage nodes across the network.

      -

      For more detailed comparison please check the documentation of the storj backend.

      -

      Limitations

      -

      rclone about is not supported by the S3 backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.

      -

      See List of backends that do not support rclone about and rclone about

      -

      Synology C2 Object Storage

      -

      Synology C2 Object Storage provides a secure, S3-compatible, and cost-effective cloud storage solution without API request, download fees, and deletion penalty.

      -

      The S3 compatible gateway is configured using rclone config with a type of s3 and with a provider name of Synology. Here is an example run of the configurator.

      -

      First run:

      -
      rclone config
      -

      This will guide you through an interactive setup process.

      -
      No remotes found, make a new one?
      -n) New remote
      -s) Set configuration password
      -q) Quit config
      +Leave blank normally.
       
      -n/s/q> n
      +Properties:
       
      -Enter name for new remote.1
      -name> syno
      +- Config:      access_token
      +- Env Var:     RCLONE_BOX_ACCESS_TOKEN
      +- Type:        string
      +- Required:    false
       
      -Type of storage to configure.
      -Enter a string value. Press Enter for the default ("").
      -Choose a number from below, or type in your own value
      +#### --box-box-sub-type
       
      - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, GCS, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi
      -   \ "s3"
       
      -Storage> s3
       
      -Choose your S3 provider.
      -Enter a string value. Press Enter for the default ("").
      -Choose a number from below, or type in your own value
      - 24 / Synology C2 Object Storage
      -   \ (Synology)
      +Properties:
       
      -provider> Synology
      +- Config:      box_sub_type
      +- Env Var:     RCLONE_BOX_BOX_SUB_TYPE
      +- Type:        string
      +- Default:     "user"
      +- Examples:
      +    - "user"
      +        - Rclone should act on behalf of a user.
      +    - "enterprise"
      +        - Rclone should act on behalf of a service account.
       
      -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
      -Only applies if access_key_id and secret_access_key is blank.
      -Enter a boolean value (true or false). Press Enter for the default ("false").
      -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"
      +### Advanced options
       
      -env_auth> 1
      +Here are the Advanced options specific to box (Box).
       
      -AWS Access Key ID.
      -Leave blank for anonymous access or runtime credentials.
      -Enter a string value. Press Enter for the default ("").
      +#### --box-token
       
      -access_key_id> accesskeyid
      +OAuth Access Token as a JSON blob.
       
      -AWS Secret Access Key (password)
      -Leave blank for anonymous access or runtime credentials.
      -Enter a string value. Press Enter for the default ("").
      +Properties:
       
      -secret_access_key> secretaccesskey
      +- Config:      token
      +- Env Var:     RCLONE_BOX_TOKEN
      +- Type:        string
      +- Required:    false
       
      -Region where your data stored.
      -Choose a number from below, or type in your own value.
      -Press Enter to leave empty.
      - 1 / Europe Region 1
      -   \ (eu-001)
      - 2 / Europe Region 2
      -   \ (eu-002)
      - 3 / US Region 1
      -   \ (us-001)
      - 4 / US Region 2
      -   \ (us-002)
      - 5 / Asia (Taiwan)
      -   \ (tw-001)
      +#### --box-auth-url
       
      -region > 1
      +Auth server URL.
       
      -Option endpoint.
      -Endpoint for Synology C2 Object Storage API.
      -Choose a number from below, or type in your own value.
      -Press Enter to leave empty.
      - 1 / EU Endpoint 1
      -   \ (eu-001.s3.synologyc2.net)
      - 2 / US Endpoint 1
      -   \ (us-001.s3.synologyc2.net)
      - 3 / TW Endpoint 1
      -   \ (tw-001.s3.synologyc2.net)
      +Leave blank to use the provider defaults.
       
      -endpoint> 1
      +Properties:
       
      -Option location_constraint.
      -Location constraint - must be set to match the Region.
      -Leave blank if not sure. Used when creating buckets only.
      -Enter a value. Press Enter to leave empty.
      -location_constraint>
      +- Config:      auth_url
      +- Env Var:     RCLONE_BOX_AUTH_URL
      +- Type:        string
      +- Required:    false
       
      -Edit advanced config? (y/n)
      -y) Yes
      -n) No
      -y/n> y
      +#### --box-token-url
       
      -Option no_check_bucket.
      -If set, don't attempt to check the bucket exists or create it.
      -This can be useful when trying to minimise the number of transactions
      -rclone does if you know the bucket exists already.
      -It can also be needed if the user you are using does not have bucket
      -creation permissions. Before v1.52.0 this would have passed silently
      -due to a bug.
      -Enter a boolean value (true or false). Press Enter for the default (true).
      +Token server url.
       
      -no_check_bucket> true
      +Leave blank to use the provider defaults.
       
      -Configuration complete.
      -Options:
      -- type: s3
      -- provider: Synology
      -- region: eu-001
      -- endpoint: eu-001.s3.synologyc2.net
      -- no_check_bucket: true
      -Keep this "syno" remote?
      -y) Yes this is OK (default)
      -e) Edit this remote
      -d) Delete this remote
      +Properties:
       
      -y/e/d> y
      +- Config:      token_url
      +- Env Var:     RCLONE_BOX_TOKEN_URL
      +- Type:        string
      +- Required:    false
       
      -#  Backblaze B2
      +#### --box-root-folder-id
       
      -B2 is [Backblaze's cloud storage system](https://www.backblaze.com/b2/).
      +Fill in for rclone to use a non root folder as its starting point.
       
      -Paths are specified as `remote:bucket` (or `remote:` for the `lsd`
      -command.)  You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`.
      +Properties:
       
      -## Configuration
      +- Config:      root_folder_id
      +- Env Var:     RCLONE_BOX_ROOT_FOLDER_ID
      +- Type:        string
      +- Default:     "0"
       
      -Here is an example of making a b2 configuration.  First run
      +#### --box-upload-cutoff
       
      -    rclone config
      +Cutoff for switching to multipart upload (>= 50 MiB).
       
      -This will guide you through an interactive setup process.  To authenticate
      -you will either need your Account ID (a short hex number) and Master
      -Application Key (a long hex number) OR an Application Key, which is the
      -recommended method. See below for further details on generating and using
      -an Application Key.
      -
      -

      No remotes found, make a new one? n) New remote q) Quit config n/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Backblaze B2  "b2" [snip] Storage> b2 Account ID or Application Key ID account> 123456789abc Application Key key> 0123456789abcdef0123456789abcdef0123456789 Endpoint for the service - leave blank normally. endpoint> Remote config -------------------- [remote] account = 123456789abc key = 0123456789abcdef0123456789abcdef0123456789 endpoint = -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

      -
      
      -This remote is called `remote` and can now be used like this
      +Properties:
       
      -See all buckets
      +- Config:      upload_cutoff
      +- Env Var:     RCLONE_BOX_UPLOAD_CUTOFF
      +- Type:        SizeSuffix
      +- Default:     50Mi
       
      -    rclone lsd remote:
      +#### --box-commit-retries
       
      -Create a new bucket
      +Max number of times to try committing a multipart file.
       
      -    rclone mkdir remote:bucket
      +Properties:
       
      -List the contents of a bucket
      +- Config:      commit_retries
      +- Env Var:     RCLONE_BOX_COMMIT_RETRIES
      +- Type:        int
      +- Default:     100
       
      -    rclone ls remote:bucket
      +#### --box-list-chunk
       
      -Sync `/home/local/directory` to the remote bucket, deleting any
      -excess files in the bucket.
      +Size of listing chunk 1-1000.
       
      -    rclone sync --interactive /home/local/directory remote:bucket
      +Properties:
       
      -### Application Keys
      +- Config:      list_chunk
      +- Env Var:     RCLONE_BOX_LIST_CHUNK
      +- Type:        int
      +- Default:     1000
       
      -B2 supports multiple [Application Keys for different access permission
      -to B2 Buckets](https://www.backblaze.com/b2/docs/application_keys.html).
      +#### --box-owned-by
       
      -You can use these with rclone too; you will need to use rclone version 1.43
      -or later.
      +Only show items owned by the login (email address) passed in.
       
      -Follow Backblaze's docs to create an Application Key with the required
      -permission and add the `applicationKeyId` as the `account` and the
      -`Application Key` itself as the `key`.
      +Properties:
       
      -Note that you must put the _applicationKeyId_ as the `account` – you
      -can't use the master Account ID.  If you try then B2 will return 401
      -errors.
      +- Config:      owned_by
      +- Env Var:     RCLONE_BOX_OWNED_BY
      +- Type:        string
      +- Required:    false
       
      -### --fast-list
      +#### --box-impersonate
       
      -This remote supports `--fast-list` which allows you to use fewer
      -transactions in exchange for more memory. See the [rclone
      -docs](https://rclone.org/docs/#fast-list) for more details.
      +Impersonate this user ID when using a service account.
       
      -### Modified time
      +Setting this flag allows rclone, when using a JWT service account, to
      +act on behalf of another user by setting the as-user header.
       
      -The modified time is stored as metadata on the object as
      -`X-Bz-Info-src_last_modified_millis` as milliseconds since 1970-01-01
      -in the Backblaze standard.  Other tools should be able to use this as
      -a modified time.
      +The user ID is the Box identifier for a user. User IDs can found for
      +any user via the GET /users endpoint, which is only available to
      +admins, or by calling the GET /users/me endpoint with an authenticated
      +user session.
       
      -Modified times are used in syncing and are fully supported. Note that
      -if a modification time needs to be updated on an object then it will
      -create a new version of the object.
      +See: https://developer.box.com/guides/authentication/jwt/as-user/
       
      -### Restricted filename characters
       
      -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
      -the following characters are also replaced:
      +Properties:
       
      -| Character | Value | Replacement |
      -| --------- |:-----:|:-----------:|
      -| \         | 0x5C  | \           |
      +- Config:      impersonate
      +- Env Var:     RCLONE_BOX_IMPERSONATE
      +- Type:        string
      +- Required:    false
       
      -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
      -as they can't be used in JSON strings.
      +#### --box-encoding
       
      -Note that in 2020-05 Backblaze started allowing \ characters in file
      -names. Rclone hasn't changed its encoding as this could cause syncs to
      -re-transfer files. If you want rclone not to replace \ then see the
      -`--b2-encoding` flag below and remove the `BackSlash` from the
      -string. This can be set in the config.
      +The encoding for the backend.
       
      -### SHA1 checksums
      +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
       
      -The SHA1 checksums of the files are checked on upload and download and
      -will be used in the syncing process.
      +Properties:
       
      -Large files (bigger than the limit in `--b2-upload-cutoff`) which are
      -uploaded in chunks will store their SHA1 on the object as
      -`X-Bz-Info-large_file_sha1` as recommended by Backblaze.
      +- Config:      encoding
      +- Env Var:     RCLONE_BOX_ENCODING
      +- Type:        Encoding
      +- Default:     Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot
       
      -For a large file to be uploaded with an SHA1 checksum, the source
      -needs to support SHA1 checksums. The local disk supports SHA1
      -checksums so large file transfers from local disk will have an SHA1.
      -See [the overview](https://rclone.org/overview/#features) for exactly which remotes
      -support SHA1.
       
      -Sources which don't support SHA1, in particular `crypt` will upload
      -large files without SHA1 checksums.  This may be fixed in the future
      -(see [#1767](https://github.com/rclone/rclone/issues/1767)).
       
      -Files sizes below `--b2-upload-cutoff` will always have an SHA1
      -regardless of the source.
      +## Limitations
       
      -### Transfers
      +Note that Box is case insensitive so you can't have a file called
      +"Hello.doc" and one called "hello.doc".
       
      -Backblaze recommends that you do lots of transfers simultaneously for
      -maximum speed.  In tests from my SSD equipped laptop the optimum
      -setting is about `--transfers 32` though higher numbers may be used
      -for a slight speed improvement. The optimum number for you may vary
      -depending on your hardware, how big the files are, how much you want
      -to load your computer, etc.  The default of `--transfers 4` is
      -definitely too low for Backblaze B2 though.
      +Box file names can't have the `\` character in.  rclone maps this to
      +and from an identical looking unicode equivalent `\` (U+FF3C Fullwidth
      +Reverse Solidus).
       
      -Note that uploading big files (bigger than 200 MiB by default) will use
      -a 96 MiB RAM buffer by default.  There can be at most `--transfers` of
      -these in use at any moment, so this sets the upper limit on the memory
      -used.
      +Box only supports filenames up to 255 characters in length.
       
      -### Versions
      +Box has [API rate limits](https://developer.box.com/guides/api-calls/permissions-and-errors/rate-limits/) that sometimes reduce the speed of rclone.
       
      -When rclone uploads a new version of a file it creates a [new version
      -of it](https://www.backblaze.com/b2/docs/file_versions.html).
      -Likewise when you delete a file, the old version will be marked hidden
      -and still be available.  Conversely, you may opt in to a "hard delete"
      -of files with the `--b2-hard-delete` flag which would permanently remove
      -the file instead of hiding it.
      +`rclone about` is not supported by the Box backend. Backends without
      +this capability cannot determine free space for an rclone mount or
      +use policy `mfs` (most free space) as a member of an rclone union
      +remote.
       
      -Old versions of files, where available, are visible using the 
      -`--b2-versions` flag.
      +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/)
       
      -It is also possible to view a bucket as it was at a certain point in time,
      -using the `--b2-version-at` flag. This will show the file versions as they
      -were at that time, showing files that have been deleted afterwards, and
      -hiding files that were created since.
      +## Get your own Box App ID
       
      -If you wish to remove all the old versions then you can use the
      -`rclone cleanup remote:bucket` command which will delete all the old
      -versions of files, leaving the current ones intact.  You can also
      -supply a path and only old versions under that path will be deleted,
      -e.g. `rclone cleanup remote:bucket/path/to/stuff`.
      +Here is how to create your own Box App ID for rclone:
       
      -Note that `cleanup` will remove partially uploaded files from the bucket
      -if they are more than a day old.
      +1. Go to the [Box Developer Console](https://app.box.com/developers/console)
      +and login, then click `My Apps` on the sidebar. Click `Create New App`
      +and select `Custom App`.
       
      -When you `purge` a bucket, the current and the old versions will be
      -deleted then the bucket will be deleted.
      +2. In the first screen on the box that pops up, you can pretty much enter
      +whatever you want. The `App Name` can be whatever. For `Purpose` choose
      +automation to avoid having to fill out anything else. Click `Next`.
       
      -However `delete` will cause the current versions of the files to
      -become hidden old versions.
      +3. In the second screen of the creation screen, select
      +`User Authentication (OAuth 2.0)`. Then click `Create App`.
       
      -Here is a session showing the listing and retrieval of an old
      -version followed by a `cleanup` of the old versions.
      +4. You should now be on the `Configuration` tab of your new app. If not,
      +click on it at the top of the webpage. Copy down `Client ID`
      +and `Client Secret`, you'll need those for rclone.
       
      -Show current version and all the versions with `--b2-versions` flag.
      -
      -

      $ rclone -q ls b2:cleanup-test 9 one.txt

      -

      $ rclone -q --b2-versions ls b2:cleanup-test 9 one.txt 8 one-v2016-07-04-141032-000.txt 16 one-v2016-07-04-141003-000.txt 15 one-v2016-07-02-155621-000.txt

      -
      
      -Retrieve an old version
      -
      -

      $ rclone -q --b2-versions copy b2:cleanup-test/one-v2016-07-04-141003-000.txt /tmp

      -

      $ ls -l /tmp/one-v2016-07-04-141003-000.txt -rw-rw-r-- 1 ncw ncw 16 Jul 2 17:46 /tmp/one-v2016-07-04-141003-000.txt

      -
      
      -Clean up all the old versions and show that they've gone.
      -
      -

      $ rclone -q cleanup b2:cleanup-test

      -

      $ rclone -q ls b2:cleanup-test 9 one.txt

      -

      $ rclone -q --b2-versions ls b2:cleanup-test 9 one.txt

      -
      
      -#### Versions naming caveat
      +5. Under "OAuth 2.0 Redirect URI", add `http://127.0.0.1:53682/`
       
      -When using `--b2-versions` flag rclone is relying on the file name
      -to work out whether the objects are versions or not. Versions' names
      -are created by inserting timestamp between file name and its extension.
      -
          9 file.txt
      -    8 file-v2023-07-17-161032-000.txt
      -   16 file-v2023-06-15-141003-000.txt
      -
      If there are real files present with the same names as versions, then
      -behaviour of `--b2-versions` can be unpredictable.
      +6. For `Application Scopes`, select `Read all files and folders stored in Box`
      +and `Write all files and folders stored in box` (assuming you want to do both).
      +Leave others unchecked. Click `Save Changes` at the top right.
       
      -### Data usage
      +#  Cache
       
      -It is useful to know how many requests are sent to the server in different scenarios.
      +The `cache` remote wraps another existing remote and stores file structure
      +and its data for long running tasks like `rclone mount`.
       
      -All copy commands send the following 4 requests:
      -
      -

      /b2api/v1/b2_authorize_account /b2api/v1/b2_create_bucket /b2api/v1/b2_list_buckets /b2api/v1/b2_list_file_names

      -
      
      -The `b2_list_file_names` request will be sent once for every 1k files
      -in the remote path, providing the checksum and modification time of
      -the listed files. As of version 1.33 issue
      -[#818](https://github.com/rclone/rclone/issues/818) causes extra requests
      -to be sent when using B2 with Crypt. When a copy operation does not
      -require any files to be uploaded, no more requests will be sent.
      +## Status
      +
      +The cache backend code is working but it currently doesn't
      +have a maintainer so there are [outstanding bugs](https://github.com/rclone/rclone/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3A%22Remote%3A+Cache%22) which aren't getting fixed.
       
      -Uploading files that do not require chunking, will send 2 requests per
      -file upload:
      -
      -

      /b2api/v1/b2_get_upload_url /b2api/v1/b2_upload_file/

      -
      
      -Uploading files requiring chunking, will send 2 requests (one each to
      -start and finish the upload) and another 2 requests for each chunk:
      -
      -

      /b2api/v1/b2_start_large_file /b2api/v1/b2_get_upload_part_url /b2api/v1/b2_upload_part/ /b2api/v1/b2_finish_large_file

      -
      
      -#### Versions
      +The cache backend is due to be phased out in favour of the VFS caching
      +layer eventually which is more tightly integrated into rclone.
       
      -Versions can be viewed with the `--b2-versions` flag. When it is set
      -rclone will show and act on older versions of files.  For example
      +Until this happens we recommend only using the cache backend if you
      +find you can't work without it. There are many docs online describing
      +the use of the cache backend to minimize API hits and by-and-large
      +these are out of date and the cache backend isn't needed in those
      +scenarios any more.
       
      -Listing without `--b2-versions`
      -
      -

      $ rclone -q ls b2:cleanup-test 9 one.txt

      -
      
      -And with
      -
      -

      $ rclone -q --b2-versions ls b2:cleanup-test 9 one.txt 8 one-v2016-07-04-141032-000.txt 16 one-v2016-07-04-141003-000.txt 15 one-v2016-07-02-155621-000.txt

      -
      
      -Showing that the current version is unchanged but older versions can
      -be seen.  These have the UTC date that they were uploaded to the
      -server to the nearest millisecond appended to them.
      +## Configuration
       
      -Note that when using `--b2-versions` no file write operations are
      -permitted, so you can't upload files or delete them.
      +To get started you just need to have an existing remote which can be configured
      +with `cache`.
       
      -### B2 and rclone link
      +Here is an example of how to make a remote called `test-cache`.  First run:
       
      -Rclone supports generating file share links for private B2 buckets.
      -They can either be for a file for example:
      -
      -

      ./rclone link B2:bucket/path/to/file.txt https://f002.backblazeb2.com/file/bucket/path/to/file.txt?Authorization=xxxxxxxx

      -
      
      -or if run on a directory you will get:
      -
      -

      ./rclone link B2:bucket/path https://f002.backblazeb2.com/file/bucket/path?Authorization=xxxxxxxx

      -
      
      -you can then use the authorization token (the part of the url from the
      - `?Authorization=` on) on any file path under that directory. For example:
      +     rclone config
      +
      +This will guide you through an interactive setup process:
       
      -

      https://f002.backblazeb2.com/file/bucket/path/to/file1?Authorization=xxxxxxxx https://f002.backblazeb2.com/file/bucket/path/file2?Authorization=xxxxxxxx https://f002.backblazeb2.com/file/bucket/path/folder/file3?Authorization=xxxxxxxx

      +

      No remotes found, make a new one? n) New remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config n/r/c/s/q> n name> test-cache Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Cache a remote  "cache" [snip] Storage> cache Remote to cache. Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", "myremote:bucket" or maybe "myremote:" (not recommended). remote> local:/test Optional: The URL of the Plex server plex_url> http://127.0.0.1:32400 Optional: The username of the Plex user plex_username> dummyusername Optional: The password of the Plex user y) Yes type in my own password g) Generate random password n) No leave this optional password blank y/g/n> y Enter the password: password: Confirm the password: password: The size of a chunk. Lower value good for slow connections but can affect seamless reading. Default: 5M Choose a number from below, or type in your own value 1 / 1 MiB  "1M" 2 / 5 MiB  "5M" 3 / 10 MiB  "10M" chunk_size> 2 How much time should object info (file size, file hashes, etc.) be stored in cache. Use a very high value if you don't plan on changing the source FS from outside the cache. Accepted units are: "s", "m", "h". Default: 5m Choose a number from below, or type in your own value 1 / 1 hour  "1h" 2 / 24 hours  "24h" 3 / 24 hours  "48h" info_age> 2 The maximum size of stored chunks. When the storage grows beyond this size, the oldest chunks will be deleted. Default: 10G Choose a number from below, or type in your own value 1 / 500 MiB  "500M" 2 / 1 GiB  "1G" 3 / 10 GiB  "10G" chunk_total_size> 3 Remote config -------------------- [test-cache] remote = local:/test plex_url = http://127.0.0.1:32400 plex_username = dummyusername plex_password = *** ENCRYPTED *** chunk_size = 5M info_age = 48h chunk_total_size = 10G

      
      +You can then use it like this,
       
      -### Standard options
      -
      -Here are the Standard options specific to b2 (Backblaze B2).
      -
      -#### --b2-account
      +List directories in top level of your drive
       
      -Account ID or Application Key ID.
      +    rclone lsd test-cache:
       
      -Properties:
      +List all the files in your drive
       
      -- Config:      account
      -- Env Var:     RCLONE_B2_ACCOUNT
      -- Type:        string
      -- Required:    true
      +    rclone ls test-cache:
       
      -#### --b2-key
      +To start a cached mount
       
      -Application Key.
      +    rclone mount --allow-other test-cache: /var/tmp/test-cache
       
      -Properties:
      +### Write Features ###
       
      -- Config:      key
      -- Env Var:     RCLONE_B2_KEY
      -- Type:        string
      -- Required:    true
      +### Offline uploading ###
       
      -#### --b2-hard-delete
      +In an effort to make writing through cache more reliable, the backend 
      +now supports this feature which can be activated by specifying a
      +`cache-tmp-upload-path`.
       
      -Permanently delete files on remote removal, otherwise hide files.
      +A files goes through these states when using this feature:
       
      -Properties:
      +1. An upload is started (usually by copying a file on the cache remote)
      +2. When the copy to the temporary location is complete the file is part 
      +of the cached remote and looks and behaves like any other file (reading included)
      +3. After `cache-tmp-wait-time` passes and the file is next in line, `rclone move` 
      +is used to move the file to the cloud provider
      +4. Reading the file still works during the upload but most modifications on it will be prohibited
      +5. Once the move is complete the file is unlocked for modifications as it
      +becomes as any other regular file
      +6. If the file is being read through `cache` when it's actually
      +deleted from the temporary path then `cache` will simply swap the source
      +to the cloud provider without interrupting the reading (small blip can happen though)
       
      -- Config:      hard_delete
      -- Env Var:     RCLONE_B2_HARD_DELETE
      -- Type:        bool
      -- Default:     false
      +Files are uploaded in sequence and only one file is uploaded at a time.
      +Uploads will be stored in a queue and be processed based on the order they were added.
      +The queue and the temporary storage is persistent across restarts but
      +can be cleared on startup with the `--cache-db-purge` flag.
       
      -### Advanced options
      +### Write Support ###
       
      -Here are the Advanced options specific to b2 (Backblaze B2).
      +Writes are supported through `cache`.
      +One caveat is that a mounted cache remote does not add any retry or fallback
      +mechanism to the upload operation. This will depend on the implementation
      +of the wrapped remote. Consider using `Offline uploading` for reliable writes.
       
      -#### --b2-endpoint
      +One special case is covered with `cache-writes` which will cache the file
      +data at the same time as the upload when it is enabled making it available
      +from the cache store immediately once the upload is finished.
       
      -Endpoint for the service.
      +### Read Features ###
       
      -Leave blank normally.
      +#### Multiple connections ####
       
      -Properties:
      +To counter the high latency between a local PC where rclone is running
      +and cloud providers, the cache remote can split multiple requests to the
      +cloud provider for smaller file chunks and combines them together locally
      +where they can be available almost immediately before the reader usually
      +needs them.
       
      -- Config:      endpoint
      -- Env Var:     RCLONE_B2_ENDPOINT
      -- Type:        string
      -- Required:    false
      +This is similar to buffering when media files are played online. Rclone
      +will stay around the current marker but always try its best to stay ahead
      +and prepare the data before.
       
      -#### --b2-test-mode
      +#### Plex Integration ####
       
      -A flag string for X-Bz-Test-Mode header for debugging.
      +There is a direct integration with Plex which allows cache to detect during reading
      +if the file is in playback or not. This helps cache to adapt how it queries
      +the cloud provider depending on what is needed for.
       
      -This is for debugging purposes only. Setting it to one of the strings
      -below will cause b2 to return specific errors:
      +Scans will have a minimum amount of workers (1) while in a confirmed playback cache
      +will deploy the configured number of workers.
       
      -  * "fail_some_uploads"
      -  * "expire_some_account_authorization_tokens"
      -  * "force_cap_exceeded"
      +This integration opens the doorway to additional performance improvements
      +which will be explored in the near future.
       
      -These will be set in the "X-Bz-Test-Mode" header which is documented
      -in the [b2 integrations checklist](https://www.backblaze.com/b2/docs/integration_checklist.html).
      +**Note:** If Plex options are not configured, `cache` will function with its
      +configured options without adapting any of its settings.
       
      -Properties:
      +How to enable? Run `rclone config` and add all the Plex options (endpoint, username
      +and password) in your remote and it will be automatically enabled.
       
      -- Config:      test_mode
      -- Env Var:     RCLONE_B2_TEST_MODE
      -- Type:        string
      -- Required:    false
      +Affected settings:
      +- `cache-workers`: _Configured value_ during confirmed playback or _1_ all the other times
       
      -#### --b2-versions
      +##### Certificate Validation #####
       
      -Include old versions in directory listings.
      +When the Plex server is configured to only accept secure connections, it is
      +possible to use `.plex.direct` URLs to ensure certificate validation succeeds.
      +These URLs are used by Plex internally to connect to the Plex server securely.
       
      -Note that when using this no file write operations are permitted,
      -so you can't upload files or delete them.
      +The format for these URLs is the following:
       
      -Properties:
      +`https://ip-with-dots-replaced.server-hash.plex.direct:32400/`
       
      -- Config:      versions
      -- Env Var:     RCLONE_B2_VERSIONS
      -- Type:        bool
      -- Default:     false
      +The `ip-with-dots-replaced` part can be any IPv4 address, where the dots
      +have been replaced with dashes, e.g. `127.0.0.1` becomes `127-0-0-1`.
       
      -#### --b2-version-at
      +To get the `server-hash` part, the easiest way is to visit
       
      -Show file versions as they were at the specified time.
      +https://plex.tv/api/resources?includeHttps=1&X-Plex-Token=your-plex-token
       
      -Note that when using this no file write operations are permitted,
      -so you can't upload files or delete them.
      +This page will list all the available Plex servers for your account
      +with at least one `.plex.direct` link for each. Copy one URL and replace
      +the IP address with the desired address. This can be used as the
      +`plex_url` value.
       
      -Properties:
      +### Known issues ###
       
      -- Config:      version_at
      -- Env Var:     RCLONE_B2_VERSION_AT
      -- Type:        Time
      -- Default:     off
      +#### Mount and --dir-cache-time ####
       
      -#### --b2-upload-cutoff
      +--dir-cache-time controls the first layer of directory caching which works at the mount layer.
      +Being an independent caching mechanism from the `cache` backend, it will manage its own entries
      +based on the configured time.
       
      -Cutoff for switching to chunked upload.
      +To avoid getting in a scenario where dir cache has obsolete data and cache would have the correct
      +one, try to set `--dir-cache-time` to a lower time than `--cache-info-age`. Default values are
      +already configured in this way. 
       
      -Files above this size will be uploaded in chunks of "--b2-chunk-size".
      +#### Windows support - Experimental ####
       
      -This value should be set no larger than 4.657 GiB (== 5 GB).
      +There are a couple of issues with Windows `mount` functionality that still require some investigations.
      +It should be considered as experimental thus far as fixes come in for this OS.
       
      -Properties:
      +Most of the issues seem to be related to the difference between filesystems
      +on Linux flavors and Windows as cache is heavily dependent on them.
       
      -- Config:      upload_cutoff
      -- Env Var:     RCLONE_B2_UPLOAD_CUTOFF
      -- Type:        SizeSuffix
      -- Default:     200Mi
      +Any reports or feedback on how cache behaves on this OS is greatly appreciated.
      + 
      +- https://github.com/rclone/rclone/issues/1935
      +- https://github.com/rclone/rclone/issues/1907
      +- https://github.com/rclone/rclone/issues/1834 
       
      -#### --b2-copy-cutoff
      +#### Risk of throttling ####
       
      -Cutoff for switching to multipart copy.
      +Future iterations of the cache backend will make use of the pooling functionality
      +of the cloud provider to synchronize and at the same time make writing through it
      +more tolerant to failures. 
       
      -Any files larger than this that need to be server-side copied will be
      -copied in chunks of this size.
      +There are a couple of enhancements in track to add these but in the meantime
      +there is a valid concern that the expiring cache listings can lead to cloud provider
      +throttles or bans due to repeated queries on it for very large mounts.
       
      -The minimum is 0 and the maximum is 4.6 GiB.
      +Some recommendations:
      +- don't use a very small interval for entry information (`--cache-info-age`)
      +- while writes aren't yet optimised, you can still write through `cache` which gives you the advantage
      +of adding the file in the cache at the same time if configured to do so.
       
      -Properties:
      +Future enhancements:
       
      -- Config:      copy_cutoff
      -- Env Var:     RCLONE_B2_COPY_CUTOFF
      -- Type:        SizeSuffix
      -- Default:     4Gi
      +- https://github.com/rclone/rclone/issues/1937
      +- https://github.com/rclone/rclone/issues/1936 
       
      -#### --b2-chunk-size
      +#### cache and crypt ####
       
      -Upload chunk size.
      +One common scenario is to keep your data encrypted in the cloud provider
      +using the `crypt` remote. `crypt` uses a similar technique to wrap around
      +an existing remote and handles this translation in a seamless way.
       
      -When uploading large files, chunk the file into this size.
      +There is an issue with wrapping the remotes in this order:
      +**cloud remote** -> **crypt** -> **cache**
       
      -Must fit in memory. These chunks are buffered in memory and there
      -might a maximum of "--transfers" chunks in progress at once.
      +During testing, I experienced a lot of bans with the remotes in this order.
      +I suspect it might be related to how crypt opens files on the cloud provider
      +which makes it think we're downloading the full file instead of small chunks.
      +Organizing the remotes in this order yields better results:
      +**cloud remote** -> **cache** -> **crypt**
       
      -5,000,000 Bytes is the minimum size.
      +#### absolute remote paths ####
       
      -Properties:
      +`cache` can not differentiate between relative and absolute paths for the wrapped remote.
      +Any path given in the `remote` config setting and on the command line will be passed to
      +the wrapped remote as is, but for storing the chunks on disk the path will be made
      +relative by removing any leading `/` character.
       
      -- Config:      chunk_size
      -- Env Var:     RCLONE_B2_CHUNK_SIZE
      -- Type:        SizeSuffix
      -- Default:     96Mi
      +This behavior is irrelevant for most backend types, but there are backends where a leading `/`
      +changes the effective directory, e.g. in the `sftp` backend paths starting with a `/` are
      +relative to the root of the SSH server and paths without are relative to the user home directory.
      +As a result `sftp:bin` and `sftp:/bin` will share the same cache folder, even if they represent
      +a different directory on the SSH server.
       
      -#### --b2-upload-concurrency
      +### Cache and Remote Control (--rc) ###
      +Cache supports the new `--rc` mode in rclone and can be remote controlled through the following end points:
      +By default, the listener is disabled if you do not add the flag.
       
      -Concurrency for multipart uploads.
      +### rc cache/expire
      +Purge a remote from the cache backend. Supports either a directory or a file.
      +It supports both encrypted and unencrypted file names if cache is wrapped by crypt.
       
      -This is the number of chunks of the same file that are uploaded
      -concurrently.
      +Params:
      +  - **remote** = path to remote **(required)**
      +  - **withData** = true/false to delete cached data (chunks) as well _(optional, false by default)_
       
      -Note that chunks are stored in memory and there may be up to
      -"--transfers" * "--b2-upload-concurrency" chunks stored at once
      -in memory.
       
      -Properties:
      +### Standard options
       
      -- Config:      upload_concurrency
      -- Env Var:     RCLONE_B2_UPLOAD_CONCURRENCY
      -- Type:        int
      -- Default:     16
      +Here are the Standard options specific to cache (Cache a remote).
       
      -#### --b2-disable-checksum
      +#### --cache-remote
       
      -Disable checksums for large (> upload cutoff) files.
      +Remote to cache.
       
      -Normally rclone will calculate the SHA1 checksum of the input before
      -uploading it so it can add it to metadata on the object. This is great
      -for data integrity checking but can cause long delays for large files
      -to start uploading.
      +Normally should contain a ':' and a path, e.g. "myremote:path/to/dir",
      +"myremote:bucket" or maybe "myremote:" (not recommended).
       
       Properties:
       
      -- Config:      disable_checksum
      -- Env Var:     RCLONE_B2_DISABLE_CHECKSUM
      -- Type:        bool
      -- Default:     false
      +- Config:      remote
      +- Env Var:     RCLONE_CACHE_REMOTE
      +- Type:        string
      +- Required:    true
       
      -#### --b2-download-url
      +#### --cache-plex-url
       
      -Custom endpoint for downloads.
      +The URL of the Plex server.
       
      -This is usually set to a Cloudflare CDN URL as Backblaze offers
      -free egress for data downloaded through the Cloudflare network.
      -Rclone works with private buckets by sending an "Authorization" header.
      -If the custom endpoint rewrites the requests for authentication,
      -e.g., in Cloudflare Workers, this header needs to be handled properly.
      -Leave blank if you want to use the endpoint provided by Backblaze.
      +Properties:
       
      -The URL provided here SHOULD have the protocol and SHOULD NOT have
      -a trailing slash or specify the /file/bucket subpath as rclone will
      -request files with "{download_url}/file/{bucket_name}/{path}".
      +- Config:      plex_url
      +- Env Var:     RCLONE_CACHE_PLEX_URL
      +- Type:        string
      +- Required:    false
       
      -Example:
      -> https://mysubdomain.mydomain.tld
      -(No trailing "/", "file" or "bucket")
      +#### --cache-plex-username
      +
      +The username of the Plex user.
       
       Properties:
       
      -- Config:      download_url
      -- Env Var:     RCLONE_B2_DOWNLOAD_URL
      +- Config:      plex_username
      +- Env Var:     RCLONE_CACHE_PLEX_USERNAME
       - Type:        string
       - Required:    false
       
      -#### --b2-download-auth-duration
      +#### --cache-plex-password
       
      -Time before the authorization token will expire in s or suffix ms|s|m|h|d.
      +The password of the Plex user.
       
      -The duration before the download authorization token will expire.
      -The minimum value is 1 second. The maximum value is one week.
      +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
       
       Properties:
       
      -- Config:      download_auth_duration
      -- Env Var:     RCLONE_B2_DOWNLOAD_AUTH_DURATION
      -- Type:        Duration
      -- Default:     1w
      +- Config:      plex_password
      +- Env Var:     RCLONE_CACHE_PLEX_PASSWORD
      +- Type:        string
      +- Required:    false
       
      -#### --b2-memory-pool-flush-time
      +#### --cache-chunk-size
       
      -How often internal memory buffer pools will be flushed. (no longer used)
      +The size of a chunk (partial file data).
      +
      +Use lower numbers for slower connections. If the chunk size is
      +changed, any downloaded chunks will be invalid and cache-chunk-path
      +will need to be cleared or unexpected EOF errors will occur.
       
       Properties:
       
      -- Config:      memory_pool_flush_time
      -- Env Var:     RCLONE_B2_MEMORY_POOL_FLUSH_TIME
      -- Type:        Duration
      -- Default:     1m0s
      +- Config:      chunk_size
      +- Env Var:     RCLONE_CACHE_CHUNK_SIZE
      +- Type:        SizeSuffix
      +- Default:     5Mi
      +- Examples:
      +    - "1M"
      +        - 1 MiB
      +    - "5M"
      +        - 5 MiB
      +    - "10M"
      +        - 10 MiB
       
      -#### --b2-memory-pool-use-mmap
      +#### --cache-info-age
       
      -Whether to use mmap buffers in internal memory pool. (no longer used)
      +How long to cache file structure information (directory listings, file size, times, etc.). 
      +If all write operations are done through the cache then you can safely make
      +this value very large as the cache store will also be updated in real time.
       
       Properties:
       
      -- Config:      memory_pool_use_mmap
      -- Env Var:     RCLONE_B2_MEMORY_POOL_USE_MMAP
      -- Type:        bool
      -- Default:     false
      +- Config:      info_age
      +- Env Var:     RCLONE_CACHE_INFO_AGE
      +- Type:        Duration
      +- Default:     6h0m0s
      +- Examples:
      +    - "1h"
      +        - 1 hour
      +    - "24h"
      +        - 24 hours
      +    - "48h"
      +        - 48 hours
       
      -#### --b2-encoding
      +#### --cache-chunk-total-size
       
      -The encoding for the backend.
      +The total size that the chunks can take up on the local disk.
       
      -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
      +If the cache exceeds this value then it will start to delete the
      +oldest chunks until it goes under this value.
       
       Properties:
       
      -- Config:      encoding
      -- Env Var:     RCLONE_B2_ENCODING
      -- Type:        MultiEncoder
      -- Default:     Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot
      -
      -
      +- Config:      chunk_total_size
      +- Env Var:     RCLONE_CACHE_CHUNK_TOTAL_SIZE
      +- Type:        SizeSuffix
      +- Default:     10Gi
      +- Examples:
      +    - "500M"
      +        - 500 MiB
      +    - "1G"
      +        - 1 GiB
      +    - "10G"
      +        - 10 GiB
       
      -## Limitations
      +### Advanced options
       
      -`rclone about` is not supported by the B2 backend. Backends without
      -this capability cannot determine free space for an rclone mount or
      -use policy `mfs` (most free space) as a member of an rclone union
      -remote.
      +Here are the Advanced options specific to cache (Cache a remote).
       
      -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/)
      +#### --cache-plex-token
       
      -#  Box
      +The plex token for authentication - auto set normally.
       
      -Paths are specified as `remote:path`
      +Properties:
       
      -Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
      +- Config:      plex_token
      +- Env Var:     RCLONE_CACHE_PLEX_TOKEN
      +- Type:        string
      +- Required:    false
       
      -The initial setup for Box involves getting a token from Box which you
      -can do either in your browser, or with a config.json downloaded from Box
      -to use JWT authentication.  `rclone config` walks you through it.
      +#### --cache-plex-insecure
       
      -## Configuration
      +Skip all certificate verification when connecting to the Plex server.
       
      -Here is an example of how to make a remote called `remote`.  First run:
      +Properties:
       
      -     rclone config
      +- Config:      plex_insecure
      +- Env Var:     RCLONE_CACHE_PLEX_INSECURE
      +- Type:        string
      +- Required:    false
       
      -This will guide you through an interactive setup process:
      -
      -

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Box  "box" [snip] Storage> box Box App Client Id - leave blank normally. client_id> Box App Client Secret - leave blank normally. client_secret> Box App config.json location Leave blank normally. Enter a string value. Press Enter for the default (""). box_config_file> Box App Primary Access Token Leave blank normally. Enter a string value. Press Enter for the default (""). access_token>

      -

      Enter a string value. Press Enter for the default ("user"). Choose a number from below, or type in your own value 1 / Rclone should act on behalf of a user  "user" 2 / Rclone should act on behalf of a service account  "enterprise" box_sub_type> Remote config Use web browser to automatically authenticate rclone with remote? * Say Y if the machine running rclone has a web browser you can use * Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N. 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 = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"XXX"} -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

      -
      
      -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a
      -machine with no Internet browser available.
      +#### --cache-db-path
       
      -Note that rclone runs a webserver on your local machine to collect the
      -token as returned from Box. This only runs from the moment it opens
      -your browser to the moment you get back the verification code.  This
      -is on `http://127.0.0.1:53682/` and this it may require you to unblock
      -it temporarily if you are running a host firewall.
      +Directory to store file structure metadata DB.
       
      -Once configured you can then use `rclone` like this,
      +The remote name is used as the DB file name.
       
      -List directories in top level of your Box
      +Properties:
       
      -    rclone lsd remote:
      +- Config:      db_path
      +- Env Var:     RCLONE_CACHE_DB_PATH
      +- Type:        string
      +- Default:     "$HOME/.cache/rclone/cache-backend"
       
      -List all the files in your Box
      +#### --cache-chunk-path
       
      -    rclone ls remote:
      +Directory to cache chunk files.
       
      -To copy a local directory to an Box directory called backup
      +Path to where partial file data (chunks) are stored locally. The remote
      +name is appended to the final path.
       
      -    rclone copy /home/source remote:backup
      +This config follows the "--cache-db-path". If you specify a custom
      +location for "--cache-db-path" and don't specify one for "--cache-chunk-path"
      +then "--cache-chunk-path" will use the same path as "--cache-db-path".
       
      -### Using rclone with an Enterprise account with SSO
      +Properties:
       
      -If you have an "Enterprise" account type with Box with single sign on
      -(SSO), you need to create a password to use Box with rclone. This can
      -be done at your Enterprise Box account by going to Settings, "Account"
      -Tab, and then set the password in the "Authentication" field.
      +- Config:      chunk_path
      +- Env Var:     RCLONE_CACHE_CHUNK_PATH
      +- Type:        string
      +- Default:     "$HOME/.cache/rclone/cache-backend"
       
      -Once you have done this, you can setup your Enterprise Box account
      -using the same procedure detailed above in the, using the password you
      -have just set.
      +#### --cache-db-purge
       
      -### Invalid refresh token
      +Clear all the cached data for this remote on start.
       
      -According to the [box docs](https://developer.box.com/v2.0/docs/oauth-20#section-6-using-the-access-and-refresh-tokens):
      +Properties:
       
      -> Each refresh_token is valid for one use in 60 days.
      +- Config:      db_purge
      +- Env Var:     RCLONE_CACHE_DB_PURGE
      +- Type:        bool
      +- Default:     false
       
      -This means that if you
      +#### --cache-chunk-clean-interval
       
      -  * Don't use the box remote for 60 days
      -  * Copy the config file with a box refresh token in and use it in two places
      -  * Get an error on a token refresh
      +How often should the cache perform cleanups of the chunk storage.
       
      -then rclone will return an error which includes the text `Invalid
      -refresh token`.
      +The default value should be ok for most people. If you find that the
      +cache goes over "cache-chunk-total-size" too often then try to lower
      +this value to force it to perform cleanups more often.
       
      -To fix this you will need to use oauth2 again to update the refresh
      -token.  You can use the methods in [the remote setup
      -docs](https://rclone.org/remote_setup/), bearing in mind that if you use the copy the
      -config file method, you should not use that remote on the computer you
      -did the authentication on.
      +Properties:
       
      -Here is how to do it.
      -
      -

      $ rclone config Current remotes:

      -

      Name Type ==== ==== remote box

      -
        -
      1. Edit existing remote
      2. -
      3. New remote
      4. -
      5. Delete remote
      6. -
      7. Rename remote
      8. -
      9. Copy remote
      10. -
      11. Set configuration password
      12. -
      13. Quit config e/n/d/r/c/s/q> e Choose a number from below, or type in an existing value 1 > remote remote> remote -------------------- [remote] type = box token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2017-07-08T23:40:08.059167677+01:00"} -------------------- Edit remote Value "client_id" = "" Edit? (y/n)>
      14. -
      15. Yes
      16. -
      17. No y/n> n Value "client_secret" = "" Edit? (y/n)>
      18. -
      19. Yes
      20. -
      21. No y/n> n Remote config Already have a token - refresh?
      22. -
      23. Yes
      24. -
      25. No y/n> y Use web browser to automatically authenticate rclone with remote?
      26. -
      -
        -
      • Say Y if the machine running rclone has a web browser you can use
      • -
      • Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N.
      • -
      -
        -
      1. Yes
      2. -
      3. 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] type = box token = {"access_token":"YYY","token_type":"bearer","refresh_token":"YYY","expiry":"2017-07-23T12:22:29.259137901+01:00"} --------------------
      4. -
      5. Yes this is OK
      6. -
      7. Edit this remote
      8. -
      9. Delete this remote y/e/d> y
      10. -
      -
      
      -### Modified time and hashes
      +- Config:      chunk_clean_interval
      +- Env Var:     RCLONE_CACHE_CHUNK_CLEAN_INTERVAL
      +- Type:        Duration
      +- Default:     1m0s
       
      -Box allows modification times to be set on objects accurate to 1
      -second.  These will be used to detect whether objects need syncing or
      -not.
      +#### --cache-read-retries
       
      -Box supports SHA1 type hashes, so you can use the `--checksum`
      -flag.
      +How many times to retry a read from a cache storage.
       
      -### Restricted filename characters
      +Since reading from a cache stream is independent from downloading file
      +data, readers can get to a point where there's no more data in the
      +cache.  Most of the times this can indicate a connectivity issue if
      +cache isn't able to provide file data anymore.
       
      -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
      -the following characters are also replaced:
      +For really slow connections, increase this to a point where the stream is
      +able to provide data but your experience will be very stuttering.
       
      -| Character | Value | Replacement |
      -| --------- |:-----:|:-----------:|
      -| \         | 0x5C  | \           |
      +Properties:
       
      -File names can also not end with the following characters.
      -These only get replaced if they are the last character in the name:
      +- Config:      read_retries
      +- Env Var:     RCLONE_CACHE_READ_RETRIES
      +- Type:        int
      +- Default:     10
       
      -| Character | Value | Replacement |
      -| --------- |:-----:|:-----------:|
      -| SP        | 0x20  | ␠           |
      +#### --cache-workers
       
      -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
      -as they can't be used in JSON strings.
      +How many workers should run in parallel to download chunks.
       
      -### Transfers
      +Higher values will mean more parallel processing (better CPU needed)
      +and more concurrent requests on the cloud provider.  This impacts
      +several aspects like the cloud provider API limits, more stress on the
      +hardware that rclone runs on but it also means that streams will be
      +more fluid and data will be available much more faster to readers.
       
      -For files above 50 MiB rclone will use a chunked transfer.  Rclone will
      -upload up to `--transfers` chunks at the same time (shared among all
      -the multipart uploads).  Chunks are buffered in memory and are
      -normally 8 MiB so increasing `--transfers` will increase memory use.
      +**Note**: If the optional Plex integration is enabled then this
      +setting will adapt to the type of reading performed and the value
      +specified here will be used as a maximum number of workers to use.
       
      -### Deleting files
      +Properties:
       
      -Depending on the enterprise settings for your user, the item will
      -either be actually deleted from Box or moved to the trash.
      +- Config:      workers
      +- Env Var:     RCLONE_CACHE_WORKERS
      +- Type:        int
      +- Default:     4
       
      -Emptying the trash is supported via the rclone however cleanup command
      -however this deletes every trashed file and folder individually so it
      -may take a very long time. 
      -Emptying the trash via the  WebUI does not have this limitation 
      -so it is advised to empty the trash via the WebUI.
      +#### --cache-chunk-no-memory
       
      -### Root folder ID
      +Disable the in-memory cache for storing chunks during streaming.
       
      -You can set the `root_folder_id` for rclone.  This is the directory
      -(identified by its `Folder ID`) that rclone considers to be the root
      -of your Box drive.
      +By default, cache will keep file data during streaming in RAM as well
      +to provide it to readers as fast as possible.
       
      -Normally you will leave this blank and rclone will determine the
      -correct root to use itself.
      +This transient data is evicted as soon as it is read and the number of
      +chunks stored doesn't exceed the number of workers. However, depending
      +on other settings like "cache-chunk-size" and "cache-workers" this footprint
      +can increase if there are parallel streams too (multiple files being read
      +at the same time).
       
      -However you can set this to restrict rclone to a specific folder
      -hierarchy.
      +If the hardware permits it, use this feature to provide an overall better
      +performance during streaming but it can also be disabled if RAM is not
      +available on the local machine.
       
      -In order to do this you will have to find the `Folder ID` of the
      -directory you wish rclone to display.  This will be the last segment
      -of the URL when you open the relevant folder in the Box web
      -interface.
      +Properties:
       
      -So if the folder you want rclone to use has a URL which looks like
      -`https://app.box.com/folder/11xxxxxxxxx8`
      -in the browser, then you use `11xxxxxxxxx8` as
      -the `root_folder_id` in the config.
      +- Config:      chunk_no_memory
      +- Env Var:     RCLONE_CACHE_CHUNK_NO_MEMORY
      +- Type:        bool
      +- Default:     false
       
      +#### --cache-rps
       
      -### Standard options
      +Limits the number of requests per second to the source FS (-1 to disable).
       
      -Here are the Standard options specific to box (Box).
      +This setting places a hard limit on the number of requests per second
      +that cache will be doing to the cloud provider remote and try to
      +respect that value by setting waits between reads.
       
      -#### --box-client-id
      +If you find that you're getting banned or limited on the cloud
      +provider through cache and know that a smaller number of requests per
      +second will allow you to work with it then you can use this setting
      +for that.
       
      -OAuth Client Id.
      +A good balance of all the other settings should make this setting
      +useless but it is available to set for more special cases.
       
      -Leave blank normally.
      +**NOTE**: This will limit the number of requests during streams but
      +other API calls to the cloud provider like directory listings will
      +still pass.
       
       Properties:
       
      -- Config:      client_id
      -- Env Var:     RCLONE_BOX_CLIENT_ID
      -- Type:        string
      -- Required:    false
      +- Config:      rps
      +- Env Var:     RCLONE_CACHE_RPS
      +- Type:        int
      +- Default:     -1
       
      -#### --box-client-secret
      +#### --cache-writes
       
      -OAuth Client Secret.
      +Cache file data on writes through the FS.
       
      -Leave blank normally.
      +If you need to read files immediately after you upload them through
      +cache you can enable this flag to have their data stored in the
      +cache store at the same time during upload.
       
       Properties:
       
      -- Config:      client_secret
      -- Env Var:     RCLONE_BOX_CLIENT_SECRET
      -- Type:        string
      -- Required:    false
      +- Config:      writes
      +- Env Var:     RCLONE_CACHE_WRITES
      +- Type:        bool
      +- Default:     false
       
      -#### --box-box-config-file
      +#### --cache-tmp-upload-path
       
      -Box App config.json location
      +Directory to keep temporary files until they are uploaded.
       
      -Leave blank normally.
      +This is the path where cache will use as a temporary storage for new
      +files that need to be uploaded to the cloud provider.
       
      -Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`.
      +Specifying a value will enable this feature. Without it, it is
      +completely disabled and files will be uploaded directly to the cloud
      +provider
       
       Properties:
       
      -- Config:      box_config_file
      -- Env Var:     RCLONE_BOX_BOX_CONFIG_FILE
      +- Config:      tmp_upload_path
      +- Env Var:     RCLONE_CACHE_TMP_UPLOAD_PATH
       - Type:        string
       - Required:    false
       
      -#### --box-access-token
      +#### --cache-tmp-wait-time
       
      -Box App Primary Access Token
      +How long should files be stored in local cache before being uploaded.
       
      -Leave blank normally.
      +This is the duration that a file must wait in the temporary location
      +_cache-tmp-upload-path_ before it is selected for upload.
       
      -Properties:
      +Note that only one file is uploaded at a time and it can take longer
      +to start the upload if a queue formed for this purpose.
       
      -- Config:      access_token
      -- Env Var:     RCLONE_BOX_ACCESS_TOKEN
      -- Type:        string
      -- Required:    false
      +Properties:
       
      -#### --box-box-sub-type
      +- Config:      tmp_wait_time
      +- Env Var:     RCLONE_CACHE_TMP_WAIT_TIME
      +- Type:        Duration
      +- Default:     15s
       
      +#### --cache-db-wait-time
       
      +How long to wait for the DB to be available - 0 is unlimited.
       
      -Properties:
      +Only one process can have the DB open at any one time, so rclone waits
      +for this duration for the DB to become available before it gives an
      +error.
       
      -- Config:      box_sub_type
      -- Env Var:     RCLONE_BOX_BOX_SUB_TYPE
      -- Type:        string
      -- Default:     "user"
      -- Examples:
      -    - "user"
      -        - Rclone should act on behalf of a user.
      -    - "enterprise"
      -        - Rclone should act on behalf of a service account.
      +If you set it to 0 then it will wait forever.
       
      -### Advanced options
      +Properties:
       
      -Here are the Advanced options specific to box (Box).
      +- Config:      db_wait_time
      +- Env Var:     RCLONE_CACHE_DB_WAIT_TIME
      +- Type:        Duration
      +- Default:     1s
       
      -#### --box-token
      +## Backend commands
       
      -OAuth Access Token as a JSON blob.
      +Here are the commands specific to the cache backend.
       
      -Properties:
      +Run them with
       
      -- Config:      token
      -- Env Var:     RCLONE_BOX_TOKEN
      -- Type:        string
      -- Required:    false
      +    rclone backend COMMAND remote:
       
      -#### --box-auth-url
      +The help below will explain what arguments each command takes.
       
      -Auth server URL.
      +See the [backend](https://rclone.org/commands/rclone_backend/) command for more
      +info on how to pass options and arguments.
       
      -Leave blank to use the provider defaults.
      +These can be run on a running backend using the rc command
      +[backend/command](https://rclone.org/rc/#backend-command).
       
      -Properties:
      +### stats
       
      -- Config:      auth_url
      -- Env Var:     RCLONE_BOX_AUTH_URL
      -- Type:        string
      -- Required:    false
      +Print stats on the cache backend in JSON format.
       
      -#### --box-token-url
      +    rclone backend stats remote: [options] [<arguments>+]
       
      -Token server url.
       
      -Leave blank to use the provider defaults.
       
      -Properties:
      +#  Chunker
       
      -- Config:      token_url
      -- Env Var:     RCLONE_BOX_TOKEN_URL
      -- Type:        string
      -- Required:    false
      +The `chunker` overlay transparently splits large files into smaller chunks
      +during upload to wrapped remote and transparently assembles them back
      +when the file is downloaded. This allows to effectively overcome size limits
      +imposed by storage providers.
       
      -#### --box-root-folder-id
      +## Configuration
       
      -Fill in for rclone to use a non root folder as its starting point.
      +To use it, first set up the underlying remote following the configuration
      +instructions for that remote. You can also use a local pathname instead of
      +a remote.
       
      -Properties:
      +First check your chosen remote is working - we'll call it `remote:path` here.
      +Note that anything inside `remote:path` will be chunked and anything outside
      +won't. This means that if you are using a bucket-based remote (e.g. S3, B2, swift)
      +then you should probably put the bucket in the remote `s3:bucket`.
       
      -- Config:      root_folder_id
      -- Env Var:     RCLONE_BOX_ROOT_FOLDER_ID
      -- Type:        string
      -- Default:     "0"
      +Now configure `chunker` using `rclone config`. We will call this one `overlay`
      +to separate it from the `remote` itself.
      +
      +

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> overlay Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Transparently chunk/split large files  "chunker" [snip] Storage> chunker Remote to chunk/unchunk. Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", "myremote:bucket" or maybe "myremote:" (not recommended). Enter a string value. Press Enter for the default (""). remote> remote:path Files larger than chunk size will be split in chunks. Enter a size with suffix K,M,G,T. Press Enter for the default ("2G"). chunk_size> 100M Choose how chunker handles hash sums. All modes but "none" require metadata. Enter a string value. Press Enter for the default ("md5"). Choose a number from below, or type in your own value 1 / Pass any hash supported by wrapped remote for non-chunked files, return nothing otherwise  "none" 2 / MD5 for composite files  "md5" 3 / SHA1 for composite files  "sha1" 4 / MD5 for all files  "md5all" 5 / SHA1 for all files  "sha1all" 6 / Copying a file to chunker will request MD5 from the source falling back to SHA1 if unsupported  "md5quick" 7 / Similar to "md5quick" but prefers SHA1 over MD5  "sha1quick" hash_type> md5 Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config -------------------- [overlay] type = chunker remote = remote:bucket chunk_size = 100M hash_type = md5 -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

      +
      
      +### Specifying the remote
       
      -#### --box-upload-cutoff
      +In normal use, make sure the remote has a `:` in. If you specify the remote
      +without a `:` then rclone will use a local directory of that name.
      +So if you use a remote of `/path/to/secret/files` then rclone will
      +chunk stuff in that directory. If you use a remote of `name` then rclone
      +will put files in a directory called `name` in the current directory.
       
      -Cutoff for switching to multipart upload (>= 50 MiB).
       
      -Properties:
      +### Chunking
       
      -- Config:      upload_cutoff
      -- Env Var:     RCLONE_BOX_UPLOAD_CUTOFF
      -- Type:        SizeSuffix
      -- Default:     50Mi
      +When rclone starts a file upload, chunker checks the file size. If it
      +doesn't exceed the configured chunk size, chunker will just pass the file
      +to the wrapped remote (however, see caveat below). If a file is large, chunker will transparently cut
      +data in pieces with temporary names and stream them one by one, on the fly.
      +Each data chunk will contain the specified number of bytes, except for the
      +last one which may have less data. If file size is unknown in advance
      +(this is called a streaming upload), chunker will internally create
      +a temporary copy, record its size and repeat the above process.
       
      -#### --box-commit-retries
      +When upload completes, temporary chunk files are finally renamed.
      +This scheme guarantees that operations can be run in parallel and look
      +from outside as atomic.
      +A similar method with hidden temporary chunks is used for other operations
      +(copy/move/rename, etc.). If an operation fails, hidden chunks are normally
      +destroyed, and the target composite file stays intact.
       
      -Max number of times to try committing a multipart file.
      +When a composite file download is requested, chunker transparently
      +assembles it by concatenating data chunks in order. As the split is trivial
      +one could even manually concatenate data chunks together to obtain the
      +original content.
       
      -Properties:
      +When the `list` rclone command scans a directory on wrapped remote,
      +the potential chunk files are accounted for, grouped and assembled into
      +composite directory entries. Any temporary chunks are hidden.
       
      -- Config:      commit_retries
      -- Env Var:     RCLONE_BOX_COMMIT_RETRIES
      -- Type:        int
      -- Default:     100
      +List and other commands can sometimes come across composite files with
      +missing or invalid chunks, e.g. shadowed by like-named directory or
      +another file. This usually means that wrapped file system has been directly
      +tampered with or damaged. If chunker detects a missing chunk it will
      +by default print warning, skip the whole incomplete group of chunks but
      +proceed with current command.
      +You can set the `--chunker-fail-hard` flag to have commands abort with
      +error message in such cases.
       
      -#### --box-list-chunk
      +**Caveat**: As it is now, chunker will always create a temporary file in the 
      +backend and then rename it, even if the file is below the chunk threshold.
      +This will result in unnecessary API calls and can severely restrict throughput
      +when handling transfers primarily composed of small files on some backends (e.g. Box).
      +A workaround to this issue is to use chunker only for files above the chunk threshold
      +via `--min-size` and then perform a separate call without chunker on the remaining
      +files. 
       
      -Size of listing chunk 1-1000.
       
      -Properties:
      +#### Chunk names
       
      -- Config:      list_chunk
      -- Env Var:     RCLONE_BOX_LIST_CHUNK
      -- Type:        int
      -- Default:     1000
      +The default chunk name format is `*.rclone_chunk.###`, hence by default
      +chunk names are `BIG_FILE_NAME.rclone_chunk.001`,
      +`BIG_FILE_NAME.rclone_chunk.002` etc. You can configure another name format
      +using the `name_format` configuration file option. The format uses asterisk
      +`*` as a placeholder for the base file name and one or more consecutive
      +hash characters `#` as a placeholder for sequential chunk number.
      +There must be one and only one asterisk. The number of consecutive hash
      +characters defines the minimum length of a string representing a chunk number.
      +If decimal chunk number has less digits than the number of hashes, it is
      +left-padded by zeros. If the decimal string is longer, it is left intact.
      +By default numbering starts from 1 but there is another option that allows
      +user to start from 0, e.g. for compatibility with legacy software.
       
      -#### --box-owned-by
      +For example, if name format is `big_*-##.part` and original file name is
      +`data.txt` and numbering starts from 0, then the first chunk will be named
      +`big_data.txt-00.part`, the 99th chunk will be `big_data.txt-98.part`
      +and the 302nd chunk will become `big_data.txt-301.part`.
       
      -Only show items owned by the login (email address) passed in.
      +Note that `list` assembles composite directory entries only when chunk names
      +match the configured format and treats non-conforming file names as normal
      +non-chunked files.
       
      -Properties:
      +When using `norename` transactions, chunk names will additionally have a unique
      +file version suffix. For example, `BIG_FILE_NAME.rclone_chunk.001_bp562k`.
       
      -- Config:      owned_by
      -- Env Var:     RCLONE_BOX_OWNED_BY
      -- Type:        string
      -- Required:    false
       
      -#### --box-impersonate
      +### Metadata
       
      -Impersonate this user ID when using a service account.
      +Besides data chunks chunker will by default create metadata object for
      +a composite file. The object is named after the original file.
      +Chunker allows user to disable metadata completely (the `none` format).
      +Note that metadata is normally not created for files smaller than the
      +configured chunk size. This may change in future rclone releases.
       
      -Settng this flag allows rclone, when using a JWT service account, to
      -act on behalf of another user by setting the as-user header.
      +#### Simple JSON metadata format
       
      -The user ID is the Box identifier for a user. User IDs can found for
      -any user via the GET /users endpoint, which is only available to
      -admins, or by calling the GET /users/me endpoint with an authenticated
      -user session.
      +This is the default format. It supports hash sums and chunk validation
      +for composite files. Meta objects carry the following fields:
       
      -See: https://developer.box.com/guides/authentication/jwt/as-user/
      +- `ver`     - version of format, currently `1`
      +- `size`    - total size of composite file
      +- `nchunks` - number of data chunks in file
      +- `md5`     - MD5 hashsum of composite file (if present)
      +- `sha1`    - SHA1 hashsum (if present)
      +- `txn`     - identifies current version of the file
       
      +There is no field for composite file name as it's simply equal to the name
      +of meta object on the wrapped remote. Please refer to respective sections
      +for details on hashsums and modified time handling.
       
      -Properties:
      +#### No metadata
       
      -- Config:      impersonate
      -- Env Var:     RCLONE_BOX_IMPERSONATE
      -- Type:        string
      -- Required:    false
      +You can disable meta objects by setting the meta format option to `none`.
      +In this mode chunker will scan directory for all files that follow
      +configured chunk name format, group them by detecting chunks with the same
      +base name and show group names as virtual composite files.
      +This method is more prone to missing chunk errors (especially missing
      +last chunk) than format with metadata enabled.
       
      -#### --box-encoding
       
      -The encoding for the backend.
      +### Hashsums
       
      -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
      +Chunker supports hashsums only when a compatible metadata is present.
      +Hence, if you choose metadata format of `none`, chunker will report hashsum
      +as `UNSUPPORTED`.
       
      -Properties:
      +Please note that by default metadata is stored only for composite files.
      +If a file is smaller than configured chunk size, chunker will transparently
      +redirect hash requests to wrapped remote, so support depends on that.
      +You will see the empty string as a hashsum of requested type for small
      +files if the wrapped remote doesn't support it.
       
      -- Config:      encoding
      -- Env Var:     RCLONE_BOX_ENCODING
      -- Type:        MultiEncoder
      -- Default:     Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot
      +Many storage backends support MD5 and SHA1 hash types, so does chunker.
      +With chunker you can choose one or another but not both.
      +MD5 is set by default as the most supported type.
      +Since chunker keeps hashes for composite files and falls back to the
      +wrapped remote hash for non-chunked ones, we advise you to choose the same
      +hash type as supported by wrapped remote so that your file listings
      +look coherent.
       
      +If your storage backend does not support MD5 or SHA1 but you need consistent
      +file hashing, configure chunker with `md5all` or `sha1all`. These two modes
      +guarantee given hash for all files. If wrapped remote doesn't support it,
      +chunker will then add metadata to all files, even small. However, this can
      +double the amount of small files in storage and incur additional service charges.
      +You can even use chunker to force md5/sha1 support in any other remote
      +at expense of sidecar meta objects by setting e.g. `hash_type=sha1all`
      +to force hashsums and `chunk_size=1P` to effectively disable chunking.
       
      +Normally, when a file is copied to chunker controlled remote, chunker
      +will ask the file source for compatible file hash and revert to on-the-fly
      +calculation if none is found. This involves some CPU overhead but provides
      +a guarantee that given hashsum is available. Also, chunker will reject
      +a server-side copy or move operation if source and destination hashsum
      +types are different resulting in the extra network bandwidth, too.
      +In some rare cases this may be undesired, so chunker provides two optional
      +choices: `sha1quick` and `md5quick`. If the source does not support primary
      +hash type and the quick mode is enabled, chunker will try to fall back to
      +the secondary type. This will save CPU and bandwidth but can result in empty
      +hashsums at destination. Beware of consequences: the `sync` command will
      +revert (sometimes silently) to time/size comparison if compatible hashsums
      +between source and target are not found.
       
      -## Limitations
       
      -Note that Box is case insensitive so you can't have a file called
      -"Hello.doc" and one called "hello.doc".
      +### Modification times
       
      -Box file names can't have the `\` character in.  rclone maps this to
      -and from an identical looking unicode equivalent `\` (U+FF3C Fullwidth
      -Reverse Solidus).
      +Chunker stores modification times using the wrapped remote so support
      +depends on that. For a small non-chunked file the chunker overlay simply
      +manipulates modification time of the wrapped remote file.
      +For a composite file with metadata chunker will get and set
      +modification time of the metadata object on the wrapped remote.
      +If file is chunked but metadata format is `none` then chunker will
      +use modification time of the first data chunk.
       
      -Box only supports filenames up to 255 characters in length.
       
      -Box has [API rate limits](https://developer.box.com/guides/api-calls/permissions-and-errors/rate-limits/) that sometimes reduce the speed of rclone.
      +### Migrations
       
      -`rclone about` is not supported by the Box backend. Backends without
      -this capability cannot determine free space for an rclone mount or
      -use policy `mfs` (most free space) as a member of an rclone union
      -remote.
      +The idiomatic way to migrate to a different chunk size, hash type, transaction
      +style or chunk naming scheme is to:
       
      -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/)
      +- Collect all your chunked files under a directory and have your
      +  chunker remote point to it.
      +- Create another directory (most probably on the same cloud storage)
      +  and configure a new remote with desired metadata format,
      +  hash type, chunk naming etc.
      +- Now run `rclone sync --interactive oldchunks: newchunks:` and all your data
      +  will be transparently converted in transfer.
      +  This may take some time, yet chunker will try server-side
      +  copy if possible.
      +- After checking data integrity you may remove configuration section
      +  of the old remote.
       
      -## Get your own Box App ID
      +If rclone gets killed during a long operation on a big composite file,
      +hidden temporary chunks may stay in the directory. They will not be
      +shown by the `list` command but will eat up your account quota.
      +Please note that the `deletefile` command deletes only active
      +chunks of a file. As a workaround, you can use remote of the wrapped
      +file system to see them.
      +An easy way to get rid of hidden garbage is to copy littered directory
      +somewhere using the chunker remote and purge the original directory.
      +The `copy` command will copy only active chunks while the `purge` will
      +remove everything including garbage.
       
      -Here is how to create your own Box App ID for rclone:
       
      -1. Go to the [Box Developer Console](https://app.box.com/developers/console)
      -and login, then click `My Apps` on the sidebar. Click `Create New App`
      -and select `Custom App`.
      +### Caveats and Limitations
       
      -2. In the first screen on the box that pops up, you can pretty much enter
      -whatever you want. The `App Name` can be whatever. For `Purpose` choose
      -automation to avoid having to fill out anything else. Click `Next`.
      +Chunker requires wrapped remote to support server-side `move` (or `copy` +
      +`delete`) operations, otherwise it will explicitly refuse to start.
      +This is because it internally renames temporary chunk files to their final
      +names when an operation completes successfully.
       
      -3. In the second screen of the creation screen, select
      -`User Authentication (OAuth 2.0)`. Then click `Create App`.
      +Chunker encodes chunk number in file name, so with default `name_format`
      +setting it adds 17 characters. Also chunker adds 7 characters of temporary
      +suffix during operations. Many file systems limit base file name without path
      +by 255 characters. Using rclone's crypt remote as a base file system limits
      +file name by 143 characters. Thus, maximum name length is 231 for most files
      +and 119 for chunker-over-crypt. A user in need can change name format to
      +e.g. `*.rcc##` and save 10 characters (provided at most 99 chunks per file).
       
      -4. You should now be on the `Configuration` tab of your new app. If not,
      -click on it at the top of the webpage. Copy down `Client ID`
      -and `Client Secret`, you'll need those for rclone.
      +Note that a move implemented using the copy-and-delete method may incur
      +double charging with some cloud storage providers.
       
      -5. Under "OAuth 2.0 Redirect URI", add `http://127.0.0.1:53682/`
      +Chunker will not automatically rename existing chunks when you run
      +`rclone config` on a live remote and change the chunk name format.
      +Beware that in result of this some files which have been treated as chunks
      +before the change can pop up in directory listings as normal files
      +and vice versa. The same warning holds for the chunk size.
      +If you desperately need to change critical chunking settings, you should
      +run data migration as described above.
       
      -6. For `Application Scopes`, select `Read all files and folders stored in Box`
      -and `Write all files and folders stored in box` (assuming you want to do both).
      -Leave others unchecked. Click `Save Changes` at the top right.
      +If wrapped remote is case insensitive, the chunker overlay will inherit
      +that property (so you can't have a file called "Hello.doc" and "hello.doc"
      +in the same directory).
       
      -#  Cache
      +Chunker included in rclone releases up to `v1.54` can sometimes fail to
      +detect metadata produced by recent versions of rclone. We recommend users
      +to keep rclone up-to-date to avoid data corruption.
       
      -The `cache` remote wraps another existing remote and stores file structure
      -and its data for long running tasks like `rclone mount`.
      +Changing `transactions` is dangerous and requires explicit migration.
       
      -## Status
       
      -The cache backend code is working but it currently doesn't
      -have a maintainer so there are [outstanding bugs](https://github.com/rclone/rclone/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3A%22Remote%3A+Cache%22) which aren't getting fixed.
      +### Standard options
       
      -The cache backend is due to be phased out in favour of the VFS caching
      -layer eventually which is more tightly integrated into rclone.
      +Here are the Standard options specific to chunker (Transparently chunk/split large files).
       
      -Until this happens we recommend only using the cache backend if you
      -find you can't work without it. There are many docs online describing
      -the use of the cache backend to minimize API hits and by-and-large
      -these are out of date and the cache backend isn't needed in those
      -scenarios any more.
      +#### --chunker-remote
       
      -## Configuration
      +Remote to chunk/unchunk.
       
      -To get started you just need to have an existing remote which can be configured
      -with `cache`.
      +Normally should contain a ':' and a path, e.g. "myremote:path/to/dir",
      +"myremote:bucket" or maybe "myremote:" (not recommended).
       
      -Here is an example of how to make a remote called `test-cache`.  First run:
      +Properties:
       
      -     rclone config
      +- Config:      remote
      +- Env Var:     RCLONE_CHUNKER_REMOTE
      +- Type:        string
      +- Required:    true
       
      -This will guide you through an interactive setup process:
      -
      -

      No remotes found, make a new one? n) New remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config n/r/c/s/q> n name> test-cache Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Cache a remote  "cache" [snip] Storage> cache Remote to cache. Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", "myremote:bucket" or maybe "myremote:" (not recommended). remote> local:/test Optional: The URL of the Plex server plex_url> http://127.0.0.1:32400 Optional: The username of the Plex user plex_username> dummyusername Optional: The password of the Plex user y) Yes type in my own password g) Generate random password n) No leave this optional password blank y/g/n> y Enter the password: password: Confirm the password: password: The size of a chunk. Lower value good for slow connections but can affect seamless reading. Default: 5M Choose a number from below, or type in your own value 1 / 1 MiB  "1M" 2 / 5 MiB  "5M" 3 / 10 MiB  "10M" chunk_size> 2 How much time should object info (file size, file hashes, etc.) be stored in cache. Use a very high value if you don't plan on changing the source FS from outside the cache. Accepted units are: "s", "m", "h". Default: 5m Choose a number from below, or type in your own value 1 / 1 hour  "1h" 2 / 24 hours  "24h" 3 / 24 hours  "48h" info_age> 2 The maximum size of stored chunks. When the storage grows beyond this size, the oldest chunks will be deleted. Default: 10G Choose a number from below, or type in your own value 1 / 500 MiB  "500M" 2 / 1 GiB  "1G" 3 / 10 GiB  "10G" chunk_total_size> 3 Remote config -------------------- [test-cache] remote = local:/test plex_url = http://127.0.0.1:32400 plex_username = dummyusername plex_password = *** ENCRYPTED *** chunk_size = 5M info_age = 48h chunk_total_size = 10G

      -
      
      -You can then use it like this,
      +#### --chunker-chunk-size
       
      -List directories in top level of your drive
      +Files larger than chunk size will be split in chunks.
       
      -    rclone lsd test-cache:
      +Properties:
       
      -List all the files in your drive
      +- Config:      chunk_size
      +- Env Var:     RCLONE_CHUNKER_CHUNK_SIZE
      +- Type:        SizeSuffix
      +- Default:     2Gi
       
      -    rclone ls test-cache:
      +#### --chunker-hash-type
       
      -To start a cached mount
      +Choose how chunker handles hash sums.
       
      -    rclone mount --allow-other test-cache: /var/tmp/test-cache
      +All modes but "none" require metadata.
       
      -### Write Features ###
      +Properties:
       
      -### Offline uploading ###
      +- Config:      hash_type
      +- Env Var:     RCLONE_CHUNKER_HASH_TYPE
      +- Type:        string
      +- Default:     "md5"
      +- Examples:
      +    - "none"
      +        - Pass any hash supported by wrapped remote for non-chunked files.
      +        - Return nothing otherwise.
      +    - "md5"
      +        - MD5 for composite files.
      +    - "sha1"
      +        - SHA1 for composite files.
      +    - "md5all"
      +        - MD5 for all files.
      +    - "sha1all"
      +        - SHA1 for all files.
      +    - "md5quick"
      +        - Copying a file to chunker will request MD5 from the source.
      +        - Falling back to SHA1 if unsupported.
      +    - "sha1quick"
      +        - Similar to "md5quick" but prefers SHA1 over MD5.
       
      -In an effort to make writing through cache more reliable, the backend 
      -now supports this feature which can be activated by specifying a
      -`cache-tmp-upload-path`.
      +### Advanced options
       
      -A files goes through these states when using this feature:
      +Here are the Advanced options specific to chunker (Transparently chunk/split large files).
       
      -1. An upload is started (usually by copying a file on the cache remote)
      -2. When the copy to the temporary location is complete the file is part 
      -of the cached remote and looks and behaves like any other file (reading included)
      -3. After `cache-tmp-wait-time` passes and the file is next in line, `rclone move` 
      -is used to move the file to the cloud provider
      -4. Reading the file still works during the upload but most modifications on it will be prohibited
      -5. Once the move is complete the file is unlocked for modifications as it
      -becomes as any other regular file
      -6. If the file is being read through `cache` when it's actually
      -deleted from the temporary path then `cache` will simply swap the source
      -to the cloud provider without interrupting the reading (small blip can happen though)
      +#### --chunker-name-format
       
      -Files are uploaded in sequence and only one file is uploaded at a time.
      -Uploads will be stored in a queue and be processed based on the order they were added.
      -The queue and the temporary storage is persistent across restarts but
      -can be cleared on startup with the `--cache-db-purge` flag.
      +String format of chunk file names.
       
      -### Write Support ###
      +The two placeholders are: base file name (*) and chunk number (#...).
      +There must be one and only one asterisk and one or more consecutive hash characters.
      +If chunk number has less digits than the number of hashes, it is left-padded by zeros.
      +If there are more digits in the number, they are left as is.
      +Possible chunk files are ignored if their name does not match given format.
       
      -Writes are supported through `cache`.
      -One caveat is that a mounted cache remote does not add any retry or fallback
      -mechanism to the upload operation. This will depend on the implementation
      -of the wrapped remote. Consider using `Offline uploading` for reliable writes.
      +Properties:
       
      -One special case is covered with `cache-writes` which will cache the file
      -data at the same time as the upload when it is enabled making it available
      -from the cache store immediately once the upload is finished.
      +- Config:      name_format
      +- Env Var:     RCLONE_CHUNKER_NAME_FORMAT
      +- Type:        string
      +- Default:     "*.rclone_chunk.###"
       
      -### Read Features ###
      +#### --chunker-start-from
       
      -#### Multiple connections ####
      +Minimum valid chunk number. Usually 0 or 1.
       
      -To counter the high latency between a local PC where rclone is running
      -and cloud providers, the cache remote can split multiple requests to the
      -cloud provider for smaller file chunks and combines them together locally
      -where they can be available almost immediately before the reader usually
      -needs them.
      +By default chunk numbers start from 1.
       
      -This is similar to buffering when media files are played online. Rclone
      -will stay around the current marker but always try its best to stay ahead
      -and prepare the data before.
      +Properties:
       
      -#### Plex Integration ####
      +- Config:      start_from
      +- Env Var:     RCLONE_CHUNKER_START_FROM
      +- Type:        int
      +- Default:     1
       
      -There is a direct integration with Plex which allows cache to detect during reading
      -if the file is in playback or not. This helps cache to adapt how it queries
      -the cloud provider depending on what is needed for.
      +#### --chunker-meta-format
       
      -Scans will have a minimum amount of workers (1) while in a confirmed playback cache
      -will deploy the configured number of workers.
      +Format of the metadata object or "none".
       
      -This integration opens the doorway to additional performance improvements
      -which will be explored in the near future.
      +By default "simplejson".
      +Metadata is a small JSON file named after the composite file.
       
      -**Note:** If Plex options are not configured, `cache` will function with its
      -configured options without adapting any of its settings.
      +Properties:
       
      -How to enable? Run `rclone config` and add all the Plex options (endpoint, username
      -and password) in your remote and it will be automatically enabled.
      +- Config:      meta_format
      +- Env Var:     RCLONE_CHUNKER_META_FORMAT
      +- Type:        string
      +- Default:     "simplejson"
      +- Examples:
      +    - "none"
      +        - Do not use metadata files at all.
      +        - Requires hash type "none".
      +    - "simplejson"
      +        - Simple JSON supports hash sums and chunk validation.
      +        - 
      +        - It has the following fields: ver, size, nchunks, md5, sha1.
       
      -Affected settings:
      -- `cache-workers`: _Configured value_ during confirmed playback or _1_ all the other times
      +#### --chunker-fail-hard
       
      -##### Certificate Validation #####
      +Choose how chunker should handle files with missing or invalid chunks.
       
      -When the Plex server is configured to only accept secure connections, it is
      -possible to use `.plex.direct` URLs to ensure certificate validation succeeds.
      -These URLs are used by Plex internally to connect to the Plex server securely.
      +Properties:
       
      -The format for these URLs is the following:
      +- Config:      fail_hard
      +- Env Var:     RCLONE_CHUNKER_FAIL_HARD
      +- Type:        bool
      +- Default:     false
      +- Examples:
      +    - "true"
      +        - Report errors and abort current command.
      +    - "false"
      +        - Warn user, skip incomplete file and proceed.
       
      -`https://ip-with-dots-replaced.server-hash.plex.direct:32400/`
      +#### --chunker-transactions
       
      -The `ip-with-dots-replaced` part can be any IPv4 address, where the dots
      -have been replaced with dashes, e.g. `127.0.0.1` becomes `127-0-0-1`.
      +Choose how chunker should handle temporary files during transactions.
       
      -To get the `server-hash` part, the easiest way is to visit
      +Properties:
       
      -https://plex.tv/api/resources?includeHttps=1&X-Plex-Token=your-plex-token
      +- Config:      transactions
      +- Env Var:     RCLONE_CHUNKER_TRANSACTIONS
      +- Type:        string
      +- Default:     "rename"
      +- Examples:
      +    - "rename"
      +        - Rename temporary files after a successful transaction.
      +    - "norename"
      +        - Leave temporary file names and write transaction ID to metadata file.
      +        - Metadata is required for no rename transactions (meta format cannot be "none").
      +        - If you are using norename transactions you should be careful not to downgrade Rclone
      +        - as older versions of Rclone don't support this transaction style and will misinterpret
      +        - files manipulated by norename transactions.
      +        - This method is EXPERIMENTAL, don't use on production systems.
      +    - "auto"
      +        - Rename or norename will be used depending on capabilities of the backend.
      +        - If meta format is set to "none", rename transactions will always be used.
      +        - This method is EXPERIMENTAL, don't use on production systems.
       
      -This page will list all the available Plex servers for your account
      -with at least one `.plex.direct` link for each. Copy one URL and replace
      -the IP address with the desired address. This can be used as the
      -`plex_url` value.
       
      -### Known issues ###
       
      -#### Mount and --dir-cache-time ####
      +#  Citrix ShareFile
       
      ---dir-cache-time controls the first layer of directory caching which works at the mount layer.
      -Being an independent caching mechanism from the `cache` backend, it will manage its own entries
      -based on the configured time.
      +[Citrix ShareFile](https://sharefile.com) is a secure file sharing and transfer service aimed as business.
       
      -To avoid getting in a scenario where dir cache has obsolete data and cache would have the correct
      -one, try to set `--dir-cache-time` to a lower time than `--cache-info-age`. Default values are
      -already configured in this way. 
      +## Configuration
       
      -#### Windows support - Experimental ####
      +The initial setup for Citrix ShareFile involves getting a token from
      +Citrix ShareFile which you can in your browser.  `rclone config` walks you
      +through it.
       
      -There are a couple of issues with Windows `mount` functionality that still require some investigations.
      -It should be considered as experimental thus far as fixes come in for this OS.
      +Here is an example of how to make a remote called `remote`.  First run:
       
      -Most of the issues seem to be related to the difference between filesystems
      -on Linux flavors and Windows as cache is heavily dependent on them.
      +     rclone config
       
      -Any reports or feedback on how cache behaves on this OS is greatly appreciated.
      - 
      -- https://github.com/rclone/rclone/issues/1935
      -- https://github.com/rclone/rclone/issues/1907
      -- https://github.com/rclone/rclone/issues/1834 
      +This will guide you through an interactive setup process:
      +
      +

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value XX / Citrix Sharefile  "sharefile" Storage> sharefile ** See help for sharefile backend at: https://rclone.org/sharefile/ **

      +

      ID of the root folder

      +

      Leave blank to access "Personal Folders". You can use one of the standard values here or any folder ID (long hex number ID). Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / Access the Personal Folders. (Default)  "" 2 / Access the Favorites folder.  "favorites" 3 / Access all the shared folders.  "allshared" 4 / Access all the individual connectors.  "connectors" 5 / Access the home, favorites, and shared folders as well as the connectors.  "top" root_folder_id> Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config Use web browser to automatically authenticate rclone with remote? * Say Y if the machine running rclone has a web browser you can use * Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N. 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?state=XXX Log in and authorize rclone for access Waiting for code... Got code -------------------- [remote] type = sharefile endpoint = https://XXX.sharefile.com token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2019-09-30T19:41:45.878561877+01:00"} -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

      +
      
      +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a
      +machine with no Internet browser available.
       
      -#### Risk of throttling ####
      +Note that rclone runs a webserver on your local machine to collect the
      +token as returned from Citrix ShareFile. This only runs from the moment it opens
      +your browser to the moment you get back the verification code.  This
      +is on `http://127.0.0.1:53682/` and this it may require you to unblock
      +it temporarily if you are running a host firewall.
       
      -Future iterations of the cache backend will make use of the pooling functionality
      -of the cloud provider to synchronize and at the same time make writing through it
      -more tolerant to failures. 
      +Once configured you can then use `rclone` like this,
       
      -There are a couple of enhancements in track to add these but in the meantime
      -there is a valid concern that the expiring cache listings can lead to cloud provider
      -throttles or bans due to repeated queries on it for very large mounts.
      +List directories in top level of your ShareFile
       
      -Some recommendations:
      -- don't use a very small interval for entry information (`--cache-info-age`)
      -- while writes aren't yet optimised, you can still write through `cache` which gives you the advantage
      -of adding the file in the cache at the same time if configured to do so.
      +    rclone lsd remote:
       
      -Future enhancements:
      +List all the files in your ShareFile
       
      -- https://github.com/rclone/rclone/issues/1937
      -- https://github.com/rclone/rclone/issues/1936 
      +    rclone ls remote:
       
      -#### cache and crypt ####
      +To copy a local directory to an ShareFile directory called backup
       
      -One common scenario is to keep your data encrypted in the cloud provider
      -using the `crypt` remote. `crypt` uses a similar technique to wrap around
      -an existing remote and handles this translation in a seamless way.
      +    rclone copy /home/source remote:backup
       
      -There is an issue with wrapping the remotes in this order:
      -**cloud remote** -> **crypt** -> **cache**
      +Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
       
      -During testing, I experienced a lot of bans with the remotes in this order.
      -I suspect it might be related to how crypt opens files on the cloud provider
      -which makes it think we're downloading the full file instead of small chunks.
      -Organizing the remotes in this order yields better results:
      -**cloud remote** -> **cache** -> **crypt**
      +### Modification times and hashes
       
      -#### absolute remote paths ####
      +ShareFile allows modification times to be set on objects accurate to 1
      +second.  These will be used to detect whether objects need syncing or
      +not.
       
      -`cache` can not differentiate between relative and absolute paths for the wrapped remote.
      -Any path given in the `remote` config setting and on the command line will be passed to
      -the wrapped remote as is, but for storing the chunks on disk the path will be made
      -relative by removing any leading `/` character.
      +ShareFile supports MD5 type hashes, so you can use the `--checksum`
      +flag.
       
      -This behavior is irrelevant for most backend types, but there are backends where a leading `/`
      -changes the effective directory, e.g. in the `sftp` backend paths starting with a `/` are
      -relative to the root of the SSH server and paths without are relative to the user home directory.
      -As a result `sftp:bin` and `sftp:/bin` will share the same cache folder, even if they represent
      -a different directory on the SSH server.
      +### Transfers
       
      -### Cache and Remote Control (--rc) ###
      -Cache supports the new `--rc` mode in rclone and can be remote controlled through the following end points:
      -By default, the listener is disabled if you do not add the flag.
      +For files above 128 MiB rclone will use a chunked transfer.  Rclone will
      +upload up to `--transfers` chunks at the same time (shared among all
      +the multipart uploads).  Chunks are buffered in memory and are
      +normally 64 MiB so increasing `--transfers` will increase memory use.
       
      -### rc cache/expire
      -Purge a remote from the cache backend. Supports either a directory or a file.
      -It supports both encrypted and unencrypted file names if cache is wrapped by crypt.
      +### Restricted filename characters
       
      -Params:
      -  - **remote** = path to remote **(required)**
      -  - **withData** = true/false to delete cached data (chunks) as well _(optional, false by default)_
      +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
      +the following characters are also replaced:
       
      +| Character | Value | Replacement |
      +| --------- |:-----:|:-----------:|
      +| \\        | 0x5C  | \           |
      +| *         | 0x2A  | *           |
      +| <         | 0x3C  | <           |
      +| >         | 0x3E  | >           |
      +| ?         | 0x3F  | ?           |
      +| :         | 0x3A  | :           |
      +| \|        | 0x7C  | |           |
      +| "         | 0x22  | "           |
       
      -### Standard options
      +File names can also not start or end with the following characters.
      +These only get replaced if they are the first or last character in the
      +name:
       
      -Here are the Standard options specific to cache (Cache a remote).
      +| Character | Value | Replacement |
      +| --------- |:-----:|:-----------:|
      +| SP        | 0x20  | ␠           |
      +| .         | 0x2E  | .           |
       
      -#### --cache-remote
      +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
      +as they can't be used in JSON strings.
       
      -Remote to cache.
       
      -Normally should contain a ':' and a path, e.g. "myremote:path/to/dir",
      -"myremote:bucket" or maybe "myremote:" (not recommended).
      +### Standard options
       
      -Properties:
      +Here are the Standard options specific to sharefile (Citrix Sharefile).
       
      -- Config:      remote
      -- Env Var:     RCLONE_CACHE_REMOTE
      -- Type:        string
      -- Required:    true
      +#### --sharefile-client-id
       
      -#### --cache-plex-url
      +OAuth Client Id.
       
      -The URL of the Plex server.
      +Leave blank normally.
       
       Properties:
       
      -- Config:      plex_url
      -- Env Var:     RCLONE_CACHE_PLEX_URL
      +- Config:      client_id
      +- Env Var:     RCLONE_SHAREFILE_CLIENT_ID
       - Type:        string
       - Required:    false
       
      -#### --cache-plex-username
      +#### --sharefile-client-secret
       
      -The username of the Plex user.
      +OAuth Client Secret.
      +
      +Leave blank normally.
       
       Properties:
       
      -- Config:      plex_username
      -- Env Var:     RCLONE_CACHE_PLEX_USERNAME
      +- Config:      client_secret
      +- Env Var:     RCLONE_SHAREFILE_CLIENT_SECRET
       - Type:        string
       - Required:    false
       
      -#### --cache-plex-password
      +#### --sharefile-root-folder-id
       
      -The password of the Plex user.
      +ID of the root folder.
       
      -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
      +Leave blank to access "Personal Folders".  You can use one of the
      +standard values here or any folder ID (long hex number ID).
       
       Properties:
       
      -- Config:      plex_password
      -- Env Var:     RCLONE_CACHE_PLEX_PASSWORD
      +- Config:      root_folder_id
      +- Env Var:     RCLONE_SHAREFILE_ROOT_FOLDER_ID
       - Type:        string
       - Required:    false
      +- Examples:
      +    - ""
      +        - Access the Personal Folders (default).
      +    - "favorites"
      +        - Access the Favorites folder.
      +    - "allshared"
      +        - Access all the shared folders.
      +    - "connectors"
      +        - Access all the individual connectors.
      +    - "top"
      +        - Access the home, favorites, and shared folders as well as the connectors.
       
      -#### --cache-chunk-size
      -
      -The size of a chunk (partial file data).
      -
      -Use lower numbers for slower connections. If the chunk size is
      -changed, any downloaded chunks will be invalid and cache-chunk-path
      -will need to be cleared or unexpected EOF errors will occur.
      -
      -Properties:
      +### Advanced options
       
      -- Config:      chunk_size
      -- Env Var:     RCLONE_CACHE_CHUNK_SIZE
      -- Type:        SizeSuffix
      -- Default:     5Mi
      -- Examples:
      -    - "1M"
      -        - 1 MiB
      -    - "5M"
      -        - 5 MiB
      -    - "10M"
      -        - 10 MiB
      +Here are the Advanced options specific to sharefile (Citrix Sharefile).
       
      -#### --cache-info-age
      +#### --sharefile-token
       
      -How long to cache file structure information (directory listings, file size, times, etc.). 
      -If all write operations are done through the cache then you can safely make
      -this value very large as the cache store will also be updated in real time.
      +OAuth Access Token as a JSON blob.
       
       Properties:
       
      -- Config:      info_age
      -- Env Var:     RCLONE_CACHE_INFO_AGE
      -- Type:        Duration
      -- Default:     6h0m0s
      -- Examples:
      -    - "1h"
      -        - 1 hour
      -    - "24h"
      -        - 24 hours
      -    - "48h"
      -        - 48 hours
      +- Config:      token
      +- Env Var:     RCLONE_SHAREFILE_TOKEN
      +- Type:        string
      +- Required:    false
       
      -#### --cache-chunk-total-size
      +#### --sharefile-auth-url
       
      -The total size that the chunks can take up on the local disk.
      +Auth server URL.
       
      -If the cache exceeds this value then it will start to delete the
      -oldest chunks until it goes under this value.
      +Leave blank to use the provider defaults.
       
       Properties:
       
      -- Config:      chunk_total_size
      -- Env Var:     RCLONE_CACHE_CHUNK_TOTAL_SIZE
      -- Type:        SizeSuffix
      -- Default:     10Gi
      -- Examples:
      -    - "500M"
      -        - 500 MiB
      -    - "1G"
      -        - 1 GiB
      -    - "10G"
      -        - 10 GiB
      -
      -### Advanced options
      +- Config:      auth_url
      +- Env Var:     RCLONE_SHAREFILE_AUTH_URL
      +- Type:        string
      +- Required:    false
       
      -Here are the Advanced options specific to cache (Cache a remote).
      +#### --sharefile-token-url
       
      -#### --cache-plex-token
      +Token server url.
       
      -The plex token for authentication - auto set normally.
      +Leave blank to use the provider defaults.
       
       Properties:
       
      -- Config:      plex_token
      -- Env Var:     RCLONE_CACHE_PLEX_TOKEN
      +- Config:      token_url
      +- Env Var:     RCLONE_SHAREFILE_TOKEN_URL
       - Type:        string
       - Required:    false
       
      -#### --cache-plex-insecure
      +#### --sharefile-upload-cutoff
       
      -Skip all certificate verification when connecting to the Plex server.
      +Cutoff for switching to multipart upload.
       
       Properties:
       
      -- Config:      plex_insecure
      -- Env Var:     RCLONE_CACHE_PLEX_INSECURE
      -- Type:        string
      -- Required:    false
      +- Config:      upload_cutoff
      +- Env Var:     RCLONE_SHAREFILE_UPLOAD_CUTOFF
      +- Type:        SizeSuffix
      +- Default:     128Mi
       
      -#### --cache-db-path
      +#### --sharefile-chunk-size
       
      -Directory to store file structure metadata DB.
      +Upload chunk size.
       
      -The remote name is used as the DB file name.
      +Must a power of 2 >= 256k.
      +
      +Making this larger will improve performance, but note that each chunk
      +is buffered in memory one per transfer.
      +
      +Reducing this will reduce memory usage but decrease performance.
       
       Properties:
       
      -- Config:      db_path
      -- Env Var:     RCLONE_CACHE_DB_PATH
      -- Type:        string
      -- Default:     "$HOME/.cache/rclone/cache-backend"
      +- Config:      chunk_size
      +- Env Var:     RCLONE_SHAREFILE_CHUNK_SIZE
      +- Type:        SizeSuffix
      +- Default:     64Mi
       
      -#### --cache-chunk-path
      +#### --sharefile-endpoint
       
      -Directory to cache chunk files.
      +Endpoint for API calls.
       
      -Path to where partial file data (chunks) are stored locally. The remote
      -name is appended to the final path.
      +This is usually auto discovered as part of the oauth process, but can
      +be set manually to something like: https://XXX.sharefile.com
       
      -This config follows the "--cache-db-path". If you specify a custom
      -location for "--cache-db-path" and don't specify one for "--cache-chunk-path"
      -then "--cache-chunk-path" will use the same path as "--cache-db-path".
       
       Properties:
       
      -- Config:      chunk_path
      -- Env Var:     RCLONE_CACHE_CHUNK_PATH
      +- Config:      endpoint
      +- Env Var:     RCLONE_SHAREFILE_ENDPOINT
       - Type:        string
      -- Default:     "$HOME/.cache/rclone/cache-backend"
      +- Required:    false
       
      -#### --cache-db-purge
      +#### --sharefile-encoding
       
      -Clear all the cached data for this remote on start.
      +The encoding for the backend.
      +
      +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
       
       Properties:
       
      -- Config:      db_purge
      -- Env Var:     RCLONE_CACHE_DB_PURGE
      -- Type:        bool
      -- Default:     false
      +- Config:      encoding
      +- Env Var:     RCLONE_SHAREFILE_ENCODING
      +- Type:        Encoding
      +- Default:     Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot
       
      -#### --cache-chunk-clean-interval
       
      -How often should the cache perform cleanups of the chunk storage.
      +## Limitations
       
      -The default value should be ok for most people. If you find that the
      -cache goes over "cache-chunk-total-size" too often then try to lower
      -this value to force it to perform cleanups more often.
      +Note that ShareFile is case insensitive so you can't have a file called
      +"Hello.doc" and one called "hello.doc".
       
      -Properties:
      +ShareFile only supports filenames up to 256 characters in length.
       
      -- Config:      chunk_clean_interval
      -- Env Var:     RCLONE_CACHE_CHUNK_CLEAN_INTERVAL
      -- Type:        Duration
      -- Default:     1m0s
      +`rclone about` is not supported by the Citrix ShareFile backend. Backends without
      +this capability cannot determine free space for an rclone mount or
      +use policy `mfs` (most free space) as a member of an rclone union
      +remote.
       
      -#### --cache-read-retries
      +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/)
       
      -How many times to retry a read from a cache storage.
      +#  Crypt
       
      -Since reading from a cache stream is independent from downloading file
      -data, readers can get to a point where there's no more data in the
      -cache.  Most of the times this can indicate a connectivity issue if
      -cache isn't able to provide file data anymore.
      +Rclone `crypt` remotes encrypt and decrypt other remotes.
       
      -For really slow connections, increase this to a point where the stream is
      -able to provide data but your experience will be very stuttering.
      +A remote of type `crypt` does not access a [storage system](https://rclone.org/overview/)
      +directly, but instead wraps another remote, which in turn accesses
      +the storage system. This is similar to how [alias](https://rclone.org/alias/),
      +[union](https://rclone.org/union/), [chunker](https://rclone.org/chunker/)
      +and a few others work. It makes the usage very flexible, as you can
      +add a layer, in this case an encryption layer, on top of any other
      +backend, even in multiple layers. Rclone's functionality
      +can be used as with any other remote, for example you can
      +[mount](https://rclone.org/commands/rclone_mount/) a crypt remote.
       
      -Properties:
      +Accessing a storage system through a crypt remote realizes client-side
      +encryption, which makes it safe to keep your data in a location you do
      +not trust will not get compromised.
      +When working against the `crypt` remote, rclone will automatically
      +encrypt (before uploading) and decrypt (after downloading) on your local
      +system as needed on the fly, leaving the data encrypted at rest in the
      +wrapped remote. If you access the storage system using an application
      +other than rclone, or access the wrapped remote directly using rclone,
      +there will not be any encryption/decryption: Downloading existing content
      +will just give you the encrypted (scrambled) format, and anything you
      +upload will *not* become encrypted.
       
      -- Config:      read_retries
      -- Env Var:     RCLONE_CACHE_READ_RETRIES
      -- Type:        int
      -- Default:     10
      +The encryption is a secret-key encryption (also called symmetric key encryption)
      +algorithm, where a password (or pass phrase) is used to generate real encryption key.
      +The password can be supplied by user, or you may chose to let rclone
      +generate one. It will be stored in the configuration file, in a lightly obscured form.
      +If you are in an environment where you are not able to keep your configuration
      +secured, you should add
      +[configuration encryption](https://rclone.org/docs/#configuration-encryption)
      +as protection. As long as you have this configuration file, you will be able to
      +decrypt your data. Without the configuration file, as long as you remember
      +the password (or keep it in a safe place), you can re-create the configuration
      +and gain access to the existing data. You may also configure a corresponding
      +remote in a different installation to access the same data.
      +See below for guidance to [changing password](#changing-password).
       
      -#### --cache-workers
      +Encryption uses [cryptographic salt](https://en.wikipedia.org/wiki/Salt_(cryptography)),
      +to permute the encryption key so that the same string may be encrypted in
      +different ways. When configuring the crypt remote it is optional to enter a salt,
      +or to let rclone generate a unique salt. If omitted, rclone uses a built-in unique string.
      +Normally in cryptography, the salt is stored together with the encrypted content,
      +and do not have to be memorized by the user. This is not the case in rclone,
      +because rclone does not store any additional information on the remotes. Use of
      +custom salt is effectively a second password that must be memorized.
       
      -How many workers should run in parallel to download chunks.
      +[File content](#file-encryption) encryption is performed using
      +[NaCl SecretBox](https://godoc.org/golang.org/x/crypto/nacl/secretbox),
      +based on XSalsa20 cipher and Poly1305 for integrity.
      +[Names](#name-encryption) (file- and directory names) are also encrypted
      +by default, but this has some implications and is therefore
      +possible to be turned off.
       
      -Higher values will mean more parallel processing (better CPU needed)
      -and more concurrent requests on the cloud provider.  This impacts
      -several aspects like the cloud provider API limits, more stress on the
      -hardware that rclone runs on but it also means that streams will be
      -more fluid and data will be available much more faster to readers.
      +## Configuration
       
      -**Note**: If the optional Plex integration is enabled then this
      -setting will adapt to the type of reading performed and the value
      -specified here will be used as a maximum number of workers to use.
      +Here is an example of how to make a remote called `secret`.
       
      -Properties:
      +To use `crypt`, first set up the underlying remote. Follow the
      +`rclone config` instructions for the specific backend.
       
      -- Config:      workers
      -- Env Var:     RCLONE_CACHE_WORKERS
      -- Type:        int
      -- Default:     4
      +Before configuring the crypt remote, check the underlying remote is
      +working. In this example the underlying remote is called `remote`.
      +We will configure a path `path` within this remote to contain the
      +encrypted content. Anything inside `remote:path` will be encrypted
      +and anything outside will not.
       
      -#### --cache-chunk-no-memory
      +Configure `crypt` using `rclone config`. In this example the `crypt`
      +remote is called `secret`, to differentiate it from the underlying
      +`remote`.
       
      -Disable the in-memory cache for storing chunks during streaming.
      +When you are done you can use the crypt remote named `secret` just
      +as you would with any other remote, e.g. `rclone copy D:\docs secret:\docs`,
      +and rclone will encrypt and decrypt as needed on the fly.
      +If you access the wrapped remote `remote:path` directly you will bypass
      +the encryption, and anything you read will be in encrypted form, and
      +anything you write will be unencrypted. To avoid issues it is best to
      +configure a dedicated path for encrypted content, and access it
      +exclusively through a crypt remote.
      +
      +

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> secret Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / Encrypt/Decrypt a remote  "crypt" [snip] Storage> crypt ** See help for crypt backend at: https://rclone.org/crypt/ **

      +

      Remote to encrypt/decrypt. Normally should contain a ':' and a path, eg "myremote:path/to/dir", "myremote:bucket" or maybe "myremote:" (not recommended). Enter a string value. Press Enter for the default (""). remote> remote:path How to encrypt the filenames. Enter a string value. Press Enter for the default ("standard"). Choose a number from below, or type in your own value. / Encrypt the filenames. 1 | See the docs for the details.  "standard" 2 / Very simple filename obfuscation.  "obfuscate" / Don't encrypt the file names. 3 | Adds a ".bin" extension only.  "off" filename_encryption> Option to either encrypt directory names or leave them intact.

      +

      NB If filename_encryption is "off" then this option will do nothing. Enter a boolean value (true or false). Press Enter for the default ("true"). Choose a number from below, or type in your own value 1 / Encrypt directory names.  "true" 2 / Don't encrypt directory names, leave them intact.  "false" directory_name_encryption> Password or pass phrase for encryption. y) Yes type in my own password g) Generate random password y/g> y Enter the password: password: Confirm the password: password: Password or pass phrase for salt. Optional but recommended. Should be different to the previous password. y) Yes type in my own password g) Generate random password n) No leave this optional password blank (default) y/g/n> g Password strength in bits. 64 is just about memorable 128 is secure 1024 is the maximum Bits> 128 Your password is: JAsJvRcgR-_veXNfy_sGmQ Use this password? Please note that an obscured version of this password (and not the password itself) will be stored under your configuration file, so keep this generated password in a safe place. y) Yes (default) n) No y/n> Edit advanced config? (y/n) y) Yes n) No (default) y/n> Remote config -------------------- [secret] type = crypt remote = remote:path password = *** ENCRYPTED password2 = ENCRYPTED *** -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d>

      +
      
      +**Important** The crypt password stored in `rclone.conf` is lightly
      +obscured. That only protects it from cursory inspection. It is not
      +secure unless [configuration encryption](https://rclone.org/docs/#configuration-encryption) of `rclone.conf` is specified.
       
      -By default, cache will keep file data during streaming in RAM as well
      -to provide it to readers as fast as possible.
      +A long passphrase is recommended, or `rclone config` can generate a
      +random one.
       
      -This transient data is evicted as soon as it is read and the number of
      -chunks stored doesn't exceed the number of workers. However, depending
      -on other settings like "cache-chunk-size" and "cache-workers" this footprint
      -can increase if there are parallel streams too (multiple files being read
      -at the same time).
      +The obscured password is created using AES-CTR with a static key. The
      +salt is stored verbatim at the beginning of the obscured password. This
      +static key is shared between all versions of rclone.
       
      -If the hardware permits it, use this feature to provide an overall better
      -performance during streaming but it can also be disabled if RAM is not
      -available on the local machine.
      +If you reconfigure rclone with the same passwords/passphrases
      +elsewhere it will be compatible, but the obscured version will be different
      +due to the different salt.
       
      -Properties:
      +Rclone does not encrypt
       
      -- Config:      chunk_no_memory
      -- Env Var:     RCLONE_CACHE_CHUNK_NO_MEMORY
      -- Type:        bool
      -- Default:     false
      +  * file length - this can be calculated within 16 bytes
      +  * modification time - used for syncing
       
      -#### --cache-rps
      +### Specifying the remote
       
      -Limits the number of requests per second to the source FS (-1 to disable).
      +When configuring the remote to encrypt/decrypt, you may specify any
      +string that rclone accepts as a source/destination of other commands.
       
      -This setting places a hard limit on the number of requests per second
      -that cache will be doing to the cloud provider remote and try to
      -respect that value by setting waits between reads.
      +The primary use case is to specify the path into an already configured
      +remote (e.g. `remote:path/to/dir` or `remote:bucket`), such that
      +data in a remote untrusted location can be stored encrypted.
       
      -If you find that you're getting banned or limited on the cloud
      -provider through cache and know that a smaller number of requests per
      -second will allow you to work with it then you can use this setting
      -for that.
      +You may also specify a local filesystem path, such as
      +`/path/to/dir` on Linux, `C:\path\to\dir` on Windows. By creating
      +a crypt remote pointing to such a local filesystem path, you can
      +use rclone as a utility for pure local file encryption, for example
      +to keep encrypted files on a removable USB drive.
       
      -A good balance of all the other settings should make this setting
      -useless but it is available to set for more special cases.
      +**Note**: A string which do not contain a `:` will by rclone be treated
      +as a relative path in the local filesystem. For example, if you enter
      +the name `remote` without the trailing `:`, it will be treated as
      +a subdirectory of the current directory with name "remote".
       
      -**NOTE**: This will limit the number of requests during streams but
      -other API calls to the cloud provider like directory listings will
      -still pass.
      +If a path `remote:path/to/dir` is specified, rclone stores encrypted
      +files in `path/to/dir` on the remote. With file name encryption, files
      +saved to `secret:subdir/subfile` are stored in the unencrypted path
      +`path/to/dir` but the `subdir/subpath` element is encrypted.
       
      -Properties:
      +The path you specify does not have to exist, rclone will create
      +it when needed.
       
      -- Config:      rps
      -- Env Var:     RCLONE_CACHE_RPS
      -- Type:        int
      -- Default:     -1
      +If you intend to use the wrapped remote both directly for keeping
      +unencrypted content, as well as through a crypt remote for encrypted
      +content, it is recommended to point the crypt remote to a separate
      +directory within the wrapped remote. If you use a bucket-based storage
      +system (e.g. Swift, S3, Google Compute Storage, B2) it is generally
      +advisable to wrap the crypt remote around a specific bucket (`s3:bucket`).
      +If wrapping around the entire root of the storage (`s3:`), and use the
      +optional file name encryption, rclone will encrypt the bucket name.
       
      -#### --cache-writes
      +### Changing password
       
      -Cache file data on writes through the FS.
      +Should the password, or the configuration file containing a lightly obscured
      +form of the password, be compromised, you need to re-encrypt your data with
      +a new password. Since rclone uses secret-key encryption, where the encryption
      +key is generated directly from the password kept on the client, it is not
      +possible to change the password/key of already encrypted content. Just changing
      +the password configured for an existing crypt remote means you will no longer
      +able to decrypt any of the previously encrypted content. The only possibility
      +is to re-upload everything via a crypt remote configured with your new password.
       
      -If you need to read files immediately after you upload them through
      -cache you can enable this flag to have their data stored in the
      -cache store at the same time during upload.
      +Depending on the size of your data, your bandwidth, storage quota etc, there are
      +different approaches you can take:
      +- If you have everything in a different location, for example on your local system,
      +you could remove all of the prior encrypted files, change the password for your
      +configured crypt remote (or delete and re-create the crypt configuration),
      +and then re-upload everything from the alternative location.
      +- If you have enough space on the storage system you can create a new crypt
      +remote pointing to a separate directory on the same backend, and then use
      +rclone to copy everything from the original crypt remote to the new,
      +effectively decrypting everything on the fly using the old password and
      +re-encrypting using the new password. When done, delete the original crypt
      +remote directory and finally the rclone crypt configuration with the old password.
      +All data will be streamed from the storage system and back, so you will
      +get half the bandwidth and be charged twice if you have upload and download quota
      +on the storage system.
       
      -Properties:
      +**Note**: A security problem related to the random password generator
      +was fixed in rclone version 1.53.3 (released 2020-11-19). Passwords generated
      +by rclone config in version 1.49.0 (released 2019-08-26) to 1.53.2
      +(released 2020-10-26) are not considered secure and should be changed.
      +If you made up your own password, or used rclone version older than 1.49.0 or
      +newer than 1.53.2 to generate it, you are *not* affected by this issue.
      +See [issue #4783](https://github.com/rclone/rclone/issues/4783) for more
      +details, and a tool you can use to check if you are affected.
       
      -- Config:      writes
      -- Env Var:     RCLONE_CACHE_WRITES
      -- Type:        bool
      -- Default:     false
      +### Example
       
      -#### --cache-tmp-upload-path
      +Create the following file structure using "standard" file name
      +encryption.
      +
      +

      plaintext/ ├── file0.txt ├── file1.txt └── subdir ├── file2.txt ├── file3.txt └── subsubdir └── file4.txt

      +
      
      +Copy these to the remote, and list them
      +
      +

      $ rclone -q copy plaintext secret: $ rclone -q ls secret: 7 file1.txt 6 file0.txt 8 subdir/file2.txt 10 subdir/subsubdir/file4.txt 9 subdir/file3.txt

      +
      
      +The crypt remote looks like
      +
      +

      $ rclone -q ls remote:path 55 hagjclgavj2mbiqm6u6cnjjqcg 54 v05749mltvv1tf4onltun46gls 57 86vhrsv86mpbtd3a0akjuqslj8/dlj7fkq4kdq72emafg7a7s41uo 58 86vhrsv86mpbtd3a0akjuqslj8/7uu829995du6o42n32otfhjqp4/b9pausrfansjth5ob3jkdqd4lc 56 86vhrsv86mpbtd3a0akjuqslj8/8njh1sk437gttmep3p70g81aps

      +
      
      +The directory structure is preserved
      +
      +

      $ rclone -q ls secret:subdir 8 file2.txt 9 file3.txt 10 subsubdir/file4.txt

      +
      
      +Without file name encryption `.bin` extensions are added to underlying
      +names. This prevents the cloud provider attempting to interpret file
      +content.
      +
      +

      $ rclone -q ls remote:path 54 file0.txt.bin 57 subdir/file3.txt.bin 56 subdir/file2.txt.bin 58 subdir/subsubdir/file4.txt.bin 55 file1.txt.bin

      +
      
      +### File name encryption modes
       
      -Directory to keep temporary files until they are uploaded.
      +Off
       
      -This is the path where cache will use as a temporary storage for new
      -files that need to be uploaded to the cloud provider.
      +  * doesn't hide file names or directory structure
      +  * allows for longer file names (~246 characters)
      +  * can use sub paths and copy single files
       
      -Specifying a value will enable this feature. Without it, it is
      -completely disabled and files will be uploaded directly to the cloud
      -provider
      +Standard
       
      -Properties:
      +  * file names encrypted
      +  * file names can't be as long (~143 characters)
      +  * can use sub paths and copy single files
      +  * directory structure visible
      +  * identical files names will have identical uploaded names
      +  * can use shortcuts to shorten the directory recursion
       
      -- Config:      tmp_upload_path
      -- Env Var:     RCLONE_CACHE_TMP_UPLOAD_PATH
      -- Type:        string
      -- Required:    false
      +Obfuscation
       
      -#### --cache-tmp-wait-time
      +This is a simple "rotate" of the filename, with each file having a rot
      +distance based on the filename. Rclone stores the distance at the
      +beginning of the filename. A file called "hello" may become "53.jgnnq".
       
      -How long should files be stored in local cache before being uploaded.
      +Obfuscation is not a strong encryption of filenames, but hinders
      +automated scanning tools picking up on filename patterns. It is an
      +intermediate between "off" and "standard" which allows for longer path
      +segment names.
       
      -This is the duration that a file must wait in the temporary location
      -_cache-tmp-upload-path_ before it is selected for upload.
      +There is a possibility with some unicode based filenames that the
      +obfuscation is weak and may map lower case characters to upper case
      +equivalents.
       
      -Note that only one file is uploaded at a time and it can take longer
      -to start the upload if a queue formed for this purpose.
      +Obfuscation cannot be relied upon for strong protection.
       
      -Properties:
      +  * file names very lightly obfuscated
      +  * file names can be longer than standard encryption
      +  * can use sub paths and copy single files
      +  * directory structure visible
      +  * identical files names will have identical uploaded names
       
      -- Config:      tmp_wait_time
      -- Env Var:     RCLONE_CACHE_TMP_WAIT_TIME
      -- Type:        Duration
      -- Default:     15s
      +Cloud storage systems have limits on file name length and
      +total path length which rclone is more likely to breach using
      +"Standard" file name encryption.  Where file names are less than 156
      +characters in length issues should not be encountered, irrespective of
      +cloud storage provider.
       
      -#### --cache-db-wait-time
      +An experimental advanced option `filename_encoding` is now provided to
      +address this problem to a certain degree.
      +For cloud storage systems with case sensitive file names (e.g. Google Drive),
      +`base64` can be used to reduce file name length. 
      +For cloud storage systems using UTF-16 to store file names internally
      +(e.g. OneDrive, Dropbox, Box), `base32768` can be used to drastically reduce
      +file name length. 
       
      -How long to wait for the DB to be available - 0 is unlimited.
      +An alternative, future rclone file name encryption mode may tolerate
      +backend provider path length limits.
       
      -Only one process can have the DB open at any one time, so rclone waits
      -for this duration for the DB to become available before it gives an
      -error.
      +### Directory name encryption
       
      -If you set it to 0 then it will wait forever.
      +Crypt offers the option of encrypting dir names or leaving them intact.
      +There are two options:
       
      -Properties:
      +True
       
      -- Config:      db_wait_time
      -- Env Var:     RCLONE_CACHE_DB_WAIT_TIME
      -- Type:        Duration
      -- Default:     1s
      +Encrypts the whole file path including directory names
      +Example:
      +`1/12/123.txt` is encrypted to
      +`p0e52nreeaj0a5ea7s64m4j72s/l42g6771hnv3an9cgc8cr2n1ng/qgm4avr35m5loi1th53ato71v0`
       
      -## Backend commands
      +False
       
      -Here are the commands specific to the cache backend.
      +Only encrypts file names, skips directory names
      +Example:
      +`1/12/123.txt` is encrypted to
      +`1/12/qgm4avr35m5loi1th53ato71v0`
       
      -Run them with
       
      -    rclone backend COMMAND remote:
      +### Modification times and hashes
       
      -The help below will explain what arguments each command takes.
      +Crypt stores modification times using the underlying remote so support
      +depends on that.
       
      -See the [backend](https://rclone.org/commands/rclone_backend/) command for more
      -info on how to pass options and arguments.
      +Hashes are not stored for crypt. However the data integrity is
      +protected by an extremely strong crypto authenticator.
       
      -These can be run on a running backend using the rc command
      -[backend/command](https://rclone.org/rc/#backend-command).
      +Use the `rclone cryptcheck` command to check the
      +integrity of an encrypted remote instead of `rclone check` which can't
      +check the checksums properly.
       
      -### stats
       
      -Print stats on the cache backend in JSON format.
      +### Standard options
       
      -    rclone backend stats remote: [options] [<arguments>+]
      +Here are the Standard options specific to crypt (Encrypt/Decrypt a remote).
       
      +#### --crypt-remote
       
      +Remote to encrypt/decrypt.
       
      -#  Chunker
      +Normally should contain a ':' and a path, e.g. "myremote:path/to/dir",
      +"myremote:bucket" or maybe "myremote:" (not recommended).
       
      -The `chunker` overlay transparently splits large files into smaller chunks
      -during upload to wrapped remote and transparently assembles them back
      -when the file is downloaded. This allows to effectively overcome size limits
      -imposed by storage providers.
      +Properties:
       
      -## Configuration
      +- Config:      remote
      +- Env Var:     RCLONE_CRYPT_REMOTE
      +- Type:        string
      +- Required:    true
       
      -To use it, first set up the underlying remote following the configuration
      -instructions for that remote. You can also use a local pathname instead of
      -a remote.
      +#### --crypt-filename-encryption
       
      -First check your chosen remote is working - we'll call it `remote:path` here.
      -Note that anything inside `remote:path` will be chunked and anything outside
      -won't. This means that if you are using a bucket-based remote (e.g. S3, B2, swift)
      -then you should probably put the bucket in the remote `s3:bucket`.
      +How to encrypt the filenames.
       
      -Now configure `chunker` using `rclone config`. We will call this one `overlay`
      -to separate it from the `remote` itself.
      -
      -

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> overlay Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Transparently chunk/split large files  "chunker" [snip] Storage> chunker Remote to chunk/unchunk. Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", "myremote:bucket" or maybe "myremote:" (not recommended). Enter a string value. Press Enter for the default (""). remote> remote:path Files larger than chunk size will be split in chunks. Enter a size with suffix K,M,G,T. Press Enter for the default ("2G"). chunk_size> 100M Choose how chunker handles hash sums. All modes but "none" require metadata. Enter a string value. Press Enter for the default ("md5"). Choose a number from below, or type in your own value 1 / Pass any hash supported by wrapped remote for non-chunked files, return nothing otherwise  "none" 2 / MD5 for composite files  "md5" 3 / SHA1 for composite files  "sha1" 4 / MD5 for all files  "md5all" 5 / SHA1 for all files  "sha1all" 6 / Copying a file to chunker will request MD5 from the source falling back to SHA1 if unsupported  "md5quick" 7 / Similar to "md5quick" but prefers SHA1 over MD5  "sha1quick" hash_type> md5 Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config -------------------- [overlay] type = chunker remote = remote:bucket chunk_size = 100M hash_type = md5 -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

      -
      
      -### Specifying the remote
      +Properties:
      +
      +- Config:      filename_encryption
      +- Env Var:     RCLONE_CRYPT_FILENAME_ENCRYPTION
      +- Type:        string
      +- Default:     "standard"
      +- Examples:
      +    - "standard"
      +        - Encrypt the filenames.
      +        - See the docs for the details.
      +    - "obfuscate"
      +        - Very simple filename obfuscation.
      +    - "off"
      +        - Don't encrypt the file names.
      +        - Adds a ".bin", or "suffix" extension only.
      +
      +#### --crypt-directory-name-encryption
      +
      +Option to either encrypt directory names or leave them intact.
      +
      +NB If filename_encryption is "off" then this option will do nothing.
      +
      +Properties:
      +
      +- Config:      directory_name_encryption
      +- Env Var:     RCLONE_CRYPT_DIRECTORY_NAME_ENCRYPTION
      +- Type:        bool
      +- Default:     true
      +- Examples:
      +    - "true"
      +        - Encrypt directory names.
      +    - "false"
      +        - Don't encrypt directory names, leave them intact.
       
      -In normal use, make sure the remote has a `:` in. If you specify the remote
      -without a `:` then rclone will use a local directory of that name.
      -So if you use a remote of `/path/to/secret/files` then rclone will
      -chunk stuff in that directory. If you use a remote of `name` then rclone
      -will put files in a directory called `name` in the current directory.
      +#### --crypt-password
       
      +Password or pass phrase for encryption.
       
      -### Chunking
      +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
       
      -When rclone starts a file upload, chunker checks the file size. If it
      -doesn't exceed the configured chunk size, chunker will just pass the file
      -to the wrapped remote (however, see caveat below). If a file is large, chunker will transparently cut
      -data in pieces with temporary names and stream them one by one, on the fly.
      -Each data chunk will contain the specified number of bytes, except for the
      -last one which may have less data. If file size is unknown in advance
      -(this is called a streaming upload), chunker will internally create
      -a temporary copy, record its size and repeat the above process.
      +Properties:
       
      -When upload completes, temporary chunk files are finally renamed.
      -This scheme guarantees that operations can be run in parallel and look
      -from outside as atomic.
      -A similar method with hidden temporary chunks is used for other operations
      -(copy/move/rename, etc.). If an operation fails, hidden chunks are normally
      -destroyed, and the target composite file stays intact.
      +- Config:      password
      +- Env Var:     RCLONE_CRYPT_PASSWORD
      +- Type:        string
      +- Required:    true
       
      -When a composite file download is requested, chunker transparently
      -assembles it by concatenating data chunks in order. As the split is trivial
      -one could even manually concatenate data chunks together to obtain the
      -original content.
      +#### --crypt-password2
       
      -When the `list` rclone command scans a directory on wrapped remote,
      -the potential chunk files are accounted for, grouped and assembled into
      -composite directory entries. Any temporary chunks are hidden.
      +Password or pass phrase for salt.
       
      -List and other commands can sometimes come across composite files with
      -missing or invalid chunks, e.g. shadowed by like-named directory or
      -another file. This usually means that wrapped file system has been directly
      -tampered with or damaged. If chunker detects a missing chunk it will
      -by default print warning, skip the whole incomplete group of chunks but
      -proceed with current command.
      -You can set the `--chunker-fail-hard` flag to have commands abort with
      -error message in such cases.
      +Optional but recommended.
      +Should be different to the previous password.
       
      -**Caveat**: As it is now, chunker will always create a temporary file in the 
      -backend and then rename it, even if the file is below the chunk threshold.
      -This will result in unnecessary API calls and can severely restrict throughput
      -when handling transfers primarily composed of small files on some backends (e.g. Box).
      -A workaround to this issue is to use chunker only for files above the chunk threshold
      -via `--min-size` and then perform a separate call without chunker on the remaining
      -files. 
      +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
       
      +Properties:
       
      -#### Chunk names
      +- Config:      password2
      +- Env Var:     RCLONE_CRYPT_PASSWORD2
      +- Type:        string
      +- Required:    false
       
      -The default chunk name format is `*.rclone_chunk.###`, hence by default
      -chunk names are `BIG_FILE_NAME.rclone_chunk.001`,
      -`BIG_FILE_NAME.rclone_chunk.002` etc. You can configure another name format
      -using the `name_format` configuration file option. The format uses asterisk
      -`*` as a placeholder for the base file name and one or more consecutive
      -hash characters `#` as a placeholder for sequential chunk number.
      -There must be one and only one asterisk. The number of consecutive hash
      -characters defines the minimum length of a string representing a chunk number.
      -If decimal chunk number has less digits than the number of hashes, it is
      -left-padded by zeros. If the decimal string is longer, it is left intact.
      -By default numbering starts from 1 but there is another option that allows
      -user to start from 0, e.g. for compatibility with legacy software.
      +### Advanced options
       
      -For example, if name format is `big_*-##.part` and original file name is
      -`data.txt` and numbering starts from 0, then the first chunk will be named
      -`big_data.txt-00.part`, the 99th chunk will be `big_data.txt-98.part`
      -and the 302nd chunk will become `big_data.txt-301.part`.
      +Here are the Advanced options specific to crypt (Encrypt/Decrypt a remote).
       
      -Note that `list` assembles composite directory entries only when chunk names
      -match the configured format and treats non-conforming file names as normal
      -non-chunked files.
      +#### --crypt-server-side-across-configs
       
      -When using `norename` transactions, chunk names will additionally have a unique
      -file version suffix. For example, `BIG_FILE_NAME.rclone_chunk.001_bp562k`.
      +Deprecated: use --server-side-across-configs instead.
       
      +Allow server-side operations (e.g. copy) to work across different crypt configs.
       
      -### Metadata
      +Normally this option is not what you want, but if you have two crypts
      +pointing to the same backend you can use it.
       
      -Besides data chunks chunker will by default create metadata object for
      -a composite file. The object is named after the original file.
      -Chunker allows user to disable metadata completely (the `none` format).
      -Note that metadata is normally not created for files smaller than the
      -configured chunk size. This may change in future rclone releases.
      +This can be used, for example, to change file name encryption type
      +without re-uploading all the data. Just make two crypt backends
      +pointing to two different directories with the single changed
      +parameter and use rclone move to move the files between the crypt
      +remotes.
       
      -#### Simple JSON metadata format
      +Properties:
       
      -This is the default format. It supports hash sums and chunk validation
      -for composite files. Meta objects carry the following fields:
      +- Config:      server_side_across_configs
      +- Env Var:     RCLONE_CRYPT_SERVER_SIDE_ACROSS_CONFIGS
      +- Type:        bool
      +- Default:     false
       
      -- `ver`     - version of format, currently `1`
      -- `size`    - total size of composite file
      -- `nchunks` - number of data chunks in file
      -- `md5`     - MD5 hashsum of composite file (if present)
      -- `sha1`    - SHA1 hashsum (if present)
      -- `txn`     - identifies current version of the file
      +#### --crypt-show-mapping
       
      -There is no field for composite file name as it's simply equal to the name
      -of meta object on the wrapped remote. Please refer to respective sections
      -for details on hashsums and modified time handling.
      +For all files listed show how the names encrypt.
       
      -#### No metadata
      +If this flag is set then for each file that the remote is asked to
      +list, it will log (at level INFO) a line stating the decrypted file
      +name and the encrypted file name.
       
      -You can disable meta objects by setting the meta format option to `none`.
      -In this mode chunker will scan directory for all files that follow
      -configured chunk name format, group them by detecting chunks with the same
      -base name and show group names as virtual composite files.
      -This method is more prone to missing chunk errors (especially missing
      -last chunk) than format with metadata enabled.
      +This is so you can work out which encrypted names are which decrypted
      +names just in case you need to do something with the encrypted file
      +names, or for debugging purposes.
       
      +Properties:
       
      -### Hashsums
      +- Config:      show_mapping
      +- Env Var:     RCLONE_CRYPT_SHOW_MAPPING
      +- Type:        bool
      +- Default:     false
       
      -Chunker supports hashsums only when a compatible metadata is present.
      -Hence, if you choose metadata format of `none`, chunker will report hashsum
      -as `UNSUPPORTED`.
      +#### --crypt-no-data-encryption
       
      -Please note that by default metadata is stored only for composite files.
      -If a file is smaller than configured chunk size, chunker will transparently
      -redirect hash requests to wrapped remote, so support depends on that.
      -You will see the empty string as a hashsum of requested type for small
      -files if the wrapped remote doesn't support it.
      +Option to either encrypt file data or leave it unencrypted.
       
      -Many storage backends support MD5 and SHA1 hash types, so does chunker.
      -With chunker you can choose one or another but not both.
      -MD5 is set by default as the most supported type.
      -Since chunker keeps hashes for composite files and falls back to the
      -wrapped remote hash for non-chunked ones, we advise you to choose the same
      -hash type as supported by wrapped remote so that your file listings
      -look coherent.
      +Properties:
       
      -If your storage backend does not support MD5 or SHA1 but you need consistent
      -file hashing, configure chunker with `md5all` or `sha1all`. These two modes
      -guarantee given hash for all files. If wrapped remote doesn't support it,
      -chunker will then add metadata to all files, even small. However, this can
      -double the amount of small files in storage and incur additional service charges.
      -You can even use chunker to force md5/sha1 support in any other remote
      -at expense of sidecar meta objects by setting e.g. `hash_type=sha1all`
      -to force hashsums and `chunk_size=1P` to effectively disable chunking.
      +- Config:      no_data_encryption
      +- Env Var:     RCLONE_CRYPT_NO_DATA_ENCRYPTION
      +- Type:        bool
      +- Default:     false
      +- Examples:
      +    - "true"
      +        - Don't encrypt file data, leave it unencrypted.
      +    - "false"
      +        - Encrypt file data.
       
      -Normally, when a file is copied to chunker controlled remote, chunker
      -will ask the file source for compatible file hash and revert to on-the-fly
      -calculation if none is found. This involves some CPU overhead but provides
      -a guarantee that given hashsum is available. Also, chunker will reject
      -a server-side copy or move operation if source and destination hashsum
      -types are different resulting in the extra network bandwidth, too.
      -In some rare cases this may be undesired, so chunker provides two optional
      -choices: `sha1quick` and `md5quick`. If the source does not support primary
      -hash type and the quick mode is enabled, chunker will try to fall back to
      -the secondary type. This will save CPU and bandwidth but can result in empty
      -hashsums at destination. Beware of consequences: the `sync` command will
      -revert (sometimes silently) to time/size comparison if compatible hashsums
      -between source and target are not found.
      +#### --crypt-pass-bad-blocks
       
      +If set this will pass bad blocks through as all 0.
       
      -### Modified time
      +This should not be set in normal operation, it should only be set if
      +trying to recover an encrypted file with errors and it is desired to
      +recover as much of the file as possible.
       
      -Chunker stores modification times using the wrapped remote so support
      -depends on that. For a small non-chunked file the chunker overlay simply
      -manipulates modification time of the wrapped remote file.
      -For a composite file with metadata chunker will get and set
      -modification time of the metadata object on the wrapped remote.
      -If file is chunked but metadata format is `none` then chunker will
      -use modification time of the first data chunk.
      +Properties:
       
      +- Config:      pass_bad_blocks
      +- Env Var:     RCLONE_CRYPT_PASS_BAD_BLOCKS
      +- Type:        bool
      +- Default:     false
       
      -### Migrations
      +#### --crypt-filename-encoding
       
      -The idiomatic way to migrate to a different chunk size, hash type, transaction
      -style or chunk naming scheme is to:
      +How to encode the encrypted filename to text string.
       
      -- Collect all your chunked files under a directory and have your
      -  chunker remote point to it.
      -- Create another directory (most probably on the same cloud storage)
      -  and configure a new remote with desired metadata format,
      -  hash type, chunk naming etc.
      -- Now run `rclone sync --interactive oldchunks: newchunks:` and all your data
      -  will be transparently converted in transfer.
      -  This may take some time, yet chunker will try server-side
      -  copy if possible.
      -- After checking data integrity you may remove configuration section
      -  of the old remote.
      +This option could help with shortening the encrypted filename. The 
      +suitable option would depend on the way your remote count the filename
      +length and if it's case sensitive.
       
      -If rclone gets killed during a long operation on a big composite file,
      -hidden temporary chunks may stay in the directory. They will not be
      -shown by the `list` command but will eat up your account quota.
      -Please note that the `deletefile` command deletes only active
      -chunks of a file. As a workaround, you can use remote of the wrapped
      -file system to see them.
      -An easy way to get rid of hidden garbage is to copy littered directory
      -somewhere using the chunker remote and purge the original directory.
      -The `copy` command will copy only active chunks while the `purge` will
      -remove everything including garbage.
      +Properties:
       
      +- Config:      filename_encoding
      +- Env Var:     RCLONE_CRYPT_FILENAME_ENCODING
      +- Type:        string
      +- Default:     "base32"
      +- Examples:
      +    - "base32"
      +        - Encode using base32. Suitable for all remote.
      +    - "base64"
      +        - Encode using base64. Suitable for case sensitive remote.
      +    - "base32768"
      +        - Encode using base32768. Suitable if your remote counts UTF-16 or
      +        - Unicode codepoint instead of UTF-8 byte length. (Eg. Onedrive, Dropbox)
       
      -### Caveats and Limitations
      +#### --crypt-suffix
       
      -Chunker requires wrapped remote to support server-side `move` (or `copy` +
      -`delete`) operations, otherwise it will explicitly refuse to start.
      -This is because it internally renames temporary chunk files to their final
      -names when an operation completes successfully.
      +If this is set it will override the default suffix of ".bin".
       
      -Chunker encodes chunk number in file name, so with default `name_format`
      -setting it adds 17 characters. Also chunker adds 7 characters of temporary
      -suffix during operations. Many file systems limit base file name without path
      -by 255 characters. Using rclone's crypt remote as a base file system limits
      -file name by 143 characters. Thus, maximum name length is 231 for most files
      -and 119 for chunker-over-crypt. A user in need can change name format to
      -e.g. `*.rcc##` and save 10 characters (provided at most 99 chunks per file).
      +Setting suffix to "none" will result in an empty suffix. This may be useful 
      +when the path length is critical.
       
      -Note that a move implemented using the copy-and-delete method may incur
      -double charging with some cloud storage providers.
      +Properties:
       
      -Chunker will not automatically rename existing chunks when you run
      -`rclone config` on a live remote and change the chunk name format.
      -Beware that in result of this some files which have been treated as chunks
      -before the change can pop up in directory listings as normal files
      -and vice versa. The same warning holds for the chunk size.
      -If you desperately need to change critical chunking settings, you should
      -run data migration as described above.
      +- Config:      suffix
      +- Env Var:     RCLONE_CRYPT_SUFFIX
      +- Type:        string
      +- Default:     ".bin"
       
      -If wrapped remote is case insensitive, the chunker overlay will inherit
      -that property (so you can't have a file called "Hello.doc" and "hello.doc"
      -in the same directory).
      +### Metadata
       
      -Chunker included in rclone releases up to `v1.54` can sometimes fail to
      -detect metadata produced by recent versions of rclone. We recommend users
      -to keep rclone up-to-date to avoid data corruption.
      +Any metadata supported by the underlying remote is read and written.
       
      -Changing `transactions` is dangerous and requires explicit migration.
      +See the [metadata](https://rclone.org/docs/#metadata) docs for more info.
       
      +## Backend commands
       
      -### Standard options
      +Here are the commands specific to the crypt backend.
       
      -Here are the Standard options specific to chunker (Transparently chunk/split large files).
      +Run them with
       
      -#### --chunker-remote
      +    rclone backend COMMAND remote:
       
      -Remote to chunk/unchunk.
      +The help below will explain what arguments each command takes.
       
      -Normally should contain a ':' and a path, e.g. "myremote:path/to/dir",
      -"myremote:bucket" or maybe "myremote:" (not recommended).
      +See the [backend](https://rclone.org/commands/rclone_backend/) command for more
      +info on how to pass options and arguments.
       
      -Properties:
      +These can be run on a running backend using the rc command
      +[backend/command](https://rclone.org/rc/#backend-command).
       
      -- Config:      remote
      -- Env Var:     RCLONE_CHUNKER_REMOTE
      -- Type:        string
      -- Required:    true
      +### encode
       
      -#### --chunker-chunk-size
      +Encode the given filename(s)
       
      -Files larger than chunk size will be split in chunks.
      +    rclone backend encode remote: [options] [<arguments>+]
       
      -Properties:
      +This encodes the filenames given as arguments returning a list of
      +strings of the encoded results.
       
      -- Config:      chunk_size
      -- Env Var:     RCLONE_CHUNKER_CHUNK_SIZE
      -- Type:        SizeSuffix
      -- Default:     2Gi
      +Usage Example:
       
      -#### --chunker-hash-type
      +    rclone backend encode crypt: file1 [file2...]
      +    rclone rc backend/command command=encode fs=crypt: file1 [file2...]
       
      -Choose how chunker handles hash sums.
       
      -All modes but "none" require metadata.
      +### decode
       
      -Properties:
      +Decode the given filename(s)
       
      -- Config:      hash_type
      -- Env Var:     RCLONE_CHUNKER_HASH_TYPE
      -- Type:        string
      -- Default:     "md5"
      -- Examples:
      -    - "none"
      -        - Pass any hash supported by wrapped remote for non-chunked files.
      -        - Return nothing otherwise.
      -    - "md5"
      -        - MD5 for composite files.
      -    - "sha1"
      -        - SHA1 for composite files.
      -    - "md5all"
      -        - MD5 for all files.
      -    - "sha1all"
      -        - SHA1 for all files.
      -    - "md5quick"
      -        - Copying a file to chunker will request MD5 from the source.
      -        - Falling back to SHA1 if unsupported.
      -    - "sha1quick"
      -        - Similar to "md5quick" but prefers SHA1 over MD5.
      +    rclone backend decode remote: [options] [<arguments>+]
       
      -### Advanced options
      +This decodes the filenames given as arguments returning a list of
      +strings of the decoded results. It will return an error if any of the
      +inputs are invalid.
       
      -Here are the Advanced options specific to chunker (Transparently chunk/split large files).
      +Usage Example:
       
      -#### --chunker-name-format
      +    rclone backend decode crypt: encryptedfile1 [encryptedfile2...]
      +    rclone rc backend/command command=decode fs=crypt: encryptedfile1 [encryptedfile2...]
       
      -String format of chunk file names.
       
      -The two placeholders are: base file name (*) and chunk number (#...).
      -There must be one and only one asterisk and one or more consecutive hash characters.
      -If chunk number has less digits than the number of hashes, it is left-padded by zeros.
      -If there are more digits in the number, they are left as is.
      -Possible chunk files are ignored if their name does not match given format.
       
      -Properties:
       
      -- Config:      name_format
      -- Env Var:     RCLONE_CHUNKER_NAME_FORMAT
      -- Type:        string
      -- Default:     "*.rclone_chunk.###"
      +## Backing up an encrypted remote
       
      -#### --chunker-start-from
      +If you wish to backup an encrypted remote, it is recommended that you use
      +`rclone sync` on the encrypted files, and make sure the passwords are
      +the same in the new encrypted remote.
       
      -Minimum valid chunk number. Usually 0 or 1.
      +This will have the following advantages
       
      -By default chunk numbers start from 1.
      +  * `rclone sync` will check the checksums while copying
      +  * you can use `rclone check` between the encrypted remotes
      +  * you don't decrypt and encrypt unnecessarily
       
      -Properties:
      +For example, let's say you have your original remote at `remote:` with
      +the encrypted version at `eremote:` with path `remote:crypt`.  You
      +would then set up the new remote `remote2:` and then the encrypted
      +version `eremote2:` with path `remote2:crypt` using the same passwords
      +as `eremote:`.
       
      -- Config:      start_from
      -- Env Var:     RCLONE_CHUNKER_START_FROM
      -- Type:        int
      -- Default:     1
      +To sync the two remotes you would do
       
      -#### --chunker-meta-format
      +    rclone sync --interactive remote:crypt remote2:crypt
       
      -Format of the metadata object or "none".
      +And to check the integrity you would do
       
      -By default "simplejson".
      -Metadata is a small JSON file named after the composite file.
      +    rclone check remote:crypt remote2:crypt
       
      -Properties:
      +## File formats
       
      -- Config:      meta_format
      -- Env Var:     RCLONE_CHUNKER_META_FORMAT
      -- Type:        string
      -- Default:     "simplejson"
      -- Examples:
      -    - "none"
      -        - Do not use metadata files at all.
      -        - Requires hash type "none".
      -    - "simplejson"
      -        - Simple JSON supports hash sums and chunk validation.
      -        - 
      -        - It has the following fields: ver, size, nchunks, md5, sha1.
      +### File encryption
       
      -#### --chunker-fail-hard
      +Files are encrypted 1:1 source file to destination object.  The file
      +has a header and is divided into chunks.
       
      -Choose how chunker should handle files with missing or invalid chunks.
      +#### Header
       
      -Properties:
      +  * 8 bytes magic string `RCLONE\x00\x00`
      +  * 24 bytes Nonce (IV)
       
      -- Config:      fail_hard
      -- Env Var:     RCLONE_CHUNKER_FAIL_HARD
      -- Type:        bool
      -- Default:     false
      -- Examples:
      -    - "true"
      -        - Report errors and abort current command.
      -    - "false"
      -        - Warn user, skip incomplete file and proceed.
      +The initial nonce is generated from the operating systems crypto
      +strong random number generator.  The nonce is incremented for each
      +chunk read making sure each nonce is unique for each block written.
      +The chance of a nonce being reused is minuscule.  If you wrote an
      +exabyte of data (10¹⁸ bytes) you would have a probability of
      +approximately 2×10⁻³² of re-using a nonce.
       
      -#### --chunker-transactions
      +#### Chunk
       
      -Choose how chunker should handle temporary files during transactions.
      +Each chunk will contain 64 KiB of data, except for the last one which
      +may have less data. The data chunk is in standard NaCl SecretBox
      +format. SecretBox uses XSalsa20 and Poly1305 to encrypt and
      +authenticate messages.
       
      -Properties:
      +Each chunk contains:
       
      -- Config:      transactions
      -- Env Var:     RCLONE_CHUNKER_TRANSACTIONS
      -- Type:        string
      -- Default:     "rename"
      -- Examples:
      -    - "rename"
      -        - Rename temporary files after a successful transaction.
      -    - "norename"
      -        - Leave temporary file names and write transaction ID to metadata file.
      -        - Metadata is required for no rename transactions (meta format cannot be "none").
      -        - If you are using norename transactions you should be careful not to downgrade Rclone
      -        - as older versions of Rclone don't support this transaction style and will misinterpret
      -        - files manipulated by norename transactions.
      -        - This method is EXPERIMENTAL, don't use on production systems.
      -    - "auto"
      -        - Rename or norename will be used depending on capabilities of the backend.
      -        - If meta format is set to "none", rename transactions will always be used.
      -        - This method is EXPERIMENTAL, don't use on production systems.
      +  * 16 Bytes of Poly1305 authenticator
      +  * 1 - 65536 bytes XSalsa20 encrypted data
       
      +64k chunk size was chosen as the best performing chunk size (the
      +authenticator takes too much time below this and the performance drops
      +off due to cache effects above this).  Note that these chunks are
      +buffered in memory so they can't be too big.
       
      +This uses a 32 byte (256 bit key) key derived from the user password.
       
      -#  Citrix ShareFile
      +#### Examples
       
      -[Citrix ShareFile](https://sharefile.com) is a secure file sharing and transfer service aimed as business.
      +1 byte file will encrypt to
       
      -## Configuration
      +  * 32 bytes header
      +  * 17 bytes data chunk
       
      -The initial setup for Citrix ShareFile involves getting a token from
      -Citrix ShareFile which you can in your browser.  `rclone config` walks you
      -through it.
      +49 bytes total
       
      -Here is an example of how to make a remote called `remote`.  First run:
      +1 MiB (1048576 bytes) file will encrypt to
       
      -     rclone config
      +  * 32 bytes header
      +  * 16 chunks of 65568 bytes
       
      -This will guide you through an interactive setup process:
      -
      -

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value XX / Citrix Sharefile  "sharefile" Storage> sharefile ** See help for sharefile backend at: https://rclone.org/sharefile/ **

      -

      ID of the root folder

      -

      Leave blank to access "Personal Folders". You can use one of the standard values here or any folder ID (long hex number ID). Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / Access the Personal Folders. (Default)  "" 2 / Access the Favorites folder.  "favorites" 3 / Access all the shared folders.  "allshared" 4 / Access all the individual connectors.  "connectors" 5 / Access the home, favorites, and shared folders as well as the connectors.  "top" root_folder_id> Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config Use web browser to automatically authenticate rclone with remote? * Say Y if the machine running rclone has a web browser you can use * Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N. 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?state=XXX Log in and authorize rclone for access Waiting for code... Got code -------------------- [remote] type = sharefile endpoint = https://XXX.sharefile.com token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2019-09-30T19:41:45.878561877+01:00"} -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

      -
      
      -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a
      -machine with no Internet browser available.
      +1049120 bytes total (a 0.05% overhead). This is the overhead for big
      +files.
       
      -Note that rclone runs a webserver on your local machine to collect the
      -token as returned from Citrix ShareFile. This only runs from the moment it opens
      -your browser to the moment you get back the verification code.  This
      -is on `http://127.0.0.1:53682/` and this it may require you to unblock
      -it temporarily if you are running a host firewall.
      +### Name encryption
       
      -Once configured you can then use `rclone` like this,
      +File names are encrypted segment by segment - the path is broken up
      +into `/` separated strings and these are encrypted individually.
       
      -List directories in top level of your ShareFile
      +File segments are padded using PKCS#7 to a multiple of 16 bytes
      +before encryption.
      +
      +They are then encrypted with EME using AES with 256 bit key. EME
      +(ECB-Mix-ECB) is a wide-block encryption mode presented in the 2003
      +paper "A Parallelizable Enciphering Mode" by Halevi and Rogaway.
       
      -    rclone lsd remote:
      +This makes for deterministic encryption which is what we want - the
      +same filename must encrypt to the same thing otherwise we can't find
      +it on the cloud storage system.
       
      -List all the files in your ShareFile
      +This means that
       
      -    rclone ls remote:
      +  * filenames with the same name will encrypt the same
      +  * filenames which start the same won't have a common prefix
       
      -To copy a local directory to an ShareFile directory called backup
      +This uses a 32 byte key (256 bits) and a 16 byte (128 bits) IV both of
      +which are derived from the user password.
       
      -    rclone copy /home/source remote:backup
      +After encryption they are written out using a modified version of
      +standard `base32` encoding as described in RFC4648.  The standard
      +encoding is modified in two ways:
       
      -Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
      +  * it becomes lower case (no-one likes upper case filenames!)
      +  * we strip the padding character `=`
       
      -### Modified time and hashes
      +`base32` is used rather than the more efficient `base64` so rclone can be
      +used on case insensitive remotes (e.g. Windows, Amazon Drive).
       
      -ShareFile allows modification times to be set on objects accurate to 1
      -second.  These will be used to detect whether objects need syncing or
      -not.
      +### Key derivation
       
      -ShareFile supports MD5 type hashes, so you can use the `--checksum`
      -flag.
      +Rclone uses `scrypt` with parameters `N=16384, r=8, p=1` with an
      +optional user supplied salt (password2) to derive the 32+32+16 = 80
      +bytes of key material required.  If the user doesn't supply a salt
      +then rclone uses an internal one.
       
      -### Transfers
      +`scrypt` makes it impractical to mount a dictionary attack on rclone
      +encrypted data.  For full protection against this you should always use
      +a salt.
       
      -For files above 128 MiB rclone will use a chunked transfer.  Rclone will
      -upload up to `--transfers` chunks at the same time (shared among all
      -the multipart uploads).  Chunks are buffered in memory and are
      -normally 64 MiB so increasing `--transfers` will increase memory use.
      +## SEE ALSO
       
      -### Restricted filename characters
      +* [rclone cryptdecode](https://rclone.org/commands/rclone_cryptdecode/)    - Show forward/reverse mapping of encrypted filenames
       
      -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
      -the following characters are also replaced:
      +#  Compress
       
      -| Character | Value | Replacement |
      -| --------- |:-----:|:-----------:|
      -| \\        | 0x5C  | \           |
      -| *         | 0x2A  | *           |
      -| <         | 0x3C  | <           |
      -| >         | 0x3E  | >           |
      -| ?         | 0x3F  | ?           |
      -| :         | 0x3A  | :           |
      -| \|        | 0x7C  | |           |
      -| "         | 0x22  | "           |
      +## Warning
       
      -File names can also not start or end with the following characters.
      -These only get replaced if they are the first or last character in the
      -name:
      +This remote is currently **experimental**. Things may break and data may be lost. Anything you do with this remote is
      +at your own risk. Please understand the risks associated with using experimental code and don't use this remote in
      +critical applications.
       
      -| Character | Value | Replacement |
      -| --------- |:-----:|:-----------:|
      -| SP        | 0x20  | ␠           |
      -| .         | 0x2E  | .           |
      +The `Compress` remote adds compression to another remote. It is best used with remotes containing
      +many large compressible files.
       
      -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
      -as they can't be used in JSON strings.
      +## Configuration
       
      +To use this remote, all you need to do is specify another remote and a compression mode to use:
      +
      +

      Current remotes:

      +

      Name Type ==== ==== remote_to_press sometype

      +
        +
      1. Edit existing remote $ rclone config
      2. +
      3. New remote
      4. +
      5. Delete remote
      6. +
      7. Rename remote
      8. +
      9. Copy remote
      10. +
      11. Set configuration password
      12. +
      13. Quit config e/n/d/r/c/s/q> n name> compress ... 8 / Compress a remote  "compress" ... Storage> compress ** See help for compress backend at: https://rclone.org/compress/ **
      14. +
      +

      Remote to compress. Enter a string value. Press Enter for the default (""). remote> remote_to_press:subdir Compression mode. Enter a string value. Press Enter for the default ("gzip"). Choose a number from below, or type in your own value 1 / Gzip compression balanced for speed and compression strength.  "gzip" compression_mode> gzip Edit advanced config? (y/n) y) Yes n) No (default) y/n> n Remote config -------------------- [compress] type = compress remote = remote_to_press:subdir compression_mode = gzip -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      +
      
      +### Compression Modes
       
      -### Standard options
      +Currently only gzip compression is supported. It provides a decent balance between speed and size and is well
      +supported by other applications. Compression strength can further be configured via an advanced setting where 0 is no
      +compression and 9 is strongest compression.
       
      -Here are the Standard options specific to sharefile (Citrix Sharefile).
      +### File types
       
      -#### --sharefile-client-id
      +If you open a remote wrapped by compress, you will see that there are many files with an extension corresponding to
      +the compression algorithm you chose. These files are standard files that can be opened by various archive programs, 
      +but they have some hidden metadata that allows them to be used by rclone.
      +While you may download and decompress these files at will, do **not** manually delete or rename files. Files without
      +correct metadata files will not be recognized by rclone.
       
      -OAuth Client Id.
      +### File names
       
      -Leave blank normally.
      +The compressed files will be named `*.###########.gz` where `*` is the base file and the `#` part is base64 encoded 
      +size of the uncompressed file. The file names should not be changed by anything other than the rclone compression backend.
       
      -Properties:
       
      -- Config:      client_id
      -- Env Var:     RCLONE_SHAREFILE_CLIENT_ID
      -- Type:        string
      -- Required:    false
      +### Standard options
       
      -#### --sharefile-client-secret
      +Here are the Standard options specific to compress (Compress a remote).
       
      -OAuth Client Secret.
      +#### --compress-remote
       
      -Leave blank normally.
      +Remote to compress.
       
       Properties:
       
      -- Config:      client_secret
      -- Env Var:     RCLONE_SHAREFILE_CLIENT_SECRET
      +- Config:      remote
      +- Env Var:     RCLONE_COMPRESS_REMOTE
       - Type:        string
      -- Required:    false
      -
      -#### --sharefile-root-folder-id
      +- Required:    true
       
      -ID of the root folder.
      +#### --compress-mode
       
      -Leave blank to access "Personal Folders".  You can use one of the
      -standard values here or any folder ID (long hex number ID).
      +Compression mode.
       
       Properties:
       
      -- Config:      root_folder_id
      -- Env Var:     RCLONE_SHAREFILE_ROOT_FOLDER_ID
      +- Config:      mode
      +- Env Var:     RCLONE_COMPRESS_MODE
       - Type:        string
      -- Required:    false
      +- Default:     "gzip"
       - Examples:
      -    - ""
      -        - Access the Personal Folders (default).
      -    - "favorites"
      -        - Access the Favorites folder.
      -    - "allshared"
      -        - Access all the shared folders.
      -    - "connectors"
      -        - Access all the individual connectors.
      -    - "top"
      -        - Access the home, favorites, and shared folders as well as the connectors.
      +    - "gzip"
      +        - Standard gzip compression with fastest parameters.
       
       ### Advanced options
       
      -Here are the Advanced options specific to sharefile (Citrix Sharefile).
      +Here are the Advanced options specific to compress (Compress a remote).
       
      -#### --sharefile-token
      +#### --compress-level
       
      -OAuth Access Token as a JSON blob.
      +GZIP compression level (-2 to 9).
      +
      +Generally -1 (default, equivalent to 5) is recommended.
      +Levels 1 to 9 increase compression at the cost of speed. Going past 6 
      +generally offers very little return.
      +
      +Level -2 uses Huffman encoding only. Only use if you know what you
      +are doing.
      +Level 0 turns off compression.
       
       Properties:
       
      -- Config:      token
      -- Env Var:     RCLONE_SHAREFILE_TOKEN
      -- Type:        string
      -- Required:    false
      +- Config:      level
      +- Env Var:     RCLONE_COMPRESS_LEVEL
      +- Type:        int
      +- Default:     -1
       
      -#### --sharefile-auth-url
      +#### --compress-ram-cache-limit
       
      -Auth server URL.
      +Some remotes don't allow the upload of files with unknown size.
      +In this case the compressed file will need to be cached to determine
      +it's size.
       
      -Leave blank to use the provider defaults.
      +Files smaller than this limit will be cached in RAM, files larger than 
      +this limit will be cached on disk.
       
       Properties:
       
      -- Config:      auth_url
      -- Env Var:     RCLONE_SHAREFILE_AUTH_URL
      -- Type:        string
      -- Required:    false
      +- Config:      ram_cache_limit
      +- Env Var:     RCLONE_COMPRESS_RAM_CACHE_LIMIT
      +- Type:        SizeSuffix
      +- Default:     20Mi
       
      -#### --sharefile-token-url
      +### Metadata
       
      -Token server url.
      +Any metadata supported by the underlying remote is read and written.
       
      -Leave blank to use the provider defaults.
      +See the [metadata](https://rclone.org/docs/#metadata) docs for more info.
       
      -Properties:
       
      -- Config:      token_url
      -- Env Var:     RCLONE_SHAREFILE_TOKEN_URL
      -- Type:        string
      -- Required:    false
       
      -#### --sharefile-upload-cutoff
      +#  Combine
       
      -Cutoff for switching to multipart upload.
      +The `combine` backend joins remotes together into a single directory
      +tree.
       
      -Properties:
      +For example you might have a remote for images on one provider:
      +
      +

      $ rclone tree s3:imagesbucket / ├── image1.jpg └── image2.jpg

      +
      
      +And a remote for files on another:
      +
      +

      $ rclone tree drive:important/files / ├── file1.txt └── file2.txt

      +
      
      +The `combine` backend can join these together into a synthetic
      +directory structure like this:
      +
      +

      $ rclone tree combined: / ├── files │ ├── file1.txt │ └── file2.txt └── images ├── image1.jpg └── image2.jpg

      +
      
      +You'd do this by specifying an `upstreams` parameter in the config
      +like this
       
      -- Config:      upload_cutoff
      -- Env Var:     RCLONE_SHAREFILE_UPLOAD_CUTOFF
      -- Type:        SizeSuffix
      -- Default:     128Mi
      +    upstreams = images=s3:imagesbucket files=drive:important/files
       
      -#### --sharefile-chunk-size
      +During the initial setup with `rclone config` you will specify the
      +upstreams remotes as a space separated list. The upstream remotes can
      +either be a local paths or other remotes.
       
      -Upload chunk size.
      +## Configuration
       
      -Must a power of 2 >= 256k.
      +Here is an example of how to make a combine called `remote` for the
      +example above. First run:
       
      -Making this larger will improve performance, but note that each chunk
      -is buffered in memory one per transfer.
      +     rclone config
       
      -Reducing this will reduce memory usage but decrease performance.
      +This will guide you through an interactive setup process:
      +
      +

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. ... XX / Combine several remotes into one  (combine) ... Storage> combine Option upstreams. Upstreams for combining These should be in the form dir=remote:path dir2=remote2:path Where before the = is specified the root directory and after is the remote to put there. Embedded spaces can be added using quotes "dir=remote:path with space" "dir2=remote2:path with space" Enter a fs.SpaceSepList value. upstreams> images=s3:imagesbucket files=drive:important/files -------------------- [remote] type = combine upstreams = images=s3:imagesbucket files=drive:important/files -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      +
      
      +### Configuring for Google Drive Shared Drives
       
      -Properties:
      +Rclone has a convenience feature for making a combine backend for all
      +the shared drives you have access to.
       
      -- Config:      chunk_size
      -- Env Var:     RCLONE_SHAREFILE_CHUNK_SIZE
      -- Type:        SizeSuffix
      -- Default:     64Mi
      +Assuming your main (non shared drive) Google drive remote is called
      +`drive:` you would run
       
      -#### --sharefile-endpoint
      +    rclone backend -o config drives drive:
       
      -Endpoint for API calls.
      +This would produce something like this:
       
      -This is usually auto discovered as part of the oauth process, but can
      -be set manually to something like: https://XXX.sharefile.com
      +    [My Drive]
      +    type = alias
      +    remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=:
       
      +    [Test Drive]
      +    type = alias
      +    remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=:
       
      -Properties:
      +    [AllDrives]
      +    type = combine
      +    upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:"
       
      -- Config:      endpoint
      -- Env Var:     RCLONE_SHAREFILE_ENDPOINT
      -- Type:        string
      -- Required:    false
      +If you then add that config to your config file (find it with `rclone
      +config file`) then you can access all the shared drives in one place
      +with the `AllDrives:` remote.
       
      -#### --sharefile-encoding
      +See [the Google Drive docs](https://rclone.org/drive/#drives) for full info.
       
      -The encoding for the backend.
       
      -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
      +### Standard options
       
      -Properties:
      +Here are the Standard options specific to combine (Combine several remotes into one).
       
      -- Config:      encoding
      -- Env Var:     RCLONE_SHAREFILE_ENCODING
      -- Type:        MultiEncoder
      -- Default:     Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot
      +#### --combine-upstreams
       
      +Upstreams for combining
       
      -## Limitations
      +These should be in the form
       
      -Note that ShareFile is case insensitive so you can't have a file called
      -"Hello.doc" and one called "hello.doc".
      +    dir=remote:path dir2=remote2:path
       
      -ShareFile only supports filenames up to 256 characters in length.
      +Where before the = is specified the root directory and after is the remote to
      +put there.
       
      -`rclone about` is not supported by the Citrix ShareFile backend. Backends without
      -this capability cannot determine free space for an rclone mount or
      -use policy `mfs` (most free space) as a member of an rclone union
      -remote.
      +Embedded spaces can be added using quotes
       
      -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/)
      +    "dir=remote:path with space" "dir2=remote2:path with space"
       
      -#  Crypt
       
      -Rclone `crypt` remotes encrypt and decrypt other remotes.
       
      -A remote of type `crypt` does not access a [storage system](https://rclone.org/overview/)
      -directly, but instead wraps another remote, which in turn accesses
      -the storage system. This is similar to how [alias](https://rclone.org/alias/),
      -[union](https://rclone.org/union/), [chunker](https://rclone.org/chunker/)
      -and a few others work. It makes the usage very flexible, as you can
      -add a layer, in this case an encryption layer, on top of any other
      -backend, even in multiple layers. Rclone's functionality
      -can be used as with any other remote, for example you can
      -[mount](https://rclone.org/commands/rclone_mount/) a crypt remote.
      +Properties:
       
      -Accessing a storage system through a crypt remote realizes client-side
      -encryption, which makes it safe to keep your data in a location you do
      -not trust will not get compromised.
      -When working against the `crypt` remote, rclone will automatically
      -encrypt (before uploading) and decrypt (after downloading) on your local
      -system as needed on the fly, leaving the data encrypted at rest in the
      -wrapped remote. If you access the storage system using an application
      -other than rclone, or access the wrapped remote directly using rclone,
      -there will not be any encryption/decryption: Downloading existing content
      -will just give you the encrypted (scrambled) format, and anything you
      -upload will *not* become encrypted.
      +- Config:      upstreams
      +- Env Var:     RCLONE_COMBINE_UPSTREAMS
      +- Type:        SpaceSepList
      +- Default:     
       
      -The encryption is a secret-key encryption (also called symmetric key encryption)
      -algorithm, where a password (or pass phrase) is used to generate real encryption key.
      -The password can be supplied by user, or you may chose to let rclone
      -generate one. It will be stored in the configuration file, in a lightly obscured form.
      -If you are in an environment where you are not able to keep your configuration
      -secured, you should add
      -[configuration encryption](https://rclone.org/docs/#configuration-encryption)
      -as protection. As long as you have this configuration file, you will be able to
      -decrypt your data. Without the configuration file, as long as you remember
      -the password (or keep it in a safe place), you can re-create the configuration
      -and gain access to the existing data. You may also configure a corresponding
      -remote in a different installation to access the same data.
      -See below for guidance to [changing password](#changing-password).
      +### Metadata
       
      -Encryption uses [cryptographic salt](https://en.wikipedia.org/wiki/Salt_(cryptography)),
      -to permute the encryption key so that the same string may be encrypted in
      -different ways. When configuring the crypt remote it is optional to enter a salt,
      -or to let rclone generate a unique salt. If omitted, rclone uses a built-in unique string.
      -Normally in cryptography, the salt is stored together with the encrypted content,
      -and do not have to be memorized by the user. This is not the case in rclone,
      -because rclone does not store any additional information on the remotes. Use of
      -custom salt is effectively a second password that must be memorized.
      +Any metadata supported by the underlying remote is read and written.
       
      -[File content](#file-encryption) encryption is performed using
      -[NaCl SecretBox](https://godoc.org/golang.org/x/crypto/nacl/secretbox),
      -based on XSalsa20 cipher and Poly1305 for integrity.
      -[Names](#name-encryption) (file- and directory names) are also encrypted
      -by default, but this has some implications and is therefore
      -possible to be turned off.
      +See the [metadata](https://rclone.org/docs/#metadata) docs for more info.
       
      -## Configuration
       
      -Here is an example of how to make a remote called `secret`.
       
      -To use `crypt`, first set up the underlying remote. Follow the
      -`rclone config` instructions for the specific backend.
      +#  Dropbox
       
      -Before configuring the crypt remote, check the underlying remote is
      -working. In this example the underlying remote is called `remote`.
      -We will configure a path `path` within this remote to contain the
      -encrypted content. Anything inside `remote:path` will be encrypted
      -and anything outside will not.
      +Paths are specified as `remote:path`
       
      -Configure `crypt` using `rclone config`. In this example the `crypt`
      -remote is called `secret`, to differentiate it from the underlying
      -`remote`.
      +Dropbox paths may be as deep as required, e.g.
      +`remote:directory/subdirectory`.
       
      -When you are done you can use the crypt remote named `secret` just
      -as you would with any other remote, e.g. `rclone copy D:\docs secret:\docs`,
      -and rclone will encrypt and decrypt as needed on the fly.
      -If you access the wrapped remote `remote:path` directly you will bypass
      -the encryption, and anything you read will be in encrypted form, and
      -anything you write will be unencrypted. To avoid issues it is best to
      -configure a dedicated path for encrypted content, and access it
      -exclusively through a crypt remote.
      +## Configuration
      +
      +The initial setup for dropbox involves getting a token from Dropbox
      +which you need to do in your browser.  `rclone config` walks you
      +through it.
      +
      +Here is an example of how to make a remote called `remote`.  First run:
      +
      +     rclone config
      +
      +This will guide you through an interactive setup process:
       
      -

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> secret Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / Encrypt/Decrypt a remote  "crypt" [snip] Storage> crypt ** See help for crypt backend at: https://rclone.org/crypt/ **

      -

      Remote to encrypt/decrypt. Normally should contain a ':' and a path, eg "myremote:path/to/dir", "myremote:bucket" or maybe "myremote:" (not recommended). Enter a string value. Press Enter for the default (""). remote> remote:path How to encrypt the filenames. Enter a string value. Press Enter for the default ("standard"). Choose a number from below, or type in your own value. / Encrypt the filenames. 1 | See the docs for the details.  "standard" 2 / Very simple filename obfuscation.  "obfuscate" / Don't encrypt the file names. 3 | Adds a ".bin" extension only.  "off" filename_encryption> Option to either encrypt directory names or leave them intact.

      -

      NB If filename_encryption is "off" then this option will do nothing. Enter a boolean value (true or false). Press Enter for the default ("true"). Choose a number from below, or type in your own value 1 / Encrypt directory names.  "true" 2 / Don't encrypt directory names, leave them intact.  "false" directory_name_encryption> Password or pass phrase for encryption. y) Yes type in my own password g) Generate random password y/g> y Enter the password: password: Confirm the password: password: Password or pass phrase for salt. Optional but recommended. Should be different to the previous password. y) Yes type in my own password g) Generate random password n) No leave this optional password blank (default) y/g/n> g Password strength in bits. 64 is just about memorable 128 is secure 1024 is the maximum Bits> 128 Your password is: JAsJvRcgR-_veXNfy_sGmQ Use this password? Please note that an obscured version of this password (and not the password itself) will be stored under your configuration file, so keep this generated password in a safe place. y) Yes (default) n) No y/n> Edit advanced config? (y/n) y) Yes n) No (default) y/n> Remote config -------------------- [secret] type = crypt remote = remote:path password = *** ENCRYPTED password2 = ENCRYPTED *** -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d>

      +
        +
      1. New remote
      2. +
      3. Delete remote
      4. +
      5. 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 [snip] XX / Dropbox  "dropbox" [snip] Storage> dropbox Dropbox App Key - leave blank normally. app_key> Dropbox App Secret - leave blank normally. app_secret> Remote config Please visit: https://www.dropbox.com/1/oauth2/authorize?client_id=XXXXXXXXXXXXXXX&response_type=code Enter the code: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXXXXXXXX -------------------- [remote] app_key = app_secret = token = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXX --------------------
      6. +
      7. Yes this is OK
      8. +
      9. Edit this remote
      10. +
      11. Delete this remote y/e/d> y
      12. +
      
      -**Important** The crypt password stored in `rclone.conf` is lightly
      -obscured. That only protects it from cursory inspection. It is not
      -secure unless [configuration encryption](https://rclone.org/docs/#configuration-encryption) of `rclone.conf` is specified.
      +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a
      +machine with no Internet browser available.
       
      -A long passphrase is recommended, or `rclone config` can generate a
      -random one.
      +Note that rclone runs a webserver on your local machine to collect the
      +token as returned from Dropbox. This only
      +runs from the moment it opens your browser to the moment you get back
      +the verification code.  This is on `http://127.0.0.1:53682/` and it
      +may require you to unblock it temporarily if you are running a host
      +firewall, or use manual mode.
       
      -The obscured password is created using AES-CTR with a static key. The
      -salt is stored verbatim at the beginning of the obscured password. This
      -static key is shared between all versions of rclone.
      +You can then use it like this,
       
      -If you reconfigure rclone with the same passwords/passphrases
      -elsewhere it will be compatible, but the obscured version will be different
      -due to the different salt.
      +List directories in top level of your dropbox
       
      -Rclone does not encrypt
      +    rclone lsd remote:
       
      -  * file length - this can be calculated within 16 bytes
      -  * modification time - used for syncing
      +List all the files in your dropbox
       
      -### Specifying the remote
      +    rclone ls remote:
       
      -When configuring the remote to encrypt/decrypt, you may specify any
      -string that rclone accepts as a source/destination of other commands.
      +To copy a local directory to a dropbox directory called backup
       
      -The primary use case is to specify the path into an already configured
      -remote (e.g. `remote:path/to/dir` or `remote:bucket`), such that
      -data in a remote untrusted location can be stored encrypted.
      +    rclone copy /home/source remote:backup
       
      -You may also specify a local filesystem path, such as
      -`/path/to/dir` on Linux, `C:\path\to\dir` on Windows. By creating
      -a crypt remote pointing to such a local filesystem path, you can
      -use rclone as a utility for pure local file encryption, for example
      -to keep encrypted files on a removable USB drive.
      +### Dropbox for business
       
      -**Note**: A string which do not contain a `:` will by rclone be treated
      -as a relative path in the local filesystem. For example, if you enter
      -the name `remote` without the trailing `:`, it will be treated as
      -a subdirectory of the current directory with name "remote".
      +Rclone supports Dropbox for business and Team Folders.
       
      -If a path `remote:path/to/dir` is specified, rclone stores encrypted
      -files in `path/to/dir` on the remote. With file name encryption, files
      -saved to `secret:subdir/subfile` are stored in the unencrypted path
      -`path/to/dir` but the `subdir/subpath` element is encrypted.
      +When using Dropbox for business `remote:` and `remote:path/to/file`
      +will refer to your personal folder.
       
      -The path you specify does not have to exist, rclone will create
      -it when needed.
      +If you wish to see Team Folders you must use a leading `/` in the
      +path, so `rclone lsd remote:/` will refer to the root and show you all
      +Team Folders and your User Folder.
       
      -If you intend to use the wrapped remote both directly for keeping
      -unencrypted content, as well as through a crypt remote for encrypted
      -content, it is recommended to point the crypt remote to a separate
      -directory within the wrapped remote. If you use a bucket-based storage
      -system (e.g. Swift, S3, Google Compute Storage, B2) it is generally
      -advisable to wrap the crypt remote around a specific bucket (`s3:bucket`).
      -If wrapping around the entire root of the storage (`s3:`), and use the
      -optional file name encryption, rclone will encrypt the bucket name.
      +You can then use team folders like this `remote:/TeamFolder` and
      +`remote:/TeamFolder/path/to/file`.
       
      -### Changing password
      +A leading `/` for a Dropbox personal account will do nothing, but it
      +will take an extra HTTP transaction so it should be avoided.
       
      -Should the password, or the configuration file containing a lightly obscured
      -form of the password, be compromised, you need to re-encrypt your data with
      -a new password. Since rclone uses secret-key encryption, where the encryption
      -key is generated directly from the password kept on the client, it is not
      -possible to change the password/key of already encrypted content. Just changing
      -the password configured for an existing crypt remote means you will no longer
      -able to decrypt any of the previously encrypted content. The only possibility
      -is to re-upload everything via a crypt remote configured with your new password.
      +### Modification times and hashes
       
      -Depending on the size of your data, your bandwidth, storage quota etc, there are
      -different approaches you can take:
      -- If you have everything in a different location, for example on your local system,
      -you could remove all of the prior encrypted files, change the password for your
      -configured crypt remote (or delete and re-create the crypt configuration),
      -and then re-upload everything from the alternative location.
      -- If you have enough space on the storage system you can create a new crypt
      -remote pointing to a separate directory on the same backend, and then use
      -rclone to copy everything from the original crypt remote to the new,
      -effectively decrypting everything on the fly using the old password and
      -re-encrypting using the new password. When done, delete the original crypt
      -remote directory and finally the rclone crypt configuration with the old password.
      -All data will be streamed from the storage system and back, so you will
      -get half the bandwidth and be charged twice if you have upload and download quota
      -on the storage system.
      +Dropbox supports modified times, but the only way to set a
      +modification time is to re-upload the file.
       
      -**Note**: A security problem related to the random password generator
      -was fixed in rclone version 1.53.3 (released 2020-11-19). Passwords generated
      -by rclone config in version 1.49.0 (released 2019-08-26) to 1.53.2
      -(released 2020-10-26) are not considered secure and should be changed.
      -If you made up your own password, or used rclone version older than 1.49.0 or
      -newer than 1.53.2 to generate it, you are *not* affected by this issue.
      -See [issue #4783](https://github.com/rclone/rclone/issues/4783) for more
      -details, and a tool you can use to check if you are affected.
      +This means that if you uploaded your data with an older version of
      +rclone which didn't support the v2 API and modified times, rclone will
      +decide to upload all your old data to fix the modification times.  If
      +you don't want this to happen use `--size-only` or `--checksum` flag
      +to stop it.
       
      -### Example
      +Dropbox supports [its own hash
      +type](https://www.dropbox.com/developers/reference/content-hash) which
      +is checked for all transfers.
       
      -Create the following file structure using "standard" file name
      -encryption.
      -
      -

      plaintext/ ├── file0.txt ├── file1.txt └── subdir ├── file2.txt ├── file3.txt └── subsubdir └── file4.txt

      -
      
      -Copy these to the remote, and list them
      -
      -

      $ rclone -q copy plaintext secret: $ rclone -q ls secret: 7 file1.txt 6 file0.txt 8 subdir/file2.txt 10 subdir/subsubdir/file4.txt 9 subdir/file3.txt

      -
      
      -The crypt remote looks like
      -
      -

      $ rclone -q ls remote:path 55 hagjclgavj2mbiqm6u6cnjjqcg 54 v05749mltvv1tf4onltun46gls 57 86vhrsv86mpbtd3a0akjuqslj8/dlj7fkq4kdq72emafg7a7s41uo 58 86vhrsv86mpbtd3a0akjuqslj8/7uu829995du6o42n32otfhjqp4/b9pausrfansjth5ob3jkdqd4lc 56 86vhrsv86mpbtd3a0akjuqslj8/8njh1sk437gttmep3p70g81aps

      -
      
      -The directory structure is preserved
      -
      -

      $ rclone -q ls secret:subdir 8 file2.txt 9 file3.txt 10 subsubdir/file4.txt

      -
      
      -Without file name encryption `.bin` extensions are added to underlying
      -names. This prevents the cloud provider attempting to interpret file
      -content.
      -
      -

      $ rclone -q ls remote:path 54 file0.txt.bin 57 subdir/file3.txt.bin 56 subdir/file2.txt.bin 58 subdir/subsubdir/file4.txt.bin 55 file1.txt.bin

      -
      
      -### File name encryption modes
      +### Restricted filename characters
       
      -Off
      +| Character | Value | Replacement |
      +| --------- |:-----:|:-----------:|
      +| NUL       | 0x00  | ␀           |
      +| /         | 0x2F  | /           |
      +| DEL       | 0x7F  | ␡           |
      +| \         | 0x5C  | \           |
       
      -  * doesn't hide file names or directory structure
      -  * allows for longer file names (~246 characters)
      -  * can use sub paths and copy single files
      +File names can also not end with the following characters.
      +These only get replaced if they are the last character in the name:
       
      -Standard
      +| Character | Value | Replacement |
      +| --------- |:-----:|:-----------:|
      +| SP        | 0x20  | ␠           |
       
      -  * file names encrypted
      -  * file names can't be as long (~143 characters)
      -  * can use sub paths and copy single files
      -  * directory structure visible
      -  * identical files names will have identical uploaded names
      -  * can use shortcuts to shorten the directory recursion
      +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
      +as they can't be used in JSON strings.
       
      -Obfuscation
      +### Batch mode uploads {#batch-mode}
       
      -This is a simple "rotate" of the filename, with each file having a rot
      -distance based on the filename. Rclone stores the distance at the
      -beginning of the filename. A file called "hello" may become "53.jgnnq".
      +Using batch mode uploads is very important for performance when using
      +the Dropbox API. See [the dropbox performance guide](https://developers.dropbox.com/dbx-performance-guide)
      +for more info.
       
      -Obfuscation is not a strong encryption of filenames, but hinders
      -automated scanning tools picking up on filename patterns. It is an
      -intermediate between "off" and "standard" which allows for longer path
      -segment names.
      +There are 3 modes rclone can use for uploads.
       
      -There is a possibility with some unicode based filenames that the
      -obfuscation is weak and may map lower case characters to upper case
      -equivalents.
      +#### --dropbox-batch-mode off
       
      -Obfuscation cannot be relied upon for strong protection.
      +In this mode rclone will not use upload batching. This was the default
      +before rclone v1.55. It has the disadvantage that it is very likely to
      +encounter `too_many_requests` errors like this
       
      -  * file names very lightly obfuscated
      -  * file names can be longer than standard encryption
      -  * can use sub paths and copy single files
      -  * directory structure visible
      -  * identical files names will have identical uploaded names
      +    NOTICE: too_many_requests/.: Too many requests or write operations. Trying again in 15 seconds.
       
      -Cloud storage systems have limits on file name length and
      -total path length which rclone is more likely to breach using
      -"Standard" file name encryption.  Where file names are less than 156
      -characters in length issues should not be encountered, irrespective of
      -cloud storage provider.
      +When rclone receives these it has to wait for 15s or sometimes 300s
      +before continuing which really slows down transfers.
       
      -An experimental advanced option `filename_encoding` is now provided to
      -address this problem to a certain degree.
      -For cloud storage systems with case sensitive file names (e.g. Google Drive),
      -`base64` can be used to reduce file name length. 
      -For cloud storage systems using UTF-16 to store file names internally
      -(e.g. OneDrive, Dropbox, Box), `base32768` can be used to drastically reduce
      -file name length. 
      +This will happen especially if `--transfers` is large, so this mode
      +isn't recommended except for compatibility or investigating problems.
       
      -An alternative, future rclone file name encryption mode may tolerate
      -backend provider path length limits.
      +#### --dropbox-batch-mode sync
       
      -### Directory name encryption
      +In this mode rclone will batch up uploads to the size specified by
      +`--dropbox-batch-size` and commit them together.
       
      -Crypt offers the option of encrypting dir names or leaving them intact.
      -There are two options:
      +Using this mode means you can use a much higher `--transfers`
      +parameter (32 or 64 works fine) without receiving `too_many_requests`
      +errors.
       
      -True
      +This mode ensures full data integrity.
       
      -Encrypts the whole file path including directory names
      -Example:
      -`1/12/123.txt` is encrypted to
      -`p0e52nreeaj0a5ea7s64m4j72s/l42g6771hnv3an9cgc8cr2n1ng/qgm4avr35m5loi1th53ato71v0`
      +Note that there may be a pause when quitting rclone while rclone
      +finishes up the last batch using this mode.
       
      -False
      +#### --dropbox-batch-mode async
       
      -Only encrypts file names, skips directory names
      -Example:
      -`1/12/123.txt` is encrypted to
      -`1/12/qgm4avr35m5loi1th53ato71v0`
      +In this mode rclone will batch up uploads to the size specified by
      +`--dropbox-batch-size` and commit them together.
       
      +However it will not wait for the status of the batch to be returned to
      +the caller. This means rclone can use a much bigger batch size (much
      +bigger than `--transfers`), at the cost of not being able to check the
      +status of the upload.
       
      -### Modified time and hashes
      +This provides the maximum possible upload speed especially with lots
      +of small files, however rclone can't check the file got uploaded
      +properly using this mode.
       
      -Crypt stores modification times using the underlying remote so support
      -depends on that.
      +If you are using this mode then using "rclone check" after the
      +transfer completes is recommended. Or you could do an initial transfer
      +with `--dropbox-batch-mode async` then do a final transfer with
      +`--dropbox-batch-mode sync` (the default).
       
      -Hashes are not stored for crypt. However the data integrity is
      -protected by an extremely strong crypto authenticator.
      +Note that there may be a pause when quitting rclone while rclone
      +finishes up the last batch using this mode.
       
      -Use the `rclone cryptcheck` command to check the
      -integrity of an encrypted remote instead of `rclone check` which can't
      -check the checksums properly.
       
       
       ### Standard options
       
      -Here are the Standard options specific to crypt (Encrypt/Decrypt a remote).
      +Here are the Standard options specific to dropbox (Dropbox).
       
      -#### --crypt-remote
      +#### --dropbox-client-id
       
      -Remote to encrypt/decrypt.
      +OAuth Client Id.
       
      -Normally should contain a ':' and a path, e.g. "myremote:path/to/dir",
      -"myremote:bucket" or maybe "myremote:" (not recommended).
      +Leave blank normally.
       
       Properties:
       
      -- Config:      remote
      -- Env Var:     RCLONE_CRYPT_REMOTE
      +- Config:      client_id
      +- Env Var:     RCLONE_DROPBOX_CLIENT_ID
       - Type:        string
      -- Required:    true
      +- Required:    false
       
      -#### --crypt-filename-encryption
      +#### --dropbox-client-secret
       
      -How to encrypt the filenames.
      +OAuth Client Secret.
      +
      +Leave blank normally.
       
       Properties:
       
      -- Config:      filename_encryption
      -- Env Var:     RCLONE_CRYPT_FILENAME_ENCRYPTION
      +- Config:      client_secret
      +- Env Var:     RCLONE_DROPBOX_CLIENT_SECRET
       - Type:        string
      -- Default:     "standard"
      -- Examples:
      -    - "standard"
      -        - Encrypt the filenames.
      -        - See the docs for the details.
      -    - "obfuscate"
      -        - Very simple filename obfuscation.
      -    - "off"
      -        - Don't encrypt the file names.
      -        - Adds a ".bin", or "suffix" extension only.
      +- Required:    false
       
      -#### --crypt-directory-name-encryption
      +### Advanced options
       
      -Option to either encrypt directory names or leave them intact.
      +Here are the Advanced options specific to dropbox (Dropbox).
       
      -NB If filename_encryption is "off" then this option will do nothing.
      +#### --dropbox-token
      +
      +OAuth Access Token as a JSON blob.
       
       Properties:
       
      -- Config:      directory_name_encryption
      -- Env Var:     RCLONE_CRYPT_DIRECTORY_NAME_ENCRYPTION
      -- Type:        bool
      -- Default:     true
      -- Examples:
      -    - "true"
      -        - Encrypt directory names.
      -    - "false"
      -        - Don't encrypt directory names, leave them intact.
      +- Config:      token
      +- Env Var:     RCLONE_DROPBOX_TOKEN
      +- Type:        string
      +- Required:    false
       
      -#### --crypt-password
      +#### --dropbox-auth-url
       
      -Password or pass phrase for encryption.
      +Auth server URL.
       
      -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
      +Leave blank to use the provider defaults.
       
       Properties:
       
      -- Config:      password
      -- Env Var:     RCLONE_CRYPT_PASSWORD
      +- Config:      auth_url
      +- Env Var:     RCLONE_DROPBOX_AUTH_URL
       - Type:        string
      -- Required:    true
      -
      -#### --crypt-password2
      +- Required:    false
       
      -Password or pass phrase for salt.
      +#### --dropbox-token-url
       
      -Optional but recommended.
      -Should be different to the previous password.
      +Token server url.
       
      -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
      +Leave blank to use the provider defaults.
       
       Properties:
       
      -- Config:      password2
      -- Env Var:     RCLONE_CRYPT_PASSWORD2
      +- Config:      token_url
      +- Env Var:     RCLONE_DROPBOX_TOKEN_URL
       - Type:        string
       - Required:    false
       
      -### Advanced options
      +#### --dropbox-chunk-size
       
      -Here are the Advanced options specific to crypt (Encrypt/Decrypt a remote).
      +Upload chunk size (< 150Mi).
       
      -#### --crypt-server-side-across-configs
      +Any files larger than this will be uploaded in chunks of this size.
       
      -Deprecated: use --server-side-across-configs instead.
      +Note that chunks are buffered in memory (one at a time) so rclone can
      +deal with retries.  Setting this larger will increase the speed
      +slightly (at most 10% for 128 MiB in tests) at the cost of using more
      +memory.  It can be set smaller if you are tight on memory.
       
      -Allow server-side operations (e.g. copy) to work across different crypt configs.
      +Properties:
       
      -Normally this option is not what you want, but if you have two crypts
      -pointing to the same backend you can use it.
      +- Config:      chunk_size
      +- Env Var:     RCLONE_DROPBOX_CHUNK_SIZE
      +- Type:        SizeSuffix
      +- Default:     48Mi
       
      -This can be used, for example, to change file name encryption type
      -without re-uploading all the data. Just make two crypt backends
      -pointing to two different directories with the single changed
      -parameter and use rclone move to move the files between the crypt
      -remotes.
      +#### --dropbox-impersonate
       
      -Properties:
      +Impersonate this user when using a business account.
       
      -- Config:      server_side_across_configs
      -- Env Var:     RCLONE_CRYPT_SERVER_SIDE_ACROSS_CONFIGS
      -- Type:        bool
      -- Default:     false
      +Note that if you want to use impersonate, you should make sure this
      +flag is set when running "rclone config" as this will cause rclone to
      +request the "members.read" scope which it won't normally. This is
      +needed to lookup a members email address into the internal ID that
      +dropbox uses in the API.
       
      -#### --crypt-show-mapping
      +Using the "members.read" scope will require a Dropbox Team Admin
      +to approve during the OAuth flow.
       
      -For all files listed show how the names encrypt.
      +You will have to use your own App (setting your own client_id and
      +client_secret) to use this option as currently rclone's default set of
      +permissions doesn't include "members.read". This can be added once
      +v1.55 or later is in use everywhere.
       
      -If this flag is set then for each file that the remote is asked to
      -list, it will log (at level INFO) a line stating the decrypted file
      -name and the encrypted file name.
       
      -This is so you can work out which encrypted names are which decrypted
      -names just in case you need to do something with the encrypted file
      -names, or for debugging purposes.
      +Properties:
      +
      +- Config:      impersonate
      +- Env Var:     RCLONE_DROPBOX_IMPERSONATE
      +- Type:        string
      +- Required:    false
      +
      +#### --dropbox-shared-files
      +
      +Instructs rclone to work on individual shared files.
      +
      +In this mode rclone's features are extremely limited - only list (ls, lsl, etc.) 
      +operations and read operations (e.g. downloading) are supported in this mode.
      +All other operations will be disabled.
       
       Properties:
       
      -- Config:      show_mapping
      -- Env Var:     RCLONE_CRYPT_SHOW_MAPPING
      +- Config:      shared_files
      +- Env Var:     RCLONE_DROPBOX_SHARED_FILES
       - Type:        bool
       - Default:     false
       
      -#### --crypt-no-data-encryption
      +#### --dropbox-shared-folders
       
      -Option to either encrypt file data or leave it unencrypted.
      +Instructs rclone to work on shared folders.
      +            
      +When this flag is used with no path only the List operation is supported and 
      +all available shared folders will be listed. If you specify a path the first part 
      +will be interpreted as the name of shared folder. Rclone will then try to mount this 
      +shared to the root namespace. On success shared folder rclone proceeds normally. 
      +The shared folder is now pretty much a normal folder and all normal operations 
      +are supported. 
      +
      +Note that we don't unmount the shared folder afterwards so the 
      +--dropbox-shared-folders can be omitted after the first use of a particular 
      +shared folder.
       
       Properties:
       
      -- Config:      no_data_encryption
      -- Env Var:     RCLONE_CRYPT_NO_DATA_ENCRYPTION
      +- Config:      shared_folders
      +- Env Var:     RCLONE_DROPBOX_SHARED_FOLDERS
       - Type:        bool
       - Default:     false
      -- Examples:
      -    - "true"
      -        - Don't encrypt file data, leave it unencrypted.
      -    - "false"
      -        - Encrypt file data.
       
      -#### --crypt-pass-bad-blocks
      +#### --dropbox-pacer-min-sleep
       
      -If set this will pass bad blocks through as all 0.
      +Minimum time to sleep between API calls.
       
      -This should not be set in normal operation, it should only be set if
      -trying to recover an encrypted file with errors and it is desired to
      -recover as much of the file as possible.
      +Properties:
      +
      +- Config:      pacer_min_sleep
      +- Env Var:     RCLONE_DROPBOX_PACER_MIN_SLEEP
      +- Type:        Duration
      +- Default:     10ms
      +
      +#### --dropbox-encoding
      +
      +The encoding for the backend.
      +
      +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
       
       Properties:
       
      -- Config:      pass_bad_blocks
      -- Env Var:     RCLONE_CRYPT_PASS_BAD_BLOCKS
      -- Type:        bool
      -- Default:     false
      +- Config:      encoding
      +- Env Var:     RCLONE_DROPBOX_ENCODING
      +- Type:        Encoding
      +- Default:     Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot
       
      -#### --crypt-filename-encoding
      +#### --dropbox-batch-mode
       
      -How to encode the encrypted filename to text string.
      +Upload file batching sync|async|off.
      +
      +This sets the batch mode used by rclone.
      +
      +For full info see [the main docs](https://rclone.org/dropbox/#batch-mode)
      +
      +This has 3 possible values
      +
      +- off - no batching
      +- sync - batch uploads and check completion (default)
      +- async - batch upload and don't check completion
      +
      +Rclone will close any outstanding batches when it exits which may make
      +a delay on quit.
       
      -This option could help with shortening the encrypted filename. The 
      -suitable option would depend on the way your remote count the filename
      -length and if it's case sensitive.
       
       Properties:
       
      -- Config:      filename_encoding
      -- Env Var:     RCLONE_CRYPT_FILENAME_ENCODING
      +- Config:      batch_mode
      +- Env Var:     RCLONE_DROPBOX_BATCH_MODE
       - Type:        string
      -- Default:     "base32"
      -- Examples:
      -    - "base32"
      -        - Encode using base32. Suitable for all remote.
      -    - "base64"
      -        - Encode using base64. Suitable for case sensitive remote.
      -    - "base32768"
      -        - Encode using base32768. Suitable if your remote counts UTF-16 or
      -        - Unicode codepoint instead of UTF-8 byte length. (Eg. Onedrive, Dropbox)
      +- Default:     "sync"
       
      -#### --crypt-suffix
      +#### --dropbox-batch-size
       
      -If this is set it will override the default suffix of ".bin".
      +Max number of files in upload batch.
      +
      +This sets the batch size of files to upload. It has to be less than 1000.
      +
      +By default this is 0 which means rclone which calculate the batch size
      +depending on the setting of batch_mode.
      +
      +- batch_mode: async - default batch_size is 100
      +- batch_mode: sync - default batch_size is the same as --transfers
      +- batch_mode: off - not in use
      +
      +Rclone will close any outstanding batches when it exits which may make
      +a delay on quit.
      +
      +Setting this is a great idea if you are uploading lots of small files
      +as it will make them a lot quicker. You can use --transfers 32 to
      +maximise throughput.
       
      -Setting suffix to "none" will result in an empty suffix. This may be useful 
      -when the path length is critical.
       
       Properties:
       
      -- Config:      suffix
      -- Env Var:     RCLONE_CRYPT_SUFFIX
      -- Type:        string
      -- Default:     ".bin"
      +- Config:      batch_size
      +- Env Var:     RCLONE_DROPBOX_BATCH_SIZE
      +- Type:        int
      +- Default:     0
       
      -### Metadata
      +#### --dropbox-batch-timeout
       
      -Any metadata supported by the underlying remote is read and written.
      +Max time to allow an idle upload batch before uploading.
       
      -See the [metadata](https://rclone.org/docs/#metadata) docs for more info.
      +If an upload batch is idle for more than this long then it will be
      +uploaded.
       
      -## Backend commands
      +The default for this is 0 which means rclone will choose a sensible
      +default based on the batch_mode in use.
       
      -Here are the commands specific to the crypt backend.
      +- batch_mode: async - default batch_timeout is 10s
      +- batch_mode: sync - default batch_timeout is 500ms
      +- batch_mode: off - not in use
       
      -Run them with
       
      -    rclone backend COMMAND remote:
      +Properties:
       
      -The help below will explain what arguments each command takes.
      +- Config:      batch_timeout
      +- Env Var:     RCLONE_DROPBOX_BATCH_TIMEOUT
      +- Type:        Duration
      +- Default:     0s
       
      -See the [backend](https://rclone.org/commands/rclone_backend/) command for more
      -info on how to pass options and arguments.
      +#### --dropbox-batch-commit-timeout
       
      -These can be run on a running backend using the rc command
      -[backend/command](https://rclone.org/rc/#backend-command).
      +Max time to wait for a batch to finish committing
       
      -### encode
      +Properties:
       
      -Encode the given filename(s)
      +- Config:      batch_commit_timeout
      +- Env Var:     RCLONE_DROPBOX_BATCH_COMMIT_TIMEOUT
      +- Type:        Duration
      +- Default:     10m0s
       
      -    rclone backend encode remote: [options] [<arguments>+]
       
      -This encodes the filenames given as arguments returning a list of
      -strings of the encoded results.
       
      -Usage Example:
      +## Limitations
       
      -    rclone backend encode crypt: file1 [file2...]
      -    rclone rc backend/command command=encode fs=crypt: file1 [file2...]
      +Note that Dropbox is case insensitive so you can't have a file called
      +"Hello.doc" and one called "hello.doc".
       
      +There are some file names such as `thumbs.db` which Dropbox can't
      +store.  There is a full list of them in the ["Ignored Files" section
      +of this document](https://www.dropbox.com/en/help/145).  Rclone will
      +issue an error message `File name disallowed - not uploading` if it
      +attempts to upload one of those file names, but the sync won't fail.
       
      -### decode
      +Some errors may occur if you try to sync copyright-protected files
      +because Dropbox has its own [copyright detector](https://techcrunch.com/2014/03/30/how-dropbox-knows-when-youre-sharing-copyrighted-stuff-without-actually-looking-at-your-stuff/) that
      +prevents this sort of file being downloaded. This will return the error `ERROR :
      +/path/to/your/file: Failed to copy: failed to open source object:
      +path/restricted_content/.`
       
      -Decode the given filename(s)
      +If you have more than 10,000 files in a directory then `rclone purge
      +dropbox:dir` will return the error `Failed to purge: There are too
      +many files involved in this operation`.  As a work-around do an
      +`rclone delete dropbox:dir` followed by an `rclone rmdir dropbox:dir`.
       
      -    rclone backend decode remote: [options] [<arguments>+]
      +When using `rclone link` you'll need to set `--expire` if using a
      +non-personal account otherwise the visibility may not be correct.
      +(Note that `--expire` isn't supported on personal accounts). See the
      +[forum discussion](https://forum.rclone.org/t/rclone-link-dropbox-permissions/23211) and the 
      +[dropbox SDK issue](https://github.com/dropbox/dropbox-sdk-go-unofficial/issues/75).
       
      -This decodes the filenames given as arguments returning a list of
      -strings of the decoded results. It will return an error if any of the
      -inputs are invalid.
      +## Get your own Dropbox App ID
       
      -Usage Example:
      +When you use rclone with Dropbox in its default configuration you are using rclone's App ID. This is shared between all the rclone users.
       
      -    rclone backend decode crypt: encryptedfile1 [encryptedfile2...]
      -    rclone rc backend/command command=decode fs=crypt: encryptedfile1 [encryptedfile2...]
      +Here is how to create your own Dropbox App ID for rclone:
      +
      +1. Log into the [Dropbox App console](https://www.dropbox.com/developers/apps/create) with your Dropbox Account (It need not
      +to be the same account as the Dropbox you want to access)
      +
      +2. Choose an API => Usually this should be `Dropbox API`
      +
      +3. Choose the type of access you want to use => `Full Dropbox` or `App Folder`. If you want to use Team Folders, `Full Dropbox` is required ([see here](https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-create-team-folder-inside-my-app-s-folder/m-p/601005/highlight/true#M27911)).
      +
      +4. Name your App. The app name is global, so you can't use `rclone` for example
      +
      +5. Click the button `Create App`
      +
      +6. Switch to the `Permissions` tab. Enable at least the following permissions: `account_info.read`, `files.metadata.write`, `files.content.write`, `files.content.read`, `sharing.write`. The `files.metadata.read` and `sharing.read` checkboxes will be marked too. Click `Submit`
      +
      +7. Switch to the `Settings` tab. Fill `OAuth2 - Redirect URIs` as `http://localhost:53682/` and click on `Add`
      +
      +8. Find the `App key` and `App secret` values on the `Settings` tab. Use these values in rclone config to add a new remote or edit an existing remote. The `App key` setting corresponds to `client_id` in rclone config, the `App secret` corresponds to `client_secret`
      +
      +#  Enterprise File Fabric
      +
      +This backend supports [Storage Made Easy's Enterprise File
      +Fabric™](https://storagemadeeasy.com/about/) which provides a software
      +solution to integrate and unify File and Object Storage accessible
      +through a global file system.
      +
      +## Configuration
      +
      +The initial setup for the Enterprise File Fabric backend involves
      +getting a token from the Enterprise File Fabric which you need to
      +do in your browser.  `rclone config` walks you through it.
       
      +Here is an example of how to make a remote called `remote`.  First run:
       
      +     rclone config
       
      +This will guide you through an interactive setup process:
      +
      +

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / Enterprise File Fabric  "filefabric" [snip] Storage> filefabric ** See help for filefabric backend at: https://rclone.org/filefabric/ **

      +

      URL of the Enterprise File Fabric to connect to Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / Storage Made Easy US  "https://storagemadeeasy.com" 2 / Storage Made Easy EU  "https://eu.storagemadeeasy.com" 3 / Connect to your Enterprise File Fabric  "https://yourfabric.smestorage.com" url> https://yourfabric.smestorage.com/ ID of the root folder Leave blank normally.

      +

      Fill in to make rclone start with directory of a given ID.

      +

      Enter a string value. Press Enter for the default (""). root_folder_id> Permanent Authentication Token

      +

      A Permanent Authentication Token can be created in the Enterprise File Fabric, on the users Dashboard under Security, there is an entry you'll see called "My Authentication Tokens". Click the Manage button to create one.

      +

      These tokens are normally valid for several years.

      +

      For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens

      +

      Enter a string value. Press Enter for the default (""). permanent_token> xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx Edit advanced config? (y/n) y) Yes n) No (default) y/n> n Remote config -------------------- [remote] type = filefabric url = https://yourfabric.smestorage.com/ permanent_token = xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      +
      
      +Once configured you can then use `rclone` like this,
       
      -## Backing up an encrypted remote
      +List directories in top level of your Enterprise File Fabric
       
      -If you wish to backup an encrypted remote, it is recommended that you use
      -`rclone sync` on the encrypted files, and make sure the passwords are
      -the same in the new encrypted remote.
      +    rclone lsd remote:
       
      -This will have the following advantages
      +List all the files in your Enterprise File Fabric
       
      -  * `rclone sync` will check the checksums while copying
      -  * you can use `rclone check` between the encrypted remotes
      -  * you don't decrypt and encrypt unnecessarily
      +    rclone ls remote:
       
      -For example, let's say you have your original remote at `remote:` with
      -the encrypted version at `eremote:` with path `remote:crypt`.  You
      -would then set up the new remote `remote2:` and then the encrypted
      -version `eremote2:` with path `remote2:crypt` using the same passwords
      -as `eremote:`.
      +To copy a local directory to an Enterprise File Fabric directory called backup
       
      -To sync the two remotes you would do
      +    rclone copy /home/source remote:backup
       
      -    rclone sync --interactive remote:crypt remote2:crypt
      +### Modification times and hashes
       
      -And to check the integrity you would do
      +The Enterprise File Fabric allows modification times to be set on
      +files accurate to 1 second.  These will be used to detect whether
      +objects need syncing or not.
       
      -    rclone check remote:crypt remote2:crypt
      +The Enterprise File Fabric does not support any data hashes at this time.
       
      -## File formats
      +### Restricted filename characters
       
      -### File encryption
      +The [default restricted characters set](https://rclone.org/overview/#restricted-characters)
      +will be replaced.
       
      -Files are encrypted 1:1 source file to destination object.  The file
      -has a header and is divided into chunks.
      +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
      +as they can't be used in JSON strings.
       
      -#### Header
      +### Empty files
       
      -  * 8 bytes magic string `RCLONE\x00\x00`
      -  * 24 bytes Nonce (IV)
      +Empty files aren't supported by the Enterprise File Fabric. Rclone will therefore
      +upload an empty file as a single space with a mime type of
      +`application/vnd.rclone.empty.file` and files with that mime type are
      +treated as empty.
       
      -The initial nonce is generated from the operating systems crypto
      -strong random number generator.  The nonce is incremented for each
      -chunk read making sure each nonce is unique for each block written.
      -The chance of a nonce being re-used is minuscule.  If you wrote an
      -exabyte of data (10¹⁸ bytes) you would have a probability of
      -approximately 2×10⁻³² of re-using a nonce.
      +### Root folder ID ###
       
      -#### Chunk
      +You can set the `root_folder_id` for rclone.  This is the directory
      +(identified by its `Folder ID`) that rclone considers to be the root
      +of your Enterprise File Fabric.
       
      -Each chunk will contain 64 KiB of data, except for the last one which
      -may have less data. The data chunk is in standard NaCl SecretBox
      -format. SecretBox uses XSalsa20 and Poly1305 to encrypt and
      -authenticate messages.
      +Normally you will leave this blank and rclone will determine the
      +correct root to use itself.
       
      -Each chunk contains:
      +However you can set this to restrict rclone to a specific folder
      +hierarchy.
       
      -  * 16 Bytes of Poly1305 authenticator
      -  * 1 - 65536 bytes XSalsa20 encrypted data
      +In order to do this you will have to find the `Folder ID` of the
      +directory you wish rclone to display.  These aren't displayed in the
      +web interface, but you can use `rclone lsf` to find them, for example
      +
      +

      $ rclone lsf --dirs-only -Fip --csv filefabric: 120673758,Burnt PDFs/ 120673759,My Quick Uploads/ 120673755,My Syncs/ 120673756,My backups/ 120673757,My contacts/ 120673761,S3 Storage/

      +
      
      +The ID for "S3 Storage" would be `120673761`.
       
      -64k chunk size was chosen as the best performing chunk size (the
      -authenticator takes too much time below this and the performance drops
      -off due to cache effects above this).  Note that these chunks are
      -buffered in memory so they can't be too big.
       
      -This uses a 32 byte (256 bit key) key derived from the user password.
      +### Standard options
       
      -#### Examples
      +Here are the Standard options specific to filefabric (Enterprise File Fabric).
       
      -1 byte file will encrypt to
      +#### --filefabric-url
       
      -  * 32 bytes header
      -  * 17 bytes data chunk
      +URL of the Enterprise File Fabric to connect to.
       
      -49 bytes total
      +Properties:
       
      -1 MiB (1048576 bytes) file will encrypt to
      +- Config:      url
      +- Env Var:     RCLONE_FILEFABRIC_URL
      +- Type:        string
      +- Required:    true
      +- Examples:
      +    - "https://storagemadeeasy.com"
      +        - Storage Made Easy US
      +    - "https://eu.storagemadeeasy.com"
      +        - Storage Made Easy EU
      +    - "https://yourfabric.smestorage.com"
      +        - Connect to your Enterprise File Fabric
       
      -  * 32 bytes header
      -  * 16 chunks of 65568 bytes
      +#### --filefabric-root-folder-id
       
      -1049120 bytes total (a 0.05% overhead). This is the overhead for big
      -files.
      +ID of the root folder.
       
      -### Name encryption
      +Leave blank normally.
       
      -File names are encrypted segment by segment - the path is broken up
      -into `/` separated strings and these are encrypted individually.
      +Fill in to make rclone start with directory of a given ID.
       
      -File segments are padded using PKCS#7 to a multiple of 16 bytes
      -before encryption.
       
      -They are then encrypted with EME using AES with 256 bit key. EME
      -(ECB-Mix-ECB) is a wide-block encryption mode presented in the 2003
      -paper "A Parallelizable Enciphering Mode" by Halevi and Rogaway.
      +Properties:
       
      -This makes for deterministic encryption which is what we want - the
      -same filename must encrypt to the same thing otherwise we can't find
      -it on the cloud storage system.
      +- Config:      root_folder_id
      +- Env Var:     RCLONE_FILEFABRIC_ROOT_FOLDER_ID
      +- Type:        string
      +- Required:    false
       
      -This means that
      +#### --filefabric-permanent-token
       
      -  * filenames with the same name will encrypt the same
      -  * filenames which start the same won't have a common prefix
      +Permanent Authentication Token.
       
      -This uses a 32 byte key (256 bits) and a 16 byte (128 bits) IV both of
      -which are derived from the user password.
      +A Permanent Authentication Token can be created in the Enterprise File
      +Fabric, on the users Dashboard under Security, there is an entry
      +you'll see called "My Authentication Tokens". Click the Manage button
      +to create one.
       
      -After encryption they are written out using a modified version of
      -standard `base32` encoding as described in RFC4648.  The standard
      -encoding is modified in two ways:
      +These tokens are normally valid for several years.
       
      -  * it becomes lower case (no-one likes upper case filenames!)
      -  * we strip the padding character `=`
      +For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens
       
      -`base32` is used rather than the more efficient `base64` so rclone can be
      -used on case insensitive remotes (e.g. Windows, Amazon Drive).
       
      -### Key derivation
      +Properties:
       
      -Rclone uses `scrypt` with parameters `N=16384, r=8, p=1` with an
      -optional user supplied salt (password2) to derive the 32+32+16 = 80
      -bytes of key material required.  If the user doesn't supply a salt
      -then rclone uses an internal one.
      +- Config:      permanent_token
      +- Env Var:     RCLONE_FILEFABRIC_PERMANENT_TOKEN
      +- Type:        string
      +- Required:    false
       
      -`scrypt` makes it impractical to mount a dictionary attack on rclone
      -encrypted data.  For full protection against this you should always use
      -a salt.
      +### Advanced options
       
      -## SEE ALSO
      +Here are the Advanced options specific to filefabric (Enterprise File Fabric).
       
      -* [rclone cryptdecode](https://rclone.org/commands/rclone_cryptdecode/)    - Show forward/reverse mapping of encrypted filenames
      +#### --filefabric-token
       
      -#  Compress
      +Session Token.
       
      -## Warning
      +This is a session token which rclone caches in the config file. It is
      +usually valid for 1 hour.
       
      -This remote is currently **experimental**. Things may break and data may be lost. Anything you do with this remote is
      -at your own risk. Please understand the risks associated with using experimental code and don't use this remote in
      -critical applications.
      +Don't set this value - rclone will set it automatically.
       
      -The `Compress` remote adds compression to another remote. It is best used with remotes containing
      -many large compressible files.
       
      -## Configuration
      +Properties:
       
      -To use this remote, all you need to do is specify another remote and a compression mode to use:
      -
      -

      Current remotes:

      -

      Name Type ==== ==== remote_to_press sometype

      -
        -
      1. Edit existing remote $ rclone config
      2. -
      3. New remote
      4. -
      5. Delete remote
      6. -
      7. Rename remote
      8. -
      9. Copy remote
      10. -
      11. Set configuration password
      12. -
      13. Quit config e/n/d/r/c/s/q> n name> compress ... 8 / Compress a remote  "compress" ... Storage> compress ** See help for compress backend at: https://rclone.org/compress/ **
      14. -
      -

      Remote to compress. Enter a string value. Press Enter for the default (""). remote> remote_to_press:subdir Compression mode. Enter a string value. Press Enter for the default ("gzip"). Choose a number from below, or type in your own value 1 / Gzip compression balanced for speed and compression strength.  "gzip" compression_mode> gzip Edit advanced config? (y/n) y) Yes n) No (default) y/n> n Remote config -------------------- [compress] type = compress remote = remote_to_press:subdir compression_mode = gzip -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      -
      
      -### Compression Modes
      +- Config:      token
      +- Env Var:     RCLONE_FILEFABRIC_TOKEN
      +- Type:        string
      +- Required:    false
       
      -Currently only gzip compression is supported. It provides a decent balance between speed and size and is well
      -supported by other applications. Compression strength can further be configured via an advanced setting where 0 is no
      -compression and 9 is strongest compression.
      +#### --filefabric-token-expiry
       
      -### File types
      +Token expiry time.
       
      -If you open a remote wrapped by compress, you will see that there are many files with an extension corresponding to
      -the compression algorithm you chose. These files are standard files that can be opened by various archive programs, 
      -but they have some hidden metadata that allows them to be used by rclone.
      -While you may download and decompress these files at will, do **not** manually delete or rename files. Files without
      -correct metadata files will not be recognized by rclone.
      +Don't set this value - rclone will set it automatically.
       
      -### File names
       
      -The compressed files will be named `*.###########.gz` where `*` is the base file and the `#` part is base64 encoded 
      -size of the uncompressed file. The file names should not be changed by anything other than the rclone compression backend.
      +Properties:
       
      +- Config:      token_expiry
      +- Env Var:     RCLONE_FILEFABRIC_TOKEN_EXPIRY
      +- Type:        string
      +- Required:    false
       
      -### Standard options
      +#### --filefabric-version
       
      -Here are the Standard options specific to compress (Compress a remote).
      +Version read from the file fabric.
       
      -#### --compress-remote
      +Don't set this value - rclone will set it automatically.
       
      -Remote to compress.
       
       Properties:
       
      -- Config:      remote
      -- Env Var:     RCLONE_COMPRESS_REMOTE
      +- Config:      version
      +- Env Var:     RCLONE_FILEFABRIC_VERSION
       - Type:        string
      -- Required:    true
      +- Required:    false
       
      -#### --compress-mode
      +#### --filefabric-encoding
       
      -Compression mode.
      +The encoding for the backend.
      +
      +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
       
       Properties:
       
      -- Config:      mode
      -- Env Var:     RCLONE_COMPRESS_MODE
      -- Type:        string
      -- Default:     "gzip"
      -- Examples:
      -    - "gzip"
      -        - Standard gzip compression with fastest parameters.
      +- Config:      encoding
      +- Env Var:     RCLONE_FILEFABRIC_ENCODING
      +- Type:        Encoding
      +- Default:     Slash,Del,Ctl,InvalidUtf8,Dot
       
      -### Advanced options
       
      -Here are the Advanced options specific to compress (Compress a remote).
       
      -#### --compress-level
      +#  FTP
       
      -GZIP compression level (-2 to 9).
      +FTP is the File Transfer Protocol. Rclone FTP support is provided using the
      +[github.com/jlaffaye/ftp](https://godoc.org/github.com/jlaffaye/ftp)
      +package.
       
      -Generally -1 (default, equivalent to 5) is recommended.
      -Levels 1 to 9 increase compression at the cost of speed. Going past 6 
      -generally offers very little return.
      +[Limitations of Rclone's FTP backend](#limitations)
       
      -Level -2 uses Huffman encoding only. Only use if you know what you
      -are doing.
      -Level 0 turns off compression.
      +Paths are specified as `remote:path`. If the path does not begin with
      +a `/` it is relative to the home directory of the user.  An empty path
      +`remote:` refers to the user's home directory.
       
      -Properties:
      +## Configuration
       
      -- Config:      level
      -- Env Var:     RCLONE_COMPRESS_LEVEL
      -- Type:        int
      -- Default:     -1
      +To create an FTP configuration named `remote`, run
       
      -#### --compress-ram-cache-limit
      +    rclone config
       
      -Some remotes don't allow the upload of files with unknown size.
      -In this case the compressed file will need to be cached to determine
      -it's size.
      +Rclone config guides you through an interactive setup process. A minimal
      +rclone FTP remote definition only requires host, username and password.
      +For an anonymous FTP server, see [below](#anonymous-ftp).
      +
      +

      No remotes found, make a new one? n) New remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config n/r/c/s/q> n name> remote Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / FTP  "ftp" [snip] Storage> ftp ** See help for ftp backend at: https://rclone.org/ftp/ **

      +

      FTP host to connect to Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / Connect to ftp.example.com  "ftp.example.com" host> ftp.example.com FTP username Enter a string value. Press Enter for the default ("$USER"). user> FTP port number Enter a signed integer. Press Enter for the default (21). port> FTP password y) Yes type in my own password g) Generate random password y/g> y Enter the password: password: Confirm the password: password: Use FTP over TLS (Implicit) Enter a boolean value (true or false). Press Enter for the default ("false"). tls> Use FTP over TLS (Explicit) Enter a boolean value (true or false). Press Enter for the default ("false"). explicit_tls> Remote config -------------------- [remote] type = ftp host = ftp.example.com pass = *** ENCRYPTED *** -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

      +
      
      +To see all directories in the home directory of `remote`
       
      -Files smaller than this limit will be cached in RAM, files larger than 
      -this limit will be cached on disk.
      +    rclone lsd remote:
       
      -Properties:
      +Make a new directory
       
      -- Config:      ram_cache_limit
      -- Env Var:     RCLONE_COMPRESS_RAM_CACHE_LIMIT
      -- Type:        SizeSuffix
      -- Default:     20Mi
      +    rclone mkdir remote:path/to/directory
       
      -### Metadata
      +List the contents of a directory
       
      -Any metadata supported by the underlying remote is read and written.
      +    rclone ls remote:path/to/directory
       
      -See the [metadata](https://rclone.org/docs/#metadata) docs for more info.
      +Sync `/home/local/directory` to the remote directory, deleting any
      +excess files in the directory.
       
      +    rclone sync --interactive /home/local/directory remote:directory
       
      +### Anonymous FTP
       
      -#  Combine
      +When connecting to a FTP server that allows anonymous login, you can use the
      +special "anonymous" username. Traditionally, this user account accepts any
      +string as a password, although it is common to use either the password
      +"anonymous" or "guest". Some servers require the use of a valid e-mail
      +address as password.
       
      -The `combine` backend joins remotes together into a single directory
      -tree.
      +Using [on-the-fly](#backend-path-to-dir) or
      +[connection string](https://rclone.org/docs/#connection-strings) remotes makes it easy to access
      +such servers, without requiring any configuration in advance. The following
      +are examples of that:
       
      -For example you might have a remote for images on one provider:
      -
      -

      $ rclone tree s3:imagesbucket / ├── image1.jpg └── image2.jpg

      -
      
      -And a remote for files on another:
      -
      -

      $ rclone tree drive:important/files / ├── file1.txt └── file2.txt

      -
      
      -The `combine` backend can join these together into a synthetic
      -directory structure like this:
      -
      -

      $ rclone tree combined: / ├── files │ ├── file1.txt │ └── file2.txt └── images ├── image1.jpg └── image2.jpg

      -
      
      -You'd do this by specifying an `upstreams` parameter in the config
      -like this
      +    rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=$(rclone obscure dummy)
      +    rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=$(rclone obscure dummy):
       
      -    upstreams = images=s3:imagesbucket files=drive:important/files
      +The above examples work in Linux shells and in PowerShell, but not Windows
      +Command Prompt. They execute the [rclone obscure](https://rclone.org/commands/rclone_obscure/)
      +command to create a password string in the format required by the
      +[pass](#ftp-pass) option. The following examples are exactly the same, except use
      +an already obscured string representation of the same password "dummy", and
      +therefore works even in Windows Command Prompt:
       
      -During the initial setup with `rclone config` you will specify the
      -upstreams remotes as a space separated list. The upstream remotes can
      -either be a local paths or other remotes.
      +    rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM
      +    rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM:
       
      -## Configuration
      +### Implicit TLS
       
      -Here is an example of how to make a combine called `remote` for the
      -example above. First run:
      +Rlone FTP supports implicit FTP over TLS servers (FTPS). This has to
      +be enabled in the FTP backend config for the remote, or with
      +[`--ftp-tls`](#ftp-tls). The default FTPS port is `990`, not `21` and
      +can be set with [`--ftp-port`](#ftp-port).
       
      -     rclone config
      +### Restricted filename characters
       
      -This will guide you through an interactive setup process:
      -
      -

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. ... XX / Combine several remotes into one  (combine) ... Storage> combine Option upstreams. Upstreams for combining These should be in the form dir=remote:path dir2=remote2:path Where before the = is specified the root directory and after is the remote to put there. Embedded spaces can be added using quotes "dir=remote:path with space" "dir2=remote2:path with space" Enter a fs.SpaceSepList value. upstreams> images=s3:imagesbucket files=drive:important/files -------------------- [remote] type = combine upstreams = images=s3:imagesbucket files=drive:important/files -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      -
      
      -### Configuring for Google Drive Shared Drives
      +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
      +the following characters are also replaced:
       
      -Rclone has a convenience feature for making a combine backend for all
      -the shared drives you have access to.
      +File names cannot end with the following characters. Replacement is
      +limited to the last character in a file name:
       
      -Assuming your main (non shared drive) Google drive remote is called
      -`drive:` you would run
      +| Character | Value | Replacement |
      +| --------- |:-----:|:-----------:|
      +| SP        | 0x20  | ␠           |
       
      -    rclone backend -o config drives drive:
      +Not all FTP servers can have all characters in file names, for example:
       
      -This would produce something like this:
      +| FTP Server| Forbidden characters |
      +| --------- |:--------------------:|
      +| proftpd   | `*`                  |
      +| pureftpd  | `\ [ ]`              |
       
      -    [My Drive]
      -    type = alias
      -    remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=:
      +This backend's interactive configuration wizard provides a selection of
      +sensible encoding settings for major FTP servers: ProFTPd, PureFTPd, VsFTPd.
      +Just hit a selection number when prompted.
       
      -    [Test Drive]
      -    type = alias
      -    remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=:
       
      -    [AllDrives]
      -    type = combine
      -    upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:"
      +### Standard options
       
      -If you then add that config to your config file (find it with `rclone
      -config file`) then you can access all the shared drives in one place
      -with the `AllDrives:` remote.
      +Here are the Standard options specific to ftp (FTP).
       
      -See [the Google Drive docs](https://rclone.org/drive/#drives) for full info.
      +#### --ftp-host
       
      +FTP host to connect to.
       
      -### Standard options
      +E.g. "ftp.example.com".
       
      -Here are the Standard options specific to combine (Combine several remotes into one).
      +Properties:
       
      -#### --combine-upstreams
      +- Config:      host
      +- Env Var:     RCLONE_FTP_HOST
      +- Type:        string
      +- Required:    true
       
      -Upstreams for combining
      +#### --ftp-user
       
      -These should be in the form
      +FTP username.
       
      -    dir=remote:path dir2=remote2:path
      +Properties:
       
      -Where before the = is specified the root directory and after is the remote to
      -put there.
      +- Config:      user
      +- Env Var:     RCLONE_FTP_USER
      +- Type:        string
      +- Default:     "$USER"
       
      -Embedded spaces can be added using quotes
      +#### --ftp-port
       
      -    "dir=remote:path with space" "dir2=remote2:path with space"
      +FTP port number.
      +
      +Properties:
      +
      +- Config:      port
      +- Env Var:     RCLONE_FTP_PORT
      +- Type:        int
      +- Default:     21
      +
      +#### --ftp-pass
       
      +FTP password.
       
      +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
       
       Properties:
       
      -- Config:      upstreams
      -- Env Var:     RCLONE_COMBINE_UPSTREAMS
      -- Type:        SpaceSepList
      -- Default:     
      +- Config:      pass
      +- Env Var:     RCLONE_FTP_PASS
      +- Type:        string
      +- Required:    false
       
      -### Metadata
      +#### --ftp-tls
       
      -Any metadata supported by the underlying remote is read and written.
      +Use Implicit FTPS (FTP over TLS).
       
      -See the [metadata](https://rclone.org/docs/#metadata) docs for more info.
      +When using implicit FTP over TLS the client connects using TLS
      +right from the start which breaks compatibility with
      +non-TLS-aware servers. This is usually served over port 990 rather
      +than port 21. Cannot be used in combination with explicit FTPS.
       
      +Properties:
       
      +- Config:      tls
      +- Env Var:     RCLONE_FTP_TLS
      +- Type:        bool
      +- Default:     false
       
      -#  Dropbox
      +#### --ftp-explicit-tls
       
      -Paths are specified as `remote:path`
      +Use Explicit FTPS (FTP over TLS).
       
      -Dropbox paths may be as deep as required, e.g.
      -`remote:directory/subdirectory`.
      +When using explicit FTP over TLS the client explicitly requests
      +security from the server in order to upgrade a plain text connection
      +to an encrypted one. Cannot be used in combination with implicit FTPS.
       
      -## Configuration
      +Properties:
       
      -The initial setup for dropbox involves getting a token from Dropbox
      -which you need to do in your browser.  `rclone config` walks you
      -through it.
      +- Config:      explicit_tls
      +- Env Var:     RCLONE_FTP_EXPLICIT_TLS
      +- Type:        bool
      +- Default:     false
       
      -Here is an example of how to make a remote called `remote`.  First run:
      +### Advanced options
       
      -     rclone config
      +Here are the Advanced options specific to ftp (FTP).
       
      -This will guide you through an interactive setup process:
      -
      -
        -
      1. New remote
      2. -
      3. Delete remote
      4. -
      5. 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 [snip] XX / Dropbox  "dropbox" [snip] Storage> dropbox Dropbox App Key - leave blank normally. app_key> Dropbox App Secret - leave blank normally. app_secret> Remote config Please visit: https://www.dropbox.com/1/oauth2/authorize?client_id=XXXXXXXXXXXXXXX&response_type=code Enter the code: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXXXXXXXX -------------------- [remote] app_key = app_secret = token = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXX --------------------
      6. -
      7. Yes this is OK
      8. -
      9. Edit this remote
      10. -
      11. Delete this remote y/e/d> y
      12. -
      -
      
      -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a
      -machine with no Internet browser available.
      +#### --ftp-concurrency
       
      -Note that rclone runs a webserver on your local machine to collect the
      -token as returned from Dropbox. This only
      -runs from the moment it opens your browser to the moment you get back
      -the verification code.  This is on `http://127.0.0.1:53682/` and it
      -may require you to unblock it temporarily if you are running a host
      -firewall, or use manual mode.
      +Maximum number of FTP simultaneous connections, 0 for unlimited.
      +
      +Note that setting this is very likely to cause deadlocks so it should
      +be used with care.
       
      -You can then use it like this,
      +If you are doing a sync or copy then make sure concurrency is one more
      +than the sum of `--transfers` and `--checkers`.
       
      -List directories in top level of your dropbox
      +If you use `--check-first` then it just needs to be one more than the
      +maximum of `--checkers` and `--transfers`.
       
      -    rclone lsd remote:
      +So for `concurrency 3` you'd use `--checkers 2 --transfers 2
      +--check-first` or `--checkers 1 --transfers 1`.
       
      -List all the files in your dropbox
       
      -    rclone ls remote:
       
      -To copy a local directory to a dropbox directory called backup
      +Properties:
       
      -    rclone copy /home/source remote:backup
      +- Config:      concurrency
      +- Env Var:     RCLONE_FTP_CONCURRENCY
      +- Type:        int
      +- Default:     0
       
      -### Dropbox for business
      +#### --ftp-no-check-certificate
       
      -Rclone supports Dropbox for business and Team Folders.
      +Do not verify the TLS certificate of the server.
       
      -When using Dropbox for business `remote:` and `remote:path/to/file`
      -will refer to your personal folder.
      +Properties:
       
      -If you wish to see Team Folders you must use a leading `/` in the
      -path, so `rclone lsd remote:/` will refer to the root and show you all
      -Team Folders and your User Folder.
      +- Config:      no_check_certificate
      +- Env Var:     RCLONE_FTP_NO_CHECK_CERTIFICATE
      +- Type:        bool
      +- Default:     false
       
      -You can then use team folders like this `remote:/TeamFolder` and
      -`remote:/TeamFolder/path/to/file`.
      +#### --ftp-disable-epsv
       
      -A leading `/` for a Dropbox personal account will do nothing, but it
      -will take an extra HTTP transaction so it should be avoided.
      +Disable using EPSV even if server advertises support.
       
      -### Modified time and Hashes
      +Properties:
       
      -Dropbox supports modified times, but the only way to set a
      -modification time is to re-upload the file.
      +- Config:      disable_epsv
      +- Env Var:     RCLONE_FTP_DISABLE_EPSV
      +- Type:        bool
      +- Default:     false
       
      -This means that if you uploaded your data with an older version of
      -rclone which didn't support the v2 API and modified times, rclone will
      -decide to upload all your old data to fix the modification times.  If
      -you don't want this to happen use `--size-only` or `--checksum` flag
      -to stop it.
      +#### --ftp-disable-mlsd
       
      -Dropbox supports [its own hash
      -type](https://www.dropbox.com/developers/reference/content-hash) which
      -is checked for all transfers.
      +Disable using MLSD even if server advertises support.
       
      -### Restricted filename characters
      +Properties:
       
      -| Character | Value | Replacement |
      -| --------- |:-----:|:-----------:|
      -| NUL       | 0x00  | ␀           |
      -| /         | 0x2F  | /           |
      -| DEL       | 0x7F  | ␡           |
      -| \         | 0x5C  | \           |
      +- Config:      disable_mlsd
      +- Env Var:     RCLONE_FTP_DISABLE_MLSD
      +- Type:        bool
      +- Default:     false
       
      -File names can also not end with the following characters.
      -These only get replaced if they are the last character in the name:
      +#### --ftp-disable-utf8
       
      -| Character | Value | Replacement |
      -| --------- |:-----:|:-----------:|
      -| SP        | 0x20  | ␠           |
      +Disable using UTF-8 even if server advertises support.
       
      -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
      -as they can't be used in JSON strings.
      +Properties:
       
      -### Batch mode uploads {#batch-mode}
      +- Config:      disable_utf8
      +- Env Var:     RCLONE_FTP_DISABLE_UTF8
      +- Type:        bool
      +- Default:     false
       
      -Using batch mode uploads is very important for performance when using
      -the Dropbox API. See [the dropbox performance guide](https://developers.dropbox.com/dbx-performance-guide)
      -for more info.
      +#### --ftp-writing-mdtm
       
      -There are 3 modes rclone can use for uploads.
      +Use MDTM to set modification time (VsFtpd quirk)
       
      -#### --dropbox-batch-mode off
      +Properties:
       
      -In this mode rclone will not use upload batching. This was the default
      -before rclone v1.55. It has the disadvantage that it is very likely to
      -encounter `too_many_requests` errors like this
      +- Config:      writing_mdtm
      +- Env Var:     RCLONE_FTP_WRITING_MDTM
      +- Type:        bool
      +- Default:     false
       
      -    NOTICE: too_many_requests/.: Too many requests or write operations. Trying again in 15 seconds.
      +#### --ftp-force-list-hidden
       
      -When rclone receives these it has to wait for 15s or sometimes 300s
      -before continuing which really slows down transfers.
      +Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD.
       
      -This will happen especially if `--transfers` is large, so this mode
      -isn't recommended except for compatibility or investigating problems.
      +Properties:
       
      -#### --dropbox-batch-mode sync
      +- Config:      force_list_hidden
      +- Env Var:     RCLONE_FTP_FORCE_LIST_HIDDEN
      +- Type:        bool
      +- Default:     false
       
      -In this mode rclone will batch up uploads to the size specified by
      -`--dropbox-batch-size` and commit them together.
      +#### --ftp-idle-timeout
       
      -Using this mode means you can use a much higher `--transfers`
      -parameter (32 or 64 works fine) without receiving `too_many_requests`
      -errors.
      +Max time before closing idle connections.
       
      -This mode ensures full data integrity.
      +If no connections have been returned to the connection pool in the time
      +given, rclone will empty the connection pool.
       
      -Note that there may be a pause when quitting rclone while rclone
      -finishes up the last batch using this mode.
      +Set to 0 to keep connections indefinitely.
       
      -#### --dropbox-batch-mode async
       
      -In this mode rclone will batch up uploads to the size specified by
      -`--dropbox-batch-size` and commit them together.
      +Properties:
       
      -However it will not wait for the status of the batch to be returned to
      -the caller. This means rclone can use a much bigger batch size (much
      -bigger than `--transfers`), at the cost of not being able to check the
      -status of the upload.
      +- Config:      idle_timeout
      +- Env Var:     RCLONE_FTP_IDLE_TIMEOUT
      +- Type:        Duration
      +- Default:     1m0s
       
      -This provides the maximum possible upload speed especially with lots
      -of small files, however rclone can't check the file got uploaded
      -properly using this mode.
      +#### --ftp-close-timeout
       
      -If you are using this mode then using "rclone check" after the
      -transfer completes is recommended. Or you could do an initial transfer
      -with `--dropbox-batch-mode async` then do a final transfer with
      -`--dropbox-batch-mode sync` (the default).
      +Maximum time to wait for a response to close.
       
      -Note that there may be a pause when quitting rclone while rclone
      -finishes up the last batch using this mode.
      +Properties:
       
      +- Config:      close_timeout
      +- Env Var:     RCLONE_FTP_CLOSE_TIMEOUT
      +- Type:        Duration
      +- Default:     1m0s
       
      +#### --ftp-tls-cache-size
       
      -### Standard options
      +Size of TLS session cache for all control and data connections.
       
      -Here are the Standard options specific to dropbox (Dropbox).
      +TLS cache allows to resume TLS sessions and reuse PSK between connections.
      +Increase if default size is not enough resulting in TLS resumption errors.
      +Enabled by default. Use 0 to disable.
       
      -#### --dropbox-client-id
      +Properties:
       
      -OAuth Client Id.
      +- Config:      tls_cache_size
      +- Env Var:     RCLONE_FTP_TLS_CACHE_SIZE
      +- Type:        int
      +- Default:     32
       
      -Leave blank normally.
      +#### --ftp-disable-tls13
       
      -Properties:
      +Disable TLS 1.3 (workaround for FTP servers with buggy TLS)
       
      -- Config:      client_id
      -- Env Var:     RCLONE_DROPBOX_CLIENT_ID
      -- Type:        string
      -- Required:    false
      +Properties:
       
      -#### --dropbox-client-secret
      +- Config:      disable_tls13
      +- Env Var:     RCLONE_FTP_DISABLE_TLS13
      +- Type:        bool
      +- Default:     false
       
      -OAuth Client Secret.
      +#### --ftp-shut-timeout
       
      -Leave blank normally.
      +Maximum time to wait for data connection closing status.
       
       Properties:
       
      -- Config:      client_secret
      -- Env Var:     RCLONE_DROPBOX_CLIENT_SECRET
      -- Type:        string
      -- Required:    false
      +- Config:      shut_timeout
      +- Env Var:     RCLONE_FTP_SHUT_TIMEOUT
      +- Type:        Duration
      +- Default:     1m0s
       
      -### Advanced options
      +#### --ftp-ask-password
       
      -Here are the Advanced options specific to dropbox (Dropbox).
      +Allow asking for FTP password when needed.
       
      -#### --dropbox-token
      +If this is set and no password is supplied then rclone will ask for a password
       
      -OAuth Access Token as a JSON blob.
       
       Properties:
       
      -- Config:      token
      -- Env Var:     RCLONE_DROPBOX_TOKEN
      -- Type:        string
      -- Required:    false
      -
      -#### --dropbox-auth-url
      +- Config:      ask_password
      +- Env Var:     RCLONE_FTP_ASK_PASSWORD
      +- Type:        bool
      +- Default:     false
       
      -Auth server URL.
      +#### --ftp-socks-proxy
       
      -Leave blank to use the provider defaults.
      +Socks 5 proxy host.
      +        
      +        Supports the format user:pass@host:port, user@host:port, host:port.
      +        
      +        Example:
      +        
      +            myUser:myPass@localhost:9005
      +        
       
       Properties:
       
      -- Config:      auth_url
      -- Env Var:     RCLONE_DROPBOX_AUTH_URL
      +- Config:      socks_proxy
      +- Env Var:     RCLONE_FTP_SOCKS_PROXY
       - Type:        string
       - Required:    false
       
      -#### --dropbox-token-url
      +#### --ftp-encoding
       
      -Token server url.
      +The encoding for the backend.
       
      -Leave blank to use the provider defaults.
      +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
       
       Properties:
       
      -- Config:      token_url
      -- Env Var:     RCLONE_DROPBOX_TOKEN_URL
      -- Type:        string
      -- Required:    false
      +- Config:      encoding
      +- Env Var:     RCLONE_FTP_ENCODING
      +- Type:        Encoding
      +- Default:     Slash,Del,Ctl,RightSpace,Dot
      +- Examples:
      +    - "Asterisk,Ctl,Dot,Slash"
      +        - ProFTPd can't handle '*' in file names
      +    - "BackSlash,Ctl,Del,Dot,RightSpace,Slash,SquareBracket"
      +        - PureFTPd can't handle '[]' or '*' in file names
      +    - "Ctl,LeftPeriod,Slash"
      +        - VsFTPd can't handle file names starting with dot
       
      -#### --dropbox-chunk-size
       
      -Upload chunk size (< 150Mi).
       
      -Any files larger than this will be uploaded in chunks of this size.
      +## Limitations
       
      -Note that chunks are buffered in memory (one at a time) so rclone can
      -deal with retries.  Setting this larger will increase the speed
      -slightly (at most 10% for 128 MiB in tests) at the cost of using more
      -memory.  It can be set smaller if you are tight on memory.
      +FTP servers acting as rclone remotes must support `passive` mode.
      +The mode cannot be configured as `passive` is the only supported one.
      +Rclone's FTP implementation is not compatible with `active` mode
      +as [the library it uses doesn't support it](https://github.com/jlaffaye/ftp/issues/29).
      +This will likely never be supported due to security concerns.
       
      -Properties:
      +Rclone's FTP backend does not support any checksums but can compare
      +file sizes.
       
      -- Config:      chunk_size
      -- Env Var:     RCLONE_DROPBOX_CHUNK_SIZE
      -- Type:        SizeSuffix
      -- Default:     48Mi
      +`rclone about` is not supported by the FTP backend. Backends without
      +this capability cannot determine free space for an rclone mount or
      +use policy `mfs` (most free space) as a member of an rclone union
      +remote.
       
      -#### --dropbox-impersonate
      +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/)
       
      -Impersonate this user when using a business account.
      +The implementation of : `--dump headers`,
      +`--dump bodies`, `--dump auth` for debugging isn't the same as
      +for rclone HTTP based backends - it has less fine grained control.
       
      -Note that if you want to use impersonate, you should make sure this
      -flag is set when running "rclone config" as this will cause rclone to
      -request the "members.read" scope which it won't normally. This is
      -needed to lookup a members email address into the internal ID that
      -dropbox uses in the API.
      +`--timeout` isn't supported (but `--contimeout` is).
       
      -Using the "members.read" scope will require a Dropbox Team Admin
      -to approve during the OAuth flow.
      +`--bind` isn't supported.
       
      -You will have to use your own App (setting your own client_id and
      -client_secret) to use this option as currently rclone's default set of
      -permissions doesn't include "members.read". This can be added once
      -v1.55 or later is in use everywhere.
      +Rclone's FTP backend could support server-side move but does not
      +at present.
       
      +The `ftp_proxy` environment variable is not currently supported.
       
      -Properties:
      +### Modification times
       
      -- Config:      impersonate
      -- Env Var:     RCLONE_DROPBOX_IMPERSONATE
      -- Type:        string
      -- Required:    false
      +File modification time (timestamps) is supported to 1 second resolution
      +for major FTP servers: ProFTPd, PureFTPd, VsFTPd, and FileZilla FTP server.
      +The `VsFTPd` server has non-standard implementation of time related protocol
      +commands and needs a special configuration setting: `writing_mdtm = true`.
       
      -#### --dropbox-shared-files
      +Support for precise file time with other FTP servers varies depending on what
      +protocol extensions they advertise. If all the `MLSD`, `MDTM` and `MFTM`
      +extensions are present, rclone will use them together to provide precise time.
      +Otherwise the times you see on the FTP server through rclone are those of the
      +last file upload.
       
      -Instructs rclone to work on individual shared files.
      +You can use the following command to check whether rclone can use precise time
      +with your FTP server: `rclone backend features your_ftp_remote:` (the trailing
      +colon is important). Look for the number in the line tagged by `Precision`
      +designating the remote time precision expressed as nanoseconds. A value of
      +`1000000000` means that file time precision of 1 second is available.
      +A value of `3153600000000000000` (or another large number) means "unsupported".
       
      -In this mode rclone's features are extremely limited - only list (ls, lsl, etc.) 
      -operations and read operations (e.g. downloading) are supported in this mode.
      -All other operations will be disabled.
      +#  Google Cloud Storage
       
      -Properties:
      +Paths are specified as `remote:bucket` (or `remote:` for the `lsd`
      +command.)  You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`.
       
      -- Config:      shared_files
      -- Env Var:     RCLONE_DROPBOX_SHARED_FILES
      -- Type:        bool
      -- Default:     false
      +## Configuration
       
      -#### --dropbox-shared-folders
      +The initial setup for google cloud storage involves getting a token from Google Cloud Storage
      +which you need to do in your browser.  `rclone config` walks you
      +through it.
       
      -Instructs rclone to work on shared folders.
      -            
      -When this flag is used with no path only the List operation is supported and 
      -all available shared folders will be listed. If you specify a path the first part 
      -will be interpreted as the name of shared folder. Rclone will then try to mount this 
      -shared to the root namespace. On success shared folder rclone proceeds normally. 
      -The shared folder is now pretty much a normal folder and all normal operations 
      -are supported. 
      +Here is an example of how to make a remote called `remote`.  First run:
       
      -Note that we don't unmount the shared folder afterwards so the 
      ---dropbox-shared-folders can be omitted after the first use of a particular 
      -shared folder.
      +     rclone config
       
      -Properties:
      +This will guide you through an interactive setup process:
      +
      +
        +
      1. New remote
      2. +
      3. Delete remote
      4. +
      5. 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 [snip] XX / Google Cloud Storage (this is not Google Drive)  "google cloud storage" [snip] Storage> google cloud storage Google Application Client Id - leave blank normally. client_id> Google Application Client Secret - leave blank normally. client_secret> Project number optional - needed only for list/create/delete buckets - see your developer console. project_number> 12345678 Service Account Credentials JSON file path - needed only if you want use SA instead of interactive login. service_account_file> Access Control List for new objects. Choose a number from below, or type in your own value 1 / Object owner gets OWNER access, and all Authenticated Users get READER access.  "authenticatedRead" 2 / Object owner gets OWNER access, and project team owners get OWNER access.  "bucketOwnerFullControl" 3 / Object owner gets OWNER access, and project team owners get READER access.  "bucketOwnerRead" 4 / Object owner gets OWNER access [default if left blank].  "private" 5 / Object owner gets OWNER access, and project team members get access according to their roles.  "projectPrivate" 6 / Object owner gets OWNER access, and all Users get READER access.  "publicRead" object_acl> 4 Access Control List for new buckets. Choose a number from below, or type in your own value 1 / Project team owners get OWNER access, and all Authenticated Users get READER access.  "authenticatedRead" 2 / Project team owners get OWNER access [default if left blank].  "private" 3 / Project team members get access according to their roles.  "projectPrivate" 4 / Project team owners get OWNER access, and all Users get READER access.  "publicRead" 5 / Project team owners get OWNER access, and all Users get WRITER access.  "publicReadWrite" bucket_acl> 2 Location for the newly created buckets. Choose a number from below, or type in your own value 1 / Empty for default location (US).  "" 2 / Multi-regional location for Asia.  "asia" 3 / Multi-regional location for Europe.  "eu" 4 / Multi-regional location for United States.  "us" 5 / Taiwan.  "asia-east1" 6 / Tokyo.  "asia-northeast1" 7 / Singapore.  "asia-southeast1" 8 / Sydney.  "australia-southeast1" 9 / Belgium.  "europe-west1" 10 / London.  "europe-west2" 11 / Iowa.  "us-central1" 12 / South Carolina.  "us-east1" 13 / Northern Virginia.  "us-east4" 14 / Oregon.  "us-west1" location> 12 The storage class to use when storing objects in Google Cloud Storage. Choose a number from below, or type in your own value 1 / Default  "" 2 / Multi-regional storage class  "MULTI_REGIONAL" 3 / Regional storage class  "REGIONAL" 4 / Nearline storage class  "NEARLINE" 5 / Coldline storage class  "COLDLINE" 6 / Durable reduced availability storage class  "DURABLE_REDUCED_AVAILABILITY" storage_class> 5 Remote config Use web browser to automatically authenticate rclone with remote?
      6. +
      +
        +
      • Say Y if the machine running rclone has a web browser you can use
      • +
      • Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N.
      • +
      +
        +
      1. Yes
      2. +
      3. 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] type = google cloud storage client_id = client_secret = token = {"AccessToken":"xxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","RefreshToken":"x/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxx","Expiry":"2014-07-17T20:49:14.929208288+01:00","Extra":null} project_number = 12345678 object_acl = private bucket_acl = private --------------------
      4. +
      5. Yes this is OK
      6. +
      7. Edit this remote
      8. +
      9. Delete this remote y/e/d> y
      10. +
      +
      
      +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a
      +machine with no Internet browser available.
       
      -- Config:      shared_folders
      -- Env Var:     RCLONE_DROPBOX_SHARED_FOLDERS
      -- Type:        bool
      -- Default:     false
      +Note that rclone runs a webserver on your local machine to collect the
      +token as returned from Google if using web browser to automatically 
      +authenticate. This only
      +runs from the moment it opens your browser to the moment you get back
      +the verification code.  This is on `http://127.0.0.1:53682/` and this
      +it may require you to unblock it temporarily if you are running a host
      +firewall, or use manual mode.
       
      -#### --dropbox-batch-mode
      +This remote is called `remote` and can now be used like this
       
      -Upload file batching sync|async|off.
      +See all the buckets in your project
       
      -This sets the batch mode used by rclone.
      +    rclone lsd remote:
       
      -For full info see [the main docs](https://rclone.org/dropbox/#batch-mode)
      +Make a new bucket
       
      -This has 3 possible values
      +    rclone mkdir remote:bucket
       
      -- off - no batching
      -- sync - batch uploads and check completion (default)
      -- async - batch upload and don't check completion
      +List the contents of a bucket
       
      -Rclone will close any outstanding batches when it exits which may make
      -a delay on quit.
      +    rclone ls remote:bucket
       
      +Sync `/home/local/directory` to the remote bucket, deleting any excess
      +files in the bucket.
       
      -Properties:
      +    rclone sync --interactive /home/local/directory remote:bucket
       
      -- Config:      batch_mode
      -- Env Var:     RCLONE_DROPBOX_BATCH_MODE
      -- Type:        string
      -- Default:     "sync"
      +### Service Account support
       
      -#### --dropbox-batch-size
      +You can set up rclone with Google Cloud Storage in an unattended mode,
      +i.e. not tied to a specific end-user Google account. This is useful
      +when you want to synchronise files onto machines that don't have
      +actively logged-in users, for example build machines.
       
      -Max number of files in upload batch.
      +To get credentials for Google Cloud Platform
      +[IAM Service Accounts](https://cloud.google.com/iam/docs/service-accounts),
      +please head to the
      +[Service Account](https://console.cloud.google.com/permissions/serviceaccounts)
      +section of the Google Developer Console. Service Accounts behave just
      +like normal `User` permissions in
      +[Google Cloud Storage ACLs](https://cloud.google.com/storage/docs/access-control),
      +so you can limit their access (e.g. make them read only). After
      +creating an account, a JSON file containing the Service Account's
      +credentials will be downloaded onto your machines. These credentials
      +are what rclone will use for authentication.
       
      -This sets the batch size of files to upload. It has to be less than 1000.
      +To use a Service Account instead of OAuth2 token flow, enter the path
      +to your Service Account credentials at the `service_account_file`
      +prompt and rclone won't use the browser based authentication
      +flow. If you'd rather stuff the contents of the credentials file into
      +the rclone config file, you can set `service_account_credentials` with
      +the actual contents of the file instead, or set the equivalent
      +environment variable.
       
      -By default this is 0 which means rclone which calculate the batch size
      -depending on the setting of batch_mode.
      +### Anonymous Access
       
      -- batch_mode: async - default batch_size is 100
      -- batch_mode: sync - default batch_size is the same as --transfers
      -- batch_mode: off - not in use
      +For downloads of objects that permit public access you can configure rclone
      +to use anonymous access by setting `anonymous` to `true`.
      +With unauthorized access you can't write or create files but only read or list
      +those buckets and objects that have public read access.
       
      -Rclone will close any outstanding batches when it exits which may make
      -a delay on quit.
      +### Application Default Credentials
       
      -Setting this is a great idea if you are uploading lots of small files
      -as it will make them a lot quicker. You can use --transfers 32 to
      -maximise throughput.
      +If no other source of credentials is provided, rclone will fall back
      +to
      +[Application Default Credentials](https://cloud.google.com/video-intelligence/docs/common/auth#authenticating_with_application_default_credentials)
      +this is useful both when you already have configured authentication
      +for your developer account, or in production when running on a google
      +compute host. Note that if running in docker, you may need to run
      +additional commands on your google compute machine -
      +[see this page](https://cloud.google.com/container-registry/docs/advanced-authentication#gcloud_as_a_docker_credential_helper).
       
      +Note that in the case application default credentials are used, there
      +is no need to explicitly configure a project number.
       
      -Properties:
      +### --fast-list
       
      -- Config:      batch_size
      -- Env Var:     RCLONE_DROPBOX_BATCH_SIZE
      -- Type:        int
      -- Default:     0
      +This remote supports `--fast-list` which allows you to use fewer
      +transactions in exchange for more memory. See the [rclone
      +docs](https://rclone.org/docs/#fast-list) for more details.
       
      -#### --dropbox-batch-timeout
      +### Custom upload headers
       
      -Max time to allow an idle upload batch before uploading.
      +You can set custom upload headers with the `--header-upload`
      +flag. Google Cloud Storage supports the headers as described in the
      +[working with metadata documentation](https://cloud.google.com/storage/docs/gsutil/addlhelp/WorkingWithObjectMetadata)
       
      -If an upload batch is idle for more than this long then it will be
      -uploaded.
      +- Cache-Control
      +- Content-Disposition
      +- Content-Encoding
      +- Content-Language
      +- Content-Type
      +- X-Goog-Storage-Class
      +- X-Goog-Meta-
       
      -The default for this is 0 which means rclone will choose a sensible
      -default based on the batch_mode in use.
      +Eg `--header-upload "Content-Type text/potato"`
       
      -- batch_mode: async - default batch_timeout is 10s
      -- batch_mode: sync - default batch_timeout is 500ms
      -- batch_mode: off - not in use
      +Note that the last of these is for setting custom metadata in the form
      +`--header-upload "x-goog-meta-key: value"`
      +
      +### Modification times
      +
      +Google Cloud Storage stores md5sum natively.
      +Google's [gsutil](https://cloud.google.com/storage/docs/gsutil) tool stores modification time
      +with one-second precision as `goog-reserved-file-mtime` in file metadata.
      +
      +To ensure compatibility with gsutil, rclone stores modification time in 2 separate metadata entries.
      +`mtime` uses RFC3339 format with one-nanosecond precision.
      +`goog-reserved-file-mtime` uses Unix timestamp format with one-second precision.
      +To get modification time from object metadata, rclone reads the metadata in the following order: `mtime`, `goog-reserved-file-mtime`, object updated time.
      +
      +Note that rclone's default modify window is 1ns.
      +Files uploaded by gsutil only contain timestamps with one-second precision.
      +If you use rclone to sync files previously uploaded by gsutil,
      +rclone will attempt to update modification time for all these files.
      +To avoid these possibly unnecessary updates, use `--modify-window 1s`.
      +
      +### Restricted filename characters
      +
      +| Character | Value | Replacement |
      +| --------- |:-----:|:-----------:|
      +| NUL       | 0x00  | ␀           |
      +| LF        | 0x0A  | ␊           |
      +| CR        | 0x0D  | ␍           |
      +| /         | 0x2F  | /          |
      +
      +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
      +as they can't be used in JSON strings.
       
       
      -Properties:
      +### Standard options
       
      -- Config:      batch_timeout
      -- Env Var:     RCLONE_DROPBOX_BATCH_TIMEOUT
      -- Type:        Duration
      -- Default:     0s
      +Here are the Standard options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)).
       
      -#### --dropbox-batch-commit-timeout
      +#### --gcs-client-id
       
      -Max time to wait for a batch to finish committing
      +OAuth Client Id.
      +
      +Leave blank normally.
       
       Properties:
       
      -- Config:      batch_commit_timeout
      -- Env Var:     RCLONE_DROPBOX_BATCH_COMMIT_TIMEOUT
      -- Type:        Duration
      -- Default:     10m0s
      +- Config:      client_id
      +- Env Var:     RCLONE_GCS_CLIENT_ID
      +- Type:        string
      +- Required:    false
       
      -#### --dropbox-pacer-min-sleep
      +#### --gcs-client-secret
       
      -Minimum time to sleep between API calls.
      +OAuth Client Secret.
      +
      +Leave blank normally.
       
       Properties:
       
      -- Config:      pacer_min_sleep
      -- Env Var:     RCLONE_DROPBOX_PACER_MIN_SLEEP
      -- Type:        Duration
      -- Default:     10ms
      +- Config:      client_secret
      +- Env Var:     RCLONE_GCS_CLIENT_SECRET
      +- Type:        string
      +- Required:    false
       
      -#### --dropbox-encoding
      +#### --gcs-project-number
       
      -The encoding for the backend.
      +Project number.
       
      -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
      +Optional - needed only for list/create/delete buckets - see your developer console.
       
       Properties:
       
      -- Config:      encoding
      -- Env Var:     RCLONE_DROPBOX_ENCODING
      -- Type:        MultiEncoder
      -- Default:     Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot
      -
      +- Config:      project_number
      +- Env Var:     RCLONE_GCS_PROJECT_NUMBER
      +- Type:        string
      +- Required:    false
       
      +#### --gcs-user-project
       
      -## Limitations
      +User project.
       
      -Note that Dropbox is case insensitive so you can't have a file called
      -"Hello.doc" and one called "hello.doc".
      +Optional - needed only for requester pays.
       
      -There are some file names such as `thumbs.db` which Dropbox can't
      -store.  There is a full list of them in the ["Ignored Files" section
      -of this document](https://www.dropbox.com/en/help/145).  Rclone will
      -issue an error message `File name disallowed - not uploading` if it
      -attempts to upload one of those file names, but the sync won't fail.
      +Properties:
       
      -Some errors may occur if you try to sync copyright-protected files
      -because Dropbox has its own [copyright detector](https://techcrunch.com/2014/03/30/how-dropbox-knows-when-youre-sharing-copyrighted-stuff-without-actually-looking-at-your-stuff/) that
      -prevents this sort of file being downloaded. This will return the error `ERROR :
      -/path/to/your/file: Failed to copy: failed to open source object:
      -path/restricted_content/.`
      +- Config:      user_project
      +- Env Var:     RCLONE_GCS_USER_PROJECT
      +- Type:        string
      +- Required:    false
       
      -If you have more than 10,000 files in a directory then `rclone purge
      -dropbox:dir` will return the error `Failed to purge: There are too
      -many files involved in this operation`.  As a work-around do an
      -`rclone delete dropbox:dir` followed by an `rclone rmdir dropbox:dir`.
      +#### --gcs-service-account-file
       
      -When using `rclone link` you'll need to set `--expire` if using a
      -non-personal account otherwise the visibility may not be correct.
      -(Note that `--expire` isn't supported on personal accounts). See the
      -[forum discussion](https://forum.rclone.org/t/rclone-link-dropbox-permissions/23211) and the 
      -[dropbox SDK issue](https://github.com/dropbox/dropbox-sdk-go-unofficial/issues/75).
      +Service Account Credentials JSON file path.
       
      -## Get your own Dropbox App ID
      +Leave blank normally.
      +Needed only if you want use SA instead of interactive login.
       
      -When you use rclone with Dropbox in its default configuration you are using rclone's App ID. This is shared between all the rclone users.
      +Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`.
       
      -Here is how to create your own Dropbox App ID for rclone:
      +Properties:
       
      -1. Log into the [Dropbox App console](https://www.dropbox.com/developers/apps/create) with your Dropbox Account (It need not
      -to be the same account as the Dropbox you want to access)
      +- Config:      service_account_file
      +- Env Var:     RCLONE_GCS_SERVICE_ACCOUNT_FILE
      +- Type:        string
      +- Required:    false
       
      -2. Choose an API => Usually this should be `Dropbox API`
      +#### --gcs-service-account-credentials
       
      -3. Choose the type of access you want to use => `Full Dropbox` or `App Folder`. If you want to use Team Folders, `Full Dropbox` is required ([see here](https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-create-team-folder-inside-my-app-s-folder/m-p/601005/highlight/true#M27911)).
      +Service Account Credentials JSON blob.
       
      -4. Name your App. The app name is global, so you can't use `rclone` for example
      +Leave blank normally.
      +Needed only if you want use SA instead of interactive login.
       
      -5. Click the button `Create App`
      +Properties:
       
      -6. Switch to the `Permissions` tab. Enable at least the following permissions: `account_info.read`, `files.metadata.write`, `files.content.write`, `files.content.read`, `sharing.write`. The `files.metadata.read` and `sharing.read` checkboxes will be marked too. Click `Submit`
      +- Config:      service_account_credentials
      +- Env Var:     RCLONE_GCS_SERVICE_ACCOUNT_CREDENTIALS
      +- Type:        string
      +- Required:    false
       
      -7. Switch to the `Settings` tab. Fill `OAuth2 - Redirect URIs` as `http://localhost:53682/` and click on `Add`
      +#### --gcs-anonymous
       
      -8. Find the `App key` and `App secret` values on the `Settings` tab. Use these values in rclone config to add a new remote or edit an existing remote. The `App key` setting corresponds to `client_id` in rclone config, the `App secret` corresponds to `client_secret`
      +Access public buckets and objects without credentials.
       
      -#  Enterprise File Fabric
      +Set to 'true' if you just want to download files and don't configure credentials.
       
      -This backend supports [Storage Made Easy's Enterprise File
      -Fabric™](https://storagemadeeasy.com/about/) which provides a software
      -solution to integrate and unify File and Object Storage accessible
      -through a global file system.
      +Properties:
       
      -## Configuration
      +- Config:      anonymous
      +- Env Var:     RCLONE_GCS_ANONYMOUS
      +- Type:        bool
      +- Default:     false
       
      -The initial setup for the Enterprise File Fabric backend involves
      -getting a token from the Enterprise File Fabric which you need to
      -do in your browser.  `rclone config` walks you through it.
      +#### --gcs-object-acl
       
      -Here is an example of how to make a remote called `remote`.  First run:
      +Access Control List for new objects.
       
      -     rclone config
      +Properties:
       
      -This will guide you through an interactive setup process:
      -
      -

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / Enterprise File Fabric  "filefabric" [snip] Storage> filefabric ** See help for filefabric backend at: https://rclone.org/filefabric/ **

      -

      URL of the Enterprise File Fabric to connect to Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / Storage Made Easy US  "https://storagemadeeasy.com" 2 / Storage Made Easy EU  "https://eu.storagemadeeasy.com" 3 / Connect to your Enterprise File Fabric  "https://yourfabric.smestorage.com" url> https://yourfabric.smestorage.com/ ID of the root folder Leave blank normally.

      -

      Fill in to make rclone start with directory of a given ID.

      -

      Enter a string value. Press Enter for the default (""). root_folder_id> Permanent Authentication Token

      -

      A Permanent Authentication Token can be created in the Enterprise File Fabric, on the users Dashboard under Security, there is an entry you'll see called "My Authentication Tokens". Click the Manage button to create one.

      -

      These tokens are normally valid for several years.

      -

      For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens

      -

      Enter a string value. Press Enter for the default (""). permanent_token> xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx Edit advanced config? (y/n) y) Yes n) No (default) y/n> n Remote config -------------------- [remote] type = filefabric url = https://yourfabric.smestorage.com/ permanent_token = xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      -
      
      -Once configured you can then use `rclone` like this,
      +- Config:      object_acl
      +- Env Var:     RCLONE_GCS_OBJECT_ACL
      +- Type:        string
      +- Required:    false
      +- Examples:
      +    - "authenticatedRead"
      +        - Object owner gets OWNER access.
      +        - All Authenticated Users get READER access.
      +    - "bucketOwnerFullControl"
      +        - Object owner gets OWNER access.
      +        - Project team owners get OWNER access.
      +    - "bucketOwnerRead"
      +        - Object owner gets OWNER access.
      +        - Project team owners get READER access.
      +    - "private"
      +        - Object owner gets OWNER access.
      +        - Default if left blank.
      +    - "projectPrivate"
      +        - Object owner gets OWNER access.
      +        - Project team members get access according to their roles.
      +    - "publicRead"
      +        - Object owner gets OWNER access.
      +        - All Users get READER access.
       
      -List directories in top level of your Enterprise File Fabric
      +#### --gcs-bucket-acl
       
      -    rclone lsd remote:
      +Access Control List for new buckets.
       
      -List all the files in your Enterprise File Fabric
      +Properties:
       
      -    rclone ls remote:
      +- Config:      bucket_acl
      +- Env Var:     RCLONE_GCS_BUCKET_ACL
      +- Type:        string
      +- Required:    false
      +- Examples:
      +    - "authenticatedRead"
      +        - Project team owners get OWNER access.
      +        - All Authenticated Users get READER access.
      +    - "private"
      +        - Project team owners get OWNER access.
      +        - Default if left blank.
      +    - "projectPrivate"
      +        - Project team members get access according to their roles.
      +    - "publicRead"
      +        - Project team owners get OWNER access.
      +        - All Users get READER access.
      +    - "publicReadWrite"
      +        - Project team owners get OWNER access.
      +        - All Users get WRITER access.
       
      -To copy a local directory to an Enterprise File Fabric directory called backup
      +#### --gcs-bucket-policy-only
       
      -    rclone copy /home/source remote:backup
      +Access checks should use bucket-level IAM policies.
       
      -### Modified time and hashes
      +If you want to upload objects to a bucket with Bucket Policy Only set
      +then you will need to set this.
       
      -The Enterprise File Fabric allows modification times to be set on
      -files accurate to 1 second.  These will be used to detect whether
      -objects need syncing or not.
      +When it is set, rclone:
       
      -The Enterprise File Fabric does not support any data hashes at this time.
      +- ignores ACLs set on buckets
      +- ignores ACLs set on objects
      +- creates buckets with Bucket Policy Only set
       
      -### Restricted filename characters
      +Docs: https://cloud.google.com/storage/docs/bucket-policy-only
       
      -The [default restricted characters set](https://rclone.org/overview/#restricted-characters)
      -will be replaced.
       
      -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
      -as they can't be used in JSON strings.
      +Properties:
       
      -### Empty files
      +- Config:      bucket_policy_only
      +- Env Var:     RCLONE_GCS_BUCKET_POLICY_ONLY
      +- Type:        bool
      +- Default:     false
       
      -Empty files aren't supported by the Enterprise File Fabric. Rclone will therefore
      -upload an empty file as a single space with a mime type of
      -`application/vnd.rclone.empty.file` and files with that mime type are
      -treated as empty.
      +#### --gcs-location
       
      -### Root folder ID ###
      +Location for the newly created buckets.
       
      -You can set the `root_folder_id` for rclone.  This is the directory
      -(identified by its `Folder ID`) that rclone considers to be the root
      -of your Enterprise File Fabric.
      +Properties:
       
      -Normally you will leave this blank and rclone will determine the
      -correct root to use itself.
      +- Config:      location
      +- Env Var:     RCLONE_GCS_LOCATION
      +- Type:        string
      +- Required:    false
      +- Examples:
      +    - ""
      +        - Empty for default location (US)
      +    - "asia"
      +        - Multi-regional location for Asia
      +    - "eu"
      +        - Multi-regional location for Europe
      +    - "us"
      +        - Multi-regional location for United States
      +    - "asia-east1"
      +        - Taiwan
      +    - "asia-east2"
      +        - Hong Kong
      +    - "asia-northeast1"
      +        - Tokyo
      +    - "asia-northeast2"
      +        - Osaka
      +    - "asia-northeast3"
      +        - Seoul
      +    - "asia-south1"
      +        - Mumbai
      +    - "asia-south2"
      +        - Delhi
      +    - "asia-southeast1"
      +        - Singapore
      +    - "asia-southeast2"
      +        - Jakarta
      +    - "australia-southeast1"
      +        - Sydney
      +    - "australia-southeast2"
      +        - Melbourne
      +    - "europe-north1"
      +        - Finland
      +    - "europe-west1"
      +        - Belgium
      +    - "europe-west2"
      +        - London
      +    - "europe-west3"
      +        - Frankfurt
      +    - "europe-west4"
      +        - Netherlands
      +    - "europe-west6"
      +        - Zürich
      +    - "europe-central2"
      +        - Warsaw
      +    - "us-central1"
      +        - Iowa
      +    - "us-east1"
      +        - South Carolina
      +    - "us-east4"
      +        - Northern Virginia
      +    - "us-west1"
      +        - Oregon
      +    - "us-west2"
      +        - California
      +    - "us-west3"
      +        - Salt Lake City
      +    - "us-west4"
      +        - Las Vegas
      +    - "northamerica-northeast1"
      +        - Montréal
      +    - "northamerica-northeast2"
      +        - Toronto
      +    - "southamerica-east1"
      +        - São Paulo
      +    - "southamerica-west1"
      +        - Santiago
      +    - "asia1"
      +        - Dual region: asia-northeast1 and asia-northeast2.
      +    - "eur4"
      +        - Dual region: europe-north1 and europe-west4.
      +    - "nam4"
      +        - Dual region: us-central1 and us-east1.
       
      -However you can set this to restrict rclone to a specific folder
      -hierarchy.
      +#### --gcs-storage-class
       
      -In order to do this you will have to find the `Folder ID` of the
      -directory you wish rclone to display.  These aren't displayed in the
      -web interface, but you can use `rclone lsf` to find them, for example
      -
      -

      $ rclone lsf --dirs-only -Fip --csv filefabric: 120673758,Burnt PDFs/ 120673759,My Quick Uploads/ 120673755,My Syncs/ 120673756,My backups/ 120673757,My contacts/ 120673761,S3 Storage/

      -
      
      -The ID for "S3 Storage" would be `120673761`.
      +The storage class to use when storing objects in Google Cloud Storage.
       
      +Properties:
       
      -### Standard options
      +- Config:      storage_class
      +- Env Var:     RCLONE_GCS_STORAGE_CLASS
      +- Type:        string
      +- Required:    false
      +- Examples:
      +    - ""
      +        - Default
      +    - "MULTI_REGIONAL"
      +        - Multi-regional storage class
      +    - "REGIONAL"
      +        - Regional storage class
      +    - "NEARLINE"
      +        - Nearline storage class
      +    - "COLDLINE"
      +        - Coldline storage class
      +    - "ARCHIVE"
      +        - Archive storage class
      +    - "DURABLE_REDUCED_AVAILABILITY"
      +        - Durable reduced availability storage class
       
      -Here are the Standard options specific to filefabric (Enterprise File Fabric).
      +#### --gcs-env-auth
       
      -#### --filefabric-url
      +Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars).
       
      -URL of the Enterprise File Fabric to connect to.
      +Only applies if service_account_file and service_account_credentials is blank.
       
       Properties:
       
      -- Config:      url
      -- Env Var:     RCLONE_FILEFABRIC_URL
      -- Type:        string
      -- Required:    true
      +- Config:      env_auth
      +- Env Var:     RCLONE_GCS_ENV_AUTH
      +- Type:        bool
      +- Default:     false
       - Examples:
      -    - "https://storagemadeeasy.com"
      -        - Storage Made Easy US
      -    - "https://eu.storagemadeeasy.com"
      -        - Storage Made Easy EU
      -    - "https://yourfabric.smestorage.com"
      -        - Connect to your Enterprise File Fabric
      -
      -#### --filefabric-root-folder-id
      +    - "false"
      +        - Enter credentials in the next step.
      +    - "true"
      +        - Get GCP IAM credentials from the environment (env vars or IAM).
       
      -ID of the root folder.
      +### Advanced options
       
      -Leave blank normally.
      +Here are the Advanced options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)).
       
      -Fill in to make rclone start with directory of a given ID.
      +#### --gcs-token
       
      +OAuth Access Token as a JSON blob.
       
       Properties:
       
      -- Config:      root_folder_id
      -- Env Var:     RCLONE_FILEFABRIC_ROOT_FOLDER_ID
      +- Config:      token
      +- Env Var:     RCLONE_GCS_TOKEN
       - Type:        string
       - Required:    false
       
      -#### --filefabric-permanent-token
      +#### --gcs-auth-url
       
      -Permanent Authentication Token.
      +Auth server URL.
       
      -A Permanent Authentication Token can be created in the Enterprise File
      -Fabric, on the users Dashboard under Security, there is an entry
      -you'll see called "My Authentication Tokens". Click the Manage button
      -to create one.
      +Leave blank to use the provider defaults.
       
      -These tokens are normally valid for several years.
      +Properties:
       
      -For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens
      +- Config:      auth_url
      +- Env Var:     RCLONE_GCS_AUTH_URL
      +- Type:        string
      +- Required:    false
      +
      +#### --gcs-token-url
       
      +Token server url.
      +
      +Leave blank to use the provider defaults.
       
       Properties:
       
      -- Config:      permanent_token
      -- Env Var:     RCLONE_FILEFABRIC_PERMANENT_TOKEN
      +- Config:      token_url
      +- Env Var:     RCLONE_GCS_TOKEN_URL
       - Type:        string
       - Required:    false
       
      -### Advanced options
      +#### --gcs-directory-markers
       
      -Here are the Advanced options specific to filefabric (Enterprise File Fabric).
      +Upload an empty object with a trailing slash when a new directory is created
       
      -#### --filefabric-token
      +Empty folders are unsupported for bucket based remotes, this option creates an empty
      +object ending with "/", to persist the folder.
       
      -Session Token.
       
      -This is a session token which rclone caches in the config file. It is
      -usually valid for 1 hour.
      +Properties:
       
      -Don't set this value - rclone will set it automatically.
      +- Config:      directory_markers
      +- Env Var:     RCLONE_GCS_DIRECTORY_MARKERS
      +- Type:        bool
      +- Default:     false
      +
      +#### --gcs-no-check-bucket
      +
      +If set, don't attempt to check the bucket exists or create it.
      +
      +This can be useful when trying to minimise the number of transactions
      +rclone does if you know the bucket exists already.
       
       
       Properties:
       
      -- Config:      token
      -- Env Var:     RCLONE_FILEFABRIC_TOKEN
      -- Type:        string
      -- Required:    false
      +- Config:      no_check_bucket
      +- Env Var:     RCLONE_GCS_NO_CHECK_BUCKET
      +- Type:        bool
      +- Default:     false
       
      -#### --filefabric-token-expiry
      +#### --gcs-decompress
       
      -Token expiry time.
      +If set this will decompress gzip encoded objects.
       
      -Don't set this value - rclone will set it automatically.
      +It is possible to upload objects to GCS with "Content-Encoding: gzip"
      +set. Normally rclone will download these files as compressed objects.
       
      +If this flag is set then rclone will decompress these files with
      +"Content-Encoding: gzip" as they are received. This means that rclone
      +can't check the size and hash but the file contents will be decompressed.
       
      -Properties:
       
      -- Config:      token_expiry
      -- Env Var:     RCLONE_FILEFABRIC_TOKEN_EXPIRY
      -- Type:        string
      -- Required:    false
      +Properties:
       
      -#### --filefabric-version
      +- Config:      decompress
      +- Env Var:     RCLONE_GCS_DECOMPRESS
      +- Type:        bool
      +- Default:     false
       
      -Version read from the file fabric.
      +#### --gcs-endpoint
       
      -Don't set this value - rclone will set it automatically.
      +Endpoint for the service.
       
      +Leave blank normally.
       
       Properties:
       
      -- Config:      version
      -- Env Var:     RCLONE_FILEFABRIC_VERSION
      +- Config:      endpoint
      +- Env Var:     RCLONE_GCS_ENDPOINT
       - Type:        string
       - Required:    false
       
      -#### --filefabric-encoding
      +#### --gcs-encoding
       
       The encoding for the backend.
       
      @@ -22312,3084 +22223,3149 @@ 

      Synology C2 Object Storage

      Properties: - Config: encoding -- Env Var: RCLONE_FILEFABRIC_ENCODING -- Type: MultiEncoder -- Default: Slash,Del,Ctl,InvalidUtf8,Dot +- Env Var: RCLONE_GCS_ENCODING +- Type: Encoding +- Default: Slash,CrLf,InvalidUtf8,Dot -# FTP +## Limitations -FTP is the File Transfer Protocol. Rclone FTP support is provided using the -[github.com/jlaffaye/ftp](https://godoc.org/github.com/jlaffaye/ftp) -package. +`rclone about` is not supported by the Google Cloud Storage backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. + +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) + +# Google Drive + +Paths are specified as `drive:path` + +Drive paths may be as deep as required, e.g. `drive:directory/subdirectory`. + +## Configuration + +The initial setup for drive involves getting a token from Google drive +which you need to do in your browser. `rclone config` walks you +through it. + +Here is an example of how to make a remote called `remote`. First run: + + rclone config + +This will guide you through an interactive setup process: +
      +

      No remotes found, make a new one? n) New remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config n/r/c/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Google Drive  "drive" [snip] Storage> drive Google Application Client Id - leave blank normally. client_id> Google Application Client Secret - leave blank normally. client_secret> Scope that rclone should use when requesting access from drive. Choose a number from below, or type in your own value 1 / Full access all files, excluding Application Data Folder.  "drive" 2 / Read-only access to file metadata and file contents.  "drive.readonly" / Access to files created by rclone only. 3 | These are visible in the drive website. | File authorization is revoked when the user deauthorizes the app.  "drive.file" / Allows read and write access to the Application Data folder. 4 | This is not visible in the drive website.  "drive.appfolder" / Allows read-only access to file metadata but 5 | does not allow any access to read or download file content.  "drive.metadata.readonly" scope> 1 Service Account Credentials JSON file path - needed only if you want use SA instead of interactive login. service_account_file> Remote config Use web browser to automatically authenticate rclone with remote? * Say Y if the machine running rclone has a web browser you can use * Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N. 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 Configure this as a Shared Drive (Team Drive)? y) Yes n) No y/n> n -------------------- [remote] client_id = client_secret = scope = drive root_folder_id = service_account_file = token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2014-03-16T13:57:58.955387075Z"} -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

      +
      
      +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a
      +machine with no Internet browser available.
      +
      +Note that rclone runs a webserver on your local machine to collect the
      +token as returned from Google if using web browser to automatically 
      +authenticate. This only
      +runs from the moment it opens your browser to the moment you get back
      +the verification code.  This is on `http://127.0.0.1:53682/` and it
      +may require you to unblock it temporarily if you are running a host
      +firewall, or use manual mode.
       
      -[Limitations of Rclone's FTP backend](#limitations)
      +You can then use it like this,
       
      -Paths are specified as `remote:path`. If the path does not begin with
      -a `/` it is relative to the home directory of the user.  An empty path
      -`remote:` refers to the user's home directory.
      +List directories in top level of your drive
       
      -## Configuration
      +    rclone lsd remote:
       
      -To create an FTP configuration named `remote`, run
      +List all the files in your drive
       
      -    rclone config
      +    rclone ls remote:
       
      -Rclone config guides you through an interactive setup process. A minimal
      -rclone FTP remote definition only requires host, username and password.
      -For an anonymous FTP server, see [below](#anonymous-ftp).
      -
      -

      No remotes found, make a new one? n) New remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config n/r/c/s/q> n name> remote Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / FTP  "ftp" [snip] Storage> ftp ** See help for ftp backend at: https://rclone.org/ftp/ **

      -

      FTP host to connect to Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / Connect to ftp.example.com  "ftp.example.com" host> ftp.example.com FTP username Enter a string value. Press Enter for the default ("$USER"). user> FTP port number Enter a signed integer. Press Enter for the default (21). port> FTP password y) Yes type in my own password g) Generate random password y/g> y Enter the password: password: Confirm the password: password: Use FTP over TLS (Implicit) Enter a boolean value (true or false). Press Enter for the default ("false"). tls> Use FTP over TLS (Explicit) Enter a boolean value (true or false). Press Enter for the default ("false"). explicit_tls> Remote config -------------------- [remote] type = ftp host = ftp.example.com pass = *** ENCRYPTED *** -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

      -
      
      -To see all directories in the home directory of `remote`
      +To copy a local directory to a drive directory called backup
       
      -    rclone lsd remote:
      +    rclone copy /home/source remote:backup
       
      -Make a new directory
      +### Scopes
       
      -    rclone mkdir remote:path/to/directory
      +Rclone allows you to select which scope you would like for rclone to
      +use.  This changes what type of token is granted to rclone.  [The
      +scopes are defined
      +here](https://developers.google.com/drive/v3/web/about-auth).
       
      -List the contents of a directory
      +A comma-separated list is allowed e.g. `drive.readonly,drive.file`.
       
      -    rclone ls remote:path/to/directory
      +The scope are
       
      -Sync `/home/local/directory` to the remote directory, deleting any
      -excess files in the directory.
      +#### drive
       
      -    rclone sync --interactive /home/local/directory remote:directory
      +This is the default scope and allows full access to all files, except
      +for the Application Data Folder (see below).
       
      -### Anonymous FTP
      +Choose this one if you aren't sure.
       
      -When connecting to a FTP server that allows anonymous login, you can use the
      -special "anonymous" username. Traditionally, this user account accepts any
      -string as a password, although it is common to use either the password
      -"anonymous" or "guest". Some servers require the use of a valid e-mail
      -address as password.
      +#### drive.readonly
       
      -Using [on-the-fly](#backend-path-to-dir) or
      -[connection string](https://rclone.org/docs/#connection-strings) remotes makes it easy to access
      -such servers, without requiring any configuration in advance. The following
      -are examples of that:
      +This allows read only access to all files.  Files may be listed and
      +downloaded but not uploaded, renamed or deleted.
       
      -    rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=$(rclone obscure dummy)
      -    rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=$(rclone obscure dummy):
      +#### drive.file
       
      -The above examples work in Linux shells and in PowerShell, but not Windows
      -Command Prompt. They execute the [rclone obscure](https://rclone.org/commands/rclone_obscure/)
      -command to create a password string in the format required by the
      -[pass](#ftp-pass) option. The following examples are exactly the same, except use
      -an already obscured string representation of the same password "dummy", and
      -therefore works even in Windows Command Prompt:
      +With this scope rclone can read/view/modify only those files and
      +folders it creates.
       
      -    rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM
      -    rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM:
      +So if you uploaded files to drive via the web interface (or any other
      +means) they will not be visible to rclone.
       
      -### Implicit TLS
      +This can be useful if you are using rclone to backup data and you want
      +to be sure confidential data on your drive is not visible to rclone.
       
      -Rlone FTP supports implicit FTP over TLS servers (FTPS). This has to
      -be enabled in the FTP backend config for the remote, or with
      -[`--ftp-tls`](#ftp-tls). The default FTPS port is `990`, not `21` and
      -can be set with [`--ftp-port`](#ftp-port).
      +Files created with this scope are visible in the web interface.
       
      -### Restricted filename characters
      +#### drive.appfolder
       
      -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
      -the following characters are also replaced:
      +This gives rclone its own private area to store files.  Rclone will
      +not be able to see any other files on your drive and you won't be able
      +to see rclone's files from the web interface either.
       
      -File names cannot end with the following characters. Replacement is
      -limited to the last character in a file name:
      +#### drive.metadata.readonly
       
      -| Character | Value | Replacement |
      -| --------- |:-----:|:-----------:|
      -| SP        | 0x20  | ␠           |
      +This allows read only access to file names only.  It does not allow
      +rclone to download or upload data, or rename or delete files or
      +directories.
       
      -Not all FTP servers can have all characters in file names, for example:
      +### Root folder ID
       
      -| FTP Server| Forbidden characters |
      -| --------- |:--------------------:|
      -| proftpd   | `*`                  |
      -| pureftpd  | `\ [ ]`              |
      +This option has been moved to the advanced section. You can set the `root_folder_id` for rclone.  This is the directory
      +(identified by its `Folder ID`) that rclone considers to be the root
      +of your drive.
       
      -This backend's interactive configuration wizard provides a selection of
      -sensible encoding settings for major FTP servers: ProFTPd, PureFTPd, VsFTPd.
      -Just hit a selection number when prompted.
      +Normally you will leave this blank and rclone will determine the
      +correct root to use itself.
       
      +However you can set this to restrict rclone to a specific folder
      +hierarchy or to access data within the "Computers" tab on the drive
      +web interface (where files from Google's Backup and Sync desktop
      +program go).
       
      -### Standard options
      +In order to do this you will have to find the `Folder ID` of the
      +directory you wish rclone to display.  This will be the last segment
      +of the URL when you open the relevant folder in the drive web
      +interface.
       
      -Here are the Standard options specific to ftp (FTP).
      +So if the folder you want rclone to use has a URL which looks like
      +`https://drive.google.com/drive/folders/1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh`
      +in the browser, then you use `1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh` as
      +the `root_folder_id` in the config.
       
      -#### --ftp-host
      +**NB** folders under the "Computers" tab seem to be read only (drive
      +gives a 500 error) when using rclone.
       
      -FTP host to connect to.
      +There doesn't appear to be an API to discover the folder IDs of the
      +"Computers" tab - please contact us if you know otherwise!
       
      -E.g. "ftp.example.com".
      +Note also that rclone can't access any data under the "Backups" tab on
      +the google drive web interface yet.
       
      -Properties:
      +### Service Account support
       
      -- Config:      host
      -- Env Var:     RCLONE_FTP_HOST
      -- Type:        string
      -- Required:    true
      +You can set up rclone with Google Drive in an unattended mode,
      +i.e. not tied to a specific end-user Google account. This is useful
      +when you want to synchronise files onto machines that don't have
      +actively logged-in users, for example build machines.
       
      -#### --ftp-user
      +To use a Service Account instead of OAuth2 token flow, enter the path
      +to your Service Account credentials at the `service_account_file`
      +prompt during `rclone config` and rclone won't use the browser based
      +authentication flow. If you'd rather stuff the contents of the
      +credentials file into the rclone config file, you can set
      +`service_account_credentials` with the actual contents of the file
      +instead, or set the equivalent environment variable.
       
      -FTP username.
      +#### Use case - Google Apps/G-suite account and individual Drive
       
      -Properties:
      +Let's say that you are the administrator of a Google Apps (old) or
      +G-suite account.
      +The goal is to store data on an individual's Drive account, who IS
      +a member of the domain.
      +We'll call the domain **example.com**, and the user
      +**foo@example.com**.
       
      -- Config:      user
      -- Env Var:     RCLONE_FTP_USER
      -- Type:        string
      -- Default:     "$USER"
      +There's a few steps we need to go through to accomplish this:
       
      -#### --ftp-port
      +##### 1. Create a service account for example.com
      +  - To create a service account and obtain its credentials, go to the
      +[Google Developer Console](https://console.developers.google.com).
      +  - You must have a project - create one if you don't.
      +  - Then go to "IAM & admin" -> "Service Accounts".
      +  - Use the "Create Service Account" button. Fill in "Service account name"
      +and "Service account ID" with something that identifies your client.
      +  - Select "Create And Continue". Step 2 and 3 are optional.
      +  - These credentials are what rclone will use for authentication.
      +If you ever need to remove access, press the "Delete service
      +account key" button.
       
      -FTP port number.
      +##### 2. Allowing API access to example.com Google Drive
      +  - Go to example.com's admin console
      +  - Go into "Security" (or use the search bar)
      +  - Select "Show more" and then "Advanced settings"
      +  - Select "Manage API client access" in the "Authentication" section
      +  - In the "Client Name" field enter the service account's
      +"Client ID" - this can be found in the Developer Console under
      +"IAM & Admin" -> "Service Accounts", then "View Client ID" for
      +the newly created service account.
      +It is a ~21 character numerical string.
      +  - In the next field, "One or More API Scopes", enter
      +`https://www.googleapis.com/auth/drive`
      +to grant access to Google Drive specifically.
       
      -Properties:
      +##### 3. Configure rclone, assuming a new install
      +
      +

      rclone config

      +

      n/s/q> n # New name>gdrive # Gdrive is an example name Storage> # Select the number shown for Google Drive client_id> # Can be left blank client_secret> # Can be left blank scope> # Select your scope, 1 for example root_folder_id> # Can be left blank service_account_file> /home/foo/myJSONfile.json # This is where the JSON file goes! y/n> # Auto config, n

      +
      
      +##### 4. Verify that it's working
      +  - `rclone -v --drive-impersonate foo@example.com lsf gdrive:backup`
      +  - The arguments do:
      +    - `-v` - verbose logging
      +    - `--drive-impersonate foo@example.com` - this is what does
      +the magic, pretending to be user foo.
      +    - `lsf` - list files in a parsing friendly way
      +    - `gdrive:backup` - use the remote called gdrive, work in
      +the folder named backup.
       
      -- Config:      port
      -- Env Var:     RCLONE_FTP_PORT
      -- Type:        int
      -- Default:     21
      +Note: in case you configured a specific root folder on gdrive and rclone is unable to access the contents of that folder when using `--drive-impersonate`, do this instead:
      +  - in the gdrive web interface, share your root folder with the user/email of the new Service Account you created/selected at step #1
      +  - use rclone without specifying the `--drive-impersonate` option, like this:
      +        `rclone -v lsf gdrive:backup`
       
      -#### --ftp-pass
       
      -FTP password.
      +### Shared drives (team drives)
       
      -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
      +If you want to configure the remote to point to a Google Shared Drive
      +(previously known as Team Drives) then answer `y` to the question
      +`Configure this as a Shared Drive (Team Drive)?`.
       
      -Properties:
      +This will fetch the list of Shared Drives from google and allow you to
      +configure which one you want to use. You can also type in a Shared
      +Drive ID if you prefer.
       
      -- Config:      pass
      -- Env Var:     RCLONE_FTP_PASS
      -- Type:        string
      -- Required:    false
      +For example:
      +
      +

      Configure this as a Shared Drive (Team Drive)? y) Yes n) No y/n> y Fetching Shared Drive list... Choose a number from below, or type in your own value 1 / Rclone Test  "xxxxxxxxxxxxxxxxxxxx" 2 / Rclone Test 2  "yyyyyyyyyyyyyyyyyyyy" 3 / Rclone Test 3  "zzzzzzzzzzzzzzzzzzzz" Enter a Shared Drive ID> 1 -------------------- [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} team_drive = xxxxxxxxxxxxxxxxxxxx -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

      +
      
      +### --fast-list
       
      -#### --ftp-tls
      +This remote supports `--fast-list` which allows you to use fewer
      +transactions in exchange for more memory. See the [rclone
      +docs](https://rclone.org/docs/#fast-list) for more details.
       
      -Use Implicit FTPS (FTP over TLS).
      +It does this by combining multiple `list` calls into a single API request.
       
      -When using implicit FTP over TLS the client connects using TLS
      -right from the start which breaks compatibility with
      -non-TLS-aware servers. This is usually served over port 990 rather
      -than port 21. Cannot be used in combination with explicit FTPS.
      +This works by combining many `'%s' in parents` filters into one expression.
      +To list the contents of directories a, b and c, the following requests will be send by the regular `List` function:
      +

      trashed=false and 'a' in parents trashed=false and 'b' in parents trashed=false and 'c' in parents

      +
      These can now be combined into a single request:
      +

      trashed=false and ('a' in parents or 'b' in parents or 'c' in parents)

      +
      
      +The implementation of `ListR` will put up to 50 `parents` filters into one request.
      +It will  use the `--checkers` value to specify the number of requests to run in parallel.
       
      -Properties:
      +In tests, these batch requests were up to 20x faster than the regular method.
      +Running the following command against different sized folders gives:
      +

      rclone lsjson -vv -R --checkers=6 gdrive:folder

      +
      
      +small folder (220 directories, 700 files):
       
      -- Config:      tls
      -- Env Var:     RCLONE_FTP_TLS
      -- Type:        bool
      -- Default:     false
      +- without `--fast-list`: 38s
      +- with `--fast-list`: 10s
       
      -#### --ftp-explicit-tls
      +large folder (10600 directories, 39000 files):
       
      -Use Explicit FTPS (FTP over TLS).
      +- without `--fast-list`: 22:05 min
      +- with `--fast-list`: 58s
       
      -When using explicit FTP over TLS the client explicitly requests
      -security from the server in order to upgrade a plain text connection
      -to an encrypted one. Cannot be used in combination with implicit FTPS.
      +### Modification times and hashes
       
      -Properties:
      +Google drive stores modification times accurate to 1 ms.
       
      -- Config:      explicit_tls
      -- Env Var:     RCLONE_FTP_EXPLICIT_TLS
      -- Type:        bool
      -- Default:     false
      +Hash algorithms MD5, SHA1 and SHA256 are supported. Note, however,
      +that a small fraction of files uploaded may not have SHA1 or SHA256
      +hashes especially if they were uploaded before 2018.
       
      -### Advanced options
      +### Restricted filename characters
       
      -Here are the Advanced options specific to ftp (FTP).
      +Only Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8),
      +as they can't be used in JSON strings.
       
      -#### --ftp-concurrency
      +In contrast to other backends, `/` can also be used in names and `.`
      +or `..` are valid names.
       
      -Maximum number of FTP simultaneous connections, 0 for unlimited.
      +### Revisions
       
      -Note that setting this is very likely to cause deadlocks so it should
      -be used with care.
      +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.
       
      -If you are doing a sync or copy then make sure concurrency is one more
      -than the sum of `--transfers` and `--checkers`.
      +Revisions follow the standard google policy which at time of writing
      +was
       
      -If you use `--check-first` then it just needs to be one more than the
      -maximum of `--checkers` and `--transfers`.
      +  * They are deleted after 30 days or 100 revisions (whatever comes first).
      +  * They do not count towards a user storage quota.
       
      -So for `concurrency 3` you'd use `--checkers 2 --transfers 2
      ---check-first` or `--checkers 1 --transfers 1`.
      +### Deleting files
       
      +By default rclone will send all files to the trash when deleting
      +files.  If deleting them permanently is required then use the
      +`--drive-use-trash=false` flag, or set the equivalent environment
      +variable.
       
      +### Shortcuts
       
      -Properties:
      +In March 2020 Google introduced a new feature in Google Drive called
      +[drive shortcuts](https://support.google.com/drive/answer/9700156)
      +([API](https://developers.google.com/drive/api/v3/shortcuts)). These
      +will (by September 2020) [replace the ability for files or folders to
      +be in multiple folders at once](https://cloud.google.com/blog/products/g-suite/simplifying-google-drives-folder-structure-and-sharing-models).
       
      -- Config:      concurrency
      -- Env Var:     RCLONE_FTP_CONCURRENCY
      -- Type:        int
      -- Default:     0
      +Shortcuts are files that link to other files on Google Drive somewhat
      +like a symlink in unix, except they point to the underlying file data
      +(e.g. the inode in unix terms) so they don't break if the source is
      +renamed or moved about.
       
      -#### --ftp-no-check-certificate
      +By default rclone treats these as follows.
       
      -Do not verify the TLS certificate of the server.
      +For shortcuts pointing to files:
       
      -Properties:
      +- When listing a file shortcut appears as the destination file.
      +- When downloading the contents of the destination file is downloaded.
      +- When updating shortcut file with a non shortcut file, the shortcut is removed then a new file is uploaded in place of the shortcut.
      +- When server-side moving (renaming) the shortcut is renamed, not the destination file.
      +- When server-side copying the shortcut is copied, not the contents of the shortcut. (unless `--drive-copy-shortcut-content` is in use in which case the contents of the shortcut gets copied).
      +- When deleting the shortcut is deleted not the linked file.
      +- When setting the modification time, the modification time of the linked file will be set.
       
      -- Config:      no_check_certificate
      -- Env Var:     RCLONE_FTP_NO_CHECK_CERTIFICATE
      -- Type:        bool
      -- Default:     false
      +For shortcuts pointing to folders:
       
      -#### --ftp-disable-epsv
      +- When listing the shortcut appears as a folder and that folder will contain the contents of the linked folder appear (including any sub folders)
      +- When downloading the contents of the linked folder and sub contents are downloaded
      +- When uploading to a shortcut folder the file will be placed in the linked folder
      +- When server-side moving (renaming) the shortcut is renamed, not the destination folder
      +- When server-side copying the contents of the linked folder is copied, not the shortcut.
      +- When deleting with `rclone rmdir` or `rclone purge` the shortcut is deleted not the linked folder.
      +- **NB** When deleting with `rclone remove` or `rclone mount` the contents of the linked folder will be deleted.
       
      -Disable using EPSV even if server advertises support.
      +The [rclone backend](https://rclone.org/commands/rclone_backend/) command can be used to create shortcuts.  
       
      -Properties:
      +Shortcuts can be completely ignored with the `--drive-skip-shortcuts` flag
      +or the corresponding `skip_shortcuts` configuration setting.
       
      -- Config:      disable_epsv
      -- Env Var:     RCLONE_FTP_DISABLE_EPSV
      -- Type:        bool
      -- Default:     false
      +### Emptying trash
       
      -#### --ftp-disable-mlsd
      +If you wish to empty your trash you can use the `rclone cleanup remote:`
      +command which will permanently delete all your trashed files. This command
      +does not take any path arguments.
       
      -Disable using MLSD even if server advertises support.
      +Note that Google Drive takes some time (minutes to days) to empty the
      +trash even though the command returns within a few seconds.  No output
      +is echoed, so there will be no confirmation even using -v or -vv.
       
      -Properties:
      +### Quota information
       
      -- Config:      disable_mlsd
      -- Env Var:     RCLONE_FTP_DISABLE_MLSD
      -- Type:        bool
      -- Default:     false
      +To view your current quota you can use the `rclone about remote:`
      +command which will display your usage limit (quota), the usage in Google
      +Drive, the size of all files in the Trash and the space used by other
      +Google services such as Gmail. This command does not take any path
      +arguments.
       
      -#### --ftp-disable-utf8
      +#### Import/Export of google documents
       
      -Disable using UTF-8 even if server advertises support.
      +Google documents can be exported from and uploaded to Google Drive.
       
      -Properties:
      +When rclone downloads a Google doc it chooses a format to download
      +depending upon the `--drive-export-formats` setting.
      +By default the export formats are `docx,xlsx,pptx,svg` which are a
      +sensible default for an editable document.
       
      -- Config:      disable_utf8
      -- Env Var:     RCLONE_FTP_DISABLE_UTF8
      -- Type:        bool
      -- Default:     false
      +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.
       
      -#### --ftp-writing-mdtm
      +If you prefer an archive copy then you might use `--drive-export-formats
      +pdf`, or if you prefer openoffice/libreoffice formats you might use
      +`--drive-export-formats ods,odt,odp`.
       
      -Use MDTM to set modification time (VsFtpd quirk)
      +Note that rclone adds the extension to the google doc, so if it is
      +called `My Spreadsheet` on google docs, it will be exported as `My
      +Spreadsheet.xlsx` or `My Spreadsheet.pdf` etc.
       
      -Properties:
      +When importing files into Google Drive, rclone will convert all
      +files with an extension in `--drive-import-formats` to their
      +associated document type.
      +rclone will not convert any files by default, since the conversion
      +is lossy process.
       
      -- Config:      writing_mdtm
      -- Env Var:     RCLONE_FTP_WRITING_MDTM
      -- Type:        bool
      -- Default:     false
      +The conversion must result in a file with the same extension when
      +the `--drive-export-formats` rules are applied to the uploaded document.
       
      -#### --ftp-force-list-hidden
      +Here are some examples for allowed and prohibited conversions.
       
      -Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD.
      +| export-formats | import-formats | Upload Ext | Document Ext | Allowed |
      +| -------------- | -------------- | ---------- | ------------ | ------- |
      +| odt | odt | odt | odt | Yes |
      +| odt | docx,odt | odt | odt | Yes |
      +|  | docx | docx | docx | Yes |
      +|  | odt | odt | docx | No |
      +| odt,docx | docx,odt | docx | odt | No |
      +| docx,odt | docx,odt | docx | docx | Yes |
      +| docx,odt | docx,odt | odt | docx | No |
       
      -Properties:
      +This limitation can be disabled by specifying `--drive-allow-import-name-change`.
      +When using this flag, rclone can convert multiple files types resulting
      +in the same document type at once, e.g. with `--drive-import-formats docx,odt,txt`,
      +all files having these extension would result in a document represented as a docx file.
      +This brings the additional risk of overwriting a document, if multiple files
      +have the same stem. Many rclone operations will not handle this name change
      +in any way. They assume an equal name when copying files and might copy the
      +file again or delete them when the name changes. 
       
      -- Config:      force_list_hidden
      -- Env Var:     RCLONE_FTP_FORCE_LIST_HIDDEN
      -- Type:        bool
      -- Default:     false
      +Here are the possible export extensions with their corresponding mime types.
      +Most of these can also be used for importing, but there more that are not
      +listed here. Some of these additional ones might only be available when
      +the operating system provides the correct MIME type entries.
       
      -#### --ftp-idle-timeout
      +This list can be changed by Google Drive at any time and might not
      +represent the currently available conversions.
       
      -Max time before closing idle connections.
      +| Extension | Mime Type | Description |
      +| --------- |-----------| ------------|
      +| bmp  | image/bmp | Windows Bitmap format |
      +| csv  | text/csv | Standard CSV format for Spreadsheets |
      +| doc  | application/msword | Classic Word file |
      +| docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document | Microsoft Office Document |
      +| epub | application/epub+zip | E-book format |
      +| html | text/html | An HTML Document |
      +| jpg  | image/jpeg | A JPEG Image File |
      +| json | application/vnd.google-apps.script+json | JSON Text Format for Google Apps scripts |
      +| odp  | application/vnd.oasis.opendocument.presentation | Openoffice Presentation |
      +| ods  | application/vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet |
      +| ods  | application/x-vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet |
      +| odt  | application/vnd.oasis.opendocument.text | Openoffice Document |
      +| pdf  | application/pdf | Adobe PDF Format |
      +| pjpeg | image/pjpeg | Progressive JPEG Image |
      +| png  | image/png | PNG Image Format|
      +| pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation | Microsoft Office Powerpoint |
      +| rtf  | application/rtf | Rich Text Format |
      +| svg  | image/svg+xml | Scalable Vector Graphics Format |
      +| tsv  | text/tab-separated-values | Standard TSV format for spreadsheets |
      +| txt  | text/plain | Plain Text |
      +| wmf  | application/x-msmetafile | Windows Meta File |
      +| xls  | application/vnd.ms-excel | Classic Excel file |
      +| xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | Microsoft Office Spreadsheet |
      +| zip  | application/zip | A ZIP file of HTML, Images CSS |
       
      -If no connections have been returned to the connection pool in the time
      -given, rclone will empty the connection pool.
      +Google documents can also be exported as link files. These files will
      +open a browser window for the Google Docs website of that document
      +when opened. The link file extension has to be specified as a
      +`--drive-export-formats` parameter. They will match all available
      +Google Documents.
       
      -Set to 0 to keep connections indefinitely.
      +| Extension | Description | OS Support |
      +| --------- | ----------- | ---------- |
      +| desktop | freedesktop.org specified desktop entry | Linux |
      +| link.html | An HTML Document with a redirect | All |
      +| url | INI style link file | macOS, Windows |
      +| webloc | macOS specific XML format | macOS |
       
       
      -Properties:
      +### Standard options
       
      -- Config:      idle_timeout
      -- Env Var:     RCLONE_FTP_IDLE_TIMEOUT
      -- Type:        Duration
      -- Default:     1m0s
      +Here are the Standard options specific to drive (Google Drive).
       
      -#### --ftp-close-timeout
      +#### --drive-client-id
       
      -Maximum time to wait for a response to close.
      +Google Application Client Id
      +Setting your own is recommended.
      +See https://rclone.org/drive/#making-your-own-client-id for how to create your own.
      +If you leave this blank, it will use an internal key which is low performance.
       
       Properties:
       
      -- Config:      close_timeout
      -- Env Var:     RCLONE_FTP_CLOSE_TIMEOUT
      -- Type:        Duration
      -- Default:     1m0s
      -
      -#### --ftp-tls-cache-size
      +- Config:      client_id
      +- Env Var:     RCLONE_DRIVE_CLIENT_ID
      +- Type:        string
      +- Required:    false
       
      -Size of TLS session cache for all control and data connections.
      +#### --drive-client-secret
       
      -TLS cache allows to resume TLS sessions and reuse PSK between connections.
      -Increase if default size is not enough resulting in TLS resumption errors.
      -Enabled by default. Use 0 to disable.
      +OAuth Client Secret.
      +
      +Leave blank normally.
       
       Properties:
       
      -- Config:      tls_cache_size
      -- Env Var:     RCLONE_FTP_TLS_CACHE_SIZE
      -- Type:        int
      -- Default:     32
      +- Config:      client_secret
      +- Env Var:     RCLONE_DRIVE_CLIENT_SECRET
      +- Type:        string
      +- Required:    false
       
      -#### --ftp-disable-tls13
      +#### --drive-scope
       
      -Disable TLS 1.3 (workaround for FTP servers with buggy TLS)
      +Comma separated list of scopes that rclone should use when requesting access from drive.
       
       Properties:
       
      -- Config:      disable_tls13
      -- Env Var:     RCLONE_FTP_DISABLE_TLS13
      -- Type:        bool
      -- Default:     false
      +- Config:      scope
      +- Env Var:     RCLONE_DRIVE_SCOPE
      +- Type:        string
      +- Required:    false
      +- Examples:
      +    - "drive"
      +        - Full access all files, excluding Application Data Folder.
      +    - "drive.readonly"
      +        - Read-only access to file metadata and file contents.
      +    - "drive.file"
      +        - Access to files created by rclone only.
      +        - These are visible in the drive website.
      +        - File authorization is revoked when the user deauthorizes the app.
      +    - "drive.appfolder"
      +        - Allows read and write access to the Application Data folder.
      +        - This is not visible in the drive website.
      +    - "drive.metadata.readonly"
      +        - Allows read-only access to file metadata but
      +        - does not allow any access to read or download file content.
       
      -#### --ftp-shut-timeout
      +#### --drive-service-account-file
       
      -Maximum time to wait for data connection closing status.
      +Service Account Credentials JSON file path.
       
      -Properties:
      +Leave blank normally.
      +Needed only if you want use SA instead of interactive login.
       
      -- Config:      shut_timeout
      -- Env Var:     RCLONE_FTP_SHUT_TIMEOUT
      -- Type:        Duration
      -- Default:     1m0s
      +Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`.
       
      -#### --ftp-ask-password
      +Properties:
       
      -Allow asking for FTP password when needed.
      +- Config:      service_account_file
      +- Env Var:     RCLONE_DRIVE_SERVICE_ACCOUNT_FILE
      +- Type:        string
      +- Required:    false
       
      -If this is set and no password is supplied then rclone will ask for a password
      +#### --drive-alternate-export
       
      +Deprecated: No longer needed.
       
       Properties:
       
      -- Config:      ask_password
      -- Env Var:     RCLONE_FTP_ASK_PASSWORD
      +- Config:      alternate_export
      +- Env Var:     RCLONE_DRIVE_ALTERNATE_EXPORT
       - Type:        bool
       - Default:     false
       
      -#### --ftp-socks-proxy
      +### Advanced options
       
      -Socks 5 proxy host.
      -        
      -        Supports the format user:pass@host:port, user@host:port, host:port.
      -        
      -        Example:
      -        
      -            myUser:myPass@localhost:9005
      -        
      +Here are the Advanced options specific to drive (Google Drive).
      +
      +#### --drive-token
      +
      +OAuth Access Token as a JSON blob.
       
       Properties:
       
      -- Config:      socks_proxy
      -- Env Var:     RCLONE_FTP_SOCKS_PROXY
      +- Config:      token
      +- Env Var:     RCLONE_DRIVE_TOKEN
       - Type:        string
       - Required:    false
       
      -#### --ftp-encoding
      +#### --drive-auth-url
       
      -The encoding for the backend.
      +Auth server URL.
       
      -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
      +Leave blank to use the provider defaults.
       
       Properties:
       
      -- Config:      encoding
      -- Env Var:     RCLONE_FTP_ENCODING
      -- Type:        MultiEncoder
      -- Default:     Slash,Del,Ctl,RightSpace,Dot
      -- Examples:
      -    - "Asterisk,Ctl,Dot,Slash"
      -        - ProFTPd can't handle '*' in file names
      -    - "BackSlash,Ctl,Del,Dot,RightSpace,Slash,SquareBracket"
      -        - PureFTPd can't handle '[]' or '*' in file names
      -    - "Ctl,LeftPeriod,Slash"
      -        - VsFTPd can't handle file names starting with dot
      +- Config:      auth_url
      +- Env Var:     RCLONE_DRIVE_AUTH_URL
      +- Type:        string
      +- Required:    false
       
      +#### --drive-token-url
       
      +Token server url.
       
      -## Limitations
      +Leave blank to use the provider defaults.
       
      -FTP servers acting as rclone remotes must support `passive` mode.
      -The mode cannot be configured as `passive` is the only supported one.
      -Rclone's FTP implementation is not compatible with `active` mode
      -as [the library it uses doesn't support it](https://github.com/jlaffaye/ftp/issues/29).
      -This will likely never be supported due to security concerns.
      +Properties:
       
      -Rclone's FTP backend does not support any checksums but can compare
      -file sizes.
      +- Config:      token_url
      +- Env Var:     RCLONE_DRIVE_TOKEN_URL
      +- Type:        string
      +- Required:    false
       
      -`rclone about` is not supported by the FTP backend. Backends without
      -this capability cannot determine free space for an rclone mount or
      -use policy `mfs` (most free space) as a member of an rclone union
      -remote.
      +#### --drive-root-folder-id
       
      -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/)
      +ID of the root folder.
      +Leave blank normally.
       
      -The implementation of : `--dump headers`,
      -`--dump bodies`, `--dump auth` for debugging isn't the same as
      -for rclone HTTP based backends - it has less fine grained control.
      +Fill in to access "Computers" folders (see docs), or for rclone to use
      +a non root folder as its starting point.
       
      -`--timeout` isn't supported (but `--contimeout` is).
       
      -`--bind` isn't supported.
      +Properties:
       
      -Rclone's FTP backend could support server-side move but does not
      -at present.
      +- Config:      root_folder_id
      +- Env Var:     RCLONE_DRIVE_ROOT_FOLDER_ID
      +- Type:        string
      +- Required:    false
       
      -The `ftp_proxy` environment variable is not currently supported.
      +#### --drive-service-account-credentials
       
      -#### Modified time
      +Service Account Credentials JSON blob.
       
      -File modification time (timestamps) is supported to 1 second resolution
      -for major FTP servers: ProFTPd, PureFTPd, VsFTPd, and FileZilla FTP server.
      -The `VsFTPd` server has non-standard implementation of time related protocol
      -commands and needs a special configuration setting: `writing_mdtm = true`.
      +Leave blank normally.
      +Needed only if you want use SA instead of interactive login.
       
      -Support for precise file time with other FTP servers varies depending on what
      -protocol extensions they advertise. If all the `MLSD`, `MDTM` and `MFTM`
      -extensions are present, rclone will use them together to provide precise time.
      -Otherwise the times you see on the FTP server through rclone are those of the
      -last file upload.
      +Properties:
       
      -You can use the following command to check whether rclone can use precise time
      -with your FTP server: `rclone backend features your_ftp_remote:` (the trailing
      -colon is important). Look for the number in the line tagged by `Precision`
      -designating the remote time precision expressed as nanoseconds. A value of
      -`1000000000` means that file time precision of 1 second is available.
      -A value of `3153600000000000000` (or another large number) means "unsupported".
      +- Config:      service_account_credentials
      +- Env Var:     RCLONE_DRIVE_SERVICE_ACCOUNT_CREDENTIALS
      +- Type:        string
      +- Required:    false
       
      -#  Google Cloud Storage
      +#### --drive-team-drive
       
      -Paths are specified as `remote:bucket` (or `remote:` for the `lsd`
      -command.)  You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`.
      +ID of the Shared Drive (Team Drive).
       
      -## Configuration
      +Properties:
       
      -The initial setup for google cloud storage involves getting a token from Google Cloud Storage
      -which you need to do in your browser.  `rclone config` walks you
      -through it.
      +- Config:      team_drive
      +- Env Var:     RCLONE_DRIVE_TEAM_DRIVE
      +- Type:        string
      +- Required:    false
       
      -Here is an example of how to make a remote called `remote`.  First run:
      +#### --drive-auth-owner-only
       
      -     rclone config
      +Only consider files owned by the authenticated user.
       
      -This will guide you through an interactive setup process:
      -
      -
        -
      1. New remote
      2. -
      3. Delete remote
      4. -
      5. 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 [snip] XX / Google Cloud Storage (this is not Google Drive)  "google cloud storage" [snip] Storage> google cloud storage Google Application Client Id - leave blank normally. client_id> Google Application Client Secret - leave blank normally. client_secret> Project number optional - needed only for list/create/delete buckets - see your developer console. project_number> 12345678 Service Account Credentials JSON file path - needed only if you want use SA instead of interactive login. service_account_file> Access Control List for new objects. Choose a number from below, or type in your own value 1 / Object owner gets OWNER access, and all Authenticated Users get READER access.  "authenticatedRead" 2 / Object owner gets OWNER access, and project team owners get OWNER access.  "bucketOwnerFullControl" 3 / Object owner gets OWNER access, and project team owners get READER access.  "bucketOwnerRead" 4 / Object owner gets OWNER access [default if left blank].  "private" 5 / Object owner gets OWNER access, and project team members get access according to their roles.  "projectPrivate" 6 / Object owner gets OWNER access, and all Users get READER access.  "publicRead" object_acl> 4 Access Control List for new buckets. Choose a number from below, or type in your own value 1 / Project team owners get OWNER access, and all Authenticated Users get READER access.  "authenticatedRead" 2 / Project team owners get OWNER access [default if left blank].  "private" 3 / Project team members get access according to their roles.  "projectPrivate" 4 / Project team owners get OWNER access, and all Users get READER access.  "publicRead" 5 / Project team owners get OWNER access, and all Users get WRITER access.  "publicReadWrite" bucket_acl> 2 Location for the newly created buckets. Choose a number from below, or type in your own value 1 / Empty for default location (US).  "" 2 / Multi-regional location for Asia.  "asia" 3 / Multi-regional location for Europe.  "eu" 4 / Multi-regional location for United States.  "us" 5 / Taiwan.  "asia-east1" 6 / Tokyo.  "asia-northeast1" 7 / Singapore.  "asia-southeast1" 8 / Sydney.  "australia-southeast1" 9 / Belgium.  "europe-west1" 10 / London.  "europe-west2" 11 / Iowa.  "us-central1" 12 / South Carolina.  "us-east1" 13 / Northern Virginia.  "us-east4" 14 / Oregon.  "us-west1" location> 12 The storage class to use when storing objects in Google Cloud Storage. Choose a number from below, or type in your own value 1 / Default  "" 2 / Multi-regional storage class  "MULTI_REGIONAL" 3 / Regional storage class  "REGIONAL" 4 / Nearline storage class  "NEARLINE" 5 / Coldline storage class  "COLDLINE" 6 / Durable reduced availability storage class  "DURABLE_REDUCED_AVAILABILITY" storage_class> 5 Remote config Use web browser to automatically authenticate rclone with remote?
      6. -
      -
        -
      • Say Y if the machine running rclone has a web browser you can use
      • -
      • Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N.
      • -
      -
        -
      1. Yes
      2. -
      3. 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] type = google cloud storage client_id = client_secret = token = {"AccessToken":"xxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","RefreshToken":"x/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxx","Expiry":"2014-07-17T20:49:14.929208288+01:00","Extra":null} project_number = 12345678 object_acl = private bucket_acl = private --------------------
      4. -
      5. Yes this is OK
      6. -
      7. Edit this remote
      8. -
      9. Delete this remote y/e/d> y
      10. -
      -
      
      -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a
      -machine with no Internet browser available.
      +Properties:
       
      -Note that rclone runs a webserver on your local machine to collect the
      -token as returned from Google if using web browser to automatically 
      -authenticate. This only
      -runs from the moment it opens your browser to the moment you get back
      -the verification code.  This is on `http://127.0.0.1:53682/` and this
      -it may require you to unblock it temporarily if you are running a host
      -firewall, or use manual mode.
      +- Config:      auth_owner_only
      +- Env Var:     RCLONE_DRIVE_AUTH_OWNER_ONLY
      +- Type:        bool
      +- Default:     false
       
      -This remote is called `remote` and can now be used like this
      +#### --drive-use-trash
       
      -See all the buckets in your project
      +Send files to the trash instead of deleting permanently.
       
      -    rclone lsd remote:
      +Defaults to true, namely sending files to the trash.
      +Use `--drive-use-trash=false` to delete files permanently instead.
       
      -Make a new bucket
      +Properties:
       
      -    rclone mkdir remote:bucket
      +- Config:      use_trash
      +- Env Var:     RCLONE_DRIVE_USE_TRASH
      +- Type:        bool
      +- Default:     true
       
      -List the contents of a bucket
      +#### --drive-copy-shortcut-content
       
      -    rclone ls remote:bucket
      +Server side copy contents of shortcuts instead of the shortcut.
       
      -Sync `/home/local/directory` to the remote bucket, deleting any excess
      -files in the bucket.
      +When doing server side copies, normally rclone will copy shortcuts as
      +shortcuts.
       
      -    rclone sync --interactive /home/local/directory remote:bucket
      +If this flag is used then rclone will copy the contents of shortcuts
      +rather than shortcuts themselves when doing server side copies.
       
      -### Service Account support
      +Properties:
       
      -You can set up rclone with Google Cloud Storage in an unattended mode,
      -i.e. not tied to a specific end-user Google account. This is useful
      -when you want to synchronise files onto machines that don't have
      -actively logged-in users, for example build machines.
      +- Config:      copy_shortcut_content
      +- Env Var:     RCLONE_DRIVE_COPY_SHORTCUT_CONTENT
      +- Type:        bool
      +- Default:     false
       
      -To get credentials for Google Cloud Platform
      -[IAM Service Accounts](https://cloud.google.com/iam/docs/service-accounts),
      -please head to the
      -[Service Account](https://console.cloud.google.com/permissions/serviceaccounts)
      -section of the Google Developer Console. Service Accounts behave just
      -like normal `User` permissions in
      -[Google Cloud Storage ACLs](https://cloud.google.com/storage/docs/access-control),
      -so you can limit their access (e.g. make them read only). After
      -creating an account, a JSON file containing the Service Account's
      -credentials will be downloaded onto your machines. These credentials
      -are what rclone will use for authentication.
      +#### --drive-skip-gdocs
       
      -To use a Service Account instead of OAuth2 token flow, enter the path
      -to your Service Account credentials at the `service_account_file`
      -prompt and rclone won't use the browser based authentication
      -flow. If you'd rather stuff the contents of the credentials file into
      -the rclone config file, you can set `service_account_credentials` with
      -the actual contents of the file instead, or set the equivalent
      -environment variable.
      +Skip google documents in all listings.
       
      -### Anonymous Access
      +If given, gdocs practically become invisible to rclone.
       
      -For downloads of objects that permit public access you can configure rclone
      -to use anonymous access by setting `anonymous` to `true`.
      -With unauthorized access you can't write or create files but only read or list
      -those buckets and objects that have public read access.
      +Properties:
       
      -### Application Default Credentials
      +- Config:      skip_gdocs
      +- Env Var:     RCLONE_DRIVE_SKIP_GDOCS
      +- Type:        bool
      +- Default:     false
       
      -If no other source of credentials is provided, rclone will fall back
      -to
      -[Application Default Credentials](https://cloud.google.com/video-intelligence/docs/common/auth#authenticating_with_application_default_credentials)
      -this is useful both when you already have configured authentication
      -for your developer account, or in production when running on a google
      -compute host. Note that if running in docker, you may need to run
      -additional commands on your google compute machine -
      -[see this page](https://cloud.google.com/container-registry/docs/advanced-authentication#gcloud_as_a_docker_credential_helper).
      +#### --drive-show-all-gdocs
       
      -Note that in the case application default credentials are used, there
      -is no need to explicitly configure a project number.
      +Show all Google Docs including non-exportable ones in listings.
       
      -### --fast-list
      +If you try a server side copy on a Google Form without this flag, you
      +will get this error:
       
      -This remote supports `--fast-list` which allows you to use fewer
      -transactions in exchange for more memory. See the [rclone
      -docs](https://rclone.org/docs/#fast-list) for more details.
      +    No export formats found for "application/vnd.google-apps.form"
       
      -### Custom upload headers
      +However adding this flag will allow the form to be server side copied.
       
      -You can set custom upload headers with the `--header-upload`
      -flag. Google Cloud Storage supports the headers as described in the
      -[working with metadata documentation](https://cloud.google.com/storage/docs/gsutil/addlhelp/WorkingWithObjectMetadata)
      +Note that rclone doesn't add extensions to the Google Docs file names
      +in this mode.
       
      -- Cache-Control
      -- Content-Disposition
      -- Content-Encoding
      -- Content-Language
      -- Content-Type
      -- X-Goog-Storage-Class
      -- X-Goog-Meta-
      +Do **not** use this flag when trying to download Google Docs - rclone
      +will fail to download them.
       
      -Eg `--header-upload "Content-Type text/potato"`
       
      -Note that the last of these is for setting custom metadata in the form
      -`--header-upload "x-goog-meta-key: value"`
      +Properties:
       
      -### Modification time
      +- Config:      show_all_gdocs
      +- Env Var:     RCLONE_DRIVE_SHOW_ALL_GDOCS
      +- Type:        bool
      +- Default:     false
       
      -Google Cloud Storage stores md5sum natively.
      -Google's [gsutil](https://cloud.google.com/storage/docs/gsutil) tool stores modification time
      -with one-second precision as `goog-reserved-file-mtime` in file metadata.
      +#### --drive-skip-checksum-gphotos
       
      -To ensure compatibility with gsutil, rclone stores modification time in 2 separate metadata entries.
      -`mtime` uses RFC3339 format with one-nanosecond precision.
      -`goog-reserved-file-mtime` uses Unix timestamp format with one-second precision.
      -To get modification time from object metadata, rclone reads the metadata in the following order: `mtime`, `goog-reserved-file-mtime`, object updated time.
      +Skip checksums on Google photos and videos only.
       
      -Note that rclone's default modify window is 1ns.
      -Files uploaded by gsutil only contain timestamps with one-second precision.
      -If you use rclone to sync files previously uploaded by gsutil,
      -rclone will attempt to update modification time for all these files.
      -To avoid these possibly unnecessary updates, use `--modify-window 1s`.
      +Use this if you get checksum errors when transferring Google photos or
      +videos.
       
      -### Restricted filename characters
      +Setting this flag will cause Google photos and videos to return a
      +blank checksums.
       
      -| Character | Value | Replacement |
      -| --------- |:-----:|:-----------:|
      -| NUL       | 0x00  | ␀           |
      -| LF        | 0x0A  | ␊           |
      -| CR        | 0x0D  | ␍           |
      -| /         | 0x2F  | /          |
      +Google photos are identified by being in the "photos" space.
       
      -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
      -as they can't be used in JSON strings.
      +Corrupted checksums are caused by Google modifying the image/video but
      +not updating the checksum.
       
      +Properties:
       
      -### Standard options
      +- Config:      skip_checksum_gphotos
      +- Env Var:     RCLONE_DRIVE_SKIP_CHECKSUM_GPHOTOS
      +- Type:        bool
      +- Default:     false
       
      -Here are the Standard options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)).
      +#### --drive-shared-with-me
       
      -#### --gcs-client-id
      +Only show files that are shared with me.
       
      -OAuth Client Id.
      +Instructs rclone to operate on your "Shared with me" folder (where
      +Google Drive lets you access the files and folders others have shared
      +with you).
       
      -Leave blank normally.
      +This works both with the "list" (lsd, lsl, etc.) and the "copy"
      +commands (copy, sync, etc.), and with all other commands too.
       
       Properties:
       
      -- Config:      client_id
      -- Env Var:     RCLONE_GCS_CLIENT_ID
      -- Type:        string
      -- Required:    false
      +- Config:      shared_with_me
      +- Env Var:     RCLONE_DRIVE_SHARED_WITH_ME
      +- Type:        bool
      +- Default:     false
       
      -#### --gcs-client-secret
      +#### --drive-trashed-only
       
      -OAuth Client Secret.
      +Only show files that are in the trash.
       
      -Leave blank normally.
      +This will show trashed files in their original directory structure.
       
       Properties:
       
      -- Config:      client_secret
      -- Env Var:     RCLONE_GCS_CLIENT_SECRET
      -- Type:        string
      -- Required:    false
      -
      -#### --gcs-project-number
      +- Config:      trashed_only
      +- Env Var:     RCLONE_DRIVE_TRASHED_ONLY
      +- Type:        bool
      +- Default:     false
       
      -Project number.
      +#### --drive-starred-only
       
      -Optional - needed only for list/create/delete buckets - see your developer console.
      +Only show files that are starred.
       
       Properties:
       
      -- Config:      project_number
      -- Env Var:     RCLONE_GCS_PROJECT_NUMBER
      -- Type:        string
      -- Required:    false
      -
      -#### --gcs-user-project
      +- Config:      starred_only
      +- Env Var:     RCLONE_DRIVE_STARRED_ONLY
      +- Type:        bool
      +- Default:     false
       
      -User project.
      +#### --drive-formats
       
      -Optional - needed only for requester pays.
      +Deprecated: See export_formats.
       
       Properties:
       
      -- Config:      user_project
      -- Env Var:     RCLONE_GCS_USER_PROJECT
      +- Config:      formats
      +- Env Var:     RCLONE_DRIVE_FORMATS
       - Type:        string
       - Required:    false
       
      -#### --gcs-service-account-file
      -
      -Service Account Credentials JSON file path.
      -
      -Leave blank normally.
      -Needed only if you want use SA instead of interactive login.
      +#### --drive-export-formats
       
      -Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`.
      +Comma separated list of preferred formats for downloading Google docs.
       
       Properties:
       
      -- Config:      service_account_file
      -- Env Var:     RCLONE_GCS_SERVICE_ACCOUNT_FILE
      +- Config:      export_formats
      +- Env Var:     RCLONE_DRIVE_EXPORT_FORMATS
       - Type:        string
      -- Required:    false
      -
      -#### --gcs-service-account-credentials
      +- Default:     "docx,xlsx,pptx,svg"
       
      -Service Account Credentials JSON blob.
      +#### --drive-import-formats
       
      -Leave blank normally.
      -Needed only if you want use SA instead of interactive login.
      +Comma separated list of preferred formats for uploading Google docs.
       
       Properties:
       
      -- Config:      service_account_credentials
      -- Env Var:     RCLONE_GCS_SERVICE_ACCOUNT_CREDENTIALS
      +- Config:      import_formats
      +- Env Var:     RCLONE_DRIVE_IMPORT_FORMATS
       - Type:        string
       - Required:    false
       
      -#### --gcs-anonymous
      +#### --drive-allow-import-name-change
       
      -Access public buckets and objects without credentials.
      +Allow the filetype to change when uploading Google docs.
       
      -Set to 'true' if you just want to download files and don't configure credentials.
      +E.g. file.doc to file.docx. This will confuse sync and reupload every time.
       
       Properties:
       
      -- Config:      anonymous
      -- Env Var:     RCLONE_GCS_ANONYMOUS
      +- Config:      allow_import_name_change
      +- Env Var:     RCLONE_DRIVE_ALLOW_IMPORT_NAME_CHANGE
       - Type:        bool
       - Default:     false
       
      -#### --gcs-object-acl
      +#### --drive-use-created-date
       
      -Access Control List for new objects.
      +Use file created date instead of modified date.
       
      -Properties:
      +Useful when downloading data and you want the creation date used in
      +place of the last modified date.
       
      -- Config:      object_acl
      -- Env Var:     RCLONE_GCS_OBJECT_ACL
      -- Type:        string
      -- Required:    false
      -- Examples:
      -    - "authenticatedRead"
      -        - Object owner gets OWNER access.
      -        - All Authenticated Users get READER access.
      -    - "bucketOwnerFullControl"
      -        - Object owner gets OWNER access.
      -        - Project team owners get OWNER access.
      -    - "bucketOwnerRead"
      -        - Object owner gets OWNER access.
      -        - Project team owners get READER access.
      -    - "private"
      -        - Object owner gets OWNER access.
      -        - Default if left blank.
      -    - "projectPrivate"
      -        - Object owner gets OWNER access.
      -        - Project team members get access according to their roles.
      -    - "publicRead"
      -        - Object owner gets OWNER access.
      -        - All Users get READER access.
      +**WARNING**: This flag may have some unexpected consequences.
       
      -#### --gcs-bucket-acl
      +When uploading to your drive all files will be overwritten unless they
      +haven't been modified since their creation. And the inverse will occur
      +while downloading.  This side effect can be avoided by using the
      +"--checksum" flag.
       
      -Access Control List for new buckets.
      +This feature was implemented to retain photos capture date as recorded
      +by google photos. You will first need to check the "Create a Google
      +Photos folder" option in your google drive settings. You can then copy
      +or move the photos locally and use the date the image was taken
      +(created) set as the modification date.
       
       Properties:
       
      -- Config:      bucket_acl
      -- Env Var:     RCLONE_GCS_BUCKET_ACL
      -- Type:        string
      -- Required:    false
      -- Examples:
      -    - "authenticatedRead"
      -        - Project team owners get OWNER access.
      -        - All Authenticated Users get READER access.
      -    - "private"
      -        - Project team owners get OWNER access.
      -        - Default if left blank.
      -    - "projectPrivate"
      -        - Project team members get access according to their roles.
      -    - "publicRead"
      -        - Project team owners get OWNER access.
      -        - All Users get READER access.
      -    - "publicReadWrite"
      -        - Project team owners get OWNER access.
      -        - All Users get WRITER access.
      -
      -#### --gcs-bucket-policy-only
      -
      -Access checks should use bucket-level IAM policies.
      -
      -If you want to upload objects to a bucket with Bucket Policy Only set
      -then you will need to set this.
      +- Config:      use_created_date
      +- Env Var:     RCLONE_DRIVE_USE_CREATED_DATE
      +- Type:        bool
      +- Default:     false
       
      -When it is set, rclone:
      +#### --drive-use-shared-date
       
      -- ignores ACLs set on buckets
      -- ignores ACLs set on objects
      -- creates buckets with Bucket Policy Only set
      +Use date file was shared instead of modified date.
       
      -Docs: https://cloud.google.com/storage/docs/bucket-policy-only
      +Note that, as with "--drive-use-created-date", this flag may have
      +unexpected consequences when uploading/downloading files.
       
      +If both this flag and "--drive-use-created-date" are set, the created
      +date is used.
       
       Properties:
       
      -- Config:      bucket_policy_only
      -- Env Var:     RCLONE_GCS_BUCKET_POLICY_ONLY
      +- Config:      use_shared_date
      +- Env Var:     RCLONE_DRIVE_USE_SHARED_DATE
       - Type:        bool
       - Default:     false
       
      -#### --gcs-location
      +#### --drive-list-chunk
       
      -Location for the newly created buckets.
      +Size of listing chunk 100-1000, 0 to disable.
       
       Properties:
       
      -- Config:      location
      -- Env Var:     RCLONE_GCS_LOCATION
      -- Type:        string
      -- Required:    false
      -- Examples:
      -    - ""
      -        - Empty for default location (US)
      -    - "asia"
      -        - Multi-regional location for Asia
      -    - "eu"
      -        - Multi-regional location for Europe
      -    - "us"
      -        - Multi-regional location for United States
      -    - "asia-east1"
      -        - Taiwan
      -    - "asia-east2"
      -        - Hong Kong
      -    - "asia-northeast1"
      -        - Tokyo
      -    - "asia-northeast2"
      -        - Osaka
      -    - "asia-northeast3"
      -        - Seoul
      -    - "asia-south1"
      -        - Mumbai
      -    - "asia-south2"
      -        - Delhi
      -    - "asia-southeast1"
      -        - Singapore
      -    - "asia-southeast2"
      -        - Jakarta
      -    - "australia-southeast1"
      -        - Sydney
      -    - "australia-southeast2"
      -        - Melbourne
      -    - "europe-north1"
      -        - Finland
      -    - "europe-west1"
      -        - Belgium
      -    - "europe-west2"
      -        - London
      -    - "europe-west3"
      -        - Frankfurt
      -    - "europe-west4"
      -        - Netherlands
      -    - "europe-west6"
      -        - Zürich
      -    - "europe-central2"
      -        - Warsaw
      -    - "us-central1"
      -        - Iowa
      -    - "us-east1"
      -        - South Carolina
      -    - "us-east4"
      -        - Northern Virginia
      -    - "us-west1"
      -        - Oregon
      -    - "us-west2"
      -        - California
      -    - "us-west3"
      -        - Salt Lake City
      -    - "us-west4"
      -        - Las Vegas
      -    - "northamerica-northeast1"
      -        - Montréal
      -    - "northamerica-northeast2"
      -        - Toronto
      -    - "southamerica-east1"
      -        - São Paulo
      -    - "southamerica-west1"
      -        - Santiago
      -    - "asia1"
      -        - Dual region: asia-northeast1 and asia-northeast2.
      -    - "eur4"
      -        - Dual region: europe-north1 and europe-west4.
      -    - "nam4"
      -        - Dual region: us-central1 and us-east1.
      +- Config:      list_chunk
      +- Env Var:     RCLONE_DRIVE_LIST_CHUNK
      +- Type:        int
      +- Default:     1000
       
      -#### --gcs-storage-class
      +#### --drive-impersonate
       
      -The storage class to use when storing objects in Google Cloud Storage.
      +Impersonate this user when using a service account.
       
       Properties:
       
      -- Config:      storage_class
      -- Env Var:     RCLONE_GCS_STORAGE_CLASS
      +- Config:      impersonate
      +- Env Var:     RCLONE_DRIVE_IMPERSONATE
       - Type:        string
       - Required:    false
      -- Examples:
      -    - ""
      -        - Default
      -    - "MULTI_REGIONAL"
      -        - Multi-regional storage class
      -    - "REGIONAL"
      -        - Regional storage class
      -    - "NEARLINE"
      -        - Nearline storage class
      -    - "COLDLINE"
      -        - Coldline storage class
      -    - "ARCHIVE"
      -        - Archive storage class
      -    - "DURABLE_REDUCED_AVAILABILITY"
      -        - Durable reduced availability storage class
       
      -#### --gcs-env-auth
      -
      -Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars).
      +#### --drive-upload-cutoff
       
      -Only applies if service_account_file and service_account_credentials is blank.
      +Cutoff for switching to chunked upload.
       
       Properties:
       
      -- Config:      env_auth
      -- Env Var:     RCLONE_GCS_ENV_AUTH
      -- Type:        bool
      -- Default:     false
      -- Examples:
      -    - "false"
      -        - Enter credentials in the next step.
      -    - "true"
      -        - Get GCP IAM credentials from the environment (env vars or IAM).
      +- Config:      upload_cutoff
      +- Env Var:     RCLONE_DRIVE_UPLOAD_CUTOFF
      +- Type:        SizeSuffix
      +- Default:     8Mi
       
      -### Advanced options
      +#### --drive-chunk-size
       
      -Here are the Advanced options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)).
      +Upload chunk size.
       
      -#### --gcs-token
      +Must a power of 2 >= 256k.
       
      -OAuth Access Token as a JSON blob.
      +Making this larger will improve performance, but note that each chunk
      +is buffered in memory one per transfer.
      +
      +Reducing this will reduce memory usage but decrease performance.
       
       Properties:
       
      -- Config:      token
      -- Env Var:     RCLONE_GCS_TOKEN
      -- Type:        string
      -- Required:    false
      +- Config:      chunk_size
      +- Env Var:     RCLONE_DRIVE_CHUNK_SIZE
      +- Type:        SizeSuffix
      +- Default:     8Mi
       
      -#### --gcs-auth-url
      +#### --drive-acknowledge-abuse
       
      -Auth server URL.
      +Set to allow files which return cannotDownloadAbusiveFile to be downloaded.
       
      -Leave blank to use the provider defaults.
      +If downloading a file returns the error "This file has been identified
      +as malware or spam and cannot be downloaded" with the error code
      +"cannotDownloadAbusiveFile" then supply this flag to rclone to
      +indicate you acknowledge the risks of downloading the file and rclone
      +will download it anyway.
       
      -Properties:
      +Note that if you are using service account it will need Manager
      +permission (not Content Manager) to for this flag to work. If the SA
      +does not have the right permission, Google will just ignore the flag.
       
      -- Config:      auth_url
      -- Env Var:     RCLONE_GCS_AUTH_URL
      -- Type:        string
      -- Required:    false
      +Properties:
       
      -#### --gcs-token-url
      +- Config:      acknowledge_abuse
      +- Env Var:     RCLONE_DRIVE_ACKNOWLEDGE_ABUSE
      +- Type:        bool
      +- Default:     false
       
      -Token server url.
      +#### --drive-keep-revision-forever
       
      -Leave blank to use the provider defaults.
      +Keep new head revision of each file forever.
       
       Properties:
       
      -- Config:      token_url
      -- Env Var:     RCLONE_GCS_TOKEN_URL
      -- Type:        string
      -- Required:    false
      +- Config:      keep_revision_forever
      +- Env Var:     RCLONE_DRIVE_KEEP_REVISION_FOREVER
      +- Type:        bool
      +- Default:     false
       
      -#### --gcs-directory-markers
      +#### --drive-size-as-quota
       
      -Upload an empty object with a trailing slash when a new directory is created
      +Show sizes as storage quota usage, not actual size.
       
      -Empty folders are unsupported for bucket based remotes, this option creates an empty
      -object ending with "/", to persist the folder.
      +Show the size of a file as the storage quota used. This is the
      +current version plus any older versions that have been set to keep
      +forever.
      +
      +**WARNING**: This flag may have some unexpected consequences.
      +
      +It is not recommended to set this flag in your config - the
      +recommended usage is using the flag form --drive-size-as-quota when
      +doing rclone ls/lsl/lsf/lsjson/etc only.
       
      +If you do use this flag for syncing (not recommended) then you will
      +need to use --ignore size also.
       
       Properties:
       
      -- Config:      directory_markers
      -- Env Var:     RCLONE_GCS_DIRECTORY_MARKERS
      +- Config:      size_as_quota
      +- Env Var:     RCLONE_DRIVE_SIZE_AS_QUOTA
       - Type:        bool
       - Default:     false
       
      -#### --gcs-no-check-bucket
      +#### --drive-v2-download-min-size
       
      -If set, don't attempt to check the bucket exists or create it.
      +If Object's are greater, use drive v2 API to download.
       
      -This can be useful when trying to minimise the number of transactions
      -rclone does if you know the bucket exists already.
      +Properties:
      +
      +- Config:      v2_download_min_size
      +- Env Var:     RCLONE_DRIVE_V2_DOWNLOAD_MIN_SIZE
      +- Type:        SizeSuffix
      +- Default:     off
      +
      +#### --drive-pacer-min-sleep
       
      +Minimum time to sleep between API calls.
       
       Properties:
       
      -- Config:      no_check_bucket
      -- Env Var:     RCLONE_GCS_NO_CHECK_BUCKET
      -- Type:        bool
      -- Default:     false
      +- Config:      pacer_min_sleep
      +- Env Var:     RCLONE_DRIVE_PACER_MIN_SLEEP
      +- Type:        Duration
      +- Default:     100ms
       
      -#### --gcs-decompress
      +#### --drive-pacer-burst
       
      -If set this will decompress gzip encoded objects.
      +Number of API calls to allow without sleeping.
       
      -It is possible to upload objects to GCS with "Content-Encoding: gzip"
      -set. Normally rclone will download these files as compressed objects.
      +Properties:
       
      -If this flag is set then rclone will decompress these files with
      -"Content-Encoding: gzip" as they are received. This means that rclone
      -can't check the size and hash but the file contents will be decompressed.
      +- Config:      pacer_burst
      +- Env Var:     RCLONE_DRIVE_PACER_BURST
      +- Type:        int
      +- Default:     100
       
      +#### --drive-server-side-across-configs
      +
      +Deprecated: use --server-side-across-configs instead.
      +
      +Allow server-side operations (e.g. copy) to work across different drive configs.
      +
      +This can be useful if you wish to do a server-side copy between two
      +different Google drives.  Note that this isn't enabled by default
      +because it isn't easy to tell if it will work between any two
      +configurations.
       
       Properties:
       
      -- Config:      decompress
      -- Env Var:     RCLONE_GCS_DECOMPRESS
      +- Config:      server_side_across_configs
      +- Env Var:     RCLONE_DRIVE_SERVER_SIDE_ACROSS_CONFIGS
       - Type:        bool
       - Default:     false
       
      -#### --gcs-endpoint
      +#### --drive-disable-http2
      +
      +Disable drive using http2.
      +
      +There is currently an unsolved issue with the google drive backend and
      +HTTP/2.  HTTP/2 is therefore disabled by default for the drive backend
      +but can be re-enabled here.  When the issue is solved this flag will
      +be removed.
      +
      +See: https://github.com/rclone/rclone/issues/3631
       
      -Endpoint for the service.
       
      -Leave blank normally.
       
       Properties:
       
      -- Config:      endpoint
      -- Env Var:     RCLONE_GCS_ENDPOINT
      -- Type:        string
      -- Required:    false
      +- Config:      disable_http2
      +- Env Var:     RCLONE_DRIVE_DISABLE_HTTP2
      +- Type:        bool
      +- Default:     true
       
      -#### --gcs-encoding
      +#### --drive-stop-on-upload-limit
       
      -The encoding for the backend.
      +Make upload limit errors be fatal.
      +
      +At the time of writing it is only possible to upload 750 GiB of data to
      +Google Drive a day (this is an undocumented limit). When this limit is
      +reached Google Drive produces a slightly different error message. When
      +this flag is set it causes these errors to be fatal.  These will stop
      +the in-progress sync.
      +
      +Note that this detection is relying on error message strings which
      +Google don't document so it may break in the future.
      +
      +See: https://github.com/rclone/rclone/issues/3857
       
      -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
       
       Properties:
       
      -- Config:      encoding
      -- Env Var:     RCLONE_GCS_ENCODING
      -- Type:        MultiEncoder
      -- Default:     Slash,CrLf,InvalidUtf8,Dot
      +- Config:      stop_on_upload_limit
      +- Env Var:     RCLONE_DRIVE_STOP_ON_UPLOAD_LIMIT
      +- Type:        bool
      +- Default:     false
       
      +#### --drive-stop-on-download-limit
       
      +Make download limit errors be fatal.
       
      -## Limitations
      +At the time of writing it is only possible to download 10 TiB of data from
      +Google Drive a day (this is an undocumented limit). When this limit is
      +reached Google Drive produces a slightly different error message. When
      +this flag is set it causes these errors to be fatal.  These will stop
      +the in-progress sync.
       
      -`rclone about` is not supported by the Google Cloud Storage backend. Backends without
      -this capability cannot determine free space for an rclone mount or
      -use policy `mfs` (most free space) as a member of an rclone union
      -remote.
      +Note that this detection is relying on error message strings which
      +Google don't document so it may break in the future.
       
      -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/)
       
      -#  Google Drive
      +Properties:
       
      -Paths are specified as `drive:path`
      +- Config:      stop_on_download_limit
      +- Env Var:     RCLONE_DRIVE_STOP_ON_DOWNLOAD_LIMIT
      +- Type:        bool
      +- Default:     false
       
      -Drive paths may be as deep as required, e.g. `drive:directory/subdirectory`.
      +#### --drive-skip-shortcuts
       
      -## Configuration
      +If set skip shortcut files.
       
      -The initial setup for drive involves getting a token from Google drive
      -which you need to do in your browser.  `rclone config` walks you
      -through it.
      +Normally rclone dereferences shortcut files making them appear as if
      +they are the original file (see [the shortcuts section](#shortcuts)).
      +If this flag is set then rclone will ignore shortcut files completely.
       
      -Here is an example of how to make a remote called `remote`.  First run:
       
      -     rclone config
      +Properties:
       
      -This will guide you through an interactive setup process:
      -
      -

      No remotes found, make a new one? n) New remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config n/r/c/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Google Drive  "drive" [snip] Storage> drive Google Application Client Id - leave blank normally. client_id> Google Application Client Secret - leave blank normally. client_secret> Scope that rclone should use when requesting access from drive. Choose a number from below, or type in your own value 1 / Full access all files, excluding Application Data Folder.  "drive" 2 / Read-only access to file metadata and file contents.  "drive.readonly" / Access to files created by rclone only. 3 | These are visible in the drive website. | File authorization is revoked when the user deauthorizes the app.  "drive.file" / Allows read and write access to the Application Data folder. 4 | This is not visible in the drive website.  "drive.appfolder" / Allows read-only access to file metadata but 5 | does not allow any access to read or download file content.  "drive.metadata.readonly" scope> 1 Service Account Credentials JSON file path - needed only if you want use SA instead of interactive login. service_account_file> Remote config Use web browser to automatically authenticate rclone with remote? * Say Y if the machine running rclone has a web browser you can use * Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N. 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 Configure this as a Shared Drive (Team Drive)? y) Yes n) No y/n> n -------------------- [remote] client_id = client_secret = scope = drive root_folder_id = service_account_file = token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2014-03-16T13:57:58.955387075Z"} -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

      -
      
      -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a
      -machine with no Internet browser available.
      +- Config:      skip_shortcuts
      +- Env Var:     RCLONE_DRIVE_SKIP_SHORTCUTS
      +- Type:        bool
      +- Default:     false
       
      -Note that rclone runs a webserver on your local machine to collect the
      -token as returned from Google if using web browser to automatically 
      -authenticate. This only
      -runs from the moment it opens your browser to the moment you get back
      -the verification code.  This is on `http://127.0.0.1:53682/` and it
      -may require you to unblock it temporarily if you are running a host
      -firewall, or use manual mode.
      +#### --drive-skip-dangling-shortcuts
       
      -You can then use it like this,
      +If set skip dangling shortcut files.
       
      -List directories in top level of your drive
      +If this is set then rclone will not show any dangling shortcuts in listings.
       
      -    rclone lsd remote:
       
      -List all the files in your drive
      +Properties:
       
      -    rclone ls remote:
      +- Config:      skip_dangling_shortcuts
      +- Env Var:     RCLONE_DRIVE_SKIP_DANGLING_SHORTCUTS
      +- Type:        bool
      +- Default:     false
       
      -To copy a local directory to a drive directory called backup
      +#### --drive-resource-key
       
      -    rclone copy /home/source remote:backup
      +Resource key for accessing a link-shared file.
       
      -### Scopes
      +If you need to access files shared with a link like this
       
      -Rclone allows you to select which scope you would like for rclone to
      -use.  This changes what type of token is granted to rclone.  [The
      -scopes are defined
      -here](https://developers.google.com/drive/v3/web/about-auth).
      +    https://drive.google.com/drive/folders/XXX?resourcekey=YYY&usp=sharing
       
      -The scope are
      +Then you will need to use the first part "XXX" as the "root_folder_id"
      +and the second part "YYY" as the "resource_key" otherwise you will get
      +404 not found errors when trying to access the directory.
       
      -#### drive
      +See: https://developers.google.com/drive/api/guides/resource-keys
       
      -This is the default scope and allows full access to all files, except
      -for the Application Data Folder (see below).
      +This resource key requirement only applies to a subset of old files.
       
      -Choose this one if you aren't sure.
      +Note also that opening the folder once in the web interface (with the
      +user you've authenticated rclone with) seems to be enough so that the
      +resource key is not needed.
       
      -#### drive.readonly
       
      -This allows read only access to all files.  Files may be listed and
      -downloaded but not uploaded, renamed or deleted.
      +Properties:
       
      -#### drive.file
      +- Config:      resource_key
      +- Env Var:     RCLONE_DRIVE_RESOURCE_KEY
      +- Type:        string
      +- Required:    false
       
      -With this scope rclone can read/view/modify only those files and
      -folders it creates.
      +#### --drive-fast-list-bug-fix
       
      -So if you uploaded files to drive via the web interface (or any other
      -means) they will not be visible to rclone.
      +Work around a bug in Google Drive listing.
       
      -This can be useful if you are using rclone to backup data and you want
      -to be sure confidential data on your drive is not visible to rclone.
      +Normally rclone will work around a bug in Google Drive when using
      +--fast-list (ListR) where the search "(A in parents) or (B in
      +parents)" returns nothing sometimes. See #3114, #4289 and
      +https://issuetracker.google.com/issues/149522397
       
      -Files created with this scope are visible in the web interface.
      +Rclone detects this by finding no items in more than one directory
      +when listing and retries them as lists of individual directories.
       
      -#### drive.appfolder
      +This means that if you have a lot of empty directories rclone will end
      +up listing them all individually and this can take many more API
      +calls.
       
      -This gives rclone its own private area to store files.  Rclone will
      -not be able to see any other files on your drive and you won't be able
      -to see rclone's files from the web interface either.
      +This flag allows the work-around to be disabled. This is **not**
      +recommended in normal use - only if you have a particular case you are
      +having trouble with like many empty directories.
       
      -#### drive.metadata.readonly
       
      -This allows read only access to file names only.  It does not allow
      -rclone to download or upload data, or rename or delete files or
      -directories.
      +Properties:
       
      -### Root folder ID
      +- Config:      fast_list_bug_fix
      +- Env Var:     RCLONE_DRIVE_FAST_LIST_BUG_FIX
      +- Type:        bool
      +- Default:     true
       
      -This option has been moved to the advanced section. You can set the `root_folder_id` for rclone.  This is the directory
      -(identified by its `Folder ID`) that rclone considers to be the root
      -of your drive.
      +#### --drive-metadata-owner
       
      -Normally you will leave this blank and rclone will determine the
      -correct root to use itself.
      +Control whether owner should be read or written in metadata.
       
      -However you can set this to restrict rclone to a specific folder
      -hierarchy or to access data within the "Computers" tab on the drive
      -web interface (where files from Google's Backup and Sync desktop
      -program go).
      +Owner is a standard part of the file metadata so is easy to read. But it
      +isn't always desirable to set the owner from the metadata.
       
      -In order to do this you will have to find the `Folder ID` of the
      -directory you wish rclone to display.  This will be the last segment
      -of the URL when you open the relevant folder in the drive web
      -interface.
      +Note that you can't set the owner on Shared Drives, and that setting
      +ownership will generate an email to the new owner (this can't be
      +disabled), and you can't transfer ownership to someone outside your
      +organization.
       
      -So if the folder you want rclone to use has a URL which looks like
      -`https://drive.google.com/drive/folders/1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh`
      -in the browser, then you use `1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh` as
      -the `root_folder_id` in the config.
       
      -**NB** folders under the "Computers" tab seem to be read only (drive
      -gives a 500 error) when using rclone.
      +Properties:
       
      -There doesn't appear to be an API to discover the folder IDs of the
      -"Computers" tab - please contact us if you know otherwise!
      +- Config:      metadata_owner
      +- Env Var:     RCLONE_DRIVE_METADATA_OWNER
      +- Type:        Bits
      +- Default:     read
      +- Examples:
      +    - "off"
      +        - Do not read or write the value
      +    - "read"
      +        - Read the value only
      +    - "write"
      +        - Write the value only
      +    - "read,write"
      +        - Read and Write the value.
       
      -Note also that rclone can't access any data under the "Backups" tab on
      -the google drive web interface yet.
      +#### --drive-metadata-permissions
       
      -### Service Account support
      +Control whether permissions should be read or written in metadata.
       
      -You can set up rclone with Google Drive in an unattended mode,
      -i.e. not tied to a specific end-user Google account. This is useful
      -when you want to synchronise files onto machines that don't have
      -actively logged-in users, for example build machines.
      +Reading permissions metadata from files can be done quickly, but it
      +isn't always desirable to set the permissions from the metadata.
       
      -To use a Service Account instead of OAuth2 token flow, enter the path
      -to your Service Account credentials at the `service_account_file`
      -prompt during `rclone config` and rclone won't use the browser based
      -authentication flow. If you'd rather stuff the contents of the
      -credentials file into the rclone config file, you can set
      -`service_account_credentials` with the actual contents of the file
      -instead, or set the equivalent environment variable.
      +Note that rclone drops any inherited permissions on Shared Drives and
      +any owner permission on My Drives as these are duplicated in the owner
      +metadata.
       
      -#### Use case - Google Apps/G-suite account and individual Drive
       
      -Let's say that you are the administrator of a Google Apps (old) or
      -G-suite account.
      -The goal is to store data on an individual's Drive account, who IS
      -a member of the domain.
      -We'll call the domain **example.com**, and the user
      -**foo@example.com**.
      +Properties:
       
      -There's a few steps we need to go through to accomplish this:
      +- Config:      metadata_permissions
      +- Env Var:     RCLONE_DRIVE_METADATA_PERMISSIONS
      +- Type:        Bits
      +- Default:     off
      +- Examples:
      +    - "off"
      +        - Do not read or write the value
      +    - "read"
      +        - Read the value only
      +    - "write"
      +        - Write the value only
      +    - "read,write"
      +        - Read and Write the value.
       
      -##### 1. Create a service account for example.com
      -  - To create a service account and obtain its credentials, go to the
      -[Google Developer Console](https://console.developers.google.com).
      -  - You must have a project - create one if you don't.
      -  - Then go to "IAM & admin" -> "Service Accounts".
      -  - Use the "Create Service Account" button. Fill in "Service account name"
      -and "Service account ID" with something that identifies your client.
      -  - Select "Create And Continue". Step 2 and 3 are optional.
      -  - These credentials are what rclone will use for authentication.
      -If you ever need to remove access, press the "Delete service
      -account key" button.
      +#### --drive-metadata-labels
      +
      +Control whether labels should be read or written in metadata.
      +
      +Reading labels metadata from files takes an extra API transaction and
      +will slow down listings. It isn't always desirable to set the labels
      +from the metadata.
      +
      +The format of labels is documented in the drive API documentation at
      +https://developers.google.com/drive/api/reference/rest/v3/Label -
      +rclone just provides a JSON dump of this format.
       
      -##### 2. Allowing API access to example.com Google Drive
      -  - Go to example.com's admin console
      -  - Go into "Security" (or use the search bar)
      -  - Select "Show more" and then "Advanced settings"
      -  - Select "Manage API client access" in the "Authentication" section
      -  - In the "Client Name" field enter the service account's
      -"Client ID" - this can be found in the Developer Console under
      -"IAM & Admin" -> "Service Accounts", then "View Client ID" for
      -the newly created service account.
      -It is a ~21 character numerical string.
      -  - In the next field, "One or More API Scopes", enter
      -`https://www.googleapis.com/auth/drive`
      -to grant access to Google Drive specifically.
      +When setting labels, the label and fields must already exist - rclone
      +will not create them. This means that if you are transferring labels
      +from two different accounts you will have to create the labels in
      +advance and use the metadata mapper to translate the IDs between the
      +two accounts.
       
      -##### 3. Configure rclone, assuming a new install
      -
      -

      rclone config

      -

      n/s/q> n # New name>gdrive # Gdrive is an example name Storage> # Select the number shown for Google Drive client_id> # Can be left blank client_secret> # Can be left blank scope> # Select your scope, 1 for example root_folder_id> # Can be left blank service_account_file> /home/foo/myJSONfile.json # This is where the JSON file goes! y/n> # Auto config, n

      -
      
      -##### 4. Verify that it's working
      -  - `rclone -v --drive-impersonate foo@example.com lsf gdrive:backup`
      -  - The arguments do:
      -    - `-v` - verbose logging
      -    - `--drive-impersonate foo@example.com` - this is what does
      -the magic, pretending to be user foo.
      -    - `lsf` - list files in a parsing friendly way
      -    - `gdrive:backup` - use the remote called gdrive, work in
      -the folder named backup.
       
      -Note: in case you configured a specific root folder on gdrive and rclone is unable to access the contents of that folder when using `--drive-impersonate`, do this instead:
      -  - in the gdrive web interface, share your root folder with the user/email of the new Service Account you created/selected at step #1
      -  - use rclone without specifying the `--drive-impersonate` option, like this:
      -        `rclone -v lsf gdrive:backup`
      +Properties:
       
      +- Config:      metadata_labels
      +- Env Var:     RCLONE_DRIVE_METADATA_LABELS
      +- Type:        Bits
      +- Default:     off
      +- Examples:
      +    - "off"
      +        - Do not read or write the value
      +    - "read"
      +        - Read the value only
      +    - "write"
      +        - Write the value only
      +    - "read,write"
      +        - Read and Write the value.
       
      -### Shared drives (team drives)
      +#### --drive-encoding
       
      -If you want to configure the remote to point to a Google Shared Drive
      -(previously known as Team Drives) then answer `y` to the question
      -`Configure this as a Shared Drive (Team Drive)?`.
      +The encoding for the backend.
       
      -This will fetch the list of Shared Drives from google and allow you to
      -configure which one you want to use. You can also type in a Shared
      -Drive ID if you prefer.
      +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
       
      -For example:
      -
      -

      Configure this as a Shared Drive (Team Drive)? y) Yes n) No y/n> y Fetching Shared Drive list... Choose a number from below, or type in your own value 1 / Rclone Test  "xxxxxxxxxxxxxxxxxxxx" 2 / Rclone Test 2  "yyyyyyyyyyyyyyyyyyyy" 3 / Rclone Test 3  "zzzzzzzzzzzzzzzzzzzz" Enter a Shared Drive ID> 1 -------------------- [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} team_drive = xxxxxxxxxxxxxxxxxxxx -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

      -
      
      -### --fast-list
      +Properties:
       
      -This remote supports `--fast-list` which allows you to use fewer
      -transactions in exchange for more memory. See the [rclone
      -docs](https://rclone.org/docs/#fast-list) for more details.
      +- Config:      encoding
      +- Env Var:     RCLONE_DRIVE_ENCODING
      +- Type:        Encoding
      +- Default:     InvalidUtf8
       
      -It does this by combining multiple `list` calls into a single API request.
      +#### --drive-env-auth
       
      -This works by combining many `'%s' in parents` filters into one expression.
      -To list the contents of directories a, b and c, the following requests will be send by the regular `List` function:
      -

      trashed=false and 'a' in parents trashed=false and 'b' in parents trashed=false and 'c' in parents

      -
      These can now be combined into a single request:
      -

      trashed=false and ('a' in parents or 'b' in parents or 'c' in parents)

      -
      
      -The implementation of `ListR` will put up to 50 `parents` filters into one request.
      -It will  use the `--checkers` value to specify the number of requests to run in parallel.
      +Get IAM credentials from runtime (environment variables or instance meta data if no env vars).
       
      -In tests, these batch requests were up to 20x faster than the regular method.
      -Running the following command against different sized folders gives:
      -

      rclone lsjson -vv -R --checkers=6 gdrive:folder

      -
      
      -small folder (220 directories, 700 files):
      +Only applies if service_account_file and service_account_credentials is blank.
       
      -- without `--fast-list`: 38s
      -- with `--fast-list`: 10s
      +Properties:
       
      -large folder (10600 directories, 39000 files):
      +- Config:      env_auth
      +- Env Var:     RCLONE_DRIVE_ENV_AUTH
      +- Type:        bool
      +- Default:     false
      +- Examples:
      +    - "false"
      +        - Enter credentials in the next step.
      +    - "true"
      +        - Get GCP IAM credentials from the environment (env vars or IAM).
       
      -- without `--fast-list`: 22:05 min
      -- with `--fast-list`: 58s
      +### Metadata
       
      -### Modified time
      +User metadata is stored in the properties field of the drive object.
       
      -Google drive stores modification times accurate to 1 ms.
      +Here are the possible system metadata items for the drive backend.
       
      -### Restricted filename characters
      +| Name | Help | Type | Example | Read Only |
      +|------|------|------|---------|-----------|
      +| btime | Time of file birth (creation) with mS accuracy. Note that this is only writable on fresh uploads - it can't be written for updates. | RFC 3339 | 2006-01-02T15:04:05.999Z07:00 | N |
      +| content-type | The MIME type of the file. | string | text/plain | N |
      +| copy-requires-writer-permission | Whether the options to copy, print, or download this file, should be disabled for readers and commenters. | boolean | true | N |
      +| description | A short description of the file. | string | Contract for signing | N |
      +| folder-color-rgb | The color for a folder or a shortcut to a folder as an RGB hex string. | string | 881133 | N |
      +| labels | Labels attached to this file in a JSON dump of Googled drive format. Enable with --drive-metadata-labels. | JSON | [] | N |
      +| mtime | Time of last modification with mS accuracy. | RFC 3339 | 2006-01-02T15:04:05.999Z07:00 | N |
      +| owner | The owner of the file. Usually an email address. Enable with --drive-metadata-owner. | string | user@example.com | N |
      +| permissions | Permissions in a JSON dump of Google drive format. On shared drives these will only be present if they aren't inherited. Enable with --drive-metadata-permissions. | JSON | {} | N |
      +| starred | Whether the user has starred the file. | boolean | false | N |
      +| viewed-by-me | Whether the file has been viewed by this user. | boolean | true | **Y** |
      +| writers-can-share | Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives. | boolean | false | N |
       
      -Only Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8),
      -as they can't be used in JSON strings.
      +See the [metadata](https://rclone.org/docs/#metadata) docs for more info.
       
      -In contrast to other backends, `/` can also be used in names and `.`
      -or `..` are valid names.
      +## Backend commands
       
      -### Revisions
      +Here are the commands specific to the drive backend.
       
      -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.
      +Run them with
       
      -Revisions follow the standard google policy which at time of writing
      -was
      +    rclone backend COMMAND remote:
       
      -  * They are deleted after 30 days or 100 revisions (whatever comes first).
      -  * They do not count towards a user storage quota.
      +The help below will explain what arguments each command takes.
       
      -### Deleting files
      +See the [backend](https://rclone.org/commands/rclone_backend/) command for more
      +info on how to pass options and arguments.
       
      -By default rclone will send all files to the trash when deleting
      -files.  If deleting them permanently is required then use the
      -`--drive-use-trash=false` flag, or set the equivalent environment
      -variable.
      +These can be run on a running backend using the rc command
      +[backend/command](https://rclone.org/rc/#backend-command).
       
      -### Shortcuts
      +### get
       
      -In March 2020 Google introduced a new feature in Google Drive called
      -[drive shortcuts](https://support.google.com/drive/answer/9700156)
      -([API](https://developers.google.com/drive/api/v3/shortcuts)). These
      -will (by September 2020) [replace the ability for files or folders to
      -be in multiple folders at once](https://cloud.google.com/blog/products/g-suite/simplifying-google-drives-folder-structure-and-sharing-models).
      +Get command for fetching the drive config parameters
       
      -Shortcuts are files that link to other files on Google Drive somewhat
      -like a symlink in unix, except they point to the underlying file data
      -(e.g. the inode in unix terms) so they don't break if the source is
      -renamed or moved about.
      +    rclone backend get remote: [options] [<arguments>+]
       
      -By default rclone treats these as follows.
      +This is a get command which will be used to fetch the various drive config parameters
       
      -For shortcuts pointing to files:
      +Usage Examples:
       
      -- When listing a file shortcut appears as the destination file.
      -- When downloading the contents of the destination file is downloaded.
      -- When updating shortcut file with a non shortcut file, the shortcut is removed then a new file is uploaded in place of the shortcut.
      -- When server-side moving (renaming) the shortcut is renamed, not the destination file.
      -- When server-side copying the shortcut is copied, not the contents of the shortcut. (unless `--drive-copy-shortcut-content` is in use in which case the contents of the shortcut gets copied).
      -- When deleting the shortcut is deleted not the linked file.
      -- When setting the modification time, the modification time of the linked file will be set.
      +    rclone backend get drive: [-o service_account_file] [-o chunk_size]
      +    rclone rc backend/command command=get fs=drive: [-o service_account_file] [-o chunk_size]
       
      -For shortcuts pointing to folders:
       
      -- When listing the shortcut appears as a folder and that folder will contain the contents of the linked folder appear (including any sub folders)
      -- When downloading the contents of the linked folder and sub contents are downloaded
      -- When uploading to a shortcut folder the file will be placed in the linked folder
      -- When server-side moving (renaming) the shortcut is renamed, not the destination folder
      -- When server-side copying the contents of the linked folder is copied, not the shortcut.
      -- When deleting with `rclone rmdir` or `rclone purge` the shortcut is deleted not the linked folder.
      -- **NB** When deleting with `rclone remove` or `rclone mount` the contents of the linked folder will be deleted.
      +Options:
       
      -The [rclone backend](https://rclone.org/commands/rclone_backend/) command can be used to create shortcuts.  
      +- "chunk_size": show the current upload chunk size
      +- "service_account_file": show the current service account file
       
      -Shortcuts can be completely ignored with the `--drive-skip-shortcuts` flag
      -or the corresponding `skip_shortcuts` configuration setting.
      +### set
       
      -### Emptying trash
      +Set command for updating the drive config parameters
       
      -If you wish to empty your trash you can use the `rclone cleanup remote:`
      -command which will permanently delete all your trashed files. This command
      -does not take any path arguments.
      +    rclone backend set remote: [options] [<arguments>+]
       
      -Note that Google Drive takes some time (minutes to days) to empty the
      -trash even though the command returns within a few seconds.  No output
      -is echoed, so there will be no confirmation even using -v or -vv.
      +This is a set command which will be used to update the various drive config parameters
       
      -### Quota information
      +Usage Examples:
       
      -To view your current quota you can use the `rclone about remote:`
      -command which will display your usage limit (quota), the usage in Google
      -Drive, the size of all files in the Trash and the space used by other
      -Google services such as Gmail. This command does not take any path
      -arguments.
      +    rclone backend set drive: [-o service_account_file=sa.json] [-o chunk_size=67108864]
      +    rclone rc backend/command command=set fs=drive: [-o service_account_file=sa.json] [-o chunk_size=67108864]
       
      -#### Import/Export of google documents
       
      -Google documents can be exported from and uploaded to Google Drive.
      +Options:
       
      -When rclone downloads a Google doc it chooses a format to download
      -depending upon the `--drive-export-formats` setting.
      -By default the export formats are `docx,xlsx,pptx,svg` which are a
      -sensible default for an editable document.
      +- "chunk_size": update the current upload chunk size
      +- "service_account_file": update the current service account file
       
      -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.
      +### shortcut
       
      -If you prefer an archive copy then you might use `--drive-export-formats
      -pdf`, or if you prefer openoffice/libreoffice formats you might use
      -`--drive-export-formats ods,odt,odp`.
      +Create shortcuts from files or directories
       
      -Note that rclone adds the extension to the google doc, so if it is
      -called `My Spreadsheet` on google docs, it will be exported as `My
      -Spreadsheet.xlsx` or `My Spreadsheet.pdf` etc.
      +    rclone backend shortcut remote: [options] [<arguments>+]
       
      -When importing files into Google Drive, rclone will convert all
      -files with an extension in `--drive-import-formats` to their
      -associated document type.
      -rclone will not convert any files by default, since the conversion
      -is lossy process.
      +This command creates shortcuts from files or directories.
       
      -The conversion must result in a file with the same extension when
      -the `--drive-export-formats` rules are applied to the uploaded document.
      +Usage:
       
      -Here are some examples for allowed and prohibited conversions.
      +    rclone backend shortcut drive: source_item destination_shortcut
      +    rclone backend shortcut drive: source_item -o target=drive2: destination_shortcut
       
      -| export-formats | import-formats | Upload Ext | Document Ext | Allowed |
      -| -------------- | -------------- | ---------- | ------------ | ------- |
      -| odt | odt | odt | odt | Yes |
      -| odt | docx,odt | odt | odt | Yes |
      -|  | docx | docx | docx | Yes |
      -|  | odt | odt | docx | No |
      -| odt,docx | docx,odt | docx | odt | No |
      -| docx,odt | docx,odt | docx | docx | Yes |
      -| docx,odt | docx,odt | odt | docx | No |
      +In the first example this creates a shortcut from the "source_item"
      +which can be a file or a directory to the "destination_shortcut". The
      +"source_item" and the "destination_shortcut" should be relative paths
      +from "drive:"
       
      -This limitation can be disabled by specifying `--drive-allow-import-name-change`.
      -When using this flag, rclone can convert multiple files types resulting
      -in the same document type at once, e.g. with `--drive-import-formats docx,odt,txt`,
      -all files having these extension would result in a document represented as a docx file.
      -This brings the additional risk of overwriting a document, if multiple files
      -have the same stem. Many rclone operations will not handle this name change
      -in any way. They assume an equal name when copying files and might copy the
      -file again or delete them when the name changes. 
      +In the second example this creates a shortcut from the "source_item"
      +relative to "drive:" to the "destination_shortcut" relative to
      +"drive2:". This may fail with a permission error if the user
      +authenticated with "drive2:" can't read files from "drive:".
       
      -Here are the possible export extensions with their corresponding mime types.
      -Most of these can also be used for importing, but there more that are not
      -listed here. Some of these additional ones might only be available when
      -the operating system provides the correct MIME type entries.
       
      -This list can be changed by Google Drive at any time and might not
      -represent the currently available conversions.
      +Options:
       
      -| Extension | Mime Type | Description |
      -| --------- |-----------| ------------|
      -| bmp  | image/bmp | Windows Bitmap format |
      -| csv  | text/csv | Standard CSV format for Spreadsheets |
      -| doc  | application/msword | Classic Word file |
      -| docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document | Microsoft Office Document |
      -| epub | application/epub+zip | E-book format |
      -| html | text/html | An HTML Document |
      -| jpg  | image/jpeg | A JPEG Image File |
      -| json | application/vnd.google-apps.script+json | JSON Text Format for Google Apps scripts |
      -| odp  | application/vnd.oasis.opendocument.presentation | Openoffice Presentation |
      -| ods  | application/vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet |
      -| ods  | application/x-vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet |
      -| odt  | application/vnd.oasis.opendocument.text | Openoffice Document |
      -| pdf  | application/pdf | Adobe PDF Format |
      -| pjpeg | image/pjpeg | Progressive JPEG Image |
      -| png  | image/png | PNG Image Format|
      -| pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation | Microsoft Office Powerpoint |
      -| rtf  | application/rtf | Rich Text Format |
      -| svg  | image/svg+xml | Scalable Vector Graphics Format |
      -| tsv  | text/tab-separated-values | Standard TSV format for spreadsheets |
      -| txt  | text/plain | Plain Text |
      -| wmf  | application/x-msmetafile | Windows Meta File |
      -| xls  | application/vnd.ms-excel | Classic Excel file |
      -| xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | Microsoft Office Spreadsheet |
      -| zip  | application/zip | A ZIP file of HTML, Images CSS |
      +- "target": optional target remote for the shortcut destination
       
      -Google documents can also be exported as link files. These files will
      -open a browser window for the Google Docs website of that document
      -when opened. The link file extension has to be specified as a
      -`--drive-export-formats` parameter. They will match all available
      -Google Documents.
      +### drives
       
      -| Extension | Description | OS Support |
      -| --------- | ----------- | ---------- |
      -| desktop | freedesktop.org specified desktop entry | Linux |
      -| link.html | An HTML Document with a redirect | All |
      -| url | INI style link file | macOS, Windows |
      -| webloc | macOS specific XML format | macOS |
      +List the Shared Drives available to this account
       
      +    rclone backend drives remote: [options] [<arguments>+]
       
      -### Standard options
      +This command lists the Shared Drives (Team Drives) available to this
      +account.
       
      -Here are the Standard options specific to drive (Google Drive).
      +Usage:
       
      -#### --drive-client-id
      +    rclone backend [-o config] drives drive:
       
      -Google Application Client Id
      -Setting your own is recommended.
      -See https://rclone.org/drive/#making-your-own-client-id for how to create your own.
      -If you leave this blank, it will use an internal key which is low performance.
      +This will return a JSON list of objects like this
       
      -Properties:
      +    [
      +        {
      +            "id": "0ABCDEF-01234567890",
      +            "kind": "drive#teamDrive",
      +            "name": "My Drive"
      +        },
      +        {
      +            "id": "0ABCDEFabcdefghijkl",
      +            "kind": "drive#teamDrive",
      +            "name": "Test Drive"
      +        }
      +    ]
       
      -- Config:      client_id
      -- Env Var:     RCLONE_DRIVE_CLIENT_ID
      -- Type:        string
      -- Required:    false
      +With the -o config parameter it will output the list in a format
      +suitable for adding to a config file to make aliases for all the
      +drives found and a combined drive.
       
      -#### --drive-client-secret
      +    [My Drive]
      +    type = alias
      +    remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=:
       
      -OAuth Client Secret.
      +    [Test Drive]
      +    type = alias
      +    remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=:
       
      -Leave blank normally.
      +    [AllDrives]
      +    type = combine
      +    upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:"
       
      -Properties:
      +Adding this to the rclone config file will cause those team drives to
      +be accessible with the aliases shown. Any illegal characters will be
      +substituted with "_" and duplicate names will have numbers suffixed.
      +It will also add a remote called AllDrives which shows all the shared
      +drives combined into one directory tree.
       
      -- Config:      client_secret
      -- Env Var:     RCLONE_DRIVE_CLIENT_SECRET
      -- Type:        string
      -- Required:    false
       
      -#### --drive-scope
      +### untrash
       
      -Scope that rclone should use when requesting access from drive.
      +Untrash files and directories
       
      -Properties:
      +    rclone backend untrash remote: [options] [<arguments>+]
       
      -- Config:      scope
      -- Env Var:     RCLONE_DRIVE_SCOPE
      -- Type:        string
      -- Required:    false
      -- Examples:
      -    - "drive"
      -        - Full access all files, excluding Application Data Folder.
      -    - "drive.readonly"
      -        - Read-only access to file metadata and file contents.
      -    - "drive.file"
      -        - Access to files created by rclone only.
      -        - These are visible in the drive website.
      -        - File authorization is revoked when the user deauthorizes the app.
      -    - "drive.appfolder"
      -        - Allows read and write access to the Application Data folder.
      -        - This is not visible in the drive website.
      -    - "drive.metadata.readonly"
      -        - Allows read-only access to file metadata but
      -        - does not allow any access to read or download file content.
      +This command untrashes all the files and directories in the directory
      +passed in recursively.
       
      -#### --drive-service-account-file
      +Usage:
       
      -Service Account Credentials JSON file path.
      +This takes an optional directory to trash which make this easier to
      +use via the API.
       
      -Leave blank normally.
      -Needed only if you want use SA instead of interactive login.
      +    rclone backend untrash drive:directory
      +    rclone backend --interactive untrash drive:directory subdir
       
      -Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`.
      +Use the --interactive/-i or --dry-run flag to see what would be restored before restoring it.
       
      -Properties:
      +Result:
       
      -- Config:      service_account_file
      -- Env Var:     RCLONE_DRIVE_SERVICE_ACCOUNT_FILE
      -- Type:        string
      -- Required:    false
      +    {
      +        "Untrashed": 17,
      +        "Errors": 0
      +    }
       
      -#### --drive-alternate-export
       
      -Deprecated: No longer needed.
      +### copyid
       
      -Properties:
      +Copy files by ID
       
      -- Config:      alternate_export
      -- Env Var:     RCLONE_DRIVE_ALTERNATE_EXPORT
      -- Type:        bool
      -- Default:     false
      +    rclone backend copyid remote: [options] [<arguments>+]
       
      -### Advanced options
      +This command copies files by ID
       
      -Here are the Advanced options specific to drive (Google Drive).
      +Usage:
       
      -#### --drive-token
      +    rclone backend copyid drive: ID path
      +    rclone backend copyid drive: ID1 path1 ID2 path2
       
      -OAuth Access Token as a JSON blob.
      +It copies the drive file with ID given to the path (an rclone path which
      +will be passed internally to rclone copyto). The ID and path pairs can be
      +repeated.
       
      -Properties:
      +The path should end with a / to indicate copy the file as named to
      +this directory. If it doesn't end with a / then the last path
      +component will be used as the file name.
       
      -- Config:      token
      -- Env Var:     RCLONE_DRIVE_TOKEN
      -- Type:        string
      -- Required:    false
      +If the destination is a drive backend then server-side copying will be
      +attempted if possible.
       
      -#### --drive-auth-url
      +Use the --interactive/-i or --dry-run flag to see what would be copied before copying.
       
      -Auth server URL.
       
      -Leave blank to use the provider defaults.
      +### exportformats
       
      -Properties:
      +Dump the export formats for debug purposes
       
      -- Config:      auth_url
      -- Env Var:     RCLONE_DRIVE_AUTH_URL
      -- Type:        string
      -- Required:    false
      +    rclone backend exportformats remote: [options] [<arguments>+]
       
      -#### --drive-token-url
      +### importformats
       
      -Token server url.
      +Dump the import formats for debug purposes
       
      -Leave blank to use the provider defaults.
      +    rclone backend importformats remote: [options] [<arguments>+]
       
      -Properties:
       
      -- Config:      token_url
      -- Env Var:     RCLONE_DRIVE_TOKEN_URL
      -- Type:        string
      -- Required:    false
       
      -#### --drive-root-folder-id
      +## Limitations
       
      -ID of the root folder.
      -Leave blank normally.
      +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 MiB/s but lots of
      +small files can take a long time.
       
      -Fill in to access "Computers" folders (see docs), or for rclone to use
      -a non root folder as its starting point.
      +Server side copies are also subject to a separate rate limit. If you
      +see User rate limit exceeded errors, wait at least 24 hours and retry.
      +You can disable server-side copies with `--disable copy` to download
      +and upload the files if you prefer.
       
      +### Limitations of Google Docs
       
      -Properties:
      +Google docs will appear as size -1 in `rclone ls`, `rclone ncdu` etc,
      +and as size 0 in anything which uses the VFS layer, e.g. `rclone mount`
      +and `rclone serve`. When calculating directory totals, e.g. in
      +`rclone size` and `rclone ncdu`, they will be counted in as empty
      +files.
       
      -- Config:      root_folder_id
      -- Env Var:     RCLONE_DRIVE_ROOT_FOLDER_ID
      -- Type:        string
      -- Required:    false
      +This is because rclone can't find out the size of the Google docs
      +without downloading them.
       
      -#### --drive-service-account-credentials
      +Google docs will transfer correctly with `rclone sync`, `rclone copy`
      +etc as rclone knows to ignore the size when doing the transfer.
       
      -Service Account Credentials JSON blob.
      +However an unfortunate consequence of this is that you may not be able
      +to download Google docs using `rclone mount`. If it doesn't work you
      +will get a 0 sized file.  If you try again the doc may gain its
      +correct size and be downloadable. Whether it will work on not depends
      +on the application accessing the mount and the OS you are running -
      +experiment to find out if it does work for you!
       
      -Leave blank normally.
      -Needed only if you want use SA instead of interactive login.
      +### Duplicated files
       
      -Properties:
      +Sometimes, for no reason I've been able to track down, drive will
      +duplicate a file that rclone uploads.  Drive unlike all the other
      +remotes can have duplicated files.
       
      -- Config:      service_account_credentials
      -- Env Var:     RCLONE_DRIVE_SERVICE_ACCOUNT_CREDENTIALS
      -- Type:        string
      -- Required:    false
      +Duplicated files cause problems with the syncing and you will see
      +messages in the log about duplicates.
       
      -#### --drive-team-drive
      +Use `rclone dedupe` to fix duplicated files.
      +
      +Note that this isn't just a problem with rclone, even Google Photos on
      +Android duplicates files on drive sometimes.
      +
      +### Rclone appears to be re-copying files it shouldn't
      +
      +The most likely cause of this is the duplicated file issue above - run
      +`rclone dedupe` and check your logs for duplicate object or directory
      +messages.
      +
      +This can also be caused by a delay/caching on google drive's end when
      +comparing directory listings. Specifically with team drives used in
      +combination with --fast-list. Files that were uploaded recently may
      +not appear on the directory list sent to rclone when using --fast-list.
      +
      +Waiting a moderate period of time between attempts (estimated to be
      +approximately 1 hour) and/or not using --fast-list both seem to be
      +effective in preventing the problem.
       
      -ID of the Shared Drive (Team Drive).
      +### SHA1 or SHA256 hashes may be missing
       
      -Properties:
      +All files have MD5 hashes, but a small fraction of files uploaded may
      +not have SHA1 or SHA256 hashes especially if they were uploaded before 2018.
       
      -- Config:      team_drive
      -- Env Var:     RCLONE_DRIVE_TEAM_DRIVE
      -- Type:        string
      -- Required:    false
      +## Making your own client_id
       
      -#### --drive-auth-owner-only
      +When you use rclone with Google drive in its default configuration you
      +are using rclone's client_id.  This is shared between all the rclone
      +users.  There is a global rate limit on the number of queries per
      +second that each client_id can do set by Google.  rclone already has a
      +high quota and I will continue to make sure it is high enough by
      +contacting Google.
       
      -Only consider files owned by the authenticated user.
      +It is strongly recommended to use your own client ID as the default rclone ID is heavily used. If you have multiple services running, it is recommended to use an API key for each service. The default Google quota is 10 transactions per second so it is recommended to stay under that number as if you use more than that, it will cause rclone to rate limit and make things slower.
       
      -Properties:
      +Here is how to create your own Google Drive client ID for rclone:
       
      -- Config:      auth_owner_only
      -- Env Var:     RCLONE_DRIVE_AUTH_OWNER_ONLY
      -- Type:        bool
      -- Default:     false
      +1. Log into the [Google API
      +Console](https://console.developers.google.com/) with your Google
      +account. It doesn't matter what Google account you use. (It need not
      +be the same account as the Google Drive you want to access)
       
      -#### --drive-use-trash
      +2. Select a project or create a new project.
       
      -Send files to the trash instead of deleting permanently.
      +3. Under "ENABLE APIS AND SERVICES" search for "Drive", and enable the
      +"Google Drive API".
       
      -Defaults to true, namely sending files to the trash.
      -Use `--drive-use-trash=false` to delete files permanently instead.
      +4. Click "Credentials" in the left-side panel (not "Create
      +credentials", which opens the wizard).
       
      -Properties:
      +5. If you already configured an "Oauth Consent Screen", then skip
      +to the next step; if not, click on "CONFIGURE CONSENT SCREEN" button 
      +(near the top right corner of the right panel), then select "External"
      +and click on "CREATE"; on the next screen, enter an "Application name"
      +("rclone" is OK); enter "User Support Email" (your own email is OK); 
      +enter "Developer Contact Email" (your own email is OK); then click on
      +"Save" (all other data is optional). You will also have to add some scopes,
      +including `.../auth/docs` and `.../auth/drive` in order to be able to edit,
      +create and delete files with RClone. You may also want to include the
      +`../auth/drive.metadata.readonly` scope. After adding scopes, click
      +"Save and continue" to add test users. Be sure to add your own account to
      +the test users. Once you've added yourself as a test user and saved the
      +changes, click again on "Credentials" on the left panel to go back to
      +the "Credentials" screen.
       
      -- Config:      use_trash
      -- Env Var:     RCLONE_DRIVE_USE_TRASH
      -- Type:        bool
      -- Default:     true
      +   (PS: if you are a GSuite user, you could also select "Internal" instead
      +of "External" above, but this will restrict API use to Google Workspace 
      +users in your organisation). 
       
      -#### --drive-copy-shortcut-content
      +6.  Click on the "+ CREATE CREDENTIALS" button at the top of the screen,
      +then select "OAuth client ID".
       
      -Server side copy contents of shortcuts instead of the shortcut.
      +7. Choose an application type of "Desktop app" and click "Create". (the default name is fine)
       
      -When doing server side copies, normally rclone will copy shortcuts as
      -shortcuts.
      +8. It will show you a client ID and client secret. Make a note of these.
      +   
      +   (If you selected "External" at Step 5 continue to Step 9. 
      +   If you chose "Internal" you don't need to publish and can skip straight to
      +   Step 10 but your destination drive must be part of the same Google Workspace.)
       
      -If this flag is used then rclone will copy the contents of shortcuts
      -rather than shortcuts themselves when doing server side copies.
      +9. Go to "Oauth consent screen" and then click "PUBLISH APP" button and confirm.
      +   You will also want to add yourself as a test user.
       
      -Properties:
      +10. Provide the noted client ID and client secret to rclone.
       
      -- Config:      copy_shortcut_content
      -- Env Var:     RCLONE_DRIVE_COPY_SHORTCUT_CONTENT
      -- Type:        bool
      -- Default:     false
      +Be aware that, due to the "enhanced security" recently introduced by
      +Google, you are theoretically expected to "submit your app for verification"
      +and then wait a few weeks(!) for their response; in practice, you can go right
      +ahead and use the client ID and client secret with rclone, the only issue will
      +be a very scary confirmation screen shown when you connect via your browser 
      +for rclone to be able to get its token-id (but as this only happens during 
      +the remote configuration, it's not such a big deal). Keeping the application in
      +"Testing" will work as well, but the limitation is that any grants will expire
      +after a week, which can be annoying to refresh constantly. If, for whatever
      +reason, a short grant time is not a problem, then keeping the application in
      +testing mode would also be sufficient.
       
      -#### --drive-skip-gdocs
      +(Thanks to @balazer on github for these instructions.)
       
      -Skip google documents in all listings.
      +Sometimes, creation of an OAuth consent in Google API Console fails due to an error message
      +“The request failed because changes to one of the field of the resource is not supported”.
      +As a convenient workaround, the necessary Google Drive API key can be created on the
      +[Python Quickstart](https://developers.google.com/drive/api/v3/quickstart/python) page.
      +Just push the Enable the Drive API button to receive the Client ID and Secret.
      +Note that it will automatically create a new project in the API Console.
       
      -If given, gdocs practically become invisible to rclone.
      +#  Google Photos
       
      -Properties:
      +The rclone backend for [Google Photos](https://www.google.com/photos/about/) is
      +a specialized backend for transferring photos and videos to and from
      +Google Photos.
       
      -- Config:      skip_gdocs
      -- Env Var:     RCLONE_DRIVE_SKIP_GDOCS
      -- Type:        bool
      -- Default:     false
      +**NB** The Google Photos API which rclone uses has quite a few
      +limitations, so please read the [limitations section](#limitations)
      +carefully to make sure it is suitable for your use.
       
      -#### --drive-skip-checksum-gphotos
      +## Configuration
       
      -Skip MD5 checksum on Google photos and videos only.
      +The initial setup for google cloud storage involves getting a token from Google Photos
      +which you need to do in your browser.  `rclone config` walks you
      +through it.
       
      -Use this if you get checksum errors when transferring Google photos or
      -videos.
      +Here is an example of how to make a remote called `remote`.  First run:
       
      -Setting this flag will cause Google photos and videos to return a
      -blank MD5 checksum.
      +     rclone config
       
      -Google photos are identified by being in the "photos" space.
      +This will guide you through an interactive setup process:
      +
      +

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / Google Photos  "google photos" [snip] Storage> google photos ** See help for google photos backend at: https://rclone.org/googlephotos/ **

      +

      Google Application Client Id Leave blank normally. Enter a string value. Press Enter for the default (""). client_id> Google Application Client Secret Leave blank normally. Enter a string value. Press Enter for the default (""). client_secret> Set to make the Google Photos backend read only.

      +

      If you choose read only then rclone will only request read only access to your photos, otherwise rclone will request full access. Enter a boolean value (true or false). Press Enter for the default ("false"). read_only> Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config Use web browser to automatically authenticate rclone with remote? * Say Y if the machine running rclone has a web browser you can use * Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N. 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

      +

      *** IMPORTANT: All media items uploaded to Google Photos with rclone *** are stored in full resolution at original quality. These uploads *** will count towards storage in your Google Account.

      + +++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      [remote] type = google photos token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2019-06-28T17:38:04.644930156+01:00"}
      y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y ```
      See the remote setup docs for how to set it up on a machine with no Internet browser available.
      Note that rclone runs a webserver on your local machine to collect the token as returned from Google if using web browser to automatically authenticate. This only runs from the moment it opens your browser to the moment you get back the verification code. This is on http://127.0.0.1:53682/ and this may require you to unblock it temporarily if you are running a host firewall, or use manual mode.
      This remote is called remote and can now be used like this
      See all the albums in your photos
      rclone lsd remote:album
      Make a new album
      rclone mkdir remote:album/newAlbum
      List the contents of an album
      rclone ls remote:album/newAlbum
      Sync /home/local/images to the Google Photos, removing any excess files in the album.
      rclone sync --interactive /home/local/image remote:album/newAlbum
      ### Layout
      As Google Photos is not a general purpose cloud storage system, the backend is laid out to help you navigate it.
      The directories under media show different ways of categorizing the media. Each file will appear multiple times. So if you want to make a backup of your google photos you might choose to backup remote:media/by-month. (NB remote:media/by-day is rather slow at the moment so avoid for syncing.)
      Note that all your photos and videos will appear somewhere under media, but they may not appear under album unless you've put them into albums.
      / - upload - file1.jpg - file2.jpg - ... - media - all - file1.jpg - file2.jpg - ... - by-year - 2000 - file1.jpg - ... - 2001 - file2.jpg - ... - ... - by-month - 2000 - 2000-01 - file1.jpg - ... - 2000-02 - file2.jpg - ... - ... - by-day - 2000 - 2000-01-01 - file1.jpg - ... - 2000-01-02 - file2.jpg - ... - ... - album - album name - album name/sub - shared-album - album name - album name/sub - feature - favorites - file1.jpg - file2.jpg
      There are two writable parts of the tree, the upload directory and sub directories of the album directory.
      The upload directory is for uploading files you don't want to put into albums. This will be empty to start with and will contain the files you've uploaded for one rclone session only, becoming empty again when you restart rclone. The use case for this would be if you have a load of files you just want to once off dump into Google Photos. For repeated syncing, uploading to album will work better.
      Directories within the album directory are also writeable and you may create new directories (albums) under album. If you copy files with a directory hierarchy in there then rclone will create albums with the / character in them. For example if you do
      rclone copy /path/to/images remote:album/images
      and the images directory contains
      images - file1.jpg dir file2.jpg dir2 dir3 file3.jpg
      Then rclone will create the following albums with the following files in
      - images - file1.jpg - images/dir - file2.jpg - images/dir2/dir3 - file3.jpg
      This means that you can use the album path pretty much like a normal filesystem and it is a good target for repeated syncing.
      The shared-album directory shows albums shared with you or by you. This is similar to the Sharing tab in the Google Photos web interface.
      ### Standard options
      Here are the Standard options specific to google photos (Google Photos).
      #### --gphotos-client-id
      OAuth Client Id.
      Leave blank normally.
      Properties:
      - Config: client_id - Env Var: RCLONE_GPHOTOS_CLIENT_ID - Type: string - Required: false
      #### --gphotos-client-secret
      OAuth Client Secret.
      Leave blank normally.
      Properties:
      - Config: client_secret - Env Var: RCLONE_GPHOTOS_CLIENT_SECRET - Type: string - Required: false
      #### --gphotos-read-only
      Set to make the Google Photos backend read only.
      If you choose read only then rclone will only request read only access to your photos, otherwise rclone will request full access.
      Properties:
      - Config: read_only - Env Var: RCLONE_GPHOTOS_READ_ONLY - Type: bool - Default: false
      ### Advanced options
      Here are the Advanced options specific to google photos (Google Photos).
      #### --gphotos-token
      OAuth Access Token as a JSON blob.
      Properties:
      - Config: token - Env Var: RCLONE_GPHOTOS_TOKEN - Type: string - Required: false
      #### --gphotos-auth-url
      Auth server URL.
      Leave blank to use the provider defaults.
      Properties:
      - Config: auth_url - Env Var: RCLONE_GPHOTOS_AUTH_URL - Type: string - Required: false
      #### --gphotos-token-url
      Token server url.
      Leave blank to use the provider defaults.
      Properties:
      - Config: token_url - Env Var: RCLONE_GPHOTOS_TOKEN_URL - Type: string - Required: false
      #### --gphotos-read-size
      Set to read the size of media items.
      Normally rclone does not read the size of media items since this takes another transaction. This isn't necessary for syncing. However rclone mount needs to know the size of files in advance of reading them, so setting this flag when using rclone mount is recommended if you want to read the media.
      Properties:
      - Config: read_size - Env Var: RCLONE_GPHOTOS_READ_SIZE - Type: bool - Default: false
      #### --gphotos-start-year
      Year limits the photos to be downloaded to those which are uploaded after the given year.
      Properties:
      - Config: start_year - Env Var: RCLONE_GPHOTOS_START_YEAR - Type: int - Default: 2000
      #### --gphotos-include-archived
      Also view and download archived media.
      By default, rclone does not request archived media. Thus, when syncing, archived media is not visible in directory listings or transferred.
      Note that media in albums is always visible and synced, no matter their archive status.
      With this flag, archived media are always visible in directory listings and transferred.
      Without this flag, archived media will not be visible in directory listings and won't be transferred.
      Properties:
      - Config: include_archived - Env Var: RCLONE_GPHOTOS_INCLUDE_ARCHIVED - Type: bool - Default: false
      #### --gphotos-encoding
      The encoding for the backend.
      See the encoding section in the overview for more info.
      Properties:
      - Config: encoding - Env Var: RCLONE_GPHOTOS_ENCODING - Type: Encoding - Default: Slash,CrLf,InvalidUtf8,Dot
      #### --gphotos-batch-mode
      Upload file batching sync|async|off.
      This sets the batch mode used by rclone.
      This has 3 possible values
      - off - no batching - sync - batch uploads and check completion (default) - async - batch upload and don't check completion
      Rclone will close any outstanding batches when it exits which may make a delay on quit.
      Properties:
      - Config: batch_mode - Env Var: RCLONE_GPHOTOS_BATCH_MODE - Type: string - Default: "sync"
      #### --gphotos-batch-size
      Max number of files in upload batch.
      This sets the batch size of files to upload. It has to be less than 50.
      By default this is 0 which means rclone which calculate the batch size depending on the setting of batch_mode.
      - batch_mode: async - default batch_size is 50 - batch_mode: sync - default batch_size is the same as --transfers - batch_mode: off - not in use
      Rclone will close any outstanding batches when it exits which may make a delay on quit.
      Setting this is a great idea if you are uploading lots of small files as it will make them a lot quicker. You can use --transfers 32 to maximise throughput.
      Properties:
      - Config: batch_size - Env Var: RCLONE_GPHOTOS_BATCH_SIZE - Type: int - Default: 0
      #### --gphotos-batch-timeout
      Max time to allow an idle upload batch before uploading.
      If an upload batch is idle for more than this long then it will be uploaded.
      The default for this is 0 which means rclone will choose a sensible default based on the batch_mode in use.
      - batch_mode: async - default batch_timeout is 10s - batch_mode: sync - default batch_timeout is 1s - batch_mode: off - not in use
      Properties:
      - Config: batch_timeout - Env Var: RCLONE_GPHOTOS_BATCH_TIMEOUT - Type: Duration - Default: 0s
      #### --gphotos-batch-commit-timeout
      Max time to wait for a batch to finish committing
      Properties:
      - Config: batch_commit_timeout - Env Var: RCLONE_GPHOTOS_BATCH_COMMIT_TIMEOUT - Type: Duration - Default: 10m0s
      ## Limitations
      Only images and videos can be uploaded. If you attempt to upload non videos or images or formats that Google Photos doesn't understand, rclone will upload the file, then Google Photos will give an error when it is put turned into a media item.
      Note that all media items uploaded to Google Photos through the API are stored in full resolution at "original quality" and will count towards your storage quota in your Google Account. The API does not offer a way to upload in "high quality" mode..
      rclone about is not supported by the Google Photos backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.
      See List of backends that do not support rclone about See rclone about
      ### Downloading Images
      When Images are downloaded this strips EXIF location (according to the docs and my tests). This is a limitation of the Google Photos API and is covered by bug #112096115.
      The current google API does not allow photos to be downloaded at original resolution. This is very important if you are, for example, relying on "Google Photos" as a backup of your photos. You will not be able to use rclone to redownload original images. You could use 'google takeout' to recover the original photos as a last resort
      ### Downloading Videos
      When videos are downloaded they are downloaded in a really compressed version of the video compared to downloading it via the Google Photos web interface. This is covered by bug #113672044.
      ### Duplicates
      If a file name is duplicated in a directory then rclone will add the file ID into its name. So two files called file.jpg would then appear as file {123456}.jpg and file {ABCDEF}.jpg (the actual IDs are a lot longer alas!).
      If you upload the same image (with the same binary data) twice then Google Photos will deduplicate it. However it will retain the filename from the first upload which may confuse rclone. For example if you uploaded an image to upload then uploaded the same image to album/my_album the filename of the image in album/my_album will be what it was uploaded with initially, not what you uploaded it with to album. In practise this shouldn't cause too many problems.
      ### Modification times
      The date shown of media in Google Photos is the creation date as determined by the EXIF information, or the upload date if that is not known.
      This is not changeable by rclone and is not the modification date of the media on local disk. This means that rclone cannot use the dates from Google Photos for syncing purposes.
      ### Size
      The Google Photos API does not return the size of media. This means that when syncing to Google Photos, rclone can only do a file existence check.
      It is possible to read the size of the media, but this needs an extra HTTP HEAD request per media item so is very slow and uses up a lot of transactions. This can be enabled with the --gphotos-read-size option or the read_size = true config parameter.
      If you want to use the backend with rclone mount you may need to enable this flag (depending on your OS and application using the photos) otherwise you may not be able to read media off the mount. You'll need to experiment to see if it works for you without the flag.
      ### Albums
      Rclone can only upload files to albums it created. This is a limitation of the Google Photos API.
      Rclone can remove files it uploaded from albums it created only.
      ### Deleting files
      Rclone can remove files from albums it created, but note that the Google Photos API does not allow media to be deleted permanently so this media will still remain. See bug #109759781.
      Rclone cannot delete files anywhere except under album.
      ### Deleting albums
      The Google Photos API does not support deleting albums - see bug #135714733.
      # Hasher
      Hasher is a special overlay backend to create remotes which handle checksums for other remotes. It's main functions include: - Emulate hash types unimplemented by backends - Cache checksums to help with slow hashing of large local or (S)FTP files - Warm up checksum cache from external SUM files
      ## Getting started
      To use Hasher, first set up the underlying remote following the configuration instructions for that remote. You can also use a local pathname instead of a remote. Check that your base remote is working.
      Let's call the base remote myRemote:path here. Note that anything inside myRemote:path will be handled by hasher and anything outside won't. This means that if you are using a bucket based remote (S3, B2, Swift) then you should put the bucket in the remote s3:bucket.
      Now proceed to interactive or manual configuration.
      ### Interactive configuration
      Run rclone config: ``` No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> Hasher1 Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Handle checksums for other remotes  "hasher" [snip] Storage> hasher Remote to cache checksums for, like myremote:mypath. Enter a string value. Press Enter for the default (""). remote> myRemote:path Comma separated list of supported checksum types. Enter a string value. Press Enter for the default ("md5,sha1"). hashsums> md5 Maximum time to keep checksums in cache. 0 = no cache, off = cache forever. max_age> off Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config
      +

      [Hasher1] type = hasher remote = myRemote:path hashsums = md5 max_age = off -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

      +
      
      +### Manual configuration
       
      -Corrupted checksums are caused by Google modifying the image/video but
      -not updating the checksum.
      +Run `rclone config path` to see the path of current active config file,
      +usually `YOURHOME/.config/rclone/rclone.conf`.
      +Open it in your favorite text editor, find section for the base remote
      +and create new section for hasher like in the following examples:
      +
      +

      [Hasher1] type = hasher remote = myRemote:path hashes = md5 max_age = off

      +

      [Hasher2] type = hasher remote = /local/path hashes = dropbox,sha1 max_age = 24h

      +
      
      +Hasher takes basically the following parameters:
      +- `remote` is required,
      +- `hashes` is a comma separated list of supported checksums
      +   (by default `md5,sha1`),
      +- `max_age` - maximum time to keep a checksum value in the cache,
      +   `0` will disable caching completely,
      +   `off` will cache "forever" (that is until the files get changed).
       
      -Properties:
      +Make sure the `remote` has `:` (colon) in. If you specify the remote without
      +a colon then rclone will use a local directory of that name. So if you use
      +a remote of `/local/path` then rclone will handle hashes for that directory.
      +If you use `remote = name` literally then rclone will put files
      +**in a directory called `name` located under current directory**.
       
      -- Config:      skip_checksum_gphotos
      -- Env Var:     RCLONE_DRIVE_SKIP_CHECKSUM_GPHOTOS
      -- Type:        bool
      -- Default:     false
      +## Usage
       
      -#### --drive-shared-with-me
      +### Basic operations
       
      -Only show files that are shared with me.
      +Now you can use it as `Hasher2:subdir/file` instead of base remote.
      +Hasher will transparently update cache with new checksums when a file
      +is fully read or overwritten, like:
      +

      rclone copy External:path/file Hasher:dest/path

      +

      rclone cat Hasher:path/to/file > /dev/null

      +
      
      +The way to refresh **all** cached checksums (even unsupported by the base backend)
      +for a subtree is to **re-download** all files in the subtree. For example,
      +use `hashsum --download` using **any** supported hashsum on the command line
      +(we just care to re-read):
      +

      rclone hashsum MD5 --download Hasher:path/to/subtree > /dev/null

      +

      rclone backend dump Hasher:path/to/subtree

      +
      
      +You can print or drop hashsum cache using custom backend commands:
      +

      rclone backend dump Hasher:dir/subdir

      +

      rclone backend drop Hasher:

      +
      
      +### Pre-Seed from a SUM File
       
      -Instructs rclone to operate on your "Shared with me" folder (where
      -Google Drive lets you access the files and folders others have shared
      -with you).
      +Hasher supports two backend commands: generic SUM file `import` and faster
      +but less consistent `stickyimport`.
      +
      +

      rclone backend import Hasher:dir/subdir SHA1 /path/to/SHA1SUM [--checkers 4]

      +
      
      +Instead of SHA1 it can be any hash supported by the remote. The last argument
      +can point to either a local or an `other-remote:path` text file in SUM format.
      +The command will parse the SUM file, then walk down the path given by the
      +first argument, snapshot current fingerprints and fill in the cache entries
      +correspondingly.
      +- Paths in the SUM file are treated as relative to `hasher:dir/subdir`.
      +- The command will **not** check that supplied values are correct.
      +  You **must know** what you are doing.
      +- This is a one-time action. The SUM file will not get "attached" to the
      +  remote. Cache entries can still be overwritten later, should the object's
      +  fingerprint change.
      +- The tree walk can take long depending on the tree size. You can increase
      +  `--checkers` to make it faster. Or use `stickyimport` if you don't care
      +  about fingerprints and consistency.
      +
      +

      rclone backend stickyimport hasher:path/to/data sha1 remote:/path/to/sum.sha1

      +
      
      +`stickyimport` is similar to `import` but works much faster because it
      +does not need to stat existing files and skips initial tree walk.
      +Instead of binding cache entries to file fingerprints it creates _sticky_
      +entries bound to the file name alone ignoring size, modification time etc.
      +Such hash entries can be replaced only by `purge`, `delete`, `backend drop`
      +or by full re-read/re-write of the files.
       
      -This works both with the "list" (lsd, lsl, etc.) and the "copy"
      -commands (copy, sync, etc.), and with all other commands too.
      +## Configuration reference
       
      -Properties:
       
      -- Config:      shared_with_me
      -- Env Var:     RCLONE_DRIVE_SHARED_WITH_ME
      -- Type:        bool
      -- Default:     false
      +### Standard options
       
      -#### --drive-trashed-only
      +Here are the Standard options specific to hasher (Better checksums for other remotes).
       
      -Only show files that are in the trash.
      +#### --hasher-remote
       
      -This will show trashed files in their original directory structure.
      +Remote to cache checksums for (e.g. myRemote:path).
       
       Properties:
       
      -- Config:      trashed_only
      -- Env Var:     RCLONE_DRIVE_TRASHED_ONLY
      -- Type:        bool
      -- Default:     false
      +- Config:      remote
      +- Env Var:     RCLONE_HASHER_REMOTE
      +- Type:        string
      +- Required:    true
       
      -#### --drive-starred-only
      +#### --hasher-hashes
       
      -Only show files that are starred.
      +Comma separated list of supported checksum types.
       
       Properties:
       
      -- Config:      starred_only
      -- Env Var:     RCLONE_DRIVE_STARRED_ONLY
      -- Type:        bool
      -- Default:     false
      +- Config:      hashes
      +- Env Var:     RCLONE_HASHER_HASHES
      +- Type:        CommaSepList
      +- Default:     md5,sha1
       
      -#### --drive-formats
      +#### --hasher-max-age
       
      -Deprecated: See export_formats.
      +Maximum time to keep checksums in cache (0 = no cache, off = cache forever).
       
       Properties:
       
      -- Config:      formats
      -- Env Var:     RCLONE_DRIVE_FORMATS
      -- Type:        string
      -- Required:    false
      -
      -#### --drive-export-formats
      -
      -Comma separated list of preferred formats for downloading Google docs.
      +- Config:      max_age
      +- Env Var:     RCLONE_HASHER_MAX_AGE
      +- Type:        Duration
      +- Default:     off
       
      -Properties:
      +### Advanced options
       
      -- Config:      export_formats
      -- Env Var:     RCLONE_DRIVE_EXPORT_FORMATS
      -- Type:        string
      -- Default:     "docx,xlsx,pptx,svg"
      +Here are the Advanced options specific to hasher (Better checksums for other remotes).
       
      -#### --drive-import-formats
      +#### --hasher-auto-size
       
      -Comma separated list of preferred formats for uploading Google docs.
      +Auto-update checksum for files smaller than this size (disabled by default).
       
       Properties:
       
      -- Config:      import_formats
      -- Env Var:     RCLONE_DRIVE_IMPORT_FORMATS
      -- Type:        string
      -- Required:    false
      +- Config:      auto_size
      +- Env Var:     RCLONE_HASHER_AUTO_SIZE
      +- Type:        SizeSuffix
      +- Default:     0
       
      -#### --drive-allow-import-name-change
      +### Metadata
       
      -Allow the filetype to change when uploading Google docs.
      +Any metadata supported by the underlying remote is read and written.
       
      -E.g. file.doc to file.docx. This will confuse sync and reupload every time.
      +See the [metadata](https://rclone.org/docs/#metadata) docs for more info.
       
      -Properties:
      +## Backend commands
       
      -- Config:      allow_import_name_change
      -- Env Var:     RCLONE_DRIVE_ALLOW_IMPORT_NAME_CHANGE
      -- Type:        bool
      -- Default:     false
      +Here are the commands specific to the hasher backend.
       
      -#### --drive-use-created-date
      +Run them with
       
      -Use file created date instead of modified date.
      +    rclone backend COMMAND remote:
       
      -Useful when downloading data and you want the creation date used in
      -place of the last modified date.
      +The help below will explain what arguments each command takes.
       
      -**WARNING**: This flag may have some unexpected consequences.
      +See the [backend](https://rclone.org/commands/rclone_backend/) command for more
      +info on how to pass options and arguments.
       
      -When uploading to your drive all files will be overwritten unless they
      -haven't been modified since their creation. And the inverse will occur
      -while downloading.  This side effect can be avoided by using the
      -"--checksum" flag.
      +These can be run on a running backend using the rc command
      +[backend/command](https://rclone.org/rc/#backend-command).
       
      -This feature was implemented to retain photos capture date as recorded
      -by google photos. You will first need to check the "Create a Google
      -Photos folder" option in your google drive settings. You can then copy
      -or move the photos locally and use the date the image was taken
      -(created) set as the modification date.
      +### drop
       
      -Properties:
      +Drop cache
       
      -- Config:      use_created_date
      -- Env Var:     RCLONE_DRIVE_USE_CREATED_DATE
      -- Type:        bool
      -- Default:     false
      +    rclone backend drop remote: [options] [<arguments>+]
       
      -#### --drive-use-shared-date
      +Completely drop checksum cache.
      +Usage Example:
      +    rclone backend drop hasher:
       
      -Use date file was shared instead of modified date.
       
      -Note that, as with "--drive-use-created-date", this flag may have
      -unexpected consequences when uploading/downloading files.
      +### dump
       
      -If both this flag and "--drive-use-created-date" are set, the created
      -date is used.
      +Dump the database
       
      -Properties:
      +    rclone backend dump remote: [options] [<arguments>+]
       
      -- Config:      use_shared_date
      -- Env Var:     RCLONE_DRIVE_USE_SHARED_DATE
      -- Type:        bool
      -- Default:     false
      +Dump cache records covered by the current remote
       
      -#### --drive-list-chunk
      +### fulldump
       
      -Size of listing chunk 100-1000, 0 to disable.
      +Full dump of the database
       
      -Properties:
      +    rclone backend fulldump remote: [options] [<arguments>+]
       
      -- Config:      list_chunk
      -- Env Var:     RCLONE_DRIVE_LIST_CHUNK
      -- Type:        int
      -- Default:     1000
      +Dump all cache records in the database
       
      -#### --drive-impersonate
      +### import
       
      -Impersonate this user when using a service account.
      +Import a SUM file
       
      -Properties:
      +    rclone backend import remote: [options] [<arguments>+]
       
      -- Config:      impersonate
      -- Env Var:     RCLONE_DRIVE_IMPERSONATE
      -- Type:        string
      -- Required:    false
      +Amend hash cache from a SUM file and bind checksums to files by size/time.
      +Usage Example:
      +    rclone backend import hasher:subdir md5 /path/to/sum.md5
       
      -#### --drive-upload-cutoff
       
      -Cutoff for switching to chunked upload.
      +### stickyimport
       
      -Properties:
      +Perform fast import of a SUM file
       
      -- Config:      upload_cutoff
      -- Env Var:     RCLONE_DRIVE_UPLOAD_CUTOFF
      -- Type:        SizeSuffix
      -- Default:     8Mi
      +    rclone backend stickyimport remote: [options] [<arguments>+]
       
      -#### --drive-chunk-size
      +Fill hash cache from a SUM file without verifying file fingerprints.
      +Usage Example:
      +    rclone backend stickyimport hasher:subdir md5 remote:path/to/sum.md5
       
      -Upload chunk size.
       
      -Must a power of 2 >= 256k.
       
      -Making this larger will improve performance, but note that each chunk
      -is buffered in memory one per transfer.
       
      -Reducing this will reduce memory usage but decrease performance.
      +## Implementation details (advanced)
       
      -Properties:
      +This section explains how various rclone operations work on a hasher remote.
       
      -- Config:      chunk_size
      -- Env Var:     RCLONE_DRIVE_CHUNK_SIZE
      -- Type:        SizeSuffix
      -- Default:     8Mi
      +**Disclaimer. This section describes current implementation which can
      +change in future rclone versions!.**
       
      -#### --drive-acknowledge-abuse
      +### Hashsum command
       
      -Set to allow files which return cannotDownloadAbusiveFile to be downloaded.
      +The `rclone hashsum` (or `md5sum` or `sha1sum`) command will:
       
      -If downloading a file returns the error "This file has been identified
      -as malware or spam and cannot be downloaded" with the error code
      -"cannotDownloadAbusiveFile" then supply this flag to rclone to
      -indicate you acknowledge the risks of downloading the file and rclone
      -will download it anyway.
      +1. if requested hash is supported by lower level, just pass it.
      +2. if object size is below `auto_size` then download object and calculate
      +   _requested_ hashes on the fly.
      +3. if unsupported and the size is big enough, build object `fingerprint`
      +   (including size, modtime if supported, first-found _other_ hash if any).
      +4. if the strict match is found in cache for the requested remote, return
      +   the stored hash.
      +5. if remote found but fingerprint mismatched, then purge the entry and
      +   proceed to step 6.
      +6. if remote not found or had no requested hash type or after step 5:
      +   download object, calculate all _supported_ hashes on the fly and store
      +   in cache; return requested hash.
       
      -Note that if you are using service account it will need Manager
      -permission (not Content Manager) to for this flag to work. If the SA
      -does not have the right permission, Google will just ignore the flag.
      +### Other operations
       
      -Properties:
      +- whenever a file is uploaded or downloaded **in full**, capture the stream
      +  to calculate all supported hashes on the fly and update database
      +- server-side `move`  will update keys of existing cache entries
      +- `deletefile` will remove a single cache entry
      +- `purge` will remove all cache entries under the purged path
       
      -- Config:      acknowledge_abuse
      -- Env Var:     RCLONE_DRIVE_ACKNOWLEDGE_ABUSE
      -- Type:        bool
      -- Default:     false
      +Note that setting `max_age = 0` will disable checksum caching completely.
       
      -#### --drive-keep-revision-forever
      +If you set `max_age = off`, checksums in cache will never age, unless you
      +fully rewrite or delete the file.
       
      -Keep new head revision of each file forever.
      +### Cache storage
       
      -Properties:
      +Cached checksums are stored as `bolt` database files under rclone cache
      +directory, usually `~/.cache/rclone/kv/`. Databases are maintained
      +one per _base_ backend, named like `BaseRemote~hasher.bolt`.
      +Checksums for multiple `alias`-es into a single base backend
      +will be stored in the single database. All local paths are treated as
      +aliases into the `local` backend (unless encrypted or chunked) and stored
      +in `~/.cache/rclone/kv/local~hasher.bolt`.
      +Databases can be shared between multiple rclone processes.
       
      -- Config:      keep_revision_forever
      -- Env Var:     RCLONE_DRIVE_KEEP_REVISION_FOREVER
      -- Type:        bool
      -- Default:     false
      +#  HDFS
       
      -#### --drive-size-as-quota
      +[HDFS](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html) is a
      +distributed file-system, part of the [Apache Hadoop](https://hadoop.apache.org/) framework.
       
      -Show sizes as storage quota usage, not actual size.
      +Paths are specified as `remote:` or `remote:path/to/dir`.
       
      -Show the size of a file as the storage quota used. This is the
      -current version plus any older versions that have been set to keep
      -forever.
      +## Configuration
       
      -**WARNING**: This flag may have some unexpected consequences.
      +Here is an example of how to make a remote called `remote`. First run:
       
      -It is not recommended to set this flag in your config - the
      -recommended usage is using the flag form --drive-size-as-quota when
      -doing rclone ls/lsl/lsf/lsjson/etc only.
      +     rclone config
       
      -If you do use this flag for syncing (not recommended) then you will
      -need to use --ignore size also.
      +This will guide you through an interactive setup process:
      +
      +

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [skip] XX / Hadoop distributed file system  "hdfs" [skip] Storage> hdfs ** See help for hdfs backend at: https://rclone.org/hdfs/ **

      +

      hadoop name node and port Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / Connect to host namenode at port 8020  "namenode:8020" namenode> namenode.hadoop:8020 hadoop user name Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / Connect to hdfs as root  "root" username> root Edit advanced config? (y/n) y) Yes n) No (default) y/n> n Remote config -------------------- [remote] type = hdfs namenode = namenode.hadoop:8020 username = root -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y Current remotes:

      +

      Name Type ==== ==== hadoop hdfs

      +
        +
      1. Edit existing remote
      2. +
      3. New remote
      4. +
      5. Delete remote
      6. +
      7. Rename remote
      8. +
      9. Copy remote
      10. +
      11. Set configuration password
      12. +
      13. Quit config e/n/d/r/c/s/q> q
      14. +
      +
      
      +This remote is called `remote` and can now be used like this
       
      -Properties:
      +See all the top level directories
       
      -- Config:      size_as_quota
      -- Env Var:     RCLONE_DRIVE_SIZE_AS_QUOTA
      -- Type:        bool
      -- Default:     false
      +    rclone lsd remote:
       
      -#### --drive-v2-download-min-size
      +List the contents of a directory
       
      -If Object's are greater, use drive v2 API to download.
      +    rclone ls remote:directory
       
      -Properties:
      +Sync the remote `directory` to `/home/local/directory`, deleting any excess files.
       
      -- Config:      v2_download_min_size
      -- Env Var:     RCLONE_DRIVE_V2_DOWNLOAD_MIN_SIZE
      -- Type:        SizeSuffix
      -- Default:     off
      +    rclone sync --interactive remote:directory /home/local/directory
       
      -#### --drive-pacer-min-sleep
      +### Setting up your own HDFS instance for testing
       
      -Minimum time to sleep between API calls.
      +You may start with a [manual setup](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/SingleCluster.html)
      +or use the docker image from the tests:
       
      -Properties:
      +If you want to build the docker image
      +
      +

      git clone https://github.com/rclone/rclone.git cd rclone/fstest/testserver/images/test-hdfs docker build --rm -t rclone/test-hdfs .

      +
      
      +Or you can just use the latest one pushed
      +
      +

      docker run --rm --name "rclone-hdfs" -p 127.0.0.1:9866:9866 -p 127.0.0.1:8020:8020 --hostname "rclone-hdfs" rclone/test-hdfs

      +
      
      +**NB** it need few seconds to startup.
       
      -- Config:      pacer_min_sleep
      -- Env Var:     RCLONE_DRIVE_PACER_MIN_SLEEP
      -- Type:        Duration
      -- Default:     100ms
      +For this docker image the remote needs to be configured like this:
      +
      +

      [remote] type = hdfs namenode = 127.0.0.1:8020 username = root

      +
      
      +You can stop this image with `docker kill rclone-hdfs` (**NB** it does not use volumes, so all data
      +uploaded will be lost.)
       
      -#### --drive-pacer-burst
      +### Modification times
       
      -Number of API calls to allow without sleeping.
      +Time accurate to 1 second is stored.
       
      -Properties:
      +### Checksum
       
      -- Config:      pacer_burst
      -- Env Var:     RCLONE_DRIVE_PACER_BURST
      -- Type:        int
      -- Default:     100
      +No checksums are implemented.
       
      -#### --drive-server-side-across-configs
      +### Usage information
       
      -Deprecated: use --server-side-across-configs instead.
      +You can use the `rclone about remote:` command which will display filesystem size and current usage.
       
      -Allow server-side operations (e.g. copy) to work across different drive configs.
      +### Restricted filename characters
       
      -This can be useful if you wish to do a server-side copy between two
      -different Google drives.  Note that this isn't enabled by default
      -because it isn't easy to tell if it will work between any two
      -configurations.
      +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
      +the following characters are also replaced:
       
      -Properties:
      +| Character | Value | Replacement |
      +| --------- |:-----:|:-----------:|
      +| :         | 0x3A  | :           |
       
      -- Config:      server_side_across_configs
      -- Env Var:     RCLONE_DRIVE_SERVER_SIDE_ACROSS_CONFIGS
      -- Type:        bool
      -- Default:     false
      +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8).
       
      -#### --drive-disable-http2
       
      -Disable drive using http2.
      +### Standard options
       
      -There is currently an unsolved issue with the google drive backend and
      -HTTP/2.  HTTP/2 is therefore disabled by default for the drive backend
      -but can be re-enabled here.  When the issue is solved this flag will
      -be removed.
      +Here are the Standard options specific to hdfs (Hadoop distributed file system).
       
      -See: https://github.com/rclone/rclone/issues/3631
      +#### --hdfs-namenode
       
      +Hadoop name nodes and ports.
       
      +E.g. "namenode-1:8020,namenode-2:8020,..." to connect to host namenodes at port 8020.
       
       Properties:
       
      -- Config:      disable_http2
      -- Env Var:     RCLONE_DRIVE_DISABLE_HTTP2
      -- Type:        bool
      -- Default:     true
      -
      -#### --drive-stop-on-upload-limit
      -
      -Make upload limit errors be fatal.
      -
      -At the time of writing it is only possible to upload 750 GiB of data to
      -Google Drive a day (this is an undocumented limit). When this limit is
      -reached Google Drive produces a slightly different error message. When
      -this flag is set it causes these errors to be fatal.  These will stop
      -the in-progress sync.
      -
      -Note that this detection is relying on error message strings which
      -Google don't document so it may break in the future.
      +- Config:      namenode
      +- Env Var:     RCLONE_HDFS_NAMENODE
      +- Type:        CommaSepList
      +- Default:     
       
      -See: https://github.com/rclone/rclone/issues/3857
      +#### --hdfs-username
       
      +Hadoop user name.
       
       Properties:
       
      -- Config:      stop_on_upload_limit
      -- Env Var:     RCLONE_DRIVE_STOP_ON_UPLOAD_LIMIT
      -- Type:        bool
      -- Default:     false
      +- Config:      username
      +- Env Var:     RCLONE_HDFS_USERNAME
      +- Type:        string
      +- Required:    false
      +- Examples:
      +    - "root"
      +        - Connect to hdfs as root.
       
      -#### --drive-stop-on-download-limit
      +### Advanced options
       
      -Make download limit errors be fatal.
      +Here are the Advanced options specific to hdfs (Hadoop distributed file system).
       
      -At the time of writing it is only possible to download 10 TiB of data from
      -Google Drive a day (this is an undocumented limit). When this limit is
      -reached Google Drive produces a slightly different error message. When
      -this flag is set it causes these errors to be fatal.  These will stop
      -the in-progress sync.
      +#### --hdfs-service-principal-name
       
      -Note that this detection is relying on error message strings which
      -Google don't document so it may break in the future.
      +Kerberos service principal name for the namenode.
       
      +Enables KERBEROS authentication. Specifies the Service Principal Name
      +(SERVICE/FQDN) for the namenode. E.g. \"hdfs/namenode.hadoop.docker\"
      +for namenode running as service 'hdfs' with FQDN 'namenode.hadoop.docker'.
       
       Properties:
       
      -- Config:      stop_on_download_limit
      -- Env Var:     RCLONE_DRIVE_STOP_ON_DOWNLOAD_LIMIT
      -- Type:        bool
      -- Default:     false
      -
      -#### --drive-skip-shortcuts
      +- Config:      service_principal_name
      +- Env Var:     RCLONE_HDFS_SERVICE_PRINCIPAL_NAME
      +- Type:        string
      +- Required:    false
       
      -If set skip shortcut files.
      +#### --hdfs-data-transfer-protection
       
      -Normally rclone dereferences shortcut files making them appear as if
      -they are the original file (see [the shortcuts section](#shortcuts)).
      -If this flag is set then rclone will ignore shortcut files completely.
      +Kerberos data transfer protection: authentication|integrity|privacy.
       
      +Specifies whether or not authentication, data signature integrity
      +checks, and wire encryption are required when communicating with
      +the datanodes. Possible values are 'authentication', 'integrity'
      +and 'privacy'. Used only with KERBEROS enabled.
       
       Properties:
       
      -- Config:      skip_shortcuts
      -- Env Var:     RCLONE_DRIVE_SKIP_SHORTCUTS
      -- Type:        bool
      -- Default:     false
      -
      -#### --drive-skip-dangling-shortcuts
      +- Config:      data_transfer_protection
      +- Env Var:     RCLONE_HDFS_DATA_TRANSFER_PROTECTION
      +- Type:        string
      +- Required:    false
      +- Examples:
      +    - "privacy"
      +        - Ensure authentication, integrity and encryption enabled.
       
      -If set skip dangling shortcut files.
      +#### --hdfs-encoding
       
      -If this is set then rclone will not show any dangling shortcuts in listings.
      +The encoding for the backend.
       
      +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
       
       Properties:
       
      -- Config:      skip_dangling_shortcuts
      -- Env Var:     RCLONE_DRIVE_SKIP_DANGLING_SHORTCUTS
      -- Type:        bool
      -- Default:     false
      +- Config:      encoding
      +- Env Var:     RCLONE_HDFS_ENCODING
      +- Type:        Encoding
      +- Default:     Slash,Colon,Del,Ctl,InvalidUtf8,Dot
       
      -#### --drive-resource-key
       
      -Resource key for accessing a link-shared file.
       
      -If you need to access files shared with a link like this
      +## Limitations
       
      -    https://drive.google.com/drive/folders/XXX?resourcekey=YYY&usp=sharing
      +- No server-side `Move` or `DirMove`.
      +- Checksums not implemented.
       
      -Then you will need to use the first part "XXX" as the "root_folder_id"
      -and the second part "YYY" as the "resource_key" otherwise you will get
      -404 not found errors when trying to access the directory.
      +#  HiDrive
       
      -See: https://developers.google.com/drive/api/guides/resource-keys
      +Paths are specified as `remote:path`
       
      -This resource key requirement only applies to a subset of old files.
      +Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
       
      -Note also that opening the folder once in the web interface (with the
      -user you've authenticated rclone with) seems to be enough so that the
      -resource key is not needed.
      +The initial setup for hidrive involves getting a token from HiDrive
      +which you need to do in your browser.
      +`rclone config` walks you through it.
       
      +## Configuration
       
      -Properties:
      +Here is an example of how to make a remote called `remote`.  First run:
       
      -- Config:      resource_key
      -- Env Var:     RCLONE_DRIVE_RESOURCE_KEY
      -- Type:        string
      -- Required:    false
      +     rclone config
       
      -#### --drive-fast-list-bug-fix
      +This will guide you through an interactive setup process:
      +
      +

      No remotes found - make a new one n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / HiDrive  "hidrive" [snip] Storage> hidrive OAuth Client Id - Leave blank normally. client_id> OAuth Client Secret - Leave blank normally. client_secret> Access permissions that rclone should use when requesting access from HiDrive. Leave blank normally. scope_access> Edit advanced config? y/n> n Use web browser to automatically authenticate rclone with remote? * Say Y if the machine running rclone has a web browser you can use * Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N. y/n> y If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=xxxxxxxxxxxxxxxxxxxxxx Log in and authorize rclone for access Waiting for code... Got code -------------------- [remote] type = hidrive token = {"access_token":"xxxxxxxxxxxxxxxxxxxx","token_type":"Bearer","refresh_token":"xxxxxxxxxxxxxxxxxxxxxxx","expiry":"xxxxxxxxxxxxxxxxxxxxxxx"} -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      +
      
      +**You should be aware that OAuth-tokens can be used to access your account
      +and hence should not be shared with other persons.**
      +See the [below section](#keeping-your-tokens-safe) for more information.
       
      -Work around a bug in Google Drive listing.
      +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a
      +machine with no Internet browser available.
       
      -Normally rclone will work around a bug in Google Drive when using
      ---fast-list (ListR) where the search "(A in parents) or (B in
      -parents)" returns nothing sometimes. See #3114, #4289 and
      -https://issuetracker.google.com/issues/149522397
      +Note that rclone runs a webserver on your local machine to collect the
      +token as returned from HiDrive. This only runs from the moment it opens
      +your browser to the moment you get back the verification code.
      +The webserver runs on `http://127.0.0.1:53682/`.
      +If local port `53682` is protected by a firewall you may need to temporarily
      +unblock the firewall to complete authorization.
       
      -Rclone detects this by finding no items in more than one directory
      -when listing and retries them as lists of individual directories.
      +Once configured you can then use `rclone` like this,
       
      -This means that if you have a lot of empty directories rclone will end
      -up listing them all individually and this can take many more API
      -calls.
      +List directories in top level of your HiDrive root folder
       
      -This flag allows the work-around to be disabled. This is **not**
      -recommended in normal use - only if you have a particular case you are
      -having trouble with like many empty directories.
      +    rclone lsd remote:
       
      +List all the files in your HiDrive filesystem
       
      -Properties:
      +    rclone ls remote:
       
      -- Config:      fast_list_bug_fix
      -- Env Var:     RCLONE_DRIVE_FAST_LIST_BUG_FIX
      -- Type:        bool
      -- Default:     true
      +To copy a local directory to a HiDrive directory called backup
       
      -#### --drive-encoding
      +    rclone copy /home/source remote:backup
       
      -The encoding for the backend.
      +### Keeping your tokens safe
       
      -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
      +Any OAuth-tokens will be stored by rclone in the remote's configuration file as unencrypted text.
      +Anyone can use a valid refresh-token to access your HiDrive filesystem without knowing your password.
      +Therefore you should make sure no one else can access your configuration.
       
      -Properties:
      +It is possible to encrypt rclone's configuration file.
      +You can find information on securing your configuration file by viewing the [configuration encryption docs](https://rclone.org/docs/#configuration-encryption).
       
      -- Config:      encoding
      -- Env Var:     RCLONE_DRIVE_ENCODING
      -- Type:        MultiEncoder
      -- Default:     InvalidUtf8
      +### Invalid refresh token
       
      -#### --drive-env-auth
      +As can be verified [here](https://developer.hidrive.com/basics-flows/),
      +each `refresh_token` (for Native Applications) is valid for 60 days.
      +If used to access HiDrivei, its validity will be automatically extended.
       
      -Get IAM credentials from runtime (environment variables or instance meta data if no env vars).
      +This means that if you
       
      -Only applies if service_account_file and service_account_credentials is blank.
      +  * Don't use the HiDrive remote for 60 days
       
      -Properties:
      +then rclone will return an error which includes a text
      +that implies the refresh token is *invalid* or *expired*.
       
      -- Config:      env_auth
      -- Env Var:     RCLONE_DRIVE_ENV_AUTH
      -- Type:        bool
      -- Default:     false
      -- Examples:
      -    - "false"
      -        - Enter credentials in the next step.
      -    - "true"
      -        - Get GCP IAM credentials from the environment (env vars or IAM).
      +To fix this you will need to authorize rclone to access your HiDrive account again.
       
      -## Backend commands
      +Using
       
      -Here are the commands specific to the drive backend.
      +    rclone config reconnect remote:
       
      -Run them with
      +the process is very similar to the process of initial setup exemplified before.
       
      -    rclone backend COMMAND remote:
      +### Modification times and hashes
       
      -The help below will explain what arguments each command takes.
      +HiDrive allows modification times to be set on objects accurate to 1 second.
       
      -See the [backend](https://rclone.org/commands/rclone_backend/) command for more
      -info on how to pass options and arguments.
      +HiDrive supports [its own hash type](https://static.hidrive.com/dev/0001)
      +which is used to verify the integrity of file contents after successful transfers.
       
      -These can be run on a running backend using the rc command
      -[backend/command](https://rclone.org/rc/#backend-command).
      +### Restricted filename characters
       
      -### get
      +HiDrive cannot store files or folders that include
      +`/` (0x2F) or null-bytes (0x00) in their name.
      +Any other characters can be used in the names of files or folders.
      +Additionally, files or folders cannot be named either of the following: `.` or `..`
       
      -Get command for fetching the drive config parameters
      +Therefore rclone will automatically replace these characters,
      +if files or folders are stored or accessed with such names.
       
      -    rclone backend get remote: [options] [<arguments>+]
      +You can read about how this filename encoding works in general
      +[here](overview/#restricted-filenames).
       
      -This is a get command which will be used to fetch the various drive config parameters
      +Keep in mind that HiDrive only supports file or folder names
      +with a length of 255 characters or less.
       
      -Usage Examples:
      +### Transfers
       
      -    rclone backend get drive: [-o service_account_file] [-o chunk_size]
      -    rclone rc backend/command command=get fs=drive: [-o service_account_file] [-o chunk_size]
      +HiDrive limits file sizes per single request to a maximum of 2 GiB.
      +To allow storage of larger files and allow for better upload performance,
      +the hidrive backend will use a chunked transfer for files larger than 96 MiB.
      +Rclone will upload multiple parts/chunks of the file at the same time.
      +Chunks in the process of being uploaded are buffered in memory,
      +so you may want to restrict this behaviour on systems with limited resources.
       
      +You can customize this behaviour using the following options:
       
      -Options:
      +* `chunk_size`: size of file parts
      +* `upload_cutoff`: files larger or equal to this in size will use a chunked transfer
      +* `upload_concurrency`: number of file-parts to upload at the same time
       
      -- "chunk_size": show the current upload chunk size
      -- "service_account_file": show the current service account file
      +See the below section about configuration options for more details.
       
      -### set
      +### Root folder
       
      -Set command for updating the drive config parameters
      +You can set the root folder for rclone.
      +This is the directory that rclone considers to be the root of your HiDrive.
       
      -    rclone backend set remote: [options] [<arguments>+]
      +Usually, you will leave this blank, and rclone will use the root of the account.
       
      -This is a set command which will be used to update the various drive config parameters
      +However, you can set this to restrict rclone to a specific folder hierarchy.
       
      -Usage Examples:
      +This works by prepending the contents of the `root_prefix` option
      +to any paths accessed by rclone.
      +For example, the following two ways to access the home directory are equivalent:
       
      -    rclone backend set drive: [-o service_account_file=sa.json] [-o chunk_size=67108864]
      -    rclone rc backend/command command=set fs=drive: [-o service_account_file=sa.json] [-o chunk_size=67108864]
      +    rclone lsd --hidrive-root-prefix="/users/test/" remote:path
       
      +    rclone lsd remote:/users/test/path
       
      -Options:
      +See the below section about configuration options for more details.
       
      -- "chunk_size": update the current upload chunk size
      -- "service_account_file": update the current service account file
      +### Directory member count
       
      -### shortcut
      +By default, rclone will know the number of directory members contained in a directory.
      +For example, `rclone lsd` uses this information.
       
      -Create shortcuts from files or directories
      +The acquisition of this information will result in additional time costs for HiDrive's API.
      +When dealing with large directory structures, it may be desirable to circumvent this time cost,
      +especially when this information is not explicitly needed.
      +For this, the `disable_fetching_member_count` option can be used.
       
      -    rclone backend shortcut remote: [options] [<arguments>+]
      +See the below section about configuration options for more details.
       
      -This command creates shortcuts from files or directories.
       
      -Usage:
      +### Standard options
       
      -    rclone backend shortcut drive: source_item destination_shortcut
      -    rclone backend shortcut drive: source_item -o target=drive2: destination_shortcut
      +Here are the Standard options specific to hidrive (HiDrive).
       
      -In the first example this creates a shortcut from the "source_item"
      -which can be a file or a directory to the "destination_shortcut". The
      -"source_item" and the "destination_shortcut" should be relative paths
      -from "drive:"
      +#### --hidrive-client-id
       
      -In the second example this creates a shortcut from the "source_item"
      -relative to "drive:" to the "destination_shortcut" relative to
      -"drive2:". This may fail with a permission error if the user
      -authenticated with "drive2:" can't read files from "drive:".
      +OAuth Client Id.
       
      +Leave blank normally.
       
      -Options:
      +Properties:
       
      -- "target": optional target remote for the shortcut destination
      +- Config:      client_id
      +- Env Var:     RCLONE_HIDRIVE_CLIENT_ID
      +- Type:        string
      +- Required:    false
       
      -### drives
      +#### --hidrive-client-secret
       
      -List the Shared Drives available to this account
      +OAuth Client Secret.
       
      -    rclone backend drives remote: [options] [<arguments>+]
      +Leave blank normally.
       
      -This command lists the Shared Drives (Team Drives) available to this
      -account.
      +Properties:
       
      -Usage:
      +- Config:      client_secret
      +- Env Var:     RCLONE_HIDRIVE_CLIENT_SECRET
      +- Type:        string
      +- Required:    false
       
      -    rclone backend [-o config] drives drive:
      +#### --hidrive-scope-access
       
      -This will return a JSON list of objects like this
      +Access permissions that rclone should use when requesting access from HiDrive.
       
      -    [
      -        {
      -            "id": "0ABCDEF-01234567890",
      -            "kind": "drive#teamDrive",
      -            "name": "My Drive"
      -        },
      -        {
      -            "id": "0ABCDEFabcdefghijkl",
      -            "kind": "drive#teamDrive",
      -            "name": "Test Drive"
      -        }
      -    ]
      +Properties:
       
      -With the -o config parameter it will output the list in a format
      -suitable for adding to a config file to make aliases for all the
      -drives found and a combined drive.
      +- Config:      scope_access
      +- Env Var:     RCLONE_HIDRIVE_SCOPE_ACCESS
      +- Type:        string
      +- Default:     "rw"
      +- Examples:
      +    - "rw"
      +        - Read and write access to resources.
      +    - "ro"
      +        - Read-only access to resources.
       
      -    [My Drive]
      -    type = alias
      -    remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=:
      +### Advanced options
       
      -    [Test Drive]
      -    type = alias
      -    remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=:
      +Here are the Advanced options specific to hidrive (HiDrive).
       
      -    [AllDrives]
      -    type = combine
      -    upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:"
      +#### --hidrive-token
       
      -Adding this to the rclone config file will cause those team drives to
      -be accessible with the aliases shown. Any illegal characters will be
      -substituted with "_" and duplicate names will have numbers suffixed.
      -It will also add a remote called AllDrives which shows all the shared
      -drives combined into one directory tree.
      +OAuth Access Token as a JSON blob.
       
      +Properties:
       
      -### untrash
      +- Config:      token
      +- Env Var:     RCLONE_HIDRIVE_TOKEN
      +- Type:        string
      +- Required:    false
       
      -Untrash files and directories
      +#### --hidrive-auth-url
       
      -    rclone backend untrash remote: [options] [<arguments>+]
      +Auth server URL.
       
      -This command untrashes all the files and directories in the directory
      -passed in recursively.
      +Leave blank to use the provider defaults.
       
      -Usage:
      +Properties:
       
      -This takes an optional directory to trash which make this easier to
      -use via the API.
      +- Config:      auth_url
      +- Env Var:     RCLONE_HIDRIVE_AUTH_URL
      +- Type:        string
      +- Required:    false
       
      -    rclone backend untrash drive:directory
      -    rclone backend --interactive untrash drive:directory subdir
      +#### --hidrive-token-url
       
      -Use the --interactive/-i or --dry-run flag to see what would be restored before restoring it.
      +Token server url.
       
      -Result:
      +Leave blank to use the provider defaults.
       
      -    {
      -        "Untrashed": 17,
      -        "Errors": 0
      -    }
      +Properties:
       
      +- Config:      token_url
      +- Env Var:     RCLONE_HIDRIVE_TOKEN_URL
      +- Type:        string
      +- Required:    false
       
      -### copyid
      +#### --hidrive-scope-role
       
      -Copy files by ID
      +User-level that rclone should use when requesting access from HiDrive.
       
      -    rclone backend copyid remote: [options] [<arguments>+]
      +Properties:
       
      -This command copies files by ID
      +- Config:      scope_role
      +- Env Var:     RCLONE_HIDRIVE_SCOPE_ROLE
      +- Type:        string
      +- Default:     "user"
      +- Examples:
      +    - "user"
      +        - User-level access to management permissions.
      +        - This will be sufficient in most cases.
      +    - "admin"
      +        - Extensive access to management permissions.
      +    - "owner"
      +        - Full access to management permissions.
       
      -Usage:
      +#### --hidrive-root-prefix
       
      -    rclone backend copyid drive: ID path
      -    rclone backend copyid drive: ID1 path1 ID2 path2
      +The root/parent folder for all paths.
       
      -It copies the drive file with ID given to the path (an rclone path which
      -will be passed internally to rclone copyto). The ID and path pairs can be
      -repeated.
      +Fill in to use the specified folder as the parent for all paths given to the remote.
      +This way rclone can use any folder as its starting point.
       
      -The path should end with a / to indicate copy the file as named to
      -this directory. If it doesn't end with a / then the last path
      -component will be used as the file name.
      +Properties:
       
      -If the destination is a drive backend then server-side copying will be
      -attempted if possible.
      +- Config:      root_prefix
      +- Env Var:     RCLONE_HIDRIVE_ROOT_PREFIX
      +- Type:        string
      +- Default:     "/"
      +- Examples:
      +    - "/"
      +        - The topmost directory accessible by rclone.
      +        - This will be equivalent with "root" if rclone uses a regular HiDrive user account.
      +    - "root"
      +        - The topmost directory of the HiDrive user account
      +    - ""
      +        - This specifies that there is no root-prefix for your paths.
      +        - When using this you will always need to specify paths to this remote with a valid parent e.g. "remote:/path/to/dir" or "remote:root/path/to/dir".
       
      -Use the --interactive/-i or --dry-run flag to see what would be copied before copying.
      +#### --hidrive-endpoint
       
      +Endpoint for the service.
       
      -### exportformats
      +This is the URL that API-calls will be made to.
       
      -Dump the export formats for debug purposes
      +Properties:
       
      -    rclone backend exportformats remote: [options] [<arguments>+]
      +- Config:      endpoint
      +- Env Var:     RCLONE_HIDRIVE_ENDPOINT
      +- Type:        string
      +- Default:     "https://api.hidrive.strato.com/2.1"
       
      -### importformats
      +#### --hidrive-disable-fetching-member-count
       
      -Dump the import formats for debug purposes
      +Do not fetch number of objects in directories unless it is absolutely necessary.
       
      -    rclone backend importformats remote: [options] [<arguments>+]
      +Requests may be faster if the number of objects in subdirectories is not fetched.
       
      +Properties:
       
      +- Config:      disable_fetching_member_count
      +- Env Var:     RCLONE_HIDRIVE_DISABLE_FETCHING_MEMBER_COUNT
      +- Type:        bool
      +- Default:     false
       
      -## Limitations
      +#### --hidrive-chunk-size
       
      -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 MiB/s but lots of
      -small files can take a long time.
      +Chunksize for chunked uploads.
       
      -Server side copies are also subject to a separate rate limit. If you
      -see User rate limit exceeded errors, wait at least 24 hours and retry.
      -You can disable server-side copies with `--disable copy` to download
      -and upload the files if you prefer.
      +Any files larger than the configured cutoff (or files of unknown size) will be uploaded in chunks of this size.
       
      -### Limitations of Google Docs
      +The upper limit for this is 2147483647 bytes (about 2.000Gi).
      +That is the maximum amount of bytes a single upload-operation will support.
      +Setting this above the upper limit or to a negative value will cause uploads to fail.
       
      -Google docs will appear as size -1 in `rclone ls`, `rclone ncdu` etc,
      -and as size 0 in anything which uses the VFS layer, e.g. `rclone mount`
      -and `rclone serve`. When calculating directory totals, e.g. in
      -`rclone size` and `rclone ncdu`, they will be counted in as empty
      -files.
      +Setting this to larger values may increase the upload speed at the cost of using more memory.
      +It can be set to smaller values smaller to save on memory.
       
      -This is because rclone can't find out the size of the Google docs
      -without downloading them.
      +Properties:
       
      -Google docs will transfer correctly with `rclone sync`, `rclone copy`
      -etc as rclone knows to ignore the size when doing the transfer.
      +- Config:      chunk_size
      +- Env Var:     RCLONE_HIDRIVE_CHUNK_SIZE
      +- Type:        SizeSuffix
      +- Default:     48Mi
       
      -However an unfortunate consequence of this is that you may not be able
      -to download Google docs using `rclone mount`. If it doesn't work you
      -will get a 0 sized file.  If you try again the doc may gain its
      -correct size and be downloadable. Whether it will work on not depends
      -on the application accessing the mount and the OS you are running -
      -experiment to find out if it does work for you!
      +#### --hidrive-upload-cutoff
       
      -### Duplicated files
      +Cutoff/Threshold for chunked uploads.
       
      -Sometimes, for no reason I've been able to track down, drive will
      -duplicate a file that rclone uploads.  Drive unlike all the other
      -remotes can have duplicated files.
      +Any files larger than this will be uploaded in chunks of the configured chunksize.
       
      -Duplicated files cause problems with the syncing and you will see
      -messages in the log about duplicates.
      +The upper limit for this is 2147483647 bytes (about 2.000Gi).
      +That is the maximum amount of bytes a single upload-operation will support.
      +Setting this above the upper limit will cause uploads to fail.
       
      -Use `rclone dedupe` to fix duplicated files.
      +Properties:
       
      -Note that this isn't just a problem with rclone, even Google Photos on
      -Android duplicates files on drive sometimes.
      +- Config:      upload_cutoff
      +- Env Var:     RCLONE_HIDRIVE_UPLOAD_CUTOFF
      +- Type:        SizeSuffix
      +- Default:     96Mi
       
      -### Rclone appears to be re-copying files it shouldn't
      +#### --hidrive-upload-concurrency
       
      -The most likely cause of this is the duplicated file issue above - run
      -`rclone dedupe` and check your logs for duplicate object or directory
      -messages.
      +Concurrency for chunked uploads.
       
      -This can also be caused by a delay/caching on google drive's end when
      -comparing directory listings. Specifically with team drives used in
      -combination with --fast-list. Files that were uploaded recently may
      -not appear on the directory list sent to rclone when using --fast-list.
      +This is the upper limit for how many transfers for the same file are running concurrently.
      +Setting this above to a value smaller than 1 will cause uploads to deadlock.
       
      -Waiting a moderate period of time between attempts (estimated to be
      -approximately 1 hour) and/or not using --fast-list both seem to be
      -effective in preventing the problem.
      +If you are uploading small numbers of large files over high-speed links
      +and these uploads do not fully utilize your bandwidth, then increasing
      +this may help to speed up the transfers.
       
      -## Making your own client_id
      +Properties:
       
      -When you use rclone with Google drive in its default configuration you
      -are using rclone's client_id.  This is shared between all the rclone
      -users.  There is a global rate limit on the number of queries per
      -second that each client_id can do set by Google.  rclone already has a
      -high quota and I will continue to make sure it is high enough by
      -contacting Google.
      +- Config:      upload_concurrency
      +- Env Var:     RCLONE_HIDRIVE_UPLOAD_CONCURRENCY
      +- Type:        int
      +- Default:     4
       
      -It is strongly recommended to use your own client ID as the default rclone ID is heavily used. If you have multiple services running, it is recommended to use an API key for each service. The default Google quota is 10 transactions per second so it is recommended to stay under that number as if you use more than that, it will cause rclone to rate limit and make things slower.
      +#### --hidrive-encoding
       
      -Here is how to create your own Google Drive client ID for rclone:
      +The encoding for the backend.
       
      -1. Log into the [Google API
      -Console](https://console.developers.google.com/) with your Google
      -account. It doesn't matter what Google account you use. (It need not
      -be the same account as the Google Drive you want to access)
      +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
       
      -2. Select a project or create a new project.
      +Properties:
       
      -3. Under "ENABLE APIS AND SERVICES" search for "Drive", and enable the
      -"Google Drive API".
      +- Config:      encoding
      +- Env Var:     RCLONE_HIDRIVE_ENCODING
      +- Type:        Encoding
      +- Default:     Slash,Dot
       
      -4. Click "Credentials" in the left-side panel (not "Create
      -credentials", which opens the wizard).
       
      -5. If you already configured an "Oauth Consent Screen", then skip
      -to the next step; if not, click on "CONFIGURE CONSENT SCREEN" button 
      -(near the top right corner of the right panel), then select "External"
      -and click on "CREATE"; on the next screen, enter an "Application name"
      -("rclone" is OK); enter "User Support Email" (your own email is OK); 
      -enter "Developer Contact Email" (your own email is OK); then click on
      -"Save" (all other data is optional). You will also have to add some scopes,
      -including `.../auth/docs` and `.../auth/drive` in order to be able to edit,
      -create and delete files with RClone. You may also want to include the
      -`../auth/drive.metadata.readonly` scope. After adding scopes, click
      -"Save and continue" to add test users. Be sure to add your own account to
      -the test users. Once you've added yourself as a test user and saved the
      -changes, click again on "Credentials" on the left panel to go back to
      -the "Credentials" screen.
       
      -   (PS: if you are a GSuite user, you could also select "Internal" instead
      -of "External" above, but this will restrict API use to Google Workspace 
      -users in your organisation). 
      +## Limitations
       
      -6.  Click on the "+ CREATE CREDENTIALS" button at the top of the screen,
      -then select "OAuth client ID".
      +### Symbolic links
       
      -7. Choose an application type of "Desktop app" and click "Create". (the default name is fine)
      +HiDrive is able to store symbolic links (*symlinks*) by design,
      +for example, when unpacked from a zip archive.
       
      -8. It will show you a client ID and client secret. Make a note of these.
      -   
      -   (If you selected "External" at Step 5 continue to Step 9. 
      -   If you chose "Internal" you don't need to publish and can skip straight to
      -   Step 10 but your destination drive must be part of the same Google Workspace.)
      +There exists no direct mechanism to manage native symlinks in remotes.
      +As such this implementation has chosen to ignore any native symlinks present in the remote.
      +rclone will not be able to access or show any symlinks stored in the hidrive-remote.
      +This means symlinks cannot be individually removed, copied, or moved,
      +except when removing, copying, or moving the parent folder.
       
      -9. Go to "Oauth consent screen" and then click "PUBLISH APP" button and confirm.
      -   You will also want to add yourself as a test user.
      +*This does not affect the `.rclonelink`-files
      +that rclone uses to encode and store symbolic links.*
       
      -10. Provide the noted client ID and client secret to rclone.
      +### Sparse files
       
      -Be aware that, due to the "enhanced security" recently introduced by
      -Google, you are theoretically expected to "submit your app for verification"
      -and then wait a few weeks(!) for their response; in practice, you can go right
      -ahead and use the client ID and client secret with rclone, the only issue will
      -be a very scary confirmation screen shown when you connect via your browser 
      -for rclone to be able to get its token-id (but as this only happens during 
      -the remote configuration, it's not such a big deal). Keeping the application in
      -"Testing" will work as well, but the limitation is that any grants will expire
      -after a week, which can be annoying to refresh constantly. If, for whatever
      -reason, a short grant time is not a problem, then keeping the application in
      -testing mode would also be sufficient.
      +It is possible to store sparse files in HiDrive.
       
      -(Thanks to @balazer on github for these instructions.)
      +Note that copying a sparse file will expand the holes
      +into null-byte (0x00) regions that will then consume disk space.
      +Likewise, when downloading a sparse file,
      +the resulting file will have null-byte regions in the place of file holes.
       
      -Sometimes, creation of an OAuth consent in Google API Console fails due to an error message
      -“The request failed because changes to one of the field of the resource is not supported”.
      -As a convenient workaround, the necessary Google Drive API key can be created on the
      -[Python Quickstart](https://developers.google.com/drive/api/v3/quickstart/python) page.
      -Just push the Enable the Drive API button to receive the Client ID and Secret.
      -Note that it will automatically create a new project in the API Console.
      +#  HTTP
       
      -#  Google Photos
      +The HTTP remote is a read only remote for reading files of a
      +webserver.  The webserver should provide file listings which rclone
      +will read and turn into a remote.  This has been tested with common
      +webservers such as Apache/Nginx/Caddy and will likely work with file
      +listings from most web servers.  (If it doesn't then please file an
      +issue, or send a pull request!)
       
      -The rclone backend for [Google Photos](https://www.google.com/photos/about/) is
      -a specialized backend for transferring photos and videos to and from
      -Google Photos.
      +Paths are specified as `remote:` or `remote:path`.
       
      -**NB** The Google Photos API which rclone uses has quite a few
      -limitations, so please read the [limitations section](#limitations)
      -carefully to make sure it is suitable for your use.
      +The `remote:` represents the configured [url](#http-url), and any path following
      +it will be resolved relative to this url, according to the URL standard. This
      +means with remote url `https://beta.rclone.org/branch` and path `fix`, the
      +resolved URL will be `https://beta.rclone.org/branch/fix`, while with path
      +`/fix` the resolved URL will be `https://beta.rclone.org/fix` as the absolute
      +path is resolved from the root of the domain.
       
      -## Configuration
      +If the path following the `remote:` ends with `/` it will be assumed to point
      +to a directory. If the path does not end with `/`, then a HEAD request is sent
      +and the response used to decide if it it is treated as a file or a directory
      +(run with `-vv` to see details). When [--http-no-head](#http-no-head) is
      +specified, a path without ending `/` is always assumed to be a file. If rclone
      +incorrectly assumes the path is a file, the solution is to specify the path with
      +ending `/`. When you know the path is a directory, ending it with `/` is always
      +better as it avoids the initial HEAD request.
       
      -The initial setup for google cloud storage involves getting a token from Google Photos
      -which you need to do in your browser.  `rclone config` walks you
      -through it.
      +To just download a single file it is easier to use
      +[copyurl](https://rclone.org/commands/rclone_copyurl/).
       
      -Here is an example of how to make a remote called `remote`.  First run:
      +## Configuration
       
      -     rclone config
      +Here is an example of how to make a remote called `remote`.  First
      +run:
       
      -This will guide you through an interactive setup process:
      -
      -

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / Google Photos  "google photos" [snip] Storage> google photos ** See help for google photos backend at: https://rclone.org/googlephotos/ **

      -

      Google Application Client Id Leave blank normally. Enter a string value. Press Enter for the default (""). client_id> Google Application Client Secret Leave blank normally. Enter a string value. Press Enter for the default (""). client_secret> Set to make the Google Photos backend read only.

      -

      If you choose read only then rclone will only request read only access to your photos, otherwise rclone will request full access. Enter a boolean value (true or false). Press Enter for the default ("false"). read_only> Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config Use web browser to automatically authenticate rclone with remote? * Say Y if the machine running rclone has a web browser you can use * Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N. 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

      -

      *** IMPORTANT: All media items uploaded to Google Photos with rclone *** are stored in full resolution at original quality. These uploads *** will count towards storage in your Google Account.

      - --- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      [remote] type = google photos token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2019-06-28T17:38:04.644930156+01:00"}
      y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y ```
      See the remote setup docs for how to set it up on a machine with no Internet browser available.
      Note that rclone runs a webserver on your local machine to collect the token as returned from Google if using web browser to automatically authenticate. This only runs from the moment it opens your browser to the moment you get back the verification code. This is on http://127.0.0.1:53682/ and this may require you to unblock it temporarily if you are running a host firewall, or use manual mode.
      This remote is called remote and can now be used like this
      See all the albums in your photos
      rclone lsd remote:album
      Make a new album
      rclone mkdir remote:album/newAlbum
      List the contents of an album
      rclone ls remote:album/newAlbum
      Sync /home/local/images to the Google Photos, removing any excess files in the album.
      rclone sync --interactive /home/local/image remote:album/newAlbum
      ### Layout
      As Google Photos is not a general purpose cloud storage system, the backend is laid out to help you navigate it.
      The directories under media show different ways of categorizing the media. Each file will appear multiple times. So if you want to make a backup of your google photos you might choose to backup remote:media/by-month. (NB remote:media/by-day is rather slow at the moment so avoid for syncing.)
      Note that all your photos and videos will appear somewhere under media, but they may not appear under album unless you've put them into albums.
      / - upload - file1.jpg - file2.jpg - ... - media - all - file1.jpg - file2.jpg - ... - by-year - 2000 - file1.jpg - ... - 2001 - file2.jpg - ... - ... - by-month - 2000 - 2000-01 - file1.jpg - ... - 2000-02 - file2.jpg - ... - ... - by-day - 2000 - 2000-01-01 - file1.jpg - ... - 2000-01-02 - file2.jpg - ... - ... - album - album name - album name/sub - shared-album - album name - album name/sub - feature - favorites - file1.jpg - file2.jpg
      There are two writable parts of the tree, the upload directory and sub directories of the album directory.
      The upload directory is for uploading files you don't want to put into albums. This will be empty to start with and will contain the files you've uploaded for one rclone session only, becoming empty again when you restart rclone. The use case for this would be if you have a load of files you just want to once off dump into Google Photos. For repeated syncing, uploading to album will work better.
      Directories within the album directory are also writeable and you may create new directories (albums) under album. If you copy files with a directory hierarchy in there then rclone will create albums with the / character in them. For example if you do
      rclone copy /path/to/images remote:album/images
      and the images directory contains
      images - file1.jpg dir file2.jpg dir2 dir3 file3.jpg
      Then rclone will create the following albums with the following files in
      - images - file1.jpg - images/dir - file2.jpg - images/dir2/dir3 - file3.jpg
      This means that you can use the album path pretty much like a normal filesystem and it is a good target for repeated syncing.
      The shared-album directory shows albums shared with you or by you. This is similar to the Sharing tab in the Google Photos web interface.
      ### Standard options
      Here are the Standard options specific to google photos (Google Photos).
      #### --gphotos-client-id
      OAuth Client Id.
      Leave blank normally.
      Properties:
      - Config: client_id - Env Var: RCLONE_GPHOTOS_CLIENT_ID - Type: string - Required: false
      #### --gphotos-client-secret
      OAuth Client Secret.
      Leave blank normally.
      Properties:
      - Config: client_secret - Env Var: RCLONE_GPHOTOS_CLIENT_SECRET - Type: string - Required: false
      #### --gphotos-read-only
      Set to make the Google Photos backend read only.
      If you choose read only then rclone will only request read only access to your photos, otherwise rclone will request full access.
      Properties:
      - Config: read_only - Env Var: RCLONE_GPHOTOS_READ_ONLY - Type: bool - Default: false
      ### Advanced options
      Here are the Advanced options specific to google photos (Google Photos).
      #### --gphotos-token
      OAuth Access Token as a JSON blob.
      Properties:
      - Config: token - Env Var: RCLONE_GPHOTOS_TOKEN - Type: string - Required: false
      #### --gphotos-auth-url
      Auth server URL.
      Leave blank to use the provider defaults.
      Properties:
      - Config: auth_url - Env Var: RCLONE_GPHOTOS_AUTH_URL - Type: string - Required: false
      #### --gphotos-token-url
      Token server url.
      Leave blank to use the provider defaults.
      Properties:
      - Config: token_url - Env Var: RCLONE_GPHOTOS_TOKEN_URL - Type: string - Required: false
      #### --gphotos-read-size
      Set to read the size of media items.
      Normally rclone does not read the size of media items since this takes another transaction. This isn't necessary for syncing. However rclone mount needs to know the size of files in advance of reading them, so setting this flag when using rclone mount is recommended if you want to read the media.
      Properties:
      - Config: read_size - Env Var: RCLONE_GPHOTOS_READ_SIZE - Type: bool - Default: false
      #### --gphotos-start-year
      Year limits the photos to be downloaded to those which are uploaded after the given year.
      Properties:
      - Config: start_year - Env Var: RCLONE_GPHOTOS_START_YEAR - Type: int - Default: 2000
      #### --gphotos-include-archived
      Also view and download archived media.
      By default, rclone does not request archived media. Thus, when syncing, archived media is not visible in directory listings or transferred.
      Note that media in albums is always visible and synced, no matter their archive status.
      With this flag, archived media are always visible in directory listings and transferred.
      Without this flag, archived media will not be visible in directory listings and won't be transferred.
      Properties:
      - Config: include_archived - Env Var: RCLONE_GPHOTOS_INCLUDE_ARCHIVED - Type: bool - Default: false
      #### --gphotos-encoding
      The encoding for the backend.
      See the encoding section in the overview for more info.
      Properties:
      - Config: encoding - Env Var: RCLONE_GPHOTOS_ENCODING - Type: MultiEncoder - Default: Slash,CrLf,InvalidUtf8,Dot
      ## Limitations
      Only images and videos can be uploaded. If you attempt to upload non videos or images or formats that Google Photos doesn't understand, rclone will upload the file, then Google Photos will give an error when it is put turned into a media item.
      Note that all media items uploaded to Google Photos through the API are stored in full resolution at "original quality" and will count towards your storage quota in your Google Account. The API does not offer a way to upload in "high quality" mode..
      rclone about is not supported by the Google Photos backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.
      See List of backends that do not support rclone about See rclone about
      ### Downloading Images
      When Images are downloaded this strips EXIF location (according to the docs and my tests). This is a limitation of the Google Photos API and is covered by bug #112096115.
      The current google API does not allow photos to be downloaded at original resolution. This is very important if you are, for example, relying on "Google Photos" as a backup of your photos. You will not be able to use rclone to redownload original images. You could use 'google takeout' to recover the original photos as a last resort
      ### Downloading Videos
      When videos are downloaded they are downloaded in a really compressed version of the video compared to downloading it via the Google Photos web interface. This is covered by bug #113672044.
      ### Duplicates
      If a file name is duplicated in a directory then rclone will add the file ID into its name. So two files called file.jpg would then appear as file {123456}.jpg and file {ABCDEF}.jpg (the actual IDs are a lot longer alas!).
      If you upload the same image (with the same binary data) twice then Google Photos will deduplicate it. However it will retain the filename from the first upload which may confuse rclone. For example if you uploaded an image to upload then uploaded the same image to album/my_album the filename of the image in album/my_album will be what it was uploaded with initially, not what you uploaded it with to album. In practise this shouldn't cause too many problems.
      ### Modified time
      The date shown of media in Google Photos is the creation date as determined by the EXIF information, or the upload date if that is not known.
      This is not changeable by rclone and is not the modification date of the media on local disk. This means that rclone cannot use the dates from Google Photos for syncing purposes.
      ### Size
      The Google Photos API does not return the size of media. This means that when syncing to Google Photos, rclone can only do a file existence check.
      It is possible to read the size of the media, but this needs an extra HTTP HEAD request per media item so is very slow and uses up a lot of transactions. This can be enabled with the --gphotos-read-size option or the read_size = true config parameter.
      If you want to use the backend with rclone mount you may need to enable this flag (depending on your OS and application using the photos) otherwise you may not be able to read media off the mount. You'll need to experiment to see if it works for you without the flag.
      ### Albums
      Rclone can only upload files to albums it created. This is a limitation of the Google Photos API.
      Rclone can remove files it uploaded from albums it created only.
      ### Deleting files
      Rclone can remove files from albums it created, but note that the Google Photos API does not allow media to be deleted permanently so this media will still remain. See bug #109759781.
      Rclone cannot delete files anywhere except under album.
      ### Deleting albums
      The Google Photos API does not support deleting albums - see bug #135714733.
      # Hasher
      Hasher is a special overlay backend to create remotes which handle checksums for other remotes. It's main functions include: - Emulate hash types unimplemented by backends - Cache checksums to help with slow hashing of large local or (S)FTP files - Warm up checksum cache from external SUM files
      ## Getting started
      To use Hasher, first set up the underlying remote following the configuration instructions for that remote. You can also use a local pathname instead of a remote. Check that your base remote is working.
      Let's call the base remote myRemote:path here. Note that anything inside myRemote:path will be handled by hasher and anything outside won't. This means that if you are using a bucket based remote (S3, B2, Swift) then you should put the bucket in the remote s3:bucket.
      Now proceed to interactive or manual configuration.
      ### Interactive configuration
      Run rclone config: ``` No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> Hasher1 Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Handle checksums for other remotes  "hasher" [snip] Storage> hasher Remote to cache checksums for, like myremote:mypath. Enter a string value. Press Enter for the default (""). remote> myRemote:path Comma separated list of supported checksum types. Enter a string value. Press Enter for the default ("md5,sha1"). hashsums> md5 Maximum time to keep checksums in cache. 0 = no cache, off = cache forever. max_age> off Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config
      -

      [Hasher1] type = hasher remote = myRemote:path hashsums = md5 max_age = off -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

      -
      
      -### Manual configuration
      +     rclone config
       
      -Run `rclone config path` to see the path of current active config file,
      -usually `YOURHOME/.config/rclone/rclone.conf`.
      -Open it in your favorite text editor, find section for the base remote
      -and create new section for hasher like in the following examples:
      +This will guide you through an interactive setup process:
       
      -

      [Hasher1] type = hasher remote = myRemote:path hashes = md5 max_age = off

      -

      [Hasher2] type = hasher remote = /local/path hashes = dropbox,sha1 max_age = 24h

      +

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / HTTP  "http" [snip] Storage> http URL of http host to connect to Choose a number from below, or type in your own value 1 / Connect to example.com  "https://example.com" url> https://beta.rclone.org Remote config -------------------- [remote] url = https://beta.rclone.org -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Current remotes:

      +

      Name Type ==== ==== remote http

      +
        +
      1. Edit existing remote
      2. +
      3. New remote
      4. +
      5. Delete remote
      6. +
      7. Rename remote
      8. +
      9. Copy remote
      10. +
      11. Set configuration password
      12. +
      13. Quit config e/n/d/r/c/s/q> q
      14. +
      
      -Hasher takes basically the following parameters:
      -- `remote` is required,
      -- `hashes` is a comma separated list of supported checksums
      -   (by default `md5,sha1`),
      -- `max_age` - maximum time to keep a checksum value in the cache,
      -   `0` will disable caching completely,
      -   `off` will cache "forever" (that is until the files get changed).
      +This remote is called `remote` and can now be used like this
       
      -Make sure the `remote` has `:` (colon) in. If you specify the remote without
      -a colon then rclone will use a local directory of that name. So if you use
      -a remote of `/local/path` then rclone will handle hashes for that directory.
      -If you use `remote = name` literally then rclone will put files
      -**in a directory called `name` located under current directory**.
      +See all the top level directories
       
      -## Usage
      +    rclone lsd remote:
       
      -### Basic operations
      +List the contents of a directory
       
      -Now you can use it as `Hasher2:subdir/file` instead of base remote.
      -Hasher will transparently update cache with new checksums when a file
      -is fully read or overwritten, like:
      -

      rclone copy External:path/file Hasher:dest/path

      -

      rclone cat Hasher:path/to/file > /dev/null

      -
      
      -The way to refresh **all** cached checksums (even unsupported by the base backend)
      -for a subtree is to **re-download** all files in the subtree. For example,
      -use `hashsum --download` using **any** supported hashsum on the command line
      -(we just care to re-read):
      -

      rclone hashsum MD5 --download Hasher:path/to/subtree > /dev/null

      -

      rclone backend dump Hasher:path/to/subtree

      -
      
      -You can print or drop hashsum cache using custom backend commands:
      -

      rclone backend dump Hasher:dir/subdir

      -

      rclone backend drop Hasher:

      -
      
      -### Pre-Seed from a SUM File
      +    rclone ls remote:directory
       
      -Hasher supports two backend commands: generic SUM file `import` and faster
      -but less consistent `stickyimport`.
      -
      -

      rclone backend import Hasher:dir/subdir SHA1 /path/to/SHA1SUM [--checkers 4]

      -
      
      -Instead of SHA1 it can be any hash supported by the remote. The last argument
      -can point to either a local or an `other-remote:path` text file in SUM format.
      -The command will parse the SUM file, then walk down the path given by the
      -first argument, snapshot current fingerprints and fill in the cache entries
      -correspondingly.
      -- Paths in the SUM file are treated as relative to `hasher:dir/subdir`.
      -- The command will **not** check that supplied values are correct.
      -  You **must know** what you are doing.
      -- This is a one-time action. The SUM file will not get "attached" to the
      -  remote. Cache entries can still be overwritten later, should the object's
      -  fingerprint change.
      -- The tree walk can take long depending on the tree size. You can increase
      -  `--checkers` to make it faster. Or use `stickyimport` if you don't care
      -  about fingerprints and consistency.
      -
      -

      rclone backend stickyimport hasher:path/to/data sha1 remote:/path/to/sum.sha1

      -
      
      -`stickyimport` is similar to `import` but works much faster because it
      -does not need to stat existing files and skips initial tree walk.
      -Instead of binding cache entries to file fingerprints it creates _sticky_
      -entries bound to the file name alone ignoring size, modification time etc.
      -Such hash entries can be replaced only by `purge`, `delete`, `backend drop`
      -or by full re-read/re-write of the files.
      +Sync the remote `directory` to `/home/local/directory`, deleting any excess files.
       
      -## Configuration reference
      +    rclone sync --interactive remote:directory /home/local/directory
      +
      +### Read only
      +
      +This remote is read only - you can't upload files to an HTTP server.
      +
      +### Modification times
      +
      +Most HTTP servers store time accurate to 1 second.
      +
      +### Checksum
      +
      +No checksums are stored.
      +
      +### Usage without a config file
      +
      +Since the http remote only has one config parameter it is easy to use
      +without a config file:
      +
      +    rclone lsd --http-url https://beta.rclone.org :http:
      +
      +or:
      +
      +    rclone lsd :http,url='https://beta.rclone.org':
       
       
       ### Standard options
       
      -Here are the Standard options specific to hasher (Better checksums for other remotes).
      +Here are the Standard options specific to http (HTTP).
       
      -#### --hasher-remote
      +#### --http-url
       
      -Remote to cache checksums for (e.g. myRemote:path).
      +URL of HTTP host to connect to.
      +
      +E.g. "https://example.com", or "https://user:pass@example.com" to use a username and password.
       
       Properties:
       
      -- Config:      remote
      -- Env Var:     RCLONE_HASHER_REMOTE
      +- Config:      url
      +- Env Var:     RCLONE_HTTP_URL
       - Type:        string
       - Required:    true
       
      -#### --hasher-hashes
      +### Advanced options
       
      -Comma separated list of supported checksum types.
      +Here are the Advanced options specific to http (HTTP).
       
      -Properties:
      +#### --http-headers
       
      -- Config:      hashes
      -- Env Var:     RCLONE_HASHER_HASHES
      -- Type:        CommaSepList
      -- Default:     md5,sha1
      +Set HTTP headers for all transactions.
       
      -#### --hasher-max-age
      +Use this to set additional HTTP headers for all transactions.
       
      -Maximum time to keep checksums in cache (0 = no cache, off = cache forever).
      +The input format is comma separated list of key,value pairs.  Standard
      +[CSV encoding](https://godoc.org/encoding/csv) may be used.
      +
      +For example, to set a Cookie use 'Cookie,name=value', or '"Cookie","name=value"'.
      +
      +You can set multiple headers, e.g. '"Cookie","name=value","Authorization","xxx"'.
       
       Properties:
       
      -- Config:      max_age
      -- Env Var:     RCLONE_HASHER_MAX_AGE
      -- Type:        Duration
      -- Default:     off
      +- Config:      headers
      +- Env Var:     RCLONE_HTTP_HEADERS
      +- Type:        CommaSepList
      +- Default:     
       
      -### Advanced options
      +#### --http-no-slash
       
      -Here are the Advanced options specific to hasher (Better checksums for other remotes).
      +Set this if the site doesn't end directories with /.
       
      -#### --hasher-auto-size
      +Use this if your target website does not use / on the end of
      +directories.
       
      -Auto-update checksum for files smaller than this size (disabled by default).
      +A / on the end of a path is how rclone normally tells the difference
      +between files and directories.  If this flag is set, then rclone will
      +treat all files with Content-Type: text/html as directories and read
      +URLs from them rather than downloading them.
      +
      +Note that this may cause rclone to confuse genuine HTML files with
      +directories.
       
       Properties:
       
      -- Config:      auto_size
      -- Env Var:     RCLONE_HASHER_AUTO_SIZE
      -- Type:        SizeSuffix
      -- Default:     0
      +- Config:      no_slash
      +- Env Var:     RCLONE_HTTP_NO_SLASH
      +- Type:        bool
      +- Default:     false
       
      -### Metadata
      +#### --http-no-head
       
      -Any metadata supported by the underlying remote is read and written.
      +Don't use HEAD requests.
       
      -See the [metadata](https://rclone.org/docs/#metadata) docs for more info.
      +HEAD requests are mainly used to find file sizes in dir listing.
      +If your site is being very slow to load then you can try this option.
      +Normally rclone does a HEAD request for each potential file in a
      +directory listing to:
      +
      +- find its size
      +- check it really exists
      +- check to see if it is a directory
      +
      +If you set this option, rclone will not do the HEAD request. This will mean
      +that directory listings are much quicker, but rclone won't have the times or
      +sizes of any files, and some files that don't exist may be in the listing.
      +
      +Properties:
      +
      +- Config:      no_head
      +- Env Var:     RCLONE_HTTP_NO_HEAD
      +- Type:        bool
      +- Default:     false
       
       ## Backend commands
       
      -Here are the commands specific to the hasher backend.
      +Here are the commands specific to the http backend.
       
       Run them with
       
      @@ -25403,263 +25379,383 @@ 

      Synology C2 Object Storage

      These can be run on a running backend using the rc command [backend/command](https://rclone.org/rc/#backend-command). -### drop +### set -Drop cache +Set command for updating the config parameters. - rclone backend drop remote: [options] [<arguments>+] + rclone backend set remote: [options] [<arguments>+] -Completely drop checksum cache. -Usage Example: - rclone backend drop hasher: +This set command can be used to update the config parameters +for a running http backend. +Usage Examples: -### dump + rclone backend set remote: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=remote: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=remote: -o url=https://example.com -Dump the database +The option keys are named as they are in the config file. - rclone backend dump remote: [options] [<arguments>+] +This rebuilds the connection to the http backend when it is called with +the new parameters. Only new parameters need be passed as the values +will default to those currently in use. -Dump cache records covered by the current remote +It doesn't return anything. -### fulldump -Full dump of the database - rclone backend fulldump remote: [options] [<arguments>+] -Dump all cache records in the database +## Limitations -### import +`rclone about` is not supported by the HTTP backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. -Import a SUM file +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) - rclone backend import remote: [options] [<arguments>+] +# ImageKit +This is a backend for the [ImageKit.io](https://imagekit.io/) storage service. -Amend hash cache from a SUM file and bind checksums to files by size/time. -Usage Example: - rclone backend import hasher:subdir md5 /path/to/sum.md5 +#### About ImageKit +[ImageKit.io](https://imagekit.io/) provides real-time image and video optimizations, transformations, and CDN delivery. Over 1,000 businesses and 70,000 developers trust ImageKit with their images and videos on the web. -### stickyimport +#### Accounts & Pricing -Perform fast import of a SUM file +To use this backend, you need to [create an account](https://imagekit.io/registration/) on ImageKit. Start with a free plan with generous usage limits. Then, as your requirements grow, upgrade to a plan that best fits your needs. See [the pricing details](https://imagekit.io/plans). - rclone backend stickyimport remote: [options] [<arguments>+] +## Configuration -Fill hash cache from a SUM file without verifying file fingerprints. -Usage Example: - rclone backend stickyimport hasher:subdir md5 remote:path/to/sum.md5 +Here is an example of making an imagekit configuration. +Firstly create a [ImageKit.io](https://imagekit.io/) account and choose a plan. +You will need to log in and get the `publicKey` and `privateKey` for your account from the developer section. +Now run
      +

      rclone config

      +
      
      +This will guide you through an interactive setup process:
      +
      +

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n

      +

      Enter the name for the new remote. name> imagekit-media-library

      +

      Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. [snip] XX / ImageKit.io  (imagekit) [snip] Storage> imagekit

      +

      Option endpoint. You can find your ImageKit.io URL endpoint in your dashboard Enter a value. endpoint> https://ik.imagekit.io/imagekit_id

      +

      Option public_key. You can find your ImageKit.io public key in your dashboard Enter a value. public_key> public_****************************

      +

      Option private_key. You can find your ImageKit.io private key in your dashboard Enter a value. private_key> private_****************************

      +

      Edit advanced config? y) Yes n) No (default) y/n> n

      +

      Configuration complete. Options: - type: imagekit - endpoint: https://ik.imagekit.io/imagekit_id - public_key: public_**************************** - private_key: private_****************************

      +

      Keep this "imagekit-media-library" remote? y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      +
      List directories in the top level of your Media Library
      +

      rclone lsd imagekit-media-library:

      +
      Make a new directory.
      +

      rclone mkdir imagekit-media-library:directory

      +
      List the contents of a directory.
      +

      rclone ls imagekit-media-library:directory

      +
      
      +###   Modified time and hashes
       
      -## Implementation details (advanced)
      +ImageKit does not support modification times or hashes yet.
       
      -This section explains how various rclone operations work on a hasher remote.
      +### Checksums
       
      -**Disclaimer. This section describes current implementation which can
      -change in future rclone versions!.**
      +No checksums are supported.
       
      -### Hashsum command
       
      -The `rclone hashsum` (or `md5sum` or `sha1sum`) command will:
      +### Standard options
       
      -1. if requested hash is supported by lower level, just pass it.
      -2. if object size is below `auto_size` then download object and calculate
      -   _requested_ hashes on the fly.
      -3. if unsupported and the size is big enough, build object `fingerprint`
      -   (including size, modtime if supported, first-found _other_ hash if any).
      -4. if the strict match is found in cache for the requested remote, return
      -   the stored hash.
      -5. if remote found but fingerprint mismatched, then purge the entry and
      -   proceed to step 6.
      -6. if remote not found or had no requested hash type or after step 5:
      -   download object, calculate all _supported_ hashes on the fly and store
      -   in cache; return requested hash.
      +Here are the Standard options specific to imagekit (ImageKit.io).
       
      -### Other operations
      +#### --imagekit-endpoint
       
      -- whenever a file is uploaded or downloaded **in full**, capture the stream
      -  to calculate all supported hashes on the fly and update database
      -- server-side `move`  will update keys of existing cache entries
      -- `deletefile` will remove a single cache entry
      -- `purge` will remove all cache entries under the purged path
      +You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys)
       
      -Note that setting `max_age = 0` will disable checksum caching completely.
      +Properties:
       
      -If you set `max_age = off`, checksums in cache will never age, unless you
      -fully rewrite or delete the file.
      +- Config:      endpoint
      +- Env Var:     RCLONE_IMAGEKIT_ENDPOINT
      +- Type:        string
      +- Required:    true
       
      -### Cache storage
      +#### --imagekit-public-key
       
      -Cached checksums are stored as `bolt` database files under rclone cache
      -directory, usually `~/.cache/rclone/kv/`. Databases are maintained
      -one per _base_ backend, named like `BaseRemote~hasher.bolt`.
      -Checksums for multiple `alias`-es into a single base backend
      -will be stored in the single database. All local paths are treated as
      -aliases into the `local` backend (unless encrypted or chunked) and stored
      -in `~/.cache/rclone/kv/local~hasher.bolt`.
      -Databases can be shared between multiple rclone processes.
      +You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys)
       
      -#  HDFS
      +Properties:
       
      -[HDFS](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html) is a
      -distributed file-system, part of the [Apache Hadoop](https://hadoop.apache.org/) framework.
      +- Config:      public_key
      +- Env Var:     RCLONE_IMAGEKIT_PUBLIC_KEY
      +- Type:        string
      +- Required:    true
       
      -Paths are specified as `remote:` or `remote:path/to/dir`.
      +#### --imagekit-private-key
       
      -## Configuration
      +You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys)
       
      -Here is an example of how to make a remote called `remote`. First run:
      +Properties:
       
      -     rclone config
      +- Config:      private_key
      +- Env Var:     RCLONE_IMAGEKIT_PRIVATE_KEY
      +- Type:        string
      +- Required:    true
       
      -This will guide you through an interactive setup process:
      -
      -

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [skip] XX / Hadoop distributed file system  "hdfs" [skip] Storage> hdfs ** See help for hdfs backend at: https://rclone.org/hdfs/ **

      -

      hadoop name node and port Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / Connect to host namenode at port 8020  "namenode:8020" namenode> namenode.hadoop:8020 hadoop user name Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / Connect to hdfs as root  "root" username> root Edit advanced config? (y/n) y) Yes n) No (default) y/n> n Remote config -------------------- [remote] type = hdfs namenode = namenode.hadoop:8020 username = root -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y Current remotes:

      -

      Name Type ==== ==== hadoop hdfs

      -
        -
      1. Edit existing remote
      2. -
      3. New remote
      4. -
      5. Delete remote
      6. -
      7. Rename remote
      8. -
      9. Copy remote
      10. -
      11. Set configuration password
      12. -
      13. Quit config e/n/d/r/c/s/q> q
      14. -
      -
      
      -This remote is called `remote` and can now be used like this
      +### Advanced options
       
      -See all the top level directories
      +Here are the Advanced options specific to imagekit (ImageKit.io).
       
      -    rclone lsd remote:
      +#### --imagekit-only-signed
       
      -List the contents of a directory
      +If you have configured `Restrict unsigned image URLs` in your dashboard settings, set this to true.
       
      -    rclone ls remote:directory
      +Properties:
       
      -Sync the remote `directory` to `/home/local/directory`, deleting any excess files.
      +- Config:      only_signed
      +- Env Var:     RCLONE_IMAGEKIT_ONLY_SIGNED
      +- Type:        bool
      +- Default:     false
       
      -    rclone sync --interactive remote:directory /home/local/directory
      +#### --imagekit-versions
       
      -### Setting up your own HDFS instance for testing
      +Include old versions in directory listings.
       
      -You may start with a [manual setup](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/SingleCluster.html)
      -or use the docker image from the tests:
      +Properties:
       
      -If you want to build the docker image
      -
      -

      git clone https://github.com/rclone/rclone.git cd rclone/fstest/testserver/images/test-hdfs docker build --rm -t rclone/test-hdfs .

      -
      
      -Or you can just use the latest one pushed
      -
      -

      docker run --rm --name "rclone-hdfs" -p 127.0.0.1:9866:9866 -p 127.0.0.1:8020:8020 --hostname "rclone-hdfs" rclone/test-hdfs

      -
      
      -**NB** it need few seconds to startup.
      +- Config:      versions
      +- Env Var:     RCLONE_IMAGEKIT_VERSIONS
      +- Type:        bool
      +- Default:     false
       
      -For this docker image the remote needs to be configured like this:
      -
      -

      [remote] type = hdfs namenode = 127.0.0.1:8020 username = root

      -
      
      -You can stop this image with `docker kill rclone-hdfs` (**NB** it does not use volumes, so all data
      -uploaded will be lost.)
      +#### --imagekit-upload-tags
       
      -### Modified time
      +Tags to add to the uploaded files, e.g. "tag1,tag2".
       
      -Time accurate to 1 second is stored.
      +Properties:
       
      -### Checksum
      +- Config:      upload_tags
      +- Env Var:     RCLONE_IMAGEKIT_UPLOAD_TAGS
      +- Type:        string
      +- Required:    false
       
      -No checksums are implemented.
      +#### --imagekit-encoding
       
      -### Usage information
      +The encoding for the backend.
       
      -You can use the `rclone about remote:` command which will display filesystem size and current usage.
      +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
       
      -### Restricted filename characters
      +Properties:
       
      -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
      -the following characters are also replaced:
      +- Config:      encoding
      +- Env Var:     RCLONE_IMAGEKIT_ENCODING
      +- Type:        Encoding
      +- Default:     Slash,LtGt,DoubleQuote,Dollar,Question,Hash,Percent,BackSlash,Del,Ctl,InvalidUtf8,Dot,SquareBracket
       
      -| Character | Value | Replacement |
      -| --------- |:-----:|:-----------:|
      -| :         | 0x3A  | :           |
      +### Metadata
       
      -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8).
      +Any metadata supported by the underlying remote is read and written.
      +
      +Here are the possible system metadata items for the imagekit backend.
      +
      +| Name | Help | Type | Example | Read Only |
      +|------|------|------|---------|-----------|
      +| aws-tags | AI generated tags by AWS Rekognition associated with the image | string | tag1,tag2 | **Y** |
      +| btime | Time of file birth (creation) read from Last-Modified header | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** |
      +| custom-coordinates | Custom coordinates of the file | string | 0,0,100,100 | **Y** |
      +| file-type | Type of the file | string | image | **Y** |
      +| google-tags | AI generated tags by Google Cloud Vision associated with the image | string | tag1,tag2 | **Y** |
      +| has-alpha | Whether the image has alpha channel or not | bool |  | **Y** |
      +| height | Height of the image or video in pixels | int |  | **Y** |
      +| is-private-file | Whether the file is private or not | bool |  | **Y** |
      +| size | Size of the object in bytes | int64 |  | **Y** |
      +| tags | Tags associated with the file | string | tag1,tag2 | **Y** |
      +| width | Width of the image or video in pixels | int |  | **Y** |
      +
      +See the [metadata](https://rclone.org/docs/#metadata) docs for more info.
      +
      +
      +
      +#  Internet Archive
      +
      +The Internet Archive backend utilizes Items on [archive.org](https://archive.org/)
      +
      +Refer to [IAS3 API documentation](https://archive.org/services/docs/api/ias3.html) for the API this backend uses.
      +
      +Paths are specified as `remote:bucket` (or `remote:` for the `lsd`
      +command.)  You may put subdirectories in too, e.g. `remote:item/path/to/dir`.
      +
      +Unlike S3, listing up all items uploaded by you isn't supported.
       
      +Once you have made a remote, you can use it like this:
      +
      +Make a new item
      +
      +    rclone mkdir remote:item
      +
      +List the contents of a item
      +
      +    rclone ls remote:item
      +
      +Sync `/home/local/directory` to the remote item, deleting any excess
      +files in the item.
      +
      +    rclone sync --interactive /home/local/directory remote:item
      +
      +## Notes
      +Because of Internet Archive's architecture, it enqueues write operations (and extra post-processings) in a per-item queue. You can check item's queue at https://catalogd.archive.org/history/item-name-here . Because of that, all uploads/deletes will not show up immediately and takes some time to be available.
      +The per-item queue is enqueued to an another queue, Item Deriver Queue. [You can check the status of Item Deriver Queue here.](https://catalogd.archive.org/catalog.php?whereami=1) This queue has a limit, and it may block you from uploading, or even deleting. You should avoid uploading a lot of small files for better behavior.
      +
      +You can optionally wait for the server's processing to finish, by setting non-zero value to `wait_archive` key.
      +By making it wait, rclone can do normal file comparison.
      +Make sure to set a large enough value (e.g. `30m0s` for smaller files) as it can take a long time depending on server's queue.
      +
      +## About metadata
      +This backend supports setting, updating and reading metadata of each file.
      +The metadata will appear as file metadata on Internet Archive.
      +However, some fields are reserved by both Internet Archive and rclone.
      +
      +The following are reserved by Internet Archive:
      +- `name`
      +- `source`
      +- `size`
      +- `md5`
      +- `crc32`
      +- `sha1`
      +- `format`
      +- `old_version`
      +- `viruscheck`
      +- `summation`
      +
      +Trying to set values to these keys is ignored with a warning.
      +Only setting `mtime` is an exception. Doing so make it the identical behavior as setting ModTime.
      +
      +rclone reserves all the keys starting with `rclone-`. Setting value for these keys will give you warnings, but values are set according to request.
      +
      +If there are multiple values for a key, only the first one is returned.
      +This is a limitation of rclone, that supports one value per one key.
      +It can be triggered when you did a server-side copy.
      +
      +Reading metadata will also provide custom (non-standard nor reserved) ones.
      +
      +## Filtering auto generated files
      +
      +The Internet Archive automatically creates metadata files after
      +upload. These can cause problems when doing an `rclone sync` as rclone
      +will try, and fail, to delete them. These metadata files are not
      +changeable, as they are created by the Internet Archive automatically.
      +
      +These auto-created files can be excluded from the sync using [metadata
      +filtering](https://rclone.org/filtering/#metadata).
      +
      +    rclone sync ... --metadata-exclude "source=metadata" --metadata-exclude "format=Metadata"
      +
      +Which excludes from the sync any files which have the
      +`source=metadata` or `format=Metadata` flags which are added to
      +Internet Archive auto-created files.
      +
      +## Configuration
      +
      +Here is an example of making an internetarchive configuration.
      +Most applies to the other providers as well, any differences are described [below](#providers).
      +
      +First run
      +
      +    rclone config
      +
      +This will guide you through an interactive setup process.
      +
      +

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. XX / InternetArchive Items  (internetarchive) Storage> internetarchive Option access_key_id. IAS3 Access Key. Leave blank for anonymous access. You can find one here: https://archive.org/account/s3.php Enter a value. Press Enter to leave empty. access_key_id> XXXX Option secret_access_key. IAS3 Secret Key (password). Leave blank for anonymous access. Enter a value. Press Enter to leave empty. secret_access_key> XXXX Edit advanced config? y) Yes n) No (default) y/n> y Option endpoint. IAS3 Endpoint. Leave blank for default value. Enter a string value. Press Enter for the default (https://s3.us.archive.org). endpoint> Option front_endpoint. Host of InternetArchive Frontend. Leave blank for default value. Enter a string value. Press Enter for the default (https://archive.org). front_endpoint> Option disable_checksum. Don't store MD5 checksum with object metadata. Normally rclone will calculate the MD5 checksum of the input before uploading it so it can ask the server to check the object against checksum. This is great for data integrity checking but can cause long delays for large files to start uploading. Enter a boolean value (true or false). Press Enter for the default (true). disable_checksum> true Option encoding. The encoding for the backend. See the encoding section in the overview for more info. Enter a encoder.MultiEncoder value. Press Enter for the default (Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot). encoding> Edit advanced config? y) Yes n) No (default) y/n> n -------------------- [remote] type = internetarchive access_key_id = XXXX secret_access_key = XXXX -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      +
      
       
       ### Standard options
       
      -Here are the Standard options specific to hdfs (Hadoop distributed file system).
      +Here are the Standard options specific to internetarchive (Internet Archive).
       
      -#### --hdfs-namenode
      +#### --internetarchive-access-key-id
       
      -Hadoop name node and port.
      +IAS3 Access Key.
       
      -E.g. "namenode:8020" to connect to host namenode at port 8020.
      +Leave blank for anonymous access.
      +You can find one here: https://archive.org/account/s3.php
       
       Properties:
       
      -- Config:      namenode
      -- Env Var:     RCLONE_HDFS_NAMENODE
      +- Config:      access_key_id
      +- Env Var:     RCLONE_INTERNETARCHIVE_ACCESS_KEY_ID
       - Type:        string
      -- Required:    true
      +- Required:    false
       
      -#### --hdfs-username
      +#### --internetarchive-secret-access-key
       
      -Hadoop user name.
      +IAS3 Secret Key (password).
      +
      +Leave blank for anonymous access.
       
       Properties:
       
      -- Config:      username
      -- Env Var:     RCLONE_HDFS_USERNAME
      +- Config:      secret_access_key
      +- Env Var:     RCLONE_INTERNETARCHIVE_SECRET_ACCESS_KEY
       - Type:        string
       - Required:    false
      -- Examples:
      -    - "root"
      -        - Connect to hdfs as root.
       
       ### Advanced options
       
      -Here are the Advanced options specific to hdfs (Hadoop distributed file system).
      +Here are the Advanced options specific to internetarchive (Internet Archive).
       
      -#### --hdfs-service-principal-name
      +#### --internetarchive-endpoint
       
      -Kerberos service principal name for the namenode.
      +IAS3 Endpoint.
       
      -Enables KERBEROS authentication. Specifies the Service Principal Name
      -(SERVICE/FQDN) for the namenode. E.g. \"hdfs/namenode.hadoop.docker\"
      -for namenode running as service 'hdfs' with FQDN 'namenode.hadoop.docker'.
      +Leave blank for default value.
      +
      +Properties:
      +
      +- Config:      endpoint
      +- Env Var:     RCLONE_INTERNETARCHIVE_ENDPOINT
      +- Type:        string
      +- Default:     "https://s3.us.archive.org"
      +
      +#### --internetarchive-front-endpoint
      +
      +Host of InternetArchive Frontend.
      +
      +Leave blank for default value.
       
       Properties:
       
      -- Config:      service_principal_name
      -- Env Var:     RCLONE_HDFS_SERVICE_PRINCIPAL_NAME
      +- Config:      front_endpoint
      +- Env Var:     RCLONE_INTERNETARCHIVE_FRONT_ENDPOINT
       - Type:        string
      -- Required:    false
      +- Default:     "https://archive.org"
       
      -#### --hdfs-data-transfer-protection
      +#### --internetarchive-disable-checksum
       
      -Kerberos data transfer protection: authentication|integrity|privacy.
      +Don't ask the server to test against MD5 checksum calculated by rclone.
      +Normally rclone will calculate the MD5 checksum of the input before
      +uploading it so it can ask the server to check the object against checksum.
      +This is great for data integrity checking but can cause long delays for
      +large files to start uploading.
       
      -Specifies whether or not authentication, data signature integrity
      -checks, and wire encryption are required when communicating with
      -the datanodes. Possible values are 'authentication', 'integrity'
      -and 'privacy'. Used only with KERBEROS enabled.
      +Properties:
      +
      +- Config:      disable_checksum
      +- Env Var:     RCLONE_INTERNETARCHIVE_DISABLE_CHECKSUM
      +- Type:        bool
      +- Default:     true
      +
      +#### --internetarchive-wait-archive
      +
      +Timeout for waiting the server's processing tasks (specifically archive and book_op) to finish.
      +Only enable if you need to be guaranteed to be reflected after write operations.
      +0 to disable waiting. No errors to be thrown in case of timeout.
       
       Properties:
       
      -- Config:      data_transfer_protection
      -- Env Var:     RCLONE_HDFS_DATA_TRANSFER_PROTECTION
      -- Type:        string
      -- Required:    false
      -- Examples:
      -    - "privacy"
      -        - Ensure authentication, integrity and encryption enabled.
      +- Config:      wait_archive
      +- Env Var:     RCLONE_INTERNETARCHIVE_WAIT_ARCHIVE
      +- Type:        Duration
      +- Default:     0s
       
      -#### --hdfs-encoding
      +#### --internetarchive-encoding
       
       The encoding for the backend.
       
      @@ -25668,172 +25764,263 @@ 

      Synology C2 Object Storage

      Properties: - Config: encoding -- Env Var: RCLONE_HDFS_ENCODING -- Type: MultiEncoder -- Default: Slash,Colon,Del,Ctl,InvalidUtf8,Dot +- Env Var: RCLONE_INTERNETARCHIVE_ENCODING +- Type: Encoding +- Default: Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot +### Metadata +Metadata fields provided by Internet Archive. +If there are multiple values for a key, only the first one is returned. +This is a limitation of Rclone, that supports one value per one key. -## Limitations +Owner is able to add custom keys. Metadata feature grabs all the keys including them. -- No server-side `Move` or `DirMove`. -- Checksums not implemented. +Here are the possible system metadata items for the internetarchive backend. -# HiDrive +| Name | Help | Type | Example | Read Only | +|------|------|------|---------|-----------| +| crc32 | CRC32 calculated by Internet Archive | string | 01234567 | **Y** | +| format | Name of format identified by Internet Archive | string | Comma-Separated Values | **Y** | +| md5 | MD5 hash calculated by Internet Archive | string | 01234567012345670123456701234567 | **Y** | +| mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | **Y** | +| name | Full file path, without the bucket part | filename | backend/internetarchive/internetarchive.go | **Y** | +| old_version | Whether the file was replaced and moved by keep-old-version flag | boolean | true | **Y** | +| rclone-ia-mtime | Time of last modification, managed by Internet Archive | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N | +| rclone-mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N | +| rclone-update-track | Random value used by Rclone for tracking changes inside Internet Archive | string | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | N | +| sha1 | SHA1 hash calculated by Internet Archive | string | 0123456701234567012345670123456701234567 | **Y** | +| size | File size in bytes | decimal number | 123456 | **Y** | +| source | The source of the file | string | original | **Y** | +| summation | Check https://forum.rclone.org/t/31922 for how it is used | string | md5 | **Y** | +| viruscheck | The last time viruscheck process was run for the file (?) | unixtime | 1654191352 | **Y** | + +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. + + + +# Jottacloud + +Jottacloud is a cloud storage service provider from a Norwegian company, using its own datacenters +in Norway. In addition to the official service at [jottacloud.com](https://www.jottacloud.com/), +it also provides white-label solutions to different companies, such as: +* Telia + * Telia Cloud (cloud.telia.se) + * Telia Sky (sky.telia.no) +* Tele2 + * Tele2 Cloud (mittcloud.tele2.se) +* Onlime + * Onlime Cloud Storage (onlime.dk) +* Elkjøp (with subsidiaries): + * Elkjøp Cloud (cloud.elkjop.no) + * Elgiganten Sweden (cloud.elgiganten.se) + * Elgiganten Denmark (cloud.elgiganten.dk) + * Giganti Cloud (cloud.gigantti.fi) + * ELKO Cloud (cloud.elko.is) + +Most of the white-label versions are supported by this backend, although may require different +authentication setup - described below. Paths are specified as `remote:path` Paths may be as deep as required, e.g. `remote:directory/subdirectory`. -The initial setup for hidrive involves getting a token from HiDrive -which you need to do in your browser. -`rclone config` walks you through it. +## Authentication types -## Configuration +Some of the whitelabel versions uses a different authentication method than the official service, +and you have to choose the correct one when setting up the remote. -Here is an example of how to make a remote called `remote`. First run: +### Standard authentication - rclone config +The standard authentication method used by the official service (jottacloud.com), as well as +some of the whitelabel services, requires you to generate a single-use personal login token +from the account security settings in the service's web interface. Log in to your account, +go to "Settings" and then "Security", or use the direct link presented to you by rclone when +configuring the remote: <https://www.jottacloud.com/web/secure>. Scroll down to the section +"Personal login token", and click the "Generate" button. Note that if you are using a +whitelabel service you probably can't use the direct link, you need to find the same page in +their dedicated web interface, and also it may be in a different location than described above. -This will guide you through an interactive setup process: -
      -

      No remotes found - make a new one n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / HiDrive  "hidrive" [snip] Storage> hidrive OAuth Client Id - Leave blank normally. client_id> OAuth Client Secret - Leave blank normally. client_secret> Access permissions that rclone should use when requesting access from HiDrive. Leave blank normally. scope_access> Edit advanced config? y/n> n Use web browser to automatically authenticate rclone with remote? * Say Y if the machine running rclone has a web browser you can use * Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N. y/n> y If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=xxxxxxxxxxxxxxxxxxxxxx Log in and authorize rclone for access Waiting for code... Got code -------------------- [remote] type = hidrive token = {"access_token":"xxxxxxxxxxxxxxxxxxxx","token_type":"Bearer","refresh_token":"xxxxxxxxxxxxxxxxxxxxxxx","expiry":"xxxxxxxxxxxxxxxxxxxxxxx"} -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      -
      
      -**You should be aware that OAuth-tokens can be used to access your account
      -and hence should not be shared with other persons.**
      -See the [below section](#keeping-your-tokens-safe) for more information.
      +To access your account from multiple instances of rclone, you need to configure each of them
      +with a separate personal login token. E.g. you create a Jottacloud remote with rclone in one
      +location, and copy the configuration file to a second location where you also want to run
      +rclone and access the same remote. Then you need to replace the token for one of them, using
      +the [config reconnect](https://rclone.org/commands/rclone_config_reconnect/) command, which
      +requires you to generate a new personal login token and supply as input. If you do not
      +do this, the token may easily end up being invalidated, resulting in both instances failing
      +with an error message something along the lines of:
       
      -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a
      -machine with no Internet browser available.
      +    oauth2: cannot fetch token: 400 Bad Request
      +    Response: {"error":"invalid_grant","error_description":"Stale token"}
       
      -Note that rclone runs a webserver on your local machine to collect the
      -token as returned from HiDrive. This only runs from the moment it opens
      -your browser to the moment you get back the verification code.
      -The webserver runs on `http://127.0.0.1:53682/`.
      -If local port `53682` is protected by a firewall you may need to temporarily
      -unblock the firewall to complete authorization.
      +When this happens, you need to replace the token as described above to be able to use your
      +remote again.
       
      -Once configured you can then use `rclone` like this,
      +All personal login tokens you have taken into use will be listed in the web interface under
      +"My logged in devices", and from the right side of that list you can click the "X" button to
      +revoke individual tokens.
       
      -List directories in top level of your HiDrive root folder
      +### Legacy authentication
       
      -    rclone lsd remote:
      +If you are using one of the whitelabel versions (e.g. from Elkjøp) you may not have the option
      +to generate a CLI token. In this case you'll have to use the legacy authentication. To do this select
      +yes when the setup asks for legacy authentication and enter your username and password.
      +The rest of the setup is identical to the default setup.
       
      -List all the files in your HiDrive filesystem
      +### Telia Cloud authentication
       
      -    rclone ls remote:
      +Similar to other whitelabel versions Telia Cloud doesn't offer the option of creating a CLI token, and
      +additionally uses a separate authentication flow where the username is generated internally. To setup
      +rclone to use Telia Cloud, choose Telia Cloud authentication in the setup. The rest of the setup is
      +identical to the default setup.
       
      -To copy a local directory to a HiDrive directory called backup
      +### Tele2 Cloud authentication
       
      -    rclone copy /home/source remote:backup
      +As Tele2-Com Hem merger was completed this authentication can be used for former Com Hem Cloud and
      +Tele2 Cloud customers as no support for creating a CLI token exists, and additionally uses a separate
      +authentication flow where the username is generated internally. To setup rclone to use Tele2 Cloud,
      +choose Tele2 Cloud authentication in the setup. The rest of the setup is identical to the default setup.
       
      -### Keeping your tokens safe
      +### Onlime Cloud Storage authentication
       
      -Any OAuth-tokens will be stored by rclone in the remote's configuration file as unencrypted text.
      -Anyone can use a valid refresh-token to access your HiDrive filesystem without knowing your password.
      -Therefore you should make sure no one else can access your configuration.
      +Onlime has sold access to Jottacloud proper, while providing localized support to Danish Customers, but
      +have recently set up their own hosting, transferring their customers from Jottacloud servers to their
      +own ones.
       
      -It is possible to encrypt rclone's configuration file.
      -You can find information on securing your configuration file by viewing the [configuration encryption docs](https://rclone.org/docs/#configuration-encryption).
      +This, of course, necessitates using their servers for authentication, but otherwise functionality and
      +architecture seems equivalent to Jottacloud.
       
      -### Invalid refresh token
      +To setup rclone to use Onlime Cloud Storage, choose Onlime Cloud authentication in the setup. The rest
      +of the setup is identical to the default setup.
       
      -As can be verified [here](https://developer.hidrive.com/basics-flows/),
      -each `refresh_token` (for Native Applications) is valid for 60 days.
      -If used to access HiDrivei, its validity will be automatically extended.
      +## Configuration
       
      -This means that if you
      +Here is an example of how to make a remote called `remote` with the default setup.  First run:
       
      -  * Don't use the HiDrive remote for 60 days
      +    rclone config
       
      -then rclone will return an error which includes a text
      -that implies the refresh token is *invalid* or *expired*.
      +This will guide you through an interactive setup process:
      +
      +

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. [snip] XX / Jottacloud  (jottacloud) [snip] Storage> jottacloud Edit advanced config? y) Yes n) No (default) y/n> n Option config_type. Select authentication type. Choose a number from below, or type in an existing string value. Press Enter for the default (standard). / Standard authentication. 1 | Use this if you're a normal Jottacloud user.  (standard) / Legacy authentication. 2 | This is only required for certain whitelabel versions of Jottacloud and not recommended for normal users.  (legacy) / Telia Cloud authentication. 3 | Use this if you are using Telia Cloud.  (telia) / Tele2 Cloud authentication. 4 | Use this if you are using Tele2 Cloud.  (tele2) / Onlime Cloud authentication. 5 | Use this if you are using Onlime Cloud.  (onlime) config_type> 1 Personal login token. Generate here: https://www.jottacloud.com/web/secure Login Token> Use a non-standard device/mountpoint? Choosing no, the default, will let you access the storage used for the archive section of the official Jottacloud client. If you instead want to access the sync or the backup section, for example, you must choose yes. y) Yes n) No (default) y/n> y Option config_device. The device to use. In standard setup the built-in Jotta device is used, which contains predefined mountpoints for archive, sync etc. All other devices are treated as backup devices by the official Jottacloud client. You may create a new by entering a unique name. Choose a number from below, or type in your own string value. Press Enter for the default (DESKTOP-3H31129). 1 > DESKTOP-3H31129 2 > Jotta config_device> 2 Option config_mountpoint. The mountpoint to use for the built-in device Jotta. The standard setup is to use the Archive mountpoint. Most other mountpoints have very limited support in rclone and should generally be avoided. Choose a number from below, or type in an existing string value. Press Enter for the default (Archive). 1 > Archive 2 > Shared 3 > Sync config_mountpoint> 1 -------------------- [remote] type = jottacloud configVersion = 1 client_id = jottacli client_secret = tokenURL = https://id.jottacloud.com/auth/realms/jottacloud/protocol/openid-connect/token token = {........} username = 2940e57271a93d987d6f8a21 device = Jotta mountpoint = Archive -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      +
      
      +Once configured you can then use `rclone` like this,
       
      -To fix this you will need to authorize rclone to access your HiDrive account again.
      +List directories in top level of your Jottacloud
       
      -Using
      +    rclone lsd remote:
       
      -    rclone config reconnect remote:
      +List all the files in your Jottacloud
       
      -the process is very similar to the process of initial setup exemplified before.
      +    rclone ls remote:
       
      -### Modified time and hashes
      +To copy a local directory to an Jottacloud directory called backup
       
      -HiDrive allows modification times to be set on objects accurate to 1 second.
      +    rclone copy /home/source remote:backup
       
      -HiDrive supports [its own hash type](https://static.hidrive.com/dev/0001)
      -which is used to verify the integrity of file contents after successful transfers.
      +### Devices and Mountpoints
       
      -### Restricted filename characters
      +The official Jottacloud client registers a device for each computer you install
      +it on, and shows them in the backup section of the user interface. For each
      +folder you select for backup it will create a mountpoint within this device.
      +A built-in device called Jotta is special, and contains mountpoints Archive,
      +Sync and some others, used for corresponding features in official clients.
       
      -HiDrive cannot store files or folders that include
      -`/` (0x2F) or null-bytes (0x00) in their name.
      -Any other characters can be used in the names of files or folders.
      -Additionally, files or folders cannot be named either of the following: `.` or `..`
      +With rclone you'll want to use the standard Jotta/Archive device/mountpoint in
      +most cases. However, you may for example want to access files from the sync or
      +backup functionality provided by the official clients, and rclone therefore
      +provides the option to select other devices and mountpoints during config.
       
      -Therefore rclone will automatically replace these characters,
      -if files or folders are stored or accessed with such names.
      +You are allowed to create new devices and mountpoints. All devices except the
      +built-in Jotta device are treated as backup devices by official Jottacloud
      +clients, and the mountpoints on them are individual backup sets.
       
      -You can read about how this filename encoding works in general
      -[here](overview/#restricted-filenames).
      +With the built-in Jotta device, only existing, built-in, mountpoints can be
      +selected. In addition to the mentioned Archive and Sync, it may contain
      +several other mountpoints such as: Latest, Links, Shared and Trash. All of
      +these are special mountpoints with a different internal representation than
      +the "regular" mountpoints. Rclone will only to a very limited degree support
      +them. Generally you should avoid these, unless you know what you are doing.
       
      -Keep in mind that HiDrive only supports file or folder names
      -with a length of 255 characters or less.
      +### --fast-list
       
      -### Transfers
      +This backend supports `--fast-list` which allows you to use fewer
      +transactions in exchange for more memory. See the [rclone
      +docs](https://rclone.org/docs/#fast-list) for more details.
       
      -HiDrive limits file sizes per single request to a maximum of 2 GiB.
      -To allow storage of larger files and allow for better upload performance,
      -the hidrive backend will use a chunked transfer for files larger than 96 MiB.
      -Rclone will upload multiple parts/chunks of the file at the same time.
      -Chunks in the process of being uploaded are buffered in memory,
      -so you may want to restrict this behaviour on systems with limited resources.
      +Note that the implementation in Jottacloud always uses only a single
      +API request to get the entire list, so for large folders this could
      +lead to long wait time before the first results are shown.
       
      -You can customize this behaviour using the following options:
      +Note also that with rclone version 1.58 and newer, information about
      +[MIME types](https://rclone.org/overview/#mime-type) and metadata item [utime](#metadata)
      +are not available when using `--fast-list`.
       
      -* `chunk_size`: size of file parts
      -* `upload_cutoff`: files larger or equal to this in size will use a chunked transfer
      -* `upload_concurrency`: number of file-parts to upload at the same time
      +### Modification times and hashes
       
      -See the below section about configuration options for more details.
      +Jottacloud allows modification times to be set on objects accurate to 1
      +second. These will be used to detect whether objects need syncing or
      +not.
       
      -### Root folder
      +Jottacloud supports MD5 type hashes, so you can use the `--checksum`
      +flag.
       
      -You can set the root folder for rclone.
      -This is the directory that rclone considers to be the root of your HiDrive.
      +Note that Jottacloud requires the MD5 hash before upload so if the
      +source does not have an MD5 checksum then the file will be cached
      +temporarily on disk (in location given by
      +[--temp-dir](https://rclone.org/docs/#temp-dir-dir)) before it is uploaded.
      +Small files will be cached in memory - see the
      +[--jottacloud-md5-memory-limit](#jottacloud-md5-memory-limit) flag.
      +When uploading from local disk the source checksum is always available,
      +so this does not apply. Starting with rclone version 1.52 the same is
      +true for encrypted remotes (in older versions the crypt backend would not
      +calculate hashes for uploads from local disk, so the Jottacloud
      +backend had to do it as described above).
       
      -Usually, you will leave this blank, and rclone will use the root of the account.
      +### Restricted filename characters
       
      -However, you can set this to restrict rclone to a specific folder hierarchy.
      +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
      +the following characters are also replaced:
       
      -This works by prepending the contents of the `root_prefix` option
      -to any paths accessed by rclone.
      -For example, the following two ways to access the home directory are equivalent:
      +| Character | Value | Replacement |
      +| --------- |:-----:|:-----------:|
      +| "         | 0x22  | "          |
      +| *         | 0x2A  | *          |
      +| :         | 0x3A  | :          |
      +| <         | 0x3C  | <          |
      +| >         | 0x3E  | >          |
      +| ?         | 0x3F  | ?          |
      +| \|        | 0x7C  | |          |
       
      -    rclone lsd --hidrive-root-prefix="/users/test/" remote:path
      +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
      +as they can't be used in XML strings.
       
      -    rclone lsd remote:/users/test/path
      +### Deleting files
       
      -See the below section about configuration options for more details.
      +By default, rclone will send all files to the trash when deleting files. They will be permanently
      +deleted automatically after 30 days. You may bypass the trash and permanently delete files immediately
      +by using the [--jottacloud-hard-delete](#jottacloud-hard-delete) flag, or set the equivalent environment variable.
      +Emptying the trash is supported by the [cleanup](https://rclone.org/commands/rclone_cleanup/) command.
       
      -### Directory member count
      +### Versions
       
      -By default, rclone will know the number of directory members contained in a directory.
      -For example, `rclone lsd` uses this information.
      +Jottacloud supports file versioning. When rclone uploads a new version of a file it creates a new version of it.
      +Currently rclone only supports retrieving the current version but older versions can be accessed via the Jottacloud Website.
       
      -The acquisition of this information will result in additional time costs for HiDrive's API.
      -When dealing with large directory structures, it may be desirable to circumvent this time cost,
      -especially when this information is not explicitly needed.
      -For this, the `disable_fetching_member_count` option can be used.
      +Versioning can be disabled by `--jottacloud-no-versions` option. This is achieved by deleting the remote file prior to uploading
      +a new version. If the upload the fails no version of the file will be available in the remote.
       
      -See the below section about configuration options for more details.
      +### Quota information
      +
      +To view your current quota you can use the `rclone about remote:`
      +command which will display your usage limit (unless it is unlimited)
      +and the current usage.
       
       
       ### Standard options
       
      -Here are the Standard options specific to hidrive (HiDrive).
      +Here are the Standard options specific to jottacloud (Jottacloud).
       
      -#### --hidrive-client-id
      +#### --jottacloud-client-id
       
       OAuth Client Id.
       
      @@ -25842,11 +26029,11 @@ 

      Synology C2 Object Storage

      Properties: - Config: client_id -- Env Var: RCLONE_HIDRIVE_CLIENT_ID +- Env Var: RCLONE_JOTTACLOUD_CLIENT_ID - Type: string - Required: false -#### --hidrive-client-secret +#### --jottacloud-client-secret OAuth Client Secret. @@ -25855,42 +26042,26 @@

      Synology C2 Object Storage

      Properties: - Config: client_secret -- Env Var: RCLONE_HIDRIVE_CLIENT_SECRET +- Env Var: RCLONE_JOTTACLOUD_CLIENT_SECRET - Type: string - Required: false -#### --hidrive-scope-access - -Access permissions that rclone should use when requesting access from HiDrive. - -Properties: - -- Config: scope_access -- Env Var: RCLONE_HIDRIVE_SCOPE_ACCESS -- Type: string -- Default: "rw" -- Examples: - - "rw" - - Read and write access to resources. - - "ro" - - Read-only access to resources. - ### Advanced options -Here are the Advanced options specific to hidrive (HiDrive). +Here are the Advanced options specific to jottacloud (Jottacloud). -#### --hidrive-token +#### --jottacloud-token OAuth Access Token as a JSON blob. Properties: - Config: token -- Env Var: RCLONE_HIDRIVE_TOKEN +- Env Var: RCLONE_JOTTACLOUD_TOKEN - Type: string - Required: false -#### --hidrive-auth-url +#### --jottacloud-auth-url Auth server URL. @@ -25899,11 +26070,11 @@

      Synology C2 Object Storage

      Properties: - Config: auth_url -- Env Var: RCLONE_HIDRIVE_AUTH_URL +- Env Var: RCLONE_JOTTACLOUD_AUTH_URL - Type: string - Required: false -#### --hidrive-token-url +#### --jottacloud-token-url Token server url. @@ -25912,134 +26083,255 @@

      Synology C2 Object Storage

      Properties: - Config: token_url -- Env Var: RCLONE_HIDRIVE_TOKEN_URL +- Env Var: RCLONE_JOTTACLOUD_TOKEN_URL - Type: string - Required: false -#### --hidrive-scope-role +#### --jottacloud-md5-memory-limit -User-level that rclone should use when requesting access from HiDrive. +Files bigger than this will be cached on disk to calculate the MD5 if required. Properties: -- Config: scope_role -- Env Var: RCLONE_HIDRIVE_SCOPE_ROLE -- Type: string -- Default: "user" -- Examples: - - "user" - - User-level access to management permissions. - - This will be sufficient in most cases. - - "admin" - - Extensive access to management permissions. - - "owner" - - Full access to management permissions. +- Config: md5_memory_limit +- Env Var: RCLONE_JOTTACLOUD_MD5_MEMORY_LIMIT +- Type: SizeSuffix +- Default: 10Mi + +#### --jottacloud-trashed-only + +Only show files that are in the trash. + +This will show trashed files in their original directory structure. + +Properties: + +- Config: trashed_only +- Env Var: RCLONE_JOTTACLOUD_TRASHED_ONLY +- Type: bool +- Default: false + +#### --jottacloud-hard-delete + +Delete files permanently rather than putting them into the trash. + +Properties: + +- Config: hard_delete +- Env Var: RCLONE_JOTTACLOUD_HARD_DELETE +- Type: bool +- Default: false + +#### --jottacloud-upload-resume-limit + +Files bigger than this can be resumed if the upload fail's. + +Properties: + +- Config: upload_resume_limit +- Env Var: RCLONE_JOTTACLOUD_UPLOAD_RESUME_LIMIT +- Type: SizeSuffix +- Default: 10Mi + +#### --jottacloud-no-versions + +Avoid server side versioning by deleting files and recreating files instead of overwriting them. + +Properties: + +- Config: no_versions +- Env Var: RCLONE_JOTTACLOUD_NO_VERSIONS +- Type: bool +- Default: false + +#### --jottacloud-encoding + +The encoding for the backend. + +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + +Properties: + +- Config: encoding +- Env Var: RCLONE_JOTTACLOUD_ENCODING +- Type: Encoding +- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot + +### Metadata + +Jottacloud has limited support for metadata, currently an extended set of timestamps. + +Here are the possible system metadata items for the jottacloud backend. + +| Name | Help | Type | Example | Read Only | +|------|------|------|---------|-----------| +| btime | Time of file birth (creation), read from rclone metadata | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | N | +| content-type | MIME type, also known as media type | string | text/plain | **Y** | +| mtime | Time of last modification, read from rclone metadata | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | N | +| utime | Time of last upload, when current revision was created, generated by backend | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** | + +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. + + + +## Limitations + +Note that Jottacloud is case insensitive so you can't have a file called +"Hello.doc" and one called "hello.doc". + +There are quite a few characters that can't be in Jottacloud file names. Rclone will map these names to and from an identical +looking unicode equivalent. For example if a file has a ? in it will be mapped to ? instead. + +Jottacloud only supports filenames up to 255 characters in length. + +## Troubleshooting + +Jottacloud exhibits some inconsistent behaviours regarding deleted files and folders which may cause Copy, Move and DirMove +operations to previously deleted paths to fail. Emptying the trash should help in such cases. + +# Koofr + +Paths are specified as `remote:path` + +Paths may be as deep as required, e.g. `remote:directory/subdirectory`. + +## Configuration + +The initial setup for Koofr involves creating an application password for +rclone. You can do that by opening the Koofr +[web application](https://app.koofr.net/app/admin/preferences/password), +giving the password a nice name like `rclone` and clicking on generate. + +Here is an example of how to make a remote called `koofr`. First run: + + rclone config + +This will guide you through an interactive setup process: +
      +

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> koofr Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. [snip] 22 / Koofr, Digi Storage and other Koofr-compatible storage providers  (koofr) [snip] Storage> koofr Option provider. Choose your storage provider. Choose a number from below, or type in your own value. Press Enter to leave empty. 1 / Koofr, https://app.koofr.net/  (koofr) 2 / Digi Storage, https://storage.rcs-rds.ro/  (digistorage) 3 / Any other Koofr API compatible storage service  (other) provider> 1
      +Option user. Your user name. Enter a value. user> USERNAME Option password. Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password). Choose an alternative below. y) Yes, type in my own password g) Generate random password y/g> y Enter the password: password: Confirm the password: password: Edit advanced config? y) Yes n) No (default) y/n> n Remote config -------------------- [koofr] type = koofr provider = koofr user = USERNAME password = *** ENCRYPTED *** -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      +
      
      +You can choose to edit advanced config in order to enter your own service URL
      +if you use an on-premise or white label Koofr instance, or choose an alternative
      +mount instead of your primary storage.
      +
      +Once configured you can then use `rclone` like this,
      +
      +List directories in top level of your Koofr
      +
      +    rclone lsd koofr:
      +
      +List all the files in your Koofr
      +
      +    rclone ls koofr:
      +
      +To copy a local directory to an Koofr directory called backup
      +
      +    rclone copy /home/source koofr:backup
      +
      +### Restricted filename characters
      +
      +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
      +the following characters are also replaced:
       
      -#### --hidrive-root-prefix
      +| Character | Value | Replacement |
      +| --------- |:-----:|:-----------:|
      +| \         | 0x5C  | \           |
       
      -The root/parent folder for all paths.
      +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
      +as they can't be used in XML strings.
       
      -Fill in to use the specified folder as the parent for all paths given to the remote.
      -This way rclone can use any folder as its starting point.
      +
      +### Standard options
      +
      +Here are the Standard options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers).
      +
      +#### --koofr-provider
      +
      +Choose your storage provider.
       
       Properties:
       
      -- Config:      root_prefix
      -- Env Var:     RCLONE_HIDRIVE_ROOT_PREFIX
      +- Config:      provider
      +- Env Var:     RCLONE_KOOFR_PROVIDER
       - Type:        string
      -- Default:     "/"
      +- Required:    false
       - Examples:
      -    - "/"
      -        - The topmost directory accessible by rclone.
      -        - This will be equivalent with "root" if rclone uses a regular HiDrive user account.
      -    - "root"
      -        - The topmost directory of the HiDrive user account
      -    - ""
      -        - This specifies that there is no root-prefix for your paths.
      -        - When using this you will always need to specify paths to this remote with a valid parent e.g. "remote:/path/to/dir" or "remote:root/path/to/dir".
      -
      -#### --hidrive-endpoint
      +    - "koofr"
      +        - Koofr, https://app.koofr.net/
      +    - "digistorage"
      +        - Digi Storage, https://storage.rcs-rds.ro/
      +    - "other"
      +        - Any other Koofr API compatible storage service
       
      -Endpoint for the service.
      +#### --koofr-endpoint
       
      -This is the URL that API-calls will be made to.
      +The Koofr API endpoint to use.
       
       Properties:
       
       - Config:      endpoint
      -- Env Var:     RCLONE_HIDRIVE_ENDPOINT
      +- Env Var:     RCLONE_KOOFR_ENDPOINT
      +- Provider:    other
       - Type:        string
      -- Default:     "https://api.hidrive.strato.com/2.1"
      -
      -#### --hidrive-disable-fetching-member-count
      +- Required:    true
       
      -Do not fetch number of objects in directories unless it is absolutely necessary.
      +#### --koofr-user
       
      -Requests may be faster if the number of objects in subdirectories is not fetched.
      +Your user name.
       
       Properties:
       
      -- Config:      disable_fetching_member_count
      -- Env Var:     RCLONE_HIDRIVE_DISABLE_FETCHING_MEMBER_COUNT
      -- Type:        bool
      -- Default:     false
      -
      -#### --hidrive-chunk-size
      -
      -Chunksize for chunked uploads.
      +- Config:      user
      +- Env Var:     RCLONE_KOOFR_USER
      +- Type:        string
      +- Required:    true
       
      -Any files larger than the configured cutoff (or files of unknown size) will be uploaded in chunks of this size.
      +#### --koofr-password
       
      -The upper limit for this is 2147483647 bytes (about 2.000Gi).
      -That is the maximum amount of bytes a single upload-operation will support.
      -Setting this above the upper limit or to a negative value will cause uploads to fail.
      +Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password).
       
      -Setting this to larger values may increase the upload speed at the cost of using more memory.
      -It can be set to smaller values smaller to save on memory.
      +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
       
       Properties:
       
      -- Config:      chunk_size
      -- Env Var:     RCLONE_HIDRIVE_CHUNK_SIZE
      -- Type:        SizeSuffix
      -- Default:     48Mi
      +- Config:      password
      +- Env Var:     RCLONE_KOOFR_PASSWORD
      +- Provider:    koofr
      +- Type:        string
      +- Required:    true
       
      -#### --hidrive-upload-cutoff
      +### Advanced options
       
      -Cutoff/Threshold for chunked uploads.
      +Here are the Advanced options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers).
       
      -Any files larger than this will be uploaded in chunks of the configured chunksize.
      +#### --koofr-mountid
       
      -The upper limit for this is 2147483647 bytes (about 2.000Gi).
      -That is the maximum amount of bytes a single upload-operation will support.
      -Setting this above the upper limit will cause uploads to fail.
      +Mount ID of the mount to use.
       
      -Properties:
      +If omitted, the primary mount is used.
       
      -- Config:      upload_cutoff
      -- Env Var:     RCLONE_HIDRIVE_UPLOAD_CUTOFF
      -- Type:        SizeSuffix
      -- Default:     96Mi
      +Properties:
       
      -#### --hidrive-upload-concurrency
      +- Config:      mountid
      +- Env Var:     RCLONE_KOOFR_MOUNTID
      +- Type:        string
      +- Required:    false
       
      -Concurrency for chunked uploads.
      +#### --koofr-setmtime
       
      -This is the upper limit for how many transfers for the same file are running concurrently.
      -Setting this above to a value smaller than 1 will cause uploads to deadlock.
      +Does the backend support setting modification time.
       
      -If you are uploading small numbers of large files over high-speed links
      -and these uploads do not fully utilize your bandwidth, then increasing
      -this may help to speed up the transfers.
      +Set this to false if you use a mount ID that points to a Dropbox or Amazon Drive backend.
       
       Properties:
       
      -- Config:      upload_concurrency
      -- Env Var:     RCLONE_HIDRIVE_UPLOAD_CONCURRENCY
      -- Type:        int
      -- Default:     4
      +- Config:      setmtime
      +- Env Var:     RCLONE_KOOFR_SETMTIME
      +- Type:        bool
      +- Default:     true
       
      -#### --hidrive-encoding
      +#### --koofr-encoding
       
       The encoding for the backend.
       
      @@ -26048,1996 +26340,1874 @@ 

      Synology C2 Object Storage

      Properties: - Config: encoding -- Env Var: RCLONE_HIDRIVE_ENCODING -- Type: MultiEncoder -- Default: Slash,Dot +- Env Var: RCLONE_KOOFR_ENCODING +- Type: Encoding +- Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot ## Limitations -### Symbolic links - -HiDrive is able to store symbolic links (*symlinks*) by design, -for example, when unpacked from a zip archive. - -There exists no direct mechanism to manage native symlinks in remotes. -As such this implementation has chosen to ignore any native symlinks present in the remote. -rclone will not be able to access or show any symlinks stored in the hidrive-remote. -This means symlinks cannot be individually removed, copied, or moved, -except when removing, copying, or moving the parent folder. - -*This does not affect the `.rclonelink`-files -that rclone uses to encode and store symbolic links.* - -### Sparse files - -It is possible to store sparse files in HiDrive. - -Note that copying a sparse file will expand the holes -into null-byte (0x00) regions that will then consume disk space. -Likewise, when downloading a sparse file, -the resulting file will have null-byte regions in the place of file holes. - -# HTTP - -The HTTP remote is a read only remote for reading files of a -webserver. The webserver should provide file listings which rclone -will read and turn into a remote. This has been tested with common -webservers such as Apache/Nginx/Caddy and will likely work with file -listings from most web servers. (If it doesn't then please file an -issue, or send a pull request!) +Note that Koofr is case insensitive so you can't have a file called +"Hello.doc" and one called "hello.doc". -Paths are specified as `remote:` or `remote:path`. +## Providers -The `remote:` represents the configured [url](#http-url), and any path following -it will be resolved relative to this url, according to the URL standard. This -means with remote url `https://beta.rclone.org/branch` and path `fix`, the -resolved URL will be `https://beta.rclone.org/branch/fix`, while with path -`/fix` the resolved URL will be `https://beta.rclone.org/fix` as the absolute -path is resolved from the root of the domain. +### Koofr -If the path following the `remote:` ends with `/` it will be assumed to point -to a directory. If the path does not end with `/`, then a HEAD request is sent -and the response used to decide if it it is treated as a file or a directory -(run with `-vv` to see details). When [--http-no-head](#http-no-head) is -specified, a path without ending `/` is always assumed to be a file. If rclone -incorrectly assumes the path is a file, the solution is to specify the path with -ending `/`. When you know the path is a directory, ending it with `/` is always -better as it avoids the initial HEAD request. +This is the original [Koofr](https://koofr.eu) storage provider used as main example and described in the [configuration](#configuration) section above. -To just download a single file it is easier to use -[copyurl](https://rclone.org/commands/rclone_copyurl/). +### Digi Storage -## Configuration +[Digi Storage](https://www.digi.ro/servicii/online/digi-storage) is a cloud storage service run by [Digi.ro](https://www.digi.ro/) that +provides a Koofr API. -Here is an example of how to make a remote called `remote`. First -run: +Here is an example of how to make a remote called `ds`. First run: rclone config This will guide you through an interactive setup process:
      -

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / HTTP  "http" [snip] Storage> http URL of http host to connect to Choose a number from below, or type in your own value 1 / Connect to example.com  "https://example.com" url> https://beta.rclone.org Remote config -------------------- [remote] url = https://beta.rclone.org -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Current remotes:

      -

      Name Type ==== ==== remote http

      -
        -
      1. Edit existing remote
      2. -
      3. New remote
      4. -
      5. Delete remote
      6. -
      7. Rename remote
      8. -
      9. Copy remote
      10. -
      11. Set configuration password
      12. -
      13. Quit config e/n/d/r/c/s/q> q
      14. -
      +

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> ds Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. [snip] 22 / Koofr, Digi Storage and other Koofr-compatible storage providers  (koofr) [snip] Storage> koofr Option provider. Choose your storage provider. Choose a number from below, or type in your own value. Press Enter to leave empty. 1 / Koofr, https://app.koofr.net/  (koofr) 2 / Digi Storage, https://storage.rcs-rds.ro/  (digistorage) 3 / Any other Koofr API compatible storage service  (other) provider> 2 Option user. Your user name. Enter a value. user> USERNAME Option password. Your password for rclone (generate one at https://storage.rcs-rds.ro/app/admin/preferences/password). Choose an alternative below. y) Yes, type in my own password g) Generate random password y/g> y Enter the password: password: Confirm the password: password: Edit advanced config? y) Yes n) No (default) y/n> n -------------------- [ds] type = koofr provider = digistorage user = USERNAME password = *** ENCRYPTED *** -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      
      -This remote is called `remote` and can now be used like this
      -
      -See all the top level directories
      -
      -    rclone lsd remote:
      -
      -List the contents of a directory
      -
      -    rclone ls remote:directory
      -
      -Sync the remote `directory` to `/home/local/directory`, deleting any excess files.
      -
      -    rclone sync --interactive remote:directory /home/local/directory
      -
      -### Read only
      -
      -This remote is read only - you can't upload files to an HTTP server.
      +### Other
       
      -### Modified time
      +You may also want to use another, public or private storage provider that runs a Koofr API compatible service, by simply providing the base URL to connect to.
       
      -Most HTTP servers store time accurate to 1 second.
      +Here is an example of how to make a remote called `other`.  First run:
       
      -### Checksum
      +     rclone config
       
      -No checksums are stored.
      +This will guide you through an interactive setup process:
      +
      +

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> other Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. [snip] 22 / Koofr, Digi Storage and other Koofr-compatible storage providers  (koofr) [snip] Storage> koofr Option provider. Choose your storage provider. Choose a number from below, or type in your own value. Press Enter to leave empty. 1 / Koofr, https://app.koofr.net/  (koofr) 2 / Digi Storage, https://storage.rcs-rds.ro/  (digistorage) 3 / Any other Koofr API compatible storage service  (other) provider> 3 Option endpoint. The Koofr API endpoint to use. Enter a value. endpoint> https://koofr.other.org Option user. Your user name. Enter a value. user> USERNAME Option password. Your password for rclone (generate one at your service's settings page). Choose an alternative below. y) Yes, type in my own password g) Generate random password y/g> y Enter the password: password: Confirm the password: password: Edit advanced config? y) Yes n) No (default) y/n> n -------------------- [other] type = koofr provider = other endpoint = https://koofr.other.org user = USERNAME password = *** ENCRYPTED *** -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      +
      
      +#  Linkbox
       
      -### Usage without a config file
      +Linkbox is [a private cloud drive](https://linkbox.to/).
       
      -Since the http remote only has one config parameter it is easy to use
      -without a config file:
      +## Configuration
       
      -    rclone lsd --http-url https://beta.rclone.org :http:
      +Here is an example of making a remote for Linkbox.
       
      -or:
      +First run:
       
      -    rclone lsd :http,url='https://beta.rclone.org':
      +     rclone config
       
      +This will guide you through an interactive setup process:
      +
      +

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n

      +

      Enter name for new remote. name> remote

      +

      Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. XX / Linkbox  (linkbox) Storage> XX

      +

      Option token. Token from https://www.linkbox.to/admin/account Enter a value. token> testFromCLToken

      +

      Configuration complete. Options: - type: linkbox - token: XXXXXXXXXXX Keep this "linkbox" remote? y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      +
      
       
       ### Standard options
       
      -Here are the Standard options specific to http (HTTP).
      -
      -#### --http-url
      +Here are the Standard options specific to linkbox (Linkbox).
       
      -URL of HTTP host to connect to.
      +#### --linkbox-token
       
      -E.g. "https://example.com", or "https://user:pass@example.com" to use a username and password.
      +Token from https://www.linkbox.to/admin/account
       
       Properties:
       
      -- Config:      url
      -- Env Var:     RCLONE_HTTP_URL
      +- Config:      token
      +- Env Var:     RCLONE_LINKBOX_TOKEN
       - Type:        string
       - Required:    true
       
      -### Advanced options
       
      -Here are the Advanced options specific to http (HTTP).
       
      -#### --http-headers
      +## Limitations
       
      -Set HTTP headers for all transactions.
      +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
      +as they can't be used in JSON strings.
       
      -Use this to set additional HTTP headers for all transactions.
      +#  Mail.ru Cloud
       
      -The input format is comma separated list of key,value pairs.  Standard
      -[CSV encoding](https://godoc.org/encoding/csv) may be used.
      +[Mail.ru Cloud](https://cloud.mail.ru/) is a cloud storage provided by a Russian internet company [Mail.Ru Group](https://mail.ru). The official desktop client is [Disk-O:](https://disk-o.cloud/en), available on Windows and Mac OS.
       
      -For example, to set a Cookie use 'Cookie,name=value', or '"Cookie","name=value"'.
      +## Features highlights
       
      -You can set multiple headers, e.g. '"Cookie","name=value","Authorization","xxx"'.
      +- Paths may be as deep as required, e.g. `remote:directory/subdirectory`
      +- Files have a `last modified time` property, directories don't
      +- Deleted files are by default moved to the trash
      +- Files and directories can be shared via public links
      +- Partial uploads or streaming are not supported, file size must be known before upload
      +- Maximum file size is limited to 2G for a free account, unlimited for paid accounts
      +- Storage keeps hash for all files and performs transparent deduplication,
      +  the hash algorithm is a modified SHA1
      +- If a particular file is already present in storage, one can quickly submit file hash
      +  instead of long file upload (this optimization is supported by rclone)
       
      -Properties:
      +## Configuration
       
      -- Config:      headers
      -- Env Var:     RCLONE_HTTP_HEADERS
      -- Type:        CommaSepList
      -- Default:     
      +Here is an example of making a mailru configuration.
       
      -#### --http-no-slash
      +First create a Mail.ru Cloud account and choose a tariff.
       
      -Set this if the site doesn't end directories with /.
      +You will need to log in and create an app password for rclone. Rclone
      +**will not work** with your normal username and password - it will
      +give an error like `oauth2: server response missing access_token`.
       
      -Use this if your target website does not use / on the end of
      -directories.
      +- Click on your user icon in the top right
      +- Go to Security / "Пароль и безопасность"
      +- Click password for apps / "Пароли для внешних приложений"
      +- Add the password - give it a name - eg "rclone"
      +- Copy the password and use this password below - your normal login password won't work.
       
      -A / on the end of a path is how rclone normally tells the difference
      -between files and directories.  If this flag is set, then rclone will
      -treat all files with Content-Type: text/html as directories and read
      -URLs from them rather than downloading them.
      +Now run
       
      -Note that this may cause rclone to confuse genuine HTML files with
      -directories.
      +    rclone config
       
      -Properties:
      +This will guide you through an interactive setup process:
      +
      +

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / Mail.ru Cloud  "mailru" [snip] Storage> mailru User name (usually email) Enter a string value. Press Enter for the default (""). user> username@mail.ru Password

      +

      This must be an app password - rclone will not work with your normal password. See the Configuration section in the docs for how to make an app password. y) Yes type in my own password g) Generate random password y/g> y Enter the password: password: Confirm the password: password: Skip full upload if there is another file with same data hash. This feature is called "speedup" or "put by hash". It is especially efficient in case of generally available files like popular books, video or audio clips [snip] Enter a boolean value (true or false). Press Enter for the default ("true"). Choose a number from below, or type in your own value 1 / Enable  "true" 2 / Disable  "false" speedup_enable> 1 Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config -------------------- [remote] type = mailru user = username@mail.ru pass = *** ENCRYPTED *** speedup_enable = true -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

      +
      
      +Configuration of this backend does not require a local web browser.
      +You can use the configured backend as shown below:
       
      -- Config:      no_slash
      -- Env Var:     RCLONE_HTTP_NO_SLASH
      -- Type:        bool
      -- Default:     false
      +See top level directories
       
      -#### --http-no-head
      +    rclone lsd remote:
       
      -Don't use HEAD requests.
      +Make a new directory
       
      -HEAD requests are mainly used to find file sizes in dir listing.
      -If your site is being very slow to load then you can try this option.
      -Normally rclone does a HEAD request for each potential file in a
      -directory listing to:
      +    rclone mkdir remote:directory
       
      -- find its size
      -- check it really exists
      -- check to see if it is a directory
      +List the contents of a directory
       
      -If you set this option, rclone will not do the HEAD request. This will mean
      -that directory listings are much quicker, but rclone won't have the times or
      -sizes of any files, and some files that don't exist may be in the listing.
      +    rclone ls remote:directory
       
      -Properties:
      +Sync `/home/local/directory` to the remote path, deleting any
      +excess files in the path.
       
      -- Config:      no_head
      -- Env Var:     RCLONE_HTTP_NO_HEAD
      -- Type:        bool
      -- Default:     false
      +    rclone sync --interactive /home/local/directory remote:directory
       
      +### Modification times and hashes
       
      +Files support a modification time attribute with up to 1 second precision.
      +Directories do not have a modification time, which is shown as "Jan 1 1970".
       
      -## Limitations
      +File hashes are supported, with a custom Mail.ru algorithm based on SHA1.
      +If file size is less than or equal to the SHA1 block size (20 bytes),
      +its hash is simply its data right-padded with zero bytes.
      +Hashes of a larger file is computed as a SHA1 of the file data
      +bytes concatenated with a decimal representation of the data length.
       
      -`rclone about` is not supported by the HTTP backend. Backends without
      -this capability cannot determine free space for an rclone mount or
      -use policy `mfs` (most free space) as a member of an rclone union
      -remote.
      +### Emptying Trash
       
      -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/)
      +Removing a file or directory actually moves it to the trash, which is not
      +visible to rclone but can be seen in a web browser. The trashed file
      +still occupies part of total quota. If you wish to empty your trash
      +and free some quota, you can use the `rclone cleanup remote:` command,
      +which will permanently delete all your trashed files.
      +This command does not take any path arguments.
       
      -#  Internet Archive
      +### Quota information
       
      -The Internet Archive backend utilizes Items on [archive.org](https://archive.org/)
      +To view your current quota you can use the `rclone about remote:`
      +command which will display your usage limit (quota) and the current usage.
       
      -Refer to [IAS3 API documentation](https://archive.org/services/docs/api/ias3.html) for the API this backend uses.
      +### Restricted filename characters
       
      -Paths are specified as `remote:bucket` (or `remote:` for the `lsd`
      -command.)  You may put subdirectories in too, e.g. `remote:item/path/to/dir`.
      +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
      +the following characters are also replaced:
       
      -Unlike S3, listing up all items uploaded by you isn't supported.
      +| Character | Value | Replacement |
      +| --------- |:-----:|:-----------:|
      +| "         | 0x22  | "          |
      +| *         | 0x2A  | *          |
      +| :         | 0x3A  | :          |
      +| <         | 0x3C  | <          |
      +| >         | 0x3E  | >          |
      +| ?         | 0x3F  | ?          |
      +| \         | 0x5C  | \          |
      +| \|        | 0x7C  | |          |
       
      -Once you have made a remote, you can use it like this:
      +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
      +as they can't be used in JSON strings.
       
      -Make a new item
       
      -    rclone mkdir remote:item
      +### Standard options
       
      -List the contents of a item
      +Here are the Standard options specific to mailru (Mail.ru Cloud).
       
      -    rclone ls remote:item
      +#### --mailru-client-id
       
      -Sync `/home/local/directory` to the remote item, deleting any excess
      -files in the item.
      +OAuth Client Id.
       
      -    rclone sync --interactive /home/local/directory remote:item
      +Leave blank normally.
       
      -## Notes
      -Because of Internet Archive's architecture, it enqueues write operations (and extra post-processings) in a per-item queue. You can check item's queue at https://catalogd.archive.org/history/item-name-here . Because of that, all uploads/deletes will not show up immediately and takes some time to be available.
      -The per-item queue is enqueued to an another queue, Item Deriver Queue. [You can check the status of Item Deriver Queue here.](https://catalogd.archive.org/catalog.php?whereami=1) This queue has a limit, and it may block you from uploading, or even deleting. You should avoid uploading a lot of small files for better behavior.
      +Properties:
       
      -You can optionally wait for the server's processing to finish, by setting non-zero value to `wait_archive` key.
      -By making it wait, rclone can do normal file comparison.
      -Make sure to set a large enough value (e.g. `30m0s` for smaller files) as it can take a long time depending on server's queue.
      +- Config:      client_id
      +- Env Var:     RCLONE_MAILRU_CLIENT_ID
      +- Type:        string
      +- Required:    false
       
      -## About metadata
      -This backend supports setting, updating and reading metadata of each file.
      -The metadata will appear as file metadata on Internet Archive.
      -However, some fields are reserved by both Internet Archive and rclone.
      +#### --mailru-client-secret
       
      -The following are reserved by Internet Archive:
      -- `name`
      -- `source`
      -- `size`
      -- `md5`
      -- `crc32`
      -- `sha1`
      -- `format`
      -- `old_version`
      -- `viruscheck`
      -- `summation`
      +OAuth Client Secret.
       
      -Trying to set values to these keys is ignored with a warning.
      -Only setting `mtime` is an exception. Doing so make it the identical behavior as setting ModTime.
      +Leave blank normally.
       
      -rclone reserves all the keys starting with `rclone-`. Setting value for these keys will give you warnings, but values are set according to request.
      +Properties:
       
      -If there are multiple values for a key, only the first one is returned.
      -This is a limitation of rclone, that supports one value per one key.
      -It can be triggered when you did a server-side copy.
      +- Config:      client_secret
      +- Env Var:     RCLONE_MAILRU_CLIENT_SECRET
      +- Type:        string
      +- Required:    false
       
      -Reading metadata will also provide custom (non-standard nor reserved) ones.
      +#### --mailru-user
       
      -## Filtering auto generated files
      +User name (usually email).
       
      -The Internet Archive automatically creates metadata files after
      -upload. These can cause problems when doing an `rclone sync` as rclone
      -will try, and fail, to delete them. These metadata files are not
      -changeable, as they are created by the Internet Archive automatically.
      +Properties:
       
      -These auto-created files can be excluded from the sync using [metadata
      -filtering](https://rclone.org/filtering/#metadata).
      +- Config:      user
      +- Env Var:     RCLONE_MAILRU_USER
      +- Type:        string
      +- Required:    true
       
      -    rclone sync ... --metadata-exclude "source=metadata" --metadata-exclude "format=Metadata"
      +#### --mailru-pass
       
      -Which excludes from the sync any files which have the
      -`source=metadata` or `format=Metadata` flags which are added to
      -Internet Archive auto-created files.
      +Password.
       
      -## Configuration
      +This must be an app password - rclone will not work with your normal
      +password. See the Configuration section in the docs for how to make an
      +app password.
       
      -Here is an example of making an internetarchive configuration.
      -Most applies to the other providers as well, any differences are described [below](#providers).
       
      -First run
      +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
       
      -    rclone config
      +Properties:
       
      -This will guide you through an interactive setup process.
      -
      -

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. XX / InternetArchive Items  (internetarchive) Storage> internetarchive Option access_key_id. IAS3 Access Key. Leave blank for anonymous access. You can find one here: https://archive.org/account/s3.php Enter a value. Press Enter to leave empty. access_key_id> XXXX Option secret_access_key. IAS3 Secret Key (password). Leave blank for anonymous access. Enter a value. Press Enter to leave empty. secret_access_key> XXXX Edit advanced config? y) Yes n) No (default) y/n> y Option endpoint. IAS3 Endpoint. Leave blank for default value. Enter a string value. Press Enter for the default (https://s3.us.archive.org). endpoint> Option front_endpoint. Host of InternetArchive Frontend. Leave blank for default value. Enter a string value. Press Enter for the default (https://archive.org). front_endpoint> Option disable_checksum. Don't store MD5 checksum with object metadata. Normally rclone will calculate the MD5 checksum of the input before uploading it so it can ask the server to check the object against checksum. This is great for data integrity checking but can cause long delays for large files to start uploading. Enter a boolean value (true or false). Press Enter for the default (true). disable_checksum> true Option encoding. The encoding for the backend. See the encoding section in the overview for more info. Enter a encoder.MultiEncoder value. Press Enter for the default (Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot). encoding> Edit advanced config? y) Yes n) No (default) y/n> n -------------------- [remote] type = internetarchive access_key_id = XXXX secret_access_key = XXXX -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      -
      
      +- Config:      pass
      +- Env Var:     RCLONE_MAILRU_PASS
      +- Type:        string
      +- Required:    true
       
      -### Standard options
      +#### --mailru-speedup-enable
       
      -Here are the Standard options specific to internetarchive (Internet Archive).
      +Skip full upload if there is another file with same data hash.
       
      -#### --internetarchive-access-key-id
      +This feature is called "speedup" or "put by hash". It is especially efficient
      +in case of generally available files like popular books, video or audio clips,
      +because files are searched by hash in all accounts of all mailru users.
      +It is meaningless and ineffective if source file is unique or encrypted.
      +Please note that rclone may need local memory and disk space to calculate
      +content hash in advance and decide whether full upload is required.
      +Also, if rclone does not know file size in advance (e.g. in case of
      +streaming or partial uploads), it will not even try this optimization.
       
      -IAS3 Access Key.
      +Properties:
       
      -Leave blank for anonymous access.
      -You can find one here: https://archive.org/account/s3.php
      +- Config:      speedup_enable
      +- Env Var:     RCLONE_MAILRU_SPEEDUP_ENABLE
      +- Type:        bool
      +- Default:     true
      +- Examples:
      +    - "true"
      +        - Enable
      +    - "false"
      +        - Disable
      +
      +### Advanced options
      +
      +Here are the Advanced options specific to mailru (Mail.ru Cloud).
      +
      +#### --mailru-token
      +
      +OAuth Access Token as a JSON blob.
       
       Properties:
       
      -- Config:      access_key_id
      -- Env Var:     RCLONE_INTERNETARCHIVE_ACCESS_KEY_ID
      +- Config:      token
      +- Env Var:     RCLONE_MAILRU_TOKEN
       - Type:        string
       - Required:    false
       
      -#### --internetarchive-secret-access-key
      +#### --mailru-auth-url
       
      -IAS3 Secret Key (password).
      +Auth server URL.
       
      -Leave blank for anonymous access.
      +Leave blank to use the provider defaults.
       
       Properties:
       
      -- Config:      secret_access_key
      -- Env Var:     RCLONE_INTERNETARCHIVE_SECRET_ACCESS_KEY
      +- Config:      auth_url
      +- Env Var:     RCLONE_MAILRU_AUTH_URL
       - Type:        string
       - Required:    false
       
      -### Advanced options
      -
      -Here are the Advanced options specific to internetarchive (Internet Archive).
      -
      -#### --internetarchive-endpoint
      +#### --mailru-token-url
       
      -IAS3 Endpoint.
      +Token server url.
       
      -Leave blank for default value.
      +Leave blank to use the provider defaults.
       
       Properties:
       
      -- Config:      endpoint
      -- Env Var:     RCLONE_INTERNETARCHIVE_ENDPOINT
      +- Config:      token_url
      +- Env Var:     RCLONE_MAILRU_TOKEN_URL
       - Type:        string
      -- Default:     "https://s3.us.archive.org"
      +- Required:    false
       
      -#### --internetarchive-front-endpoint
      +#### --mailru-speedup-file-patterns
       
      -Host of InternetArchive Frontend.
      +Comma separated list of file name patterns eligible for speedup (put by hash).
       
      -Leave blank for default value.
      +Patterns are case insensitive and can contain '*' or '?' meta characters.
       
       Properties:
       
      -- Config:      front_endpoint
      -- Env Var:     RCLONE_INTERNETARCHIVE_FRONT_ENDPOINT
      +- Config:      speedup_file_patterns
      +- Env Var:     RCLONE_MAILRU_SPEEDUP_FILE_PATTERNS
       - Type:        string
      -- Default:     "https://archive.org"
      -
      -#### --internetarchive-disable-checksum
      -
      -Don't ask the server to test against MD5 checksum calculated by rclone.
      -Normally rclone will calculate the MD5 checksum of the input before
      -uploading it so it can ask the server to check the object against checksum.
      -This is great for data integrity checking but can cause long delays for
      -large files to start uploading.
      -
      -Properties:
      +- Default:     "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf"
      +- Examples:
      +    - ""
      +        - Empty list completely disables speedup (put by hash).
      +    - "*"
      +        - All files will be attempted for speedup.
      +    - "*.mkv,*.avi,*.mp4,*.mp3"
      +        - Only common audio/video files will be tried for put by hash.
      +    - "*.zip,*.gz,*.rar,*.pdf"
      +        - Only common archives or PDF books will be tried for speedup.
       
      -- Config:      disable_checksum
      -- Env Var:     RCLONE_INTERNETARCHIVE_DISABLE_CHECKSUM
      -- Type:        bool
      -- Default:     true
      +#### --mailru-speedup-max-disk
       
      -#### --internetarchive-wait-archive
      +This option allows you to disable speedup (put by hash) for large files.
       
      -Timeout for waiting the server's processing tasks (specifically archive and book_op) to finish.
      -Only enable if you need to be guaranteed to be reflected after write operations.
      -0 to disable waiting. No errors to be thrown in case of timeout.
      +Reason is that preliminary hashing can exhaust your RAM or disk space.
       
       Properties:
       
      -- Config:      wait_archive
      -- Env Var:     RCLONE_INTERNETARCHIVE_WAIT_ARCHIVE
      -- Type:        Duration
      -- Default:     0s
      -
      -#### --internetarchive-encoding
      +- Config:      speedup_max_disk
      +- Env Var:     RCLONE_MAILRU_SPEEDUP_MAX_DISK
      +- Type:        SizeSuffix
      +- Default:     3Gi
      +- Examples:
      +    - "0"
      +        - Completely disable speedup (put by hash).
      +    - "1G"
      +        - Files larger than 1Gb will be uploaded directly.
      +    - "3G"
      +        - Choose this option if you have less than 3Gb free on local disk.
       
      -The encoding for the backend.
      +#### --mailru-speedup-max-memory
       
      -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
      +Files larger than the size given below will always be hashed on disk.
       
       Properties:
       
      -- Config:      encoding
      -- Env Var:     RCLONE_INTERNETARCHIVE_ENCODING
      -- Type:        MultiEncoder
      -- Default:     Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot
      -
      -### Metadata
      -
      -Metadata fields provided by Internet Archive.
      -If there are multiple values for a key, only the first one is returned.
      -This is a limitation of Rclone, that supports one value per one key.
      +- Config:      speedup_max_memory
      +- Env Var:     RCLONE_MAILRU_SPEEDUP_MAX_MEMORY
      +- Type:        SizeSuffix
      +- Default:     32Mi
      +- Examples:
      +    - "0"
      +        - Preliminary hashing will always be done in a temporary disk location.
      +    - "32M"
      +        - Do not dedicate more than 32Mb RAM for preliminary hashing.
      +    - "256M"
      +        - You have at most 256Mb RAM free for hash calculations.
       
      -Owner is able to add custom keys. Metadata feature grabs all the keys including them.
      +#### --mailru-check-hash
       
      -Here are the possible system metadata items for the internetarchive backend.
      +What should copy do if file checksum is mismatched or invalid.
       
      -| Name | Help | Type | Example | Read Only |
      -|------|------|------|---------|-----------|
      -| crc32 | CRC32 calculated by Internet Archive | string | 01234567 | **Y** |
      -| format | Name of format identified by Internet Archive | string | Comma-Separated Values | **Y** |
      -| md5 | MD5 hash calculated by Internet Archive | string | 01234567012345670123456701234567 | **Y** |
      -| mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | **Y** |
      -| name | Full file path, without the bucket part | filename | backend/internetarchive/internetarchive.go | **Y** |
      -| old_version | Whether the file was replaced and moved by keep-old-version flag | boolean | true | **Y** |
      -| rclone-ia-mtime | Time of last modification, managed by Internet Archive | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N |
      -| rclone-mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N |
      -| rclone-update-track | Random value used by Rclone for tracking changes inside Internet Archive | string | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | N |
      -| sha1 | SHA1 hash calculated by Internet Archive | string | 0123456701234567012345670123456701234567 | **Y** |
      -| size | File size in bytes | decimal number | 123456 | **Y** |
      -| source | The source of the file | string | original | **Y** |
      -| summation | Check https://forum.rclone.org/t/31922 for how it is used | string | md5 | **Y** |
      -| viruscheck | The last time viruscheck process was run for the file (?) | unixtime | 1654191352 | **Y** |
      +Properties:
       
      -See the [metadata](https://rclone.org/docs/#metadata) docs for more info.
      +- Config:      check_hash
      +- Env Var:     RCLONE_MAILRU_CHECK_HASH
      +- Type:        bool
      +- Default:     true
      +- Examples:
      +    - "true"
      +        - Fail with error.
      +    - "false"
      +        - Ignore and continue.
       
      +#### --mailru-user-agent
       
      +HTTP user agent used internally by client.
       
      -#  Jottacloud
      +Defaults to "rclone/VERSION" or "--user-agent" provided on command line.
       
      -Jottacloud is a cloud storage service provider from a Norwegian company, using its own datacenters
      -in Norway. In addition to the official service at [jottacloud.com](https://www.jottacloud.com/),
      -it also provides white-label solutions to different companies, such as:
      -* Telia
      -  * Telia Cloud (cloud.telia.se)
      -  * Telia Sky (sky.telia.no)
      -* Tele2
      -  * Tele2 Cloud (mittcloud.tele2.se)
      -* Onlime
      -  * Onlime Cloud Storage (onlime.dk)
      -* Elkjøp (with subsidiaries):
      -  * Elkjøp Cloud (cloud.elkjop.no)
      -  * Elgiganten Sweden (cloud.elgiganten.se)
      -  * Elgiganten Denmark (cloud.elgiganten.dk)
      -  * Giganti Cloud  (cloud.gigantti.fi)
      -  * ELKO Cloud (cloud.elko.is)
      +Properties:
       
      -Most of the white-label versions are supported by this backend, although may require different
      -authentication setup - described below.
      +- Config:      user_agent
      +- Env Var:     RCLONE_MAILRU_USER_AGENT
      +- Type:        string
      +- Required:    false
       
      -Paths are specified as `remote:path`
      +#### --mailru-quirks
       
      -Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
      +Comma separated list of internal maintenance flags.
       
      -## Authentication types
      +This option must not be used by an ordinary user. It is intended only to
      +facilitate remote troubleshooting of backend issues. Strict meaning of
      +flags is not documented and not guaranteed to persist between releases.
      +Quirks will be removed when the backend grows stable.
      +Supported quirks: atomicmkdir binlist unknowndirs
       
      -Some of the whitelabel versions uses a different authentication method than the official service,
      -and you have to choose the correct one when setting up the remote.
      +Properties:
       
      -### Standard authentication
      +- Config:      quirks
      +- Env Var:     RCLONE_MAILRU_QUIRKS
      +- Type:        string
      +- Required:    false
       
      -The standard authentication method used by the official service (jottacloud.com), as well as
      -some of the whitelabel services, requires you to generate a single-use personal login token
      -from the account security settings in the service's web interface. Log in to your account,
      -go to "Settings" and then "Security", or use the direct link presented to you by rclone when
      -configuring the remote: <https://www.jottacloud.com/web/secure>. Scroll down to the section
      -"Personal login token", and click the "Generate" button. Note that if you are using a
      -whitelabel service you probably can't use the direct link, you need to find the same page in
      -their dedicated web interface, and also it may be in a different location than described above.
      +#### --mailru-encoding
       
      -To access your account from multiple instances of rclone, you need to configure each of them
      -with a separate personal login token. E.g. you create a Jottacloud remote with rclone in one
      -location, and copy the configuration file to a second location where you also want to run
      -rclone and access the same remote. Then you need to replace the token for one of them, using
      -the [config reconnect](https://rclone.org/commands/rclone_config_reconnect/) command, which
      -requires you to generate a new personal login token and supply as input. If you do not
      -do this, the token may easily end up being invalidated, resulting in both instances failing
      -with an error message something along the lines of:
      +The encoding for the backend.
       
      -    oauth2: cannot fetch token: 400 Bad Request
      -    Response: {"error":"invalid_grant","error_description":"Stale token"}
      +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
       
      -When this happens, you need to replace the token as described above to be able to use your
      -remote again.
      +Properties:
       
      -All personal login tokens you have taken into use will be listed in the web interface under
      -"My logged in devices", and from the right side of that list you can click the "X" button to
      -revoke individual tokens.
      +- Config:      encoding
      +- Env Var:     RCLONE_MAILRU_ENCODING
      +- Type:        Encoding
      +- Default:     Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot
       
      -### Legacy authentication
       
      -If you are using one of the whitelabel versions (e.g. from Elkjøp) you may not have the option
      -to generate a CLI token. In this case you'll have to use the legacy authentication. To do this select
      -yes when the setup asks for legacy authentication and enter your username and password.
      -The rest of the setup is identical to the default setup.
       
      -### Telia Cloud authentication
      +## Limitations
       
      -Similar to other whitelabel versions Telia Cloud doesn't offer the option of creating a CLI token, and
      -additionally uses a separate authentication flow where the username is generated internally. To setup
      -rclone to use Telia Cloud, choose Telia Cloud authentication in the setup. The rest of the setup is
      -identical to the default setup.
      +File size limits depend on your account. A single file size is limited by 2G
      +for a free account and unlimited for paid tariffs. Please refer to the Mail.ru
      +site for the total uploaded size limits.
       
      -### Tele2 Cloud authentication
      +Note that Mailru is case insensitive so you can't have a file called
      +"Hello.doc" and one called "hello.doc".
       
      -As Tele2-Com Hem merger was completed this authentication can be used for former Com Hem Cloud and
      -Tele2 Cloud customers as no support for creating a CLI token exists, and additionally uses a separate
      -authentication flow where the username is generated internally. To setup rclone to use Tele2 Cloud,
      -choose Tele2 Cloud authentication in the setup. The rest of the setup is identical to the default setup.
      +#  Mega
       
      -### Onlime Cloud Storage authentication
      +[Mega](https://mega.nz/) is a cloud storage and file hosting service
      +known for its security feature where all files are encrypted locally
      +before they are uploaded. This prevents anyone (including employees of
      +Mega) from accessing the files without knowledge of the key used for
      +encryption.
       
      -Onlime has sold access to Jottacloud proper, while providing localized support to Danish Customers, but
      -have recently set up their own hosting, transferring their customers from Jottacloud servers to their
      -own ones.
      +This is an rclone backend for Mega which supports the file transfer
      +features of Mega using the same client side encryption.
       
      -This, of course, necessitates using their servers for authentication, but otherwise functionality and
      -architecture seems equivalent to Jottacloud.
      +Paths are specified as `remote:path`
       
      -To setup rclone to use Onlime Cloud Storage, choose Onlime Cloud authentication in the setup. The rest
      -of the setup is identical to the default setup.
      +Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
       
       ## Configuration
       
      -Here is an example of how to make a remote called `remote` with the default setup.  First run:
      +Here is an example of how to make a remote called `remote`.  First run:
       
      -    rclone config
      +     rclone config
       
       This will guide you through an interactive setup process:
       
      -

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. [snip] XX / Jottacloud  (jottacloud) [snip] Storage> jottacloud Edit advanced config? y) Yes n) No (default) y/n> n Option config_type. Select authentication type. Choose a number from below, or type in an existing string value. Press Enter for the default (standard). / Standard authentication. 1 | Use this if you're a normal Jottacloud user.  (standard) / Legacy authentication. 2 | This is only required for certain whitelabel versions of Jottacloud and not recommended for normal users.  (legacy) / Telia Cloud authentication. 3 | Use this if you are using Telia Cloud.  (telia) / Tele2 Cloud authentication. 4 | Use this if you are using Tele2 Cloud.  (tele2) / Onlime Cloud authentication. 5 | Use this if you are using Onlime Cloud.  (onlime) config_type> 1 Personal login token. Generate here: https://www.jottacloud.com/web/secure Login Token> Use a non-standard device/mountpoint? Choosing no, the default, will let you access the storage used for the archive section of the official Jottacloud client. If you instead want to access the sync or the backup section, for example, you must choose yes. y) Yes n) No (default) y/n> y Option config_device. The device to use. In standard setup the built-in Jotta device is used, which contains predefined mountpoints for archive, sync etc. All other devices are treated as backup devices by the official Jottacloud client. You may create a new by entering a unique name. Choose a number from below, or type in your own string value. Press Enter for the default (DESKTOP-3H31129). 1 > DESKTOP-3H31129 2 > Jotta config_device> 2 Option config_mountpoint. The mountpoint to use for the built-in device Jotta. The standard setup is to use the Archive mountpoint. Most other mountpoints have very limited support in rclone and should generally be avoided. Choose a number from below, or type in an existing string value. Press Enter for the default (Archive). 1 > Archive 2 > Shared 3 > Sync config_mountpoint> 1 -------------------- [remote] type = jottacloud configVersion = 1 client_id = jottacli client_secret = tokenURL = https://id.jottacloud.com/auth/realms/jottacloud/protocol/openid-connect/token token = {........} username = 2940e57271a93d987d6f8a21 device = Jotta mountpoint = Archive -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      +

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Mega  "mega" [snip] Storage> mega User name user> you@example.com Password. y) Yes type in my own password g) Generate random password n) No leave this optional password blank y/g/n> y Enter the password: password: Confirm the password: password: Remote config -------------------- [remote] type = mega user = you@example.com pass = *** ENCRYPTED *** -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

      
      +**NOTE:** The encryption keys need to have been already generated after a regular login
      +via the browser, otherwise attempting to use the credentials in `rclone` will fail.
      +
       Once configured you can then use `rclone` like this,
       
      -List directories in top level of your Jottacloud
      +List directories in top level of your Mega
       
           rclone lsd remote:
       
      -List all the files in your Jottacloud
      +List all the files in your Mega
       
           rclone ls remote:
       
      -To copy a local directory to an Jottacloud directory called backup
      +To copy a local directory to an Mega directory called backup
       
           rclone copy /home/source remote:backup
       
      -### Devices and Mountpoints
      +### Modification times and hashes
       
      -The official Jottacloud client registers a device for each computer you install
      -it on, and shows them in the backup section of the user interface. For each
      -folder you select for backup it will create a mountpoint within this device.
      -A built-in device called Jotta is special, and contains mountpoints Archive,
      -Sync and some others, used for corresponding features in official clients.
      +Mega does not support modification times or hashes yet.
       
      -With rclone you'll want to use the standard Jotta/Archive device/mountpoint in
      -most cases. However, you may for example want to access files from the sync or
      -backup functionality provided by the official clients, and rclone therefore
      -provides the option to select other devices and mountpoints during config.
      +### Restricted filename characters
       
      -You are allowed to create new devices and mountpoints. All devices except the
      -built-in Jotta device are treated as backup devices by official Jottacloud
      -clients, and the mountpoints on them are individual backup sets.
      +| Character | Value | Replacement |
      +| --------- |:-----:|:-----------:|
      +| NUL       | 0x00  | ␀           |
      +| /         | 0x2F  | /          |
       
      -With the built-in Jotta device, only existing, built-in, mountpoints can be
      -selected. In addition to the mentioned Archive and Sync, it may contain
      -several other mountpoints such as: Latest, Links, Shared and Trash. All of
      -these are special mountpoints with a different internal representation than
      -the "regular" mountpoints. Rclone will only to a very limited degree support
      -them. Generally you should avoid these, unless you know what you are doing.
      +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
      +as they can't be used in JSON strings.
       
      -### --fast-list
      +### Duplicated files
       
      -This remote supports `--fast-list` which allows you to use fewer
      -transactions in exchange for more memory. See the [rclone
      -docs](https://rclone.org/docs/#fast-list) for more details.
      +Mega can have two files with exactly the same name and path (unlike a
      +normal file system).
       
      -Note that the implementation in Jottacloud always uses only a single
      -API request to get the entire list, so for large folders this could
      -lead to long wait time before the first results are shown.
      +Duplicated files cause problems with the syncing and you will see
      +messages in the log about duplicates.
       
      -Note also that with rclone version 1.58 and newer information about
      -[MIME types](https://rclone.org/overview/#mime-type) are not available when using `--fast-list`.
      +Use `rclone dedupe` to fix duplicated files.
       
      -### Modified time and hashes
      +### Failure to log-in
       
      -Jottacloud allows modification times to be set on objects accurate to 1
      -second. These will be used to detect whether objects need syncing or
      -not.
      +#### Object not found
       
      -Jottacloud supports MD5 type hashes, so you can use the `--checksum`
      -flag.
      +If you are connecting to your Mega remote for the first time, 
      +to test access and synchronization, you may receive an error such as 
      +
      +

      Failed to create file system for "my-mega-remote:": couldn't login: Object (typically, node or user) not found

      +
      
      +The diagnostic steps often recommended in the [rclone forum](https://forum.rclone.org/search?q=mega)
      +start with the **MEGAcmd** utility. Note that this refers to 
      +the official C++ command from https://github.com/meganz/MEGAcmd 
      +and not the go language built command from t3rm1n4l/megacmd 
      +that is no longer maintained. 
       
      -Note that Jottacloud requires the MD5 hash before upload so if the
      -source does not have an MD5 checksum then the file will be cached
      -temporarily on disk (in location given by
      -[--temp-dir](https://rclone.org/docs/#temp-dir-dir)) before it is uploaded.
      -Small files will be cached in memory - see the
      -[--jottacloud-md5-memory-limit](#jottacloud-md5-memory-limit) flag.
      -When uploading from local disk the source checksum is always available,
      -so this does not apply. Starting with rclone version 1.52 the same is
      -true for encrypted remotes (in older versions the crypt backend would not
      -calculate hashes for uploads from local disk, so the Jottacloud
      -backend had to do it as described above).
      +Follow the instructions for installing MEGAcmd and try accessing 
      +your remote as they recommend. You can establish whether or not 
      +you can log in using MEGAcmd, and obtain diagnostic information 
      +to help you, and search or work with others in the forum. 
      +
      +

      MEGA CMD> login me@example.com Password: Fetching nodes ... Loading transfers from local cache Login complete as me@example.com me@example.com:/$

      +
      
      +Note that some have found issues with passwords containing special 
      +characters. If you can not log on with rclone, but MEGAcmd logs on 
      +just fine, then consider changing your password temporarily to 
      +pure alphanumeric characters, in case that helps.
       
      -### Restricted filename characters
       
      -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
      -the following characters are also replaced:
      +#### Repeated commands blocks access
       
      -| Character | Value | Replacement |
      -| --------- |:-----:|:-----------:|
      -| "         | 0x22  | "          |
      -| *         | 0x2A  | *          |
      -| :         | 0x3A  | :          |
      -| <         | 0x3C  | <          |
      -| >         | 0x3E  | >          |
      -| ?         | 0x3F  | ?          |
      -| \|        | 0x7C  | |          |
      +Mega remotes seem to get blocked (reject logins) under "heavy use".
      +We haven't worked out the exact blocking rules but it seems to be
      +related to fast paced, successive rclone commands.
       
      -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
      -as they can't be used in XML strings.
      +For example, executing this command 90 times in a row `rclone link
      +remote:file` will cause the remote to become "blocked". This is not an
      +abnormal situation, for example if you wish to get the public links of
      +a directory with hundred of files...  After more or less a week, the
      +remote will remote accept rclone logins normally again.
       
      -### Deleting files
      +You can mitigate this issue by mounting the remote it with `rclone
      +mount`. This will log-in when mounting and a log-out when unmounting
      +only. You can also run `rclone rcd` and then use `rclone rc` to run
      +the commands over the API to avoid logging in each time.
       
      -By default, rclone will send all files to the trash when deleting files. They will be permanently
      -deleted automatically after 30 days. You may bypass the trash and permanently delete files immediately
      -by using the [--jottacloud-hard-delete](#jottacloud-hard-delete) flag, or set the equivalent environment variable.
      -Emptying the trash is supported by the [cleanup](https://rclone.org/commands/rclone_cleanup/) command.
      +Rclone does not currently close mega sessions (you can see them in the
      +web interface), however closing the sessions does not solve the issue.
       
      -### Versions
      +If you space rclone commands by 3 seconds it will avoid blocking the
      +remote. We haven't identified the exact blocking rules, so perhaps one
      +could execute the command 80 times without waiting and avoid blocking
      +by waiting 3 seconds, then continuing...
       
      -Jottacloud supports file versioning. When rclone uploads a new version of a file it creates a new version of it.
      -Currently rclone only supports retrieving the current version but older versions can be accessed via the Jottacloud Website.
      +Note that this has been observed by trial and error and might not be
      +set in stone.
       
      -Versioning can be disabled by `--jottacloud-no-versions` option. This is achieved by deleting the remote file prior to uploading
      -a new version. If the upload the fails no version of the file will be available in the remote.
      +Other tools seem not to produce this blocking effect, as they use a
      +different working approach (state-based, using sessionIDs instead of
      +log-in) which isn't compatible with the current stateless rclone
      +approach.
       
      -### Quota information
      +Note that once blocked, the use of other tools (such as megacmd) is
      +not a sure workaround: following megacmd login times have been
      +observed in succession for blocked remote: 7 minutes, 20 min, 30min, 30
      +min, 30min. Web access looks unaffected though.
       
      -To view your current quota you can use the `rclone about remote:`
      -command which will display your usage limit (unless it is unlimited)
      -and the current usage.
      +Investigation is continuing in relation to workarounds based on
      +timeouts, pacers, retrials and tpslimits - if you discover something
      +relevant, please post on the forum.
      +
      +So, if rclone was working nicely and suddenly you are unable to log-in
      +and you are sure the user and the password are correct, likely you
      +have got the remote blocked for a while.
       
       
       ### Standard options
       
      -Here are the Standard options specific to jottacloud (Jottacloud).
      -
      -#### --jottacloud-client-id
      +Here are the Standard options specific to mega (Mega).
       
      -OAuth Client Id.
      +#### --mega-user
       
      -Leave blank normally.
      +User name.
       
       Properties:
       
      -- Config:      client_id
      -- Env Var:     RCLONE_JOTTACLOUD_CLIENT_ID
      +- Config:      user
      +- Env Var:     RCLONE_MEGA_USER
       - Type:        string
      -- Required:    false
      +- Required:    true
       
      -#### --jottacloud-client-secret
      +#### --mega-pass
       
      -OAuth Client Secret.
      +Password.
       
      -Leave blank normally.
      +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
       
       Properties:
       
      -- Config:      client_secret
      -- Env Var:     RCLONE_JOTTACLOUD_CLIENT_SECRET
      +- Config:      pass
      +- Env Var:     RCLONE_MEGA_PASS
       - Type:        string
      -- Required:    false
      +- Required:    true
       
       ### Advanced options
       
      -Here are the Advanced options specific to jottacloud (Jottacloud).
      -
      -#### --jottacloud-token
      -
      -OAuth Access Token as a JSON blob.
      -
      -Properties:
      -
      -- Config:      token
      -- Env Var:     RCLONE_JOTTACLOUD_TOKEN
      -- Type:        string
      -- Required:    false
      +Here are the Advanced options specific to mega (Mega).
       
      -#### --jottacloud-auth-url
      +#### --mega-debug
       
      -Auth server URL.
      +Output more debug from Mega.
       
      -Leave blank to use the provider defaults.
      +If this flag is set (along with -vv) it will print further debugging
      +information from the mega backend.
       
       Properties:
       
      -- Config:      auth_url
      -- Env Var:     RCLONE_JOTTACLOUD_AUTH_URL
      -- Type:        string
      -- Required:    false
      -
      -#### --jottacloud-token-url
      -
      -Token server url.
      -
      -Leave blank to use the provider defaults.
      -
      -Properties:
      +- Config:      debug
      +- Env Var:     RCLONE_MEGA_DEBUG
      +- Type:        bool
      +- Default:     false
       
      -- Config:      token_url
      -- Env Var:     RCLONE_JOTTACLOUD_TOKEN_URL
      -- Type:        string
      -- Required:    false
      +#### --mega-hard-delete
       
      -#### --jottacloud-md5-memory-limit
      +Delete files permanently rather than putting them into the trash.
       
      -Files bigger than this will be cached on disk to calculate the MD5 if required.
      +Normally the mega backend will put all deletions into the trash rather
      +than permanently deleting them.  If you specify this then rclone will
      +permanently delete objects instead.
       
       Properties:
       
      -- Config:      md5_memory_limit
      -- Env Var:     RCLONE_JOTTACLOUD_MD5_MEMORY_LIMIT
      -- Type:        SizeSuffix
      -- Default:     10Mi
      +- Config:      hard_delete
      +- Env Var:     RCLONE_MEGA_HARD_DELETE
      +- Type:        bool
      +- Default:     false
       
      -#### --jottacloud-trashed-only
      +#### --mega-use-https
       
      -Only show files that are in the trash.
      +Use HTTPS for transfers.
       
      -This will show trashed files in their original directory structure.
      +MEGA uses plain text HTTP connections by default.
      +Some ISPs throttle HTTP connections, this causes transfers to become very slow.
      +Enabling this will force MEGA to use HTTPS for all transfers.
      +HTTPS is normally not necessary since all data is already encrypted anyway.
      +Enabling it will increase CPU usage and add network overhead.
       
       Properties:
       
      -- Config:      trashed_only
      -- Env Var:     RCLONE_JOTTACLOUD_TRASHED_ONLY
      +- Config:      use_https
      +- Env Var:     RCLONE_MEGA_USE_HTTPS
       - Type:        bool
       - Default:     false
       
      -#### --jottacloud-hard-delete
      +#### --mega-encoding
       
      -Delete files permanently rather than putting them into the trash.
      +The encoding for the backend.
      +
      +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
       
       Properties:
       
      -- Config:      hard_delete
      -- Env Var:     RCLONE_JOTTACLOUD_HARD_DELETE
      -- Type:        bool
      -- Default:     false
      +- Config:      encoding
      +- Env Var:     RCLONE_MEGA_ENCODING
      +- Type:        Encoding
      +- Default:     Slash,InvalidUtf8,Dot
       
      -#### --jottacloud-upload-resume-limit
       
      -Files bigger than this can be resumed if the upload fail's.
       
      -Properties:
      +### Process `killed`
       
      -- Config:      upload_resume_limit
      -- Env Var:     RCLONE_JOTTACLOUD_UPLOAD_RESUME_LIMIT
      -- Type:        SizeSuffix
      -- Default:     10Mi
      +On accounts with large files or something else, memory usage can significantly increase when executing list/sync instructions. When running on cloud providers (like AWS with EC2), check if the instance type has sufficient memory/CPU to execute the commands. Use the resource monitoring tools to inspect after sending the commands. Look [at this issue](https://forum.rclone.org/t/rclone-with-mega-appears-to-work-only-in-some-accounts/40233/4).
       
      -#### --jottacloud-no-versions
      +## Limitations
       
      -Avoid server side versioning by deleting files and recreating files instead of overwriting them.
      +This backend uses the [go-mega go library](https://github.com/t3rm1n4l/go-mega) which is an opensource
      +go library implementing the Mega API. There doesn't appear to be any
      +documentation for the mega protocol beyond the [mega C++ SDK](https://github.com/meganz/sdk) source code
      +so there are likely quite a few errors still remaining in this library.
       
      -Properties:
      +Mega allows duplicate files which may confuse rclone.
       
      -- Config:      no_versions
      -- Env Var:     RCLONE_JOTTACLOUD_NO_VERSIONS
      -- Type:        bool
      -- Default:     false
      +#  Memory
       
      -#### --jottacloud-encoding
      +The memory backend is an in RAM backend. It does not persist its
      +data - use the local backend for that.
       
      -The encoding for the backend.
      +The memory backend behaves like a bucket-based remote (e.g. like
      +s3). Because it has no parameters you can just use it with the
      +`:memory:` remote name.
       
      -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
      +## Configuration
       
      -Properties:
      +You can configure it as a remote like this with `rclone config` too if
      +you want to:
      +
      +

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / Memory  "memory" [snip] Storage> memory ** See help for memory backend at: https://rclone.org/memory/ **

      +

      Remote config

      + + + + + + + + + +
      [remote]
      type = memory
      +
        +
      1. Yes this is OK (default)
      2. +
      3. Edit this remote
      4. +
      5. Delete this remote y/e/d> y
      6. +
      +
      
      +Because the memory backend isn't persistent it is most useful for
      +testing or with an rclone server or rclone mount, e.g.
       
      -- Config:      encoding
      -- Env Var:     RCLONE_JOTTACLOUD_ENCODING
      -- Type:        MultiEncoder
      -- Default:     Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot
      +    rclone mount :memory: /mnt/tmp
      +    rclone serve webdav :memory:
      +    rclone serve sftp :memory:
       
      +### Modification times and hashes
       
      +The memory backend supports MD5 hashes and modification times accurate to 1 nS.
       
      -## Limitations
      +### Restricted filename characters
       
      -Note that Jottacloud is case insensitive so you can't have a file called
      -"Hello.doc" and one called "hello.doc".
      +The memory backend replaces the [default restricted characters
      +set](https://rclone.org/overview/#restricted-characters).
       
      -There are quite a few characters that can't be in Jottacloud file names. Rclone will map these names to and from an identical
      -looking unicode equivalent. For example if a file has a ? in it will be mapped to ? instead.
       
      -Jottacloud only supports filenames up to 255 characters in length.
       
      -## Troubleshooting
       
      -Jottacloud exhibits some inconsistent behaviours regarding deleted files and folders which may cause Copy, Move and DirMove
      -operations to previously deleted paths to fail. Emptying the trash should help in such cases.
      +#  Akamai NetStorage
       
      -#  Koofr
      +Paths are specified as `remote:`
      +You may put subdirectories in too, e.g. `remote:/path/to/dir`.
      +If you have a CP code you can use that as the folder after the domain such as \<domain>\/\<cpcode>\/\<internal directories within cpcode>.
       
      -Paths are specified as `remote:path`
      +For example, this is commonly configured with or without a CP code:
      +* **With a CP code**. `[your-domain-prefix]-nsu.akamaihd.net/123456/subdirectory/`
      +* **Without a CP code**. `[your-domain-prefix]-nsu.akamaihd.net`
       
      -Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
       
      -## Configuration
      +See all buckets
      +   rclone lsd remote:
      +The initial setup for Netstorage involves getting an account and secret. Use `rclone config` to walk you through the setup process.
       
      -The initial setup for Koofr involves creating an application password for
      -rclone. You can do that by opening the Koofr
      -[web application](https://app.koofr.net/app/admin/preferences/password),
      -giving the password a nice name like `rclone` and clicking on generate.
      +## Configuration
       
      -Here is an example of how to make a remote called `koofr`.  First run:
      +Here's an example of how to make a remote called `ns1`.
       
      -     rclone config
      +1. To begin the interactive configuration process, enter this command:
      +
      +

      rclone config

      +
      
      +2. Type `n` to create a new remote.
      +
      +
        +
      1. New remote
      2. +
      3. Delete remote
      4. +
      5. Quit config e/n/d/q> n
      6. +
      +
      
      +3. For this example, enter `ns1` when you reach the name> prompt.
      +
      +

      name> ns1

      +
      
      +4. Enter `netstorage` as the type of storage to configure.
      +
      +

      Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value XX / NetStorage  "netstorage" Storage> netstorage

      +
      
      +5. Select between the HTTP or HTTPS protocol. Most users should choose HTTPS, which is the default. HTTP is provided primarily for debugging purposes.
       
      -This will guide you through an interactive setup process:
       
      -

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> koofr Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. [snip] 22 / Koofr, Digi Storage and other Koofr-compatible storage providers  (koofr) [snip] Storage> koofr Option provider. Choose your storage provider. Choose a number from below, or type in your own value. Press Enter to leave empty. 1 / Koofr, https://app.koofr.net/  (koofr) 2 / Digi Storage, https://storage.rcs-rds.ro/  (digistorage) 3 / Any other Koofr API compatible storage service  (other) provider> 1
      -Option user. Your user name. Enter a value. user> USERNAME Option password. Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password). Choose an alternative below. y) Yes, type in my own password g) Generate random password y/g> y Enter the password: password: Confirm the password: password: Edit advanced config? y) Yes n) No (default) y/n> n Remote config -------------------- [koofr] type = koofr provider = koofr user = USERNAME password = *** ENCRYPTED *** -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      +

      Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / HTTP protocol  "http" 2 / HTTPS protocol  "https" protocol> 1

      
      -You can choose to edit advanced config in order to enter your own service URL
      -if you use an on-premise or white label Koofr instance, or choose an alternative
      -mount instead of your primary storage.
      +6. Specify your NetStorage host, CP code, and any necessary content paths using this format: `<domain>/<cpcode>/<content>/`
      +
      +

      Enter a string value. Press Enter for the default (""). host> baseball-nsu.akamaihd.net/123456/content/

      +
      
      +7. Set the netstorage account name
      +

      Enter a string value. Press Enter for the default (""). account> username

      +
      
      +8. Set the Netstorage account secret/G2O key which will be used for authentication purposes. Select the `y` option to set your own password then enter your secret.
      +Note: The secret is stored in the `rclone.conf` file with hex-encoded encryption.
      +
      +
        +
      1. Yes type in my own password
      2. +
      3. Generate random password y/g> y Enter the password: password: Confirm the password: password:
      4. +
      +
      
      +9. View the summary and confirm your remote configuration.
      +
      +

      [ns1] type = netstorage protocol = http host = baseball-nsu.akamaihd.net/123456/content/ account = username secret = *** ENCRYPTED *** -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      +
      
      +This remote is called `ns1` and can now be used.
       
      -Once configured you can then use `rclone` like this,
      +## Example operations
       
      -List directories in top level of your Koofr
      +Get started with rclone and NetStorage with these examples. For additional rclone commands, visit https://rclone.org/commands/.
       
      -    rclone lsd koofr:
      +### See contents of a directory in your project
       
      -List all the files in your Koofr
      +    rclone lsd ns1:/974012/testing/
       
      -    rclone ls koofr:
      +### Sync the contents local with remote
       
      -To copy a local directory to an Koofr directory called backup
      +    rclone sync . ns1:/974012/testing/
       
      -    rclone copy /home/source koofr:backup
      +### Upload local content to remote
      +    rclone copy notes.txt ns1:/974012/testing/
       
      -### Restricted filename characters
      +### Delete content on remote
      +    rclone delete ns1:/974012/testing/notes.txt
       
      -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
      -the following characters are also replaced:
      +### Move or copy content between CP codes.
       
      -| Character | Value | Replacement |
      -| --------- |:-----:|:-----------:|
      -| \         | 0x5C  | \           |
      +Your credentials must have access to two CP codes on the same remote. You can't perform operations between different remotes.
       
      -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
      -as they can't be used in XML strings.
      +    rclone move ns1:/974012/testing/notes.txt ns1:/974450/testing2/
       
      +## Features
       
      -### Standard options
      +### Symlink Support
       
      -Here are the Standard options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers).
      +The Netstorage backend changes the rclone `--links, -l` behavior. When uploading, instead of creating the .rclonelink file, use the "symlink" API in order to create the corresponding symlink on the remote. The .rclonelink file will not be created, the upload will be intercepted and only the symlink file that matches the source file name with no suffix will be created on the remote.
       
      -#### --koofr-provider
      +This will effectively allow commands like copy/copyto, move/moveto and sync to upload from local to remote and download from remote to local directories with symlinks. Due to internal rclone limitations, it is not possible to upload an individual symlink file to any remote backend. You can always use the "backend symlink" command to create a symlink on the NetStorage server, refer to "symlink" section below.
       
      -Choose your storage provider.
      +Individual symlink files on the remote can be used with the commands like "cat" to print the destination name, or "delete" to delete symlink, or copy, copy/to and move/moveto to download from the remote to local. Note: individual symlink files on the remote should be specified including the suffix .rclonelink.
       
      -Properties:
      +**Note**: No file with the suffix .rclonelink should ever exist on the server since it is not possible to actually upload/create a file with .rclonelink suffix with rclone, it can only exist if it is manually created through a non-rclone method on the remote.
       
      -- Config:      provider
      -- Env Var:     RCLONE_KOOFR_PROVIDER
      -- Type:        string
      -- Required:    false
      -- Examples:
      -    - "koofr"
      -        - Koofr, https://app.koofr.net/
      -    - "digistorage"
      -        - Digi Storage, https://storage.rcs-rds.ro/
      -    - "other"
      -        - Any other Koofr API compatible storage service
      +### Implicit vs. Explicit Directories
       
      -#### --koofr-endpoint
      +With NetStorage, directories can exist in one of two forms:
       
      -The Koofr API endpoint to use.
      +1. **Explicit Directory**. This is an actual, physical directory that you have created in a storage group.
      +2. **Implicit Directory**. This refers to a directory within a path that has not been physically created. For example, during upload of a file, nonexistent subdirectories can be specified in the target path. NetStorage creates these as "implicit." While the directories aren't physically created, they exist implicitly and the noted path is connected with the uploaded file.
       
      -Properties:
      +Rclone will intercept all file uploads and mkdir commands for the NetStorage remote and will explicitly issue the mkdir command for each directory in the uploading path. This will help with the interoperability with the other Akamai services such as SFTP and the Content Management Shell (CMShell). Rclone will not guarantee correctness of operations with implicit directories which might have been created as a result of using an upload API directly.
       
      -- Config:      endpoint
      -- Env Var:     RCLONE_KOOFR_ENDPOINT
      -- Provider:    other
      -- Type:        string
      -- Required:    true
      +### `--fast-list` / ListR support
       
      -#### --koofr-user
      +NetStorage remote supports the ListR feature by using the "list" NetStorage API action to return a lexicographical list of all objects within the specified CP code, recursing into subdirectories as they're encountered.
       
      -Your user name.
      +* **Rclone will use the ListR method for some commands by default**. Commands such as `lsf -R` will use ListR by default. To disable this, include the `--disable listR` option to use the non-recursive method of listing objects.
       
      -Properties:
      +* **Rclone will not use the ListR method for some commands**. Commands such as `sync` don't use ListR by default. To force using the ListR method, include the  `--fast-list` option.
       
      -- Config:      user
      -- Env Var:     RCLONE_KOOFR_USER
      -- Type:        string
      -- Required:    true
      +There are pros and cons of using the ListR method, refer to [rclone documentation](https://rclone.org/docs/#fast-list). In general, the sync command over an existing deep tree on the remote will run faster with the "--fast-list" flag but with extra memory usage as a side effect. It might also result in higher CPU utilization but the whole task can be completed faster.
       
      -#### --koofr-password
      +**Note**: There is a known limitation that "lsf -R" will display number of files in the directory and directory size as -1 when ListR method is used. The workaround is to pass "--disable listR" flag if these numbers are important in the output.
       
      -Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password).
      +### Purge
       
      -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
      +NetStorage remote supports the purge feature by using the "quick-delete" NetStorage API action. The quick-delete action is disabled by default for security reasons and can be enabled for the account through the Akamai portal. Rclone will first try to use quick-delete action for the purge command and if this functionality is disabled then will fall back to a standard delete method.
      +
      +**Note**: Read the [NetStorage Usage API](https://learn.akamai.com/en-us/webhelp/netstorage/netstorage-http-api-developer-guide/GUID-15836617-9F50-405A-833C-EA2556756A30.html) for considerations when using "quick-delete". In general, using quick-delete method will not delete the tree immediately and objects targeted for quick-delete may still be accessible.
      +
      +
      +### Standard options
      +
      +Here are the Standard options specific to netstorage (Akamai NetStorage).
      +
      +#### --netstorage-host
      +
      +Domain+path of NetStorage host to connect to.
      +
      +Format should be `<domain>/<internal folders>`
       
       Properties:
       
      -- Config:      password
      -- Env Var:     RCLONE_KOOFR_PASSWORD
      -- Provider:    koofr
      +- Config:      host
      +- Env Var:     RCLONE_NETSTORAGE_HOST
       - Type:        string
       - Required:    true
       
      -#### --koofr-password
      -
      -Your password for rclone (generate one at https://storage.rcs-rds.ro/app/admin/preferences/password).
      +#### --netstorage-account
       
      -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
      +Set the NetStorage account name
       
       Properties:
       
      -- Config:      password
      -- Env Var:     RCLONE_KOOFR_PASSWORD
      -- Provider:    digistorage
      +- Config:      account
      +- Env Var:     RCLONE_NETSTORAGE_ACCOUNT
       - Type:        string
       - Required:    true
       
      -#### --koofr-password
      +#### --netstorage-secret
       
      -Your password for rclone (generate one at your service's settings page).
      +Set the NetStorage account secret/G2O key for authentication.
      +
      +Please choose the 'y' option to set your own password then enter your secret.
       
       **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
       
       Properties:
       
      -- Config:      password
      -- Env Var:     RCLONE_KOOFR_PASSWORD
      -- Provider:    other
      +- Config:      secret
      +- Env Var:     RCLONE_NETSTORAGE_SECRET
       - Type:        string
       - Required:    true
       
       ### Advanced options
       
      -Here are the Advanced options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers).
      +Here are the Advanced options specific to netstorage (Akamai NetStorage).
       
      -#### --koofr-mountid
      +#### --netstorage-protocol
       
      -Mount ID of the mount to use.
      +Select between HTTP or HTTPS protocol.
       
      -If omitted, the primary mount is used.
      +Most users should choose HTTPS, which is the default.
      +HTTP is provided primarily for debugging purposes.
       
       Properties:
       
      -- Config:      mountid
      -- Env Var:     RCLONE_KOOFR_MOUNTID
      +- Config:      protocol
      +- Env Var:     RCLONE_NETSTORAGE_PROTOCOL
       - Type:        string
      -- Required:    false
      -
      -#### --koofr-setmtime
      -
      -Does the backend support setting modification time.
      -
      -Set this to false if you use a mount ID that points to a Dropbox or Amazon Drive backend.
      +- Default:     "https"
      +- Examples:
      +    - "http"
      +        - HTTP protocol
      +    - "https"
      +        - HTTPS protocol
       
      -Properties:
      +## Backend commands
       
      -- Config:      setmtime
      -- Env Var:     RCLONE_KOOFR_SETMTIME
      -- Type:        bool
      -- Default:     true
      +Here are the commands specific to the netstorage backend.
       
      -#### --koofr-encoding
      +Run them with
       
      -The encoding for the backend.
      +    rclone backend COMMAND remote:
       
      -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
      +The help below will explain what arguments each command takes.
       
      -Properties:
      +See the [backend](https://rclone.org/commands/rclone_backend/) command for more
      +info on how to pass options and arguments.
       
      -- Config:      encoding
      -- Env Var:     RCLONE_KOOFR_ENCODING
      -- Type:        MultiEncoder
      -- Default:     Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot
      +These can be run on a running backend using the rc command
      +[backend/command](https://rclone.org/rc/#backend-command).
       
      +### du
       
      +Return disk usage information for a specified directory
       
      -## Limitations
      +    rclone backend du remote: [options] [<arguments>+]
       
      -Note that Koofr is case insensitive so you can't have a file called
      -"Hello.doc" and one called "hello.doc".
      +The usage information returned, includes the targeted directory as well as all
      +files stored in any sub-directories that may exist.
       
      -## Providers
      +### symlink
       
      -### Koofr
      +You can create a symbolic link in ObjectStore with the symlink action.
       
      -This is the original [Koofr](https://koofr.eu) storage provider used as main example and described in the [configuration](#configuration) section above.
      +    rclone backend symlink remote: [options] [<arguments>+]
       
      -### Digi Storage 
      +The desired path location (including applicable sub-directories) ending in
      +the object that will be the target of the symlink (for example, /links/mylink).
      +Include the file extension for the object, if applicable.
      +`rclone backend symlink <src> <path>`
       
      -[Digi Storage](https://www.digi.ro/servicii/online/digi-storage) is a cloud storage service run by [Digi.ro](https://www.digi.ro/) that
      -provides a Koofr API.
       
      -Here is an example of how to make a remote called `ds`.  First run:
       
      -     rclone config
      +#  Microsoft Azure Blob Storage
       
      -This will guide you through an interactive setup process:
      -
      -

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> ds Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. [snip] 22 / Koofr, Digi Storage and other Koofr-compatible storage providers  (koofr) [snip] Storage> koofr Option provider. Choose your storage provider. Choose a number from below, or type in your own value. Press Enter to leave empty. 1 / Koofr, https://app.koofr.net/  (koofr) 2 / Digi Storage, https://storage.rcs-rds.ro/  (digistorage) 3 / Any other Koofr API compatible storage service  (other) provider> 2 Option user. Your user name. Enter a value. user> USERNAME Option password. Your password for rclone (generate one at https://storage.rcs-rds.ro/app/admin/preferences/password). Choose an alternative below. y) Yes, type in my own password g) Generate random password y/g> y Enter the password: password: Confirm the password: password: Edit advanced config? y) Yes n) No (default) y/n> n -------------------- [ds] type = koofr provider = digistorage user = USERNAME password = *** ENCRYPTED *** -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      -
      
      -### Other
      +Paths are specified as `remote:container` (or `remote:` for the `lsd`
      +command.)  You may put subdirectories in too, e.g.
      +`remote:container/path/to/dir`.
       
      -You may also want to use another, public or private storage provider that runs a Koofr API compatible service, by simply providing the base URL to connect to.
      +## Configuration
       
      -Here is an example of how to make a remote called `other`.  First run:
      +Here is an example of making a Microsoft Azure Blob Storage
      +configuration.  For a remote called `remote`.  First run:
       
            rclone config
       
       This will guide you through an interactive setup process:
       
      -

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> other Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. [snip] 22 / Koofr, Digi Storage and other Koofr-compatible storage providers  (koofr) [snip] Storage> koofr Option provider. Choose your storage provider. Choose a number from below, or type in your own value. Press Enter to leave empty. 1 / Koofr, https://app.koofr.net/  (koofr) 2 / Digi Storage, https://storage.rcs-rds.ro/  (digistorage) 3 / Any other Koofr API compatible storage service  (other) provider> 3 Option endpoint. The Koofr API endpoint to use. Enter a value. endpoint> https://koofr.other.org Option user. Your user name. Enter a value. user> USERNAME Option password. Your password for rclone (generate one at your service's settings page). Choose an alternative below. y) Yes, type in my own password g) Generate random password y/g> y Enter the password: password: Confirm the password: password: Edit advanced config? y) Yes n) No (default) y/n> n -------------------- [other] type = koofr provider = other endpoint = https://koofr.other.org user = USERNAME password = *** ENCRYPTED *** -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      +

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Microsoft Azure Blob Storage  "azureblob" [snip] Storage> azureblob Storage Account Name account> account_name Storage Account Key key> base64encodedkey== Endpoint for the service - leave blank normally. endpoint> Remote config -------------------- [remote] account = account_name key = base64encodedkey== endpoint = -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

      
      -#  Mail.ru Cloud
      +See all containers
       
      -[Mail.ru Cloud](https://cloud.mail.ru/) is a cloud storage provided by a Russian internet company [Mail.Ru Group](https://mail.ru). The official desktop client is [Disk-O:](https://disk-o.cloud/en), available on Windows and Mac OS.
      +    rclone lsd remote:
       
      -## Features highlights
      +Make a new container
       
      -- Paths may be as deep as required, e.g. `remote:directory/subdirectory`
      -- Files have a `last modified time` property, directories don't
      -- Deleted files are by default moved to the trash
      -- Files and directories can be shared via public links
      -- Partial uploads or streaming are not supported, file size must be known before upload
      -- Maximum file size is limited to 2G for a free account, unlimited for paid accounts
      -- Storage keeps hash for all files and performs transparent deduplication,
      -  the hash algorithm is a modified SHA1
      -- If a particular file is already present in storage, one can quickly submit file hash
      -  instead of long file upload (this optimization is supported by rclone)
      +    rclone mkdir remote:container
       
      -## Configuration
      +List the contents of a container
       
      -Here is an example of making a mailru configuration.
      +    rclone ls remote:container
       
      -First create a Mail.ru Cloud account and choose a tariff.
      +Sync `/home/local/directory` to the remote container, deleting any excess
      +files in the container.
       
      -You will need to log in and create an app password for rclone. Rclone
      -**will not work** with your normal username and password - it will
      -give an error like `oauth2: server response missing access_token`.
      +    rclone sync --interactive /home/local/directory remote:container
       
      -- Click on your user icon in the top right
      -- Go to Security / "Пароль и безопасность"
      -- Click password for apps / "Пароли для внешних приложений"
      -- Add the password - give it a name - eg "rclone"
      -- Copy the password and use this password below - your normal login password won't work.
      +### --fast-list
       
      -Now run
      +This remote supports `--fast-list` which allows you to use fewer
      +transactions in exchange for more memory. See the [rclone
      +docs](https://rclone.org/docs/#fast-list) for more details.
       
      -    rclone config
      +### Modification times and hashes
       
      -This will guide you through an interactive setup process:
      -
      -

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / Mail.ru Cloud  "mailru" [snip] Storage> mailru User name (usually email) Enter a string value. Press Enter for the default (""). user> username@mail.ru Password

      -

      This must be an app password - rclone will not work with your normal password. See the Configuration section in the docs for how to make an app password. y) Yes type in my own password g) Generate random password y/g> y Enter the password: password: Confirm the password: password: Skip full upload if there is another file with same data hash. This feature is called "speedup" or "put by hash". It is especially efficient in case of generally available files like popular books, video or audio clips [snip] Enter a boolean value (true or false). Press Enter for the default ("true"). Choose a number from below, or type in your own value 1 / Enable  "true" 2 / Disable  "false" speedup_enable> 1 Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config -------------------- [remote] type = mailru user = username@mail.ru pass = *** ENCRYPTED *** speedup_enable = true -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

      -
      
      -Configuration of this backend does not require a local web browser.
      -You can use the configured backend as shown below:
      +The modification time is stored as metadata on the object with the
      +`mtime` key.  It is stored using RFC3339 Format time with nanosecond
      +precision.  The metadata is supplied during directory listings so
      +there is no performance overhead to using it.
       
      -See top level directories
      +If you wish to use the Azure standard `LastModified` time stored on
      +the object as the modified time, then use the `--use-server-modtime`
      +flag. Note that rclone can't set `LastModified`, so using the
      +`--update` flag when syncing is recommended if using
      +`--use-server-modtime`.
       
      -    rclone lsd remote:
      +MD5 hashes are stored with blobs. However blobs that were uploaded in
      +chunks only have an MD5 if the source remote was capable of MD5
      +hashes, e.g. the local disk.
       
      -Make a new directory
      +### Performance
       
      -    rclone mkdir remote:directory
      +When uploading large files, increasing the value of
      +`--azureblob-upload-concurrency` will increase performance at the cost
      +of using more memory. The default of 16 is set quite conservatively to
      +use less memory. It maybe be necessary raise it to 64 or higher to
      +fully utilize a 1 GBit/s link with a single file transfer.
       
      -List the contents of a directory
      +### Restricted filename characters
       
      -    rclone ls remote:directory
      +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
      +the following characters are also replaced:
       
      -Sync `/home/local/directory` to the remote path, deleting any
      -excess files in the path.
      +| Character | Value | Replacement |
      +| --------- |:-----:|:-----------:|
      +| /         | 0x2F  | /           |
      +| \         | 0x5C  | \           |
       
      -    rclone sync --interactive /home/local/directory remote:directory
      +File names can also not end with the following characters.
      +These only get replaced if they are the last character in the name:
       
      -### Modified time
      +| Character | Value | Replacement |
      +| --------- |:-----:|:-----------:|
      +| .         | 0x2E  | .          |
       
      -Files support a modification time attribute with up to 1 second precision.
      -Directories do not have a modification time, which is shown as "Jan 1 1970".
      +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
      +as they can't be used in JSON strings.
       
      -### Hash checksums
      +### Authentication {#authentication}
       
      -Hash sums use a custom Mail.ru algorithm based on SHA1.
      -If file size is less than or equal to the SHA1 block size (20 bytes),
      -its hash is simply its data right-padded with zero bytes.
      -Hash sum of a larger file is computed as a SHA1 sum of the file data
      -bytes concatenated with a decimal representation of the data length.
      +There are a number of ways of supplying credentials for Azure Blob
      +Storage. Rclone tries them in the order of the sections below.
       
      -### Emptying Trash
      +#### Env Auth
       
      -Removing a file or directory actually moves it to the trash, which is not
      -visible to rclone but can be seen in a web browser. The trashed file
      -still occupies part of total quota. If you wish to empty your trash
      -and free some quota, you can use the `rclone cleanup remote:` command,
      -which will permanently delete all your trashed files.
      -This command does not take any path arguments.
      +If the `env_auth` config parameter is `true` then rclone will pull
      +credentials from the environment or runtime.
       
      -### Quota information
      +It tries these authentication methods in this order:
       
      -To view your current quota you can use the `rclone about remote:`
      -command which will display your usage limit (quota) and the current usage.
      +1. Environment Variables
      +2. Managed Service Identity Credentials
      +3. Azure CLI credentials (as used by the az tool)
       
      -### Restricted filename characters
      +These are described in the following sections
       
      -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters)
      -the following characters are also replaced:
      +##### Env Auth: 1. Environment Variables
       
      -| Character | Value | Replacement |
      -| --------- |:-----:|:-----------:|
      -| "         | 0x22  | "          |
      -| *         | 0x2A  | *          |
      -| :         | 0x3A  | :          |
      -| <         | 0x3C  | <          |
      -| >         | 0x3E  | >          |
      -| ?         | 0x3F  | ?          |
      -| \         | 0x5C  | \          |
      -| \|        | 0x7C  | |          |
      +If `env_auth` is set and environment variables are present rclone
      +authenticates a service principal with a secret or certificate, or a
      +user with a password, depending on which environment variable are set.
      +It reads configuration from these variables, in the following order:
       
      -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
      -as they can't be used in JSON strings.
      +1. Service principal with client secret
      +    - `AZURE_TENANT_ID`: ID of the service principal's tenant. Also called its "directory" ID.
      +    - `AZURE_CLIENT_ID`: the service principal's client ID
      +    - `AZURE_CLIENT_SECRET`: one of the service principal's client secrets
      +2. Service principal with certificate
      +    - `AZURE_TENANT_ID`: ID of the service principal's tenant. Also called its "directory" ID.
      +    - `AZURE_CLIENT_ID`: the service principal's client ID
      +    - `AZURE_CLIENT_CERTIFICATE_PATH`: path to a PEM or PKCS12 certificate file including the private key.
      +    - `AZURE_CLIENT_CERTIFICATE_PASSWORD`: (optional) password for the certificate file.
      +    - `AZURE_CLIENT_SEND_CERTIFICATE_CHAIN`: (optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to "true" or "1", authentication requests include the x5c header.
      +3. User with username and password
      +    - `AZURE_TENANT_ID`: (optional) tenant to authenticate in. Defaults to "organizations".
      +    - `AZURE_CLIENT_ID`: client ID of the application the user will authenticate to
      +    - `AZURE_USERNAME`: a username (usually an email address)
      +    - `AZURE_PASSWORD`: the user's password
      +4. Workload Identity
      +    - `AZURE_TENANT_ID`: Tenant to authenticate in.
      +    - `AZURE_CLIENT_ID`: Client ID of the application the user will authenticate to.
      +    - `AZURE_FEDERATED_TOKEN_FILE`: Path to projected service account token file.
      +    - `AZURE_AUTHORITY_HOST`: Authority of an Azure Active Directory endpoint (default: login.microsoftonline.com).
       
       
      -### Standard options
      +##### Env Auth: 2. Managed Service Identity Credentials
       
      -Here are the Standard options specific to mailru (Mail.ru Cloud).
      +When using Managed Service Identity if the VM(SS) on which this
      +program is running has a system-assigned identity, it will be used by
      +default. If the resource has no system-assigned but exactly one
      +user-assigned identity, the user-assigned identity will be used by
      +default.
       
      -#### --mailru-client-id
      +If the resource has multiple user-assigned identities you will need to
      +unset `env_auth` and set `use_msi` instead. See the [`use_msi`
      +section](#use_msi).
       
      -OAuth Client Id.
      +##### Env Auth: 3. Azure CLI credentials (as used by the az tool)
       
      -Leave blank normally.
      +Credentials created with the `az` tool can be picked up using `env_auth`.
       
      -Properties:
      +For example if you were to login with a service principal like this:
       
      -- Config:      client_id
      -- Env Var:     RCLONE_MAILRU_CLIENT_ID
      -- Type:        string
      -- Required:    false
      +    az login --service-principal -u XXX -p XXX --tenant XXX
       
      -#### --mailru-client-secret
      +Then you could access rclone resources like this:
       
      -OAuth Client Secret.
      +    rclone lsf :azureblob,env_auth,account=ACCOUNT:CONTAINER
       
      -Leave blank normally.
      +Or
       
      -Properties:
      +    rclone lsf --azureblob-env-auth --azureblob-account=ACCOUNT :azureblob:CONTAINER
       
      -- Config:      client_secret
      -- Env Var:     RCLONE_MAILRU_CLIENT_SECRET
      -- Type:        string
      -- Required:    false
      +Which is analogous to using the `az` tool:
       
      -#### --mailru-user
      +    az storage blob list --container-name CONTAINER --account-name ACCOUNT --auth-mode login
       
      -User name (usually email).
      +#### Account and Shared Key
       
      -Properties:
      +This is the most straight forward and least flexible way.  Just fill
      +in the `account` and `key` lines and leave the rest blank.
       
      -- Config:      user
      -- Env Var:     RCLONE_MAILRU_USER
      -- Type:        string
      -- Required:    true
      +#### SAS URL
       
      -#### --mailru-pass
      +This can be an account level SAS URL or container level SAS URL.
       
      -Password.
      +To use it leave `account` and `key` blank and fill in `sas_url`.
       
      -This must be an app password - rclone will not work with your normal
      -password. See the Configuration section in the docs for how to make an
      -app password.
      +An account level SAS URL or container level SAS URL can be obtained
      +from the Azure portal or the Azure Storage Explorer.  To get a
      +container level SAS URL right click on a container in the Azure Blob
      +explorer in the Azure portal.
       
      +If you use a container level SAS URL, rclone operations are permitted
      +only on a particular container, e.g.
       
      -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
      +    rclone ls azureblob:container
       
      -Properties:
      +You can also list the single container from the root. This will only
      +show the container specified by the SAS URL.
       
      -- Config:      pass
      -- Env Var:     RCLONE_MAILRU_PASS
      -- Type:        string
      -- Required:    true
      +    $ rclone lsd azureblob:
      +    container/
       
      -#### --mailru-speedup-enable
      +Note that you can't see or access any other containers - this will
      +fail
       
      -Skip full upload if there is another file with same data hash.
      +    rclone ls azureblob:othercontainer
       
      -This feature is called "speedup" or "put by hash". It is especially efficient
      -in case of generally available files like popular books, video or audio clips,
      -because files are searched by hash in all accounts of all mailru users.
      -It is meaningless and ineffective if source file is unique or encrypted.
      -Please note that rclone may need local memory and disk space to calculate
      -content hash in advance and decide whether full upload is required.
      -Also, if rclone does not know file size in advance (e.g. in case of
      -streaming or partial uploads), it will not even try this optimization.
      +Container level SAS URLs are useful for temporarily allowing third
      +parties access to a single container or putting credentials into an
      +untrusted environment such as a CI build server.
       
      -Properties:
      +#### Service principal with client secret
       
      -- Config:      speedup_enable
      -- Env Var:     RCLONE_MAILRU_SPEEDUP_ENABLE
      -- Type:        bool
      -- Default:     true
      -- Examples:
      -    - "true"
      -        - Enable
      -    - "false"
      -        - Disable
      +If these variables are set, rclone will authenticate with a service principal with a client secret.
       
      -### Advanced options
      +- `tenant`: ID of the service principal's tenant. Also called its "directory" ID.
      +- `client_id`: the service principal's client ID
      +- `client_secret`: one of the service principal's client secrets
       
      -Here are the Advanced options specific to mailru (Mail.ru Cloud).
      +The credentials can also be placed in a file using the
      +`service_principal_file` configuration option.
       
      -#### --mailru-token
      +#### Service principal with certificate
       
      -OAuth Access Token as a JSON blob.
      +If these variables are set, rclone will authenticate with a service principal with certificate.
       
      -Properties:
      +- `tenant`: ID of the service principal's tenant. Also called its "directory" ID.
      +- `client_id`: the service principal's client ID
      +- `client_certificate_path`: path to a PEM or PKCS12 certificate file including the private key.
      +- `client_certificate_password`: (optional) password for the certificate file.
      +- `client_send_certificate_chain`: (optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to "true" or "1", authentication requests include the x5c header.
       
      -- Config:      token
      -- Env Var:     RCLONE_MAILRU_TOKEN
      -- Type:        string
      -- Required:    false
      +**NB** `client_certificate_password` must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
       
      -#### --mailru-auth-url
      +#### User with username and password
       
      -Auth server URL.
      +If these variables are set, rclone will authenticate with username and password.
       
      -Leave blank to use the provider defaults.
      +- `tenant`: (optional) tenant to authenticate in. Defaults to "organizations".
      +- `client_id`: client ID of the application the user will authenticate to
      +- `username`: a username (usually an email address)
      +- `password`: the user's password
       
      -Properties:
      +Microsoft doesn't recommend this kind of authentication, because it's
      +less secure than other authentication flows. This method is not
      +interactive, so it isn't compatible with any form of multi-factor
      +authentication, and the application must already have user or admin
      +consent. This credential can only authenticate work and school
      +accounts; it can't authenticate Microsoft accounts.
       
      -- Config:      auth_url
      -- Env Var:     RCLONE_MAILRU_AUTH_URL
      -- Type:        string
      -- Required:    false
      +**NB** `password` must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
       
      -#### --mailru-token-url
      +#### Managed Service Identity Credentials {#use_msi}
       
      -Token server url.
      +If `use_msi` is set then managed service identity credentials are
      +used. This authentication only works when running in an Azure service.
      +`env_auth` needs to be unset to use this.
       
      -Leave blank to use the provider defaults.
      +However if you have multiple user identities to choose from these must
      +be explicitly specified using exactly one of the `msi_object_id`,
      +`msi_client_id`, or `msi_mi_res_id` parameters.
       
      -Properties:
      +If none of `msi_object_id`, `msi_client_id`, or `msi_mi_res_id` is
      +set, this is is equivalent to using `env_auth`.
       
      -- Config:      token_url
      -- Env Var:     RCLONE_MAILRU_TOKEN_URL
      -- Type:        string
      -- Required:    false
       
      -#### --mailru-speedup-file-patterns
      +### Standard options
       
      -Comma separated list of file name patterns eligible for speedup (put by hash).
      +Here are the Standard options specific to azureblob (Microsoft Azure Blob Storage).
       
      -Patterns are case insensitive and can contain '*' or '?' meta characters.
      +#### --azureblob-account
       
      -Properties:
      +Azure Storage Account Name.
       
      -- Config:      speedup_file_patterns
      -- Env Var:     RCLONE_MAILRU_SPEEDUP_FILE_PATTERNS
      -- Type:        string
      -- Default:     "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf"
      -- Examples:
      -    - ""
      -        - Empty list completely disables speedup (put by hash).
      -    - "*"
      -        - All files will be attempted for speedup.
      -    - "*.mkv,*.avi,*.mp4,*.mp3"
      -        - Only common audio/video files will be tried for put by hash.
      -    - "*.zip,*.gz,*.rar,*.pdf"
      -        - Only common archives or PDF books will be tried for speedup.
      +Set this to the Azure Storage Account Name in use.
       
      -#### --mailru-speedup-max-disk
      +Leave blank to use SAS URL or Emulator, otherwise it needs to be set.
       
      -This option allows you to disable speedup (put by hash) for large files.
      +If this is blank and if env_auth is set it will be read from the
      +environment variable `AZURE_STORAGE_ACCOUNT_NAME` if possible.
       
      -Reason is that preliminary hashing can exhaust your RAM or disk space.
       
       Properties:
       
      -- Config:      speedup_max_disk
      -- Env Var:     RCLONE_MAILRU_SPEEDUP_MAX_DISK
      -- Type:        SizeSuffix
      -- Default:     3Gi
      -- Examples:
      -    - "0"
      -        - Completely disable speedup (put by hash).
      -    - "1G"
      -        - Files larger than 1Gb will be uploaded directly.
      -    - "3G"
      -        - Choose this option if you have less than 3Gb free on local disk.
      -
      -#### --mailru-speedup-max-memory
      -
      -Files larger than the size given below will always be hashed on disk.
      -
      -Properties:
      +- Config:      account
      +- Env Var:     RCLONE_AZUREBLOB_ACCOUNT
      +- Type:        string
      +- Required:    false
       
      -- Config:      speedup_max_memory
      -- Env Var:     RCLONE_MAILRU_SPEEDUP_MAX_MEMORY
      -- Type:        SizeSuffix
      -- Default:     32Mi
      -- Examples:
      -    - "0"
      -        - Preliminary hashing will always be done in a temporary disk location.
      -    - "32M"
      -        - Do not dedicate more than 32Mb RAM for preliminary hashing.
      -    - "256M"
      -        - You have at most 256Mb RAM free for hash calculations.
      +#### --azureblob-env-auth
       
      -#### --mailru-check-hash
      +Read credentials from runtime (environment variables, CLI or MSI).
       
      -What should copy do if file checksum is mismatched or invalid.
      +See the [authentication docs](/azureblob#authentication) for full info.
       
       Properties:
       
      -- Config:      check_hash
      -- Env Var:     RCLONE_MAILRU_CHECK_HASH
      +- Config:      env_auth
      +- Env Var:     RCLONE_AZUREBLOB_ENV_AUTH
       - Type:        bool
      -- Default:     true
      -- Examples:
      -    - "true"
      -        - Fail with error.
      -    - "false"
      -        - Ignore and continue.
      +- Default:     false
       
      -#### --mailru-user-agent
      +#### --azureblob-key
       
      -HTTP user agent used internally by client.
      +Storage Account Shared Key.
       
      -Defaults to "rclone/VERSION" or "--user-agent" provided on command line.
      +Leave blank to use SAS URL or Emulator.
       
       Properties:
       
      -- Config:      user_agent
      -- Env Var:     RCLONE_MAILRU_USER_AGENT
      +- Config:      key
      +- Env Var:     RCLONE_AZUREBLOB_KEY
       - Type:        string
       - Required:    false
       
      -#### --mailru-quirks
      +#### --azureblob-sas-url
       
      -Comma separated list of internal maintenance flags.
      +SAS URL for container level access only.
       
      -This option must not be used by an ordinary user. It is intended only to
      -facilitate remote troubleshooting of backend issues. Strict meaning of
      -flags is not documented and not guaranteed to persist between releases.
      -Quirks will be removed when the backend grows stable.
      -Supported quirks: atomicmkdir binlist unknowndirs
      +Leave blank if using account/key or Emulator.
       
       Properties:
       
      -- Config:      quirks
      -- Env Var:     RCLONE_MAILRU_QUIRKS
      +- Config:      sas_url
      +- Env Var:     RCLONE_AZUREBLOB_SAS_URL
       - Type:        string
       - Required:    false
       
      -#### --mailru-encoding
      -
      -The encoding for the backend.
      -
      -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
      -
      -Properties:
      -
      -- Config:      encoding
      -- Env Var:     RCLONE_MAILRU_ENCODING
      -- Type:        MultiEncoder
      -- Default:     Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot
      +#### --azureblob-tenant
       
      +ID of the service principal's tenant. Also called its directory ID.
       
      +Set this if using
      +- Service principal with client secret
      +- Service principal with certificate
      +- User with username and password
       
      -## Limitations
       
      -File size limits depend on your account. A single file size is limited by 2G
      -for a free account and unlimited for paid tariffs. Please refer to the Mail.ru
      -site for the total uploaded size limits.
      +Properties:
       
      -Note that Mailru is case insensitive so you can't have a file called
      -"Hello.doc" and one called "hello.doc".
      +- Config:      tenant
      +- Env Var:     RCLONE_AZUREBLOB_TENANT
      +- Type:        string
      +- Required:    false
       
      -#  Mega
      +#### --azureblob-client-id
       
      -[Mega](https://mega.nz/) is a cloud storage and file hosting service
      -known for its security feature where all files are encrypted locally
      -before they are uploaded. This prevents anyone (including employees of
      -Mega) from accessing the files without knowledge of the key used for
      -encryption.
      +The ID of the client in use.
       
      -This is an rclone backend for Mega which supports the file transfer
      -features of Mega using the same client side encryption.
      +Set this if using
      +- Service principal with client secret
      +- Service principal with certificate
      +- User with username and password
       
      -Paths are specified as `remote:path`
       
      -Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
      +Properties:
       
      -## Configuration
      +- Config:      client_id
      +- Env Var:     RCLONE_AZUREBLOB_CLIENT_ID
      +- Type:        string
      +- Required:    false
       
      -Here is an example of how to make a remote called `remote`.  First run:
      +#### --azureblob-client-secret
       
      -     rclone config
      +One of the service principal's client secrets
       
      -This will guide you through an interactive setup process:
      -
      -

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Mega  "mega" [snip] Storage> mega User name user> you@example.com Password. y) Yes type in my own password g) Generate random password n) No leave this optional password blank y/g/n> y Enter the password: password: Confirm the password: password: Remote config -------------------- [remote] type = mega user = you@example.com pass = *** ENCRYPTED *** -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

      -
      
      -**NOTE:** The encryption keys need to have been already generated after a regular login
      -via the browser, otherwise attempting to use the credentials in `rclone` will fail.
      +Set this if using
      +- Service principal with client secret
       
      -Once configured you can then use `rclone` like this,
       
      -List directories in top level of your Mega
      +Properties:
       
      -    rclone lsd remote:
      +- Config:      client_secret
      +- Env Var:     RCLONE_AZUREBLOB_CLIENT_SECRET
      +- Type:        string
      +- Required:    false
       
      -List all the files in your Mega
      +#### --azureblob-client-certificate-path
       
      -    rclone ls remote:
      +Path to a PEM or PKCS12 certificate file including the private key.
       
      -To copy a local directory to an Mega directory called backup
      +Set this if using
      +- Service principal with certificate
       
      -    rclone copy /home/source remote:backup
       
      -### Modified time and hashes
      +Properties:
       
      -Mega does not support modification times or hashes yet.
      +- Config:      client_certificate_path
      +- Env Var:     RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PATH
      +- Type:        string
      +- Required:    false
       
      -### Restricted filename characters
      +#### --azureblob-client-certificate-password
       
      -| Character | Value | Replacement |
      -| --------- |:-----:|:-----------:|
      -| NUL       | 0x00  | ␀           |
      -| /         | 0x2F  | /          |
      +Password for the certificate file (optional).
       
      -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8),
      -as they can't be used in JSON strings.
      +Optionally set this if using
      +- Service principal with certificate
       
      -### Duplicated files
      +And the certificate has a password.
       
      -Mega can have two files with exactly the same name and path (unlike a
      -normal file system).
       
      -Duplicated files cause problems with the syncing and you will see
      -messages in the log about duplicates.
      +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
       
      -Use `rclone dedupe` to fix duplicated files.
      +Properties:
       
      -### Failure to log-in
      +- Config:      client_certificate_password
      +- Env Var:     RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PASSWORD
      +- Type:        string
      +- Required:    false
       
      -#### Object not found
      +### Advanced options
       
      -If you are connecting to your Mega remote for the first time, 
      -to test access and synchronization, you may receive an error such as 
      -
      -

      Failed to create file system for "my-mega-remote:": couldn't login: Object (typically, node or user) not found

      -
      
      -The diagnostic steps often recommended in the [rclone forum](https://forum.rclone.org/search?q=mega)
      -start with the **MEGAcmd** utility. Note that this refers to 
      -the official C++ command from https://github.com/meganz/MEGAcmd 
      -and not the go language built command from t3rm1n4l/megacmd 
      -that is no longer maintained. 
      +Here are the Advanced options specific to azureblob (Microsoft Azure Blob Storage).
       
      -Follow the instructions for installing MEGAcmd and try accessing 
      -your remote as they recommend. You can establish whether or not 
      -you can log in using MEGAcmd, and obtain diagnostic information 
      -to help you, and search or work with others in the forum. 
      -
      -

      MEGA CMD> login me@example.com Password: Fetching nodes ... Loading transfers from local cache Login complete as me@example.com me@example.com:/$

      -
      
      -Note that some have found issues with passwords containing special 
      -characters. If you can not log on with rclone, but MEGAcmd logs on 
      -just fine, then consider changing your password temporarily to 
      -pure alphanumeric characters, in case that helps.
      +#### --azureblob-client-send-certificate-chain
       
      +Send the certificate chain when using certificate auth.
       
      -#### Repeated commands blocks access
      +Specifies whether an authentication request will include an x5c header
      +to support subject name / issuer based authentication. When set to
      +true, authentication requests include the x5c header.
       
      -Mega remotes seem to get blocked (reject logins) under "heavy use".
      -We haven't worked out the exact blocking rules but it seems to be
      -related to fast paced, successive rclone commands.
      +Optionally set this if using
      +- Service principal with certificate
       
      -For example, executing this command 90 times in a row `rclone link
      -remote:file` will cause the remote to become "blocked". This is not an
      -abnormal situation, for example if you wish to get the public links of
      -a directory with hundred of files...  After more or less a week, the
      -remote will remote accept rclone logins normally again.
       
      -You can mitigate this issue by mounting the remote it with `rclone
      -mount`. This will log-in when mounting and a log-out when unmounting
      -only. You can also run `rclone rcd` and then use `rclone rc` to run
      -the commands over the API to avoid logging in each time.
      +Properties:
       
      -Rclone does not currently close mega sessions (you can see them in the
      -web interface), however closing the sessions does not solve the issue.
      +- Config:      client_send_certificate_chain
      +- Env Var:     RCLONE_AZUREBLOB_CLIENT_SEND_CERTIFICATE_CHAIN
      +- Type:        bool
      +- Default:     false
       
      -If you space rclone commands by 3 seconds it will avoid blocking the
      -remote. We haven't identified the exact blocking rules, so perhaps one
      -could execute the command 80 times without waiting and avoid blocking
      -by waiting 3 seconds, then continuing...
      +#### --azureblob-username
       
      -Note that this has been observed by trial and error and might not be
      -set in stone.
      +User name (usually an email address)
       
      -Other tools seem not to produce this blocking effect, as they use a
      -different working approach (state-based, using sessionIDs instead of
      -log-in) which isn't compatible with the current stateless rclone
      -approach.
      +Set this if using
      +- User with username and password
       
      -Note that once blocked, the use of other tools (such as megacmd) is
      -not a sure workaround: following megacmd login times have been
      -observed in succession for blocked remote: 7 minutes, 20 min, 30min, 30
      -min, 30min. Web access looks unaffected though.
       
      -Investigation is continuing in relation to workarounds based on
      -timeouts, pacers, retrials and tpslimits - if you discover something
      -relevant, please post on the forum.
      +Properties:
       
      -So, if rclone was working nicely and suddenly you are unable to log-in
      -and you are sure the user and the password are correct, likely you
      -have got the remote blocked for a while.
      +- Config:      username
      +- Env Var:     RCLONE_AZUREBLOB_USERNAME
      +- Type:        string
      +- Required:    false
       
      +#### --azureblob-password
       
      -### Standard options
      +The user's password
       
      -Here are the Standard options specific to mega (Mega).
      +Set this if using
      +- User with username and password
       
      -#### --mega-user
       
      -User name.
      +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
       
       Properties:
       
      -- Config:      user
      -- Env Var:     RCLONE_MEGA_USER
      +- Config:      password
      +- Env Var:     RCLONE_AZUREBLOB_PASSWORD
       - Type:        string
      -- Required:    true
      -
      -#### --mega-pass
      -
      -Password.
      -
      -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
      +- Required:    false
       
      -Properties:
      +#### --azureblob-service-principal-file
       
      -- Config:      pass
      -- Env Var:     RCLONE_MEGA_PASS
      -- Type:        string
      -- Required:    true
      +Path to file containing credentials for use with a service principal.
       
      -### Advanced options
      +Leave blank normally. Needed only if you want to use a service principal instead of interactive login.
       
      -Here are the Advanced options specific to mega (Mega).
      +    $ az ad sp create-for-rbac --name "<name>" \
      +      --role "Storage Blob Data Owner" \
      +      --scopes "/subscriptions/<subscription>/resourceGroups/<resource-group>/providers/Microsoft.Storage/storageAccounts/<storage-account>/blobServices/default/containers/<container>" \
      +      > azure-principal.json
       
      -#### --mega-debug
      +See ["Create an Azure service principal"](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) and ["Assign an Azure role for access to blob data"](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli) pages for more details.
       
      -Output more debug from Mega.
      +It may be more convenient to put the credentials directly into the
      +rclone config file under the `client_id`, `tenant` and `client_secret`
      +keys instead of setting `service_principal_file`.
       
      -If this flag is set (along with -vv) it will print further debugging
      -information from the mega backend.
       
       Properties:
       
      -- Config:      debug
      -- Env Var:     RCLONE_MEGA_DEBUG
      -- Type:        bool
      -- Default:     false
      +- Config:      service_principal_file
      +- Env Var:     RCLONE_AZUREBLOB_SERVICE_PRINCIPAL_FILE
      +- Type:        string
      +- Required:    false
       
      -#### --mega-hard-delete
      +#### --azureblob-use-msi
       
      -Delete files permanently rather than putting them into the trash.
      +Use a managed service identity to authenticate (only works in Azure).
       
      -Normally the mega backend will put all deletions into the trash rather
      -than permanently deleting them.  If you specify this then rclone will
      -permanently delete objects instead.
      +When true, use a [managed service identity](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/)
      +to authenticate to Azure Storage instead of a SAS token or account key.
      +
      +If the VM(SS) on which this program is running has a system-assigned identity, it will
      +be used by default. If the resource has no system-assigned but exactly one user-assigned identity,
      +the user-assigned identity will be used by default. If the resource has multiple user-assigned
      +identities, the identity to use must be explicitly specified using exactly one of the msi_object_id,
      +msi_client_id, or msi_mi_res_id parameters.
       
       Properties:
       
      -- Config:      hard_delete
      -- Env Var:     RCLONE_MEGA_HARD_DELETE
      +- Config:      use_msi
      +- Env Var:     RCLONE_AZUREBLOB_USE_MSI
       - Type:        bool
       - Default:     false
       
      -#### --mega-use-https
      +#### --azureblob-msi-object-id
       
      -Use HTTPS for transfers.
      +Object ID of the user-assigned MSI to use, if any.
       
      -MEGA uses plain text HTTP connections by default.
      -Some ISPs throttle HTTP connections, this causes transfers to become very slow.
      -Enabling this will force MEGA to use HTTPS for all transfers.
      -HTTPS is normally not necessary since all data is already encrypted anyway.
      -Enabling it will increase CPU usage and add network overhead.
      +Leave blank if msi_client_id or msi_mi_res_id specified.
       
       Properties:
       
      -- Config:      use_https
      -- Env Var:     RCLONE_MEGA_USE_HTTPS
      -- Type:        bool
      -- Default:     false
      +- Config:      msi_object_id
      +- Env Var:     RCLONE_AZUREBLOB_MSI_OBJECT_ID
      +- Type:        string
      +- Required:    false
       
      -#### --mega-encoding
      +#### --azureblob-msi-client-id
       
      -The encoding for the backend.
      +Object ID of the user-assigned MSI to use, if any.
       
      -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
      +Leave blank if msi_object_id or msi_mi_res_id specified.
       
       Properties:
       
      -- Config:      encoding
      -- Env Var:     RCLONE_MEGA_ENCODING
      -- Type:        MultiEncoder
      -- Default:     Slash,InvalidUtf8,Dot
      +- Config:      msi_client_id
      +- Env Var:     RCLONE_AZUREBLOB_MSI_CLIENT_ID
      +- Type:        string
      +- Required:    false
       
      +#### --azureblob-msi-mi-res-id
       
      +Azure resource ID of the user-assigned MSI to use, if any.
       
      -### Process `killed`
      +Leave blank if msi_client_id or msi_object_id specified.
       
      -On accounts with large files or something else, memory usage can significantly increase when executing list/sync instructions. When running on cloud providers (like AWS with EC2), check if the instance type has sufficient memory/CPU to execute the commands. Use the resource monitoring tools to inspect after sending the commands. Look [at this issue](https://forum.rclone.org/t/rclone-with-mega-appears-to-work-only-in-some-accounts/40233/4).
      +Properties:
       
      -## Limitations
      +- Config:      msi_mi_res_id
      +- Env Var:     RCLONE_AZUREBLOB_MSI_MI_RES_ID
      +- Type:        string
      +- Required:    false
       
      -This backend uses the [go-mega go library](https://github.com/t3rm1n4l/go-mega) which is an opensource
      -go library implementing the Mega API. There doesn't appear to be any
      -documentation for the mega protocol beyond the [mega C++ SDK](https://github.com/meganz/sdk) source code
      -so there are likely quite a few errors still remaining in this library.
      +#### --azureblob-use-emulator
       
      -Mega allows duplicate files which may confuse rclone.
      +Uses local storage emulator if provided as 'true'.
       
      -#  Memory
      +Leave blank if using real azure storage endpoint.
       
      -The memory backend is an in RAM backend. It does not persist its
      -data - use the local backend for that.
      +Properties:
       
      -The memory backend behaves like a bucket-based remote (e.g. like
      -s3). Because it has no parameters you can just use it with the
      -`:memory:` remote name.
      +- Config:      use_emulator
      +- Env Var:     RCLONE_AZUREBLOB_USE_EMULATOR
      +- Type:        bool
      +- Default:     false
       
      -## Configuration
      +#### --azureblob-endpoint
       
      -You can configure it as a remote like this with `rclone config` too if
      -you want to:
      -
      -

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] XX / Memory  "memory" [snip] Storage> memory ** See help for memory backend at: https://rclone.org/memory/ **

      -

      Remote config

      - - - - - - - - - -
      [remote]
      type = memory
      -
        -
      1. Yes this is OK (default)
      2. -
      3. Edit this remote
      4. -
      5. Delete this remote y/e/d> y
      6. -
      -
      
      -Because the memory backend isn't persistent it is most useful for
      -testing or with an rclone server or rclone mount, e.g.
      +Endpoint for the service.
       
      -    rclone mount :memory: /mnt/tmp
      -    rclone serve webdav :memory:
      -    rclone serve sftp :memory:
      +Leave blank normally.
       
      -### Modified time and hashes
      +Properties:
       
      -The memory backend supports MD5 hashes and modification times accurate to 1 nS.
      +- Config:      endpoint
      +- Env Var:     RCLONE_AZUREBLOB_ENDPOINT
      +- Type:        string
      +- Required:    false
       
      -### Restricted filename characters
      +#### --azureblob-upload-cutoff
       
      -The memory backend replaces the [default restricted characters
      -set](https://rclone.org/overview/#restricted-characters).
      +Cutoff for switching to chunked upload (<= 256 MiB) (deprecated).
       
      +Properties:
       
      +- Config:      upload_cutoff
      +- Env Var:     RCLONE_AZUREBLOB_UPLOAD_CUTOFF
      +- Type:        string
      +- Required:    false
       
      +#### --azureblob-chunk-size
       
      -#  Akamai NetStorage
      +Upload chunk size.
       
      -Paths are specified as `remote:`
      -You may put subdirectories in too, e.g. `remote:/path/to/dir`.
      -If you have a CP code you can use that as the folder after the domain such as \<domain>\/\<cpcode>\/\<internal directories within cpcode>.
      +Note that this is stored in memory and there may be up to
      +"--transfers" * "--azureblob-upload-concurrency" chunks stored at once
      +in memory.
       
      -For example, this is commonly configured with or without a CP code:
      -* **With a CP code**. `[your-domain-prefix]-nsu.akamaihd.net/123456/subdirectory/`
      -* **Without a CP code**. `[your-domain-prefix]-nsu.akamaihd.net`
      +Properties:
       
      +- Config:      chunk_size
      +- Env Var:     RCLONE_AZUREBLOB_CHUNK_SIZE
      +- Type:        SizeSuffix
      +- Default:     4Mi
       
      -See all buckets
      -   rclone lsd remote:
      -The initial setup for Netstorage involves getting an account and secret. Use `rclone config` to walk you through the setup process.
      +#### --azureblob-upload-concurrency
       
      -## Configuration
      +Concurrency for multipart uploads.
       
      -Here's an example of how to make a remote called `ns1`.
      +This is the number of chunks of the same file that are uploaded
      +concurrently.
       
      -1. To begin the interactive configuration process, enter this command:
      -
      -

      rclone config

      -
      
      -2. Type `n` to create a new remote.
      -
      -
        -
      1. New remote
      2. -
      3. Delete remote
      4. -
      5. Quit config e/n/d/q> n
      6. -
      -
      
      -3. For this example, enter `ns1` when you reach the name> prompt.
      -
      -

      name> ns1

      -
      
      -4. Enter `netstorage` as the type of storage to configure.
      -
      -

      Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value XX / NetStorage  "netstorage" Storage> netstorage

      -
      
      -5. Select between the HTTP or HTTPS protocol. Most users should choose HTTPS, which is the default. HTTP is provided primarily for debugging purposes.
      +If you are uploading small numbers of large files over high-speed
      +links and these uploads do not fully utilize your bandwidth, then
      +increasing this may help to speed up the transfers.
       
      -
      -

      Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / HTTP protocol  "http" 2 / HTTPS protocol  "https" protocol> 1

      -
      
      -6. Specify your NetStorage host, CP code, and any necessary content paths using this format: `<domain>/<cpcode>/<content>/`
      -
      -

      Enter a string value. Press Enter for the default (""). host> baseball-nsu.akamaihd.net/123456/content/

      -
      
      -7. Set the netstorage account name
      -

      Enter a string value. Press Enter for the default (""). account> username

      -
      
      -8. Set the Netstorage account secret/G2O key which will be used for authentication purposes. Select the `y` option to set your own password then enter your secret.
      -Note: The secret is stored in the `rclone.conf` file with hex-encoded encryption.
      -
      -
        -
      1. Yes type in my own password
      2. -
      3. Generate random password y/g> y Enter the password: password: Confirm the password: password:
      4. -
      -
      
      -9. View the summary and confirm your remote configuration.
      -
      -

      [ns1] type = netstorage protocol = http host = baseball-nsu.akamaihd.net/123456/content/ account = username secret = *** ENCRYPTED *** -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      -
      
      -This remote is called `ns1` and can now be used.
      +In tests, upload speed increases almost linearly with upload
      +concurrency. For example to fill a gigabit pipe it may be necessary to
      +raise this to 64. Note that this will use more memory.
       
      -## Example operations
      +Note that chunks are stored in memory and there may be up to
      +"--transfers" * "--azureblob-upload-concurrency" chunks stored at once
      +in memory.
       
      -Get started with rclone and NetStorage with these examples. For additional rclone commands, visit https://rclone.org/commands/.
      +Properties:
       
      -### See contents of a directory in your project
      +- Config:      upload_concurrency
      +- Env Var:     RCLONE_AZUREBLOB_UPLOAD_CONCURRENCY
      +- Type:        int
      +- Default:     16
       
      -    rclone lsd ns1:/974012/testing/
      +#### --azureblob-list-chunk
       
      -### Sync the contents local with remote
      +Size of blob list.
       
      -    rclone sync . ns1:/974012/testing/
      +This sets the number of blobs requested in each listing chunk. Default
      +is the maximum, 5000. "List blobs" requests are permitted 2 minutes
      +per megabyte to complete. If an operation is taking longer than 2
      +minutes per megabyte on average, it will time out (
      +[source](https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-blob-service-operations#exceptions-to-default-timeout-interval)
      +). This can be used to limit the number of blobs items to return, to
      +avoid the time out.
       
      -### Upload local content to remote
      -    rclone copy notes.txt ns1:/974012/testing/
      +Properties:
       
      -### Delete content on remote
      -    rclone delete ns1:/974012/testing/notes.txt
      +- Config:      list_chunk
      +- Env Var:     RCLONE_AZUREBLOB_LIST_CHUNK
      +- Type:        int
      +- Default:     5000
       
      -### Move or copy content between CP codes.
      +#### --azureblob-access-tier
       
      -Your credentials must have access to two CP codes on the same remote. You can't perform operations between different remotes.
      +Access tier of blob: hot, cool, cold or archive.
       
      -    rclone move ns1:/974012/testing/notes.txt ns1:/974450/testing2/
      +Archived blobs can be restored by setting access tier to hot, cool or
      +cold. Leave blank if you intend to use default access tier, which is
      +set at account level
       
      -## Features
      +If there is no "access tier" specified, rclone doesn't apply any tier.
      +rclone performs "Set Tier" operation on blobs while uploading, if objects
      +are not modified, specifying "access tier" to new one will have no effect.
      +If blobs are in "archive tier" at remote, trying to perform data transfer
      +operations from remote will not be allowed. User should first restore by
      +tiering blob to "Hot", "Cool" or "Cold".
       
      -### Symlink Support
      +Properties:
       
      -The Netstorage backend changes the rclone `--links, -l` behavior. When uploading, instead of creating the .rclonelink file, use the "symlink" API in order to create the corresponding symlink on the remote. The .rclonelink file will not be created, the upload will be intercepted and only the symlink file that matches the source file name with no suffix will be created on the remote.
      +- Config:      access_tier
      +- Env Var:     RCLONE_AZUREBLOB_ACCESS_TIER
      +- Type:        string
      +- Required:    false
       
      -This will effectively allow commands like copy/copyto, move/moveto and sync to upload from local to remote and download from remote to local directories with symlinks. Due to internal rclone limitations, it is not possible to upload an individual symlink file to any remote backend. You can always use the "backend symlink" command to create a symlink on the NetStorage server, refer to "symlink" section below.
      +#### --azureblob-archive-tier-delete
       
      -Individual symlink files on the remote can be used with the commands like "cat" to print the destination name, or "delete" to delete symlink, or copy, copy/to and move/moveto to download from the remote to local. Note: individual symlink files on the remote should be specified including the suffix .rclonelink.
      +Delete archive tier blobs before overwriting.
       
      -**Note**: No file with the suffix .rclonelink should ever exist on the server since it is not possible to actually upload/create a file with .rclonelink suffix with rclone, it can only exist if it is manually created through a non-rclone method on the remote.
      +Archive tier blobs cannot be updated. So without this flag, if you
      +attempt to update an archive tier blob, then rclone will produce the
      +error:
       
      -### Implicit vs. Explicit Directories
      +    can't update archive tier blob without --azureblob-archive-tier-delete
       
      -With NetStorage, directories can exist in one of two forms:
      +With this flag set then before rclone attempts to overwrite an archive
      +tier blob, it will delete the existing blob before uploading its
      +replacement.  This has the potential for data loss if the upload fails
      +(unlike updating a normal blob) and also may cost more since deleting
      +archive tier blobs early may be chargable.
       
      -1. **Explicit Directory**. This is an actual, physical directory that you have created in a storage group.
      -2. **Implicit Directory**. This refers to a directory within a path that has not been physically created. For example, during upload of a file, nonexistent subdirectories can be specified in the target path. NetStorage creates these as "implicit." While the directories aren't physically created, they exist implicitly and the noted path is connected with the uploaded file.
       
      -Rclone will intercept all file uploads and mkdir commands for the NetStorage remote and will explicitly issue the mkdir command for each directory in the uploading path. This will help with the interoperability with the other Akamai services such as SFTP and the Content Management Shell (CMShell). Rclone will not guarantee correctness of operations with implicit directories which might have been created as a result of using an upload API directly.
      +Properties:
       
      -### `--fast-list` / ListR support
      +- Config:      archive_tier_delete
      +- Env Var:     RCLONE_AZUREBLOB_ARCHIVE_TIER_DELETE
      +- Type:        bool
      +- Default:     false
       
      -NetStorage remote supports the ListR feature by using the "list" NetStorage API action to return a lexicographical list of all objects within the specified CP code, recursing into subdirectories as they're encountered.
      +#### --azureblob-disable-checksum
       
      -* **Rclone will use the ListR method for some commands by default**. Commands such as `lsf -R` will use ListR by default. To disable this, include the `--disable listR` option to use the non-recursive method of listing objects.
      +Don't store MD5 checksum with object metadata.
       
      -* **Rclone will not use the ListR method for some commands**. Commands such as `sync` don't use ListR by default. To force using the ListR method, include the  `--fast-list` option.
      +Normally rclone will calculate the MD5 checksum of the input before
      +uploading it so it can add it to metadata on the object. This is great
      +for data integrity checking but can cause long delays for large files
      +to start uploading.
       
      -There are pros and cons of using the ListR method, refer to [rclone documentation](https://rclone.org/docs/#fast-list). In general, the sync command over an existing deep tree on the remote will run faster with the "--fast-list" flag but with extra memory usage as a side effect. It might also result in higher CPU utilization but the whole task can be completed faster.
      +Properties:
       
      -**Note**: There is a known limitation that "lsf -R" will display number of files in the directory and directory size as -1 when ListR method is used. The workaround is to pass "--disable listR" flag if these numbers are important in the output.
      +- Config:      disable_checksum
      +- Env Var:     RCLONE_AZUREBLOB_DISABLE_CHECKSUM
      +- Type:        bool
      +- Default:     false
       
      -### Purge
      +#### --azureblob-memory-pool-flush-time
       
      -NetStorage remote supports the purge feature by using the "quick-delete" NetStorage API action. The quick-delete action is disabled by default for security reasons and can be enabled for the account through the Akamai portal. Rclone will first try to use quick-delete action for the purge command and if this functionality is disabled then will fall back to a standard delete method.
      +How often internal memory buffer pools will be flushed. (no longer used)
       
      -**Note**: Read the [NetStorage Usage API](https://learn.akamai.com/en-us/webhelp/netstorage/netstorage-http-api-developer-guide/GUID-15836617-9F50-405A-833C-EA2556756A30.html) for considerations when using "quick-delete". In general, using quick-delete method will not delete the tree immediately and objects targeted for quick-delete may still be accessible.
      +Properties:
       
      +- Config:      memory_pool_flush_time
      +- Env Var:     RCLONE_AZUREBLOB_MEMORY_POOL_FLUSH_TIME
      +- Type:        Duration
      +- Default:     1m0s
       
      -### Standard options
      +#### --azureblob-memory-pool-use-mmap
       
      -Here are the Standard options specific to netstorage (Akamai NetStorage).
      +Whether to use mmap buffers in internal memory pool. (no longer used)
       
      -#### --netstorage-host
      +Properties:
       
      -Domain+path of NetStorage host to connect to.
      +- Config:      memory_pool_use_mmap
      +- Env Var:     RCLONE_AZUREBLOB_MEMORY_POOL_USE_MMAP
      +- Type:        bool
      +- Default:     false
       
      -Format should be `<domain>/<internal folders>`
      +#### --azureblob-encoding
      +
      +The encoding for the backend.
      +
      +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info.
       
       Properties:
       
      -- Config:      host
      -- Env Var:     RCLONE_NETSTORAGE_HOST
      -- Type:        string
      -- Required:    true
      +- Config:      encoding
      +- Env Var:     RCLONE_AZUREBLOB_ENCODING
      +- Type:        Encoding
      +- Default:     Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8
       
      -#### --netstorage-account
      +#### --azureblob-public-access
       
      -Set the NetStorage account name
      +Public access level of a container: blob or container.
       
       Properties:
       
      -- Config:      account
      -- Env Var:     RCLONE_NETSTORAGE_ACCOUNT
      +- Config:      public_access
      +- Env Var:     RCLONE_AZUREBLOB_PUBLIC_ACCESS
       - Type:        string
      -- Required:    true
      +- Required:    false
      +- Examples:
      +    - ""
      +        - The container and its blobs can be accessed only with an authorized request.
      +        - It's a default value.
      +    - "blob"
      +        - Blob data within this container can be read via anonymous request.
      +    - "container"
      +        - Allow full public read access for container and blob data.
       
      -#### --netstorage-secret
      +#### --azureblob-directory-markers
       
      -Set the NetStorage account secret/G2O key for authentication.
      +Upload an empty object with a trailing slash when a new directory is created
       
      -Please choose the 'y' option to set your own password then enter your secret.
      +Empty folders are unsupported for bucket based remotes, this option
      +creates an empty object ending with "/", to persist the folder.
       
      -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/).
      +This object also has the metadata "hdi_isfolder = true" to conform to
      +the Microsoft standard.
      + 
       
       Properties:
       
      -- Config:      secret
      -- Env Var:     RCLONE_NETSTORAGE_SECRET
      -- Type:        string
      -- Required:    true
      -
      -### Advanced options
      +- Config:      directory_markers
      +- Env Var:     RCLONE_AZUREBLOB_DIRECTORY_MARKERS
      +- Type:        bool
      +- Default:     false
       
      -Here are the Advanced options specific to netstorage (Akamai NetStorage).
      +#### --azureblob-no-check-container
       
      -#### --netstorage-protocol
      +If set, don't attempt to check the container exists or create it.
       
      -Select between HTTP or HTTPS protocol.
      +This can be useful when trying to minimise the number of transactions
      +rclone does if you know the container exists already.
       
      -Most users should choose HTTPS, which is the default.
      -HTTP is provided primarily for debugging purposes.
       
       Properties:
       
      -- Config:      protocol
      -- Env Var:     RCLONE_NETSTORAGE_PROTOCOL
      -- Type:        string
      -- Default:     "https"
      -- Examples:
      -    - "http"
      -        - HTTP protocol
      -    - "https"
      -        - HTTPS protocol
      +- Config:      no_check_container
      +- Env Var:     RCLONE_AZUREBLOB_NO_CHECK_CONTAINER
      +- Type:        bool
      +- Default:     false
       
      -## Backend commands
      +#### --azureblob-no-head-object
       
      -Here are the commands specific to the netstorage backend.
      +If set, do not do HEAD before GET when getting objects.
       
      -Run them with
      +Properties:
       
      -    rclone backend COMMAND remote:
      +- Config:      no_head_object
      +- Env Var:     RCLONE_AZUREBLOB_NO_HEAD_OBJECT
      +- Type:        bool
      +- Default:     false
       
      -The help below will explain what arguments each command takes.
       
      -See the [backend](https://rclone.org/commands/rclone_backend/) command for more
      -info on how to pass options and arguments.
       
      -These can be run on a running backend using the rc command
      -[backend/command](https://rclone.org/rc/#backend-command).
      +### Custom upload headers
       
      -### du
      +You can set custom upload headers with the `--header-upload` flag. 
       
      -Return disk usage information for a specified directory
      +- Cache-Control
      +- Content-Disposition
      +- Content-Encoding
      +- Content-Language
      +- Content-Type
       
      -    rclone backend du remote: [options] [<arguments>+]
      +Eg `--header-upload "Content-Type: text/potato"`
       
      -The usage information returned, includes the targeted directory as well as all
      -files stored in any sub-directories that may exist.
      +## Limitations
       
      -### symlink
      +MD5 sums are only uploaded with chunked files if the source has an MD5
      +sum.  This will always be the case for a local to azure copy.
       
      -You can create a symbolic link in ObjectStore with the symlink action.
      +`rclone about` is not supported by the Microsoft Azure Blob storage backend. Backends without
      +this capability cannot determine free space for an rclone mount or
      +use policy `mfs` (most free space) as a member of an rclone union
      +remote.
       
      -    rclone backend symlink remote: [options] [<arguments>+]
      +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/)
       
      -The desired path location (including applicable sub-directories) ending in
      -the object that will be the target of the symlink (for example, /links/mylink).
      -Include the file extension for the object, if applicable.
      -`rclone backend symlink <src> <path>`
      +## Azure Storage Emulator Support
       
      +You can run rclone with the storage emulator (usually _azurite_).
       
      +To do this, just set up a new remote with `rclone config` following
      +the instructions in the introduction and set `use_emulator` in the
      +advanced settings as `true`. You do not need to provide a default
      +account name nor an account key. But you can override them in the
      +`account` and `key` options. (Prior to v1.61 they were hard coded to
      +_azurite_'s `devstoreaccount1`.)
       
      -#  Microsoft Azure Blob Storage
      +Also, if you want to access a storage emulator instance running on a
      +different machine, you can override the `endpoint` parameter in the
      +advanced settings, setting it to
      +`http(s)://<host>:<port>/devstoreaccount1`
      +(e.g. `http://10.254.2.5:10000/devstoreaccount1`).
       
      -Paths are specified as `remote:container` (or `remote:` for the `lsd`
      -command.)  You may put subdirectories in too, e.g.
      -`remote:container/path/to/dir`.
      +#  Microsoft Azure Files Storage
      +
      +Paths are specified as `remote:` You may put subdirectories in too,
      +e.g. `remote:path/to/dir`.
       
       ## Configuration
       
      -Here is an example of making a Microsoft Azure Blob Storage
      +Here is an example of making a Microsoft Azure Files Storage
       configuration.  For a remote called `remote`.  First run:
       
            rclone config
       
       This will guide you through an interactive setup process:
       
      -

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Microsoft Azure Blob Storage  "azureblob" [snip] Storage> azureblob Storage Account Name account> account_name Storage Account Key key> base64encodedkey== Endpoint for the service - leave blank normally. endpoint> Remote config -------------------- [remote] account = account_name key = base64encodedkey== endpoint = -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y

      +

      No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Microsoft Azure Files Storage  "azurefiles" [snip]

      +

      Option account. Azure Storage Account Name. Set this to the Azure Storage Account Name in use. Leave blank to use SAS URL or connection string, otherwise it needs to be set. If this is blank and if env_auth is set it will be read from the environment variable AZURE_STORAGE_ACCOUNT_NAME if possible. Enter a value. Press Enter to leave empty. account> account_name

      +

      Option share_name. Azure Files Share Name. This is required and is the name of the share to access. Enter a value. Press Enter to leave empty. share_name> share_name

      +

      Option env_auth. Read credentials from runtime (environment variables, CLI or MSI). See the authentication docs for full info. Enter a boolean value (true or false). Press Enter for the default (false). env_auth>

      +

      Option key. Storage Account Shared Key. Leave blank to use SAS URL or connection string. Enter a value. Press Enter to leave empty. key> base64encodedkey==

      +

      Option sas_url. SAS URL. Leave blank if using account/key or connection string. Enter a value. Press Enter to leave empty. sas_url>

      +

      Option connection_string. Azure Files Connection String. Enter a value. Press Enter to leave empty. connection_string> [snip]

      +

      Configuration complete. Options: - type: azurefiles - account: account_name - share_name: share_name - key: base64encodedkey== Keep this "remote" remote? y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d>

      
      -See all containers
      -
      -    rclone lsd remote:
      +Once configured you can use rclone.
       
      -Make a new container
      +See all files in the top level:
       
      -    rclone mkdir remote:container
      +    rclone lsf remote:
       
      -List the contents of a container
      +Make a new directory in the root:
       
      -    rclone ls remote:container
      +    rclone mkdir remote:dir
       
      -Sync `/home/local/directory` to the remote container, deleting any excess
      -files in the container.
      +Recursively List the contents:
       
      -    rclone sync --interactive /home/local/directory remote:container
      +    rclone ls remote:
       
      -### --fast-list
      +Sync `/home/local/directory` to the remote directory, deleting any
      +excess files in the directory.
       
      -This remote supports `--fast-list` which allows you to use fewer
      -transactions in exchange for more memory. See the [rclone
      -docs](https://rclone.org/docs/#fast-list) for more details.
      +    rclone sync --interactive /home/local/directory remote:dir
       
       ### Modified time
       
      -The modified time is stored as metadata on the object with the `mtime`
      -key.  It is stored using RFC3339 Format time with nanosecond
      -precision.  The metadata is supplied during directory listings so
      -there is no performance overhead to using it.
      -
      -If you wish to use the Azure standard `LastModified` time stored on
      -the object as the modified time, then use the `--use-server-modtime`
      -flag. Note that rclone can't set `LastModified`, so using the
      -`--update` flag when syncing is recommended if using
      -`--use-server-modtime`.
      +The modified time is stored as Azure standard `LastModified` time on
      +files
       
       ### Performance
       
       When uploading large files, increasing the value of
      -`--azureblob-upload-concurrency` will increase performance at the cost
      +`--azurefiles-upload-concurrency` will increase performance at the cost
       of using more memory. The default of 16 is set quite conservatively to
       use less memory. It maybe be necessary raise it to 64 or higher to
       fully utilize a 1 GBit/s link with a single file transfer.
      @@ -28049,8 +28219,14 @@ 

      Synology C2 Object Storage

      | Character | Value | Replacement | | --------- |:-----:|:-----------:| -| / | 0x2F | / | -| \ | 0x5C | \ | +| " | 0x22 | " | +| * | 0x2A | * | +| : | 0x3A | : | +| < | 0x3C | < | +| > | 0x3E | > | +| ? | 0x3F | ? | +| \ | 0x5C | \ | +| \| | 0x7C | | | File names can also not end with the following characters. These only get replaced if they are the last character in the name: @@ -28064,13 +28240,12 @@

      Synology C2 Object Storage

      ### Hashes -MD5 hashes are stored with blobs. However blobs that were uploaded in -chunks only have an MD5 if the source remote was capable of MD5 -hashes, e.g. the local disk. +MD5 hashes are stored with files. Not all files will have MD5 hashes +as these have to be uploaded with the file. ### Authentication {#authentication} -There are a number of ways of supplying credentials for Azure Blob +There are a number of ways of supplying credentials for Azure Files Storage. Rclone tries them in the order of the sections below. #### Env Auth @@ -28137,15 +28312,11 @@

      Synology C2 Object Storage

      Then you could access rclone resources like this: - rclone lsf :azureblob,env_auth,account=ACCOUNT:CONTAINER + rclone lsf :azurefiles,env_auth,account=ACCOUNT: Or - rclone lsf --azureblob-env-auth --azureblob-account=ACCOUNT :azureblob:CONTAINER - -Which is analogous to using the `az` tool: - - az storage blob list --container-name CONTAINER --account-name ACCOUNT --auth-mode login + rclone lsf --azurefiles-env-auth --azurefiles-account=ACCOUNT :azurefiles: #### Account and Shared Key @@ -28154,34 +28325,11 @@

      Synology C2 Object Storage

      #### SAS URL -This can be an account level SAS URL or container level SAS URL. - -To use it leave `account` and `key` blank and fill in `sas_url`. - -An account level SAS URL or container level SAS URL can be obtained -from the Azure portal or the Azure Storage Explorer. To get a -container level SAS URL right click on a container in the Azure Blob -explorer in the Azure portal. - -If you use a container level SAS URL, rclone operations are permitted -only on a particular container, e.g. - - rclone ls azureblob:container - -You can also list the single container from the root. This will only -show the container specified by the SAS URL. - - $ rclone lsd azureblob: - container/ - -Note that you can't see or access any other containers - this will -fail +To use it leave `account`, `key` and `connection_string` blank and fill in `sas_url`. - rclone ls azureblob:othercontainer +#### Connection String -Container level SAS URLs are useful for temporarily allowing third -parties access to a single container or putting credentials into an -untrusted environment such as a CI build server. +To use it leave `account`, `key` and "sas_url" blank and fill in `connection_string`. #### Service principal with client secret @@ -28240,15 +28388,15 @@

      Synology C2 Object Storage

      ### Standard options -Here are the Standard options specific to azureblob (Microsoft Azure Blob Storage). +Here are the Standard options specific to azurefiles (Microsoft Azure Files). -#### --azureblob-account +#### --azurefiles-account Azure Storage Account Name. Set this to the Azure Storage Account Name in use. -Leave blank to use SAS URL or Emulator, otherwise it needs to be set. +Leave blank to use SAS URL or connection string, otherwise it needs to be set. If this is blank and if env_auth is set it will be read from the environment variable `AZURE_STORAGE_ACCOUNT_NAME` if possible. @@ -28257,50 +28405,75 @@

      Synology C2 Object Storage

      Properties: - Config: account -- Env Var: RCLONE_AZUREBLOB_ACCOUNT +- Env Var: RCLONE_AZUREFILES_ACCOUNT - Type: string - Required: false -#### --azureblob-env-auth +#### --azurefiles-share-name + +Azure Files Share Name. + +This is required and is the name of the share to access. + + +Properties: + +- Config: share_name +- Env Var: RCLONE_AZUREFILES_SHARE_NAME +- Type: string +- Required: false + +#### --azurefiles-env-auth Read credentials from runtime (environment variables, CLI or MSI). -See the [authentication docs](/azureblob#authentication) for full info. +See the [authentication docs](/azurefiles#authentication) for full info. Properties: - Config: env_auth -- Env Var: RCLONE_AZUREBLOB_ENV_AUTH +- Env Var: RCLONE_AZUREFILES_ENV_AUTH - Type: bool - Default: false -#### --azureblob-key +#### --azurefiles-key Storage Account Shared Key. -Leave blank to use SAS URL or Emulator. +Leave blank to use SAS URL or connection string. Properties: - Config: key -- Env Var: RCLONE_AZUREBLOB_KEY +- Env Var: RCLONE_AZUREFILES_KEY - Type: string - Required: false -#### --azureblob-sas-url +#### --azurefiles-sas-url -SAS URL for container level access only. +SAS URL. -Leave blank if using account/key or Emulator. +Leave blank if using account/key or connection string. Properties: - Config: sas_url -- Env Var: RCLONE_AZUREBLOB_SAS_URL +- Env Var: RCLONE_AZUREFILES_SAS_URL - Type: string - Required: false -#### --azureblob-tenant +#### --azurefiles-connection-string + +Azure Files Connection String. + +Properties: + +- Config: connection_string +- Env Var: RCLONE_AZUREFILES_CONNECTION_STRING +- Type: string +- Required: false + +#### --azurefiles-tenant ID of the service principal's tenant. Also called its directory ID. @@ -28313,11 +28486,11 @@

      Synology C2 Object Storage

      Properties: - Config: tenant -- Env Var: RCLONE_AZUREBLOB_TENANT +- Env Var: RCLONE_AZUREFILES_TENANT - Type: string - Required: false -#### --azureblob-client-id +#### --azurefiles-client-id The ID of the client in use. @@ -28330,11 +28503,11 @@

      Synology C2 Object Storage

      Properties: - Config: client_id -- Env Var: RCLONE_AZUREBLOB_CLIENT_ID +- Env Var: RCLONE_AZUREFILES_CLIENT_ID - Type: string - Required: false -#### --azureblob-client-secret +#### --azurefiles-client-secret One of the service principal's client secrets @@ -28345,11 +28518,11 @@

      Synology C2 Object Storage

      Properties: - Config: client_secret -- Env Var: RCLONE_AZUREBLOB_CLIENT_SECRET +- Env Var: RCLONE_AZUREFILES_CLIENT_SECRET - Type: string - Required: false -#### --azureblob-client-certificate-path +#### --azurefiles-client-certificate-path Path to a PEM or PKCS12 certificate file including the private key. @@ -28360,11 +28533,11 @@

      Synology C2 Object Storage

      Properties: - Config: client_certificate_path -- Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PATH +- Env Var: RCLONE_AZUREFILES_CLIENT_CERTIFICATE_PATH - Type: string - Required: false -#### --azureblob-client-certificate-password +#### --azurefiles-client-certificate-password Password for the certificate file (optional). @@ -28379,15 +28552,15 @@

      Synology C2 Object Storage

      Properties: - Config: client_certificate_password -- Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PASSWORD +- Env Var: RCLONE_AZUREFILES_CLIENT_CERTIFICATE_PASSWORD - Type: string - Required: false ### Advanced options -Here are the Advanced options specific to azureblob (Microsoft Azure Blob Storage). +Here are the Advanced options specific to azurefiles (Microsoft Azure Files). -#### --azureblob-client-send-certificate-chain +#### --azurefiles-client-send-certificate-chain Send the certificate chain when using certificate auth. @@ -28402,11 +28575,11 @@

      Synology C2 Object Storage

      Properties: - Config: client_send_certificate_chain -- Env Var: RCLONE_AZUREBLOB_CLIENT_SEND_CERTIFICATE_CHAIN +- Env Var: RCLONE_AZUREFILES_CLIENT_SEND_CERTIFICATE_CHAIN - Type: bool - Default: false -#### --azureblob-username +#### --azurefiles-username User name (usually an email address) @@ -28417,11 +28590,11 @@

      Synology C2 Object Storage

      Properties: - Config: username -- Env Var: RCLONE_AZUREBLOB_USERNAME +- Env Var: RCLONE_AZUREFILES_USERNAME - Type: string - Required: false -#### --azureblob-password +#### --azurefiles-password The user's password @@ -28434,22 +28607,24 @@

      Synology C2 Object Storage

      Properties: - Config: password -- Env Var: RCLONE_AZUREBLOB_PASSWORD +- Env Var: RCLONE_AZUREFILES_PASSWORD - Type: string - Required: false -#### --azureblob-service-principal-file +#### --azurefiles-service-principal-file Path to file containing credentials for use with a service principal. Leave blank normally. Needed only if you want to use a service principal instead of interactive login. $ az ad sp create-for-rbac --name "<name>" \ - --role "Storage Blob Data Owner" \ + --role "Storage Files Data Owner" \ --scopes "/subscriptions/<subscription>/resourceGroups/<resource-group>/providers/Microsoft.Storage/storageAccounts/<storage-account>/blobServices/default/containers/<container>" \ > azure-principal.json -See ["Create an Azure service principal"](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) and ["Assign an Azure role for access to blob data"](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli) pages for more details. +See ["Create an Azure service principal"](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) and ["Assign an Azure role for access to files data"](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli) pages for more details. + +**NB** this section needs updating for Azure Files - pull requests appreciated! It may be more convenient to put the credentials directly into the rclone config file under the `client_id`, `tenant` and `client_secret` @@ -28459,11 +28634,11 @@

      Synology C2 Object Storage

      Properties: - Config: service_principal_file -- Env Var: RCLONE_AZUREBLOB_SERVICE_PRINCIPAL_FILE +- Env Var: RCLONE_AZUREFILES_SERVICE_PRINCIPAL_FILE - Type: string - Required: false -#### --azureblob-use-msi +#### --azurefiles-use-msi Use a managed service identity to authenticate (only works in Azure). @@ -28479,11 +28654,11 @@

      Synology C2 Object Storage

      Properties: - Config: use_msi -- Env Var: RCLONE_AZUREBLOB_USE_MSI +- Env Var: RCLONE_AZUREFILES_USE_MSI - Type: bool - Default: false -#### --azureblob-msi-object-id +#### --azurefiles-msi-object-id Object ID of the user-assigned MSI to use, if any. @@ -28492,11 +28667,11 @@

      Synology C2 Object Storage

      Properties: - Config: msi_object_id -- Env Var: RCLONE_AZUREBLOB_MSI_OBJECT_ID +- Env Var: RCLONE_AZUREFILES_MSI_OBJECT_ID - Type: string - Required: false -#### --azureblob-msi-client-id +#### --azurefiles-msi-client-id Object ID of the user-assigned MSI to use, if any. @@ -28505,11 +28680,11 @@

      Synology C2 Object Storage

      Properties: - Config: msi_client_id -- Env Var: RCLONE_AZUREBLOB_MSI_CLIENT_ID +- Env Var: RCLONE_AZUREFILES_MSI_CLIENT_ID - Type: string - Required: false -#### --azureblob-msi-mi-res-id +#### --azurefiles-msi-mi-res-id Azure resource ID of the user-assigned MSI to use, if any. @@ -28518,24 +28693,11 @@

      Synology C2 Object Storage

      Properties: - Config: msi_mi_res_id -- Env Var: RCLONE_AZUREBLOB_MSI_MI_RES_ID +- Env Var: RCLONE_AZUREFILES_MSI_MI_RES_ID - Type: string - Required: false -#### --azureblob-use-emulator - -Uses local storage emulator if provided as 'true'. - -Leave blank if using real azure storage endpoint. - -Properties: - -- Config: use_emulator -- Env Var: RCLONE_AZUREBLOB_USE_EMULATOR -- Type: bool -- Default: false - -#### --azureblob-endpoint +#### --azurefiles-endpoint Endpoint for the service. @@ -28544,37 +28706,26 @@

      Synology C2 Object Storage

      Properties: - Config: endpoint -- Env Var: RCLONE_AZUREBLOB_ENDPOINT -- Type: string -- Required: false - -#### --azureblob-upload-cutoff - -Cutoff for switching to chunked upload (<= 256 MiB) (deprecated). - -Properties: - -- Config: upload_cutoff -- Env Var: RCLONE_AZUREBLOB_UPLOAD_CUTOFF +- Env Var: RCLONE_AZUREFILES_ENDPOINT - Type: string - Required: false -#### --azureblob-chunk-size +#### --azurefiles-chunk-size Upload chunk size. Note that this is stored in memory and there may be up to -"--transfers" * "--azureblob-upload-concurrency" chunks stored at once +"--transfers" * "--azurefile-upload-concurrency" chunks stored at once in memory. Properties: - Config: chunk_size -- Env Var: RCLONE_AZUREBLOB_CHUNK_SIZE +- Env Var: RCLONE_AZUREFILES_CHUNK_SIZE - Type: SizeSuffix - Default: 4Mi -#### --azureblob-upload-concurrency +#### --azurefiles-upload-concurrency Concurrency for multipart uploads. @@ -28585,125 +28736,41 @@

      Synology C2 Object Storage

      links and these uploads do not fully utilize your bandwidth, then increasing this may help to speed up the transfers. -In tests, upload speed increases almost linearly with upload -concurrency. For example to fill a gigabit pipe it may be necessary to -raise this to 64. Note that this will use more memory. - Note that chunks are stored in memory and there may be up to -"--transfers" * "--azureblob-upload-concurrency" chunks stored at once +"--transfers" * "--azurefile-upload-concurrency" chunks stored at once in memory. Properties: - Config: upload_concurrency -- Env Var: RCLONE_AZUREBLOB_UPLOAD_CONCURRENCY +- Env Var: RCLONE_AZUREFILES_UPLOAD_CONCURRENCY - Type: int - Default: 16 -#### --azureblob-list-chunk +#### --azurefiles-max-stream-size -Size of blob list. +Max size for streamed files. -This sets the number of blobs requested in each listing chunk. Default -is the maximum, 5000. "List blobs" requests are permitted 2 minutes -per megabyte to complete. If an operation is taking longer than 2 -minutes per megabyte on average, it will time out ( -[source](https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-blob-service-operations#exceptions-to-default-timeout-interval) -). This can be used to limit the number of blobs items to return, to -avoid the time out. +Azure files needs to know in advance how big the file will be. When +rclone doesn't know it uses this value instead. -Properties: - -- Config: list_chunk -- Env Var: RCLONE_AZUREBLOB_LIST_CHUNK -- Type: int -- Default: 5000 +This will be used when rclone is streaming data, the most common uses are: -#### --azureblob-access-tier +- Uploading files with `--vfs-cache-mode off` with `rclone mount` +- Using `rclone rcat` +- Copying files with unknown length -Access tier of blob: hot, cool or archive. +You will need this much free space in the share as the file will be this size temporarily. -Archived blobs can be restored by setting access tier to hot or -cool. Leave blank if you intend to use default access tier, which is -set at account level - -If there is no "access tier" specified, rclone doesn't apply any tier. -rclone performs "Set Tier" operation on blobs while uploading, if objects -are not modified, specifying "access tier" to new one will have no effect. -If blobs are in "archive tier" at remote, trying to perform data transfer -operations from remote will not be allowed. User should first restore by -tiering blob to "Hot" or "Cool". - -Properties: - -- Config: access_tier -- Env Var: RCLONE_AZUREBLOB_ACCESS_TIER -- Type: string -- Required: false - -#### --azureblob-archive-tier-delete - -Delete archive tier blobs before overwriting. - -Archive tier blobs cannot be updated. So without this flag, if you -attempt to update an archive tier blob, then rclone will produce the -error: - - can't update archive tier blob without --azureblob-archive-tier-delete - -With this flag set then before rclone attempts to overwrite an archive -tier blob, it will delete the existing blob before uploading its -replacement. This has the potential for data loss if the upload fails -(unlike updating a normal blob) and also may cost more since deleting -archive tier blobs early may be chargable. - - -Properties: - -- Config: archive_tier_delete -- Env Var: RCLONE_AZUREBLOB_ARCHIVE_TIER_DELETE -- Type: bool -- Default: false - -#### --azureblob-disable-checksum - -Don't store MD5 checksum with object metadata. - -Normally rclone will calculate the MD5 checksum of the input before -uploading it so it can add it to metadata on the object. This is great -for data integrity checking but can cause long delays for large files -to start uploading. Properties: -- Config: disable_checksum -- Env Var: RCLONE_AZUREBLOB_DISABLE_CHECKSUM -- Type: bool -- Default: false - -#### --azureblob-memory-pool-flush-time - -How often internal memory buffer pools will be flushed. (no longer used) - -Properties: - -- Config: memory_pool_flush_time -- Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_FLUSH_TIME -- Type: Duration -- Default: 1m0s - -#### --azureblob-memory-pool-use-mmap - -Whether to use mmap buffers in internal memory pool. (no longer used) - -Properties: - -- Config: memory_pool_use_mmap -- Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_USE_MMAP -- Type: bool -- Default: false +- Config: max_stream_size +- Env Var: RCLONE_AZUREFILES_MAX_STREAM_SIZE +- Type: SizeSuffix +- Default: 10Gi -#### --azureblob-encoding +#### --azurefiles-encoding The encoding for the backend. @@ -28712,72 +28779,9 @@

      Synology C2 Object Storage

      Properties: - Config: encoding -- Env Var: RCLONE_AZUREBLOB_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8 - -#### --azureblob-public-access - -Public access level of a container: blob or container. - -Properties: - -- Config: public_access -- Env Var: RCLONE_AZUREBLOB_PUBLIC_ACCESS -- Type: string -- Required: false -- Examples: - - "" - - The container and its blobs can be accessed only with an authorized request. - - It's a default value. - - "blob" - - Blob data within this container can be read via anonymous request. - - "container" - - Allow full public read access for container and blob data. - -#### --azureblob-directory-markers - -Upload an empty object with a trailing slash when a new directory is created - -Empty folders are unsupported for bucket based remotes, this option -creates an empty object ending with "/", to persist the folder. - -This object also has the metadata "hdi_isfolder = true" to conform to -the Microsoft standard. - - -Properties: - -- Config: directory_markers -- Env Var: RCLONE_AZUREBLOB_DIRECTORY_MARKERS -- Type: bool -- Default: false - -#### --azureblob-no-check-container - -If set, don't attempt to check the container exists or create it. - -This can be useful when trying to minimise the number of transactions -rclone does if you know the container exists already. - - -Properties: - -- Config: no_check_container -- Env Var: RCLONE_AZUREBLOB_NO_CHECK_CONTAINER -- Type: bool -- Default: false - -#### --azureblob-no-head-object - -If set, do not do HEAD before GET when getting objects. - -Properties: - -- Config: no_head_object -- Env Var: RCLONE_AZUREBLOB_NO_HEAD_OBJECT -- Type: bool -- Default: false +- Env Var: RCLONE_AZUREFILES_ENCODING +- Type: Encoding +- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8,Dot @@ -28798,30 +28802,6 @@

      Synology C2 Object Storage

      MD5 sums are only uploaded with chunked files if the source has an MD5 sum. This will always be the case for a local to azure copy. -`rclone about` is not supported by the Microsoft Azure Blob storage backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. - -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) - -## Azure Storage Emulator Support - -You can run rclone with the storage emulator (usually _azurite_). - -To do this, just set up a new remote with `rclone config` following -the instructions in the introduction and set `use_emulator` in the -advanced settings as `true`. You do not need to provide a default -account name nor an account key. But you can override them in the -`account` and `key` options. (Prior to v1.61 they were hard coded to -_azurite_'s `devstoreaccount1`.) - -Also, if you want to access a storage emulator instance running on a -different machine, you can override the `endpoint` parameter in the -advanced settings, setting it to -`http(s)://<host>:<port>/devstoreaccount1` -(e.g. `http://10.254.2.5:10000/devstoreaccount1`). - # Microsoft OneDrive Paths are specified as `remote:path` @@ -28930,7 +28910,7 @@

      Synology C2 Object Storage

      Note: If you have a special region, you may need a different host in step 4 and 5. Here are [some hints](https://github.com/rclone/rclone/blob/bc23bf11db1c78c6ebbf8ea538fbebf7058b4176/backend/onedrive/onedrive.go#L86). -### Modification time and hashes +### Modification times and hashes OneDrive allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or @@ -28951,6 +28931,32 @@

      Synology C2 Object Storage

      For all types of OneDrive you can use the `--checksum` flag. +### --fast-list + +This remote supports `--fast-list` which allows you to use fewer +transactions in exchange for more memory. See the [rclone +docs](https://rclone.org/docs/#fast-list) for more details. + +This must be enabled with the `--onedrive-delta` flag (or `delta = +true` in the config file) as it can cause performance degradation. + +It does this by using the delta listing facilities of OneDrive which +returns all the files in the remote very efficiently. This is much +more efficient than listing directories recursively and is Microsoft's +recommended way of reading all the file information from a drive. + +This can be useful with `rclone mount` and [rclone rc vfs/refresh +recursive=true](https://rclone.org/rc/#vfs-refresh)) to very quickly fill the mount with +information about all the files. + +The API used for the recursive listing (`ListR`) only supports listing +from the root of the drive. This will become increasingly inefficient +the further away you get from the root as rclone will have to discard +files outside of the directory you are using. + +Some commands (like `rclone lsf -R`) will use `ListR` by default - you +can turn this off with `--disable ListR` if you need to. + ### Restricted filename characters In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) @@ -29362,6 +29368,43 @@

      Synology C2 Object Storage

      - Type: bool - Default: false +#### --onedrive-delta + +If set rclone will use delta listing to implement recursive listings. + +If this flag is set the the onedrive backend will advertise `ListR` +support for recursive listings. + +Setting this flag speeds up these things greatly: + + rclone lsf -R onedrive: + rclone size onedrive: + rclone rc vfs/refresh recursive=true + +**However** the delta listing API **only** works at the root of the +drive. If you use it not at the root then it recurses from the root +and discards all the data that is not under the directory you asked +for. So it will be correct but may not be very efficient. + +This is why this flag is not set as the default. + +As a rule of thumb if nearly all of your data is under rclone's root +directory (the `root/directory` in `onedrive:root/directory`) then +using this flag will be be a big performance win. If your data is +mostly not under the root then using this flag will be a big +performance loss. + +It is recommended if you are mounting your onedrive at the root +(or near the root when using crypt) and using rclone `rc vfs/refresh`. + + +Properties: + +- Config: delta +- Env Var: RCLONE_ONEDRIVE_DELTA +- Type: bool +- Default: false + #### --onedrive-encoding The encoding for the backend. @@ -29372,7 +29415,7 @@

      Synology C2 Object Storage

      - Config: encoding - Env Var: RCLONE_ONEDRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot @@ -29631,12 +29674,14 @@

      Synology C2 Object Storage

      rclone copy /home/source remote:backup -### Modified time and MD5SUMs +### Modification times and hashes OpenDrive allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or not. +The MD5 hash algorithm is supported. + ### Restricted filename characters | Character | Value | Replacement | @@ -29710,7 +29755,7 @@

      Synology C2 Object Storage

      - Config: encoding - Env Var: RCLONE_OPENDRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot #### --opendrive-chunk-size @@ -29818,6 +29863,7 @@

      Synology C2 Object Storage

      No authentication ### User Principal + Sample rclone config file for Authentication Provider User Principal: [oos] @@ -29838,6 +29884,7 @@

      Synology C2 Object Storage

      - If the user is deleted, the config file will no longer work and may cause automation regressions that use the user's credentials. ### Instance Principal + An OCI compute instance can be authorized to use rclone by using it's identity and certificates as an instance principal. With this approach no credentials have to be stored and managed. @@ -29867,6 +29914,7 @@

      Synology C2 Object Storage

      - It is applicable for oci compute instances only. It cannot be used on external instance or resources. ### Resource Principal + Resource principal auth is very similar to instance principal auth but used for resources that are not compute instances such as [serverless functions](https://docs.oracle.com/en-us/iaas/Content/Functions/Concepts/functionsoverview.htm). To use resource principal ensure Rclone process is started with these environment variables set in its process. @@ -29886,6 +29934,7 @@

      Synology C2 Object Storage

      provider = resource_principal_auth ### No authentication + Public buckets do not require any authentication mechanism to read objects. Sample rclone configuration file for No authentication: @@ -29896,10 +29945,9 @@

      Synology C2 Object Storage

      region = us-ashburn-1 provider = no_auth -## Options -### Modified time +### Modification times and hashes -The modified time is stored as metadata on the object as +The modification time is stored as metadata on the object as `opc-meta-mtime` as floating point since the epoch, accurate to 1 ns. If the modification time needs to be updated rclone will attempt to perform a server @@ -29909,6 +29957,8 @@

      Synology C2 Object Storage

      Note that reading this from the object takes an additional `HEAD` request as the metadata isn't returned in object listings. +The MD5 hash algorithm is supported. + ### Multipart uploads rclone supports multipart uploads with OOS which means that it can @@ -30211,7 +30261,7 @@

      Synology C2 Object Storage

      - Config: encoding - Env Var: RCLONE_OOS_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,InvalidUtf8,Dot #### --oos-leave-parts-on-error @@ -30682,7 +30732,7 @@

      Synology C2 Object Storage

      - Config: encoding - Env Var: RCLONE_QINGSTOR_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Ctl,InvalidUtf8 @@ -30784,7 +30834,7 @@

      Synology C2 Object Storage

      y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y ``` -### Modified time and hashes +### Modification times and hashes Quatrix allows modification times to be set on objects accurate to 1 microsecond. These will be used to detect whether objects need syncing or not. @@ -30859,7 +30909,7 @@

      Synology C2 Object Storage

      Properties: -- Config: encoding - Env Var: RCLONE_QUATRIX_ENCODING - Type: MultiEncoder - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot +- Config: encoding - Env Var: RCLONE_QUATRIX_ENCODING - Type: Encoding - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot #### --quatrix-effective-upload-time @@ -31036,7 +31086,7 @@

      Synology C2 Object Storage

      - Config: encoding - Env Var: RCLONE_SIA_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot @@ -31162,7 +31212,7 @@

      Synology C2 Object Storage

      `--use-server-modtime`, you can avoid the extra API call and simply upload files whose local modtime is newer than the time it was last uploaded. -### Modified time +### Modification times and hashes The modified time is stored as metadata on the object as `X-Object-Meta-Mtime` as floating point since the epoch accurate to 1 @@ -31171,6 +31221,8 @@

      Synology C2 Object Storage

      This is a de facto standard (used in the official python-swiftclient amongst others) for storing the modification time for an object. +The MD5 hash algorithm is supported. + ### Restricted filename characters | Character | Value | Replacement | @@ -31517,7 +31569,7 @@

      Synology C2 Object Storage

      - Config: encoding - Env Var: RCLONE_SWIFT_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,InvalidUtf8 @@ -31605,7 +31657,7 @@

      Synology C2 Object Storage

      rclone copy /home/source remote:backup -### Modified time and hashes ### +### Modification times and hashes pCloud allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or @@ -31744,7 +31796,7 @@

      Synology C2 Object Storage

      - Config: encoding - Env Var: RCLONE_PCLOUD_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot #### --pcloud-root-folder-id @@ -31833,6 +31885,13 @@

      Synology C2 Object Storage

      Edit advanced config? y) Yes n) No (default) y/n>

      Configuration complete. Options: - type: pikpak - user: USERNAME - pass: *** ENCRYPTED *** - token: {"access_token":"eyJ...","token_type":"Bearer","refresh_token":"os...","expiry":"2023-01-26T18:54:32.170582647+09:00"} Keep this "remote" remote? y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y

      
      +### Modification times and hashes
      +
      +PikPak keeps modification times on objects, and updates them when uploading objects,
      +but it does not support changing only the modification time
      +
      +The MD5 hash algorithm is supported.
      +
       
       ### Standard options
       
      @@ -31992,7 +32051,7 @@ 

      Synology C2 Object Storage

      - Config: encoding - Env Var: RCLONE_PIKPAK_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot ## Backend commands @@ -32056,15 +32115,16 @@

      Synology C2 Object Storage

      -## Limitations ## +## Limitations -### Hashes ### +### Hashes may be empty PikPak supports MD5 hash, but sometimes given empty especially for user-uploaded files. -### Deleted files ### +### Deleted files still visible with trashed-only -Deleted files will still be visible with `--pikpak-trashed-only` even after the trash emptied. This goes away after few days. +Deleted files will still be visible with `--pikpak-trashed-only` even after the +trash emptied. This goes away after few days. # premiumize.me @@ -32109,7 +32169,7 @@

      Synology C2 Object Storage

      rclone copy /home/source remote:backup -### Modified time and hashes +### Modification times and hashes premiumize.me does not support modification times or hashes, therefore syncing will default to `--size-only` checking. Note that using @@ -32224,7 +32284,7 @@

      Synology C2 Object Storage

      - Config: encoding - Env Var: RCLONE_PREMIUMIZEME_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot @@ -32290,10 +32350,12 @@

      Synology C2 Object Storage

      rclone copy /home/source remote:backup -### Modified time +### Modification times and hashes Proton Drive Bridge does not support updating modification times yet. +The SHA1 hash algorithm is supported. + ### Restricted filename characters Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), also left and @@ -32439,7 +32501,7 @@

      Synology C2 Object Storage

      - Config: encoding - Env Var: RCLONE_PROTONDRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LeftSpace,RightSpace,InvalidUtf8,Dot #### --protondrive-original-file-size @@ -32702,7 +32764,7 @@

      Synology C2 Object Storage

      - Config: encoding - Env Var: RCLONE_PUTIO_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot @@ -32766,10 +32828,12 @@

      Synology C2 Object Storage

      rclone copy /home/source remote:backup -### Modified time +### Modification times and hashes Proton Drive Bridge does not support updating modification times yet. +The SHA1 hash algorithm is supported. + ### Restricted filename characters Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), also left and @@ -32915,7 +32979,7 @@

      Synology C2 Object Storage

      - Config: encoding - Env Var: RCLONE_PROTONDRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LeftSpace,RightSpace,InvalidUtf8,Dot #### --protondrive-original-file-size @@ -33272,7 +33336,7 @@

      Synology C2 Object Storage

      - Config: encoding - Env Var: RCLONE_SEAFILE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8 @@ -33457,7 +33521,7 @@

      Checksum

      The options md5sum_command and sha1_command can be used to customize the command to be executed for calculation of checksums. You can for example set a specific path to where md5sum and sha1sum executables are located, or use them to specify some other tools that print checksums in compatible format. The value can include command-line arguments, or even shell script blocks as with PowerShell. Rclone has subcommands md5sum and sha1sum that use compatible format, which means if you have an rclone executable on the server it can be used. As mentioned above, they will be automatically picked up if found in PATH, but if not you can set something like /path/to/rclone md5sum as the value of option md5sum_command to make sure a specific executable is used.

      Remote checksumming is recommended and enabled by default. First time rclone is using a SFTP remote, if options md5sum_command or sha1_command are not set, it will check if any of the default commands for each of them, as described above, can be used. The result will be saved in the remote configuration, so next time it will use the same. Value none will be set if none of the default commands could be used for a specific algorithm, and this algorithm will not be supported by the remote.

      Disabling the checksumming may be required if you are connecting to SFTP servers which are not under your control, and to which the execution of remote shell commands is prohibited. Set the configuration option disable_hashcheck to true to disable checksumming entirely, or set shell_type to none to disable all functionality based on remote shell command execution.

      -

      Modified time

      +

      Modification times and hashes

      Modified times are stored on the server to 1 second precision.

      Modified times are used in syncing and are fully supported.

      Some SFTP servers disable setting/modifying the file modification time after upload (for example, certain configurations of ProFTPd with mod_sftp). If you are using one of these servers, you can set the option set_modtime = false in your RClone backend configuration to disable this behaviour.

      @@ -33903,7 +33967,21 @@

      --sftp-socks-proxy

    3. Type: string
    4. Required: false
    5. -

      Limitations

      + +

      Set to enable server side copies using hardlinks.

      +

      The SFTP protocol does not define a copy command so normally server side copies are not allowed with the sftp backend.

      +

      However the SFTP protocol does support hardlinking, and if you enable this flag then the sftp backend will support server side copies. These will be implemented by doing a hardlink from the source to the destination.

      +

      Not all sftp servers support this.

      +

      Note that hardlinking two files together will use no additional space as the source and the destination will be the same file.

      +

      This feature may be useful backups made with --copy-dest.

      +

      Properties:

      +
        +
      • Config: copy_is_hardlink
      • +
      • Env Var: RCLONE_SFTP_COPY_IS_HARDLINK
      • +
      • Type: bool
      • +
      • Default: false
      • +
      +

      Limitations

      On some SFTP servers (e.g. Synology) the paths are different for SSH and SFTP so the hashes can't be calculated properly. For them using disable_hashcheck is a good idea.

      The only ssh agent supported under Windows is Putty's pageant.

      The Go SSH library disables the use of the aes128-cbc cipher by default, due to security concerns. This can be re-enabled on a per-connection basis by setting the use_insecure_cipher setting in the configuration file to true. Further details on the insecurity of this cipher can be found in this paper.

      @@ -33920,7 +33998,7 @@

      SMB

      SMB is a communication protocol to share files over network.

      This relies on go-smb2 library for communication with SMB protocol.

      Paths are specified as remote:sharename (or remote: for the lsd command.) You may put subdirectories in too, e.g. remote:item/path/to/dir.

      -

      Notes

      +

      Notes

      The first path segment must be the name of the share, which you entered when you started to share on Windows. On smbd, it's the section title in smb.conf (usually in /etc/samba/) file. You can find shares by querying the root if you're unsure (e.g. rclone lsd remote:).

      You can't access to the shared printers from rclone, obviously.

      You can't use Anonymous access for logging in. You have to use the guest user with an empty password instead. The rclone client tries to avoid 8.3 names when uploading files by encoding trailing spaces and periods. Alternatively, the local backend on Windows can access SMB servers using UNC paths, by \\server\share. This doesn't apply to non-Windows OSes, such as Linux and macOS.

      @@ -34099,7 +34177,7 @@

      --smb-encoding

      • Config: encoding
      • Env Var: RCLONE_SMB_ENCODING
      • -
      • Type: MultiEncoder
      • +
      • Type: Encoding
      • Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot

      Storj

      @@ -34391,7 +34469,7 @@

      Sync two Locations

      rclone sync --interactive --progress remote-us:bucket/path/to/dir/ remote-europe:bucket/path/to/dir/

      Or even between another cloud storage and Storj.

      rclone sync --interactive --progress s3:bucket/path/to/dir/ storj:bucket/path/to/dir/
      -

      Limitations

      +

      Limitations

      rclone about is not supported by the rclone Storj backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.

      See List of backends that do not support rclone about and rclone about

      Known issues

      @@ -34464,7 +34542,7 @@

      Configuration

      Paths are specified as remote:path

      Paths may be as deep as required, e.g. remote:directory/subdirectory.

      NB you can't create files in the top level folder you have to create a folder, which rclone will create as a "Sync Folder" with SugarSync.

      -

      Modified time and hashes

      +

      Modification times and hashes

      SugarSync does not support modification times or hashes, therefore syncing will default to --size-only checking. Note that using --update will work as rclone can read the time files were uploaded.

      Restricted filename characters

      SugarSync replaces the default restricted characters set except for DEL.

      @@ -34582,10 +34660,10 @@

      --sugarsync-encoding

      • Config: encoding
      • Env Var: RCLONE_SUGARSYNC_ENCODING
      • -
      • Type: MultiEncoder
      • +
      • Type: Encoding
      • Default: Slash,Ctl,InvalidUtf8,Dot
      -

      Limitations

      +

      Limitations

      rclone about is not supported by the SugarSync backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote.

      See List of backends that do not support rclone about and rclone about

      Tardigrade

      @@ -34648,7 +34726,7 @@

      Configuration

      rclone ls remote:

      To copy a local directory to an Uptobox directory called backup

      rclone copy /home/source remote:backup
      -

      Modified time and hashes

      +

      Modification times and hashes

      Uptobox supports neither modified times nor checksums. All timestamps will read as that set by --default-time.

      Restricted filename characters

      In addition to the default restricted characters set the following characters are also replaced:

      @@ -34704,16 +34782,16 @@

      --uptobox-encoding

      • Config: encoding
      • Env Var: RCLONE_UPTOBOX_ENCODING
      • -
      • Type: MultiEncoder
      • +
      • Type: Encoding
      • Default: Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot
      -

      Limitations

      +

      Limitations

      Uptobox will delete inactive files that have not been accessed in 60 days.

      rclone about is not supported by this backend an overview of used space can however been seen in the uptobox web interface.

      Union

      The union backend joins several remotes together to make a single unified view of them.

      During the initial setup with rclone config you will specify the upstream remotes as a space separated list. The upstream remotes can either be a local paths or other remotes.

      -

      The attributes :ro, :nc and :nc can be attached to the end of the remote to tag the remote as read only, no create or writeback, e.g. remote:directory/subdirectory:ro or remote:directory/subdirectory:nc.

      +

      The attributes :ro, :nc and :writeback can be attached to the end of the remote to tag the remote as read only, no create or writeback, e.g. remote:directory/subdirectory:ro or remote:directory/subdirectory:nc.

      • :ro means files will only be read from here and never written
      • :nc means new files or directories won't be created here
      • @@ -35056,7 +35134,9 @@

        Configuration

        \ (sharepoint) 5 / Sharepoint with NTLM authentication, usually self-hosted or on-premises \ (sharepoint-ntlm) - 6 / Other site/service or software + 6 / rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol + \ (rclone) + 7 / Other site/service or software \ (other) vendor> 2 User name @@ -35093,7 +35173,7 @@

        Configuration

        rclone ls remote:

        To copy a local directory to an WebDAV directory called backup

        rclone copy /home/source remote:backup
        -

        Modified time and hashes

        +

        Modification times and hashes

        Plain WebDAV does not support modified times. However when used with Fastmail Files, Owncloud or Nextcloud rclone will support modified times.

        Likewise plain WebDAV does not support hashes, however when used with Fastmail Files, Owncloud or Nextcloud rclone will support SHA1 and MD5 hashes. Depending on the exact version of Owncloud or Nextcloud hashes may appear on all objects, or only on objects which had a hash uploaded with them.

        Standard options

        @@ -35138,6 +35218,10 @@

        --webdav-vendor

        • Sharepoint with NTLM authentication, usually self-hosted or on-premises
        +
      • "rclone" +
          +
        • rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol
        • +
      • "other"
        • Other site/service or software
        • @@ -35273,6 +35357,9 @@

          Required Flags for SharePoint

          As SharePoint does some special things with uploaded documents, you won't be able to use the documents size or the documents hash to compare if a file has been changed since the upload / which file is newer.

          For Rclone calls copying files (especially Office files such as .docx, .xlsx, etc.) from/to SharePoint (like copy, sync, etc.), you should append these flags to ensure Rclone uses the "Last Modified" datetime property to compare your documents:

          --ignore-size --ignore-checksum --update
          +

          Rclone

          +

          Use this option if you are hosting remotes over WebDAV provided by rclone. Read rclone serve webdav for more details.

          +

          rclone serve supports modified times using the X-OC-Mtime header.

          dCache

          dCache is a storage system that supports many protocols and authentication/authorisation schemes. For WebDAV clients, it allows users to authenticate with username and password (BASIC), X.509, Kerberos, and various bearer tokens, including Macaroons and OpenID-Connect access tokens.

          Configure as normal using the other type. Don't enter a username or password, instead enter your Macaroon as the bearer_token.

          @@ -35357,10 +35444,9 @@

          Configuration

          Sync /home/local/directory to the remote path, deleting any excess files in the path.

          rclone sync --interactive /home/local/directory remote:directory

          Yandex paths may be as deep as required, e.g. remote:directory/subdirectory.

          -

          Modified time

          +

          Modification times and hashes

          Modified times are supported and are stored accurate to 1 ns in custom metadata called rclone_modified in RFC3339 with nanoseconds format.

          -

          MD5 checksums

          -

          MD5 checksums are natively supported by Yandex Disk.

          +

          The MD5 hash algorithm is natively supported by Yandex Disk.

          Emptying Trash

          If you wish to empty your trash you can use the rclone cleanup remote: command which will permanently delete all your trashed files. This command does not take any path arguments.

          Quota information

          @@ -35437,10 +35523,10 @@

          --yandex-encoding

          • Config: encoding
          • Env Var: RCLONE_YANDEX_ENCODING
          • -
          • Type: MultiEncoder
          • +
          • Type: Encoding
          • Default: Slash,Del,Ctl,InvalidUtf8,Dot
          -

          Limitations

          +

          Limitations

          When uploading very large files (bigger than about 5 GiB) you will need to increase the --timeout parameter. This is because Yandex pauses (perhaps to calculate the MD5SUM for the entire file) before returning confirmation that the file has been uploaded. The default handling of timeouts in rclone is to assume a 5 minute pause is an error and close the connection - you'll see net/http: timeout awaiting response headers errors in the logs if this is happening. Setting the timeout to twice the max size of file in GiB should be enough, so if you want to upload a 30 GiB file set a timeout of 2 * 30 = 60m, that is --timeout 60m.

          Having a Yandex Mail account is mandatory to use the Yandex.Disk subscription. Token generation will work without a mail account, but Rclone won't be able to complete any actions.

          [403 - DiskUnsupportedUserAccountTypeError] User account type is not supported.
          @@ -35519,10 +35605,9 @@

          Configuration

          Sync /home/local/directory to the remote path, deleting any excess files in the path.

          rclone sync --interactive /home/local/directory remote:directory

          Zoho paths may be as deep as required, eg remote:directory/subdirectory.

          -

          Modified time

          +

          Modification times and hashes

          Modified times are currently not supported for Zoho Workdrive

          -

          Checksums

          -

          No checksums are supported.

          +

          No hash algorithms are supported.

          Usage information

          To view your current quota you can use the rclone about remote: command which will display your current usage.

          Restricted filename characters

          @@ -35624,7 +35709,7 @@

          --zoho-encoding

          • Config: encoding
          • Env Var: RCLONE_ZOHO_ENCODING
          • -
          • Type: MultiEncoder
          • +
          • Type: Encoding
          • Default: Del,Ctl,InvalidUtf8

          Setting up your own client_id

          @@ -35641,8 +35726,8 @@

          Local Filesystem

          Will sync /home/source to /tmp/destination.

          Configuration

          For consistencies sake one can also configure a remote of type local in the config file, and access the local filesystem using rclone remote paths, e.g. remote:path/to/wherever, but it is probably easier not to.

          -

          Modified time

          -

          Rclone reads and writes the modified time using an accuracy determined by the OS. Typically this is 1ns on Linux, 10 ns on Windows and 1 Second on OS X.

          +

          Modification times

          +

          Rclone reads and writes the modification times using an accuracy determined by the OS. Typically this is 1ns on Linux, 10 ns on Windows and 1 Second on OS X.

          Filenames

          Filenames should be encoded in UTF-8 on disk. This is the normal case for Windows and OS X.

          There is a bit more uncertainty in the Linux world, but new distributions will have UTF-8 encoded files names. If you are using an old Linux filesystem with non UTF-8 file names (e.g. latin1) then you can use the convmv tool to convert the filesystem to UTF-8. This tool is available in most distributions' package managers.

          @@ -36097,6 +36182,7 @@

          --local-no-check-updated

        • Only checksum the size that stat gave
        • Don't update the stat info for the file
        +

        NB do not use this flag on a Windows Volume Shadow (VSS). For some unknown reason, files in a VSS sometimes show different sizes from the directory listing (where the initial stat value comes from on Windows) and when stat is called on them directly. Other copy tools always use the direct stat value and setting this flag will disable that.

        Properties:

        • Config: no_check_updated
        • @@ -36170,7 +36256,7 @@

          --local-encoding

          • Config: encoding
          • Env Var: RCLONE_LOCAL_ENCODING
          • -
          • Type: MultiEncoder
          • +
          • Type: Encoding
          • Default: Slash,Dot

          Metadata

          @@ -36264,6 +36350,228 @@

          noop

        • "error": return an error based on option value

        Changelog

        +

        v1.65.0 - 2023-11-26

        +

        See commits

        +
          +
        • New backends +
            +
          • Azure Files (karan, moongdal, Nick Craig-Wood)
          • +
          • ImageKit (Abhinav Dhiman)
          • +
          • Linkbox (viktor, Nick Craig-Wood)
          • +
        • +
        • New commands +
            +
          • serve s3: Let rclone act as an S3 compatible server (Mikubill, Artur Neumann, Saw-jan, Nick Craig-Wood)
          • +
          • nfsmount: mount command to provide mount mechanism on macOS without FUSE (Saleh Dindar)
          • +
          • serve nfs: to serve a remote for use by nfsmount (Saleh Dindar)
          • +
        • +
        • New Features +
            +
          • install.sh: Clean up temp files in install script (Jacob Hands)
          • +
          • build +
              +
            • Update all dependencies (Nick Craig-Wood)
            • +
            • Refactor version info and icon resource handling on windows (albertony)
            • +
          • +
          • doc updates (albertony, alfish2000, asdffdsazqqq, Dimitri Papadopoulos, Herby Gillot, Joda Stößer, Manoj Ghosh, Nick Craig-Wood)
          • +
          • Implement --metadata-mapper to transform metatadata with a user supplied program (Nick Craig-Wood)
          • +
          • Add ChunkWriterDoesntSeek feature flag and set it for b2 (Nick Craig-Wood)
          • +
          • lib/http: Export basic go string functions for use in --template (Gabriel Espinoza)
          • +
          • makefile: Use POSIX compatible install arguments (Mina Galić)
          • +
          • operations +
              +
            • Use less memory when doing multithread uploads (Nick Craig-Wood)
            • +
            • Implement --partial-suffix to control extension of temporary file names (Volodymyr)
            • +
          • +
          • rc +
              +
            • Add operations/check to the rc API (Nick Craig-Wood)
            • +
            • Always report an error as JSON (Nick Craig-Wood)
            • +
            • Set Last-Modified header for files served by --rc-serve (Nikita Shoshin)
            • +
          • +
          • size: Dont show duplicate object count when less than 1k (albertony)
          • +
        • +
        • Bug Fixes +
            +
          • fshttp: Fix --contimeout being ignored (你知道未来吗)
          • +
          • march: Fix excessive parallelism when using --no-traverse (Nick Craig-Wood)
          • +
          • ncdu: Fix crash when re-entering changed directory after rescan (Nick Craig-Wood)
          • +
          • operations +
              +
            • Fix overwrite of destination when multi-thread transfer fails (Nick Craig-Wood)
            • +
            • Fix invalid UTF-8 when truncating file names when not using --inplace (Nick Craig-Wood)
            • +
          • +
          • serve dnla: Fix crash on graceful exit (wuxingzhong)
          • +
        • +
        • Mount +
            +
          • Disable mount for freebsd and alias cmount as mount on that platform (Nick Craig-Wood)
          • +
        • +
        • VFS +
            +
          • Add --vfs-refresh flag to read all the directories on start (Beyond Meat)
          • +
          • Implement Name() method in WriteFileHandle and ReadFileHandle (Saleh Dindar)
          • +
          • Add go-billy dependency and make sure vfs.Handle implements billy.File (Saleh Dindar)
          • +
          • Error out early if can't upload 0 length file (Nick Craig-Wood)
          • +
        • +
        • Local +
            +
          • Fix copying from Windows Volume Shadows (Nick Craig-Wood)
          • +
        • +
        • Azure Blob +
            +
          • Add support for cold tier (Ivan Yanitra)
          • +
        • +
        • B2 +
            +
          • Implement "rclone backend lifecycle" to read and set bucket lifecycles (Nick Craig-Wood)
          • +
          • Implement --b2-lifecycle to control lifecycle when creating buckets (Nick Craig-Wood)
          • +
          • Fix listing all buckets when not needed (Nick Craig-Wood)
          • +
          • Fix multi-thread upload with copyto going to wrong name (Nick Craig-Wood)
          • +
          • Fix server side chunked copy when file size was exactly --b2-copy-cutoff (Nick Craig-Wood)
          • +
          • Fix streaming chunked files an exact multiple of chunk size (Nick Craig-Wood)
          • +
        • +
        • Box +
            +
          • Filter more EventIDs when polling (David Sze)
          • +
          • Add more logging for polling (David Sze)
          • +
          • Fix performance problem reading metadata for single files (Nick Craig-Wood)
          • +
        • +
        • Drive +
            +
          • Add read/write metadata support (Nick Craig-Wood)
          • +
          • Add support for SHA-1 and SHA-256 checksums (rinsuki)
          • +
          • Add --drive-show-all-gdocs to allow unexportable gdocs to be server side copied (Nick Craig-Wood)
          • +
          • Add a note that --drive-scope accepts comma-separated list of scopes (Keigo Imai)
          • +
          • Fix error updating created time metadata on existing object (Nick Craig-Wood)
          • +
          • Fix integration tests by enabling metadata support from the context (Nick Craig-Wood)
          • +
        • +
        • Dropbox +
            +
          • Factor batcher into lib/batcher (Nick Craig-Wood)
          • +
          • Fix missing encoding for rclone purge (Nick Craig-Wood)
          • +
        • +
        • Google Cloud Storage +
            +
          • Fix 400 Bad request errors when using multi-thread copy (Nick Craig-Wood)
          • +
        • +
        • Googlephotos +
            +
          • Implement batcher for uploads (Nick Craig-Wood)
          • +
        • +
        • Hdfs +
            +
          • Added support for list of namenodes in hdfs remote config (Tayo-pasedaRJ)
          • +
        • +
        • HTTP +
            +
          • Implement set backend command to update running backend (Nick Craig-Wood)
          • +
          • Enable methods used with WebDAV (Alen Šiljak)
          • +
        • +
        • Jottacloud +
            +
          • Add support for reading and writing metadata (albertony)
          • +
        • +
        • Onedrive +
            +
          • Implement ListR method which gives --fast-list support (Nick Craig-Wood) +
              +
            • This must be enabled with the --onedrive-delta flag
            • +
          • +
        • +
        • Quatrix +
            +
          • Add partial upload support (Oksana Zhykina)
          • +
          • Overwrite files on conflict during server-side move (Oksana Zhykina)
          • +
        • +
        • S3 +
            +
          • Add Linode provider (Nick Craig-Wood)
          • +
          • Add docs on how to add a new provider (Nick Craig-Wood)
          • +
          • Fix no error being returned when creating a bucket we don't own (Nick Craig-Wood)
          • +
          • Emit a debug message if anonymous credentials are in use (Nick Craig-Wood)
          • +
          • Add --s3-disable-multipart-uploads flag (Nick Craig-Wood)
          • +
          • Detect looping when using gcs and versions (Nick Craig-Wood)
          • +
        • +
        • SFTP +
            +
          • Implement --sftp-copy-is-hardlink to server side copy as hardlink (Nick Craig-Wood)
          • +
        • +
        • Smb +
            +
          • Fix incorrect about size by switching to github.com/cloudsoda/go-smb2 fork (Nick Craig-Wood)
          • +
          • Fix modtime of multithread uploads by setting PartialUploads (Nick Craig-Wood)
          • +
        • +
        • WebDAV +
            +
          • Added an rclone vendor to work with rclone serve webdav (Adithya Kumar)
          • +
        • +
        +

        v1.64.2 - 2023-10-19

        +

        See commits

        +
          +
        • Bug Fixes +
            +
          • selfupdate: Fix "invalid hashsum signature" error (Nick Craig-Wood)
          • +
          • build: Fix docker build running out of space (Nick Craig-Wood)
          • +
        • +
        +

        v1.64.1 - 2023-10-17

        +

        See commits

        +
          +
        • Bug Fixes +
            +
          • cmd: Make --progress output logs in the same format as without (Nick Craig-Wood)
          • +
          • docs fixes (Dimitri Papadopoulos Orfanos, Herby Gillot, Manoj Ghosh, Nick Craig-Wood)
          • +
          • lsjson: Make sure we set the global metadata flag too (Nick Craig-Wood)
          • +
          • operations +
              +
            • Ensure concurrency is no greater than the number of chunks (Pat Patterson)
            • +
            • Fix OpenOptions ignored in copy if operation was a multiThreadCopy (Vitor Gomes)
            • +
            • Fix error message on delete to have file name (Nick Craig-Wood)
            • +
          • +
          • serve sftp: Return not supported error for not supported commands (Nick Craig-Wood)
          • +
          • build: Upgrade golang.org/x/net to v0.17.0 to fix HTTP/2 rapid reset (Nick Craig-Wood)
          • +
          • pacer: Fix b2 deadlock by defaulting max connections to unlimited (Nick Craig-Wood)
          • +
        • +
        • Mount +
            +
          • Fix automount not detecting drive is ready (Nick Craig-Wood)
          • +
        • +
        • VFS +
            +
          • Fix update dir modification time (Saleh Dindar)
          • +
        • +
        • Azure Blob +
            +
          • Fix "fatal error: concurrent map writes" (Nick Craig-Wood)
          • +
        • +
        • B2 +
            +
          • Fix multipart upload: corrupted on transfer: sizes differ XXX vs 0 (Nick Craig-Wood)
          • +
          • Fix locking window when getting mutipart upload URL (Nick Craig-Wood)
          • +
          • Fix server side copies greater than 4GB (Nick Craig-Wood)
          • +
          • Fix chunked streaming uploads (Nick Craig-Wood)
          • +
          • Reduce default --b2-upload-concurrency to 4 to reduce memory usage (Nick Craig-Wood)
          • +
        • +
        • Onedrive +
            +
          • Fix the configurator to allow /teams/ID in the config (Nick Craig-Wood)
          • +
        • +
        • Oracleobjectstorage +
            +
          • Fix OpenOptions being ignored in uploadMultipart with chunkWriter (Nick Craig-Wood)
          • +
        • +
        • S3 +
            +
          • Fix slice bounds out of range error when listing (Nick Craig-Wood)
          • +
          • Fix OpenOptions being ignored in uploadMultipart with chunkWriter (Vitor Gomes)
          • +
        • +
        • Storj +
            +
          • Update storj.io/uplink to v1.12.0 (Kaloyan Raev)
          • +
        • +

        v1.64.0 - 2023-09-11

        See commits

          @@ -36414,7 +36722,7 @@

          v1.64.0 - 2023-09-11

        • Hdfs
          • Retry "replication in progress" errors when uploading (Nick Craig-Wood)
          • -
          • Fix uploading to the wrong object on Update with overriden remote name (Nick Craig-Wood)
          • +
          • Fix uploading to the wrong object on Update with overridden remote name (Nick Craig-Wood)
        • HTTP
            @@ -36427,7 +36735,7 @@

            v1.64.0 - 2023-09-11

        • Oracleobjectstorage
            -
          • Use rclone's rate limiter in mutipart transfers (Manoj Ghosh)
          • +
          • Use rclone's rate limiter in multipart transfers (Manoj Ghosh)
          • Implement OpenChunkWriter and multi-thread uploads (Manoj Ghosh)
        • S3 @@ -36690,7 +36998,7 @@

          v1.63.0 - 2023-06-30

      • Putio
          -
        • Fix uploading to the wrong object on Update with overriden remote name (Nick Craig-Wood)
        • +
        • Fix uploading to the wrong object on Update with overridden remote name (Nick Craig-Wood)
        • Fix modification times not being preserved for server side copy and move (Nick Craig-Wood)
        • Fix server side copy failures (400 errors) (Nick Craig-Wood)
      • @@ -36699,7 +37007,7 @@

        v1.63.0 - 2023-06-30

      • Empty directory markers (Jānis Bebrītis, Nick Craig-Wood)
      • Update Scaleway storage classes (Brian Starkey)
      • Fix --s3-versions on individual objects (Nick Craig-Wood)
      • -
      • Fix hang on aborting multpart upload with iDrive e2 (Nick Craig-Wood)
      • +
      • Fix hang on aborting multipart upload with iDrive e2 (Nick Craig-Wood)
      • Fix missing "tier" metadata (Nick Craig-Wood)
      • Fix V3sign: add missing subresource delete (cc)
      • Fix Arvancloud Domain and region changes and alphabetise the provider (Ehsan Tadayon)
      • @@ -36724,7 +37032,7 @@

        v1.63.0 - 2023-06-30

      • Storj
        • Fix "uplink: too many requests" errors when uploading to the same file (Nick Craig-Wood)
        • -
        • Fix uploading to the wrong object on Update with overriden remote name (Nick Craig-Wood)
        • +
        • Fix uploading to the wrong object on Update with overridden remote name (Nick Craig-Wood)
      • Swift
          @@ -42141,7 +42449,7 @@

          v1.38 - 2017-09-30

      • Mount
          -
        • Re-use rcat internals to support uploads from all remotes
        • +
        • Reuse rcat internals to support uploads from all remotes
      • Dropbox
          @@ -43316,7 +43624,7 @@

          v0.00 - 2012-11-18

        • Project started

        Bugs and Limitations

        -

        Limitations

        +

        Limitations

        Directory timestamps aren't preserved

        Rclone doesn't currently preserve the timestamps of directories. This is because rclone only really considers objects when syncing.

        Rclone struggles with millions of files in a directory/bucket

        @@ -43325,7 +43633,7 @@

        Rclone str

        Bucket-based remotes and folders

        Bucket-based remotes (e.g. S3/GCS/Swift/B2) do not have a concept of directories. Rclone therefore cannot create directories in them which means that empty directories on a bucket-based remote will tend to disappear.

        Some software creates empty keys ending in / as directory markers. Rclone doesn't do this as it potentially creates more objects and costs more. This ability may be added in the future (probably via a flag/option).

        -

        Bugs

        +

        Bugs

        Bugs are stored in rclone's GitHub project:

        Contact the rclone project

        Forum

        diff --git a/MANUAL.md b/MANUAL.md index 9b4c2e21df34b..13bee7b753b3e 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -1,6 +1,6 @@ % rclone(1) User Manual % Nick Craig-Wood -% Sep 11, 2023 +% Nov 26, 2023 # Rclone syncs your files to cloud storage @@ -135,11 +135,14 @@ WebDAV or S3, that work out of the box.) - Koofr - Leviia Object Storage - Liara Object Storage +- Linkbox +- Linode Object Storage - Mail.ru Cloud - Memset Memstore - Mega - Memory - Microsoft Azure Blob Storage +- Microsoft Azure Files Storage - Microsoft OneDrive - Minio - Nextcloud @@ -279,6 +282,19 @@ developers so it may be out of date. Its current version is as below. [![Homebrew package](https://repology.org/badge/version-for-repo/homebrew/rclone.svg)](https://repology.org/project/rclone/versions) +### Installation with MacPorts (#macos-macports) + +On macOS, rclone can also be installed via [MacPorts](https://www.macports.org): + + sudo port install rclone + +Note that this is a third party installer not controlled by the rclone +developers so it may be out of date. Its current version is as below. + +[![MacPorts port](https://repology.org/badge/version-for-repo/macports/rclone.svg)](https://repology.org/project/rclone/versions) + +More information [here](https://ports.macports.org/port/rclone/). + ### Precompiled binary, using curl {#macos-precompiled} To avoid problems with macOS gatekeeper enforcing the binary to be signed and @@ -501,7 +517,7 @@ Make sure you have [Snapd installed](https://snapcraft.io/docs/installing-snapd) ```bash $ sudo snap install rclone ``` -Due to the strict confinement of Snap, rclone snap cannot acess real /home/$USER/.config/rclone directory, default config path is as below. +Due to the strict confinement of Snap, rclone snap cannot access real /home/$USER/.config/rclone directory, default config path is as below. - Default config directory: - /home/$USER/snap/rclone/current/.config/rclone @@ -518,7 +534,7 @@ Note that this is controlled by [community maintainer](https://github.com/bouken ## Source installation {#source} Make sure you have git and [Go](https://golang.org/) installed. -Go version 1.17 or newer is required, latest release is recommended. +Go version 1.18 or newer is required, the latest release is recommended. You can get it from your package manager, or download it from [golang.org/dl](https://golang.org/dl/). Then you can run the following: @@ -552,26 +568,59 @@ port of GCC, e.g. by installing it in a [MSYS2](https://www.msys2.org) distribution (make sure you install it in the classic mingw64 subsystem, the ucrt64 version is not compatible). -Additionally, on Windows, you must install the third party utility -[WinFsp](https://winfsp.dev/), with the "Developer" feature selected. +Additionally, to build with mount on Windows, you must install the third party +utility [WinFsp](https://winfsp.dev/), with the "Developer" feature selected. If building with cgo, you must also set environment variable CPATH pointing to the fuse include directory within the WinFsp installation (normally `C:\Program Files (x86)\WinFsp\inc\fuse`). -You may also add arguments `-ldflags -s` (with or without `-tags cmount`), -to omit symbol table and debug information, making the executable file smaller, -and `-trimpath` to remove references to local file system paths. This is how -the official rclone releases are built. +You may add arguments `-ldflags -s` to omit symbol table and debug information, +making the executable file smaller, and `-trimpath` to remove references to +local file system paths. The official rclone releases are built with both of these. ``` go build -trimpath -ldflags -s -tags cmount ``` +If you want to customize the version string, as reported by +the `rclone version` command, you can set one of the variables `fs.Version`, +`fs.VersionTag` (to keep default suffix but customize the number), +or `fs.VersionSuffix` (to keep default number but customize the suffix). +This can be done from the build command, by adding to the `-ldflags` +argument value as shown below. + +``` +go build -trimpath -ldflags "-s -X github.com/rclone/rclone/fs.Version=v9.9.9-test" -tags cmount +``` + +On Windows, the official executables also have the version information, +as well as a file icon, embedded as binary resources. To get that with your +own build you need to run the following command **before** the build command. +It generates a Windows resource system object file, with extension .syso, e.g. +`resource_windows_amd64.syso`, that will be automatically picked up by +future build commands. + +``` +go run bin/resource_windows.go +``` + +The above command will generate a resource file containing version information +based on the fs.Version variable in source at the time you run the command, +which means if the value of this variable changes you need to re-run the +command for it to be reflected in the version information. Also, if you +override this version variable in the build command as described above, you +need to do that also when generating the resource file, or else it will still +use the value from the source. + +``` +go run bin/resource_windows.go -version v9.9.9-test +``` + Instead of executing the `go build` command directly, you can run it via the -Makefile. It changes the version number suffix from "-DEV" to "-beta" and -appends commit details. It also copies the resulting rclone executable into -your GOPATH bin folder (`$(go env GOPATH)/bin`, which corresponds to -`~/go/bin/rclone` by default). +Makefile. The default target changes the version suffix from "-DEV" to "-beta" +followed by additional commit details, embeds version information binary resources +on Windows, and copies the resulting rclone executable into your GOPATH bin folder +(`$(go env GOPATH)/bin`, which corresponds to `~/go/bin/rclone` by default). ``` make @@ -584,32 +633,22 @@ make GOTAGS=cmount ``` There are other make targets that can be used for more advanced builds, -such as cross-compiling for all supported os/architectures, embedding -icon and version info resources into windows executable, and packaging +such as cross-compiling for all supported os/architectures, and packaging results into release artifacts. See [Makefile](https://github.com/rclone/rclone/blob/master/Makefile) and [cross-compile.go](https://github.com/rclone/rclone/blob/master/bin/cross-compile.go) for details. -Another alternative is to download the source, build and install rclone in one -operation, as a regular Go package. The source will be stored it in the Go -module cache, and the resulting executable will be in your GOPATH bin folder -(`$(go env GOPATH)/bin`, which corresponds to `~/go/bin/rclone` by default). - -With Go version 1.17 or newer: +Another alternative method for source installation is to download the source, +build and install rclone - all in one operation, as a regular Go package. +The source will be stored it in the Go module cache, and the resulting +executable will be in your GOPATH bin folder (`$(go env GOPATH)/bin`, +which corresponds to `~/go/bin/rclone` by default). ``` go install github.com/rclone/rclone@latest ``` -With Go versions older than 1.17 (do **not** use the `-u` flag, it causes Go to -try to update the dependencies that rclone uses and sometimes these don't work -with the current version): - -``` -go get github.com/rclone/rclone -``` - ## Ansible installation {#ansible} This can be done with [Stefan Weichinger's ansible @@ -771,7 +810,7 @@ It requires .NET Framework, but it is preinstalled on newer versions of Windows, also provides alternative standalone distributions which includes necessary runtime (.NET 5). WinSW is a command-line only utility, where you have to manually create an XML file with service configuration. This may be a drawback for some, but it can also be an advantage -as it is easy to back up and re-use the configuration +as it is easy to back up and reuse the configuration settings, without having go through manual steps in a GUI. One thing to note is that by default it does not restart the service on error, one have to explicit enable this in the configuration file (via the "onfailure" parameter). @@ -841,10 +880,12 @@ See the following for detailed instructions for * [Internet Archive](https://rclone.org/internetarchive/) * [Jottacloud](https://rclone.org/jottacloud/) * [Koofr](https://rclone.org/koofr/) + * [Linkbox](https://rclone.org/linkbox/) * [Mail.ru Cloud](https://rclone.org/mailru/) * [Mega](https://rclone.org/mega/) * [Memory](https://rclone.org/memory/) * [Microsoft Azure Blob Storage](https://rclone.org/azureblob/) + * [Microsoft Azure Files Storage](https://rclone.org/azurefiles/) * [Microsoft OneDrive](https://rclone.org/onedrive/) * [OpenStack Swift / Rackspace Cloudfiles / Blomp Cloud Storage / Memset Memstore](https://rclone.org/swift/) * [OpenDrive](https://rclone.org/opendrive/) @@ -1024,11 +1065,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -1043,11 +1084,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination ``` @@ -1170,11 +1212,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -1189,11 +1231,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination ``` @@ -1330,11 +1373,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -1349,11 +1392,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination ``` @@ -2775,11 +2819,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -2794,11 +2838,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination ``` @@ -2950,17 +2995,20 @@ See the [global flags page](https://rclone.org/flags/) for global options not li # rclone checksum -Checks the files in the source against a SUM file. +Checks the files in the destination against a SUM file. ## Synopsis -Checks that hashsums of source files match the SUM file. +Checks that hashsums of destination files match the SUM file. It compares hashes (MD5, SHA1, etc) and logs a report of files which don't match. It doesn't alter the file system. -If you supply the `--download` flag, it will download the data from remote -and calculate the contents hash on the fly. This can be useful for remotes +The sumfile is treated as the source and the dst:path is treated as +the destination for the purposes of the output. + +If you supply the `--download` flag, it will download the data from the remote +and calculate the content hash on the fly. This can be useful for remotes that don't support hashes or if you really want to check all the data. Note that hash values in the SUM file are treated as case insensitive. @@ -2991,7 +3039,7 @@ option for more information. ``` -rclone checksum sumfile src:path [flags] +rclone checksum sumfile dst:path [flags] ``` ## Options @@ -3903,11 +3951,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -3922,11 +3970,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination ``` @@ -4454,10 +4503,6 @@ Run without a hash to see the list of all supported hashes, e.g. * whirlpool * crc32 * sha256 - * dropbox - * hidrive - * mailru - * quickxor Then @@ -4467,7 +4512,7 @@ Note that hash names are case insensitive and values are output in lower case. ``` -rclone hashsum remote:path [flags] +rclone hashsum [ remote:path] [flags] ``` ## Options @@ -4967,7 +5012,6 @@ Mount the remote as file system on a mountpoint. ## Synopsis - rclone mount allows Linux, FreeBSD, macOS and Windows to mount any of Rclone's cloud storage systems as a file system with FUSE. @@ -5222,11 +5266,17 @@ does not suffer from the same limitations. ## Mounting on macOS -Mounting on macOS can be done either via [macFUSE](https://osxfuse.github.io/) +Mounting on macOS can be done either via [built-in NFS server](https://rclone.org/commands/rclone_serve_nfs/), [macFUSE](https://osxfuse.github.io/) (also known as osxfuse) or [FUSE-T](https://www.fuse-t.org/). macFUSE is a traditional FUSE driver utilizing a macOS kernel extension (kext). FUSE-T is an alternative FUSE system which "mounts" via an NFSv4 local server. +# NFS mount + +This method spins up an NFS server using [serve nfs](https://rclone.org/commands/rclone_serve_nfs/) command and mounts +it to the specified mountpoint. If you run this in background mode using |--daemon|, you will need to +send SIGTERM signal to the rclone process using |kill| command to stop the mount. + ### macFUSE Notes If installing macFUSE using [dmg packages](https://github.com/osxfuse/osxfuse/releases) from @@ -5276,6 +5326,8 @@ sequentially, it can only seek when reading. This means that many applications won't work with their files on an rclone mount without `--vfs-cache-mode writes` or `--vfs-cache-mode full`. See the [VFS File Caching](#vfs-file-caching) section for more info. +When using NFS mount on macOS, if you don't specify |--vfs-cache-mode| +the mount point will be read-only. The bucket-based remotes (e.g. Swift, S3, Google Compute Storage, B2) do not support the concept of empty directories, so empty @@ -5422,7 +5474,6 @@ Mount option syntax includes a few extra options treated specially: - `vv...` will be transformed into appropriate `--verbose=N` - standard mount options like `x-systemd.automount`, `_netdev`, `nosuid` and alike are intended only for Automountd and ignored by rclone. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -5804,6 +5855,7 @@ rclone mount remote:path /path/to/mountpoint [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -5906,11 +5958,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -5925,11 +5977,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination ``` @@ -6395,6 +6448,17 @@ to be used within the template to server pages: |-- .Size | Size in Bytes of the entry. | |-- .ModTime | The UTC timestamp of an entry. | +The server also makes the following functions available so that they can be used within the +template. These functions help extend the options for dynamic rendering of HTML. They can +be used to render HTML based on specific conditions. + +| Function | Description | +| :---------- | :---------- | +| afterEpoch | Returns the time since the epoch for the given time. | +| contains | Checks whether a given substring is present or not in a given string. | +| hasPrefix | Checks whether the given string begins with the specified prefix. | +| hasSuffix | Checks whether the given string end with the specified suffix. | + ### Authentication By default this will serve files without needing a login. @@ -6536,7 +6600,6 @@ Update the rclone binary. ## Synopsis - This command downloads the latest release of rclone and replaces the currently running binary. The download is verified with a hashsum and cryptographically signed signature; see [the release signing @@ -6643,7 +6706,9 @@ See the [global flags page](https://rclone.org/flags/) for global options not li * [rclone serve docker](https://rclone.org/commands/rclone_serve_docker/) - Serve any remote on docker's volume plugin API. * [rclone serve ftp](https://rclone.org/commands/rclone_serve_ftp/) - Serve remote:path over FTP. * [rclone serve http](https://rclone.org/commands/rclone_serve_http/) - Serve the remote over HTTP. +* [rclone serve nfs](https://rclone.org/commands/rclone_serve_nfs/) - Serve the remote as an NFS mount * [rclone serve restic](https://rclone.org/commands/rclone_serve_restic/) - Serve the remote for restic's REST API. +* [rclone serve s3](https://rclone.org/commands/rclone_serve_s3/) - Serve remote:path over s3. * [rclone serve sftp](https://rclone.org/commands/rclone_serve_sftp/) - Serve the remote over SFTP. * [rclone serve webdav](https://rclone.org/commands/rclone_serve_webdav/) - Serve remote:path over WebDAV. @@ -6676,7 +6741,6 @@ default "rclone (hostname)". Use `--log-trace` in conjunction with `-vv` to enable additional debug logging of all UPNP traffic. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -7045,6 +7109,7 @@ rclone serve dlna remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -7092,7 +7157,6 @@ Serve any remote on docker's volume plugin API. ## Synopsis - This command implements the Docker volume plugin API allowing docker to use rclone as a data storage mechanism for various cloud providers. rclone provides [docker volume plugin](/docker) based on it. @@ -7131,7 +7195,6 @@ directory with book-keeping records of created and mounted volumes. All mount and VFS options are submitted by the docker daemon via API, but you can also provide defaults on the command line as well as set path to the config file and cache directory or adjust logging verbosity. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -7518,6 +7581,7 @@ rclone serve docker [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -7587,7 +7651,6 @@ then using Authentication is advised - see the next section for info. By default this will serve files without needing a login. You can set a single username and password with the --user and --pass flags. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -8040,6 +8103,7 @@ rclone serve ftp remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -8171,6 +8235,17 @@ to be used within the template to server pages: |-- .Size | Size in Bytes of the entry. | |-- .ModTime | The UTC timestamp of an entry. | +The server also makes the following functions available so that they can be used within the +template. These functions help extend the options for dynamic rendering of HTML. They can +be used to render HTML based on specific conditions. + +| Function | Description | +| :---------- | :---------- | +| afterEpoch | Returns the time since the epoch for the given time. | +| contains | Checks whether a given substring is present or not in a given string. | +| hasPrefix | Checks whether the given string begins with the specified prefix. | +| hasSuffix | Checks whether the given string end with the specified suffix. | + ### Authentication By default this will serve files without needing a login. @@ -8197,7 +8272,6 @@ The password file can be updated while rclone is running. Use `--realm` to set the authentication realm. Use `--salt` to change the password hashing salt from the default. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -8659,6 +8733,7 @@ rclone serve http remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -8700,263 +8775,40 @@ See the [global flags page](https://rclone.org/flags/) for global options not li * [rclone serve](https://rclone.org/commands/rclone_serve/) - Serve a remote over a protocol. -# rclone serve restic +# rclone serve nfs -Serve the remote for restic's REST API. +Serve the remote as an NFS mount ## Synopsis -Run a basic web server to serve a remote over restic's REST backend -API over HTTP. This allows restic to use rclone as a data storage -mechanism for cloud providers that restic does not support directly. - -[Restic](https://restic.net/) is a command-line program for doing -backups. - -The server will log errors. Use -v to see access logs. - -`--bwlimit` will be respected for file transfers. -Use `--stats` to control the stats printing. - -## Setting up rclone for use by restic ### - -First [set up a remote for your chosen cloud provider](https://rclone.org/docs/#configure). - -Once you have set up the remote, check it is working with, for example -"rclone lsd remote:". You may have called the remote something other -than "remote:" - just substitute whatever you called it in the -following instructions. - -Now start the rclone restic server - - rclone serve restic -v remote:backup - -Where you can replace "backup" in the above by whatever path in the -remote you wish to use. - -By default this will serve on "localhost:8080" you can change this -with use of the `--addr` flag. - -You might wish to start this server on boot. - -Adding `--cache-objects=false` will cause rclone to stop caching objects -returned from the List call. Caching is normally desirable as it speeds -up downloading objects, saves transactions and uses very little memory. - -## Setting up restic to use rclone ### - -Now you can [follow the restic -instructions](http://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html#rest-server) -on setting up restic. - -Note that you will need restic 0.8.2 or later to interoperate with -rclone. - -For the example above you will want to use "http://localhost:8080/" as -the URL for the REST server. - -For example: - - $ export RESTIC_REPOSITORY=rest:http://localhost:8080/ - $ export RESTIC_PASSWORD=yourpassword - $ restic init - created restic backend 8b1a4b56ae at rest:http://localhost:8080/ - - Please note that knowledge of your password is required to access - the repository. Losing your password means that your data is - irrecoverably lost. - $ restic backup /path/to/files/to/backup - scan [/path/to/files/to/backup] - scanned 189 directories, 312 files in 0:00 - [0:00] 100.00% 38.128 MiB / 38.128 MiB 501 / 501 items 0 errors ETA 0:00 - duration: 0:00 - snapshot 45c8fdd8 saved - -### Multiple repositories #### - -Note that you can use the endpoint to host multiple repositories. Do -this by adding a directory name or path after the URL. Note that -these **must** end with /. Eg - - $ export RESTIC_REPOSITORY=rest:http://localhost:8080/user1repo/ - # backup user1 stuff - $ export RESTIC_REPOSITORY=rest:http://localhost:8080/user2repo/ - # backup user2 stuff - -### Private repositories #### - -The`--private-repos` flag can be used to limit users to repositories starting -with a path of `//`. - -## Server options - -Use `--addr` to specify which IP address and port the server should -listen on, eg `--addr 1.2.3.4:8000` or `--addr :8080` to listen to all -IPs. By default it only listens on localhost. You can use port -:0 to let the OS choose an available port. - -If you set `--addr` to listen on a public or LAN accessible IP address -then using Authentication is advised - see the next section for info. - -You can use a unix socket by setting the url to `unix:///path/to/socket` -or just by using an absolute path name. Note that unix sockets bypass the -authentication - this is expected to be done with file system permissions. - -`--addr` may be repeated to listen on multiple IPs/ports/sockets. - -`--server-read-timeout` and `--server-write-timeout` can be used to -control the timeouts on the server. Note that this is the total time -for a transfer. - -`--max-header-bytes` controls the maximum number of bytes the server will -accept in the HTTP header. - -`--baseurl` controls the URL prefix that rclone serves from. By default -rclone will serve from the root. If you used `--baseurl "/rclone"` then -rclone would serve from a URL starting with "/rclone/". This is -useful if you wish to proxy rclone serve. Rclone automatically -inserts leading and trailing "/" on `--baseurl`, so `--baseurl "rclone"`, -`--baseurl "/rclone"` and `--baseurl "/rclone/"` are all treated -identically. - -### TLS (SSL) - -By default this will serve over http. If you want you can serve over -https. You will need to supply the `--cert` and `--key` flags. -If you wish to do client side certificate validation then you will need to -supply `--client-ca` also. - -`--cert` should be a either a PEM encoded certificate or a concatenation -of that with the CA certificate. `--key` should be the PEM encoded -private key and `--client-ca` should be the PEM encoded client -certificate authority certificate. - ---min-tls-version is minimum TLS version that is acceptable. Valid - values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default - "tls1.0"). - -### Authentication - -By default this will serve files without needing a login. - -You can either use an htpasswd file which can take lots of users, or -set a single username and password with the `--user` and `--pass` flags. - -If no static users are configured by either of the above methods, and client -certificates are required by the `--client-ca` flag passed to the server, the -client certificate common name will be considered as the username. - -Use `--htpasswd /path/to/htpasswd` to provide an htpasswd file. This is -in standard apache format and supports MD5, SHA1 and BCrypt for basic -authentication. Bcrypt is recommended. - -To create an htpasswd file: - - touch htpasswd - htpasswd -B htpasswd user - htpasswd -B htpasswd anotherUser - -The password file can be updated while rclone is running. - -Use `--realm` to set the authentication realm. - -Use `--salt` to change the password hashing salt from the default. - - -``` -rclone serve restic remote:path [flags] -``` - -## Options - -``` - --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) - --allow-origin string Origin which cross-domain request (CORS) can be executed from - --append-only Disallow deletion of repository data - --baseurl string Prefix for URLs - leave blank for root - --cache-objects Cache listed objects (default true) - --cert string TLS PEM key (concatenation of certificate and CA certificate) - --client-ca string Client certificate authority to verify clients with - -h, --help help for restic - --htpasswd string A htpasswd file - if not provided no authentication is done - --key string TLS PEM Private key - --max-header-bytes int Maximum size of request header (default 4096) - --min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") - --pass string Password for authentication - --private-repos Users can only access their private repo - --realm string Realm for authentication - --salt string Password hashing salt (default "dlPL2MqE") - --server-read-timeout Duration Timeout for server reading data (default 1h0m0s) - --server-write-timeout Duration Timeout for server writing data (default 1h0m0s) - --stdio Run an HTTP2 server on stdin/stdout - --user string User name for authentication -``` - - -See the [global flags page](https://rclone.org/flags/) for global options not listed here. - -# SEE ALSO - -* [rclone serve](https://rclone.org/commands/rclone_serve/) - Serve a remote over a protocol. - -# rclone serve sftp - -Serve the remote over SFTP. - -## Synopsis - -Run an SFTP server to serve a remote over SFTP. This can be used -with an SFTP client or you can make a remote of type [sftp](/sftp) to use with it. - -You can use the [filter](/filtering) flags (e.g. `--include`, `--exclude`) -to control what is served. - -The server will respond to a small number of shell commands, mainly -md5sum, sha1sum and df, which enable it to provide support for checksums -and the about feature when accessed from an sftp remote. - -Note that this server uses standard 32 KiB packet payload size, which -means you must not configure the client to expect anything else, e.g. -with the [chunk_size](https://rclone.org/sftp/#sftp-chunk-size) option on an sftp remote. - -The server will log errors. Use `-v` to see access logs. - -`--bwlimit` will be respected for file transfers. -Use `--stats` to control the stats printing. - -You must provide some means of authentication, either with -`--user`/`--pass`, an authorized keys file (specify location with -`--authorized-keys` - the default is the same as ssh), an -`--auth-proxy`, or set the `--no-auth` flag for no -authentication when logging in. +Create an NFS server that serves the given remote over the network. + +The primary purpose for this command is to enable [mount command](https://rclone.org/commands/rclone_mount/) on recent macOS versions where +installing FUSE is very cumbersome. -If you don't supply a host `--key` then rclone will generate rsa, ecdsa -and ed25519 variants, and cache them for later use in rclone's cache -directory (see `rclone help flags cache-dir`) in the "serve-sftp" -directory. +Since this is running on NFSv3, no authentication method is available. Any client +will be able to access the data. To limit access, you can use serve NFS on loopback address +and rely on secure tunnels (such as SSH). For this reason, by default, a random TCP port is chosen and loopback interface is used for the listening address; +meaning that it is only available to the local machine. If you want other machines to access the +NFS mount over local network, you need to specify the listening address and port using `--addr` flag. -By default the server binds to localhost:2022 - if you want it to be -reachable externally then supply `--addr :2022` for example. +Modifying files through NFS protocol requires VFS caching. Usually you will need to specify `--vfs-cache-mode` +in order to be able to write to the mountpoint (full is recommended). If you don't specify VFS cache mode, +the mount will be read-only. -Note that the default of `--vfs-cache-mode off` is fine for the rclone -sftp backend, but it may not be with other SFTP clients. +To serve NFS over the network use following command: -If `--stdio` is specified, rclone will serve SFTP over stdio, which can -be used with sshd via ~/.ssh/authorized_keys, for example: + rclone serve nfs remote: --addr 0.0.0.0:$PORT --vfs-cache-mode=full - restrict,command="rclone serve sftp --stdio ./photos" ssh-rsa ... +We specify a specific port that we can use in the mount command: -On the client you need to set `--transfers 1` when using `--stdio`. -Otherwise multiple instances of the rclone server are started by OpenSSH -which can lead to "corrupted on transfer" errors. This is the case because -the client chooses indiscriminately which server to send commands to while -the servers all have different views of the state of the filing system. +To mount the server under Linux/macOS, use the following command: + + mount -oport=$PORT,mountport=$PORT $HOSTNAME: path/to/mountpoint -The "restrict" in authorized_keys prevents SHA1SUMs and MD5SUMs from being -used. Omitting "restrict" and using `--sftp-path-override` to enable -checksumming is possible but less secure and you could use the SFTP server -provided by OpenSSH in this case. +Where `$PORT` is the same port number we used in the serve nfs command. +This feature is only available on Unix platforms. ## VFS - Virtual File System @@ -9289,115 +9141,27 @@ _WARNING._ Contrary to `rclone size`, this flag ignores filters so that the result is accurate. However, this is very inefficient and may cost lots of API calls resulting in extra charges. Use it as a last resort and only with caching. -## Auth Proxy - -If you supply the parameter `--auth-proxy /path/to/program` then -rclone will use that program to generate backends on the fly which -then are used to authenticate incoming requests. This uses a simple -JSON based protocol with input on STDIN and output on STDOUT. - -**PLEASE NOTE:** `--auth-proxy` and `--authorized-keys` cannot be used -together, if `--auth-proxy` is set the authorized keys option will be -ignored. - -There is an example program -[bin/test_proxy.py](https://github.com/rclone/rclone/blob/master/test_proxy.py) -in the rclone source code. - -The program's job is to take a `user` and `pass` on the input and turn -those into the config for a backend on STDOUT in JSON format. This -config will have any default parameters for the backend added, but it -won't use configuration from environment variables or command line -options - it is the job of the proxy program to make a complete -config. - -This config generated must have this extra parameter -- `_root` - root to use for the backend - -And it may have this parameter -- `_obscure` - comma separated strings for parameters to obscure - -If password authentication was used by the client, input to the proxy -process (on STDIN) would look similar to this: - -``` -{ - "user": "me", - "pass": "mypassword" -} -``` - -If public-key authentication was used by the client, input to the -proxy process (on STDIN) would look similar to this: - -``` -{ - "user": "me", - "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDuwESFdAe14hVS6omeyX7edc...JQdf" -} -``` - -And as an example return this on STDOUT - -``` -{ - "type": "sftp", - "_root": "", - "_obscure": "pass", - "user": "me", - "pass": "mypassword", - "host": "sftp.example.com" -} -``` - -This would mean that an SFTP backend would be created on the fly for -the `user` and `pass`/`public_key` returned in the output to the host given. Note -that since `_obscure` is set to `pass`, rclone will obscure the `pass` -parameter before creating the backend (which is required for sftp -backends). - -The program can manipulate the supplied `user` in any way, for example -to make proxy to many different sftp backends, you could make the -`user` be `user@example.com` and then set the `host` to `example.com` -in the output and the user to `user`. For security you'd probably want -to restrict the `host` to a limited list. - -Note that an internal cache is keyed on `user` so only use that for -configuration, don't use `pass` or `public_key`. This also means that if a user's -password or public-key is changed the cache will need to expire (which takes 5 mins) -before it takes effect. - -This can be used to build general purpose proxies to any kind of -backend that rclone supports. - ``` -rclone serve sftp remote:path [flags] +rclone serve nfs remote:path [flags] ``` ## Options ``` - --addr string IPaddress:Port or :Port to bind server to (default "localhost:2022") - --auth-proxy string A program to use to create the backend from the auth - --authorized-keys string Authorized keys file (default "~/.ssh/authorized_keys") + --addr string IPaddress:Port or :Port to bind server to --dir-cache-time Duration Time to cache directory entries for (default 5m0s) --dir-perms FileMode Directory permissions (default 0777) --file-perms FileMode File permissions (default 0666) --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) - -h, --help help for sftp - --key stringArray SSH private host key file (Can be multi-valued, leave blank to auto generate) - --no-auth Allow connections with no authentication if set + -h, --help help for nfs --no-checksum Don't compare checksums on up/download --no-modtime Don't read/write the modification time (can speed things up) --no-seek Don't allow seeking in files - --pass string Password for authentication --poll-interval Duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s) --read-only Only allow read-only access - --stdio Run an sftp server on stdin/stdout --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) - --user string User name for authentication --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) @@ -9410,6 +9174,7 @@ rclone serve sftp remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -9451,52 +9216,93 @@ See the [global flags page](https://rclone.org/flags/) for global options not li * [rclone serve](https://rclone.org/commands/rclone_serve/) - Serve a remote over a protocol. -# rclone serve webdav +# rclone serve restic -Serve remote:path over WebDAV. +Serve the remote for restic's REST API. ## Synopsis -Run a basic WebDAV server to serve a remote over HTTP via the -WebDAV protocol. This can be viewed with a WebDAV client, through a web -browser, or you can make a remote of type WebDAV to read and write it. +Run a basic web server to serve a remote over restic's REST backend +API over HTTP. This allows restic to use rclone as a data storage +mechanism for cloud providers that restic does not support directly. -## WebDAV options +[Restic](https://restic.net/) is a command-line program for doing +backups. -### --etag-hash +The server will log errors. Use -v to see access logs. -This controls the ETag header. Without this flag the ETag will be -based on the ModTime and Size of the object. +`--bwlimit` will be respected for file transfers. +Use `--stats` to control the stats printing. -If this flag is set to "auto" then rclone will choose the first -supported hash on the backend or you can use a named hash such as -"MD5" or "SHA-1". Use the [hashsum](https://rclone.org/commands/rclone_hashsum/) command -to see the full list. +## Setting up rclone for use by restic ### -## Access WebDAV on Windows -WebDAV shared folder can be mapped as a drive on Windows, however the default settings prevent it. -Windows will fail to connect to the server using insecure Basic authentication. -It will not even display any login dialog. Windows requires SSL / HTTPS connection to be used with Basic. -If you try to connect via Add Network Location Wizard you will get the following error: -"The folder you entered does not appear to be valid. Please choose another". -However, you still can connect if you set the following registry key on a client machine: -HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters\BasicAuthLevel to 2. -The BasicAuthLevel can be set to the following values: - 0 - Basic authentication disabled - 1 - Basic authentication enabled for SSL connections only - 2 - Basic authentication enabled for SSL connections and for non-SSL connections -If required, increase the FileSizeLimitInBytes to a higher value. -Navigate to the Services interface, then restart the WebClient service. +First [set up a remote for your chosen cloud provider](https://rclone.org/docs/#configure). -## Access Office applications on WebDAV -Navigate to following registry HKEY_CURRENT_USER\Software\Microsoft\Office\[14.0/15.0/16.0]\Common\Internet -Create a new DWORD BasicAuthLevel with value 2. - 0 - Basic authentication disabled - 1 - Basic authentication enabled for SSL connections only - 2 - Basic authentication enabled for SSL and for non-SSL connections +Once you have set up the remote, check it is working with, for example +"rclone lsd remote:". You may have called the remote something other +than "remote:" - just substitute whatever you called it in the +following instructions. -https://learn.microsoft.com/en-us/office/troubleshoot/powerpoint/office-opens-blank-from-sharepoint +Now start the rclone restic server + + rclone serve restic -v remote:backup + +Where you can replace "backup" in the above by whatever path in the +remote you wish to use. + +By default this will serve on "localhost:8080" you can change this +with use of the `--addr` flag. + +You might wish to start this server on boot. + +Adding `--cache-objects=false` will cause rclone to stop caching objects +returned from the List call. Caching is normally desirable as it speeds +up downloading objects, saves transactions and uses very little memory. + +## Setting up restic to use rclone ### + +Now you can [follow the restic +instructions](http://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html#rest-server) +on setting up restic. + +Note that you will need restic 0.8.2 or later to interoperate with +rclone. + +For the example above you will want to use "http://localhost:8080/" as +the URL for the REST server. + +For example: + + $ export RESTIC_REPOSITORY=rest:http://localhost:8080/ + $ export RESTIC_PASSWORD=yourpassword + $ restic init + created restic backend 8b1a4b56ae at rest:http://localhost:8080/ + + Please note that knowledge of your password is required to access + the repository. Losing your password means that your data is + irrecoverably lost. + $ restic backup /path/to/files/to/backup + scan [/path/to/files/to/backup] + scanned 189 directories, 312 files in 0:00 + [0:00] 100.00% 38.128 MiB / 38.128 MiB 501 / 501 items 0 errors ETA 0:00 + duration: 0:00 + snapshot 45c8fdd8 saved + +### Multiple repositories #### + +Note that you can use the endpoint to host multiple repositories. Do +this by adding a directory name or path after the URL. Note that +these **must** end with /. Eg + + $ export RESTIC_REPOSITORY=rest:http://localhost:8080/user1repo/ + # backup user1 stuff + $ export RESTIC_REPOSITORY=rest:http://localhost:8080/user2repo/ + # backup user2 stuff +### Private repositories #### + +The`--private-repos` flag can be used to limit users to repositories starting +with a path of `//`. ## Server options @@ -9545,31 +9351,6 @@ certificate authority certificate. values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default "tls1.0"). -### Template - -`--template` allows a user to specify a custom markup template for HTTP -and WebDAV serve functions. The server exports the following markup -to be used within the template to server pages: - -| Parameter | Description | -| :---------- | :---------- | -| .Name | The full path of a file/directory. | -| .Title | Directory listing of .Name | -| .Sort | The current sort used. This is changeable via ?sort= parameter | -| | Sort Options: namedirfirst,name,size,time (default namedirfirst) | -| .Order | The current ordering used. This is changeable via ?order= parameter | -| | Order Options: asc,desc (default asc) | -| .Query | Currently unused. | -| .Breadcrumb | Allows for creating a relative navigation | -|-- .Link | The relative to the root link of the Text. | -|-- .Text | The Name of the directory. | -| .Entries | Information about a specific file/directory. | -|-- .URL | The 'url' of an entry. | -|-- .Leaf | Currently same as 'URL' but intended to be 'just' the name. | -|-- .IsDir | Boolean for if an entry is a directory or not. | -|-- .Size | Size in Bytes of the entry. | -|-- .ModTime | The UTC timestamp of an entry. | - ### Authentication By default this will serve files without needing a login. @@ -9597,6 +9378,211 @@ Use `--realm` to set the authentication realm. Use `--salt` to change the password hashing salt from the default. + +``` +rclone serve restic remote:path [flags] +``` + +## Options + +``` + --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) + --allow-origin string Origin which cross-domain request (CORS) can be executed from + --append-only Disallow deletion of repository data + --baseurl string Prefix for URLs - leave blank for root + --cache-objects Cache listed objects (default true) + --cert string TLS PEM key (concatenation of certificate and CA certificate) + --client-ca string Client certificate authority to verify clients with + -h, --help help for restic + --htpasswd string A htpasswd file - if not provided no authentication is done + --key string TLS PEM Private key + --max-header-bytes int Maximum size of request header (default 4096) + --min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") + --pass string Password for authentication + --private-repos Users can only access their private repo + --realm string Realm for authentication + --salt string Password hashing salt (default "dlPL2MqE") + --server-read-timeout Duration Timeout for server reading data (default 1h0m0s) + --server-write-timeout Duration Timeout for server writing data (default 1h0m0s) + --stdio Run an HTTP2 server on stdin/stdout + --user string User name for authentication +``` + + +See the [global flags page](https://rclone.org/flags/) for global options not listed here. + +# SEE ALSO + +* [rclone serve](https://rclone.org/commands/rclone_serve/) - Serve a remote over a protocol. + +# rclone serve s3 + +Serve remote:path over s3. + +## Synopsis + +`serve s3` implements a basic s3 server that serves a remote via s3. +This can be viewed with an s3 client, or you can make an [s3 type +remote](https://rclone.org/s3/) to read and write to it with rclone. + +`serve s3` is considered **Experimental** so use with care. + +S3 server supports Signature Version 4 authentication. Just use +`--auth-key accessKey,secretKey` and set the `Authorization` +header correctly in the request. (See the [AWS +docs](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html)). + +`--auth-key` can be repeated for multiple auth pairs. If +`--auth-key` is not provided then `serve s3` will allow anonymous +access. + +Please note that some clients may require HTTPS endpoints. See [the +SSL docs](#ssl-tls) for more information. + +This command uses the [VFS directory cache](#vfs-virtual-file-system). +All the functionality will work with `--vfs-cache-mode off`. Using +`--vfs-cache-mode full` (or `writes`) can be used to cache objects +locally to improve performance. + +Use `--force-path-style=false` if you want to use the bucket name as a +part of the hostname (such as mybucket.local) + +Use `--etag-hash` if you want to change the hash uses for the `ETag`. +Note that using anything other than `MD5` (the default) is likely to +cause problems for S3 clients which rely on the Etag being the MD5. + +## Quickstart + +For a simple set up, to serve `remote:path` over s3, run the server +like this: + +``` +rclone serve s3 --auth-key ACCESS_KEY_ID,SECRET_ACCESS_KEY remote:path +``` + +This will be compatible with an rclone remote which is defined like this: + +``` +[serves3] +type = s3 +provider = Rclone +endpoint = http://127.0.0.1:8080/ +access_key_id = ACCESS_KEY_ID +secret_access_key = SECRET_ACCESS_KEY +use_multipart_uploads = false +``` + +Note that setting `disable_multipart_uploads = true` is to work around +[a bug](#bugs) which will be fixed in due course. + +## Bugs + +When uploading multipart files `serve s3` holds all the parts in +memory (see [#7453](https://github.com/rclone/rclone/issues/7453)). +This is a limitaton of the library rclone uses for serving S3 and will +hopefully be fixed at some point. + +Multipart server side copies do not work (see +[#7454](https://github.com/rclone/rclone/issues/7454)). These take a +very long time and eventually fail. The default threshold for +multipart server side copies is 5G which is the maximum it can be, so +files above this side will fail to be server side copied. + +For a current list of `serve s3` bugs see the [serve +s3](https://github.com/rclone/rclone/labels/serve%20s3) bug category +on GitHub. + +## Limitations + +`serve s3` will treat all directories in the root as buckets and +ignore all files in the root. You can use `CreateBucket` to create +folders under the root, but you can't create empty folders under other +folders not in the root. + +When using `PutObject` or `DeleteObject`, rclone will automatically +create or clean up empty folders. If you don't want to clean up empty +folders automatically, use `--no-cleanup`. + +When using `ListObjects`, rclone will use `/` when the delimiter is +empty. This reduces backend requests with no effect on most +operations, but if the delimiter is something other than `/` and +empty, rclone will do a full recursive search of the backend, which +can take some time. + +Versioning is not currently supported. + +Metadata will only be saved in memory other than the rclone `mtime` +metadata which will be set as the modification time of the file. + +## Supported operations + +`serve s3` currently supports the following operations. + +- Bucket + - `ListBuckets` + - `CreateBucket` + - `DeleteBucket` +- Object + - `HeadObject` + - `ListObjects` + - `GetObject` + - `PutObject` + - `DeleteObject` + - `DeleteObjects` + - `CreateMultipartUpload` + - `CompleteMultipartUpload` + - `AbortMultipartUpload` + - `CopyObject` + - `UploadPart` + +Other operations will return error `Unimplemented`. + +## Server options + +Use `--addr` to specify which IP address and port the server should +listen on, eg `--addr 1.2.3.4:8000` or `--addr :8080` to listen to all +IPs. By default it only listens on localhost. You can use port +:0 to let the OS choose an available port. + +If you set `--addr` to listen on a public or LAN accessible IP address +then using Authentication is advised - see the next section for info. + +You can use a unix socket by setting the url to `unix:///path/to/socket` +or just by using an absolute path name. Note that unix sockets bypass the +authentication - this is expected to be done with file system permissions. + +`--addr` may be repeated to listen on multiple IPs/ports/sockets. + +`--server-read-timeout` and `--server-write-timeout` can be used to +control the timeouts on the server. Note that this is the total time +for a transfer. + +`--max-header-bytes` controls the maximum number of bytes the server will +accept in the HTTP header. + +`--baseurl` controls the URL prefix that rclone serves from. By default +rclone will serve from the root. If you used `--baseurl "/rclone"` then +rclone would serve from a URL starting with "/rclone/". This is +useful if you wish to proxy rclone serve. Rclone automatically +inserts leading and trailing "/" on `--baseurl`, so `--baseurl "rclone"`, +`--baseurl "/rclone"` and `--baseurl "/rclone/"` are all treated +identically. + +### TLS (SSL) + +By default this will serve over http. If you want you can serve over +https. You will need to supply the `--cert` and `--key` flags. +If you wish to do client side certificate validation then you will need to +supply `--client-ca` also. + +`--cert` should be a either a PEM encoded certificate or a concatenation +of that with the CA certificate. `--key` should be the PEM encoded +private key and `--client-ca` should be the PEM encoded client +certificate authority certificate. + +--min-tls-version is minimum TLS version that is acceptable. Valid + values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default + "tls1.0"). ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -9928,90 +9914,9 @@ _WARNING._ Contrary to `rclone size`, this flag ignores filters so that the result is accurate. However, this is very inefficient and may cost lots of API calls resulting in extra charges. Use it as a last resort and only with caching. -## Auth Proxy - -If you supply the parameter `--auth-proxy /path/to/program` then -rclone will use that program to generate backends on the fly which -then are used to authenticate incoming requests. This uses a simple -JSON based protocol with input on STDIN and output on STDOUT. - -**PLEASE NOTE:** `--auth-proxy` and `--authorized-keys` cannot be used -together, if `--auth-proxy` is set the authorized keys option will be -ignored. - -There is an example program -[bin/test_proxy.py](https://github.com/rclone/rclone/blob/master/test_proxy.py) -in the rclone source code. - -The program's job is to take a `user` and `pass` on the input and turn -those into the config for a backend on STDOUT in JSON format. This -config will have any default parameters for the backend added, but it -won't use configuration from environment variables or command line -options - it is the job of the proxy program to make a complete -config. - -This config generated must have this extra parameter -- `_root` - root to use for the backend - -And it may have this parameter -- `_obscure` - comma separated strings for parameters to obscure - -If password authentication was used by the client, input to the proxy -process (on STDIN) would look similar to this: - -``` -{ - "user": "me", - "pass": "mypassword" -} -``` - -If public-key authentication was used by the client, input to the -proxy process (on STDIN) would look similar to this: - -``` -{ - "user": "me", - "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDuwESFdAe14hVS6omeyX7edc...JQdf" -} -``` - -And as an example return this on STDOUT - -``` -{ - "type": "sftp", - "_root": "", - "_obscure": "pass", - "user": "me", - "pass": "mypassword", - "host": "sftp.example.com" -} -``` - -This would mean that an SFTP backend would be created on the fly for -the `user` and `pass`/`public_key` returned in the output to the host given. Note -that since `_obscure` is set to `pass`, rclone will obscure the `pass` -parameter before creating the backend (which is required for sftp -backends). - -The program can manipulate the supplied `user` in any way, for example -to make proxy to many different sftp backends, you could make the -`user` be `user@example.com` and then set the `host` to `example.com` -in the output and the user to `user`. For security you'd probably want -to restrict the `host` to a limited list. - -Note that an internal cache is keyed on `user` so only use that for -configuration, don't use `pass` or `public_key`. This also means that if a user's -password or public-key is changed the cache will need to expire (which takes 5 mins) -before it takes effect. - -This can be used to build general purpose proxies to any kind of -backend that rclone supports. - ``` -rclone serve webdav remote:path [flags] +rclone serve s3 remote:path [flags] ``` ## Options @@ -10019,35 +9924,30 @@ rclone serve webdav remote:path [flags] ``` --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) --allow-origin string Origin which cross-domain request (CORS) can be executed from - --auth-proxy string A program to use to create the backend from the auth + --auth-key stringArray Set key pair for v4 authorization: access_key_id,secret_access_key --baseurl string Prefix for URLs - leave blank for root --cert string TLS PEM key (concatenation of certificate and CA certificate) --client-ca string Client certificate authority to verify clients with --dir-cache-time Duration Time to cache directory entries for (default 5m0s) --dir-perms FileMode Directory permissions (default 0777) - --disable-dir-list Disable HTML directory list on GET request for a directory - --etag-hash string Which hash to use for the ETag, or auto or blank for off + --etag-hash string Which hash to use for the ETag, or auto or blank for off (default "MD5") --file-perms FileMode File permissions (default 0666) + --force-path-style If true use path style access if false use virtual hosted style (default true) (default true) --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) - -h, --help help for webdav - --htpasswd string A htpasswd file - if not provided no authentication is done + -h, --help help for s3 --key string TLS PEM Private key --max-header-bytes int Maximum size of request header (default 4096) --min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") --no-checksum Don't compare checksums on up/download + --no-cleanup Not to cleanup empty folder after object is deleted --no-modtime Don't read/write the modification time (can speed things up) --no-seek Don't allow seeking in files - --pass string Password for authentication --poll-interval Duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s) --read-only Only allow read-only access - --realm string Realm for authentication - --salt string Password hashing salt (default "dlPL2MqE") --server-read-timeout Duration Timeout for server reading data (default 1h0m0s) --server-write-timeout Duration Timeout for server writing data (default 1h0m0s) - --template string User-specified template --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) - --user string User name for authentication --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) @@ -10060,6 +9960,7 @@ rclone serve webdav remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -10101,316 +10002,523 @@ See the [global flags page](https://rclone.org/flags/) for global options not li * [rclone serve](https://rclone.org/commands/rclone_serve/) - Serve a remote over a protocol. -# rclone settier +# rclone serve sftp -Changes storage class/tier of objects in remote. +Serve the remote over SFTP. ## Synopsis +Run an SFTP server to serve a remote over SFTP. This can be used +with an SFTP client or you can make a remote of type [sftp](/sftp) to use with it. -rclone settier changes storage tier or class at remote if supported. -Few cloud storage services provides different storage classes on objects, -for example AWS S3 and Glacier, Azure Blob storage - Hot, Cool and Archive, -Google Cloud Storage, Regional Storage, Nearline, Coldline etc. +You can use the [filter](/filtering) flags (e.g. `--include`, `--exclude`) +to control what is served. -Note that, certain tier changes make objects not available to access immediately. -For example tiering to archive in azure blob storage makes objects in frozen state, -user can restore by setting tier to Hot/Cool, similarly S3 to Glacier makes object -inaccessible.true +The server will respond to a small number of shell commands, mainly +md5sum, sha1sum and df, which enable it to provide support for checksums +and the about feature when accessed from an sftp remote. -You can use it to tier single object +Note that this server uses standard 32 KiB packet payload size, which +means you must not configure the client to expect anything else, e.g. +with the [chunk_size](https://rclone.org/sftp/#sftp-chunk-size) option on an sftp remote. - rclone settier Cool remote:path/file +The server will log errors. Use `-v` to see access logs. -Or use rclone filters to set tier on only specific files +`--bwlimit` will be respected for file transfers. +Use `--stats` to control the stats printing. - rclone --include "*.txt" settier Hot remote:path/dir +You must provide some means of authentication, either with +`--user`/`--pass`, an authorized keys file (specify location with +`--authorized-keys` - the default is the same as ssh), an +`--auth-proxy`, or set the `--no-auth` flag for no +authentication when logging in. -Or just provide remote directory and all files in directory will be tiered +If you don't supply a host `--key` then rclone will generate rsa, ecdsa +and ed25519 variants, and cache them for later use in rclone's cache +directory (see `rclone help flags cache-dir`) in the "serve-sftp" +directory. - rclone settier tier remote:path/dir +By default the server binds to localhost:2022 - if you want it to be +reachable externally then supply `--addr :2022` for example. +Note that the default of `--vfs-cache-mode off` is fine for the rclone +sftp backend, but it may not be with other SFTP clients. -``` -rclone settier tier remote:path [flags] -``` +If `--stdio` is specified, rclone will serve SFTP over stdio, which can +be used with sshd via ~/.ssh/authorized_keys, for example: -## Options + restrict,command="rclone serve sftp --stdio ./photos" ssh-rsa ... -``` - -h, --help help for settier -``` +On the client you need to set `--transfers 1` when using `--stdio`. +Otherwise multiple instances of the rclone server are started by OpenSSH +which can lead to "corrupted on transfer" errors. This is the case because +the client chooses indiscriminately which server to send commands to while +the servers all have different views of the state of the filing system. +The "restrict" in authorized_keys prevents SHA1SUMs and MD5SUMs from being +used. Omitting "restrict" and using `--sftp-path-override` to enable +checksumming is possible but less secure and you could use the SFTP server +provided by OpenSSH in this case. -See the [global flags page](https://rclone.org/flags/) for global options not listed here. +## VFS - Virtual File System -# SEE ALSO +This command uses the VFS layer. This adapts the cloud storage objects +that rclone uses into something which looks much more like a disk +filing system. -* [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. +Cloud storage objects have lots of properties which aren't like disk +files - you can't extend them or write to the middle of them, so the +VFS layer has to deal with that. Because there is no one right way of +doing this there are various options explained below. -# rclone test +The VFS layer also implements a directory cache - this caches info +about files and directories (but not the data) in memory. -Run a test command +## VFS Directory Cache -## Synopsis +Using the `--dir-cache-time` flag, you can control how long a +directory should be considered up to date and not refreshed from the +backend. Changes made through the VFS will appear immediately or +invalidate the cache. -Rclone test is used to run test commands. + --dir-cache-time duration Time to cache directory entries for (default 5m0s) + --poll-interval duration Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable (default 1m0s) -Select which test command you want with the subcommand, eg +However, changes made directly on the cloud storage by the web +interface or a different copy of rclone will only be picked up once +the directory cache expires if the backend configured does not support +polling for changes. If the backend supports polling, changes will be +picked up within the polling interval. - rclone test memory remote: +You can send a `SIGHUP` signal to rclone for it to flush all +directory caches, regardless of how old they are. Assuming only one +rclone instance is running, you can reset the cache like this: -Each subcommand has its own options which you can see in their help. + kill -SIGHUP $(pidof rclone) -**NB** Be careful running these commands, they may do strange things -so reading their documentation first is recommended. +If you configure rclone with a [remote control](/rc) then you can use +rclone rc to flush the whole directory cache: + rclone rc vfs/forget -## Options +Or individual files or directories: -``` - -h, --help help for test -``` + rclone rc vfs/forget file=path/to/file dir=path/to/dir +## VFS File Buffering -See the [global flags page](https://rclone.org/flags/) for global options not listed here. +The `--buffer-size` flag determines the amount of memory, +that will be used to buffer data in advance. -# SEE ALSO +Each open file will try to keep the specified amount of data in memory +at all times. The buffered data is bound to one open file and won't be +shared. -* [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. -* [rclone test changenotify](https://rclone.org/commands/rclone_test_changenotify/) - Log any change notify requests for the remote passed in. -* [rclone test histogram](https://rclone.org/commands/rclone_test_histogram/) - Makes a histogram of file name characters. -* [rclone test info](https://rclone.org/commands/rclone_test_info/) - Discovers file name or other limitations for paths. -* [rclone test makefile](https://rclone.org/commands/rclone_test_makefile/) - Make files with random contents of the size given -* [rclone test makefiles](https://rclone.org/commands/rclone_test_makefiles/) - Make a random file hierarchy in a directory -* [rclone test memory](https://rclone.org/commands/rclone_test_memory/) - Load all the objects at remote:path into memory and report memory stats. +This flag is a upper limit for the used memory per open file. The +buffer will only use memory for data that is downloaded but not not +yet read. If the buffer is empty, only a small amount of memory will +be used. -# rclone test changenotify +The maximum memory used by rclone for buffering can be up to +`--buffer-size * open files`. -Log any change notify requests for the remote passed in. +## VFS File Caching -``` -rclone test changenotify remote: [flags] -``` +These flags control the VFS file caching options. File caching is +necessary to make the VFS layer appear compatible with a normal file +system. It can be disabled at the cost of some compatibility. -## Options +For example you'll need to enable VFS caching if you want to read and +write simultaneously to a file. See below for more details. -``` - -h, --help help for changenotify - --poll-interval Duration Time to wait between polling for changes (default 10s) -``` +Note that the VFS cache is separate from the cache backend and you may +find that you need one or the other or both. + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) -See the [global flags page](https://rclone.org/flags/) for global options not listed here. +If run with `-vv` rclone will print the location of the file cache. The +files are stored in the user cache file area which is OS dependent but +can be controlled with `--cache-dir` or setting the appropriate +environment variable. -# SEE ALSO +The cache has 4 different modes selected by `--vfs-cache-mode`. +The higher the cache mode the more compatible rclone becomes at the +cost of using disk space. -* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command +Note that files are written back to the remote only when they are +closed and if they haven't been accessed for `--vfs-write-back` +seconds. If rclone is quit or dies with files that haven't been +uploaded, these will be uploaded next time rclone is run with the same +flags. -# rclone test histogram +If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note +that the cache may exceed these quotas for two reasons. Firstly +because it is only checked every `--vfs-cache-poll-interval`. Secondly +because open files cannot be evicted from the cache. When +`--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded, +rclone will attempt to evict the least accessed files from the cache +first. rclone will start with files that haven't been accessed for the +longest. This cache flushing strategy is efficient and more relevant +files are likely to remain cached. -Makes a histogram of file name characters. +The `--vfs-cache-max-age` will evict files from the cache +after the set time since last access has passed. The default value of +1 hour will start evicting files from cache that haven't been accessed +for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 +and will wait for 1 more hour before evicting. Specify the time with +standard notation, s, m, h, d, w . -## Synopsis +You **should not** run two copies of rclone using the same VFS cache +with the same or overlapping remotes if using `--vfs-cache-mode > off`. +This can potentially cause data corruption if you do. You can work +around this by giving each rclone its own cache hierarchy with +`--cache-dir`. You don't need to worry about this if the remotes in +use don't overlap. -This command outputs JSON which shows the histogram of characters used -in filenames in the remote:path specified. +### --vfs-cache-mode off -The data doesn't contain any identifying information but is useful for -the rclone developers when developing filename compression. +In this mode (the default) the cache will read directly from the remote and write +directly to the remote without caching anything on disk. +This will mean some operations are not possible -``` -rclone test histogram [remote:path] [flags] -``` + * Files can't be opened for both read AND write + * Files opened for write can't be seeked + * Existing files opened for write must have O_TRUNC set + * Files open for read with O_TRUNC will be opened write only + * Files open for write only will behave as if O_TRUNC was supplied + * Open modes O_APPEND, O_TRUNC are ignored + * If an upload fails it can't be retried -## Options +### --vfs-cache-mode minimal -``` - -h, --help help for histogram -``` +This is very similar to "off" except that files opened for read AND +write will be buffered to disk. This means that files opened for +write will be a lot more compatible, but uses the minimal disk space. +These operations are not possible -See the [global flags page](https://rclone.org/flags/) for global options not listed here. + * Files opened for write only can't be seeked + * Existing files opened for write must have O_TRUNC set + * Files opened for write only will ignore O_APPEND, O_TRUNC + * If an upload fails it can't be retried -# SEE ALSO +### --vfs-cache-mode writes -* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command +In this mode files opened for read only are still read directly from +the remote, write only and read/write files are buffered to disk +first. -# rclone test info +This mode should support all normal file system operations. -Discovers file name or other limitations for paths. +If an upload fails it will be retried at exponentially increasing +intervals up to 1 minute. -## Synopsis +### --vfs-cache-mode full -rclone info discovers what filenames and upload methods are possible -to write to the paths passed in and how long they can be. It can take some -time. It will write test files into the remote:path passed in. It outputs -a bit of go code for each one. +In this mode all reads and writes are buffered to and from disk. When +data is read from the remote this is buffered to disk as well. -**NB** this can create undeletable files and other hazards - use with care +In this mode the files in the cache will be sparse files and rclone +will keep track of which bits of the files it has downloaded. +So if an application only reads the starts of each file, then rclone +will only buffer the start of the file. These files will appear to be +their full size in the cache, but they will be sparse files with only +the data that has been downloaded present in them. -``` -rclone test info [remote:path]+ [flags] -``` +This mode should support all normal file system operations and is +otherwise identical to `--vfs-cache-mode` writes. -## Options +When reading a file rclone will read `--buffer-size` plus +`--vfs-read-ahead` bytes ahead. The `--buffer-size` is buffered in memory +whereas the `--vfs-read-ahead` is buffered on disk. -``` - --all Run all tests - --check-base32768 Check can store all possible base32768 characters - --check-control Check control characters - --check-length Check max filename length - --check-normalization Check UTF-8 Normalization - --check-streaming Check uploads with indeterminate file size - -h, --help help for info - --upload-wait Duration Wait after writing a file (default 0s) - --write-json string Write results to file -``` +When using this mode it is recommended that `--buffer-size` is not set +too large and `--vfs-read-ahead` is set large if required. +**IMPORTANT** not all file systems support sparse files. In particular +FAT/exFAT do not. Rclone will perform very badly if the cache +directory is on a filesystem which doesn't support sparse files and it +will log an ERROR message if one is detected. -See the [global flags page](https://rclone.org/flags/) for global options not listed here. +### Fingerprinting -# SEE ALSO +Various parts of the VFS use fingerprinting to see if a local file +copy has changed relative to a remote file. Fingerprints are made +from: -* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command +- size +- modification time +- hash -# rclone test makefile +where available on an object. -Make files with random contents of the size given +On some backends some of these attributes are slow to read (they take +an extra API call per object, or extra work per object). -``` -rclone test makefile []+ [flags] -``` +For example `hash` is slow with the `local` and `sftp` backends as +they have to read the entire file and hash it, and `modtime` is slow +with the `s3`, `swift`, `ftp` and `qinqstor` backends because they +need to do an extra API call to fetch it. -## Options +If you use the `--vfs-fast-fingerprint` flag then rclone will not +include the slow operations in the fingerprint. This makes the +fingerprinting less accurate but much faster and will improve the +opening time of cached files. -``` - --ascii Fill files with random ASCII printable bytes only - --chargen Fill files with a ASCII chargen pattern - -h, --help help for makefile - --pattern Fill files with a periodic pattern - --seed int Seed for the random number generator (0 for random) (default 1) - --sparse Make the files sparse (appear to be filled with ASCII 0x00) - --zero Fill files with ASCII 0x00 -``` +If you are running a vfs cache over `local`, `s3` or `swift` backends +then using this flag is recommended. +Note that if you change the value of this flag, the fingerprints of +the files in the cache may be invalidated and the files will need to +be downloaded again. -See the [global flags page](https://rclone.org/flags/) for global options not listed here. +## VFS Chunked Reading -# SEE ALSO +When rclone reads files from a remote it reads them in chunks. This +means that rather than requesting the whole file rclone reads the +chunk specified. This can reduce the used download quota for some +remotes by requesting only chunks from the remote that are actually +read, at the cost of an increased number of requests. -* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command +These flags control the chunking: -# rclone test makefiles + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128M) + --vfs-read-chunk-size-limit SizeSuffix Max chunk doubling size (default off) -Make a random file hierarchy in a directory +Rclone will start reading a chunk of size `--vfs-read-chunk-size`, +and then double the size for each read. When `--vfs-read-chunk-size-limit` is +specified, and greater than `--vfs-read-chunk-size`, the chunk size for each +open file will get doubled only until the specified value is reached. If the +value is "off", which is the default, the limit is disabled and the chunk size +will grow indefinitely. -``` -rclone test makefiles [flags] -``` +With `--vfs-read-chunk-size 100M` and `--vfs-read-chunk-size-limit 0` +the following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on. +When `--vfs-read-chunk-size-limit 500M` is specified, the result would be +0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on. -## Options +Setting `--vfs-read-chunk-size` to `0` or "off" disables chunked reading. -``` - --ascii Fill files with random ASCII printable bytes only - --chargen Fill files with a ASCII chargen pattern - --files int Number of files to create (default 1000) - --files-per-directory int Average number of files per directory (default 10) - -h, --help help for makefiles - --max-depth int Maximum depth of directory hierarchy (default 10) - --max-file-size SizeSuffix Maximum size of files to create (default 100) - --max-name-length int Maximum size of file names (default 12) - --min-file-size SizeSuffix Minimum size of file to create - --min-name-length int Minimum size of file names (default 4) - --pattern Fill files with a periodic pattern - --seed int Seed for the random number generator (0 for random) (default 1) - --sparse Make the files sparse (appear to be filled with ASCII 0x00) - --zero Fill files with ASCII 0x00 -``` +## VFS Performance +These flags may be used to enable/disable features of the VFS for +performance or other reasons. See also the [chunked reading](#vfs-chunked-reading) +feature. -See the [global flags page](https://rclone.org/flags/) for global options not listed here. +In particular S3 and Swift benefit hugely from the `--no-modtime` flag +(or use `--use-server-modtime` for a slightly different effect) as each +read of the modification time takes a transaction. -# SEE ALSO + --no-checksum Don't compare checksums on up/download. + --no-modtime Don't read/write the modification time (can speed things up). + --no-seek Don't allow seeking in files. + --read-only Only allow read-only access. -* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command +Sometimes rclone is delivered reads or writes out of order. Rather +than seeking rclone will wait a short time for the in sequence read or +write to come in. These flags only come into effect when not using an +on disk cache file. -# rclone test memory + --vfs-read-wait duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-write-wait duration Time to wait for in-sequence write before giving error (default 1s) -Load all the objects at remote:path into memory and report memory stats. +When using VFS write caching (`--vfs-cache-mode` with value writes or full), +the global flag `--transfers` can be set to adjust the number of parallel uploads of +modified files from the cache (the related global flag `--checkers` has no effect on the VFS). -``` -rclone test memory remote:path [flags] -``` + --transfers int Number of file transfers to run in parallel (default 4) -## Options +## VFS Case Sensitivity -``` - -h, --help help for memory -``` +Linux file systems are case-sensitive: two files can differ only +by case, and the exact case must be used when opening a file. +File systems in modern Windows are case-insensitive but case-preserving: +although existing files can be opened using any case, the exact case used +to create the file is preserved and available for programs to query. +It is not allowed for two files in the same directory to differ only by case. -See the [global flags page](https://rclone.org/flags/) for global options not listed here. +Usually file systems on macOS are case-insensitive. It is possible to make macOS +file systems case-sensitive but that is not the default. -# SEE ALSO +The `--vfs-case-insensitive` VFS flag controls how rclone handles these +two cases. If its value is "false", rclone passes file names to the remote +as-is. If the flag is "true" (or appears without a value on the +command line), rclone may perform a "fixup" as explained below. -* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command +The user may specify a file name to open/delete/rename/etc with a case +different than what is stored on the remote. If an argument refers +to an existing file with exactly the same name, then the case of the existing +file on the disk will be used. However, if a file name with exactly the same +name is not found but a name differing only by case exists, rclone will +transparently fixup the name. This fixup happens only when an existing file +is requested. Case sensitivity of file names created anew by rclone is +controlled by the underlying remote. -# rclone touch +Note that case sensitivity of the operating system running rclone (the target) +may differ from case sensitivity of a file system presented by rclone (the source). +The flag controls whether "fixup" is performed to satisfy the target. -Create new file or change file modification time. +If the flag is not provided on the command line, then its default value depends +on the operating system where rclone runs: "true" on Windows and macOS, "false" +otherwise. If the flag is provided without a value, then it is "true". -## Synopsis +## VFS Disk Options +This flag allows you to manually set the statistics about the filing system. +It can be useful when those statistics cannot be read correctly automatically. -Set the modification time on file(s) as specified by remote:path to -have the current time. + --vfs-disk-space-total-size Manually set the total disk space size (example: 256G, default: -1) -If remote:path does not exist then a zero sized file will be created, -unless `--no-create` or `--recursive` is provided. +## Alternate report of used bytes -If `--recursive` is used then recursively sets the modification -time on all existing files that is found under the path. Filters are supported, -and you can test with the `--dry-run` or the `--interactive`/`-i` flag. +Some backends, most notably S3, do not report the amount of bytes used. +If you need this information to be available when running `df` on the +filesystem, then pass the flag `--vfs-used-is-size` to rclone. +With this flag set, instead of relying on the backend to report this +information, rclone will scan the whole remote similar to `rclone size` +and compute the total used space itself. -If `--timestamp` is used then sets the modification time to that -time instead of the current time. Times may be specified as one of: +_WARNING._ Contrary to `rclone size`, this flag ignores filters so that the +result is accurate. However, this is very inefficient and may cost lots of API +calls resulting in extra charges. Use it as a last resort and only with caching. -- 'YYMMDD' - e.g. 17.10.30 -- 'YYYY-MM-DDTHH:MM:SS' - e.g. 2006-01-02T15:04:05 -- 'YYYY-MM-DDTHH:MM:SS.SSS' - e.g. 2006-01-02T15:04:05.123456789 +## Auth Proxy -Note that value of `--timestamp` is in UTC. If you want local time -then add the `--localtime` flag. +If you supply the parameter `--auth-proxy /path/to/program` then +rclone will use that program to generate backends on the fly which +then are used to authenticate incoming requests. This uses a simple +JSON based protocol with input on STDIN and output on STDOUT. + +**PLEASE NOTE:** `--auth-proxy` and `--authorized-keys` cannot be used +together, if `--auth-proxy` is set the authorized keys option will be +ignored. + +There is an example program +[bin/test_proxy.py](https://github.com/rclone/rclone/blob/master/test_proxy.py) +in the rclone source code. + +The program's job is to take a `user` and `pass` on the input and turn +those into the config for a backend on STDOUT in JSON format. This +config will have any default parameters for the backend added, but it +won't use configuration from environment variables or command line +options - it is the job of the proxy program to make a complete +config. + +This config generated must have this extra parameter +- `_root` - root to use for the backend +And it may have this parameter +- `_obscure` - comma separated strings for parameters to obscure + +If password authentication was used by the client, input to the proxy +process (on STDIN) would look similar to this: ``` -rclone touch remote:path [flags] +{ + "user": "me", + "pass": "mypassword" +} ``` -## Options +If public-key authentication was used by the client, input to the +proxy process (on STDIN) would look similar to this: ``` - -h, --help help for touch - --localtime Use localtime for timestamp, not UTC - -C, --no-create Do not create the file if it does not exist (implied with --recursive) - -R, --recursive Recursively touch all files - -t, --timestamp string Use specified time instead of the current time of day +{ + "user": "me", + "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDuwESFdAe14hVS6omeyX7edc...JQdf" +} ``` +And as an example return this on STDOUT -## Important Options +``` +{ + "type": "sftp", + "_root": "", + "_obscure": "pass", + "user": "me", + "pass": "mypassword", + "host": "sftp.example.com" +} +``` + +This would mean that an SFTP backend would be created on the fly for +the `user` and `pass`/`public_key` returned in the output to the host given. Note +that since `_obscure` is set to `pass`, rclone will obscure the `pass` +parameter before creating the backend (which is required for sftp +backends). + +The program can manipulate the supplied `user` in any way, for example +to make proxy to many different sftp backends, you could make the +`user` be `user@example.com` and then set the `host` to `example.com` +in the output and the user to `user`. For security you'd probably want +to restrict the `host` to a limited list. + +Note that an internal cache is keyed on `user` so only use that for +configuration, don't use `pass` or `public_key`. This also means that if a user's +password or public-key is changed the cache will need to expire (which takes 5 mins) +before it takes effect. + +This can be used to build general purpose proxies to any kind of +backend that rclone supports. -Important flags useful for most commands. ``` - -n, --dry-run Do a trial run with no permanent changes - -i, --interactive Enable interactive mode - -v, --verbose count Print lots more stuff (repeat for more) +rclone serve sftp remote:path [flags] +``` + +## Options + +``` + --addr string IPaddress:Port or :Port to bind server to (default "localhost:2022") + --auth-proxy string A program to use to create the backend from the auth + --authorized-keys string Authorized keys file (default "~/.ssh/authorized_keys") + --dir-cache-time Duration Time to cache directory entries for (default 5m0s) + --dir-perms FileMode Directory permissions (default 0777) + --file-perms FileMode File permissions (default 0666) + --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) + -h, --help help for sftp + --key stringArray SSH private host key file (Can be multi-valued, leave blank to auto generate) + --no-auth Allow connections with no authentication if set + --no-checksum Don't compare checksums on up/download + --no-modtime Don't read/write the modification time (can speed things up) + --no-seek Don't allow seeking in files + --pass string Password for authentication + --poll-interval Duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s) + --read-only Only allow read-only access + --stdio Run an sftp server on stdin/stdout + --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) + --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) + --user string User name for authentication + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-case-insensitive If a file name not found, find a case insensitive match + --vfs-disk-space-total-size SizeSuffix Specify the total space of disk (default off) + --vfs-fast-fingerprint Use fast (less accurate) fingerprints for change detection + --vfs-read-ahead SizeSuffix Extra read ahead over --buffer-size when using cache-mode full + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) + --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) + --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start + --vfs-used-is-size rclone size Use the rclone size algorithm for Used size + --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) + --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) ``` + ## Filter Options Flags for filtering directory listings. @@ -10440,6928 +10548,8172 @@ Flags for filtering directory listings. --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) ``` -## Listing Options +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -Flags for listing directories. +# SEE ALSO -``` - --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) - --fast-list Use recursive list if available; uses more memory but fewer transactions -``` - -See the [global flags page](https://rclone.org/flags/) for global options not listed here. - -# SEE ALSO - -* [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. +* [rclone serve](https://rclone.org/commands/rclone_serve/) - Serve a remote over a protocol. -# rclone tree +# rclone serve webdav -List the contents of the remote in a tree like fashion. +Serve remote:path over WebDAV. ## Synopsis +Run a basic WebDAV server to serve a remote over HTTP via the +WebDAV protocol. This can be viewed with a WebDAV client, through a web +browser, or you can make a remote of type WebDAV to read and write it. -rclone tree lists the contents of a remote in a similar way to the -unix tree command. +## WebDAV options -For example +### --etag-hash - $ rclone tree remote:path - / - ├── file1 - ├── file2 - ├── file3 - └── subdir - ├── file4 - └── file5 +This controls the ETag header. Without this flag the ETag will be +based on the ModTime and Size of the object. - 1 directories, 5 files +If this flag is set to "auto" then rclone will choose the first +supported hash on the backend or you can use a named hash such as +"MD5" or "SHA-1". Use the [hashsum](https://rclone.org/commands/rclone_hashsum/) command +to see the full list. -You can use any of the filtering options with the tree command (e.g. -`--include` and `--exclude`. You can also use `--fast-list`. +## Access WebDAV on Windows +WebDAV shared folder can be mapped as a drive on Windows, however the default settings prevent it. +Windows will fail to connect to the server using insecure Basic authentication. +It will not even display any login dialog. Windows requires SSL / HTTPS connection to be used with Basic. +If you try to connect via Add Network Location Wizard you will get the following error: +"The folder you entered does not appear to be valid. Please choose another". +However, you still can connect if you set the following registry key on a client machine: +HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters\BasicAuthLevel to 2. +The BasicAuthLevel can be set to the following values: + 0 - Basic authentication disabled + 1 - Basic authentication enabled for SSL connections only + 2 - Basic authentication enabled for SSL connections and for non-SSL connections +If required, increase the FileSizeLimitInBytes to a higher value. +Navigate to the Services interface, then restart the WebClient service. -The tree command has many options for controlling the listing which -are compatible with the tree command, for example you can include file -sizes with `--size`. Note that not all of them have -short options as they conflict with rclone's short options. +## Access Office applications on WebDAV +Navigate to following registry HKEY_CURRENT_USER\Software\Microsoft\Office\[14.0/15.0/16.0]\Common\Internet +Create a new DWORD BasicAuthLevel with value 2. + 0 - Basic authentication disabled + 1 - Basic authentication enabled for SSL connections only + 2 - Basic authentication enabled for SSL and for non-SSL connections -For a more interactive navigation of the remote see the -[ncdu](https://rclone.org/commands/rclone_ncdu/) command. +https://learn.microsoft.com/en-us/office/troubleshoot/powerpoint/office-opens-blank-from-sharepoint -``` -rclone tree remote:path [flags] -``` +## Server options -## Options +Use `--addr` to specify which IP address and port the server should +listen on, eg `--addr 1.2.3.4:8000` or `--addr :8080` to listen to all +IPs. By default it only listens on localhost. You can use port +:0 to let the OS choose an available port. -``` - -a, --all All files are listed (list . files too) - -d, --dirs-only List directories only - --dirsfirst List directories before files (-U disables) - --full-path Print the full path prefix for each file - -h, --help help for tree - --level int Descend only level directories deep - -D, --modtime Print the date of last modification. - --noindent Don't print indentation lines - --noreport Turn off file/directory count at end of tree listing - -o, --output string Output to file instead of stdout - -p, --protections Print the protections for each file. - -Q, --quote Quote filenames with double quotes. - -s, --size Print the size in bytes of each file. - --sort string Select sort: name,version,size,mtime,ctime - --sort-ctime Sort files by last status change time - -t, --sort-modtime Sort files by last modification time - -r, --sort-reverse Reverse the order of the sort - -U, --unsorted Leave files unsorted - --version Sort files alphanumerically by version -``` +If you set `--addr` to listen on a public or LAN accessible IP address +then using Authentication is advised - see the next section for info. +You can use a unix socket by setting the url to `unix:///path/to/socket` +or just by using an absolute path name. Note that unix sockets bypass the +authentication - this is expected to be done with file system permissions. -## Filter Options +`--addr` may be repeated to listen on multiple IPs/ports/sockets. -Flags for filtering directory listings. +`--server-read-timeout` and `--server-write-timeout` can be used to +control the timeouts on the server. Note that this is the total time +for a transfer. -``` - --delete-excluded Delete files on dest excluded from sync - --exclude stringArray Exclude files matching pattern - --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) - --exclude-if-present stringArray Exclude directories if filename is present - --files-from stringArray Read list of source-file names from file (use - to read from stdin) - --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) - -f, --filter stringArray Add a file filtering rule - --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) - --ignore-case Ignore case in filters (case insensitive) - --include stringArray Include files matching pattern - --include-from stringArray Read file include patterns from file (use - to read from stdin) - --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) - --max-depth int If set limits the recursion depth to this (default -1) - --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) - --metadata-exclude stringArray Exclude metadatas matching pattern - --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) - --metadata-filter stringArray Add a metadata filtering rule - --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) - --metadata-include stringArray Include metadatas matching pattern - --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) - --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) - --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) -``` +`--max-header-bytes` controls the maximum number of bytes the server will +accept in the HTTP header. -## Listing Options +`--baseurl` controls the URL prefix that rclone serves from. By default +rclone will serve from the root. If you used `--baseurl "/rclone"` then +rclone would serve from a URL starting with "/rclone/". This is +useful if you wish to proxy rclone serve. Rclone automatically +inserts leading and trailing "/" on `--baseurl`, so `--baseurl "rclone"`, +`--baseurl "/rclone"` and `--baseurl "/rclone/"` are all treated +identically. -Flags for listing directories. +### TLS (SSL) -``` - --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) - --fast-list Use recursive list if available; uses more memory but fewer transactions -``` +By default this will serve over http. If you want you can serve over +https. You will need to supply the `--cert` and `--key` flags. +If you wish to do client side certificate validation then you will need to +supply `--client-ca` also. -See the [global flags page](https://rclone.org/flags/) for global options not listed here. +`--cert` should be a either a PEM encoded certificate or a concatenation +of that with the CA certificate. `--key` should be the PEM encoded +private key and `--client-ca` should be the PEM encoded client +certificate authority certificate. -# SEE ALSO +--min-tls-version is minimum TLS version that is acceptable. Valid + values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default + "tls1.0"). -* [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. +### Template +`--template` allows a user to specify a custom markup template for HTTP +and WebDAV serve functions. The server exports the following markup +to be used within the template to server pages: -Copying single files --------------------- +| Parameter | Description | +| :---------- | :---------- | +| .Name | The full path of a file/directory. | +| .Title | Directory listing of .Name | +| .Sort | The current sort used. This is changeable via ?sort= parameter | +| | Sort Options: namedirfirst,name,size,time (default namedirfirst) | +| .Order | The current ordering used. This is changeable via ?order= parameter | +| | Order Options: asc,desc (default asc) | +| .Query | Currently unused. | +| .Breadcrumb | Allows for creating a relative navigation | +|-- .Link | The relative to the root link of the Text. | +|-- .Text | The Name of the directory. | +| .Entries | Information about a specific file/directory. | +|-- .URL | The 'url' of an entry. | +|-- .Leaf | Currently same as 'URL' but intended to be 'just' the name. | +|-- .IsDir | Boolean for if an entry is a directory or not. | +|-- .Size | Size in Bytes of the entry. | +|-- .ModTime | The UTC timestamp of an entry. | -rclone normally syncs or copies directories. However, if the source -remote points to a file, rclone will just copy that file. The -destination remote must point to a directory - rclone will give the -error `Failed to create file system for "remote:file": is a file not a -directory` if it isn't. +The server also makes the following functions available so that they can be used within the +template. These functions help extend the options for dynamic rendering of HTML. They can +be used to render HTML based on specific conditions. -For example, suppose you have a remote with a file in called -`test.jpg`, then you could copy just that file like this +| Function | Description | +| :---------- | :---------- | +| afterEpoch | Returns the time since the epoch for the given time. | +| contains | Checks whether a given substring is present or not in a given string. | +| hasPrefix | Checks whether the given string begins with the specified prefix. | +| hasSuffix | Checks whether the given string end with the specified suffix. | - rclone copy remote:test.jpg /tmp/download +### Authentication -The file `test.jpg` will be placed inside `/tmp/download`. +By default this will serve files without needing a login. -This is equivalent to specifying +You can either use an htpasswd file which can take lots of users, or +set a single username and password with the `--user` and `--pass` flags. - rclone copy --files-from /tmp/files remote: /tmp/download +If no static users are configured by either of the above methods, and client +certificates are required by the `--client-ca` flag passed to the server, the +client certificate common name will be considered as the username. -Where `/tmp/files` contains the single line +Use `--htpasswd /path/to/htpasswd` to provide an htpasswd file. This is +in standard apache format and supports MD5, SHA1 and BCrypt for basic +authentication. Bcrypt is recommended. - test.jpg +To create an htpasswd file: -It is recommended to use `copy` when copying individual files, not `sync`. -They have pretty much the same effect but `copy` will use a lot less -memory. + touch htpasswd + htpasswd -B htpasswd user + htpasswd -B htpasswd anotherUser -Syntax of remote paths ----------------------- +The password file can be updated while rclone is running. -The syntax of the paths passed to the rclone command are as follows. +Use `--realm` to set the authentication realm. -### /path/to/dir +Use `--salt` to change the password hashing salt from the default. +## VFS - Virtual File System -This refers to the local file system. +This command uses the VFS layer. This adapts the cloud storage objects +that rclone uses into something which looks much more like a disk +filing system. -On Windows `\` may be used instead of `/` in local paths **only**, -non local paths must use `/`. See [local filesystem](https://rclone.org/local/#paths-on-windows) -documentation for more about Windows-specific paths. +Cloud storage objects have lots of properties which aren't like disk +files - you can't extend them or write to the middle of them, so the +VFS layer has to deal with that. Because there is no one right way of +doing this there are various options explained below. -These paths needn't start with a leading `/` - if they don't then they -will be relative to the current directory. +The VFS layer also implements a directory cache - this caches info +about files and directories (but not the data) in memory. -### remote:path/to/dir +## VFS Directory Cache -This refers to a directory `path/to/dir` on `remote:` as defined in -the config file (configured with `rclone config`). +Using the `--dir-cache-time` flag, you can control how long a +directory should be considered up to date and not refreshed from the +backend. Changes made through the VFS will appear immediately or +invalidate the cache. -### remote:/path/to/dir + --dir-cache-time duration Time to cache directory entries for (default 5m0s) + --poll-interval duration Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable (default 1m0s) -On most backends this is refers to the same directory as -`remote:path/to/dir` and that format should be preferred. On a very -small number of remotes (FTP, SFTP, Dropbox for business) this will -refer to a different directory. On these, paths without a leading `/` -will refer to your "home" directory and paths with a leading `/` will -refer to the root. +However, changes made directly on the cloud storage by the web +interface or a different copy of rclone will only be picked up once +the directory cache expires if the backend configured does not support +polling for changes. If the backend supports polling, changes will be +picked up within the polling interval. -### :backend:path/to/dir +You can send a `SIGHUP` signal to rclone for it to flush all +directory caches, regardless of how old they are. Assuming only one +rclone instance is running, you can reset the cache like this: -This is an advanced form for creating remotes on the fly. `backend` -should be the name or prefix of a backend (the `type` in the config -file) and all the configuration for the backend should be provided on -the command line (or in environment variables). + kill -SIGHUP $(pidof rclone) -Here are some examples: +If you configure rclone with a [remote control](/rc) then you can use +rclone rc to flush the whole directory cache: - rclone lsd --http-url https://pub.rclone.org :http: + rclone rc vfs/forget -To list all the directories in the root of `https://pub.rclone.org/`. +Or individual files or directories: - rclone lsf --http-url https://example.com :http:path/to/dir + rclone rc vfs/forget file=path/to/file dir=path/to/dir -To list files and directories in `https://example.com/path/to/dir/` +## VFS File Buffering - rclone copy --http-url https://example.com :http:path/to/dir /tmp/dir +The `--buffer-size` flag determines the amount of memory, +that will be used to buffer data in advance. -To copy files and directories in `https://example.com/path/to/dir` to `/tmp/dir`. +Each open file will try to keep the specified amount of data in memory +at all times. The buffered data is bound to one open file and won't be +shared. - rclone copy --sftp-host example.com :sftp:path/to/dir /tmp/dir +This flag is a upper limit for the used memory per open file. The +buffer will only use memory for data that is downloaded but not not +yet read. If the buffer is empty, only a small amount of memory will +be used. -To copy files and directories from `example.com` in the relative -directory `path/to/dir` to `/tmp/dir` using sftp. +The maximum memory used by rclone for buffering can be up to +`--buffer-size * open files`. -### Connection strings {#connection-strings} +## VFS File Caching -The above examples can also be written using a connection string -syntax, so instead of providing the arguments as command line -parameters `--http-url https://pub.rclone.org` they are provided as -part of the remote specification as a kind of connection string. +These flags control the VFS file caching options. File caching is +necessary to make the VFS layer appear compatible with a normal file +system. It can be disabled at the cost of some compatibility. - rclone lsd ":http,url='https://pub.rclone.org':" - rclone lsf ":http,url='https://example.com':path/to/dir" - rclone copy ":http,url='https://example.com':path/to/dir" /tmp/dir - rclone copy :sftp,host=example.com:path/to/dir /tmp/dir +For example you'll need to enable VFS caching if you want to read and +write simultaneously to a file. See below for more details. -These can apply to modify existing remotes as well as create new -remotes with the on the fly syntax. This example is equivalent to -adding the `--drive-shared-with-me` parameter to the remote `gdrive:`. +Note that the VFS cache is separate from the cache backend and you may +find that you need one or the other or both. - rclone lsf "gdrive,shared_with_me:path/to/dir" + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) -The major advantage to using the connection string style syntax is -that it only applies to the remote, not to all the remotes of that -type of the command line. A common confusion is this attempt to copy a -file shared on google drive to the normal drive which **does not -work** because the `--drive-shared-with-me` flag applies to both the -source and the destination. +If run with `-vv` rclone will print the location of the file cache. The +files are stored in the user cache file area which is OS dependent but +can be controlled with `--cache-dir` or setting the appropriate +environment variable. - rclone copy --drive-shared-with-me gdrive:shared-file.txt gdrive: +The cache has 4 different modes selected by `--vfs-cache-mode`. +The higher the cache mode the more compatible rclone becomes at the +cost of using disk space. -However using the connection string syntax, this does work. +Note that files are written back to the remote only when they are +closed and if they haven't been accessed for `--vfs-write-back` +seconds. If rclone is quit or dies with files that haven't been +uploaded, these will be uploaded next time rclone is run with the same +flags. - rclone copy "gdrive,shared_with_me:shared-file.txt" gdrive: +If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note +that the cache may exceed these quotas for two reasons. Firstly +because it is only checked every `--vfs-cache-poll-interval`. Secondly +because open files cannot be evicted from the cache. When +`--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded, +rclone will attempt to evict the least accessed files from the cache +first. rclone will start with files that haven't been accessed for the +longest. This cache flushing strategy is efficient and more relevant +files are likely to remain cached. -Note that the connection string only affects the options of the immediate -backend. If for example gdriveCrypt is a crypt based on gdrive, then the -following command **will not work** as intended, because -`shared_with_me` is ignored by the crypt backend: +The `--vfs-cache-max-age` will evict files from the cache +after the set time since last access has passed. The default value of +1 hour will start evicting files from cache that haven't been accessed +for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 +and will wait for 1 more hour before evicting. Specify the time with +standard notation, s, m, h, d, w . - rclone copy "gdriveCrypt,shared_with_me:shared-file.txt" gdriveCrypt: +You **should not** run two copies of rclone using the same VFS cache +with the same or overlapping remotes if using `--vfs-cache-mode > off`. +This can potentially cause data corruption if you do. You can work +around this by giving each rclone its own cache hierarchy with +`--cache-dir`. You don't need to worry about this if the remotes in +use don't overlap. -The connection strings have the following syntax +### --vfs-cache-mode off - remote,parameter=value,parameter2=value2:path/to/dir - :backend,parameter=value,parameter2=value2:path/to/dir +In this mode (the default) the cache will read directly from the remote and write +directly to the remote without caching anything on disk. -If the `parameter` has a `:` or `,` then it must be placed in quotes `"` or -`'`, so +This will mean some operations are not possible - remote,parameter="colon:value",parameter2="comma,value":path/to/dir - :backend,parameter='colon:value',parameter2='comma,value':path/to/dir + * Files can't be opened for both read AND write + * Files opened for write can't be seeked + * Existing files opened for write must have O_TRUNC set + * Files open for read with O_TRUNC will be opened write only + * Files open for write only will behave as if O_TRUNC was supplied + * Open modes O_APPEND, O_TRUNC are ignored + * If an upload fails it can't be retried -If a quoted value needs to include that quote, then it should be -doubled, so +### --vfs-cache-mode minimal - remote,parameter="with""quote",parameter2='with''quote':path/to/dir +This is very similar to "off" except that files opened for read AND +write will be buffered to disk. This means that files opened for +write will be a lot more compatible, but uses the minimal disk space. -This will make `parameter` be `with"quote` and `parameter2` be -`with'quote`. +These operations are not possible -If you leave off the `=parameter` then rclone will substitute `=true` -which works very well with flags. For example, to use s3 configured in -the environment you could use: + * Files opened for write only can't be seeked + * Existing files opened for write must have O_TRUNC set + * Files opened for write only will ignore O_APPEND, O_TRUNC + * If an upload fails it can't be retried - rclone lsd :s3,env_auth: +### --vfs-cache-mode writes -Which is equivalent to +In this mode files opened for read only are still read directly from +the remote, write only and read/write files are buffered to disk +first. - rclone lsd :s3,env_auth=true: +This mode should support all normal file system operations. -Note that on the command line you might need to surround these -connection strings with `"` or `'` to stop the shell interpreting any -special characters within them. +If an upload fails it will be retried at exponentially increasing +intervals up to 1 minute. -If you are a shell master then you'll know which strings are OK and -which aren't, but if you aren't sure then enclose them in `"` and use -`'` as the inside quote. This syntax works on all OSes. +### --vfs-cache-mode full - rclone copy ":http,url='https://example.com':path/to/dir" /tmp/dir +In this mode all reads and writes are buffered to and from disk. When +data is read from the remote this is buffered to disk as well. -On Linux/macOS some characters are still interpreted inside `"` -strings in the shell (notably `\` and `$` and `"`) so if your strings -contain those you can swap the roles of `"` and `'` thus. (This syntax -does not work on Windows.) +In this mode the files in the cache will be sparse files and rclone +will keep track of which bits of the files it has downloaded. - rclone copy ':http,url="https://example.com":path/to/dir' /tmp/dir +So if an application only reads the starts of each file, then rclone +will only buffer the start of the file. These files will appear to be +their full size in the cache, but they will be sparse files with only +the data that has been downloaded present in them. -#### Connection strings, config and logging +This mode should support all normal file system operations and is +otherwise identical to `--vfs-cache-mode` writes. -If you supply extra configuration to a backend by command line flag, -environment variable or connection string then rclone will add a -suffix based on the hash of the config to the name of the remote, eg +When reading a file rclone will read `--buffer-size` plus +`--vfs-read-ahead` bytes ahead. The `--buffer-size` is buffered in memory +whereas the `--vfs-read-ahead` is buffered on disk. - rclone -vv lsf --s3-chunk-size 20M s3: +When using this mode it is recommended that `--buffer-size` is not set +too large and `--vfs-read-ahead` is set large if required. -Has the log message +**IMPORTANT** not all file systems support sparse files. In particular +FAT/exFAT do not. Rclone will perform very badly if the cache +directory is on a filesystem which doesn't support sparse files and it +will log an ERROR message if one is detected. - DEBUG : s3: detected overridden config - adding "{Srj1p}" suffix to name +### Fingerprinting -This is so rclone can tell the modified remote apart from the -unmodified remote when caching the backends. +Various parts of the VFS use fingerprinting to see if a local file +copy has changed relative to a remote file. Fingerprints are made +from: -This should only be noticeable in the logs. +- size +- modification time +- hash -This means that on the fly backends such as +where available on an object. - rclone -vv lsf :s3,env_auth: +On some backends some of these attributes are slow to read (they take +an extra API call per object, or extra work per object). -Will get their own names +For example `hash` is slow with the `local` and `sftp` backends as +they have to read the entire file and hash it, and `modtime` is slow +with the `s3`, `swift`, `ftp` and `qinqstor` backends because they +need to do an extra API call to fetch it. - DEBUG : :s3: detected overridden config - adding "{YTu53}" suffix to name +If you use the `--vfs-fast-fingerprint` flag then rclone will not +include the slow operations in the fingerprint. This makes the +fingerprinting less accurate but much faster and will improve the +opening time of cached files. -### Valid remote names +If you are running a vfs cache over `local`, `s3` or `swift` backends +then using this flag is recommended. -Remote names are case sensitive, and must adhere to the following rules: - - May contain number, letter, `_`, `-`, `.`, `+`, `@` and space. - - May not start with `-` or space. - - May not end with space. +Note that if you change the value of this flag, the fingerprints of +the files in the cache may be invalidated and the files will need to +be downloaded again. -Starting with rclone version 1.61, any Unicode numbers and letters are allowed, -while in older versions it was limited to plain ASCII (0-9, A-Z, a-z). If you use -the same rclone configuration from different shells, which may be configured with -different character encoding, you must be cautious to use characters that are -possible to write in all of them. This is mostly a problem on Windows, where -the console traditionally uses a non-Unicode character set - defined -by the so-called "code page". +## VFS Chunked Reading -Do not use single character names on Windows as it creates ambiguity with Windows -drives' names, e.g.: remote called `C` is indistinguishable from `C` drive. Rclone -will always assume that single letter name refers to a drive. +When rclone reads files from a remote it reads them in chunks. This +means that rather than requesting the whole file rclone reads the +chunk specified. This can reduce the used download quota for some +remotes by requesting only chunks from the remote that are actually +read, at the cost of an increased number of requests. -Quoting and the shell ---------------------- +These flags control the chunking: -When you are typing commands to your computer you are using something -called the command line shell. This interprets various characters in -an OS specific way. + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128M) + --vfs-read-chunk-size-limit SizeSuffix Max chunk doubling size (default off) -Here are some gotchas which may help users unfamiliar with the shell rules +Rclone will start reading a chunk of size `--vfs-read-chunk-size`, +and then double the size for each read. When `--vfs-read-chunk-size-limit` is +specified, and greater than `--vfs-read-chunk-size`, the chunk size for each +open file will get doubled only until the specified value is reached. If the +value is "off", which is the default, the limit is disabled and the chunk size +will grow indefinitely. -### Linux / OSX ### +With `--vfs-read-chunk-size 100M` and `--vfs-read-chunk-size-limit 0` +the following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on. +When `--vfs-read-chunk-size-limit 500M` is specified, the result would be +0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on. -If your names have spaces or shell metacharacters (e.g. `*`, `?`, `$`, -`'`, `"`, etc.) then you must quote them. Use single quotes `'` by default. +Setting `--vfs-read-chunk-size` to `0` or "off" disables chunked reading. - rclone copy 'Important files?' remote:backup +## VFS Performance -If you want to send a `'` you will need to use `"`, e.g. +These flags may be used to enable/disable features of the VFS for +performance or other reasons. See also the [chunked reading](#vfs-chunked-reading) +feature. - rclone copy "O'Reilly Reviews" remote:backup +In particular S3 and Swift benefit hugely from the `--no-modtime` flag +(or use `--use-server-modtime` for a slightly different effect) as each +read of the modification time takes a transaction. -The rules for quoting metacharacters are complicated and if you want -the full details you'll have to consult the manual page for your -shell. + --no-checksum Don't compare checksums on up/download. + --no-modtime Don't read/write the modification time (can speed things up). + --no-seek Don't allow seeking in files. + --read-only Only allow read-only access. -### Windows ### +Sometimes rclone is delivered reads or writes out of order. Rather +than seeking rclone will wait a short time for the in sequence read or +write to come in. These flags only come into effect when not using an +on disk cache file. -If your names have spaces in you need to put them in `"`, e.g. + --vfs-read-wait duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-write-wait duration Time to wait for in-sequence write before giving error (default 1s) - rclone copy "E:\folder name\folder name\folder name" remote:backup +When using VFS write caching (`--vfs-cache-mode` with value writes or full), +the global flag `--transfers` can be set to adjust the number of parallel uploads of +modified files from the cache (the related global flag `--checkers` has no effect on the VFS). -If you are using the root directory on its own then don't quote it -(see [#464](https://github.com/rclone/rclone/issues/464) for why), e.g. + --transfers int Number of file transfers to run in parallel (default 4) - rclone copy E:\ remote:backup +## VFS Case Sensitivity -Copying files or directories with `:` in the names --------------------------------------------------- +Linux file systems are case-sensitive: two files can differ only +by case, and the exact case must be used when opening a file. -rclone uses `:` to mark a remote name. This is, however, a valid -filename component in non-Windows OSes. The remote name parser will -only search for a `:` up to the first `/` so if you need to act on a -file or directory like this then use the full path starting with a -`/`, or use `./` as a current directory prefix. +File systems in modern Windows are case-insensitive but case-preserving: +although existing files can be opened using any case, the exact case used +to create the file is preserved and available for programs to query. +It is not allowed for two files in the same directory to differ only by case. -So to sync a directory called `sync:me` to a remote called `remote:` use +Usually file systems on macOS are case-insensitive. It is possible to make macOS +file systems case-sensitive but that is not the default. - rclone sync --interactive ./sync:me remote:path +The `--vfs-case-insensitive` VFS flag controls how rclone handles these +two cases. If its value is "false", rclone passes file names to the remote +as-is. If the flag is "true" (or appears without a value on the +command line), rclone may perform a "fixup" as explained below. -or +The user may specify a file name to open/delete/rename/etc with a case +different than what is stored on the remote. If an argument refers +to an existing file with exactly the same name, then the case of the existing +file on the disk will be used. However, if a file name with exactly the same +name is not found but a name differing only by case exists, rclone will +transparently fixup the name. This fixup happens only when an existing file +is requested. Case sensitivity of file names created anew by rclone is +controlled by the underlying remote. - rclone sync --interactive /full/path/to/sync:me remote:path +Note that case sensitivity of the operating system running rclone (the target) +may differ from case sensitivity of a file system presented by rclone (the source). +The flag controls whether "fixup" is performed to satisfy the target. -Server Side Copy ----------------- +If the flag is not provided on the command line, then its default value depends +on the operating system where rclone runs: "true" on Windows and macOS, "false" +otherwise. If the flag is provided without a value, then it is "true". -Most remotes (but not all - see [the -overview](https://rclone.org/overview/#optional-features)) support server-side copy. +## VFS Disk Options -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. +This flag allows you to manually set the statistics about the filing system. +It can be useful when those statistics cannot be read correctly automatically. -Eg + --vfs-disk-space-total-size Manually set the total disk space size (example: 256G, default: -1) - rclone copy s3:oldbucket s3:newbucket +## Alternate report of used bytes -Will copy the contents of `oldbucket` to `newbucket` without -downloading and re-uploading. +Some backends, most notably S3, do not report the amount of bytes used. +If you need this information to be available when running `df` on the +filesystem, then pass the flag `--vfs-used-is-size` to rclone. +With this flag set, instead of relying on the backend to report this +information, rclone will scan the whole remote similar to `rclone size` +and compute the total used space itself. -Remotes which don't support server-side copy **will** download and -re-upload in this case. +_WARNING._ Contrary to `rclone size`, this flag ignores filters so that the +result is accurate. However, this is very inefficient and may cost lots of API +calls resulting in extra charges. Use it as a last resort and only with caching. -Server side copies are used with `sync` and `copy` and will be -identified in the log when using the `-v` flag. The `move` command -may also use them if remote doesn't support server-side move directly. -This is done by issuing a server-side copy then a delete which is much -quicker than a download and re-upload. +## Auth Proxy -Server side copies will only be attempted if the remote names are the -same. +If you supply the parameter `--auth-proxy /path/to/program` then +rclone will use that program to generate backends on the fly which +then are used to authenticate incoming requests. This uses a simple +JSON based protocol with input on STDIN and output on STDOUT. -This can be used when scripting to make aged backups efficiently, e.g. +**PLEASE NOTE:** `--auth-proxy` and `--authorized-keys` cannot be used +together, if `--auth-proxy` is set the authorized keys option will be +ignored. - rclone sync --interactive remote:current-backup remote:previous-backup - rclone sync --interactive /path/to/files remote:current-backup +There is an example program +[bin/test_proxy.py](https://github.com/rclone/rclone/blob/master/test_proxy.py) +in the rclone source code. -## Metadata support {#metadata} +The program's job is to take a `user` and `pass` on the input and turn +those into the config for a backend on STDOUT in JSON format. This +config will have any default parameters for the backend added, but it +won't use configuration from environment variables or command line +options - it is the job of the proxy program to make a complete +config. -Metadata is data about a file which isn't the contents of the file. -Normally rclone only preserves the modification time and the content -(MIME) type where possible. +This config generated must have this extra parameter +- `_root` - root to use for the backend -Rclone supports preserving all the available metadata on files (not -directories) when using the `--metadata` or `-M` flag. +And it may have this parameter +- `_obscure` - comma separated strings for parameters to obscure -Exactly what metadata is supported and what that support means depends -on the backend. Backends that support metadata have a metadata section -in their docs and are listed in the [features table](https://rclone.org/overview/#features) -(Eg [local](https://rclone.org/local/#metadata), [s3](/s3/#metadata)) +If password authentication was used by the client, input to the proxy +process (on STDIN) would look similar to this: -Rclone only supports a one-time sync of metadata. This means that -metadata will be synced from the source object to the destination -object only when the source object has changed and needs to be -re-uploaded. If the metadata subsequently changes on the source object -without changing the object itself then it won't be synced to the -destination object. This is in line with the way rclone syncs -`Content-Type` without the `--metadata` flag. +``` +{ + "user": "me", + "pass": "mypassword" +} +``` -Using `--metadata` when syncing from local to local will preserve file -attributes such as file mode, owner, extended attributes (not -Windows). +If public-key authentication was used by the client, input to the +proxy process (on STDIN) would look similar to this: -Note that arbitrary metadata may be added to objects using the -`--metadata-set key=value` flag when the object is first uploaded. -This flag can be repeated as many times as necessary. +``` +{ + "user": "me", + "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDuwESFdAe14hVS6omeyX7edc...JQdf" +} +``` -### Types of metadata +And as an example return this on STDOUT -Metadata is divided into two type. System metadata and User metadata. +``` +{ + "type": "sftp", + "_root": "", + "_obscure": "pass", + "user": "me", + "pass": "mypassword", + "host": "sftp.example.com" +} +``` -Metadata which the backend uses itself is called system metadata. For -example on the local backend the system metadata `uid` will store the -user ID of the file when used on a unix based platform. +This would mean that an SFTP backend would be created on the fly for +the `user` and `pass`/`public_key` returned in the output to the host given. Note +that since `_obscure` is set to `pass`, rclone will obscure the `pass` +parameter before creating the backend (which is required for sftp +backends). -Arbitrary metadata is called user metadata and this can be set however -is desired. +The program can manipulate the supplied `user` in any way, for example +to make proxy to many different sftp backends, you could make the +`user` be `user@example.com` and then set the `host` to `example.com` +in the output and the user to `user`. For security you'd probably want +to restrict the `host` to a limited list. -When objects are copied from backend to backend, they will attempt to -interpret system metadata if it is supplied. Metadata may change from -being user metadata to system metadata as objects are copied between -different backends. For example copying an object from s3 sets the -`content-type` metadata. In a backend which understands this (like -`azureblob`) this will become the Content-Type of the object. In a -backend which doesn't understand this (like the `local` backend) this -will become user metadata. However should the local object be copied -back to s3, the Content-Type will be set correctly. +Note that an internal cache is keyed on `user` so only use that for +configuration, don't use `pass` or `public_key`. This also means that if a user's +password or public-key is changed the cache will need to expire (which takes 5 mins) +before it takes effect. -### Metadata framework +This can be used to build general purpose proxies to any kind of +backend that rclone supports. -Rclone implements a metadata framework which can read metadata from an -object and write it to the object when (and only when) it is being -uploaded. -This metadata is stored as a dictionary with string keys and string -values. +``` +rclone serve webdav remote:path [flags] +``` -There are some limits on the names of the keys (these may be clarified -further in the future). +## Options -- must be lower case -- may be `a-z` `0-9` containing `.` `-` or `_` -- length is backend dependent +``` + --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) + --allow-origin string Origin which cross-domain request (CORS) can be executed from + --auth-proxy string A program to use to create the backend from the auth + --baseurl string Prefix for URLs - leave blank for root + --cert string TLS PEM key (concatenation of certificate and CA certificate) + --client-ca string Client certificate authority to verify clients with + --dir-cache-time Duration Time to cache directory entries for (default 5m0s) + --dir-perms FileMode Directory permissions (default 0777) + --disable-dir-list Disable HTML directory list on GET request for a directory + --etag-hash string Which hash to use for the ETag, or auto or blank for off + --file-perms FileMode File permissions (default 0666) + --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) + -h, --help help for webdav + --htpasswd string A htpasswd file - if not provided no authentication is done + --key string TLS PEM Private key + --max-header-bytes int Maximum size of request header (default 4096) + --min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") + --no-checksum Don't compare checksums on up/download + --no-modtime Don't read/write the modification time (can speed things up) + --no-seek Don't allow seeking in files + --pass string Password for authentication + --poll-interval Duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s) + --read-only Only allow read-only access + --realm string Realm for authentication + --salt string Password hashing salt (default "dlPL2MqE") + --server-read-timeout Duration Timeout for server reading data (default 1h0m0s) + --server-write-timeout Duration Timeout for server writing data (default 1h0m0s) + --template string User-specified template + --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) + --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) + --user string User name for authentication + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-case-insensitive If a file name not found, find a case insensitive match + --vfs-disk-space-total-size SizeSuffix Specify the total space of disk (default off) + --vfs-fast-fingerprint Use fast (less accurate) fingerprints for change detection + --vfs-read-ahead SizeSuffix Extra read ahead over --buffer-size when using cache-mode full + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) + --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) + --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start + --vfs-used-is-size rclone size Use the rclone size algorithm for Used size + --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) + --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) +``` -Each backend can provide system metadata that it understands. Some -backends can also store arbitrary user metadata. -Where possible the key names are standardized, so, for example, it is -possible to copy object metadata from s3 to azureblob for example and -metadata will be translated appropriately. +## Filter Options -Some backends have limits on the size of the metadata and rclone will -give errors on upload if they are exceeded. +Flags for filtering directory listings. -### Metadata preservation +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` -The goal of the implementation is to +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -1. Preserve metadata if at all possible -2. Interpret metadata if at all possible +# SEE ALSO -The consequences of 1 is that you can copy an S3 object to a local -disk then back to S3 losslessly. Likewise you can copy a local file -with file attributes and xattrs from local disk to s3 and back again -losslessly. +* [rclone serve](https://rclone.org/commands/rclone_serve/) - Serve a remote over a protocol. -The consequence of 2 is that you can copy an S3 object with metadata -to Azureblob (say) and have the metadata appear on the Azureblob -object also. +# rclone settier -### Standard system metadata +Changes storage class/tier of objects in remote. -Here is a table of standard system metadata which, if appropriate, a -backend may implement. +## Synopsis -| key | description | example | -|---------------------|-------------|---------| -| mode | File type and mode: octal, unix style | 0100664 | -| uid | User ID of owner: decimal number | 500 | -| gid | Group ID of owner: decimal number | 500 | -| rdev | Device ID (if special file) => hexadecimal | 0 | -| atime | Time of last access: RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | -| mtime | Time of last modification: RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | -| btime | Time of file creation (birth): RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | -| cache-control | Cache-Control header | no-cache | -| content-disposition | Content-Disposition header | inline | -| content-encoding | Content-Encoding header | gzip | -| content-language | Content-Language header | en-US | -| content-type | Content-Type header | text/plain | -The metadata keys `mtime` and `content-type` will take precedence if -supplied in the metadata over reading the `Content-Type` or -modification time of the source object. +rclone settier changes storage tier or class at remote if supported. +Few cloud storage services provides different storage classes on objects, +for example AWS S3 and Glacier, Azure Blob storage - Hot, Cool and Archive, +Google Cloud Storage, Regional Storage, Nearline, Coldline etc. -Hashes are not included in system metadata as there is a well defined -way of reading those already. +Note that, certain tier changes make objects not available to access immediately. +For example tiering to archive in azure blob storage makes objects in frozen state, +user can restore by setting tier to Hot/Cool, similarly S3 to Glacier makes object +inaccessible.true -Options -------- +You can use it to tier single object -Rclone has a number of options to control its behaviour. + rclone settier Cool remote:path/file -Options that take parameters can have the values passed in two ways, -`--option=value` or `--option value`. However boolean (true/false) -options behave slightly differently to the other options in that -`--boolean` sets the option to `true` and the absence of the flag sets -it to `false`. It is also possible to specify `--boolean=false` or -`--boolean=true`. Note that `--boolean false` is not valid - this is -parsed as `--boolean` and the `false` is parsed as an extra command -line argument for rclone. +Or use rclone filters to set tier on only specific files -### Time or duration options {#time-option} + rclone --include "*.txt" settier Hot remote:path/dir -TIME or DURATION options can be specified as a duration string or a -time string. +Or just provide remote directory and all files in directory will be tiered -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". Default units are seconds or the following -abbreviations are valid: + rclone settier tier remote:path/dir - * `ms` - Milliseconds - * `s` - Seconds - * `m` - Minutes - * `h` - Hours - * `d` - Days - * `w` - Weeks - * `M` - Months - * `y` - Years -These can also be specified as an absolute time in the following -formats: +``` +rclone settier tier remote:path [flags] +``` -- RFC3339 - e.g. `2006-01-02T15:04:05Z` or `2006-01-02T15:04:05+07:00` -- ISO8601 Date and time, local timezone - `2006-01-02T15:04:05` -- ISO8601 Date and time, local timezone - `2006-01-02 15:04:05` -- ISO8601 Date - `2006-01-02` (YYYY-MM-DD) +## Options -### Size options {#size-option} +``` + -h, --help help for settier +``` -Options which use SIZE use KiB (multiples of 1024 bytes) by default. -However, a suffix of `B` for Byte, `K` for KiB, `M` for MiB, -`G` for GiB, `T` for TiB and `P` for PiB may be used. These are -the binary units, e.g. 1, 2\*\*10, 2\*\*20, 2\*\*30 respectively. -### --backup-dir=DIR ### +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -When using `sync`, `copy` or `move` any files which would have been -overwritten or deleted are moved in their original hierarchy into this -directory. +# SEE ALSO -If `--suffix` is set, then the moved files will have the suffix added -to them. If there is a file with the same path (after the suffix has -been added) in DIR, then it will be overwritten. +* [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. -The remote in use must support server-side move or copy and you must -use the same remote as the destination of the sync. The backup -directory must not overlap the destination directory without it being -excluded by a filter rule. +# rclone test -For example +Run a test command - rclone sync --interactive /path/to/local remote:current --backup-dir remote:old +## Synopsis -will sync `/path/to/local` to `remote:current`, but for any files -which would have been updated or deleted will be stored in -`remote:old`. +Rclone test is used to run test commands. -If running rclone from a script you might want to use today's date as -the directory name passed to `--backup-dir` to store the old files, or -you might want to pass `--suffix` with today's date. +Select which test command you want with the subcommand, eg -See `--compare-dest` and `--copy-dest`. + rclone test memory remote: -### --bind string ### +Each subcommand has its own options which you can see in their help. -Local address to bind to for outgoing connections. This can be an -IPv4 address (1.2.3.4), an IPv6 address (1234::789A) or host name. If -the host name doesn't resolve or resolves to more than one IP address -it will give an error. +**NB** Be careful running these commands, they may do strange things +so reading their documentation first is recommended. -You can use `--bind 0.0.0.0` to force rclone to use IPv4 addresses and -`--bind ::0` to force rclone to use IPv6 addresses. -### --bwlimit=BANDWIDTH_SPEC ### +## Options -This option controls the bandwidth limit. For example +``` + -h, --help help for test +``` - --bwlimit 10M -would mean limit the upload and download bandwidth to 10 MiB/s. -**NB** this is **bytes** per second not **bits** per second. To use a -single limit, specify the desired bandwidth in KiB/s, or use a -suffix B|K|M|G|T|P. The default is `0` which means to not limit bandwidth. +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -The upload and download bandwidth can be specified separately, as -`--bwlimit UP:DOWN`, so +# SEE ALSO - --bwlimit 10M:100k +* [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. +* [rclone test changenotify](https://rclone.org/commands/rclone_test_changenotify/) - Log any change notify requests for the remote passed in. +* [rclone test histogram](https://rclone.org/commands/rclone_test_histogram/) - Makes a histogram of file name characters. +* [rclone test info](https://rclone.org/commands/rclone_test_info/) - Discovers file name or other limitations for paths. +* [rclone test makefile](https://rclone.org/commands/rclone_test_makefile/) - Make files with random contents of the size given +* [rclone test makefiles](https://rclone.org/commands/rclone_test_makefiles/) - Make a random file hierarchy in a directory +* [rclone test memory](https://rclone.org/commands/rclone_test_memory/) - Load all the objects at remote:path into memory and report memory stats. -would mean limit the upload bandwidth to 10 MiB/s and the download -bandwidth to 100 KiB/s. Either limit can be "off" meaning no limit, so -to just limit the upload bandwidth you would use +# rclone test changenotify - --bwlimit 10M:off +Log any change notify requests for the remote passed in. -this would limit the upload bandwidth to 10 MiB/s but the download -bandwidth would be unlimited. +``` +rclone test changenotify remote: [flags] +``` -When specified as above the bandwidth limits last for the duration of -run of the rclone binary. +## Options -It is also possible to specify a "timetable" of limits, which will -cause certain limits to be applied at certain times. To specify a -timetable, format your entries as `WEEKDAY-HH:MM,BANDWIDTH -WEEKDAY-HH:MM,BANDWIDTH...` where: `WEEKDAY` is optional element. +``` + -h, --help help for changenotify + --poll-interval Duration Time to wait between polling for changes (default 10s) +``` -- `BANDWIDTH` can be a single number, e.g.`100k` or a pair of numbers -for upload:download, e.g.`10M:1M`. -- `WEEKDAY` can be written as the whole word or only using the first 3 - characters. It is optional. -- `HH:MM` is an hour from 00:00 to 23:59. -An example of a typical timetable to avoid link saturation during daytime -working hours could be: +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -`--bwlimit "08:00,512k 12:00,10M 13:00,512k 18:00,30M 23:00,off"` +# SEE ALSO -In this example, the transfer bandwidth will be set to 512 KiB/s -at 8am every day. At noon, it will rise to 10 MiB/s, and drop back -to 512 KiB/sec at 1pm. At 6pm, the bandwidth limit will be set to -30 MiB/s, and at 11pm it will be completely disabled (full speed). -Anything between 11pm and 8am will remain unlimited. +* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command -An example of timetable with `WEEKDAY` could be: +# rclone test histogram -`--bwlimit "Mon-00:00,512 Fri-23:59,10M Sat-10:00,1M Sun-20:00,off"` +Makes a histogram of file name characters. -It means that, the transfer bandwidth will be set to 512 KiB/s on -Monday. It will rise to 10 MiB/s before the end of Friday. At 10:00 -on Saturday it will be set to 1 MiB/s. From 20:00 on Sunday it will -be unlimited. +## Synopsis -Timeslots without `WEEKDAY` are extended to the whole week. So this -example: +This command outputs JSON which shows the histogram of characters used +in filenames in the remote:path specified. -`--bwlimit "Mon-00:00,512 12:00,1M Sun-20:00,off"` +The data doesn't contain any identifying information but is useful for +the rclone developers when developing filename compression. -Is equivalent to this: -`--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"` +``` +rclone test histogram [remote:path] [flags] +``` -Bandwidth limit apply to the data transfer for all backends. For most -backends the directory listing bandwidth is also included (exceptions -being the non HTTP backends, `ftp`, `sftp` and `storj`). +## Options -Note that the units are **Byte/s**, not **bit/s**. Typically -connections are measured in bit/s - to convert divide by 8. For -example, let's say you have a 10 Mbit/s connection and you wish rclone -to use half of it - 5 Mbit/s. This is 5/8 = 0.625 MiB/s so you would -use a `--bwlimit 0.625M` parameter for rclone. +``` + -h, --help help for histogram +``` -On Unix systems (Linux, macOS, …) the bandwidth limiter can be toggled by -sending a `SIGUSR2` signal to rclone. This allows to remove the limitations -of a long running rclone transfer and to restore it back to the value specified -with `--bwlimit` quickly when needed. Assuming there is only one rclone instance -running, you can toggle the limiter like this: - kill -SIGUSR2 $(pidof rclone) +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -If you configure rclone with a [remote control](/rc) then you can use -change the bwlimit dynamically: +# SEE ALSO - rclone rc core/bwlimit rate=1M +* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command -### --bwlimit-file=BANDWIDTH_SPEC ### +# rclone test info -This option controls per file bandwidth limit. For the options see the -`--bwlimit` flag. +Discovers file name or other limitations for paths. -For example use this to allow no transfers to be faster than 1 MiB/s +## Synopsis - --bwlimit-file 1M +rclone info discovers what filenames and upload methods are possible +to write to the paths passed in and how long they can be. It can take some +time. It will write test files into the remote:path passed in. It outputs +a bit of go code for each one. -This can be used in conjunction with `--bwlimit`. +**NB** this can create undeletable files and other hazards - use with care -Note that if a schedule is provided the file will use the schedule in -effect at the start of the transfer. -### --buffer-size=SIZE ### +``` +rclone test info [remote:path]+ [flags] +``` -Use this sized buffer to speed up file transfers. Each `--transfer` -will use this much memory for buffering. +## Options -When using `mount` or `cmount` each open file descriptor will use this much -memory for buffering. -See the [mount](https://rclone.org/commands/rclone_mount/#file-buffering) documentation for more details. +``` + --all Run all tests + --check-base32768 Check can store all possible base32768 characters + --check-control Check control characters + --check-length Check max filename length + --check-normalization Check UTF-8 Normalization + --check-streaming Check uploads with indeterminate file size + -h, --help help for info + --upload-wait Duration Wait after writing a file (default 0s) + --write-json string Write results to file +``` -Set to `0` to disable the buffering for the minimum memory usage. -Note that the memory allocation of the buffers is influenced by the -[--use-mmap](#use-mmap) flag. +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -### --cache-dir=DIR ### +# SEE ALSO -Specify the directory rclone will use for caching, to override -the default. +* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command -Default value is depending on operating system: -- Windows `%LocalAppData%\rclone`, if `LocalAppData` is defined. -- macOS `$HOME/Library/Caches/rclone` if `HOME` is defined. -- Unix `$XDG_CACHE_HOME/rclone` if `XDG_CACHE_HOME` is defined, else `$HOME/.cache/rclone` if `HOME` is defined. -- Fallback (on all OS) to `$TMPDIR/rclone`, where `TMPDIR` is the value from [--temp-dir](#temp-dir-dir). +# rclone test makefile -You can use the [config paths](https://rclone.org/commands/rclone_config_paths/) -command to see the current value. +Make files with random contents of the size given -Cache directory is heavily used by the [VFS File Caching](https://rclone.org/commands/rclone_mount/#vfs-file-caching) -mount feature, but also by [serve](https://rclone.org/commands/rclone_serve/), [GUI](/gui) and other parts of rclone. +``` +rclone test makefile []+ [flags] +``` -### --check-first ### +## Options -If this flag is set then in a `sync`, `copy` or `move`, rclone will do -all the checks to see whether files need to be transferred before -doing any of the transfers. Normally rclone would start running -transfers as soon as possible. +``` + --ascii Fill files with random ASCII printable bytes only + --chargen Fill files with a ASCII chargen pattern + -h, --help help for makefile + --pattern Fill files with a periodic pattern + --seed int Seed for the random number generator (0 for random) (default 1) + --sparse Make the files sparse (appear to be filled with ASCII 0x00) + --zero Fill files with ASCII 0x00 +``` -This flag can be useful on IO limited systems where transfers -interfere with checking. -It can also be useful to ensure perfect ordering when using -`--order-by`. +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -If both `--check-first` and `--order-by` are set when doing `rclone move` -then rclone will use the transfer thread to delete source files which -don't need transferring. This will enable perfect ordering of the -transfers and deletes but will cause the transfer stats to have more -items in than expected. +# SEE ALSO -Using this flag can use more memory as it effectively sets -`--max-backlog` to infinite. This means that all the info on the -objects to transfer is held in memory before the transfers start. +* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command -### --checkers=N ### +# rclone test makefiles -Originally controlling just the number of file checkers to run in parallel, -e.g. by `rclone copy`. Now a fairly universal parallelism control -used by `rclone` in several places. +Make a random file hierarchy in a directory -Note: checkers do the equality checking of files during a sync. -For some storage systems (e.g. S3, Swift, Dropbox) this can take -a significant amount of time so they are run in parallel. +``` +rclone test makefiles [flags] +``` -The default is to run 8 checkers in parallel. However, in case -of slow-reacting backends you may need to lower (rather than increase) -this default by setting `--checkers` to 4 or less threads. This is -especially advised if you are experiencing backend server crashes -during file checking phase (e.g. on subsequent or top-up backups -where little or no file copying is done and checking takes up -most of the time). Increase this setting only with utmost care, -while monitoring your server health and file checking throughput. +## Options -### -c, --checksum ### +``` + --ascii Fill files with random ASCII printable bytes only + --chargen Fill files with a ASCII chargen pattern + --files int Number of files to create (default 1000) + --files-per-directory int Average number of files per directory (default 10) + -h, --help help for makefiles + --max-depth int Maximum depth of directory hierarchy (default 10) + --max-file-size SizeSuffix Maximum size of files to create (default 100) + --max-name-length int Maximum size of file names (default 12) + --min-file-size SizeSuffix Minimum size of file to create + --min-name-length int Minimum size of file names (default 4) + --pattern Fill files with a periodic pattern + --seed int Seed for the random number generator (0 for random) (default 1) + --sparse Make the files sparse (appear to be filled with ASCII 0x00) + --zero Fill files with ASCII 0x00 +``` -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. -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. +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -This is very useful when transferring between remotes which store the -same hash type on the object, e.g. Drive and Swift. For details of which -remotes support which hash type see the table in the [overview -section](https://rclone.org/overview/). +# SEE ALSO -Eg `rclone --checksum sync s3:/bucket swift:/bucket` would run much -quicker than without the `--checksum` flag. +* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command -When using this flag, rclone won't update mtimes of remote files if -they are incorrect as it would normally. +# rclone test memory -### --color WHEN ### +Load all the objects at remote:path into memory and report memory stats. -Specify when colors (and other ANSI codes) should be added to the output. +``` +rclone test memory remote:path [flags] +``` -`AUTO` (default) only allows ANSI codes when the output is a terminal +## Options -`NEVER` never allow ANSI codes +``` + -h, --help help for memory +``` -`ALWAYS` always add ANSI codes, regardless of the output format (terminal or file) -### --compare-dest=DIR ### +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -When using `sync`, `copy` or `move` DIR is checked in addition to the -destination for files. If a file identical to the source is found that -file is NOT copied from source. This is useful to copy just files that -have changed since the last backup. +# SEE ALSO -You must use the same remote as the destination of the sync. The -compare directory must not overlap the destination directory. +* [rclone test](https://rclone.org/commands/rclone_test/) - Run a test command -See `--copy-dest` and `--backup-dir`. +# rclone touch -### --config=CONFIG_FILE ### +Create new file or change file modification time. -Specify the location of the rclone configuration file, to override -the default. E.g. `rclone config --config="rclone.conf"`. +## Synopsis -The exact default is a bit complex to describe, due to changes -introduced through different versions of rclone while preserving -backwards compatibility, but in most cases it is as simple as: - - `%APPDATA%/rclone/rclone.conf` on Windows - - `~/.config/rclone/rclone.conf` on other +Set the modification time on file(s) as specified by remote:path to +have the current time. -The complete logic is as follows: Rclone will look for an existing -configuration file in any of the following locations, in priority order: +If remote:path does not exist then a zero sized file will be created, +unless `--no-create` or `--recursive` is provided. - 1. `rclone.conf` (in program directory, where rclone executable is) - 2. `%APPDATA%/rclone/rclone.conf` (only on Windows) - 3. `$XDG_CONFIG_HOME/rclone/rclone.conf` (on all systems, including Windows) - 4. `~/.config/rclone/rclone.conf` (see below for explanation of ~ symbol) - 5. `~/.rclone.conf` +If `--recursive` is used then recursively sets the modification +time on all existing files that is found under the path. Filters are supported, +and you can test with the `--dry-run` or the `--interactive`/`-i` flag. -If no existing configuration file is found, then a new one will be created -in the following location: +If `--timestamp` is used then sets the modification time to that +time instead of the current time. Times may be specified as one of: -- On Windows: Location 2 listed above, except in the unlikely event - that `APPDATA` is not defined, then location 4 is used instead. -- On Unix: Location 3 if `XDG_CONFIG_HOME` is defined, else location 4. -- Fallback to location 5 (on all OS), when the rclone directory cannot be - created, but if also a home directory was not found then path - `.rclone.conf` relative to current working directory will be used as - a final resort. +- 'YYMMDD' - e.g. 17.10.30 +- 'YYYY-MM-DDTHH:MM:SS' - e.g. 2006-01-02T15:04:05 +- 'YYYY-MM-DDTHH:MM:SS.SSS' - e.g. 2006-01-02T15:04:05.123456789 -The `~` symbol in paths above represent the home directory of the current user -on any OS, and the value is defined as following: +Note that value of `--timestamp` is in UTC. If you want local time +then add the `--localtime` flag. - - On Windows: `%HOME%` if defined, else `%USERPROFILE%`, or else `%HOMEDRIVE%\%HOMEPATH%`. - - On Unix: `$HOME` if defined, else by looking up current user in OS-specific user database - (e.g. passwd file), or else use the result from shell command `cd && pwd`. -If you run `rclone config file` you will see where the default -location is for you. +``` +rclone touch remote:path [flags] +``` -The fact that an existing file `rclone.conf` in the same directory -as the rclone executable is always preferred, means that it is easy -to run in "portable" mode by downloading rclone executable to a -writable directory and then create an empty file `rclone.conf` in the -same directory. +## Options -If the location is set to empty string `""` or path to a file -with name `notfound`, or the os null device represented by value `NUL` on -Windows and `/dev/null` on Unix systems, then rclone will keep the -config file in memory only. +``` + -h, --help help for touch + --localtime Use localtime for timestamp, not UTC + -C, --no-create Do not create the file if it does not exist (implied with --recursive) + -R, --recursive Recursively touch all files + -t, --timestamp string Use specified time instead of the current time of day +``` -The file format is basic [INI](https://en.wikipedia.org/wiki/INI_file#Format): -Sections of text, led by a `[section]` header and followed by -`key=value` entries on separate lines. In rclone each remote is -represented by its own section, where the section name defines the -name of the remote. Options are specified as the `key=value` entries, -where the key is the option name without the `--backend-` prefix, -in lowercase and with `_` instead of `-`. E.g. option `--mega-hard-delete` -corresponds to key `hard_delete`. Only backend options can be specified. -A special, and required, key `type` identifies the [storage system](https://rclone.org/overview/), -where the value is the internal lowercase name as returned by command -`rclone help backends`. Comments are indicated by `;` or `#` at the -beginning of a line. -Example: +## Important Options - [megaremote] - type = mega - user = you@example.com - pass = PDPcQVVjVtzFY-GTdDFozqBhTdsPg3qH +Important flags useful for most commands. -Note that passwords are in [obscured](https://rclone.org/commands/rclone_obscure/) -form. Also, many storage systems uses token-based authentication instead -of passwords, and this requires additional steps. It is easier, and safer, -to use the interactive command `rclone config` instead of manually -editing the configuration file. +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` -The configuration file will typically contain login information, and -should therefore have restricted permissions so that only the current user -can read it. Rclone tries to ensure this when it writes the file. -You may also choose to [encrypt](#configuration-encryption) the file. +## Filter Options -When token-based authentication are used, the configuration file -must be writable, because rclone needs to update the tokens inside it. +Flags for filtering directory listings. -To reduce risk of corrupting an existing configuration file, rclone -will not write directly to it when saving changes. Instead it will -first write to a new, temporary, file. If a configuration file already -existed, it will (on Unix systems) try to mirror its permissions to -the new file. Then it will rename the existing file to a temporary -name as backup. Next, rclone will rename the new file to the correct name, -before finally cleaning up by deleting the backup file. +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` -If the configuration file path used by rclone is a symbolic link, then -this will be evaluated and rclone will write to the resolved path, instead -of overwriting the symbolic link. Temporary files used in the process -(described above) will be written to the same parent directory as that -of the resolved configuration file, but if this directory is also a -symbolic link it will not be resolved and the temporary files will be -written to the location of the directory symbolic link. +## Listing Options -### --contimeout=TIME ### +Flags for listing directories. -Set the connection timeout. This should be in go time format which -looks like `5s` for 5 seconds, `10m` for 10 minutes, or `3h30m`. +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` -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 -`1m` by default. +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -### --copy-dest=DIR ### +# SEE ALSO -When using `sync`, `copy` or `move` DIR is checked in addition to the -destination for files. If a file identical to the source is found that -file is server-side copied from DIR to the destination. This is useful -for incremental backup. +* [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. -The remote in use must support server-side copy and you must -use the same remote as the destination of the sync. The compare -directory must not overlap the destination directory. +# rclone tree -See `--compare-dest` and `--backup-dir`. +List the contents of the remote in a tree like fashion. -### --dedupe-mode MODE ### +## Synopsis -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. -### --default-time TIME ### +rclone tree lists the contents of a remote in a similar way to the +unix tree command. -If a file or directory does have a modification time rclone can read -then rclone will display this fixed time instead. +For example -The default is `2000-01-01 00:00:00 UTC`. This can be configured in -any of the ways shown in [the time or duration options](#time-option). + $ rclone tree remote:path + / + ├── file1 + ├── file2 + ├── file3 + └── subdir + ├── file4 + └── file5 -For example `--default-time 2020-06-01` to set the default time to the -1st of June 2020 or `--default-time 0s` to set the default time to the -time rclone started up. + 1 directories, 5 files -### --disable FEATURE,FEATURE,... ### +You can use any of the filtering options with the tree command (e.g. +`--include` and `--exclude`. You can also use `--fast-list`. -This disables a comma separated list of optional features. For example -to disable server-side move and server-side copy use: +The tree command has many options for controlling the listing which +are compatible with the tree command, for example you can include file +sizes with `--size`. Note that not all of them have +short options as they conflict with rclone's short options. - --disable move,copy +For a more interactive navigation of the remote see the +[ncdu](https://rclone.org/commands/rclone_ncdu/) command. -The features can be put in any case. -To see a list of which features can be disabled use: +``` +rclone tree remote:path [flags] +``` - --disable help +## Options -The features a remote has can be seen in JSON format with: +``` + -a, --all All files are listed (list . files too) + -d, --dirs-only List directories only + --dirsfirst List directories before files (-U disables) + --full-path Print the full path prefix for each file + -h, --help help for tree + --level int Descend only level directories deep + -D, --modtime Print the date of last modification. + --noindent Don't print indentation lines + --noreport Turn off file/directory count at end of tree listing + -o, --output string Output to file instead of stdout + -p, --protections Print the protections for each file. + -Q, --quote Quote filenames with double quotes. + -s, --size Print the size in bytes of each file. + --sort string Select sort: name,version,size,mtime,ctime + --sort-ctime Sort files by last status change time + -t, --sort-modtime Sort files by last modification time + -r, --sort-reverse Reverse the order of the sort + -U, --unsorted Leave files unsorted + --version Sort files alphanumerically by version +``` - rclone backend features remote: -See the overview [features](https://rclone.org/overview/#features) and -[optional features](https://rclone.org/overview/#optional-features) to get an idea of -which feature does what. +## Filter Options -Note that some features can be set to `true` if they are `true`/`false` -feature flag features by prefixing them with `!`. For example the -`CaseInsensitive` feature can be forced to `false` with `--disable CaseInsensitive` -and forced to `true` with `--disable '!CaseInsensitive'`. In general -it isn't a good idea doing this but it may be useful in extremis. +Flags for filtering directory listings. -(Note that `!` is a shell command which you will -need to escape with single quotes or a backslash on unix like -platforms.) +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` -This flag can be useful for debugging and in exceptional circumstances -(e.g. Google Drive limiting the total volume of Server Side Copies to -100 GiB/day). +## Listing Options -### --disable-http2 +Flags for listing directories. -This stops rclone from trying to use HTTP/2 if available. This can -sometimes speed up transfers due to a -[problem in the Go standard library](https://github.com/golang/go/issues/37373). +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` -### --dscp VALUE ### +See the [global flags page](https://rclone.org/flags/) for global options not listed here. -Specify a DSCP value or name to use in connections. This could help QoS -system to identify traffic class. BE, EF, DF, LE, CSx and AFxx are allowed. +# SEE ALSO -See the description of [differentiated services](https://en.wikipedia.org/wiki/Differentiated_services) to get an idea of -this field. Setting this to 1 (LE) to identify the flow to SCAVENGER class -can avoid occupying too much bandwidth in a network with DiffServ support ([RFC 8622](https://tools.ietf.org/html/rfc8622)). - -For example, if you configured QoS on router to handle LE properly. Running: -``` -rclone copy --dscp LE from:/from to:/to -``` -would make the priority lower than usual internet flows. +* [rclone](https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. -This option has no effect on Windows (see [golang/go#42728](https://github.com/golang/go/issues/42728)). -### -n, --dry-run ### +Copying single files +-------------------- -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 `sync` -command which deletes files in the destination. +rclone normally syncs or copies directories. However, if the source +remote points to a file, rclone will just copy that file. The +destination remote must point to a directory - rclone will give the +error `Failed to create file system for "remote:file": is a file not a +directory` if it isn't. -### --expect-continue-timeout=TIME ### +For example, suppose you have a remote with a file in called +`test.jpg`, then you could copy just that file like this -This specifies the amount of time to wait for a server's first -response headers after fully writing the request headers if the -request has an "Expect: 100-continue" header. Not all backends support -using this. + rclone copy remote:test.jpg /tmp/download -Zero means no timeout and causes the body to be sent immediately, -without waiting for the server to approve. This time does not include -the time to send the request header. +The file `test.jpg` will be placed inside `/tmp/download`. -The default is `1s`. Set to `0` to disable. +This is equivalent to specifying -### --error-on-no-transfer ### + rclone copy --files-from /tmp/files remote: /tmp/download -By default, rclone will exit with return code 0 if there were no errors. +Where `/tmp/files` contains the single line -This option allows rclone to return exit code 9 if no files were transferred -between the source and destination. This allows using rclone in scripts, and -triggering follow-on actions if data was copied, or skipping if not. + test.jpg -NB: Enabling this option turns a usually non-fatal error into a potentially -fatal one - please check and adjust your scripts accordingly! +It is recommended to use `copy` when copying individual files, not `sync`. +They have pretty much the same effect but `copy` will use a lot less +memory. -### --fs-cache-expire-duration=TIME +Syntax of remote paths +---------------------- -When using rclone via the API rclone caches created remotes for 5 -minutes by default in the "fs cache". This means that if you do -repeated actions on the same remote then rclone won't have to build it -again from scratch, which makes it more efficient. +The syntax of the paths passed to the rclone command are as follows. -This flag sets the time that the remotes are cached for. If you set it -to `0` (or negative) then rclone won't cache the remotes at all. +### /path/to/dir -Note that if you use some flags, eg `--backup-dir` and if this is set -to `0` rclone may build two remotes (one for the source or destination -and one for the `--backup-dir` where it may have only built one -before. +This refers to the local file system. -### --fs-cache-expire-interval=TIME +On Windows `\` may be used instead of `/` in local paths **only**, +non local paths must use `/`. See [local filesystem](https://rclone.org/local/#paths-on-windows) +documentation for more about Windows-specific paths. -This controls how often rclone checks for cached remotes to expire. -See the `--fs-cache-expire-duration` documentation above for more -info. The default is 60s, set to 0 to disable expiry. +These paths needn't start with a leading `/` - if they don't then they +will be relative to the current directory. -### --header ### +### remote:path/to/dir -Add an HTTP header for all transactions. The flag can be repeated to -add multiple headers. +This refers to a directory `path/to/dir` on `remote:` as defined in +the config file (configured with `rclone config`). -If you want to add headers only for uploads use `--header-upload` and -if you want to add headers only for downloads use `--header-download`. +### remote:/path/to/dir -This flag is supported for all HTTP based backends even those not -supported by `--header-upload` and `--header-download` so may be used -as a workaround for those with care. +On most backends this is refers to the same directory as +`remote:path/to/dir` and that format should be preferred. On a very +small number of remotes (FTP, SFTP, Dropbox for business) this will +refer to a different directory. On these, paths without a leading `/` +will refer to your "home" directory and paths with a leading `/` will +refer to the root. -``` -rclone ls remote:test --header "X-Rclone: Foo" --header "X-LetMeIn: Yes" -``` +### :backend:path/to/dir -### --header-download ### +This is an advanced form for creating remotes on the fly. `backend` +should be the name or prefix of a backend (the `type` in the config +file) and all the configuration for the backend should be provided on +the command line (or in environment variables). -Add an HTTP header for all download transactions. The flag can be repeated to -add multiple headers. +Here are some examples: -``` -rclone sync --interactive s3:test/src ~/dst --header-download "X-Amz-Meta-Test: Foo" --header-download "X-Amz-Meta-Test2: Bar" -``` + rclone lsd --http-url https://pub.rclone.org :http: -See the GitHub issue [here](https://github.com/rclone/rclone/issues/59) for -currently supported backends. +To list all the directories in the root of `https://pub.rclone.org/`. -### --header-upload ### + rclone lsf --http-url https://example.com :http:path/to/dir -Add an HTTP header for all upload transactions. The flag can be repeated to add -multiple headers. +To list files and directories in `https://example.com/path/to/dir/` -``` -rclone sync --interactive ~/src s3:test/dst --header-upload "Content-Disposition: attachment; filename='cool.html'" --header-upload "X-Amz-Meta-Test: FooBar" -``` + rclone copy --http-url https://example.com :http:path/to/dir /tmp/dir -See the GitHub issue [here](https://github.com/rclone/rclone/issues/59) for -currently supported backends. +To copy files and directories in `https://example.com/path/to/dir` to `/tmp/dir`. -### --human-readable ### + rclone copy --sftp-host example.com :sftp:path/to/dir /tmp/dir -Rclone commands output values for sizes (e.g. number of bytes) and -counts (e.g. number of files) either as *raw* numbers, or -in *human-readable* format. +To copy files and directories from `example.com` in the relative +directory `path/to/dir` to `/tmp/dir` using sftp. -In human-readable format the values are scaled to larger units, indicated with -a suffix shown after the value, and rounded to three decimals. Rclone consistently -uses binary units (powers of 2) for sizes and decimal units (powers of 10) for counts. -The unit prefix for size is according to IEC standard notation, e.g. `Ki` for kibi. -Used with byte unit, `1 KiB` means 1024 Byte. In list type of output, only the -unit prefix appended to the value (e.g. `9.762Ki`), while in more textual output -the full unit is shown (e.g. `9.762 KiB`). For counts the SI standard notation is -used, e.g. prefix `k` for kilo. Used with file counts, `1k` means 1000 files. +### Connection strings {#connection-strings} -The various [list](https://rclone.org/commands/rclone_ls/) commands output raw numbers by default. -Option `--human-readable` will make them output values in human-readable format -instead (with the short unit prefix). +The above examples can also be written using a connection string +syntax, so instead of providing the arguments as command line +parameters `--http-url https://pub.rclone.org` they are provided as +part of the remote specification as a kind of connection string. -The [about](https://rclone.org/commands/rclone_about/) command outputs human-readable by default, -with a command-specific option `--full` to output the raw numbers instead. + rclone lsd ":http,url='https://pub.rclone.org':" + rclone lsf ":http,url='https://example.com':path/to/dir" + rclone copy ":http,url='https://example.com':path/to/dir" /tmp/dir + rclone copy :sftp,host=example.com:path/to/dir /tmp/dir -Command [size](https://rclone.org/commands/rclone_size/) outputs both human-readable and raw numbers -in the same output. +These can apply to modify existing remotes as well as create new +remotes with the on the fly syntax. This example is equivalent to +adding the `--drive-shared-with-me` parameter to the remote `gdrive:`. -The [tree](https://rclone.org/commands/rclone_tree/) command also considers `--human-readable`, but -it will not use the exact same notation as the other commands: It rounds to one -decimal, and uses single letter suffix, e.g. `K` instead of `Ki`. The reason for -this is that it relies on an external library. + rclone lsf "gdrive,shared_with_me:path/to/dir" -The interactive command [ncdu](https://rclone.org/commands/rclone_ncdu/) shows human-readable by -default, and responds to key `u` for toggling human-readable format. +The major advantage to using the connection string style syntax is +that it only applies to the remote, not to all the remotes of that +type of the command line. A common confusion is this attempt to copy a +file shared on google drive to the normal drive which **does not +work** because the `--drive-shared-with-me` flag applies to both the +source and the destination. -### --ignore-case-sync ### + rclone copy --drive-shared-with-me gdrive:shared-file.txt gdrive: -Using this option will cause rclone to ignore the case of the files -when synchronizing so files will not be copied/synced when the -existing filenames are the same, even if the casing is different. +However using the connection string syntax, this does work. -### --ignore-checksum ### + rclone copy "gdrive,shared_with_me:shared-file.txt" gdrive: -Normally rclone will check that the checksums of transferred files -match, and give an error "corrupted on transfer" if they don't. +Note that the connection string only affects the options of the immediate +backend. If for example gdriveCrypt is a crypt based on gdrive, then the +following command **will not work** as intended, because +`shared_with_me` is ignored by the crypt backend: -You can use this option to skip that check. You should only use it if -you have had the "corrupted on transfer" error message and you are -sure you might want to transfer potentially corrupted data. + rclone copy "gdriveCrypt,shared_with_me:shared-file.txt" gdriveCrypt: -### --ignore-existing ### +The connection strings have the following syntax -Using this option will make rclone unconditionally skip all files -that exist on the destination, no matter the content of these files. + remote,parameter=value,parameter2=value2:path/to/dir + :backend,parameter=value,parameter2=value2:path/to/dir -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. +If the `parameter` has a `:` or `,` then it must be placed in quotes `"` or +`'`, so -When performing a `move`/`moveto` command, this flag will leave skipped -files in the source location unchanged when a file with the same name -exists on the destination. + remote,parameter="colon:value",parameter2="comma,value":path/to/dir + :backend,parameter='colon:value',parameter2='comma,value':path/to/dir -### --ignore-size ### +If a quoted value needs to include that quote, then it should be +doubled, so -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 modification time. If `--checksum` is set then it only -checks the checksum. + remote,parameter="with""quote",parameter2='with''quote':path/to/dir -It will also cause rclone to skip verifying the sizes are the same -after transfer. +This will make `parameter` be `with"quote` and `parameter2` be +`with'quote`. -This can be useful for transferring files to and from OneDrive which -occasionally misreports the size of image files (see -[#399](https://github.com/rclone/rclone/issues/399) for more info). +If you leave off the `=parameter` then rclone will substitute `=true` +which works very well with flags. For example, to use s3 configured in +the environment you could use: -### -I, --ignore-times ### + rclone lsd :s3,env_auth: -Using this option will cause rclone to unconditionally upload all -files regardless of the state of files on the destination. +Which is equivalent to -Normally rclone would skip any files that have the same -modification time and are the same size (or have the same checksum if -using `--checksum`). + rclone lsd :s3,env_auth=true: -### --immutable ### +Note that on the command line you might need to surround these +connection strings with `"` or `'` to stop the shell interpreting any +special characters within them. -Treat source and destination files as immutable and disallow -modification. +If you are a shell master then you'll know which strings are OK and +which aren't, but if you aren't sure then enclose them in `"` and use +`'` as the inside quote. This syntax works on all OSes. -With this option set, files will be created and deleted as requested, -but existing files will never be updated. If an existing file does -not match between the source and destination, rclone will give the error -`Source and destination exist but do not match: immutable file modified`. + rclone copy ":http,url='https://example.com':path/to/dir" /tmp/dir -Note that only commands which transfer files (e.g. `sync`, `copy`, -`move`) are affected by this behavior, and only modification is -disallowed. Files may still be deleted explicitly (e.g. `delete`, -`purge`) or implicitly (e.g. `sync`, `move`). Use `copy --immutable` -if it is desired to avoid deletion as well as modification. +On Linux/macOS some characters are still interpreted inside `"` +strings in the shell (notably `\` and `$` and `"`) so if your strings +contain those you can swap the roles of `"` and `'` thus. (This syntax +does not work on Windows.) -This can be useful as an additional layer of protection for immutable -or append-only data sets (notably backup archives), where modification -implies corruption and should not be propagated. + rclone copy ':http,url="https://example.com":path/to/dir' /tmp/dir -### --inplace {#inplace} +#### Connection strings, config and logging -The `--inplace` flag changes the behaviour of rclone when uploading -files to some backends (backends with the `PartialUploads` feature -flag set) such as: +If you supply extra configuration to a backend by command line flag, +environment variable or connection string then rclone will add a +suffix based on the hash of the config to the name of the remote, eg -- local -- ftp -- sftp + rclone -vv lsf --s3-chunk-size 20M s3: -Without `--inplace` (the default) rclone will first upload to a -temporary file with an extension like this where `XXXXXX` represents a -random string. +Has the log message - original-file-name.XXXXXX.partial + DEBUG : s3: detected overridden config - adding "{Srj1p}" suffix to name -(rclone will make sure the final name is no longer than 100 characters -by truncating the `original-file-name` part if necessary). +This is so rclone can tell the modified remote apart from the +unmodified remote when caching the backends. -When the upload is complete, rclone will rename the `.partial` file to -the correct name, overwriting any existing file at that point. If the -upload fails then the `.partial` file will be deleted. +This should only be noticeable in the logs. -This prevents other users of the backend from seeing partially -uploaded files in their new names and prevents overwriting the old -file until the new one is completely uploaded. +This means that on the fly backends such as -If the `--inplace` flag is supplied, rclone will upload directly to -the final name without creating a `.partial` file. + rclone -vv lsf :s3,env_auth: -This means that an incomplete file will be visible in the directory -listings while the upload is in progress and any existing files will -be overwritten as soon as the upload starts. If the transfer fails -then the file will be deleted. This can cause data loss of the -existing file if the transfer fails. +Will get their own names -Note that on the local file system if you don't use `--inplace` hard -links (Unix only) will be broken. And if you do use `--inplace` you -won't be able to update in use executables. + DEBUG : :s3: detected overridden config - adding "{YTu53}" suffix to name -Note also that versions of rclone prior to v1.63.0 behave as if the -`--inplace` flag is always supplied. +### Valid remote names -### -i, --interactive {#interactive} +Remote names are case sensitive, and must adhere to the following rules: + - May contain number, letter, `_`, `-`, `.`, `+`, `@` and space. + - May not start with `-` or space. + - May not end with space. -This flag can be used to tell rclone that you wish a manual -confirmation before destructive operations. +Starting with rclone version 1.61, any Unicode numbers and letters are allowed, +while in older versions it was limited to plain ASCII (0-9, A-Z, a-z). If you use +the same rclone configuration from different shells, which may be configured with +different character encoding, you must be cautious to use characters that are +possible to write in all of them. This is mostly a problem on Windows, where +the console traditionally uses a non-Unicode character set - defined +by the so-called "code page". -It is **recommended** that you use this flag while learning rclone -especially with `rclone sync`. +Do not use single character names on Windows as it creates ambiguity with Windows +drives' names, e.g.: remote called `C` is indistinguishable from `C` drive. Rclone +will always assume that single letter name refers to a drive. -For example +Quoting and the shell +--------------------- -``` -$ rclone delete --interactive /tmp/dir -rclone: delete "important-file.txt"? -y) Yes, this is OK (default) -n) No, skip this -s) Skip all delete operations with no more questions -!) Do all delete operations with no more questions -q) Exit rclone now. -y/n/s/!/q> n -``` +When you are typing commands to your computer you are using something +called the command line shell. This interprets various characters in +an OS specific way. -The options mean +Here are some gotchas which may help users unfamiliar with the shell rules -- `y`: **Yes**, this operation should go ahead. You can also press Return - for this to happen. You'll be asked every time unless you choose `s` - or `!`. -- `n`: **No**, do not do this operation. You'll be asked every time unless - you choose `s` or `!`. -- `s`: **Skip** all the following operations of this type with no more - questions. This takes effect until rclone exits. If there are any - different kind of operations you'll be prompted for them. -- `!`: **Do all** the following operations with no more - questions. Useful if you've decided that you don't mind rclone doing - that kind of operation. This takes effect until rclone exits . If - there are any different kind of operations you'll be prompted for - them. -- `q`: **Quit** rclone now, just in case! +### Linux / OSX ### -### --leave-root #### +If your names have spaces or shell metacharacters (e.g. `*`, `?`, `$`, +`'`, `"`, etc.) then you must quote them. Use single quotes `'` by default. -During rmdirs it will not remove root directory, even if it's empty. + rclone copy 'Important files?' remote:backup -### --log-file=FILE ### +If you want to send a `'` you will need to use `"`, e.g. -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 `-v` flag. See the [Logging section](#logging) -for more info. + rclone copy "O'Reilly Reviews" remote:backup -If FILE exists then rclone will append to it. +The rules for quoting metacharacters are complicated and if you want +the full details you'll have to consult the manual page for your +shell. -Note that if you are using the `logrotate` program to manage rclone's -logs, then you should use the `copytruncate` option as rclone doesn't -have a signal to rotate logs. +### Windows ### -### --log-format LIST ### +If your names have spaces in you need to put them in `"`, e.g. -Comma separated list of log format options. Accepted options are `date`, -`time`, `microseconds`, `pid`, `longfile`, `shortfile`, `UTC`. Any other -keywords will be silently ignored. `pid` will tag log messages with process -identifier which useful with `rclone mount --daemon`. Other accepted -options are explained in the [go documentation](https://pkg.go.dev/log#pkg-constants). -The default log format is "`date`,`time`". + rclone copy "E:\folder name\folder name\folder name" remote:backup -### --log-level LEVEL ### +If you are using the root directory on its own then don't quote it +(see [#464](https://github.com/rclone/rclone/issues/464) for why), e.g. -This sets the log level for rclone. The default log level is `NOTICE`. + rclone copy E:\ remote:backup -`DEBUG` is equivalent to `-vv`. It outputs lots of debug info - useful -for bug reports and really finding out what rclone is doing. +Copying files or directories with `:` in the names +-------------------------------------------------- -`INFO` is equivalent to `-v`. It outputs information about each transfer -and prints stats once a minute by default. +rclone uses `:` to mark a remote name. This is, however, a valid +filename component in non-Windows OSes. The remote name parser will +only search for a `:` up to the first `/` so if you need to act on a +file or directory like this then use the full path starting with a +`/`, or use `./` as a current directory prefix. -`NOTICE` is the default log level if no logging flags are supplied. It -outputs very little when things are working normally. It outputs -warnings and significant events. +So to sync a directory called `sync:me` to a remote called `remote:` use -`ERROR` is equivalent to `-q`. It only outputs error messages. + rclone sync --interactive ./sync:me remote:path -### --use-json-log ### +or -This switches the log format to JSON for rclone. The fields of json log -are level, msg, source, time. + rclone sync --interactive /full/path/to/sync:me remote:path -### --low-level-retries NUMBER ### +Server Side Copy +---------------- -This controls the number of low level retries rclone does. +Most remotes (but not all - see [the +overview](https://rclone.org/overview/#optional-features)) support server-side copy. -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 `-v` -flag. +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. -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 -`--retries` flag) quicker. +Eg -Disable low level retries with `--low-level-retries 1`. + rclone copy s3:oldbucket s3:newbucket -### --max-backlog=N ### +Will copy the contents of `oldbucket` to `newbucket` without +downloading and re-uploading. -This is the maximum allowable backlog of files in a sync/copy/move -queued for being checked or transferred. +Remotes which don't support server-side copy **will** download and +re-upload in this case. -This can be set arbitrarily large. It will only use memory when the -queue is in use. Note that it will use in the order of N KiB of memory -when the backlog is in use. +Server side copies are used with `sync` and `copy` and will be +identified in the log when using the `-v` flag. The `move` command +may also use them if remote doesn't support server-side move directly. +This is done by issuing a server-side copy then a delete which is much +quicker than a download and re-upload. -Setting this large allows rclone to calculate how many files are -pending more accurately, give a more accurate estimated finish -time and make `--order-by` work more accurately. +Server side copies will only be attempted if the remote names are the +same. -Setting this small will make rclone more synchronous to the listings -of the remote which may be desirable. +This can be used when scripting to make aged backups efficiently, e.g. -Setting this to a negative number will make the backlog as large as -possible. + rclone sync --interactive remote:current-backup remote:previous-backup + rclone sync --interactive /path/to/files remote:current-backup -### --max-delete=N ### +## Metadata support {#metadata} -This tells rclone not to delete more than N files. If that limit is -exceeded then a fatal error will be generated and rclone will stop the -operation in progress. +Metadata is data about a file which isn't the contents of the file. +Normally rclone only preserves the modification time and the content +(MIME) type where possible. -### --max-delete-size=SIZE ### +Rclone supports preserving all the available metadata on files (not +directories) when using the `--metadata` or `-M` flag. -Rclone will stop deleting files when the total size of deletions has -reached the size specified. It defaults to off. +Exactly what metadata is supported and what that support means depends +on the backend. Backends that support metadata have a metadata section +in their docs and are listed in the [features table](https://rclone.org/overview/#features) +(Eg [local](https://rclone.org/local/#metadata), [s3](/s3/#metadata)) -If that limit is exceeded then a fatal error will be generated and -rclone will stop the operation in progress. +Rclone only supports a one-time sync of metadata. This means that +metadata will be synced from the source object to the destination +object only when the source object has changed and needs to be +re-uploaded. If the metadata subsequently changes on the source object +without changing the object itself then it won't be synced to the +destination object. This is in line with the way rclone syncs +`Content-Type` without the `--metadata` flag. -### --max-depth=N ### +Using `--metadata` when syncing from local to local will preserve file +attributes such as file mode, owner, extended attributes (not +Windows). -This modifies the recursion depth for all the commands except purge. +Note that arbitrary metadata may be added to objects using the +`--metadata-set key=value` flag when the object is first uploaded. +This flag can be repeated as many times as necessary. -So if you do `rclone --max-depth 1 ls remote:path` you will see only -the files in the top level directory. Using `--max-depth 2` means you -will see all the files in first two directory levels and so on. +The [--metadata-mapper](#metadata-mapper) flag can be used to pass the +name of a program in which can transform metadata when it is being +copied from source to destination. -For historical reasons the `lsd` command defaults to using a -`--max-depth` of 1 - you can override this with the command line flag. +### Types of metadata -You can use this command to disable recursion (with `--max-depth 1`). +Metadata is divided into two type. System metadata and User metadata. -Note that if you use this with `sync` and `--delete-excluded` the -files not recursed through are considered excluded and will be deleted -on the destination. Test first with `--dry-run` if you are not sure -what will happen. +Metadata which the backend uses itself is called system metadata. For +example on the local backend the system metadata `uid` will store the +user ID of the file when used on a unix based platform. -### --max-duration=TIME ### +Arbitrary metadata is called user metadata and this can be set however +is desired. -Rclone will stop transferring when it has run for the -duration specified. -Defaults to off. - -When the limit is reached all transfers will stop immediately. -Use `--cutoff-mode` to modify this behaviour. - -Rclone will exit with exit code 10 if the duration limit is reached. +When objects are copied from backend to backend, they will attempt to +interpret system metadata if it is supplied. Metadata may change from +being user metadata to system metadata as objects are copied between +different backends. For example copying an object from s3 sets the +`content-type` metadata. In a backend which understands this (like +`azureblob`) this will become the Content-Type of the object. In a +backend which doesn't understand this (like the `local` backend) this +will become user metadata. However should the local object be copied +back to s3, the Content-Type will be set correctly. -### --max-transfer=SIZE ### +### Metadata framework -Rclone will stop transferring when it has reached the size specified. -Defaults to off. +Rclone implements a metadata framework which can read metadata from an +object and write it to the object when (and only when) it is being +uploaded. -When the limit is reached all transfers will stop immediately. -Use `--cutoff-mode` to modify this behaviour. +This metadata is stored as a dictionary with string keys and string +values. -Rclone will exit with exit code 8 if the transfer limit is reached. +There are some limits on the names of the keys (these may be clarified +further in the future). -### --cutoff-mode=hard|soft|cautious ### +- must be lower case +- may be `a-z` `0-9` containing `.` `-` or `_` +- length is backend dependent -This modifies the behavior of `--max-transfer` and `--max-duration` -Defaults to `--cutoff-mode=hard`. +Each backend can provide system metadata that it understands. Some +backends can also store arbitrary user metadata. -Specifying `--cutoff-mode=hard` will stop transferring immediately -when Rclone reaches the limit. +Where possible the key names are standardized, so, for example, it is +possible to copy object metadata from s3 to azureblob for example and +metadata will be translated appropriately. -Specifying `--cutoff-mode=soft` will stop starting new transfers -when Rclone reaches the limit. +Some backends have limits on the size of the metadata and rclone will +give errors on upload if they are exceeded. -Specifying `--cutoff-mode=cautious` will try to prevent Rclone -from reaching the limit. Only applicable for `--max-transfer` +### Metadata preservation -## -M, --metadata +The goal of the implementation is to -Setting this flag enables rclone to copy the metadata from the source -to the destination. For local backends this is ownership, permissions, -xattr etc. See the [#metadata](metadata section) for more info. +1. Preserve metadata if at all possible +2. Interpret metadata if at all possible -### --metadata-set key=value +The consequences of 1 is that you can copy an S3 object to a local +disk then back to S3 losslessly. Likewise you can copy a local file +with file attributes and xattrs from local disk to s3 and back again +losslessly. -Add metadata `key` = `value` when uploading. This can be repeated as -many times as required. See the [#metadata](metadata section) for more -info. +The consequence of 2 is that you can copy an S3 object with metadata +to Azureblob (say) and have the metadata appear on the Azureblob +object also. -### --modify-window=TIME ### +### Standard system metadata -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. +Here is a table of standard system metadata which, if appropriate, a +backend may implement. -The default is `1ns` 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 -`1s` by default. +| key | description | example | +|---------------------|-------------|---------| +| mode | File type and mode: octal, unix style | 0100664 | +| uid | User ID of owner: decimal number | 500 | +| gid | Group ID of owner: decimal number | 500 | +| rdev | Device ID (if special file) => hexadecimal | 0 | +| atime | Time of last access: RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | +| mtime | Time of last modification: RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | +| btime | Time of file creation (birth): RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | +| utime | Time of file upload: RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | +| cache-control | Cache-Control header | no-cache | +| content-disposition | Content-Disposition header | inline | +| content-encoding | Content-Encoding header | gzip | +| content-language | Content-Language header | en-US | +| content-type | Content-Type header | text/plain | -This command line flag allows you to override that computed default. +The metadata keys `mtime` and `content-type` will take precedence if +supplied in the metadata over reading the `Content-Type` or +modification time of the source object. -### --multi-thread-write-buffer-size=SIZE ### +Hashes are not included in system metadata as there is a well defined +way of reading those already. -When transferring with multiple threads, rclone will buffer SIZE bytes -in memory before writing to disk for each thread. +Options +------- -This can improve performance if the underlying filesystem does not deal -well with a lot of small writes in different positions of the file, so -if you see transfers being limited by disk write speed, you might want -to experiment with different values. Specially for magnetic drives and -remote file systems a higher value can be useful. +Rclone has a number of options to control its behaviour. -Nevertheless, the default of `128k` should be fine for almost all use -cases, so before changing it ensure that network is not really your -bottleneck. +Options that take parameters can have the values passed in two ways, +`--option=value` or `--option value`. However boolean (true/false) +options behave slightly differently to the other options in that +`--boolean` sets the option to `true` and the absence of the flag sets +it to `false`. It is also possible to specify `--boolean=false` or +`--boolean=true`. Note that `--boolean false` is not valid - this is +parsed as `--boolean` and the `false` is parsed as an extra command +line argument for rclone. -As a final hint, size is not the only factor: block size (or similar -concept) can have an impact. In one case, we observed that exact -multiples of 16k performed much better than other values. +### Time or duration options {#time-option} -### --multi-thread-chunk-size=SizeSuffix ### +TIME or DURATION options can be specified as a duration string or a +time string. -Normally the chunk size for multi thread transfers is set by the backend. -However some backends such as `local` and `smb` (which implement `OpenWriterAt` -but not `OpenChunkWriter`) don't have a natural chunk size. +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". Default units are seconds or the following +abbreviations are valid: -In this case the value of this option is used (default 64Mi). + * `ms` - Milliseconds + * `s` - Seconds + * `m` - Minutes + * `h` - Hours + * `d` - Days + * `w` - Weeks + * `M` - Months + * `y` - Years -### --multi-thread-cutoff=SIZE {#multi-thread-cutoff} +These can also be specified as an absolute time in the following +formats: -When transferring files above SIZE to capable backends, rclone will -use multiple threads to transfer the file (default 256M). +- RFC3339 - e.g. `2006-01-02T15:04:05Z` or `2006-01-02T15:04:05+07:00` +- ISO8601 Date and time, local timezone - `2006-01-02T15:04:05` +- ISO8601 Date and time, local timezone - `2006-01-02 15:04:05` +- ISO8601 Date - `2006-01-02` (YYYY-MM-DD) -Capable backends are marked in the -[overview](https://rclone.org/overview/#optional-features) as `MultithreadUpload`. (They -need to implement either the `OpenWriterAt` or `OpenChunkedWriter` -internal interfaces). These include include, `local`, `s3`, -`azureblob`, `b2`, `oracleobjectstorage` and `smb` at the time of -writing. +### Size options {#size-option} -On the local disk, rclone preallocates the file (using -`fallocate(FALLOC_FL_KEEP_SIZE)` on unix or `NTSetInformationFile` on -Windows both of which takes no time) then each thread writes directly -into the file at the correct place. This means that rclone won't -create fragmented or sparse files and there won't be any assembly time -at the end of the transfer. +Options which use SIZE use KiB (multiples of 1024 bytes) by default. +However, a suffix of `B` for Byte, `K` for KiB, `M` for MiB, +`G` for GiB, `T` for TiB and `P` for PiB may be used. These are +the binary units, e.g. 1, 2\*\*10, 2\*\*20, 2\*\*30 respectively. -The number of threads used to transfer is controlled by -`--multi-thread-streams`. +### --backup-dir=DIR ### -Use `-vv` if you wish to see info about the threads. +When using `sync`, `copy` or `move` any files which would have been +overwritten or deleted are moved in their original hierarchy into this +directory. -This will work with the `sync`/`copy`/`move` commands and friends -`copyto`/`moveto`. Multi thread transfers will be used with `rclone -mount` and `rclone serve` if `--vfs-cache-mode` is set to `writes` or -above. +If `--suffix` is set, then the moved files will have the suffix added +to them. If there is a file with the same path (after the suffix has +been added) in DIR, then it will be overwritten. -**NB** that this **only** works with supported backends as the -destination but will work with any backend as the source. +The remote in use must support server-side move or copy and you must +use the same remote as the destination of the sync. The backup +directory must not overlap the destination directory without it being +excluded by a filter rule. -**NB** that multi-thread copies are disabled for local to local copies -as they are faster without unless `--multi-thread-streams` is set -explicitly. +For example -**NB** on Windows using multi-thread transfers to the local disk will -cause the resulting files to be [sparse](https://en.wikipedia.org/wiki/Sparse_file). -Use `--local-no-sparse` to disable sparse files (which may cause long -delays at the start of transfers) or disable multi-thread transfers -with `--multi-thread-streams 0` + rclone sync --interactive /path/to/local remote:current --backup-dir remote:old -### --multi-thread-streams=N ### +will sync `/path/to/local` to `remote:current`, but for any files +which would have been updated or deleted will be stored in +`remote:old`. -When using multi thread transfers (see above `--multi-thread-cutoff`) -this sets the number of streams to use. Set to `0` to disable multi -thread transfers (Default 4). +If running rclone from a script you might want to use today's date as +the directory name passed to `--backup-dir` to store the old files, or +you might want to pass `--suffix` with today's date. -If the backend has a `--backend-upload-concurrency` setting (eg -`--s3-upload-concurrency`) then this setting will be used as the -number of transfers instead if it is larger than the value of -`--multi-thread-streams` or `--multi-thread-streams` isn't set. +See `--compare-dest` and `--copy-dest`. -### --no-check-dest ### +### --bind string ### -The `--no-check-dest` can be used with `move` or `copy` and it causes -rclone not to check the destination at all when copying files. +Local address to bind to for outgoing connections. This can be an +IPv4 address (1.2.3.4), an IPv6 address (1234::789A) or host name. If +the host name doesn't resolve or resolves to more than one IP address +it will give an error. -This means that: +You can use `--bind 0.0.0.0` to force rclone to use IPv4 addresses and +`--bind ::0` to force rclone to use IPv6 addresses. -- the destination is not listed minimising the API calls -- files are always transferred -- this can cause duplicates on remotes which allow it (e.g. Google Drive) -- `--retries 1` is recommended otherwise you'll transfer everything again on a retry +### --bwlimit=BANDWIDTH_SPEC ### -This flag is useful to minimise the transactions if you know that none -of the files are on the destination. +This option controls the bandwidth limit. For example -This is a specialized flag which should be ignored by most users! + --bwlimit 10M -### --no-gzip-encoding ### +would mean limit the upload and download bandwidth to 10 MiB/s. +**NB** this is **bytes** per second not **bits** per second. To use a +single limit, specify the desired bandwidth in KiB/s, or use a +suffix B|K|M|G|T|P. The default is `0` which means to not limit bandwidth. -Don't set `Accept-Encoding: gzip`. This means that rclone won't ask -the server for compressed files automatically. Useful if you've set -the server to return files with `Content-Encoding: gzip` but you -uploaded compressed files. +The upload and download bandwidth can be specified separately, as +`--bwlimit UP:DOWN`, so -There is no need to set this in normal operation, and doing so will -decrease the network transfer efficiency of rclone. + --bwlimit 10M:100k -### --no-traverse ### +would mean limit the upload bandwidth to 10 MiB/s and the download +bandwidth to 100 KiB/s. Either limit can be "off" meaning no limit, so +to just limit the upload bandwidth you would use -The `--no-traverse` flag controls whether the destination file system -is traversed when using the `copy` or `move` commands. -`--no-traverse` is not compatible with `sync` and will be ignored if -you supply it with `sync`. + --bwlimit 10M:off -If you are only copying a small number of files (or are filtering most -of the files) and/or have a large number of files on the destination -then `--no-traverse` will stop rclone listing the destination and save -time. +this would limit the upload bandwidth to 10 MiB/s but the download +bandwidth would be unlimited. -However, if you are copying a large number of files, especially if you -are doing a copy where lots of the files under consideration haven't -changed and won't need copying then you shouldn't use `--no-traverse`. +When specified as above the bandwidth limits last for the duration of +run of the rclone binary. -See [rclone copy](https://rclone.org/commands/rclone_copy/) for an example of how to use it. +It is also possible to specify a "timetable" of limits, which will +cause certain limits to be applied at certain times. To specify a +timetable, format your entries as `WEEKDAY-HH:MM,BANDWIDTH +WEEKDAY-HH:MM,BANDWIDTH...` where: `WEEKDAY` is optional element. -### --no-unicode-normalization ### +- `BANDWIDTH` can be a single number, e.g.`100k` or a pair of numbers +for upload:download, e.g.`10M:1M`. +- `WEEKDAY` can be written as the whole word or only using the first 3 + characters. It is optional. +- `HH:MM` is an hour from 00:00 to 23:59. -Don't normalize unicode characters in filenames during the sync routine. +An example of a typical timetable to avoid link saturation during daytime +working hours could be: -Sometimes, an operating system will store filenames containing unicode -parts in their decomposed form (particularly macOS). Some cloud storage -systems will then recompose the unicode, resulting in duplicate files if -the data is ever copied back to a local filesystem. +`--bwlimit "08:00,512k 12:00,10M 13:00,512k 18:00,30M 23:00,off"` -Using this flag will disable that functionality, treating each unicode -character as unique. For example, by default é and é will be normalized -into the same character. With `--no-unicode-normalization` they will be -treated as unique characters. +In this example, the transfer bandwidth will be set to 512 KiB/s +at 8am every day. At noon, it will rise to 10 MiB/s, and drop back +to 512 KiB/sec at 1pm. At 6pm, the bandwidth limit will be set to +30 MiB/s, and at 11pm it will be completely disabled (full speed). +Anything between 11pm and 8am will remain unlimited. -### --no-update-modtime ### +An example of timetable with `WEEKDAY` could be: -When using this flag, rclone won't update modification times of remote -files if they are incorrect as it would normally. +`--bwlimit "Mon-00:00,512 Fri-23:59,10M Sat-10:00,1M Sun-20:00,off"` -This can be used if the remote is being synced with another tool also -(e.g. the Google Drive client). +It means that, the transfer bandwidth will be set to 512 KiB/s on +Monday. It will rise to 10 MiB/s before the end of Friday. At 10:00 +on Saturday it will be set to 1 MiB/s. From 20:00 on Sunday it will +be unlimited. -### --order-by string ### +Timeslots without `WEEKDAY` are extended to the whole week. So this +example: -The `--order-by` flag controls the order in which files in the backlog -are processed in `rclone sync`, `rclone copy` and `rclone move`. +`--bwlimit "Mon-00:00,512 12:00,1M Sun-20:00,off"` -The order by string is constructed like this. The first part -describes what aspect is being measured: +Is equivalent to this: -- `size` - order by the size of the files -- `name` - order by the full path of the files -- `modtime` - order by the modification date of the files +`--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"` -This can have a modifier appended with a comma: +Bandwidth limit apply to the data transfer for all backends. For most +backends the directory listing bandwidth is also included (exceptions +being the non HTTP backends, `ftp`, `sftp` and `storj`). -- `ascending` or `asc` - order so that the smallest (or oldest) is processed first -- `descending` or `desc` - order so that the largest (or newest) is processed first -- `mixed` - order so that the smallest is processed first for some threads and the largest for others +Note that the units are **Byte/s**, not **bit/s**. Typically +connections are measured in bit/s - to convert divide by 8. For +example, let's say you have a 10 Mbit/s connection and you wish rclone +to use half of it - 5 Mbit/s. This is 5/8 = 0.625 MiB/s so you would +use a `--bwlimit 0.625M` parameter for rclone. -If the modifier is `mixed` then it can have an optional percentage -(which defaults to `50`), e.g. `size,mixed,25` which means that 25% of -the threads should be taking the smallest items and 75% the -largest. The threads which take the smallest first will always take -the smallest first and likewise the largest first threads. The `mixed` -mode can be useful to minimise the transfer time when you are -transferring a mixture of large and small files - the large files are -guaranteed upload threads and bandwidth and the small files will be -processed continuously. +On Unix systems (Linux, macOS, …) the bandwidth limiter can be toggled by +sending a `SIGUSR2` signal to rclone. This allows to remove the limitations +of a long running rclone transfer and to restore it back to the value specified +with `--bwlimit` quickly when needed. Assuming there is only one rclone instance +running, you can toggle the limiter like this: -If no modifier is supplied then the order is `ascending`. + kill -SIGUSR2 $(pidof rclone) -For example +If you configure rclone with a [remote control](/rc) then you can use +change the bwlimit dynamically: -- `--order-by size,desc` - send the largest files first -- `--order-by modtime,ascending` - send the oldest files first -- `--order-by name` - send the files with alphabetically by path first + rclone rc core/bwlimit rate=1M -If the `--order-by` flag is not supplied or it is supplied with an -empty string then the default ordering will be used which is as -scanned. With `--checkers 1` this is mostly alphabetical, however -with the default `--checkers 8` it is somewhat random. +### --bwlimit-file=BANDWIDTH_SPEC ### -#### Limitations +This option controls per file bandwidth limit. For the options see the +`--bwlimit` flag. -The `--order-by` flag does not do a separate pass over the data. This -means that it may transfer some files out of the order specified if +For example use this to allow no transfers to be faster than 1 MiB/s -- there are no files in the backlog or the source has not been fully scanned yet -- there are more than [--max-backlog](#max-backlog-n) files in the backlog + --bwlimit-file 1M -Rclone will do its best to transfer the best file it has so in -practice this should not cause a problem. Think of `--order-by` as -being more of a best efforts flag rather than a perfect ordering. +This can be used in conjunction with `--bwlimit`. -If you want perfect ordering then you will need to specify -[--check-first](#check-first) which will find all the files which need -transferring first before transferring any. +Note that if a schedule is provided the file will use the schedule in +effect at the start of the transfer. -### --password-command SpaceSepList ### +### --buffer-size=SIZE ### -This flag supplies a program which should supply the config password -when run. This is an alternative to rclone prompting for the password -or setting the `RCLONE_CONFIG_PASS` variable. +Use this sized buffer to speed up file transfers. Each `--transfer` +will use this much memory for buffering. -The argument to this should be a command with a space separated list -of arguments. If one of the arguments has a space in then enclose it -in `"`, if you want a literal `"` in an argument then enclose the -argument in `"` and double the `"`. See [CSV encoding](https://godoc.org/encoding/csv) -for more info. +When using `mount` or `cmount` each open file descriptor will use this much +memory for buffering. +See the [mount](https://rclone.org/commands/rclone_mount/#file-buffering) documentation for more details. -Eg +Set to `0` to disable the buffering for the minimum memory usage. - --password-command echo hello - --password-command echo "hello with space" - --password-command echo "hello with ""quotes"" and space" +Note that the memory allocation of the buffers is influenced by the +[--use-mmap](#use-mmap) flag. -See the [Configuration Encryption](#configuration-encryption) for more info. +### --cache-dir=DIR ### -See a [Windows PowerShell example on the Wiki](https://github.com/rclone/rclone/wiki/Windows-Powershell-use-rclone-password-command-for-Config-file-password). +Specify the directory rclone will use for caching, to override +the default. -### -P, --progress ### +Default value is depending on operating system: +- Windows `%LocalAppData%\rclone`, if `LocalAppData` is defined. +- macOS `$HOME/Library/Caches/rclone` if `HOME` is defined. +- Unix `$XDG_CACHE_HOME/rclone` if `XDG_CACHE_HOME` is defined, else `$HOME/.cache/rclone` if `HOME` is defined. +- Fallback (on all OS) to `$TMPDIR/rclone`, where `TMPDIR` is the value from [--temp-dir](#temp-dir-dir). -This flag makes rclone update the stats in a static block in the -terminal providing a realtime overview of the transfer. +You can use the [config paths](https://rclone.org/commands/rclone_config_paths/) +command to see the current value. -Any log messages will scroll above the static block. Log messages -will push the static block down to the bottom of the terminal where it -will stay. +Cache directory is heavily used by the [VFS File Caching](https://rclone.org/commands/rclone_mount/#vfs-file-caching) +mount feature, but also by [serve](https://rclone.org/commands/rclone_serve/), [GUI](/gui) and other parts of rclone. -Normally this is updated every 500mS but this period can be overridden -with the `--stats` flag. +### --check-first ### -This can be used with the `--stats-one-line` flag for a simpler -display. +If this flag is set then in a `sync`, `copy` or `move`, rclone will do +all the checks to see whether files need to be transferred before +doing any of the transfers. Normally rclone would start running +transfers as soon as possible. -Note: On Windows until [this bug](https://github.com/Azure/go-ansiterm/issues/26) -is fixed all non-ASCII characters will be replaced with `.` when -`--progress` is in use. +This flag can be useful on IO limited systems where transfers +interfere with checking. -### --progress-terminal-title ### +It can also be useful to ensure perfect ordering when using +`--order-by`. -This flag, when used with `-P/--progress`, will print the string `ETA: %s` -to the terminal title. +If both `--check-first` and `--order-by` are set when doing `rclone move` +then rclone will use the transfer thread to delete source files which +don't need transferring. This will enable perfect ordering of the +transfers and deletes but will cause the transfer stats to have more +items in than expected. -### -q, --quiet ### +Using this flag can use more memory as it effectively sets +`--max-backlog` to infinite. This means that all the info on the +objects to transfer is held in memory before the transfers start. -This flag will limit rclone's output to error messages only. +### --checkers=N ### -### --refresh-times ### +Originally controlling just the number of file checkers to run in parallel, +e.g. by `rclone copy`. Now a fairly universal parallelism control +used by `rclone` in several places. -The `--refresh-times` flag can be used to update modification times of -existing files when they are out of sync on backends which don't -support hashes. +Note: checkers do the equality checking of files during a sync. +For some storage systems (e.g. S3, Swift, Dropbox) this can take +a significant amount of time so they are run in parallel. -This is useful if you uploaded files with the incorrect timestamps and -you now wish to correct them. +The default is to run 8 checkers in parallel. However, in case +of slow-reacting backends you may need to lower (rather than increase) +this default by setting `--checkers` to 4 or less threads. This is +especially advised if you are experiencing backend server crashes +during file checking phase (e.g. on subsequent or top-up backups +where little or no file copying is done and checking takes up +most of the time). Increase this setting only with utmost care, +while monitoring your server health and file checking throughput. -This flag is **only** useful for destinations which don't support -hashes (e.g. `crypt`). +### -c, --checksum ### -This can be used any of the sync commands `sync`, `copy` or `move`. +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. -To use this flag you will need to be doing a modification time sync -(so not using `--size-only` or `--checksum`). The flag will have no -effect when using `--size-only` or `--checksum`. +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. -If this flag is used when rclone comes to upload a file it will check -to see if there is an existing file on the destination. If this file -matches the source with size (and checksum if available) but has a -differing timestamp then instead of re-uploading it, rclone will -update the timestamp on the destination file. If the checksum does not -match rclone will upload the new file. If the checksum is absent (e.g. -on a `crypt` backend) then rclone will update the timestamp. +This is very useful when transferring between remotes which store the +same hash type on the object, e.g. Drive and Swift. For details of which +remotes support which hash type see the table in the [overview +section](https://rclone.org/overview/). -Note that some remotes can't set the modification time without -re-uploading the file so this flag is less useful on them. +Eg `rclone --checksum sync s3:/bucket swift:/bucket` would run much +quicker than without the `--checksum` flag. -Normally if you are doing a modification time sync rclone will update -modification times without `--refresh-times` provided that the remote -supports checksums **and** the checksums match on the file. However if the -checksums are absent then rclone will upload the file rather than -setting the timestamp as this is the safe behaviour. +When using this flag, rclone won't update mtimes of remote files if +they are incorrect as it would normally. -### --retries int ### +### --color WHEN ### -Retry the entire sync if it fails this many times it fails (default 3). +Specify when colors (and other ANSI codes) should be added to the output. -Some remotes can be unreliable and a few retries help pick up the -files which didn't get transferred because of errors. +`AUTO` (default) only allows ANSI codes when the output is a terminal -Disable retries with `--retries 1`. +`NEVER` never allow ANSI codes -### --retries-sleep=TIME ### +`ALWAYS` always add ANSI codes, regardless of the output format (terminal or file) -This sets the interval between each retry specified by `--retries` +### --compare-dest=DIR ### -The default is `0`. Use `0` to disable. +When using `sync`, `copy` or `move` DIR is checked in addition to the +destination for files. If a file identical to the source is found that +file is NOT copied from source. This is useful to copy just files that +have changed since the last backup. -### --server-side-across-configs ### +You must use the same remote as the destination of the sync. The +compare directory must not overlap the destination directory. -Allow server-side operations (e.g. copy or move) to work across -different configurations. +See `--copy-dest` and `--backup-dir`. -This can be useful if you wish to do a server-side copy or move -between two remotes which use the same backend but are configured -differently. +### --config=CONFIG_FILE ### -Note that this isn't enabled by default because it isn't easy for -rclone to tell if it will work between any two configurations. +Specify the location of the rclone configuration file, to override +the default. E.g. `rclone config --config="rclone.conf"`. -### --size-only ### +The exact default is a bit complex to describe, due to changes +introduced through different versions of rclone while preserving +backwards compatibility, but in most cases it is as simple as: -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. + - `%APPDATA%/rclone/rclone.conf` on Windows + - `~/.config/rclone/rclone.conf` on other -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. +The complete logic is as follows: Rclone will look for an existing +configuration file in any of the following locations, in priority order: -### --stats=TIME ### + 1. `rclone.conf` (in program directory, where rclone executable is) + 2. `%APPDATA%/rclone/rclone.conf` (only on Windows) + 3. `$XDG_CONFIG_HOME/rclone/rclone.conf` (on all systems, including Windows) + 4. `~/.config/rclone/rclone.conf` (see below for explanation of ~ symbol) + 5. `~/.rclone.conf` -Commands which transfer data (`sync`, `copy`, `copyto`, `move`, -`moveto`) will print data transfer stats at regular intervals to show -their progress. +If no existing configuration file is found, then a new one will be created +in the following location: -This sets the interval. +- On Windows: Location 2 listed above, except in the unlikely event + that `APPDATA` is not defined, then location 4 is used instead. +- On Unix: Location 3 if `XDG_CONFIG_HOME` is defined, else location 4. +- Fallback to location 5 (on all OS), when the rclone directory cannot be + created, but if also a home directory was not found then path + `.rclone.conf` relative to current working directory will be used as + a final resort. -The default is `1m`. Use `0` to disable. +The `~` symbol in paths above represent the home directory of the current user +on any OS, and the value is defined as following: -If you set the stats interval then all commands can show stats. This -can be useful when running other commands, `check` or `mount` for -example. + - On Windows: `%HOME%` if defined, else `%USERPROFILE%`, or else `%HOMEDRIVE%\%HOMEPATH%`. + - On Unix: `$HOME` if defined, else by looking up current user in OS-specific user database + (e.g. passwd file), or else use the result from shell command `cd && pwd`. -Stats are logged at `INFO` level by default which means they won't -show at default log level `NOTICE`. Use `--stats-log-level NOTICE` or -`-v` to make them show. See the [Logging section](#logging) for more -info on log levels. +If you run `rclone config file` you will see where the default +location is for you. -Note that on macOS you can send a SIGINFO (which is normally ctrl-T in -the terminal) to make the stats print immediately. +The fact that an existing file `rclone.conf` in the same directory +as the rclone executable is always preferred, means that it is easy +to run in "portable" mode by downloading rclone executable to a +writable directory and then create an empty file `rclone.conf` in the +same directory. -### --stats-file-name-length integer ### -By default, the `--stats` output will truncate file names and paths longer -than 40 characters. This is equivalent to providing -`--stats-file-name-length 40`. Use `--stats-file-name-length 0` to disable -any truncation of file names printed by stats. +If the location is set to empty string `""` or path to a file +with name `notfound`, or the os null device represented by value `NUL` on +Windows and `/dev/null` on Unix systems, then rclone will keep the +config file in memory only. -### --stats-log-level string ### +The file format is basic [INI](https://en.wikipedia.org/wiki/INI_file#Format): +Sections of text, led by a `[section]` header and followed by +`key=value` entries on separate lines. In rclone each remote is +represented by its own section, where the section name defines the +name of the remote. Options are specified as the `key=value` entries, +where the key is the option name without the `--backend-` prefix, +in lowercase and with `_` instead of `-`. E.g. option `--mega-hard-delete` +corresponds to key `hard_delete`. Only backend options can be specified. +A special, and required, key `type` identifies the [storage system](https://rclone.org/overview/), +where the value is the internal lowercase name as returned by command +`rclone help backends`. Comments are indicated by `;` or `#` at the +beginning of a line. -Log level to show `--stats` output at. This can be `DEBUG`, `INFO`, -`NOTICE`, or `ERROR`. The default is `INFO`. This means at the -default level of logging which is `NOTICE` the stats won't show - if -you want them to then use `--stats-log-level NOTICE`. See the [Logging -section](#logging) for more info on log levels. +Example: -### --stats-one-line ### + [megaremote] + type = mega + user = you@example.com + pass = PDPcQVVjVtzFY-GTdDFozqBhTdsPg3qH -When this is specified, rclone condenses the stats into a single line -showing the most important stats only. +Note that passwords are in [obscured](https://rclone.org/commands/rclone_obscure/) +form. Also, many storage systems uses token-based authentication instead +of passwords, and this requires additional steps. It is easier, and safer, +to use the interactive command `rclone config` instead of manually +editing the configuration file. -### --stats-one-line-date ### +The configuration file will typically contain login information, and +should therefore have restricted permissions so that only the current user +can read it. Rclone tries to ensure this when it writes the file. +You may also choose to [encrypt](#configuration-encryption) the file. -When this is specified, rclone enables the single-line stats and prepends -the display with a date string. The default is `2006/01/02 15:04:05 - ` +When token-based authentication are used, the configuration file +must be writable, because rclone needs to update the tokens inside it. -### --stats-one-line-date-format ### +To reduce risk of corrupting an existing configuration file, rclone +will not write directly to it when saving changes. Instead it will +first write to a new, temporary, file. If a configuration file already +existed, it will (on Unix systems) try to mirror its permissions to +the new file. Then it will rename the existing file to a temporary +name as backup. Next, rclone will rename the new file to the correct name, +before finally cleaning up by deleting the backup file. -When this is specified, rclone enables the single-line stats and prepends -the display with a user-supplied date string. The date string MUST be -enclosed in quotes. Follow [golang specs](https://golang.org/pkg/time/#Time.Format) for -date formatting syntax. +If the configuration file path used by rclone is a symbolic link, then +this will be evaluated and rclone will write to the resolved path, instead +of overwriting the symbolic link. Temporary files used in the process +(described above) will be written to the same parent directory as that +of the resolved configuration file, but if this directory is also a +symbolic link it will not be resolved and the temporary files will be +written to the location of the directory symbolic link. -### --stats-unit=bits|bytes ### +### --contimeout=TIME ### -By default, data transfer rates will be printed in bytes per second. +Set the connection timeout. This should be in go time format which +looks like `5s` for 5 seconds, `10m` for 10 minutes, or `3h30m`. -This option allows the data rate to be printed in bits per second. +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 +`1m` by default. -Data transfer volume will still be reported in bytes. +### --copy-dest=DIR ### -The rate is reported as a binary unit, not SI unit. So 1 Mbit/s -equals 1,048,576 bit/s and not 1,000,000 bit/s. +When using `sync`, `copy` or `move` DIR is checked in addition to the +destination for files. If a file identical to the source is found that +file is server-side copied from DIR to the destination. This is useful +for incremental backup. -The default is `bytes`. +The remote in use must support server-side copy and you must +use the same remote as the destination of the sync. The compare +directory must not overlap the destination directory. -### --suffix=SUFFIX ### +See `--compare-dest` and `--backup-dir`. -When using `sync`, `copy` or `move` any files which would have been -overwritten or deleted will have the suffix added to them. If there -is a file with the same path (after the suffix has been added), then -it will be overwritten. +### --dedupe-mode MODE ### -The remote in use must support server-side move or copy and you must -use the same remote as the destination of the sync. +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. -This is for use with files to add the suffix in the current directory -or with `--backup-dir`. See `--backup-dir` for more info. +### --default-time TIME ### -For example +If a file or directory does have a modification time rclone can read +then rclone will display this fixed time instead. - rclone copy --interactive /path/to/local/file remote:current --suffix .bak +The default is `2000-01-01 00:00:00 UTC`. This can be configured in +any of the ways shown in [the time or duration options](#time-option). -will copy `/path/to/local` to `remote:current`, but for any files -which would have been updated or deleted have .bak added. +For example `--default-time 2020-06-01` to set the default time to the +1st of June 2020 or `--default-time 0s` to set the default time to the +time rclone started up. -If using `rclone sync` with `--suffix` and without `--backup-dir` then -it is recommended to put a filter rule in excluding the suffix -otherwise the `sync` will delete the backup files. +### --disable FEATURE,FEATURE,... ### - rclone sync --interactive /path/to/local/file remote:current --suffix .bak --exclude "*.bak" +This disables a comma separated list of optional features. For example +to disable server-side move and server-side copy use: -### --suffix-keep-extension ### + --disable move,copy -When using `--suffix`, setting this causes rclone put the SUFFIX -before the extension of the files that it backs up rather than after. +The features can be put in any case. -So let's say we had `--suffix -2019-01-01`, without the flag `file.txt` -would be backed up to `file.txt-2019-01-01` and with the flag it would -be backed up to `file-2019-01-01.txt`. This can be helpful to make -sure the suffixed files can still be opened. +To see a list of which features can be disabled use: -If a file has two (or more) extensions and the second (or subsequent) -extension is recognised as a valid mime type, then the suffix will go -before that extension. So `file.tar.gz` would be backed up to -`file-2019-01-01.tar.gz` whereas `file.badextension.gz` would be -backed up to `file.badextension-2019-01-01.gz`. + --disable help -### --syslog ### +The features a remote has can be seen in JSON format with: -On capable OSes (not Windows or Plan9) send all log output to syslog. + rclone backend features remote: -This can be useful for running rclone in a script or `rclone mount`. +See the overview [features](https://rclone.org/overview/#features) and +[optional features](https://rclone.org/overview/#optional-features) to get an idea of +which feature does what. -### --syslog-facility string ### +Note that some features can be set to `true` if they are `true`/`false` +feature flag features by prefixing them with `!`. For example the +`CaseInsensitive` feature can be forced to `false` with `--disable CaseInsensitive` +and forced to `true` with `--disable '!CaseInsensitive'`. In general +it isn't a good idea doing this but it may be useful in extremis. -If using `--syslog` this sets the syslog facility (e.g. `KERN`, `USER`). -See `man syslog` for a list of possible facilities. The default -facility is `DAEMON`. +(Note that `!` is a shell command which you will +need to escape with single quotes or a backslash on unix like +platforms.) -### --temp-dir=DIR ### +This flag can be useful for debugging and in exceptional circumstances +(e.g. Google Drive limiting the total volume of Server Side Copies to +100 GiB/day). -Specify the directory rclone will use for temporary files, to override -the default. Make sure the directory exists and have accessible permissions. +### --disable-http2 -By default the operating system's temp directory will be used: -- On Unix systems, `$TMPDIR` if non-empty, else `/tmp`. -- On Windows, the first non-empty value from `%TMP%`, `%TEMP%`, `%USERPROFILE%`, or the Windows directory. +This stops rclone from trying to use HTTP/2 if available. This can +sometimes speed up transfers due to a +[problem in the Go standard library](https://github.com/golang/go/issues/37373). -When overriding the default with this option, the specified path will be -set as value of environment variable `TMPDIR` on Unix systems -and `TMP` and `TEMP` on Windows. +### --dscp VALUE ### -You can use the [config paths](https://rclone.org/commands/rclone_config_paths/) -command to see the current value. +Specify a DSCP value or name to use in connections. This could help QoS +system to identify traffic class. BE, EF, DF, LE, CSx and AFxx are allowed. -### --tpslimit float ### +See the description of [differentiated services](https://en.wikipedia.org/wiki/Differentiated_services) to get an idea of +this field. Setting this to 1 (LE) to identify the flow to SCAVENGER class +can avoid occupying too much bandwidth in a network with DiffServ support ([RFC 8622](https://tools.ietf.org/html/rfc8622)). -Limit transactions per second to this number. Default is 0 which is -used to mean unlimited transactions per second. +For example, if you configured QoS on router to handle LE properly. Running: +``` +rclone copy --dscp LE from:/from to:/to +``` +would make the priority lower than usual internet flows. -A transaction is roughly defined as an API call; its exact meaning -will depend on the backend. For HTTP based backends it is an HTTP -PUT/GET/POST/etc and its response. For FTP/SFTP it is a round trip -transaction over TCP. +This option has no effect on Windows (see [golang/go#42728](https://github.com/golang/go/issues/42728)). -For example, to limit rclone to 10 transactions per second use -`--tpslimit 10`, or to 1 transaction every 2 seconds use `--tpslimit -0.5`. +### -n, --dry-run ### -Use this when the number of transactions per second from rclone is -causing a problem with the cloud storage provider (e.g. getting you -banned or rate limited). +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 `sync` +command which deletes files in the destination. -This can be very useful for `rclone mount` to control the behaviour of -applications using it. +### --expect-continue-timeout=TIME ### -This limit applies to all HTTP based backends and to the FTP and SFTP -backends. It does not apply to the local backend or the Storj backend. +This specifies the amount of time to wait for a server's first +response headers after fully writing the request headers if the +request has an "Expect: 100-continue" header. Not all backends support +using this. -See also `--tpslimit-burst`. +Zero means no timeout and causes the body to be sent immediately, +without waiting for the server to approve. This time does not include +the time to send the request header. -### --tpslimit-burst int ### +The default is `1s`. Set to `0` to disable. -Max burst of transactions for `--tpslimit` (default `1`). +### --error-on-no-transfer ### -Normally `--tpslimit` will do exactly the number of transaction per -second specified. However if you supply `--tps-burst` then rclone can -save up some transactions from when it was idle giving a burst of up -to the parameter supplied. +By default, rclone will exit with return code 0 if there were no errors. -For example if you provide `--tpslimit-burst 10` then if rclone has -been idle for more than 10*`--tpslimit` then it can do 10 transactions -very quickly before they are limited again. +This option allows rclone to return exit code 9 if no files were transferred +between the source and destination. This allows using rclone in scripts, and +triggering follow-on actions if data was copied, or skipping if not. -This may be used to increase performance of `--tpslimit` without -changing the long term average number of transactions per second. +NB: Enabling this option turns a usually non-fatal error into a potentially +fatal one - please check and adjust your scripts accordingly! -### --track-renames ### +### --fs-cache-expire-duration=TIME -By default, rclone doesn't keep track of renamed files, so if you -rename a file locally then sync it to a remote, rclone will delete the -old file on the remote and upload a new copy. +When using rclone via the API rclone caches created remotes for 5 +minutes by default in the "fs cache". This means that if you do +repeated actions on the same remote then rclone won't have to build it +again from scratch, which makes it more efficient. -An rclone sync with `--track-renames` runs like a normal sync, but keeps -track of objects which exist in the destination but not in the source -(which would normally be deleted), and which objects exist in the -source but not the destination (which would normally be transferred). -These objects are then candidates for renaming. +This flag sets the time that the remotes are cached for. If you set it +to `0` (or negative) then rclone won't cache the remotes at all. -After the sync, rclone matches up the source only and destination only -objects using the `--track-renames-strategy` specified and either -renames the destination object or transfers the source and deletes the -destination object. `--track-renames` is stateless like all of -rclone's syncs. +Note that if you use some flags, eg `--backup-dir` and if this is set +to `0` rclone may build two remotes (one for the source or destination +and one for the `--backup-dir` where it may have only built one +before. -To use this flag the destination must support server-side copy or -server-side move, and to use a hash based `--track-renames-strategy` -(the default) the source and the destination must have a compatible -hash. +### --fs-cache-expire-interval=TIME -If the destination does not support server-side copy or move, rclone -will fall back to the default behaviour and log an error level message -to the console. +This controls how often rclone checks for cached remotes to expire. +See the `--fs-cache-expire-duration` documentation above for more +info. The default is 60s, set to 0 to disable expiry. -Encrypted destinations are not currently supported by `--track-renames` -if `--track-renames-strategy` includes `hash`. +### --header ### -Note that `--track-renames` is incompatible with `--no-traverse` and -that it uses extra memory to keep track of all the rename candidates. +Add an HTTP header for all transactions. The flag can be repeated to +add multiple headers. -Note also that `--track-renames` is incompatible with -`--delete-before` and will select `--delete-after` instead of -`--delete-during`. +If you want to add headers only for uploads use `--header-upload` and +if you want to add headers only for downloads use `--header-download`. -### --track-renames-strategy (hash,modtime,leaf,size) ### +This flag is supported for all HTTP based backends even those not +supported by `--header-upload` and `--header-download` so may be used +as a workaround for those with care. -This option changes the file matching criteria for `--track-renames`. +``` +rclone ls remote:test --header "X-Rclone: Foo" --header "X-LetMeIn: Yes" +``` -The matching is controlled by a comma separated selection of these tokens: +### --header-download ### -- `modtime` - the modification time of the file - not supported on all backends -- `hash` - the hash of the file contents - not supported on all backends -- `leaf` - the name of the file not including its directory name -- `size` - the size of the file (this is always enabled) +Add an HTTP header for all download transactions. The flag can be repeated to +add multiple headers. -The default option is `hash`. +``` +rclone sync --interactive s3:test/src ~/dst --header-download "X-Amz-Meta-Test: Foo" --header-download "X-Amz-Meta-Test2: Bar" +``` -Using `--track-renames-strategy modtime,leaf` would match files -based on modification time, the leaf of the file name and the size -only. +See the GitHub issue [here](https://github.com/rclone/rclone/issues/59) for +currently supported backends. -Using `--track-renames-strategy modtime` or `leaf` can enable -`--track-renames` support for encrypted destinations. +### --header-upload ### -Note that the `hash` strategy is not supported with encrypted destinations. +Add an HTTP header for all upload transactions. The flag can be repeated to add +multiple headers. -### --delete-(before,during,after) ### +``` +rclone sync --interactive ~/src s3:test/dst --header-upload "Content-Disposition: attachment; filename='cool.html'" --header-upload "X-Amz-Meta-Test: FooBar" +``` -This option allows you to specify when files on your destination are -deleted when you sync folders. +See the GitHub issue [here](https://github.com/rclone/rclone/issues/59) for +currently supported backends. -Specifying the value `--delete-before` will delete all files present -on the destination, but not on the source *before* starting the -transfer of any new or updated files. This uses two passes through the -file systems, one for the deletions and one for the copies. +### --human-readable ### -Specifying `--delete-during` will delete files while checking and -uploading files. This is the fastest option and uses the least memory. +Rclone commands output values for sizes (e.g. number of bytes) and +counts (e.g. number of files) either as *raw* numbers, or +in *human-readable* format. -Specifying `--delete-after` (the default value) will delay deletion of -files until all new/updated files have been successfully transferred. -The files to be deleted are collected in the copy pass then deleted -after the copy pass has completed successfully. The files to be -deleted are held in memory so this mode may use more memory. This is -the safest mode as it will only delete files if there have been no -errors subsequent to that. If there have been errors before the -deletions start then you will get the message `not deleting files as -there were IO errors`. +In human-readable format the values are scaled to larger units, indicated with +a suffix shown after the value, and rounded to three decimals. Rclone consistently +uses binary units (powers of 2) for sizes and decimal units (powers of 10) for counts. +The unit prefix for size is according to IEC standard notation, e.g. `Ki` for kibi. +Used with byte unit, `1 KiB` means 1024 Byte. In list type of output, only the +unit prefix appended to the value (e.g. `9.762Ki`), while in more textual output +the full unit is shown (e.g. `9.762 KiB`). For counts the SI standard notation is +used, e.g. prefix `k` for kilo. Used with file counts, `1k` means 1000 files. -### --fast-list ### +The various [list](https://rclone.org/commands/rclone_ls/) commands output raw numbers by default. +Option `--human-readable` will make them output values in human-readable format +instead (with the short unit prefix). -When doing anything which involves a directory listing (e.g. `sync`, -`copy`, `ls` - in fact nearly every command), rclone normally lists a -directory and processes it before using more directory lists to -process any subdirectories. This can be parallelised and works very -quickly using the least amount of memory. - -However, some remotes have a way of listing all files beneath a -directory in one (or a small number) of transactions. These tend to -be the bucket-based remotes (e.g. S3, B2, GCS, Swift). - -If you use the `--fast-list` flag then rclone will use this method for -listing directories. This will have the following consequences for -the listing: - - * It **will** use fewer transactions (important if you pay for them) - * It **will** use more memory. Rclone has to load the whole listing into memory. - * It *may* be faster because it uses fewer transactions - * It *may* be slower because it can't be parallelized - -rclone should always give identical results with and without -`--fast-list`. - -If you pay for transactions and can fit your entire sync listing into -memory then `--fast-list` is recommended. If you have a very big sync -to do then don't use `--fast-list` otherwise you will run out of -memory. +The [about](https://rclone.org/commands/rclone_about/) command outputs human-readable by default, +with a command-specific option `--full` to output the raw numbers instead. -If you use `--fast-list` on a remote which doesn't support it, then -rclone will just ignore it. +Command [size](https://rclone.org/commands/rclone_size/) outputs both human-readable and raw numbers +in the same output. -### --timeout=TIME ### +The [tree](https://rclone.org/commands/rclone_tree/) command also considers `--human-readable`, but +it will not use the exact same notation as the other commands: It rounds to one +decimal, and uses single letter suffix, e.g. `K` instead of `Ki`. The reason for +this is that it relies on an external library. -This sets the IO idle timeout. If a transfer has started but then -becomes idle for this long it is considered broken and disconnected. +The interactive command [ncdu](https://rclone.org/commands/rclone_ncdu/) shows human-readable by +default, and responds to key `u` for toggling human-readable format. -The default is `5m`. Set to `0` to disable. +### --ignore-case-sync ### -### --transfers=N ### +Using this option will cause rclone to ignore the case of the files +when synchronizing so files will not be copied/synced when the +existing filenames are the same, even if the casing is different. -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. +### --ignore-checksum ### -The default is to run 4 file transfers in parallel. +Normally rclone will check that the checksums of transferred files +match, and give an error "corrupted on transfer" if they don't. -Look at --multi-thread-streams if you would like to control single file transfers. +You can use this option to skip that check. You should only use it if +you have had the "corrupted on transfer" error message and you are +sure you might want to transfer potentially corrupted data. -### -u, --update ### +### --ignore-existing ### -This forces rclone to skip any files which exist on the destination -and have a modified time that is newer than the source file. +Using this option will make rclone unconditionally skip all files +that exist on the destination, no matter the content of these files. -This can be useful in avoiding needless transfers when transferring to -a remote which doesn't support modification times directly (or when -using `--use-server-modtime` to avoid extra API calls) as it is more -accurate than a `--size-only` check and faster than using -`--checksum`. On such remotes (or when using `--use-server-modtime`) -the time checked will be the uploaded time. +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. -If an existing destination file has a modification time older than the -source file's, it will be updated if the sizes are different. If the -sizes are the same, it will be updated if the checksum is different or -not available. +When performing a `move`/`moveto` command, this flag will leave skipped +files in the source location unchanged when a file with the same name +exists on the destination. -If an existing destination file has a modification time equal (within -the computed modify window) to the source file's, it will be updated -if the sizes are different. The checksum will not be checked in this -case unless the `--checksum` flag is provided. +### --ignore-size ### -In all other cases the file will not be updated. +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 modification time. If `--checksum` is set then it only +checks the checksum. -Consider using the `--modify-window` flag to compensate for time skews -between the source and the backend, for backends that do not support -mod times, and instead use uploaded times. However, if the backend -does not support checksums, note that syncing or copying within the -time skew window may still result in additional transfers for safety. +It will also cause rclone to skip verifying the sizes are the same +after transfer. -### --use-mmap ### +This can be useful for transferring files to and from OneDrive which +occasionally misreports the size of image files (see +[#399](https://github.com/rclone/rclone/issues/399) for more info). -If this flag is set then rclone will use anonymous memory allocated by -mmap on Unix based platforms and VirtualAlloc on Windows for its -transfer buffers (size controlled by `--buffer-size`). Memory -allocated like this does not go on the Go heap and can be returned to -the OS immediately when it is finished with. +### -I, --ignore-times ### -If this flag is not set then rclone will allocate and free the buffers -using the Go memory allocator which may use more memory as memory -pages are returned less aggressively to the OS. +Using this option will cause rclone to unconditionally upload all +files regardless of the state of files on the destination. -It is possible this does not work well on all platforms so it is -disabled by default; in the future it may be enabled by default. +Normally rclone would skip any files that have the same +modification time and are the same size (or have the same checksum if +using `--checksum`). -### --use-server-modtime ### +### --immutable ### -Some object-store backends (e.g, Swift, S3) do not preserve file modification -times (modtime). On these backends, rclone stores the original modtime as -additional metadata on the object. By default it will make an API call to -retrieve the metadata when the modtime is needed by an operation. +Treat source and destination files as immutable and disallow +modification. -Use this flag to disable the extra API call and rely instead on the server's -modified time. In cases such as a local to remote sync using `--update`, -knowing the local file is newer than the time it was last uploaded to the -remote is sufficient. In those cases, this flag can speed up the process and -reduce the number of API calls necessary. +With this option set, files will be created and deleted as requested, +but existing files will never be updated. If an existing file does +not match between the source and destination, rclone will give the error +`Source and destination exist but do not match: immutable file modified`. -Using this flag on a sync operation without also using `--update` would cause -all files modified at any time other than the last upload time to be uploaded -again, which is probably not what you want. +Note that only commands which transfer files (e.g. `sync`, `copy`, +`move`) are affected by this behavior, and only modification is +disallowed. Files may still be deleted explicitly (e.g. `delete`, +`purge`) or implicitly (e.g. `sync`, `move`). Use `copy --immutable` +if it is desired to avoid deletion as well as modification. -### -v, -vv, --verbose ### +This can be useful as an additional layer of protection for immutable +or append-only data sets (notably backup archives), where modification +implies corruption and should not be propagated. -With `-v` rclone will tell you about each file that is transferred and -a small number of significant events. +### --inplace {#inplace} -With `-vv` rclone will become very verbose telling you about every -file it considers and transfers. Please send bug reports with a log -with this setting. +The `--inplace` flag changes the behaviour of rclone when uploading +files to some backends (backends with the `PartialUploads` feature +flag set) such as: -When setting verbosity as an environment variable, use -`RCLONE_VERBOSE=1` or `RCLONE_VERBOSE=2` for `-v` and `-vv` respectively. +- local +- ftp +- sftp -### -V, --version ### +Without `--inplace` (the default) rclone will first upload to a +temporary file with an extension like this, where `XXXXXX` represents a +random string and `.partial` is [--partial-suffix](#partial-suffix) value +(`.partial` by default). -Prints the version number + original-file-name.XXXXXX.partial -SSL/TLS options ---------------- +(rclone will make sure the final name is no longer than 100 characters +by truncating the `original-file-name` part if necessary). -The outgoing SSL/TLS connections rclone makes can be controlled with -these options. For example this can be very useful with the HTTP or -WebDAV backends. Rclone HTTP servers have their own set of -configuration for SSL/TLS which you can find in their documentation. +When the upload is complete, rclone will rename the `.partial` file to +the correct name, overwriting any existing file at that point. If the +upload fails then the `.partial` file will be deleted. -### --ca-cert stringArray +This prevents other users of the backend from seeing partially +uploaded files in their new names and prevents overwriting the old +file until the new one is completely uploaded. -This loads the PEM encoded certificate authority certificates and uses -it to verify the certificates of the servers rclone connects to. +If the `--inplace` flag is supplied, rclone will upload directly to +the final name without creating a `.partial` file. -If you have generated certificates signed with a local CA then you -will need this flag to connect to servers using those certificates. +This means that an incomplete file will be visible in the directory +listings while the upload is in progress and any existing files will +be overwritten as soon as the upload starts. If the transfer fails +then the file will be deleted. This can cause data loss of the +existing file if the transfer fails. -### --client-cert string +Note that on the local file system if you don't use `--inplace` hard +links (Unix only) will be broken. And if you do use `--inplace` you +won't be able to update in use executables. -This loads the PEM encoded client side certificate. +Note also that versions of rclone prior to v1.63.0 behave as if the +`--inplace` flag is always supplied. -This is used for [mutual TLS authentication](https://en.wikipedia.org/wiki/Mutual_authentication). +### -i, --interactive {#interactive} -The `--client-key` flag is required too when using this. +This flag can be used to tell rclone that you wish a manual +confirmation before destructive operations. -### --client-key string +It is **recommended** that you use this flag while learning rclone +especially with `rclone sync`. -This loads the PEM encoded client side private key used for mutual TLS -authentication. Used in conjunction with `--client-cert`. +For example -### --no-check-certificate=true/false ### +``` +$ rclone delete --interactive /tmp/dir +rclone: delete "important-file.txt"? +y) Yes, this is OK (default) +n) No, skip this +s) Skip all delete operations with no more questions +!) Do all delete operations with no more questions +q) Exit rclone now. +y/n/s/!/q> n +``` -`--no-check-certificate` controls whether a client verifies the -server's certificate chain and host name. -If `--no-check-certificate` 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. +The options mean -This option defaults to `false`. +- `y`: **Yes**, this operation should go ahead. You can also press Return + for this to happen. You'll be asked every time unless you choose `s` + or `!`. +- `n`: **No**, do not do this operation. You'll be asked every time unless + you choose `s` or `!`. +- `s`: **Skip** all the following operations of this type with no more + questions. This takes effect until rclone exits. If there are any + different kind of operations you'll be prompted for them. +- `!`: **Do all** the following operations with no more + questions. Useful if you've decided that you don't mind rclone doing + that kind of operation. This takes effect until rclone exits . If + there are any different kind of operations you'll be prompted for + them. +- `q`: **Quit** rclone now, just in case! -**This should be used only for testing.** +### --leave-root #### -Configuration Encryption ------------------------- -Your configuration file contains information for logging in to -your cloud services. This means that you should keep your -`rclone.conf` file in a secure location. +During rmdirs it will not remove root directory, even if it's empty. -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 supply the password every time you start rclone. +### --log-file=FILE ### -To add a password to your rclone configuration, execute `rclone config`. +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 `-v` flag. See the [Logging section](#logging) +for more info. -``` ->rclone config -Current remotes: +If FILE exists then rclone will append to it. -e) Edit existing remote -n) New remote -d) Delete remote -s) Set configuration password -q) Quit config -e/n/d/s/q> -``` +Note that if you are using the `logrotate` program to manage rclone's +logs, then you should use the `copytruncate` option as rclone doesn't +have a signal to rotate logs. -Go into `s`, Set configuration password: -``` -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> -``` +### --log-format LIST ### -Your configuration is now encrypted, and every time you start rclone -you will have to supply the password. See below for details. -In the same menu, you can change the password or completely remove -encryption from your configuration. +Comma separated list of log format options. Accepted options are `date`, +`time`, `microseconds`, `pid`, `longfile`, `shortfile`, `UTC`. Any other +keywords will be silently ignored. `pid` will tag log messages with process +identifier which useful with `rclone mount --daemon`. Other accepted +options are explained in the [go documentation](https://pkg.go.dev/log#pkg-constants). +The default log format is "`date`,`time`". -There is no way to recover the configuration if you lose your password. +### --log-level LEVEL ### -rclone uses [nacl secretbox](https://godoc.org/golang.org/x/crypto/nacl/secretbox) -which in turn 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. +This sets the log level for rclone. The default log level is `NOTICE`. -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. +`DEBUG` is equivalent to `-vv`. It outputs lots of debug info - useful +for bug reports and really finding out what rclone is doing. -If it is safe in your environment, you can set the `RCLONE_CONFIG_PASS` -environment variable to contain your password, in which case it will be -used for decrypting the configuration. +`INFO` is equivalent to `-v`. It outputs information about each transfer +and prints stats once a minute by default. -You can set this for a session from a script. For unix like systems -save this to a file called `set-rclone-password`: +`NOTICE` is the default log level if no logging flags are supplied. It +outputs very little when things are working normally. It outputs +warnings and significant events. -``` -#!/bin/echo Source this file don't run it +`ERROR` is equivalent to `-q`. It only outputs error messages. -read -s RCLONE_CONFIG_PASS -export RCLONE_CONFIG_PASS -``` +### --use-json-log ### -Then source the file when you want to use it. From the shell you -would do `source set-rclone-password`. It will then ask you for the -password and set it in the environment variable. +This switches the log format to JSON for rclone. The fields of json log +are level, msg, source, time. -An alternate means of supplying the password is to provide a script -which will retrieve the password and print on standard output. This -script should have a fully specified path name and not rely on any -environment variables. The script is supplied either via -`--password-command="..."` command line argument or via the -`RCLONE_PASSWORD_COMMAND` environment variable. +### --low-level-retries NUMBER ### -One useful example of this is using the `passwordstore` application -to retrieve the password: +This controls the number of low level retries rclone does. -``` -export RCLONE_PASSWORD_COMMAND="pass rclone/config" -``` +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 `-v` +flag. -If the `passwordstore` password manager holds the password for the -rclone configuration, using the script method means the password -is primarily protected by the `passwordstore` system, and is never -embedded in the clear in scripts, nor available for examination -using the standard commands available. It is quite possible with -long running rclone sessions for copies of passwords to be innocently -captured in log files or terminal scroll buffers, etc. Using the -script method of supplying the password enhances the security of -the config password considerably. +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 +`--retries` flag) quicker. -If you are running rclone inside a script, unless you are using the -`--password-command` method, you might want to disable -password prompts. To do that, pass the parameter -`--ask-password=false` to rclone. This will make rclone fail instead -of asking for a password if `RCLONE_CONFIG_PASS` doesn't contain -a valid password, and `--password-command` has not been supplied. +Disable low level retries with `--low-level-retries 1`. -Whenever running commands that may be affected by options in a -configuration file, rclone will look for an existing file according -to the rules described [above](#config-config-file), and load any it -finds. If an encrypted file is found, this includes decrypting it, -with the possible consequence of a password prompt. When executing -a command line that you know are not actually using anything from such -a configuration file, you can avoid it being loaded by overriding the -location, e.g. with one of the documented special values for -memory-only configuration. Since only backend options can be stored -in configuration files, this is normally unnecessary for commands -that do not operate on backends, e.g. `genautocomplete`. However, -it will be relevant for commands that do operate on backends in -general, but are used without referencing a stored remote, e.g. -listing local filesystem paths, or -[connection strings](#connection-strings): `rclone --config="" ls .` +### --max-backlog=N ### -Developer options ------------------ +This is the maximum allowable backlog of files in a sync/copy/move +queued for being checked or transferred. -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 e.g. -`--drive-test-option` - see the docs for the remote in question. +This can be set arbitrarily large. It will only use memory when the +queue is in use. Note that it will use in the order of N KiB of memory +when the backlog is in use. -### --cpuprofile=FILE ### +Setting this large allows rclone to calculate how many files are +pending more accurately, give a more accurate estimated finish +time and make `--order-by` work more accurately. -Write CPU profile to file. This can be analysed with `go tool pprof`. +Setting this small will make rclone more synchronous to the listings +of the remote which may be desirable. -#### --dump flag,flag,flag #### +Setting this to a negative number will make the backlog as large as +possible. -The `--dump` flag takes a comma separated list of flags to dump info -about. +### --max-delete=N ### -Note that some headers including `Accept-Encoding` as shown may not -be correct in the request and the response may not show `Content-Encoding` -if the go standard libraries auto gzip encoding was in effect. In this case -the body of the request will be gunzipped before showing it. +This tells rclone not to delete more than N files. If that limit is +exceeded then a fatal error will be generated and rclone will stop the +operation in progress. -The available flags are: +### --max-delete-size=SIZE ### -#### --dump headers #### +Rclone will stop deleting files when the total size of deletions has +reached the size specified. It defaults to off. -Dump HTTP headers with `Authorization:` lines removed. May still -contain sensitive info. Can be very verbose. Useful for debugging -only. +If that limit is exceeded then a fatal error will be generated and +rclone will stop the operation in progress. -Use `--dump auth` if you do want the `Authorization:` headers. +### --max-depth=N ### -#### --dump bodies #### +This modifies the recursion depth for all the commands except purge. -Dump HTTP headers and bodies - may contain sensitive info. Can be -very verbose. Useful for debugging only. +So if you do `rclone --max-depth 1 ls remote:path` you will see only +the files in the top level directory. Using `--max-depth 2` means you +will see all the files in first two directory levels and so on. -Note that the bodies are buffered in memory so don't use this for -enormous files. +For historical reasons the `lsd` command defaults to using a +`--max-depth` of 1 - you can override this with the command line flag. -#### --dump requests #### +You can use this command to disable recursion (with `--max-depth 1`). -Like `--dump bodies` but dumps the request bodies and the response -headers. Useful for debugging download problems. +Note that if you use this with `sync` and `--delete-excluded` the +files not recursed through are considered excluded and will be deleted +on the destination. Test first with `--dry-run` if you are not sure +what will happen. -#### --dump responses #### +### --max-duration=TIME ### -Like `--dump bodies` but dumps the response bodies and the request -headers. Useful for debugging upload problems. +Rclone will stop transferring when it has run for the +duration specified. +Defaults to off. -#### --dump auth #### +When the limit is reached all transfers will stop immediately. +Use `--cutoff-mode` to modify this behaviour. -Dump HTTP headers - will contain sensitive info such as -`Authorization:` headers - use `--dump headers` to dump without -`Authorization:` headers. Can be very verbose. Useful for debugging -only. +Rclone will exit with exit code 10 if the duration limit is reached. -#### --dump filters #### +### --max-transfer=SIZE ### -Dump the filters to the output. Useful to see exactly what include -and exclude options are filtering on. +Rclone will stop transferring when it has reached the size specified. +Defaults to off. -#### --dump goroutines #### +When the limit is reached all transfers will stop immediately. +Use `--cutoff-mode` to modify this behaviour. -This dumps a list of the running go-routines at the end of the command -to standard output. +Rclone will exit with exit code 8 if the transfer limit is reached. -#### --dump openfiles #### +### --cutoff-mode=hard|soft|cautious ### -This dumps a list of the open files at the end of the command. It -uses the `lsof` command to do that so you'll need that installed to -use it. +This modifies the behavior of `--max-transfer` and `--max-duration` +Defaults to `--cutoff-mode=hard`. -### --memprofile=FILE ### +Specifying `--cutoff-mode=hard` will stop transferring immediately +when Rclone reaches the limit. -Write memory profile to file. This can be analysed with `go tool pprof`. +Specifying `--cutoff-mode=soft` will stop starting new transfers +when Rclone reaches the limit. -Filtering ---------- +Specifying `--cutoff-mode=cautious` will try to prevent Rclone +from reaching the limit. Only applicable for `--max-transfer` -For the filtering options +## -M, --metadata - * `--delete-excluded` - * `--filter` - * `--filter-from` - * `--exclude` - * `--exclude-from` - * `--exclude-if-present` - * `--include` - * `--include-from` - * `--files-from` - * `--files-from-raw` - * `--min-size` - * `--max-size` - * `--min-age` - * `--max-age` - * `--dump filters` - * `--metadata-include` - * `--metadata-include-from` - * `--metadata-exclude` - * `--metadata-exclude-from` - * `--metadata-filter` - * `--metadata-filter-from` +Setting this flag enables rclone to copy the metadata from the source +to the destination. For local backends this is ownership, permissions, +xattr etc. See the [metadata section](#metadata) for more info. -See the [filtering section](https://rclone.org/filtering/). +### --metadata-mapper SpaceSepList {#metadata-mapper} -Remote control --------------- +If you supply the parameter `--metadata-mapper /path/to/program` then +rclone will use that program to map metadata from source object to +destination object. -For the remote control options and for instructions on how to remote control rclone +The argument to this flag should be a command with an optional space separated +list of arguments. If one of the arguments has a space in then enclose +it in `"`, if you want a literal `"` in an argument then enclose the +argument in `"` and double the `"`. See [CSV encoding](https://godoc.org/encoding/csv) +for more info. - * `--rc` - * and anything starting with `--rc-` + --metadata-mapper "python bin/test_metadata_mapper.py" + --metadata-mapper 'python bin/test_metadata_mapper.py "argument with a space"' + --metadata-mapper 'python bin/test_metadata_mapper.py "argument with ""two"" quotes"' -See [the remote control section](https://rclone.org/rc/). +This uses a simple JSON based protocol with input on STDIN and output +on STDOUT. This will be called for every file and directory copied and +may be called concurrently. -Logging -------- +The program's job is to take a metadata blob on the input and turn it +into a metadata blob on the output suitable for the destination +backend. -rclone has 4 levels of logging, `ERROR`, `NOTICE`, `INFO` and `DEBUG`. +Input to the program (via STDIN) might look like this. This provides +some context for the `Metadata` which may be important. -By default, rclone logs to standard error. This means you can redirect -standard error and still see the normal output of rclone commands (e.g. -`rclone ls`). +- `SrcFs` is the config string for the remote that the object is currently on. +- `SrcFsType` is the name of the source backend. +- `DstFs` is the config string for the remote that the object is being copied to +- `DstFsType` is the name of the destination backend. +- `Remote` is the path of the file relative to the root. +- `Size`, `MimeType`, `ModTime` are attributes of the file. +- `IsDir` is `true` if this is a directory (not yet implemented). +- `ID` is the source `ID` of the file if known. +- `Metadata` is the backend specific metadata as described in the backend docs. -By default, rclone will produce `Error` and `Notice` level messages. +```json +{ + "SrcFs": "gdrive:", + "SrcFsType": "drive", + "DstFs": "newdrive:user", + "DstFsType": "onedrive", + "Remote": "test.txt", + "Size": 6, + "MimeType": "text/plain; charset=utf-8", + "ModTime": "2022-10-11T17:53:10.286745272+01:00", + "IsDir": false, + "ID": "xyz", + "Metadata": { + "btime": "2022-10-11T16:53:11Z", + "content-type": "text/plain; charset=utf-8", + "mtime": "2022-10-11T17:53:10.286745272+01:00", + "owner": "user1@domain1.com", + "permissions": "...", + "description": "my nice file", + "starred": "false" + } +} +``` -If you use the `-q` flag, rclone will only produce `Error` messages. +The program should then modify the input as desired and send it to +STDOUT. The returned `Metadata` field will be used in its entirety for +the destination object. Any other fields will be ignored. Note in this +example we translate user names and permissions and add something to +the description: -If you use the `-v` flag, rclone will produce `Error`, `Notice` and -`Info` messages. +```json +{ + "Metadata": { + "btime": "2022-10-11T16:53:11Z", + "content-type": "text/plain; charset=utf-8", + "mtime": "2022-10-11T17:53:10.286745272+01:00", + "owner": "user1@domain2.com", + "permissions": "...", + "description": "my nice file [migrated from domain1]", + "starred": "false" + } +} +``` -If you use the `-vv` flag, rclone will produce `Error`, `Notice`, -`Info` and `Debug` messages. +Metadata can be removed here too. -You can also control the log levels with the `--log-level` flag. +An example python program might look something like this to implement +the above transformations. -If you use the `--log-file=FILE` option, rclone will redirect `Error`, -`Info` and `Debug` messages along with standard error to FILE. +```python +import sys, json -If you use the `--syslog` flag then rclone will log to syslog and the -`--syslog-facility` control which facility it uses. +i = json.load(sys.stdin) +metadata = i["Metadata"] +# Add tag to description +if "description" in metadata: + metadata["description"] += " [migrated from domain1]" +else: + metadata["description"] = "[migrated from domain1]" +# Modify owner +if "owner" in metadata: + metadata["owner"] = metadata["owner"].replace("domain1.com", "domain2.com") +o = { "Metadata": metadata } +json.dump(o, sys.stdout, indent="\t") +``` -Rclone prefixes all log messages with their level in capitals, e.g. INFO -which makes it easy to grep the log file for different kinds of -information. +You can find this example (slightly expanded) in the rclone source code at +[bin/test_metadata_mapper.py](https://github.com/rclone/rclone/blob/master/test_metadata_mapper.py). -Exit Code ---------- +If you want to see the input to the metadata mapper and the output +returned from it in the log you can use `-vv --dump mapper`. -If any errors occur during the command execution, rclone will exit with a -non-zero exit code. This allows scripts to detect when rclone -operations have failed. +See the [metadata section](#metadata) for more info. -During the startup phase, rclone will exit immediately if an error is -detected in the configuration. There will always be a log message -immediately before exiting. +### --metadata-set key=value -When rclone is running it will accumulate errors as it goes along, and -only exit with a non-zero exit code if (after retries) there were -still failed transfers. For every error counted there will be a high -priority log message (visible with `-q`) showing the message and -which file caused the problem. A high priority message is also shown -when starting a retry so the user can see that any previous error -messages may not be valid after the retry. If rclone has done a retry -it will log a high priority message if the retry was successful. +Add metadata `key` = `value` when uploading. This can be repeated as +many times as required. See the [metadata section](#metadata) for more +info. -### List of exit codes ### - * `0` - success - * `1` - Syntax or usage error - * `2` - Error not otherwise categorised - * `3` - Directory not found - * `4` - File not found - * `5` - Temporary error (one that more retries might fix) (Retry errors) - * `6` - Less serious errors (like 461 errors from dropbox) (NoRetry errors) - * `7` - Fatal error (one that more retries won't fix, like account suspended) (Fatal errors) - * `8` - Transfer exceeded - limit set by --max-transfer reached - * `9` - Operation successful, but no files transferred - * `10` - Duration exceeded - limit set by --max-duration reached +### --modify-window=TIME ### -Environment Variables ---------------------- +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. -Rclone can be configured entirely using environment variables. These -can be used to set defaults for options or config file entries. +The default is `1ns` 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 +`1s` by default. -### Options ### +This command line flag allows you to override that computed default. -Every option in rclone can have its default set by environment -variable. +### --multi-thread-write-buffer-size=SIZE ### -To find the name of the environment variable, first, take the long -option name, strip the leading `--`, change `-` to `_`, make -upper case and prepend `RCLONE_`. +When transferring with multiple threads, rclone will buffer SIZE bytes +in memory before writing to disk for each thread. -For example, to always set `--stats 5s`, set the environment variable -`RCLONE_STATS=5s`. If you set stats on the command line this will -override the environment variable setting. +This can improve performance if the underlying filesystem does not deal +well with a lot of small writes in different positions of the file, so +if you see transfers being limited by disk write speed, you might want +to experiment with different values. Specially for magnetic drives and +remote file systems a higher value can be useful. -Or to always use the trash in drive `--drive-use-trash`, set -`RCLONE_DRIVE_USE_TRASH=true`. +Nevertheless, the default of `128k` should be fine for almost all use +cases, so before changing it ensure that network is not really your +bottleneck. -Verbosity is slightly different, the environment variable -equivalent of `--verbose` or `-v` is `RCLONE_VERBOSE=1`, -or for `-vv`, `RCLONE_VERBOSE=2`. +As a final hint, size is not the only factor: block size (or similar +concept) can have an impact. In one case, we observed that exact +multiples of 16k performed much better than other values. -The same parser is used for the options and the environment variables -so they take exactly the same form. +### --multi-thread-chunk-size=SizeSuffix ### -The options set by environment variables can be seen with the `-vv` flag, e.g. `rclone version -vv`. +Normally the chunk size for multi thread transfers is set by the backend. +However some backends such as `local` and `smb` (which implement `OpenWriterAt` +but not `OpenChunkWriter`) don't have a natural chunk size. -### Config file ### +In this case the value of this option is used (default 64Mi). -You can set defaults for values in the config file on an individual -remote basis. The names of the config items are documented in the page -for each backend. +### --multi-thread-cutoff=SIZE {#multi-thread-cutoff} -To find the name of the environment variable, you need to set, take -`RCLONE_CONFIG_` + name of remote + `_` + name of config file option -and make it all uppercase. -Note one implication here is the remote's name must be -convertible into a valid environment variable name, -so it can only contain letters, digits, or the `_` (underscore) character. +When transferring files above SIZE to capable backends, rclone will +use multiple threads to transfer the file (default 256M). -For example, to configure an S3 remote named `mys3:` without a config -file (using unix ways of setting environment variables): +Capable backends are marked in the +[overview](https://rclone.org/overview/#optional-features) as `MultithreadUpload`. (They +need to implement either the `OpenWriterAt` or `OpenChunkedWriter` +internal interfaces). These include include, `local`, `s3`, +`azureblob`, `b2`, `oracleobjectstorage` and `smb` at the time of +writing. -``` -$ export RCLONE_CONFIG_MYS3_TYPE=s3 -$ export RCLONE_CONFIG_MYS3_ACCESS_KEY_ID=XXX -$ export RCLONE_CONFIG_MYS3_SECRET_ACCESS_KEY=XXX -$ rclone lsd mys3: - -1 2016-09-21 12:54:21 -1 my-bucket -$ rclone listremotes | grep mys3 -mys3: -``` +On the local disk, rclone preallocates the file (using +`fallocate(FALLOC_FL_KEEP_SIZE)` on unix or `NTSetInformationFile` on +Windows both of which takes no time) then each thread writes directly +into the file at the correct place. This means that rclone won't +create fragmented or sparse files and there won't be any assembly time +at the end of the transfer. -Note that if you want to create a remote using environment variables -you must create the `..._TYPE` variable as above. +The number of threads used to transfer is controlled by +`--multi-thread-streams`. -Note that the name of a remote created using environment variable is -case insensitive, in contrast to regular remotes stored in config -file as documented [above](#valid-remote-names). -You must write the name in uppercase in the environment variable, but -as seen from example above it will be listed and can be accessed in -lowercase, while you can also refer to the same remote in uppercase: -``` -$ rclone lsd mys3: - -1 2016-09-21 12:54:21 -1 my-bucket -$ rclone lsd MYS3: - -1 2016-09-21 12:54:21 -1 my-bucket -``` +Use `-vv` if you wish to see info about the threads. +This will work with the `sync`/`copy`/`move` commands and friends +`copyto`/`moveto`. Multi thread transfers will be used with `rclone +mount` and `rclone serve` if `--vfs-cache-mode` is set to `writes` or +above. -Note that you can only set the options of the immediate backend, -so RCLONE_CONFIG_MYS3CRYPT_ACCESS_KEY_ID has no effect, if myS3Crypt is -a crypt remote based on an S3 remote. However RCLONE_S3_ACCESS_KEY_ID will -set the access key of all remotes using S3, including myS3Crypt. +**NB** that this **only** works with supported backends as the +destination but will work with any backend as the source. -Note also that now rclone has [connection strings](#connection-strings), -it is probably easier to use those instead which makes the above example +**NB** that multi-thread copies are disabled for local to local copies +as they are faster without unless `--multi-thread-streams` is set +explicitly. - rclone lsd :s3,access_key_id=XXX,secret_access_key=XXX: +**NB** on Windows using multi-thread transfers to the local disk will +cause the resulting files to be [sparse](https://en.wikipedia.org/wiki/Sparse_file). +Use `--local-no-sparse` to disable sparse files (which may cause long +delays at the start of transfers) or disable multi-thread transfers +with `--multi-thread-streams 0` -### Precedence +### --multi-thread-streams=N ### -The various different methods of backend configuration are read in -this order and the first one with a value is used. +When using multi thread transfers (see above `--multi-thread-cutoff`) +this sets the number of streams to use. Set to `0` to disable multi +thread transfers (Default 4). -- Parameters in connection strings, e.g. `myRemote,skip_links:` -- Flag values as supplied on the command line, e.g. `--skip-links` -- Remote specific environment vars, e.g. `RCLONE_CONFIG_MYREMOTE_SKIP_LINKS` (see above). -- Backend-specific environment vars, e.g. `RCLONE_LOCAL_SKIP_LINKS`. -- Backend generic environment vars, e.g. `RCLONE_SKIP_LINKS`. -- Config file, e.g. `skip_links = true`. -- Default values, e.g. `false` - these can't be changed. +If the backend has a `--backend-upload-concurrency` setting (eg +`--s3-upload-concurrency`) then this setting will be used as the +number of transfers instead if it is larger than the value of +`--multi-thread-streams` or `--multi-thread-streams` isn't set. -So if both `--skip-links` is supplied on the command line and an -environment variable `RCLONE_LOCAL_SKIP_LINKS` is set, the command line -flag will take preference. +### --no-check-dest ### -The backend configurations set by environment variables can be seen with the `-vv` flag, e.g. `rclone about myRemote: -vv`. +The `--no-check-dest` can be used with `move` or `copy` and it causes +rclone not to check the destination at all when copying files. -For non backend configuration the order is as follows: +This means that: -- Flag values as supplied on the command line, e.g. `--stats 5s`. -- Environment vars, e.g. `RCLONE_STATS=5s`. -- Default values, e.g. `1m` - these can't be changed. +- the destination is not listed minimising the API calls +- files are always transferred +- this can cause duplicates on remotes which allow it (e.g. Google Drive) +- `--retries 1` is recommended otherwise you'll transfer everything again on a retry -### Other environment variables ### +This flag is useful to minimise the transactions if you know that none +of the files are on the destination. -- `RCLONE_CONFIG_PASS` set to contain your config file password (see [Configuration Encryption](#configuration-encryption) section) -- `HTTP_PROXY`, `HTTPS_PROXY` and `NO_PROXY` (or the lowercase versions thereof). - - `HTTPS_PROXY` takes precedence over `HTTP_PROXY` for https requests. - - The environment values may be either a complete URL or a "host[:port]" for, in which case the "http" scheme is assumed. -- `USER` and `LOGNAME` values are used as fallbacks for current username. The primary method for looking up username is OS-specific: Windows API on Windows, real user ID in /etc/passwd on Unix systems. In the documentation the current username is simply referred to as `$USER`. -- `RCLONE_CONFIG_DIR` - rclone **sets** this variable for use in config files and sub processes to point to the directory holding the config file. +This is a specialized flag which should be ignored by most users! -The options set by environment variables can be seen with the `-vv` and `--log-level=DEBUG` flags, e.g. `rclone version -vv`. +### --no-gzip-encoding ### -# Configuring rclone on a remote / headless machine # +Don't set `Accept-Encoding: gzip`. This means that rclone won't ask +the server for compressed files automatically. Useful if you've set +the server to return files with `Content-Encoding: gzip` but you +uploaded compressed files. -Some of the configurations (those involving oauth2) require an -Internet connected web browser. +There is no need to set this in normal operation, and doing so will +decrease the network transfer efficiency of rclone. -If you are trying to set rclone up on a remote or headless box with no -browser available on it (e.g. 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. +### --no-traverse ### -## Configuring using rclone authorize ## +The `--no-traverse` flag controls whether the destination file system +is traversed when using the `copy` or `move` commands. +`--no-traverse` is not compatible with `sync` and will be ignored if +you supply it with `sync`. -On the headless box run `rclone` config but answer `N` to the `Use web browser -to automatically authenticate?` question. +If you are only copying a small number of files (or are filtering most +of the files) and/or have a large number of files on the destination +then `--no-traverse` will stop rclone listing the destination and save +time. -``` -... -Remote config -Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. -y) Yes (default) -n) No -y/n> n -For this to work, you will need rclone available on a machine that has -a web browser available. +However, if you are copying a large number of files, especially if you +are doing a copy where lots of the files under consideration haven't +changed and won't need copying then you shouldn't use `--no-traverse`. -For more help and alternate methods see: https://rclone.org/remote_setup/ +See [rclone copy](https://rclone.org/commands/rclone_copy/) for an example of how to use it. -Execute the following on the machine with the web browser (same rclone -version recommended): +### --no-unicode-normalization ### - rclone authorize "amazon cloud drive" +Don't normalize unicode characters in filenames during the sync routine. -Then paste the result below: -result> -``` +Sometimes, an operating system will store filenames containing unicode +parts in their decomposed form (particularly macOS). Some cloud storage +systems will then recompose the unicode, resulting in duplicate files if +the data is ever copied back to a local filesystem. -Then on your main desktop machine +Using this flag will disable that functionality, treating each unicode +character as unique. For example, by default é and é will be normalized +into the same character. With `--no-unicode-normalization` they will be +treated as unique characters. -``` -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 -``` +### --no-update-modtime ### -Then back to the headless box, paste in the code +When using this flag, rclone won't update modification times of remote +files if they are incorrect as it would normally. -``` -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> -``` +This can be used if the remote is being synced with another tool also +(e.g. the Google Drive client). -## Configuring by copying the config file ## +### --order-by string ### -Rclone stores all of its config in a single configuration file. This -can easily be copied to configure a remote rclone. +The `--order-by` flag controls the order in which files in the backlog +are processed in `rclone sync`, `rclone copy` and `rclone move`. -So first configure rclone on your desktop machine with +The order by string is constructed like this. The first part +describes what aspect is being measured: - rclone config +- `size` - order by the size of the files +- `name` - order by the full path of the files +- `modtime` - order by the modification date of the files -to set up the config file. +This can have a modifier appended with a comma: -Find the config file by running `rclone config file`, for example +- `ascending` or `asc` - order so that the smallest (or oldest) is processed first +- `descending` or `desc` - order so that the largest (or newest) is processed first +- `mixed` - order so that the smallest is processed first for some threads and the largest for others -``` -$ rclone config file -Configuration file is stored at: -/home/user/.rclone.conf -``` +If the modifier is `mixed` then it can have an optional percentage +(which defaults to `50`), e.g. `size,mixed,25` which means that 25% of +the threads should be taking the smallest items and 75% the +largest. The threads which take the smallest first will always take +the smallest first and likewise the largest first threads. The `mixed` +mode can be useful to minimise the transfer time when you are +transferring a mixture of large and small files - the large files are +guaranteed upload threads and bandwidth and the small files will be +processed continuously. -Now transfer it to the remote box (scp, cut paste, ftp, sftp, etc.) and -place it in the correct place (use `rclone config file` on the remote -box to find out where). +If no modifier is supplied then the order is `ascending`. -## Configuring using SSH Tunnel ## +For example -Linux and MacOS users can utilize SSH Tunnel to redirect the headless box port 53682 to local machine by using the following command: -``` -ssh -L localhost:53682:localhost:53682 username@remote_server -``` -Then on the headless box run `rclone` config and answer `Y` to the `Use web -browser to automatically authenticate?` question. +- `--order-by size,desc` - send the largest files first +- `--order-by modtime,ascending` - send the oldest files first +- `--order-by name` - send the files with alphabetically by path first -``` -... -Remote config -Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. -y) Yes (default) -n) No -y/n> y -``` -Then copy and paste the auth url `http://127.0.0.1:53682/auth?state=xxxxxxxxxxxx` to the browser on your local machine, complete the auth and it is done. +If the `--order-by` flag is not supplied or it is supplied with an +empty string then the default ordering will be used which is as +scanned. With `--checkers 1` this is mostly alphabetical, however +with the default `--checkers 8` it is somewhat random. -# Filtering, includes and excludes +#### Limitations -Filter flags determine which files rclone `sync`, `move`, `ls`, `lsl`, -`md5sum`, `sha1sum`, `size`, `delete`, `check` and similar commands -apply to. +The `--order-by` flag does not do a separate pass over the data. This +means that it may transfer some files out of the order specified if -They are specified in terms of path/file name patterns; path/file -lists; file age and size, or presence of a file in a directory. Bucket -based remotes without the concept of directory apply filters to object -key, age and size in an analogous way. +- there are no files in the backlog or the source has not been fully scanned yet +- there are more than [--max-backlog](#max-backlog-n) files in the backlog -Rclone `purge` does not obey filters. +Rclone will do its best to transfer the best file it has so in +practice this should not cause a problem. Think of `--order-by` as +being more of a best efforts flag rather than a perfect ordering. -To test filters without risk of damage to data, apply them to `rclone -ls`, or with the `--dry-run` and `-vv` flags. +If you want perfect ordering then you will need to specify +[--check-first](#check-first) which will find all the files which need +transferring first before transferring any. -Rclone filter patterns can only be used in filter command line options, not -in the specification of a remote. +### --partial-suffix {#partial-suffix} -E.g. `rclone copy "remote:dir*.jpg" /path/to/dir` does not have a filter effect. -`rclone copy remote:dir /path/to/dir --include "*.jpg"` does. +When [--inplace](#inplace) is not used, it causes rclone to use +the `--partial-suffix` as suffix for temporary files. -**Important** Avoid mixing any two of `--include...`, `--exclude...` or -`--filter...` flags in an rclone command. The results might not be what -you expect. Instead use a `--filter...` flag. +Suffix length limit is 16 characters. -## Patterns for matching path/file names +The default is `.partial`. -### Pattern syntax {#patterns} +### --password-command SpaceSepList ### -Here is a formal definition of the pattern syntax, -[examples](#examples) are below. +This flag supplies a program which should supply the config password +when run. This is an alternative to rclone prompting for the password +or setting the `RCLONE_CONFIG_PASS` variable. -Rclone matching rules follow a glob style: +The argument to this should be a command with a space separated list +of arguments. If one of the arguments has a space in then enclose it +in `"`, if you want a literal `"` in an argument then enclose the +argument in `"` and double the `"`. See [CSV encoding](https://godoc.org/encoding/csv) +for more info. - * matches any sequence of non-separator (/) characters - ** matches any sequence of characters including / separators - ? matches any single non-separator (/) character - [ [ ! ] { character-range } ] - character class (must be non-empty) - { pattern-list } - pattern alternatives - {{ regexp }} - regular expression to match - c matches character c (c != *, **, ?, \, [, {, }) - \c matches reserved character c (c = *, **, ?, \, [, {, }) or character class +Eg -character-range: + --password-command "echo hello" + --password-command 'echo "hello with space"' + --password-command 'echo "hello with ""quotes"" and space"' - c matches character c (c != \, -, ]) - \c matches reserved character c (c = \, -, ]) - lo - hi matches character c for lo <= c <= hi +See the [Configuration Encryption](#configuration-encryption) for more info. -pattern-list: +See a [Windows PowerShell example on the Wiki](https://github.com/rclone/rclone/wiki/Windows-Powershell-use-rclone-password-command-for-Config-file-password). - pattern { , pattern } - comma-separated (without spaces) patterns +### -P, --progress ### -character classes (see [Go regular expression reference](https://golang.org/pkg/regexp/syntax/)) include: +This flag makes rclone update the stats in a static block in the +terminal providing a realtime overview of the transfer. - Named character classes (e.g. [\d], [^\d], [\D], [^\D]) - Perl character classes (e.g. \s, \S, \w, \W) - ASCII character classes (e.g. [[:alnum:]], [[:alpha:]], [[:punct:]], [[:xdigit:]]) +Any log messages will scroll above the static block. Log messages +will push the static block down to the bottom of the terminal where it +will stay. -regexp for advanced users to insert a regular expression - see [below](#regexp) for more info: +Normally this is updated every 500mS but this period can be overridden +with the `--stats` flag. - Any re2 regular expression not containing `}}` +This can be used with the `--stats-one-line` flag for a simpler +display. -If the filter pattern starts with a `/` then it only matches -at the top level of the directory tree, -**relative to the root of the remote** (not necessarily the root -of the drive). If it does not start with `/` then it is matched -starting at the **end of the path/file name** but it only matches -a complete path element - it must match from a `/` -separator or the beginning of the path/file. +Note: On Windows until [this bug](https://github.com/Azure/go-ansiterm/issues/26) +is fixed all non-ASCII characters will be replaced with `.` when +`--progress` is in use. - 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" +### --progress-terminal-title ### -The top level of the remote might not be the top level of the drive. +This flag, when used with `-P/--progress`, will print the string `ETA: %s` +to the terminal title. -E.g. for a Microsoft Windows local directory structure +### -q, --quiet ### - F: - ├── bkp - ├── data - │ ├── excl - │ │ ├── 123.jpg - │ │ └── 456.jpg - │ ├── incl - │ │ └── document.pdf +This flag will limit rclone's output to error messages only. -To copy the contents of folder `data` into folder `bkp` excluding the contents of subfolder -`excl`the following command treats `F:\data` and `F:\bkp` as top level for filtering. +### --refresh-times ### -`rclone copy F:\data\ F:\bkp\ --exclude=/excl/**` +The `--refresh-times` flag can be used to update modification times of +existing files when they are out of sync on backends which don't +support hashes. -**Important** Use `/` in path/file name patterns and not `\` even if -running on Microsoft Windows. +This is useful if you uploaded files with the incorrect timestamps and +you now wish to correct them. -Simple patterns are case sensitive unless the `--ignore-case` flag is used. +This flag is **only** useful for destinations which don't support +hashes (e.g. `crypt`). -Without `--ignore-case` (default) +This can be used any of the sync commands `sync`, `copy` or `move`. - potato - matches "potato" - - doesn't match "POTATO" +To use this flag you will need to be doing a modification time sync +(so not using `--size-only` or `--checksum`). The flag will have no +effect when using `--size-only` or `--checksum`. -With `--ignore-case` +If this flag is used when rclone comes to upload a file it will check +to see if there is an existing file on the destination. If this file +matches the source with size (and checksum if available) but has a +differing timestamp then instead of re-uploading it, rclone will +update the timestamp on the destination file. If the checksum does not +match rclone will upload the new file. If the checksum is absent (e.g. +on a `crypt` backend) then rclone will update the timestamp. - potato - matches "potato" - - matches "POTATO" +Note that some remotes can't set the modification time without +re-uploading the file so this flag is less useful on them. -## Using regular expressions in filter patterns {#regexp} +Normally if you are doing a modification time sync rclone will update +modification times without `--refresh-times` provided that the remote +supports checksums **and** the checksums match on the file. However if the +checksums are absent then rclone will upload the file rather than +setting the timestamp as this is the safe behaviour. -The syntax of filter patterns is glob style matching (like `bash` -uses) to make things easy for users. However this does not provide -absolute control over the matching, so for advanced users rclone also -provides a regular expression syntax. +### --retries int ### -The regular expressions used are as defined in the [Go regular -expression reference](https://golang.org/pkg/regexp/syntax/). Regular -expressions should be enclosed in `{{` `}}`. They will match only the -last path segment if the glob doesn't start with `/` or the whole path -name if it does. Note that rclone does not attempt to parse the -supplied regular expression, meaning that using any regular expression -filter will prevent rclone from using [directory filter rules](#directory_filter), -as it will instead check every path against -the supplied regular expression(s). +Retry the entire sync if it fails this many times it fails (default 3). -Here is how the `{{regexp}}` is transformed into an full regular -expression to match the entire path: +Some remotes can be unreliable and a few retries help pick up the +files which didn't get transferred because of errors. - {{regexp}} becomes (^|/)(regexp)$ - /{{regexp}} becomes ^(regexp)$ +Disable retries with `--retries 1`. -Regexp syntax can be mixed with glob syntax, for example +### --retries-sleep=TIME ### - *.{{jpe?g}} to match file.jpg, file.jpeg but not file.png +This sets the interval between each retry specified by `--retries` -You can also use regexp flags - to set case insensitive, for example +The default is `0`. Use `0` to disable. - *.{{(?i)jpg}} to match file.jpg, file.JPG but not file.png +### --server-side-across-configs ### -Be careful with wildcards in regular expressions - you don't want them -to match path separators normally. To match any file name starting -with `start` and ending with `end` write +Allow server-side operations (e.g. copy or move) to work across +different configurations. - {{start[^/]*end\.jpg}} +This can be useful if you wish to do a server-side copy or move +between two remotes which use the same backend but are configured +differently. -Not +Note that this isn't enabled by default because it isn't easy for +rclone to tell if it will work between any two configurations. - {{start.*end\.jpg}} +### --size-only ### -Which will match a directory called `start` with a file called -`end.jpg` in it as the `.*` will match `/` characters. +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. -Note that you can use `-vv --dump filters` to show the filter patterns -in regexp format - rclone implements the glob patterns by transforming -them into regular expressions. +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. -## Filter pattern examples {#examples} +### --stats=TIME ### -| Description | Pattern | Matches | Does not match | -| ----------- |-------- | ------- | -------------- | -| Wildcard | `*.jpg` | `/file.jpg` | `/file.png` | -| | | `/dir/file.jpg` | `/dir/file.png` | -| Rooted | `/*.jpg` | `/file.jpg` | `/file.png` | -| | | `/file2.jpg` | `/dir/file.jpg` | -| Alternates | `*.{jpg,png}` | `/file.jpg` | `/file.gif` | -| | | `/dir/file.png` | `/dir/file.gif` | -| Path Wildcard | `dir/**` | `/dir/anyfile` | `file.png` | -| | | `/subdir/dir/subsubdir/anyfile` | `/subdir/file.png` | -| Any Char | `*.t?t` | `/file.txt` | `/file.qxt` | -| | | `/dir/file.tzt` | `/dir/file.png` | -| Range | `*.[a-z]` | `/file.a` | `/file.0` | -| | | `/dir/file.b` | `/dir/file.1` | -| Escape | `*.\?\?\?` | `/file.???` | `/file.abc` | -| | | `/dir/file.???` | `/dir/file.def` | -| Class | `*.\d\d\d` | `/file.012` | `/file.abc` | -| | | `/dir/file.345` | `/dir/file.def` | -| Regexp | `*.{{jpe?g}}` | `/file.jpeg` | `/file.png` | -| | | `/dir/file.jpg` | `/dir/file.jpeeg` | -| Rooted Regexp | `/{{.*\.jpe?g}}` | `/file.jpeg` | `/file.png` | -| | | `/file.jpg` | `/dir/file.jpg` | - -## How filter rules are applied to files {#how-filter-rules-work} +Commands which transfer data (`sync`, `copy`, `copyto`, `move`, +`moveto`) will print data transfer stats at regular intervals to show +their progress. -Rclone path/file name filters are made up of one or more of the following flags: +This sets the interval. - * `--include` - * `--include-from` - * `--exclude` - * `--exclude-from` - * `--filter` - * `--filter-from` +The default is `1m`. Use `0` to disable. -There can be more than one instance of individual flags. +If you set the stats interval then all commands can show stats. This +can be useful when running other commands, `check` or `mount` for +example. -Rclone internally uses a combined list of all the include and exclude -rules. The order in which rules are processed can influence the result -of the filter. +Stats are logged at `INFO` level by default which means they won't +show at default log level `NOTICE`. Use `--stats-log-level NOTICE` or +`-v` to make them show. See the [Logging section](#logging) for more +info on log levels. -All flags of the same type are processed together in the order -above, regardless of what order the different types of flags are -included on the command line. +Note that on macOS you can send a SIGINFO (which is normally ctrl-T in +the terminal) to make the stats print immediately. -Multiple instances of the same flag are processed from left -to right according to their position in the command line. +### --stats-file-name-length integer ### +By default, the `--stats` output will truncate file names and paths longer +than 40 characters. This is equivalent to providing +`--stats-file-name-length 40`. Use `--stats-file-name-length 0` to disable +any truncation of file names printed by stats. -To mix up the order of processing includes and excludes use `--filter...` -flags. +### --stats-log-level string ### -Within `--include-from`, `--exclude-from` and `--filter-from` flags -rules are processed from top to bottom of the referenced file. +Log level to show `--stats` output at. This can be `DEBUG`, `INFO`, +`NOTICE`, or `ERROR`. The default is `INFO`. This means at the +default level of logging which is `NOTICE` the stats won't show - if +you want them to then use `--stats-log-level NOTICE`. See the [Logging +section](#logging) for more info on log levels. -If there is an `--include` or `--include-from` flag specified, rclone -implies a `- **` rule which it adds to the bottom of the internal rule -list. Specifying a `+` rule with a `--filter...` flag does not imply -that rule. +### --stats-one-line ### -Each path/file name passed through rclone is matched against the -combined filter list. At first match to a rule the path/file name -is included or excluded and no further filter rules are processed for -that path/file. +When this is specified, rclone condenses the stats into a single line +showing the most important stats only. -If rclone does not find a match, after testing against all rules -(including the implied rule if appropriate), the path/file name -is included. +### --stats-one-line-date ### -Any path/file included at that stage is processed by the rclone -command. +When this is specified, rclone enables the single-line stats and prepends +the display with a date string. The default is `2006/01/02 15:04:05 - ` -`--files-from` and `--files-from-raw` flags over-ride and cannot be -combined with other filter options. +### --stats-one-line-date-format ### -To see the internal combined rule list, in regular expression form, -for a command add the `--dump filters` flag. Running an rclone command -with `--dump filters` and `-vv` flags lists the internal filter elements -and shows how they are applied to each source path/file. There is not -currently a means provided to pass regular expression filter options into -rclone directly though character class filter rules contain character -classes. [Go regular expression reference](https://golang.org/pkg/regexp/syntax/) +When this is specified, rclone enables the single-line stats and prepends +the display with a user-supplied date string. The date string MUST be +enclosed in quotes. Follow [golang specs](https://golang.org/pkg/time/#Time.Format) for +date formatting syntax. -### How filter rules are applied to directories {#directory_filter} +### --stats-unit=bits|bytes ### -Rclone commands are applied to path/file names not -directories. The entire contents of a directory can be matched -to a filter by the pattern `directory/*` or recursively by -`directory/**`. +By default, data transfer rates will be printed in bytes per second. -Directory filter rules are defined with a closing `/` separator. +This option allows the data rate to be printed in bits per second. -E.g. `/directory/subdirectory/` is an rclone directory filter rule. +Data transfer volume will still be reported in bytes. -Rclone commands can use directory filter rules to determine whether they -recurse into subdirectories. This potentially optimises access to a remote -by avoiding listing unnecessary directories. Whether optimisation is -desirable depends on the specific filter rules and source remote content. +The rate is reported as a binary unit, not SI unit. So 1 Mbit/s +equals 1,048,576 bit/s and not 1,000,000 bit/s. -If any [regular expression filters](#regexp) are in use, then no -directory recursion optimisation is possible, as rclone must check -every path against the supplied regular expression(s). +The default is `bytes`. -Directory recursion optimisation occurs if either: +### --suffix=SUFFIX ### -* A source remote does not support the rclone `ListR` primitive. local, -sftp, Microsoft OneDrive and WebDAV do not support `ListR`. Google -Drive and most bucket type storage do. [Full list](https://rclone.org/overview/#optional-features) +When using `sync`, `copy` or `move` any files which would have been +overwritten or deleted will have the suffix added to them. If there +is a file with the same path (after the suffix has been added), then +it will be overwritten. -* On other remotes (those that support `ListR`), if the rclone command is not naturally recursive, and -provided it is not run with the `--fast-list` flag. `ls`, `lsf -R` and -`size` are naturally recursive but `sync`, `copy` and `move` are not. +The remote in use must support server-side move or copy and you must +use the same remote as the destination of the sync. -* Whenever the `--disable ListR` flag is applied to an rclone command. +This is for use with files to add the suffix in the current directory +or with `--backup-dir`. See `--backup-dir` for more info. -Rclone commands imply directory filter rules from path/file filter -rules. To view the directory filter rules rclone has implied for a -command specify the `--dump filters` flag. +For example -E.g. for an include rule + rclone copy --interactive /path/to/local/file remote:current --suffix .bak - /a/*.jpg +will copy `/path/to/local` to `remote:current`, but for any files +which would have been updated or deleted have .bak added. -Rclone implies the directory include rule +If using `rclone sync` with `--suffix` and without `--backup-dir` then +it is recommended to put a filter rule in excluding the suffix +otherwise the `sync` will delete the backup files. - /a/ + rclone sync --interactive /path/to/local/file remote:current --suffix .bak --exclude "*.bak" -Directory filter rules specified in an rclone command can limit -the scope of an rclone command but path/file filters still have -to be specified. +### --suffix-keep-extension ### -E.g. `rclone ls remote: --include /directory/` will not match any -files. Because it is an `--include` option the `--exclude **` rule -is implied, and the `/directory/` pattern serves only to optimise -access to the remote by ignoring everything outside of that directory. +When using `--suffix`, setting this causes rclone put the SUFFIX +before the extension of the files that it backs up rather than after. -E.g. `rclone ls remote: --filter-from filter-list.txt` with a file -`filter-list.txt`: +So let's say we had `--suffix -2019-01-01`, without the flag `file.txt` +would be backed up to `file.txt-2019-01-01` and with the flag it would +be backed up to `file-2019-01-01.txt`. This can be helpful to make +sure the suffixed files can still be opened. - - /dir1/ - - /dir2/ - + *.pdf - - ** +If a file has two (or more) extensions and the second (or subsequent) +extension is recognised as a valid mime type, then the suffix will go +before that extension. So `file.tar.gz` would be backed up to +`file-2019-01-01.tar.gz` whereas `file.badextension.gz` would be +backed up to `file.badextension-2019-01-01.gz`. -All files in directories `dir1` or `dir2` or their subdirectories -are completely excluded from the listing. Only files of suffix -`pdf` in the root of `remote:` or its subdirectories are listed. -The `- **` rule prevents listing of any path/files not previously -matched by the rules above. +### --syslog ### -Option `exclude-if-present` creates a directory exclude rule based -on the presence of a file in a directory and takes precedence over -other rclone directory filter rules. +On capable OSes (not Windows or Plan9) send all log output to syslog. -When using pattern list syntax, if a pattern item contains either -`/` or `**`, then rclone will not able to imply a directory filter rule -from this pattern list. +This can be useful for running rclone in a script or `rclone mount`. -E.g. for an include rule +### --syslog-facility string ### - {dir1/**,dir2/**} +If using `--syslog` this sets the syslog facility (e.g. `KERN`, `USER`). +See `man syslog` for a list of possible facilities. The default +facility is `DAEMON`. -Rclone will match files below directories `dir1` or `dir2` only, -but will not be able to use this filter to exclude a directory `dir3` -from being traversed. +### --temp-dir=DIR ### -Directory recursion optimisation may affect performance, but normally -not the result. One exception to this is sync operations with option -`--create-empty-src-dirs`, where any traversed empty directories will -be created. With the pattern list example `{dir1/**,dir2/**}` above, -this would create an empty directory `dir3` on destination (when it exists -on source). Changing the filter to `{dir1,dir2}/**`, or splitting it into -two include rules `--include dir1/** --include dir2/**`, will match the -same files while also filtering directories, with the result that an empty -directory `dir3` will no longer be created. +Specify the directory rclone will use for temporary files, to override +the default. Make sure the directory exists and have accessible permissions. -### `--exclude` - Exclude files matching pattern +By default the operating system's temp directory will be used: +- On Unix systems, `$TMPDIR` if non-empty, else `/tmp`. +- On Windows, the first non-empty value from `%TMP%`, `%TEMP%`, `%USERPROFILE%`, or the Windows directory. -Excludes path/file names from an rclone command based on a single exclude -rule. +When overriding the default with this option, the specified path will be +set as value of environment variable `TMPDIR` on Unix systems +and `TMP` and `TEMP` on Windows. -This flag can be repeated. See above for the order filter flags are -processed in. +You can use the [config paths](https://rclone.org/commands/rclone_config_paths/) +command to see the current value. -`--exclude` should not be used with `--include`, `--include-from`, -`--filter` or `--filter-from` flags. +### --tpslimit float ### -`--exclude` has no effect when combined with `--files-from` or -`--files-from-raw` flags. +Limit transactions per second to this number. Default is 0 which is +used to mean unlimited transactions per second. -E.g. `rclone ls remote: --exclude *.bak` excludes all .bak files -from listing. +A transaction is roughly defined as an API call; its exact meaning +will depend on the backend. For HTTP based backends it is an HTTP +PUT/GET/POST/etc and its response. For FTP/SFTP it is a round trip +transaction over TCP. -E.g. `rclone size remote: "--exclude /dir/**"` returns the total size of -all files on `remote:` excluding those in root directory `dir` and sub -directories. +For example, to limit rclone to 10 transactions per second use +`--tpslimit 10`, or to 1 transaction every 2 seconds use `--tpslimit +0.5`. -E.g. on Microsoft Windows `rclone ls remote: --exclude "*\[{JP,KR,HK}\]*"` -lists the files in `remote:` without `[JP]` or `[KR]` or `[HK]` in -their name. Quotes prevent the shell from interpreting the `\` -characters.`\` characters escape the `[` and `]` so an rclone filter -treats them literally rather than as a character-range. The `{` and `}` -define an rclone pattern list. For other operating systems single quotes are -required ie `rclone ls remote: --exclude '*\[{JP,KR,HK}\]*'` +Use this when the number of transactions per second from rclone is +causing a problem with the cloud storage provider (e.g. getting you +banned or rate limited). -### `--exclude-from` - Read exclude patterns from file +This can be very useful for `rclone mount` to control the behaviour of +applications using it. -Excludes path/file names from an rclone command based on rules in a -named file. The file contains a list of remarks and pattern rules. +This limit applies to all HTTP based backends and to the FTP and SFTP +backends. It does not apply to the local backend or the Storj backend. -For an example `exclude-file.txt`: +See also `--tpslimit-burst`. - # a sample exclude rule file - *.bak - file2.jpg +### --tpslimit-burst int ### -`rclone ls remote: --exclude-from exclude-file.txt` lists the files on -`remote:` except those named `file2.jpg` or with a suffix `.bak`. That is -equivalent to `rclone ls remote: --exclude file2.jpg --exclude "*.bak"`. +Max burst of transactions for `--tpslimit` (default `1`). -This flag can be repeated. See above for the order filter flags are -processed in. +Normally `--tpslimit` will do exactly the number of transaction per +second specified. However if you supply `--tps-burst` then rclone can +save up some transactions from when it was idle giving a burst of up +to the parameter supplied. -The `--exclude-from` flag is useful where multiple exclude filter rules -are applied to an rclone command. +For example if you provide `--tpslimit-burst 10` then if rclone has +been idle for more than 10*`--tpslimit` then it can do 10 transactions +very quickly before they are limited again. -`--exclude-from` should not be used with `--include`, `--include-from`, -`--filter` or `--filter-from` flags. +This may be used to increase performance of `--tpslimit` without +changing the long term average number of transactions per second. -`--exclude-from` has no effect when combined with `--files-from` or -`--files-from-raw` flags. +### --track-renames ### -`--exclude-from` followed by `-` reads filter rules from standard input. +By default, rclone doesn't keep track of renamed files, so if you +rename a file locally then sync it to a remote, rclone will delete the +old file on the remote and upload a new copy. -### `--include` - Include files matching pattern +An rclone sync with `--track-renames` runs like a normal sync, but keeps +track of objects which exist in the destination but not in the source +(which would normally be deleted), and which objects exist in the +source but not the destination (which would normally be transferred). +These objects are then candidates for renaming. -Adds a single include rule based on path/file names to an rclone -command. +After the sync, rclone matches up the source only and destination only +objects using the `--track-renames-strategy` specified and either +renames the destination object or transfers the source and deletes the +destination object. `--track-renames` is stateless like all of +rclone's syncs. -This flag can be repeated. See above for the order filter flags are -processed in. +To use this flag the destination must support server-side copy or +server-side move, and to use a hash based `--track-renames-strategy` +(the default) the source and the destination must have a compatible +hash. -`--include` has no effect when combined with `--files-from` or -`--files-from-raw` flags. +If the destination does not support server-side copy or move, rclone +will fall back to the default behaviour and log an error level message +to the console. -`--include` implies `--exclude **` at the end of an rclone internal -filter list. Therefore if you mix `--include` and `--include-from` -flags with `--exclude`, `--exclude-from`, `--filter` or `--filter-from`, -you must use include rules for all the files you want in the include -statement. For more flexibility use the `--filter-from` flag. +Encrypted destinations are not currently supported by `--track-renames` +if `--track-renames-strategy` includes `hash`. -E.g. `rclone ls remote: --include "*.{png,jpg}"` lists the files on -`remote:` with suffix `.png` and `.jpg`. All other files are excluded. +Note that `--track-renames` is incompatible with `--no-traverse` and +that it uses extra memory to keep track of all the rename candidates. -E.g. multiple rclone copy commands can be combined with `--include` and a -pattern-list. +Note also that `--track-renames` is incompatible with +`--delete-before` and will select `--delete-after` instead of +`--delete-during`. - rclone copy /vol1/A remote:A - rclone copy /vol1/B remote:B +### --track-renames-strategy (hash,modtime,leaf,size) ### -is equivalent to: +This option changes the file matching criteria for `--track-renames`. - rclone copy /vol1 remote: --include "{A,B}/**" +The matching is controlled by a comma separated selection of these tokens: -E.g. `rclone ls remote:/wheat --include "??[^[:punct:]]*"` lists the -files `remote:` directory `wheat` (and subdirectories) whose third -character is not punctuation. This example uses -an [ASCII character class](https://golang.org/pkg/regexp/syntax/). +- `modtime` - the modification time of the file - not supported on all backends +- `hash` - the hash of the file contents - not supported on all backends +- `leaf` - the name of the file not including its directory name +- `size` - the size of the file (this is always enabled) -### `--include-from` - Read include patterns from file +The default option is `hash`. -Adds path/file names to an rclone command based on rules in a -named file. The file contains a list of remarks and pattern rules. +Using `--track-renames-strategy modtime,leaf` would match files +based on modification time, the leaf of the file name and the size +only. -For an example `include-file.txt`: +Using `--track-renames-strategy modtime` or `leaf` can enable +`--track-renames` support for encrypted destinations. - # a sample include rule file - *.jpg - file2.avi +Note that the `hash` strategy is not supported with encrypted destinations. -`rclone ls remote: --include-from include-file.txt` lists the files on -`remote:` with name `file2.avi` or suffix `.jpg`. That is equivalent to -`rclone ls remote: --include file2.avi --include "*.jpg"`. +### --delete-(before,during,after) ### -This flag can be repeated. See above for the order filter flags are -processed in. +This option allows you to specify when files on your destination are +deleted when you sync folders. -The `--include-from` flag is useful where multiple include filter rules -are applied to an rclone command. +Specifying the value `--delete-before` will delete all files present +on the destination, but not on the source *before* starting the +transfer of any new or updated files. This uses two passes through the +file systems, one for the deletions and one for the copies. -`--include-from` implies `--exclude **` at the end of an rclone internal -filter list. Therefore if you mix `--include` and `--include-from` -flags with `--exclude`, `--exclude-from`, `--filter` or `--filter-from`, -you must use include rules for all the files you want in the include -statement. For more flexibility use the `--filter-from` flag. +Specifying `--delete-during` will delete files while checking and +uploading files. This is the fastest option and uses the least memory. -`--exclude-from` has no effect when combined with `--files-from` or -`--files-from-raw` flags. +Specifying `--delete-after` (the default value) will delay deletion of +files until all new/updated files have been successfully transferred. +The files to be deleted are collected in the copy pass then deleted +after the copy pass has completed successfully. The files to be +deleted are held in memory so this mode may use more memory. This is +the safest mode as it will only delete files if there have been no +errors subsequent to that. If there have been errors before the +deletions start then you will get the message `not deleting files as +there were IO errors`. -`--exclude-from` followed by `-` reads filter rules from standard input. +### --fast-list ### -### `--filter` - Add a file-filtering rule +When doing anything which involves a directory listing (e.g. `sync`, +`copy`, `ls` - in fact nearly every command), rclone has different +strategies to choose from. + +The basic strategy is to list one directory and processes it before using +more directory lists to process any subdirectories. This is a mandatory +backend feature, called `List`, which means it is supported by all backends. +This strategy uses small amount of memory, and because it can be parallelised +it is fast for operations involving processing of the list results. + +Some backends provide the support for an alternative strategy, where all +files beneath a directory can be listed in one (or a small number) of +transactions. Rclone supports this alternative strategy through an optional +backend feature called [`ListR`](https://rclone.org/overview/#listr). You can see in the storage +system overview documentation's [optional features](https://rclone.org/overview/#optional-features) +section which backends it is enabled for (these tend to be the bucket-based +ones, e.g. S3, B2, GCS, Swift). This strategy requires fewer transactions +for highly recursive operations, which is important on backends where this +is charged or heavily rate limited. It may be faster (due to fewer transactions) +or slower (because it can't be parallelized) depending on different parameters, +and may require more memory if rclone has to keep the whole listing in memory. + +Which listing strategy rclone picks for a given operation is complicated, but +in general it tries to choose the best possible. It will prefer `ListR` in +situations where it doesn't need to store the listed files in memory, e.g. +for unlimited recursive `ls` command variants. In other situations it will +prefer `List`, e.g. for `sync` and `copy`, where it needs to keep the listed +files in memory, and is performing operations on them where parallelization +may be a huge advantage. + +Rclone is not able to take all relevant parameters into account for deciding +the best strategy, and therefore allows you to influence the choice in two ways: +You can stop rclone from using `ListR` by disabling the feature, using the +[--disable](#disable-feature-feature) option (`--disable ListR`), or you can +allow rclone to use `ListR` where it would normally choose not to do so due to +higher memory usage, using the `--fast-list` option. Rclone should always +produce identical results either way. Using `--disable ListR` or `--fast-list` +on a remote which doesn't support `ListR` does nothing, rclone will just ignore +it. -Specifies path/file names to an rclone command, based on a single -include or exclude rule, in `+` or `-` format. +A rule of thumb is that if you pay for transactions and can fit your entire +sync listing into memory, then `--fast-list` is recommended. If you have a +very big sync to do, then don't use `--fast-list`, otherwise you will run out +of memory. Run some tests and compare before you decide, and if in doubt then +just leave the default, let rclone decide, i.e. not use `--fast-list`. -This flag can be repeated. See above for the order filter flags are -processed in. +### --timeout=TIME ### -`--filter +` differs from `--include`. In the case of `--include` rclone -implies an `--exclude *` rule which it adds to the bottom of the internal rule -list. `--filter...+` does not imply -that rule. +This sets the IO idle timeout. If a transfer has started but then +becomes idle for this long it is considered broken and disconnected. -`--filter` has no effect when combined with `--files-from` or -`--files-from-raw` flags. +The default is `5m`. Set to `0` to disable. -`--filter` should not be used with `--include`, `--include-from`, -`--exclude` or `--exclude-from` flags. +### --transfers=N ### -E.g. `rclone ls remote: --filter "- *.bak"` excludes all `.bak` files -from a list of `remote:`. +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. -### `--filter-from` - Read filtering patterns from a file +The default is to run 4 file transfers in parallel. -Adds path/file names to an rclone command based on rules in a -named file. The file contains a list of remarks and pattern rules. Include -rules start with `+ ` and exclude rules with `- `. `!` clears existing -rules. Rules are processed in the order they are defined. +Look at --multi-thread-streams if you would like to control single file transfers. -This flag can be repeated. See above for the order filter flags are -processed in. +### -u, --update ### -Arrange the order of filter rules with the most restrictive first and -work down. +This forces rclone to skip any files which exist on the destination +and have a modified time that is newer than the source file. -E.g. for `filter-file.txt`: +This can be useful in avoiding needless transfers when transferring to +a remote which doesn't support modification times directly (or when +using `--use-server-modtime` to avoid extra API calls) as it is more +accurate than a `--size-only` check and faster than using +`--checksum`. On such remotes (or when using `--use-server-modtime`) +the time checked will be the uploaded time. - # a sample filter rule file - - secret*.jpg - + *.jpg - + *.png - + file2.avi - - /dir/Trash/** - + /dir/** - # exclude everything else - - * +If an existing destination file has a modification time older than the +source file's, it will be updated if the sizes are different. If the +sizes are the same, it will be updated if the checksum is different or +not available. -`rclone ls remote: --filter-from filter-file.txt` lists the path/files on -`remote:` including all `jpg` and `png` files, excluding any -matching `secret*.jpg` and including `file2.avi`. It also includes -everything in the directory `dir` at the root of `remote`, except -`remote:dir/Trash` which it excludes. Everything else is excluded. +If an existing destination file has a modification time equal (within +the computed modify window) to the source file's, it will be updated +if the sizes are different. The checksum will not be checked in this +case unless the `--checksum` flag is provided. +In all other cases the file will not be updated. -E.g. for an alternative `filter-file.txt`: +Consider using the `--modify-window` flag to compensate for time skews +between the source and the backend, for backends that do not support +mod times, and instead use uploaded times. However, if the backend +does not support checksums, note that syncing or copying within the +time skew window may still result in additional transfers for safety. - - secret*.jpg - + *.jpg - + *.png - + file2.avi - - * +### --use-mmap ### -Files `file1.jpg`, `file3.png` and `file2.avi` are listed whilst -`secret17.jpg` and files without the suffix .jpg` or `.png` are excluded. +If this flag is set then rclone will use anonymous memory allocated by +mmap on Unix based platforms and VirtualAlloc on Windows for its +transfer buffers (size controlled by `--buffer-size`). Memory +allocated like this does not go on the Go heap and can be returned to +the OS immediately when it is finished with. -E.g. for an alternative `filter-file.txt`: +If this flag is not set then rclone will allocate and free the buffers +using the Go memory allocator which may use more memory as memory +pages are returned less aggressively to the OS. - + *.jpg - + *.gif - ! - + 42.doc - - * +It is possible this does not work well on all platforms so it is +disabled by default; in the future it may be enabled by default. -Only file 42.doc is listed. Prior rules are cleared by the `!`. +### --use-server-modtime ### -### `--files-from` - Read list of source-file names +Some object-store backends (e.g, Swift, S3) do not preserve file modification +times (modtime). On these backends, rclone stores the original modtime as +additional metadata on the object. By default it will make an API call to +retrieve the metadata when the modtime is needed by an operation. -Adds path/files to an rclone command from a list in a named file. -Rclone processes the path/file names in the order of the list, and -no others. +Use this flag to disable the extra API call and rely instead on the server's +modified time. In cases such as a local to remote sync using `--update`, +knowing the local file is newer than the time it was last uploaded to the +remote is sufficient. In those cases, this flag can speed up the process and +reduce the number of API calls necessary. -Other filter flags (`--include`, `--include-from`, `--exclude`, -`--exclude-from`, `--filter` and `--filter-from`) are ignored when -`--files-from` is used. +Using this flag on a sync operation without also using `--update` would cause +all files modified at any time other than the last upload time to be uploaded +again, which is probably not what you want. -`--files-from` expects a list of files as its input. Leading or -trailing whitespace is stripped from the input lines. Lines starting -with `#` or `;` are ignored. +### -v, -vv, --verbose ### -Rclone commands with a `--files-from` flag traverse the remote, -treating the names in `--files-from` as a set of filters. +With `-v` rclone will tell you about each file that is transferred and +a small number of significant events. -If the `--no-traverse` and `--files-from` flags are used together -an rclone command does not traverse the remote. Instead it addresses -each path/file named in the file individually. For each path/file name, that -requires typically 1 API call. This can be efficient for a short `--files-from` -list and a remote containing many files. - -Rclone commands do not error if any names in the `--files-from` file are -missing from the source remote. +With `-vv` rclone will become very verbose telling you about every +file it considers and transfers. Please send bug reports with a log +with this setting. -The `--files-from` flag can be repeated in a single rclone command to -read path/file names from more than one file. The files are read from left -to right along the command line. +When setting verbosity as an environment variable, use +`RCLONE_VERBOSE=1` or `RCLONE_VERBOSE=2` for `-v` and `-vv` respectively. -Paths within the `--files-from` file are interpreted as starting -with the root specified in the rclone command. Leading `/` separators are -ignored. See [--files-from-raw](#files-from-raw-read-list-of-source-file-names-without-any-processing) if -you need the input to be processed in a raw manner. +### -V, --version ### -E.g. for a file `files-from.txt`: +Prints the version number - # comment - file1.jpg - subdir/file2.jpg +SSL/TLS options +--------------- -`rclone copy --files-from files-from.txt /home/me/pics remote:pics` -copies the following, if they exist, and only those files. +The outgoing SSL/TLS connections rclone makes can be controlled with +these options. For example this can be very useful with the HTTP or +WebDAV backends. Rclone HTTP servers have their own set of +configuration for SSL/TLS which you can find in their documentation. - /home/me/pics/file1.jpg → remote:pics/file1.jpg - /home/me/pics/subdir/file2.jpg → remote:pics/subdir/file2.jpg +### --ca-cert stringArray -E.g. to copy the following files referenced by their absolute paths: +This loads the PEM encoded certificate authority certificates and uses +it to verify the certificates of the servers rclone connects to. - /home/user1/42 - /home/user1/dir/ford - /home/user2/prefect +If you have generated certificates signed with a local CA then you +will need this flag to connect to servers using those certificates. -First find a common subdirectory - in this case `/home` -and put the remaining files in `files-from.txt` with or without -leading `/`, e.g. +### --client-cert string - user1/42 - user1/dir/ford - user2/prefect +This loads the PEM encoded client side certificate. -Then copy these to a remote: +This is used for [mutual TLS authentication](https://en.wikipedia.org/wiki/Mutual_authentication). - rclone copy --files-from files-from.txt /home remote:backup +The `--client-key` flag is required too when using this. -The three files are transferred as follows: +### --client-key string - /home/user1/42 → remote:backup/user1/important - /home/user1/dir/ford → remote:backup/user1/dir/file - /home/user2/prefect → remote:backup/user2/stuff +This loads the PEM encoded client side private key used for mutual TLS +authentication. Used in conjunction with `--client-cert`. -Alternatively if `/` is chosen as root `files-from.txt` will be: +### --no-check-certificate=true/false ### - /home/user1/42 - /home/user1/dir/ford - /home/user2/prefect +`--no-check-certificate` controls whether a client verifies the +server's certificate chain and host name. +If `--no-check-certificate` 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. -The copy command will be: +This option defaults to `false`. - rclone copy --files-from files-from.txt / remote:backup +**This should be used only for testing.** -Then there will be an extra `home` directory on the remote: +Configuration Encryption +------------------------ +Your configuration file contains information for logging in to +your cloud services. This means that you should keep your +`rclone.conf` file in a secure location. - /home/user1/42 → remote:backup/home/user1/42 - /home/user1/dir/ford → remote:backup/home/user1/dir/ford - /home/user2/prefect → remote:backup/home/user2/prefect +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 supply the password every time you start rclone. -### `--files-from-raw` - Read list of source-file names without any processing +To add a password to your rclone configuration, execute `rclone config`. -This flag is the same as `--files-from` except that input is read in a -raw manner. Lines with leading / trailing whitespace, and lines starting -with `;` or `#` are read without any processing. [rclone lsf](https://rclone.org/commands/rclone_lsf/) has -a compatible format that can be used to export file lists from remotes for -input to `--files-from-raw`. +``` +>rclone config +Current remotes: -### `--ignore-case` - make searches case insensitive +e) Edit existing remote +n) New remote +d) Delete remote +s) Set configuration password +q) Quit config +e/n/d/s/q> +``` -By default, rclone filter patterns are case sensitive. The `--ignore-case` -flag makes all of the filters patterns on the command line case -insensitive. +Go into `s`, Set configuration password: +``` +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> +``` -E.g. `--include "zaphod.txt"` does not match a file `Zaphod.txt`. With -`--ignore-case` a match is made. +Your configuration is now encrypted, and every time you start rclone +you will have to supply the password. See below for details. +In the same menu, you can change the password or completely remove +encryption from your configuration. -## Quoting shell metacharacters +There is no way to recover the configuration if you lose your password. -Rclone commands with filter patterns containing shell metacharacters may -not as work as expected in your shell and may require quoting. +rclone uses [nacl secretbox](https://godoc.org/golang.org/x/crypto/nacl/secretbox) +which in turn 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. -E.g. linux, OSX (`*` metacharacter) +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. - * `--include \*.jpg` - * `--include '*.jpg'` - * `--include='*.jpg'` +If it is safe in your environment, you can set the `RCLONE_CONFIG_PASS` +environment variable to contain your password, in which case it will be +used for decrypting the configuration. -Microsoft Windows expansion is done by the command, not shell, so -`--include *.jpg` does not require quoting. +You can set this for a session from a script. For unix like systems +save this to a file called `set-rclone-password`: -If the rclone error -`Command .... needs .... arguments maximum: you provided .... non flag arguments:` -is encountered, the cause is commonly spaces within the name of a -remote or flag value. The fix then is to quote values containing spaces. +``` +#!/bin/echo Source this file don't run it -## Other filters +read -s RCLONE_CONFIG_PASS +export RCLONE_CONFIG_PASS +``` -### `--min-size` - Don't transfer any file smaller than this +Then source the file when you want to use it. From the shell you +would do `source set-rclone-password`. It will then ask you for the +password and set it in the environment variable. -Controls the minimum size file within the scope of an rclone command. -Default units are `KiB` but abbreviations `K`, `M`, `G`, `T` or `P` are valid. +An alternate means of supplying the password is to provide a script +which will retrieve the password and print on standard output. This +script should have a fully specified path name and not rely on any +environment variables. The script is supplied either via +`--password-command="..."` command line argument or via the +`RCLONE_PASSWORD_COMMAND` environment variable. -E.g. `rclone ls remote: --min-size 50k` lists files on `remote:` of 50 KiB -size or larger. +One useful example of this is using the `passwordstore` application +to retrieve the password: -See [the size option docs](https://rclone.org/docs/#size-option) for more info. +``` +export RCLONE_PASSWORD_COMMAND="pass rclone/config" +``` -### `--max-size` - Don't transfer any file larger than this +If the `passwordstore` password manager holds the password for the +rclone configuration, using the script method means the password +is primarily protected by the `passwordstore` system, and is never +embedded in the clear in scripts, nor available for examination +using the standard commands available. It is quite possible with +long running rclone sessions for copies of passwords to be innocently +captured in log files or terminal scroll buffers, etc. Using the +script method of supplying the password enhances the security of +the config password considerably. -Controls the maximum size file within the scope of an rclone command. -Default units are `KiB` but abbreviations `K`, `M`, `G`, `T` or `P` are valid. +If you are running rclone inside a script, unless you are using the +`--password-command` method, you might want to disable +password prompts. To do that, pass the parameter +`--ask-password=false` to rclone. This will make rclone fail instead +of asking for a password if `RCLONE_CONFIG_PASS` doesn't contain +a valid password, and `--password-command` has not been supplied. -E.g. `rclone ls remote: --max-size 1G` lists files on `remote:` of 1 GiB -size or smaller. +Whenever running commands that may be affected by options in a +configuration file, rclone will look for an existing file according +to the rules described [above](#config-config-file), and load any it +finds. If an encrypted file is found, this includes decrypting it, +with the possible consequence of a password prompt. When executing +a command line that you know are not actually using anything from such +a configuration file, you can avoid it being loaded by overriding the +location, e.g. with one of the documented special values for +memory-only configuration. Since only backend options can be stored +in configuration files, this is normally unnecessary for commands +that do not operate on backends, e.g. `genautocomplete`. However, +it will be relevant for commands that do operate on backends in +general, but are used without referencing a stored remote, e.g. +listing local filesystem paths, or +[connection strings](#connection-strings): `rclone --config="" ls .` -See [the size option docs](https://rclone.org/docs/#size-option) for more info. +Developer options +----------------- -### `--max-age` - Don't transfer any file older than this +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 e.g. +`--drive-test-option` - see the docs for the remote in question. -Controls the maximum age of files within the scope of an rclone command. +### --cpuprofile=FILE ### -`--max-age` applies only to files and not to directories. +Write CPU profile to file. This can be analysed with `go tool pprof`. -E.g. `rclone ls remote: --max-age 2d` lists files on `remote:` of 2 days -old or less. +#### --dump flag,flag,flag #### -See [the time option docs](https://rclone.org/docs/#time-option) for valid formats. +The `--dump` flag takes a comma separated list of flags to dump info +about. -### `--min-age` - Don't transfer any file younger than this +Note that some headers including `Accept-Encoding` as shown may not +be correct in the request and the response may not show `Content-Encoding` +if the go standard libraries auto gzip encoding was in effect. In this case +the body of the request will be gunzipped before showing it. -Controls the minimum age of files within the scope of an rclone command. -(see `--max-age` for valid formats) +The available flags are: -`--min-age` applies only to files and not to directories. +#### --dump headers #### -E.g. `rclone ls remote: --min-age 2d` lists files on `remote:` of 2 days -old or more. +Dump HTTP headers with `Authorization:` lines removed. May still +contain sensitive info. Can be very verbose. Useful for debugging +only. -See [the time option docs](https://rclone.org/docs/#time-option) for valid formats. +Use `--dump auth` if you do want the `Authorization:` headers. -## Other flags +#### --dump bodies #### -### `--delete-excluded` - Delete files on dest excluded from sync +Dump HTTP headers and bodies - may contain sensitive info. Can be +very verbose. Useful for debugging only. -**Important** this flag is dangerous to your data - use with `--dry-run` -and `-v` first. +Note that the bodies are buffered in memory so don't use this for +enormous files. -In conjunction with `rclone sync`, `--delete-excluded` deletes any files -on the destination which are excluded from the command. +#### --dump requests #### -E.g. the scope of `rclone sync --interactive A: B:` can be restricted: +Like `--dump bodies` but dumps the request bodies and the response +headers. Useful for debugging download problems. - rclone --min-size 50k --delete-excluded sync A: B: +#### --dump responses #### -All files on `B:` which are less than 50 KiB are deleted -because they are excluded from the rclone sync command. +Like `--dump bodies` but dumps the response bodies and the request +headers. Useful for debugging upload problems. -### `--dump filters` - dump the filters to the output +#### --dump auth #### -Dumps the defined filters to standard output in regular expression -format. +Dump HTTP headers - will contain sensitive info such as +`Authorization:` headers - use `--dump headers` to dump without +`Authorization:` headers. Can be very verbose. Useful for debugging +only. -Useful for debugging. +#### --dump filters #### -## Exclude directory based on a file +Dump the filters to the output. Useful to see exactly what include +and exclude options are filtering on. -The `--exclude-if-present` flag controls whether a directory is -within the scope of an rclone command based on the presence of a -named file within it. The flag can be repeated to check for -multiple file names, presence of any of them will exclude the -directory. +#### --dump goroutines #### -This flag has a priority over other filter flags. +This dumps a list of the running go-routines at the end of the command +to standard output. -E.g. for the following directory structure: +#### --dump openfiles #### - dir1/file1 - dir1/dir2/file2 - dir1/dir2/dir3/file3 - dir1/dir2/dir3/.ignore +This dumps a list of the open files at the end of the command. It +uses the `lsof` command to do that so you'll need that installed to +use it. -The command `rclone ls --exclude-if-present .ignore dir1` does -not list `dir3`, `file3` or `.ignore`. +#### --dump mapper #### -## Metadata filters {#metadata} +This shows the JSON blobs being sent to the program supplied with +`--metadata-mapper` and received from it. It can be useful for +debugging the metadata mapper interface. -The metadata filters work in a very similar way to the normal file -name filters, except they match [metadata](https://rclone.org/docs/#metadata) on the -object. +### --memprofile=FILE ### -The metadata should be specified as `key=value` patterns. This may be -wildcarded using the normal [filter patterns](#patterns) or [regular -expressions](#regexp). +Write memory profile to file. This can be analysed with `go tool pprof`. -For example if you wished to list only local files with a mode of -`100664` you could do that with: +Filtering +--------- - rclone lsf -M --files-only --metadata-include "mode=100664" . +For the filtering options -Or if you wished to show files with an `atime`, `mtime` or `btime` at a given date: + * `--delete-excluded` + * `--filter` + * `--filter-from` + * `--exclude` + * `--exclude-from` + * `--exclude-if-present` + * `--include` + * `--include-from` + * `--files-from` + * `--files-from-raw` + * `--min-size` + * `--max-size` + * `--min-age` + * `--max-age` + * `--dump filters` + * `--metadata-include` + * `--metadata-include-from` + * `--metadata-exclude` + * `--metadata-exclude-from` + * `--metadata-filter` + * `--metadata-filter-from` - rclone lsf -M --files-only --metadata-include "[abm]time=2022-12-16*" . +See the [filtering section](https://rclone.org/filtering/). -Like file filtering, metadata filtering only applies to files not to -directories. +Remote control +-------------- -The filters can be applied using these flags. +For the remote control options and for instructions on how to remote control rclone -- `--metadata-include` - Include metadatas matching pattern -- `--metadata-include-from` - Read metadata include patterns from file (use - to read from stdin) -- `--metadata-exclude` - Exclude metadatas matching pattern -- `--metadata-exclude-from` - Read metadata exclude patterns from file (use - to read from stdin) -- `--metadata-filter` - Add a metadata filtering rule -- `--metadata-filter-from` - Read metadata filtering patterns from a file (use - to read from stdin) + * `--rc` + * and anything starting with `--rc-` -Each flag can be repeated. See the section on [how filter rules are -applied](#how-filter-rules-work) for more details - these flags work -in an identical way to the file name filtering flags, but instead of -file name patterns have metadata patterns. +See [the remote control section](https://rclone.org/rc/). +Logging +------- -## Common pitfalls +rclone has 4 levels of logging, `ERROR`, `NOTICE`, `INFO` and `DEBUG`. -The most frequent filter support issues on -the [rclone forum](https://forum.rclone.org/) are: +By default, rclone logs to standard error. This means you can redirect +standard error and still see the normal output of rclone commands (e.g. +`rclone ls`). -* Not using paths relative to the root of the remote -* Not using `/` to match from the root of a remote -* Not using `**` to match the contents of a directory +By default, rclone will produce `Error` and `Notice` level messages. -# GUI (Experimental) +If you use the `-q` flag, rclone will only produce `Error` messages. -Rclone can serve a web based GUI (graphical user interface). This is -somewhat experimental at the moment so things may be subject to -change. +If you use the `-v` flag, rclone will produce `Error`, `Notice` and +`Info` messages. -Run this command in a terminal and rclone will download and then -display the GUI in a web browser. +If you use the `-vv` flag, rclone will produce `Error`, `Notice`, +`Info` and `Debug` messages. -``` -rclone rcd --rc-web-gui -``` +You can also control the log levels with the `--log-level` flag. -This will produce logs like this and rclone needs to continue to run to serve the GUI: +If you use the `--log-file=FILE` option, rclone will redirect `Error`, +`Info` and `Debug` messages along with standard error to FILE. -``` -2019/08/25 11:40:14 NOTICE: A new release for gui is present at https://github.com/rclone/rclone-webui-react/releases/download/v0.0.6/currentbuild.zip -2019/08/25 11:40:14 NOTICE: Downloading webgui binary. Please wait. [Size: 3813937, Path : /home/USER/.cache/rclone/webgui/v0.0.6.zip] -2019/08/25 11:40:16 NOTICE: Unzipping -2019/08/25 11:40:16 NOTICE: Serving remote control on http://127.0.0.1:5572/ -``` +If you use the `--syslog` flag then rclone will log to syslog and the +`--syslog-facility` control which facility it uses. -This assumes you are running rclone locally on your machine. It is -possible to separate the rclone and the GUI - see below for details. +Rclone prefixes all log messages with their level in capitals, e.g. INFO +which makes it easy to grep the log file for different kinds of +information. -If you wish to check for updates then you can add `--rc-web-gui-update` -to the command line. +Exit Code +--------- -If you find your GUI broken, you may force it to update by add `--rc-web-gui-force-update`. +If any errors occur during the command execution, rclone will exit with a +non-zero exit code. This allows scripts to detect when rclone +operations have failed. -By default, rclone will open your browser. Add `--rc-web-gui-no-open-browser` -to disable this feature. +During the startup phase, rclone will exit immediately if an error is +detected in the configuration. There will always be a log message +immediately before exiting. -## Using the GUI +When rclone is running it will accumulate errors as it goes along, and +only exit with a non-zero exit code if (after retries) there were +still failed transfers. For every error counted there will be a high +priority log message (visible with `-q`) showing the message and +which file caused the problem. A high priority message is also shown +when starting a retry so the user can see that any previous error +messages may not be valid after the retry. If rclone has done a retry +it will log a high priority message if the retry was successful. -Once the GUI opens, you will be looking at the dashboard which has an overall overview. +### List of exit codes ### + * `0` - success + * `1` - Syntax or usage error + * `2` - Error not otherwise categorised + * `3` - Directory not found + * `4` - File not found + * `5` - Temporary error (one that more retries might fix) (Retry errors) + * `6` - Less serious errors (like 461 errors from dropbox) (NoRetry errors) + * `7` - Fatal error (one that more retries won't fix, like account suspended) (Fatal errors) + * `8` - Transfer exceeded - limit set by --max-transfer reached + * `9` - Operation successful, but no files transferred + * `10` - Duration exceeded - limit set by --max-duration reached -On the left hand side you will see a series of view buttons you can click on: +Environment Variables +--------------------- -- Dashboard - main overview -- Configs - examine and create new configurations -- Explorer - view, download and upload files to the cloud storage systems -- Backend - view or alter the backend config -- Log out +Rclone can be configured entirely using environment variables. These +can be used to set defaults for options or config file entries. -(More docs and walkthrough video to come!) +### Options ### -## How it works +Every option in rclone can have its default set by environment +variable. -When you run the `rclone rcd --rc-web-gui` this is what happens +To find the name of the environment variable, first, take the long +option name, strip the leading `--`, change `-` to `_`, make +upper case and prepend `RCLONE_`. -- Rclone starts but only runs the remote control API ("rc"). -- The API is bound to localhost with an auto-generated username and password. -- If the API bundle is missing then rclone will download it. -- rclone will start serving the files from the API bundle over the same port as the API -- rclone will open the browser with a `login_token` so it can log straight in. +For example, to always set `--stats 5s`, set the environment variable +`RCLONE_STATS=5s`. If you set stats on the command line this will +override the environment variable setting. -## Advanced use +Or to always use the trash in drive `--drive-use-trash`, set +`RCLONE_DRIVE_USE_TRASH=true`. -The `rclone rcd` may use any of the [flags documented on the rc page](https://rclone.org/rc/#supported-parameters). +Verbosity is slightly different, the environment variable +equivalent of `--verbose` or `-v` is `RCLONE_VERBOSE=1`, +or for `-vv`, `RCLONE_VERBOSE=2`. -The flag `--rc-web-gui` is shorthand for +The same parser is used for the options and the environment variables +so they take exactly the same form. -- Download the web GUI if necessary -- Check we are using some authentication -- `--rc-user gui` -- `--rc-pass ` -- `--rc-serve` +The options set by environment variables can be seen with the `-vv` flag, e.g. `rclone version -vv`. -These flags can be overridden as desired. +### Config file ### -See also the [rclone rcd documentation](https://rclone.org/commands/rclone_rcd/). +You can set defaults for values in the config file on an individual +remote basis. The names of the config items are documented in the page +for each backend. -### Example: Running a public GUI +To find the name of the environment variable, you need to set, take +`RCLONE_CONFIG_` + name of remote + `_` + name of config file option +and make it all uppercase. +Note one implication here is the remote's name must be +convertible into a valid environment variable name, +so it can only contain letters, digits, or the `_` (underscore) character. -For example the GUI could be served on a public port over SSL using an htpasswd file using the following flags: +For example, to configure an S3 remote named `mys3:` without a config +file (using unix ways of setting environment variables): -- `--rc-web-gui` -- `--rc-addr :443` -- `--rc-htpasswd /path/to/htpasswd` -- `--rc-cert /path/to/ssl.crt` -- `--rc-key /path/to/ssl.key` +``` +$ export RCLONE_CONFIG_MYS3_TYPE=s3 +$ export RCLONE_CONFIG_MYS3_ACCESS_KEY_ID=XXX +$ export RCLONE_CONFIG_MYS3_SECRET_ACCESS_KEY=XXX +$ rclone lsd mys3: + -1 2016-09-21 12:54:21 -1 my-bucket +$ rclone listremotes | grep mys3 +mys3: +``` -### Example: Running a GUI behind a proxy +Note that if you want to create a remote using environment variables +you must create the `..._TYPE` variable as above. -If you want to run the GUI behind a proxy at `/rclone` you could use these flags: +Note that the name of a remote created using environment variable is +case insensitive, in contrast to regular remotes stored in config +file as documented [above](#valid-remote-names). +You must write the name in uppercase in the environment variable, but +as seen from example above it will be listed and can be accessed in +lowercase, while you can also refer to the same remote in uppercase: +``` +$ rclone lsd mys3: + -1 2016-09-21 12:54:21 -1 my-bucket +$ rclone lsd MYS3: + -1 2016-09-21 12:54:21 -1 my-bucket +``` -- `--rc-web-gui` -- `--rc-baseurl rclone` -- `--rc-htpasswd /path/to/htpasswd` -Or instead of htpasswd if you just want a single user and password: +Note that you can only set the options of the immediate backend, +so RCLONE_CONFIG_MYS3CRYPT_ACCESS_KEY_ID has no effect, if myS3Crypt is +a crypt remote based on an S3 remote. However RCLONE_S3_ACCESS_KEY_ID will +set the access key of all remotes using S3, including myS3Crypt. -- `--rc-user me` -- `--rc-pass mypassword` +Note also that now rclone has [connection strings](#connection-strings), +it is probably easier to use those instead which makes the above example -## Project + rclone lsd :s3,access_key_id=XXX,secret_access_key=XXX: -The GUI is being developed in the: [rclone/rclone-webui-react repository](https://github.com/rclone/rclone-webui-react). +### Precedence -Bug reports and contributions are very welcome :-) +The various different methods of backend configuration are read in +this order and the first one with a value is used. -If you have questions then please ask them on the [rclone forum](https://forum.rclone.org/). +- Parameters in connection strings, e.g. `myRemote,skip_links:` +- Flag values as supplied on the command line, e.g. `--skip-links` +- Remote specific environment vars, e.g. `RCLONE_CONFIG_MYREMOTE_SKIP_LINKS` (see above). +- Backend-specific environment vars, e.g. `RCLONE_LOCAL_SKIP_LINKS`. +- Backend generic environment vars, e.g. `RCLONE_SKIP_LINKS`. +- Config file, e.g. `skip_links = true`. +- Default values, e.g. `false` - these can't be changed. -# Remote controlling rclone with its API +So if both `--skip-links` is supplied on the command line and an +environment variable `RCLONE_LOCAL_SKIP_LINKS` is set, the command line +flag will take preference. -If rclone is run with the `--rc` flag then it starts an HTTP server -which can be used to remote control rclone using its API. +The backend configurations set by environment variables can be seen with the `-vv` flag, e.g. `rclone about myRemote: -vv`. -You can either use the [rc](#api-rc) command to access the API -or [use HTTP directly](#api-http). +For non backend configuration the order is as follows: -If you just want to run a remote control then see the [rcd](https://rclone.org/commands/rclone_rcd/) command. +- Flag values as supplied on the command line, e.g. `--stats 5s`. +- Environment vars, e.g. `RCLONE_STATS=5s`. +- Default values, e.g. `1m` - these can't be changed. -## Supported parameters +### Other environment variables ### -### --rc +- `RCLONE_CONFIG_PASS` set to contain your config file password (see [Configuration Encryption](#configuration-encryption) section) +- `HTTP_PROXY`, `HTTPS_PROXY` and `NO_PROXY` (or the lowercase versions thereof). + - `HTTPS_PROXY` takes precedence over `HTTP_PROXY` for https requests. + - The environment values may be either a complete URL or a "host[:port]" for, in which case the "http" scheme is assumed. +- `USER` and `LOGNAME` values are used as fallbacks for current username. The primary method for looking up username is OS-specific: Windows API on Windows, real user ID in /etc/passwd on Unix systems. In the documentation the current username is simply referred to as `$USER`. +- `RCLONE_CONFIG_DIR` - rclone **sets** this variable for use in config files and sub processes to point to the directory holding the config file. -Flag to start the http server listen on remote requests - -### --rc-addr=IP +The options set by environment variables can be seen with the `-vv` and `--log-level=DEBUG` flags, e.g. `rclone version -vv`. -IPaddress:Port or :Port to bind server to. (default "localhost:5572") +# Configuring rclone on a remote / headless machine # -### --rc-cert=KEY -SSL PEM key (concatenation of certificate and CA certificate) +Some of the configurations (those involving oauth2) require an +Internet connected web browser. -### --rc-client-ca=PATH -Client certificate authority to verify clients with +If you are trying to set rclone up on a remote or headless box with no +browser available on it (e.g. 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. -### --rc-htpasswd=PATH +## Configuring using rclone authorize ## -htpasswd file - if not provided no authentication is done +On the headless box run `rclone` config but answer `N` to the `Use web browser +to automatically authenticate?` question. -### --rc-key=PATH +``` +... +Remote config +Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. +y) Yes (default) +n) No +y/n> n +For this to work, you will need rclone available on a machine that has +a web browser available. -SSL PEM Private key +For more help and alternate methods see: https://rclone.org/remote_setup/ -### --rc-max-header-bytes=VALUE +Execute the following on the machine with the web browser (same rclone +version recommended): -Maximum size of request header (default 4096) + rclone authorize "amazon cloud drive" -### --rc-min-tls-version=VALUE +Then paste the result below: +result> +``` -The minimum TLS version that is acceptable. Valid values are "tls1.0", -"tls1.1", "tls1.2" and "tls1.3" (default "tls1.0"). +Then on your main desktop machine -### --rc-user=VALUE +``` +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 +``` -User name for authentication. +Then back to the headless box, paste in the code -### --rc-pass=VALUE +``` +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> +``` -Password for authentication. +## Configuring by copying the config file ## -### --rc-realm=VALUE +Rclone stores all of its config in a single configuration file. This +can easily be copied to configure a remote rclone. -Realm for authentication (default "rclone") +So first configure rclone on your desktop machine with -### --rc-server-read-timeout=DURATION + rclone config -Timeout for server reading data (default 1h0m0s) +to set up the config file. -### --rc-server-write-timeout=DURATION +Find the config file by running `rclone config file`, for example -Timeout for server writing data (default 1h0m0s) +``` +$ rclone config file +Configuration file is stored at: +/home/user/.rclone.conf +``` -### --rc-serve +Now transfer it to the remote box (scp, cut paste, ftp, sftp, etc.) and +place it in the correct place (use `rclone config file` on the remote +box to find out where). -Enable the serving of remote objects via the HTTP interface. This -means objects will be accessible at http://127.0.0.1:5572/ by default, -so you can browse to http://127.0.0.1:5572/ or http://127.0.0.1:5572/* -to see a listing of the remotes. Objects may be requested from -remotes using this syntax http://127.0.0.1:5572/[remote:path]/path/to/object +## Configuring using SSH Tunnel ## -Default Off. +Linux and MacOS users can utilize SSH Tunnel to redirect the headless box port 53682 to local machine by using the following command: +``` +ssh -L localhost:53682:localhost:53682 username@remote_server +``` +Then on the headless box run `rclone` config and answer `Y` to the `Use web +browser to automatically authenticate?` question. -### --rc-files /path/to/directory +``` +... +Remote config +Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. +y) Yes (default) +n) No +y/n> y +``` +Then copy and paste the auth url `http://127.0.0.1:53682/auth?state=xxxxxxxxxxxx` to the browser on your local machine, complete the auth and it is done. -Path to local files to serve on the HTTP server. +# Filtering, includes and excludes -If this is set then rclone will serve the files in that directory. It -will also open the root in the web browser if specified. This is for -implementing browser based GUIs for rclone functions. +Filter flags determine which files rclone `sync`, `move`, `ls`, `lsl`, +`md5sum`, `sha1sum`, `size`, `delete`, `check` and similar commands +apply to. -If `--rc-user` or `--rc-pass` is set then the URL that is opened will -have the authorization in the URL in the `http://user:pass@localhost/` -style. +They are specified in terms of path/file name patterns; path/file +lists; file age and size, or presence of a file in a directory. Bucket +based remotes without the concept of directory apply filters to object +key, age and size in an analogous way. -Default Off. +Rclone `purge` does not obey filters. -### --rc-enable-metrics +To test filters without risk of damage to data, apply them to `rclone +ls`, or with the `--dry-run` and `-vv` flags. -Enable OpenMetrics/Prometheus compatible endpoint at `/metrics`. +Rclone filter patterns can only be used in filter command line options, not +in the specification of a remote. -Default Off. +E.g. `rclone copy "remote:dir*.jpg" /path/to/dir` does not have a filter effect. +`rclone copy remote:dir /path/to/dir --include "*.jpg"` does. -### --rc-web-gui +**Important** Avoid mixing any two of `--include...`, `--exclude...` or +`--filter...` flags in an rclone command. The results might not be what +you expect. Instead use a `--filter...` flag. -Set this flag to serve the default web gui on the same port as rclone. +## Patterns for matching path/file names -Default Off. +### Pattern syntax {#patterns} -### --rc-allow-origin +Here is a formal definition of the pattern syntax, +[examples](#examples) are below. -Set the allowed Access-Control-Allow-Origin for rc requests. +Rclone matching rules follow a glob style: -Can be used with --rc-web-gui if the rclone is running on different IP than the web-gui. + * matches any sequence of non-separator (/) characters + ** matches any sequence of characters including / separators + ? matches any single non-separator (/) character + [ [ ! ] { character-range } ] + character class (must be non-empty) + { pattern-list } + pattern alternatives + {{ regexp }} + regular expression to match + c matches character c (c != *, **, ?, \, [, {, }) + \c matches reserved character c (c = *, **, ?, \, [, {, }) or character class -Default is IP address on which rc is running. +character-range: -### --rc-web-fetch-url + c matches character c (c != \, -, ]) + \c matches reserved character c (c = \, -, ]) + lo - hi matches character c for lo <= c <= hi -Set the URL to fetch the rclone-web-gui files from. +pattern-list: -Default https://api.github.com/repos/rclone/rclone-webui-react/releases/latest. + pattern { , pattern } + comma-separated (without spaces) patterns -### --rc-web-gui-update +character classes (see [Go regular expression reference](https://golang.org/pkg/regexp/syntax/)) include: -Set this flag to check and update rclone-webui-react from the rc-web-fetch-url. + Named character classes (e.g. [\d], [^\d], [\D], [^\D]) + Perl character classes (e.g. \s, \S, \w, \W) + ASCII character classes (e.g. [[:alnum:]], [[:alpha:]], [[:punct:]], [[:xdigit:]]) -Default Off. +regexp for advanced users to insert a regular expression - see [below](#regexp) for more info: -### --rc-web-gui-force-update + Any re2 regular expression not containing `}}` -Set this flag to force update rclone-webui-react from the rc-web-fetch-url. +If the filter pattern starts with a `/` then it only matches +at the top level of the directory tree, +**relative to the root of the remote** (not necessarily the root +of the drive). If it does not start with `/` then it is matched +starting at the **end of the path/file name** but it only matches +a complete path element - it must match from a `/` +separator or the beginning of the path/file. -Default Off. + 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" -### --rc-web-gui-no-open-browser +The top level of the remote might not be the top level of the drive. -Set this flag to disable opening browser automatically when using web-gui. +E.g. for a Microsoft Windows local directory structure -Default Off. + F: + ├── bkp + ├── data + │ ├── excl + │ │ ├── 123.jpg + │ │ └── 456.jpg + │ ├── incl + │ │ └── document.pdf -### --rc-job-expire-duration=DURATION +To copy the contents of folder `data` into folder `bkp` excluding the contents of subfolder +`excl`the following command treats `F:\data` and `F:\bkp` as top level for filtering. -Expire finished async jobs older than DURATION (default 60s). +`rclone copy F:\data\ F:\bkp\ --exclude=/excl/**` -### --rc-job-expire-interval=DURATION +**Important** Use `/` in path/file name patterns and not `\` even if +running on Microsoft Windows. -Interval duration to check for expired async jobs (default 10s). +Simple patterns are case sensitive unless the `--ignore-case` flag is used. -### --rc-no-auth +Without `--ignore-case` (default) -By default rclone will require authorisation to have been set up on -the rc interface in order to use any methods which access any rclone -remotes. Eg `operations/list` is denied as it involved creating a -remote as is `sync/copy`. + potato - matches "potato" + - doesn't match "POTATO" -If this is set then no authorisation will be required on the server to -use these methods. The alternative is to use `--rc-user` and -`--rc-pass` and use these credentials in the request. +With `--ignore-case` -Default Off. + potato - matches "potato" + - matches "POTATO" -### --rc-baseurl +## Using regular expressions in filter patterns {#regexp} -Prefix for URLs. +The syntax of filter patterns is glob style matching (like `bash` +uses) to make things easy for users. However this does not provide +absolute control over the matching, so for advanced users rclone also +provides a regular expression syntax. -Default is root +The regular expressions used are as defined in the [Go regular +expression reference](https://golang.org/pkg/regexp/syntax/). Regular +expressions should be enclosed in `{{` `}}`. They will match only the +last path segment if the glob doesn't start with `/` or the whole path +name if it does. Note that rclone does not attempt to parse the +supplied regular expression, meaning that using any regular expression +filter will prevent rclone from using [directory filter rules](#directory_filter), +as it will instead check every path against +the supplied regular expression(s). -### --rc-template +Here is how the `{{regexp}}` is transformed into an full regular +expression to match the entire path: -User-specified template. + {{regexp}} becomes (^|/)(regexp)$ + /{{regexp}} becomes ^(regexp)$ -## Accessing the remote control via the rclone rc command {#api-rc} +Regexp syntax can be mixed with glob syntax, for example -Rclone itself implements the remote control protocol in its `rclone -rc` command. + *.{{jpe?g}} to match file.jpg, file.jpeg but not file.png -You can use it like this +You can also use regexp flags - to set case insensitive, for example -``` -$ rclone rc rc/noop param1=one param2=two -{ - "param1": "one", - "param2": "two" -} -``` + *.{{(?i)jpg}} to match file.jpg, file.JPG but not file.png -Run `rclone rc` on its own to see the help for the installed remote -control commands. +Be careful with wildcards in regular expressions - you don't want them +to match path separators normally. To match any file name starting +with `start` and ending with `end` write -## JSON input + {{start[^/]*end\.jpg}} -`rclone rc` also supports a `--json` flag which can be used to send -more complicated input parameters. +Not -``` -$ rclone rc --json '{ "p1": [1,"2",null,4], "p2": { "a":1, "b":2 } }' rc/noop -{ - "p1": [ - 1, - "2", - null, - 4 - ], - "p2": { - "a": 1, - "b": 2 - } -} -``` + {{start.*end\.jpg}} -If the parameter being passed is an object then it can be passed as a -JSON string rather than using the `--json` flag which simplifies the -command line. +Which will match a directory called `start` with a file called +`end.jpg` in it as the `.*` will match `/` characters. -``` -rclone rc operations/list fs=/tmp remote=test opt='{"showHash": true}' -``` +Note that you can use `-vv --dump filters` to show the filter patterns +in regexp format - rclone implements the glob patterns by transforming +them into regular expressions. -Rather than +## Filter pattern examples {#examples} -``` -rclone rc operations/list --json '{"fs": "/tmp", "remote": "test", "opt": {"showHash": true}}' -``` +| Description | Pattern | Matches | Does not match | +| ----------- |-------- | ------- | -------------- | +| Wildcard | `*.jpg` | `/file.jpg` | `/file.png` | +| | | `/dir/file.jpg` | `/dir/file.png` | +| Rooted | `/*.jpg` | `/file.jpg` | `/file.png` | +| | | `/file2.jpg` | `/dir/file.jpg` | +| Alternates | `*.{jpg,png}` | `/file.jpg` | `/file.gif` | +| | | `/dir/file.png` | `/dir/file.gif` | +| Path Wildcard | `dir/**` | `/dir/anyfile` | `file.png` | +| | | `/subdir/dir/subsubdir/anyfile` | `/subdir/file.png` | +| Any Char | `*.t?t` | `/file.txt` | `/file.qxt` | +| | | `/dir/file.tzt` | `/dir/file.png` | +| Range | `*.[a-z]` | `/file.a` | `/file.0` | +| | | `/dir/file.b` | `/dir/file.1` | +| Escape | `*.\?\?\?` | `/file.???` | `/file.abc` | +| | | `/dir/file.???` | `/dir/file.def` | +| Class | `*.\d\d\d` | `/file.012` | `/file.abc` | +| | | `/dir/file.345` | `/dir/file.def` | +| Regexp | `*.{{jpe?g}}` | `/file.jpeg` | `/file.png` | +| | | `/dir/file.jpg` | `/dir/file.jpeeg` | +| Rooted Regexp | `/{{.*\.jpe?g}}` | `/file.jpeg` | `/file.png` | +| | | `/file.jpg` | `/dir/file.jpg` | -## Special parameters +## How filter rules are applied to files {#how-filter-rules-work} -The rc interface supports some special parameters which apply to -**all** commands. These start with `_` to show they are different. +Rclone path/file name filters are made up of one or more of the following flags: -### Running asynchronous jobs with _async = true + * `--include` + * `--include-from` + * `--exclude` + * `--exclude-from` + * `--filter` + * `--filter-from` -Each rc call is classified as a job and it is assigned its own id. By default -jobs are executed immediately as they are created or synchronously. +There can be more than one instance of individual flags. -If `_async` has a true value when supplied to an rc call then it will -return immediately with a job id and the task will be run in the -background. The `job/status` call can be used to get information of -the background job. The job can be queried for up to 1 minute after -it has finished. +Rclone internally uses a combined list of all the include and exclude +rules. The order in which rules are processed can influence the result +of the filter. -It is recommended that potentially long running jobs, e.g. `sync/sync`, -`sync/copy`, `sync/move`, `operations/purge` are run with the `_async` -flag to avoid any potential problems with the HTTP request and -response timing out. +All flags of the same type are processed together in the order +above, regardless of what order the different types of flags are +included on the command line. -Starting a job with the `_async` flag: +Multiple instances of the same flag are processed from left +to right according to their position in the command line. -``` -$ rclone rc --json '{ "p1": [1,"2",null,4], "p2": { "a":1, "b":2 }, "_async": true }' rc/noop -{ - "jobid": 2 -} -``` +To mix up the order of processing includes and excludes use `--filter...` +flags. -Query the status to see if the job has finished. For more information -on the meaning of these return parameters see the `job/status` call. +Within `--include-from`, `--exclude-from` and `--filter-from` flags +rules are processed from top to bottom of the referenced file. -``` -$ rclone rc --json '{ "jobid":2 }' job/status -{ - "duration": 0.000124163, - "endTime": "2018-10-27T11:38:07.911245881+01:00", - "error": "", - "finished": true, - "id": 2, - "output": { - "_async": true, - "p1": [ - 1, - "2", - null, - 4 - ], - "p2": { - "a": 1, - "b": 2 - } - }, - "startTime": "2018-10-27T11:38:07.911121728+01:00", - "success": true -} -``` +If there is an `--include` or `--include-from` flag specified, rclone +implies a `- **` rule which it adds to the bottom of the internal rule +list. Specifying a `+` rule with a `--filter...` flag does not imply +that rule. -`job/list` can be used to show the running or recently completed jobs +Each path/file name passed through rclone is matched against the +combined filter list. At first match to a rule the path/file name +is included or excluded and no further filter rules are processed for +that path/file. -``` -$ rclone rc job/list -{ - "jobids": [ - 2 - ] -} -``` +If rclone does not find a match, after testing against all rules +(including the implied rule if appropriate), the path/file name +is included. -### Setting config flags with _config +Any path/file included at that stage is processed by the rclone +command. -If you wish to set config (the equivalent of the global flags) for the -duration of an rc call only then pass in the `_config` parameter. +`--files-from` and `--files-from-raw` flags over-ride and cannot be +combined with other filter options. -This should be in the same format as the `config` key returned by -[options/get](#options-get). +To see the internal combined rule list, in regular expression form, +for a command add the `--dump filters` flag. Running an rclone command +with `--dump filters` and `-vv` flags lists the internal filter elements +and shows how they are applied to each source path/file. There is not +currently a means provided to pass regular expression filter options into +rclone directly though character class filter rules contain character +classes. [Go regular expression reference](https://golang.org/pkg/regexp/syntax/) -For example, if you wished to run a sync with the `--checksum` -parameter, you would pass this parameter in your JSON blob. +### How filter rules are applied to directories {#directory_filter} - "_config":{"CheckSum": true} +Rclone commands are applied to path/file names not +directories. The entire contents of a directory can be matched +to a filter by the pattern `directory/*` or recursively by +`directory/**`. -If using `rclone rc` this could be passed as +Directory filter rules are defined with a closing `/` separator. - rclone rc sync/sync ... _config='{"CheckSum": true}' +E.g. `/directory/subdirectory/` is an rclone directory filter rule. -Any config parameters you don't set will inherit the global defaults -which were set with command line flags or environment variables. +Rclone commands can use directory filter rules to determine whether they +recurse into subdirectories. This potentially optimises access to a remote +by avoiding listing unnecessary directories. Whether optimisation is +desirable depends on the specific filter rules and source remote content. -Note that it is possible to set some values as strings or integers - -see [data types](#data-types) for more info. Here is an example -setting the equivalent of `--buffer-size` in string or integer format. +If any [regular expression filters](#regexp) are in use, then no +directory recursion optimisation is possible, as rclone must check +every path against the supplied regular expression(s). - "_config":{"BufferSize": "42M"} - "_config":{"BufferSize": 44040192} +Directory recursion optimisation occurs if either: -If you wish to check the `_config` assignment has worked properly then -calling `options/local` will show what the value got set to. +* A source remote does not support the rclone `ListR` primitive. local, +sftp, Microsoft OneDrive and WebDAV do not support `ListR`. Google +Drive and most bucket type storage do. [Full list](https://rclone.org/overview/#optional-features) -### Setting filter flags with _filter +* On other remotes (those that support `ListR`), if the rclone command is not naturally recursive, and +provided it is not run with the `--fast-list` flag. `ls`, `lsf -R` and +`size` are naturally recursive but `sync`, `copy` and `move` are not. -If you wish to set filters for the duration of an rc call only then -pass in the `_filter` parameter. +* Whenever the `--disable ListR` flag is applied to an rclone command. -This should be in the same format as the `filter` key returned by -[options/get](#options-get). +Rclone commands imply directory filter rules from path/file filter +rules. To view the directory filter rules rclone has implied for a +command specify the `--dump filters` flag. -For example, if you wished to run a sync with these flags +E.g. for an include rule - --max-size 1M --max-age 42s --include "a" --include "b" + /a/*.jpg -you would pass this parameter in your JSON blob. +Rclone implies the directory include rule - "_filter":{"MaxSize":"1M", "IncludeRule":["a","b"], "MaxAge":"42s"} + /a/ -If using `rclone rc` this could be passed as +Directory filter rules specified in an rclone command can limit +the scope of an rclone command but path/file filters still have +to be specified. - rclone rc ... _filter='{"MaxSize":"1M", "IncludeRule":["a","b"], "MaxAge":"42s"}' +E.g. `rclone ls remote: --include /directory/` will not match any +files. Because it is an `--include` option the `--exclude **` rule +is implied, and the `/directory/` pattern serves only to optimise +access to the remote by ignoring everything outside of that directory. -Any filter parameters you don't set will inherit the global defaults -which were set with command line flags or environment variables. +E.g. `rclone ls remote: --filter-from filter-list.txt` with a file +`filter-list.txt`: -Note that it is possible to set some values as strings or integers - -see [data types](#data-types) for more info. Here is an example -setting the equivalent of `--buffer-size` in string or integer format. + - /dir1/ + - /dir2/ + + *.pdf + - ** - "_filter":{"MinSize": "42M"} - "_filter":{"MinSize": 44040192} +All files in directories `dir1` or `dir2` or their subdirectories +are completely excluded from the listing. Only files of suffix +`pdf` in the root of `remote:` or its subdirectories are listed. +The `- **` rule prevents listing of any path/files not previously +matched by the rules above. -If you wish to check the `_filter` assignment has worked properly then -calling `options/local` will show what the value got set to. +Option `exclude-if-present` creates a directory exclude rule based +on the presence of a file in a directory and takes precedence over +other rclone directory filter rules. -### Assigning operations to groups with _group = value +When using pattern list syntax, if a pattern item contains either +`/` or `**`, then rclone will not able to imply a directory filter rule +from this pattern list. -Each rc call has its own stats group for tracking its metrics. By default -grouping is done by the composite group name from prefix `job/` and id of the -job like so `job/1`. +E.g. for an include rule -If `_group` has a value then stats for that request will be grouped under that -value. This allows caller to group stats under their own name. + {dir1/**,dir2/**} -Stats for specific group can be accessed by passing `group` to `core/stats`: +Rclone will match files below directories `dir1` or `dir2` only, +but will not be able to use this filter to exclude a directory `dir3` +from being traversed. -``` -$ rclone rc --json '{ "group": "job/1" }' core/stats -{ - "speed": 12345 - ... -} -``` +Directory recursion optimisation may affect performance, but normally +not the result. One exception to this is sync operations with option +`--create-empty-src-dirs`, where any traversed empty directories will +be created. With the pattern list example `{dir1/**,dir2/**}` above, +this would create an empty directory `dir3` on destination (when it exists +on source). Changing the filter to `{dir1,dir2}/**`, or splitting it into +two include rules `--include dir1/** --include dir2/**`, will match the +same files while also filtering directories, with the result that an empty +directory `dir3` will no longer be created. -## Data types {#data-types} +### `--exclude` - Exclude files matching pattern -When the API returns types, these will mostly be straight forward -integer, string or boolean types. +Excludes path/file names from an rclone command based on a single exclude +rule. -However some of the types returned by the [options/get](#options-get) -call and taken by the [options/set](#options-set) calls as well as the -`vfsOpt`, `mountOpt` and the `_config` parameters. +This flag can be repeated. See above for the order filter flags are +processed in. -- `Duration` - these are returned as an integer duration in - nanoseconds. They may be set as an integer, or they may be set with - time string, eg "5s". See the [options section](https://rclone.org/docs/#options) for - more info. -- `Size` - these are returned as an integer number of bytes. They may - be set as an integer or they may be set with a size suffix string, - eg "10M". See the [options section](https://rclone.org/docs/#options) for more info. -- Enumerated type (such as `CutoffMode`, `DumpFlags`, `LogLevel`, - `VfsCacheMode` - these will be returned as an integer and may be set - as an integer but more conveniently they can be set as a string, eg - "HARD" for `CutoffMode` or `DEBUG` for `LogLevel`. -- `BandwidthSpec` - this will be set and returned as a string, eg - "1M". +`--exclude` should not be used with `--include`, `--include-from`, +`--filter` or `--filter-from` flags. -## Specifying remotes to work on +`--exclude` has no effect when combined with `--files-from` or +`--files-from-raw` flags. -Remotes are specified with the `fs=`, `srcFs=`, `dstFs=` -parameters depending on the command being used. +E.g. `rclone ls remote: --exclude *.bak` excludes all .bak files +from listing. -The parameters can be a string as per the rest of rclone, eg -`s3:bucket/path` or `:sftp:/my/dir`. They can also be specified as -JSON blobs. +E.g. `rclone size remote: "--exclude /dir/**"` returns the total size of +all files on `remote:` excluding those in root directory `dir` and sub +directories. -If specifying a JSON blob it should be a object mapping strings to -strings. These values will be used to configure the remote. There are -3 special values which may be set: +E.g. on Microsoft Windows `rclone ls remote: --exclude "*\[{JP,KR,HK}\]*"` +lists the files in `remote:` without `[JP]` or `[KR]` or `[HK]` in +their name. Quotes prevent the shell from interpreting the `\` +characters.`\` characters escape the `[` and `]` so an rclone filter +treats them literally rather than as a character-range. The `{` and `}` +define an rclone pattern list. For other operating systems single quotes are +required ie `rclone ls remote: --exclude '*\[{JP,KR,HK}\]*'` -- `type` - set to `type` to specify a remote called `:type:` -- `_name` - set to `name` to specify a remote called `name:` -- `_root` - sets the root of the remote - may be empty +### `--exclude-from` - Read exclude patterns from file -One of `_name` or `type` should normally be set. If the `local` -backend is desired then `type` should be set to `local`. If `_root` -isn't specified then it defaults to the root of the remote. +Excludes path/file names from an rclone command based on rules in a +named file. The file contains a list of remarks and pattern rules. -For example this JSON is equivalent to `remote:/tmp` +For an example `exclude-file.txt`: -``` -{ - "_name": "remote", - "_path": "/tmp" -} -``` + # a sample exclude rule file + *.bak + file2.jpg -And this is equivalent to `:sftp,host='example.com':/tmp` +`rclone ls remote: --exclude-from exclude-file.txt` lists the files on +`remote:` except those named `file2.jpg` or with a suffix `.bak`. That is +equivalent to `rclone ls remote: --exclude file2.jpg --exclude "*.bak"`. -``` -{ - "type": "sftp", - "host": "example.com", - "_path": "/tmp" -} -``` +This flag can be repeated. See above for the order filter flags are +processed in. -And this is equivalent to `/tmp/dir` +The `--exclude-from` flag is useful where multiple exclude filter rules +are applied to an rclone command. -``` -{ - type = "local", - _ path = "/tmp/dir" -} -``` +`--exclude-from` should not be used with `--include`, `--include-from`, +`--filter` or `--filter-from` flags. -## Supported commands +`--exclude-from` has no effect when combined with `--files-from` or +`--files-from-raw` flags. -### backend/command: Runs a backend command. {#backend-command} +`--exclude-from` followed by `-` reads filter rules from standard input. -This takes the following parameters: +### `--include` - Include files matching pattern -- command - a string with the command name -- fs - a remote name string e.g. "drive:" -- arg - a list of arguments for the backend command -- opt - a map of string to string of options +Adds a single include rule based on path/file names to an rclone +command. -Returns: +This flag can be repeated. See above for the order filter flags are +processed in. -- result - result from the backend command +`--include` has no effect when combined with `--files-from` or +`--files-from-raw` flags. -Example: +`--include` implies `--exclude **` at the end of an rclone internal +filter list. Therefore if you mix `--include` and `--include-from` +flags with `--exclude`, `--exclude-from`, `--filter` or `--filter-from`, +you must use include rules for all the files you want in the include +statement. For more flexibility use the `--filter-from` flag. - rclone rc backend/command command=noop fs=. -o echo=yes -o blue -a path1 -a path2 +E.g. `rclone ls remote: --include "*.{png,jpg}"` lists the files on +`remote:` with suffix `.png` and `.jpg`. All other files are excluded. -Returns +E.g. multiple rclone copy commands can be combined with `--include` and a +pattern-list. -``` -{ - "result": { - "arg": [ - "path1", - "path2" - ], - "name": "noop", - "opt": { - "blue": "", - "echo": "yes" - } - } -} -``` + rclone copy /vol1/A remote:A + rclone copy /vol1/B remote:B -Note that this is the direct equivalent of using this "backend" -command: +is equivalent to: - rclone backend noop . -o echo=yes -o blue path1 path2 + rclone copy /vol1 remote: --include "{A,B}/**" -Note that arguments must be preceded by the "-a" flag +E.g. `rclone ls remote:/wheat --include "??[^[:punct:]]*"` lists the +files `remote:` directory `wheat` (and subdirectories) whose third +character is not punctuation. This example uses +an [ASCII character class](https://golang.org/pkg/regexp/syntax/). -See the [backend](https://rclone.org/commands/rclone_backend/) command for more information. +### `--include-from` - Read include patterns from file -**Authentication is required for this call.** +Adds path/file names to an rclone command based on rules in a +named file. The file contains a list of remarks and pattern rules. -### cache/expire: Purge a remote from cache {#cache-expire} +For an example `include-file.txt`: -Purge a remote from the cache backend. Supports either a directory or a file. -Params: - - remote = path to remote (required) - - withData = true/false to delete cached data (chunks) as well (optional) + # a sample include rule file + *.jpg + file2.avi -Eg +`rclone ls remote: --include-from include-file.txt` lists the files on +`remote:` with name `file2.avi` or suffix `.jpg`. That is equivalent to +`rclone ls remote: --include file2.avi --include "*.jpg"`. - rclone rc cache/expire remote=path/to/sub/folder/ - rclone rc cache/expire remote=/ withData=true +This flag can be repeated. See above for the order filter flags are +processed in. -### cache/fetch: Fetch file chunks {#cache-fetch} +The `--include-from` flag is useful where multiple include filter rules +are applied to an rclone command. -Ensure the specified file chunks are cached on disk. +`--include-from` implies `--exclude **` at the end of an rclone internal +filter list. Therefore if you mix `--include` and `--include-from` +flags with `--exclude`, `--exclude-from`, `--filter` or `--filter-from`, +you must use include rules for all the files you want in the include +statement. For more flexibility use the `--filter-from` flag. -The chunks= parameter specifies the file chunks to check. -It takes a comma separated list of array slice indices. -The slice indices are similar to Python slices: start[:end] +`--exclude-from` has no effect when combined with `--files-from` or +`--files-from-raw` flags. -start is the 0 based chunk number from the beginning of the file -to fetch inclusive. end is 0 based chunk number from the beginning -of the file to fetch exclusive. -Both values can be negative, in which case they count from the back -of the file. The value "-5:" represents the last 5 chunks of a file. +`--exclude-from` followed by `-` reads filter rules from standard input. -Some valid examples are: -":5,-5:" -> the first and last five chunks -"0,-2" -> the first and the second last chunk -"0:10" -> the first ten chunks +### `--filter` - Add a file-filtering rule -Any parameter with a key that starts with "file" can be used to -specify files to fetch, e.g. +Specifies path/file names to an rclone command, based on a single +include or exclude rule, in `+` or `-` format. - rclone rc cache/fetch chunks=0 file=hello file2=home/goodbye +This flag can be repeated. See above for the order filter flags are +processed in. -File names will automatically be encrypted when the a crypt remote -is used on top of the cache. +`--filter +` differs from `--include`. In the case of `--include` rclone +implies an `--exclude *` rule which it adds to the bottom of the internal rule +list. `--filter...+` does not imply +that rule. -### cache/stats: Get cache stats {#cache-stats} +`--filter` has no effect when combined with `--files-from` or +`--files-from-raw` flags. -Show statistics for the cache remote. +`--filter` should not be used with `--include`, `--include-from`, +`--exclude` or `--exclude-from` flags. -### config/create: create the config for a remote. {#config-create} +E.g. `rclone ls remote: --filter "- *.bak"` excludes all `.bak` files +from a list of `remote:`. -This takes the following parameters: +### `--filter-from` - Read filtering patterns from a file -- name - name of remote -- parameters - a map of \{ "key": "value" \} pairs -- type - type of the new remote -- opt - a dictionary of options to control the configuration - - obscure - declare passwords are plain and need obscuring - - noObscure - declare passwords are already obscured and don't need obscuring - - nonInteractive - don't interact with a user, return questions - - continue - continue the config process with an answer - - all - ask all the config questions not just the post config ones - - state - state to restart with - used with continue - - result - result to restart with - used with continue +Adds path/file names to an rclone command based on rules in a +named file. The file contains a list of remarks and pattern rules. Include +rules start with `+ ` and exclude rules with `- `. `!` clears existing +rules. Rules are processed in the order they are defined. +This flag can be repeated. See above for the order filter flags are +processed in. -See the [config create](https://rclone.org/commands/rclone_config_create/) command for more information on the above. +Arrange the order of filter rules with the most restrictive first and +work down. -**Authentication is required for this call.** +E.g. for `filter-file.txt`: -### config/delete: Delete a remote in the config file. {#config-delete} + # a sample filter rule file + - secret*.jpg + + *.jpg + + *.png + + file2.avi + - /dir/Trash/** + + /dir/** + # exclude everything else + - * -Parameters: +`rclone ls remote: --filter-from filter-file.txt` lists the path/files on +`remote:` including all `jpg` and `png` files, excluding any +matching `secret*.jpg` and including `file2.avi`. It also includes +everything in the directory `dir` at the root of `remote`, except +`remote:dir/Trash` which it excludes. Everything else is excluded. -- name - name of remote to delete -See the [config delete](https://rclone.org/commands/rclone_config_delete/) command for more information on the above. +E.g. for an alternative `filter-file.txt`: -**Authentication is required for this call.** + - secret*.jpg + + *.jpg + + *.png + + file2.avi + - * -### config/dump: Dumps the config file. {#config-dump} +Files `file1.jpg`, `file3.png` and `file2.avi` are listed whilst +`secret17.jpg` and files without the suffix .jpg` or `.png` are excluded. -Returns a JSON object: -- key: value +E.g. for an alternative `filter-file.txt`: -Where keys are remote names and values are the config parameters. + + *.jpg + + *.gif + ! + + 42.doc + - * -See the [config dump](https://rclone.org/commands/rclone_config_dump/) command for more information on the above. +Only file 42.doc is listed. Prior rules are cleared by the `!`. -**Authentication is required for this call.** +### `--files-from` - Read list of source-file names -### config/get: Get a remote in the config file. {#config-get} +Adds path/files to an rclone command from a list in a named file. +Rclone processes the path/file names in the order of the list, and +no others. -Parameters: +Other filter flags (`--include`, `--include-from`, `--exclude`, +`--exclude-from`, `--filter` and `--filter-from`) are ignored when +`--files-from` is used. -- name - name of remote to get +`--files-from` expects a list of files as its input. Leading or +trailing whitespace is stripped from the input lines. Lines starting +with `#` or `;` are ignored. -See the [config dump](https://rclone.org/commands/rclone_config_dump/) command for more information on the above. +Rclone commands with a `--files-from` flag traverse the remote, +treating the names in `--files-from` as a set of filters. -**Authentication is required for this call.** +If the `--no-traverse` and `--files-from` flags are used together +an rclone command does not traverse the remote. Instead it addresses +each path/file named in the file individually. For each path/file name, that +requires typically 1 API call. This can be efficient for a short `--files-from` +list and a remote containing many files. -### config/listremotes: Lists the remotes in the config file and defined in environment variables. {#config-listremotes} +Rclone commands do not error if any names in the `--files-from` file are +missing from the source remote. -Returns -- remotes - array of remote names +The `--files-from` flag can be repeated in a single rclone command to +read path/file names from more than one file. The files are read from left +to right along the command line. -See the [listremotes](https://rclone.org/commands/rclone_listremotes/) command for more information on the above. +Paths within the `--files-from` file are interpreted as starting +with the root specified in the rclone command. Leading `/` separators are +ignored. See [--files-from-raw](#files-from-raw-read-list-of-source-file-names-without-any-processing) if +you need the input to be processed in a raw manner. -**Authentication is required for this call.** +E.g. for a file `files-from.txt`: -### config/password: password the config for a remote. {#config-password} + # comment + file1.jpg + subdir/file2.jpg -This takes the following parameters: +`rclone copy --files-from files-from.txt /home/me/pics remote:pics` +copies the following, if they exist, and only those files. -- name - name of remote -- parameters - a map of \{ "key": "value" \} pairs + /home/me/pics/file1.jpg → remote:pics/file1.jpg + /home/me/pics/subdir/file2.jpg → remote:pics/subdir/file2.jpg +E.g. to copy the following files referenced by their absolute paths: -See the [config password](https://rclone.org/commands/rclone_config_password/) command for more information on the above. + /home/user1/42 + /home/user1/dir/ford + /home/user2/prefect -**Authentication is required for this call.** +First find a common subdirectory - in this case `/home` +and put the remaining files in `files-from.txt` with or without +leading `/`, e.g. -### config/providers: Shows how providers are configured in the config file. {#config-providers} + user1/42 + user1/dir/ford + user2/prefect -Returns a JSON object: -- providers - array of objects +Then copy these to a remote: -See the [config providers](https://rclone.org/commands/rclone_config_providers/) command for more information on the above. + rclone copy --files-from files-from.txt /home remote:backup -**Authentication is required for this call.** +The three files are transferred as follows: -### config/setpath: Set the path of the config file {#config-setpath} + /home/user1/42 → remote:backup/user1/important + /home/user1/dir/ford → remote:backup/user1/dir/file + /home/user2/prefect → remote:backup/user2/stuff -Parameters: +Alternatively if `/` is chosen as root `files-from.txt` will be: -- path - path to the config file to use + /home/user1/42 + /home/user1/dir/ford + /home/user2/prefect -**Authentication is required for this call.** +The copy command will be: -### config/update: update the config for a remote. {#config-update} + rclone copy --files-from files-from.txt / remote:backup -This takes the following parameters: +Then there will be an extra `home` directory on the remote: -- name - name of remote -- parameters - a map of \{ "key": "value" \} pairs -- opt - a dictionary of options to control the configuration - - obscure - declare passwords are plain and need obscuring - - noObscure - declare passwords are already obscured and don't need obscuring - - nonInteractive - don't interact with a user, return questions - - continue - continue the config process with an answer - - all - ask all the config questions not just the post config ones - - state - state to restart with - used with continue - - result - result to restart with - used with continue - - -See the [config update](https://rclone.org/commands/rclone_config_update/) command for more information on the above. - -**Authentication is required for this call.** + /home/user1/42 → remote:backup/home/user1/42 + /home/user1/dir/ford → remote:backup/home/user1/dir/ford + /home/user2/prefect → remote:backup/home/user2/prefect -### core/bwlimit: Set the bandwidth limit. {#core-bwlimit} +### `--files-from-raw` - Read list of source-file names without any processing -This sets the bandwidth limit to the string passed in. This should be -a single bandwidth limit entry or a pair of upload:download bandwidth. +This flag is the same as `--files-from` except that input is read in a +raw manner. Lines with leading / trailing whitespace, and lines starting +with `;` or `#` are read without any processing. [rclone lsf](https://rclone.org/commands/rclone_lsf/) has +a compatible format that can be used to export file lists from remotes for +input to `--files-from-raw`. -Eg +### `--ignore-case` - make searches case insensitive - rclone rc core/bwlimit rate=off - { - "bytesPerSecond": -1, - "bytesPerSecondTx": -1, - "bytesPerSecondRx": -1, - "rate": "off" - } - rclone rc core/bwlimit rate=1M - { - "bytesPerSecond": 1048576, - "bytesPerSecondTx": 1048576, - "bytesPerSecondRx": 1048576, - "rate": "1M" - } - rclone rc core/bwlimit rate=1M:100k - { - "bytesPerSecond": 1048576, - "bytesPerSecondTx": 1048576, - "bytesPerSecondRx": 131072, - "rate": "1M" - } +By default, rclone filter patterns are case sensitive. The `--ignore-case` +flag makes all of the filters patterns on the command line case +insensitive. +E.g. `--include "zaphod.txt"` does not match a file `Zaphod.txt`. With +`--ignore-case` a match is made. -If the rate parameter is not supplied then the bandwidth is queried +## Quoting shell metacharacters - rclone rc core/bwlimit - { - "bytesPerSecond": 1048576, - "bytesPerSecondTx": 1048576, - "bytesPerSecondRx": 1048576, - "rate": "1M" - } +Rclone commands with filter patterns containing shell metacharacters may +not as work as expected in your shell and may require quoting. -The format of the parameter is exactly the same as passed to --bwlimit -except only one bandwidth may be specified. +E.g. linux, OSX (`*` metacharacter) -In either case "rate" is returned as a human-readable string, and -"bytesPerSecond" is returned as a number. + * `--include \*.jpg` + * `--include '*.jpg'` + * `--include='*.jpg'` -### core/command: Run a rclone terminal command over rc. {#core-command} +Microsoft Windows expansion is done by the command, not shell, so +`--include *.jpg` does not require quoting. -This takes the following parameters: +If the rclone error +`Command .... needs .... arguments maximum: you provided .... non flag arguments:` +is encountered, the cause is commonly spaces within the name of a +remote or flag value. The fix then is to quote values containing spaces. -- command - a string with the command name. -- arg - a list of arguments for the backend command. -- opt - a map of string to string of options. -- returnType - one of ("COMBINED_OUTPUT", "STREAM", "STREAM_ONLY_STDOUT", "STREAM_ONLY_STDERR"). - - Defaults to "COMBINED_OUTPUT" if not set. - - The STREAM returnTypes will write the output to the body of the HTTP message. - - The COMBINED_OUTPUT will write the output to the "result" parameter. +## Other filters -Returns: +### `--min-size` - Don't transfer any file smaller than this -- result - result from the backend command. - - Only set when using returnType "COMBINED_OUTPUT". -- error - set if rclone exits with an error code. -- returnType - one of ("COMBINED_OUTPUT", "STREAM", "STREAM_ONLY_STDOUT", "STREAM_ONLY_STDERR"). +Controls the minimum size file within the scope of an rclone command. +Default units are `KiB` but abbreviations `K`, `M`, `G`, `T` or `P` are valid. -Example: +E.g. `rclone ls remote: --min-size 50k` lists files on `remote:` of 50 KiB +size or larger. - rclone rc core/command command=ls -a mydrive:/ -o max-depth=1 - rclone rc core/command -a ls -a mydrive:/ -o max-depth=1 +See [the size option docs](https://rclone.org/docs/#size-option) for more info. -Returns: +### `--max-size` - Don't transfer any file larger than this -``` -{ - "error": false, - "result": "" -} +Controls the maximum size file within the scope of an rclone command. +Default units are `KiB` but abbreviations `K`, `M`, `G`, `T` or `P` are valid. -OR -{ - "error": true, - "result": "" -} +E.g. `rclone ls remote: --max-size 1G` lists files on `remote:` of 1 GiB +size or smaller. -``` +See [the size option docs](https://rclone.org/docs/#size-option) for more info. -**Authentication is required for this call.** +### `--max-age` - Don't transfer any file older than this -### core/du: Returns disk usage of a locally attached disk. {#core-du} +Controls the maximum age of files within the scope of an rclone command. -This returns the disk usage for the local directory passed in as dir. +`--max-age` applies only to files and not to directories. -If the directory is not passed in, it defaults to the directory -pointed to by --cache-dir. +E.g. `rclone ls remote: --max-age 2d` lists files on `remote:` of 2 days +old or less. -- dir - string (optional) +See [the time option docs](https://rclone.org/docs/#time-option) for valid formats. -Returns: +### `--min-age` - Don't transfer any file younger than this -``` -{ - "dir": "/", - "info": { - "Available": 361769115648, - "Free": 361785892864, - "Total": 982141468672 - } -} -``` +Controls the minimum age of files within the scope of an rclone command. +(see `--max-age` for valid formats) -### core/gc: Runs a garbage collection. {#core-gc} +`--min-age` applies only to files and not to directories. -This tells the go runtime to do a garbage collection run. It isn't -necessary to call this normally, but it can be useful for debugging -memory problems. +E.g. `rclone ls remote: --min-age 2d` lists files on `remote:` of 2 days +old or more. -### core/group-list: Returns list of stats. {#core-group-list} +See [the time option docs](https://rclone.org/docs/#time-option) for valid formats. -This returns list of stats groups currently in memory. +## Other flags -Returns the following values: -``` -{ - "groups": an array of group names: - [ - "group1", - "group2", - ... - ] -} -``` +### `--delete-excluded` - Delete files on dest excluded from sync -### core/memstats: Returns the memory statistics {#core-memstats} +**Important** this flag is dangerous to your data - use with `--dry-run` +and `-v` first. -This returns the memory statistics of the running program. What the values mean -are explained in the go docs: https://golang.org/pkg/runtime/#MemStats +In conjunction with `rclone sync`, `--delete-excluded` deletes any files +on the destination which are excluded from the command. -The most interesting values for most people are: +E.g. the scope of `rclone sync --interactive A: B:` can be restricted: -- HeapAlloc - this is the amount of memory rclone is actually using -- HeapSys - this is the amount of memory rclone has obtained from the OS -- Sys - this is the total amount of memory requested from the OS - - It is virtual memory so may include unused memory + rclone --min-size 50k --delete-excluded sync A: B: -### core/obscure: Obscures a string passed in. {#core-obscure} +All files on `B:` which are less than 50 KiB are deleted +because they are excluded from the rclone sync command. -Pass a clear string and rclone will obscure it for the config file: -- clear - string +### `--dump filters` - dump the filters to the output -Returns: -- obscured - string +Dumps the defined filters to standard output in regular expression +format. -### core/pid: Return PID of current process {#core-pid} +Useful for debugging. -This returns PID of current process. -Useful for stopping rclone process. +## Exclude directory based on a file -### core/quit: Terminates the app. {#core-quit} +The `--exclude-if-present` flag controls whether a directory is +within the scope of an rclone command based on the presence of a +named file within it. The flag can be repeated to check for +multiple file names, presence of any of them will exclude the +directory. -(Optional) Pass an exit code to be used for terminating the app: -- exitCode - int +This flag has a priority over other filter flags. -### core/stats: Returns stats about current transfers. {#core-stats} +E.g. for the following directory structure: -This returns all available stats: + dir1/file1 + dir1/dir2/file2 + dir1/dir2/dir3/file3 + dir1/dir2/dir3/.ignore - rclone rc core/stats +The command `rclone ls --exclude-if-present .ignore dir1` does +not list `dir3`, `file3` or `.ignore`. -If group is not provided then summed up stats for all groups will be -returned. +## Metadata filters {#metadata} -Parameters +The metadata filters work in a very similar way to the normal file +name filters, except they match [metadata](https://rclone.org/docs/#metadata) on the +object. -- group - name of the stats group (string) +The metadata should be specified as `key=value` patterns. This may be +wildcarded using the normal [filter patterns](#patterns) or [regular +expressions](#regexp). -Returns the following values: +For example if you wished to list only local files with a mode of +`100664` you could do that with: -``` -{ - "bytes": total transferred bytes since the start of the group, - "checks": number of files checked, - "deletes" : number of files deleted, - "elapsedTime": time in floating point seconds since rclone was started, - "errors": number of errors, - "eta": estimated time in seconds until the group completes, - "fatalError": boolean whether there has been at least one fatal error, - "lastError": last error string, - "renames" : number of files renamed, - "retryError": boolean showing whether there has been at least one non-NoRetryError, - "serverSideCopies": number of server side copies done, - "serverSideCopyBytes": number bytes server side copied, - "serverSideMoves": number of server side moves done, - "serverSideMoveBytes": number bytes server side moved, - "speed": average speed in bytes per second since start of the group, - "totalBytes": total number of bytes in the group, - "totalChecks": total number of checks in the group, - "totalTransfers": total number of transfers in the group, - "transferTime" : total time spent on running jobs, - "transfers": number of transferred files, - "transferring": an array of currently active file transfers: - [ - { - "bytes": total transferred bytes for this file, - "eta": estimated time in seconds until file transfer completion - "name": name of the file, - "percentage": progress of the file transfer in percent, - "speed": average speed over the whole transfer in bytes per second, - "speedAvg": current speed in bytes per second as an exponentially weighted moving average, - "size": size of the file in bytes - } - ], - "checking": an array of names of currently active file checks - [] -} -``` -Values for "transferring", "checking" and "lastError" are only assigned if data is available. -The value for "eta" is null if an eta cannot be determined. + rclone lsf -M --files-only --metadata-include "mode=100664" . -### core/stats-delete: Delete stats group. {#core-stats-delete} +Or if you wished to show files with an `atime`, `mtime` or `btime` at a given date: -This deletes entire stats group. + rclone lsf -M --files-only --metadata-include "[abm]time=2022-12-16*" . -Parameters +Like file filtering, metadata filtering only applies to files not to +directories. -- group - name of the stats group (string) +The filters can be applied using these flags. -### core/stats-reset: Reset stats. {#core-stats-reset} +- `--metadata-include` - Include metadatas matching pattern +- `--metadata-include-from` - Read metadata include patterns from file (use - to read from stdin) +- `--metadata-exclude` - Exclude metadatas matching pattern +- `--metadata-exclude-from` - Read metadata exclude patterns from file (use - to read from stdin) +- `--metadata-filter` - Add a metadata filtering rule +- `--metadata-filter-from` - Read metadata filtering patterns from a file (use - to read from stdin) -This clears counters, errors and finished transfers for all stats or specific -stats group if group is provided. +Each flag can be repeated. See the section on [how filter rules are +applied](#how-filter-rules-work) for more details - these flags work +in an identical way to the file name filtering flags, but instead of +file name patterns have metadata patterns. -Parameters -- group - name of the stats group (string) +## Common pitfalls -### core/transferred: Returns stats about completed transfers. {#core-transferred} +The most frequent filter support issues on +the [rclone forum](https://forum.rclone.org/) are: -This returns stats about completed transfers: +* Not using paths relative to the root of the remote +* Not using `/` to match from the root of a remote +* Not using `**` to match the contents of a directory - rclone rc core/transferred +# GUI (Experimental) -If group is not provided then completed transfers for all groups will be -returned. +Rclone can serve a web based GUI (graphical user interface). This is +somewhat experimental at the moment so things may be subject to +change. -Note only the last 100 completed transfers are returned. +Run this command in a terminal and rclone will download and then +display the GUI in a web browser. -Parameters +``` +rclone rcd --rc-web-gui +``` -- group - name of the stats group (string) +This will produce logs like this and rclone needs to continue to run to serve the GUI: -Returns the following values: ``` -{ - "transferred": an array of completed transfers (including failed ones): - [ - { - "name": name of the file, - "size": size of the file in bytes, - "bytes": total transferred bytes for this file, - "checked": if the transfer is only checked (skipped, deleted), - "timestamp": integer representing millisecond unix epoch, - "error": string description of the error (empty if successful), - "jobid": id of the job that this transfer belongs to - } - ] -} +2019/08/25 11:40:14 NOTICE: A new release for gui is present at https://github.com/rclone/rclone-webui-react/releases/download/v0.0.6/currentbuild.zip +2019/08/25 11:40:14 NOTICE: Downloading webgui binary. Please wait. [Size: 3813937, Path : /home/USER/.cache/rclone/webgui/v0.0.6.zip] +2019/08/25 11:40:16 NOTICE: Unzipping +2019/08/25 11:40:16 NOTICE: Serving remote control on http://127.0.0.1:5572/ ``` -### core/version: Shows the current version of rclone and the go runtime. {#core-version} +This assumes you are running rclone locally on your machine. It is +possible to separate the rclone and the GUI - see below for details. -This shows the current version of go and the go runtime: +If you wish to check for updates then you can add `--rc-web-gui-update` +to the command line. -- version - rclone version, e.g. "v1.53.0" -- decomposed - version number as [major, minor, patch] -- isGit - boolean - true if this was compiled from the git version -- isBeta - boolean - true if this is a beta version -- os - OS in use as according to Go -- arch - cpu architecture in use according to Go -- goVersion - version of Go runtime in use -- linking - type of rclone executable (static or dynamic) -- goTags - space separated build tags or "none" +If you find your GUI broken, you may force it to update by add `--rc-web-gui-force-update`. -### debug/set-block-profile-rate: Set runtime.SetBlockProfileRate for blocking profiling. {#debug-set-block-profile-rate} +By default, rclone will open your browser. Add `--rc-web-gui-no-open-browser` +to disable this feature. -SetBlockProfileRate controls the fraction of goroutine blocking events -that are reported in the blocking profile. The profiler aims to sample -an average of one blocking event per rate nanoseconds spent blocked. +## Using the GUI -To include every blocking event in the profile, pass rate = 1. To turn -off profiling entirely, pass rate <= 0. +Once the GUI opens, you will be looking at the dashboard which has an overall overview. -After calling this you can use this to see the blocking profile: +On the left hand side you will see a series of view buttons you can click on: - go tool pprof http://localhost:5572/debug/pprof/block +- Dashboard - main overview +- Configs - examine and create new configurations +- Explorer - view, download and upload files to the cloud storage systems +- Backend - view or alter the backend config +- Log out -Parameters: +(More docs and walkthrough video to come!) -- rate - int +## How it works -### debug/set-gc-percent: Call runtime/debug.SetGCPercent for setting the garbage collection target percentage. {#debug-set-gc-percent} +When you run the `rclone rcd --rc-web-gui` this is what happens -SetGCPercent sets the garbage collection target percentage: a collection is triggered -when the ratio of freshly allocated data to live data remaining after the previous collection -reaches this percentage. SetGCPercent returns the previous setting. The initial setting is the -value of the GOGC environment variable at startup, or 100 if the variable is not set. +- Rclone starts but only runs the remote control API ("rc"). +- The API is bound to localhost with an auto-generated username and password. +- If the API bundle is missing then rclone will download it. +- rclone will start serving the files from the API bundle over the same port as the API +- rclone will open the browser with a `login_token` so it can log straight in. -This setting may be effectively reduced in order to maintain a memory limit. -A negative percentage effectively disables garbage collection, unless the memory limit is reached. +## Advanced use -See https://pkg.go.dev/runtime/debug#SetMemoryLimit for more details. +The `rclone rcd` may use any of the [flags documented on the rc page](https://rclone.org/rc/#supported-parameters). -Parameters: +The flag `--rc-web-gui` is shorthand for -- gc-percent - int +- Download the web GUI if necessary +- Check we are using some authentication +- `--rc-user gui` +- `--rc-pass ` +- `--rc-serve` -### debug/set-mutex-profile-fraction: Set runtime.SetMutexProfileFraction for mutex profiling. {#debug-set-mutex-profile-fraction} +These flags can be overridden as desired. -SetMutexProfileFraction controls the fraction of mutex contention -events that are reported in the mutex profile. On average 1/rate -events are reported. The previous rate is returned. +See also the [rclone rcd documentation](https://rclone.org/commands/rclone_rcd/). -To turn off profiling entirely, pass rate 0. To just read the current -rate, pass rate < 0. (For n>1 the details of sampling may change.) +### Example: Running a public GUI -Once this is set you can look use this to profile the mutex contention: +For example the GUI could be served on a public port over SSL using an htpasswd file using the following flags: - go tool pprof http://localhost:5572/debug/pprof/mutex +- `--rc-web-gui` +- `--rc-addr :443` +- `--rc-htpasswd /path/to/htpasswd` +- `--rc-cert /path/to/ssl.crt` +- `--rc-key /path/to/ssl.key` -Parameters: +### Example: Running a GUI behind a proxy -- rate - int +If you want to run the GUI behind a proxy at `/rclone` you could use these flags: -Results: +- `--rc-web-gui` +- `--rc-baseurl rclone` +- `--rc-htpasswd /path/to/htpasswd` -- previousRate - int +Or instead of htpasswd if you just want a single user and password: -### debug/set-soft-memory-limit: Call runtime/debug.SetMemoryLimit for setting a soft memory limit for the runtime. {#debug-set-soft-memory-limit} +- `--rc-user me` +- `--rc-pass mypassword` -SetMemoryLimit provides the runtime with a soft memory limit. +## Project -The runtime undertakes several processes to try to respect this memory limit, including -adjustments to the frequency of garbage collections and returning memory to the underlying -system more aggressively. This limit will be respected even if GOGC=off (or, if SetGCPercent(-1) is executed). +The GUI is being developed in the: [rclone/rclone-webui-react repository](https://github.com/rclone/rclone-webui-react). -The input limit is provided as bytes, and includes all memory mapped, managed, and not -released by the Go runtime. Notably, it does not account for space used by the Go binary -and memory external to Go, such as memory managed by the underlying system on behalf of -the process, or memory managed by non-Go code inside the same process. -Examples of excluded memory sources include: OS kernel memory held on behalf of the process, -memory allocated by C code, and memory mapped by syscall.Mmap (because it is not managed by the Go runtime). +Bug reports and contributions are very welcome :-) -A zero limit or a limit that's lower than the amount of memory used by the Go runtime may cause -the garbage collector to run nearly continuously. However, the application may still make progress. +If you have questions then please ask them on the [rclone forum](https://forum.rclone.org/). -The memory limit is always respected by the Go runtime, so to effectively disable this behavior, -set the limit very high. math.MaxInt64 is the canonical value for disabling the limit, but values -much greater than the available memory on the underlying system work just as well. +# Remote controlling rclone with its API -See https://go.dev/doc/gc-guide for a detailed guide explaining the soft memory limit in more detail, -as well as a variety of common use-cases and scenarios. +If rclone is run with the `--rc` flag then it starts an HTTP server +which can be used to remote control rclone using its API. -SetMemoryLimit returns the previously set memory limit. A negative input does not adjust the limit, -and allows for retrieval of the currently set memory limit. +You can either use the [rc](#api-rc) command to access the API +or [use HTTP directly](#api-http). -Parameters: +If you just want to run a remote control then see the [rcd](https://rclone.org/commands/rclone_rcd/) command. -- mem-limit - int +## Supported parameters -### fscache/clear: Clear the Fs cache. {#fscache-clear} +### --rc -This clears the fs cache. This is where remotes created from backends -are cached for a short while to make repeated rc calls more efficient. +Flag to start the http server listen on remote requests + +### --rc-addr=IP -If you change the parameters of a backend then you may want to call -this to clear an existing remote out of the cache before re-creating -it. +IPaddress:Port or :Port to bind server to. (default "localhost:5572") -**Authentication is required for this call.** +### --rc-cert=KEY +SSL PEM key (concatenation of certificate and CA certificate) -### fscache/entries: Returns the number of entries in the fs cache. {#fscache-entries} +### --rc-client-ca=PATH +Client certificate authority to verify clients with -This returns the number of entries in the fs cache. +### --rc-htpasswd=PATH -Returns -- entries - number of items in the cache +htpasswd file - if not provided no authentication is done -**Authentication is required for this call.** +### --rc-key=PATH -### job/list: Lists the IDs of the running jobs {#job-list} +SSL PEM Private key -Parameters: None. +### --rc-max-header-bytes=VALUE -Results: +Maximum size of request header (default 4096) -- executeId - string id of rclone executing (change after restart) -- jobids - array of integer job ids (starting at 1 on each restart) +### --rc-min-tls-version=VALUE -### job/status: Reads the status of the job ID {#job-status} +The minimum TLS version that is acceptable. Valid values are "tls1.0", +"tls1.1", "tls1.2" and "tls1.3" (default "tls1.0"). -Parameters: +### --rc-user=VALUE -- jobid - id of the job (integer). +User name for authentication. -Results: +### --rc-pass=VALUE -- finished - boolean -- duration - time in seconds that the job ran for -- endTime - time the job finished (e.g. "2018-10-26T18:50:20.528746884+01:00") -- error - error from the job or empty string for no error -- finished - boolean whether the job has finished or not -- id - as passed in above -- startTime - time the job started (e.g. "2018-10-26T18:50:20.528336039+01:00") -- success - boolean - true for success false otherwise -- output - output of the job as would have been returned if called synchronously -- progress - output of the progress related to the underlying job +Password for authentication. -### job/stop: Stop the running job {#job-stop} - -Parameters: - -- jobid - id of the job (integer). - -### job/stopgroup: Stop all running jobs in a group {#job-stopgroup} - -Parameters: - -- group - name of the group (string). - -### mount/listmounts: Show current mount points {#mount-listmounts} +### --rc-realm=VALUE -This shows currently mounted points, which can be used for performing an unmount. +Realm for authentication (default "rclone") -This takes no parameters and returns +### --rc-server-read-timeout=DURATION -- mountPoints: list of current mount points +Timeout for server reading data (default 1h0m0s) -Eg +### --rc-server-write-timeout=DURATION - rclone rc mount/listmounts +Timeout for server writing data (default 1h0m0s) -**Authentication is required for this call.** +### --rc-serve -### mount/mount: Create a new mount point {#mount-mount} +Enable the serving of remote objects via the HTTP interface. This +means objects will be accessible at http://127.0.0.1:5572/ by default, +so you can browse to http://127.0.0.1:5572/ or http://127.0.0.1:5572/* +to see a listing of the remotes. Objects may be requested from +remotes using this syntax http://127.0.0.1:5572/[remote:path]/path/to/object -rclone allows Linux, FreeBSD, macOS and Windows to mount any of -Rclone's cloud storage systems as a file system with FUSE. +Default Off. -If no mountType is provided, the priority is given as follows: 1. mount 2.cmount 3.mount2 +### --rc-files /path/to/directory -This takes the following parameters: +Path to local files to serve on the HTTP server. -- fs - a remote path to be mounted (required) -- mountPoint: valid path on the local machine (required) -- mountType: one of the values (mount, cmount, mount2) specifies the mount implementation to use -- mountOpt: a JSON object with Mount options in. -- vfsOpt: a JSON object with VFS options in. +If this is set then rclone will serve the files in that directory. It +will also open the root in the web browser if specified. This is for +implementing browser based GUIs for rclone functions. -Example: +If `--rc-user` or `--rc-pass` is set then the URL that is opened will +have the authorization in the URL in the `http://user:pass@localhost/` +style. - rclone rc mount/mount fs=mydrive: mountPoint=/home//mountPoint - rclone rc mount/mount fs=mydrive: mountPoint=/home//mountPoint mountType=mount - rclone rc mount/mount fs=TestDrive: mountPoint=/mnt/tmp vfsOpt='{"CacheMode": 2}' mountOpt='{"AllowOther": true}' +Default Off. -The vfsOpt are as described in options/get and can be seen in the the -"vfs" section when running and the mountOpt can be seen in the "mount" section: +### --rc-enable-metrics - rclone rc options/get +Enable OpenMetrics/Prometheus compatible endpoint at `/metrics`. -**Authentication is required for this call.** +Default Off. -### mount/types: Show all possible mount types {#mount-types} +### --rc-web-gui -This shows all possible mount types and returns them as a list. +Set this flag to serve the default web gui on the same port as rclone. -This takes no parameters and returns +Default Off. -- mountTypes: list of mount types +### --rc-allow-origin -The mount types are strings like "mount", "mount2", "cmount" and can -be passed to mount/mount as the mountType parameter. +Set the allowed Access-Control-Allow-Origin for rc requests. -Eg +Can be used with --rc-web-gui if the rclone is running on different IP than the web-gui. - rclone rc mount/types +Default is IP address on which rc is running. -**Authentication is required for this call.** +### --rc-web-fetch-url -### mount/unmount: Unmount selected active mount {#mount-unmount} +Set the URL to fetch the rclone-web-gui files from. -rclone allows Linux, FreeBSD, macOS and Windows to -mount any of Rclone's cloud storage systems as a file system with -FUSE. +Default https://api.github.com/repos/rclone/rclone-webui-react/releases/latest. -This takes the following parameters: +### --rc-web-gui-update -- mountPoint: valid path on the local machine where the mount was created (required) +Set this flag to check and update rclone-webui-react from the rc-web-fetch-url. -Example: +Default Off. - rclone rc mount/unmount mountPoint=/home//mountPoint +### --rc-web-gui-force-update -**Authentication is required for this call.** +Set this flag to force update rclone-webui-react from the rc-web-fetch-url. -### mount/unmountall: Unmount all active mounts {#mount-unmountall} +Default Off. -rclone allows Linux, FreeBSD, macOS and Windows to -mount any of Rclone's cloud storage systems as a file system with -FUSE. +### --rc-web-gui-no-open-browser -This takes no parameters and returns error if unmount does not succeed. +Set this flag to disable opening browser automatically when using web-gui. -Eg +Default Off. - rclone rc mount/unmountall +### --rc-job-expire-duration=DURATION -**Authentication is required for this call.** +Expire finished async jobs older than DURATION (default 60s). -### operations/about: Return the space used on the remote {#operations-about} +### --rc-job-expire-interval=DURATION -This takes the following parameters: +Interval duration to check for expired async jobs (default 10s). -- fs - a remote name string e.g. "drive:" +### --rc-no-auth -The result is as returned from rclone about --json +By default rclone will require authorisation to have been set up on +the rc interface in order to use any methods which access any rclone +remotes. Eg `operations/list` is denied as it involved creating a +remote as is `sync/copy`. -See the [about](https://rclone.org/commands/rclone_about/) command for more information on the above. +If this is set then no authorisation will be required on the server to +use these methods. The alternative is to use `--rc-user` and +`--rc-pass` and use these credentials in the request. -**Authentication is required for this call.** +Default Off. -### operations/cleanup: Remove trashed files in the remote or path {#operations-cleanup} +### --rc-baseurl -This takes the following parameters: +Prefix for URLs. -- fs - a remote name string e.g. "drive:" +Default is root -See the [cleanup](https://rclone.org/commands/rclone_cleanup/) command for more information on the above. +### --rc-template -**Authentication is required for this call.** +User-specified template. -### operations/copyfile: Copy a file from source remote to destination remote {#operations-copyfile} +## Accessing the remote control via the rclone rc command {#api-rc} -This takes the following parameters: +Rclone itself implements the remote control protocol in its `rclone +rc` command. -- srcFs - a remote name string e.g. "drive:" for the source, "/" for local filesystem -- srcRemote - a path within that remote e.g. "file.txt" for the source -- dstFs - a remote name string e.g. "drive2:" for the destination, "/" for local filesystem -- dstRemote - a path within that remote e.g. "file2.txt" for the destination +You can use it like this -**Authentication is required for this call.** +``` +$ rclone rc rc/noop param1=one param2=two +{ + "param1": "one", + "param2": "two" +} +``` -### operations/copyurl: Copy the URL to the object {#operations-copyurl} +Run `rclone rc` on its own to see the help for the installed remote +control commands. -This takes the following parameters: +## JSON input -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" -- url - string, URL to read from - - autoFilename - boolean, set to true to retrieve destination file name from url +`rclone rc` also supports a `--json` flag which can be used to send +more complicated input parameters. -See the [copyurl](https://rclone.org/commands/rclone_copyurl/) command for more information on the above. +``` +$ rclone rc --json '{ "p1": [1,"2",null,4], "p2": { "a":1, "b":2 } }' rc/noop +{ + "p1": [ + 1, + "2", + null, + 4 + ], + "p2": { + "a": 1, + "b": 2 + } +} +``` -**Authentication is required for this call.** +If the parameter being passed is an object then it can be passed as a +JSON string rather than using the `--json` flag which simplifies the +command line. -### operations/delete: Remove files in the path {#operations-delete} +``` +rclone rc operations/list fs=/tmp remote=test opt='{"showHash": true}' +``` -This takes the following parameters: +Rather than -- fs - a remote name string e.g. "drive:" +``` +rclone rc operations/list --json '{"fs": "/tmp", "remote": "test", "opt": {"showHash": true}}' +``` -See the [delete](https://rclone.org/commands/rclone_delete/) command for more information on the above. +## Special parameters -**Authentication is required for this call.** +The rc interface supports some special parameters which apply to +**all** commands. These start with `_` to show they are different. -### operations/deletefile: Remove the single file pointed to {#operations-deletefile} +### Running asynchronous jobs with _async = true -This takes the following parameters: +Each rc call is classified as a job and it is assigned its own id. By default +jobs are executed immediately as they are created or synchronously. -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" +If `_async` has a true value when supplied to an rc call then it will +return immediately with a job id and the task will be run in the +background. The `job/status` call can be used to get information of +the background job. The job can be queried for up to 1 minute after +it has finished. -See the [deletefile](https://rclone.org/commands/rclone_deletefile/) command for more information on the above. +It is recommended that potentially long running jobs, e.g. `sync/sync`, +`sync/copy`, `sync/move`, `operations/purge` are run with the `_async` +flag to avoid any potential problems with the HTTP request and +response timing out. -**Authentication is required for this call.** +Starting a job with the `_async` flag: -### operations/fsinfo: Return information about the remote {#operations-fsinfo} +``` +$ rclone rc --json '{ "p1": [1,"2",null,4], "p2": { "a":1, "b":2 }, "_async": true }' rc/noop +{ + "jobid": 2 +} +``` -This takes the following parameters: +Query the status to see if the job has finished. For more information +on the meaning of these return parameters see the `job/status` call. -- fs - a remote name string e.g. "drive:" +``` +$ rclone rc --json '{ "jobid":2 }' job/status +{ + "duration": 0.000124163, + "endTime": "2018-10-27T11:38:07.911245881+01:00", + "error": "", + "finished": true, + "id": 2, + "output": { + "_async": true, + "p1": [ + 1, + "2", + null, + 4 + ], + "p2": { + "a": 1, + "b": 2 + } + }, + "startTime": "2018-10-27T11:38:07.911121728+01:00", + "success": true +} +``` -This returns info about the remote passed in; +`job/list` can be used to show the running or recently completed jobs ``` +$ rclone rc job/list { - // optional features and whether they are available or not - "Features": { - "About": true, - "BucketBased": false, - "BucketBasedRootOK": false, - "CanHaveEmptyDirectories": true, - "CaseInsensitive": false, - "ChangeNotify": false, - "CleanUp": false, - "Command": true, - "Copy": false, - "DirCacheFlush": false, - "DirMove": true, - "Disconnect": false, - "DuplicateFiles": false, - "GetTier": false, - "IsLocal": true, - "ListR": false, - "MergeDirs": false, - "MetadataInfo": true, - "Move": true, - "OpenWriterAt": true, - "PublicLink": false, - "Purge": true, - "PutStream": true, - "PutUnchecked": false, - "ReadMetadata": true, - "ReadMimeType": false, - "ServerSideAcrossConfigs": false, - "SetTier": false, - "SetWrapper": false, - "Shutdown": false, - "SlowHash": true, - "SlowModTime": false, - "UnWrap": false, - "UserInfo": false, - "UserMetadata": true, - "WrapFs": false, - "WriteMetadata": true, - "WriteMimeType": false - }, - // Names of hashes available - "Hashes": [ - "md5", - "sha1", - "whirlpool", - "crc32", - "sha256", - "dropbox", - "mailru", - "quickxor" - ], - "Name": "local", // Name as created - "Precision": 1, // Precision of timestamps in ns - "Root": "/", // Path as created - "String": "Local file system at /", // how the remote will appear in logs - // Information about the system metadata for this backend - "MetadataInfo": { - "System": { - "atime": { - "Help": "Time of last access", - "Type": "RFC 3339", - "Example": "2006-01-02T15:04:05.999999999Z07:00" - }, - "btime": { - "Help": "Time of file birth (creation)", - "Type": "RFC 3339", - "Example": "2006-01-02T15:04:05.999999999Z07:00" - }, - "gid": { - "Help": "Group ID of owner", - "Type": "decimal number", - "Example": "500" - }, - "mode": { - "Help": "File type and mode", - "Type": "octal, unix style", - "Example": "0100664" - }, - "mtime": { - "Help": "Time of last modification", - "Type": "RFC 3339", - "Example": "2006-01-02T15:04:05.999999999Z07:00" - }, - "rdev": { - "Help": "Device ID (if special file)", - "Type": "hexadecimal", - "Example": "1abc" - }, - "uid": { - "Help": "User ID of owner", - "Type": "decimal number", - "Example": "500" - } - }, - "Help": "Textual help string\n" - } + "jobids": [ + 2 + ] } ``` -This command does not have a command line equivalent so use this instead: - - rclone rc --loopback operations/fsinfo fs=remote: +### Setting config flags with _config -### operations/list: List the given remote and path in JSON format {#operations-list} +If you wish to set config (the equivalent of the global flags) for the +duration of an rc call only then pass in the `_config` parameter. -This takes the following parameters: +This should be in the same format as the `config` key returned by +[options/get](#options-get). -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" -- opt - a dictionary of options to control the listing (optional) - - recurse - If set recurse directories - - noModTime - If set return modification time - - showEncrypted - If set show decrypted names - - showOrigIDs - If set show the IDs for each item if known - - showHash - If set return a dictionary of hashes - - noMimeType - If set don't show mime types - - dirsOnly - If set only show directories - - filesOnly - If set only show files - - metadata - If set return metadata of objects also - - hashTypes - array of strings of hash types to show if showHash set +For example, if you wished to run a sync with the `--checksum` +parameter, you would pass this parameter in your JSON blob. -Returns: + "_config":{"CheckSum": true} -- list - - This is an array of objects as described in the lsjson command +If using `rclone rc` this could be passed as -See the [lsjson](https://rclone.org/commands/rclone_lsjson/) command for more information on the above and examples. + rclone rc sync/sync ... _config='{"CheckSum": true}' -**Authentication is required for this call.** +Any config parameters you don't set will inherit the global defaults +which were set with command line flags or environment variables. -### operations/mkdir: Make a destination directory or container {#operations-mkdir} +Note that it is possible to set some values as strings or integers - +see [data types](#data-types) for more info. Here is an example +setting the equivalent of `--buffer-size` in string or integer format. -This takes the following parameters: + "_config":{"BufferSize": "42M"} + "_config":{"BufferSize": 44040192} -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" +If you wish to check the `_config` assignment has worked properly then +calling `options/local` will show what the value got set to. -See the [mkdir](https://rclone.org/commands/rclone_mkdir/) command for more information on the above. +### Setting filter flags with _filter -**Authentication is required for this call.** +If you wish to set filters for the duration of an rc call only then +pass in the `_filter` parameter. -### operations/movefile: Move a file from source remote to destination remote {#operations-movefile} +This should be in the same format as the `filter` key returned by +[options/get](#options-get). -This takes the following parameters: +For example, if you wished to run a sync with these flags -- srcFs - a remote name string e.g. "drive:" for the source, "/" for local filesystem -- srcRemote - a path within that remote e.g. "file.txt" for the source -- dstFs - a remote name string e.g. "drive2:" for the destination, "/" for local filesystem -- dstRemote - a path within that remote e.g. "file2.txt" for the destination + --max-size 1M --max-age 42s --include "a" --include "b" -**Authentication is required for this call.** +you would pass this parameter in your JSON blob. -### operations/publiclink: Create or retrieve a public link to the given file or folder. {#operations-publiclink} + "_filter":{"MaxSize":"1M", "IncludeRule":["a","b"], "MaxAge":"42s"} -This takes the following parameters: +If using `rclone rc` this could be passed as -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" -- unlink - boolean - if set removes the link rather than adding it (optional) -- expire - string - the expiry time of the link e.g. "1d" (optional) + rclone rc ... _filter='{"MaxSize":"1M", "IncludeRule":["a","b"], "MaxAge":"42s"}' -Returns: +Any filter parameters you don't set will inherit the global defaults +which were set with command line flags or environment variables. -- url - URL of the resource +Note that it is possible to set some values as strings or integers - +see [data types](#data-types) for more info. Here is an example +setting the equivalent of `--buffer-size` in string or integer format. -See the [link](https://rclone.org/commands/rclone_link/) command for more information on the above. + "_filter":{"MinSize": "42M"} + "_filter":{"MinSize": 44040192} -**Authentication is required for this call.** +If you wish to check the `_filter` assignment has worked properly then +calling `options/local` will show what the value got set to. -### operations/purge: Remove a directory or container and all of its contents {#operations-purge} +### Assigning operations to groups with _group = value -This takes the following parameters: +Each rc call has its own stats group for tracking its metrics. By default +grouping is done by the composite group name from prefix `job/` and id of the +job like so `job/1`. -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" +If `_group` has a value then stats for that request will be grouped under that +value. This allows caller to group stats under their own name. -See the [purge](https://rclone.org/commands/rclone_purge/) command for more information on the above. +Stats for specific group can be accessed by passing `group` to `core/stats`: -**Authentication is required for this call.** +``` +$ rclone rc --json '{ "group": "job/1" }' core/stats +{ + "speed": 12345 + ... +} +``` -### operations/rmdir: Remove an empty directory or container {#operations-rmdir} +## Data types {#data-types} -This takes the following parameters: +When the API returns types, these will mostly be straight forward +integer, string or boolean types. -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" +However some of the types returned by the [options/get](#options-get) +call and taken by the [options/set](#options-set) calls as well as the +`vfsOpt`, `mountOpt` and the `_config` parameters. -See the [rmdir](https://rclone.org/commands/rclone_rmdir/) command for more information on the above. +- `Duration` - these are returned as an integer duration in + nanoseconds. They may be set as an integer, or they may be set with + time string, eg "5s". See the [options section](https://rclone.org/docs/#options) for + more info. +- `Size` - these are returned as an integer number of bytes. They may + be set as an integer or they may be set with a size suffix string, + eg "10M". See the [options section](https://rclone.org/docs/#options) for more info. +- Enumerated type (such as `CutoffMode`, `DumpFlags`, `LogLevel`, + `VfsCacheMode` - these will be returned as an integer and may be set + as an integer but more conveniently they can be set as a string, eg + "HARD" for `CutoffMode` or `DEBUG` for `LogLevel`. +- `BandwidthSpec` - this will be set and returned as a string, eg + "1M". -**Authentication is required for this call.** +## Specifying remotes to work on -### operations/rmdirs: Remove all the empty directories in the path {#operations-rmdirs} +Remotes are specified with the `fs=`, `srcFs=`, `dstFs=` +parameters depending on the command being used. -This takes the following parameters: +The parameters can be a string as per the rest of rclone, eg +`s3:bucket/path` or `:sftp:/my/dir`. They can also be specified as +JSON blobs. -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" -- leaveRoot - boolean, set to true not to delete the root +If specifying a JSON blob it should be a object mapping strings to +strings. These values will be used to configure the remote. There are +3 special values which may be set: -See the [rmdirs](https://rclone.org/commands/rclone_rmdirs/) command for more information on the above. +- `type` - set to `type` to specify a remote called `:type:` +- `_name` - set to `name` to specify a remote called `name:` +- `_root` - sets the root of the remote - may be empty -**Authentication is required for this call.** +One of `_name` or `type` should normally be set. If the `local` +backend is desired then `type` should be set to `local`. If `_root` +isn't specified then it defaults to the root of the remote. -### operations/settier: Changes storage tier or class on all files in the path {#operations-settier} +For example this JSON is equivalent to `remote:/tmp` -This takes the following parameters: - -- fs - a remote name string e.g. "drive:" - -See the [settier](https://rclone.org/commands/rclone_settier/) command for more information on the above. - -**Authentication is required for this call.** +``` +{ + "_name": "remote", + "_path": "/tmp" +} +``` -### operations/settierfile: Changes storage tier or class on the single file pointed to {#operations-settierfile} +And this is equivalent to `:sftp,host='example.com':/tmp` -This takes the following parameters: +``` +{ + "type": "sftp", + "host": "example.com", + "_path": "/tmp" +} +``` -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" +And this is equivalent to `/tmp/dir` -See the [settierfile](https://rclone.org/commands/rclone_settierfile/) command for more information on the above. +``` +{ + type = "local", + _ path = "/tmp/dir" +} +``` -**Authentication is required for this call.** +## Supported commands -### operations/size: Count the number of bytes and files in remote {#operations-size} +### backend/command: Runs a backend command. {#backend-command} This takes the following parameters: -- fs - a remote name string e.g. "drive:path/to/dir" +- command - a string with the command name +- fs - a remote name string e.g. "drive:" +- arg - a list of arguments for the backend command +- opt - a map of string to string of options Returns: -- count - number of files -- bytes - number of bytes in those files - -See the [size](https://rclone.org/commands/rclone_size/) command for more information on the above. - -**Authentication is required for this call.** - -### operations/stat: Give information about the supplied file or directory {#operations-stat} - -This takes the following parameters - -- fs - a remote name string eg "drive:" -- remote - a path within that remote eg "dir" -- opt - a dictionary of options to control the listing (optional) - - see operations/list for the options - -The result is +- result - result from the backend command -- item - an object as described in the lsjson command. Will be null if not found. +Example: -Note that if you are only interested in files then it is much more -efficient to set the filesOnly flag in the options. + rclone rc backend/command command=noop fs=. -o echo=yes -o blue -a path1 -a path2 -See the [lsjson](https://rclone.org/commands/rclone_lsjson/) command for more information on the above and examples. +Returns -**Authentication is required for this call.** +``` +{ + "result": { + "arg": [ + "path1", + "path2" + ], + "name": "noop", + "opt": { + "blue": "", + "echo": "yes" + } + } +} +``` -### operations/uploadfile: Upload file using multiform/form-data {#operations-uploadfile} +Note that this is the direct equivalent of using this "backend" +command: -This takes the following parameters: + rclone backend noop . -o echo=yes -o blue path1 path2 -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" -- each part in body represents a file to be uploaded +Note that arguments must be preceded by the "-a" flag -See the [uploadfile](https://rclone.org/commands/rclone_uploadfile/) command for more information on the above. +See the [backend](https://rclone.org/commands/rclone_backend/) command for more information. **Authentication is required for this call.** -### options/blocks: List all the option blocks {#options-blocks} +### cache/expire: Purge a remote from cache {#cache-expire} -Returns: -- options - a list of the options block names +Purge a remote from the cache backend. Supports either a directory or a file. +Params: + - remote = path to remote (required) + - withData = true/false to delete cached data (chunks) as well (optional) -### options/get: Get all the global options {#options-get} +Eg -Returns an object where keys are option block names and values are an -object with the current option values in. + rclone rc cache/expire remote=path/to/sub/folder/ + rclone rc cache/expire remote=/ withData=true -Note that these are the global options which are unaffected by use of -the _config and _filter parameters. If you wish to read the parameters -set in _config then use options/config and for _filter use options/filter. +### cache/fetch: Fetch file chunks {#cache-fetch} -This shows the internal names of the option within rclone which should -map to the external options very easily with a few exceptions. +Ensure the specified file chunks are cached on disk. -### options/local: Get the currently active config for this call {#options-local} +The chunks= parameter specifies the file chunks to check. +It takes a comma separated list of array slice indices. +The slice indices are similar to Python slices: start[:end] -Returns an object with the keys "config" and "filter". -The "config" key contains the local config and the "filter" key contains -the local filters. +start is the 0 based chunk number from the beginning of the file +to fetch inclusive. end is 0 based chunk number from the beginning +of the file to fetch exclusive. +Both values can be negative, in which case they count from the back +of the file. The value "-5:" represents the last 5 chunks of a file. -Note that these are the local options specific to this rc call. If -_config was not supplied then they will be the global options. -Likewise with "_filter". +Some valid examples are: +":5,-5:" -> the first and last five chunks +"0,-2" -> the first and the second last chunk +"0:10" -> the first ten chunks -This call is mostly useful for seeing if _config and _filter passing -is working. +Any parameter with a key that starts with "file" can be used to +specify files to fetch, e.g. -This shows the internal names of the option within rclone which should -map to the external options very easily with a few exceptions. + rclone rc cache/fetch chunks=0 file=hello file2=home/goodbye -### options/set: Set an option {#options-set} +File names will automatically be encrypted when the a crypt remote +is used on top of the cache. -Parameters: +### cache/stats: Get cache stats {#cache-stats} -- option block name containing an object with - - key: value +Show statistics for the cache remote. -Repeated as often as required. +### config/create: create the config for a remote. {#config-create} -Only supply the options you wish to change. If an option is unknown -it will be silently ignored. Not all options will have an effect when -changed like this. +This takes the following parameters: -For example: +- name - name of remote +- parameters - a map of \{ "key": "value" \} pairs +- type - type of the new remote +- opt - a dictionary of options to control the configuration + - obscure - declare passwords are plain and need obscuring + - noObscure - declare passwords are already obscured and don't need obscuring + - nonInteractive - don't interact with a user, return questions + - continue - continue the config process with an answer + - all - ask all the config questions not just the post config ones + - state - state to restart with - used with continue + - result - result to restart with - used with continue -This sets DEBUG level logs (-vv) (these can be set by number or string) - rclone rc options/set --json '{"main": {"LogLevel": "DEBUG"}}' - rclone rc options/set --json '{"main": {"LogLevel": 8}}' +See the [config create](https://rclone.org/commands/rclone_config_create/) command for more information on the above. -And this sets INFO level logs (-v) +**Authentication is required for this call.** - rclone rc options/set --json '{"main": {"LogLevel": "INFO"}}' +### config/delete: Delete a remote in the config file. {#config-delete} -And this sets NOTICE level logs (normal without -v) +Parameters: - rclone rc options/set --json '{"main": {"LogLevel": "NOTICE"}}' +- name - name of remote to delete -### pluginsctl/addPlugin: Add a plugin using url {#pluginsctl-addPlugin} +See the [config delete](https://rclone.org/commands/rclone_config_delete/) command for more information on the above. -Used for adding a plugin to the webgui. +**Authentication is required for this call.** -This takes the following parameters: +### config/dump: Dumps the config file. {#config-dump} -- url - http url of the github repo where the plugin is hosted (http://github.com/rclone/rclone-webui-react). +Returns a JSON object: +- key: value -Example: +Where keys are remote names and values are the config parameters. - rclone rc pluginsctl/addPlugin +See the [config dump](https://rclone.org/commands/rclone_config_dump/) command for more information on the above. **Authentication is required for this call.** -### pluginsctl/getPluginsForType: Get plugins with type criteria {#pluginsctl-getPluginsForType} +### config/get: Get a remote in the config file. {#config-get} -This shows all possible plugins by a mime type. +Parameters: -This takes the following parameters: +- name - name of remote to get -- type - supported mime type by a loaded plugin e.g. (video/mp4, audio/mp3). -- pluginType - filter plugins based on their type e.g. (DASHBOARD, FILE_HANDLER, TERMINAL). +See the [config dump](https://rclone.org/commands/rclone_config_dump/) command for more information on the above. -Returns: +**Authentication is required for this call.** -- loadedPlugins - list of current production plugins. -- testPlugins - list of temporarily loaded development plugins, usually running on a different server. +### config/listremotes: Lists the remotes in the config file and defined in environment variables. {#config-listremotes} -Example: +Returns +- remotes - array of remote names - rclone rc pluginsctl/getPluginsForType type=video/mp4 +See the [listremotes](https://rclone.org/commands/rclone_listremotes/) command for more information on the above. **Authentication is required for this call.** -### pluginsctl/listPlugins: Get the list of currently loaded plugins {#pluginsctl-listPlugins} - -This allows you to get the currently enabled plugins and their details. +### config/password: password the config for a remote. {#config-password} -This takes no parameters and returns: +This takes the following parameters: -- loadedPlugins - list of current production plugins. -- testPlugins - list of temporarily loaded development plugins, usually running on a different server. +- name - name of remote +- parameters - a map of \{ "key": "value" \} pairs -E.g. - rclone rc pluginsctl/listPlugins +See the [config password](https://rclone.org/commands/rclone_config_password/) command for more information on the above. **Authentication is required for this call.** -### pluginsctl/listTestPlugins: Show currently loaded test plugins {#pluginsctl-listTestPlugins} - -Allows listing of test plugins with the rclone.test set to true in package.json of the plugin. - -This takes no parameters and returns: - -- loadedTestPlugins - list of currently available test plugins. +### config/providers: Shows how providers are configured in the config file. {#config-providers} -E.g. +Returns a JSON object: +- providers - array of objects - rclone rc pluginsctl/listTestPlugins +See the [config providers](https://rclone.org/commands/rclone_config_providers/) command for more information on the above. **Authentication is required for this call.** -### pluginsctl/removePlugin: Remove a loaded plugin {#pluginsctl-removePlugin} - -This allows you to remove a plugin using it's name. - -This takes parameters: - -- name - name of the plugin in the format `author`/`plugin_name`. +### config/setpath: Set the path of the config file {#config-setpath} -E.g. +Parameters: - rclone rc pluginsctl/removePlugin name=rclone/video-plugin +- path - path to the config file to use **Authentication is required for this call.** -### pluginsctl/removeTestPlugin: Remove a test plugin {#pluginsctl-removeTestPlugin} - -This allows you to remove a plugin using it's name. +### config/update: update the config for a remote. {#config-update} This takes the following parameters: -- name - name of the plugin in the format `author`/`plugin_name`. +- name - name of remote +- parameters - a map of \{ "key": "value" \} pairs +- opt - a dictionary of options to control the configuration + - obscure - declare passwords are plain and need obscuring + - noObscure - declare passwords are already obscured and don't need obscuring + - nonInteractive - don't interact with a user, return questions + - continue - continue the config process with an answer + - all - ask all the config questions not just the post config ones + - state - state to restart with - used with continue + - result - result to restart with - used with continue -Example: - rclone rc pluginsctl/removeTestPlugin name=rclone/rclone-webui-react +See the [config update](https://rclone.org/commands/rclone_config_update/) command for more information on the above. **Authentication is required for this call.** -### rc/error: This returns an error {#rc-error} - -This returns an error with the input as part of its error string. -Useful for testing error handling. - -### rc/list: List all the registered remote control commands {#rc-list} - -This lists all the registered remote control commands as a JSON map in -the commands response. - -### rc/noop: Echo the input to the output parameters {#rc-noop} - -This echoes the input parameters to the output parameters for testing -purposes. It can be used to check that rclone is still alive and to -check that parameter passing is working properly. +### core/bwlimit: Set the bandwidth limit. {#core-bwlimit} -### rc/noopauth: Echo the input to the output parameters requiring auth {#rc-noopauth} +This sets the bandwidth limit to the string passed in. This should be +a single bandwidth limit entry or a pair of upload:download bandwidth. -This echoes the input parameters to the output parameters for testing -purposes. It can be used to check that rclone is still alive and to -check that parameter passing is working properly. +Eg -**Authentication is required for this call.** + rclone rc core/bwlimit rate=off + { + "bytesPerSecond": -1, + "bytesPerSecondTx": -1, + "bytesPerSecondRx": -1, + "rate": "off" + } + rclone rc core/bwlimit rate=1M + { + "bytesPerSecond": 1048576, + "bytesPerSecondTx": 1048576, + "bytesPerSecondRx": 1048576, + "rate": "1M" + } + rclone rc core/bwlimit rate=1M:100k + { + "bytesPerSecond": 1048576, + "bytesPerSecondTx": 1048576, + "bytesPerSecondRx": 131072, + "rate": "1M" + } -### sync/bisync: Perform bidirectional synchronization between two paths. {#sync-bisync} -This takes the following parameters +If the rate parameter is not supplied then the bandwidth is queried -- path1 - a remote directory string e.g. `drive:path1` -- path2 - a remote directory string e.g. `drive:path2` -- dryRun - dry-run mode -- resync - performs the resync run -- checkAccess - abort if RCLONE_TEST files are not found on both filesystems -- checkFilename - file name for checkAccess (default: RCLONE_TEST) -- maxDelete - abort sync if percentage of deleted files is above - this threshold (default: 50) -- force - Bypass maxDelete safety check and run the sync -- checkSync - `true` by default, `false` disables comparison of final listings, - `only` will skip sync, only compare listings from the last run -- createEmptySrcDirs - Sync creation and deletion of empty directories. - (Not compatible with --remove-empty-dirs) -- removeEmptyDirs - remove empty directories at the final cleanup step -- filtersFile - read filtering patterns from a file -- ignoreListingChecksum - Do not use checksums for listings -- resilient - Allow future runs to retry after certain less-serious errors, instead of requiring resync. - Use at your own risk! -- workdir - server directory for history files (default: /home/ncw/.cache/rclone/bisync) -- noCleanup - retain working files + rclone rc core/bwlimit + { + "bytesPerSecond": 1048576, + "bytesPerSecondTx": 1048576, + "bytesPerSecondRx": 1048576, + "rate": "1M" + } -See [bisync command help](https://rclone.org/commands/rclone_bisync/) -and [full bisync description](https://rclone.org/bisync/) -for more information. +The format of the parameter is exactly the same as passed to --bwlimit +except only one bandwidth may be specified. -**Authentication is required for this call.** +In either case "rate" is returned as a human-readable string, and +"bytesPerSecond" is returned as a number. -### sync/copy: copy a directory from source remote to destination remote {#sync-copy} +### core/command: Run a rclone terminal command over rc. {#core-command} This takes the following parameters: -- srcFs - a remote name string e.g. "drive:src" for the source -- dstFs - a remote name string e.g. "drive:dst" for the destination -- createEmptySrcDirs - create empty src directories on destination if set +- command - a string with the command name. +- arg - a list of arguments for the backend command. +- opt - a map of string to string of options. +- returnType - one of ("COMBINED_OUTPUT", "STREAM", "STREAM_ONLY_STDOUT", "STREAM_ONLY_STDERR"). + - Defaults to "COMBINED_OUTPUT" if not set. + - The STREAM returnTypes will write the output to the body of the HTTP message. + - The COMBINED_OUTPUT will write the output to the "result" parameter. +Returns: -See the [copy](https://rclone.org/commands/rclone_copy/) command for more information on the above. +- result - result from the backend command. + - Only set when using returnType "COMBINED_OUTPUT". +- error - set if rclone exits with an error code. +- returnType - one of ("COMBINED_OUTPUT", "STREAM", "STREAM_ONLY_STDOUT", "STREAM_ONLY_STDERR"). -**Authentication is required for this call.** +Example: -### sync/move: move a directory from source remote to destination remote {#sync-move} + rclone rc core/command command=ls -a mydrive:/ -o max-depth=1 + rclone rc core/command -a ls -a mydrive:/ -o max-depth=1 -This takes the following parameters: +Returns: -- srcFs - a remote name string e.g. "drive:src" for the source -- dstFs - a remote name string e.g. "drive:dst" for the destination -- createEmptySrcDirs - create empty src directories on destination if set -- deleteEmptySrcDirs - delete empty src directories if set +``` +{ + "error": false, + "result": "" +} +OR +{ + "error": true, + "result": "" +} -See the [move](https://rclone.org/commands/rclone_move/) command for more information on the above. +``` **Authentication is required for this call.** -### sync/sync: sync a directory from source remote to destination remote {#sync-sync} +### core/du: Returns disk usage of a locally attached disk. {#core-du} -This takes the following parameters: +This returns the disk usage for the local directory passed in as dir. -- srcFs - a remote name string e.g. "drive:src" for the source -- dstFs - a remote name string e.g. "drive:dst" for the destination -- createEmptySrcDirs - create empty src directories on destination if set +If the directory is not passed in, it defaults to the directory +pointed to by --cache-dir. +- dir - string (optional) -See the [sync](https://rclone.org/commands/rclone_sync/) command for more information on the above. +Returns: -**Authentication is required for this call.** +``` +{ + "dir": "/", + "info": { + "Available": 361769115648, + "Free": 361785892864, + "Total": 982141468672 + } +} +``` -### vfs/forget: Forget files or directories in the directory cache. {#vfs-forget} +### core/gc: Runs a garbage collection. {#core-gc} -This forgets the paths in the directory cache causing them to be -re-read from the remote when needed. +This tells the go runtime to do a garbage collection run. It isn't +necessary to call this normally, but it can be useful for debugging +memory problems. -If no paths are passed in then it will forget all the paths in the -directory cache. +### core/group-list: Returns list of stats. {#core-group-list} - rclone rc vfs/forget +This returns list of stats groups currently in memory. -Otherwise pass files or dirs in as file=path or dir=path. Any -parameter key starting with file will forget that file and any -starting with dir will forget that dir, e.g. +Returns the following values: +``` +{ + "groups": an array of group names: + [ + "group1", + "group2", + ... + ] +} +``` - rclone rc vfs/forget file=hello file2=goodbye dir=home/junk - -This command takes an "fs" parameter. If this parameter is not -supplied and if there is only one VFS in use then that VFS will be -used. If there is more than one VFS in use then the "fs" parameter -must be supplied. +### core/memstats: Returns the memory statistics {#core-memstats} -### vfs/list: List active VFSes. {#vfs-list} +This returns the memory statistics of the running program. What the values mean +are explained in the go docs: https://golang.org/pkg/runtime/#MemStats -This lists the active VFSes. +The most interesting values for most people are: -It returns a list under the key "vfses" where the values are the VFS -names that could be passed to the other VFS commands in the "fs" -parameter. +- HeapAlloc - this is the amount of memory rclone is actually using +- HeapSys - this is the amount of memory rclone has obtained from the OS +- Sys - this is the total amount of memory requested from the OS + - It is virtual memory so may include unused memory -### vfs/poll-interval: Get the status or update the value of the poll-interval option. {#vfs-poll-interval} +### core/obscure: Obscures a string passed in. {#core-obscure} -Without any parameter given this returns the current status of the -poll-interval setting. +Pass a clear string and rclone will obscure it for the config file: +- clear - string -When the interval=duration parameter is set, the poll-interval value -is updated and the polling function is notified. -Setting interval=0 disables poll-interval. +Returns: +- obscured - string - rclone rc vfs/poll-interval interval=5m +### core/pid: Return PID of current process {#core-pid} -The timeout=duration parameter can be used to specify a time to wait -for the current poll function to apply the new value. -If timeout is less or equal 0, which is the default, wait indefinitely. +This returns PID of current process. +Useful for stopping rclone process. -The new poll-interval value will only be active when the timeout is -not reached. +### core/quit: Terminates the app. {#core-quit} -If poll-interval is updated or disabled temporarily, some changes -might not get picked up by the polling function, depending on the -used remote. - -This command takes an "fs" parameter. If this parameter is not -supplied and if there is only one VFS in use then that VFS will be -used. If there is more than one VFS in use then the "fs" parameter -must be supplied. +(Optional) Pass an exit code to be used for terminating the app: +- exitCode - int -### vfs/refresh: Refresh the directory cache. {#vfs-refresh} +### core/stats: Returns stats about current transfers. {#core-stats} -This reads the directories for the specified paths and freshens the -directory cache. +This returns all available stats: -If no paths are passed in then it will refresh the root directory. + rclone rc core/stats - rclone rc vfs/refresh +If group is not provided then summed up stats for all groups will be +returned. -Otherwise pass directories in as dir=path. Any parameter key -starting with dir will refresh that directory, e.g. +Parameters - rclone rc vfs/refresh dir=home/junk dir2=data/misc +- group - name of the stats group (string) -If the parameter recursive=true is given the whole directory tree -will get refreshed. This refresh will use --fast-list if enabled. - -This command takes an "fs" parameter. If this parameter is not -supplied and if there is only one VFS in use then that VFS will be -used. If there is more than one VFS in use then the "fs" parameter -must be supplied. +Returns the following values: -### vfs/stats: Stats for a VFS. {#vfs-stats} +``` +{ + "bytes": total transferred bytes since the start of the group, + "checks": number of files checked, + "deletes" : number of files deleted, + "elapsedTime": time in floating point seconds since rclone was started, + "errors": number of errors, + "eta": estimated time in seconds until the group completes, + "fatalError": boolean whether there has been at least one fatal error, + "lastError": last error string, + "renames" : number of files renamed, + "retryError": boolean showing whether there has been at least one non-NoRetryError, + "serverSideCopies": number of server side copies done, + "serverSideCopyBytes": number bytes server side copied, + "serverSideMoves": number of server side moves done, + "serverSideMoveBytes": number bytes server side moved, + "speed": average speed in bytes per second since start of the group, + "totalBytes": total number of bytes in the group, + "totalChecks": total number of checks in the group, + "totalTransfers": total number of transfers in the group, + "transferTime" : total time spent on running jobs, + "transfers": number of transferred files, + "transferring": an array of currently active file transfers: + [ + { + "bytes": total transferred bytes for this file, + "eta": estimated time in seconds until file transfer completion + "name": name of the file, + "percentage": progress of the file transfer in percent, + "speed": average speed over the whole transfer in bytes per second, + "speedAvg": current speed in bytes per second as an exponentially weighted moving average, + "size": size of the file in bytes + } + ], + "checking": an array of names of currently active file checks + [] +} +``` +Values for "transferring", "checking" and "lastError" are only assigned if data is available. +The value for "eta" is null if an eta cannot be determined. -This returns stats for the selected VFS. +### core/stats-delete: Delete stats group. {#core-stats-delete} - { - // Status of the disk cache - only present if --vfs-cache-mode > off - "diskCache": { - "bytesUsed": 0, - "erroredFiles": 0, - "files": 0, - "hashType": 1, - "outOfSpace": false, - "path": "/home/user/.cache/rclone/vfs/local/mnt/a", - "pathMeta": "/home/user/.cache/rclone/vfsMeta/local/mnt/a", - "uploadsInProgress": 0, - "uploadsQueued": 0 - }, - "fs": "/mnt/a", - "inUse": 1, - // Status of the in memory metadata cache - "metadataCache": { - "dirs": 1, - "files": 0 - }, - // Options as returned by options/get - "opt": { - "CacheMaxAge": 3600000000000, - // ... - "WriteWait": 1000000000 - } - } +This deletes entire stats group. - -This command takes an "fs" parameter. If this parameter is not -supplied and if there is only one VFS in use then that VFS will be -used. If there is more than one VFS in use then the "fs" parameter -must be supplied. +Parameters +- group - name of the stats group (string) +### core/stats-reset: Reset stats. {#core-stats-reset} -## Accessing the remote control via HTTP {#api-http} +This clears counters, errors and finished transfers for all stats or specific +stats group if group is provided. -Rclone implements a simple HTTP based protocol. +Parameters -Each endpoint takes an JSON object and returns a JSON object or an -error. The JSON objects are essentially a map of string names to -values. +- group - name of the stats group (string) -All calls must made using POST. +### core/transferred: Returns stats about completed transfers. {#core-transferred} -The input objects can be supplied using URL parameters, POST -parameters or by supplying "Content-Type: application/json" and a JSON -blob in the body. There are examples of these below using `curl`. +This returns stats about completed transfers: -The response will be a JSON blob in the body of the response. This is -formatted to be reasonably human-readable. + rclone rc core/transferred -### Error returns +If group is not provided then completed transfers for all groups will be +returned. -If an error occurs then there will be an HTTP error status (e.g. 500) -and the body of the response will contain a JSON encoded error object, -e.g. +Note only the last 100 completed transfers are returned. + +Parameters + +- group - name of the stats group (string) +Returns the following values: ``` { - "error": "Expecting string value for key \"remote\" (was float64)", - "input": { - "fs": "/tmp", - "remote": 3 - }, - "status": 400 - "path": "operations/rmdir", + "transferred": an array of completed transfers (including failed ones): + [ + { + "name": name of the file, + "size": size of the file in bytes, + "bytes": total transferred bytes for this file, + "checked": if the transfer is only checked (skipped, deleted), + "timestamp": integer representing millisecond unix epoch, + "error": string description of the error (empty if successful), + "jobid": id of the job that this transfer belongs to + } + ] } ``` -The keys in the error response are -- error - error string -- input - the input parameters to the call -- status - the HTTP status code -- path - the path of the call +### core/version: Shows the current version of rclone and the go runtime. {#core-version} -### CORS +This shows the current version of go and the go runtime: -The sever implements basic CORS support and allows all origins for that. -The response to a preflight OPTIONS request will echo the requested "Access-Control-Request-Headers" back. +- version - rclone version, e.g. "v1.53.0" +- decomposed - version number as [major, minor, patch] +- isGit - boolean - true if this was compiled from the git version +- isBeta - boolean - true if this is a beta version +- os - OS in use as according to Go +- arch - cpu architecture in use according to Go +- goVersion - version of Go runtime in use +- linking - type of rclone executable (static or dynamic) +- goTags - space separated build tags or "none" -### Using POST with URL parameters only +### debug/set-block-profile-rate: Set runtime.SetBlockProfileRate for blocking profiling. {#debug-set-block-profile-rate} -``` -curl -X POST 'http://localhost:5572/rc/noop?potato=1&sausage=2' -``` +SetBlockProfileRate controls the fraction of goroutine blocking events +that are reported in the blocking profile. The profiler aims to sample +an average of one blocking event per rate nanoseconds spent blocked. -Response +To include every blocking event in the profile, pass rate = 1. To turn +off profiling entirely, pass rate <= 0. -``` -{ - "potato": "1", - "sausage": "2" -} -``` +After calling this you can use this to see the blocking profile: -Here is what an error response looks like: + go tool pprof http://localhost:5572/debug/pprof/block -``` -curl -X POST 'http://localhost:5572/rc/error?potato=1&sausage=2' -``` +Parameters: -``` -{ - "error": "arbitrary error on input map[potato:1 sausage:2]", - "input": { - "potato": "1", - "sausage": "2" - } -} -``` +- rate - int -Note that curl doesn't return errors to the shell unless you use the `-f` option +### debug/set-gc-percent: Call runtime/debug.SetGCPercent for setting the garbage collection target percentage. {#debug-set-gc-percent} -``` -$ curl -f -X POST 'http://localhost:5572/rc/error?potato=1&sausage=2' -curl: (22) The requested URL returned error: 400 Bad Request -$ echo $? -22 -``` +SetGCPercent sets the garbage collection target percentage: a collection is triggered +when the ratio of freshly allocated data to live data remaining after the previous collection +reaches this percentage. SetGCPercent returns the previous setting. The initial setting is the +value of the GOGC environment variable at startup, or 100 if the variable is not set. -### Using POST with a form +This setting may be effectively reduced in order to maintain a memory limit. +A negative percentage effectively disables garbage collection, unless the memory limit is reached. -``` -curl --data "potato=1" --data "sausage=2" http://localhost:5572/rc/noop -``` +See https://pkg.go.dev/runtime/debug#SetMemoryLimit for more details. -Response +Parameters: -``` -{ - "potato": "1", - "sausage": "2" -} -``` +- gc-percent - int -Note that you can combine these with URL parameters too with the POST -parameters taking precedence. +### debug/set-mutex-profile-fraction: Set runtime.SetMutexProfileFraction for mutex profiling. {#debug-set-mutex-profile-fraction} -``` -curl --data "potato=1" --data "sausage=2" "http://localhost:5572/rc/noop?rutabaga=3&sausage=4" -``` +SetMutexProfileFraction controls the fraction of mutex contention +events that are reported in the mutex profile. On average 1/rate +events are reported. The previous rate is returned. -Response +To turn off profiling entirely, pass rate 0. To just read the current +rate, pass rate < 0. (For n>1 the details of sampling may change.) -``` -{ - "potato": "1", - "rutabaga": "3", - "sausage": "4" -} +Once this is set you can look use this to profile the mutex contention: -``` + go tool pprof http://localhost:5572/debug/pprof/mutex -### Using POST with a JSON blob +Parameters: -``` -curl -H "Content-Type: application/json" -X POST -d '{"potato":2,"sausage":1}' http://localhost:5572/rc/noop -``` +- rate - int -response +Results: -``` -{ - "password": "xyz", - "username": "xyz" -} -``` +- previousRate - int -This can be combined with URL parameters too if required. The JSON -blob takes precedence. +### debug/set-soft-memory-limit: Call runtime/debug.SetMemoryLimit for setting a soft memory limit for the runtime. {#debug-set-soft-memory-limit} -``` -curl -H "Content-Type: application/json" -X POST -d '{"potato":2,"sausage":1}' 'http://localhost:5572/rc/noop?rutabaga=3&potato=4' -``` +SetMemoryLimit provides the runtime with a soft memory limit. -``` -{ - "potato": 2, - "rutabaga": "3", - "sausage": 1 -} -``` +The runtime undertakes several processes to try to respect this memory limit, including +adjustments to the frequency of garbage collections and returning memory to the underlying +system more aggressively. This limit will be respected even if GOGC=off (or, if SetGCPercent(-1) is executed). -## Debugging rclone with pprof ## +The input limit is provided as bytes, and includes all memory mapped, managed, and not +released by the Go runtime. Notably, it does not account for space used by the Go binary +and memory external to Go, such as memory managed by the underlying system on behalf of +the process, or memory managed by non-Go code inside the same process. +Examples of excluded memory sources include: OS kernel memory held on behalf of the process, +memory allocated by C code, and memory mapped by syscall.Mmap (because it is not managed by the Go runtime). -If you use the `--rc` flag this will also enable the use of the go -profiling tools on the same port. +A zero limit or a limit that's lower than the amount of memory used by the Go runtime may cause +the garbage collector to run nearly continuously. However, the application may still make progress. -To use these, first [install go](https://golang.org/doc/install). +The memory limit is always respected by the Go runtime, so to effectively disable this behavior, +set the limit very high. math.MaxInt64 is the canonical value for disabling the limit, but values +much greater than the available memory on the underlying system work just as well. -### Debugging memory use +See https://go.dev/doc/gc-guide for a detailed guide explaining the soft memory limit in more detail, +as well as a variety of common use-cases and scenarios. -To profile rclone's memory use you can run: +SetMemoryLimit returns the previously set memory limit. A negative input does not adjust the limit, +and allows for retrieval of the currently set memory limit. - go tool pprof -web http://localhost:5572/debug/pprof/heap +Parameters: -This should open a page in your browser showing what is using what -memory. +- mem-limit - int -You can also use the `-text` flag to produce a textual summary +### fscache/clear: Clear the Fs cache. {#fscache-clear} -``` -$ go tool pprof -text http://localhost:5572/debug/pprof/heap -Showing nodes accounting for 1537.03kB, 100% of 1537.03kB total - flat flat% sum% cum cum% - 1024.03kB 66.62% 66.62% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.addDecoderNode - 513kB 33.38% 100% 513kB 33.38% net/http.newBufioWriterSize - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/all.init - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/serve.init - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/serve/restic.init - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2.init - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.init - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.init.0 - 0 0% 100% 1024.03kB 66.62% main.init - 0 0% 100% 513kB 33.38% net/http.(*conn).readRequest - 0 0% 100% 513kB 33.38% net/http.(*conn).serve - 0 0% 100% 1024.03kB 66.62% runtime.main -``` +This clears the fs cache. This is where remotes created from backends +are cached for a short while to make repeated rc calls more efficient. -### Debugging go routine leaks +If you change the parameters of a backend then you may want to call +this to clear an existing remote out of the cache before re-creating +it. -Memory leaks are most often caused by go routine leaks keeping memory -alive which should have been garbage collected. +**Authentication is required for this call.** -See all active go routines using +### fscache/entries: Returns the number of entries in the fs cache. {#fscache-entries} - curl http://localhost:5572/debug/pprof/goroutine?debug=1 +This returns the number of entries in the fs cache. -Or go to http://localhost:5572/debug/pprof/goroutine?debug=1 in your browser. +Returns +- entries - number of items in the cache -### Other profiles to look at +**Authentication is required for this call.** -You can see a summary of profiles available at http://localhost:5572/debug/pprof/ +### job/list: Lists the IDs of the running jobs {#job-list} -Here is how to use some of them: +Parameters: None. -- Memory: `go tool pprof http://localhost:5572/debug/pprof/heap` -- Go routines: `curl http://localhost:5572/debug/pprof/goroutine?debug=1` -- 30-second CPU profile: `go tool pprof http://localhost:5572/debug/pprof/profile` -- 5-second execution trace: `wget http://localhost:5572/debug/pprof/trace?seconds=5` -- Goroutine blocking profile - - Enable first with: `rclone rc debug/set-block-profile-rate rate=1` ([docs](#debug-set-block-profile-rate)) - - `go tool pprof http://localhost:5572/debug/pprof/block` -- Contended mutexes: - - Enable first with: `rclone rc debug/set-mutex-profile-fraction rate=1` ([docs](#debug-set-mutex-profile-fraction)) - - `go tool pprof http://localhost:5572/debug/pprof/mutex` +Results: -See the [net/http/pprof docs](https://golang.org/pkg/net/http/pprof/) -for more info on how to use the profiling and for a general overview -see [the Go team's blog post on profiling go programs](https://blog.golang.org/profiling-go-programs). +- executeId - string id of rclone executing (change after restart) +- jobids - array of integer job ids (starting at 1 on each restart) -The profiling hook is [zero overhead unless it is used](https://stackoverflow.com/q/26545159/164234). +### job/status: Reads the status of the job ID {#job-status} -# Overview of cloud storage systems # +Parameters: -Each cloud storage system is slightly different. Rclone attempts to -provide a unified interface to them, but some underlying differences -show through. +- jobid - id of the job (integer). -## Features ## +Results: -Here is an overview of the major features of each cloud storage system. +- finished - boolean +- duration - time in seconds that the job ran for +- endTime - time the job finished (e.g. "2018-10-26T18:50:20.528746884+01:00") +- error - error from the job or empty string for no error +- finished - boolean whether the job has finished or not +- id - as passed in above +- startTime - time the job started (e.g. "2018-10-26T18:50:20.528336039+01:00") +- success - boolean - true for success false otherwise +- output - output of the job as would have been returned if called synchronously +- progress - output of the progress related to the underlying job -| Name | Hash | ModTime | Case Insensitive | Duplicate Files | MIME Type | Metadata | -| ---------------------------- |:----------------:|:-------:|:----------------:|:---------------:|:---------:|:--------:| -| 1Fichier | Whirlpool | - | No | Yes | R | - | -| Akamai Netstorage | MD5, SHA256 | R/W | No | No | R | - | -| Amazon Drive | MD5 | - | Yes | No | R | - | -| Amazon S3 (or S3 compatible) | MD5 | R/W | No | No | R/W | RWU | -| Backblaze B2 | SHA1 | R/W | No | No | R/W | - | -| Box | SHA1 | R/W | Yes | No | - | - | -| Citrix ShareFile | MD5 | R/W | Yes | No | - | - | -| Dropbox | DBHASH ¹ | R | Yes | No | - | - | -| Enterprise File Fabric | - | R/W | Yes | No | R/W | - | -| FTP | - | R/W ¹⁰ | No | No | - | - | -| Google Cloud Storage | MD5 | R/W | No | No | R/W | - | -| Google Drive | MD5 | R/W | No | Yes | R/W | - | -| Google Photos | - | - | No | Yes | R | - | -| HDFS | - | R/W | No | No | - | - | -| HiDrive | HiDrive ¹² | R/W | No | No | - | - | -| HTTP | - | R | No | No | R | - | -| Internet Archive | MD5, SHA1, CRC32 | R/W ¹¹ | No | No | - | RWU | -| Jottacloud | MD5 | R/W | Yes | No | R | - | -| Koofr | MD5 | - | Yes | No | - | - | -| Mail.ru Cloud | Mailru ⁶ | R/W | Yes | No | - | - | -| Mega | - | - | No | Yes | - | - | -| Memory | MD5 | R/W | No | No | - | - | -| Microsoft Azure Blob Storage | MD5 | R/W | No | No | R/W | - | -| Microsoft OneDrive | QuickXorHash ⁵ | R/W | Yes | No | R | - | -| OpenDrive | MD5 | R/W | Yes | Partial ⁸ | - | - | -| OpenStack Swift | MD5 | R/W | No | No | R/W | - | -| Oracle Object Storage | MD5 | R/W | No | No | R/W | - | -| pCloud | MD5, SHA1 ⁷ | R | No | No | W | - | -| PikPak | MD5 | R | No | No | R | - | -| premiumize.me | - | - | Yes | No | R | - | -| put.io | CRC-32 | R/W | No | Yes | R | - | -| Proton Drive | SHA1 | R/W | No | No | R | - | -| QingStor | MD5 | - ⁹ | No | No | R/W | - | -| Quatrix by Maytech | - | R/W | No | No | - | - | -| Seafile | - | - | No | No | - | - | -| SFTP | MD5, SHA1 ² | R/W | Depends | No | - | - | -| Sia | - | - | No | No | - | - | -| SMB | - | - | Yes | No | - | - | -| SugarSync | - | - | No | No | - | - | -| Storj | - | R | No | No | - | - | -| Uptobox | - | - | No | Yes | - | - | -| WebDAV | MD5, SHA1 ³ | R ⁴ | Depends | No | - | - | -| Yandex Disk | MD5 | R/W | No | No | R | - | -| Zoho WorkDrive | - | - | No | No | - | - | -| The local filesystem | All | R/W | Depends | No | - | RWU | - -### Notes +### job/stop: Stop the running job {#job-stop} -¹ Dropbox supports [its own custom -hash](https://www.dropbox.com/developers/reference/content-hash). -This is an SHA256 sum of all the 4 MiB block SHA256s. +Parameters: -² SFTP supports checksums if the same login has shell access and -`md5sum` or `sha1sum` as well as `echo` are in the remote's PATH. +- jobid - id of the job (integer). -³ WebDAV supports hashes when used with Fastmail Files, Owncloud and Nextcloud only. +### job/stopgroup: Stop all running jobs in a group {#job-stopgroup} -⁴ WebDAV supports modtimes when used with Fastmail Files, Owncloud and Nextcloud only. +Parameters: -⁵ [QuickXorHash](https://docs.microsoft.com/en-us/onedrive/developer/code-snippets/quickxorhash) is Microsoft's own hash. +- group - name of the group (string). -⁶ Mail.ru uses its own modified SHA1 hash +### mount/listmounts: Show current mount points {#mount-listmounts} -⁷ pCloud only supports SHA1 (not MD5) in its EU region +This shows currently mounted points, which can be used for performing an unmount. -⁸ Opendrive does not support creation of duplicate files using -their web client interface or other stock clients, but the underlying -storage platform has been determined to allow duplicate files, and it -is possible to create them with `rclone`. It may be that this is a -mistake or an unsupported feature. +This takes no parameters and returns -⁹ QingStor does not support SetModTime for objects bigger than 5 GiB. +- mountPoints: list of current mount points -¹⁰ FTP supports modtimes for the major FTP servers, and also others -if they advertised required protocol extensions. See [this](https://rclone.org/ftp/#modified-time) -for more details. +Eg -¹¹ Internet Archive requires option `wait_archive` to be set to a non-zero value -for full modtime support. + rclone rc mount/listmounts -¹² HiDrive supports [its own custom -hash](https://static.hidrive.com/dev/0001). -It combines SHA1 sums for each 4 KiB block hierarchically to a single -top-level sum. +**Authentication is required for this call.** -### Hash ### +### mount/mount: Create a new mount point {#mount-mount} -The cloud storage system supports various hash types of the objects. -The hashes are used when transferring data as an integrity check and -can be specifically used with the `--checksum` flag in syncs and in -the `check` command. +rclone allows Linux, FreeBSD, macOS and Windows to mount any of +Rclone's cloud storage systems as a file system with FUSE. -To use the verify checksums when transferring between cloud storage -systems they must support a common hash type. +If no mountType is provided, the priority is given as follows: 1. mount 2.cmount 3.mount2 -### ModTime ### +This takes the following parameters: -Almost all cloud storage systems store some sort of timestamp -on objects, but several of them not something that is appropriate -to use for syncing. E.g. some backends will only write a timestamp -that represent the time of the upload. To be relevant for syncing -it should be able to store the modification time of the source -object. If this is not the case, rclone will only check the file -size by default, though can be configured to check the file hash -(with the `--checksum` flag). Ideally it should also be possible to -change the timestamp of an existing file without having to re-upload it. +- fs - a remote path to be mounted (required) +- mountPoint: valid path on the local machine (required) +- mountType: one of the values (mount, cmount, mount2) specifies the mount implementation to use +- mountOpt: a JSON object with Mount options in. +- vfsOpt: a JSON object with VFS options in. -Storage systems with a `-` in the ModTime column, means the -modification read on objects is not the modification time of the -file when uploaded. It is most likely the time the file was uploaded, -or possibly something else (like the time the picture was taken in -Google Photos). +Example: -Storage systems with a `R` (for read-only) in the ModTime column, -means the it keeps modification times on objects, and updates them -when uploading objects, but it does not support changing only the -modification time (`SetModTime` operation) without re-uploading, -possibly not even without deleting existing first. Some operations -in rclone, such as `copy` and `sync` commands, will automatically -check for `SetModTime` support and re-upload if necessary to keep -the modification times in sync. Other commands will not work -without `SetModTime` support, e.g. `touch` command on an existing -file will fail, and changes to modification time only on a files -in a `mount` will be silently ignored. + rclone rc mount/mount fs=mydrive: mountPoint=/home//mountPoint + rclone rc mount/mount fs=mydrive: mountPoint=/home//mountPoint mountType=mount + rclone rc mount/mount fs=TestDrive: mountPoint=/mnt/tmp vfsOpt='{"CacheMode": 2}' mountOpt='{"AllowOther": true}' -Storage systems with `R/W` (for read/write) in the ModTime column, -means they do also support modtime-only operations. +The vfsOpt are as described in options/get and can be seen in the the +"vfs" section when running and the mountOpt can be seen in the "mount" section: -### Case Insensitive ### + rclone rc options/get -If a cloud storage systems is case sensitive then it is possible to -have two files which differ only in case, e.g. `file.txt` and -`FILE.txt`. If a cloud storage system is case insensitive then that -isn't possible. +**Authentication is required for this call.** -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. +### mount/types: Show all possible mount types {#mount-types} -The local filesystem and SFTP may or may not be case sensitive -depending on OS. +This shows all possible mount types and returns them as a list. - * Windows - usually case insensitive, though case is preserved - * OSX - usually case insensitive, though it is possible to format case sensitive - * Linux - usually case sensitive, but there are case insensitive file systems (e.g. FAT formatted USB keys) +This takes no parameters and returns -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. +- mountTypes: list of mount types -### Duplicate files ### +The mount types are strings like "mount", "mount2", "cmount" and can +be passed to mount/mount as the mountType parameter. -If a cloud storage system allows duplicate files then it can have two -objects with the same name. +Eg -This confuses rclone greatly when syncing - use the `rclone dedupe` -command to rename or remove duplicates. + rclone rc mount/types -### Restricted filenames ### +**Authentication is required for this call.** -Some cloud storage systems might have restrictions on the characters -that are usable in file or directory names. -When `rclone` detects such a name during a file upload, it will -transparently replace the restricted characters with similar looking -Unicode characters. To handle the different sets of restricted characters -for different backends, rclone uses something it calls [encoding](#encoding). +### mount/unmount: Unmount selected active mount {#mount-unmount} -This process is designed to avoid ambiguous file names as much as -possible and allow to move files between many cloud storage systems -transparently. +rclone allows Linux, FreeBSD, macOS and Windows to +mount any of Rclone's cloud storage systems as a file system with +FUSE. -The name shown by `rclone` to the user or during log output will only -contain a minimal set of [replaced characters](#restricted-characters) -to ensure correct formatting and not necessarily the actual name used -on the cloud storage. +This takes the following parameters: -This transformation is reversed when downloading a file or parsing -`rclone` arguments. For example, when uploading a file named `my file?.txt` -to Onedrive, it will be displayed as `my file?.txt` on the console, but -stored as `my file?.txt` to Onedrive (the `?` gets replaced by the similar -looking `?` character, the so-called "fullwidth question mark"). -The reverse transformation allows to read a file `unusual/name.txt` -from Google Drive, by passing the name `unusual/name.txt` on the command line -(the `/` needs to be replaced by the similar looking `/` character). +- mountPoint: valid path on the local machine where the mount was created (required) -#### Caveats {#restricted-filenames-caveats} +Example: -The filename encoding system works well in most cases, at least -where file names are written in English or similar languages. -You might not even notice it: It just works. In some cases it may -lead to issues, though. E.g. when file names are written in Chinese, -or Japanese, where it is always the Unicode fullwidth variants of the -punctuation marks that are used. + rclone rc mount/unmount mountPoint=/home//mountPoint -On Windows, the characters `:`, `*` and `?` are examples of restricted -characters. If these are used in filenames on a remote that supports it, -Rclone will transparently convert them to their fullwidth Unicode -variants `*`, `?` and `:` when downloading to Windows, and back again -when uploading. This way files with names that are not allowed on Windows -can still be stored. +**Authentication is required for this call.** -However, if you have files on your Windows system originally with these same -Unicode characters in their names, they will be included in the same conversion -process. E.g. if you create a file in your Windows filesystem with name -`Test:1.jpg`, where `:` is the Unicode fullwidth colon symbol, and use -rclone to upload it to Google Drive, which supports regular `:` (halfwidth -question mark), rclone will replace the fullwidth `:` with the -halfwidth `:` and store the file as `Test:1.jpg` in Google Drive. Since -both Windows and Google Drive allows the name `Test:1.jpg`, it would -probably be better if rclone just kept the name as is in this case. +### mount/unmountall: Unmount all active mounts {#mount-unmountall} -With the opposite situation; if you have a file named `Test:1.jpg`, -in your Google Drive, e.g. uploaded from a Linux system where `:` is valid -in file names. Then later use rclone to copy this file to your Windows -computer you will notice that on your local disk it gets renamed -to `Test:1.jpg`. The original filename is not legal on Windows, due to -the `:`, and rclone therefore renames it to make the copy possible. -That is all good. However, this can also lead to an issue: If you already -had a *different* file named `Test:1.jpg` on Windows, and then use rclone -to copy either way. Rclone will then treat the file originally named -`Test:1.jpg` on Google Drive and the file originally named `Test:1.jpg` -on Windows as the same file, and replace the contents from one with the other. +rclone allows Linux, FreeBSD, macOS and Windows to +mount any of Rclone's cloud storage systems as a file system with +FUSE. -Its virtually impossible to handle all cases like these correctly in all -situations, but by customizing the [encoding option](#encoding), changing the -set of characters that rclone should convert, you should be able to -create a configuration that works well for your specific situation. -See also the [example](https://rclone.org/overview/#encoding-example-windows) below. +This takes no parameters and returns error if unmount does not succeed. -(Windows was used as an example of a file system with many restricted -characters, and Google drive a storage system with few.) +Eg -#### Default restricted characters {#restricted-characters} + rclone rc mount/unmountall -The table below shows the characters that are replaced by default. +**Authentication is required for this call.** -When a replacement character is found in a filename, this character -will be escaped with the `‛` character to avoid ambiguous file names. -(e.g. a file named `␀.txt` would shown as `‛␀.txt`) +### operations/about: Return the space used on the remote {#operations-about} -Each cloud storage backend can use a different set of characters, -which will be specified in the documentation for each backend. +This takes the following parameters: -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| NUL | 0x00 | ␀ | -| SOH | 0x01 | ␁ | -| STX | 0x02 | ␂ | -| ETX | 0x03 | ␃ | -| EOT | 0x04 | ␄ | -| ENQ | 0x05 | ␅ | -| ACK | 0x06 | ␆ | -| BEL | 0x07 | ␇ | -| BS | 0x08 | ␈ | -| HT | 0x09 | ␉ | -| LF | 0x0A | ␊ | -| VT | 0x0B | ␋ | -| FF | 0x0C | ␌ | -| CR | 0x0D | ␍ | -| SO | 0x0E | ␎ | -| SI | 0x0F | ␏ | -| DLE | 0x10 | ␐ | -| DC1 | 0x11 | ␑ | -| DC2 | 0x12 | ␒ | -| DC3 | 0x13 | ␓ | -| DC4 | 0x14 | ␔ | -| NAK | 0x15 | ␕ | -| SYN | 0x16 | ␖ | -| ETB | 0x17 | ␗ | -| CAN | 0x18 | ␘ | -| EM | 0x19 | ␙ | -| SUB | 0x1A | ␚ | -| ESC | 0x1B | ␛ | -| FS | 0x1C | ␜ | -| GS | 0x1D | ␝ | -| RS | 0x1E | ␞ | -| US | 0x1F | ␟ | -| / | 0x2F | / | -| DEL | 0x7F | ␡ | +- fs - a remote name string e.g. "drive:" -The default encoding will also encode these file names as they are -problematic with many cloud storage systems. +The result is as returned from rclone about --json -| File name | Replacement | -| --------- |:-----------:| -| . | . | -| .. | .. | +See the [about](https://rclone.org/commands/rclone_about/) command for more information on the above. -#### Invalid UTF-8 bytes {#invalid-utf8} +**Authentication is required for this call.** -Some backends only support a sequence of well formed UTF-8 bytes -as file or directory names. +### operations/check: check the source and destination are the same {#operations-check} -In this case all invalid UTF-8 bytes will be replaced with a quoted -representation of the byte value to allow uploading a file to such a -backend. For example, the invalid byte `0xFE` will be encoded as `‛FE`. +Checks the files in the source and destination match. It compares +sizes and hashes and logs a report of files that don't +match. It doesn't alter the source or destination. -A common source of invalid UTF-8 bytes are local filesystems, that store -names in a different encoding than UTF-8 or UTF-16, like latin1. See the -[local filenames](https://rclone.org/local/#filenames) section for details. +This takes the following parameters: -#### Encoding option {#encoding} +- srcFs - a remote name string e.g. "drive:" for the source, "/" for local filesystem +- dstFs - a remote name string e.g. "drive2:" for the destination, "/" for local filesystem +- download - check by downloading rather than with hash +- checkFileHash - treat checkFileFs:checkFileRemote as a SUM file with hashes of given type +- checkFileFs - treat checkFileFs:checkFileRemote as a SUM file with hashes of given type +- checkFileRemote - treat checkFileFs:checkFileRemote as a SUM file with hashes of given type +- oneWay - check one way only, source files must exist on remote +- combined - make a combined report of changes (default false) +- missingOnSrc - report all files missing from the source (default true) +- missingOnDst - report all files missing from the destination (default true) +- match - report all matching files (default false) +- differ - report all non-matching files (default true) +- error - report all files with errors (hashing or reading) (default true) + +If you supply the download flag, it will download the data from +both remotes and check them against each other on the fly. This can +be useful for remotes that don't support hashes or if you really want +to check all the data. -Most backends have an encoding option, specified as a flag -`--backend-encoding` where `backend` is the name of the backend, or as -a config parameter `encoding` (you'll need to select the Advanced -config in `rclone config` to see it). +If you supply the size-only global flag, it will only compare the sizes not +the hashes as well. Use this for a quick check. -This will have default value which encodes and decodes characters in -such a way as to preserve the maximum number of characters (see -above). +If you supply the checkFileHash option with a valid hash name, the +checkFileFs:checkFileRemote must point to a text file in the SUM +format. This treats the checksum file as the source and dstFs as the +destination. Note that srcFs is not used and should not be supplied in +this case. -However this can be incorrect in some scenarios, for example if you -have a Windows file system with Unicode fullwidth characters -`*`, `?` or `:`, that you want to remain as those characters on the -remote rather than being translated to regular (halfwidth) `*`, `?` and `:`. +Returns: -The `--backend-encoding` flags allow you to change that. You can -disable the encoding completely with `--backend-encoding None` or set -`encoding = None` in the config file. +- success - true if no error, false otherwise +- status - textual summary of check, OK or text string +- hashType - hash used in check, may be missing +- combined - array of strings of combined report of changes +- missingOnSrc - array of strings of all files missing from the source +- missingOnDst - array of strings of all files missing from the destination +- match - array of strings of all matching files +- differ - array of strings of all non-matching files +- error - array of strings of all files with errors (hashing or reading) -Encoding takes a comma separated list of encodings. You can see the -list of all possible values by passing an invalid value to this -flag, e.g. `--local-encoding "help"`. The command `rclone help flags encoding` -will show you the defaults for the backends. +**Authentication is required for this call.** -| Encoding | Characters | Encoded as | -| --------- | ---------- | ---------- | -| Asterisk | `*` | `*` | -| BackQuote | `` ` `` | ``` | -| BackSlash | `\` | `\` | -| Colon | `:` | `:` | -| CrLf | CR 0x0D, LF 0x0A | `␍`, `␊` | -| Ctl | All control characters 0x00-0x1F | `␀␁␂␃␄␅␆␇␈␉␊␋␌␍␎␏␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟` | -| Del | DEL 0x7F | `␡` | -| Dollar | `$` | `$` | -| Dot | `.` or `..` as entire string | `.`, `..` | -| DoubleQuote | `"` | `"` | -| Hash | `#` | `#` | -| InvalidUtf8 | An invalid UTF-8 character (e.g. latin1) | `�` | -| LeftCrLfHtVt | CR 0x0D, LF 0x0A, HT 0x09, VT 0x0B on the left of a string | `␍`, `␊`, `␉`, `␋` | -| LeftPeriod | `.` on the left of a string | `.` | -| LeftSpace | SPACE on the left of a string | `␠` | -| LeftTilde | `~` on the left of a string | `~` | -| LtGt | `<`, `>` | `<`, `>` | -| None | No characters are encoded | | -| Percent | `%` | `%` | -| Pipe | \| | `|` | -| Question | `?` | `?` | -| RightCrLfHtVt | CR 0x0D, LF 0x0A, HT 0x09, VT 0x0B on the right of a string | `␍`, `␊`, `␉`, `␋` | -| RightPeriod | `.` on the right of a string | `.` | -| RightSpace | SPACE on the right of a string | `␠` | -| Semicolon | `;` | `;` | -| SingleQuote | `'` | `'` | -| Slash | `/` | `/` | -| SquareBracket | `[`, `]` | `[`, `]` | +### operations/cleanup: Remove trashed files in the remote or path {#operations-cleanup} -##### Encoding example: FTP +This takes the following parameters: -To take a specific example, the FTP backend's default encoding is +- fs - a remote name string e.g. "drive:" - --ftp-encoding "Slash,Del,Ctl,RightSpace,Dot" +See the [cleanup](https://rclone.org/commands/rclone_cleanup/) command for more information on the above. -However, let's say the FTP server is running on Windows and can't have -any of the invalid Windows characters in file names. You are backing -up Linux servers to this FTP server which do have those characters in -file names. So you would add the Windows set which are +**Authentication is required for this call.** - Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot +### operations/copyfile: Copy a file from source remote to destination remote {#operations-copyfile} -to the existing ones, giving: +This takes the following parameters: - Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot,Del,RightSpace +- srcFs - a remote name string e.g. "drive:" for the source, "/" for local filesystem +- srcRemote - a path within that remote e.g. "file.txt" for the source +- dstFs - a remote name string e.g. "drive2:" for the destination, "/" for local filesystem +- dstRemote - a path within that remote e.g. "file2.txt" for the destination -This can be specified using the `--ftp-encoding` flag or using an `encoding` parameter in the config file. +**Authentication is required for this call.** -##### Encoding example: Windows +### operations/copyurl: Copy the URL to the object {#operations-copyurl} -As a nother example, take a Windows system where there is a file with -name `Test:1.jpg`, where `:` is the Unicode fullwidth colon symbol. -When using rclone to copy this to a remote which supports `:`, -the regular (halfwidth) colon (such as Google Drive), you will notice -that the file gets renamed to `Test:1.jpg`. +This takes the following parameters: -To avoid this you can change the set of characters rclone should convert -for the local filesystem, using command-line argument `--local-encoding`. -Rclone's default behavior on Windows corresponds to +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" +- url - string, URL to read from + - autoFilename - boolean, set to true to retrieve destination file name from url -``` ---local-encoding "Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot" -``` +See the [copyurl](https://rclone.org/commands/rclone_copyurl/) command for more information on the above. -If you want to use fullwidth characters `:`, `*` and `?` in your filenames -without rclone changing them when uploading to a remote, then set the same as -the default value but without `Colon,Question,Asterisk`: +**Authentication is required for this call.** -``` ---local-encoding "Slash,LtGt,DoubleQuote,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot" -``` +### operations/delete: Remove files in the path {#operations-delete} -Alternatively, you can disable the conversion of any characters with `--local-encoding None`. +This takes the following parameters: -Instead of using command-line argument `--local-encoding`, you may also set it -as [environment variable](https://rclone.org/docs/#environment-variables) `RCLONE_LOCAL_ENCODING`, -or [configure](https://rclone.org/docs/#configure) a remote of type `local` in your config, -and set the `encoding` option there. +- fs - a remote name string e.g. "drive:" -The risk by doing this is that if you have a filename with the regular (halfwidth) -`:`, `*` and `?` in your cloud storage, and you try to download -it to your Windows filesystem, this will fail. These characters are not -valid in filenames on Windows, and you have told rclone not to work around -this by converting them to valid fullwidth variants. +See the [delete](https://rclone.org/commands/rclone_delete/) command for more information on the above. -### MIME Type ### +**Authentication is required for this call.** -MIME types (also known as media types) classify types of documents -using a simple text classification, e.g. `text/html` or -`application/pdf`. +### operations/deletefile: Remove the single file pointed to {#operations-deletefile} -Some cloud storage systems support reading (`R`) the MIME type of -objects and some support writing (`W`) the MIME type of objects. +This takes the following parameters: -The MIME type can be important if you are serving files directly to -HTTP from the storage system. +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" -If you are copying from a remote which supports reading (`R`) to a -remote which supports writing (`W`) then rclone will preserve the MIME -types. Otherwise they will be guessed from the extension, or the -remote itself may assign the MIME type. +See the [deletefile](https://rclone.org/commands/rclone_deletefile/) command for more information on the above. -### Metadata +**Authentication is required for this call.** -Backends may or may support reading or writing metadata. They may -support reading and writing system metadata (metadata intrinsic to -that backend) and/or user metadata (general purpose metadata). +### operations/fsinfo: Return information about the remote {#operations-fsinfo} -The levels of metadata support are +This takes the following parameters: -| Key | Explanation | -|-----|-------------| -| `R` | Read only System Metadata | -| `RW` | Read and write System Metadata | -| `RWU` | Read and write System Metadata and read and write User Metadata | +- fs - a remote name string e.g. "drive:" -See [the metadata docs](https://rclone.org/docs/#metadata) for more info. +This returns info about the remote passed in; -## Optional Features ## +``` +{ + // optional features and whether they are available or not + "Features": { + "About": true, + "BucketBased": false, + "BucketBasedRootOK": false, + "CanHaveEmptyDirectories": true, + "CaseInsensitive": false, + "ChangeNotify": false, + "CleanUp": false, + "Command": true, + "Copy": false, + "DirCacheFlush": false, + "DirMove": true, + "Disconnect": false, + "DuplicateFiles": false, + "GetTier": false, + "IsLocal": true, + "ListR": false, + "MergeDirs": false, + "MetadataInfo": true, + "Move": true, + "OpenWriterAt": true, + "PublicLink": false, + "Purge": true, + "PutStream": true, + "PutUnchecked": false, + "ReadMetadata": true, + "ReadMimeType": false, + "ServerSideAcrossConfigs": false, + "SetTier": false, + "SetWrapper": false, + "Shutdown": false, + "SlowHash": true, + "SlowModTime": false, + "UnWrap": false, + "UserInfo": false, + "UserMetadata": true, + "WrapFs": false, + "WriteMetadata": true, + "WriteMimeType": false + }, + // Names of hashes available + "Hashes": [ + "md5", + "sha1", + "whirlpool", + "crc32", + "sha256", + "dropbox", + "mailru", + "quickxor" + ], + "Name": "local", // Name as created + "Precision": 1, // Precision of timestamps in ns + "Root": "/", // Path as created + "String": "Local file system at /", // how the remote will appear in logs + // Information about the system metadata for this backend + "MetadataInfo": { + "System": { + "atime": { + "Help": "Time of last access", + "Type": "RFC 3339", + "Example": "2006-01-02T15:04:05.999999999Z07:00" + }, + "btime": { + "Help": "Time of file birth (creation)", + "Type": "RFC 3339", + "Example": "2006-01-02T15:04:05.999999999Z07:00" + }, + "gid": { + "Help": "Group ID of owner", + "Type": "decimal number", + "Example": "500" + }, + "mode": { + "Help": "File type and mode", + "Type": "octal, unix style", + "Example": "0100664" + }, + "mtime": { + "Help": "Time of last modification", + "Type": "RFC 3339", + "Example": "2006-01-02T15:04:05.999999999Z07:00" + }, + "rdev": { + "Help": "Device ID (if special file)", + "Type": "hexadecimal", + "Example": "1abc" + }, + "uid": { + "Help": "User ID of owner", + "Type": "decimal number", + "Example": "500" + } + }, + "Help": "Textual help string\n" + } +} +``` -All rclone remotes support a base command set. Other features depend -upon backend-specific capabilities. +This command does not have a command line equivalent so use this instead: -| Name | Purge | Copy | Move | DirMove | CleanUp | ListR | StreamUpload | MultithreadUpload | LinkSharing | About | EmptyDir | -| ---------------------------- |:-----:|:----:|:----:|:-------:|:-------:|:-----:|:------------:|:------------------|:------------:|:-----:|:--------:| -| 1Fichier | No | Yes | Yes | No | No | No | No | No | Yes | No | Yes | -| Akamai Netstorage | Yes | No | No | No | No | Yes | Yes | No | No | No | Yes | -| Amazon Drive | Yes | No | Yes | Yes | No | No | No | No | No | No | Yes | -| Amazon S3 (or S3 compatible) | No | Yes | No | No | Yes | Yes | Yes | Yes | Yes | No | No | -| Backblaze B2 | No | Yes | No | No | Yes | Yes | Yes | Yes | Yes | No | No | -| Box | Yes | Yes | Yes | Yes | Yes ‡‡ | No | Yes | No | Yes | Yes | Yes | -| Citrix ShareFile | Yes | Yes | Yes | Yes | No | No | No | No | No | No | Yes | -| Dropbox | Yes | Yes | Yes | Yes | No | No | Yes | No | Yes | Yes | Yes | -| Enterprise File Fabric | Yes | Yes | Yes | Yes | Yes | No | No | No | No | No | Yes | -| FTP | No | No | Yes | Yes | No | No | Yes | No | No | No | Yes | -| Google Cloud Storage | Yes | Yes | No | No | No | Yes | Yes | No | No | No | No | -| Google Drive | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | Yes | -| Google Photos | No | No | No | No | No | No | No | No | No | No | No | -| HDFS | Yes | No | Yes | Yes | No | No | Yes | No | No | Yes | Yes | -| HiDrive | Yes | Yes | Yes | Yes | No | No | Yes | No | No | No | Yes | -| HTTP | No | No | No | No | No | No | No | No | No | No | Yes | -| Internet Archive | No | Yes | No | No | Yes | Yes | No | No | Yes | Yes | No | -| Jottacloud | Yes | Yes | Yes | Yes | Yes | Yes | No | No | Yes | Yes | Yes | -| Koofr | Yes | Yes | Yes | Yes | No | No | Yes | No | Yes | Yes | Yes | -| Mail.ru Cloud | Yes | Yes | Yes | Yes | Yes | No | No | No | Yes | Yes | Yes | -| Mega | Yes | No | Yes | Yes | Yes | No | No | No | Yes | Yes | Yes | -| Memory | No | Yes | No | No | No | Yes | Yes | No | No | No | No | -| Microsoft Azure Blob Storage | Yes | Yes | No | No | No | Yes | Yes | Yes | No | No | No | -| Microsoft OneDrive | Yes | Yes | Yes | Yes | Yes | No | No | No | Yes | Yes | Yes | -| OpenDrive | Yes | Yes | Yes | Yes | No | No | No | No | No | No | Yes | -| OpenStack Swift | Yes † | Yes | No | No | No | Yes | Yes | No | No | Yes | No | -| Oracle Object Storage | No | Yes | No | No | Yes | Yes | Yes | No | No | No | No | -| pCloud | Yes | Yes | Yes | Yes | Yes | No | No | No | Yes | Yes | Yes | -| PikPak | Yes | Yes | Yes | Yes | Yes | No | No | No | Yes | Yes | Yes | -| premiumize.me | Yes | No | Yes | Yes | No | No | No | No | Yes | Yes | Yes | -| put.io | Yes | No | Yes | Yes | Yes | No | Yes | No | No | Yes | Yes | -| Proton Drive | Yes | No | Yes | Yes | Yes | No | No | No | No | Yes | Yes | -| QingStor | No | Yes | No | No | Yes | Yes | No | No | No | No | No | -| Quatrix by Maytech | Yes | Yes | Yes | Yes | No | No | No | No | No | Yes | Yes | -| Seafile | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | Yes | -| SFTP | No | No | Yes | Yes | No | No | Yes | No | No | Yes | Yes | -| Sia | No | No | No | No | No | No | Yes | No | No | No | Yes | -| SMB | No | No | Yes | Yes | No | No | Yes | Yes | No | No | Yes | -| SugarSync | Yes | Yes | Yes | Yes | No | No | Yes | No | Yes | No | Yes | -| Storj | Yes ☨ | Yes | Yes | No | No | Yes | Yes | No | Yes | No | No | -| Uptobox | No | Yes | Yes | Yes | No | No | No | No | No | No | No | -| WebDAV | Yes | Yes | Yes | Yes | No | No | Yes ‡ | No | No | Yes | Yes | -| Yandex Disk | Yes | Yes | Yes | Yes | Yes | No | Yes | No | Yes | Yes | Yes | -| Zoho WorkDrive | Yes | Yes | Yes | Yes | No | No | No | No | No | Yes | Yes | -| The local filesystem | Yes | No | Yes | Yes | No | No | Yes | Yes | No | Yes | Yes | + rclone rc --loopback operations/fsinfo fs=remote: -### Purge ### +### operations/list: List the given remote and path in JSON format {#operations-list} -This deletes a directory quicker than just deleting all the files in -the directory. +This takes the following parameters: -† Note Swift implements this in order to delete directory markers but -they don't actually have a quicker way of deleting files other than -deleting them individually. +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" +- opt - a dictionary of options to control the listing (optional) + - recurse - If set recurse directories + - noModTime - If set return modification time + - showEncrypted - If set show decrypted names + - showOrigIDs - If set show the IDs for each item if known + - showHash - If set return a dictionary of hashes + - noMimeType - If set don't show mime types + - dirsOnly - If set only show directories + - filesOnly - If set only show files + - metadata - If set return metadata of objects also + - hashTypes - array of strings of hash types to show if showHash set -☨ Storj implements this efficiently only for entire buckets. If -purging a directory inside a bucket, files are deleted individually. +Returns: -‡ StreamUpload is not supported with Nextcloud +- list + - This is an array of objects as described in the lsjson command -### Copy ### +See the [lsjson](https://rclone.org/commands/rclone_lsjson/) command for more information on the above and examples. -Used when copying an object to and from the same remote. This known -as a server-side copy so you can copy a file without downloading it -and uploading it again. It is used if you use `rclone copy` or -`rclone move` if the remote doesn't support `Move` directly. +**Authentication is required for this call.** -If the server doesn't support `Copy` directly then for copy operations -the file is downloaded then re-uploaded. +### operations/mkdir: Make a destination directory or container {#operations-mkdir} -### Move ### +This takes the following parameters: -Used when moving/renaming an object on the same remote. This is known -as a server-side move of a file. This is used in `rclone move` if the -server doesn't support `DirMove`. +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" -If the server isn't capable of `Move` then rclone simulates it with -`Copy` then delete. If the server doesn't support `Copy` then rclone -will download the file and re-upload it. +See the [mkdir](https://rclone.org/commands/rclone_mkdir/) command for more information on the above. -### DirMove ### +**Authentication is required for this call.** -This is used to implement `rclone move` to move a directory if -possible. If it isn't then it will use `Move` on each file (which -falls back to `Copy` then download and upload - see `Move` section). +### operations/movefile: Move a file from source remote to destination remote {#operations-movefile} -### CleanUp ### +This takes the following parameters: -This is used for emptying the trash for a remote by `rclone cleanup`. +- srcFs - a remote name string e.g. "drive:" for the source, "/" for local filesystem +- srcRemote - a path within that remote e.g. "file.txt" for the source +- dstFs - a remote name string e.g. "drive2:" for the destination, "/" for local filesystem +- dstRemote - a path within that remote e.g. "file2.txt" for the destination -If the server can't do `CleanUp` then `rclone cleanup` will return an -error. +**Authentication is required for this call.** -‡‡ Note that while Box implements this it has to delete every file -individually so it will be slower than emptying the trash via the WebUI +### operations/publiclink: Create or retrieve a public link to the given file or folder. {#operations-publiclink} -### ListR ### +This takes the following parameters: -The remote supports a recursive list to list all the contents beneath -a directory quickly. This enables the `--fast-list` flag to work. -See the [rclone docs](https://rclone.org/docs/#fast-list) for more details. +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" +- unlink - boolean - if set removes the link rather than adding it (optional) +- expire - string - the expiry time of the link e.g. "1d" (optional) -### StreamUpload ### +Returns: -Some remotes allow files to be uploaded without knowing the file size -in advance. This allows certain operations to work without spooling the -file to local disk first, e.g. `rclone rcat`. +- url - URL of the resource -### MultithreadUpload ### +See the [link](https://rclone.org/commands/rclone_link/) command for more information on the above. -Some remotes allow transfers to the remote to be sent as chunks in -parallel. If this is supported then rclone will use multi-thread -copying to transfer files much faster. +**Authentication is required for this call.** -### LinkSharing ### +### operations/purge: Remove a directory or container and all of its contents {#operations-purge} -Sets the necessary permissions on a file or folder and prints a link -that allows others to access them, even if they don't have an account -on the particular cloud provider. +This takes the following parameters: -### About ### +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" -Rclone `about` prints quota information for a remote. Typical output -includes bytes used, free, quota and in trash. +See the [purge](https://rclone.org/commands/rclone_purge/) command for more information on the above. -If a remote lacks about capability `rclone about remote:`returns -an error. +**Authentication is required for this call.** -Backends without about capability cannot determine free space for an -rclone mount, or use policy `mfs` (most free space) as a member of an -rclone union remote. +### operations/rmdir: Remove an empty directory or container {#operations-rmdir} -See [rclone about command](https://rclone.org/commands/rclone_about/) +This takes the following parameters: -### EmptyDir ### +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" -The remote supports empty directories. See [Limitations](https://rclone.org/bugs/#limitations) - for details. Most Object/Bucket-based remotes do not support this. +See the [rmdir](https://rclone.org/commands/rclone_rmdir/) command for more information on the above. -# Global Flags +**Authentication is required for this call.** -This describes the global flags available to every rclone command -split into groups. +### operations/rmdirs: Remove all the empty directories in the path {#operations-rmdirs} +This takes the following parameters: -## Copy +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" +- leaveRoot - boolean, set to true not to delete the root -Flags for anything which can Copy a file. +See the [rmdirs](https://rclone.org/commands/rclone_rmdirs/) command for more information on the above. -``` - --check-first Do all the checks before starting transfers - -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). - --compare-dest stringArray Include additional comma separated server-side paths during comparison - --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") - --ignore-case-sync Ignore case when synchronizing - --ignore-checksum Skip post copy check of checksums - --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum - -I, --ignore-times Don't skip files that match size and time - transfer all files - --immutable Do not modify files, fail if existing files have been modified - --inplace Download directly to destination file instead of atomic download to temp/rename - --max-backlog int Maximum number of objects in sync or check backlog (default 10000) - --max-duration Duration Maximum duration rclone will transfer data for (default 0s) - --max-transfer SizeSuffix Maximum size of data to transfer (default off) - -M, --metadata If set, preserve metadata when copying objects - --modify-window Duration Max time diff to be considered the same (default 1ns) - --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) - --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) - --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) - --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) - --no-check-dest Don't check the destination, copy regardless - --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical - --order-by string Instructions on how to order the transfers, e.g. 'size,descending' - --refresh-times Refresh the modtime of remote files - --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum - --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) - -u, --update Skip files that are newer on the destination -``` +**Authentication is required for this call.** +### operations/settier: Changes storage tier or class on all files in the path {#operations-settier} -## Sync +This takes the following parameters: -Flags just used for `rclone sync`. +- fs - a remote name string e.g. "drive:" -``` - --backup-dir string Make backups into hierarchy based in DIR - --delete-after When synchronizing, delete files on destination after transferring (default) - --delete-before When synchronizing, delete files on destination before transferring - --delete-during When synchronizing, delete files during transfer - --ignore-errors Delete even if there are I/O errors - --max-delete int When synchronizing, limit the number of deletes (default -1) - --max-delete-size SizeSuffix When synchronizing, limit the total size of deletes (default off) - --suffix string Suffix to add to changed files - --suffix-keep-extension Preserve the extension when using --suffix - --track-renames When synchronizing, track file renames and do a server-side move if possible - --track-renames-strategy string Strategies to use when synchronizing using track-renames hash|modtime|leaf (default "hash") -``` +See the [settier](https://rclone.org/commands/rclone_settier/) command for more information on the above. +**Authentication is required for this call.** -## Important +### operations/settierfile: Changes storage tier or class on the single file pointed to {#operations-settierfile} -Important flags useful for most commands. +This takes the following parameters: -``` - -n, --dry-run Do a trial run with no permanent changes - -i, --interactive Enable interactive mode - -v, --verbose count Print lots more stuff (repeat for more) -``` +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" +See the [settierfile](https://rclone.org/commands/rclone_settierfile/) command for more information on the above. -## Check +**Authentication is required for this call.** -Flags used for `rclone check`. +### operations/size: Count the number of bytes and files in remote {#operations-size} -``` - --max-backlog int Maximum number of objects in sync or check backlog (default 10000) -``` +This takes the following parameters: +- fs - a remote name string e.g. "drive:path/to/dir" -## Networking +Returns: -General networking and HTTP stuff. +- count - number of files +- bytes - number of bytes in those files -``` - --bind string Local address to bind to for outgoing connections, IPv4, IPv6 or name - --bwlimit BwTimetable Bandwidth limit in KiB/s, or use suffix B|K|M|G|T|P or a full timetable - --bwlimit-file BwTimetable Bandwidth limit per file in KiB/s, or use suffix B|K|M|G|T|P or a full timetable - --ca-cert stringArray CA certificate used to verify servers - --client-cert string Client SSL certificate (PEM) for mutual TLS auth - --client-key string Client SSL private key (PEM) for mutual TLS auth - --contimeout Duration Connect timeout (default 1m0s) - --disable-http-keep-alives Disable HTTP keep-alives and use each connection once. - --disable-http2 Disable HTTP/2 in the global transport - --dscp string Set DSCP value to connections, value or name, e.g. CS1, LE, DF, AF21 - --expect-continue-timeout Duration Timeout when using expect / 100-continue in HTTP (default 1s) - --header stringArray Set HTTP header for all transactions - --header-download stringArray Set HTTP header for download transactions - --header-upload stringArray Set HTTP header for upload transactions - --no-check-certificate Do not verify the server SSL certificate (insecure) - --no-gzip-encoding Don't set Accept-Encoding: gzip - --timeout Duration IO idle timeout (default 5m0s) - --tpslimit float Limit HTTP transactions per second to this - --tpslimit-burst int Max burst of transactions for --tpslimit (default 1) - --use-cookies Enable session cookiejar - --user-agent string Set the user-agent to a specified string (default "rclone/v1.64.0") -``` +See the [size](https://rclone.org/commands/rclone_size/) command for more information on the above. +**Authentication is required for this call.** -## Performance +### operations/stat: Give information about the supplied file or directory {#operations-stat} -Flags helpful for increasing performance. +This takes the following parameters -``` - --buffer-size SizeSuffix In memory buffer size when reading files for each --transfer (default 16Mi) - --checkers int Number of checkers to run in parallel (default 8) - --transfers int Number of file transfers to run in parallel (default 4) -``` +- fs - a remote name string eg "drive:" +- remote - a path within that remote eg "dir" +- opt - a dictionary of options to control the listing (optional) + - see operations/list for the options +The result is -## Config +- item - an object as described in the lsjson command. Will be null if not found. -General configuration of rclone. +Note that if you are only interested in files then it is much more +efficient to set the filesOnly flag in the options. -``` - --ask-password Allow prompt for password for encrypted configuration (default true) - --auto-confirm If enabled, do not request console confirmation - --cache-dir string Directory rclone will use for caching (default "$HOME/.cache/rclone") - --color string When to show colors (and other ANSI codes) AUTO|NEVER|ALWAYS (default "AUTO") - --config string Config file (default "$HOME/.config/rclone/rclone.conf") - --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) - --disable string Disable a comma separated list of features (use --disable help to see a list) - -n, --dry-run Do a trial run with no permanent changes - --error-on-no-transfer Sets exit code 9 if no files are transferred, useful in scripts - --fs-cache-expire-duration Duration Cache remotes for this long (0 to disable caching) (default 5m0s) - --fs-cache-expire-interval Duration Interval to check for expired remotes (default 1m0s) - --human-readable Print numbers in a human-readable format, sizes with suffix Ki|Mi|Gi|Ti|Pi - -i, --interactive Enable interactive mode - --kv-lock-time Duration Maximum time to keep key-value database locked by process (default 1s) - --low-level-retries int Number of low level retries to do (default 10) - --no-console Hide console window (supported on Windows only) - --no-unicode-normalization Don't normalize unicode characters in filenames - --password-command SpaceSepList Command for supplying password for encrypted configuration - --retries int Retry operations this many times if they fail (default 3) - --retries-sleep Duration Interval between retrying operations if they fail, e.g. 500ms, 60s, 5m (0 to disable) (default 0s) - --temp-dir string Directory rclone will use for temporary files (default "/tmp") - --use-mmap Use mmap allocator (see docs) - --use-server-modtime Use server modified time instead of object metadata -``` +See the [lsjson](https://rclone.org/commands/rclone_lsjson/) command for more information on the above and examples. +**Authentication is required for this call.** -## Debugging +### operations/uploadfile: Upload file using multiform/form-data {#operations-uploadfile} -Flags for developers. +This takes the following parameters: -``` - --cpuprofile string Write cpu profile to file - --dump DumpFlags List of items to dump from: headers,bodies,requests,responses,auth,filters,goroutines,openfiles - --dump-bodies Dump HTTP headers and bodies - may contain sensitive info - --dump-headers Dump HTTP headers - may contain sensitive info - --memprofile string Write memory profile to file -``` +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" +- each part in body represents a file to be uploaded +See the [uploadfile](https://rclone.org/commands/rclone_uploadfile/) command for more information on the above. -## Filter +**Authentication is required for this call.** -Flags for filtering directory listings. +### options/blocks: List all the option blocks {#options-blocks} -``` - --delete-excluded Delete files on dest excluded from sync - --exclude stringArray Exclude files matching pattern - --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) - --exclude-if-present stringArray Exclude directories if filename is present - --files-from stringArray Read list of source-file names from file (use - to read from stdin) - --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) - -f, --filter stringArray Add a file filtering rule - --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) - --ignore-case Ignore case in filters (case insensitive) - --include stringArray Include files matching pattern - --include-from stringArray Read file include patterns from file (use - to read from stdin) - --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) - --max-depth int If set limits the recursion depth to this (default -1) - --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) - --metadata-exclude stringArray Exclude metadatas matching pattern - --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) - --metadata-filter stringArray Add a metadata filtering rule - --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) - --metadata-include stringArray Include metadatas matching pattern - --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) - --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) - --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) -``` +Returns: +- options - a list of the options block names +### options/get: Get all the global options {#options-get} -## Listing +Returns an object where keys are option block names and values are an +object with the current option values in. -Flags for listing directories. +Note that these are the global options which are unaffected by use of +the _config and _filter parameters. If you wish to read the parameters +set in _config then use options/config and for _filter use options/filter. -``` - --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) - --fast-list Use recursive list if available; uses more memory but fewer transactions -``` +This shows the internal names of the option within rclone which should +map to the external options very easily with a few exceptions. +### options/local: Get the currently active config for this call {#options-local} -## Logging +Returns an object with the keys "config" and "filter". +The "config" key contains the local config and the "filter" key contains +the local filters. -Logging and statistics. +Note that these are the local options specific to this rc call. If +_config was not supplied then they will be the global options. +Likewise with "_filter". -``` - --log-file string Log everything to this file - --log-format string Comma separated list of log format options (default "date,time") - --log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "NOTICE") - --log-systemd Activate systemd integration for the logger - --max-stats-groups int Maximum number of stats groups to keep in memory, on max oldest is discarded (default 1000) - -P, --progress Show progress during transfer - --progress-terminal-title Show progress on the terminal title (requires -P/--progress) - -q, --quiet Print as little stuff as possible - --stats Duration Interval between printing stats, e.g. 500ms, 60s, 5m (0 to disable) (default 1m0s) - --stats-file-name-length int Max file name length in stats (0 for no limit) (default 45) - --stats-log-level string Log level to show --stats output DEBUG|INFO|NOTICE|ERROR (default "INFO") - --stats-one-line Make the stats fit on one line - --stats-one-line-date Enable --stats-one-line and add current date/time prefix - --stats-one-line-date-format string Enable --stats-one-line-date and use custom formatted date: Enclose date string in double quotes ("), see https://golang.org/pkg/time/#Time.Format - --stats-unit string Show data rate in stats as either 'bits' or 'bytes' per second (default "bytes") - --syslog Use Syslog for logging - --syslog-facility string Facility for syslog, e.g. KERN,USER,... (default "DAEMON") - --use-json-log Use json log format - -v, --verbose count Print lots more stuff (repeat for more) -``` +This call is mostly useful for seeing if _config and _filter passing +is working. +This shows the internal names of the option within rclone which should +map to the external options very easily with a few exceptions. -## Metadata +### options/set: Set an option {#options-set} -Flags to control metadata. +Parameters: -``` - -M, --metadata If set, preserve metadata when copying objects - --metadata-exclude stringArray Exclude metadatas matching pattern - --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) - --metadata-filter stringArray Add a metadata filtering rule - --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) - --metadata-include stringArray Include metadatas matching pattern - --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) - --metadata-set stringArray Add metadata key=value when uploading -``` +- option block name containing an object with + - key: value +Repeated as often as required. -## RC +Only supply the options you wish to change. If an option is unknown +it will be silently ignored. Not all options will have an effect when +changed like this. -Flags to control the Remote Control API. +For example: -``` - --rc Enable the remote control server - --rc-addr stringArray IPaddress:Port or :Port to bind server to (default [localhost:5572]) - --rc-allow-origin string Origin which cross-domain request (CORS) can be executed from - --rc-baseurl string Prefix for URLs - leave blank for root - --rc-cert string TLS PEM key (concatenation of certificate and CA certificate) - --rc-client-ca string Client certificate authority to verify clients with - --rc-enable-metrics Enable prometheus metrics on /metrics - --rc-files string Path to local files to serve on the HTTP server - --rc-htpasswd string A htpasswd file - if not provided no authentication is done - --rc-job-expire-duration Duration Expire finished async jobs older than this value (default 1m0s) - --rc-job-expire-interval Duration Interval to check for expired async jobs (default 10s) - --rc-key string TLS PEM Private key - --rc-max-header-bytes int Maximum size of request header (default 4096) - --rc-min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") - --rc-no-auth Don't require auth for certain methods - --rc-pass string Password for authentication - --rc-realm string Realm for authentication - --rc-salt string Password hashing salt (default "dlPL2MqE") - --rc-serve Enable the serving of remote objects - --rc-server-read-timeout Duration Timeout for server reading data (default 1h0m0s) - --rc-server-write-timeout Duration Timeout for server writing data (default 1h0m0s) - --rc-template string User-specified template - --rc-user string User name for authentication - --rc-web-fetch-url string URL to fetch the releases for webgui (default "https://api.github.com/repos/rclone/rclone-webui-react/releases/latest") - --rc-web-gui Launch WebGUI on localhost - --rc-web-gui-force-update Force update to latest version of web gui - --rc-web-gui-no-open-browser Don't open the browser automatically - --rc-web-gui-update Check and update to latest version of web gui -``` +This sets DEBUG level logs (-vv) (these can be set by number or string) + rclone rc options/set --json '{"main": {"LogLevel": "DEBUG"}}' + rclone rc options/set --json '{"main": {"LogLevel": 8}}' -## Backend +And this sets INFO level logs (-v) -Backend only flags. These can be set in the config file also. + rclone rc options/set --json '{"main": {"LogLevel": "INFO"}}' -``` - --acd-auth-url string Auth server URL - --acd-client-id string OAuth Client Id - --acd-client-secret string OAuth Client Secret - --acd-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) - --acd-templink-threshold SizeSuffix Files >= this size will be downloaded via their tempLink (default 9Gi) - --acd-token string OAuth Access Token as a JSON blob - --acd-token-url string Token server url - --acd-upload-wait-per-gb Duration Additional time per GiB to wait after a failed complete upload to see if it appears (default 3m0s) - --alias-remote string Remote or path to alias - --azureblob-access-tier string Access tier of blob: hot, cool or archive - --azureblob-account string Azure Storage Account Name - --azureblob-archive-tier-delete Delete archive tier blobs before overwriting - --azureblob-chunk-size SizeSuffix Upload chunk size (default 4Mi) - --azureblob-client-certificate-password string Password for the certificate file (optional) (obscured) - --azureblob-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key - --azureblob-client-id string The ID of the client in use - --azureblob-client-secret string One of the service principal's client secrets - --azureblob-client-send-certificate-chain Send the certificate chain when using certificate auth - --azureblob-directory-markers Upload an empty object with a trailing slash when a new directory is created - --azureblob-disable-checksum Don't store MD5 checksum with object metadata - --azureblob-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8) - --azureblob-endpoint string Endpoint for the service - --azureblob-env-auth Read credentials from runtime (environment variables, CLI or MSI) - --azureblob-key string Storage Account Shared Key - --azureblob-list-chunk int Size of blob list (default 5000) - --azureblob-msi-client-id string Object ID of the user-assigned MSI to use, if any - --azureblob-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any - --azureblob-msi-object-id string Object ID of the user-assigned MSI to use, if any - --azureblob-no-check-container If set, don't attempt to check the container exists or create it - --azureblob-no-head-object If set, do not do HEAD before GET when getting objects - --azureblob-password string The user's password (obscured) - --azureblob-public-access string Public access level of a container: blob or container - --azureblob-sas-url string SAS URL for container level access only - --azureblob-service-principal-file string Path to file containing credentials for use with a service principal - --azureblob-tenant string ID of the service principal's tenant. Also called its directory ID - --azureblob-upload-concurrency int Concurrency for multipart uploads (default 16) - --azureblob-upload-cutoff string Cutoff for switching to chunked upload (<= 256 MiB) (deprecated) - --azureblob-use-emulator Uses local storage emulator if provided as 'true' - --azureblob-use-msi Use a managed service identity to authenticate (only works in Azure) - --azureblob-username string User name (usually an email address) - --b2-account string Account ID or Application Key ID - --b2-chunk-size SizeSuffix Upload chunk size (default 96Mi) - --b2-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4Gi) - --b2-disable-checksum Disable checksums for large (> upload cutoff) files - --b2-download-auth-duration Duration Time before the authorization token will expire in s or suffix ms|s|m|h|d (default 1w) - --b2-download-url string Custom endpoint for downloads - --b2-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --b2-endpoint string Endpoint for the service - --b2-hard-delete Permanently delete files on remote removal, otherwise hide files - --b2-key string Application Key - --b2-test-mode string A flag string for X-Bz-Test-Mode header for debugging - --b2-upload-concurrency int Concurrency for multipart uploads (default 16) - --b2-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) - --b2-version-at Time Show file versions as they were at the specified time (default off) - --b2-versions Include old versions in directory listings - --box-access-token string Box App Primary Access Token - --box-auth-url string Auth server URL - --box-box-config-file string Box App config.json location - --box-box-sub-type string (default "user") - --box-client-id string OAuth Client Id - --box-client-secret string OAuth Client Secret - --box-commit-retries int Max number of times to try committing a multipart file (default 100) - --box-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot) - --box-impersonate string Impersonate this user ID when using a service account - --box-list-chunk int Size of listing chunk 1-1000 (default 1000) - --box-owned-by string Only show items owned by the login (email address) passed in - --box-root-folder-id string Fill in for rclone to use a non root folder as its starting point - --box-token string OAuth Access Token as a JSON blob - --box-token-url string Token server url - --box-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (>= 50 MiB) (default 50Mi) - --cache-chunk-clean-interval Duration How often should the cache perform cleanups of the chunk storage (default 1m0s) - --cache-chunk-no-memory Disable the in-memory cache for storing chunks during streaming - --cache-chunk-path string Directory to cache chunk files (default "$HOME/.cache/rclone/cache-backend") - --cache-chunk-size SizeSuffix The size of a chunk (partial file data) (default 5Mi) - --cache-chunk-total-size SizeSuffix The total size that the chunks can take up on the local disk (default 10Gi) - --cache-db-path string Directory to store file structure metadata DB (default "$HOME/.cache/rclone/cache-backend") - --cache-db-purge Clear all the cached data for this remote on start - --cache-db-wait-time Duration How long to wait for the DB to be available - 0 is unlimited (default 1s) - --cache-info-age Duration How long to cache file structure information (directory listings, file size, times, etc.) (default 6h0m0s) - --cache-plex-insecure string Skip all certificate verification when connecting to the Plex server - --cache-plex-password string The password of the Plex user (obscured) - --cache-plex-url string The URL of the Plex server - --cache-plex-username string The username of the Plex user - --cache-read-retries int How many times to retry a read from a cache storage (default 10) - --cache-remote string Remote to cache - --cache-rps int Limits the number of requests per second to the source FS (-1 to disable) (default -1) - --cache-tmp-upload-path string Directory to keep temporary files until they are uploaded - --cache-tmp-wait-time Duration How long should files be stored in local cache before being uploaded (default 15s) - --cache-workers int How many workers should run in parallel to download chunks (default 4) - --cache-writes Cache file data on writes through the FS - --chunker-chunk-size SizeSuffix Files larger than chunk size will be split in chunks (default 2Gi) - --chunker-fail-hard Choose how chunker should handle files with missing or invalid chunks - --chunker-hash-type string Choose how chunker handles hash sums (default "md5") - --chunker-remote string Remote to chunk/unchunk - --combine-upstreams SpaceSepList Upstreams for combining - --compress-level int GZIP compression level (-2 to 9) (default -1) - --compress-mode string Compression mode (default "gzip") - --compress-ram-cache-limit SizeSuffix Some remotes don't allow the upload of files with unknown size (default 20Mi) - --compress-remote string Remote to compress - -L, --copy-links Follow symlinks and copy the pointed to item - --crypt-directory-name-encryption Option to either encrypt directory names or leave them intact (default true) - --crypt-filename-encoding string How to encode the encrypted filename to text string (default "base32") - --crypt-filename-encryption string How to encrypt the filenames (default "standard") - --crypt-no-data-encryption Option to either encrypt file data or leave it unencrypted - --crypt-pass-bad-blocks If set this will pass bad blocks through as all 0 - --crypt-password string Password or pass phrase for encryption (obscured) - --crypt-password2 string Password or pass phrase for salt (obscured) - --crypt-remote string Remote to encrypt/decrypt - --crypt-server-side-across-configs Deprecated: use --server-side-across-configs instead - --crypt-show-mapping For all files listed show how the names encrypt - --crypt-suffix string If this is set it will override the default suffix of ".bin" (default ".bin") - --drive-acknowledge-abuse Set to allow files which return cannotDownloadAbusiveFile to be downloaded - --drive-allow-import-name-change Allow the filetype to change when uploading Google docs - --drive-auth-owner-only Only consider files owned by the authenticated user - --drive-auth-url string Auth server URL - --drive-chunk-size SizeSuffix Upload chunk size (default 8Mi) - --drive-client-id string Google Application Client Id - --drive-client-secret string OAuth Client Secret - --drive-copy-shortcut-content Server side copy contents of shortcuts instead of the shortcut - --drive-disable-http2 Disable drive using http2 (default true) - --drive-encoding MultiEncoder The encoding for the backend (default InvalidUtf8) - --drive-env-auth Get IAM credentials from runtime (environment variables or instance meta data if no env vars) - --drive-export-formats string Comma separated list of preferred formats for downloading Google docs (default "docx,xlsx,pptx,svg") - --drive-fast-list-bug-fix Work around a bug in Google Drive listing (default true) - --drive-formats string Deprecated: See export_formats - --drive-impersonate string Impersonate this user when using a service account - --drive-import-formats string Comma separated list of preferred formats for uploading Google docs - --drive-keep-revision-forever Keep new head revision of each file forever - --drive-list-chunk int Size of listing chunk 100-1000, 0 to disable (default 1000) - --drive-pacer-burst int Number of API calls to allow without sleeping (default 100) - --drive-pacer-min-sleep Duration Minimum time to sleep between API calls (default 100ms) - --drive-resource-key string Resource key for accessing a link-shared file - --drive-root-folder-id string ID of the root folder - --drive-scope string Scope that rclone should use when requesting access from drive - --drive-server-side-across-configs Deprecated: use --server-side-across-configs instead - --drive-service-account-credentials string Service Account Credentials JSON blob - --drive-service-account-file string Service Account Credentials JSON file path - --drive-shared-with-me Only show files that are shared with me - --drive-size-as-quota Show sizes as storage quota usage, not actual size - --drive-skip-checksum-gphotos Skip MD5 checksum on Google photos and videos only - --drive-skip-dangling-shortcuts If set skip dangling shortcut files - --drive-skip-gdocs Skip google documents in all listings - --drive-skip-shortcuts If set skip shortcut files - --drive-starred-only Only show files that are starred - --drive-stop-on-download-limit Make download limit errors be fatal - --drive-stop-on-upload-limit Make upload limit errors be fatal - --drive-team-drive string ID of the Shared Drive (Team Drive) - --drive-token string OAuth Access Token as a JSON blob - --drive-token-url string Token server url - --drive-trashed-only Only show files that are in the trash - --drive-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 8Mi) - --drive-use-created-date Use file created date instead of modified date - --drive-use-shared-date Use date file was shared instead of modified date - --drive-use-trash Send files to the trash instead of deleting permanently (default true) - --drive-v2-download-min-size SizeSuffix If Object's are greater, use drive v2 API to download (default off) - --dropbox-auth-url string Auth server URL - --dropbox-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) - --dropbox-batch-mode string Upload file batching sync|async|off (default "sync") - --dropbox-batch-size int Max number of files in upload batch - --dropbox-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) - --dropbox-chunk-size SizeSuffix Upload chunk size (< 150Mi) (default 48Mi) - --dropbox-client-id string OAuth Client Id - --dropbox-client-secret string OAuth Client Secret - --dropbox-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot) - --dropbox-impersonate string Impersonate this user when using a business account - --dropbox-pacer-min-sleep Duration Minimum time to sleep between API calls (default 10ms) - --dropbox-shared-files Instructs rclone to work on individual shared files - --dropbox-shared-folders Instructs rclone to work on shared folders - --dropbox-token string OAuth Access Token as a JSON blob - --dropbox-token-url string Token server url - --fichier-api-key string Your API Key, get it from https://1fichier.com/console/params.pl - --fichier-cdn Set if you wish to use CDN download links - --fichier-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot) - --fichier-file-password string If you want to download a shared file that is password protected, add this parameter (obscured) - --fichier-folder-password string If you want to list the files in a shared folder that is password protected, add this parameter (obscured) - --fichier-shared-folder string If you want to download a shared folder, add this parameter - --filefabric-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) - --filefabric-permanent-token string Permanent Authentication Token - --filefabric-root-folder-id string ID of the root folder - --filefabric-token string Session Token - --filefabric-token-expiry string Token expiry time - --filefabric-url string URL of the Enterprise File Fabric to connect to - --filefabric-version string Version read from the file fabric - --ftp-ask-password Allow asking for FTP password when needed - --ftp-close-timeout Duration Maximum time to wait for a response to close (default 1m0s) - --ftp-concurrency int Maximum number of FTP simultaneous connections, 0 for unlimited - --ftp-disable-epsv Disable using EPSV even if server advertises support - --ftp-disable-mlsd Disable using MLSD even if server advertises support - --ftp-disable-tls13 Disable TLS 1.3 (workaround for FTP servers with buggy TLS) - --ftp-disable-utf8 Disable using UTF-8 even if server advertises support - --ftp-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,RightSpace,Dot) - --ftp-explicit-tls Use Explicit FTPS (FTP over TLS) - --ftp-force-list-hidden Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD - --ftp-host string FTP host to connect to - --ftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) - --ftp-no-check-certificate Do not verify the TLS certificate of the server - --ftp-pass string FTP password (obscured) - --ftp-port int FTP port number (default 21) - --ftp-shut-timeout Duration Maximum time to wait for data connection closing status (default 1m0s) - --ftp-socks-proxy string Socks 5 proxy host - --ftp-tls Use Implicit FTPS (FTP over TLS) - --ftp-tls-cache-size int Size of TLS session cache for all control and data connections (default 32) - --ftp-user string FTP username (default "$USER") - --ftp-writing-mdtm Use MDTM to set modification time (VsFtpd quirk) - --gcs-anonymous Access public buckets and objects without credentials - --gcs-auth-url string Auth server URL - --gcs-bucket-acl string Access Control List for new buckets - --gcs-bucket-policy-only Access checks should use bucket-level IAM policies - --gcs-client-id string OAuth Client Id - --gcs-client-secret string OAuth Client Secret - --gcs-decompress If set this will decompress gzip encoded objects - --gcs-directory-markers Upload an empty object with a trailing slash when a new directory is created - --gcs-encoding MultiEncoder The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) - --gcs-endpoint string Endpoint for the service - --gcs-env-auth Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars) - --gcs-location string Location for the newly created buckets - --gcs-no-check-bucket If set, don't attempt to check the bucket exists or create it - --gcs-object-acl string Access Control List for new objects - --gcs-project-number string Project number - --gcs-service-account-file string Service Account Credentials JSON file path - --gcs-storage-class string The storage class to use when storing objects in Google Cloud Storage - --gcs-token string OAuth Access Token as a JSON blob - --gcs-token-url string Token server url - --gcs-user-project string User project - --gphotos-auth-url string Auth server URL - --gphotos-client-id string OAuth Client Id - --gphotos-client-secret string OAuth Client Secret - --gphotos-encoding MultiEncoder The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) - --gphotos-include-archived Also view and download archived media - --gphotos-read-only Set to make the Google Photos backend read only - --gphotos-read-size Set to read the size of media items - --gphotos-start-year int Year limits the photos to be downloaded to those which are uploaded after the given year (default 2000) - --gphotos-token string OAuth Access Token as a JSON blob - --gphotos-token-url string Token server url - --hasher-auto-size SizeSuffix Auto-update checksum for files smaller than this size (disabled by default) - --hasher-hashes CommaSepList Comma separated list of supported checksum types (default md5,sha1) - --hasher-max-age Duration Maximum time to keep checksums in cache (0 = no cache, off = cache forever) (default off) - --hasher-remote string Remote to cache checksums for (e.g. myRemote:path) +And this sets NOTICE level logs (normal without -v) + + rclone rc options/set --json '{"main": {"LogLevel": "NOTICE"}}' + +### pluginsctl/addPlugin: Add a plugin using url {#pluginsctl-addPlugin} + +Used for adding a plugin to the webgui. + +This takes the following parameters: + +- url - http url of the github repo where the plugin is hosted (http://github.com/rclone/rclone-webui-react). + +Example: + + rclone rc pluginsctl/addPlugin + +**Authentication is required for this call.** + +### pluginsctl/getPluginsForType: Get plugins with type criteria {#pluginsctl-getPluginsForType} + +This shows all possible plugins by a mime type. + +This takes the following parameters: + +- type - supported mime type by a loaded plugin e.g. (video/mp4, audio/mp3). +- pluginType - filter plugins based on their type e.g. (DASHBOARD, FILE_HANDLER, TERMINAL). + +Returns: + +- loadedPlugins - list of current production plugins. +- testPlugins - list of temporarily loaded development plugins, usually running on a different server. + +Example: + + rclone rc pluginsctl/getPluginsForType type=video/mp4 + +**Authentication is required for this call.** + +### pluginsctl/listPlugins: Get the list of currently loaded plugins {#pluginsctl-listPlugins} + +This allows you to get the currently enabled plugins and their details. + +This takes no parameters and returns: + +- loadedPlugins - list of current production plugins. +- testPlugins - list of temporarily loaded development plugins, usually running on a different server. + +E.g. + + rclone rc pluginsctl/listPlugins + +**Authentication is required for this call.** + +### pluginsctl/listTestPlugins: Show currently loaded test plugins {#pluginsctl-listTestPlugins} + +Allows listing of test plugins with the rclone.test set to true in package.json of the plugin. + +This takes no parameters and returns: + +- loadedTestPlugins - list of currently available test plugins. + +E.g. + + rclone rc pluginsctl/listTestPlugins + +**Authentication is required for this call.** + +### pluginsctl/removePlugin: Remove a loaded plugin {#pluginsctl-removePlugin} + +This allows you to remove a plugin using it's name. + +This takes parameters: + +- name - name of the plugin in the format `author`/`plugin_name`. + +E.g. + + rclone rc pluginsctl/removePlugin name=rclone/video-plugin + +**Authentication is required for this call.** + +### pluginsctl/removeTestPlugin: Remove a test plugin {#pluginsctl-removeTestPlugin} + +This allows you to remove a plugin using it's name. + +This takes the following parameters: + +- name - name of the plugin in the format `author`/`plugin_name`. + +Example: + + rclone rc pluginsctl/removeTestPlugin name=rclone/rclone-webui-react + +**Authentication is required for this call.** + +### rc/error: This returns an error {#rc-error} + +This returns an error with the input as part of its error string. +Useful for testing error handling. + +### rc/list: List all the registered remote control commands {#rc-list} + +This lists all the registered remote control commands as a JSON map in +the commands response. + +### rc/noop: Echo the input to the output parameters {#rc-noop} + +This echoes the input parameters to the output parameters for testing +purposes. It can be used to check that rclone is still alive and to +check that parameter passing is working properly. + +### rc/noopauth: Echo the input to the output parameters requiring auth {#rc-noopauth} + +This echoes the input parameters to the output parameters for testing +purposes. It can be used to check that rclone is still alive and to +check that parameter passing is working properly. + +**Authentication is required for this call.** + +### sync/bisync: Perform bidirectional synchronization between two paths. {#sync-bisync} + +This takes the following parameters + +- path1 - a remote directory string e.g. `drive:path1` +- path2 - a remote directory string e.g. `drive:path2` +- dryRun - dry-run mode +- resync - performs the resync run +- checkAccess - abort if RCLONE_TEST files are not found on both filesystems +- checkFilename - file name for checkAccess (default: RCLONE_TEST) +- maxDelete - abort sync if percentage of deleted files is above + this threshold (default: 50) +- force - Bypass maxDelete safety check and run the sync +- checkSync - `true` by default, `false` disables comparison of final listings, + `only` will skip sync, only compare listings from the last run +- createEmptySrcDirs - Sync creation and deletion of empty directories. + (Not compatible with --remove-empty-dirs) +- removeEmptyDirs - remove empty directories at the final cleanup step +- filtersFile - read filtering patterns from a file +- ignoreListingChecksum - Do not use checksums for listings +- resilient - Allow future runs to retry after certain less-serious errors, instead of requiring resync. + Use at your own risk! +- workdir - server directory for history files (default: /home/ncw/.cache/rclone/bisync) +- noCleanup - retain working files + +See [bisync command help](https://rclone.org/commands/rclone_bisync/) +and [full bisync description](https://rclone.org/bisync/) +for more information. + +**Authentication is required for this call.** + +### sync/copy: copy a directory from source remote to destination remote {#sync-copy} + +This takes the following parameters: + +- srcFs - a remote name string e.g. "drive:src" for the source +- dstFs - a remote name string e.g. "drive:dst" for the destination +- createEmptySrcDirs - create empty src directories on destination if set + + +See the [copy](https://rclone.org/commands/rclone_copy/) command for more information on the above. + +**Authentication is required for this call.** + +### sync/move: move a directory from source remote to destination remote {#sync-move} + +This takes the following parameters: + +- srcFs - a remote name string e.g. "drive:src" for the source +- dstFs - a remote name string e.g. "drive:dst" for the destination +- createEmptySrcDirs - create empty src directories on destination if set +- deleteEmptySrcDirs - delete empty src directories if set + + +See the [move](https://rclone.org/commands/rclone_move/) command for more information on the above. + +**Authentication is required for this call.** + +### sync/sync: sync a directory from source remote to destination remote {#sync-sync} + +This takes the following parameters: + +- srcFs - a remote name string e.g. "drive:src" for the source +- dstFs - a remote name string e.g. "drive:dst" for the destination +- createEmptySrcDirs - create empty src directories on destination if set + + +See the [sync](https://rclone.org/commands/rclone_sync/) command for more information on the above. + +**Authentication is required for this call.** + +### vfs/forget: Forget files or directories in the directory cache. {#vfs-forget} + +This forgets the paths in the directory cache causing them to be +re-read from the remote when needed. + +If no paths are passed in then it will forget all the paths in the +directory cache. + + rclone rc vfs/forget + +Otherwise pass files or dirs in as file=path or dir=path. Any +parameter key starting with file will forget that file and any +starting with dir will forget that dir, e.g. + + rclone rc vfs/forget file=hello file2=goodbye dir=home/junk + +This command takes an "fs" parameter. If this parameter is not +supplied and if there is only one VFS in use then that VFS will be +used. If there is more than one VFS in use then the "fs" parameter +must be supplied. + +### vfs/list: List active VFSes. {#vfs-list} + +This lists the active VFSes. + +It returns a list under the key "vfses" where the values are the VFS +names that could be passed to the other VFS commands in the "fs" +parameter. + +### vfs/poll-interval: Get the status or update the value of the poll-interval option. {#vfs-poll-interval} + +Without any parameter given this returns the current status of the +poll-interval setting. + +When the interval=duration parameter is set, the poll-interval value +is updated and the polling function is notified. +Setting interval=0 disables poll-interval. + + rclone rc vfs/poll-interval interval=5m + +The timeout=duration parameter can be used to specify a time to wait +for the current poll function to apply the new value. +If timeout is less or equal 0, which is the default, wait indefinitely. + +The new poll-interval value will only be active when the timeout is +not reached. + +If poll-interval is updated or disabled temporarily, some changes +might not get picked up by the polling function, depending on the +used remote. + +This command takes an "fs" parameter. If this parameter is not +supplied and if there is only one VFS in use then that VFS will be +used. If there is more than one VFS in use then the "fs" parameter +must be supplied. + +### vfs/refresh: Refresh the directory cache. {#vfs-refresh} + +This reads the directories for the specified paths and freshens the +directory cache. + +If no paths are passed in then it will refresh the root directory. + + rclone rc vfs/refresh + +Otherwise pass directories in as dir=path. Any parameter key +starting with dir will refresh that directory, e.g. + + rclone rc vfs/refresh dir=home/junk dir2=data/misc + +If the parameter recursive=true is given the whole directory tree +will get refreshed. This refresh will use --fast-list if enabled. + +This command takes an "fs" parameter. If this parameter is not +supplied and if there is only one VFS in use then that VFS will be +used. If there is more than one VFS in use then the "fs" parameter +must be supplied. + +### vfs/stats: Stats for a VFS. {#vfs-stats} + +This returns stats for the selected VFS. + + { + // Status of the disk cache - only present if --vfs-cache-mode > off + "diskCache": { + "bytesUsed": 0, + "erroredFiles": 0, + "files": 0, + "hashType": 1, + "outOfSpace": false, + "path": "/home/user/.cache/rclone/vfs/local/mnt/a", + "pathMeta": "/home/user/.cache/rclone/vfsMeta/local/mnt/a", + "uploadsInProgress": 0, + "uploadsQueued": 0 + }, + "fs": "/mnt/a", + "inUse": 1, + // Status of the in memory metadata cache + "metadataCache": { + "dirs": 1, + "files": 0 + }, + // Options as returned by options/get + "opt": { + "CacheMaxAge": 3600000000000, + // ... + "WriteWait": 1000000000 + } + } + + +This command takes an "fs" parameter. If this parameter is not +supplied and if there is only one VFS in use then that VFS will be +used. If there is more than one VFS in use then the "fs" parameter +must be supplied. + + + +## Accessing the remote control via HTTP {#api-http} + +Rclone implements a simple HTTP based protocol. + +Each endpoint takes an JSON object and returns a JSON object or an +error. The JSON objects are essentially a map of string names to +values. + +All calls must made using POST. + +The input objects can be supplied using URL parameters, POST +parameters or by supplying "Content-Type: application/json" and a JSON +blob in the body. There are examples of these below using `curl`. + +The response will be a JSON blob in the body of the response. This is +formatted to be reasonably human-readable. + +### Error returns + +If an error occurs then there will be an HTTP error status (e.g. 500) +and the body of the response will contain a JSON encoded error object, +e.g. + +``` +{ + "error": "Expecting string value for key \"remote\" (was float64)", + "input": { + "fs": "/tmp", + "remote": 3 + }, + "status": 400 + "path": "operations/rmdir", +} +``` + +The keys in the error response are +- error - error string +- input - the input parameters to the call +- status - the HTTP status code +- path - the path of the call + +### CORS + +The sever implements basic CORS support and allows all origins for that. +The response to a preflight OPTIONS request will echo the requested "Access-Control-Request-Headers" back. + +### Using POST with URL parameters only + +``` +curl -X POST 'http://localhost:5572/rc/noop?potato=1&sausage=2' +``` + +Response + +``` +{ + "potato": "1", + "sausage": "2" +} +``` + +Here is what an error response looks like: + +``` +curl -X POST 'http://localhost:5572/rc/error?potato=1&sausage=2' +``` + +``` +{ + "error": "arbitrary error on input map[potato:1 sausage:2]", + "input": { + "potato": "1", + "sausage": "2" + } +} +``` + +Note that curl doesn't return errors to the shell unless you use the `-f` option + +``` +$ curl -f -X POST 'http://localhost:5572/rc/error?potato=1&sausage=2' +curl: (22) The requested URL returned error: 400 Bad Request +$ echo $? +22 +``` + +### Using POST with a form + +``` +curl --data "potato=1" --data "sausage=2" http://localhost:5572/rc/noop +``` + +Response + +``` +{ + "potato": "1", + "sausage": "2" +} +``` + +Note that you can combine these with URL parameters too with the POST +parameters taking precedence. + +``` +curl --data "potato=1" --data "sausage=2" "http://localhost:5572/rc/noop?rutabaga=3&sausage=4" +``` + +Response + +``` +{ + "potato": "1", + "rutabaga": "3", + "sausage": "4" +} + +``` + +### Using POST with a JSON blob + +``` +curl -H "Content-Type: application/json" -X POST -d '{"potato":2,"sausage":1}' http://localhost:5572/rc/noop +``` + +response + +``` +{ + "password": "xyz", + "username": "xyz" +} +``` + +This can be combined with URL parameters too if required. The JSON +blob takes precedence. + +``` +curl -H "Content-Type: application/json" -X POST -d '{"potato":2,"sausage":1}' 'http://localhost:5572/rc/noop?rutabaga=3&potato=4' +``` + +``` +{ + "potato": 2, + "rutabaga": "3", + "sausage": 1 +} +``` + +## Debugging rclone with pprof ## + +If you use the `--rc` flag this will also enable the use of the go +profiling tools on the same port. + +To use these, first [install go](https://golang.org/doc/install). + +### Debugging memory use + +To profile rclone's memory use you can run: + + go tool pprof -web http://localhost:5572/debug/pprof/heap + +This should open a page in your browser showing what is using what +memory. + +You can also use the `-text` flag to produce a textual summary + +``` +$ go tool pprof -text http://localhost:5572/debug/pprof/heap +Showing nodes accounting for 1537.03kB, 100% of 1537.03kB total + flat flat% sum% cum cum% + 1024.03kB 66.62% 66.62% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.addDecoderNode + 513kB 33.38% 100% 513kB 33.38% net/http.newBufioWriterSize + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/all.init + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/serve.init + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/serve/restic.init + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2.init + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.init + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.init.0 + 0 0% 100% 1024.03kB 66.62% main.init + 0 0% 100% 513kB 33.38% net/http.(*conn).readRequest + 0 0% 100% 513kB 33.38% net/http.(*conn).serve + 0 0% 100% 1024.03kB 66.62% runtime.main +``` + +### Debugging go routine leaks + +Memory leaks are most often caused by go routine leaks keeping memory +alive which should have been garbage collected. + +See all active go routines using + + curl http://localhost:5572/debug/pprof/goroutine?debug=1 + +Or go to http://localhost:5572/debug/pprof/goroutine?debug=1 in your browser. + +### Other profiles to look at + +You can see a summary of profiles available at http://localhost:5572/debug/pprof/ + +Here is how to use some of them: + +- Memory: `go tool pprof http://localhost:5572/debug/pprof/heap` +- Go routines: `curl http://localhost:5572/debug/pprof/goroutine?debug=1` +- 30-second CPU profile: `go tool pprof http://localhost:5572/debug/pprof/profile` +- 5-second execution trace: `wget http://localhost:5572/debug/pprof/trace?seconds=5` +- Goroutine blocking profile + - Enable first with: `rclone rc debug/set-block-profile-rate rate=1` ([docs](#debug-set-block-profile-rate)) + - `go tool pprof http://localhost:5572/debug/pprof/block` +- Contended mutexes: + - Enable first with: `rclone rc debug/set-mutex-profile-fraction rate=1` ([docs](#debug-set-mutex-profile-fraction)) + - `go tool pprof http://localhost:5572/debug/pprof/mutex` + +See the [net/http/pprof docs](https://golang.org/pkg/net/http/pprof/) +for more info on how to use the profiling and for a general overview +see [the Go team's blog post on profiling go programs](https://blog.golang.org/profiling-go-programs). + +The profiling hook is [zero overhead unless it is used](https://stackoverflow.com/q/26545159/164234). + +# Overview of cloud storage systems # + +Each cloud storage system is slightly different. Rclone attempts to +provide a unified interface to them, but some underlying differences +show through. + +## Features ## + +Here is an overview of the major features of each cloud storage system. + +| Name | Hash | ModTime | Case Insensitive | Duplicate Files | MIME Type | Metadata | +| ---------------------------- |:-----------------:|:-------:|:----------------:|:---------------:|:---------:|:--------:| +| 1Fichier | Whirlpool | - | No | Yes | R | - | +| Akamai Netstorage | MD5, SHA256 | R/W | No | No | R | - | +| Amazon Drive | MD5 | - | Yes | No | R | - | +| Amazon S3 (or S3 compatible) | MD5 | R/W | No | No | R/W | RWU | +| Backblaze B2 | SHA1 | R/W | No | No | R/W | - | +| Box | SHA1 | R/W | Yes | No | - | - | +| Citrix ShareFile | MD5 | R/W | Yes | No | - | - | +| Dropbox | DBHASH ¹ | R | Yes | No | - | - | +| Enterprise File Fabric | - | R/W | Yes | No | R/W | - | +| FTP | - | R/W ¹⁰ | No | No | - | - | +| Google Cloud Storage | MD5 | R/W | No | No | R/W | - | +| Google Drive | MD5, SHA1, SHA256 | R/W | No | Yes | R/W | - | +| Google Photos | - | - | No | Yes | R | - | +| HDFS | - | R/W | No | No | - | - | +| HiDrive | HiDrive ¹² | R/W | No | No | - | - | +| HTTP | - | R | No | No | R | - | +| Internet Archive | MD5, SHA1, CRC32 | R/W ¹¹ | No | No | - | RWU | +| Jottacloud | MD5 | R/W | Yes | No | R | RW | +| Koofr | MD5 | - | Yes | No | - | - | +| Linkbox | - | R | No | No | - | - | +| Mail.ru Cloud | Mailru ⁶ | R/W | Yes | No | - | - | +| Mega | - | - | No | Yes | - | - | +| Memory | MD5 | R/W | No | No | - | - | +| Microsoft Azure Blob Storage | MD5 | R/W | No | No | R/W | - | +| Microsoft Azure Files Storage | MD5 | R/W | Yes | No | R/W | - | +| Microsoft OneDrive | QuickXorHash ⁵ | R/W | Yes | No | R | - | +| OpenDrive | MD5 | R/W | Yes | Partial ⁸ | - | - | +| OpenStack Swift | MD5 | R/W | No | No | R/W | - | +| Oracle Object Storage | MD5 | R/W | No | No | R/W | - | +| pCloud | MD5, SHA1 ⁷ | R | No | No | W | - | +| PikPak | MD5 | R | No | No | R | - | +| premiumize.me | - | - | Yes | No | R | - | +| put.io | CRC-32 | R/W | No | Yes | R | - | +| Proton Drive | SHA1 | R/W | No | No | R | - | +| QingStor | MD5 | - ⁹ | No | No | R/W | - | +| Quatrix by Maytech | - | R/W | No | No | - | - | +| Seafile | - | - | No | No | - | - | +| SFTP | MD5, SHA1 ² | R/W | Depends | No | - | - | +| Sia | - | - | No | No | - | - | +| SMB | - | R/W | Yes | No | - | - | +| SugarSync | - | - | No | No | - | - | +| Storj | - | R | No | No | - | - | +| Uptobox | - | - | No | Yes | - | - | +| WebDAV | MD5, SHA1 ³ | R ⁴ | Depends | No | - | - | +| Yandex Disk | MD5 | R/W | No | No | R | - | +| Zoho WorkDrive | - | - | No | No | - | - | +| The local filesystem | All | R/W | Depends | No | - | RWU | + +¹ Dropbox supports [its own custom +hash](https://www.dropbox.com/developers/reference/content-hash). +This is an SHA256 sum of all the 4 MiB block SHA256s. + +² SFTP supports checksums if the same login has shell access and +`md5sum` or `sha1sum` as well as `echo` are in the remote's PATH. + +³ WebDAV supports hashes when used with Fastmail Files, Owncloud and Nextcloud only. + +⁴ WebDAV supports modtimes when used with Fastmail Files, Owncloud and Nextcloud only. + +⁵ [QuickXorHash](https://docs.microsoft.com/en-us/onedrive/developer/code-snippets/quickxorhash) is Microsoft's own hash. + +⁶ Mail.ru uses its own modified SHA1 hash + +⁷ pCloud only supports SHA1 (not MD5) in its EU region + +⁸ Opendrive does not support creation of duplicate files using +their web client interface or other stock clients, but the underlying +storage platform has been determined to allow duplicate files, and it +is possible to create them with `rclone`. It may be that this is a +mistake or an unsupported feature. + +⁹ QingStor does not support SetModTime for objects bigger than 5 GiB. + +¹⁰ FTP supports modtimes for the major FTP servers, and also others +if they advertised required protocol extensions. See [this](https://rclone.org/ftp/#modification-times) +for more details. + +¹¹ Internet Archive requires option `wait_archive` to be set to a non-zero value +for full modtime support. + +¹² HiDrive supports [its own custom +hash](https://static.hidrive.com/dev/0001). +It combines SHA1 sums for each 4 KiB block hierarchically to a single +top-level sum. + +### Hash ### + +The cloud storage system supports various hash types of the objects. +The hashes are used when transferring data as an integrity check and +can be specifically used with the `--checksum` flag in syncs and in +the `check` command. + +To use the verify checksums when transferring between cloud storage +systems they must support a common hash type. + +### ModTime ### + +Almost all cloud storage systems store some sort of timestamp +on objects, but several of them not something that is appropriate +to use for syncing. E.g. some backends will only write a timestamp +that represent the time of the upload. To be relevant for syncing +it should be able to store the modification time of the source +object. If this is not the case, rclone will only check the file +size by default, though can be configured to check the file hash +(with the `--checksum` flag). Ideally it should also be possible to +change the timestamp of an existing file without having to re-upload it. + +Storage systems with a `-` in the ModTime column, means the +modification read on objects is not the modification time of the +file when uploaded. It is most likely the time the file was uploaded, +or possibly something else (like the time the picture was taken in +Google Photos). + +Storage systems with a `R` (for read-only) in the ModTime column, +means the it keeps modification times on objects, and updates them +when uploading objects, but it does not support changing only the +modification time (`SetModTime` operation) without re-uploading, +possibly not even without deleting existing first. Some operations +in rclone, such as `copy` and `sync` commands, will automatically +check for `SetModTime` support and re-upload if necessary to keep +the modification times in sync. Other commands will not work +without `SetModTime` support, e.g. `touch` command on an existing +file will fail, and changes to modification time only on a files +in a `mount` will be silently ignored. + +Storage systems with `R/W` (for read/write) in the ModTime column, +means they do also support modtime-only operations. + +### Case Insensitive ### + +If a cloud storage systems is case sensitive then it is possible to +have two files which differ only in case, e.g. `file.txt` and +`FILE.txt`. If a cloud storage system is case insensitive then that +isn't possible. + +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. + +The local filesystem and SFTP may or may not be case sensitive +depending on OS. + + * Windows - usually case insensitive, though case is preserved + * OSX - usually case insensitive, though it is possible to format case sensitive + * Linux - usually case sensitive, but there are case insensitive file systems (e.g. FAT formatted USB keys) + +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. + +### Duplicate files ### + +If a cloud storage system allows duplicate files then it can have two +objects with the same name. + +This confuses rclone greatly when syncing - use the `rclone dedupe` +command to rename or remove duplicates. + +### Restricted filenames ### + +Some cloud storage systems might have restrictions on the characters +that are usable in file or directory names. +When `rclone` detects such a name during a file upload, it will +transparently replace the restricted characters with similar looking +Unicode characters. To handle the different sets of restricted characters +for different backends, rclone uses something it calls [encoding](#encoding). + +This process is designed to avoid ambiguous file names as much as +possible and allow to move files between many cloud storage systems +transparently. + +The name shown by `rclone` to the user or during log output will only +contain a minimal set of [replaced characters](#restricted-characters) +to ensure correct formatting and not necessarily the actual name used +on the cloud storage. + +This transformation is reversed when downloading a file or parsing +`rclone` arguments. For example, when uploading a file named `my file?.txt` +to Onedrive, it will be displayed as `my file?.txt` on the console, but +stored as `my file?.txt` to Onedrive (the `?` gets replaced by the similar +looking `?` character, the so-called "fullwidth question mark"). +The reverse transformation allows to read a file `unusual/name.txt` +from Google Drive, by passing the name `unusual/name.txt` on the command line +(the `/` needs to be replaced by the similar looking `/` character). + +#### Caveats {#restricted-filenames-caveats} + +The filename encoding system works well in most cases, at least +where file names are written in English or similar languages. +You might not even notice it: It just works. In some cases it may +lead to issues, though. E.g. when file names are written in Chinese, +or Japanese, where it is always the Unicode fullwidth variants of the +punctuation marks that are used. + +On Windows, the characters `:`, `*` and `?` are examples of restricted +characters. If these are used in filenames on a remote that supports it, +Rclone will transparently convert them to their fullwidth Unicode +variants `*`, `?` and `:` when downloading to Windows, and back again +when uploading. This way files with names that are not allowed on Windows +can still be stored. + +However, if you have files on your Windows system originally with these same +Unicode characters in their names, they will be included in the same conversion +process. E.g. if you create a file in your Windows filesystem with name +`Test:1.jpg`, where `:` is the Unicode fullwidth colon symbol, and use +rclone to upload it to Google Drive, which supports regular `:` (halfwidth +question mark), rclone will replace the fullwidth `:` with the +halfwidth `:` and store the file as `Test:1.jpg` in Google Drive. Since +both Windows and Google Drive allows the name `Test:1.jpg`, it would +probably be better if rclone just kept the name as is in this case. + +With the opposite situation; if you have a file named `Test:1.jpg`, +in your Google Drive, e.g. uploaded from a Linux system where `:` is valid +in file names. Then later use rclone to copy this file to your Windows +computer you will notice that on your local disk it gets renamed +to `Test:1.jpg`. The original filename is not legal on Windows, due to +the `:`, and rclone therefore renames it to make the copy possible. +That is all good. However, this can also lead to an issue: If you already +had a *different* file named `Test:1.jpg` on Windows, and then use rclone +to copy either way. Rclone will then treat the file originally named +`Test:1.jpg` on Google Drive and the file originally named `Test:1.jpg` +on Windows as the same file, and replace the contents from one with the other. + +Its virtually impossible to handle all cases like these correctly in all +situations, but by customizing the [encoding option](#encoding), changing the +set of characters that rclone should convert, you should be able to +create a configuration that works well for your specific situation. +See also the [example](https://rclone.org/overview/#encoding-example-windows) below. + +(Windows was used as an example of a file system with many restricted +characters, and Google drive a storage system with few.) + +#### Default restricted characters {#restricted-characters} + +The table below shows the characters that are replaced by default. + +When a replacement character is found in a filename, this character +will be escaped with the `‛` character to avoid ambiguous file names. +(e.g. a file named `␀.txt` would shown as `‛␀.txt`) + +Each cloud storage backend can use a different set of characters, +which will be specified in the documentation for each backend. + +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| NUL | 0x00 | ␀ | +| SOH | 0x01 | ␁ | +| STX | 0x02 | ␂ | +| ETX | 0x03 | ␃ | +| EOT | 0x04 | ␄ | +| ENQ | 0x05 | ␅ | +| ACK | 0x06 | ␆ | +| BEL | 0x07 | ␇ | +| BS | 0x08 | ␈ | +| HT | 0x09 | ␉ | +| LF | 0x0A | ␊ | +| VT | 0x0B | ␋ | +| FF | 0x0C | ␌ | +| CR | 0x0D | ␍ | +| SO | 0x0E | ␎ | +| SI | 0x0F | ␏ | +| DLE | 0x10 | ␐ | +| DC1 | 0x11 | ␑ | +| DC2 | 0x12 | ␒ | +| DC3 | 0x13 | ␓ | +| DC4 | 0x14 | ␔ | +| NAK | 0x15 | ␕ | +| SYN | 0x16 | ␖ | +| ETB | 0x17 | ␗ | +| CAN | 0x18 | ␘ | +| EM | 0x19 | ␙ | +| SUB | 0x1A | ␚ | +| ESC | 0x1B | ␛ | +| FS | 0x1C | ␜ | +| GS | 0x1D | ␝ | +| RS | 0x1E | ␞ | +| US | 0x1F | ␟ | +| / | 0x2F | / | +| DEL | 0x7F | ␡ | + +The default encoding will also encode these file names as they are +problematic with many cloud storage systems. + +| File name | Replacement | +| --------- |:-----------:| +| . | . | +| .. | .. | + +#### Invalid UTF-8 bytes {#invalid-utf8} + +Some backends only support a sequence of well formed UTF-8 bytes +as file or directory names. + +In this case all invalid UTF-8 bytes will be replaced with a quoted +representation of the byte value to allow uploading a file to such a +backend. For example, the invalid byte `0xFE` will be encoded as `‛FE`. + +A common source of invalid UTF-8 bytes are local filesystems, that store +names in a different encoding than UTF-8 or UTF-16, like latin1. See the +[local filenames](https://rclone.org/local/#filenames) section for details. + +#### Encoding option {#encoding} + +Most backends have an encoding option, specified as a flag +`--backend-encoding` where `backend` is the name of the backend, or as +a config parameter `encoding` (you'll need to select the Advanced +config in `rclone config` to see it). + +This will have default value which encodes and decodes characters in +such a way as to preserve the maximum number of characters (see +above). + +However this can be incorrect in some scenarios, for example if you +have a Windows file system with Unicode fullwidth characters +`*`, `?` or `:`, that you want to remain as those characters on the +remote rather than being translated to regular (halfwidth) `*`, `?` and `:`. + +The `--backend-encoding` flags allow you to change that. You can +disable the encoding completely with `--backend-encoding None` or set +`encoding = None` in the config file. + +Encoding takes a comma separated list of encodings. You can see the +list of all possible values by passing an invalid value to this +flag, e.g. `--local-encoding "help"`. The command `rclone help flags encoding` +will show you the defaults for the backends. + +| Encoding | Characters | Encoded as | +| --------- | ---------- | ---------- | +| Asterisk | `*` | `*` | +| BackQuote | `` ` `` | ``` | +| BackSlash | `\` | `\` | +| Colon | `:` | `:` | +| CrLf | CR 0x0D, LF 0x0A | `␍`, `␊` | +| Ctl | All control characters 0x00-0x1F | `␀␁␂␃␄␅␆␇␈␉␊␋␌␍␎␏␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟` | +| Del | DEL 0x7F | `␡` | +| Dollar | `$` | `$` | +| Dot | `.` or `..` as entire string | `.`, `..` | +| DoubleQuote | `"` | `"` | +| Hash | `#` | `#` | +| InvalidUtf8 | An invalid UTF-8 character (e.g. latin1) | `�` | +| LeftCrLfHtVt | CR 0x0D, LF 0x0A, HT 0x09, VT 0x0B on the left of a string | `␍`, `␊`, `␉`, `␋` | +| LeftPeriod | `.` on the left of a string | `.` | +| LeftSpace | SPACE on the left of a string | `␠` | +| LeftTilde | `~` on the left of a string | `~` | +| LtGt | `<`, `>` | `<`, `>` | +| None | No characters are encoded | | +| Percent | `%` | `%` | +| Pipe | \| | `|` | +| Question | `?` | `?` | +| RightCrLfHtVt | CR 0x0D, LF 0x0A, HT 0x09, VT 0x0B on the right of a string | `␍`, `␊`, `␉`, `␋` | +| RightPeriod | `.` on the right of a string | `.` | +| RightSpace | SPACE on the right of a string | `␠` | +| Semicolon | `;` | `;` | +| SingleQuote | `'` | `'` | +| Slash | `/` | `/` | +| SquareBracket | `[`, `]` | `[`, `]` | + +##### Encoding example: FTP + +To take a specific example, the FTP backend's default encoding is + + --ftp-encoding "Slash,Del,Ctl,RightSpace,Dot" + +However, let's say the FTP server is running on Windows and can't have +any of the invalid Windows characters in file names. You are backing +up Linux servers to this FTP server which do have those characters in +file names. So you would add the Windows set which are + + Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot + +to the existing ones, giving: + + Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot,Del,RightSpace + +This can be specified using the `--ftp-encoding` flag or using an `encoding` parameter in the config file. + +##### Encoding example: Windows + +As a nother example, take a Windows system where there is a file with +name `Test:1.jpg`, where `:` is the Unicode fullwidth colon symbol. +When using rclone to copy this to a remote which supports `:`, +the regular (halfwidth) colon (such as Google Drive), you will notice +that the file gets renamed to `Test:1.jpg`. + +To avoid this you can change the set of characters rclone should convert +for the local filesystem, using command-line argument `--local-encoding`. +Rclone's default behavior on Windows corresponds to + +``` +--local-encoding "Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot" +``` + +If you want to use fullwidth characters `:`, `*` and `?` in your filenames +without rclone changing them when uploading to a remote, then set the same as +the default value but without `Colon,Question,Asterisk`: + +``` +--local-encoding "Slash,LtGt,DoubleQuote,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot" +``` + +Alternatively, you can disable the conversion of any characters with `--local-encoding None`. + +Instead of using command-line argument `--local-encoding`, you may also set it +as [environment variable](https://rclone.org/docs/#environment-variables) `RCLONE_LOCAL_ENCODING`, +or [configure](https://rclone.org/docs/#configure) a remote of type `local` in your config, +and set the `encoding` option there. + +The risk by doing this is that if you have a filename with the regular (halfwidth) +`:`, `*` and `?` in your cloud storage, and you try to download +it to your Windows filesystem, this will fail. These characters are not +valid in filenames on Windows, and you have told rclone not to work around +this by converting them to valid fullwidth variants. + +### MIME Type ### + +MIME types (also known as media types) classify types of documents +using a simple text classification, e.g. `text/html` or +`application/pdf`. + +Some cloud storage systems support reading (`R`) the MIME type of +objects and some support writing (`W`) the MIME type of objects. + +The MIME type can be important if you are serving files directly to +HTTP from the storage system. + +If you are copying from a remote which supports reading (`R`) to a +remote which supports writing (`W`) then rclone will preserve the MIME +types. Otherwise they will be guessed from the extension, or the +remote itself may assign the MIME type. + +### Metadata + +Backends may or may support reading or writing metadata. They may +support reading and writing system metadata (metadata intrinsic to +that backend) and/or user metadata (general purpose metadata). + +The levels of metadata support are + +| Key | Explanation | +|-----|-------------| +| `R` | Read only System Metadata | +| `RW` | Read and write System Metadata | +| `RWU` | Read and write System Metadata and read and write User Metadata | + +See [the metadata docs](https://rclone.org/docs/#metadata) for more info. + +## Optional Features ## + +All rclone remotes support a base command set. Other features depend +upon backend-specific capabilities. + +| Name | Purge | Copy | Move | DirMove | CleanUp | ListR | StreamUpload | MultithreadUpload | LinkSharing | About | EmptyDir | +| ---------------------------- |:-----:|:----:|:----:|:-------:|:-------:|:-----:|:------------:|:------------------|:------------:|:-----:|:--------:| +| 1Fichier | No | Yes | Yes | No | No | No | No | No | Yes | No | Yes | +| Akamai Netstorage | Yes | No | No | No | No | Yes | Yes | No | No | No | Yes | +| Amazon Drive | Yes | No | Yes | Yes | No | No | No | No | No | No | Yes | +| Amazon S3 (or S3 compatible) | No | Yes | No | No | Yes | Yes | Yes | Yes | Yes | No | No | +| Backblaze B2 | No | Yes | No | No | Yes | Yes | Yes | Yes | Yes | No | No | +| Box | Yes | Yes | Yes | Yes | Yes | No | Yes | No | Yes | Yes | Yes | +| Citrix ShareFile | Yes | Yes | Yes | Yes | No | No | No | No | No | No | Yes | +| Dropbox | Yes | Yes | Yes | Yes | No | No | Yes | No | Yes | Yes | Yes | +| Enterprise File Fabric | Yes | Yes | Yes | Yes | Yes | No | No | No | No | No | Yes | +| FTP | No | No | Yes | Yes | No | No | Yes | No | No | No | Yes | +| Google Cloud Storage | Yes | Yes | No | No | No | Yes | Yes | No | No | No | No | +| Google Drive | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | Yes | +| Google Photos | No | No | No | No | No | No | No | No | No | No | No | +| HDFS | Yes | No | Yes | Yes | No | No | Yes | No | No | Yes | Yes | +| HiDrive | Yes | Yes | Yes | Yes | No | No | Yes | No | No | No | Yes | +| HTTP | No | No | No | No | No | No | No | No | No | No | Yes | +| Internet Archive | No | Yes | No | No | Yes | Yes | No | No | Yes | Yes | No | +| Jottacloud | Yes | Yes | Yes | Yes | Yes | Yes | No | No | Yes | Yes | Yes | +| Koofr | Yes | Yes | Yes | Yes | No | No | Yes | No | Yes | Yes | Yes | +| Mail.ru Cloud | Yes | Yes | Yes | Yes | Yes | No | No | No | Yes | Yes | Yes | +| Mega | Yes | No | Yes | Yes | Yes | No | No | No | Yes | Yes | Yes | +| Memory | No | Yes | No | No | No | Yes | Yes | No | No | No | No | +| Microsoft Azure Blob Storage | Yes | Yes | No | No | No | Yes | Yes | Yes | No | No | No | +| Microsoft Azure Files Storage | No | Yes | Yes | Yes | No | No | Yes | Yes | No | Yes | Yes | +| Microsoft OneDrive | Yes | Yes | Yes | Yes | Yes | Yes ⁵ | No | No | Yes | Yes | Yes | +| OpenDrive | Yes | Yes | Yes | Yes | No | No | No | No | No | No | Yes | +| OpenStack Swift | Yes ¹ | Yes | No | No | No | Yes | Yes | No | No | Yes | No | +| Oracle Object Storage | No | Yes | No | No | Yes | Yes | Yes | Yes | No | No | No | +| pCloud | Yes | Yes | Yes | Yes | Yes | No | No | No | Yes | Yes | Yes | +| PikPak | Yes | Yes | Yes | Yes | Yes | No | No | No | Yes | Yes | Yes | +| premiumize.me | Yes | No | Yes | Yes | No | No | No | No | Yes | Yes | Yes | +| put.io | Yes | No | Yes | Yes | Yes | No | Yes | No | No | Yes | Yes | +| Proton Drive | Yes | No | Yes | Yes | Yes | No | No | No | No | Yes | Yes | +| QingStor | No | Yes | No | No | Yes | Yes | No | No | No | No | No | +| Quatrix by Maytech | Yes | Yes | Yes | Yes | No | No | No | No | No | Yes | Yes | +| Seafile | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | Yes | +| SFTP | No | Yes ⁴| Yes | Yes | No | No | Yes | No | No | Yes | Yes | +| Sia | No | No | No | No | No | No | Yes | No | No | No | Yes | +| SMB | No | No | Yes | Yes | No | No | Yes | Yes | No | No | Yes | +| SugarSync | Yes | Yes | Yes | Yes | No | No | Yes | No | Yes | No | Yes | +| Storj | Yes ² | Yes | Yes | No | No | Yes | Yes | No | Yes | No | No | +| Uptobox | No | Yes | Yes | Yes | No | No | No | No | No | No | No | +| WebDAV | Yes | Yes | Yes | Yes | No | No | Yes ³ | No | No | Yes | Yes | +| Yandex Disk | Yes | Yes | Yes | Yes | Yes | No | Yes | No | Yes | Yes | Yes | +| Zoho WorkDrive | Yes | Yes | Yes | Yes | No | No | No | No | No | Yes | Yes | +| The local filesystem | Yes | No | Yes | Yes | No | No | Yes | Yes | No | Yes | Yes | + +¹ Note Swift implements this in order to delete directory markers but +it doesn't actually have a quicker way of deleting files other than +deleting them individually. + +² Storj implements this efficiently only for entire buckets. If +purging a directory inside a bucket, files are deleted individually. + +³ StreamUpload is not supported with Nextcloud + +⁴ Use the `--sftp-copy-is-hardlink` flag to enable. + +⁵ Use the `--onedrive-delta` flag to enable. + +### Purge ### + +This deletes a directory quicker than just deleting all the files in +the directory. + +### Copy ### + +Used when copying an object to and from the same remote. This known +as a server-side copy so you can copy a file without downloading it +and uploading it again. It is used if you use `rclone copy` or +`rclone move` if the remote doesn't support `Move` directly. + +If the server doesn't support `Copy` directly then for copy operations +the file is downloaded then re-uploaded. + +### Move ### + +Used when moving/renaming an object on the same remote. This is known +as a server-side move of a file. This is used in `rclone move` if the +server doesn't support `DirMove`. + +If the server isn't capable of `Move` then rclone simulates it with +`Copy` then delete. If the server doesn't support `Copy` then rclone +will download the file and re-upload it. + +### DirMove ### + +This is used to implement `rclone move` to move a directory if +possible. If it isn't then it will use `Move` on each file (which +falls back to `Copy` then download and upload - see `Move` section). + +### CleanUp ### + +This is used for emptying the trash for a remote by `rclone cleanup`. + +If the server can't do `CleanUp` then `rclone cleanup` will return an +error. + +‡‡ Note that while Box implements this it has to delete every file +individually so it will be slower than emptying the trash via the WebUI + +### ListR ### + +The remote supports a recursive list to list all the contents beneath +a directory quickly. This enables the `--fast-list` flag to work. +See the [rclone docs](https://rclone.org/docs/#fast-list) for more details. + +### StreamUpload ### + +Some remotes allow files to be uploaded without knowing the file size +in advance. This allows certain operations to work without spooling the +file to local disk first, e.g. `rclone rcat`. + +### MultithreadUpload ### + +Some remotes allow transfers to the remote to be sent as chunks in +parallel. If this is supported then rclone will use multi-thread +copying to transfer files much faster. + +### LinkSharing ### + +Sets the necessary permissions on a file or folder and prints a link +that allows others to access them, even if they don't have an account +on the particular cloud provider. + +### About ### + +Rclone `about` prints quota information for a remote. Typical output +includes bytes used, free, quota and in trash. + +If a remote lacks about capability `rclone about remote:`returns +an error. + +Backends without about capability cannot determine free space for an +rclone mount, or use policy `mfs` (most free space) as a member of an +rclone union remote. + +See [rclone about command](https://rclone.org/commands/rclone_about/) + +### EmptyDir ### + +The remote supports empty directories. See [Limitations](https://rclone.org/bugs/#limitations) + for details. Most Object/Bucket-based remotes do not support this. + +# Global Flags + +This describes the global flags available to every rclone command +split into groups. + + +## Copy + +Flags for anything which can Copy a file. + +``` + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination +``` + + +## Sync + +Flags just used for `rclone sync`. + +``` + --backup-dir string Make backups into hierarchy based in DIR + --delete-after When synchronizing, delete files on destination after transferring (default) + --delete-before When synchronizing, delete files on destination before transferring + --delete-during When synchronizing, delete files during transfer + --ignore-errors Delete even if there are I/O errors + --max-delete int When synchronizing, limit the number of deletes (default -1) + --max-delete-size SizeSuffix When synchronizing, limit the total size of deletes (default off) + --suffix string Suffix to add to changed files + --suffix-keep-extension Preserve the extension when using --suffix + --track-renames When synchronizing, track file renames and do a server-side move if possible + --track-renames-strategy string Strategies to use when synchronizing using track-renames hash|modtime|leaf (default "hash") +``` + + +## Important + +Important flags useful for most commands. + +``` + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +``` + + +## Check + +Flags used for `rclone check`. + +``` + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) +``` + + +## Networking + +General networking and HTTP stuff. + +``` + --bind string Local address to bind to for outgoing connections, IPv4, IPv6 or name + --bwlimit BwTimetable Bandwidth limit in KiB/s, or use suffix B|K|M|G|T|P or a full timetable + --bwlimit-file BwTimetable Bandwidth limit per file in KiB/s, or use suffix B|K|M|G|T|P or a full timetable + --ca-cert stringArray CA certificate used to verify servers + --client-cert string Client SSL certificate (PEM) for mutual TLS auth + --client-key string Client SSL private key (PEM) for mutual TLS auth + --contimeout Duration Connect timeout (default 1m0s) + --disable-http-keep-alives Disable HTTP keep-alives and use each connection once. + --disable-http2 Disable HTTP/2 in the global transport + --dscp string Set DSCP value to connections, value or name, e.g. CS1, LE, DF, AF21 + --expect-continue-timeout Duration Timeout when using expect / 100-continue in HTTP (default 1s) + --header stringArray Set HTTP header for all transactions + --header-download stringArray Set HTTP header for download transactions + --header-upload stringArray Set HTTP header for upload transactions + --no-check-certificate Do not verify the server SSL certificate (insecure) + --no-gzip-encoding Don't set Accept-Encoding: gzip + --timeout Duration IO idle timeout (default 5m0s) + --tpslimit float Limit HTTP transactions per second to this + --tpslimit-burst int Max burst of transactions for --tpslimit (default 1) + --use-cookies Enable session cookiejar + --user-agent string Set the user-agent to a specified string (default "rclone/v1.65.0") +``` + + +## Performance + +Flags helpful for increasing performance. + +``` + --buffer-size SizeSuffix In memory buffer size when reading files for each --transfer (default 16Mi) + --checkers int Number of checkers to run in parallel (default 8) + --transfers int Number of file transfers to run in parallel (default 4) +``` + + +## Config + +General configuration of rclone. + +``` + --ask-password Allow prompt for password for encrypted configuration (default true) + --auto-confirm If enabled, do not request console confirmation + --cache-dir string Directory rclone will use for caching (default "$HOME/.cache/rclone") + --color AUTO|NEVER|ALWAYS When to show colors (and other ANSI codes) AUTO|NEVER|ALWAYS (default AUTO) + --config string Config file (default "$HOME/.config/rclone/rclone.conf") + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --disable string Disable a comma separated list of features (use --disable help to see a list) + -n, --dry-run Do a trial run with no permanent changes + --error-on-no-transfer Sets exit code 9 if no files are transferred, useful in scripts + --fs-cache-expire-duration Duration Cache remotes for this long (0 to disable caching) (default 5m0s) + --fs-cache-expire-interval Duration Interval to check for expired remotes (default 1m0s) + --human-readable Print numbers in a human-readable format, sizes with suffix Ki|Mi|Gi|Ti|Pi + -i, --interactive Enable interactive mode + --kv-lock-time Duration Maximum time to keep key-value database locked by process (default 1s) + --low-level-retries int Number of low level retries to do (default 10) + --no-console Hide console window (supported on Windows only) + --no-unicode-normalization Don't normalize unicode characters in filenames + --password-command SpaceSepList Command for supplying password for encrypted configuration + --retries int Retry operations this many times if they fail (default 3) + --retries-sleep Duration Interval between retrying operations if they fail, e.g. 500ms, 60s, 5m (0 to disable) (default 0s) + --temp-dir string Directory rclone will use for temporary files (default "/tmp") + --use-mmap Use mmap allocator (see docs) + --use-server-modtime Use server modified time instead of object metadata +``` + + +## Debugging + +Flags for developers. + +``` + --cpuprofile string Write cpu profile to file + --dump DumpFlags List of items to dump from: headers, bodies, requests, responses, auth, filters, goroutines, openfiles, mapper + --dump-bodies Dump HTTP headers and bodies - may contain sensitive info + --dump-headers Dump HTTP headers - may contain sensitive info + --memprofile string Write memory profile to file +``` + + +## Filter + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + + +## Listing + +Flags for listing directories. + +``` + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +``` + + +## Logging + +Logging and statistics. + +``` + --log-file string Log everything to this file + --log-format string Comma separated list of log format options (default "date,time") + --log-level LogLevel Log level DEBUG|INFO|NOTICE|ERROR (default NOTICE) + --log-systemd Activate systemd integration for the logger + --max-stats-groups int Maximum number of stats groups to keep in memory, on max oldest is discarded (default 1000) + -P, --progress Show progress during transfer + --progress-terminal-title Show progress on the terminal title (requires -P/--progress) + -q, --quiet Print as little stuff as possible + --stats Duration Interval between printing stats, e.g. 500ms, 60s, 5m (0 to disable) (default 1m0s) + --stats-file-name-length int Max file name length in stats (0 for no limit) (default 45) + --stats-log-level LogLevel Log level to show --stats output DEBUG|INFO|NOTICE|ERROR (default INFO) + --stats-one-line Make the stats fit on one line + --stats-one-line-date Enable --stats-one-line and add current date/time prefix + --stats-one-line-date-format string Enable --stats-one-line-date and use custom formatted date: Enclose date string in double quotes ("), see https://golang.org/pkg/time/#Time.Format + --stats-unit string Show data rate in stats as either 'bits' or 'bytes' per second (default "bytes") + --syslog Use Syslog for logging + --syslog-facility string Facility for syslog, e.g. KERN,USER,... (default "DAEMON") + --use-json-log Use json log format + -v, --verbose count Print lots more stuff (repeat for more) +``` + + +## Metadata + +Flags to control metadata. + +``` + -M, --metadata If set, preserve metadata when copying objects + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --metadata-mapper SpaceSepList Program to run to transforming metadata before upload + --metadata-set stringArray Add metadata key=value when uploading +``` + + +## RC + +Flags to control the Remote Control API. + +``` + --rc Enable the remote control server + --rc-addr stringArray IPaddress:Port or :Port to bind server to (default [localhost:5572]) + --rc-allow-origin string Origin which cross-domain request (CORS) can be executed from + --rc-baseurl string Prefix for URLs - leave blank for root + --rc-cert string TLS PEM key (concatenation of certificate and CA certificate) + --rc-client-ca string Client certificate authority to verify clients with + --rc-enable-metrics Enable prometheus metrics on /metrics + --rc-files string Path to local files to serve on the HTTP server + --rc-htpasswd string A htpasswd file - if not provided no authentication is done + --rc-job-expire-duration Duration Expire finished async jobs older than this value (default 1m0s) + --rc-job-expire-interval Duration Interval to check for expired async jobs (default 10s) + --rc-key string TLS PEM Private key + --rc-max-header-bytes int Maximum size of request header (default 4096) + --rc-min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") + --rc-no-auth Don't require auth for certain methods + --rc-pass string Password for authentication + --rc-realm string Realm for authentication + --rc-salt string Password hashing salt (default "dlPL2MqE") + --rc-serve Enable the serving of remote objects + --rc-server-read-timeout Duration Timeout for server reading data (default 1h0m0s) + --rc-server-write-timeout Duration Timeout for server writing data (default 1h0m0s) + --rc-template string User-specified template + --rc-user string User name for authentication + --rc-web-fetch-url string URL to fetch the releases for webgui (default "https://api.github.com/repos/rclone/rclone-webui-react/releases/latest") + --rc-web-gui Launch WebGUI on localhost + --rc-web-gui-force-update Force update to latest version of web gui + --rc-web-gui-no-open-browser Don't open the browser automatically + --rc-web-gui-update Check and update to latest version of web gui +``` + + +## Backend + +Backend only flags. These can be set in the config file also. + +``` + --acd-auth-url string Auth server URL + --acd-client-id string OAuth Client Id + --acd-client-secret string OAuth Client Secret + --acd-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --acd-templink-threshold SizeSuffix Files >= this size will be downloaded via their tempLink (default 9Gi) + --acd-token string OAuth Access Token as a JSON blob + --acd-token-url string Token server url + --acd-upload-wait-per-gb Duration Additional time per GiB to wait after a failed complete upload to see if it appears (default 3m0s) + --alias-remote string Remote or path to alias + --azureblob-access-tier string Access tier of blob: hot, cool, cold or archive + --azureblob-account string Azure Storage Account Name + --azureblob-archive-tier-delete Delete archive tier blobs before overwriting + --azureblob-chunk-size SizeSuffix Upload chunk size (default 4Mi) + --azureblob-client-certificate-password string Password for the certificate file (optional) (obscured) + --azureblob-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key + --azureblob-client-id string The ID of the client in use + --azureblob-client-secret string One of the service principal's client secrets + --azureblob-client-send-certificate-chain Send the certificate chain when using certificate auth + --azureblob-directory-markers Upload an empty object with a trailing slash when a new directory is created + --azureblob-disable-checksum Don't store MD5 checksum with object metadata + --azureblob-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8) + --azureblob-endpoint string Endpoint for the service + --azureblob-env-auth Read credentials from runtime (environment variables, CLI or MSI) + --azureblob-key string Storage Account Shared Key + --azureblob-list-chunk int Size of blob list (default 5000) + --azureblob-msi-client-id string Object ID of the user-assigned MSI to use, if any + --azureblob-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any + --azureblob-msi-object-id string Object ID of the user-assigned MSI to use, if any + --azureblob-no-check-container If set, don't attempt to check the container exists or create it + --azureblob-no-head-object If set, do not do HEAD before GET when getting objects + --azureblob-password string The user's password (obscured) + --azureblob-public-access string Public access level of a container: blob or container + --azureblob-sas-url string SAS URL for container level access only + --azureblob-service-principal-file string Path to file containing credentials for use with a service principal + --azureblob-tenant string ID of the service principal's tenant. Also called its directory ID + --azureblob-upload-concurrency int Concurrency for multipart uploads (default 16) + --azureblob-upload-cutoff string Cutoff for switching to chunked upload (<= 256 MiB) (deprecated) + --azureblob-use-emulator Uses local storage emulator if provided as 'true' + --azureblob-use-msi Use a managed service identity to authenticate (only works in Azure) + --azureblob-username string User name (usually an email address) + --azurefiles-account string Azure Storage Account Name + --azurefiles-chunk-size SizeSuffix Upload chunk size (default 4Mi) + --azurefiles-client-certificate-password string Password for the certificate file (optional) (obscured) + --azurefiles-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key + --azurefiles-client-id string The ID of the client in use + --azurefiles-client-secret string One of the service principal's client secrets + --azurefiles-client-send-certificate-chain Send the certificate chain when using certificate auth + --azurefiles-connection-string string Azure Files Connection String + --azurefiles-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8,Dot) + --azurefiles-endpoint string Endpoint for the service + --azurefiles-env-auth Read credentials from runtime (environment variables, CLI or MSI) + --azurefiles-key string Storage Account Shared Key + --azurefiles-max-stream-size SizeSuffix Max size for streamed files (default 10Gi) + --azurefiles-msi-client-id string Object ID of the user-assigned MSI to use, if any + --azurefiles-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any + --azurefiles-msi-object-id string Object ID of the user-assigned MSI to use, if any + --azurefiles-password string The user's password (obscured) + --azurefiles-sas-url string SAS URL + --azurefiles-service-principal-file string Path to file containing credentials for use with a service principal + --azurefiles-share-name string Azure Files Share Name + --azurefiles-tenant string ID of the service principal's tenant. Also called its directory ID + --azurefiles-upload-concurrency int Concurrency for multipart uploads (default 16) + --azurefiles-use-msi Use a managed service identity to authenticate (only works in Azure) + --azurefiles-username string User name (usually an email address) + --b2-account string Account ID or Application Key ID + --b2-chunk-size SizeSuffix Upload chunk size (default 96Mi) + --b2-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4Gi) + --b2-disable-checksum Disable checksums for large (> upload cutoff) files + --b2-download-auth-duration Duration Time before the authorization token will expire in s or suffix ms|s|m|h|d (default 1w) + --b2-download-url string Custom endpoint for downloads + --b2-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --b2-endpoint string Endpoint for the service + --b2-hard-delete Permanently delete files on remote removal, otherwise hide files + --b2-key string Application Key + --b2-lifecycle int Set the number of days deleted files should be kept when creating a bucket + --b2-test-mode string A flag string for X-Bz-Test-Mode header for debugging + --b2-upload-concurrency int Concurrency for multipart uploads (default 4) + --b2-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --b2-version-at Time Show file versions as they were at the specified time (default off) + --b2-versions Include old versions in directory listings + --box-access-token string Box App Primary Access Token + --box-auth-url string Auth server URL + --box-box-config-file string Box App config.json location + --box-box-sub-type string (default "user") + --box-client-id string OAuth Client Id + --box-client-secret string OAuth Client Secret + --box-commit-retries int Max number of times to try committing a multipart file (default 100) + --box-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot) + --box-impersonate string Impersonate this user ID when using a service account + --box-list-chunk int Size of listing chunk 1-1000 (default 1000) + --box-owned-by string Only show items owned by the login (email address) passed in + --box-root-folder-id string Fill in for rclone to use a non root folder as its starting point + --box-token string OAuth Access Token as a JSON blob + --box-token-url string Token server url + --box-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (>= 50 MiB) (default 50Mi) + --cache-chunk-clean-interval Duration How often should the cache perform cleanups of the chunk storage (default 1m0s) + --cache-chunk-no-memory Disable the in-memory cache for storing chunks during streaming + --cache-chunk-path string Directory to cache chunk files (default "$HOME/.cache/rclone/cache-backend") + --cache-chunk-size SizeSuffix The size of a chunk (partial file data) (default 5Mi) + --cache-chunk-total-size SizeSuffix The total size that the chunks can take up on the local disk (default 10Gi) + --cache-db-path string Directory to store file structure metadata DB (default "$HOME/.cache/rclone/cache-backend") + --cache-db-purge Clear all the cached data for this remote on start + --cache-db-wait-time Duration How long to wait for the DB to be available - 0 is unlimited (default 1s) + --cache-info-age Duration How long to cache file structure information (directory listings, file size, times, etc.) (default 6h0m0s) + --cache-plex-insecure string Skip all certificate verification when connecting to the Plex server + --cache-plex-password string The password of the Plex user (obscured) + --cache-plex-url string The URL of the Plex server + --cache-plex-username string The username of the Plex user + --cache-read-retries int How many times to retry a read from a cache storage (default 10) + --cache-remote string Remote to cache + --cache-rps int Limits the number of requests per second to the source FS (-1 to disable) (default -1) + --cache-tmp-upload-path string Directory to keep temporary files until they are uploaded + --cache-tmp-wait-time Duration How long should files be stored in local cache before being uploaded (default 15s) + --cache-workers int How many workers should run in parallel to download chunks (default 4) + --cache-writes Cache file data on writes through the FS + --chunker-chunk-size SizeSuffix Files larger than chunk size will be split in chunks (default 2Gi) + --chunker-fail-hard Choose how chunker should handle files with missing or invalid chunks + --chunker-hash-type string Choose how chunker handles hash sums (default "md5") + --chunker-remote string Remote to chunk/unchunk + --combine-upstreams SpaceSepList Upstreams for combining + --compress-level int GZIP compression level (-2 to 9) (default -1) + --compress-mode string Compression mode (default "gzip") + --compress-ram-cache-limit SizeSuffix Some remotes don't allow the upload of files with unknown size (default 20Mi) + --compress-remote string Remote to compress + -L, --copy-links Follow symlinks and copy the pointed to item + --crypt-directory-name-encryption Option to either encrypt directory names or leave them intact (default true) + --crypt-filename-encoding string How to encode the encrypted filename to text string (default "base32") + --crypt-filename-encryption string How to encrypt the filenames (default "standard") + --crypt-no-data-encryption Option to either encrypt file data or leave it unencrypted + --crypt-pass-bad-blocks If set this will pass bad blocks through as all 0 + --crypt-password string Password or pass phrase for encryption (obscured) + --crypt-password2 string Password or pass phrase for salt (obscured) + --crypt-remote string Remote to encrypt/decrypt + --crypt-server-side-across-configs Deprecated: use --server-side-across-configs instead + --crypt-show-mapping For all files listed show how the names encrypt + --crypt-suffix string If this is set it will override the default suffix of ".bin" (default ".bin") + --drive-acknowledge-abuse Set to allow files which return cannotDownloadAbusiveFile to be downloaded + --drive-allow-import-name-change Allow the filetype to change when uploading Google docs + --drive-auth-owner-only Only consider files owned by the authenticated user + --drive-auth-url string Auth server URL + --drive-chunk-size SizeSuffix Upload chunk size (default 8Mi) + --drive-client-id string Google Application Client Id + --drive-client-secret string OAuth Client Secret + --drive-copy-shortcut-content Server side copy contents of shortcuts instead of the shortcut + --drive-disable-http2 Disable drive using http2 (default true) + --drive-encoding Encoding The encoding for the backend (default InvalidUtf8) + --drive-env-auth Get IAM credentials from runtime (environment variables or instance meta data if no env vars) + --drive-export-formats string Comma separated list of preferred formats for downloading Google docs (default "docx,xlsx,pptx,svg") + --drive-fast-list-bug-fix Work around a bug in Google Drive listing (default true) + --drive-formats string Deprecated: See export_formats + --drive-impersonate string Impersonate this user when using a service account + --drive-import-formats string Comma separated list of preferred formats for uploading Google docs + --drive-keep-revision-forever Keep new head revision of each file forever + --drive-list-chunk int Size of listing chunk 100-1000, 0 to disable (default 1000) + --drive-metadata-labels Bits Control whether labels should be read or written in metadata (default off) + --drive-metadata-owner Bits Control whether owner should be read or written in metadata (default read) + --drive-metadata-permissions Bits Control whether permissions should be read or written in metadata (default off) + --drive-pacer-burst int Number of API calls to allow without sleeping (default 100) + --drive-pacer-min-sleep Duration Minimum time to sleep between API calls (default 100ms) + --drive-resource-key string Resource key for accessing a link-shared file + --drive-root-folder-id string ID of the root folder + --drive-scope string Comma separated list of scopes that rclone should use when requesting access from drive + --drive-server-side-across-configs Deprecated: use --server-side-across-configs instead + --drive-service-account-credentials string Service Account Credentials JSON blob + --drive-service-account-file string Service Account Credentials JSON file path + --drive-shared-with-me Only show files that are shared with me + --drive-show-all-gdocs Show all Google Docs including non-exportable ones in listings + --drive-size-as-quota Show sizes as storage quota usage, not actual size + --drive-skip-checksum-gphotos Skip checksums on Google photos and videos only + --drive-skip-dangling-shortcuts If set skip dangling shortcut files + --drive-skip-gdocs Skip google documents in all listings + --drive-skip-shortcuts If set skip shortcut files + --drive-starred-only Only show files that are starred + --drive-stop-on-download-limit Make download limit errors be fatal + --drive-stop-on-upload-limit Make upload limit errors be fatal + --drive-team-drive string ID of the Shared Drive (Team Drive) + --drive-token string OAuth Access Token as a JSON blob + --drive-token-url string Token server url + --drive-trashed-only Only show files that are in the trash + --drive-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 8Mi) + --drive-use-created-date Use file created date instead of modified date + --drive-use-shared-date Use date file was shared instead of modified date + --drive-use-trash Send files to the trash instead of deleting permanently (default true) + --drive-v2-download-min-size SizeSuffix If Object's are greater, use drive v2 API to download (default off) + --dropbox-auth-url string Auth server URL + --dropbox-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) + --dropbox-batch-mode string Upload file batching sync|async|off (default "sync") + --dropbox-batch-size int Max number of files in upload batch + --dropbox-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) + --dropbox-chunk-size SizeSuffix Upload chunk size (< 150Mi) (default 48Mi) + --dropbox-client-id string OAuth Client Id + --dropbox-client-secret string OAuth Client Secret + --dropbox-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot) + --dropbox-impersonate string Impersonate this user when using a business account + --dropbox-pacer-min-sleep Duration Minimum time to sleep between API calls (default 10ms) + --dropbox-shared-files Instructs rclone to work on individual shared files + --dropbox-shared-folders Instructs rclone to work on shared folders + --dropbox-token string OAuth Access Token as a JSON blob + --dropbox-token-url string Token server url + --fichier-api-key string Your API Key, get it from https://1fichier.com/console/params.pl + --fichier-cdn Set if you wish to use CDN download links + --fichier-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot) + --fichier-file-password string If you want to download a shared file that is password protected, add this parameter (obscured) + --fichier-folder-password string If you want to list the files in a shared folder that is password protected, add this parameter (obscured) + --fichier-shared-folder string If you want to download a shared folder, add this parameter + --filefabric-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) + --filefabric-permanent-token string Permanent Authentication Token + --filefabric-root-folder-id string ID of the root folder + --filefabric-token string Session Token + --filefabric-token-expiry string Token expiry time + --filefabric-url string URL of the Enterprise File Fabric to connect to + --filefabric-version string Version read from the file fabric + --ftp-ask-password Allow asking for FTP password when needed + --ftp-close-timeout Duration Maximum time to wait for a response to close (default 1m0s) + --ftp-concurrency int Maximum number of FTP simultaneous connections, 0 for unlimited + --ftp-disable-epsv Disable using EPSV even if server advertises support + --ftp-disable-mlsd Disable using MLSD even if server advertises support + --ftp-disable-tls13 Disable TLS 1.3 (workaround for FTP servers with buggy TLS) + --ftp-disable-utf8 Disable using UTF-8 even if server advertises support + --ftp-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,RightSpace,Dot) + --ftp-explicit-tls Use Explicit FTPS (FTP over TLS) + --ftp-force-list-hidden Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD + --ftp-host string FTP host to connect to + --ftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) + --ftp-no-check-certificate Do not verify the TLS certificate of the server + --ftp-pass string FTP password (obscured) + --ftp-port int FTP port number (default 21) + --ftp-shut-timeout Duration Maximum time to wait for data connection closing status (default 1m0s) + --ftp-socks-proxy string Socks 5 proxy host + --ftp-tls Use Implicit FTPS (FTP over TLS) + --ftp-tls-cache-size int Size of TLS session cache for all control and data connections (default 32) + --ftp-user string FTP username (default "$USER") + --ftp-writing-mdtm Use MDTM to set modification time (VsFtpd quirk) + --gcs-anonymous Access public buckets and objects without credentials + --gcs-auth-url string Auth server URL + --gcs-bucket-acl string Access Control List for new buckets + --gcs-bucket-policy-only Access checks should use bucket-level IAM policies + --gcs-client-id string OAuth Client Id + --gcs-client-secret string OAuth Client Secret + --gcs-decompress If set this will decompress gzip encoded objects + --gcs-directory-markers Upload an empty object with a trailing slash when a new directory is created + --gcs-encoding Encoding The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) + --gcs-endpoint string Endpoint for the service + --gcs-env-auth Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars) + --gcs-location string Location for the newly created buckets + --gcs-no-check-bucket If set, don't attempt to check the bucket exists or create it + --gcs-object-acl string Access Control List for new objects + --gcs-project-number string Project number + --gcs-service-account-file string Service Account Credentials JSON file path + --gcs-storage-class string The storage class to use when storing objects in Google Cloud Storage + --gcs-token string OAuth Access Token as a JSON blob + --gcs-token-url string Token server url + --gcs-user-project string User project + --gphotos-auth-url string Auth server URL + --gphotos-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) + --gphotos-batch-mode string Upload file batching sync|async|off (default "sync") + --gphotos-batch-size int Max number of files in upload batch + --gphotos-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) + --gphotos-client-id string OAuth Client Id + --gphotos-client-secret string OAuth Client Secret + --gphotos-encoding Encoding The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) + --gphotos-include-archived Also view and download archived media + --gphotos-read-only Set to make the Google Photos backend read only + --gphotos-read-size Set to read the size of media items + --gphotos-start-year int Year limits the photos to be downloaded to those which are uploaded after the given year (default 2000) + --gphotos-token string OAuth Access Token as a JSON blob + --gphotos-token-url string Token server url + --hasher-auto-size SizeSuffix Auto-update checksum for files smaller than this size (disabled by default) + --hasher-hashes CommaSepList Comma separated list of supported checksum types (default md5,sha1) + --hasher-max-age Duration Maximum time to keep checksums in cache (0 = no cache, off = cache forever) (default off) + --hasher-remote string Remote to cache checksums for (e.g. myRemote:path) --hdfs-data-transfer-protection string Kerberos data transfer protection: authentication|integrity|privacy - --hdfs-encoding MultiEncoder The encoding for the backend (default Slash,Colon,Del,Ctl,InvalidUtf8,Dot) - --hdfs-namenode string Hadoop name node and port + --hdfs-encoding Encoding The encoding for the backend (default Slash,Colon,Del,Ctl,InvalidUtf8,Dot) + --hdfs-namenode CommaSepList Hadoop name nodes and ports --hdfs-service-principal-name string Kerberos service principal name for the namenode --hdfs-username string Hadoop user name --hidrive-auth-url string Auth server URL @@ -17369,7 +18721,7 @@ Backend only flags. These can be set in the config file also. --hidrive-client-id string OAuth Client Id --hidrive-client-secret string OAuth Client Secret --hidrive-disable-fetching-member-count Do not fetch number of objects in directories unless it is absolutely necessary - --hidrive-encoding MultiEncoder The encoding for the backend (default Slash,Dot) + --hidrive-encoding Encoding The encoding for the backend (default Slash,Dot) --hidrive-endpoint string Endpoint for the service (default "https://api.hidrive.strato.com/2.1") --hidrive-root-prefix string The root/parent folder for all paths (default "/") --hidrive-scope-access string Access permissions that rclone should use when requesting access from HiDrive (default "rw") @@ -17382,9 +18734,16 @@ Backend only flags. These can be set in the config file also. --http-no-head Don't use HEAD requests --http-no-slash Set this if the site doesn't end directories with / --http-url string URL of HTTP host to connect to + --imagekit-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Dollar,Question,Hash,Percent,BackSlash,Del,Ctl,InvalidUtf8,Dot,SquareBracket) + --imagekit-endpoint string You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-only-signed Restrict unsigned image URLs If you have configured Restrict unsigned image URLs in your dashboard settings, set this to true + --imagekit-private-key string You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-public-key string You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-upload-tags string Tags to add to the uploaded files, e.g. "tag1,tag2" + --imagekit-versions Include old versions in directory listings --internetarchive-access-key-id string IAS3 Access Key --internetarchive-disable-checksum Don't ask the server to test against MD5 checksum calculated by rclone (default true) - --internetarchive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot) + --internetarchive-encoding Encoding The encoding for the backend (default Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot) --internetarchive-endpoint string IAS3 Endpoint (default "https://s3.us.archive.org") --internetarchive-front-endpoint string Host of InternetArchive Frontend (default "https://archive.org") --internetarchive-secret-access-key string IAS3 Secret Key (password) @@ -17392,7 +18751,7 @@ Backend only flags. These can be set in the config file also. --jottacloud-auth-url string Auth server URL --jottacloud-client-id string OAuth Client Id --jottacloud-client-secret string OAuth Client Secret - --jottacloud-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot) + --jottacloud-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot) --jottacloud-hard-delete Delete files permanently rather than putting them into the trash --jottacloud-md5-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate the MD5 if required (default 10Mi) --jottacloud-no-versions Avoid server side versioning by deleting files and recreating files instead of overwriting them @@ -17400,17 +18759,18 @@ Backend only flags. These can be set in the config file also. --jottacloud-token-url string Token server url --jottacloud-trashed-only Only show files that are in the trash --jottacloud-upload-resume-limit SizeSuffix Files bigger than this can be resumed if the upload fail's (default 10Mi) - --koofr-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --koofr-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) --koofr-endpoint string The Koofr API endpoint to use --koofr-mountid string Mount ID of the mount to use --koofr-password string Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password) (obscured) --koofr-provider string Choose your storage provider --koofr-setmtime Does the backend support setting modification time (default true) --koofr-user string Your user name + --linkbox-token string Token from https://www.linkbox.to/admin/account -l, --links Translate symlinks to/from regular files with a '.rclonelink' extension --local-case-insensitive Force the filesystem to report itself as case insensitive --local-case-sensitive Force the filesystem to report itself as case sensitive - --local-encoding MultiEncoder The encoding for the backend (default Slash,Dot) + --local-encoding Encoding The encoding for the backend (default Slash,Dot) --local-no-check-updated Don't check to see if the files change during upload --local-no-preallocate Disable preallocation of disk space for transferred files --local-no-set-modtime Disable setting modtime @@ -17422,7 +18782,7 @@ Backend only flags. These can be set in the config file also. --mailru-check-hash What should copy do if file checksum is mismatched or invalid (default true) --mailru-client-id string OAuth Client Id --mailru-client-secret string OAuth Client Secret - --mailru-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --mailru-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot) --mailru-pass string Password (obscured) --mailru-speedup-enable Skip full upload if there is another file with same data hash (default true) --mailru-speedup-file-patterns string Comma separated list of file name patterns eligible for speedup (put by hash) (default "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf") @@ -17432,7 +18792,7 @@ Backend only flags. These can be set in the config file also. --mailru-token-url string Token server url --mailru-user string User name (usually email) --mega-debug Output more debug from Mega - --mega-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) + --mega-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) --mega-hard-delete Delete files permanently rather than putting them into the trash --mega-pass string Password (obscured) --mega-use-https Use HTTPS for transfers @@ -17448,9 +18808,10 @@ Backend only flags. These can be set in the config file also. --onedrive-chunk-size SizeSuffix Chunk size to upload files with - must be multiple of 320k (327,680 bytes) (default 10Mi) --onedrive-client-id string OAuth Client Id --onedrive-client-secret string OAuth Client Secret + --onedrive-delta If set rclone will use delta listing to implement recursive listings --onedrive-drive-id string The ID of the drive to use --onedrive-drive-type string The type of the drive (personal | business | documentLibrary) - --onedrive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot) + --onedrive-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot) --onedrive-expose-onenote-files Set to make OneNote files show up in directory listings --onedrive-hash-type string Specify the hash in use for the backend (default "auto") --onedrive-link-password string Set the password for links created by the link command @@ -17471,7 +18832,7 @@ Backend only flags. These can be set in the config file also. --oos-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) --oos-copy-timeout Duration Timeout for copy (default 1m0s) --oos-disable-checksum Don't store MD5 checksum with object metadata - --oos-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) + --oos-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) --oos-endpoint string Endpoint for Object storage API --oos-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts for manual recovery --oos-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) @@ -17488,13 +18849,13 @@ Backend only flags. These can be set in the config file also. --oos-upload-concurrency int Concurrency for multipart uploads (default 10) --oos-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) --opendrive-chunk-size SizeSuffix Files will be uploaded in chunks this size (default 10Mi) - --opendrive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot) + --opendrive-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot) --opendrive-password string Password (obscured) --opendrive-username string Username --pcloud-auth-url string Auth server URL --pcloud-client-id string OAuth Client Id --pcloud-client-secret string OAuth Client Secret - --pcloud-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --pcloud-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) --pcloud-hostname string Hostname to connect to (default "api.pcloud.com") --pcloud-password string Your pcloud password (obscured) --pcloud-root-folder-id string Fill in for rclone to use a non root folder as its starting point (default "d0") @@ -17504,7 +18865,7 @@ Backend only flags. These can be set in the config file also. --pikpak-auth-url string Auth server URL --pikpak-client-id string OAuth Client Id --pikpak-client-secret string OAuth Client Secret - --pikpak-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot) + --pikpak-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot) --pikpak-hash-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate hash if required (default 10Mi) --pikpak-pass string Pikpak password (obscured) --pikpak-root-folder-id string ID of the root folder @@ -17516,13 +18877,13 @@ Backend only flags. These can be set in the config file also. --premiumizeme-auth-url string Auth server URL --premiumizeme-client-id string OAuth Client Id --premiumizeme-client-secret string OAuth Client Secret - --premiumizeme-encoding MultiEncoder The encoding for the backend (default Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --premiumizeme-encoding Encoding The encoding for the backend (default Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot) --premiumizeme-token string OAuth Access Token as a JSON blob --premiumizeme-token-url string Token server url --protondrive-2fa string The 2FA code --protondrive-app-version string The app version string (default "macos-drive@1.0.0-alpha.1+rclone") --protondrive-enable-caching Caches the files and folders metadata to reduce API calls (default true) - --protondrive-encoding MultiEncoder The encoding for the backend (default Slash,LeftSpace,RightSpace,InvalidUtf8,Dot) + --protondrive-encoding Encoding The encoding for the backend (default Slash,LeftSpace,RightSpace,InvalidUtf8,Dot) --protondrive-mailbox-password string The mailbox password of your two-password proton account (obscured) --protondrive-original-file-size Return the file size before encryption (default true) --protondrive-password string The password of your proton account (obscured) @@ -17531,13 +18892,13 @@ Backend only flags. These can be set in the config file also. --putio-auth-url string Auth server URL --putio-client-id string OAuth Client Id --putio-client-secret string OAuth Client Secret - --putio-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --putio-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) --putio-token string OAuth Access Token as a JSON blob --putio-token-url string Token server url --qingstor-access-key-id string QingStor Access Key ID --qingstor-chunk-size SizeSuffix Chunk size to use for uploading (default 4Mi) --qingstor-connection-retries int Number of connection retries (default 3) - --qingstor-encoding MultiEncoder The encoding for the backend (default Slash,Ctl,InvalidUtf8) + --qingstor-encoding Encoding The encoding for the backend (default Slash,Ctl,InvalidUtf8) --qingstor-endpoint string Enter an endpoint URL to connection QingStor API --qingstor-env-auth Get QingStor credentials from runtime --qingstor-secret-access-key string QingStor Secret Access Key (password) @@ -17546,7 +18907,7 @@ Backend only flags. These can be set in the config file also. --qingstor-zone string Zone to connect to --quatrix-api-key string API key for accessing Quatrix account --quatrix-effective-upload-time string Wanted upload time for one chunk (default "4s") - --quatrix-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --quatrix-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) --quatrix-hard-delete Delete files permanently rather than putting them into the trash --quatrix-host string Host name of Quatrix account --quatrix-maximal-summary-chunk-size SizeSuffix The maximal summary for all chunks. It should not be less than 'transfers'*'minimal_chunk_size' (default 95.367Mi) @@ -17561,7 +18922,7 @@ Backend only flags. These can be set in the config file also. --s3-disable-checksum Don't store MD5 checksum with object metadata --s3-disable-http2 Disable usage of http2 for S3 backends --s3-download-url string Custom endpoint for downloads - --s3-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) + --s3-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) --s3-endpoint string Endpoint for S3 API --s3-env-auth Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars) --s3-force-path-style If true use path style access if false use virtual hosted style (default true) @@ -17595,14 +18956,16 @@ Backend only flags. These can be set in the config file also. --s3-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) --s3-use-accelerate-endpoint If true use the AWS S3 accelerated endpoint --s3-use-accept-encoding-gzip Accept-Encoding: gzip Whether to send Accept-Encoding: gzip header (default unset) + --s3-use-already-exists Tristate Set if rclone should report BucketAlreadyExists errors on bucket creation (default unset) --s3-use-multipart-etag Tristate Whether to use ETag in multipart uploads for verification (default unset) + --s3-use-multipart-uploads Tristate Set if rclone should use multipart uploads (default unset) --s3-use-presigned-request Whether to use a presigned request or PutObject for single part uploads --s3-v2-auth If true use v2 authentication --s3-version-at Time Show file versions as they were at the specified time (default off) --s3-versions Include old versions in directory listings --seafile-2fa Two-factor authentication ('true' if the account has 2FA enabled) --seafile-create-library Should rclone create a library if it doesn't exist - --seafile-encoding MultiEncoder The encoding for the backend (default Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8) + --seafile-encoding Encoding The encoding for the backend (default Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8) --seafile-library string Name of the library --seafile-library-key string Library password (for encrypted libraries only) (obscured) --seafile-pass string Password (obscured) @@ -17612,6 +18975,7 @@ Backend only flags. These can be set in the config file also. --sftp-chunk-size SizeSuffix Upload and download chunk size (default 32Ki) --sftp-ciphers SpaceSepList Space separated list of ciphers to be used for session encryption, ordered by preference --sftp-concurrency int The maximum number of outstanding requests for one file (default 64) + --sftp-copy-is-hardlink Set to enable server side copies using hardlinks --sftp-disable-concurrent-reads If set don't use concurrent reads --sftp-disable-concurrent-writes If set don't use concurrent writes --sftp-disable-hashcheck Disable the execution of SSH commands to determine if remote file hashing is available @@ -17646,7 +19010,7 @@ Backend only flags. These can be set in the config file also. --sharefile-chunk-size SizeSuffix Upload chunk size (default 64Mi) --sharefile-client-id string OAuth Client Id --sharefile-client-secret string OAuth Client Secret - --sharefile-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot) + --sharefile-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot) --sharefile-endpoint string Endpoint for API calls --sharefile-root-folder-id string ID of the root folder --sharefile-token string OAuth Access Token as a JSON blob @@ -17654,12 +19018,12 @@ Backend only flags. These can be set in the config file also. --sharefile-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (default 128Mi) --sia-api-password string Sia Daemon API Password (obscured) --sia-api-url string Sia daemon API URL, like http://sia.daemon.host:9980 (default "http://127.0.0.1:9980") - --sia-encoding MultiEncoder The encoding for the backend (default Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot) + --sia-encoding Encoding The encoding for the backend (default Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot) --sia-user-agent string Siad User Agent (default "Sia-Agent") --skip-links Don't warn about skipped symlinks --smb-case-insensitive Whether the server is configured to be case-insensitive (default true) --smb-domain string Domain name for NTLM authentication (default "WORKGROUP") - --smb-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot) + --smb-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot) --smb-hide-special-share Hide special shares (e.g. print$) which users aren't supposed to access (default true) --smb-host string SMB server hostname to connect to --smb-idle-timeout Duration Max time before closing idle connections (default 1m0s) @@ -17677,7 +19041,7 @@ Backend only flags. These can be set in the config file also. --sugarsync-authorization string Sugarsync authorization --sugarsync-authorization-expiry string Sugarsync authorization expiry --sugarsync-deleted-id string Sugarsync deleted folder id - --sugarsync-encoding MultiEncoder The encoding for the backend (default Slash,Ctl,InvalidUtf8,Dot) + --sugarsync-encoding Encoding The encoding for the backend (default Slash,Ctl,InvalidUtf8,Dot) --sugarsync-hard-delete Permanently delete files if true --sugarsync-private-access-key string Sugarsync Private Access Key --sugarsync-refresh-token string Sugarsync refresh token @@ -17691,7 +19055,7 @@ Backend only flags. These can be set in the config file also. --swift-auth-version int AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION) --swift-chunk-size SizeSuffix Above this size files will be chunked into a _segments container (default 5Gi) --swift-domain string User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME) - --swift-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8) + --swift-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8) --swift-endpoint-type string Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE) (default "public") --swift-env-auth Get swift credentials from environment variables in standard OpenStack form --swift-key string API key or password (OS_PASSWORD) @@ -17713,7 +19077,7 @@ Backend only flags. These can be set in the config file also. --union-search-policy string Policy to choose upstream on SEARCH category (default "ff") --union-upstreams string List of space separated upstreams --uptobox-access-token string Your access token - --uptobox-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot) + --uptobox-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot) --uptobox-private Set to make uploaded files private --webdav-bearer-token string Bearer token instead of user/pass (e.g. a Macaroon) --webdav-bearer-token-command string Command to run to get a bearer token @@ -17728,9421 +19092,10046 @@ Backend only flags. These can be set in the config file also. --yandex-auth-url string Auth server URL --yandex-client-id string OAuth Client Id --yandex-client-secret string OAuth Client Secret - --yandex-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) + --yandex-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) --yandex-hard-delete Delete files permanently rather than putting them into the trash --yandex-token string OAuth Access Token as a JSON blob --yandex-token-url string Token server url --zoho-auth-url string Auth server URL --zoho-client-id string OAuth Client Id --zoho-client-secret string OAuth Client Secret - --zoho-encoding MultiEncoder The encoding for the backend (default Del,Ctl,InvalidUtf8) + --zoho-encoding Encoding The encoding for the backend (default Del,Ctl,InvalidUtf8) --zoho-region string Zoho region to connect to --zoho-token string OAuth Access Token as a JSON blob --zoho-token-url string Token server url ``` -# Docker Volume Plugin +# Docker Volume Plugin + +## Introduction + +Docker 1.9 has added support for creating +[named volumes](https://docs.docker.com/storage/volumes/) via +[command-line interface](https://docs.docker.com/engine/reference/commandline/volume_create/) +and mounting them in containers as a way to share data between them. +Since Docker 1.10 you can create named volumes with +[Docker Compose](https://docs.docker.com/compose/) by descriptions in +[docker-compose.yml](https://docs.docker.com/compose/compose-file/compose-file-v2/#volume-configuration-reference) +files for use by container groups on a single host. +As of Docker 1.12 volumes are supported by +[Docker Swarm](https://docs.docker.com/engine/swarm/key-concepts/) +included with Docker Engine and created from descriptions in +[swarm compose v3](https://docs.docker.com/compose/compose-file/compose-file-v3/#volume-configuration-reference) +files for use with _swarm stacks_ across multiple cluster nodes. + +[Docker Volume Plugins](https://docs.docker.com/engine/extend/plugins_volume/) +augment the default `local` volume driver included in Docker with stateful +volumes shared across containers and hosts. Unlike local volumes, your +data will _not_ be deleted when such volume is removed. Plugins can run +managed by the docker daemon, as a native system service +(under systemd, _sysv_ or _upstart_) or as a standalone executable. +Rclone can run as docker volume plugin in all these modes. +It interacts with the local docker daemon +via [plugin API](https://docs.docker.com/engine/extend/plugin_api/) and +handles mounting of remote file systems into docker containers so it must +run on the same host as the docker daemon or on every Swarm node. + +## Getting started + +In the first example we will use the [SFTP](https://rclone.org/sftp/) +rclone volume with Docker engine on a standalone Ubuntu machine. + +Start from [installing Docker](https://docs.docker.com/engine/install/) +on the host. + +The _FUSE_ driver is a prerequisite for rclone mounting and should be +installed on host: +``` +sudo apt-get -y install fuse +``` + +Create two directories required by rclone docker plugin: +``` +sudo mkdir -p /var/lib/docker-plugins/rclone/config +sudo mkdir -p /var/lib/docker-plugins/rclone/cache +``` + +Install the managed rclone docker plugin for your architecture (here `amd64`): +``` +docker plugin install rclone/docker-volume-rclone:amd64 args="-v" --alias rclone --grant-all-permissions +docker plugin list +``` + +Create your [SFTP volume](https://rclone.org/sftp/#standard-options): +``` +docker volume create firstvolume -d rclone -o type=sftp -o sftp-host=_hostname_ -o sftp-user=_username_ -o sftp-pass=_password_ -o allow-other=true +``` + +Note that since all options are static, you don't even have to run +`rclone config` or create the `rclone.conf` file (but the `config` directory +should still be present). In the simplest case you can use `localhost` +as _hostname_ and your SSH credentials as _username_ and _password_. +You can also change the remote path to your home directory on the host, +for example `-o path=/home/username`. + + +Time to create a test container and mount the volume into it: +``` +docker run --rm -it -v firstvolume:/mnt --workdir /mnt ubuntu:latest bash +``` + +If all goes well, you will enter the new container and change right to +the mounted SFTP remote. You can type `ls` to list the mounted directory +or otherwise play with it. Type `exit` when you are done. +The container will stop but the volume will stay, ready to be reused. +When it's not needed anymore, remove it: +``` +docker volume list +docker volume remove firstvolume +``` + +Now let us try **something more elaborate**: +[Google Drive](https://rclone.org/drive/) volume on multi-node Docker Swarm. + +You should start from installing Docker and FUSE, creating plugin +directories and installing rclone plugin on _every_ swarm node. +Then [setup the Swarm](https://docs.docker.com/engine/swarm/swarm-mode/). + +Google Drive volumes need an access token which can be setup via web +browser and will be periodically renewed by rclone. The managed +plugin cannot run a browser so we will use a technique similar to the +[rclone setup on a headless box](https://rclone.org/remote_setup/). + +Run [rclone config](https://rclone.org/commands/rclone_config_create/) +on _another_ machine equipped with _web browser_ and graphical user interface. +Create the [Google Drive remote](https://rclone.org/drive/#standard-options). +When done, transfer the resulting `rclone.conf` to the Swarm cluster +and save as `/var/lib/docker-plugins/rclone/config/rclone.conf` +on _every_ node. By default this location is accessible only to the +root user so you will need appropriate privileges. The resulting config +will look like this: +``` +[gdrive] +type = drive +scope = drive +drive_id = 1234567... +root_folder_id = 0Abcd... +token = {"access_token":...} +``` + +Now create the file named `example.yml` with a swarm stack description +like this: +``` +version: '3' +services: + heimdall: + image: linuxserver/heimdall:latest + ports: [8080:80] + volumes: [configdata:/config] +volumes: + configdata: + driver: rclone + driver_opts: + remote: 'gdrive:heimdall' + allow_other: 'true' + vfs_cache_mode: full + poll_interval: 0 +``` + +and run the stack: +``` +docker stack deploy example -c ./example.yml +``` + +After a few seconds docker will spread the parsed stack description +over cluster, create the `example_heimdall` service on port _8080_, +run service containers on one or more cluster nodes and request +the `example_configdata` volume from rclone plugins on the node hosts. +You can use the following commands to confirm results: +``` +docker service ls +docker service ps example_heimdall +docker volume ls +``` + +Point your browser to `http://cluster.host.address:8080` and play with +the service. Stop it with `docker stack remove example` when you are done. +Note that the `example_configdata` volume(s) created on demand at the +cluster nodes will not be automatically removed together with the stack +but stay for future reuse. You can remove them manually by invoking +the `docker volume remove example_configdata` command on every node. + +## Creating Volumes via CLI + +Volumes can be created with [docker volume create](https://docs.docker.com/engine/reference/commandline/volume_create/). +Here are a few examples: +``` +docker volume create vol1 -d rclone -o remote=storj: -o vfs-cache-mode=full +docker volume create vol2 -d rclone -o remote=:storj,access_grant=xxx:heimdall +docker volume create vol3 -d rclone -o type=storj -o path=heimdall -o storj-access-grant=xxx -o poll-interval=0 +``` + +Note the `-d rclone` flag that tells docker to request volume from the +rclone driver. This works even if you installed managed driver by its full +name `rclone/docker-volume-rclone` because you provided the `--alias rclone` +option. + +Volumes can be inspected as follows: +``` +docker volume list +docker volume inspect vol1 +``` + +## Volume Configuration + +Rclone flags and volume options are set via the `-o` flag to the +`docker volume create` command. They include backend-specific parameters +as well as mount and _VFS_ options. Also there are a few +special `-o` options: +`remote`, `fs`, `type`, `path`, `mount-type` and `persist`. + +`remote` determines an existing remote name from the config file, with +trailing colon and optionally with a remote path. See the full syntax in +the [rclone documentation](https://rclone.org/docs/#syntax-of-remote-paths). +This option can be aliased as `fs` to prevent confusion with the +_remote_ parameter of such backends as _crypt_ or _alias_. + +The `remote=:backend:dir/subdir` syntax can be used to create +[on-the-fly (config-less) remotes](https://rclone.org/docs/#backend-path-to-dir), +while the `type` and `path` options provide a simpler alternative for this. +Using two split options +``` +-o type=backend -o path=dir/subdir +``` +is equivalent to the combined syntax +``` +-o remote=:backend:dir/subdir +``` +but is arguably easier to parameterize in scripts. +The `path` part is optional. + +[Mount and VFS options](https://rclone.org/commands/rclone_serve_docker/#options) +as well as [backend parameters](https://rclone.org/flags/#backend-flags) are named +like their twin command-line flags without the `--` CLI prefix. +Optionally you can use underscores instead of dashes in option names. +For example, `--vfs-cache-mode full` becomes +`-o vfs-cache-mode=full` or `-o vfs_cache_mode=full`. +Boolean CLI flags without value will gain the `true` value, e.g. +`--allow-other` becomes `-o allow-other=true` or `-o allow_other=true`. + +Please note that you can provide parameters only for the backend immediately +referenced by the backend type of mounted `remote`. +If this is a wrapping backend like _alias, chunker or crypt_, you cannot +provide options for the referred to remote or backend. This limitation is +imposed by the rclone connection string parser. The only workaround is to +feed plugin with `rclone.conf` or configure plugin arguments (see below). + +## Special Volume Options + +`mount-type` determines the mount method and in general can be one of: +`mount`, `cmount`, or `mount2`. This can be aliased as `mount_type`. +It should be noted that the managed rclone docker plugin currently does +not support the `cmount` method and `mount2` is rarely needed. +This option defaults to the first found method, which is usually `mount` +so you generally won't need it. + +`persist` is a reserved boolean (true/false) option. +In future it will allow to persist on-the-fly remotes in the plugin +`rclone.conf` file. + +## Connection Strings + +The `remote` value can be extended +with [connection strings](https://rclone.org/docs/#connection-strings) +as an alternative way to supply backend parameters. This is equivalent +to the `-o` backend options with one _syntactic difference_. +Inside connection string the backend prefix must be dropped from parameter +names but in the `-o param=value` array it must be present. +For instance, compare the following option array +``` +-o remote=:sftp:/home -o sftp-host=localhost +``` +with equivalent connection string: +``` +-o remote=:sftp,host=localhost:/home +``` +This difference exists because flag options `-o key=val` include not only +backend parameters but also mount/VFS flags and possibly other settings. +Also it allows to discriminate the `remote` option from the `crypt-remote` +(or similarly named backend parameters) and arguably simplifies scripting +due to clearer value substitution. + +## Using with Swarm or Compose + +Both _Docker Swarm_ and _Docker Compose_ use +[YAML](http://yaml.org/spec/1.2/spec.html)-formatted text files to describe +groups (stacks) of containers, their properties, networks and volumes. +_Compose_ uses the [compose v2](https://docs.docker.com/compose/compose-file/compose-file-v2/#volume-configuration-reference) format, +_Swarm_ uses the [compose v3](https://docs.docker.com/compose/compose-file/compose-file-v3/#volume-configuration-reference) format. +They are mostly similar, differences are explained in the +[docker documentation](https://docs.docker.com/compose/compose-file/compose-versioning/#upgrading). + +Volumes are described by the children of the top-level `volumes:` node. +Each of them should be named after its volume and have at least two +elements, the self-explanatory `driver: rclone` value and the +`driver_opts:` structure playing the same role as `-o key=val` CLI flags: + +``` +volumes: + volume_name_1: + driver: rclone + driver_opts: + remote: 'gdrive:' + allow_other: 'true' + vfs_cache_mode: full + token: '{"type": "borrower", "expires": "2021-12-31"}' + poll_interval: 0 +``` + +Notice a few important details: +- YAML prefers `_` in option names instead of `-`. +- YAML treats single and double quotes interchangeably. + Simple strings and integers can be left unquoted. +- Boolean values must be quoted like `'true'` or `"false"` because + these two words are reserved by YAML. +- The filesystem string is keyed with `remote` (or with `fs`). + Normally you can omit quotes here, but if the string ends with colon, + you **must** quote it like `remote: "storage_box:"`. +- YAML is picky about surrounding braces in values as this is in fact + another [syntax for key/value mappings](http://yaml.org/spec/1.2/spec.html#id2790832). + For example, JSON access tokens usually contain double quotes and + surrounding braces, so you must put them in single quotes. + +## Installing as Managed Plugin + +Docker daemon can install plugins from an image registry and run them managed. +We maintain the +[docker-volume-rclone](https://hub.docker.com/p/rclone/docker-volume-rclone/) +plugin image on [Docker Hub](https://hub.docker.com). + +Rclone volume plugin requires **Docker Engine >= 19.03.15** + +The plugin requires presence of two directories on the host before it can +be installed. Note that plugin will **not** create them automatically. +By default they must exist on host at the following locations +(though you can tweak the paths): +- `/var/lib/docker-plugins/rclone/config` + is reserved for the `rclone.conf` config file and **must** exist + even if it's empty and the config file is not present. +- `/var/lib/docker-plugins/rclone/cache` + holds the plugin state file as well as optional VFS caches. + +You can [install managed plugin](https://docs.docker.com/engine/reference/commandline/plugin_install/) +with default settings as follows: +``` +docker plugin install rclone/docker-volume-rclone:amd64 --grant-all-permissions --alias rclone +``` + +The `:amd64` part of the image specification after colon is called a _tag_. +Usually you will want to install the latest plugin for your architecture. In +this case the tag will just name it, like `amd64` above. The following plugin +architectures are currently available: +- `amd64` +- `arm64` +- `arm-v7` + +Sometimes you might want a concrete plugin version, not the latest one. +Then you should use image tag in the form `:ARCHITECTURE-VERSION`. +For example, to install plugin version `v1.56.2` on architecture `arm64` +you will use tag `arm64-1.56.2` (note the removed `v`) so the full image +specification becomes `rclone/docker-volume-rclone:arm64-1.56.2`. + +We also provide the `latest` plugin tag, but since docker does not support +multi-architecture plugins as of the time of this writing, this tag is +currently an **alias for `amd64`**. +By convention the `latest` tag is the default one and can be omitted, thus +both `rclone/docker-volume-rclone:latest` and just `rclone/docker-volume-rclone` +will refer to the latest plugin release for the `amd64` platform. + +Also the `amd64` part can be omitted from the versioned rclone plugin tags. +For example, rclone image reference `rclone/docker-volume-rclone:amd64-1.56.2` +can be abbreviated as `rclone/docker-volume-rclone:1.56.2` for convenience. +However, for non-intel architectures you still have to use the full tag as +`amd64` or `latest` will fail to start. + +Managed plugin is in fact a special container running in a namespace separate +from normal docker containers. Inside it runs the `rclone serve docker` +command. The config and cache directories are bind-mounted into the +container at start. The docker daemon connects to a unix socket created +by the command inside the container. The command creates on-demand remote +mounts right inside, then docker machinery propagates them through kernel +mount namespaces and bind-mounts into requesting user containers. + +You can tweak a few plugin settings after installation when it's disabled +(not in use), for instance: +``` +docker plugin disable rclone +docker plugin set rclone RCLONE_VERBOSE=2 config=/etc/rclone args="--vfs-cache-mode=writes --allow-other" +docker plugin enable rclone +docker plugin inspect rclone +``` + +Note that if docker refuses to disable the plugin, you should find and +remove all active volumes connected with it as well as containers and +swarm services that use them. This is rather tedious so please carefully +plan in advance. + +You can tweak the following settings: +`args`, `config`, `cache`, `HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY` +and `RCLONE_VERBOSE`. +It's _your_ task to keep plugin settings in sync across swarm cluster nodes. + +`args` sets command-line arguments for the `rclone serve docker` command +(_none_ by default). Arguments should be separated by space so you will +normally want to put them in quotes on the +[docker plugin set](https://docs.docker.com/engine/reference/commandline/plugin_set/) +command line. Both [serve docker flags](https://rclone.org/commands/rclone_serve_docker/#options) +and [generic rclone flags](https://rclone.org/flags/) are supported, including backend +parameters that will be used as defaults for volume creation. +Note that plugin will fail (due to [this docker bug](https://github.com/moby/moby/blob/v20.10.7/plugin/v2/plugin.go#L195)) +if the `args` value is empty. Use e.g. `args="-v"` as a workaround. + +`config=/host/dir` sets alternative host location for the config directory. +Plugin will look for `rclone.conf` here. It's not an error if the config +file is not present but the directory must exist. Please note that plugin +can periodically rewrite the config file, for example when it renews +storage access tokens. Keep this in mind and try to avoid races between +the plugin and other instances of rclone on the host that might try to +change the config simultaneously resulting in corrupted `rclone.conf`. +You can also put stuff like private key files for SFTP remotes in this +directory. Just note that it's bind-mounted inside the plugin container +at the predefined path `/data/config`. For example, if your key file is +named `sftp-box1.key` on the host, the corresponding volume config option +should read `-o sftp-key-file=/data/config/sftp-box1.key`. + +`cache=/host/dir` sets alternative host location for the _cache_ directory. +The plugin will keep VFS caches here. Also it will create and maintain +the `docker-plugin.state` file in this directory. When the plugin is +restarted or reinstalled, it will look in this file to recreate any volumes +that existed previously. However, they will not be re-mounted into +consuming containers after restart. Usually this is not a problem as +the docker daemon normally will restart affected user containers after +failures, daemon restarts or host reboots. + +`RCLONE_VERBOSE` sets plugin verbosity from `0` (errors only, by default) +to `2` (debugging). Verbosity can be also tweaked via `args="-v [-v] ..."`. +Since arguments are more generic, you will rarely need this setting. +The plugin output by default feeds the docker daemon log on local host. +Log entries are reflected as _errors_ in the docker log but retain their +actual level assigned by rclone in the encapsulated message string. + +`HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY` customize the plugin proxy settings. + +You can set custom plugin options right when you install it, _in one go_: +``` +docker plugin remove rclone +docker plugin install rclone/docker-volume-rclone:amd64 \ + --alias rclone --grant-all-permissions \ + args="-v --allow-other" config=/etc/rclone +docker plugin inspect rclone +``` + +## Healthchecks + +The docker plugin volume protocol doesn't provide a way for plugins +to inform the docker daemon that a volume is (un-)available. +As a workaround you can setup a healthcheck to verify that the mount +is responding, for example: +``` +services: + my_service: + image: my_image + healthcheck: + test: ls /path/to/rclone/mount || exit 1 + interval: 1m + timeout: 15s + retries: 3 + start_period: 15s +``` + +## Running Plugin under Systemd + +In most cases you should prefer managed mode. Moreover, MacOS and Windows +do not support native Docker plugins. Please use managed mode on these +systems. Proceed further only if you are on Linux. + +First, [install rclone](https://rclone.org/install/). +You can just run it (type `rclone serve docker` and hit enter) for the test. + +Install _FUSE_: +``` +sudo apt-get -y install fuse +``` + +Download two systemd configuration files: +[docker-volume-rclone.service](https://raw.githubusercontent.com/rclone/rclone/master/contrib/docker-plugin/systemd/docker-volume-rclone.service) +and [docker-volume-rclone.socket](https://raw.githubusercontent.com/rclone/rclone/master/contrib/docker-plugin/systemd/docker-volume-rclone.socket). + +Put them to the `/etc/systemd/system/` directory: +``` +cp docker-volume-plugin.service /etc/systemd/system/ +cp docker-volume-plugin.socket /etc/systemd/system/ +``` + +Please note that all commands in this section must be run as _root_ but +we omit `sudo` prefix for brevity. +Now create directories required by the service: +``` +mkdir -p /var/lib/docker-volumes/rclone +mkdir -p /var/lib/docker-plugins/rclone/config +mkdir -p /var/lib/docker-plugins/rclone/cache +``` + +Run the docker plugin service in the socket activated mode: +``` +systemctl daemon-reload +systemctl start docker-volume-rclone.service +systemctl enable docker-volume-rclone.socket +systemctl start docker-volume-rclone.socket +systemctl restart docker +``` + +Or run the service directly: +- run `systemctl daemon-reload` to let systemd pick up new config +- run `systemctl enable docker-volume-rclone.service` to make the new + service start automatically when you power on your machine. +- run `systemctl start docker-volume-rclone.service` + to start the service now. +- run `systemctl restart docker` to restart docker daemon and let it + detect the new plugin socket. Note that this step is not needed in + managed mode where docker knows about plugin state changes. + +The two methods are equivalent from the user perspective, but I personally +prefer socket activation. + +## Troubleshooting + +You can [see managed plugin settings](https://docs.docker.com/engine/extend/#debugging-plugins) +with +``` +docker plugin list +docker plugin inspect rclone +``` +Note that docker (including latest 20.10.7) will not show actual values +of `args`, just the defaults. + +Use `journalctl --unit docker` to see managed plugin output as part of +the docker daemon log. Note that docker reflects plugin lines as _errors_ +but their actual level can be seen from encapsulated message string. + +You will usually install the latest version of managed plugin for your platform. +Use the following commands to print the actual installed version: +``` +PLUGID=$(docker plugin list --no-trunc | awk '/rclone/{print$1}') +sudo runc --root /run/docker/runtime-runc/plugins.moby exec $PLUGID rclone version +``` + +You can even use `runc` to run shell inside the plugin container: +``` +sudo runc --root /run/docker/runtime-runc/plugins.moby exec --tty $PLUGID bash +``` + +Also you can use curl to check the plugin socket connectivity: +``` +docker plugin list --no-trunc +PLUGID=123abc... +sudo curl -H Content-Type:application/json -XPOST -d {} --unix-socket /run/docker/plugins/$PLUGID/rclone.sock http://localhost/Plugin.Activate +``` +though this is rarely needed. + +## Caveats + +Finally I'd like to mention a _caveat with updating volume settings_. +Docker CLI does not have a dedicated command like `docker volume update`. +It may be tempting to invoke `docker volume create` with updated options +on existing volume, but there is a gotcha. The command will do nothing, +it won't even return an error. I hope that docker maintainers will fix +this some day. In the meantime be aware that you must remove your volume +before recreating it with new settings: +``` +docker volume remove my_vol +docker volume create my_vol -d rclone -o opt1=new_val1 ... +``` + +and verify that settings did update: +``` +docker volume list +docker volume inspect my_vol +``` + +If docker refuses to remove the volume, you should find containers +or swarm services that use it and stop them first. + +## Getting started {#getting-started} + +- [Install rclone](https://rclone.org/install/) and setup your remotes. +- Bisync will create its working directory + at `~/.cache/rclone/bisync` on Linux + or `C:\Users\MyLogin\AppData\Local\rclone\bisync` on Windows. + Make sure that this location is writable. +- Run bisync with the `--resync` flag, specifying the paths + to the local and remote sync directory roots. +- For successive sync runs, leave off the `--resync` flag. +- Consider using a [filters file](#filtering) for excluding + unnecessary files and directories from the sync. +- Consider setting up the [--check-access](#check-access) feature + for safety. +- On Linux, consider setting up a [crontab entry](#cron). bisync can + safely run in concurrent cron jobs thanks to lock files it maintains. + +Here is a typical run log (with timestamps removed for clarity): + +``` +rclone bisync /testdir/path1/ /testdir/path2/ --verbose +INFO : Synching Path1 "/testdir/path1/" with Path2 "/testdir/path2/" +INFO : Path1 checking for diffs +INFO : - Path1 File is new - file11.txt +INFO : - Path1 File is newer - file2.txt +INFO : - Path1 File is newer - file5.txt +INFO : - Path1 File is newer - file7.txt +INFO : - Path1 File was deleted - file4.txt +INFO : - Path1 File was deleted - file6.txt +INFO : - Path1 File was deleted - file8.txt +INFO : Path1: 7 changes: 1 new, 3 newer, 0 older, 3 deleted +INFO : Path2 checking for diffs +INFO : - Path2 File is new - file10.txt +INFO : - Path2 File is newer - file1.txt +INFO : - Path2 File is newer - file5.txt +INFO : - Path2 File is newer - file6.txt +INFO : - Path2 File was deleted - file3.txt +INFO : - Path2 File was deleted - file7.txt +INFO : - Path2 File was deleted - file8.txt +INFO : Path2: 7 changes: 1 new, 3 newer, 0 older, 3 deleted +INFO : Applying changes +INFO : - Path1 Queue copy to Path2 - /testdir/path2/file11.txt +INFO : - Path1 Queue copy to Path2 - /testdir/path2/file2.txt +INFO : - Path2 Queue delete - /testdir/path2/file4.txt +NOTICE: - WARNING New or changed in both paths - file5.txt +NOTICE: - Path1 Renaming Path1 copy - /testdir/path1/file5.txt..path1 +NOTICE: - Path1 Queue copy to Path2 - /testdir/path2/file5.txt..path1 +NOTICE: - Path2 Renaming Path2 copy - /testdir/path2/file5.txt..path2 +NOTICE: - Path2 Queue copy to Path1 - /testdir/path1/file5.txt..path2 +INFO : - Path2 Queue copy to Path1 - /testdir/path1/file6.txt +INFO : - Path1 Queue copy to Path2 - /testdir/path2/file7.txt +INFO : - Path2 Queue copy to Path1 - /testdir/path1/file1.txt +INFO : - Path2 Queue copy to Path1 - /testdir/path1/file10.txt +INFO : - Path1 Queue delete - /testdir/path1/file3.txt +INFO : - Path2 Do queued copies to - Path1 +INFO : - Path1 Do queued copies to - Path2 +INFO : - Do queued deletes on - Path1 +INFO : - Do queued deletes on - Path2 +INFO : Updating listings +INFO : Validating listings for Path1 "/testdir/path1/" vs Path2 "/testdir/path2/" +INFO : Bisync successful +``` + +## Command line syntax + +``` +$ rclone bisync --help +Usage: + rclone bisync remote1:path1 remote2:path2 [flags] + +Positional arguments: + Path1, Path2 Local path, or remote storage with ':' plus optional path. + Type 'rclone listremotes' for list of configured remotes. + +Optional Flags: + --check-access Ensure expected `RCLONE_TEST` files are found on + both Path1 and Path2 filesystems, else abort. + --check-filename FILENAME Filename for `--check-access` (default: `RCLONE_TEST`) + --check-sync CHOICE Controls comparison of final listings: + `true | false | only` (default: true) + If set to `only`, bisync will only compare listings + from the last run but skip actual sync. + --filters-file PATH Read filtering patterns from a file + --max-delete PERCENT Safety check on maximum percentage of deleted files allowed. + If exceeded, the bisync run will abort. (default: 50%) + --force Bypass `--max-delete` safety check and run the sync. + Consider using with `--verbose` + --create-empty-src-dirs Sync creation and deletion of empty directories. + (Not compatible with --remove-empty-dirs) + --remove-empty-dirs Remove empty directories at the final cleanup step. + -1, --resync Performs the resync run. + Warning: Path1 files may overwrite Path2 versions. + Consider using `--verbose` or `--dry-run` first. + --ignore-listing-checksum Do not use checksums for listings + (add --ignore-checksum to additionally skip post-copy checksum checks) + --resilient Allow future runs to retry after certain less-serious errors, + instead of requiring --resync. Use at your own risk! + --localtime Use local time in listings (default: UTC) + --no-cleanup Retain working files (useful for troubleshooting and testing). + --workdir PATH Use custom working directory (useful for testing). + (default: `~/.cache/rclone/bisync`) + -n, --dry-run Go through the motions - No files are copied/deleted. + -v, --verbose Increases logging verbosity. + May be specified more than once for more details. + -h, --help help for bisync +``` + +Arbitrary rclone flags may be specified on the +[bisync command line](https://rclone.org/commands/rclone_bisync/), for example +`rclone bisync ./testdir/path1/ gdrive:testdir/path2/ --drive-skip-gdocs -v -v --timeout 10s` +Note that interactions of various rclone flags with bisync process flow +has not been fully tested yet. + +### Paths + +Path1 and Path2 arguments may be references to any mix of local directory +paths (absolute or relative), UNC paths (`//server/share/path`), +Windows drive paths (with a drive letter and `:`) or configured +[remotes](https://rclone.org/docs/#syntax-of-remote-paths) with optional subdirectory paths. +Cloud references are distinguished by having a `:` in the argument +(see [Windows support](#windows) below). + +Path1 and Path2 are treated equally, in that neither has priority for +file changes (except during [`--resync`](#resync)), and access efficiency does not change whether a remote +is on Path1 or Path2. + +The listings in bisync working directory (default: `~/.cache/rclone/bisync`) +are named based on the Path1 and Path2 arguments so that separate syncs +to individual directories within the tree may be set up, e.g.: +`path_to_local_tree..dropbox_subdir.lst`. + +Any empty directories after the sync on both the Path1 and Path2 +filesystems are not deleted by default, unless `--create-empty-src-dirs` is specified. +If the `--remove-empty-dirs` flag is specified, then both paths will have ALL empty directories purged +as the last step in the process. + +## Command-line flags + +#### --resync + +This will effectively make both Path1 and Path2 filesystems contain a +matching superset of all files. Path2 files that do not exist in Path1 will +be copied to Path1, and the process will then copy the Path1 tree to Path2. + +The `--resync` sequence is roughly equivalent to: +``` +rclone copy Path2 Path1 --ignore-existing +rclone copy Path1 Path2 +``` +Or, if using `--create-empty-src-dirs`: +``` +rclone copy Path2 Path1 --ignore-existing +rclone copy Path1 Path2 --create-empty-src-dirs +rclone copy Path2 Path1 --create-empty-src-dirs +``` + +The base directories on both Path1 and Path2 filesystems must exist +or bisync will fail. This is required for safety - that bisync can verify +that both paths are valid. + +When using `--resync`, a newer version of a file on the Path2 filesystem +will be overwritten by the Path1 filesystem version. +(Note that this is [NOT entirely symmetrical](https://github.com/rclone/rclone/issues/5681#issuecomment-938761815).) +Carefully evaluate deltas using [--dry-run](https://rclone.org/flags/#non-backend-flags). + +[//]: # (I reverted a recent change in the above paragraph, as it was incorrect. +https://github.com/rclone/rclone/commit/dd72aff98a46c6e20848ac7ae5f7b19d45802493 ) + +For a resync run, one of the paths may be empty (no files in the path tree). +The resync run should result in files on both paths, else a normal non-resync +run will fail. + +For a non-resync run, either path being empty (no files in the tree) fails with +`Empty current PathN listing. Cannot sync to an empty directory: X.pathN.lst` +This is a safety check that an unexpected empty path does not result in +deleting **everything** in the other path. + +#### --check-access + +Access check files are an additional safety measure against data loss. +bisync will ensure it can find matching `RCLONE_TEST` files in the same places +in the Path1 and Path2 filesystems. +`RCLONE_TEST` files are not generated automatically. +For `--check-access` to succeed, you must first either: +**A)** Place one or more `RCLONE_TEST` files in both systems, or +**B)** Set `--check-filename` to a filename already in use in various locations +throughout your sync'd fileset. Recommended methods for **A)** include: +* `rclone touch Path1/RCLONE_TEST` (create a new file) +* `rclone copyto Path1/RCLONE_TEST Path2/RCLONE_TEST` (copy an existing file) +* `rclone copy Path1/RCLONE_TEST Path2/RCLONE_TEST --include "RCLONE_TEST"` (copy multiple files at once, recursively) +* create the files manually (outside of rclone) +* run `bisync` once *without* `--check-access` to set matching files on both filesystems +will also work, but is not preferred, due to potential for user error +(you are temporarily disabling the safety feature). + +Note that `--check-access` is still enforced on `--resync`, so `bisync --resync --check-access` +will not work as a method of initially setting the files (this is to ensure that bisync can't +[inadvertently circumvent its own safety switch](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=3.%20%2D%2Dcheck%2Daccess%20doesn%27t%20always%20fail%20when%20it%20should).) + +Time stamps and file contents for `RCLONE_TEST` files are not important, just the names and locations. +If you have symbolic links in your sync tree it is recommended to place +`RCLONE_TEST` files in the linked-to directory tree to protect against +bisync assuming a bunch of deleted files if the linked-to tree should not be +accessible. +See also the [--check-filename](--check-filename) flag. + +#### --check-filename + +Name of the file(s) used in access health validation. +The default `--check-filename` is `RCLONE_TEST`. +One or more files having this filename must exist, synchronized between your +source and destination filesets, in order for `--check-access` to succeed. +See [--check-access](#check-access) for additional details. + +#### --max-delete + +As a safety check, if greater than the `--max-delete` percent of files were +deleted on either the Path1 or Path2 filesystem, then bisync will abort with +a warning message, without making any changes. +The default `--max-delete` is `50%`. +One way to trigger this limit is to rename a directory that contains more +than half of your files. This will appear to bisync as a bunch of deleted +files and a bunch of new files. +This safety check is intended to block bisync from deleting all of the +files on both filesystems due to a temporary network access issue, or if +the user had inadvertently deleted the files on one side or the other. +To force the sync, either set a different delete percentage limit, +e.g. `--max-delete 75` (allows up to 75% deletion), or use `--force` +to bypass the check. + +Also see the [all files changed](#all-files-changed) check. + +#### --filters-file {#filters-file} + +By using rclone filter features you can exclude file types or directory +sub-trees from the sync. +See the [bisync filters](#filtering) section and generic +[--filter-from](https://rclone.org/filtering/#filter-from-read-filtering-patterns-from-a-file) +documentation. +An [example filters file](#example-filters-file) contains filters for +non-allowed files for synching with Dropbox. + +If you make changes to your filters file then bisync requires a run +with `--resync`. This is a safety feature, which prevents existing files +on the Path1 and/or Path2 side from seeming to disappear from view +(since they are excluded in the new listings), which would fool bisync +into seeing them as deleted (as compared to the prior run listings), +and then bisync would proceed to delete them for real. + +To block this from happening, bisync calculates an MD5 hash of the filters file +and stores the hash in a `.md5` file in the same place as your filters file. +On the next run with `--filters-file` set, bisync re-calculates the MD5 hash +of the current filters file and compares it to the hash stored in the `.md5` file. +If they don't match, the run aborts with a critical error and thus forces you +to do a `--resync`, likely avoiding a disaster. + +#### --check-sync + +Enabled by default, the check-sync function checks that all of the same +files exist in both the Path1 and Path2 history listings. This _check-sync_ +integrity check is performed at the end of the sync run by default. +Any untrapped failing copy/deletes between the two paths might result +in differences between the two listings and in the untracked file content +differences between the two paths. A resync run would correct the error. + +Note that the default-enabled integrity check locally executes a load of both +the final Path1 and Path2 listings, and thus adds to the run time of a sync. +Using `--check-sync=false` will disable it and may significantly reduce the +sync run times for very large numbers of files. + +The check may be run manually with `--check-sync=only`. It runs only the +integrity check and terminates without actually synching. + +See also: [Concurrent modifications](#concurrent-modifications) + + +#### --ignore-listing-checksum + +By default, bisync will retrieve (or generate) checksums (for backends that support them) +when creating the listings for both paths, and store the checksums in the listing files. +`--ignore-listing-checksum` will disable this behavior, which may speed things up considerably, +especially on backends (such as [local](https://rclone.org/local/)) where hashes must be computed on the fly instead of retrieved. +Please note the following: + +* While checksums are (by default) generated and stored in the listing files, +they are NOT currently used for determining diffs (deltas). +It is anticipated that full checksum support will be added in a future version. +* `--ignore-listing-checksum` is NOT the same as [`--ignore-checksum`](https://rclone.org/docs/#ignore-checksum), +and you may wish to use one or the other, or both. In a nutshell: +`--ignore-listing-checksum` controls whether checksums are considered when scanning for diffs, +while `--ignore-checksum` controls whether checksums are considered during the copy/sync operations that follow, +if there ARE diffs. +* Unless `--ignore-listing-checksum` is passed, bisync currently computes hashes for one path +*even when there's no common hash with the other path* +(for example, a [crypt](https://rclone.org/crypt/#modification-times-and-hashes) remote.) +* If both paths support checksums and have a common hash, +AND `--ignore-listing-checksum` was not specified when creating the listings, +`--check-sync=only` can be used to compare Path1 vs. Path2 checksums (as of the time the previous listings were created.) +However, `--check-sync=only` will NOT include checksums if the previous listings +were generated on a run using `--ignore-listing-checksum`. For a more robust integrity check of the current state, +consider using [`check`](commands/rclone_check/) +(or [`cryptcheck`](https://rclone.org/commands/rclone_cryptcheck/), if at least one path is a `crypt` remote.) + +#### --resilient + +***Caution: this is an experimental feature. Use at your own risk!*** + +By default, most errors or interruptions will cause bisync to abort and +require [`--resync`](#resync) to recover. This is a safety feature, +to prevent bisync from running again until a user checks things out. +However, in some cases, bisync can go too far and enforce a lockout when one isn't actually necessary, +like for certain less-serious errors that might resolve themselves on the next run. +When `--resilient` is specified, bisync tries its best to recover and self-correct, +and only requires `--resync` as a last resort when a human's involvement is absolutely necessary. +The intended use case is for running bisync as a background process (such as via scheduled [cron](#cron)). + +When using `--resilient` mode, bisync will still report the error and abort, +however it will not lock out future runs -- allowing the possibility of retrying at the next normally scheduled time, +without requiring a `--resync` first. Examples of such retryable errors include +access test failures, missing listing files, and filter change detections. +These safety features will still prevent the *current* run from proceeding -- +the difference is that if conditions have improved by the time of the *next* run, +that next run will be allowed to proceed. +Certain more serious errors will still enforce a `--resync` lockout, even in `--resilient` mode, to prevent data loss. + +Behavior of `--resilient` may change in a future version. + +## Operation + +### Runtime flow details + +bisync retains the listings of the `Path1` and `Path2` filesystems +from the prior run. +On each successive run it will: + +- list files on `path1` and `path2`, and check for changes on each side. + Changes include `New`, `Newer`, `Older`, and `Deleted` files. +- Propagate changes on `path1` to `path2`, and vice-versa. + +### Safety measures + +- Lock file prevents multiple simultaneous runs when taking a while. + This can be particularly useful if bisync is run by cron scheduler. +- Handle change conflicts non-destructively by creating + `..path1` and `..path2` file versions. +- File system access health check using `RCLONE_TEST` files + (see the `--check-access` flag). +- Abort on excessive deletes - protects against a failed listing + being interpreted as all the files were deleted. + See the `--max-delete` and `--force` flags. +- If something evil happens, bisync goes into a safe state to block + damage by later runs. (See [Error Handling](#error-handling)) + +### Normal sync checks + + Type | Description | Result | Implementation +--------------|-----------------------------------------------|--------------------------|----------------------------- +Path2 new | File is new on Path2, does not exist on Path1 | Path2 version survives | `rclone copy` Path2 to Path1 +Path2 newer | File is newer on Path2, unchanged on Path1 | Path2 version survives | `rclone copy` Path2 to Path1 +Path2 deleted | File is deleted on Path2, unchanged on Path1 | File is deleted | `rclone delete` Path1 +Path1 new | File is new on Path1, does not exist on Path2 | Path1 version survives | `rclone copy` Path1 to Path2 +Path1 newer | File is newer on Path1, unchanged on Path2 | Path1 version survives | `rclone copy` Path1 to Path2 +Path1 older | File is older on Path1, unchanged on Path2 | _Path1 version survives_ | `rclone copy` Path1 to Path2 +Path2 older | File is older on Path2, unchanged on Path1 | _Path2 version survives_ | `rclone copy` Path2 to Path1 +Path1 deleted | File no longer exists on Path1 | File is deleted | `rclone delete` Path2 + +### Unusual sync checks + + Type | Description | Result | Implementation +--------------------------------|---------------------------------------|------------------------------------|----------------------- +Path1 new/changed AND Path2 new/changed AND Path1 == Path2 | File is new/changed on Path1 AND new/changed on Path2 AND Path1 version is currently identical to Path2 | No change | None +Path1 new AND Path2 new | File is new on Path1 AND new on Path2 (and Path1 version is NOT identical to Path2) | Files renamed to _Path1 and _Path2 | `rclone copy` _Path2 file to Path1, `rclone copy` _Path1 file to Path2 +Path2 newer AND Path1 changed | File is newer on Path2 AND also changed (newer/older/size) on Path1 (and Path1 version is NOT identical to Path2) | Files renamed to _Path1 and _Path2 | `rclone copy` _Path2 file to Path1, `rclone copy` _Path1 file to Path2 +Path2 newer AND Path1 deleted | File is newer on Path2 AND also deleted on Path1 | Path2 version survives | `rclone copy` Path2 to Path1 +Path2 deleted AND Path1 changed | File is deleted on Path2 AND changed (newer/older/size) on Path1 | Path1 version survives |`rclone copy` Path1 to Path2 +Path1 deleted AND Path2 changed | File is deleted on Path1 AND changed (newer/older/size) on Path2 | Path2 version survives | `rclone copy` Path2 to Path1 + +As of `rclone v1.64`, bisync is now better at detecting *false positive* sync conflicts, +which would previously have resulted in unnecessary renames and duplicates. +Now, when bisync comes to a file that it wants to rename (because it is new/changed on both sides), +it first checks whether the Path1 and Path2 versions are currently *identical* +(using the same underlying function as [`check`](commands/rclone_check/).) +If bisync concludes that the files are identical, it will skip them and move on. +Otherwise, it will create renamed `..Path1` and `..Path2` duplicates, as before. +This behavior also [improves the experience of renaming directories](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=Renamed%20directories), +as a `--resync` is no longer required, so long as the same change has been made on both sides. + +### All files changed check {#all-files-changed} + +If _all_ prior existing files on either of the filesystems have changed +(e.g. timestamps have changed due to changing the system's timezone) +then bisync will abort without making any changes. +Any new files are not considered for this check. You could use `--force` +to force the sync (whichever side has the changed timestamp files wins). +Alternately, a `--resync` may be used (Path1 versions will be pushed +to Path2). Consider the situation carefully and perhaps use `--dry-run` +before you commit to the changes. + +### Modification times + +Bisync relies on file timestamps to identify changed files and will +_refuse_ to operate if backend lacks the modification time support. + +If you or your application should change the content of a file +without changing the modification time then bisync will _not_ +notice the change, and thus will not copy it to the other side. + +Note that on some cloud storage systems it is not possible to have file +timestamps that match _precisely_ between the local and other filesystems. + +Bisync's approach to this problem is by tracking the changes on each side +_separately_ over time with a local database of files in that side then +applying the resulting changes on the other side. + +### Error handling {#error-handling} + +Certain bisync critical errors, such as file copy/move failing, will result in +a bisync lockout of following runs. The lockout is asserted because the sync +status and history of the Path1 and Path2 filesystems cannot be trusted, +so it is safer to block any further changes until someone checks things out. +The recovery is to do a `--resync` again. + +It is recommended to use `--resync --dry-run --verbose` initially and +_carefully_ review what changes will be made before running the `--resync` +without `--dry-run`. + +Most of these events come up due to an error status from an internal call. +On such a critical error the `{...}.path1.lst` and `{...}.path2.lst` +listing files are renamed to extension `.lst-err`, which blocks any future +bisync runs (since the normal `.lst` files are not found). +Bisync keeps them under `bisync` subdirectory of the rclone cache directory, +typically at `${HOME}/.cache/rclone/bisync/` on Linux. + +Some errors are considered temporary and re-running the bisync is not blocked. +The _critical return_ blocks further bisync runs. + +See also: [`--resilient`](#resilient) + +### Lock file + +When bisync is running, a lock file is created in the bisync working directory, +typically at `~/.cache/rclone/bisync/PATH1..PATH2.lck` on Linux. +If bisync should crash or hang, the lock file will remain in place and block +any further runs of bisync _for the same paths_. +Delete the lock file as part of debugging the situation. +The lock file effectively blocks follow-on (e.g., scheduled by _cron_) runs +when the prior invocation is taking a long time. +The lock file contains _PID_ of the blocking process, which may help in debug. + +**Note** +that while concurrent bisync runs are allowed, _be very cautious_ +that there is no overlap in the trees being synched between concurrent runs, +lest there be replicated files, deleted files and general mayhem. + +### Return codes + +`rclone bisync` returns the following codes to calling program: +- `0` on a successful run, +- `1` for a non-critical failing run (a rerun may be successful), +- `2` for a critically aborted run (requires a `--resync` to recover). + +## Limitations + +### Supported backends + +Bisync is considered _BETA_ and has been tested with the following backends: +- Local filesystem +- Google Drive +- Dropbox +- OneDrive +- S3 +- SFTP +- Yandex Disk + +It has not been fully tested with other services yet. +If it works, or sorta works, please let us know and we'll update the list. +Run the test suite to check for proper operation as described below. + +First release of `rclone bisync` requires that underlying backend supports +the modification time feature and will refuse to run otherwise. +This limitation will be lifted in a future `rclone bisync` release. + +### Concurrent modifications + +When using **Local, FTP or SFTP** remotes rclone does not create _temporary_ +files at the destination when copying, and thus if the connection is lost +the created file may be corrupt, which will likely propagate back to the +original path on the next sync, resulting in data loss. +This will be solved in a future release, there is no workaround at the moment. + +Files that **change during** a bisync run may result in data loss. +This has been seen in a highly dynamic environment, where the filesystem +is getting hammered by running processes during the sync. +The currently recommended solution is to sync at quiet times or [filter out](#filtering) +unnecessary directories and files. + +As an [alternative approach](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=scans%2C%20to%20avoid-,errors%20if%20files%20changed%20during%20sync,-Given%20the%20number), +consider using `--check-sync=false` (and possibly `--resilient`) to make bisync more forgiving +of filesystems that change during the sync. +Be advised that this may cause bisync to miss events that occur during a bisync run, +so it is a good idea to supplement this with a periodic independent integrity check, +and corrective sync if diffs are found. For example, a possible sequence could look like this: + +1. Normally scheduled bisync run: + +``` +rclone bisync Path1 Path2 -MPc --check-access --max-delete 10 --filters-file /path/to/filters.txt -v --check-sync=false --no-cleanup --ignore-listing-checksum --disable ListR --checkers=16 --drive-pacer-min-sleep=10ms --create-empty-src-dirs --resilient +``` + +2. Periodic independent integrity check (perhaps scheduled nightly or weekly): + +``` +rclone check -MvPc Path1 Path2 --filter-from /path/to/filters.txt +``` + +3. If diffs are found, you have some choices to correct them. +If one side is more up-to-date and you want to make the other side match it, you could run: + +``` +rclone sync Path1 Path2 --filter-from /path/to/filters.txt --create-empty-src-dirs -MPc -v +``` +(or switch Path1 and Path2 to make Path2 the source-of-truth) + +Or, if neither side is totally up-to-date, you could run a `--resync` to bring them back into agreement +(but remember that this could cause deleted files to re-appear.) + +*Note also that `rclone check` does not currently include empty directories, +so if you want to know if any empty directories are out of sync, +consider alternatively running the above `rclone sync` command with `--dry-run` added. + +### Empty directories + +By default, new/deleted empty directories on one path are _not_ propagated to the other side. +This is because bisync (and rclone) natively works on files, not directories. +However, this can be changed with the `--create-empty-src-dirs` flag, which works in +much the same way as in [`sync`](https://rclone.org/commands/rclone_sync/) and [`copy`](https://rclone.org/commands/rclone_copy/). +When used, empty directories created or deleted on one side will also be created or deleted on the other side. +The following should be noted: +* `--create-empty-src-dirs` is not compatible with `--remove-empty-dirs`. Use only one or the other (or neither). +* It is not recommended to switch back and forth between `--create-empty-src-dirs` +and the default (no `--create-empty-src-dirs`) without running `--resync`. +This is because it may appear as though all directories (not just the empty ones) were created/deleted, +when actually you've just toggled between making them visible/invisible to bisync. +It looks scarier than it is, but it's still probably best to stick to one or the other, +and use `--resync` when you need to switch. + +### Renamed directories + +Renaming a folder on the Path1 side results in deleting all files on +the Path2 side and then copying all files again from Path1 to Path2. +Bisync sees this as all files in the old directory name as deleted and all +files in the new directory name as new. +Currently, the most effective and efficient method of renaming a directory +is to rename it to the same name on both sides. (As of `rclone v1.64`, +a `--resync` is no longer required after doing so, as bisync will automatically +detect that Path1 and Path2 are in agreement.) + +### `--fast-list` used by default + +Unlike most other rclone commands, bisync uses [`--fast-list`](https://rclone.org/docs/#fast-list) by default, +for backends that support it. In many cases this is desirable, however, +there are some scenarios in which bisync could be faster *without* `--fast-list`, +and there is also a [known issue concerning Google Drive users with many empty directories](https://github.com/rclone/rclone/commit/cbf3d4356135814921382dd3285d859d15d0aa77). +For now, the recommended way to avoid using `--fast-list` is to add `--disable ListR` +to all bisync commands. The default behavior may change in a future version. + +### Overridden Configs + +When rclone detects an overridden config, it adds a suffix like `{ABCDE}` on the fly +to the internal name of the remote. Bisync follows suit by including this suffix in its listing filenames. +However, this suffix does not necessarily persist from run to run, especially if different flags are provided. +So if next time the suffix assigned is `{FGHIJ}`, bisync will get confused, +because it's looking for a listing file with `{FGHIJ}`, when the file it wants has `{ABCDE}`. +As a result, it throws +`Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run` +and refuses to run again until the user runs a `--resync` (unless using `--resilient`). +The best workaround at the moment is to set any backend-specific flags in the [config file](https://rclone.org/commands/rclone_config/) +instead of specifying them with command flags. (You can still override them as needed for other rclone commands.) + +### Case sensitivity + +Synching with **case-insensitive** filesystems, such as Windows or `Box`, +can result in file name conflicts. This will be fixed in a future release. +The near-term workaround is to make sure that files on both sides +don't have spelling case differences (`Smile.jpg` vs. `smile.jpg`). + +## Windows support {#windows} + +Bisync has been tested on Windows 8.1, Windows 10 Pro 64-bit and on Windows +GitHub runners. + +Drive letters are allowed, including drive letters mapped to network drives +(`rclone bisync J:\localsync GDrive:`). +If a drive letter is omitted, the shell current drive is the default. +Drive letters are a single character follows by `:`, so cloud names +must be more than one character long. + +Absolute paths (with or without a drive letter), and relative paths +(with or without a drive letter) are supported. + +Working directory is created at `C:\Users\MyLogin\AppData\Local\rclone\bisync`. + +Note that bisync output may show a mix of forward `/` and back `\` slashes. + +Be careful of case independent directory and file naming on Windows +vs. case dependent Linux + +## Filtering {#filtering} + +See [filtering documentation](https://rclone.org/filtering/) +for how filter rules are written and interpreted. + +Bisync's [`--filters-file`](#filters-file) flag slightly extends the rclone's +[--filter-from](https://rclone.org/filtering/#filter-from-read-filtering-patterns-from-a-file) +filtering mechanism. +For a given bisync run you may provide _only one_ `--filters-file`. +The `--include*`, `--exclude*`, and `--filter` flags are also supported. + +### How to filter directories + +Filtering portions of the directory tree is a critical feature for synching. + +Examples of directory trees (always beneath the Path1/Path2 root level) +you may want to exclude from your sync: +- Directory trees containing only software build intermediate files. +- Directory trees containing application temporary files and data + such as the Windows `C:\Users\MyLogin\AppData\` tree. +- Directory trees containing files that are large, less important, + or are getting thrashed continuously by ongoing processes. + +On the other hand, there may be only select directories that you +actually want to sync, and exclude all others. See the +[Example include-style filters for Windows user directories](#include-filters) +below. + +### Filters file writing guidelines + +1. Begin with excluding directory trees: + - e.g. `- /AppData/` + - `**` on the end is not necessary. Once a given directory level + is excluded then everything beneath it won't be looked at by rclone. + - Exclude such directories that are unneeded, are big, dynamically thrashed, + or where there may be access permission issues. + - Excluding such dirs first will make rclone operations (much) faster. + - Specific files may also be excluded, as with the Dropbox exclusions + example below. +2. Decide if it's easier (or cleaner) to: + - Include select directories and therefore _exclude everything else_ -- or -- + - Exclude select directories and therefore _include everything else_ +3. Include select directories: + - Add lines like: `+ /Documents/PersonalFiles/**` to select which + directories to include in the sync. + - `**` on the end specifies to include the full depth of the specified tree. + - With Include-style filters, files at the Path1/Path2 root are not included. + They may be included with `+ /*`. + - Place RCLONE_TEST files within these included directory trees. + They will only be looked for in these directory trees. + - Finish by excluding everything else by adding `- **` at the end + of the filters file. + - Disregard step 4. +4. Exclude select directories: + - Add more lines like in step 1. + For example: `-/Desktop/tempfiles/`, or `- /testdir/`. + Again, a `**` on the end is not necessary. + - Do _not_ add a `- **` in the file. Without this line, everything + will be included that has not been explicitly excluded. + - Disregard step 3. + +A few rules for the syntax of a filter file expanding on +[filtering documentation](https://rclone.org/filtering/): + +- Lines may start with spaces and tabs - rclone strips leading whitespace. +- If the first non-whitespace character is a `#` then the line is a comment + and will be ignored. +- Blank lines are ignored. +- The first non-whitespace character on a filter line must be a `+` or `-`. +- Exactly 1 space is allowed between the `+/-` and the path term. +- Only forward slashes (`/`) are used in path terms, even on Windows. +- The rest of the line is taken as the path term. + Trailing whitespace is taken literally, and probably is an error. + +### Example include-style filters for Windows user directories {#include-filters} + +This Windows _include-style_ example is based on the sync root (Path1) +set to `C:\Users\MyLogin`. The strategy is to select specific directories +to be synched with a network drive (Path2). + +- `- /AppData/` excludes an entire tree of Windows stored stuff + that need not be synched. + In my case, AppData has >11 GB of stuff I don't care about, and there are + some subdirectories beneath AppData that are not accessible to my + user login, resulting in bisync critical aborts. +- Windows creates cache files starting with both upper and + lowercase `NTUSER` at `C:\Users\MyLogin`. These files may be dynamic, + locked, and are generally _don't care_. +- There are just a few directories with _my_ data that I do want synched, + in the form of `+ /`. By selecting only the directory trees I + want to avoid the dozen plus directories that various apps make + at `C:\Users\MyLogin\Documents`. +- Include files in the root of the sync point, `C:\Users\MyLogin`, + by adding the `+ /*` line. +- This is an Include-style filters file, therefore it ends with `- **` + which excludes everything not explicitly included. + +``` +- /AppData/ +- NTUSER* +- ntuser* ++ /Documents/Family/** ++ /Documents/Sketchup/** ++ /Documents/Microcapture_Photo/** ++ /Documents/Microcapture_Video/** ++ /Desktop/** ++ /Pictures/** ++ /* +- ** +``` + +Note also that Windows implements several "library" links such as +`C:\Users\MyLogin\My Documents\My Music` pointing to `C:\Users\MyLogin\Music`. +rclone sees these as links, so you must add `--links` to the +bisync command line if you which to follow these links. I find that I get +permission errors in trying to follow the links, so I don't include the +rclone `--links` flag, but then you get lots of `Can't follow symlink…` +noise from rclone about not following the links. This noise can be +quashed by adding `--quiet` to the bisync command line. + +## Example exclude-style filters files for use with Dropbox {#exclude-filters} + +- Dropbox disallows synching the listed temporary and configuration/data files. + The `- ` filters exclude these files where ever they may occur + in the sync tree. Consider adding similar exclusions for file types + you don't need to sync, such as core dump and software build files. +- bisync testing creates `/testdir/` at the top level of the sync tree, + and usually deletes the tree after the test. If a normal sync should run + while the `/testdir/` tree exists the `--check-access` phase may fail + due to unbalanced RCLONE_TEST files. + The `- /testdir/` filter blocks this tree from being synched. + You don't need this exclusion if you are not doing bisync development testing. +- Everything else beneath the Path1/Path2 root will be synched. +- RCLONE_TEST files may be placed anywhere within the tree, including the root. + +### Example filters file for Dropbox {#example-filters-file} + +``` +# Filter file for use with bisync +# See https://rclone.org/filtering/ for filtering rules +# NOTICE: If you make changes to this file you MUST do a --resync run. +# Run with --dry-run to see what changes will be made. + +# Dropbox won't sync some files so filter them away here. +# See https://help.dropbox.com/installs-integrations/sync-uploads/files-not-syncing +- .dropbox.attr +- ~*.tmp +- ~$* +- .~* +- desktop.ini +- .dropbox + +# Used for bisync testing, so excluded from normal runs +- /testdir/ + +# Other example filters +#- /TiBU/ +#- /Photos/ +``` + +### How --check-access handles filters + +At the start of a bisync run, listings are gathered for Path1 and Path2 +while using the user's `--filters-file`. During the check access phase, +bisync scans these listings for `RCLONE_TEST` files. +Any `RCLONE_TEST` files hidden by the `--filters-file` are _not_ in the +listings and thus not checked during the check access phase. + +## Troubleshooting {#troubleshooting} + +### Reading bisync logs + +Here are two normal runs. The first one has a newer file on the remote. +The second has no deltas between local and remote. + +``` +2021/05/16 00:24:38 INFO : Synching Path1 "/path/to/local/tree/" with Path2 "dropbox:/" +2021/05/16 00:24:38 INFO : Path1 checking for diffs +2021/05/16 00:24:38 INFO : - Path1 File is new - file.txt +2021/05/16 00:24:38 INFO : Path1: 1 changes: 1 new, 0 newer, 0 older, 0 deleted +2021/05/16 00:24:38 INFO : Path2 checking for diffs +2021/05/16 00:24:38 INFO : Applying changes +2021/05/16 00:24:38 INFO : - Path1 Queue copy to Path2 - dropbox:/file.txt +2021/05/16 00:24:38 INFO : - Path1 Do queued copies to - Path2 +2021/05/16 00:24:38 INFO : Updating listings +2021/05/16 00:24:38 INFO : Validating listings for Path1 "/path/to/local/tree/" vs Path2 "dropbox:/" +2021/05/16 00:24:38 INFO : Bisync successful + +2021/05/16 00:36:52 INFO : Synching Path1 "/path/to/local/tree/" with Path2 "dropbox:/" +2021/05/16 00:36:52 INFO : Path1 checking for diffs +2021/05/16 00:36:52 INFO : Path2 checking for diffs +2021/05/16 00:36:52 INFO : No changes found +2021/05/16 00:36:52 INFO : Updating listings +2021/05/16 00:36:52 INFO : Validating listings for Path1 "/path/to/local/tree/" vs Path2 "dropbox:/" +2021/05/16 00:36:52 INFO : Bisync successful +``` + +### Dry run oddity + +The `--dry-run` messages may indicate that it would try to delete some files. +For example, if a file is new on Path2 and does not exist on Path1 then +it would normally be copied to Path1, but with `--dry-run` enabled those +copies don't happen, which leads to the attempted delete on Path2, +blocked again by --dry-run: `... Not deleting as --dry-run`. + +This whole confusing situation is an artifact of the `--dry-run` flag. +Scrutinize the proposed deletes carefully, and if the files would have been +copied to Path1 then the threatened deletes on Path2 may be disregarded. + +### Retries + +Rclone has built-in retries. If you run with `--verbose` you'll see +error and retry messages such as shown below. This is usually not a bug. +If at the end of the run, you see `Bisync successful` and not +`Bisync critical error` or `Bisync aborted` then the run was successful, +and you can ignore the error messages. + +The following run shows an intermittent fail. Lines _5_ and _6- are +low-level messages. Line _6_ is a bubbled-up _warning_ message, conveying +the error. Rclone normally retries failing commands, so there may be +numerous such messages in the log. + +Since there are no final error/warning messages on line _7_, rclone has +recovered from failure after a retry, and the overall sync was successful. + +``` +1: 2021/05/14 00:44:12 INFO : Synching Path1 "/path/to/local/tree" with Path2 "dropbox:" +2: 2021/05/14 00:44:12 INFO : Path1 checking for diffs +3: 2021/05/14 00:44:12 INFO : Path2 checking for diffs +4: 2021/05/14 00:44:12 INFO : Path2: 113 changes: 22 new, 0 newer, 0 older, 91 deleted +5: 2021/05/14 00:44:12 ERROR : /path/to/local/tree/objects/af: error listing: unexpected end of JSON input +6: 2021/05/14 00:44:12 NOTICE: WARNING listing try 1 failed. - dropbox: +7: 2021/05/14 00:44:12 INFO : Bisync successful +``` + +This log shows a _Critical failure_ which requires a `--resync` to recover from. +See the [Runtime Error Handling](#error-handling) section. + +``` +2021/05/12 00:49:40 INFO : Google drive root '': Waiting for checks to finish +2021/05/12 00:49:40 INFO : Google drive root '': Waiting for transfers to finish +2021/05/12 00:49:40 INFO : Google drive root '': not deleting files as there were IO errors +2021/05/12 00:49:40 ERROR : Attempt 3/3 failed with 3 errors and: not deleting files as there were IO errors +2021/05/12 00:49:40 ERROR : Failed to sync: not deleting files as there were IO errors +2021/05/12 00:49:40 NOTICE: WARNING rclone sync try 3 failed. - /path/to/local/tree/ +2021/05/12 00:49:40 ERROR : Bisync aborted. Must run --resync to recover. +``` + +### Denied downloads of "infected" or "abusive" files + +Google Drive has a filter for certain file types (`.exe`, `.apk`, et cetera) +that by default cannot be copied from Google Drive to the local filesystem. +If you are having problems, run with `--verbose` to see specifically which +files are generating complaints. If the error is +`This file has been identified as malware or spam and cannot be downloaded`, +consider using the flag +[--drive-acknowledge-abuse](https://rclone.org/drive/#drive-acknowledge-abuse). + +### Google Doc files + +Google docs exist as virtual files on Google Drive and cannot be transferred +to other filesystems natively. While it is possible to export a Google doc to +a normal file (with `.xlsx` extension, for example), it is not possible +to import a normal file back into a Google document. + +Bisync's handling of Google Doc files is to flag them in the run log output +for user's attention and ignore them for any file transfers, deletes, or syncs. +They will show up with a length of `-1` in the listings. +This bisync run is otherwise successful: + +``` +2021/05/11 08:23:15 INFO : Synching Path1 "/path/to/local/tree/base/" with Path2 "GDrive:" +2021/05/11 08:23:15 INFO : ...path2.lst-new: Ignoring incorrect line: "- -1 - - 2018-07-29T08:49:30.136000000+0000 GoogleDoc.docx" +2021/05/11 08:23:15 INFO : Bisync successful +``` + +## Usage examples + +### Cron {#cron} + +Rclone does not yet have a built-in capability to monitor the local file +system for changes and must be blindly run periodically. +On Windows this can be done using a _Task Scheduler_, +on Linux you can use _Cron_ which is described below. + +The 1st example runs a sync every 5 minutes between a local directory +and an OwnCloud server, with output logged to a runlog file: + +``` +# Minute (0-59) +# Hour (0-23) +# Day of Month (1-31) +# Month (1-12 or Jan-Dec) +# Day of Week (0-6 or Sun-Sat) +# Command + */5 * * * * /path/to/rclone bisync /local/files MyCloud: --check-access --filters-file /path/to/bysync-filters.txt --log-file /path/to//bisync.log +``` + +See [crontab syntax](https://www.man7.org/linux/man-pages/man1/crontab.1p.html#INPUT_FILES) +for the details of crontab time interval expressions. + +If you run `rclone bisync` as a cron job, redirect stdout/stderr to a file. +The 2nd example runs a sync to Dropbox every hour and logs all stdout (via the `>>`) +and stderr (via `2>&1`) to a log file. + +``` +0 * * * * /path/to/rclone bisync /path/to/local/dropbox Dropbox: --check-access --filters-file /home/user/filters.txt >> /path/to/logs/dropbox-run.log 2>&1 +``` + +### Sharing an encrypted folder tree between hosts + +bisync can keep a local folder in sync with a cloud service, +but what if you have some highly sensitive files to be synched? + +Usage of a cloud service is for exchanging both routine and sensitive +personal files between one's home network, one's personal notebook when on the +road, and with one's work computer. The routine data is not sensitive. +For the sensitive data, configure an rclone [crypt remote](https://rclone.org/crypt/) to point to +a subdirectory within the local disk tree that is bisync'd to Dropbox, +and then set up an bisync for this local crypt directory to a directory +outside of the main sync tree. + +### Linux server setup + +- `/path/to/DBoxroot` is the root of my local sync tree. + There are numerous subdirectories. +- `/path/to/DBoxroot/crypt` is the root subdirectory for files + that are encrypted. This local directory target is setup as an + rclone crypt remote named `Dropcrypt:`. + See [rclone.conf](#rclone-conf-snippet) snippet below. +- `/path/to/my/unencrypted/files` is the root of my sensitive + files - not encrypted, not within the tree synched to Dropbox. +- To sync my local unencrypted files with the encrypted Dropbox versions + I manually run `bisync /path/to/my/unencrypted/files DropCrypt:`. + This step could be bundled into a script to run before and after + the full Dropbox tree sync in the last step, + thus actively keeping the sensitive files in sync. +- `bisync /path/to/DBoxroot Dropbox:` runs periodically via cron, + keeping my full local sync tree in sync with Dropbox. + +### Windows notebook setup + +- The Dropbox client runs keeping the local tree `C:\Users\MyLogin\Dropbox` + always in sync with Dropbox. I could have used `rclone bisync` instead. +- A separate directory tree at `C:\Users\MyLogin\Documents\DropLocal` + hosts the tree of unencrypted files/folders. +- To sync my local unencrypted files with the encrypted + Dropbox versions I manually run the following command: + `rclone bisync C:\Users\MyLogin\Documents\DropLocal Dropcrypt:`. +- The Dropbox client then syncs the changes with Dropbox. + +### rclone.conf snippet {#rclone-conf-snippet} + +``` +[Dropbox] +type = dropbox +... + +[Dropcrypt] +type = crypt +remote = /path/to/DBoxroot/crypt # on the Linux server +remote = C:\Users\MyLogin\Dropbox\crypt # on the Windows notebook +filename_encryption = standard +directory_name_encryption = true +password = ... +... +``` + +## Testing {#testing} + +You should read this section only if you are developing for rclone. +You need to have rclone source code locally to work with bisync tests. + +Bisync has a dedicated test framework implemented in the `bisync_test.go` +file located in the rclone source tree. The test suite is based on the +`go test` command. Series of tests are stored in subdirectories below the +`cmd/bisync/testdata` directory. Individual tests can be invoked by their +directory name, e.g. +`go test . -case basic -remote local -remote2 gdrive: -v` + +Tests will make a temporary folder on remote and purge it afterwards. +If during test run there are intermittent errors and rclone retries, +these errors will be captured and flagged as invalid MISCOMPAREs. +Rerunning the test will let it pass. Consider such failures as noise. + +### Test command syntax + +``` +usage: go test ./cmd/bisync [options...] + +Options: + -case NAME Name(s) of the test case(s) to run. Multiple names should + be separated by commas. You can remove the `test_` prefix + and replace `_` by `-` in test name for convenience. + If not `all`, the name(s) should map to a directory under + `./cmd/bisync/testdata`. + Use `all` to run all tests (default: all) + -remote PATH1 `local` or name of cloud service with `:` (default: local) + -remote2 PATH2 `local` or name of cloud service with `:` (default: local) + -no-compare Disable comparing test results with the golden directory + (default: compare) + -no-cleanup Disable cleanup of Path1 and Path2 testdirs. + Useful for troubleshooting. (default: cleanup) + -golden Store results in the golden directory (default: false) + This flag can be used with multiple tests. + -debug Print debug messages + -stop-at NUM Stop test after given step number. (default: run to the end) + Implies `-no-compare` and `-no-cleanup`, if the test really + ends prematurely. Only meaningful for a single test case. + -refresh-times Force refreshing the target modtime, useful for Dropbox + (default: false) + -verbose Run tests verbosely +``` + +Note: unlike rclone flags which must be prefixed by double dash (`--`), the +test command flags can be equally prefixed by a single `-` or double dash. + +### Running tests + +- `go test . -case basic -remote local -remote2 local` + runs the `test_basic` test case using only the local filesystem, + synching one local directory with another local directory. + Test script output is to the console, while commands within scenario.txt + have their output sent to the `.../workdir/test.log` file, + which is finally compared to the golden copy. +- The first argument after `go test` should be a relative name of the + directory containing bisync source code. If you run tests right from there, + the argument will be `.` (current directory) as in most examples below. + If you run bisync tests from the rclone source directory, the command + should be `go test ./cmd/bisync ...`. +- The test engine will mangle rclone output to ensure comparability + with golden listings and logs. +- Test scenarios are located in `./cmd/bisync/testdata`. The test `-case` + argument should match the full name of a subdirectory under that + directory. Every test subdirectory name on disk must start with `test_`, + this prefix can be omitted on command line for brevity. Also, underscores + in the name can be replaced by dashes for convenience. +- `go test . -remote local -remote2 local -case all` runs all tests. +- Path1 and Path2 may either be the keyword `local` + or may be names of configured cloud services. + `go test . -remote gdrive: -remote2 dropbox: -case basic` + will run the test between these two services, without transferring + any files to the local filesystem. +- Test run stdout and stderr console output may be directed to a file, e.g. + `go test . -remote gdrive: -remote2 local -case all > runlog.txt 2>&1` + +### Test execution flow + +1. The base setup in the `initial` directory of the testcase is applied + on the Path1 and Path2 filesystems (via rclone copy the initial directory + to Path1, then rclone sync Path1 to Path2). +2. The commands in the scenario.txt file are applied, with output directed + to the `test.log` file in the test working directory. + Typically, the first actual command in the `scenario.txt` file is + to do a `--resync`, which establishes the baseline + `{...}.path1.lst` and `{...}.path2.lst` files in the test working + directory (`.../workdir/` relative to the temporary test directory). + Various commands and listing snapshots are done within the test. +3. Finally, the contents of the test working directory are compared + to the contents of the testcase's golden directory. + +### Notes about testing + +- Test cases are in individual directories beneath `./cmd/bisync/testdata`. + A command line reference to a test is understood to reference a directory + beneath `testdata`. For example, + `go test ./cmd/bisync -case dry-run -remote gdrive: -remote2 local` + refers to the test case in `./cmd/bisync/testdata/test_dry_run`. +- The test working directory is located at `.../workdir` relative to a + temporary test directory, usually under `/tmp` on Linux. +- The local test sync tree is created at a temporary directory named + like `bisync.XXX` under system temporary directory. +- The remote test sync tree is located at a temporary directory + under `/bisync.XXX/`. +- `path1` and/or `path2` subdirectories are created in a temporary + directory under the respective local or cloud test remote. +- By default, the Path1 and Path2 test dirs and workdir will be deleted + after each test run. The `-no-cleanup` flag disables purging these + directories when validating and debugging a given test. + These directories will be flushed before running another test, + independent of the `-no-cleanup` usage. +- You will likely want to add `- /testdir/` to your normal + bisync `--filters-file` so that normal syncs do not attempt to sync + the test temporary directories, which may have `RCLONE_TEST` miscompares + in some testcases which would otherwise trip the `--check-access` system. + The `--check-access` mechanism is hard-coded to ignore `RCLONE_TEST` + files beneath `bisync/testdata`, so the test cases may reside on the + synched tree even if there are check file mismatches in the test tree. +- Some Dropbox tests can fail, notably printing the following message: + `src and dst identical but can't set mod time without deleting and re-uploading` + This is expected and happens due to the way Dropbox handles modification times. + You should use the `-refresh-times` test flag to make up for this. +- If Dropbox tests hit request limit for you and print error message + `too_many_requests/...: Too many requests or write operations.` + then follow the + [Dropbox App ID instructions](https://rclone.org/dropbox/#get-your-own-dropbox-app-id). + +### Updating golden results + +Sometimes even a slight change in the bisync source can cause little changes +spread around many log files. Updating them manually would be a nightmare. + +The `-golden` flag will store the `test.log` and `*.lst` listings from each +test case into respective golden directories. Golden results will +automatically contain generic strings instead of local or cloud paths which +means that they should match when run with a different cloud service. + +Your normal workflow might be as follows: +1. Git-clone the rclone sources locally +2. Modify bisync source and check that it builds +3. Run the whole test suite `go test ./cmd/bisync -remote local` +4. If some tests show log difference, recheck them individually, e.g.: + `go test ./cmd/bisync -remote local -case basic` +5. If you are convinced with the difference, goldenize all tests at once: + `go test ./cmd/bisync -remote local -golden` +6. Use word diff: `git diff --word-diff ./cmd/bisync/testdata/`. + Please note that normal line-level diff is generally useless here. +7. Check the difference _carefully_! +8. Commit the change (`git commit`) _only_ if you are sure. + If unsure, save your code changes then wipe the log diffs from git: + `git reset [--hard]`. + +### Structure of test scenarios + +- `/initial/` contains a tree of files that will be set + as the initial condition on both Path1 and Path2 testdirs. +- `/modfiles/` contains files that will be used to + modify the Path1 and/or Path2 filesystems. +- `/golden/` contains the expected content of the test + working directory (`workdir`) at the completion of the testcase. +- `/scenario.txt` contains the body of the test, in the form of + various commands to modify files, run bisync, and snapshot listings. + Output from these commands is captured to `.../workdir/test.log` + for comparison to the golden files. + +### Supported test commands + +- `test ` + Print the line to the console and to the `test.log`: + `test sync is working correctly with options x, y, z` +- `copy-listings ` + Save a copy of all `.lst` listings in the test working directory + with the specified prefix: + `save-listings exclude-pass-run` +- `move-listings ` + Similar to `copy-listings` but removes the source +- `purge-children ` + This will delete all child files and purge all child subdirs under given + directory but keep the parent intact. This behavior is important for tests + with Google Drive because removing and re-creating the parent would change + its ID. +- `delete-file ` + Delete a single file. +- `delete-glob ` + Delete a group of files located one level deep in the given directory + with names matching a given glob pattern. +- `touch-glob YYYY-MM-DD ` + Change modification time on a group of files. +- `touch-copy YYYY-MM-DD ` + Change file modification time then copy it to destination. +- `copy-file ` + Copy a single file to given directory. +- `copy-as ` + Similar to above but destination must include both directory + and the new file name at destination. +- `copy-dir ` and `sync-dir ` + Copy/sync a directory. Equivalent of `rclone copy` and `rclone sync`. +- `list-dirs ` + Equivalent to `rclone lsf -R --dirs-only ` +- `bisync [options]` + Runs bisync against `-remote` and `-remote2`. + +### Supported substitution terms -## Introduction +- `{testdir/}` - the root dir of the testcase +- `{datadir/}` - the `modfiles` dir under the testcase root +- `{workdir/}` - the temporary test working directory +- `{path1/}` - the root of the Path1 test directory tree +- `{path2/}` - the root of the Path2 test directory tree +- `{session}` - base name of the test listings +- `{/}` - OS-specific path separator +- `{spc}`, `{tab}`, `{eol}` - whitespace +- `{chr:HH}` - raw byte with given hexadecimal code -Docker 1.9 has added support for creating -[named volumes](https://docs.docker.com/storage/volumes/) via -[command-line interface](https://docs.docker.com/engine/reference/commandline/volume_create/) -and mounting them in containers as a way to share data between them. -Since Docker 1.10 you can create named volumes with -[Docker Compose](https://docs.docker.com/compose/) by descriptions in -[docker-compose.yml](https://docs.docker.com/compose/compose-file/compose-file-v2/#volume-configuration-reference) -files for use by container groups on a single host. -As of Docker 1.12 volumes are supported by -[Docker Swarm](https://docs.docker.com/engine/swarm/key-concepts/) -included with Docker Engine and created from descriptions in -[swarm compose v3](https://docs.docker.com/compose/compose-file/compose-file-v3/#volume-configuration-reference) -files for use with _swarm stacks_ across multiple cluster nodes. +Substitution results of the terms named like `{dir/}` will end with +`/` (or backslash on Windows), so it is not necessary to include +slash in the usage, for example `delete-file {path1/}file1.txt`. -[Docker Volume Plugins](https://docs.docker.com/engine/extend/plugins_volume/) -augment the default `local` volume driver included in Docker with stateful -volumes shared across containers and hosts. Unlike local volumes, your -data will _not_ be deleted when such volume is removed. Plugins can run -managed by the docker daemon, as a native system service -(under systemd, _sysv_ or _upstart_) or as a standalone executable. -Rclone can run as docker volume plugin in all these modes. -It interacts with the local docker daemon -via [plugin API](https://docs.docker.com/engine/extend/plugin_api/) and -handles mounting of remote file systems into docker containers so it must -run on the same host as the docker daemon or on every Swarm node. +## Benchmarks -## Getting started +_This section is work in progress._ -In the first example we will use the [SFTP](https://rclone.org/sftp/) -rclone volume with Docker engine on a standalone Ubuntu machine. +Here are a few data points for scale, execution times, and memory usage. -Start from [installing Docker](https://docs.docker.com/engine/install/) -on the host. +The first set of data was taken between a local disk to Dropbox. +The [speedtest.net](https://speedtest.net) download speed was ~170 Mbps, +and upload speed was ~10 Mbps. 500 files (~9.5 MB each) had been already +synched. 50 files were added in a new directory, each ~9.5 MB, ~475 MB total. -The _FUSE_ driver is a prerequisite for rclone mounting and should be -installed on host: -``` -sudo apt-get -y install fuse -``` +Change | Operations and times | Overall run time +--------------------------------------|--------------------------------------------------------|------------------ +500 files synched (nothing to move) | 1x listings for Path1 & Path2 | 1.5 sec +500 files synched with --check-access | 1x listings for Path1 & Path2 | 1.5 sec +50 new files on remote | Queued 50 copies down: 27 sec | 29 sec +Moved local dir | Queued 50 copies up: 410 sec, 50 deletes up: 9 sec | 421 sec +Moved remote dir | Queued 50 copies down: 31 sec, 50 deletes down: <1 sec | 33 sec +Delete local dir | Queued 50 deletes up: 9 sec | 13 sec -Create two directories required by rclone docker plugin: -``` -sudo mkdir -p /var/lib/docker-plugins/rclone/config -sudo mkdir -p /var/lib/docker-plugins/rclone/cache -``` +This next data is from a user's application. They had ~400GB of data +over 1.96 million files being sync'ed between a Windows local disk and some +remote cloud. The file full path length was on average 35 characters +(which factors into load time and RAM required). -Install the managed rclone docker plugin for your architecture (here `amd64`): -``` -docker plugin install rclone/docker-volume-rclone:amd64 args="-v" --alias rclone --grant-all-permissions -docker plugin list -``` +- Loading the prior listing into memory (1.96 million files, listing file + size 140 MB) took ~30 sec and occupied about 1 GB of RAM. +- Getting a fresh listing of the local file system (producing the + 140 MB output file) took about XXX sec. +- Getting a fresh listing of the remote file system (producing the 140 MB + output file) took about XXX sec. The network download speed was measured + at XXX Mb/s. +- Once the prior and current Path1 and Path2 listings were loaded (a total + of four to be loaded, two at a time), determining the deltas was pretty + quick (a few seconds for this test case), and the transfer time for any + files to be copied was dominated by the network bandwidth. -Create your [SFTP volume](https://rclone.org/sftp/#standard-options): -``` -docker volume create firstvolume -d rclone -o type=sftp -o sftp-host=_hostname_ -o sftp-user=_username_ -o sftp-pass=_password_ -o allow-other=true -``` +## References -Note that since all options are static, you don't even have to run -`rclone config` or create the `rclone.conf` file (but the `config` directory -should still be present). In the simplest case you can use `localhost` -as _hostname_ and your SSH credentials as _username_ and _password_. -You can also change the remote path to your home directory on the host, -for example `-o path=/home/username`. +rclone's bisync implementation was derived from +the [rclonesync-V2](https://github.com/cjnaz/rclonesync-V2) project, +including documentation and test mechanisms, +with [@cjnaz](https://github.com/cjnaz)'s full support and encouragement. +`rclone bisync` is similar in nature to a range of other projects: -Time to create a test container and mount the volume into it: -``` -docker run --rm -it -v firstvolume:/mnt --workdir /mnt ubuntu:latest bash -``` +- [unison](https://github.com/bcpierce00/unison) +- [syncthing](https://github.com/syncthing/syncthing) +- [cjnaz/rclonesync](https://github.com/cjnaz/rclonesync-V2) +- [ConorWilliams/rsinc](https://github.com/ConorWilliams/rsinc) +- [jwink3101/syncrclone](https://github.com/Jwink3101/syncrclone) +- [DavideRossi/upback](https://github.com/DavideRossi/upback) -If all goes well, you will enter the new container and change right to -the mounted SFTP remote. You can type `ls` to list the mounted directory -or otherwise play with it. Type `exit` when you are done. -The container will stop but the volume will stay, ready to be reused. -When it's not needed anymore, remove it: -``` -docker volume list -docker volume remove firstvolume -``` +Bisync adopts the differential synchronization technique, which is +based on keeping history of changes performed by both synchronizing sides. +See the _Dual Shadow Method_ section in +[Neil Fraser's article](https://neil.fraser.name/writing/sync/). -Now let us try **something more elaborate**: -[Google Drive](https://rclone.org/drive/) volume on multi-node Docker Swarm. +Also note a number of academic publications by +[Benjamin Pierce](http://www.cis.upenn.edu/%7Ebcpierce/papers/index.shtml#File%20Synchronization) +about _Unison_ and synchronization in general. -You should start from installing Docker and FUSE, creating plugin -directories and installing rclone plugin on _every_ swarm node. -Then [setup the Swarm](https://docs.docker.com/engine/swarm/swarm-mode/). +## Changelog -Google Drive volumes need an access token which can be setup via web -browser and will be periodically renewed by rclone. The managed -plugin cannot run a browser so we will use a technique similar to the -[rclone setup on a headless box](https://rclone.org/remote_setup/). +### `v1.64` +* Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Dry%20runs%20are%20not%20completely%20dry) +causing dry runs to inadvertently commit filter changes +* Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=2.%20%2D%2Dresync%20deletes%20data%2C%20contrary%20to%20docs) +causing `--resync` to erroneously delete empty folders and duplicate files unique to Path2 +* `--check-access` is now enforced during `--resync`, preventing data loss in [certain user error scenarios](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=%2D%2Dcheck%2Daccess%20doesn%27t%20always%20fail%20when%20it%20should) +* Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=5.%20Bisync%20reads%20files%20in%20excluded%20directories%20during%20delete%20operations) +causing bisync to consider more files than necessary due to overbroad filters during delete operations +* [Improved detection of false positive change conflicts](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Identical%20files%20should%20be%20left%20alone%2C%20even%20if%20new/newer/changed%20on%20both%20sides) +(identical files are now left alone instead of renamed) +* Added [support for `--create-empty-src-dirs`](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=3.%20Bisync%20should%20create/delete%20empty%20directories%20as%20sync%20does%2C%20when%20%2D%2Dcreate%2Dempty%2Dsrc%2Ddirs%20is%20passed) +* Added experimental `--resilient` mode to allow [recovery from self-correctable errors](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=2.%20Bisync%20should%20be%20more%20resilient%20to%20self%2Dcorrectable%20errors) +* Added [new `--ignore-listing-checksum` flag](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=6.%20%2D%2Dignore%2Dchecksum%20should%20be%20split%20into%20two%20flags%20for%20separate%20purposes) +to distinguish from `--ignore-checksum` +* [Performance improvements](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=6.%20Deletes%20take%20several%20times%20longer%20than%20copies) for large remotes +* Documentation and testing improvements -Run [rclone config](https://rclone.org/commands/rclone_config_create/) -on _another_ machine equipped with _web browser_ and graphical user interface. -Create the [Google Drive remote](https://rclone.org/drive/#standard-options). -When done, transfer the resulting `rclone.conf` to the Swarm cluster -and save as `/var/lib/docker-plugins/rclone/config/rclone.conf` -on _every_ node. By default this location is accessible only to the -root user so you will need appropriate privileges. The resulting config -will look like this: -``` -[gdrive] -type = drive -scope = drive -drive_id = 1234567... -root_folder_id = 0Abcd... -token = {"access_token":...} -``` +# Release signing -Now create the file named `example.yml` with a swarm stack description -like this: -``` -version: '3' -services: - heimdall: - image: linuxserver/heimdall:latest - ports: [8080:80] - volumes: [configdata:/config] -volumes: - configdata: - driver: rclone - driver_opts: - remote: 'gdrive:heimdall' - allow_other: 'true' - vfs_cache_mode: full - poll_interval: 0 -``` +The hashes of the binary artefacts of the rclone release are signed +with a public PGP/GPG key. This can be verified manually as described +below. -and run the stack: -``` -docker stack deploy example -c ./example.yml -``` +The same mechanism is also used by [rclone selfupdate](https://rclone.org/commands/rclone_selfupdate/) +to verify that the release has not been tampered with before the new +update is installed. This checks the SHA256 hash and the signature +with a public key compiled into the rclone binary. + +## Release signing key + +You may obtain the release signing key from: + +- From [KEYS](/KEYS) on this website - this file contains all past signing keys also. +- The git repository hosted on GitHub - https://github.com/rclone/rclone/blob/master/docs/content/KEYS +- `gpg --keyserver hkps://keys.openpgp.org --search nick@craig-wood.com` +- `gpg --keyserver hkps://keyserver.ubuntu.com --search nick@craig-wood.com` +- https://www.craig-wood.com/nick/pub/pgp-key.txt + +After importing the key, verify that the fingerprint of one of the +keys matches: `FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA` as this key is used for signing. + +We recommend that you cross-check the fingerprint shown above through +the domains listed below. By cross-checking the integrity of the +fingerprint across multiple domains you can be confident that you +obtained the correct key. + +- The [source for this page on GitHub](https://github.com/rclone/rclone/blob/master/docs/content/release_signing.md). +- Through DNS `dig key.rclone.org txt` + +If you find anything that doesn't not match, please contact the +developers at once. + +## How to verify the release + +In the release directory you will see the release files and some files called `MD5SUMS`, `SHA1SUMS` and `SHA256SUMS`. -After a few seconds docker will spread the parsed stack description -over cluster, create the `example_heimdall` service on port _8080_, -run service containers on one or more cluster nodes and request -the `example_configdata` volume from rclone plugins on the node hosts. -You can use the following commands to confirm results: ``` -docker service ls -docker service ps example_heimdall -docker volume ls +$ rclone lsf --http-url https://downloads.rclone.org/v1.63.1 :http: +MD5SUMS +SHA1SUMS +SHA256SUMS +rclone-v1.63.1-freebsd-386.zip +rclone-v1.63.1-freebsd-amd64.zip +... +rclone-v1.63.1-windows-arm64.zip +rclone-v1.63.1.tar.gz +version.txt ``` -Point your browser to `http://cluster.host.address:8080` and play with -the service. Stop it with `docker stack remove example` when you are done. -Note that the `example_configdata` volume(s) created on demand at the -cluster nodes will not be automatically removed together with the stack -but stay for future reuse. You can remove them manually by invoking -the `docker volume remove example_configdata` command on every node. +The `MD5SUMS`, `SHA1SUMS` and `SHA256SUMS` contain hashes of the +binary files in the release directory along with a signature. -## Creating Volumes via CLI +For example: -Volumes can be created with [docker volume create](https://docs.docker.com/engine/reference/commandline/volume_create/). -Here are a few examples: ``` -docker volume create vol1 -d rclone -o remote=storj: -o vfs-cache-mode=full -docker volume create vol2 -d rclone -o remote=:storj,access_grant=xxx:heimdall -docker volume create vol3 -d rclone -o type=storj -o path=heimdall -o storj-access-grant=xxx -o poll-interval=0 +$ rclone cat --http-url https://downloads.rclone.org/v1.63.1 :http:SHA256SUMS +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +f6d1b2d7477475ce681bdce8cb56f7870f174cb6b2a9ac5d7b3764296ea4a113 rclone-v1.63.1-freebsd-386.zip +7266febec1f01a25d6575de51c44ddf749071a4950a6384e4164954dff7ac37e rclone-v1.63.1-freebsd-amd64.zip +... +66ca083757fb22198309b73879831ed2b42309892394bf193ff95c75dff69c73 rclone-v1.63.1-windows-amd64.zip +bbb47c16882b6c5f2e8c1b04229378e28f68734c613321ef0ea2263760f74cd0 rclone-v1.63.1-windows-arm64.zip +-----BEGIN PGP SIGNATURE----- + +iF0EARECAB0WIQT79zfs6firGGBL0qyTk14C/ztU+gUCZLVKJQAKCRCTk14C/ztU ++pZuAJ0XJ+QWLP/3jCtkmgcgc4KAwd/rrwCcCRZQ7E+oye1FPY46HOVzCFU3L7g= +=8qrL +-----END PGP SIGNATURE----- ``` -Note the `-d rclone` flag that tells docker to request volume from the -rclone driver. This works even if you installed managed driver by its full -name `rclone/docker-volume-rclone` because you provided the `--alias rclone` -option. +### Download the files + +The first step is to download the binary and SUMs file and verify that +the SUMs you have downloaded match. Here we download +`rclone-v1.63.1-windows-amd64.zip` - choose the binary (or binaries) +appropriate to your architecture. We've also chosen the `SHA256SUMS` +as these are the most secure. You could verify the other types of hash +also for extra security. `rclone selfupdate` verifies just the +`SHA256SUMS`. -Volumes can be inspected as follows: ``` -docker volume list -docker volume inspect vol1 +$ mkdir /tmp/check +$ cd /tmp/check +$ rclone copy --http-url https://downloads.rclone.org/v1.63.1 :http:SHA256SUMS . +$ rclone copy --http-url https://downloads.rclone.org/v1.63.1 :http:rclone-v1.63.1-windows-amd64.zip . ``` -## Volume Configuration +### Verify the signatures -Rclone flags and volume options are set via the `-o` flag to the -`docker volume create` command. They include backend-specific parameters -as well as mount and _VFS_ options. Also there are a few -special `-o` options: -`remote`, `fs`, `type`, `path`, `mount-type` and `persist`. +First verify the signatures on the SHA256 file. -`remote` determines an existing remote name from the config file, with -trailing colon and optionally with a remote path. See the full syntax in -the [rclone documentation](https://rclone.org/docs/#syntax-of-remote-paths). -This option can be aliased as `fs` to prevent confusion with the -_remote_ parameter of such backends as _crypt_ or _alias_. +Import the key. See above for ways to verify this key is correct. -The `remote=:backend:dir/subdir` syntax can be used to create -[on-the-fly (config-less) remotes](https://rclone.org/docs/#backend-path-to-dir), -while the `type` and `path` options provide a simpler alternative for this. -Using two split options ``` --o type=backend -o path=dir/subdir +$ gpg --keyserver keyserver.ubuntu.com --receive-keys FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA +gpg: key 93935E02FF3B54FA: public key "Nick Craig-Wood " imported +gpg: Total number processed: 1 +gpg: imported: 1 ``` -is equivalent to the combined syntax + +Then check the signature: + ``` --o remote=:backend:dir/subdir +$ gpg --verify SHA256SUMS +gpg: Signature made Mon 17 Jul 2023 15:03:17 BST +gpg: using DSA key FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA +gpg: Good signature from "Nick Craig-Wood " [ultimate] ``` -but is arguably easier to parameterize in scripts. -The `path` part is optional. -[Mount and VFS options](https://rclone.org/commands/rclone_serve_docker/#options) -as well as [backend parameters](https://rclone.org/flags/#backend-flags) are named -like their twin command-line flags without the `--` CLI prefix. -Optionally you can use underscores instead of dashes in option names. -For example, `--vfs-cache-mode full` becomes -`-o vfs-cache-mode=full` or `-o vfs_cache_mode=full`. -Boolean CLI flags without value will gain the `true` value, e.g. -`--allow-other` becomes `-o allow-other=true` or `-o allow_other=true`. +Verify the signature was good and is using the fingerprint shown above. -Please note that you can provide parameters only for the backend immediately -referenced by the backend type of mounted `remote`. -If this is a wrapping backend like _alias, chunker or crypt_, you cannot -provide options for the referred to remote or backend. This limitation is -imposed by the rclone connection string parser. The only workaround is to -feed plugin with `rclone.conf` or configure plugin arguments (see below). +Repeat for `MD5SUMS` and `SHA1SUMS` if desired. -## Special Volume Options +### Verify the hashes -`mount-type` determines the mount method and in general can be one of: -`mount`, `cmount`, or `mount2`. This can be aliased as `mount_type`. -It should be noted that the managed rclone docker plugin currently does -not support the `cmount` method and `mount2` is rarely needed. -This option defaults to the first found method, which is usually `mount` -so you generally won't need it. +Now that we know the signatures on the hashes are OK we can verify the +binaries match the hashes, completing the verification. -`persist` is a reserved boolean (true/false) option. -In future it will allow to persist on-the-fly remotes in the plugin -`rclone.conf` file. +``` +$ sha256sum -c SHA256SUMS 2>&1 | grep OK +rclone-v1.63.1-windows-amd64.zip: OK +``` -## Connection Strings +Or do the check with rclone -The `remote` value can be extended -with [connection strings](https://rclone.org/docs/#connection-strings) -as an alternative way to supply backend parameters. This is equivalent -to the `-o` backend options with one _syntactic difference_. -Inside connection string the backend prefix must be dropped from parameter -names but in the `-o param=value` array it must be present. -For instance, compare the following option array ``` --o remote=:sftp:/home -o sftp-host=localhost +$ rclone hashsum sha256 -C SHA256SUMS rclone-v1.63.1-windows-amd64.zip +2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 0 +2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 1 +2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 49 +2023/09/11 10:53:58 NOTICE: SHA256SUMS: 4 warning(s) suppressed... += rclone-v1.63.1-windows-amd64.zip +2023/09/11 10:53:58 NOTICE: Local file system at /tmp/check: 0 differences found +2023/09/11 10:53:58 NOTICE: Local file system at /tmp/check: 1 matching files ``` -with equivalent connection string: + +### Verify signatures and hashes together + +You can verify the signatures and hashes in one command line like this: + ``` --o remote=:sftp,host=localhost:/home +$ gpg --decrypt SHA256SUMS | sha256sum -c --ignore-missing +gpg: Signature made Mon 17 Jul 2023 15:03:17 BST +gpg: using DSA key FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA +gpg: Good signature from "Nick Craig-Wood " [ultimate] +gpg: aka "Nick Craig-Wood " [unknown] +rclone-v1.63.1-windows-amd64.zip: OK ``` -This difference exists because flag options `-o key=val` include not only -backend parameters but also mount/VFS flags and possibly other settings. -Also it allows to discriminate the `remote` option from the `crypt-remote` -(or similarly named backend parameters) and arguably simplifies scripting -due to clearer value substitution. -## Using with Swarm or Compose +# 1Fichier -Both _Docker Swarm_ and _Docker Compose_ use -[YAML](http://yaml.org/spec/1.2/spec.html)-formatted text files to describe -groups (stacks) of containers, their properties, networks and volumes. -_Compose_ uses the [compose v2](https://docs.docker.com/compose/compose-file/compose-file-v2/#volume-configuration-reference) format, -_Swarm_ uses the [compose v3](https://docs.docker.com/compose/compose-file/compose-file-v3/#volume-configuration-reference) format. -They are mostly similar, differences are explained in the -[docker documentation](https://docs.docker.com/compose/compose-file/compose-versioning/#upgrading). +This is a backend for the [1fichier](https://1fichier.com) cloud +storage service. Note that a Premium subscription is required to use +the API. -Volumes are described by the children of the top-level `volumes:` node. -Each of them should be named after its volume and have at least two -elements, the self-explanatory `driver: rclone` value and the -`driver_opts:` structure playing the same role as `-o key=val` CLI flags: +Paths are specified as `remote:path` -``` -volumes: - volume_name_1: - driver: rclone - driver_opts: - remote: 'gdrive:' - allow_other: 'true' - vfs_cache_mode: full - token: '{"type": "borrower", "expires": "2021-12-31"}' - poll_interval: 0 -``` +Paths may be as deep as required, e.g. `remote:directory/subdirectory`. -Notice a few important details: -- YAML prefers `_` in option names instead of `-`. -- YAML treats single and double quotes interchangeably. - Simple strings and integers can be left unquoted. -- Boolean values must be quoted like `'true'` or `"false"` because - these two words are reserved by YAML. -- The filesystem string is keyed with `remote` (or with `fs`). - Normally you can omit quotes here, but if the string ends with colon, - you **must** quote it like `remote: "storage_box:"`. -- YAML is picky about surrounding braces in values as this is in fact - another [syntax for key/value mappings](http://yaml.org/spec/1.2/spec.html#id2790832). - For example, JSON access tokens usually contain double quotes and - surrounding braces, so you must put them in single quotes. +## Configuration -## Installing as Managed Plugin +The initial setup for 1Fichier involves getting the API key from the website which you +need to do in your browser. -Docker daemon can install plugins from an image registry and run them managed. -We maintain the -[docker-volume-rclone](https://hub.docker.com/p/rclone/docker-volume-rclone/) -plugin image on [Docker Hub](https://hub.docker.com). +Here is an example of how to make a remote called `remote`. First run: -Rclone volume plugin requires **Docker Engine >= 19.03.15** + rclone config -The plugin requires presence of two directories on the host before it can -be installed. Note that plugin will **not** create them automatically. -By default they must exist on host at the following locations -(though you can tweak the paths): -- `/var/lib/docker-plugins/rclone/config` - is reserved for the `rclone.conf` config file and **must** exist - even if it's empty and the config file is not present. -- `/var/lib/docker-plugins/rclone/cache` - holds the plugin state file as well as optional VFS caches. +This will guide you through an interactive setup process: -You can [install managed plugin](https://docs.docker.com/engine/reference/commandline/plugin_install/) -with default settings as follows: -``` -docker plugin install rclone/docker-volume-rclone:amd64 --grant-all-permissions --alias rclone ``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value +[snip] +XX / 1Fichier + \ "fichier" +[snip] +Storage> fichier +** See help for fichier backend at: https://rclone.org/fichier/ ** -The `:amd64` part of the image specification after colon is called a _tag_. -Usually you will want to install the latest plugin for your architecture. In -this case the tag will just name it, like `amd64` above. The following plugin -architectures are currently available: -- `amd64` -- `arm64` -- `arm-v7` +Your API Key, get it from https://1fichier.com/console/params.pl +Enter a string value. Press Enter for the default (""). +api_key> example_key + +Edit advanced config? (y/n) +y) Yes +n) No +y/n> +Remote config +-------------------- +[remote] +type = fichier +api_key = example_key +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -Sometimes you might want a concrete plugin version, not the latest one. -Then you should use image tag in the form `:ARCHITECTURE-VERSION`. -For example, to install plugin version `v1.56.2` on architecture `arm64` -you will use tag `arm64-1.56.2` (note the removed `v`) so the full image -specification becomes `rclone/docker-volume-rclone:arm64-1.56.2`. +Once configured you can then use `rclone` like this, -We also provide the `latest` plugin tag, but since docker does not support -multi-architecture plugins as of the time of this writing, this tag is -currently an **alias for `amd64`**. -By convention the `latest` tag is the default one and can be omitted, thus -both `rclone/docker-volume-rclone:latest` and just `rclone/docker-volume-rclone` -will refer to the latest plugin release for the `amd64` platform. +List directories in top level of your 1Fichier account -Also the `amd64` part can be omitted from the versioned rclone plugin tags. -For example, rclone image reference `rclone/docker-volume-rclone:amd64-1.56.2` -can be abbreviated as `rclone/docker-volume-rclone:1.56.2` for convenience. -However, for non-intel architectures you still have to use the full tag as -`amd64` or `latest` will fail to start. + rclone lsd remote: -Managed plugin is in fact a special container running in a namespace separate -from normal docker containers. Inside it runs the `rclone serve docker` -command. The config and cache directories are bind-mounted into the -container at start. The docker daemon connects to a unix socket created -by the command inside the container. The command creates on-demand remote -mounts right inside, then docker machinery propagates them through kernel -mount namespaces and bind-mounts into requesting user containers. +List all the files in your 1Fichier account -You can tweak a few plugin settings after installation when it's disabled -(not in use), for instance: -``` -docker plugin disable rclone -docker plugin set rclone RCLONE_VERBOSE=2 config=/etc/rclone args="--vfs-cache-mode=writes --allow-other" -docker plugin enable rclone -docker plugin inspect rclone -``` + rclone ls remote: -Note that if docker refuses to disable the plugin, you should find and -remove all active volumes connected with it as well as containers and -swarm services that use them. This is rather tedious so please carefully -plan in advance. +To copy a local directory to a 1Fichier directory called backup -You can tweak the following settings: -`args`, `config`, `cache`, `HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY` -and `RCLONE_VERBOSE`. -It's _your_ task to keep plugin settings in sync across swarm cluster nodes. + rclone copy /home/source remote:backup -`args` sets command-line arguments for the `rclone serve docker` command -(_none_ by default). Arguments should be separated by space so you will -normally want to put them in quotes on the -[docker plugin set](https://docs.docker.com/engine/reference/commandline/plugin_set/) -command line. Both [serve docker flags](https://rclone.org/commands/rclone_serve_docker/#options) -and [generic rclone flags](https://rclone.org/flags/) are supported, including backend -parameters that will be used as defaults for volume creation. -Note that plugin will fail (due to [this docker bug](https://github.com/moby/moby/blob/v20.10.7/plugin/v2/plugin.go#L195)) -if the `args` value is empty. Use e.g. `args="-v"` as a workaround. +### Modification times and hashes -`config=/host/dir` sets alternative host location for the config directory. -Plugin will look for `rclone.conf` here. It's not an error if the config -file is not present but the directory must exist. Please note that plugin -can periodically rewrite the config file, for example when it renews -storage access tokens. Keep this in mind and try to avoid races between -the plugin and other instances of rclone on the host that might try to -change the config simultaneously resulting in corrupted `rclone.conf`. -You can also put stuff like private key files for SFTP remotes in this -directory. Just note that it's bind-mounted inside the plugin container -at the predefined path `/data/config`. For example, if your key file is -named `sftp-box1.key` on the host, the corresponding volume config option -should read `-o sftp-key-file=/data/config/sftp-box1.key`. +1Fichier does not support modification times. It supports the Whirlpool hash algorithm. -`cache=/host/dir` sets alternative host location for the _cache_ directory. -The plugin will keep VFS caches here. Also it will create and maintain -the `docker-plugin.state` file in this directory. When the plugin is -restarted or reinstalled, it will look in this file to recreate any volumes -that existed previously. However, they will not be re-mounted into -consuming containers after restart. Usually this is not a problem as -the docker daemon normally will restart affected user containers after -failures, daemon restarts or host reboots. +### Duplicated files -`RCLONE_VERBOSE` sets plugin verbosity from `0` (errors only, by default) -to `2` (debugging). Verbosity can be also tweaked via `args="-v [-v] ..."`. -Since arguments are more generic, you will rarely need this setting. -The plugin output by default feeds the docker daemon log on local host. -Log entries are reflected as _errors_ in the docker log but retain their -actual level assigned by rclone in the encapsulated message string. +1Fichier can have two files with exactly the same name and path (unlike a +normal file system). -`HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY` customize the plugin proxy settings. +Duplicated files cause problems with the syncing and you will see +messages in the log about duplicates. -You can set custom plugin options right when you install it, _in one go_: -``` -docker plugin remove rclone -docker plugin install rclone/docker-volume-rclone:amd64 \ - --alias rclone --grant-all-permissions \ - args="-v --allow-other" config=/etc/rclone -docker plugin inspect rclone -``` +### Restricted filename characters -## Healthchecks +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) +the following characters are also replaced: -The docker plugin volume protocol doesn't provide a way for plugins -to inform the docker daemon that a volume is (un-)available. -As a workaround you can setup a healthcheck to verify that the mount -is responding, for example: -``` -services: - my_service: - image: my_image - healthcheck: - test: ls /path/to/rclone/mount || exit 1 - interval: 1m - timeout: 15s - retries: 3 - start_period: 15s -``` +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| \ | 0x5C | \ | +| < | 0x3C | < | +| > | 0x3E | > | +| " | 0x22 | " | +| $ | 0x24 | $ | +| ` | 0x60 | ` | +| ' | 0x27 | ' | -## Running Plugin under Systemd +File names can also not start or end with the following characters. +These only get replaced if they are the first or last character in the +name: -In most cases you should prefer managed mode. Moreover, MacOS and Windows -do not support native Docker plugins. Please use managed mode on these -systems. Proceed further only if you are on Linux. +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| SP | 0x20 | ␠ | -First, [install rclone](https://rclone.org/install/). -You can just run it (type `rclone serve docker` and hit enter) for the test. +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. -Install _FUSE_: -``` -sudo apt-get -y install fuse -``` -Download two systemd configuration files: -[docker-volume-rclone.service](https://raw.githubusercontent.com/rclone/rclone/master/contrib/docker-plugin/systemd/docker-volume-rclone.service) -and [docker-volume-rclone.socket](https://raw.githubusercontent.com/rclone/rclone/master/contrib/docker-plugin/systemd/docker-volume-rclone.socket). +### Standard options -Put them to the `/etc/systemd/system/` directory: -``` -cp docker-volume-plugin.service /etc/systemd/system/ -cp docker-volume-plugin.socket /etc/systemd/system/ -``` +Here are the Standard options specific to fichier (1Fichier). -Please note that all commands in this section must be run as _root_ but -we omit `sudo` prefix for brevity. -Now create directories required by the service: -``` -mkdir -p /var/lib/docker-volumes/rclone -mkdir -p /var/lib/docker-plugins/rclone/config -mkdir -p /var/lib/docker-plugins/rclone/cache -``` +#### --fichier-api-key -Run the docker plugin service in the socket activated mode: -``` -systemctl daemon-reload -systemctl start docker-volume-rclone.service -systemctl enable docker-volume-rclone.socket -systemctl start docker-volume-rclone.socket -systemctl restart docker -``` +Your API Key, get it from https://1fichier.com/console/params.pl. -Or run the service directly: -- run `systemctl daemon-reload` to let systemd pick up new config -- run `systemctl enable docker-volume-rclone.service` to make the new - service start automatically when you power on your machine. -- run `systemctl start docker-volume-rclone.service` - to start the service now. -- run `systemctl restart docker` to restart docker daemon and let it - detect the new plugin socket. Note that this step is not needed in - managed mode where docker knows about plugin state changes. +Properties: -The two methods are equivalent from the user perspective, but I personally -prefer socket activation. +- Config: api_key +- Env Var: RCLONE_FICHIER_API_KEY +- Type: string +- Required: false -## Troubleshooting +### Advanced options -You can [see managed plugin settings](https://docs.docker.com/engine/extend/#debugging-plugins) -with -``` -docker plugin list -docker plugin inspect rclone -``` -Note that docker (including latest 20.10.7) will not show actual values -of `args`, just the defaults. +Here are the Advanced options specific to fichier (1Fichier). -Use `journalctl --unit docker` to see managed plugin output as part of -the docker daemon log. Note that docker reflects plugin lines as _errors_ -but their actual level can be seen from encapsulated message string. +#### --fichier-shared-folder -You will usually install the latest version of managed plugin for your platform. -Use the following commands to print the actual installed version: -``` -PLUGID=$(docker plugin list --no-trunc | awk '/rclone/{print$1}') -sudo runc --root /run/docker/runtime-runc/plugins.moby exec $PLUGID rclone version -``` +If you want to download a shared folder, add this parameter. -You can even use `runc` to run shell inside the plugin container: -``` -sudo runc --root /run/docker/runtime-runc/plugins.moby exec --tty $PLUGID bash -``` +Properties: -Also you can use curl to check the plugin socket connectivity: -``` -docker plugin list --no-trunc -PLUGID=123abc... -sudo curl -H Content-Type:application/json -XPOST -d {} --unix-socket /run/docker/plugins/$PLUGID/rclone.sock http://localhost/Plugin.Activate -``` -though this is rarely needed. +- Config: shared_folder +- Env Var: RCLONE_FICHIER_SHARED_FOLDER +- Type: string +- Required: false -## Caveats +#### --fichier-file-password -Finally I'd like to mention a _caveat with updating volume settings_. -Docker CLI does not have a dedicated command like `docker volume update`. -It may be tempting to invoke `docker volume create` with updated options -on existing volume, but there is a gotcha. The command will do nothing, -it won't even return an error. I hope that docker maintainers will fix -this some day. In the meantime be aware that you must remove your volume -before recreating it with new settings: -``` -docker volume remove my_vol -docker volume create my_vol -d rclone -o opt1=new_val1 ... -``` +If you want to download a shared file that is password protected, add this parameter. -and verify that settings did update: -``` -docker volume list -docker volume inspect my_vol -``` +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -If docker refuses to remove the volume, you should find containers -or swarm services that use it and stop them first. +Properties: -## Getting started {#getting-started} +- Config: file_password +- Env Var: RCLONE_FICHIER_FILE_PASSWORD +- Type: string +- Required: false -- [Install rclone](https://rclone.org/install/) and setup your remotes. -- Bisync will create its working directory - at `~/.cache/rclone/bisync` on Linux - or `C:\Users\MyLogin\AppData\Local\rclone\bisync` on Windows. - Make sure that this location is writable. -- Run bisync with the `--resync` flag, specifying the paths - to the local and remote sync directory roots. -- For successive sync runs, leave off the `--resync` flag. -- Consider using a [filters file](#filtering) for excluding - unnecessary files and directories from the sync. -- Consider setting up the [--check-access](#check-access) feature - for safety. -- On Linux, consider setting up a [crontab entry](#cron). bisync can - safely run in concurrent cron jobs thanks to lock files it maintains. +#### --fichier-folder-password -Here is a typical run log (with timestamps removed for clarity): +If you want to list the files in a shared folder that is password protected, add this parameter. -``` -rclone bisync /testdir/path1/ /testdir/path2/ --verbose -INFO : Synching Path1 "/testdir/path1/" with Path2 "/testdir/path2/" -INFO : Path1 checking for diffs -INFO : - Path1 File is new - file11.txt -INFO : - Path1 File is newer - file2.txt -INFO : - Path1 File is newer - file5.txt -INFO : - Path1 File is newer - file7.txt -INFO : - Path1 File was deleted - file4.txt -INFO : - Path1 File was deleted - file6.txt -INFO : - Path1 File was deleted - file8.txt -INFO : Path1: 7 changes: 1 new, 3 newer, 0 older, 3 deleted -INFO : Path2 checking for diffs -INFO : - Path2 File is new - file10.txt -INFO : - Path2 File is newer - file1.txt -INFO : - Path2 File is newer - file5.txt -INFO : - Path2 File is newer - file6.txt -INFO : - Path2 File was deleted - file3.txt -INFO : - Path2 File was deleted - file7.txt -INFO : - Path2 File was deleted - file8.txt -INFO : Path2: 7 changes: 1 new, 3 newer, 0 older, 3 deleted -INFO : Applying changes -INFO : - Path1 Queue copy to Path2 - /testdir/path2/file11.txt -INFO : - Path1 Queue copy to Path2 - /testdir/path2/file2.txt -INFO : - Path2 Queue delete - /testdir/path2/file4.txt -NOTICE: - WARNING New or changed in both paths - file5.txt -NOTICE: - Path1 Renaming Path1 copy - /testdir/path1/file5.txt..path1 -NOTICE: - Path1 Queue copy to Path2 - /testdir/path2/file5.txt..path1 -NOTICE: - Path2 Renaming Path2 copy - /testdir/path2/file5.txt..path2 -NOTICE: - Path2 Queue copy to Path1 - /testdir/path1/file5.txt..path2 -INFO : - Path2 Queue copy to Path1 - /testdir/path1/file6.txt -INFO : - Path1 Queue copy to Path2 - /testdir/path2/file7.txt -INFO : - Path2 Queue copy to Path1 - /testdir/path1/file1.txt -INFO : - Path2 Queue copy to Path1 - /testdir/path1/file10.txt -INFO : - Path1 Queue delete - /testdir/path1/file3.txt -INFO : - Path2 Do queued copies to - Path1 -INFO : - Path1 Do queued copies to - Path2 -INFO : - Do queued deletes on - Path1 -INFO : - Do queued deletes on - Path2 -INFO : Updating listings -INFO : Validating listings for Path1 "/testdir/path1/" vs Path2 "/testdir/path2/" -INFO : Bisync successful -``` +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -## Command line syntax +Properties: -``` -$ rclone bisync --help -Usage: - rclone bisync remote1:path1 remote2:path2 [flags] +- Config: folder_password +- Env Var: RCLONE_FICHIER_FOLDER_PASSWORD +- Type: string +- Required: false -Positional arguments: - Path1, Path2 Local path, or remote storage with ':' plus optional path. - Type 'rclone listremotes' for list of configured remotes. +#### --fichier-cdn -Optional Flags: - --check-access Ensure expected `RCLONE_TEST` files are found on - both Path1 and Path2 filesystems, else abort. - --check-filename FILENAME Filename for `--check-access` (default: `RCLONE_TEST`) - --check-sync CHOICE Controls comparison of final listings: - `true | false | only` (default: true) - If set to `only`, bisync will only compare listings - from the last run but skip actual sync. - --filters-file PATH Read filtering patterns from a file - --max-delete PERCENT Safety check on maximum percentage of deleted files allowed. - If exceeded, the bisync run will abort. (default: 50%) - --force Bypass `--max-delete` safety check and run the sync. - Consider using with `--verbose` - --create-empty-src-dirs Sync creation and deletion of empty directories. - (Not compatible with --remove-empty-dirs) - --remove-empty-dirs Remove empty directories at the final cleanup step. - -1, --resync Performs the resync run. - Warning: Path1 files may overwrite Path2 versions. - Consider using `--verbose` or `--dry-run` first. - --ignore-listing-checksum Do not use checksums for listings - (add --ignore-checksum to additionally skip post-copy checksum checks) - --resilient Allow future runs to retry after certain less-serious errors, - instead of requiring --resync. Use at your own risk! - --localtime Use local time in listings (default: UTC) - --no-cleanup Retain working files (useful for troubleshooting and testing). - --workdir PATH Use custom working directory (useful for testing). - (default: `~/.cache/rclone/bisync`) - -n, --dry-run Go through the motions - No files are copied/deleted. - -v, --verbose Increases logging verbosity. - May be specified more than once for more details. - -h, --help help for bisync -``` +Set if you wish to use CDN download links. -Arbitrary rclone flags may be specified on the -[bisync command line](https://rclone.org/commands/rclone_bisync/), for example -`rclone bisync ./testdir/path1/ gdrive:testdir/path2/ --drive-skip-gdocs -v -v --timeout 10s` -Note that interactions of various rclone flags with bisync process flow -has not been fully tested yet. +Properties: -### Paths +- Config: cdn +- Env Var: RCLONE_FICHIER_CDN +- Type: bool +- Default: false -Path1 and Path2 arguments may be references to any mix of local directory -paths (absolute or relative), UNC paths (`//server/share/path`), -Windows drive paths (with a drive letter and `:`) or configured -[remotes](https://rclone.org/docs/#syntax-of-remote-paths) with optional subdirectory paths. -Cloud references are distinguished by having a `:` in the argument -(see [Windows support](#windows) below). +#### --fichier-encoding -Path1 and Path2 are treated equally, in that neither has priority for -file changes (except during [`--resync`](#resync)), and access efficiency does not change whether a remote -is on Path1 or Path2. +The encoding for the backend. -The listings in bisync working directory (default: `~/.cache/rclone/bisync`) -are named based on the Path1 and Path2 arguments so that separate syncs -to individual directories within the tree may be set up, e.g.: -`path_to_local_tree..dropbox_subdir.lst`. +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -Any empty directories after the sync on both the Path1 and Path2 -filesystems are not deleted by default, unless `--create-empty-src-dirs` is specified. -If the `--remove-empty-dirs` flag is specified, then both paths will have ALL empty directories purged -as the last step in the process. +Properties: -## Command-line flags +- Config: encoding +- Env Var: RCLONE_FICHIER_ENCODING +- Type: Encoding +- Default: Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot -#### --resync -This will effectively make both Path1 and Path2 filesystems contain a -matching superset of all files. Path2 files that do not exist in Path1 will -be copied to Path1, and the process will then copy the Path1 tree to Path2. -The `--resync` sequence is roughly equivalent to: -``` -rclone copy Path2 Path1 --ignore-existing -rclone copy Path1 Path2 -``` -Or, if using `--create-empty-src-dirs`: -``` -rclone copy Path2 Path1 --ignore-existing -rclone copy Path1 Path2 --create-empty-src-dirs -rclone copy Path2 Path1 --create-empty-src-dirs -``` +## Limitations -The base directories on both Path1 and Path2 filesystems must exist -or bisync will fail. This is required for safety - that bisync can verify -that both paths are valid. +`rclone about` is not supported by the 1Fichier backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. -When using `--resync`, a newer version of a file on the Path2 filesystem -will be overwritten by the Path1 filesystem version. -(Note that this is [NOT entirely symmetrical](https://github.com/rclone/rclone/issues/5681#issuecomment-938761815).) -Carefully evaluate deltas using [--dry-run](https://rclone.org/flags/#non-backend-flags). +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -[//]: # (I reverted a recent change in the above paragraph, as it was incorrect. -https://github.com/rclone/rclone/commit/dd72aff98a46c6e20848ac7ae5f7b19d45802493 ) +# Alias -For a resync run, one of the paths may be empty (no files in the path tree). -The resync run should result in files on both paths, else a normal non-resync -run will fail. +The `alias` remote provides a new name for another remote. -For a non-resync run, either path being empty (no files in the tree) fails with -`Empty current PathN listing. Cannot sync to an empty directory: X.pathN.lst` -This is a safety check that an unexpected empty path does not result in -deleting **everything** in the other path. +Paths may be as deep as required or a local path, +e.g. `remote:directory/subdirectory` or `/directory/subdirectory`. -#### --check-access +During the initial setup with `rclone config` you will specify the target +remote. The target remote can either be a local path or another remote. -Access check files are an additional safety measure against data loss. -bisync will ensure it can find matching `RCLONE_TEST` files in the same places -in the Path1 and Path2 filesystems. -`RCLONE_TEST` files are not generated automatically. -For `--check-access` to succeed, you must first either: -**A)** Place one or more `RCLONE_TEST` files in both systems, or -**B)** Set `--check-filename` to a filename already in use in various locations -throughout your sync'd fileset. Recommended methods for **A)** include: -* `rclone touch Path1/RCLONE_TEST` (create a new file) -* `rclone copyto Path1/RCLONE_TEST Path2/RCLONE_TEST` (copy an existing file) -* `rclone copy Path1/RCLONE_TEST Path2/RCLONE_TEST --include "RCLONE_TEST"` (copy multiple files at once, recursively) -* create the files manually (outside of rclone) -* run `bisync` once *without* `--check-access` to set matching files on both filesystems -will also work, but is not preferred, due to potential for user error -(you are temporarily disabling the safety feature). +Subfolders can be used in target remote. Assume an alias remote named `backup` +with the target `mydrive:private/backup`. Invoking `rclone mkdir backup:desktop` +is exactly the same as invoking `rclone mkdir mydrive:private/backup/desktop`. -Note that `--check-access` is still enforced on `--resync`, so `bisync --resync --check-access` -will not work as a method of initially setting the files (this is to ensure that bisync can't -[inadvertently circumvent its own safety switch](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=3.%20%2D%2Dcheck%2Daccess%20doesn%27t%20always%20fail%20when%20it%20should).) +There will be no special handling of paths containing `..` segments. +Invoking `rclone mkdir backup:../desktop` is exactly the same as invoking +`rclone mkdir mydrive:private/backup/../desktop`. +The empty path is not allowed as a remote. To alias the current directory +use `.` instead. -Time stamps and file contents for `RCLONE_TEST` files are not important, just the names and locations. -If you have symbolic links in your sync tree it is recommended to place -`RCLONE_TEST` files in the linked-to directory tree to protect against -bisync assuming a bunch of deleted files if the linked-to tree should not be -accessible. -See also the [--check-filename](--check-filename) flag. +The target remote can also be a [connection string](https://rclone.org/docs/#connection-strings). +This can be used to modify the config of a remote for different uses, e.g. +the alias `myDriveTrash` with the target remote `myDrive,trashed_only:` +can be used to only show the trashed files in `myDrive`. -#### --check-filename +## Configuration -Name of the file(s) used in access health validation. -The default `--check-filename` is `RCLONE_TEST`. -One or more files having this filename must exist, synchronized between your -source and destination filesets, in order for `--check-access` to succeed. -See [--check-access](#check-access) for additional details. +Here is an example of how to make an alias called `remote` for local folder. +First run: -#### --max-delete + rclone config + +This will guide you through an interactive setup process: + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Alias for an existing remote + \ "alias" +[snip] +Storage> alias +Remote or path to alias. +Can be "myremote:path/to/dir", "myremote:bucket", "myremote:" or "/local/path". +remote> /mnt/storage/backup +Remote config +-------------------- +[remote] +remote = /mnt/storage/backup +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +Current remotes: -As a safety check, if greater than the `--max-delete` percent of files were -deleted on either the Path1 or Path2 filesystem, then bisync will abort with -a warning message, without making any changes. -The default `--max-delete` is `50%`. -One way to trigger this limit is to rename a directory that contains more -than half of your files. This will appear to bisync as a bunch of deleted -files and a bunch of new files. -This safety check is intended to block bisync from deleting all of the -files on both filesystems due to a temporary network access issue, or if -the user had inadvertently deleted the files on one side or the other. -To force the sync, either set a different delete percentage limit, -e.g. `--max-delete 75` (allows up to 75% deletion), or use `--force` -to bypass the check. +Name Type +==== ==== +remote alias -Also see the [all files changed](#all-files-changed) check. +e) Edit existing remote +n) New remote +d) Delete remote +r) Rename remote +c) Copy remote +s) Set configuration password +q) Quit config +e/n/d/r/c/s/q> q +``` -#### --filters-file {#filters-file} +Once configured you can then use `rclone` like this, -By using rclone filter features you can exclude file types or directory -sub-trees from the sync. -See the [bisync filters](#filtering) section and generic -[--filter-from](https://rclone.org/filtering/#filter-from-read-filtering-patterns-from-a-file) -documentation. -An [example filters file](#example-filters-file) contains filters for -non-allowed files for synching with Dropbox. +List directories in top level in `/mnt/storage/backup` -If you make changes to your filters file then bisync requires a run -with `--resync`. This is a safety feature, which prevents existing files -on the Path1 and/or Path2 side from seeming to disappear from view -(since they are excluded in the new listings), which would fool bisync -into seeing them as deleted (as compared to the prior run listings), -and then bisync would proceed to delete them for real. + rclone lsd remote: -To block this from happening, bisync calculates an MD5 hash of the filters file -and stores the hash in a `.md5` file in the same place as your filters file. -On the next run with `--filters-file` set, bisync re-calculates the MD5 hash -of the current filters file and compares it to the hash stored in the `.md5` file. -If they don't match, the run aborts with a critical error and thus forces you -to do a `--resync`, likely avoiding a disaster. +List all the files in `/mnt/storage/backup` -#### --check-sync + rclone ls remote: -Enabled by default, the check-sync function checks that all of the same -files exist in both the Path1 and Path2 history listings. This _check-sync_ -integrity check is performed at the end of the sync run by default. -Any untrapped failing copy/deletes between the two paths might result -in differences between the two listings and in the untracked file content -differences between the two paths. A resync run would correct the error. +Copy another local directory to the alias directory called source -Note that the default-enabled integrity check locally executes a load of both -the final Path1 and Path2 listings, and thus adds to the run time of a sync. -Using `--check-sync=false` will disable it and may significantly reduce the -sync run times for very large numbers of files. + rclone copy /home/source remote:source -The check may be run manually with `--check-sync=only`. It runs only the -integrity check and terminates without actually synching. -See also: [Concurrent modifications](#concurrent-modifications) +### Standard options +Here are the Standard options specific to alias (Alias for an existing remote). -#### --ignore-listing-checksum +#### --alias-remote -By default, bisync will retrieve (or generate) checksums (for backends that support them) -when creating the listings for both paths, and store the checksums in the listing files. -`--ignore-listing-checksum` will disable this behavior, which may speed things up considerably, -especially on backends (such as [local](https://rclone.org/local/)) where hashes must be computed on the fly instead of retrieved. -Please note the following: +Remote or path to alias. -* While checksums are (by default) generated and stored in the listing files, -they are NOT currently used for determining diffs (deltas). -It is anticipated that full checksum support will be added in a future version. -* `--ignore-listing-checksum` is NOT the same as [`--ignore-checksum`](https://rclone.org/docs/#ignore-checksum), -and you may wish to use one or the other, or both. In a nutshell: -`--ignore-listing-checksum` controls whether checksums are considered when scanning for diffs, -while `--ignore-checksum` controls whether checksums are considered during the copy/sync operations that follow, -if there ARE diffs. -* Unless `--ignore-listing-checksum` is passed, bisync currently computes hashes for one path -*even when there's no common hash with the other path* -(for example, a [crypt](https://rclone.org/crypt/#modified-time-and-hashes) remote.) -* If both paths support checksums and have a common hash, -AND `--ignore-listing-checksum` was not specified when creating the listings, -`--check-sync=only` can be used to compare Path1 vs. Path2 checksums (as of the time the previous listings were created.) -However, `--check-sync=only` will NOT include checksums if the previous listings -were generated on a run using `--ignore-listing-checksum`. For a more robust integrity check of the current state, -consider using [`check`](commands/rclone_check/) -(or [`cryptcheck`](https://rclone.org/commands/rclone_cryptcheck/), if at least one path is a `crypt` remote.) +Can be "myremote:path/to/dir", "myremote:bucket", "myremote:" or "/local/path". -#### --resilient +Properties: -***Caution: this is an experimental feature. Use at your own risk!*** +- Config: remote +- Env Var: RCLONE_ALIAS_REMOTE +- Type: string +- Required: true -By default, most errors or interruptions will cause bisync to abort and -require [`--resync`](#resync) to recover. This is a safety feature, -to prevent bisync from running again until a user checks things out. -However, in some cases, bisync can go too far and enforce a lockout when one isn't actually necessary, -like for certain less-serious errors that might resolve themselves on the next run. -When `--resilient` is specified, bisync tries its best to recover and self-correct, -and only requires `--resync` as a last resort when a human's involvement is absolutely necessary. -The intended use case is for running bisync as a background process (such as via scheduled [cron](#cron)). -When using `--resilient` mode, bisync will still report the error and abort, -however it will not lock out future runs -- allowing the possibility of retrying at the next normally scheduled time, -without requiring a `--resync` first. Examples of such retryable errors include -access test failures, missing listing files, and filter change detections. -These safety features will still prevent the *current* run from proceeding -- -the difference is that if conditions have improved by the time of the *next* run, -that next run will be allowed to proceed. -Certain more serious errors will still enforce a `--resync` lockout, even in `--resilient` mode, to prevent data loss. -Behavior of `--resilient` may change in a future version. +# Amazon Drive -## Operation +Amazon Drive, formerly known as Amazon Cloud Drive, is a cloud storage +service run by Amazon for consumers. -### Runtime flow details +## Status -bisync retains the listings of the `Path1` and `Path2` filesystems -from the prior run. -On each successive run it will: +**Important:** rclone supports Amazon Drive only if you have your own +set of API keys. Unfortunately the [Amazon Drive developer +program](https://developer.amazon.com/amazon-drive) is now closed to +new entries so if you don't already have your own set of keys you will +not be able to use rclone with Amazon Drive. -- list files on `path1` and `path2`, and check for changes on each side. - Changes include `New`, `Newer`, `Older`, and `Deleted` files. -- Propagate changes on `path1` to `path2`, and vice-versa. +For the history on why rclone no longer has a set of Amazon Drive API +keys see [the forum](https://forum.rclone.org/t/rclone-has-been-banned-from-amazon-drive/2314). -### Safety measures +If you happen to know anyone who works at Amazon then please ask them +to re-instate rclone into the Amazon Drive developer program - thanks! -- Lock file prevents multiple simultaneous runs when taking a while. - This can be particularly useful if bisync is run by cron scheduler. -- Handle change conflicts non-destructively by creating - `..path1` and `..path2` file versions. -- File system access health check using `RCLONE_TEST` files - (see the `--check-access` flag). -- Abort on excessive deletes - protects against a failed listing - being interpreted as all the files were deleted. - See the `--max-delete` and `--force` flags. -- If something evil happens, bisync goes into a safe state to block - damage by later runs. (See [Error Handling](#error-handling)) +## Configuration -### Normal sync checks +The initial setup for Amazon Drive involves getting a token from +Amazon which you need to do in your browser. `rclone config` walks +you through it. - Type | Description | Result | Implementation ---------------|-----------------------------------------------|--------------------------|----------------------------- -Path2 new | File is new on Path2, does not exist on Path1 | Path2 version survives | `rclone copy` Path2 to Path1 -Path2 newer | File is newer on Path2, unchanged on Path1 | Path2 version survives | `rclone copy` Path2 to Path1 -Path2 deleted | File is deleted on Path2, unchanged on Path1 | File is deleted | `rclone delete` Path1 -Path1 new | File is new on Path1, does not exist on Path2 | Path1 version survives | `rclone copy` Path1 to Path2 -Path1 newer | File is newer on Path1, unchanged on Path2 | Path1 version survives | `rclone copy` Path1 to Path2 -Path1 older | File is older on Path1, unchanged on Path2 | _Path1 version survives_ | `rclone copy` Path1 to Path2 -Path2 older | File is older on Path2, unchanged on Path1 | _Path2 version survives_ | `rclone copy` Path2 to Path1 -Path1 deleted | File no longer exists on Path1 | File is deleted | `rclone delete` Path2 +The configuration process for Amazon Drive may involve using an [oauth +proxy](https://github.com/ncw/oauthproxy). This is used to keep the +Amazon credentials out of the source code. The proxy runs in Google's +very secure App Engine environment and doesn't store any credentials +which pass through it. -### Unusual sync checks +Since rclone doesn't currently have its own Amazon Drive credentials +so you will either need to have your own `client_id` and +`client_secret` with Amazon Drive, or use a third-party oauth proxy +in which case you will need to enter `client_id`, `client_secret`, +`auth_url` and `token_url`. - Type | Description | Result | Implementation ---------------------------------|---------------------------------------|------------------------------------|----------------------- -Path1 new/changed AND Path2 new/changed AND Path1 == Path2 | File is new/changed on Path1 AND new/changed on Path2 AND Path1 version is currently identical to Path2 | No change | None -Path1 new AND Path2 new | File is new on Path1 AND new on Path2 (and Path1 version is NOT identical to Path2) | Files renamed to _Path1 and _Path2 | `rclone copy` _Path2 file to Path1, `rclone copy` _Path1 file to Path2 -Path2 newer AND Path1 changed | File is newer on Path2 AND also changed (newer/older/size) on Path1 (and Path1 version is NOT identical to Path2) | Files renamed to _Path1 and _Path2 | `rclone copy` _Path2 file to Path1, `rclone copy` _Path1 file to Path2 -Path2 newer AND Path1 deleted | File is newer on Path2 AND also deleted on Path1 | Path2 version survives | `rclone copy` Path2 to Path1 -Path2 deleted AND Path1 changed | File is deleted on Path2 AND changed (newer/older/size) on Path1 | Path1 version survives |`rclone copy` Path1 to Path2 -Path1 deleted AND Path2 changed | File is deleted on Path1 AND changed (newer/older/size) on Path2 | Path2 version survives | `rclone copy` Path2 to Path1 +Note also if you are not using Amazon's `auth_url` and `token_url`, +(ie you filled in something for those) then if setting up on a remote +machine you can only use the [copying the config method of +configuration](https://rclone.org/remote_setup/#configuring-by-copying-the-config-file) +- `rclone authorize` will not work. -As of `rclone v1.64`, bisync is now better at detecting *false positive* sync conflicts, -which would previously have resulted in unnecessary renames and duplicates. -Now, when bisync comes to a file that it wants to rename (because it is new/changed on both sides), -it first checks whether the Path1 and Path2 versions are currently *identical* -(using the same underlying function as [`check`](commands/rclone_check/).) -If bisync concludes that the files are identical, it will skip them and move on. -Otherwise, it will create renamed `..Path1` and `..Path2` duplicates, as before. -This behavior also [improves the experience of renaming directories](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=Renamed%20directories), -as a `--resync` is no longer required, so long as the same change has been made on both sides. +Here is an example of how to make a remote called `remote`. First run: -### All files changed check {#all-files-changed} + rclone config -If _all_ prior existing files on either of the filesystems have changed -(e.g. timestamps have changed due to changing the system's timezone) -then bisync will abort without making any changes. -Any new files are not considered for this check. You could use `--force` -to force the sync (whichever side has the changed timestamp files wins). -Alternately, a `--resync` may be used (Path1 versions will be pushed -to Path2). Consider the situation carefully and perhaps use `--dry-run` -before you commit to the changes. +This will guide you through an interactive setup process: -### Modification time +``` +No remotes found, make a new one? +n) New remote +r) Rename remote +c) Copy remote +s) Set configuration password +q) Quit config +n/r/c/s/q> n +name> remote +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Amazon Drive + \ "amazon cloud drive" +[snip] +Storage> amazon cloud drive +Amazon Application Client Id - required. +client_id> your client ID goes here +Amazon Application Client Secret - required. +client_secret> your client secret goes here +Auth server URL - leave blank to use Amazon's. +auth_url> Optional auth URL +Token server url - leave blank to use Amazon's. +token_url> Optional token URL +Remote config +Make sure your Redirect URL is set to "http://127.0.0.1:53682/" in your custom config. +Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. +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 = your client ID goes here +client_secret = your client secret goes here +auth_url = Optional auth URL +token_url = Optional token URL +token = {"access_token":"xxxxxxxxxxxxxxxxxxxxxxx","token_type":"bearer","refresh_token":"xxxxxxxxxxxxxxxxxx","expiry":"2015-09-06T16:07:39.658438471+01:00"} +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -Bisync relies on file timestamps to identify changed files and will -_refuse_ to operate if backend lacks the modification time support. +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a +machine with no Internet browser available. -If you or your application should change the content of a file -without changing the modification time then bisync will _not_ -notice the change, and thus will not copy it to the other side. +Note that rclone runs a webserver on your local machine to collect the +token as returned from Amazon. This only runs from the moment it +opens your browser to the moment you get back the verification +code. This is on `http://127.0.0.1:53682/` and this it may require +you to unblock it temporarily if you are running a host firewall. -Note that on some cloud storage systems it is not possible to have file -timestamps that match _precisely_ between the local and other filesystems. +Once configured you can then use `rclone` like this, -Bisync's approach to this problem is by tracking the changes on each side -_separately_ over time with a local database of files in that side then -applying the resulting changes on the other side. +List directories in top level of your Amazon Drive -### Error handling {#error-handling} + rclone lsd remote: -Certain bisync critical errors, such as file copy/move failing, will result in -a bisync lockout of following runs. The lockout is asserted because the sync -status and history of the Path1 and Path2 filesystems cannot be trusted, -so it is safer to block any further changes until someone checks things out. -The recovery is to do a `--resync` again. +List all the files in your Amazon Drive -It is recommended to use `--resync --dry-run --verbose` initially and -_carefully_ review what changes will be made before running the `--resync` -without `--dry-run`. + rclone ls remote: -Most of these events come up due to an error status from an internal call. -On such a critical error the `{...}.path1.lst` and `{...}.path2.lst` -listing files are renamed to extension `.lst-err`, which blocks any future -bisync runs (since the normal `.lst` files are not found). -Bisync keeps them under `bisync` subdirectory of the rclone cache directory, -typically at `${HOME}/.cache/rclone/bisync/` on Linux. +To copy a local directory to an Amazon Drive directory called backup -Some errors are considered temporary and re-running the bisync is not blocked. -The _critical return_ blocks further bisync runs. + rclone copy /home/source remote:backup -See also: [`--resilient`](#resilient) +### Modification times and hashes -### Lock file +Amazon Drive doesn't allow modification times to be changed via +the API so these won't be accurate or used for syncing. -When bisync is running, a lock file is created in the bisync working directory, -typically at `~/.cache/rclone/bisync/PATH1..PATH2.lck` on Linux. -If bisync should crash or hang, the lock file will remain in place and block -any further runs of bisync _for the same paths_. -Delete the lock file as part of debugging the situation. -The lock file effectively blocks follow-on (e.g., scheduled by _cron_) runs -when the prior invocation is taking a long time. -The lock file contains _PID_ of the blocking process, which may help in debug. +It does support the MD5 hash algorithm, so for a more accurate sync, +you can use the `--checksum` flag. -**Note** -that while concurrent bisync runs are allowed, _be very cautious_ -that there is no overlap in the trees being synched between concurrent runs, -lest there be replicated files, deleted files and general mayhem. +### Restricted filename characters -### Return codes +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| NUL | 0x00 | ␀ | +| / | 0x2F | / | -`rclone bisync` returns the following codes to calling program: -- `0` on a successful run, -- `1` for a non-critical failing run (a rerun may be successful), -- `2` for a critically aborted run (requires a `--resync` to recover). +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. -## Limitations +### Deleting files -### Supported backends +Any files you delete with rclone will end up in the trash. Amazon +don't provide an API to permanently delete files, nor to empty the +trash, so you will have to do that with one of Amazon's apps or via +the Amazon Drive website. As of November 17, 2016, files are +automatically deleted by Amazon from the trash after 30 days. -Bisync is considered _BETA_ and has been tested with the following backends: -- Local filesystem -- Google Drive -- Dropbox -- OneDrive -- S3 -- SFTP -- Yandex Disk +### Using with non `.com` Amazon accounts -It has not been fully tested with other services yet. -If it works, or sorta works, please let us know and we'll update the list. -Run the test suite to check for proper operation as described below. +Let's say you usually use `amazon.co.uk`. When you authenticate with +rclone it will take you to an `amazon.com` page to log in. Your +`amazon.co.uk` email and password should work here just fine. -First release of `rclone bisync` requires that underlying backend supports -the modification time feature and will refuse to run otherwise. -This limitation will be lifted in a future `rclone bisync` release. -### Concurrent modifications +### Standard options -When using **Local, FTP or SFTP** remotes rclone does not create _temporary_ -files at the destination when copying, and thus if the connection is lost -the created file may be corrupt, which will likely propagate back to the -original path on the next sync, resulting in data loss. -This will be solved in a future release, there is no workaround at the moment. +Here are the Standard options specific to amazon cloud drive (Amazon Drive). -Files that **change during** a bisync run may result in data loss. -This has been seen in a highly dynamic environment, where the filesystem -is getting hammered by running processes during the sync. -The currently recommended solution is to sync at quiet times or [filter out](#filtering) -unnecessary directories and files. +#### --acd-client-id -As an [alternative approach](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=scans%2C%20to%20avoid-,errors%20if%20files%20changed%20during%20sync,-Given%20the%20number), -consider using `--check-sync=false` (and possibly `--resilient`) to make bisync more forgiving -of filesystems that change during the sync. -Be advised that this may cause bisync to miss events that occur during a bisync run, -so it is a good idea to supplement this with a periodic independent integrity check, -and corrective sync if diffs are found. For example, a possible sequence could look like this: +OAuth Client Id. -1. Normally scheduled bisync run: +Leave blank normally. -``` -rclone bisync Path1 Path2 -MPc --check-access --max-delete 10 --filters-file /path/to/filters.txt -v --check-sync=false --no-cleanup --ignore-listing-checksum --disable ListR --checkers=16 --drive-pacer-min-sleep=10ms --create-empty-src-dirs --resilient -``` +Properties: -2. Periodic independent integrity check (perhaps scheduled nightly or weekly): +- Config: client_id +- Env Var: RCLONE_ACD_CLIENT_ID +- Type: string +- Required: false -``` -rclone check -MvPc Path1 Path2 --filter-from /path/to/filters.txt -``` +#### --acd-client-secret -3. If diffs are found, you have some choices to correct them. -If one side is more up-to-date and you want to make the other side match it, you could run: +OAuth Client Secret. -``` -rclone sync Path1 Path2 --filter-from /path/to/filters.txt --create-empty-src-dirs -MPc -v -``` -(or switch Path1 and Path2 to make Path2 the source-of-truth) +Leave blank normally. -Or, if neither side is totally up-to-date, you could run a `--resync` to bring them back into agreement -(but remember that this could cause deleted files to re-appear.) +Properties: -*Note also that `rclone check` does not currently include empty directories, -so if you want to know if any empty directories are out of sync, -consider alternatively running the above `rclone sync` command with `--dry-run` added. +- Config: client_secret +- Env Var: RCLONE_ACD_CLIENT_SECRET +- Type: string +- Required: false -### Empty directories +### Advanced options -By default, new/deleted empty directories on one path are _not_ propagated to the other side. -This is because bisync (and rclone) natively works on files, not directories. -However, this can be changed with the `--create-empty-src-dirs` flag, which works in -much the same way as in [`sync`](https://rclone.org/commands/rclone_sync/) and [`copy`](https://rclone.org/commands/rclone_copy/). -When used, empty directories created or deleted on one side will also be created or deleted on the other side. -The following should be noted: -* `--create-empty-src-dirs` is not compatible with `--remove-empty-dirs`. Use only one or the other (or neither). -* It is not recommended to switch back and forth between `--create-empty-src-dirs` -and the default (no `--create-empty-src-dirs`) without running `--resync`. -This is because it may appear as though all directories (not just the empty ones) were created/deleted, -when actually you've just toggled between making them visible/invisible to bisync. -It looks scarier than it is, but it's still probably best to stick to one or the other, -and use `--resync` when you need to switch. +Here are the Advanced options specific to amazon cloud drive (Amazon Drive). -### Renamed directories +#### --acd-token -Renaming a folder on the Path1 side results in deleting all files on -the Path2 side and then copying all files again from Path1 to Path2. -Bisync sees this as all files in the old directory name as deleted and all -files in the new directory name as new. -Currently, the most effective and efficient method of renaming a directory -is to rename it to the same name on both sides. (As of `rclone v1.64`, -a `--resync` is no longer required after doing so, as bisync will automatically -detect that Path1 and Path2 are in agreement.) +OAuth Access Token as a JSON blob. -### `--fast-list` used by default +Properties: -Unlike most other rclone commands, bisync uses [`--fast-list`](https://rclone.org/docs/#fast-list) by default, -for backends that support it. In many cases this is desirable, however, -there are some scenarios in which bisync could be faster *without* `--fast-list`, -and there is also a [known issue concerning Google Drive users with many empty directories](https://github.com/rclone/rclone/commit/cbf3d4356135814921382dd3285d859d15d0aa77). -For now, the recommended way to avoid using `--fast-list` is to add `--disable ListR` -to all bisync commands. The default behavior may change in a future version. +- Config: token +- Env Var: RCLONE_ACD_TOKEN +- Type: string +- Required: false -### Overridden Configs +#### --acd-auth-url -When rclone detects an overridden config, it adds a suffix like `{ABCDE}` on the fly -to the internal name of the remote. Bisync follows suit by including this suffix in its listing filenames. -However, this suffix does not necessarily persist from run to run, especially if different flags are provided. -So if next time the suffix assigned is `{FGHIJ}`, bisync will get confused, -because it's looking for a listing file with `{FGHIJ}`, when the file it wants has `{ABCDE}`. -As a result, it throws -`Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run` -and refuses to run again until the user runs a `--resync` (unless using `--resilient`). -The best workaround at the moment is to set any backend-specific flags in the [config file](https://rclone.org/commands/rclone_config/) -instead of specifying them with command flags. (You can still override them as needed for other rclone commands.) +Auth server URL. -### Case sensitivity +Leave blank to use the provider defaults. -Synching with **case-insensitive** filesystems, such as Windows or `Box`, -can result in file name conflicts. This will be fixed in a future release. -The near-term workaround is to make sure that files on both sides -don't have spelling case differences (`Smile.jpg` vs. `smile.jpg`). +Properties: -## Windows support {#windows} +- Config: auth_url +- Env Var: RCLONE_ACD_AUTH_URL +- Type: string +- Required: false -Bisync has been tested on Windows 8.1, Windows 10 Pro 64-bit and on Windows -GitHub runners. +#### --acd-token-url -Drive letters are allowed, including drive letters mapped to network drives -(`rclone bisync J:\localsync GDrive:`). -If a drive letter is omitted, the shell current drive is the default. -Drive letters are a single character follows by `:`, so cloud names -must be more than one character long. +Token server url. -Absolute paths (with or without a drive letter), and relative paths -(with or without a drive letter) are supported. +Leave blank to use the provider defaults. -Working directory is created at `C:\Users\MyLogin\AppData\Local\rclone\bisync`. +Properties: -Note that bisync output may show a mix of forward `/` and back `\` slashes. +- Config: token_url +- Env Var: RCLONE_ACD_TOKEN_URL +- Type: string +- Required: false -Be careful of case independent directory and file naming on Windows -vs. case dependent Linux +#### --acd-checkpoint -## Filtering {#filtering} +Checkpoint for internal polling (debug). -See [filtering documentation](https://rclone.org/filtering/) -for how filter rules are written and interpreted. +Properties: -Bisync's [`--filters-file`](#filters-file) flag slightly extends the rclone's -[--filter-from](https://rclone.org/filtering/#filter-from-read-filtering-patterns-from-a-file) -filtering mechanism. -For a given bisync run you may provide _only one_ `--filters-file`. -The `--include*`, `--exclude*`, and `--filter` flags are also supported. +- Config: checkpoint +- Env Var: RCLONE_ACD_CHECKPOINT +- Type: string +- Required: false -### How to filter directories +#### --acd-upload-wait-per-gb -Filtering portions of the directory tree is a critical feature for synching. +Additional time per GiB to wait after a failed complete upload to see if it appears. -Examples of directory trees (always beneath the Path1/Path2 root level) -you may want to exclude from your sync: -- Directory trees containing only software build intermediate files. -- Directory trees containing application temporary files and data - such as the Windows `C:\Users\MyLogin\AppData\` tree. -- Directory trees containing files that are large, less important, - or are getting thrashed continuously by ongoing processes. +Sometimes Amazon Drive gives an error when a file has been fully +uploaded but the file appears anyway after a little while. This +happens sometimes for files over 1 GiB in size and nearly every time for +files bigger than 10 GiB. This parameter controls the time rclone waits +for the file to appear. -On the other hand, there may be only select directories that you -actually want to sync, and exclude all others. See the -[Example include-style filters for Windows user directories](#include-filters) -below. +The default value for this parameter is 3 minutes per GiB, so by +default it will wait 3 minutes for every GiB uploaded to see if the +file appears. -### Filters file writing guidelines +You can disable this feature by setting it to 0. This may cause +conflict errors as rclone retries the failed upload but the file will +most likely appear correctly eventually. -1. Begin with excluding directory trees: - - e.g. `- /AppData/` - - `**` on the end is not necessary. Once a given directory level - is excluded then everything beneath it won't be looked at by rclone. - - Exclude such directories that are unneeded, are big, dynamically thrashed, - or where there may be access permission issues. - - Excluding such dirs first will make rclone operations (much) faster. - - Specific files may also be excluded, as with the Dropbox exclusions - example below. -2. Decide if it's easier (or cleaner) to: - - Include select directories and therefore _exclude everything else_ -- or -- - - Exclude select directories and therefore _include everything else_ -3. Include select directories: - - Add lines like: `+ /Documents/PersonalFiles/**` to select which - directories to include in the sync. - - `**` on the end specifies to include the full depth of the specified tree. - - With Include-style filters, files at the Path1/Path2 root are not included. - They may be included with `+ /*`. - - Place RCLONE_TEST files within these included directory trees. - They will only be looked for in these directory trees. - - Finish by excluding everything else by adding `- **` at the end - of the filters file. - - Disregard step 4. -4. Exclude select directories: - - Add more lines like in step 1. - For example: `-/Desktop/tempfiles/`, or `- /testdir/`. - Again, a `**` on the end is not necessary. - - Do _not_ add a `- **` in the file. Without this line, everything - will be included that has not been explicitly excluded. - - Disregard step 3. +These values were determined empirically by observing lots of uploads +of big files for a range of file sizes. -A few rules for the syntax of a filter file expanding on -[filtering documentation](https://rclone.org/filtering/): +Upload with the "-v" flag to see more info about what rclone is doing +in this situation. -- Lines may start with spaces and tabs - rclone strips leading whitespace. -- If the first non-whitespace character is a `#` then the line is a comment - and will be ignored. -- Blank lines are ignored. -- The first non-whitespace character on a filter line must be a `+` or `-`. -- Exactly 1 space is allowed between the `+/-` and the path term. -- Only forward slashes (`/`) are used in path terms, even on Windows. -- The rest of the line is taken as the path term. - Trailing whitespace is taken literally, and probably is an error. +Properties: -### Example include-style filters for Windows user directories {#include-filters} +- Config: upload_wait_per_gb +- Env Var: RCLONE_ACD_UPLOAD_WAIT_PER_GB +- Type: Duration +- Default: 3m0s -This Windows _include-style_ example is based on the sync root (Path1) -set to `C:\Users\MyLogin`. The strategy is to select specific directories -to be synched with a network drive (Path2). +#### --acd-templink-threshold -- `- /AppData/` excludes an entire tree of Windows stored stuff - that need not be synched. - In my case, AppData has >11 GB of stuff I don't care about, and there are - some subdirectories beneath AppData that are not accessible to my - user login, resulting in bisync critical aborts. -- Windows creates cache files starting with both upper and - lowercase `NTUSER` at `C:\Users\MyLogin`. These files may be dynamic, - locked, and are generally _don't care_. -- There are just a few directories with _my_ data that I do want synched, - in the form of `+ /`. By selecting only the directory trees I - want to avoid the dozen plus directories that various apps make - at `C:\Users\MyLogin\Documents`. -- Include files in the root of the sync point, `C:\Users\MyLogin`, - by adding the `+ /*` line. -- This is an Include-style filters file, therefore it ends with `- **` - which excludes everything not explicitly included. +Files >= this size will be downloaded via their tempLink. -``` -- /AppData/ -- NTUSER* -- ntuser* -+ /Documents/Family/** -+ /Documents/Sketchup/** -+ /Documents/Microcapture_Photo/** -+ /Documents/Microcapture_Video/** -+ /Desktop/** -+ /Pictures/** -+ /* -- ** -``` +Files this size or more will be downloaded via their "tempLink". This +is to work around a problem with Amazon Drive which blocks downloads +of files bigger than about 10 GiB. The default for this is 9 GiB which +shouldn't need to be changed. -Note also that Windows implements several "library" links such as -`C:\Users\MyLogin\My Documents\My Music` pointing to `C:\Users\MyLogin\Music`. -rclone sees these as links, so you must add `--links` to the -bisync command line if you which to follow these links. I find that I get -permission errors in trying to follow the links, so I don't include the -rclone `--links` flag, but then you get lots of `Can't follow symlink…` -noise from rclone about not following the links. This noise can be -quashed by adding `--quiet` to the bisync command line. +To download files above this threshold, rclone requests a "tempLink" +which downloads the file through a temporary URL directly from the +underlying S3 storage. -## Example exclude-style filters files for use with Dropbox {#exclude-filters} +Properties: -- Dropbox disallows synching the listed temporary and configuration/data files. - The `- ` filters exclude these files where ever they may occur - in the sync tree. Consider adding similar exclusions for file types - you don't need to sync, such as core dump and software build files. -- bisync testing creates `/testdir/` at the top level of the sync tree, - and usually deletes the tree after the test. If a normal sync should run - while the `/testdir/` tree exists the `--check-access` phase may fail - due to unbalanced RCLONE_TEST files. - The `- /testdir/` filter blocks this tree from being synched. - You don't need this exclusion if you are not doing bisync development testing. -- Everything else beneath the Path1/Path2 root will be synched. -- RCLONE_TEST files may be placed anywhere within the tree, including the root. +- Config: templink_threshold +- Env Var: RCLONE_ACD_TEMPLINK_THRESHOLD +- Type: SizeSuffix +- Default: 9Gi -### Example filters file for Dropbox {#example-filters-file} +#### --acd-encoding -``` -# Filter file for use with bisync -# See https://rclone.org/filtering/ for filtering rules -# NOTICE: If you make changes to this file you MUST do a --resync run. -# Run with --dry-run to see what changes will be made. +The encoding for the backend. -# Dropbox won't sync some files so filter them away here. -# See https://help.dropbox.com/installs-integrations/sync-uploads/files-not-syncing -- .dropbox.attr -- ~*.tmp -- ~$* -- .~* -- desktop.ini -- .dropbox +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -# Used for bisync testing, so excluded from normal runs -- /testdir/ +Properties: -# Other example filters -#- /TiBU/ -#- /Photos/ -``` +- Config: encoding +- Env Var: RCLONE_ACD_ENCODING +- Type: Encoding +- Default: Slash,InvalidUtf8,Dot -### How --check-access handles filters -At the start of a bisync run, listings are gathered for Path1 and Path2 -while using the user's `--filters-file`. During the check access phase, -bisync scans these listings for `RCLONE_TEST` files. -Any `RCLONE_TEST` files hidden by the `--filters-file` are _not_ in the -listings and thus not checked during the check access phase. -## Troubleshooting {#troubleshooting} +## Limitations -### Reading bisync logs +Note that Amazon Drive is case insensitive so you can't have a +file called "Hello.doc" and one called "hello.doc". -Here are two normal runs. The first one has a newer file on the remote. -The second has no deltas between local and remote. +Amazon Drive has rate limiting so you may notice errors in the +sync (429 errors). rclone will automatically retry the sync up to 3 +times by default (see `--retries` flag) which should hopefully work +around this problem. -``` -2021/05/16 00:24:38 INFO : Synching Path1 "/path/to/local/tree/" with Path2 "dropbox:/" -2021/05/16 00:24:38 INFO : Path1 checking for diffs -2021/05/16 00:24:38 INFO : - Path1 File is new - file.txt -2021/05/16 00:24:38 INFO : Path1: 1 changes: 1 new, 0 newer, 0 older, 0 deleted -2021/05/16 00:24:38 INFO : Path2 checking for diffs -2021/05/16 00:24:38 INFO : Applying changes -2021/05/16 00:24:38 INFO : - Path1 Queue copy to Path2 - dropbox:/file.txt -2021/05/16 00:24:38 INFO : - Path1 Do queued copies to - Path2 -2021/05/16 00:24:38 INFO : Updating listings -2021/05/16 00:24:38 INFO : Validating listings for Path1 "/path/to/local/tree/" vs Path2 "dropbox:/" -2021/05/16 00:24:38 INFO : Bisync successful +Amazon Drive has an internal limit of file sizes that can be uploaded +to the service. This limit is not officially published, but all files +larger than this will fail. -2021/05/16 00:36:52 INFO : Synching Path1 "/path/to/local/tree/" with Path2 "dropbox:/" -2021/05/16 00:36:52 INFO : Path1 checking for diffs -2021/05/16 00:36:52 INFO : Path2 checking for diffs -2021/05/16 00:36:52 INFO : No changes found -2021/05/16 00:36:52 INFO : Updating listings -2021/05/16 00:36:52 INFO : Validating listings for Path1 "/path/to/local/tree/" vs Path2 "dropbox:/" -2021/05/16 00:36:52 INFO : Bisync successful -``` +At the time of writing (Jan 2016) is in the area of 50 GiB per file. +This means that larger files are likely to fail. -### Dry run oddity +Unfortunately there is no way for rclone to see that this failure is +because of file size, so it will retry the operation, as any other +failure. To avoid this problem, use `--max-size 50000M` option to limit +the maximum size of uploaded files. Note that `--max-size` does not split +files into segments, it only ignores files over this size. -The `--dry-run` messages may indicate that it would try to delete some files. -For example, if a file is new on Path2 and does not exist on Path1 then -it would normally be copied to Path1, but with `--dry-run` enabled those -copies don't happen, which leads to the attempted delete on Path2, -blocked again by --dry-run: `... Not deleting as --dry-run`. +`rclone about` is not supported by the Amazon Drive backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. -This whole confusing situation is an artifact of the `--dry-run` flag. -Scrutinize the proposed deletes carefully, and if the files would have been -copied to Path1 then the threatened deletes on Path2 may be disregarded. +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -### Retries +# Amazon S3 Storage Providers -Rclone has built-in retries. If you run with `--verbose` you'll see -error and retry messages such as shown below. This is usually not a bug. -If at the end of the run, you see `Bisync successful` and not -`Bisync critical error` or `Bisync aborted` then the run was successful, -and you can ignore the error messages. +The S3 backend can be used with a number of different providers: -The following run shows an intermittent fail. Lines _5_ and _6- are -low-level messages. Line _6_ is a bubbled-up _warning_ message, conveying -the error. Rclone normally retries failing commands, so there may be -numerous such messages in the log. -Since there are no final error/warning messages on line _7_, rclone has -recovered from failure after a retry, and the overall sync was successful. +- AWS S3 +- Alibaba Cloud (Aliyun) Object Storage System (OSS) +- Ceph +- China Mobile Ecloud Elastic Object Storage (EOS) +- Cloudflare R2 +- Arvan Cloud Object Storage (AOS) +- DigitalOcean Spaces +- Dreamhost +- GCS +- Huawei OBS +- IBM COS S3 +- IDrive e2 +- IONOS Cloud +- Leviia Object Storage +- Liara Object Storage +- Linode Object Storage +- Minio +- Petabox +- Qiniu Cloud Object Storage (Kodo) +- RackCorp Object Storage +- Rclone Serve S3 +- Scaleway +- Seagate Lyve Cloud +- SeaweedFS +- StackPath +- Storj +- Synology C2 Object Storage +- Tencent Cloud Object Storage (COS) +- Wasabi -``` -1: 2021/05/14 00:44:12 INFO : Synching Path1 "/path/to/local/tree" with Path2 "dropbox:" -2: 2021/05/14 00:44:12 INFO : Path1 checking for diffs -3: 2021/05/14 00:44:12 INFO : Path2 checking for diffs -4: 2021/05/14 00:44:12 INFO : Path2: 113 changes: 22 new, 0 newer, 0 older, 91 deleted -5: 2021/05/14 00:44:12 ERROR : /path/to/local/tree/objects/af: error listing: unexpected end of JSON input -6: 2021/05/14 00:44:12 NOTICE: WARNING listing try 1 failed. - dropbox: -7: 2021/05/14 00:44:12 INFO : Bisync successful -``` -This log shows a _Critical failure_ which requires a `--resync` to recover from. -See the [Runtime Error Handling](#error-handling) section. +Paths are specified as `remote:bucket` (or `remote:` for the `lsd` +command.) You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`. -``` -2021/05/12 00:49:40 INFO : Google drive root '': Waiting for checks to finish -2021/05/12 00:49:40 INFO : Google drive root '': Waiting for transfers to finish -2021/05/12 00:49:40 INFO : Google drive root '': not deleting files as there were IO errors -2021/05/12 00:49:40 ERROR : Attempt 3/3 failed with 3 errors and: not deleting files as there were IO errors -2021/05/12 00:49:40 ERROR : Failed to sync: not deleting files as there were IO errors -2021/05/12 00:49:40 NOTICE: WARNING rclone sync try 3 failed. - /path/to/local/tree/ -2021/05/12 00:49:40 ERROR : Bisync aborted. Must run --resync to recover. -``` +Once you have made a remote (see the provider specific section above) +you can use it like this: -### Denied downloads of "infected" or "abusive" files +See all buckets -Google Drive has a filter for certain file types (`.exe`, `.apk`, et cetera) -that by default cannot be copied from Google Drive to the local filesystem. -If you are having problems, run with `--verbose` to see specifically which -files are generating complaints. If the error is -`This file has been identified as malware or spam and cannot be downloaded`, -consider using the flag -[--drive-acknowledge-abuse](https://rclone.org/drive/#drive-acknowledge-abuse). + rclone lsd remote: -### Google Doc files +Make a new bucket -Google docs exist as virtual files on Google Drive and cannot be transferred -to other filesystems natively. While it is possible to export a Google doc to -a normal file (with `.xlsx` extension, for example), it is not possible -to import a normal file back into a Google document. + rclone mkdir remote:bucket -Bisync's handling of Google Doc files is to flag them in the run log output -for user's attention and ignore them for any file transfers, deletes, or syncs. -They will show up with a length of `-1` in the listings. -This bisync run is otherwise successful: +List the contents of a bucket -``` -2021/05/11 08:23:15 INFO : Synching Path1 "/path/to/local/tree/base/" with Path2 "GDrive:" -2021/05/11 08:23:15 INFO : ...path2.lst-new: Ignoring incorrect line: "- -1 - - 2018-07-29T08:49:30.136000000+0000 GoogleDoc.docx" -2021/05/11 08:23:15 INFO : Bisync successful -``` + rclone ls remote:bucket -## Usage examples +Sync `/home/local/directory` to the remote bucket, deleting any excess +files in the bucket. -### Cron {#cron} + rclone sync --interactive /home/local/directory remote:bucket -Rclone does not yet have a built-in capability to monitor the local file -system for changes and must be blindly run periodically. -On Windows this can be done using a _Task Scheduler_, -on Linux you can use _Cron_ which is described below. +## Configuration -The 1st example runs a sync every 5 minutes between a local directory -and an OwnCloud server, with output logged to a runlog file: +Here is an example of making an s3 configuration for the AWS S3 provider. +Most applies to the other providers as well, any differences are described [below](#providers). -``` -# Minute (0-59) -# Hour (0-23) -# Day of Month (1-31) -# Month (1-12 or Jan-Dec) -# Day of Week (0-6 or Sun-Sat) -# Command - */5 * * * * /path/to/rclone bisync /local/files MyCloud: --check-access --filters-file /path/to/bysync-filters.txt --log-file /path/to//bisync.log -``` +First run -See [crontab syntax](https://www.man7.org/linux/man-pages/man1/crontab.1p.html#INPUT_FILES) -for the details of crontab time interval expressions. + rclone config -If you run `rclone bisync` as a cron job, redirect stdout/stderr to a file. -The 2nd example runs a sync to Dropbox every hour and logs all stdout (via the `>>`) -and stderr (via `2>&1`) to a log file. +This will guide you through an interactive setup process. ``` -0 * * * * /path/to/rclone bisync /path/to/local/dropbox Dropbox: --check-access --filters-file /home/user/filters.txt >> /path/to/logs/dropbox-run.log 2>&1 +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Amazon S3 Compliant Storage Providers including AWS, Ceph, ChinaMobile, ArvanCloud, Dreamhost, IBM COS, Liara, Minio, and Tencent COS + \ "s3" +[snip] +Storage> s3 +Choose your S3 provider. +Choose a number from below, or type in your own value + 1 / Amazon Web Services (AWS) S3 + \ "AWS" + 2 / Ceph Object Storage + \ "Ceph" + 3 / DigitalOcean Spaces + \ "DigitalOcean" + 4 / Dreamhost DreamObjects + \ "Dreamhost" + 5 / IBM COS S3 + \ "IBMCOS" + 6 / Minio Object Storage + \ "Minio" + 7 / Wasabi Object Storage + \ "Wasabi" + 8 / Any other S3 compatible provider + \ "Other" +provider> 1 +Get AWS credentials from runtime (environment variables or EC2/ECS 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> XXX +AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. +secret_access_key> YYY +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 East (Ohio) Region + 2 | Needs location constraint us-east-2. + \ "us-east-2" + / US West (Oregon) Region + 3 | Needs location constraint us-west-2. + \ "us-west-2" + / US West (Northern California) Region + 4 | Needs location constraint us-west-1. + \ "us-west-1" + / Canada (Central) Region + 5 | Needs location constraint ca-central-1. + \ "ca-central-1" + / EU (Ireland) Region + 6 | Needs location constraint EU or eu-west-1. + \ "eu-west-1" + / EU (London) Region + 7 | Needs location constraint eu-west-2. + \ "eu-west-2" + / EU (Frankfurt) Region + 8 | Needs location constraint eu-central-1. + \ "eu-central-1" + / Asia Pacific (Singapore) Region + 9 | Needs location constraint ap-southeast-1. + \ "ap-southeast-1" + / Asia Pacific (Sydney) Region +10 | Needs location constraint ap-southeast-2. + \ "ap-southeast-2" + / Asia Pacific (Tokyo) Region +11 | Needs location constraint ap-northeast-1. + \ "ap-northeast-1" + / Asia Pacific (Seoul) +12 | Needs location constraint ap-northeast-2. + \ "ap-northeast-2" + / Asia Pacific (Mumbai) +13 | Needs location constraint ap-south-1. + \ "ap-south-1" + / Asia Pacific (Hong Kong) Region +14 | Needs location constraint ap-east-1. + \ "ap-east-1" + / South America (Sao Paulo) Region +15 | Needs location constraint sa-east-1. + \ "sa-east-1" +region> 1 +Endpoint for S3 API. +Leave blank if using AWS to use the default endpoint for the region. +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 East (Ohio) Region. + \ "us-east-2" + 3 / US West (Oregon) Region. + \ "us-west-2" + 4 / US West (Northern California) Region. + \ "us-west-1" + 5 / Canada (Central) Region. + \ "ca-central-1" + 6 / EU (Ireland) Region. + \ "eu-west-1" + 7 / EU (London) Region. + \ "eu-west-2" + 8 / EU Region. + \ "EU" + 9 / Asia Pacific (Singapore) Region. + \ "ap-southeast-1" +10 / Asia Pacific (Sydney) Region. + \ "ap-southeast-2" +11 / Asia Pacific (Tokyo) Region. + \ "ap-northeast-1" +12 / Asia Pacific (Seoul) + \ "ap-northeast-2" +13 / Asia Pacific (Mumbai) + \ "ap-south-1" +14 / Asia Pacific (Hong Kong) + \ "ap-east-1" +15 / South America (Sao Paulo) Region. + \ "sa-east-1" +location_constraint> 1 +Canned ACL used when creating buckets and/or storing objects in S3. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Choose a number from below, or type in your own value + 1 / Owner gets FULL_CONTROL. No one else has access rights (default). + \ "private" + 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access. + \ "public-read" + / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. + 3 | Granting this on a bucket is generally not recommended. + \ "public-read-write" + 4 / Owner gets FULL_CONTROL. The AuthenticatedUsers group gets READ access. + \ "authenticated-read" + / Object owner gets FULL_CONTROL. Bucket owner gets READ access. + 5 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \ "bucket-owner-read" + / Both the object owner and the bucket owner get FULL_CONTROL over the object. + 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \ "bucket-owner-full-control" +acl> 1 +The server-side encryption algorithm used when storing this object in S3. +Choose a number from below, or type in your own value + 1 / None + \ "" + 2 / AES256 + \ "AES256" +server_side_encryption> 1 +The storage class to use when storing objects in S3. +Choose a number from below, or type in your own value + 1 / Default + \ "" + 2 / Standard storage class + \ "STANDARD" + 3 / Reduced redundancy storage class + \ "REDUCED_REDUNDANCY" + 4 / Standard Infrequent Access storage class + \ "STANDARD_IA" + 5 / One Zone Infrequent Access storage class + \ "ONEZONE_IA" + 6 / Glacier storage class + \ "GLACIER" + 7 / Glacier Deep Archive storage class + \ "DEEP_ARCHIVE" + 8 / Intelligent-Tiering storage class + \ "INTELLIGENT_TIERING" + 9 / Glacier Instant Retrieval storage class + \ "GLACIER_IR" +storage_class> 1 +Remote config +-------------------- +[remote] +type = s3 +provider = AWS +env_auth = false +access_key_id = XXX +secret_access_key = YYY +region = us-east-1 +endpoint = +location_constraint = +acl = private +server_side_encryption = +storage_class = +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> ``` -### Sharing an encrypted folder tree between hosts +### Modification times and hashes -bisync can keep a local folder in sync with a cloud service, -but what if you have some highly sensitive files to be synched? +#### Modification times -Usage of a cloud service is for exchanging both routine and sensitive -personal files between one's home network, one's personal notebook when on the -road, and with one's work computer. The routine data is not sensitive. -For the sensitive data, configure an rclone [crypt remote](https://rclone.org/crypt/) to point to -a subdirectory within the local disk tree that is bisync'd to Dropbox, -and then set up an bisync for this local crypt directory to a directory -outside of the main sync tree. +The modified time is stored as metadata on the object as +`X-Amz-Meta-Mtime` as floating point since the epoch, accurate to 1 ns. -### Linux server setup +If the modification time needs to be updated rclone will attempt to perform a server +side copy to update the modification if the object can be copied in a single part. +In the case the object is larger than 5Gb or is in Glacier or Glacier Deep Archive +storage the object will be uploaded rather than copied. -- `/path/to/DBoxroot` is the root of my local sync tree. - There are numerous subdirectories. -- `/path/to/DBoxroot/crypt` is the root subdirectory for files - that are encrypted. This local directory target is setup as an - rclone crypt remote named `Dropcrypt:`. - See [rclone.conf](#rclone-conf-snippet) snippet below. -- `/path/to/my/unencrypted/files` is the root of my sensitive - files - not encrypted, not within the tree synched to Dropbox. -- To sync my local unencrypted files with the encrypted Dropbox versions - I manually run `bisync /path/to/my/unencrypted/files DropCrypt:`. - This step could be bundled into a script to run before and after - the full Dropbox tree sync in the last step, - thus actively keeping the sensitive files in sync. -- `bisync /path/to/DBoxroot Dropbox:` runs periodically via cron, - keeping my full local sync tree in sync with Dropbox. +Note that reading this from the object takes an additional `HEAD` +request as the metadata isn't returned in object listings. -### Windows notebook setup +#### Hashes -- The Dropbox client runs keeping the local tree `C:\Users\MyLogin\Dropbox` - always in sync with Dropbox. I could have used `rclone bisync` instead. -- A separate directory tree at `C:\Users\MyLogin\Documents\DropLocal` - hosts the tree of unencrypted files/folders. -- To sync my local unencrypted files with the encrypted - Dropbox versions I manually run the following command: - `rclone bisync C:\Users\MyLogin\Documents\DropLocal Dropcrypt:`. -- The Dropbox client then syncs the changes with Dropbox. +For small objects which weren't uploaded as multipart uploads (objects +sized below `--s3-upload-cutoff` if uploaded with rclone) rclone uses +the `ETag:` header as an MD5 checksum. -### rclone.conf snippet {#rclone-conf-snippet} +However for objects which were uploaded as multipart uploads or with +server side encryption (SSE-AWS or SSE-C) the `ETag` header is no +longer the MD5 sum of the data, so rclone adds an additional piece of +metadata `X-Amz-Meta-Md5chksum` which is a base64 encoded MD5 hash (in +the same format as is required for `Content-MD5`). You can use base64 -d and hexdump to check this value manually: -``` -[Dropbox] -type = dropbox -... + echo 'VWTGdNx3LyXQDfA0e2Edxw==' | base64 -d | hexdump -[Dropcrypt] -type = crypt -remote = /path/to/DBoxroot/crypt # on the Linux server -remote = C:\Users\MyLogin\Dropbox\crypt # on the Windows notebook -filename_encryption = standard -directory_name_encryption = true -password = ... -... -``` +or you can use `rclone check` to verify the hashes are OK. -## Testing {#testing} +For large objects, calculating this hash can take some time so the +addition of this hash can be disabled with `--s3-disable-checksum`. +This will mean that these objects do not have an MD5 checksum. -You should read this section only if you are developing for rclone. -You need to have rclone source code locally to work with bisync tests. +Note that reading this from the object takes an additional `HEAD` +request as the metadata isn't returned in object listings. -Bisync has a dedicated test framework implemented in the `bisync_test.go` -file located in the rclone source tree. The test suite is based on the -`go test` command. Series of tests are stored in subdirectories below the -`cmd/bisync/testdata` directory. Individual tests can be invoked by their -directory name, e.g. -`go test . -case basic -remote local -remote2 gdrive: -v` +### Reducing costs -Tests will make a temporary folder on remote and purge it afterwards. -If during test run there are intermittent errors and rclone retries, -these errors will be captured and flagged as invalid MISCOMPAREs. -Rerunning the test will let it pass. Consider such failures as noise. +#### Avoiding HEAD requests to read the modification time -### Test command syntax +By default, rclone will use the modification time of objects stored in +S3 for syncing. This is stored in object metadata which unfortunately +takes an extra HEAD request to read which can be expensive (in time +and money). -``` -usage: go test ./cmd/bisync [options...] +The modification time is used by default for all operations that +require checking the time a file was last updated. It allows rclone to +treat the remote more like a true filesystem, but it is inefficient on +S3 because it requires an extra API call to retrieve the metadata. -Options: - -case NAME Name(s) of the test case(s) to run. Multiple names should - be separated by commas. You can remove the `test_` prefix - and replace `_` by `-` in test name for convenience. - If not `all`, the name(s) should map to a directory under - `./cmd/bisync/testdata`. - Use `all` to run all tests (default: all) - -remote PATH1 `local` or name of cloud service with `:` (default: local) - -remote2 PATH2 `local` or name of cloud service with `:` (default: local) - -no-compare Disable comparing test results with the golden directory - (default: compare) - -no-cleanup Disable cleanup of Path1 and Path2 testdirs. - Useful for troubleshooting. (default: cleanup) - -golden Store results in the golden directory (default: false) - This flag can be used with multiple tests. - -debug Print debug messages - -stop-at NUM Stop test after given step number. (default: run to the end) - Implies `-no-compare` and `-no-cleanup`, if the test really - ends prematurely. Only meaningful for a single test case. - -refresh-times Force refreshing the target modtime, useful for Dropbox - (default: false) - -verbose Run tests verbosely -``` +The extra API calls can be avoided when syncing (using `rclone sync` +or `rclone copy`) in a few different ways, each with its own +tradeoffs. -Note: unlike rclone flags which must be prefixed by double dash (`--`), the -test command flags can be equally prefixed by a single `-` or double dash. +- `--size-only` + - Only checks the size of files. + - Uses no extra transactions. + - If the file doesn't change size then rclone won't detect it has + changed. + - `rclone sync --size-only /path/to/source s3:bucket` +- `--checksum` + - Checks the size and MD5 checksum of files. + - Uses no extra transactions. + - The most accurate detection of changes possible. + - Will cause the source to read an MD5 checksum which, if it is a + local disk, will cause lots of disk activity. + - If the source and destination are both S3 this is the + **recommended** flag to use for maximum efficiency. + - `rclone sync --checksum /path/to/source s3:bucket` +- `--update --use-server-modtime` + - Uses no extra transactions. + - Modification time becomes the time the object was uploaded. + - For many operations this is sufficient to determine if it needs + uploading. + - Using `--update` along with `--use-server-modtime`, avoids the + extra API call and uploads files whose local modification time + is newer than the time it was last uploaded. + - Files created with timestamps in the past will be missed by the sync. + - `rclone sync --update --use-server-modtime /path/to/source s3:bucket` -### Running tests +These flags can and should be used in combination with `--fast-list` - +see below. -- `go test . -case basic -remote local -remote2 local` - runs the `test_basic` test case using only the local filesystem, - synching one local directory with another local directory. - Test script output is to the console, while commands within scenario.txt - have their output sent to the `.../workdir/test.log` file, - which is finally compared to the golden copy. -- The first argument after `go test` should be a relative name of the - directory containing bisync source code. If you run tests right from there, - the argument will be `.` (current directory) as in most examples below. - If you run bisync tests from the rclone source directory, the command - should be `go test ./cmd/bisync ...`. -- The test engine will mangle rclone output to ensure comparability - with golden listings and logs. -- Test scenarios are located in `./cmd/bisync/testdata`. The test `-case` - argument should match the full name of a subdirectory under that - directory. Every test subdirectory name on disk must start with `test_`, - this prefix can be omitted on command line for brevity. Also, underscores - in the name can be replaced by dashes for convenience. -- `go test . -remote local -remote2 local -case all` runs all tests. -- Path1 and Path2 may either be the keyword `local` - or may be names of configured cloud services. - `go test . -remote gdrive: -remote2 dropbox: -case basic` - will run the test between these two services, without transferring - any files to the local filesystem. -- Test run stdout and stderr console output may be directed to a file, e.g. - `go test . -remote gdrive: -remote2 local -case all > runlog.txt 2>&1` +If using `rclone mount` or any command using the VFS (eg `rclone +serve`) commands then you might want to consider using the VFS flag +`--no-modtime` which will stop rclone reading the modification time +for every object. You could also use `--use-server-modtime` if you are +happy with the modification times of the objects being the time of +upload. -### Test execution flow +#### Avoiding GET requests to read directory listings -1. The base setup in the `initial` directory of the testcase is applied - on the Path1 and Path2 filesystems (via rclone copy the initial directory - to Path1, then rclone sync Path1 to Path2). -2. The commands in the scenario.txt file are applied, with output directed - to the `test.log` file in the test working directory. - Typically, the first actual command in the `scenario.txt` file is - to do a `--resync`, which establishes the baseline - `{...}.path1.lst` and `{...}.path2.lst` files in the test working - directory (`.../workdir/` relative to the temporary test directory). - Various commands and listing snapshots are done within the test. -3. Finally, the contents of the test working directory are compared - to the contents of the testcase's golden directory. +Rclone's default directory traversal is to process each directory +individually. This takes one API call per directory. Using the +`--fast-list` flag will read all info about the objects into +memory first using a smaller number of API calls (one per 1000 +objects). See the [rclone docs](https://rclone.org/docs/#fast-list) for more details. -### Notes about testing + rclone sync --fast-list --checksum /path/to/source s3:bucket -- Test cases are in individual directories beneath `./cmd/bisync/testdata`. - A command line reference to a test is understood to reference a directory - beneath `testdata`. For example, - `go test ./cmd/bisync -case dry-run -remote gdrive: -remote2 local` - refers to the test case in `./cmd/bisync/testdata/test_dry_run`. -- The test working directory is located at `.../workdir` relative to a - temporary test directory, usually under `/tmp` on Linux. -- The local test sync tree is created at a temporary directory named - like `bisync.XXX` under system temporary directory. -- The remote test sync tree is located at a temporary directory - under `/bisync.XXX/`. -- `path1` and/or `path2` subdirectories are created in a temporary - directory under the respective local or cloud test remote. -- By default, the Path1 and Path2 test dirs and workdir will be deleted - after each test run. The `-no-cleanup` flag disables purging these - directories when validating and debugging a given test. - These directories will be flushed before running another test, - independent of the `-no-cleanup` usage. -- You will likely want to add `- /testdir/` to your normal - bisync `--filters-file` so that normal syncs do not attempt to sync - the test temporary directories, which may have `RCLONE_TEST` miscompares - in some testcases which would otherwise trip the `--check-access` system. - The `--check-access` mechanism is hard-coded to ignore `RCLONE_TEST` - files beneath `bisync/testdata`, so the test cases may reside on the - synched tree even if there are check file mismatches in the test tree. -- Some Dropbox tests can fail, notably printing the following message: - `src and dst identical but can't set mod time without deleting and re-uploading` - This is expected and happens due to the way Dropbox handles modification times. - You should use the `-refresh-times` test flag to make up for this. -- If Dropbox tests hit request limit for you and print error message - `too_many_requests/...: Too many requests or write operations.` - then follow the - [Dropbox App ID instructions](https://rclone.org/dropbox/#get-your-own-dropbox-app-id). +`--fast-list` trades off API transactions for memory use. As a rough +guide rclone uses 1k of memory per object stored, so using +`--fast-list` on a sync of a million objects will use roughly 1 GiB of +RAM. -### Updating golden results +If you are only copying a small number of files into a big repository +then using `--no-traverse` is a good idea. This finds objects directly +instead of through directory listings. You can do a "top-up" sync very +cheaply by using `--max-age` and `--no-traverse` to copy only recent +files, eg -Sometimes even a slight change in the bisync source can cause little changes -spread around many log files. Updating them manually would be a nightmare. + rclone copy --max-age 24h --no-traverse /path/to/source s3:bucket -The `-golden` flag will store the `test.log` and `*.lst` listings from each -test case into respective golden directories. Golden results will -automatically contain generic strings instead of local or cloud paths which -means that they should match when run with a different cloud service. +You'd then do a full `rclone sync` less often. -Your normal workflow might be as follows: -1. Git-clone the rclone sources locally -2. Modify bisync source and check that it builds -3. Run the whole test suite `go test ./cmd/bisync -remote local` -4. If some tests show log difference, recheck them individually, e.g.: - `go test ./cmd/bisync -remote local -case basic` -5. If you are convinced with the difference, goldenize all tests at once: - `go test ./cmd/bisync -remote local -golden` -6. Use word diff: `git diff --word-diff ./cmd/bisync/testdata/`. - Please note that normal line-level diff is generally useless here. -7. Check the difference _carefully_! -8. Commit the change (`git commit`) _only_ if you are sure. - If unsure, save your code changes then wipe the log diffs from git: - `git reset [--hard]`. +Note that `--fast-list` isn't required in the top-up sync. -### Structure of test scenarios +#### Avoiding HEAD requests after PUT -- `/initial/` contains a tree of files that will be set - as the initial condition on both Path1 and Path2 testdirs. -- `/modfiles/` contains files that will be used to - modify the Path1 and/or Path2 filesystems. -- `/golden/` contains the expected content of the test - working directory (`workdir`) at the completion of the testcase. -- `/scenario.txt` contains the body of the test, in the form of - various commands to modify files, run bisync, and snapshot listings. - Output from these commands is captured to `.../workdir/test.log` - for comparison to the golden files. +By default, rclone will HEAD every object it uploads. It does this to +check the object got uploaded correctly. -### Supported test commands +You can disable this with the [--s3-no-head](#s3-no-head) option - see +there for more details. -- `test ` - Print the line to the console and to the `test.log`: - `test sync is working correctly with options x, y, z` -- `copy-listings ` - Save a copy of all `.lst` listings in the test working directory - with the specified prefix: - `save-listings exclude-pass-run` -- `move-listings ` - Similar to `copy-listings` but removes the source -- `purge-children ` - This will delete all child files and purge all child subdirs under given - directory but keep the parent intact. This behavior is important for tests - with Google Drive because removing and re-creating the parent would change - its ID. -- `delete-file ` - Delete a single file. -- `delete-glob ` - Delete a group of files located one level deep in the given directory - with names matching a given glob pattern. -- `touch-glob YYYY-MM-DD ` - Change modification time on a group of files. -- `touch-copy YYYY-MM-DD ` - Change file modification time then copy it to destination. -- `copy-file ` - Copy a single file to given directory. -- `copy-as ` - Similar to above but destination must include both directory - and the new file name at destination. -- `copy-dir ` and `sync-dir ` - Copy/sync a directory. Equivalent of `rclone copy` and `rclone sync`. -- `list-dirs ` - Equivalent to `rclone lsf -R --dirs-only ` -- `bisync [options]` - Runs bisync against `-remote` and `-remote2`. +Setting this flag increases the chance for undetected upload failures. -### Supported substitution terms +### Versions -- `{testdir/}` - the root dir of the testcase -- `{datadir/}` - the `modfiles` dir under the testcase root -- `{workdir/}` - the temporary test working directory -- `{path1/}` - the root of the Path1 test directory tree -- `{path2/}` - the root of the Path2 test directory tree -- `{session}` - base name of the test listings -- `{/}` - OS-specific path separator -- `{spc}`, `{tab}`, `{eol}` - whitespace -- `{chr:HH}` - raw byte with given hexadecimal code +When bucket versioning is enabled (this can be done with rclone with +the [`rclone backend versioning`](#versioning) command) when rclone +uploads a new version of a file it creates a +[new version of it](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Versioning.html) +Likewise when you delete a file, the old version will be marked hidden +and still be available. -Substitution results of the terms named like `{dir/}` will end with -`/` (or backslash on Windows), so it is not necessary to include -slash in the usage, for example `delete-file {path1/}file1.txt`. +Old versions of files, where available, are visible using the +[`--s3-versions`](#s3-versions) flag. -## Benchmarks +It is also possible to view a bucket as it was at a certain point in +time, using the [`--s3-version-at`](#s3-version-at) flag. This will +show the file versions as they were at that time, showing files that +have been deleted afterwards, and hiding files that were created +since. -_This section is work in progress._ +If you wish to remove all the old versions then you can use the +[`rclone backend cleanup-hidden remote:bucket`](#cleanup-hidden) +command which will delete all the old hidden versions of files, +leaving the current ones intact. You can also supply a path and only +old versions under that path will be deleted, e.g. +`rclone backend cleanup-hidden remote:bucket/path/to/stuff`. -Here are a few data points for scale, execution times, and memory usage. +When you `purge` a bucket, the current and the old versions will be +deleted then the bucket will be deleted. -The first set of data was taken between a local disk to Dropbox. -The [speedtest.net](https://speedtest.net) download speed was ~170 Mbps, -and upload speed was ~10 Mbps. 500 files (~9.5 MB each) had been already -synched. 50 files were added in a new directory, each ~9.5 MB, ~475 MB total. +However `delete` will cause the current versions of the files to +become hidden old versions. -Change | Operations and times | Overall run time ---------------------------------------|--------------------------------------------------------|------------------ -500 files synched (nothing to move) | 1x listings for Path1 & Path2 | 1.5 sec -500 files synched with --check-access | 1x listings for Path1 & Path2 | 1.5 sec -50 new files on remote | Queued 50 copies down: 27 sec | 29 sec -Moved local dir | Queued 50 copies up: 410 sec, 50 deletes up: 9 sec | 421 sec -Moved remote dir | Queued 50 copies down: 31 sec, 50 deletes down: <1 sec | 33 sec -Delete local dir | Queued 50 deletes up: 9 sec | 13 sec +Here is a session showing the listing and retrieval of an old +version followed by a `cleanup` of the old versions. -This next data is from a user's application. They had ~400GB of data -over 1.96 million files being sync'ed between a Windows local disk and some -remote cloud. The file full path length was on average 35 characters -(which factors into load time and RAM required). +Show current version and all the versions with `--s3-versions` flag. -- Loading the prior listing into memory (1.96 million files, listing file - size 140 MB) took ~30 sec and occupied about 1 GB of RAM. -- Getting a fresh listing of the local file system (producing the - 140 MB output file) took about XXX sec. -- Getting a fresh listing of the remote file system (producing the 140 MB - output file) took about XXX sec. The network download speed was measured - at XXX Mb/s. -- Once the prior and current Path1 and Path2 listings were loaded (a total - of four to be loaded, two at a time), determining the deltas was pretty - quick (a few seconds for this test case), and the transfer time for any - files to be copied was dominated by the network bandwidth. +``` +$ rclone -q ls s3:cleanup-test + 9 one.txt -## References +$ rclone -q --s3-versions ls s3:cleanup-test + 9 one.txt + 8 one-v2016-07-04-141032-000.txt + 16 one-v2016-07-04-141003-000.txt + 15 one-v2016-07-02-155621-000.txt +``` -rclone's bisync implementation was derived from -the [rclonesync-V2](https://github.com/cjnaz/rclonesync-V2) project, -including documentation and test mechanisms, -with [@cjnaz](https://github.com/cjnaz)'s full support and encouragement. +Retrieve an old version -`rclone bisync` is similar in nature to a range of other projects: +``` +$ rclone -q --s3-versions copy s3:cleanup-test/one-v2016-07-04-141003-000.txt /tmp -- [unison](https://github.com/bcpierce00/unison) -- [syncthing](https://github.com/syncthing/syncthing) -- [cjnaz/rclonesync](https://github.com/cjnaz/rclonesync-V2) -- [ConorWilliams/rsinc](https://github.com/ConorWilliams/rsinc) -- [jwink3101/syncrclone](https://github.com/Jwink3101/syncrclone) -- [DavideRossi/upback](https://github.com/DavideRossi/upback) +$ ls -l /tmp/one-v2016-07-04-141003-000.txt +-rw-rw-r-- 1 ncw ncw 16 Jul 2 17:46 /tmp/one-v2016-07-04-141003-000.txt +``` -Bisync adopts the differential synchronization technique, which is -based on keeping history of changes performed by both synchronizing sides. -See the _Dual Shadow Method_ section in -[Neil Fraser's article](https://neil.fraser.name/writing/sync/). +Clean up all the old versions and show that they've gone. -Also note a number of academic publications by -[Benjamin Pierce](http://www.cis.upenn.edu/%7Ebcpierce/papers/index.shtml#File%20Synchronization) -about _Unison_ and synchronization in general. +``` +$ rclone -q backend cleanup-hidden s3:cleanup-test -## Changelog +$ rclone -q ls s3:cleanup-test + 9 one.txt -### `v1.64` -* Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Dry%20runs%20are%20not%20completely%20dry) -causing dry runs to inadvertently commit filter changes -* Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=2.%20%2D%2Dresync%20deletes%20data%2C%20contrary%20to%20docs) -causing `--resync` to erroneously delete empty folders and duplicate files unique to Path2 -* `--check-access` is now enforced during `--resync`, preventing data loss in [certain user error scenarios](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=%2D%2Dcheck%2Daccess%20doesn%27t%20always%20fail%20when%20it%20should) -* Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=5.%20Bisync%20reads%20files%20in%20excluded%20directories%20during%20delete%20operations) -causing bisync to consider more files than necessary due to overbroad filters during delete operations -* [Improved detection of false positive change conflicts](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Identical%20files%20should%20be%20left%20alone%2C%20even%20if%20new/newer/changed%20on%20both%20sides) -(identical files are now left alone instead of renamed) -* Added [support for `--create-empty-src-dirs`](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=3.%20Bisync%20should%20create/delete%20empty%20directories%20as%20sync%20does%2C%20when%20%2D%2Dcreate%2Dempty%2Dsrc%2Ddirs%20is%20passed) -* Added experimental `--resilient` mode to allow [recovery from self-correctable errors](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=2.%20Bisync%20should%20be%20more%20resilient%20to%20self%2Dcorrectable%20errors) -* Added [new `--ignore-listing-checksum` flag](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=6.%20%2D%2Dignore%2Dchecksum%20should%20be%20split%20into%20two%20flags%20for%20separate%20purposes) -to distinguish from `--ignore-checksum` -* [Performance improvements](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=6.%20Deletes%20take%20several%20times%20longer%20than%20copies) for large remotes -* Documentation and testing improvements +$ rclone -q --s3-versions ls s3:cleanup-test + 9 one.txt +``` -# Release signing +#### Versions naming caveat -The hashes of the binary artefacts of the rclone release are signed -with a public PGP/GPG key. This can be verified manually as described -below. +When using `--s3-versions` flag rclone is relying on the file name +to work out whether the objects are versions or not. Versions' names +are created by inserting timestamp between file name and its extension. +``` + 9 file.txt + 8 file-v2023-07-17-161032-000.txt + 16 file-v2023-06-15-141003-000.txt +``` +If there are real files present with the same names as versions, then +behaviour of `--s3-versions` can be unpredictable. -The same mechanism is also used by [rclone selfupdate](https://rclone.org/commands/rclone_selfupdate/) -to verify that the release has not been tampered with before the new -update is installed. This checks the SHA256 hash and the signature -with a public key compiled into the rclone binary. +### Cleanup -## Release signing key +If you run `rclone cleanup s3:bucket` then it will remove all pending +multipart uploads older than 24 hours. You can use the `--interactive`/`i` +or `--dry-run` flag to see exactly what it will do. If you want more control over the +expiry date then run `rclone backend cleanup s3:bucket -o max-age=1h` +to expire all uploads older than one hour. You can use `rclone backend +list-multipart-uploads s3:bucket` to see the pending multipart +uploads. -You may obtain the release signing key from: +### Restricted filename characters -- From [KEYS](/KEYS) on this website - this file contains all past signing keys also. -- The git repository hosted on GitHub - https://github.com/rclone/rclone/blob/master/docs/content/KEYS -- `gpg --keyserver hkps://keys.openpgp.org --search nick@craig-wood.com` -- `gpg --keyserver hkps://keyserver.ubuntu.com --search nick@craig-wood.com` -- https://www.craig-wood.com/nick/pub/pgp-key.txt +S3 allows any valid UTF-8 string as a key. -After importing the key, verify that the fingerprint of one of the -keys matches: `FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA` as this key is used for signing. +Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), as +they can't be used in XML. -We recommend that you cross-check the fingerprint shown above through -the domains listed below. By cross-checking the integrity of the -fingerprint across multiple domains you can be confident that you -obtained the correct key. +The following characters are replaced since these are problematic when +dealing with the REST API: -- The [source for this page on GitHub](https://github.com/rclone/rclone/blob/master/docs/content/release_signing.md). -- Through DNS `dig key.rclone.org txt` +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| NUL | 0x00 | ␀ | +| / | 0x2F | / | -If you find anything that doesn't not match, please contact the -developers at once. +The encoding will also encode these file names as they don't seem to +work with the SDK properly: -## How to verify the release +| File name | Replacement | +| --------- |:-----------:| +| . | . | +| .. | .. | -In the release directory you will see the release files and some files called `MD5SUMS`, `SHA1SUMS` and `SHA256SUMS`. +### Multipart uploads -``` -$ rclone lsf --http-url https://downloads.rclone.org/v1.63.1 :http: -MD5SUMS -SHA1SUMS -SHA256SUMS -rclone-v1.63.1-freebsd-386.zip -rclone-v1.63.1-freebsd-amd64.zip -... -rclone-v1.63.1-windows-arm64.zip -rclone-v1.63.1.tar.gz -version.txt -``` +rclone supports multipart uploads with S3 which means that it can +upload files bigger than 5 GiB. -The `MD5SUMS`, `SHA1SUMS` and `SHA256SUMS` contain hashes of the -binary files in the release directory along with a signature. +Note that files uploaded *both* with multipart upload *and* through +crypt remotes do not have MD5 sums. -For example: +rclone switches from single part uploads to multipart uploads at the +point specified by `--s3-upload-cutoff`. This can be a maximum of 5 GiB +and a minimum of 0 (ie always upload multipart files). -``` -$ rclone cat --http-url https://downloads.rclone.org/v1.63.1 :http:SHA256SUMS ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 +The chunk sizes used in the multipart upload are specified by +`--s3-chunk-size` and the number of chunks uploaded concurrently is +specified by `--s3-upload-concurrency`. -f6d1b2d7477475ce681bdce8cb56f7870f174cb6b2a9ac5d7b3764296ea4a113 rclone-v1.63.1-freebsd-386.zip -7266febec1f01a25d6575de51c44ddf749071a4950a6384e4164954dff7ac37e rclone-v1.63.1-freebsd-amd64.zip -... -66ca083757fb22198309b73879831ed2b42309892394bf193ff95c75dff69c73 rclone-v1.63.1-windows-amd64.zip -bbb47c16882b6c5f2e8c1b04229378e28f68734c613321ef0ea2263760f74cd0 rclone-v1.63.1-windows-arm64.zip ------BEGIN PGP SIGNATURE----- +Multipart uploads will use `--transfers` * `--s3-upload-concurrency` * +`--s3-chunk-size` extra memory. Single part uploads to not use extra +memory. -iF0EARECAB0WIQT79zfs6firGGBL0qyTk14C/ztU+gUCZLVKJQAKCRCTk14C/ztU -+pZuAJ0XJ+QWLP/3jCtkmgcgc4KAwd/rrwCcCRZQ7E+oye1FPY46HOVzCFU3L7g= -=8qrL ------END PGP SIGNATURE----- -``` +Single part transfers can be faster than multipart transfers or slower +depending on your latency from S3 - the more latency, the more likely +single part transfers will be faster. -### Download the files +Increasing `--s3-upload-concurrency` will increase throughput (8 would +be a sensible value) and increasing `--s3-chunk-size` also increases +throughput (16M would be sensible). Increasing either of these will +use more memory. The default values are high enough to gain most of +the possible performance without using too much memory. -The first step is to download the binary and SUMs file and verify that -the SUMs you have downloaded match. Here we download -`rclone-v1.63.1-windows-amd64.zip` - choose the binary (or binaries) -appropriate to your architecture. We've also chosen the `SHA256SUMS` -as these are the most secure. You could verify the other types of hash -also for extra security. `rclone selfupdate` verifies just the -`SHA256SUMS`. -``` -$ mkdir /tmp/check -$ cd /tmp/check -$ rclone copy --http-url https://downloads.rclone.org/v1.63.1 :http:SHA256SUMS . -$ rclone copy --http-url https://downloads.rclone.org/v1.63.1 :http:rclone-v1.63.1-windows-amd64.zip . -``` +### Buckets and Regions -### Verify the signatures +With Amazon S3 you can list buckets (`rclone lsd`) using any region, +but you can only access the content of a bucket from the region it was +created in. If you attempt to access a bucket from the wrong region, +you will get an error, `incorrect region, the bucket is not in 'XXX' +region`. -First verify the signatures on the SHA256 file. +### Authentication -Import the key. See above for ways to verify this key is correct. +There are a number of ways to supply `rclone` with a set of AWS +credentials, with and without using the environment. -``` -$ gpg --keyserver keyserver.ubuntu.com --receive-keys FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA -gpg: key 93935E02FF3B54FA: public key "Nick Craig-Wood " imported -gpg: Total number processed: 1 -gpg: imported: 1 -``` +The different authentication methods are tried in this order: -Then check the signature: + - Directly in the rclone configuration file (`env_auth = false` in the config file): + - `access_key_id` and `secret_access_key` are required. + - `session_token` can be optionally set when using AWS STS. + - Runtime configuration (`env_auth = true` in the config file): + - Export the following environment variables before running `rclone`: + - Access Key ID: `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` + - Secret Access Key: `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` + - Session Token: `AWS_SESSION_TOKEN` (optional) + - Or, use a [named profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html): + - Profile files are standard files used by AWS CLI tools + - By default it will use the profile in your home directory (e.g. `~/.aws/credentials` on unix based systems) file and the "default" profile, to change set these environment variables: + - `AWS_SHARED_CREDENTIALS_FILE` to control which file. + - `AWS_PROFILE` to control which profile to use. + - Or, run `rclone` in an ECS task with an IAM role (AWS only). + - Or, run `rclone` on an EC2 instance with an IAM role (AWS only). + - Or, run `rclone` in an EKS pod with an IAM role that is associated with a service account (AWS only). -``` -$ gpg --verify SHA256SUMS -gpg: Signature made Mon 17 Jul 2023 15:03:17 BST -gpg: using DSA key FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA -gpg: Good signature from "Nick Craig-Wood " [ultimate] -``` +If none of these option actually end up providing `rclone` with AWS +credentials then S3 interaction will be non-authenticated (see below). -Verify the signature was good and is using the fingerprint shown above. +### S3 Permissions -Repeat for `MD5SUMS` and `SHA1SUMS` if desired. +When using the `sync` subcommand of `rclone` the following minimum +permissions are required to be available on the bucket being written to: -### Verify the hashes +* `ListBucket` +* `DeleteObject` +* `GetObject` +* `PutObject` +* `PutObjectACL` -Now that we know the signatures on the hashes are OK we can verify the -binaries match the hashes, completing the verification. +When using the `lsd` subcommand, the `ListAllMyBuckets` permission is required. + +Example policy: ``` -$ sha256sum -c SHA256SUMS 2>&1 | grep OK -rclone-v1.63.1-windows-amd64.zip: OK +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "AWS": "arn:aws:iam::USER_SID:user/USER_NAME" + }, + "Action": [ + "s3:ListBucket", + "s3:DeleteObject", + "s3:GetObject", + "s3:PutObject", + "s3:PutObjectAcl" + ], + "Resource": [ + "arn:aws:s3:::BUCKET_NAME/*", + "arn:aws:s3:::BUCKET_NAME" + ] + }, + { + "Effect": "Allow", + "Action": "s3:ListAllMyBuckets", + "Resource": "arn:aws:s3:::*" + } + ] +} ``` -Or do the check with rclone +Notes on above: -``` -$ rclone hashsum sha256 -C SHA256SUMS rclone-v1.63.1-windows-amd64.zip -2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 0 -2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 1 -2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 49 -2023/09/11 10:53:58 NOTICE: SHA256SUMS: 4 warning(s) suppressed... -= rclone-v1.63.1-windows-amd64.zip -2023/09/11 10:53:58 NOTICE: Local file system at /tmp/check: 0 differences found -2023/09/11 10:53:58 NOTICE: Local file system at /tmp/check: 1 matching files -``` +1. This is a policy that can be used when creating bucket. It assumes + that `USER_NAME` has been created. +2. The Resource entry must include both resource ARNs, as one implies + the bucket and the other implies the bucket's objects. -### Verify signatures and hashes together +For reference, [here's an Ansible script](https://gist.github.com/ebridges/ebfc9042dd7c756cd101cfa807b7ae2b) +that will generate one or more buckets that will work with `rclone sync`. -You can verify the signatures and hashes in one command line like this: +### Key Management System (KMS) -``` -$ gpg --decrypt SHA256SUMS | sha256sum -c --ignore-missing -gpg: Signature made Mon 17 Jul 2023 15:03:17 BST -gpg: using DSA key FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA -gpg: Good signature from "Nick Craig-Wood " [ultimate] -gpg: aka "Nick Craig-Wood " [unknown] -rclone-v1.63.1-windows-amd64.zip: OK -``` +If you are using server-side encryption with KMS then you must make +sure rclone is configured with `server_side_encryption = aws:kms` +otherwise you will find you can't transfer small objects - these will +create checksum errors. -# 1Fichier +### Glacier and Glacier Deep Archive -This is a backend for the [1fichier](https://1fichier.com) cloud -storage service. Note that a Premium subscription is required to use -the API. +You can upload objects using the glacier storage class or transition them to glacier using a [lifecycle policy](http://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-lifecycle.html). +The bucket can still be synced or copied into normally, but if rclone +tries to access data from the glacier storage class you will see an error like below. -Paths are specified as `remote:path` + 2017/09/11 19:07:43 Failed to sync: failed to open source object: Object in GLACIER, restore first: path/to/file -Paths may be as deep as required, e.g. `remote:directory/subdirectory`. +In this case you need to [restore](http://docs.aws.amazon.com/AmazonS3/latest/user-guide/restore-archived-objects.html) +the object(s) in question before using rclone. -## Configuration +Note that rclone only speaks the S3 API it does not speak the Glacier +Vault API, so rclone cannot directly access Glacier Vaults. -The initial setup for 1Fichier involves getting the API key from the website which you -need to do in your browser. +### Object-lock enabled S3 bucket -Here is an example of how to make a remote called `remote`. First run: +According to AWS's [documentation on S3 Object Lock](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-overview.html#object-lock-permission): - rclone config +> If you configure a default retention period on a bucket, requests to upload objects in such a bucket must include the Content-MD5 header. -This will guide you through an interactive setup process: +As mentioned in the [Modification times and hashes](#modification-times-and-hashes) section, +small files that are not uploaded as multipart, use a different tag, causing the upload to fail. +A simple solution is to set the `--s3-upload-cutoff 0` and force all the files to be uploaded as multipart. -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> remote -Type of storage to configure. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value -[snip] -XX / 1Fichier - \ "fichier" -[snip] -Storage> fichier -** See help for fichier backend at: https://rclone.org/fichier/ ** -Your API Key, get it from https://1fichier.com/console/params.pl -Enter a string value. Press Enter for the default (""). -api_key> example_key +### Standard options -Edit advanced config? (y/n) -y) Yes -n) No -y/n> -Remote config --------------------- -[remote] -type = fichier -api_key = example_key --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +Here are the Standard options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Minio, Netease, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others). -Once configured you can then use `rclone` like this, +#### --s3-provider -List directories in top level of your 1Fichier account +Choose your S3 provider. - rclone lsd remote: +Properties: -List all the files in your 1Fichier account +- Config: provider +- Env Var: RCLONE_S3_PROVIDER +- Type: string +- Required: false +- Examples: + - "AWS" + - Amazon Web Services (AWS) S3 + - "Alibaba" + - Alibaba Cloud Object Storage System (OSS) formerly Aliyun + - "ArvanCloud" + - Arvan Cloud Object Storage (AOS) + - "Ceph" + - Ceph Object Storage + - "ChinaMobile" + - China Mobile Ecloud Elastic Object Storage (EOS) + - "Cloudflare" + - Cloudflare R2 Storage + - "DigitalOcean" + - DigitalOcean Spaces + - "Dreamhost" + - Dreamhost DreamObjects + - "GCS" + - Google Cloud Storage + - "HuaweiOBS" + - Huawei Object Storage Service + - "IBMCOS" + - IBM COS S3 + - "IDrive" + - IDrive e2 + - "IONOS" + - IONOS Cloud + - "LyveCloud" + - Seagate Lyve Cloud + - "Leviia" + - Leviia Object Storage + - "Liara" + - Liara Object Storage + - "Linode" + - Linode Object Storage + - "Minio" + - Minio Object Storage + - "Netease" + - Netease Object Storage (NOS) + - "Petabox" + - Petabox Object Storage + - "RackCorp" + - RackCorp Object Storage + - "Rclone" + - Rclone S3 Server + - "Scaleway" + - Scaleway Object Storage + - "SeaweedFS" + - SeaweedFS S3 + - "StackPath" + - StackPath Object Storage + - "Storj" + - Storj (S3 Compatible Gateway) + - "Synology" + - Synology C2 Object Storage + - "TencentCOS" + - Tencent Cloud Object Storage (COS) + - "Wasabi" + - Wasabi Object Storage + - "Qiniu" + - Qiniu Object Storage (Kodo) + - "Other" + - Any other S3 compatible provider - rclone ls remote: +#### --s3-env-auth -To copy a local directory to a 1Fichier directory called backup +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). - rclone copy /home/source remote:backup +Only applies if access_key_id and secret_access_key is blank. -### Modified time and hashes ### +Properties: -1Fichier does not support modification times. It supports the Whirlpool hash algorithm. +- Config: env_auth +- Env Var: RCLONE_S3_ENV_AUTH +- Type: bool +- Default: false +- Examples: + - "false" + - Enter AWS credentials in the next step. + - "true" + - Get AWS credentials from the environment (env vars or IAM). + +#### --s3-access-key-id -### Duplicated files ### +AWS Access Key ID. -1Fichier can have two files with exactly the same name and path (unlike a -normal file system). +Leave blank for anonymous access or runtime credentials. -Duplicated files cause problems with the syncing and you will see -messages in the log about duplicates. +Properties: -### Restricted filename characters +- Config: access_key_id +- Env Var: RCLONE_S3_ACCESS_KEY_ID +- Type: string +- Required: false -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) -the following characters are also replaced: +#### --s3-secret-access-key -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| \ | 0x5C | \ | -| < | 0x3C | < | -| > | 0x3E | > | -| " | 0x22 | " | -| $ | 0x24 | $ | -| ` | 0x60 | ` | -| ' | 0x27 | ' | +AWS Secret Access Key (password). -File names can also not start or end with the following characters. -These only get replaced if they are the first or last character in the -name: +Leave blank for anonymous access or runtime credentials. -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| SP | 0x20 | ␠ | +Properties: -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in JSON strings. +- Config: secret_access_key +- Env Var: RCLONE_S3_SECRET_ACCESS_KEY +- Type: string +- Required: false +#### --s3-region -### Standard options +Region to connect to. + +Properties: + +- Config: region +- Env Var: RCLONE_S3_REGION +- Provider: AWS +- Type: string +- Required: false +- Examples: + - "us-east-1" + - The default endpoint - a good choice if you are unsure. + - US Region, Northern Virginia, or Pacific Northwest. + - Leave location constraint empty. + - "us-east-2" + - US East (Ohio) Region. + - Needs location constraint us-east-2. + - "us-west-1" + - US West (Northern California) Region. + - Needs location constraint us-west-1. + - "us-west-2" + - US West (Oregon) Region. + - Needs location constraint us-west-2. + - "ca-central-1" + - Canada (Central) Region. + - Needs location constraint ca-central-1. + - "eu-west-1" + - EU (Ireland) Region. + - Needs location constraint EU or eu-west-1. + - "eu-west-2" + - EU (London) Region. + - Needs location constraint eu-west-2. + - "eu-west-3" + - EU (Paris) Region. + - Needs location constraint eu-west-3. + - "eu-north-1" + - EU (Stockholm) Region. + - Needs location constraint eu-north-1. + - "eu-south-1" + - EU (Milan) Region. + - Needs location constraint eu-south-1. + - "eu-central-1" + - EU (Frankfurt) Region. + - Needs location constraint eu-central-1. + - "ap-southeast-1" + - Asia Pacific (Singapore) Region. + - Needs location constraint ap-southeast-1. + - "ap-southeast-2" + - Asia Pacific (Sydney) Region. + - Needs location constraint ap-southeast-2. + - "ap-northeast-1" + - Asia Pacific (Tokyo) Region. + - Needs location constraint ap-northeast-1. + - "ap-northeast-2" + - Asia Pacific (Seoul). + - Needs location constraint ap-northeast-2. + - "ap-northeast-3" + - Asia Pacific (Osaka-Local). + - Needs location constraint ap-northeast-3. + - "ap-south-1" + - Asia Pacific (Mumbai). + - Needs location constraint ap-south-1. + - "ap-east-1" + - Asia Pacific (Hong Kong) Region. + - Needs location constraint ap-east-1. + - "sa-east-1" + - South America (Sao Paulo) Region. + - Needs location constraint sa-east-1. + - "me-south-1" + - Middle East (Bahrain) Region. + - Needs location constraint me-south-1. + - "af-south-1" + - Africa (Cape Town) Region. + - Needs location constraint af-south-1. + - "cn-north-1" + - China (Beijing) Region. + - Needs location constraint cn-north-1. + - "cn-northwest-1" + - China (Ningxia) Region. + - Needs location constraint cn-northwest-1. + - "us-gov-east-1" + - AWS GovCloud (US-East) Region. + - Needs location constraint us-gov-east-1. + - "us-gov-west-1" + - AWS GovCloud (US) Region. + - Needs location constraint us-gov-west-1. -Here are the Standard options specific to fichier (1Fichier). +#### --s3-endpoint -#### --fichier-api-key +Endpoint for S3 API. -Your API Key, get it from https://1fichier.com/console/params.pl. +Leave blank if using AWS to use the default endpoint for the region. Properties: -- Config: api_key -- Env Var: RCLONE_FICHIER_API_KEY +- Config: endpoint +- Env Var: RCLONE_S3_ENDPOINT +- Provider: AWS - Type: string - Required: false -### Advanced options - -Here are the Advanced options specific to fichier (1Fichier). +#### --s3-location-constraint -#### --fichier-shared-folder +Location constraint - must be set to match the Region. -If you want to download a shared folder, add this parameter. +Used when creating buckets only. Properties: -- Config: shared_folder -- Env Var: RCLONE_FICHIER_SHARED_FOLDER +- Config: location_constraint +- Env Var: RCLONE_S3_LOCATION_CONSTRAINT +- Provider: AWS - Type: string - Required: false +- Examples: + - "" + - Empty for US Region, Northern Virginia, or Pacific Northwest + - "us-east-2" + - US East (Ohio) Region + - "us-west-1" + - US West (Northern California) Region + - "us-west-2" + - US West (Oregon) Region + - "ca-central-1" + - Canada (Central) Region + - "eu-west-1" + - EU (Ireland) Region + - "eu-west-2" + - EU (London) Region + - "eu-west-3" + - EU (Paris) Region + - "eu-north-1" + - EU (Stockholm) Region + - "eu-south-1" + - EU (Milan) Region + - "EU" + - EU Region + - "ap-southeast-1" + - Asia Pacific (Singapore) Region + - "ap-southeast-2" + - Asia Pacific (Sydney) Region + - "ap-northeast-1" + - Asia Pacific (Tokyo) Region + - "ap-northeast-2" + - Asia Pacific (Seoul) Region + - "ap-northeast-3" + - Asia Pacific (Osaka-Local) Region + - "ap-south-1" + - Asia Pacific (Mumbai) Region + - "ap-east-1" + - Asia Pacific (Hong Kong) Region + - "sa-east-1" + - South America (Sao Paulo) Region + - "me-south-1" + - Middle East (Bahrain) Region + - "af-south-1" + - Africa (Cape Town) Region + - "cn-north-1" + - China (Beijing) Region + - "cn-northwest-1" + - China (Ningxia) Region + - "us-gov-east-1" + - AWS GovCloud (US-East) Region + - "us-gov-west-1" + - AWS GovCloud (US) Region -#### --fichier-file-password - -If you want to download a shared file that is password protected, add this parameter. +#### --s3-acl -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +Canned ACL used when creating buckets and storing or copying objects. -Properties: +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. -- Config: file_password -- Env Var: RCLONE_FICHIER_FILE_PASSWORD -- Type: string -- Required: false +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -#### --fichier-folder-password +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. -If you want to list the files in a shared folder that is password protected, add this parameter. +If the acl is an empty string then no X-Amz-Acl: header is added and +the default (private) will be used. -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: -- Config: folder_password -- Env Var: RCLONE_FICHIER_FOLDER_PASSWORD +- Config: acl +- Env Var: RCLONE_S3_ACL +- Provider: !Storj,Synology,Cloudflare - Type: string - Required: false +- Examples: + - "default" + - Owner gets Full_CONTROL. + - No one else has access rights (default). + - "private" + - Owner gets FULL_CONTROL. + - No one else has access rights (default). + - "public-read" + - Owner gets FULL_CONTROL. + - The AllUsers group gets READ access. + - "public-read-write" + - Owner gets FULL_CONTROL. + - The AllUsers group gets READ and WRITE access. + - Granting this on a bucket is generally not recommended. + - "authenticated-read" + - Owner gets FULL_CONTROL. + - The AuthenticatedUsers group gets READ access. + - "bucket-owner-read" + - Object owner gets FULL_CONTROL. + - Bucket owner gets READ access. + - If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + - "bucket-owner-full-control" + - Both the object owner and the bucket owner get FULL_CONTROL over the object. + - If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + - "private" + - Owner gets FULL_CONTROL. + - No one else has access rights (default). + - This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise COS. + - "public-read" + - Owner gets FULL_CONTROL. + - The AllUsers group gets READ access. + - This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise IBM COS. + - "public-read-write" + - Owner gets FULL_CONTROL. + - The AllUsers group gets READ and WRITE access. + - This acl is available on IBM Cloud (Infra), On-Premise IBM COS. + - "authenticated-read" + - Owner gets FULL_CONTROL. + - The AuthenticatedUsers group gets READ access. + - Not supported on Buckets. + - This acl is available on IBM Cloud (Infra) and On-Premise IBM COS. -#### --fichier-cdn +#### --s3-server-side-encryption -Set if you wish to use CDN download links. +The server-side encryption algorithm used when storing this object in S3. Properties: -- Config: cdn -- Env Var: RCLONE_FICHIER_CDN -- Type: bool -- Default: false - -#### --fichier-encoding +- Config: server_side_encryption +- Env Var: RCLONE_S3_SERVER_SIDE_ENCRYPTION +- Provider: AWS,Ceph,ChinaMobile,Minio +- Type: string +- Required: false +- Examples: + - "" + - None + - "AES256" + - AES256 + - "aws:kms" + - aws:kms -The encoding for the backend. +#### --s3-sse-kms-key-id -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +If using KMS ID you must provide the ARN of Key. Properties: -- Config: encoding -- Env Var: RCLONE_FICHIER_ENCODING -- Type: MultiEncoder -- Default: Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot - - - -## Limitations - -`rclone about` is not supported by the 1Fichier backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. - -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) - -# Alias - -The `alias` remote provides a new name for another remote. +- Config: sse_kms_key_id +- Env Var: RCLONE_S3_SSE_KMS_KEY_ID +- Provider: AWS,Ceph,Minio +- Type: string +- Required: false +- Examples: + - "" + - None + - "arn:aws:kms:us-east-1:*" + - arn:aws:kms:* -Paths may be as deep as required or a local path, -e.g. `remote:directory/subdirectory` or `/directory/subdirectory`. +#### --s3-storage-class -During the initial setup with `rclone config` you will specify the target -remote. The target remote can either be a local path or another remote. +The storage class to use when storing new objects in S3. -Subfolders can be used in target remote. Assume an alias remote named `backup` -with the target `mydrive:private/backup`. Invoking `rclone mkdir backup:desktop` -is exactly the same as invoking `rclone mkdir mydrive:private/backup/desktop`. +Properties: -There will be no special handling of paths containing `..` segments. -Invoking `rclone mkdir backup:../desktop` is exactly the same as invoking -`rclone mkdir mydrive:private/backup/../desktop`. -The empty path is not allowed as a remote. To alias the current directory -use `.` instead. +- Config: storage_class +- Env Var: RCLONE_S3_STORAGE_CLASS +- Provider: AWS +- Type: string +- Required: false +- Examples: + - "" + - Default + - "STANDARD" + - Standard storage class + - "REDUCED_REDUNDANCY" + - Reduced redundancy storage class + - "STANDARD_IA" + - Standard Infrequent Access storage class + - "ONEZONE_IA" + - One Zone Infrequent Access storage class + - "GLACIER" + - Glacier storage class + - "DEEP_ARCHIVE" + - Glacier Deep Archive storage class + - "INTELLIGENT_TIERING" + - Intelligent-Tiering storage class + - "GLACIER_IR" + - Glacier Instant Retrieval storage class -The target remote can also be a [connection string](https://rclone.org/docs/#connection-strings). -This can be used to modify the config of a remote for different uses, e.g. -the alias `myDriveTrash` with the target remote `myDrive,trashed_only:` -can be used to only show the trashed files in `myDrive`. +### Advanced options -## Configuration +Here are the Advanced options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Minio, Netease, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others). -Here is an example of how to make an alias called `remote` for local folder. -First run: +#### --s3-bucket-acl - rclone config +Canned ACL used when creating buckets. -This will guide you through an interactive setup process: +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> remote -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Alias for an existing remote - \ "alias" -[snip] -Storage> alias -Remote or path to alias. -Can be "myremote:path/to/dir", "myremote:bucket", "myremote:" or "/local/path". -remote> /mnt/storage/backup -Remote config --------------------- -[remote] -remote = /mnt/storage/backup --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -Current remotes: +Note that this ACL is applied when only when creating buckets. If it +isn't set then "acl" is used instead. -Name Type -==== ==== -remote alias +If the "acl" and "bucket_acl" are empty strings then no X-Amz-Acl: +header is added and the default (private) will be used. -e) Edit existing remote -n) New remote -d) Delete remote -r) Rename remote -c) Copy remote -s) Set configuration password -q) Quit config -e/n/d/r/c/s/q> q -``` -Once configured you can then use `rclone` like this, +Properties: -List directories in top level in `/mnt/storage/backup` +- Config: bucket_acl +- Env Var: RCLONE_S3_BUCKET_ACL +- Type: string +- Required: false +- Examples: + - "private" + - Owner gets FULL_CONTROL. + - No one else has access rights (default). + - "public-read" + - Owner gets FULL_CONTROL. + - The AllUsers group gets READ access. + - "public-read-write" + - Owner gets FULL_CONTROL. + - The AllUsers group gets READ and WRITE access. + - Granting this on a bucket is generally not recommended. + - "authenticated-read" + - Owner gets FULL_CONTROL. + - The AuthenticatedUsers group gets READ access. - rclone lsd remote: +#### --s3-requester-pays -List all the files in `/mnt/storage/backup` +Enables requester pays option when interacting with S3 bucket. - rclone ls remote: +Properties: -Copy another local directory to the alias directory called source +- Config: requester_pays +- Env Var: RCLONE_S3_REQUESTER_PAYS +- Provider: AWS +- Type: bool +- Default: false - rclone copy /home/source remote:source +#### --s3-sse-customer-algorithm +If using SSE-C, the server-side encryption algorithm used when storing this object in S3. -### Standard options +Properties: -Here are the Standard options specific to alias (Alias for an existing remote). +- Config: sse_customer_algorithm +- Env Var: RCLONE_S3_SSE_CUSTOMER_ALGORITHM +- Provider: AWS,Ceph,ChinaMobile,Minio +- Type: string +- Required: false +- Examples: + - "" + - None + - "AES256" + - AES256 -#### --alias-remote +#### --s3-sse-customer-key -Remote or path to alias. +To use SSE-C you may provide the secret encryption key used to encrypt/decrypt your data. -Can be "myremote:path/to/dir", "myremote:bucket", "myremote:" or "/local/path". +Alternatively you can provide --sse-customer-key-base64. Properties: -- Config: remote -- Env Var: RCLONE_ALIAS_REMOTE +- Config: sse_customer_key +- Env Var: RCLONE_S3_SSE_CUSTOMER_KEY +- Provider: AWS,Ceph,ChinaMobile,Minio - Type: string -- Required: true - - - -# Amazon Drive +- Required: false +- Examples: + - "" + - None -Amazon Drive, formerly known as Amazon Cloud Drive, is a cloud storage -service run by Amazon for consumers. +#### --s3-sse-customer-key-base64 -## Status +If using SSE-C you must provide the secret encryption key encoded in base64 format to encrypt/decrypt your data. -**Important:** rclone supports Amazon Drive only if you have your own -set of API keys. Unfortunately the [Amazon Drive developer -program](https://developer.amazon.com/amazon-drive) is now closed to -new entries so if you don't already have your own set of keys you will -not be able to use rclone with Amazon Drive. +Alternatively you can provide --sse-customer-key. -For the history on why rclone no longer has a set of Amazon Drive API -keys see [the forum](https://forum.rclone.org/t/rclone-has-been-banned-from-amazon-drive/2314). +Properties: -If you happen to know anyone who works at Amazon then please ask them -to re-instate rclone into the Amazon Drive developer program - thanks! +- Config: sse_customer_key_base64 +- Env Var: RCLONE_S3_SSE_CUSTOMER_KEY_BASE64 +- Provider: AWS,Ceph,ChinaMobile,Minio +- Type: string +- Required: false +- Examples: + - "" + - None -## Configuration +#### --s3-sse-customer-key-md5 -The initial setup for Amazon Drive involves getting a token from -Amazon which you need to do in your browser. `rclone config` walks -you through it. +If using SSE-C you may provide the secret encryption key MD5 checksum (optional). -The configuration process for Amazon Drive may involve using an [oauth -proxy](https://github.com/ncw/oauthproxy). This is used to keep the -Amazon credentials out of the source code. The proxy runs in Google's -very secure App Engine environment and doesn't store any credentials -which pass through it. +If you leave it blank, this is calculated automatically from the sse_customer_key provided. -Since rclone doesn't currently have its own Amazon Drive credentials -so you will either need to have your own `client_id` and -`client_secret` with Amazon Drive, or use a third-party oauth proxy -in which case you will need to enter `client_id`, `client_secret`, -`auth_url` and `token_url`. -Note also if you are not using Amazon's `auth_url` and `token_url`, -(ie you filled in something for those) then if setting up on a remote -machine you can only use the [copying the config method of -configuration](https://rclone.org/remote_setup/#configuring-by-copying-the-config-file) -- `rclone authorize` will not work. +Properties: -Here is an example of how to make a remote called `remote`. First run: +- Config: sse_customer_key_md5 +- Env Var: RCLONE_S3_SSE_CUSTOMER_KEY_MD5 +- Provider: AWS,Ceph,ChinaMobile,Minio +- Type: string +- Required: false +- Examples: + - "" + - None - rclone config +#### --s3-upload-cutoff -This will guide you through an interactive setup process: +Cutoff for switching to chunked upload. -``` -No remotes found, make a new one? -n) New remote -r) Rename remote -c) Copy remote -s) Set configuration password -q) Quit config -n/r/c/s/q> n -name> remote -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Amazon Drive - \ "amazon cloud drive" -[snip] -Storage> amazon cloud drive -Amazon Application Client Id - required. -client_id> your client ID goes here -Amazon Application Client Secret - required. -client_secret> your client secret goes here -Auth server URL - leave blank to use Amazon's. -auth_url> Optional auth URL -Token server url - leave blank to use Amazon's. -token_url> Optional token URL -Remote config -Make sure your Redirect URL is set to "http://127.0.0.1:53682/" in your custom config. -Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. -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 = your client ID goes here -client_secret = your client secret goes here -auth_url = Optional auth URL -token_url = Optional token URL -token = {"access_token":"xxxxxxxxxxxxxxxxxxxxxxx","token_type":"bearer","refresh_token":"xxxxxxxxxxxxxxxxxx","expiry":"2015-09-06T16:07:39.658438471+01:00"} --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +Any files larger than this will be uploaded in chunks of chunk_size. +The minimum is 0 and the maximum is 5 GiB. -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a -machine with no Internet browser available. +Properties: -Note that rclone runs a webserver on your local machine to collect the -token as returned from Amazon. This only runs from the moment it -opens your browser to the moment you get back the verification -code. This is on `http://127.0.0.1:53682/` and this it may require -you to unblock it temporarily if you are running a host firewall. +- Config: upload_cutoff +- Env Var: RCLONE_S3_UPLOAD_CUTOFF +- Type: SizeSuffix +- Default: 200Mi -Once configured you can then use `rclone` like this, +#### --s3-chunk-size -List directories in top level of your Amazon Drive +Chunk size to use for uploading. - rclone lsd remote: +When uploading files larger than upload_cutoff or files with unknown +size (e.g. from "rclone rcat" or uploaded with "rclone mount" or google +photos or google docs) they will be uploaded as multipart uploads +using this chunk size. -List all the files in your Amazon Drive +Note that "--s3-upload-concurrency" chunks of this size are buffered +in memory per transfer. - rclone ls remote: +If you are transferring large files over high-speed links and you have +enough memory, then increasing this will speed up the transfers. -To copy a local directory to an Amazon Drive directory called backup +Rclone will automatically increase the chunk size when uploading a +large file of known size to stay below the 10,000 chunks limit. - rclone copy /home/source remote:backup +Files of unknown size are uploaded with the configured +chunk_size. Since the default chunk size is 5 MiB and there can be at +most 10,000 chunks, this means that by default the maximum size of +a file you can stream upload is 48 GiB. If you wish to stream upload +larger files then you will need to increase chunk_size. -### Modified time and MD5SUMs +Increasing the chunk size decreases the accuracy of the progress +statistics displayed with "-P" flag. Rclone treats chunk as sent when +it's buffered by the AWS SDK, when in fact it may still be uploading. +A bigger chunk size means a bigger AWS SDK buffer and progress +reporting more deviating from the truth. -Amazon Drive doesn't allow modification times to be changed via -the API so these won't be accurate or used for syncing. -It does store MD5SUMs so for a more accurate sync, you can use the -`--checksum` flag. +Properties: -### Restricted filename characters +- Config: chunk_size +- Env Var: RCLONE_S3_CHUNK_SIZE +- Type: SizeSuffix +- Default: 5Mi -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| NUL | 0x00 | ␀ | -| / | 0x2F | / | +#### --s3-max-upload-parts -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in JSON strings. +Maximum number of parts in a multipart upload. -### Deleting files +This option defines the maximum number of multipart chunks to use +when doing a multipart upload. -Any files you delete with rclone will end up in the trash. Amazon -don't provide an API to permanently delete files, nor to empty the -trash, so you will have to do that with one of Amazon's apps or via -the Amazon Drive website. As of November 17, 2016, files are -automatically deleted by Amazon from the trash after 30 days. +This can be useful if a service does not support the AWS S3 +specification of 10,000 chunks. -### Using with non `.com` Amazon accounts +Rclone will automatically increase the chunk size when uploading a +large file of a known size to stay below this number of chunks limit. -Let's say you usually use `amazon.co.uk`. When you authenticate with -rclone it will take you to an `amazon.com` page to log in. Your -`amazon.co.uk` email and password should work here just fine. +Properties: -### Standard options +- Config: max_upload_parts +- Env Var: RCLONE_S3_MAX_UPLOAD_PARTS +- Type: int +- Default: 10000 -Here are the Standard options specific to amazon cloud drive (Amazon Drive). +#### --s3-copy-cutoff -#### --acd-client-id +Cutoff for switching to multipart copy. -OAuth Client Id. +Any files larger than this that need to be server-side copied will be +copied in chunks of this size. -Leave blank normally. +The minimum is 0 and the maximum is 5 GiB. Properties: -- Config: client_id -- Env Var: RCLONE_ACD_CLIENT_ID -- Type: string -- Required: false +- Config: copy_cutoff +- Env Var: RCLONE_S3_COPY_CUTOFF +- Type: SizeSuffix +- Default: 4.656Gi -#### --acd-client-secret +#### --s3-disable-checksum -OAuth Client Secret. +Don't store MD5 checksum with object metadata. -Leave blank normally. +Normally rclone will calculate the MD5 checksum of the input before +uploading it so it can add it to metadata on the object. This is great +for data integrity checking but can cause long delays for large files +to start uploading. Properties: -- Config: client_secret -- Env Var: RCLONE_ACD_CLIENT_SECRET -- Type: string -- Required: false - -### Advanced options - -Here are the Advanced options specific to amazon cloud drive (Amazon Drive). - -#### --acd-token +- Config: disable_checksum +- Env Var: RCLONE_S3_DISABLE_CHECKSUM +- Type: bool +- Default: false -OAuth Access Token as a JSON blob. +#### --s3-shared-credentials-file -Properties: +Path to the shared credentials file. -- Config: token -- Env Var: RCLONE_ACD_TOKEN -- Type: string -- Required: false +If env_auth = true then rclone can use a shared credentials file. -#### --acd-auth-url +If this variable is empty rclone will look for the +"AWS_SHARED_CREDENTIALS_FILE" env variable. If the env value is empty +it will default to the current user's home directory. -Auth server URL. + Linux/OSX: "$HOME/.aws/credentials" + Windows: "%USERPROFILE%\.aws\credentials" -Leave blank to use the provider defaults. Properties: -- Config: auth_url -- Env Var: RCLONE_ACD_AUTH_URL +- Config: shared_credentials_file +- Env Var: RCLONE_S3_SHARED_CREDENTIALS_FILE - Type: string - Required: false -#### --acd-token-url +#### --s3-profile -Token server url. +Profile to use in the shared credentials file. + +If env_auth = true then rclone can use a shared credentials file. This +variable controls which profile is used in that file. + +If empty it will default to the environment variable "AWS_PROFILE" or +"default" if that environment variable is also not set. -Leave blank to use the provider defaults. Properties: -- Config: token_url -- Env Var: RCLONE_ACD_TOKEN_URL +- Config: profile +- Env Var: RCLONE_S3_PROFILE - Type: string - Required: false -#### --acd-checkpoint +#### --s3-session-token -Checkpoint for internal polling (debug). +An AWS session token. Properties: -- Config: checkpoint -- Env Var: RCLONE_ACD_CHECKPOINT +- Config: session_token +- Env Var: RCLONE_S3_SESSION_TOKEN - Type: string - Required: false -#### --acd-upload-wait-per-gb - -Additional time per GiB to wait after a failed complete upload to see if it appears. - -Sometimes Amazon Drive gives an error when a file has been fully -uploaded but the file appears anyway after a little while. This -happens sometimes for files over 1 GiB in size and nearly every time for -files bigger than 10 GiB. This parameter controls the time rclone waits -for the file to appear. - -The default value for this parameter is 3 minutes per GiB, so by -default it will wait 3 minutes for every GiB uploaded to see if the -file appears. +#### --s3-upload-concurrency -You can disable this feature by setting it to 0. This may cause -conflict errors as rclone retries the failed upload but the file will -most likely appear correctly eventually. +Concurrency for multipart uploads. -These values were determined empirically by observing lots of uploads -of big files for a range of file sizes. +This is the number of chunks of the same file that are uploaded +concurrently. -Upload with the "-v" flag to see more info about what rclone is doing -in this situation. +If you are uploading small numbers of large files over high-speed links +and these uploads do not fully utilize your bandwidth, then increasing +this may help to speed up the transfers. Properties: -- Config: upload_wait_per_gb -- Env Var: RCLONE_ACD_UPLOAD_WAIT_PER_GB -- Type: Duration -- Default: 3m0s +- Config: upload_concurrency +- Env Var: RCLONE_S3_UPLOAD_CONCURRENCY +- Type: int +- Default: 4 -#### --acd-templink-threshold +#### --s3-force-path-style -Files >= this size will be downloaded via their tempLink. +If true use path style access if false use virtual hosted style. -Files this size or more will be downloaded via their "tempLink". This -is to work around a problem with Amazon Drive which blocks downloads -of files bigger than about 10 GiB. The default for this is 9 GiB which -shouldn't need to be changed. +If this is true (the default) then rclone will use path style access, +if false then rclone will use virtual path style. See [the AWS S3 +docs](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro) +for more info. -To download files above this threshold, rclone requests a "tempLink" -which downloads the file through a temporary URL directly from the -underlying S3 storage. +Some providers (e.g. AWS, Aliyun OSS, Netease COS, or Tencent COS) require this set to +false - rclone will do this automatically based on the provider +setting. Properties: -- Config: templink_threshold -- Env Var: RCLONE_ACD_TEMPLINK_THRESHOLD -- Type: SizeSuffix -- Default: 9Gi - -#### --acd-encoding - -The encoding for the backend. +- Config: force_path_style +- Env Var: RCLONE_S3_FORCE_PATH_STYLE +- Type: bool +- Default: true -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +#### --s3-v2-auth -Properties: +If true use v2 authentication. -- Config: encoding -- Env Var: RCLONE_ACD_ENCODING -- Type: MultiEncoder -- Default: Slash,InvalidUtf8,Dot +If this is false (the default) then rclone will use v4 authentication. +If it is set then rclone will use v2 authentication. +Use this only if v4 signatures don't work, e.g. pre Jewel/v10 CEPH. +Properties: -## Limitations +- Config: v2_auth +- Env Var: RCLONE_S3_V2_AUTH +- Type: bool +- Default: false -Note that Amazon Drive is case insensitive so you can't have a -file called "Hello.doc" and one called "hello.doc". +#### --s3-use-accelerate-endpoint -Amazon Drive has rate limiting so you may notice errors in the -sync (429 errors). rclone will automatically retry the sync up to 3 -times by default (see `--retries` flag) which should hopefully work -around this problem. +If true use the AWS S3 accelerated endpoint. -Amazon Drive has an internal limit of file sizes that can be uploaded -to the service. This limit is not officially published, but all files -larger than this will fail. +See: [AWS S3 Transfer acceleration](https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration-examples.html) -At the time of writing (Jan 2016) is in the area of 50 GiB per file. -This means that larger files are likely to fail. +Properties: -Unfortunately there is no way for rclone to see that this failure is -because of file size, so it will retry the operation, as any other -failure. To avoid this problem, use `--max-size 50000M` option to limit -the maximum size of uploaded files. Note that `--max-size` does not split -files into segments, it only ignores files over this size. +- Config: use_accelerate_endpoint +- Env Var: RCLONE_S3_USE_ACCELERATE_ENDPOINT +- Provider: AWS +- Type: bool +- Default: false -`rclone about` is not supported by the Amazon Drive backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. +#### --s3-leave-parts-on-error -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) +If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery. -# Amazon S3 Storage Providers +It should be set to true for resuming uploads across different sessions. -The S3 backend can be used with a number of different providers: +WARNING: Storing parts of an incomplete multipart upload counts towards space usage on S3 and will add additional costs if not cleaned up. -- AWS S3 -- Alibaba Cloud (Aliyun) Object Storage System (OSS) -- Ceph -- China Mobile Ecloud Elastic Object Storage (EOS) -- Cloudflare R2 -- Arvan Cloud Object Storage (AOS) -- DigitalOcean Spaces -- Dreamhost -- GCS -- Huawei OBS -- IBM COS S3 -- IDrive e2 -- IONOS Cloud - - Leviia Object Storage -- Liara Object Storage -- Minio -- Petabox -- Qiniu Cloud Object Storage (Kodo) -- RackCorp Object Storage -- Scaleway -- Seagate Lyve Cloud -- SeaweedFS -- StackPath -- Storj -- Synology C2 Object Storage -- Tencent Cloud Object Storage (COS) -- Wasabi +Properties: +- Config: leave_parts_on_error +- Env Var: RCLONE_S3_LEAVE_PARTS_ON_ERROR +- Provider: AWS +- Type: bool +- Default: false -Paths are specified as `remote:bucket` (or `remote:` for the `lsd` -command.) You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`. +#### --s3-list-chunk -Once you have made a remote (see the provider specific section above) -you can use it like this: +Size of listing chunk (response list for each ListObject S3 request). -See all buckets +This option is also known as "MaxKeys", "max-items", or "page-size" from the AWS S3 specification. +Most services truncate the response list to 1000 objects even if requested more than that. +In AWS S3 this is a global maximum and cannot be changed, see [AWS S3](https://docs.aws.amazon.com/cli/latest/reference/s3/ls.html). +In Ceph, this can be increased with the "rgw list buckets max chunk" option. - rclone lsd remote: -Make a new bucket +Properties: - rclone mkdir remote:bucket +- Config: list_chunk +- Env Var: RCLONE_S3_LIST_CHUNK +- Type: int +- Default: 1000 -List the contents of a bucket +#### --s3-list-version - rclone ls remote:bucket +Version of ListObjects to use: 1,2 or 0 for auto. -Sync `/home/local/directory` to the remote bucket, deleting any excess -files in the bucket. +When S3 originally launched it only provided the ListObjects call to +enumerate objects in a bucket. - rclone sync --interactive /home/local/directory remote:bucket +However in May 2016 the ListObjectsV2 call was introduced. This is +much higher performance and should be used if at all possible. -## Configuration +If set to the default, 0, rclone will guess according to the provider +set which list objects method to call. If it guesses wrong, then it +may be set manually here. -Here is an example of making an s3 configuration for the AWS S3 provider. -Most applies to the other providers as well, any differences are described [below](#providers). -First run +Properties: - rclone config +- Config: list_version +- Env Var: RCLONE_S3_LIST_VERSION +- Type: int +- Default: 0 -This will guide you through an interactive setup process. +#### --s3-list-url-encode -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> remote -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Amazon S3 Compliant Storage Providers including AWS, Ceph, ChinaMobile, ArvanCloud, Dreamhost, IBM COS, Liara, Minio, and Tencent COS - \ "s3" -[snip] -Storage> s3 -Choose your S3 provider. -Choose a number from below, or type in your own value - 1 / Amazon Web Services (AWS) S3 - \ "AWS" - 2 / Ceph Object Storage - \ "Ceph" - 3 / DigitalOcean Spaces - \ "DigitalOcean" - 4 / Dreamhost DreamObjects - \ "Dreamhost" - 5 / IBM COS S3 - \ "IBMCOS" - 6 / Minio Object Storage - \ "Minio" - 7 / Wasabi Object Storage - \ "Wasabi" - 8 / Any other S3 compatible provider - \ "Other" -provider> 1 -Get AWS credentials from runtime (environment variables or EC2/ECS 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> XXX -AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. -secret_access_key> YYY -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 East (Ohio) Region - 2 | Needs location constraint us-east-2. - \ "us-east-2" - / US West (Oregon) Region - 3 | Needs location constraint us-west-2. - \ "us-west-2" - / US West (Northern California) Region - 4 | Needs location constraint us-west-1. - \ "us-west-1" - / Canada (Central) Region - 5 | Needs location constraint ca-central-1. - \ "ca-central-1" - / EU (Ireland) Region - 6 | Needs location constraint EU or eu-west-1. - \ "eu-west-1" - / EU (London) Region - 7 | Needs location constraint eu-west-2. - \ "eu-west-2" - / EU (Frankfurt) Region - 8 | Needs location constraint eu-central-1. - \ "eu-central-1" - / Asia Pacific (Singapore) Region - 9 | Needs location constraint ap-southeast-1. - \ "ap-southeast-1" - / Asia Pacific (Sydney) Region -10 | Needs location constraint ap-southeast-2. - \ "ap-southeast-2" - / Asia Pacific (Tokyo) Region -11 | Needs location constraint ap-northeast-1. - \ "ap-northeast-1" - / Asia Pacific (Seoul) -12 | Needs location constraint ap-northeast-2. - \ "ap-northeast-2" - / Asia Pacific (Mumbai) -13 | Needs location constraint ap-south-1. - \ "ap-south-1" - / Asia Pacific (Hong Kong) Region -14 | Needs location constraint ap-east-1. - \ "ap-east-1" - / South America (Sao Paulo) Region -15 | Needs location constraint sa-east-1. - \ "sa-east-1" -region> 1 -Endpoint for S3 API. -Leave blank if using AWS to use the default endpoint for the region. -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 East (Ohio) Region. - \ "us-east-2" - 3 / US West (Oregon) Region. - \ "us-west-2" - 4 / US West (Northern California) Region. - \ "us-west-1" - 5 / Canada (Central) Region. - \ "ca-central-1" - 6 / EU (Ireland) Region. - \ "eu-west-1" - 7 / EU (London) Region. - \ "eu-west-2" - 8 / EU Region. - \ "EU" - 9 / Asia Pacific (Singapore) Region. - \ "ap-southeast-1" -10 / Asia Pacific (Sydney) Region. - \ "ap-southeast-2" -11 / Asia Pacific (Tokyo) Region. - \ "ap-northeast-1" -12 / Asia Pacific (Seoul) - \ "ap-northeast-2" -13 / Asia Pacific (Mumbai) - \ "ap-south-1" -14 / Asia Pacific (Hong Kong) - \ "ap-east-1" -15 / South America (Sao Paulo) Region. - \ "sa-east-1" -location_constraint> 1 -Canned ACL used when creating buckets and/or storing objects in S3. -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -Choose a number from below, or type in your own value - 1 / Owner gets FULL_CONTROL. No one else has access rights (default). - \ "private" - 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access. - \ "public-read" - / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. - 3 | Granting this on a bucket is generally not recommended. - \ "public-read-write" - 4 / Owner gets FULL_CONTROL. The AuthenticatedUsers group gets READ access. - \ "authenticated-read" - / Object owner gets FULL_CONTROL. Bucket owner gets READ access. - 5 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. - \ "bucket-owner-read" - / Both the object owner and the bucket owner get FULL_CONTROL over the object. - 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. - \ "bucket-owner-full-control" -acl> 1 -The server-side encryption algorithm used when storing this object in S3. -Choose a number from below, or type in your own value - 1 / None - \ "" - 2 / AES256 - \ "AES256" -server_side_encryption> 1 -The storage class to use when storing objects in S3. -Choose a number from below, or type in your own value - 1 / Default - \ "" - 2 / Standard storage class - \ "STANDARD" - 3 / Reduced redundancy storage class - \ "REDUCED_REDUNDANCY" - 4 / Standard Infrequent Access storage class - \ "STANDARD_IA" - 5 / One Zone Infrequent Access storage class - \ "ONEZONE_IA" - 6 / Glacier storage class - \ "GLACIER" - 7 / Glacier Deep Archive storage class - \ "DEEP_ARCHIVE" - 8 / Intelligent-Tiering storage class - \ "INTELLIGENT_TIERING" - 9 / Glacier Instant Retrieval storage class - \ "GLACIER_IR" -storage_class> 1 -Remote config --------------------- -[remote] -type = s3 -provider = AWS -env_auth = false -access_key_id = XXX -secret_access_key = YYY -region = us-east-1 -endpoint = -location_constraint = -acl = private -server_side_encryption = -storage_class = --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> -``` +Whether to url encode listings: true/false/unset -### Modified time +Some providers support URL encoding listings and where this is +available this is more reliable when using control characters in file +names. If this is set to unset (the default) then rclone will choose +according to the provider setting what to apply, but you can override +rclone's choice here. -The modified time is stored as metadata on the object as -`X-Amz-Meta-Mtime` as floating point since the epoch, accurate to 1 ns. -If the modification time needs to be updated rclone will attempt to perform a server -side copy to update the modification if the object can be copied in a single part. -In the case the object is larger than 5Gb or is in Glacier or Glacier Deep Archive -storage the object will be uploaded rather than copied. +Properties: -Note that reading this from the object takes an additional `HEAD` -request as the metadata isn't returned in object listings. +- Config: list_url_encode +- Env Var: RCLONE_S3_LIST_URL_ENCODE +- Type: Tristate +- Default: unset -### Reducing costs +#### --s3-no-check-bucket -#### Avoiding HEAD requests to read the modification time +If set, don't attempt to check the bucket exists or create it. -By default, rclone will use the modification time of objects stored in -S3 for syncing. This is stored in object metadata which unfortunately -takes an extra HEAD request to read which can be expensive (in time -and money). +This can be useful when trying to minimise the number of transactions +rclone does if you know the bucket exists already. -The modification time is used by default for all operations that -require checking the time a file was last updated. It allows rclone to -treat the remote more like a true filesystem, but it is inefficient on -S3 because it requires an extra API call to retrieve the metadata. +It can also be needed if the user you are using does not have bucket +creation permissions. Before v1.52.0 this would have passed silently +due to a bug. -The extra API calls can be avoided when syncing (using `rclone sync` -or `rclone copy`) in a few different ways, each with its own -tradeoffs. -- `--size-only` - - Only checks the size of files. - - Uses no extra transactions. - - If the file doesn't change size then rclone won't detect it has - changed. - - `rclone sync --size-only /path/to/source s3:bucket` -- `--checksum` - - Checks the size and MD5 checksum of files. - - Uses no extra transactions. - - The most accurate detection of changes possible. - - Will cause the source to read an MD5 checksum which, if it is a - local disk, will cause lots of disk activity. - - If the source and destination are both S3 this is the - **recommended** flag to use for maximum efficiency. - - `rclone sync --checksum /path/to/source s3:bucket` -- `--update --use-server-modtime` - - Uses no extra transactions. - - Modification time becomes the time the object was uploaded. - - For many operations this is sufficient to determine if it needs - uploading. - - Using `--update` along with `--use-server-modtime`, avoids the - extra API call and uploads files whose local modification time - is newer than the time it was last uploaded. - - Files created with timestamps in the past will be missed by the sync. - - `rclone sync --update --use-server-modtime /path/to/source s3:bucket` +Properties: -These flags can and should be used in combination with `--fast-list` - -see below. +- Config: no_check_bucket +- Env Var: RCLONE_S3_NO_CHECK_BUCKET +- Type: bool +- Default: false -If using `rclone mount` or any command using the VFS (eg `rclone -serve`) commands then you might want to consider using the VFS flag -`--no-modtime` which will stop rclone reading the modification time -for every object. You could also use `--use-server-modtime` if you are -happy with the modification times of the objects being the time of -upload. +#### --s3-no-head -#### Avoiding GET requests to read directory listings +If set, don't HEAD uploaded objects to check integrity. -Rclone's default directory traversal is to process each directory -individually. This takes one API call per directory. Using the -`--fast-list` flag will read all info about the objects into -memory first using a smaller number of API calls (one per 1000 -objects). See the [rclone docs](https://rclone.org/docs/#fast-list) for more details. +This can be useful when trying to minimise the number of transactions +rclone does. - rclone sync --fast-list --checksum /path/to/source s3:bucket +Setting it means that if rclone receives a 200 OK message after +uploading an object with PUT then it will assume that it got uploaded +properly. -`--fast-list` trades off API transactions for memory use. As a rough -guide rclone uses 1k of memory per object stored, so using -`--fast-list` on a sync of a million objects will use roughly 1 GiB of -RAM. +In particular it will assume: -If you are only copying a small number of files into a big repository -then using `--no-traverse` is a good idea. This finds objects directly -instead of through directory listings. You can do a "top-up" sync very -cheaply by using `--max-age` and `--no-traverse` to copy only recent -files, eg +- the metadata, including modtime, storage class and content type was as uploaded +- the size was as uploaded - rclone copy --max-age 24h --no-traverse /path/to/source s3:bucket +It reads the following items from the response for a single part PUT: -You'd then do a full `rclone sync` less often. +- the MD5SUM +- The uploaded date -Note that `--fast-list` isn't required in the top-up sync. +For multipart uploads these items aren't read. -#### Avoiding HEAD requests after PUT +If an source object of unknown length is uploaded then rclone **will** do a +HEAD request. -By default, rclone will HEAD every object it uploads. It does this to -check the object got uploaded correctly. +Setting this flag increases the chance for undetected upload failures, +in particular an incorrect size, so it isn't recommended for normal +operation. In practice the chance of an undetected upload failure is +very small even with this flag. -You can disable this with the [--s3-no-head](#s3-no-head) option - see -there for more details. -Setting this flag increases the chance for undetected upload failures. +Properties: -### Hashes +- Config: no_head +- Env Var: RCLONE_S3_NO_HEAD +- Type: bool +- Default: false -For small objects which weren't uploaded as multipart uploads (objects -sized below `--s3-upload-cutoff` if uploaded with rclone) rclone uses -the `ETag:` header as an MD5 checksum. +#### --s3-no-head-object -However for objects which were uploaded as multipart uploads or with -server side encryption (SSE-AWS or SSE-C) the `ETag` header is no -longer the MD5 sum of the data, so rclone adds an additional piece of -metadata `X-Amz-Meta-Md5chksum` which is a base64 encoded MD5 hash (in -the same format as is required for `Content-MD5`). You can use base64 -d and hexdump to check this value manually: +If set, do not do HEAD before GET when getting objects. - echo 'VWTGdNx3LyXQDfA0e2Edxw==' | base64 -d | hexdump +Properties: -or you can use `rclone check` to verify the hashes are OK. +- Config: no_head_object +- Env Var: RCLONE_S3_NO_HEAD_OBJECT +- Type: bool +- Default: false -For large objects, calculating this hash can take some time so the -addition of this hash can be disabled with `--s3-disable-checksum`. -This will mean that these objects do not have an MD5 checksum. +#### --s3-encoding -Note that reading this from the object takes an additional `HEAD` -request as the metadata isn't returned in object listings. +The encoding for the backend. -### Versions +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -When bucket versioning is enabled (this can be done with rclone with -the [`rclone backend versioning`](#versioning) command) when rclone -uploads a new version of a file it creates a -[new version of it](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Versioning.html) -Likewise when you delete a file, the old version will be marked hidden -and still be available. +Properties: -Old versions of files, where available, are visible using the -[`--s3-versions`](#s3-versions) flag. +- Config: encoding +- Env Var: RCLONE_S3_ENCODING +- Type: Encoding +- Default: Slash,InvalidUtf8,Dot -It is also possible to view a bucket as it was at a certain point in -time, using the [`--s3-version-at`](#s3-version-at) flag. This will -show the file versions as they were at that time, showing files that -have been deleted afterwards, and hiding files that were created -since. +#### --s3-memory-pool-flush-time -If you wish to remove all the old versions then you can use the -[`rclone backend cleanup-hidden remote:bucket`](#cleanup-hidden) -command which will delete all the old hidden versions of files, -leaving the current ones intact. You can also supply a path and only -old versions under that path will be deleted, e.g. -`rclone backend cleanup-hidden remote:bucket/path/to/stuff`. +How often internal memory buffer pools will be flushed. (no longer used) -When you `purge` a bucket, the current and the old versions will be -deleted then the bucket will be deleted. +Properties: -However `delete` will cause the current versions of the files to -become hidden old versions. +- Config: memory_pool_flush_time +- Env Var: RCLONE_S3_MEMORY_POOL_FLUSH_TIME +- Type: Duration +- Default: 1m0s -Here is a session showing the listing and retrieval of an old -version followed by a `cleanup` of the old versions. +#### --s3-memory-pool-use-mmap -Show current version and all the versions with `--s3-versions` flag. +Whether to use mmap buffers in internal memory pool. (no longer used) -``` -$ rclone -q ls s3:cleanup-test - 9 one.txt +Properties: -$ rclone -q --s3-versions ls s3:cleanup-test - 9 one.txt - 8 one-v2016-07-04-141032-000.txt - 16 one-v2016-07-04-141003-000.txt - 15 one-v2016-07-02-155621-000.txt -``` +- Config: memory_pool_use_mmap +- Env Var: RCLONE_S3_MEMORY_POOL_USE_MMAP +- Type: bool +- Default: false -Retrieve an old version +#### --s3-disable-http2 -``` -$ rclone -q --s3-versions copy s3:cleanup-test/one-v2016-07-04-141003-000.txt /tmp +Disable usage of http2 for S3 backends. -$ ls -l /tmp/one-v2016-07-04-141003-000.txt --rw-rw-r-- 1 ncw ncw 16 Jul 2 17:46 /tmp/one-v2016-07-04-141003-000.txt -``` +There is currently an unsolved issue with the s3 (specifically minio) backend +and HTTP/2. HTTP/2 is enabled by default for the s3 backend but can be +disabled here. When the issue is solved this flag will be removed. -Clean up all the old versions and show that they've gone. +See: https://github.com/rclone/rclone/issues/4673, https://github.com/rclone/rclone/issues/3631 -``` -$ rclone -q backend cleanup-hidden s3:cleanup-test -$ rclone -q ls s3:cleanup-test - 9 one.txt -$ rclone -q --s3-versions ls s3:cleanup-test - 9 one.txt -``` +Properties: -#### Versions naming caveat +- Config: disable_http2 +- Env Var: RCLONE_S3_DISABLE_HTTP2 +- Type: bool +- Default: false -When using `--s3-versions` flag rclone is relying on the file name -to work out whether the objects are versions or not. Versions' names -are created by inserting timestamp between file name and its extension. -``` - 9 file.txt - 8 file-v2023-07-17-161032-000.txt - 16 file-v2023-06-15-141003-000.txt -``` -If there are real files present with the same names as versions, then -behaviour of `--s3-versions` can be unpredictable. +#### --s3-download-url -### Cleanup +Custom endpoint for downloads. +This is usually set to a CloudFront CDN URL as AWS S3 offers +cheaper egress for data downloaded through the CloudFront network. -If you run `rclone cleanup s3:bucket` then it will remove all pending -multipart uploads older than 24 hours. You can use the `--interactive`/`i` -or `--dry-run` flag to see exactly what it will do. If you want more control over the -expiry date then run `rclone backend cleanup s3:bucket -o max-age=1h` -to expire all uploads older than one hour. You can use `rclone backend -list-multipart-uploads s3:bucket` to see the pending multipart -uploads. +Properties: -### Restricted filename characters +- Config: download_url +- Env Var: RCLONE_S3_DOWNLOAD_URL +- Type: string +- Required: false -S3 allows any valid UTF-8 string as a key. +#### --s3-directory-markers -Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), as -they can't be used in XML. +Upload an empty object with a trailing slash when a new directory is created -The following characters are replaced since these are problematic when -dealing with the REST API: +Empty folders are unsupported for bucket based remotes, this option creates an empty +object ending with "/", to persist the folder. -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| NUL | 0x00 | ␀ | -| / | 0x2F | / | -The encoding will also encode these file names as they don't seem to -work with the SDK properly: +Properties: -| File name | Replacement | -| --------- |:-----------:| -| . | . | -| .. | .. | +- Config: directory_markers +- Env Var: RCLONE_S3_DIRECTORY_MARKERS +- Type: bool +- Default: false -### Multipart uploads +#### --s3-use-multipart-etag -rclone supports multipart uploads with S3 which means that it can -upload files bigger than 5 GiB. +Whether to use ETag in multipart uploads for verification -Note that files uploaded *both* with multipart upload *and* through -crypt remotes do not have MD5 sums. +This should be true, false or left unset to use the default for the provider. -rclone switches from single part uploads to multipart uploads at the -point specified by `--s3-upload-cutoff`. This can be a maximum of 5 GiB -and a minimum of 0 (ie always upload multipart files). -The chunk sizes used in the multipart upload are specified by -`--s3-chunk-size` and the number of chunks uploaded concurrently is -specified by `--s3-upload-concurrency`. +Properties: -Multipart uploads will use `--transfers` * `--s3-upload-concurrency` * -`--s3-chunk-size` extra memory. Single part uploads to not use extra -memory. +- Config: use_multipart_etag +- Env Var: RCLONE_S3_USE_MULTIPART_ETAG +- Type: Tristate +- Default: unset -Single part transfers can be faster than multipart transfers or slower -depending on your latency from S3 - the more latency, the more likely -single part transfers will be faster. +#### --s3-use-presigned-request -Increasing `--s3-upload-concurrency` will increase throughput (8 would -be a sensible value) and increasing `--s3-chunk-size` also increases -throughput (16M would be sensible). Increasing either of these will -use more memory. The default values are high enough to gain most of -the possible performance without using too much memory. +Whether to use a presigned request or PutObject for single part uploads + +If this is false rclone will use PutObject from the AWS SDK to upload +an object. +Versions of rclone < 1.59 use presigned requests to upload a single +part object and setting this flag to true will re-enable that +functionality. This shouldn't be necessary except in exceptional +circumstances or for testing. -### Buckets and Regions -With Amazon S3 you can list buckets (`rclone lsd`) using any region, -but you can only access the content of a bucket from the region it was -created in. If you attempt to access a bucket from the wrong region, -you will get an error, `incorrect region, the bucket is not in 'XXX' -region`. +Properties: -### Authentication +- Config: use_presigned_request +- Env Var: RCLONE_S3_USE_PRESIGNED_REQUEST +- Type: bool +- Default: false -There are a number of ways to supply `rclone` with a set of AWS -credentials, with and without using the environment. +#### --s3-versions -The different authentication methods are tried in this order: +Include old versions in directory listings. - - Directly in the rclone configuration file (`env_auth = false` in the config file): - - `access_key_id` and `secret_access_key` are required. - - `session_token` can be optionally set when using AWS STS. - - Runtime configuration (`env_auth = true` in the config file): - - Export the following environment variables before running `rclone`: - - Access Key ID: `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY` - - Secret Access Key: `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY` - - Session Token: `AWS_SESSION_TOKEN` (optional) - - Or, use a [named profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html): - - Profile files are standard files used by AWS CLI tools - - By default it will use the profile in your home directory (e.g. `~/.aws/credentials` on unix based systems) file and the "default" profile, to change set these environment variables: - - `AWS_SHARED_CREDENTIALS_FILE` to control which file. - - `AWS_PROFILE` to control which profile to use. - - Or, run `rclone` in an ECS task with an IAM role (AWS only). - - Or, run `rclone` on an EC2 instance with an IAM role (AWS only). - - Or, run `rclone` in an EKS pod with an IAM role that is associated with a service account (AWS only). +Properties: + +- Config: versions +- Env Var: RCLONE_S3_VERSIONS +- Type: bool +- Default: false + +#### --s3-version-at + +Show file versions as they were at the specified time. + +The parameter should be a date, "2006-01-02", datetime "2006-01-02 +15:04:05" or a duration for that long ago, eg "100d" or "1h". + +Note that when using this no file write operations are permitted, +so you can't upload files or delete them. + +See [the time option docs](https://rclone.org/docs/#time-option) for valid formats. + + +Properties: + +- Config: version_at +- Env Var: RCLONE_S3_VERSION_AT +- Type: Time +- Default: off + +#### --s3-decompress + +If set this will decompress gzip encoded objects. + +It is possible to upload objects to S3 with "Content-Encoding: gzip" +set. Normally rclone will download these files as compressed objects. + +If this flag is set then rclone will decompress these files with +"Content-Encoding: gzip" as they are received. This means that rclone +can't check the size and hash but the file contents will be decompressed. + + +Properties: + +- Config: decompress +- Env Var: RCLONE_S3_DECOMPRESS +- Type: bool +- Default: false + +#### --s3-might-gzip + +Set this if the backend might gzip objects. + +Normally providers will not alter objects when they are downloaded. If +an object was not uploaded with `Content-Encoding: gzip` then it won't +be set on download. + +However some providers may gzip objects even if they weren't uploaded +with `Content-Encoding: gzip` (eg Cloudflare). + +A symptom of this would be receiving errors like + + ERROR corrupted on transfer: sizes differ NNN vs MMM + +If you set this flag and rclone downloads an object with +Content-Encoding: gzip set and chunked transfer encoding, then rclone +will decompress the object on the fly. + +If this is set to unset (the default) then rclone will choose +according to the provider setting what to apply, but you can override +rclone's choice here. + + +Properties: + +- Config: might_gzip +- Env Var: RCLONE_S3_MIGHT_GZIP +- Type: Tristate +- Default: unset + +#### --s3-use-accept-encoding-gzip + +Whether to send `Accept-Encoding: gzip` header. + +By default, rclone will append `Accept-Encoding: gzip` to the request to download +compressed objects whenever possible. + +However some providers such as Google Cloud Storage may alter the HTTP headers, breaking +the signature of the request. + +A symptom of this would be receiving errors like + + SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. + +In this case, you might want to try disabling this option. + + +Properties: + +- Config: use_accept_encoding_gzip +- Env Var: RCLONE_S3_USE_ACCEPT_ENCODING_GZIP +- Type: Tristate +- Default: unset + +#### --s3-no-system-metadata + +Suppress setting and reading of system metadata + +Properties: + +- Config: no_system_metadata +- Env Var: RCLONE_S3_NO_SYSTEM_METADATA +- Type: bool +- Default: false + +#### --s3-sts-endpoint + +Endpoint for STS. + +Leave blank if using AWS to use the default endpoint for the region. + +Properties: + +- Config: sts_endpoint +- Env Var: RCLONE_S3_STS_ENDPOINT +- Provider: AWS +- Type: string +- Required: false + +#### --s3-use-already-exists + +Set if rclone should report BucketAlreadyExists errors on bucket creation. + +At some point during the evolution of the s3 protocol, AWS started +returning an `AlreadyOwnedByYou` error when attempting to create a +bucket that the user already owned, rather than a +`BucketAlreadyExists` error. + +Unfortunately exactly what has been implemented by s3 clones is a +little inconsistent, some return `AlreadyOwnedByYou`, some return +`BucketAlreadyExists` and some return no error at all. + +This is important to rclone because it ensures the bucket exists by +creating it on quite a lot of operations (unless +`--s3-no-check-bucket` is used). + +If rclone knows the provider can return `AlreadyOwnedByYou` or returns +no error then it can report `BucketAlreadyExists` errors when the user +attempts to create a bucket not owned by them. Otherwise rclone +ignores the `BucketAlreadyExists` error which can lead to confusion. + +This should be automatically set correctly for all providers rclone +knows about - please make a bug report if not. + + +Properties: + +- Config: use_already_exists +- Env Var: RCLONE_S3_USE_ALREADY_EXISTS +- Type: Tristate +- Default: unset + +#### --s3-use-multipart-uploads + +Set if rclone should use multipart uploads. + +You can change this if you want to disable the use of multipart uploads. +This shouldn't be necessary in normal operation. + +This should be automatically set correctly for all providers rclone +knows about - please make a bug report if not. + + +Properties: + +- Config: use_multipart_uploads +- Env Var: RCLONE_S3_USE_MULTIPART_UPLOADS +- Type: Tristate +- Default: unset + +### Metadata + +User metadata is stored as x-amz-meta- keys. S3 metadata keys are case insensitive and are always returned in lower case. + +Here are the possible system metadata items for the s3 backend. -If none of these option actually end up providing `rclone` with AWS -credentials then S3 interaction will be non-authenticated (see below). +| Name | Help | Type | Example | Read Only | +|------|------|------|---------|-----------| +| btime | Time of file birth (creation) read from Last-Modified header | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** | +| cache-control | Cache-Control header | string | no-cache | N | +| content-disposition | Content-Disposition header | string | inline | N | +| content-encoding | Content-Encoding header | string | gzip | N | +| content-language | Content-Language header | string | en-US | N | +| content-type | Content-Type header | string | text/plain | N | +| mtime | Time of last modification, read from rclone metadata | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | N | +| tier | Tier of the object | string | GLACIER | **Y** | -### S3 Permissions +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -When using the `sync` subcommand of `rclone` the following minimum -permissions are required to be available on the bucket being written to: +## Backend commands -* `ListBucket` -* `DeleteObject` -* `GetObject` -* `PutObject` -* `PutObjectACL` +Here are the commands specific to the s3 backend. -When using the `lsd` subcommand, the `ListAllMyBuckets` permission is required. +Run them with -Example policy: + rclone backend COMMAND remote: -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "AWS": "arn:aws:iam::USER_SID:user/USER_NAME" - }, - "Action": [ - "s3:ListBucket", - "s3:DeleteObject", - "s3:GetObject", - "s3:PutObject", - "s3:PutObjectAcl" - ], - "Resource": [ - "arn:aws:s3:::BUCKET_NAME/*", - "arn:aws:s3:::BUCKET_NAME" - ] - }, - { - "Effect": "Allow", - "Action": "s3:ListAllMyBuckets", - "Resource": "arn:aws:s3:::*" - } - ] -} -``` +The help below will explain what arguments each command takes. -Notes on above: +See the [backend](https://rclone.org/commands/rclone_backend/) command for more +info on how to pass options and arguments. -1. This is a policy that can be used when creating bucket. It assumes - that `USER_NAME` has been created. -2. The Resource entry must include both resource ARNs, as one implies - the bucket and the other implies the bucket's objects. +These can be run on a running backend using the rc command +[backend/command](https://rclone.org/rc/#backend-command). -For reference, [here's an Ansible script](https://gist.github.com/ebridges/ebfc9042dd7c756cd101cfa807b7ae2b) -that will generate one or more buckets that will work with `rclone sync`. +### restore -### Key Management System (KMS) +Restore objects from GLACIER to normal storage -If you are using server-side encryption with KMS then you must make -sure rclone is configured with `server_side_encryption = aws:kms` -otherwise you will find you can't transfer small objects - these will -create checksum errors. + rclone backend restore remote: [options] [+] -### Glacier and Glacier Deep Archive +This command can be used to restore one or more objects from GLACIER +to normal storage. -You can upload objects using the glacier storage class or transition them to glacier using a [lifecycle policy](http://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-lifecycle.html). -The bucket can still be synced or copied into normally, but if rclone -tries to access data from the glacier storage class you will see an error like below. +Usage Examples: - 2017/09/11 19:07:43 Failed to sync: failed to open source object: Object in GLACIER, restore first: path/to/file + rclone backend restore s3:bucket/path/to/object -o priority=PRIORITY -o lifetime=DAYS + rclone backend restore s3:bucket/path/to/directory -o priority=PRIORITY -o lifetime=DAYS + rclone backend restore s3:bucket -o priority=PRIORITY -o lifetime=DAYS -In this case you need to [restore](http://docs.aws.amazon.com/AmazonS3/latest/user-guide/restore-archived-objects.html) -the object(s) in question before using rclone. +This flag also obeys the filters. Test first with --interactive/-i or --dry-run flags -Note that rclone only speaks the S3 API it does not speak the Glacier -Vault API, so rclone cannot directly access Glacier Vaults. + rclone --interactive backend restore --include "*.txt" s3:bucket/path -o priority=Standard -o lifetime=1 -### Object-lock enabled S3 bucket +All the objects shown will be marked for restore, then -According to AWS's [documentation on S3 Object Lock](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-overview.html#object-lock-permission): + rclone backend restore --include "*.txt" s3:bucket/path -o priority=Standard -o lifetime=1 -> If you configure a default retention period on a bucket, requests to upload objects in such a bucket must include the Content-MD5 header. +It returns a list of status dictionaries with Remote and Status +keys. The Status will be OK if it was successful or an error message +if not. -As mentioned in the [Hashes](#hashes) section, small files that are not uploaded as multipart, use a different tag, causing the upload to fail. -A simple solution is to set the `--s3-upload-cutoff 0` and force all the files to be uploaded as multipart. + [ + { + "Status": "OK", + "Remote": "test.txt" + }, + { + "Status": "OK", + "Remote": "test/file4.txt" + } + ] -### Standard options -Here are the Standard options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, China Mobile, Cloudflare, GCS, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Leviia, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi). +Options: -#### --s3-provider +- "description": The optional description for the job. +- "lifetime": Lifetime of the active copy in days +- "priority": Priority of restore: Standard|Expedited|Bulk -Choose your S3 provider. +### restore-status -Properties: +Show the restore status for objects being restored from GLACIER to normal storage -- Config: provider -- Env Var: RCLONE_S3_PROVIDER -- Type: string -- Required: false -- Examples: - - "AWS" - - Amazon Web Services (AWS) S3 - - "Alibaba" - - Alibaba Cloud Object Storage System (OSS) formerly Aliyun - - "ArvanCloud" - - Arvan Cloud Object Storage (AOS) - - "Ceph" - - Ceph Object Storage - - "ChinaMobile" - - China Mobile Ecloud Elastic Object Storage (EOS) - - "Cloudflare" - - Cloudflare R2 Storage - - "DigitalOcean" - - DigitalOcean Spaces - - "Dreamhost" - - Dreamhost DreamObjects - - "GCS" - - Google Cloud Storage - - "HuaweiOBS" - - Huawei Object Storage Service - - "IBMCOS" - - IBM COS S3 - - "IDrive" - - IDrive e2 - - "IONOS" - - IONOS Cloud - - "LyveCloud" - - Seagate Lyve Cloud - - "Leviia" - - Leviia Object Storage - - "Liara" - - Liara Object Storage - - "Minio" - - Minio Object Storage - - "Netease" - - Netease Object Storage (NOS) - - "Petabox" - - Petabox Object Storage - - "RackCorp" - - RackCorp Object Storage - - "Scaleway" - - Scaleway Object Storage - - "SeaweedFS" - - SeaweedFS S3 - - "StackPath" - - StackPath Object Storage - - "Storj" - - Storj (S3 Compatible Gateway) - - "Synology" - - Synology C2 Object Storage - - "TencentCOS" - - Tencent Cloud Object Storage (COS) - - "Wasabi" - - Wasabi Object Storage - - "Qiniu" - - Qiniu Object Storage (Kodo) - - "Other" - - Any other S3 compatible provider + rclone backend restore-status remote: [options] [+] -#### --s3-env-auth +This command can be used to show the status for objects being restored from GLACIER +to normal storage. -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). +Usage Examples: -Only applies if access_key_id and secret_access_key is blank. + rclone backend restore-status s3:bucket/path/to/object + rclone backend restore-status s3:bucket/path/to/directory + rclone backend restore-status -o all s3:bucket/path/to/directory -Properties: +This command does not obey the filters. -- Config: env_auth -- Env Var: RCLONE_S3_ENV_AUTH -- Type: bool -- Default: false -- Examples: - - "false" - - Enter AWS credentials in the next step. - - "true" - - Get AWS credentials from the environment (env vars or IAM). +It returns a list of status dictionaries. -#### --s3-access-key-id + [ + { + "Remote": "file.txt", + "VersionID": null, + "RestoreStatus": { + "IsRestoreInProgress": true, + "RestoreExpiryDate": "2023-09-06T12:29:19+01:00" + }, + "StorageClass": "GLACIER" + }, + { + "Remote": "test.pdf", + "VersionID": null, + "RestoreStatus": { + "IsRestoreInProgress": false, + "RestoreExpiryDate": "2023-09-06T12:29:19+01:00" + }, + "StorageClass": "DEEP_ARCHIVE" + } + ] -AWS Access Key ID. -Leave blank for anonymous access or runtime credentials. +Options: -Properties: +- "all": if set then show all objects, not just ones with restore status -- Config: access_key_id -- Env Var: RCLONE_S3_ACCESS_KEY_ID -- Type: string -- Required: false +### list-multipart-uploads -#### --s3-secret-access-key +List the unfinished multipart uploads -AWS Secret Access Key (password). + rclone backend list-multipart-uploads remote: [options] [+] -Leave blank for anonymous access or runtime credentials. +This command lists the unfinished multipart uploads in JSON format. -Properties: + rclone backend list-multipart s3:bucket/path/to/object -- Config: secret_access_key -- Env Var: RCLONE_S3_SECRET_ACCESS_KEY -- Type: string -- Required: false +It returns a dictionary of buckets with values as lists of unfinished +multipart uploads. -#### --s3-region +You can call it with no bucket in which case it lists all bucket, with +a bucket or with a bucket and path. -Region to connect to. + { + "rclone": [ + { + "Initiated": "2020-06-26T14:20:36Z", + "Initiator": { + "DisplayName": "XXX", + "ID": "arn:aws:iam::XXX:user/XXX" + }, + "Key": "KEY", + "Owner": { + "DisplayName": null, + "ID": "XXX" + }, + "StorageClass": "STANDARD", + "UploadId": "XXX" + } + ], + "rclone-1000files": [], + "rclone-dst": [] + } -Properties: -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: AWS -- Type: string -- Required: false -- Examples: - - "us-east-1" - - The default endpoint - a good choice if you are unsure. - - US Region, Northern Virginia, or Pacific Northwest. - - Leave location constraint empty. - - "us-east-2" - - US East (Ohio) Region. - - Needs location constraint us-east-2. - - "us-west-1" - - US West (Northern California) Region. - - Needs location constraint us-west-1. - - "us-west-2" - - US West (Oregon) Region. - - Needs location constraint us-west-2. - - "ca-central-1" - - Canada (Central) Region. - - Needs location constraint ca-central-1. - - "eu-west-1" - - EU (Ireland) Region. - - Needs location constraint EU or eu-west-1. - - "eu-west-2" - - EU (London) Region. - - Needs location constraint eu-west-2. - - "eu-west-3" - - EU (Paris) Region. - - Needs location constraint eu-west-3. - - "eu-north-1" - - EU (Stockholm) Region. - - Needs location constraint eu-north-1. - - "eu-south-1" - - EU (Milan) Region. - - Needs location constraint eu-south-1. - - "eu-central-1" - - EU (Frankfurt) Region. - - Needs location constraint eu-central-1. - - "ap-southeast-1" - - Asia Pacific (Singapore) Region. - - Needs location constraint ap-southeast-1. - - "ap-southeast-2" - - Asia Pacific (Sydney) Region. - - Needs location constraint ap-southeast-2. - - "ap-northeast-1" - - Asia Pacific (Tokyo) Region. - - Needs location constraint ap-northeast-1. - - "ap-northeast-2" - - Asia Pacific (Seoul). - - Needs location constraint ap-northeast-2. - - "ap-northeast-3" - - Asia Pacific (Osaka-Local). - - Needs location constraint ap-northeast-3. - - "ap-south-1" - - Asia Pacific (Mumbai). - - Needs location constraint ap-south-1. - - "ap-east-1" - - Asia Pacific (Hong Kong) Region. - - Needs location constraint ap-east-1. - - "sa-east-1" - - South America (Sao Paulo) Region. - - Needs location constraint sa-east-1. - - "me-south-1" - - Middle East (Bahrain) Region. - - Needs location constraint me-south-1. - - "af-south-1" - - Africa (Cape Town) Region. - - Needs location constraint af-south-1. - - "cn-north-1" - - China (Beijing) Region. - - Needs location constraint cn-north-1. - - "cn-northwest-1" - - China (Ningxia) Region. - - Needs location constraint cn-northwest-1. - - "us-gov-east-1" - - AWS GovCloud (US-East) Region. - - Needs location constraint us-gov-east-1. - - "us-gov-west-1" - - AWS GovCloud (US) Region. - - Needs location constraint us-gov-west-1. -#### --s3-region +### cleanup -region - the location where your bucket will be created and your data stored. +Remove unfinished multipart uploads. + rclone backend cleanup remote: [options] [+] -Properties: +This command removes unfinished multipart uploads of age greater than +max-age which defaults to 24 hours. -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: RackCorp -- Type: string -- Required: false -- Examples: - - "global" - - Global CDN (All locations) Region - - "au" - - Australia (All states) - - "au-nsw" - - NSW (Australia) Region - - "au-qld" - - QLD (Australia) Region - - "au-vic" - - VIC (Australia) Region - - "au-wa" - - Perth (Australia) Region - - "ph" - - Manila (Philippines) Region - - "th" - - Bangkok (Thailand) Region - - "hk" - - HK (Hong Kong) Region - - "mn" - - Ulaanbaatar (Mongolia) Region - - "kg" - - Bishkek (Kyrgyzstan) Region - - "id" - - Jakarta (Indonesia) Region - - "jp" - - Tokyo (Japan) Region - - "sg" - - SG (Singapore) Region - - "de" - - Frankfurt (Germany) Region - - "us" - - USA (AnyCast) Region - - "us-east-1" - - New York (USA) Region - - "us-west-1" - - Freemont (USA) Region - - "nz" - - Auckland (New Zealand) Region +Note that you can use --interactive/-i or --dry-run with this command to see what +it would do. -#### --s3-region + rclone backend cleanup s3:bucket/path/to/object + rclone backend cleanup -o max-age=7w s3:bucket/path/to/object -Region to connect to. +Durations are parsed as per the rest of rclone, 2h, 7d, 7w etc. -Properties: -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: Scaleway -- Type: string -- Required: false -- Examples: - - "nl-ams" - - Amsterdam, The Netherlands - - "fr-par" - - Paris, France - - "pl-waw" - - Warsaw, Poland +Options: -#### --s3-region +- "max-age": Max age of upload to delete -Region to connect to. - the location where your bucket will be created and your data stored. Need bo be same with your endpoint. +### cleanup-hidden +Remove old versions of files. -Properties: + rclone backend cleanup-hidden remote: [options] [+] -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: HuaweiOBS -- Type: string -- Required: false -- Examples: - - "af-south-1" - - AF-Johannesburg - - "ap-southeast-2" - - AP-Bangkok - - "ap-southeast-3" - - AP-Singapore - - "cn-east-3" - - CN East-Shanghai1 - - "cn-east-2" - - CN East-Shanghai2 - - "cn-north-1" - - CN North-Beijing1 - - "cn-north-4" - - CN North-Beijing4 - - "cn-south-1" - - CN South-Guangzhou - - "ap-southeast-1" - - CN-Hong Kong - - "sa-argentina-1" - - LA-Buenos Aires1 - - "sa-peru-1" - - LA-Lima1 - - "na-mexico-1" - - LA-Mexico City1 - - "sa-chile-1" - - LA-Santiago2 - - "sa-brazil-1" - - LA-Sao Paulo1 - - "ru-northwest-2" - - RU-Moscow2 +This command removes any old hidden versions of files +on a versions enabled bucket. -#### --s3-region +Note that you can use --interactive/-i or --dry-run with this command to see what +it would do. -Region to connect to. + rclone backend cleanup-hidden s3:bucket/path/to/dir -Properties: -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: Cloudflare -- Type: string -- Required: false -- Examples: - - "auto" - - R2 buckets are automatically distributed across Cloudflare's data centers for low latency. +### versioning -#### --s3-region +Set/get versioning support for a bucket. -Region to connect to. + rclone backend versioning remote: [options] [+] -Properties: +This command sets versioning support if a parameter is +passed and then returns the current versioning status for the bucket +supplied. -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: Qiniu -- Type: string -- Required: false -- Examples: - - "cn-east-1" - - The default endpoint - a good choice if you are unsure. - - East China Region 1. - - Needs location constraint cn-east-1. - - "cn-east-2" - - East China Region 2. - - Needs location constraint cn-east-2. - - "cn-north-1" - - North China Region 1. - - Needs location constraint cn-north-1. - - "cn-south-1" - - South China Region 1. - - Needs location constraint cn-south-1. - - "us-north-1" - - North America Region. - - Needs location constraint us-north-1. - - "ap-southeast-1" - - Southeast Asia Region 1. - - Needs location constraint ap-southeast-1. - - "ap-northeast-1" - - Northeast Asia Region 1. - - Needs location constraint ap-northeast-1. + rclone backend versioning s3:bucket # read status only + rclone backend versioning s3:bucket Enabled + rclone backend versioning s3:bucket Suspended -#### --s3-region +It may return "Enabled", "Suspended" or "Unversioned". Note that once versioning +has been enabled the status can't be set back to "Unversioned". -Region where your bucket will be created and your data stored. +### set -Properties: +Set command for updating the config parameters. -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: IONOS -- Type: string -- Required: false -- Examples: - - "de" - - Frankfurt, Germany - - "eu-central-2" - - Berlin, Germany - - "eu-south-2" - - Logrono, Spain + rclone backend set remote: [options] [+] -#### --s3-region +This set command can be used to update the config parameters +for a running s3 backend. -Region where your bucket will be created and your data stored. +Usage Examples: + rclone backend set s3: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=s3: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=s3: -o session_token=X -o access_key_id=X -o secret_access_key=X -Properties: +The option keys are named as they are in the config file. -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: Petabox -- Type: string -- Required: false -- Examples: - - "us-east-1" - - US East (N. Virginia) - - "eu-central-1" - - Europe (Frankfurt) - - "ap-southeast-1" - - Asia Pacific (Singapore) - - "me-south-1" - - Middle East (Bahrain) - - "sa-east-1" - - South America (São Paulo) +This rebuilds the connection to the s3 backend when it is called with +the new parameters. Only new parameters need be passed as the values +will default to those currently in use. -#### --s3-region +It doesn't return anything. -Region where your data stored. -Properties: -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: Synology -- Type: string -- Required: false -- Examples: - - "eu-001" - - Europe Region 1 - - "eu-002" - - Europe Region 2 - - "us-001" - - US Region 1 - - "us-002" - - US Region 2 - - "tw-001" - - Asia (Taiwan) +### Anonymous access to public buckets + +If you want to use rclone to access a public bucket, configure with a +blank `access_key_id` and `secret_access_key`. Your config should end +up looking like this: + +``` +[anons3] +type = s3 +provider = AWS +env_auth = false +access_key_id = +secret_access_key = +region = us-east-1 +endpoint = +location_constraint = +acl = private +server_side_encryption = +storage_class = +``` + +Then use it as normal with the name of the public bucket, e.g. -#### --s3-region + rclone lsd anons3:1000genomes -Region to connect to. +You will be able to list and copy data but not upload it. -Leave blank if you are using an S3 clone and you don't have a region. +## Providers -Properties: +### AWS S3 -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: !AWS,Alibaba,ArvanCloud,ChinaMobile,Cloudflare,IONOS,Petabox,Liara,Qiniu,RackCorp,Scaleway,Storj,Synology,TencentCOS,HuaweiOBS,IDrive -- Type: string -- Required: false -- Examples: - - "" - - Use this if unsure. - - Will use v4 signatures and an empty region. - - "other-v2-signature" - - Use this only if v4 signatures don't work. - - E.g. pre Jewel/v10 CEPH. +This is the provider used as main example and described in the [configuration](#configuration) section above. -#### --s3-endpoint +### AWS Snowball Edge -Endpoint for S3 API. +[AWS Snowball](https://aws.amazon.com/snowball/) is a hardware +appliance used for transferring bulk data back to AWS. Its main +software interface is S3 object storage. -Leave blank if using AWS to use the default endpoint for the region. +To use rclone with AWS Snowball Edge devices, configure as standard +for an 'S3 Compatible Service'. -Properties: +If using rclone pre v1.59 be sure to set `upload_cutoff = 0` otherwise +you will run into authentication header issues as the snowball device +does not support query parameter based authentication. -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: AWS -- Type: string -- Required: false +With rclone v1.59 or later setting `upload_cutoff` should not be necessary. -#### --s3-endpoint +eg. +``` +[snowball] +type = s3 +provider = Other +access_key_id = YOUR_ACCESS_KEY +secret_access_key = YOUR_SECRET_KEY +endpoint = http://[IP of Snowball]:8080 +upload_cutoff = 0 +``` -Endpoint for China Mobile Ecloud Elastic Object Storage (EOS) API. +### Ceph -Properties: +[Ceph](https://ceph.com/) is an open-source, unified, distributed +storage system designed for excellent performance, reliability and +scalability. It has an S3 compatible object storage interface. -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: ChinaMobile -- Type: string -- Required: false -- Examples: - - "eos-wuxi-1.cmecloud.cn" - - The default endpoint - a good choice if you are unsure. - - East China (Suzhou) - - "eos-jinan-1.cmecloud.cn" - - East China (Jinan) - - "eos-ningbo-1.cmecloud.cn" - - East China (Hangzhou) - - "eos-shanghai-1.cmecloud.cn" - - East China (Shanghai-1) - - "eos-zhengzhou-1.cmecloud.cn" - - Central China (Zhengzhou) - - "eos-hunan-1.cmecloud.cn" - - Central China (Changsha-1) - - "eos-zhuzhou-1.cmecloud.cn" - - Central China (Changsha-2) - - "eos-guangzhou-1.cmecloud.cn" - - South China (Guangzhou-2) - - "eos-dongguan-1.cmecloud.cn" - - South China (Guangzhou-3) - - "eos-beijing-1.cmecloud.cn" - - North China (Beijing-1) - - "eos-beijing-2.cmecloud.cn" - - North China (Beijing-2) - - "eos-beijing-4.cmecloud.cn" - - North China (Beijing-3) - - "eos-huhehaote-1.cmecloud.cn" - - North China (Huhehaote) - - "eos-chengdu-1.cmecloud.cn" - - Southwest China (Chengdu) - - "eos-chongqing-1.cmecloud.cn" - - Southwest China (Chongqing) - - "eos-guiyang-1.cmecloud.cn" - - Southwest China (Guiyang) - - "eos-xian-1.cmecloud.cn" - - Nouthwest China (Xian) - - "eos-yunnan.cmecloud.cn" - - Yunnan China (Kunming) - - "eos-yunnan-2.cmecloud.cn" - - Yunnan China (Kunming-2) - - "eos-tianjin-1.cmecloud.cn" - - Tianjin China (Tianjin) - - "eos-jilin-1.cmecloud.cn" - - Jilin China (Changchun) - - "eos-hubei-1.cmecloud.cn" - - Hubei China (Xiangyan) - - "eos-jiangxi-1.cmecloud.cn" - - Jiangxi China (Nanchang) - - "eos-gansu-1.cmecloud.cn" - - Gansu China (Lanzhou) - - "eos-shanxi-1.cmecloud.cn" - - Shanxi China (Taiyuan) - - "eos-liaoning-1.cmecloud.cn" - - Liaoning China (Shenyang) - - "eos-hebei-1.cmecloud.cn" - - Hebei China (Shijiazhuang) - - "eos-fujian-1.cmecloud.cn" - - Fujian China (Xiamen) - - "eos-guangxi-1.cmecloud.cn" - - Guangxi China (Nanning) - - "eos-anhui-1.cmecloud.cn" - - Anhui China (Huainan) +To use rclone with Ceph, configure as above but leave the region blank +and set the endpoint. You should end up with something like this in +your config: -#### --s3-endpoint -Endpoint for Arvan Cloud Object Storage (AOS) API. +``` +[ceph] +type = s3 +provider = Ceph +env_auth = false +access_key_id = XXX +secret_access_key = YYY +region = +endpoint = https://ceph.endpoint.example.com +location_constraint = +acl = +server_side_encryption = +storage_class = +``` -Properties: +If you are using an older version of CEPH (e.g. 10.2.x Jewel) and a +version of rclone before v1.59 then you may need to supply the +parameter `--s3-upload-cutoff 0` or put this in the config file as +`upload_cutoff 0` to work around a bug which causes uploading of small +files to fail. -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: ArvanCloud -- Type: string -- Required: false -- Examples: - - "s3.ir-thr-at1.arvanstorage.ir" - - The default endpoint - a good choice if you are unsure. - - Tehran Iran (Simin) - - "s3.ir-tbz-sh1.arvanstorage.ir" - - Tabriz Iran (Shahriar) +Note also that Ceph sometimes puts `/` in the passwords it gives +users. If you read the secret access key using the command line tools +you will get a JSON blob with the `/` escaped as `\/`. Make sure you +only write `/` in the secret access key. -#### --s3-endpoint +Eg the dump from Ceph looks something like this (irrelevant keys +removed). -Endpoint for IBM COS S3 API. +``` +{ + "user_id": "xxx", + "display_name": "xxxx", + "keys": [ + { + "user": "xxx", + "access_key": "xxxxxx", + "secret_key": "xxxxxx\/xxxx" + } + ], +} +``` -Specify if using an IBM COS On Premise. +Because this is a json dump, it is encoding the `/` as `\/`, so if you +use the secret key as `xxxxxx/xxxx` it will work fine. -Properties: +### Cloudflare R2 {#cloudflare-r2} -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: IBMCOS -- Type: string -- Required: false -- Examples: - - "s3.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Endpoint - - "s3.dal.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Dallas Endpoint - - "s3.wdc.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Washington DC Endpoint - - "s3.sjc.us.cloud-object-storage.appdomain.cloud" - - US Cross Region San Jose Endpoint - - "s3.private.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Private Endpoint - - "s3.private.dal.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Dallas Private Endpoint - - "s3.private.wdc.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Washington DC Private Endpoint - - "s3.private.sjc.us.cloud-object-storage.appdomain.cloud" - - US Cross Region San Jose Private Endpoint - - "s3.us-east.cloud-object-storage.appdomain.cloud" - - US Region East Endpoint - - "s3.private.us-east.cloud-object-storage.appdomain.cloud" - - US Region East Private Endpoint - - "s3.us-south.cloud-object-storage.appdomain.cloud" - - US Region South Endpoint - - "s3.private.us-south.cloud-object-storage.appdomain.cloud" - - US Region South Private Endpoint - - "s3.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Endpoint - - "s3.fra.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Frankfurt Endpoint - - "s3.mil.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Milan Endpoint - - "s3.ams.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Amsterdam Endpoint - - "s3.private.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Private Endpoint - - "s3.private.fra.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Frankfurt Private Endpoint - - "s3.private.mil.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Milan Private Endpoint - - "s3.private.ams.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Amsterdam Private Endpoint - - "s3.eu-gb.cloud-object-storage.appdomain.cloud" - - Great Britain Endpoint - - "s3.private.eu-gb.cloud-object-storage.appdomain.cloud" - - Great Britain Private Endpoint - - "s3.eu-de.cloud-object-storage.appdomain.cloud" - - EU Region DE Endpoint - - "s3.private.eu-de.cloud-object-storage.appdomain.cloud" - - EU Region DE Private Endpoint - - "s3.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Endpoint - - "s3.tok.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Tokyo Endpoint - - "s3.hkg.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional HongKong Endpoint - - "s3.seo.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Seoul Endpoint - - "s3.private.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Private Endpoint - - "s3.private.tok.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Tokyo Private Endpoint - - "s3.private.hkg.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional HongKong Private Endpoint - - "s3.private.seo.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Seoul Private Endpoint - - "s3.jp-tok.cloud-object-storage.appdomain.cloud" - - APAC Region Japan Endpoint - - "s3.private.jp-tok.cloud-object-storage.appdomain.cloud" - - APAC Region Japan Private Endpoint - - "s3.au-syd.cloud-object-storage.appdomain.cloud" - - APAC Region Australia Endpoint - - "s3.private.au-syd.cloud-object-storage.appdomain.cloud" - - APAC Region Australia Private Endpoint - - "s3.ams03.cloud-object-storage.appdomain.cloud" - - Amsterdam Single Site Endpoint - - "s3.private.ams03.cloud-object-storage.appdomain.cloud" - - Amsterdam Single Site Private Endpoint - - "s3.che01.cloud-object-storage.appdomain.cloud" - - Chennai Single Site Endpoint - - "s3.private.che01.cloud-object-storage.appdomain.cloud" - - Chennai Single Site Private Endpoint - - "s3.mel01.cloud-object-storage.appdomain.cloud" - - Melbourne Single Site Endpoint - - "s3.private.mel01.cloud-object-storage.appdomain.cloud" - - Melbourne Single Site Private Endpoint - - "s3.osl01.cloud-object-storage.appdomain.cloud" - - Oslo Single Site Endpoint - - "s3.private.osl01.cloud-object-storage.appdomain.cloud" - - Oslo Single Site Private Endpoint - - "s3.tor01.cloud-object-storage.appdomain.cloud" - - Toronto Single Site Endpoint - - "s3.private.tor01.cloud-object-storage.appdomain.cloud" - - Toronto Single Site Private Endpoint - - "s3.seo01.cloud-object-storage.appdomain.cloud" - - Seoul Single Site Endpoint - - "s3.private.seo01.cloud-object-storage.appdomain.cloud" - - Seoul Single Site Private Endpoint - - "s3.mon01.cloud-object-storage.appdomain.cloud" - - Montreal Single Site Endpoint - - "s3.private.mon01.cloud-object-storage.appdomain.cloud" - - Montreal Single Site Private Endpoint - - "s3.mex01.cloud-object-storage.appdomain.cloud" - - Mexico Single Site Endpoint - - "s3.private.mex01.cloud-object-storage.appdomain.cloud" - - Mexico Single Site Private Endpoint - - "s3.sjc04.cloud-object-storage.appdomain.cloud" - - San Jose Single Site Endpoint - - "s3.private.sjc04.cloud-object-storage.appdomain.cloud" - - San Jose Single Site Private Endpoint - - "s3.mil01.cloud-object-storage.appdomain.cloud" - - Milan Single Site Endpoint - - "s3.private.mil01.cloud-object-storage.appdomain.cloud" - - Milan Single Site Private Endpoint - - "s3.hkg02.cloud-object-storage.appdomain.cloud" - - Hong Kong Single Site Endpoint - - "s3.private.hkg02.cloud-object-storage.appdomain.cloud" - - Hong Kong Single Site Private Endpoint - - "s3.par01.cloud-object-storage.appdomain.cloud" - - Paris Single Site Endpoint - - "s3.private.par01.cloud-object-storage.appdomain.cloud" - - Paris Single Site Private Endpoint - - "s3.sng01.cloud-object-storage.appdomain.cloud" - - Singapore Single Site Endpoint - - "s3.private.sng01.cloud-object-storage.appdomain.cloud" - - Singapore Single Site Private Endpoint +[Cloudflare R2](https://blog.cloudflare.com/r2-open-beta/) Storage +allows developers to store large amounts of unstructured data without +the costly egress bandwidth fees associated with typical cloud storage +services. -#### --s3-endpoint +Here is an example of making a Cloudflare R2 configuration. First run: -Endpoint for IONOS S3 Object Storage. + rclone config -Specify the endpoint from the same region. +This will guide you through an interactive setup process. -Properties: +Note that all buckets are private, and all are stored in the same +"auto" region. It is necessary to use Cloudflare workers to share the +content of a bucket publicly. -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: IONOS -- Type: string -- Required: false -- Examples: - - "s3-eu-central-1.ionoscloud.com" - - Frankfurt, Germany - - "s3-eu-central-2.ionoscloud.com" - - Berlin, Germany - - "s3-eu-south-2.ionoscloud.com" - - Logrono, Spain +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> r2 +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +... +XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi + \ (s3) +... +Storage> s3 +Option provider. +Choose your S3 provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. +... +XX / Cloudflare R2 Storage + \ (Cloudflare) +... +provider> Cloudflare +Option env_auth. +Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). +Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) +env_auth> 1 +Option access_key_id. +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +access_key_id> ACCESS_KEY +Option secret_access_key. +AWS Secret Access Key (password). +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +secret_access_key> SECRET_ACCESS_KEY +Option region. +Region to connect to. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / R2 buckets are automatically distributed across Cloudflare's data centers for low latency. + \ (auto) +region> 1 +Option endpoint. +Endpoint for S3 API. +Required when using an S3 clone. +Enter a value. Press Enter to leave empty. +endpoint> https://ACCOUNT_ID.r2.cloudflarestorage.com +Edit advanced config? +y) Yes +n) No (default) +y/n> n +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -#### --s3-endpoint +This will leave your config looking something like: -Endpoint for Petabox S3 Object Storage. +``` +[r2] +type = s3 +provider = Cloudflare +access_key_id = ACCESS_KEY +secret_access_key = SECRET_ACCESS_KEY +region = auto +endpoint = https://ACCOUNT_ID.r2.cloudflarestorage.com +acl = private +``` -Specify the endpoint from the same region. +Now run `rclone lsf r2:` to see your buckets and `rclone lsf +r2:bucket` to look within a bucket. -Properties: +### Dreamhost -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Petabox -- Type: string -- Required: true -- Examples: - - "s3.petabox.io" - - US East (N. Virginia) - - "s3.us-east-1.petabox.io" - - US East (N. Virginia) - - "s3.eu-central-1.petabox.io" - - Europe (Frankfurt) - - "s3.ap-southeast-1.petabox.io" - - Asia Pacific (Singapore) - - "s3.me-south-1.petabox.io" - - Middle East (Bahrain) - - "s3.sa-east-1.petabox.io" - - South America (São Paulo) +Dreamhost [DreamObjects](https://www.dreamhost.com/cloud/storage/) is +an object storage system based on CEPH. -#### --s3-endpoint +To use rclone with Dreamhost, configure as above but leave the region blank +and set the endpoint. You should end up with something like this in +your config: -Endpoint for Leviia Object Storage API. +``` +[dreamobjects] +type = s3 +provider = DreamHost +env_auth = false +access_key_id = your_access_key +secret_access_key = your_secret_key +region = +endpoint = objects-us-west-1.dream.io +location_constraint = +acl = private +server_side_encryption = +storage_class = +``` -Properties: +### Google Cloud Storage -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Leviia -- Type: string -- Required: false -- Examples: - - "s3.leviia.com" - - The default endpoint - - Leviia +[GoogleCloudStorage](https://cloud.google.com/storage/docs) is an [S3-interoperable](https://cloud.google.com/storage/docs/interoperability) object storage service from Google Cloud Platform. -#### --s3-endpoint +To connect to Google Cloud Storage you will need an access key and secret key. These can be retrieved by creating an [HMAC key](https://cloud.google.com/storage/docs/authentication/managing-hmackeys). -Endpoint for Liara Object Storage API. +``` +[gs] +type = s3 +provider = GCS +access_key_id = your_access_key +secret_access_key = your_secret_key +endpoint = https://storage.googleapis.com +``` -Properties: +**Note** that `--s3-versions` does not work with GCS when it needs to do directory paging. Rclone will return the error: -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Liara -- Type: string -- Required: false -- Examples: - - "storage.iran.liara.space" - - The default endpoint - - Iran + s3 protocol error: received versions listing with IsTruncated set with no NextKeyMarker -#### --s3-endpoint +This is Google bug [#312292516](https://issuetracker.google.com/u/0/issues/312292516). -Endpoint for OSS API. +### DigitalOcean Spaces -Properties: +[Spaces](https://www.digitalocean.com/products/object-storage/) is an [S3-interoperable](https://developers.digitalocean.com/documentation/spaces/) object storage service from cloud provider DigitalOcean. -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Alibaba -- Type: string -- Required: false -- Examples: - - "oss-accelerate.aliyuncs.com" - - Global Accelerate - - "oss-accelerate-overseas.aliyuncs.com" - - Global Accelerate (outside mainland China) - - "oss-cn-hangzhou.aliyuncs.com" - - East China 1 (Hangzhou) - - "oss-cn-shanghai.aliyuncs.com" - - East China 2 (Shanghai) - - "oss-cn-qingdao.aliyuncs.com" - - North China 1 (Qingdao) - - "oss-cn-beijing.aliyuncs.com" - - North China 2 (Beijing) - - "oss-cn-zhangjiakou.aliyuncs.com" - - North China 3 (Zhangjiakou) - - "oss-cn-huhehaote.aliyuncs.com" - - North China 5 (Hohhot) - - "oss-cn-wulanchabu.aliyuncs.com" - - North China 6 (Ulanqab) - - "oss-cn-shenzhen.aliyuncs.com" - - South China 1 (Shenzhen) - - "oss-cn-heyuan.aliyuncs.com" - - South China 2 (Heyuan) - - "oss-cn-guangzhou.aliyuncs.com" - - South China 3 (Guangzhou) - - "oss-cn-chengdu.aliyuncs.com" - - West China 1 (Chengdu) - - "oss-cn-hongkong.aliyuncs.com" - - Hong Kong (Hong Kong) - - "oss-us-west-1.aliyuncs.com" - - US West 1 (Silicon Valley) - - "oss-us-east-1.aliyuncs.com" - - US East 1 (Virginia) - - "oss-ap-southeast-1.aliyuncs.com" - - Southeast Asia Southeast 1 (Singapore) - - "oss-ap-southeast-2.aliyuncs.com" - - Asia Pacific Southeast 2 (Sydney) - - "oss-ap-southeast-3.aliyuncs.com" - - Southeast Asia Southeast 3 (Kuala Lumpur) - - "oss-ap-southeast-5.aliyuncs.com" - - Asia Pacific Southeast 5 (Jakarta) - - "oss-ap-northeast-1.aliyuncs.com" - - Asia Pacific Northeast 1 (Japan) - - "oss-ap-south-1.aliyuncs.com" - - Asia Pacific South 1 (Mumbai) - - "oss-eu-central-1.aliyuncs.com" - - Central Europe 1 (Frankfurt) - - "oss-eu-west-1.aliyuncs.com" - - West Europe (London) - - "oss-me-east-1.aliyuncs.com" - - Middle East 1 (Dubai) +To connect to DigitalOcean Spaces you will need an access key and secret key. These can be retrieved on the "[Applications & API](https://cloud.digitalocean.com/settings/api/tokens)" page of the DigitalOcean control panel. They will be needed when prompted by `rclone config` for your `access_key_id` and `secret_access_key`. -#### --s3-endpoint +When prompted for a `region` or `location_constraint`, press enter to use the default value. The region must be included in the `endpoint` setting (e.g. `nyc3.digitaloceanspaces.com`). The default values can be used for other settings. -Endpoint for OBS API. +Going through the whole process of creating a new remote by running `rclone config`, each prompt should be answered as shown below: -Properties: +``` +Storage> s3 +env_auth> 1 +access_key_id> YOUR_ACCESS_KEY +secret_access_key> YOUR_SECRET_KEY +region> +endpoint> nyc3.digitaloceanspaces.com +location_constraint> +acl> +storage_class> +``` -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: HuaweiOBS -- Type: string -- Required: false -- Examples: - - "obs.af-south-1.myhuaweicloud.com" - - AF-Johannesburg - - "obs.ap-southeast-2.myhuaweicloud.com" - - AP-Bangkok - - "obs.ap-southeast-3.myhuaweicloud.com" - - AP-Singapore - - "obs.cn-east-3.myhuaweicloud.com" - - CN East-Shanghai1 - - "obs.cn-east-2.myhuaweicloud.com" - - CN East-Shanghai2 - - "obs.cn-north-1.myhuaweicloud.com" - - CN North-Beijing1 - - "obs.cn-north-4.myhuaweicloud.com" - - CN North-Beijing4 - - "obs.cn-south-1.myhuaweicloud.com" - - CN South-Guangzhou - - "obs.ap-southeast-1.myhuaweicloud.com" - - CN-Hong Kong - - "obs.sa-argentina-1.myhuaweicloud.com" - - LA-Buenos Aires1 - - "obs.sa-peru-1.myhuaweicloud.com" - - LA-Lima1 - - "obs.na-mexico-1.myhuaweicloud.com" - - LA-Mexico City1 - - "obs.sa-chile-1.myhuaweicloud.com" - - LA-Santiago2 - - "obs.sa-brazil-1.myhuaweicloud.com" - - LA-Sao Paulo1 - - "obs.ru-northwest-2.myhuaweicloud.com" - - RU-Moscow2 +The resulting configuration file should look like: -#### --s3-endpoint +``` +[spaces] +type = s3 +provider = DigitalOcean +env_auth = false +access_key_id = YOUR_ACCESS_KEY +secret_access_key = YOUR_SECRET_KEY +region = +endpoint = nyc3.digitaloceanspaces.com +location_constraint = +acl = +server_side_encryption = +storage_class = +``` -Endpoint for Scaleway Object Storage. +Once configured, you can create a new Space and begin copying files. For example: -Properties: +``` +rclone mkdir spaces:my-new-space +rclone copy /path/to/files spaces:my-new-space +``` +### Huawei OBS {#huawei-obs} -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Scaleway -- Type: string -- Required: false -- Examples: - - "s3.nl-ams.scw.cloud" - - Amsterdam Endpoint - - "s3.fr-par.scw.cloud" - - Paris Endpoint - - "s3.pl-waw.scw.cloud" - - Warsaw Endpoint +Object Storage Service (OBS) provides stable, secure, efficient, and easy-to-use cloud storage that lets you store virtually any volume of unstructured data in any format and access it from anywhere. -#### --s3-endpoint +OBS provides an S3 interface, you can copy and modify the following configuration and add it to your rclone configuration file. +``` +[obs] +type = s3 +provider = HuaweiOBS +access_key_id = your-access-key-id +secret_access_key = your-secret-access-key +region = af-south-1 +endpoint = obs.af-south-1.myhuaweicloud.com +acl = private +``` -Endpoint for StackPath Object Storage. +Or you can also configure via the interactive command line: +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> obs +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi + \ (s3) +[snip] +Storage> 5 +Option provider. +Choose your S3 provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. +[snip] + 9 / Huawei Object Storage Service + \ (HuaweiOBS) +[snip] +provider> 9 +Option env_auth. +Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). +Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) +env_auth> 1 +Option access_key_id. +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +access_key_id> your-access-key-id +Option secret_access_key. +AWS Secret Access Key (password). +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +secret_access_key> your-secret-access-key +Option region. +Region to connect to. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / AF-Johannesburg + \ (af-south-1) + 2 / AP-Bangkok + \ (ap-southeast-2) +[snip] +region> 1 +Option endpoint. +Endpoint for OBS API. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / AF-Johannesburg + \ (obs.af-south-1.myhuaweicloud.com) + 2 / AP-Bangkok + \ (obs.ap-southeast-2.myhuaweicloud.com) +[snip] +endpoint> 1 +Option acl. +Canned ACL used when creating buckets and storing or copying objects. +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) +[snip] +acl> 1 +Edit advanced config? +y) Yes +n) No (default) +y/n> +-------------------- +[obs] +type = s3 +provider = HuaweiOBS +access_key_id = your-access-key-id +secret_access_key = your-secret-access-key +region = af-south-1 +endpoint = obs.af-south-1.myhuaweicloud.com +acl = private +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +Current remotes: -Properties: +Name Type +==== ==== +obs s3 -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: StackPath -- Type: string -- Required: false -- Examples: - - "s3.us-east-2.stackpathstorage.com" - - US East Endpoint - - "s3.us-west-1.stackpathstorage.com" - - US West Endpoint - - "s3.eu-central-1.stackpathstorage.com" - - EU Endpoint +e) Edit existing remote +n) New remote +d) Delete remote +r) Rename remote +c) Copy remote +s) Set configuration password +q) Quit config +e/n/d/r/c/s/q> q +``` -#### --s3-endpoint +### IBM COS (S3) -Endpoint for Google Cloud Storage. +Information stored with IBM Cloud Object Storage is encrypted and dispersed across multiple geographic locations, and accessed through an implementation of the S3 API. This service makes use of the distributed storage technologies provided by IBM’s Cloud Object Storage System (formerly Cleversafe). For more information visit: (http://www.ibm.com/cloud/object-storage) -Properties: +To configure access to IBM COS S3, follow the steps below: -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: GCS -- Type: string -- Required: false -- Examples: - - "https://storage.googleapis.com" - - Google Cloud Storage endpoint +1. Run rclone config and select n for a new remote. +``` + 2018/02/14 14:13:11 NOTICE: Config file "C:\\Users\\a\\.config\\rclone\\rclone.conf" not found - using defaults + No remotes found, make a new one? + n) New remote + s) Set configuration password + q) Quit config + n/s/q> n +``` -#### --s3-endpoint +2. Enter the name for the configuration +``` + name> +``` -Endpoint for Storj Gateway. +3. Select "s3" storage. +``` +Choose a number from below, or type in your own value + 1 / Alias for an existing remote + \ "alias" + 2 / Amazon Drive + \ "amazon cloud drive" + 3 / Amazon S3 Complaint Storage Providers (Dreamhost, Ceph, ChinaMobile, Liara, ArvanCloud, Minio, IBM COS) + \ "s3" + 4 / Backblaze B2 + \ "b2" +[snip] + 23 / HTTP + \ "http" +Storage> 3 +``` -Properties: +4. Select IBM COS as the S3 Storage Provider. +``` +Choose the S3 provider. +Choose a number from below, or type in your own value + 1 / Choose this option to configure Storage to AWS S3 + \ "AWS" + 2 / Choose this option to configure Storage to Ceph Systems + \ "Ceph" + 3 / Choose this option to configure Storage to Dreamhost + \ "Dreamhost" + 4 / Choose this option to the configure Storage to IBM COS S3 + \ "IBMCOS" + 5 / Choose this option to the configure Storage to Minio + \ "Minio" + Provider>4 +``` -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Storj -- Type: string -- Required: false -- Examples: - - "gateway.storjshare.io" - - Global Hosted Gateway +5. Enter the Access Key and Secret. +``` + AWS Access Key ID - leave blank for anonymous access or runtime credentials. + access_key_id> <> + AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. + secret_access_key> <> +``` -#### --s3-endpoint +6. Specify the endpoint for IBM COS. For Public IBM COS, choose from the option below. For On Premise IBM COS, enter an endpoint address. +``` + Endpoint for IBM COS S3 API. + Specify if using an IBM COS On Premise. + Choose a number from below, or type in your own value + 1 / US Cross Region Endpoint + \ "s3-api.us-geo.objectstorage.softlayer.net" + 2 / US Cross Region Dallas Endpoint + \ "s3-api.dal.us-geo.objectstorage.softlayer.net" + 3 / US Cross Region Washington DC Endpoint + \ "s3-api.wdc-us-geo.objectstorage.softlayer.net" + 4 / US Cross Region San Jose Endpoint + \ "s3-api.sjc-us-geo.objectstorage.softlayer.net" + 5 / US Cross Region Private Endpoint + \ "s3-api.us-geo.objectstorage.service.networklayer.com" + 6 / US Cross Region Dallas Private Endpoint + \ "s3-api.dal-us-geo.objectstorage.service.networklayer.com" + 7 / US Cross Region Washington DC Private Endpoint + \ "s3-api.wdc-us-geo.objectstorage.service.networklayer.com" + 8 / US Cross Region San Jose Private Endpoint + \ "s3-api.sjc-us-geo.objectstorage.service.networklayer.com" + 9 / US Region East Endpoint + \ "s3.us-east.objectstorage.softlayer.net" + 10 / US Region East Private Endpoint + \ "s3.us-east.objectstorage.service.networklayer.com" + 11 / US Region South Endpoint +[snip] + 34 / Toronto Single Site Private Endpoint + \ "s3.tor01.objectstorage.service.networklayer.com" + endpoint>1 +``` -Endpoint for Synology C2 Object Storage API. -Properties: +7. Specify a IBM COS Location Constraint. The location constraint must match endpoint when using IBM Cloud Public. For on-prem COS, do not make a selection from this list, hit enter +``` + 1 / US Cross Region Standard + \ "us-standard" + 2 / US Cross Region Vault + \ "us-vault" + 3 / US Cross Region Cold + \ "us-cold" + 4 / US Cross Region Flex + \ "us-flex" + 5 / US East Region Standard + \ "us-east-standard" + 6 / US East Region Vault + \ "us-east-vault" + 7 / US East Region Cold + \ "us-east-cold" + 8 / US East Region Flex + \ "us-east-flex" + 9 / US South Region Standard + \ "us-south-standard" + 10 / US South Region Vault + \ "us-south-vault" +[snip] + 32 / Toronto Flex + \ "tor01-flex" +location_constraint>1 +``` -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Synology -- Type: string -- Required: false -- Examples: - - "eu-001.s3.synologyc2.net" - - EU Endpoint 1 - - "eu-002.s3.synologyc2.net" - - EU Endpoint 2 - - "us-001.s3.synologyc2.net" - - US Endpoint 1 - - "us-002.s3.synologyc2.net" - - US Endpoint 2 - - "tw-001.s3.synologyc2.net" - - TW Endpoint 1 +9. Specify a canned ACL. IBM Cloud (Storage) supports "public-read" and "private". IBM Cloud(Infra) supports all the canned ACLs. On-Premise COS supports all the canned ACLs. +``` +Canned ACL used when creating buckets and/or storing objects in S3. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Choose a number from below, or type in your own value + 1 / Owner gets FULL_CONTROL. No one else has access rights (default). This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise COS + \ "private" + 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access. This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise IBM COS + \ "public-read" + 3 / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. This acl is available on IBM Cloud (Infra), On-Premise IBM COS + \ "public-read-write" + 4 / Owner gets FULL_CONTROL. The AuthenticatedUsers group gets READ access. Not supported on Buckets. This acl is available on IBM Cloud (Infra) and On-Premise IBM COS + \ "authenticated-read" +acl> 1 +``` -#### --s3-endpoint -Endpoint for Tencent COS API. +12. Review the displayed configuration and accept to save the "remote" then quit. The config file should look like this +``` + [xxx] + type = s3 + Provider = IBMCOS + access_key_id = xxx + secret_access_key = yyy + endpoint = s3-api.us-geo.objectstorage.softlayer.net + location_constraint = us-standard + acl = private +``` -Properties: +13. Execute rclone commands +``` + 1) Create a bucket. + rclone mkdir IBM-COS-XREGION:newbucket + 2) List available buckets. + rclone lsd IBM-COS-XREGION: + -1 2017-11-08 21:16:22 -1 test + -1 2018-02-14 20:16:39 -1 newbucket + 3) List contents of a bucket. + rclone ls IBM-COS-XREGION:newbucket + 18685952 test.exe + 4) Copy a file from local to remote. + rclone copy /Users/file.txt IBM-COS-XREGION:newbucket + 5) Copy a file from remote to local. + rclone copy IBM-COS-XREGION:newbucket/file.txt . + 6) Delete a file on remote. + rclone delete IBM-COS-XREGION:newbucket/file.txt +``` -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: TencentCOS -- Type: string -- Required: false -- Examples: - - "cos.ap-beijing.myqcloud.com" - - Beijing Region - - "cos.ap-nanjing.myqcloud.com" - - Nanjing Region - - "cos.ap-shanghai.myqcloud.com" - - Shanghai Region - - "cos.ap-guangzhou.myqcloud.com" - - Guangzhou Region - - "cos.ap-nanjing.myqcloud.com" - - Nanjing Region - - "cos.ap-chengdu.myqcloud.com" - - Chengdu Region - - "cos.ap-chongqing.myqcloud.com" - - Chongqing Region - - "cos.ap-hongkong.myqcloud.com" - - Hong Kong (China) Region - - "cos.ap-singapore.myqcloud.com" - - Singapore Region - - "cos.ap-mumbai.myqcloud.com" - - Mumbai Region - - "cos.ap-seoul.myqcloud.com" - - Seoul Region - - "cos.ap-bangkok.myqcloud.com" - - Bangkok Region - - "cos.ap-tokyo.myqcloud.com" - - Tokyo Region - - "cos.na-siliconvalley.myqcloud.com" - - Silicon Valley Region - - "cos.na-ashburn.myqcloud.com" - - Virginia Region - - "cos.na-toronto.myqcloud.com" - - Toronto Region - - "cos.eu-frankfurt.myqcloud.com" - - Frankfurt Region - - "cos.eu-moscow.myqcloud.com" - - Moscow Region - - "cos.accelerate.myqcloud.com" - - Use Tencent COS Accelerate Endpoint +### IDrive e2 {#idrive-e2} -#### --s3-endpoint +Here is an example of making an [IDrive e2](https://www.idrive.com/e2/) +configuration. First run: -Endpoint for RackCorp Object Storage. + rclone config -Properties: +This will guide you through an interactive setup process. -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: RackCorp -- Type: string -- Required: false -- Examples: - - "s3.rackcorp.com" - - Global (AnyCast) Endpoint - - "au.s3.rackcorp.com" - - Australia (Anycast) Endpoint - - "au-nsw.s3.rackcorp.com" - - Sydney (Australia) Endpoint - - "au-qld.s3.rackcorp.com" - - Brisbane (Australia) Endpoint - - "au-vic.s3.rackcorp.com" - - Melbourne (Australia) Endpoint - - "au-wa.s3.rackcorp.com" - - Perth (Australia) Endpoint - - "ph.s3.rackcorp.com" - - Manila (Philippines) Endpoint - - "th.s3.rackcorp.com" - - Bangkok (Thailand) Endpoint - - "hk.s3.rackcorp.com" - - HK (Hong Kong) Endpoint - - "mn.s3.rackcorp.com" - - Ulaanbaatar (Mongolia) Endpoint - - "kg.s3.rackcorp.com" - - Bishkek (Kyrgyzstan) Endpoint - - "id.s3.rackcorp.com" - - Jakarta (Indonesia) Endpoint - - "jp.s3.rackcorp.com" - - Tokyo (Japan) Endpoint - - "sg.s3.rackcorp.com" - - SG (Singapore) Endpoint - - "de.s3.rackcorp.com" - - Frankfurt (Germany) Endpoint - - "us.s3.rackcorp.com" - - USA (AnyCast) Endpoint - - "us-east-1.s3.rackcorp.com" - - New York (USA) Endpoint - - "us-west-1.s3.rackcorp.com" - - Freemont (USA) Endpoint - - "nz.s3.rackcorp.com" - - Auckland (New Zealand) Endpoint +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n -#### --s3-endpoint +Enter name for new remote. +name> e2 -Endpoint for Qiniu Object Storage. +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] +XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi + \ (s3) +[snip] +Storage> s3 -Properties: +Option provider. +Choose your S3 provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. +[snip] +XX / IDrive e2 + \ (IDrive) +[snip] +provider> IDrive -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Qiniu -- Type: string -- Required: false -- Examples: - - "s3-cn-east-1.qiniucs.com" - - East China Endpoint 1 - - "s3-cn-east-2.qiniucs.com" - - East China Endpoint 2 - - "s3-cn-north-1.qiniucs.com" - - North China Endpoint 1 - - "s3-cn-south-1.qiniucs.com" - - South China Endpoint 1 - - "s3-us-north-1.qiniucs.com" - - North America Endpoint 1 - - "s3-ap-southeast-1.qiniucs.com" - - Southeast Asia Endpoint 1 - - "s3-ap-northeast-1.qiniucs.com" - - Northeast Asia Endpoint 1 +Option env_auth. +Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). +Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) +env_auth> -#### --s3-endpoint +Option access_key_id. +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +access_key_id> YOUR_ACCESS_KEY -Endpoint for S3 API. +Option secret_access_key. +AWS Secret Access Key (password). +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +secret_access_key> YOUR_SECRET_KEY -Required when using an S3 clone. +Option acl. +Canned ACL used when creating buckets and storing or copying objects. +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + / Owner gets FULL_CONTROL. + 2 | The AllUsers group gets READ access. + \ (public-read) + / Owner gets FULL_CONTROL. + 3 | The AllUsers group gets READ and WRITE access. + | Granting this on a bucket is generally not recommended. + \ (public-read-write) + / Owner gets FULL_CONTROL. + 4 | The AuthenticatedUsers group gets READ access. + \ (authenticated-read) + / Object owner gets FULL_CONTROL. + 5 | Bucket owner gets READ access. + | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \ (bucket-owner-read) + / Both the object owner and the bucket owner get FULL_CONTROL over the object. + 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \ (bucket-owner-full-control) +acl> -Properties: +Edit advanced config? +y) Yes +n) No (default) +y/n> -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: !AWS,ArvanCloud,IBMCOS,IDrive,IONOS,TencentCOS,HuaweiOBS,Alibaba,ChinaMobile,GCS,Liara,Scaleway,StackPath,Storj,Synology,RackCorp,Qiniu,Petabox -- Type: string -- Required: false -- Examples: - - "objects-us-east-1.dream.io" - - Dream Objects endpoint - - "syd1.digitaloceanspaces.com" - - DigitalOcean Spaces Sydney 1 - - "sfo3.digitaloceanspaces.com" - - DigitalOcean Spaces San Francisco 3 - - "fra1.digitaloceanspaces.com" - - DigitalOcean Spaces Frankfurt 1 - - "nyc3.digitaloceanspaces.com" - - DigitalOcean Spaces New York 3 - - "ams3.digitaloceanspaces.com" - - DigitalOcean Spaces Amsterdam 3 - - "sgp1.digitaloceanspaces.com" - - DigitalOcean Spaces Singapore 1 - - "localhost:8333" - - SeaweedFS S3 localhost - - "s3.us-east-1.lyvecloud.seagate.com" - - Seagate Lyve Cloud US East 1 (Virginia) - - "s3.us-west-1.lyvecloud.seagate.com" - - Seagate Lyve Cloud US West 1 (California) - - "s3.ap-southeast-1.lyvecloud.seagate.com" - - Seagate Lyve Cloud AP Southeast 1 (Singapore) - - "s3.wasabisys.com" - - Wasabi US East 1 (N. Virginia) - - "s3.us-east-2.wasabisys.com" - - Wasabi US East 2 (N. Virginia) - - "s3.us-central-1.wasabisys.com" - - Wasabi US Central 1 (Texas) - - "s3.us-west-1.wasabisys.com" - - Wasabi US West 1 (Oregon) - - "s3.ca-central-1.wasabisys.com" - - Wasabi CA Central 1 (Toronto) - - "s3.eu-central-1.wasabisys.com" - - Wasabi EU Central 1 (Amsterdam) - - "s3.eu-central-2.wasabisys.com" - - Wasabi EU Central 2 (Frankfurt) - - "s3.eu-west-1.wasabisys.com" - - Wasabi EU West 1 (London) - - "s3.eu-west-2.wasabisys.com" - - Wasabi EU West 2 (Paris) - - "s3.ap-northeast-1.wasabisys.com" - - Wasabi AP Northeast 1 (Tokyo) endpoint - - "s3.ap-northeast-2.wasabisys.com" - - Wasabi AP Northeast 2 (Osaka) endpoint - - "s3.ap-southeast-1.wasabisys.com" - - Wasabi AP Southeast 1 (Singapore) - - "s3.ap-southeast-2.wasabisys.com" - - Wasabi AP Southeast 2 (Sydney) - - "storage.iran.liara.space" - - Liara Iran endpoint - - "s3.ir-thr-at1.arvanstorage.ir" - - ArvanCloud Tehran Iran (Simin) endpoint - - "s3.ir-tbz-sh1.arvanstorage.ir" - - ArvanCloud Tabriz Iran (Shahriar) endpoint +Configuration complete. +Options: +- type: s3 +- provider: IDrive +- access_key_id: YOUR_ACCESS_KEY +- secret_access_key: YOUR_SECRET_KEY +- endpoint: q9d9.la12.idrivee2-5.com +Keep this "e2" remote? +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -#### --s3-location-constraint +### IONOS Cloud {#ionos} -Location constraint - must be set to match the Region. +[IONOS S3 Object Storage](https://cloud.ionos.com/storage/object-storage) is a service offered by IONOS for storing and accessing unstructured data. +To connect to the service, you will need an access key and a secret key. These can be found in the [Data Center Designer](https://dcd.ionos.com/), by selecting **Manager resources** > **Object Storage Key Manager**. -Used when creating buckets only. -Properties: +Here is an example of a configuration. First, run `rclone config`. This will walk you through an interactive setup process. Type `n` to add the new remote, and then enter a name: -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: AWS -- Type: string -- Required: false -- Examples: - - "" - - Empty for US Region, Northern Virginia, or Pacific Northwest - - "us-east-2" - - US East (Ohio) Region - - "us-west-1" - - US West (Northern California) Region - - "us-west-2" - - US West (Oregon) Region - - "ca-central-1" - - Canada (Central) Region - - "eu-west-1" - - EU (Ireland) Region - - "eu-west-2" - - EU (London) Region - - "eu-west-3" - - EU (Paris) Region - - "eu-north-1" - - EU (Stockholm) Region - - "eu-south-1" - - EU (Milan) Region - - "EU" - - EU Region - - "ap-southeast-1" - - Asia Pacific (Singapore) Region - - "ap-southeast-2" - - Asia Pacific (Sydney) Region - - "ap-northeast-1" - - Asia Pacific (Tokyo) Region - - "ap-northeast-2" - - Asia Pacific (Seoul) Region - - "ap-northeast-3" - - Asia Pacific (Osaka-Local) Region - - "ap-south-1" - - Asia Pacific (Mumbai) Region - - "ap-east-1" - - Asia Pacific (Hong Kong) Region - - "sa-east-1" - - South America (Sao Paulo) Region - - "me-south-1" - - Middle East (Bahrain) Region - - "af-south-1" - - Africa (Cape Town) Region - - "cn-north-1" - - China (Beijing) Region - - "cn-northwest-1" - - China (Ningxia) Region - - "us-gov-east-1" - - AWS GovCloud (US-East) Region - - "us-gov-west-1" - - AWS GovCloud (US) Region +``` +Enter name for new remote. +name> ionos-fra +``` -#### --s3-location-constraint +Type `s3` to choose the connection type: +``` +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] +XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi + \ (s3) +[snip] +Storage> s3 +``` -Location constraint - must match endpoint. +Type `IONOS`: +``` +Option provider. +Choose your S3 provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. +[snip] +XX / IONOS Cloud + \ (IONOS) +[snip] +provider> IONOS +``` -Used when creating buckets only. +Press Enter to choose the default option `Enter AWS credentials in the next step`: +``` +Option env_auth. +Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). +Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) +env_auth> +``` -Properties: +Enter your Access Key and Secret key. These can be retrieved in the [Data Center Designer](https://dcd.ionos.com/), click on the menu “Manager resources” / "Object Storage Key Manager". +``` +Option access_key_id. +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +access_key_id> YOUR_ACCESS_KEY -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: ChinaMobile -- Type: string -- Required: false -- Examples: - - "wuxi1" - - East China (Suzhou) - - "jinan1" - - East China (Jinan) - - "ningbo1" - - East China (Hangzhou) - - "shanghai1" - - East China (Shanghai-1) - - "zhengzhou1" - - Central China (Zhengzhou) - - "hunan1" - - Central China (Changsha-1) - - "zhuzhou1" - - Central China (Changsha-2) - - "guangzhou1" - - South China (Guangzhou-2) - - "dongguan1" - - South China (Guangzhou-3) - - "beijing1" - - North China (Beijing-1) - - "beijing2" - - North China (Beijing-2) - - "beijing4" - - North China (Beijing-3) - - "huhehaote1" - - North China (Huhehaote) - - "chengdu1" - - Southwest China (Chengdu) - - "chongqing1" - - Southwest China (Chongqing) - - "guiyang1" - - Southwest China (Guiyang) - - "xian1" - - Nouthwest China (Xian) - - "yunnan" - - Yunnan China (Kunming) - - "yunnan2" - - Yunnan China (Kunming-2) - - "tianjin1" - - Tianjin China (Tianjin) - - "jilin1" - - Jilin China (Changchun) - - "hubei1" - - Hubei China (Xiangyan) - - "jiangxi1" - - Jiangxi China (Nanchang) - - "gansu1" - - Gansu China (Lanzhou) - - "shanxi1" - - Shanxi China (Taiyuan) - - "liaoning1" - - Liaoning China (Shenyang) - - "hebei1" - - Hebei China (Shijiazhuang) - - "fujian1" - - Fujian China (Xiamen) - - "guangxi1" - - Guangxi China (Nanning) - - "anhui1" - - Anhui China (Huainan) +Option secret_access_key. +AWS Secret Access Key (password). +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +secret_access_key> YOUR_SECRET_KEY +``` -#### --s3-location-constraint +Choose the region where your bucket is located: +``` +Option region. +Region where your bucket will be created and your data stored. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / Frankfurt, Germany + \ (de) + 2 / Berlin, Germany + \ (eu-central-2) + 3 / Logrono, Spain + \ (eu-south-2) +region> 2 +``` -Location constraint - must match endpoint. +Choose the endpoint from the same region: +``` +Option endpoint. +Endpoint for IONOS S3 Object Storage. +Specify the endpoint from the same region. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / Frankfurt, Germany + \ (s3-eu-central-1.ionoscloud.com) + 2 / Berlin, Germany + \ (s3-eu-central-2.ionoscloud.com) + 3 / Logrono, Spain + \ (s3-eu-south-2.ionoscloud.com) +endpoint> 1 +``` -Used when creating buckets only. +Press Enter to choose the default option or choose the desired ACL setting: +``` +Option acl. +Canned ACL used when creating buckets and storing or copying objects. +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + / Owner gets FULL_CONTROL. +[snip] +acl> +``` -Properties: +Press Enter to skip the advanced config: +``` +Edit advanced config? +y) Yes +n) No (default) +y/n> +``` -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: ArvanCloud -- Type: string -- Required: false -- Examples: - - "ir-thr-at1" - - Tehran Iran (Simin) - - "ir-tbz-sh1" - - Tabriz Iran (Shahriar) +Press Enter to save the configuration, and then `q` to quit the configuration process: +``` +Configuration complete. +Options: +- type: s3 +- provider: IONOS +- access_key_id: YOUR_ACCESS_KEY +- secret_access_key: YOUR_SECRET_KEY +- endpoint: s3-eu-central-1.ionoscloud.com +Keep this "ionos-fra" remote? +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -#### --s3-location-constraint +Done! Now you can try some commands (for macOS, use `./rclone` instead of `rclone`). -Location constraint - must match endpoint when using IBM Cloud Public. +1) Create a bucket (the name must be unique within the whole IONOS S3) +``` +rclone mkdir ionos-fra:my-bucket +``` +2) List available buckets +``` +rclone lsd ionos-fra: +``` +4) Copy a file from local to remote +``` +rclone copy /Users/file.txt ionos-fra:my-bucket +``` +3) List contents of a bucket +``` +rclone ls ionos-fra:my-bucket +``` +5) Copy a file from remote to local +``` +rclone copy ionos-fra:my-bucket/file.txt +``` -For on-prem COS, do not make a selection from this list, hit enter. +### Minio -Properties: +[Minio](https://minio.io/) is an object storage server built for cloud application developers and devops. -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: IBMCOS -- Type: string -- Required: false -- Examples: - - "us-standard" - - US Cross Region Standard - - "us-vault" - - US Cross Region Vault - - "us-cold" - - US Cross Region Cold - - "us-flex" - - US Cross Region Flex - - "us-east-standard" - - US East Region Standard - - "us-east-vault" - - US East Region Vault - - "us-east-cold" - - US East Region Cold - - "us-east-flex" - - US East Region Flex - - "us-south-standard" - - US South Region Standard - - "us-south-vault" - - US South Region Vault - - "us-south-cold" - - US South Region Cold - - "us-south-flex" - - US South Region Flex - - "eu-standard" - - EU Cross Region Standard - - "eu-vault" - - EU Cross Region Vault - - "eu-cold" - - EU Cross Region Cold - - "eu-flex" - - EU Cross Region Flex - - "eu-gb-standard" - - Great Britain Standard - - "eu-gb-vault" - - Great Britain Vault - - "eu-gb-cold" - - Great Britain Cold - - "eu-gb-flex" - - Great Britain Flex - - "ap-standard" - - APAC Standard - - "ap-vault" - - APAC Vault - - "ap-cold" - - APAC Cold - - "ap-flex" - - APAC Flex - - "mel01-standard" - - Melbourne Standard - - "mel01-vault" - - Melbourne Vault - - "mel01-cold" - - Melbourne Cold - - "mel01-flex" - - Melbourne Flex - - "tor01-standard" - - Toronto Standard - - "tor01-vault" - - Toronto Vault - - "tor01-cold" - - Toronto Cold - - "tor01-flex" - - Toronto Flex +It is very easy to install and provides an S3 compatible server which can be used by rclone. -#### --s3-location-constraint +To use it, install Minio following the instructions [here](https://docs.minio.io/docs/minio-quickstart-guide). -Location constraint - the location where your bucket will be located and your data stored. +When it configures itself Minio will print something like this +``` +Endpoint: http://192.168.1.106:9000 http://172.23.0.1:9000 +AccessKey: USWUXHGYZQYFYFFIT3RE +SecretKey: MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 +Region: us-east-1 +SQS ARNs: arn:minio:sqs:us-east-1:1:redis arn:minio:sqs:us-east-1:2:redis -Properties: +Browser Access: + http://192.168.1.106:9000 http://172.23.0.1:9000 -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: RackCorp -- Type: string -- Required: false -- Examples: - - "global" - - Global CDN Region - - "au" - - Australia (All locations) - - "au-nsw" - - NSW (Australia) Region - - "au-qld" - - QLD (Australia) Region - - "au-vic" - - VIC (Australia) Region - - "au-wa" - - Perth (Australia) Region - - "ph" - - Manila (Philippines) Region - - "th" - - Bangkok (Thailand) Region - - "hk" - - HK (Hong Kong) Region - - "mn" - - Ulaanbaatar (Mongolia) Region - - "kg" - - Bishkek (Kyrgyzstan) Region - - "id" - - Jakarta (Indonesia) Region - - "jp" - - Tokyo (Japan) Region - - "sg" - - SG (Singapore) Region - - "de" - - Frankfurt (Germany) Region - - "us" - - USA (AnyCast) Region - - "us-east-1" - - New York (USA) Region - - "us-west-1" - - Freemont (USA) Region - - "nz" - - Auckland (New Zealand) Region +Command-line Access: https://docs.minio.io/docs/minio-client-quickstart-guide + $ mc config host add myminio http://192.168.1.106:9000 USWUXHGYZQYFYFFIT3RE MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 -#### --s3-location-constraint +Object API (Amazon S3 compatible): + Go: https://docs.minio.io/docs/golang-client-quickstart-guide + Java: https://docs.minio.io/docs/java-client-quickstart-guide + Python: https://docs.minio.io/docs/python-client-quickstart-guide + JavaScript: https://docs.minio.io/docs/javascript-client-quickstart-guide + .NET: https://docs.minio.io/docs/dotnet-client-quickstart-guide -Location constraint - must be set to match the Region. +Drive Capacity: 26 GiB Free, 165 GiB Total +``` -Used when creating buckets only. +These details need to go into `rclone config` like this. Note that it +is important to put the region in as stated above. -Properties: +``` +env_auth> 1 +access_key_id> USWUXHGYZQYFYFFIT3RE +secret_access_key> MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 +region> us-east-1 +endpoint> http://192.168.1.106:9000 +location_constraint> +server_side_encryption> +``` -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: Qiniu -- Type: string -- Required: false -- Examples: - - "cn-east-1" - - East China Region 1 - - "cn-east-2" - - East China Region 2 - - "cn-north-1" - - North China Region 1 - - "cn-south-1" - - South China Region 1 - - "us-north-1" - - North America Region 1 - - "ap-southeast-1" - - Southeast Asia Region 1 - - "ap-northeast-1" - - Northeast Asia Region 1 +Which makes the config file look like this -#### --s3-location-constraint +``` +[minio] +type = s3 +provider = Minio +env_auth = false +access_key_id = USWUXHGYZQYFYFFIT3RE +secret_access_key = MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 +region = us-east-1 +endpoint = http://192.168.1.106:9000 +location_constraint = +server_side_encryption = +``` -Location constraint - must be set to match the Region. +So once set up, for example, to copy files into a bucket -Leave blank if not sure. Used when creating buckets only. +``` +rclone copy /path/to/files minio:bucket +``` -Properties: +### Qiniu Cloud Object Storage (Kodo) {#qiniu} -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: !AWS,Alibaba,ArvanCloud,HuaweiOBS,ChinaMobile,Cloudflare,IBMCOS,IDrive,IONOS,Leviia,Liara,Qiniu,RackCorp,Scaleway,StackPath,Storj,TencentCOS,Petabox -- Type: string -- Required: false +[Qiniu Cloud Object Storage (Kodo)](https://www.qiniu.com/en/products/kodo), a completely independent-researched core technology which is proven by repeated customer experience has occupied absolute leading market leader position. Kodo can be widely applied to mass data management. -#### --s3-acl +To configure access to Qiniu Kodo, follow the steps below: -Canned ACL used when creating buckets and storing or copying objects. +1. Run `rclone config` and select `n` for a new remote. -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. +``` +rclone config +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +``` -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +2. Give the name of the configuration. For example, name it 'qiniu'. -Note that this ACL is applied when server-side copying objects as S3 -doesn't copy the ACL from the source but rather writes a fresh one. +``` +name> qiniu +``` -If the acl is an empty string then no X-Amz-Acl: header is added and -the default (private) will be used. +3. Select `s3` storage. +``` +Choose a number from below, or type in your own value + 1 / 1Fichier + \ (fichier) + 2 / Akamai NetStorage + \ (netstorage) + 3 / Alias for an existing remote + \ (alias) + 4 / Amazon Drive + \ (amazon cloud drive) + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi + \ (s3) +[snip] +Storage> s3 +``` -Properties: +4. Select `Qiniu` provider. +``` +Choose a number from below, or type in your own value +1 / Amazon Web Services (AWS) S3 + \ "AWS" +[snip] +22 / Qiniu Object Storage (Kodo) + \ (Qiniu) +[snip] +provider> Qiniu +``` -- Config: acl -- Env Var: RCLONE_S3_ACL -- Provider: !Storj,Synology,Cloudflare -- Type: string -- Required: false -- Examples: - - "default" - - Owner gets Full_CONTROL. - - No one else has access rights (default). - - "private" - - Owner gets FULL_CONTROL. - - No one else has access rights (default). - - "public-read" - - Owner gets FULL_CONTROL. - - The AllUsers group gets READ access. - - "public-read-write" - - Owner gets FULL_CONTROL. - - The AllUsers group gets READ and WRITE access. - - Granting this on a bucket is generally not recommended. - - "authenticated-read" - - Owner gets FULL_CONTROL. - - The AuthenticatedUsers group gets READ access. - - "bucket-owner-read" - - Object owner gets FULL_CONTROL. - - Bucket owner gets READ access. - - If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. - - "bucket-owner-full-control" - - Both the object owner and the bucket owner get FULL_CONTROL over the object. - - If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. - - "private" - - Owner gets FULL_CONTROL. - - No one else has access rights (default). - - This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise COS. - - "public-read" - - Owner gets FULL_CONTROL. - - The AllUsers group gets READ access. - - This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise IBM COS. - - "public-read-write" - - Owner gets FULL_CONTROL. - - The AllUsers group gets READ and WRITE access. - - This acl is available on IBM Cloud (Infra), On-Premise IBM COS. - - "authenticated-read" - - Owner gets FULL_CONTROL. - - The AuthenticatedUsers group gets READ access. - - Not supported on Buckets. - - This acl is available on IBM Cloud (Infra) and On-Premise IBM COS. +5. Enter your SecretId and SecretKey of Qiniu Kodo. -#### --s3-server-side-encryption +``` +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). +Only applies if access_key_id and secret_access_key is blank. +Enter a boolean value (true or false). Press Enter for the default ("false"). +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. +Enter a string value. Press Enter for the default (""). +access_key_id> AKIDxxxxxxxxxx +AWS Secret Access Key (password) +Leave blank for anonymous access or runtime credentials. +Enter a string value. Press Enter for the default (""). +secret_access_key> xxxxxxxxxxx +``` -The server-side encryption algorithm used when storing this object in S3. +6. Select endpoint for Qiniu Kodo. This is the standard endpoint for different region. -Properties: +``` + / The default endpoint - a good choice if you are unsure. + 1 | East China Region 1. + | Needs location constraint cn-east-1. + \ (cn-east-1) + / East China Region 2. + 2 | Needs location constraint cn-east-2. + \ (cn-east-2) + / North China Region 1. + 3 | Needs location constraint cn-north-1. + \ (cn-north-1) + / South China Region 1. + 4 | Needs location constraint cn-south-1. + \ (cn-south-1) + / North America Region. + 5 | Needs location constraint us-north-1. + \ (us-north-1) + / Southeast Asia Region 1. + 6 | Needs location constraint ap-southeast-1. + \ (ap-southeast-1) + / Northeast Asia Region 1. + 7 | Needs location constraint ap-northeast-1. + \ (ap-northeast-1) +[snip] +endpoint> 1 -- Config: server_side_encryption -- Env Var: RCLONE_S3_SERVER_SIDE_ENCRYPTION -- Provider: AWS,Ceph,ChinaMobile,Minio -- Type: string -- Required: false -- Examples: - - "" - - None - - "AES256" - - AES256 - - "aws:kms" - - aws:kms +Option endpoint. +Endpoint for Qiniu Object Storage. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / East China Endpoint 1 + \ (s3-cn-east-1.qiniucs.com) + 2 / East China Endpoint 2 + \ (s3-cn-east-2.qiniucs.com) + 3 / North China Endpoint 1 + \ (s3-cn-north-1.qiniucs.com) + 4 / South China Endpoint 1 + \ (s3-cn-south-1.qiniucs.com) + 5 / North America Endpoint 1 + \ (s3-us-north-1.qiniucs.com) + 6 / Southeast Asia Endpoint 1 + \ (s3-ap-southeast-1.qiniucs.com) + 7 / Northeast Asia Endpoint 1 + \ (s3-ap-northeast-1.qiniucs.com) +endpoint> 1 -#### --s3-sse-kms-key-id +Option location_constraint. +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. +Press Enter to leave empty. + 1 / East China Region 1 + \ (cn-east-1) + 2 / East China Region 2 + \ (cn-east-2) + 3 / North China Region 1 + \ (cn-north-1) + 4 / South China Region 1 + \ (cn-south-1) + 5 / North America Region 1 + \ (us-north-1) + 6 / Southeast Asia Region 1 + \ (ap-southeast-1) + 7 / Northeast Asia Region 1 + \ (ap-northeast-1) +location_constraint> 1 +``` -If using KMS ID you must provide the ARN of Key. +7. Choose acl and storage class. -Properties: +``` +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + / Owner gets FULL_CONTROL. + 2 | The AllUsers group gets READ access. + \ (public-read) +[snip] +acl> 2 +The storage class to use when storing new objects in Tencent COS. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 1 / Standard storage class + \ (STANDARD) + 2 / Infrequent access storage mode + \ (LINE) + 3 / Archive storage mode + \ (GLACIER) + 4 / Deep archive storage mode + \ (DEEP_ARCHIVE) +[snip] +storage_class> 1 +Edit advanced config? (y/n) +y) Yes +n) No (default) +y/n> n +Remote config +-------------------- +[qiniu] +- type: s3 +- provider: Qiniu +- access_key_id: xxx +- secret_access_key: xxx +- region: cn-east-1 +- endpoint: s3-cn-east-1.qiniucs.com +- location_constraint: cn-east-1 +- acl: public-read +- storage_class: STANDARD +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +Current remotes: -- Config: sse_kms_key_id -- Env Var: RCLONE_S3_SSE_KMS_KEY_ID -- Provider: AWS,Ceph,Minio -- Type: string -- Required: false -- Examples: - - "" - - None - - "arn:aws:kms:us-east-1:*" - - arn:aws:kms:* +Name Type +==== ==== +qiniu s3 +``` -#### --s3-storage-class +### RackCorp {#RackCorp} -The storage class to use when storing new objects in S3. +[RackCorp Object Storage](https://www.rackcorp.com/storage/s3storage) is an S3 compatible object storage platform from your friendly cloud provider RackCorp. +The service is fast, reliable, well priced and located in many strategic locations unserviced by others, to ensure you can maintain data sovereignty. -Properties: +Before you can use RackCorp Object Storage, you'll need to "[sign up](https://www.rackcorp.com/signup)" for an account on our "[portal](https://portal.rackcorp.com)". +Next you can create an `access key`, a `secret key` and `buckets`, in your location of choice with ease. +These details are required for the next steps of configuration, when `rclone config` asks for your `access_key_id` and `secret_access_key`. -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: AWS -- Type: string -- Required: false -- Examples: - - "" - - Default - - "STANDARD" - - Standard storage class - - "REDUCED_REDUNDANCY" - - Reduced redundancy storage class - - "STANDARD_IA" - - Standard Infrequent Access storage class - - "ONEZONE_IA" - - One Zone Infrequent Access storage class - - "GLACIER" - - Glacier storage class - - "DEEP_ARCHIVE" - - Glacier Deep Archive storage class - - "INTELLIGENT_TIERING" - - Intelligent-Tiering storage class - - "GLACIER_IR" - - Glacier Instant Retrieval storage class +Your config should end up looking a bit like this: -#### --s3-storage-class +``` +[RCS3-demo-config] +type = s3 +provider = RackCorp +env_auth = true +access_key_id = YOURACCESSKEY +secret_access_key = YOURSECRETACCESSKEY +region = au-nsw +endpoint = s3.rackcorp.com +location_constraint = au-nsw +``` -The storage class to use when storing new objects in OSS. +### Rclone Serve S3 {#rclone} -Properties: +Rclone can serve any remote over the S3 protocol. For details see the +[rclone serve s3](https://rclone.org/commands/rclone_serve_http/) documentation. -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: Alibaba -- Type: string -- Required: false -- Examples: - - "" - - Default - - "STANDARD" - - Standard storage class - - "GLACIER" - - Archive storage mode - - "STANDARD_IA" - - Infrequent access storage mode +For example, to serve `remote:path` over s3, run the server like this: -#### --s3-storage-class +``` +rclone serve s3 --auth-key ACCESS_KEY_ID,SECRET_ACCESS_KEY remote:path +``` -The storage class to use when storing new objects in ChinaMobile. +This will be compatible with an rclone remote which is defined like this: -Properties: +``` +[serves3] +type = s3 +provider = Rclone +endpoint = http://127.0.0.1:8080/ +access_key_id = ACCESS_KEY_ID +secret_access_key = SECRET_ACCESS_KEY +use_multipart_uploads = false +``` -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: ChinaMobile -- Type: string -- Required: false -- Examples: - - "" - - Default - - "STANDARD" - - Standard storage class - - "GLACIER" - - Archive storage mode - - "STANDARD_IA" - - Infrequent access storage mode +Note that setting `disable_multipart_uploads = true` is to work around +[a bug](https://rclone.org/commands/rclone_serve_http/#bugs) which will be fixed in due course. -#### --s3-storage-class +### Scaleway -The storage class to use when storing new objects in Liara +[Scaleway](https://www.scaleway.com/object-storage/) The Object Storage platform allows you to store anything from backups, logs and web assets to documents and photos. +Files can be dropped from the Scaleway console or transferred through our API and CLI or using any S3-compatible tool. -Properties: +Scaleway provides an S3 interface which can be configured for use with rclone like this: -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: Liara -- Type: string -- Required: false -- Examples: - - "STANDARD" - - Standard storage class +``` +[scaleway] +type = s3 +provider = Scaleway +env_auth = false +endpoint = s3.nl-ams.scw.cloud +access_key_id = SCWXXXXXXXXXXXXXX +secret_access_key = 1111111-2222-3333-44444-55555555555555 +region = nl-ams +location_constraint = +acl = private +server_side_encryption = +storage_class = +``` -#### --s3-storage-class +[C14 Cold Storage](https://www.online.net/en/storage/c14-cold-storage) is the low-cost S3 Glacier alternative from Scaleway and it works the same way as on S3 by accepting the "GLACIER" `storage_class`. +So you can configure your remote with the `storage_class = GLACIER` option to upload directly to C14. Don't forget that in this state you can't read files back after, you will need to restore them to "STANDARD" storage_class first before being able to read them (see "restore" section above) -The storage class to use when storing new objects in ArvanCloud. +### Seagate Lyve Cloud {#lyve} -Properties: +[Seagate Lyve Cloud](https://www.seagate.com/gb/en/services/cloud/storage/) is an S3 +compatible object storage platform from [Seagate](https://seagate.com/) intended for enterprise use. -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: ArvanCloud -- Type: string -- Required: false -- Examples: - - "STANDARD" - - Standard storage class +Here is a config run through for a remote called `remote` - you may +choose a different name of course. Note that to create an access key +and secret key you will need to create a service account first. -#### --s3-storage-class +``` +$ rclone config +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +``` -The storage class to use when storing new objects in Tencent COS. +Choose `s3` backend -Properties: +``` +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] +XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS + \ (s3) +[snip] +Storage> s3 +``` -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: TencentCOS -- Type: string -- Required: false -- Examples: - - "" - - Default - - "STANDARD" - - Standard storage class - - "ARCHIVE" - - Archive storage mode - - "STANDARD_IA" - - Infrequent access storage mode +Choose `LyveCloud` as S3 provider -#### --s3-storage-class +``` +Choose your S3 provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. +[snip] +XX / Seagate Lyve Cloud + \ (LyveCloud) +[snip] +provider> LyveCloud +``` -The storage class to use when storing new objects in S3. +Take the default (just press enter) to enter access key and secret in the config file. -Properties: +``` +Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). +Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) +env_auth> +``` -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: Scaleway -- Type: string -- Required: false -- Examples: - - "" - - Default. - - "STANDARD" - - The Standard class for any upload. - - Suitable for on-demand content like streaming or CDN. - - Available in all regions. - - "GLACIER" - - Archived storage. - - Prices are lower, but it needs to be restored first to be accessed. - - Available in FR-PAR and NL-AMS regions. - - "ONEZONE_IA" - - One Zone - Infrequent Access. - - A good choice for storing secondary backup copies or easily re-creatable data. - - Available in the FR-PAR region only. +``` +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +access_key_id> XXX +``` -#### --s3-storage-class +``` +AWS Secret Access Key (password). +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +secret_access_key> YYY +``` -The storage class to use when storing new objects in Qiniu. +Leave region blank -Properties: +``` +Region to connect to. +Leave blank if you are using an S3 clone and you don't have a region. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + / Use this if unsure. + 1 | Will use v4 signatures and an empty region. + \ () + / Use this only if v4 signatures don't work. + 2 | E.g. pre Jewel/v10 CEPH. + \ (other-v2-signature) +region> +``` -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: Qiniu -- Type: string -- Required: false -- Examples: - - "STANDARD" - - Standard storage class - - "LINE" - - Infrequent access storage mode - - "GLACIER" - - Archive storage mode - - "DEEP_ARCHIVE" - - Deep archive storage mode +Choose an endpoint from the list -### Advanced options +``` +Endpoint for S3 API. +Required when using an S3 clone. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / Seagate Lyve Cloud US East 1 (Virginia) + \ (s3.us-east-1.lyvecloud.seagate.com) + 2 / Seagate Lyve Cloud US West 1 (California) + \ (s3.us-west-1.lyvecloud.seagate.com) + 3 / Seagate Lyve Cloud AP Southeast 1 (Singapore) + \ (s3.ap-southeast-1.lyvecloud.seagate.com) +endpoint> 1 +``` -Here are the Advanced options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, China Mobile, Cloudflare, GCS, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Leviia, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi). +Leave location constraint blank -#### --s3-bucket-acl +``` +Location constraint - must be set to match the Region. +Leave blank if not sure. Used when creating buckets only. +Enter a value. Press Enter to leave empty. +location_constraint> +``` -Canned ACL used when creating buckets. +Choose default ACL (`private`). +``` +Canned ACL used when creating buckets and storing or copying objects. +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) +[snip] +acl> +``` -Note that this ACL is applied when only when creating buckets. If it -isn't set then "acl" is used instead. - -If the "acl" and "bucket_acl" are empty strings then no X-Amz-Acl: -header is added and the default (private) will be used. - - -Properties: +And the config file should end up looking like this: -- Config: bucket_acl -- Env Var: RCLONE_S3_BUCKET_ACL -- Type: string -- Required: false -- Examples: - - "private" - - Owner gets FULL_CONTROL. - - No one else has access rights (default). - - "public-read" - - Owner gets FULL_CONTROL. - - The AllUsers group gets READ access. - - "public-read-write" - - Owner gets FULL_CONTROL. - - The AllUsers group gets READ and WRITE access. - - Granting this on a bucket is generally not recommended. - - "authenticated-read" - - Owner gets FULL_CONTROL. - - The AuthenticatedUsers group gets READ access. +``` +[remote] +type = s3 +provider = LyveCloud +access_key_id = XXX +secret_access_key = YYY +endpoint = s3.us-east-1.lyvecloud.seagate.com +``` -#### --s3-requester-pays +### SeaweedFS -Enables requester pays option when interacting with S3 bucket. +[SeaweedFS](https://github.com/chrislusf/seaweedfs/) is a distributed storage system for +blobs, objects, files, and data lake, with O(1) disk seek and a scalable file metadata store. +It has an S3 compatible object storage interface. SeaweedFS can also act as a +[gateway to remote S3 compatible object store](https://github.com/chrislusf/seaweedfs/wiki/Gateway-to-Remote-Object-Storage) +to cache data and metadata with asynchronous write back, for fast local speed and minimize access cost. -Properties: +Assuming the SeaweedFS are configured with `weed shell` as such: +``` +> s3.bucket.create -name foo +> s3.configure -access_key=any -secret_key=any -buckets=foo -user=me -actions=Read,Write,List,Tagging,Admin -apply +{ + "identities": [ + { + "name": "me", + "credentials": [ + { + "accessKey": "any", + "secretKey": "any" + } + ], + "actions": [ + "Read:foo", + "Write:foo", + "List:foo", + "Tagging:foo", + "Admin:foo" + ] + } + ] +} +``` -- Config: requester_pays -- Env Var: RCLONE_S3_REQUESTER_PAYS -- Provider: AWS -- Type: bool -- Default: false +To use rclone with SeaweedFS, above configuration should end up with something like this in +your config: -#### --s3-sse-customer-algorithm +``` +[seaweedfs_s3] +type = s3 +provider = SeaweedFS +access_key_id = any +secret_access_key = any +endpoint = localhost:8333 +``` -If using SSE-C, the server-side encryption algorithm used when storing this object in S3. +So once set up, for example to copy files into a bucket -Properties: +``` +rclone copy /path/to/files seaweedfs_s3:foo +``` -- Config: sse_customer_algorithm -- Env Var: RCLONE_S3_SSE_CUSTOMER_ALGORITHM -- Provider: AWS,Ceph,ChinaMobile,Minio -- Type: string -- Required: false -- Examples: - - "" - - None - - "AES256" - - AES256 +### Wasabi -#### --s3-sse-customer-key +[Wasabi](https://wasabi.com) is a cloud-based object storage service for a +broad range of applications and use cases. Wasabi is designed for +individuals and organizations that require a high-performance, +reliable, and secure data storage infrastructure at minimal cost. -To use SSE-C you may provide the secret encryption key used to encrypt/decrypt your data. +Wasabi provides an S3 interface which can be configured for use with +rclone like this. -Alternatively you can provide --sse-customer-key-base64. +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +n/s> n +name> wasabi +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Minio, Liara) + \ "s3" +[snip] +Storage> s3 +Get AWS credentials from runtime (environment variables or EC2/ECS 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> YOURACCESSKEY +AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. +secret_access_key> YOURSECRETACCESSKEY +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" +[snip] +region> us-east-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> s3.wasabisys.com +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. + \ "" +[snip] +location_constraint> +Canned ACL used when creating buckets and/or storing objects in S3. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Choose a number from below, or type in your own value + 1 / Owner gets FULL_CONTROL. No one else has access rights (default). + \ "private" +[snip] +acl> +The server-side encryption algorithm used when storing this object in S3. +Choose a number from below, or type in your own value + 1 / None + \ "" + 2 / AES256 + \ "AES256" +server_side_encryption> +The storage class to use when storing objects in S3. +Choose a number from below, or type in your own value + 1 / Default + \ "" + 2 / Standard storage class + \ "STANDARD" + 3 / Reduced redundancy storage class + \ "REDUCED_REDUNDANCY" + 4 / Standard Infrequent Access storage class + \ "STANDARD_IA" +storage_class> +Remote config +-------------------- +[wasabi] +env_auth = false +access_key_id = YOURACCESSKEY +secret_access_key = YOURSECRETACCESSKEY +region = us-east-1 +endpoint = s3.wasabisys.com +location_constraint = +acl = +server_side_encryption = +storage_class = +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -Properties: +This will leave the config file looking like this. -- Config: sse_customer_key -- Env Var: RCLONE_S3_SSE_CUSTOMER_KEY -- Provider: AWS,Ceph,ChinaMobile,Minio -- Type: string -- Required: false -- Examples: - - "" - - None +``` +[wasabi] +type = s3 +provider = Wasabi +env_auth = false +access_key_id = YOURACCESSKEY +secret_access_key = YOURSECRETACCESSKEY +region = +endpoint = s3.wasabisys.com +location_constraint = +acl = +server_side_encryption = +storage_class = +``` -#### --s3-sse-customer-key-base64 +### Alibaba OSS {#alibaba-oss} -If using SSE-C you must provide the secret encryption key encoded in base64 format to encrypt/decrypt your data. +Here is an example of making an [Alibaba Cloud (Aliyun) OSS](https://www.alibabacloud.com/product/oss/) +configuration. First run: -Alternatively you can provide --sse-customer-key. + rclone config -Properties: +This will guide you through an interactive setup process. -- Config: sse_customer_key_base64 -- Env Var: RCLONE_S3_SSE_CUSTOMER_KEY_BASE64 -- Provider: AWS,Ceph,ChinaMobile,Minio -- Type: string -- Required: false -- Examples: - - "" - - None +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> oss +Type of storage to configure. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value +[snip] + 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Minio, and Tencent COS + \ "s3" +[snip] +Storage> s3 +Choose your S3 provider. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 1 / Amazon Web Services (AWS) S3 + \ "AWS" + 2 / Alibaba Cloud Object Storage System (OSS) formerly Aliyun + \ "Alibaba" + 3 / Ceph Object Storage + \ "Ceph" +[snip] +provider> Alibaba +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). +Only applies if access_key_id and secret_access_key is blank. +Enter a boolean value (true or false). Press Enter for the default ("false"). +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. +Enter a string value. Press Enter for the default (""). +access_key_id> accesskeyid +AWS Secret Access Key (password) +Leave blank for anonymous access or runtime credentials. +Enter a string value. Press Enter for the default (""). +secret_access_key> secretaccesskey +Endpoint for OSS API. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 1 / East China 1 (Hangzhou) + \ "oss-cn-hangzhou.aliyuncs.com" + 2 / East China 2 (Shanghai) + \ "oss-cn-shanghai.aliyuncs.com" + 3 / North China 1 (Qingdao) + \ "oss-cn-qingdao.aliyuncs.com" +[snip] +endpoint> 1 +Canned ACL used when creating buckets and storing or copying objects. -#### --s3-sse-customer-key-md5 +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 1 / Owner gets FULL_CONTROL. No one else has access rights (default). + \ "private" + 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access. + \ "public-read" + / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. +[snip] +acl> 1 +The storage class to use when storing new objects in OSS. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 1 / Default + \ "" + 2 / Standard storage class + \ "STANDARD" + 3 / Archive storage mode. + \ "GLACIER" + 4 / Infrequent access storage mode. + \ "STANDARD_IA" +storage_class> 1 +Edit advanced config? (y/n) +y) Yes +n) No +y/n> n +Remote config +-------------------- +[oss] +type = s3 +provider = Alibaba +env_auth = false +access_key_id = accesskeyid +secret_access_key = secretaccesskey +endpoint = oss-cn-hangzhou.aliyuncs.com +acl = private +storage_class = Standard +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -If using SSE-C you may provide the secret encryption key MD5 checksum (optional). +### China Mobile Ecloud Elastic Object Storage (EOS) {#china-mobile-ecloud-eos} -If you leave it blank, this is calculated automatically from the sse_customer_key provided. +Here is an example of making an [China Mobile Ecloud Elastic Object Storage (EOS)](https:///ecloud.10086.cn/home/product-introduction/eos/) +configuration. First run: + rclone config -Properties: +This will guide you through an interactive setup process. -- Config: sse_customer_key_md5 -- Env Var: RCLONE_S3_SSE_CUSTOMER_KEY_MD5 -- Provider: AWS,Ceph,ChinaMobile,Minio -- Type: string -- Required: false -- Examples: - - "" - - None +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> ChinaMobile +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. + ... + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS + \ (s3) + ... +Storage> s3 +Option provider. +Choose your S3 provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + ... + 4 / China Mobile Ecloud Elastic Object Storage (EOS) + \ (ChinaMobile) + ... +provider> ChinaMobile +Option env_auth. +Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). +Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) +env_auth> +Option access_key_id. +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +access_key_id> accesskeyid +Option secret_access_key. +AWS Secret Access Key (password). +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +secret_access_key> secretaccesskey +Option endpoint. +Endpoint for China Mobile Ecloud Elastic Object Storage (EOS) API. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + / The default endpoint - a good choice if you are unsure. + 1 | East China (Suzhou) + \ (eos-wuxi-1.cmecloud.cn) + 2 / East China (Jinan) + \ (eos-jinan-1.cmecloud.cn) + 3 / East China (Hangzhou) + \ (eos-ningbo-1.cmecloud.cn) + 4 / East China (Shanghai-1) + \ (eos-shanghai-1.cmecloud.cn) + 5 / Central China (Zhengzhou) + \ (eos-zhengzhou-1.cmecloud.cn) + 6 / Central China (Changsha-1) + \ (eos-hunan-1.cmecloud.cn) + 7 / Central China (Changsha-2) + \ (eos-zhuzhou-1.cmecloud.cn) + 8 / South China (Guangzhou-2) + \ (eos-guangzhou-1.cmecloud.cn) + 9 / South China (Guangzhou-3) + \ (eos-dongguan-1.cmecloud.cn) +10 / North China (Beijing-1) + \ (eos-beijing-1.cmecloud.cn) +11 / North China (Beijing-2) + \ (eos-beijing-2.cmecloud.cn) +12 / North China (Beijing-3) + \ (eos-beijing-4.cmecloud.cn) +13 / North China (Huhehaote) + \ (eos-huhehaote-1.cmecloud.cn) +14 / Southwest China (Chengdu) + \ (eos-chengdu-1.cmecloud.cn) +15 / Southwest China (Chongqing) + \ (eos-chongqing-1.cmecloud.cn) +16 / Southwest China (Guiyang) + \ (eos-guiyang-1.cmecloud.cn) +17 / Nouthwest China (Xian) + \ (eos-xian-1.cmecloud.cn) +18 / Yunnan China (Kunming) + \ (eos-yunnan.cmecloud.cn) +19 / Yunnan China (Kunming-2) + \ (eos-yunnan-2.cmecloud.cn) +20 / Tianjin China (Tianjin) + \ (eos-tianjin-1.cmecloud.cn) +21 / Jilin China (Changchun) + \ (eos-jilin-1.cmecloud.cn) +22 / Hubei China (Xiangyan) + \ (eos-hubei-1.cmecloud.cn) +23 / Jiangxi China (Nanchang) + \ (eos-jiangxi-1.cmecloud.cn) +24 / Gansu China (Lanzhou) + \ (eos-gansu-1.cmecloud.cn) +25 / Shanxi China (Taiyuan) + \ (eos-shanxi-1.cmecloud.cn) +26 / Liaoning China (Shenyang) + \ (eos-liaoning-1.cmecloud.cn) +27 / Hebei China (Shijiazhuang) + \ (eos-hebei-1.cmecloud.cn) +28 / Fujian China (Xiamen) + \ (eos-fujian-1.cmecloud.cn) +29 / Guangxi China (Nanning) + \ (eos-guangxi-1.cmecloud.cn) +30 / Anhui China (Huainan) + \ (eos-anhui-1.cmecloud.cn) +endpoint> 1 +Option location_constraint. +Location constraint - must match endpoint. +Used when creating buckets only. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / East China (Suzhou) + \ (wuxi1) + 2 / East China (Jinan) + \ (jinan1) + 3 / East China (Hangzhou) + \ (ningbo1) + 4 / East China (Shanghai-1) + \ (shanghai1) + 5 / Central China (Zhengzhou) + \ (zhengzhou1) + 6 / Central China (Changsha-1) + \ (hunan1) + 7 / Central China (Changsha-2) + \ (zhuzhou1) + 8 / South China (Guangzhou-2) + \ (guangzhou1) + 9 / South China (Guangzhou-3) + \ (dongguan1) +10 / North China (Beijing-1) + \ (beijing1) +11 / North China (Beijing-2) + \ (beijing2) +12 / North China (Beijing-3) + \ (beijing4) +13 / North China (Huhehaote) + \ (huhehaote1) +14 / Southwest China (Chengdu) + \ (chengdu1) +15 / Southwest China (Chongqing) + \ (chongqing1) +16 / Southwest China (Guiyang) + \ (guiyang1) +17 / Nouthwest China (Xian) + \ (xian1) +18 / Yunnan China (Kunming) + \ (yunnan) +19 / Yunnan China (Kunming-2) + \ (yunnan2) +20 / Tianjin China (Tianjin) + \ (tianjin1) +21 / Jilin China (Changchun) + \ (jilin1) +22 / Hubei China (Xiangyan) + \ (hubei1) +23 / Jiangxi China (Nanchang) + \ (jiangxi1) +24 / Gansu China (Lanzhou) + \ (gansu1) +25 / Shanxi China (Taiyuan) + \ (shanxi1) +26 / Liaoning China (Shenyang) + \ (liaoning1) +27 / Hebei China (Shijiazhuang) + \ (hebei1) +28 / Fujian China (Xiamen) + \ (fujian1) +29 / Guangxi China (Nanning) + \ (guangxi1) +30 / Anhui China (Huainan) + \ (anhui1) +location_constraint> 1 +Option acl. +Canned ACL used when creating buckets and storing or copying objects. +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + / Owner gets FULL_CONTROL. + 2 | The AllUsers group gets READ access. + \ (public-read) + / Owner gets FULL_CONTROL. + 3 | The AllUsers group gets READ and WRITE access. + | Granting this on a bucket is generally not recommended. + \ (public-read-write) + / Owner gets FULL_CONTROL. + 4 | The AuthenticatedUsers group gets READ access. + \ (authenticated-read) + / Object owner gets FULL_CONTROL. +acl> private +Option server_side_encryption. +The server-side encryption algorithm used when storing this object in S3. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / None + \ () + 2 / AES256 + \ (AES256) +server_side_encryption> +Option storage_class. +The storage class to use when storing new objects in ChinaMobile. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / Default + \ () + 2 / Standard storage class + \ (STANDARD) + 3 / Archive storage mode + \ (GLACIER) + 4 / Infrequent access storage mode + \ (STANDARD_IA) +storage_class> +Edit advanced config? +y) Yes +n) No (default) +y/n> n +-------------------- +[ChinaMobile] +type = s3 +provider = ChinaMobile +access_key_id = accesskeyid +secret_access_key = secretaccesskey +endpoint = eos-wuxi-1.cmecloud.cn +location_constraint = wuxi1 +acl = private +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` +### Leviia Cloud Object Storage {#leviia} -#### --s3-upload-cutoff +[Leviia Object Storage](https://www.leviia.com/object-storage/), backup and secure your data in a 100% French cloud, independent of GAFAM.. -Cutoff for switching to chunked upload. +To configure access to Leviia, follow the steps below: -Any files larger than this will be uploaded in chunks of chunk_size. -The minimum is 0 and the maximum is 5 GiB. +1. Run `rclone config` and select `n` for a new remote. -Properties: +``` +rclone config +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +``` -- Config: upload_cutoff -- Env Var: RCLONE_S3_UPLOAD_CUTOFF -- Type: SizeSuffix -- Default: 200Mi +2. Give the name of the configuration. For example, name it 'leviia'. -#### --s3-chunk-size +``` +name> leviia +``` -Chunk size to use for uploading. +3. Select `s3` storage. -When uploading files larger than upload_cutoff or files with unknown -size (e.g. from "rclone rcat" or uploaded with "rclone mount" or google -photos or google docs) they will be uploaded as multipart uploads -using this chunk size. +``` +Choose a number from below, or type in your own value + 1 / 1Fichier + \ (fichier) + 2 / Akamai NetStorage + \ (netstorage) + 3 / Alias for an existing remote + \ (alias) + 4 / Amazon Drive + \ (amazon cloud drive) + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi + \ (s3) +[snip] +Storage> s3 +``` -Note that "--s3-upload-concurrency" chunks of this size are buffered -in memory per transfer. +4. Select `Leviia` provider. +``` +Choose a number from below, or type in your own value +1 / Amazon Web Services (AWS) S3 + \ "AWS" +[snip] +15 / Leviia Object Storage + \ (Leviia) +[snip] +provider> Leviia +``` -If you are transferring large files over high-speed links and you have -enough memory, then increasing this will speed up the transfers. +5. Enter your SecretId and SecretKey of Leviia. -Rclone will automatically increase the chunk size when uploading a -large file of known size to stay below the 10,000 chunks limit. +``` +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). +Only applies if access_key_id and secret_access_key is blank. +Enter a boolean value (true or false). Press Enter for the default ("false"). +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. +Enter a string value. Press Enter for the default (""). +access_key_id> ZnIx.xxxxxxxxxxxxxxx +AWS Secret Access Key (password) +Leave blank for anonymous access or runtime credentials. +Enter a string value. Press Enter for the default (""). +secret_access_key> xxxxxxxxxxx +``` -Files of unknown size are uploaded with the configured -chunk_size. Since the default chunk size is 5 MiB and there can be at -most 10,000 chunks, this means that by default the maximum size of -a file you can stream upload is 48 GiB. If you wish to stream upload -larger files then you will need to increase chunk_size. +6. Select endpoint for Leviia. -Increasing the chunk size decreases the accuracy of the progress -statistics displayed with "-P" flag. Rclone treats chunk as sent when -it's buffered by the AWS SDK, when in fact it may still be uploading. -A bigger chunk size means a bigger AWS SDK buffer and progress -reporting more deviating from the truth. +``` + / The default endpoint + 1 | Leviia. + \ (s3.leviia.com) +[snip] +endpoint> 1 +``` +7. Choose acl. +``` +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + / Owner gets FULL_CONTROL. + 2 | The AllUsers group gets READ access. + \ (public-read) +[snip] +acl> 1 +Edit advanced config? (y/n) +y) Yes +n) No (default) +y/n> n +Remote config +-------------------- +[leviia] +- type: s3 +- provider: Leviia +- access_key_id: ZnIx.xxxxxxx +- secret_access_key: xxxxxxxx +- endpoint: s3.leviia.com +- acl: private +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +Current remotes: -Properties: +Name Type +==== ==== +leviia s3 +``` -- Config: chunk_size -- Env Var: RCLONE_S3_CHUNK_SIZE -- Type: SizeSuffix -- Default: 5Mi +### Liara {#liara-cloud} -#### --s3-max-upload-parts +Here is an example of making a [Liara Object Storage](https://liara.ir/landing/object-storage) +configuration. First run: -Maximum number of parts in a multipart upload. + rclone config -This option defines the maximum number of multipart chunks to use -when doing a multipart upload. +This will guide you through an interactive setup process. -This can be useful if a service does not support the AWS S3 -specification of 10,000 chunks. +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +n/s> n +name> Liara +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Liara, Minio) + \ "s3" +[snip] +Storage> s3 +Get AWS credentials from runtime (environment variables or EC2/ECS 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> YOURACCESSKEY +AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. +secret_access_key> YOURSECRETACCESSKEY +Region to connect to. +Choose a number from below, or type in your own value + / The default endpoint + 1 | US Region, Northern Virginia, or Pacific Northwest. + | Leave location constraint empty. + \ "us-east-1" +[snip] +region> +Endpoint for S3 API. +Leave blank if using Liara to use the default endpoint for the region. +Specify if using an S3 clone such as Ceph. +endpoint> storage.iran.liara.space +Canned ACL used when creating buckets and/or storing objects in S3. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Choose a number from below, or type in your own value + 1 / Owner gets FULL_CONTROL. No one else has access rights (default). + \ "private" +[snip] +acl> +The server-side encryption algorithm used when storing this object in S3. +Choose a number from below, or type in your own value + 1 / None + \ "" + 2 / AES256 + \ "AES256" +server_side_encryption> +The storage class to use when storing objects in S3. +Choose a number from below, or type in your own value + 1 / Default + \ "" + 2 / Standard storage class + \ "STANDARD" +storage_class> +Remote config +-------------------- +[Liara] +env_auth = false +access_key_id = YOURACCESSKEY +secret_access_key = YOURSECRETACCESSKEY +endpoint = storage.iran.liara.space +location_constraint = +acl = +server_side_encryption = +storage_class = +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -Rclone will automatically increase the chunk size when uploading a -large file of a known size to stay below this number of chunks limit. +This will leave the config file looking like this. +``` +[Liara] +type = s3 +provider = Liara +env_auth = false +access_key_id = YOURACCESSKEY +secret_access_key = YOURSECRETACCESSKEY +region = +endpoint = storage.iran.liara.space +location_constraint = +acl = +server_side_encryption = +storage_class = +``` -Properties: +### Linode {#linode} -- Config: max_upload_parts -- Env Var: RCLONE_S3_MAX_UPLOAD_PARTS -- Type: int -- Default: 10000 +Here is an example of making a [Linode Object Storage](https://www.linode.com/products/object-storage/) +configuration. First run: -#### --s3-copy-cutoff + rclone config -Cutoff for switching to multipart copy. +This will guide you through an interactive setup process. -Any files larger than this that need to be server-side copied will be -copied in chunks of this size. +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n -The minimum is 0 and the maximum is 5 GiB. +Enter name for new remote. +name> linode -Properties: +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] + X / Amazon S3 Compliant Storage Providers including AWS, ...Linode, ...and others + \ (s3) +[snip] +Storage> s3 -- Config: copy_cutoff -- Env Var: RCLONE_S3_COPY_CUTOFF -- Type: SizeSuffix -- Default: 4.656Gi +Option provider. +Choose your S3 provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. +[snip] +XX / Linode Object Storage + \ (Linode) +[snip] +provider> Linode -#### --s3-disable-checksum +Option env_auth. +Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). +Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) +env_auth> -Don't store MD5 checksum with object metadata. +Option access_key_id. +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +access_key_id> ACCESS_KEY -Normally rclone will calculate the MD5 checksum of the input before -uploading it so it can add it to metadata on the object. This is great -for data integrity checking but can cause long delays for large files -to start uploading. +Option secret_access_key. +AWS Secret Access Key (password). +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +secret_access_key> SECRET_ACCESS_KEY -Properties: +Option endpoint. +Endpoint for Linode Object Storage API. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / Atlanta, GA (USA), us-southeast-1 + \ (us-southeast-1.linodeobjects.com) + 2 / Chicago, IL (USA), us-ord-1 + \ (us-ord-1.linodeobjects.com) + 3 / Frankfurt (Germany), eu-central-1 + \ (eu-central-1.linodeobjects.com) + 4 / Milan (Italy), it-mil-1 + \ (it-mil-1.linodeobjects.com) + 5 / Newark, NJ (USA), us-east-1 + \ (us-east-1.linodeobjects.com) + 6 / Paris (France), fr-par-1 + \ (fr-par-1.linodeobjects.com) + 7 / Seattle, WA (USA), us-sea-1 + \ (us-sea-1.linodeobjects.com) + 8 / Singapore ap-south-1 + \ (ap-south-1.linodeobjects.com) + 9 / Stockholm (Sweden), se-sto-1 + \ (se-sto-1.linodeobjects.com) +10 / Washington, DC, (USA), us-iad-1 + \ (us-iad-1.linodeobjects.com) +endpoint> 3 -- Config: disable_checksum -- Env Var: RCLONE_S3_DISABLE_CHECKSUM -- Type: bool -- Default: false +Option acl. +Canned ACL used when creating buckets and storing or copying objects. +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. +If the acl is an empty string then no X-Amz-Acl: header is added and +the default (private) will be used. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) +[snip] +acl> -#### --s3-shared-credentials-file +Edit advanced config? +y) Yes +n) No (default) +y/n> n -Path to the shared credentials file. +Configuration complete. +Options: +- type: s3 +- provider: Linode +- access_key_id: ACCESS_KEY +- secret_access_key: SECRET_ACCESS_KEY +- endpoint: eu-central-1.linodeobjects.com +Keep this "linode" remote? +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -If env_auth = true then rclone can use a shared credentials file. +This will leave the config file looking like this. -If this variable is empty rclone will look for the -"AWS_SHARED_CREDENTIALS_FILE" env variable. If the env value is empty -it will default to the current user's home directory. +``` +[linode] +type = s3 +provider = Linode +access_key_id = ACCESS_KEY +secret_access_key = SECRET_ACCESS_KEY +endpoint = eu-central-1.linodeobjects.com +``` - Linux/OSX: "$HOME/.aws/credentials" - Windows: "%USERPROFILE%\.aws\credentials" +### ArvanCloud {#arvan-cloud} +[ArvanCloud](https://www.arvancloud.com/en/products/cloud-storage) ArvanCloud Object Storage goes beyond the limited traditional file storage. +It gives you access to backup and archived files and allows sharing. +Files like profile image in the app, images sent by users or scanned documents can be stored securely and easily in our Object Storage service. -Properties: +ArvanCloud provides an S3 interface which can be configured for use with +rclone like this. -- Config: shared_credentials_file -- Env Var: RCLONE_S3_SHARED_CREDENTIALS_FILE -- Type: string -- Required: false +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +n/s> n +name> ArvanCloud +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Liara, Minio) + \ "s3" +[snip] +Storage> s3 +Get AWS credentials from runtime (environment variables or EC2/ECS 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> YOURACCESSKEY +AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. +secret_access_key> YOURSECRETACCESSKEY +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" +[snip] +region> +Endpoint for S3 API. +Leave blank if using ArvanCloud to use the default endpoint for the region. +Specify if using an S3 clone such as Ceph. +endpoint> s3.arvanstorage.com +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 Iran-Tehran Region. + \ "" +[snip] +location_constraint> +Canned ACL used when creating buckets and/or storing objects in S3. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Choose a number from below, or type in your own value + 1 / Owner gets FULL_CONTROL. No one else has access rights (default). + \ "private" +[snip] +acl> +The server-side encryption algorithm used when storing this object in S3. +Choose a number from below, or type in your own value + 1 / None + \ "" + 2 / AES256 + \ "AES256" +server_side_encryption> +The storage class to use when storing objects in S3. +Choose a number from below, or type in your own value + 1 / Default + \ "" + 2 / Standard storage class + \ "STANDARD" +storage_class> +Remote config +-------------------- +[ArvanCloud] +env_auth = false +access_key_id = YOURACCESSKEY +secret_access_key = YOURSECRETACCESSKEY +region = ir-thr-at1 +endpoint = s3.arvanstorage.com +location_constraint = +acl = +server_side_encryption = +storage_class = +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -#### --s3-profile +This will leave the config file looking like this. -Profile to use in the shared credentials file. +``` +[ArvanCloud] +type = s3 +provider = ArvanCloud +env_auth = false +access_key_id = YOURACCESSKEY +secret_access_key = YOURSECRETACCESSKEY +region = +endpoint = s3.arvanstorage.com +location_constraint = +acl = +server_side_encryption = +storage_class = +``` -If env_auth = true then rclone can use a shared credentials file. This -variable controls which profile is used in that file. +### Tencent COS {#tencent-cos} -If empty it will default to the environment variable "AWS_PROFILE" or -"default" if that environment variable is also not set. +[Tencent Cloud Object Storage (COS)](https://intl.cloud.tencent.com/product/cos) is a distributed storage service offered by Tencent Cloud for unstructured data. It is secure, stable, massive, convenient, low-delay and low-cost. +To configure access to Tencent COS, follow the steps below: -Properties: +1. Run `rclone config` and select `n` for a new remote. -- Config: profile -- Env Var: RCLONE_S3_PROFILE -- Type: string -- Required: false +``` +rclone config +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +``` -#### --s3-session-token +2. Give the name of the configuration. For example, name it 'cos'. -An AWS session token. +``` +name> cos +``` -Properties: +3. Select `s3` storage. -- Config: session_token -- Env Var: RCLONE_S3_SESSION_TOKEN -- Type: string -- Required: false +``` +Choose a number from below, or type in your own value +1 / 1Fichier + \ "fichier" + 2 / Alias for an existing remote + \ "alias" + 3 / Amazon Drive + \ "amazon cloud drive" + 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Minio, and Tencent COS + \ "s3" +[snip] +Storage> s3 +``` -#### --s3-upload-concurrency +4. Select `TencentCOS` provider. +``` +Choose a number from below, or type in your own value +1 / Amazon Web Services (AWS) S3 + \ "AWS" +[snip] +11 / Tencent Cloud Object Storage (COS) + \ "TencentCOS" +[snip] +provider> TencentCOS +``` -Concurrency for multipart uploads. +5. Enter your SecretId and SecretKey of Tencent Cloud. -This is the number of chunks of the same file that are uploaded -concurrently. +``` +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). +Only applies if access_key_id and secret_access_key is blank. +Enter a boolean value (true or false). Press Enter for the default ("false"). +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. +Enter a string value. Press Enter for the default (""). +access_key_id> AKIDxxxxxxxxxx +AWS Secret Access Key (password) +Leave blank for anonymous access or runtime credentials. +Enter a string value. Press Enter for the default (""). +secret_access_key> xxxxxxxxxxx +``` -If you are uploading small numbers of large files over high-speed links -and these uploads do not fully utilize your bandwidth, then increasing -this may help to speed up the transfers. +6. Select endpoint for Tencent COS. This is the standard endpoint for different region. -Properties: +``` + 1 / Beijing Region. + \ "cos.ap-beijing.myqcloud.com" + 2 / Nanjing Region. + \ "cos.ap-nanjing.myqcloud.com" + 3 / Shanghai Region. + \ "cos.ap-shanghai.myqcloud.com" + 4 / Guangzhou Region. + \ "cos.ap-guangzhou.myqcloud.com" +[snip] +endpoint> 4 +``` -- Config: upload_concurrency -- Env Var: RCLONE_S3_UPLOAD_CONCURRENCY -- Type: int -- Default: 4 +7. Choose acl and storage class. -#### --s3-force-path-style +``` +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 1 / Owner gets Full_CONTROL. No one else has access rights (default). + \ "default" +[snip] +acl> 1 +The storage class to use when storing new objects in Tencent COS. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 1 / Default + \ "" +[snip] +storage_class> 1 +Edit advanced config? (y/n) +y) Yes +n) No (default) +y/n> n +Remote config +-------------------- +[cos] +type = s3 +provider = TencentCOS +env_auth = false +access_key_id = xxx +secret_access_key = xxx +endpoint = cos.ap-guangzhou.myqcloud.com +acl = default +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +Current remotes: -If true use path style access if false use virtual hosted style. +Name Type +==== ==== +cos s3 +``` -If this is true (the default) then rclone will use path style access, -if false then rclone will use virtual path style. See [the AWS S3 -docs](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro) -for more info. +### Netease NOS -Some providers (e.g. AWS, Aliyun OSS, Netease COS, or Tencent COS) require this set to -false - rclone will do this automatically based on the provider -setting. +For Netease NOS configure as per the configurator `rclone config` +setting the provider `Netease`. This will automatically set +`force_path_style = false` which is necessary for it to run properly. -Properties: +### Petabox -- Config: force_path_style -- Env Var: RCLONE_S3_FORCE_PATH_STYLE -- Type: bool -- Default: true +Here is an example of making a [Petabox](https://petabox.io/) +configuration. First run: -#### --s3-v2-auth +```bash +rclone config +``` -If true use v2 authentication. +This will guide you through an interactive setup process. -If this is false (the default) then rclone will use v4 authentication. -If it is set then rclone will use v2 authentication. +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +n/s> n -Use this only if v4 signatures don't work, e.g. pre Jewel/v10 CEPH. +Enter name for new remote. +name> My Petabox Storage -Properties: +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] +XX / Amazon S3 Compliant Storage Providers including AWS, ... + \ "s3" +[snip] +Storage> s3 -- Config: v2_auth -- Env Var: RCLONE_S3_V2_AUTH -- Type: bool -- Default: false +Option provider. +Choose your S3 provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. +[snip] +XX / Petabox Object Storage + \ (Petabox) +[snip] +provider> Petabox -#### --s3-use-accelerate-endpoint +Option env_auth. +Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). +Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) +env_auth> 1 -If true use the AWS S3 accelerated endpoint. +Option access_key_id. +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +access_key_id> YOUR_ACCESS_KEY_ID -See: [AWS S3 Transfer acceleration](https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration-examples.html) +Option secret_access_key. +AWS Secret Access Key (password). +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +secret_access_key> YOUR_SECRET_ACCESS_KEY -Properties: +Option region. +Region where your bucket will be created and your data stored. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / US East (N. Virginia) + \ (us-east-1) + 2 / Europe (Frankfurt) + \ (eu-central-1) + 3 / Asia Pacific (Singapore) + \ (ap-southeast-1) + 4 / Middle East (Bahrain) + \ (me-south-1) + 5 / South America (São Paulo) + \ (sa-east-1) +region> 1 -- Config: use_accelerate_endpoint -- Env Var: RCLONE_S3_USE_ACCELERATE_ENDPOINT -- Provider: AWS -- Type: bool -- Default: false +Option endpoint. +Endpoint for Petabox S3 Object Storage. +Specify the endpoint from the same region. +Choose a number from below, or type in your own value. + 1 / US East (N. Virginia) + \ (s3.petabox.io) + 2 / US East (N. Virginia) + \ (s3.us-east-1.petabox.io) + 3 / Europe (Frankfurt) + \ (s3.eu-central-1.petabox.io) + 4 / Asia Pacific (Singapore) + \ (s3.ap-southeast-1.petabox.io) + 5 / Middle East (Bahrain) + \ (s3.me-south-1.petabox.io) + 6 / South America (São Paulo) + \ (s3.sa-east-1.petabox.io) +endpoint> 1 -#### --s3-leave-parts-on-error +Option acl. +Canned ACL used when creating buckets and storing or copying objects. +This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. +If the acl is an empty string then no X-Amz-Acl: header is added and +the default (private) will be used. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + / Owner gets FULL_CONTROL. + 2 | The AllUsers group gets READ access. + \ (public-read) + / Owner gets FULL_CONTROL. + 3 | The AllUsers group gets READ and WRITE access. + | Granting this on a bucket is generally not recommended. + \ (public-read-write) + / Owner gets FULL_CONTROL. + 4 | The AuthenticatedUsers group gets READ access. + \ (authenticated-read) + / Object owner gets FULL_CONTROL. + 5 | Bucket owner gets READ access. + | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \ (bucket-owner-read) + / Both the object owner and the bucket owner get FULL_CONTROL over the object. + 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \ (bucket-owner-full-control) +acl> 1 -If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery. +Edit advanced config? +y) Yes +n) No (default) +y/n> No -It should be set to true for resuming uploads across different sessions. +Configuration complete. +Options: +- type: s3 +- provider: Petabox +- access_key_id: YOUR_ACCESS_KEY_ID +- secret_access_key: YOUR_SECRET_ACCESS_KEY +- region: us-east-1 +- endpoint: s3.petabox.io +Keep this "My Petabox Storage" remote? +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -WARNING: Storing parts of an incomplete multipart upload counts towards space usage on S3 and will add additional costs if not cleaned up. +This will leave the config file looking like this. +``` +[My Petabox Storage] +type = s3 +provider = Petabox +access_key_id = YOUR_ACCESS_KEY_ID +secret_access_key = YOUR_SECRET_ACCESS_KEY +region = us-east-1 +endpoint = s3.petabox.io +``` -Properties: +### Storj -- Config: leave_parts_on_error -- Env Var: RCLONE_S3_LEAVE_PARTS_ON_ERROR -- Provider: AWS -- Type: bool -- Default: false +Storj is a decentralized cloud storage which can be used through its +native protocol or an S3 compatible gateway. -#### --s3-list-chunk +The S3 compatible gateway is configured using `rclone config` with a +type of `s3` and with a provider name of `Storj`. Here is an example +run of the configurator. -Size of listing chunk (response list for each ListObject S3 request). +``` +Type of storage to configure. +Storage> s3 +Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). +Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) +env_auth> 1 +Option access_key_id. +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +access_key_id> XXXX (as shown when creating the access grant) +Option secret_access_key. +AWS Secret Access Key (password). +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +secret_access_key> XXXX (as shown when creating the access grant) +Option endpoint. +Endpoint of the Shared Gateway. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / EU1 Shared Gateway + \ (gateway.eu1.storjshare.io) + 2 / US1 Shared Gateway + \ (gateway.us1.storjshare.io) + 3 / Asia-Pacific Shared Gateway + \ (gateway.ap1.storjshare.io) +endpoint> 1 (as shown when creating the access grant) +Edit advanced config? +y) Yes +n) No (default) +y/n> n +``` -This option is also known as "MaxKeys", "max-items", or "page-size" from the AWS S3 specification. -Most services truncate the response list to 1000 objects even if requested more than that. -In AWS S3 this is a global maximum and cannot be changed, see [AWS S3](https://docs.aws.amazon.com/cli/latest/reference/s3/ls.html). -In Ceph, this can be increased with the "rgw list buckets max chunk" option. +Note that s3 credentials are generated when you [create an access +grant](https://docs.storj.io/dcs/api-reference/s3-compatible-gateway#usage). +#### Backend quirks -Properties: +- `--chunk-size` is forced to be 64 MiB or greater. This will use more + memory than the default of 5 MiB. +- Server side copy is disabled as it isn't currently supported in the + gateway. +- GetTier and SetTier are not supported. -- Config: list_chunk -- Env Var: RCLONE_S3_LIST_CHUNK -- Type: int -- Default: 1000 +#### Backend bugs -#### --s3-list-version +Due to [issue #39](https://github.com/storj/gateway-mt/issues/39) +uploading multipart files via the S3 gateway causes them to lose their +metadata. For rclone's purpose this means that the modification time +is not stored, nor is any MD5SUM (if one is available from the +source). -Version of ListObjects to use: 1,2 or 0 for auto. +This has the following consequences: -When S3 originally launched it only provided the ListObjects call to -enumerate objects in a bucket. +- Using `rclone rcat` will fail as the medatada doesn't match after upload +- Uploading files with `rclone mount` will fail for the same reason + - This can worked around by using `--vfs-cache-mode writes` or `--vfs-cache-mode full` or setting `--s3-upload-cutoff` large +- Files uploaded via a multipart upload won't have their modtimes + - This will mean that `rclone sync` will likely keep trying to upload files bigger than `--s3-upload-cutoff` + - This can be worked around with `--checksum` or `--size-only` or setting `--s3-upload-cutoff` large + - The maximum value for `--s3-upload-cutoff` is 5GiB though -However in May 2016 the ListObjectsV2 call was introduced. This is -much higher performance and should be used if at all possible. +One general purpose workaround is to set `--s3-upload-cutoff 5G`. This +means that rclone will upload files smaller than 5GiB as single parts. +Note that this can be set in the config file with `upload_cutoff = 5G` +or configured in the advanced settings. If you regularly transfer +files larger than 5G then using `--checksum` or `--size-only` in +`rclone sync` is the recommended workaround. -If set to the default, 0, rclone will guess according to the provider -set which list objects method to call. If it guesses wrong, then it -may be set manually here. +#### Comparison with the native protocol +Use the [the native protocol](/storj) to take advantage of +client-side encryption as well as to achieve the best possible +download performance. Uploads will be erasure-coded locally, thus a +1gb upload will result in 2.68gb of data being uploaded to storage +nodes across the network. -Properties: +Use this backend and the S3 compatible Hosted Gateway to increase +upload performance and reduce the load on your systems and network. +Uploads will be encrypted and erasure-coded server-side, thus a 1GB +upload will result in only in 1GB of data being uploaded to storage +nodes across the network. -- Config: list_version -- Env Var: RCLONE_S3_LIST_VERSION -- Type: int -- Default: 0 +For more detailed comparison please check the documentation of the +[storj](/storj) backend. -#### --s3-list-url-encode +## Limitations -Whether to url encode listings: true/false/unset +`rclone about` is not supported by the S3 backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. -Some providers support URL encoding listings and where this is -available this is more reliable when using control characters in file -names. If this is set to unset (the default) then rclone will choose -according to the provider setting what to apply, but you can override -rclone's choice here. +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -Properties: -- Config: list_url_encode -- Env Var: RCLONE_S3_LIST_URL_ENCODE -- Type: Tristate -- Default: unset +### Synology C2 Object Storage {#synology-c2} -#### --s3-no-check-bucket +[Synology C2 Object Storage](https://c2.synology.com/en-global/object-storage/overview) provides a secure, S3-compatible, and cost-effective cloud storage solution without API request, download fees, and deletion penalty. -If set, don't attempt to check the bucket exists or create it. +The S3 compatible gateway is configured using `rclone config` with a +type of `s3` and with a provider name of `Synology`. Here is an example +run of the configurator. -This can be useful when trying to minimise the number of transactions -rclone does if you know the bucket exists already. +First run: -It can also be needed if the user you are using does not have bucket -creation permissions. Before v1.52.0 this would have passed silently -due to a bug. +``` +rclone config +``` +This will guide you through an interactive setup process. -Properties: +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config -- Config: no_check_bucket -- Env Var: RCLONE_S3_NO_CHECK_BUCKET -- Type: bool -- Default: false +n/s/q> n -#### --s3-no-head +Enter name for new remote.1 +name> syno -If set, don't HEAD uploaded objects to check integrity. +Type of storage to configure. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value -This can be useful when trying to minimise the number of transactions -rclone does. + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, GCS, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi + \ "s3" -Setting it means that if rclone receives a 200 OK message after -uploading an object with PUT then it will assume that it got uploaded -properly. +Storage> s3 -In particular it will assume: +Choose your S3 provider. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 24 / Synology C2 Object Storage + \ (Synology) -- the metadata, including modtime, storage class and content type was as uploaded -- the size was as uploaded +provider> Synology -It reads the following items from the response for a single part PUT: +Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). +Only applies if access_key_id and secret_access_key is blank. +Enter a boolean value (true or false). Press Enter for the default ("false"). +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" -- the MD5SUM -- The uploaded date +env_auth> 1 -For multipart uploads these items aren't read. +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a string value. Press Enter for the default (""). -If an source object of unknown length is uploaded then rclone **will** do a -HEAD request. +access_key_id> accesskeyid -Setting this flag increases the chance for undetected upload failures, -in particular an incorrect size, so it isn't recommended for normal -operation. In practice the chance of an undetected upload failure is -very small even with this flag. +AWS Secret Access Key (password) +Leave blank for anonymous access or runtime credentials. +Enter a string value. Press Enter for the default (""). +secret_access_key> secretaccesskey -Properties: +Region where your data stored. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / Europe Region 1 + \ (eu-001) + 2 / Europe Region 2 + \ (eu-002) + 3 / US Region 1 + \ (us-001) + 4 / US Region 2 + \ (us-002) + 5 / Asia (Taiwan) + \ (tw-001) -- Config: no_head -- Env Var: RCLONE_S3_NO_HEAD -- Type: bool -- Default: false +region > 1 -#### --s3-no-head-object +Option endpoint. +Endpoint for Synology C2 Object Storage API. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / EU Endpoint 1 + \ (eu-001.s3.synologyc2.net) + 2 / US Endpoint 1 + \ (us-001.s3.synologyc2.net) + 3 / TW Endpoint 1 + \ (tw-001.s3.synologyc2.net) -If set, do not do HEAD before GET when getting objects. +endpoint> 1 -Properties: +Option location_constraint. +Location constraint - must be set to match the Region. +Leave blank if not sure. Used when creating buckets only. +Enter a value. Press Enter to leave empty. +location_constraint> -- Config: no_head_object -- Env Var: RCLONE_S3_NO_HEAD_OBJECT -- Type: bool -- Default: false +Edit advanced config? (y/n) +y) Yes +n) No +y/n> y -#### --s3-encoding +Option no_check_bucket. +If set, don't attempt to check the bucket exists or create it. +This can be useful when trying to minimise the number of transactions +rclone does if you know the bucket exists already. +It can also be needed if the user you are using does not have bucket +creation permissions. Before v1.52.0 this would have passed silently +due to a bug. +Enter a boolean value (true or false). Press Enter for the default (true). -The encoding for the backend. +no_check_bucket> true -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Configuration complete. +Options: +- type: s3 +- provider: Synology +- region: eu-001 +- endpoint: eu-001.s3.synologyc2.net +- no_check_bucket: true +Keep this "syno" remote? +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote -Properties: +y/e/d> y -- Config: encoding -- Env Var: RCLONE_S3_ENCODING -- Type: MultiEncoder -- Default: Slash,InvalidUtf8,Dot +# Backblaze B2 -#### --s3-memory-pool-flush-time +B2 is [Backblaze's cloud storage system](https://www.backblaze.com/b2/). -How often internal memory buffer pools will be flushed. (no longer used) +Paths are specified as `remote:bucket` (or `remote:` for the `lsd` +command.) You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`. -Properties: +## Configuration -- Config: memory_pool_flush_time -- Env Var: RCLONE_S3_MEMORY_POOL_FLUSH_TIME -- Type: Duration -- Default: 1m0s +Here is an example of making a b2 configuration. First run -#### --s3-memory-pool-use-mmap + rclone config -Whether to use mmap buffers in internal memory pool. (no longer used) +This will guide you through an interactive setup process. To authenticate +you will either need your Account ID (a short hex number) and Master +Application Key (a long hex number) OR an Application Key, which is the +recommended method. See below for further details on generating and using +an Application Key. -Properties: +``` +No remotes found, make a new one? +n) New remote +q) Quit config +n/q> n +name> remote +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Backblaze B2 + \ "b2" +[snip] +Storage> b2 +Account ID or Application Key ID +account> 123456789abc +Application Key +key> 0123456789abcdef0123456789abcdef0123456789 +Endpoint for the service - leave blank normally. +endpoint> +Remote config +-------------------- +[remote] +account = 123456789abc +key = 0123456789abcdef0123456789abcdef0123456789 +endpoint = +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -- Config: memory_pool_use_mmap -- Env Var: RCLONE_S3_MEMORY_POOL_USE_MMAP -- Type: bool -- Default: false +This remote is called `remote` and can now be used like this -#### --s3-disable-http2 +See all buckets -Disable usage of http2 for S3 backends. + rclone lsd remote: -There is currently an unsolved issue with the s3 (specifically minio) backend -and HTTP/2. HTTP/2 is enabled by default for the s3 backend but can be -disabled here. When the issue is solved this flag will be removed. +Create a new bucket -See: https://github.com/rclone/rclone/issues/4673, https://github.com/rclone/rclone/issues/3631 + rclone mkdir remote:bucket +List the contents of a bucket + rclone ls remote:bucket -Properties: +Sync `/home/local/directory` to the remote bucket, deleting any +excess files in the bucket. -- Config: disable_http2 -- Env Var: RCLONE_S3_DISABLE_HTTP2 -- Type: bool -- Default: false + rclone sync --interactive /home/local/directory remote:bucket -#### --s3-download-url +### Application Keys -Custom endpoint for downloads. -This is usually set to a CloudFront CDN URL as AWS S3 offers -cheaper egress for data downloaded through the CloudFront network. +B2 supports multiple [Application Keys for different access permission +to B2 Buckets](https://www.backblaze.com/b2/docs/application_keys.html). -Properties: +You can use these with rclone too; you will need to use rclone version 1.43 +or later. -- Config: download_url -- Env Var: RCLONE_S3_DOWNLOAD_URL -- Type: string -- Required: false +Follow Backblaze's docs to create an Application Key with the required +permission and add the `applicationKeyId` as the `account` and the +`Application Key` itself as the `key`. -#### --s3-directory-markers +Note that you must put the _applicationKeyId_ as the `account` – you +can't use the master Account ID. If you try then B2 will return 401 +errors. -Upload an empty object with a trailing slash when a new directory is created +### --fast-list -Empty folders are unsupported for bucket based remotes, this option creates an empty -object ending with "/", to persist the folder. +This remote supports `--fast-list` which allows you to use fewer +transactions in exchange for more memory. See the [rclone +docs](https://rclone.org/docs/#fast-list) for more details. +### Modification times -Properties: +The modification time is stored as metadata on the object as +`X-Bz-Info-src_last_modified_millis` as milliseconds since 1970-01-01 +in the Backblaze standard. Other tools should be able to use this as +a modified time. -- Config: directory_markers -- Env Var: RCLONE_S3_DIRECTORY_MARKERS -- Type: bool -- Default: false +Modified times are used in syncing and are fully supported. Note that +if a modification time needs to be updated on an object then it will +create a new version of the object. -#### --s3-use-multipart-etag +### Restricted filename characters -Whether to use ETag in multipart uploads for verification +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) +the following characters are also replaced: -This should be true, false or left unset to use the default for the provider. +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| \ | 0x5C | \ | +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. -Properties: +Note that in 2020-05 Backblaze started allowing \ characters in file +names. Rclone hasn't changed its encoding as this could cause syncs to +re-transfer files. If you want rclone not to replace \ then see the +`--b2-encoding` flag below and remove the `BackSlash` from the +string. This can be set in the config. -- Config: use_multipart_etag -- Env Var: RCLONE_S3_USE_MULTIPART_ETAG -- Type: Tristate -- Default: unset +### SHA1 checksums -#### --s3-use-presigned-request +The SHA1 checksums of the files are checked on upload and download and +will be used in the syncing process. -Whether to use a presigned request or PutObject for single part uploads +Large files (bigger than the limit in `--b2-upload-cutoff`) which are +uploaded in chunks will store their SHA1 on the object as +`X-Bz-Info-large_file_sha1` as recommended by Backblaze. -If this is false rclone will use PutObject from the AWS SDK to upload -an object. +For a large file to be uploaded with an SHA1 checksum, the source +needs to support SHA1 checksums. The local disk supports SHA1 +checksums so large file transfers from local disk will have an SHA1. +See [the overview](https://rclone.org/overview/#features) for exactly which remotes +support SHA1. -Versions of rclone < 1.59 use presigned requests to upload a single -part object and setting this flag to true will re-enable that -functionality. This shouldn't be necessary except in exceptional -circumstances or for testing. +Sources which don't support SHA1, in particular `crypt` will upload +large files without SHA1 checksums. This may be fixed in the future +(see [#1767](https://github.com/rclone/rclone/issues/1767)). +Files sizes below `--b2-upload-cutoff` will always have an SHA1 +regardless of the source. -Properties: +### Transfers -- Config: use_presigned_request -- Env Var: RCLONE_S3_USE_PRESIGNED_REQUEST -- Type: bool -- Default: false +Backblaze recommends that you do lots of transfers simultaneously for +maximum speed. In tests from my SSD equipped laptop the optimum +setting is about `--transfers 32` though higher numbers may be used +for a slight speed improvement. The optimum number for you may vary +depending on your hardware, how big the files are, how much you want +to load your computer, etc. The default of `--transfers 4` is +definitely too low for Backblaze B2 though. -#### --s3-versions +Note that uploading big files (bigger than 200 MiB by default) will use +a 96 MiB RAM buffer by default. There can be at most `--transfers` of +these in use at any moment, so this sets the upper limit on the memory +used. -Include old versions in directory listings. +### Versions -Properties: +When rclone uploads a new version of a file it creates a [new version +of it](https://www.backblaze.com/b2/docs/file_versions.html). +Likewise when you delete a file, the old version will be marked hidden +and still be available. Conversely, you may opt in to a "hard delete" +of files with the `--b2-hard-delete` flag which would permanently remove +the file instead of hiding it. -- Config: versions -- Env Var: RCLONE_S3_VERSIONS -- Type: bool -- Default: false +Old versions of files, where available, are visible using the +`--b2-versions` flag. -#### --s3-version-at +It is also possible to view a bucket as it was at a certain point in time, +using the `--b2-version-at` flag. This will show the file versions as they +were at that time, showing files that have been deleted afterwards, and +hiding files that were created since. -Show file versions as they were at the specified time. +If you wish to remove all the old versions then you can use the +`rclone cleanup remote:bucket` command which will delete all the old +versions of files, leaving the current ones intact. You can also +supply a path and only old versions under that path will be deleted, +e.g. `rclone cleanup remote:bucket/path/to/stuff`. -The parameter should be a date, "2006-01-02", datetime "2006-01-02 -15:04:05" or a duration for that long ago, eg "100d" or "1h". +Note that `cleanup` will remove partially uploaded files from the bucket +if they are more than a day old. -Note that when using this no file write operations are permitted, -so you can't upload files or delete them. +When you `purge` a bucket, the current and the old versions will be +deleted then the bucket will be deleted. -See [the time option docs](https://rclone.org/docs/#time-option) for valid formats. +However `delete` will cause the current versions of the files to +become hidden old versions. +Here is a session showing the listing and retrieval of an old +version followed by a `cleanup` of the old versions. -Properties: +Show current version and all the versions with `--b2-versions` flag. -- Config: version_at -- Env Var: RCLONE_S3_VERSION_AT -- Type: Time -- Default: off +``` +$ rclone -q ls b2:cleanup-test + 9 one.txt -#### --s3-decompress +$ rclone -q --b2-versions ls b2:cleanup-test + 9 one.txt + 8 one-v2016-07-04-141032-000.txt + 16 one-v2016-07-04-141003-000.txt + 15 one-v2016-07-02-155621-000.txt +``` -If set this will decompress gzip encoded objects. +Retrieve an old version -It is possible to upload objects to S3 with "Content-Encoding: gzip" -set. Normally rclone will download these files as compressed objects. +``` +$ rclone -q --b2-versions copy b2:cleanup-test/one-v2016-07-04-141003-000.txt /tmp -If this flag is set then rclone will decompress these files with -"Content-Encoding: gzip" as they are received. This means that rclone -can't check the size and hash but the file contents will be decompressed. +$ ls -l /tmp/one-v2016-07-04-141003-000.txt +-rw-rw-r-- 1 ncw ncw 16 Jul 2 17:46 /tmp/one-v2016-07-04-141003-000.txt +``` +Clean up all the old versions and show that they've gone. -Properties: +``` +$ rclone -q cleanup b2:cleanup-test -- Config: decompress -- Env Var: RCLONE_S3_DECOMPRESS -- Type: bool -- Default: false +$ rclone -q ls b2:cleanup-test + 9 one.txt -#### --s3-might-gzip +$ rclone -q --b2-versions ls b2:cleanup-test + 9 one.txt +``` -Set this if the backend might gzip objects. +#### Versions naming caveat -Normally providers will not alter objects when they are downloaded. If -an object was not uploaded with `Content-Encoding: gzip` then it won't -be set on download. +When using `--b2-versions` flag rclone is relying on the file name +to work out whether the objects are versions or not. Versions' names +are created by inserting timestamp between file name and its extension. +``` + 9 file.txt + 8 file-v2023-07-17-161032-000.txt + 16 file-v2023-06-15-141003-000.txt +``` +If there are real files present with the same names as versions, then +behaviour of `--b2-versions` can be unpredictable. -However some providers may gzip objects even if they weren't uploaded -with `Content-Encoding: gzip` (eg Cloudflare). +### Data usage -A symptom of this would be receiving errors like +It is useful to know how many requests are sent to the server in different scenarios. - ERROR corrupted on transfer: sizes differ NNN vs MMM +All copy commands send the following 4 requests: -If you set this flag and rclone downloads an object with -Content-Encoding: gzip set and chunked transfer encoding, then rclone -will decompress the object on the fly. +``` +/b2api/v1/b2_authorize_account +/b2api/v1/b2_create_bucket +/b2api/v1/b2_list_buckets +/b2api/v1/b2_list_file_names +``` -If this is set to unset (the default) then rclone will choose -according to the provider setting what to apply, but you can override -rclone's choice here. +The `b2_list_file_names` request will be sent once for every 1k files +in the remote path, providing the checksum and modification time of +the listed files. As of version 1.33 issue +[#818](https://github.com/rclone/rclone/issues/818) causes extra requests +to be sent when using B2 with Crypt. When a copy operation does not +require any files to be uploaded, no more requests will be sent. +Uploading files that do not require chunking, will send 2 requests per +file upload: -Properties: +``` +/b2api/v1/b2_get_upload_url +/b2api/v1/b2_upload_file/ +``` -- Config: might_gzip -- Env Var: RCLONE_S3_MIGHT_GZIP -- Type: Tristate -- Default: unset +Uploading files requiring chunking, will send 2 requests (one each to +start and finish the upload) and another 2 requests for each chunk: -#### --s3-use-accept-encoding-gzip +``` +/b2api/v1/b2_start_large_file +/b2api/v1/b2_get_upload_part_url +/b2api/v1/b2_upload_part/ +/b2api/v1/b2_finish_large_file +``` -Whether to send `Accept-Encoding: gzip` header. +#### Versions -By default, rclone will append `Accept-Encoding: gzip` to the request to download -compressed objects whenever possible. +Versions can be viewed with the `--b2-versions` flag. When it is set +rclone will show and act on older versions of files. For example -However some providers such as Google Cloud Storage may alter the HTTP headers, breaking -the signature of the request. +Listing without `--b2-versions` -A symptom of this would be receiving errors like +``` +$ rclone -q ls b2:cleanup-test + 9 one.txt +``` - SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. +And with -In this case, you might want to try disabling this option. +``` +$ rclone -q --b2-versions ls b2:cleanup-test + 9 one.txt + 8 one-v2016-07-04-141032-000.txt + 16 one-v2016-07-04-141003-000.txt + 15 one-v2016-07-02-155621-000.txt +``` +Showing that the current version is unchanged but older versions can +be seen. These have the UTC date that they were uploaded to the +server to the nearest millisecond appended to them. -Properties: +Note that when using `--b2-versions` no file write operations are +permitted, so you can't upload files or delete them. -- Config: use_accept_encoding_gzip -- Env Var: RCLONE_S3_USE_ACCEPT_ENCODING_GZIP -- Type: Tristate -- Default: unset +### B2 and rclone link -#### --s3-no-system-metadata +Rclone supports generating file share links for private B2 buckets. +They can either be for a file for example: -Suppress setting and reading of system metadata +``` +./rclone link B2:bucket/path/to/file.txt +https://f002.backblazeb2.com/file/bucket/path/to/file.txt?Authorization=xxxxxxxx -Properties: +``` -- Config: no_system_metadata -- Env Var: RCLONE_S3_NO_SYSTEM_METADATA -- Type: bool -- Default: false +or if run on a directory you will get: -#### --s3-sts-endpoint +``` +./rclone link B2:bucket/path +https://f002.backblazeb2.com/file/bucket/path?Authorization=xxxxxxxx +``` -Endpoint for STS. +you can then use the authorization token (the part of the url from the + `?Authorization=` on) on any file path under that directory. For example: -Leave blank if using AWS to use the default endpoint for the region. +``` +https://f002.backblazeb2.com/file/bucket/path/to/file1?Authorization=xxxxxxxx +https://f002.backblazeb2.com/file/bucket/path/file2?Authorization=xxxxxxxx +https://f002.backblazeb2.com/file/bucket/path/folder/file3?Authorization=xxxxxxxx -Properties: +``` -- Config: sts_endpoint -- Env Var: RCLONE_S3_STS_ENDPOINT -- Provider: AWS -- Type: string -- Required: false -### Metadata +### Standard options -User metadata is stored as x-amz-meta- keys. S3 metadata keys are case insensitive and are always returned in lower case. +Here are the Standard options specific to b2 (Backblaze B2). -Here are the possible system metadata items for the s3 backend. +#### --b2-account -| Name | Help | Type | Example | Read Only | -|------|------|------|---------|-----------| -| btime | Time of file birth (creation) read from Last-Modified header | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** | -| cache-control | Cache-Control header | string | no-cache | N | -| content-disposition | Content-Disposition header | string | inline | N | -| content-encoding | Content-Encoding header | string | gzip | N | -| content-language | Content-Language header | string | en-US | N | -| content-type | Content-Type header | string | text/plain | N | -| mtime | Time of last modification, read from rclone metadata | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | N | -| tier | Tier of the object | string | GLACIER | **Y** | +Account ID or Application Key ID. -See the [metadata](https://rclone.org/docs/#metadata) docs for more info. +Properties: -## Backend commands +- Config: account +- Env Var: RCLONE_B2_ACCOUNT +- Type: string +- Required: true -Here are the commands specific to the s3 backend. +#### --b2-key -Run them with +Application Key. - rclone backend COMMAND remote: +Properties: -The help below will explain what arguments each command takes. +- Config: key +- Env Var: RCLONE_B2_KEY +- Type: string +- Required: true -See the [backend](https://rclone.org/commands/rclone_backend/) command for more -info on how to pass options and arguments. +#### --b2-hard-delete -These can be run on a running backend using the rc command -[backend/command](https://rclone.org/rc/#backend-command). +Permanently delete files on remote removal, otherwise hide files. -### restore +Properties: -Restore objects from GLACIER to normal storage +- Config: hard_delete +- Env Var: RCLONE_B2_HARD_DELETE +- Type: bool +- Default: false - rclone backend restore remote: [options] [+] +### Advanced options -This command can be used to restore one or more objects from GLACIER -to normal storage. +Here are the Advanced options specific to b2 (Backblaze B2). -Usage Examples: +#### --b2-endpoint - rclone backend restore s3:bucket/path/to/object -o priority=PRIORITY -o lifetime=DAYS - rclone backend restore s3:bucket/path/to/directory -o priority=PRIORITY -o lifetime=DAYS - rclone backend restore s3:bucket -o priority=PRIORITY -o lifetime=DAYS +Endpoint for the service. -This flag also obeys the filters. Test first with --interactive/-i or --dry-run flags +Leave blank normally. - rclone --interactive backend restore --include "*.txt" s3:bucket/path -o priority=Standard -o lifetime=1 +Properties: -All the objects shown will be marked for restore, then +- Config: endpoint +- Env Var: RCLONE_B2_ENDPOINT +- Type: string +- Required: false - rclone backend restore --include "*.txt" s3:bucket/path -o priority=Standard -o lifetime=1 +#### --b2-test-mode -It returns a list of status dictionaries with Remote and Status -keys. The Status will be OK if it was successful or an error message -if not. +A flag string for X-Bz-Test-Mode header for debugging. - [ - { - "Status": "OK", - "Remote": "test.txt" - }, - { - "Status": "OK", - "Remote": "test/file4.txt" - } - ] +This is for debugging purposes only. Setting it to one of the strings +below will cause b2 to return specific errors: + * "fail_some_uploads" + * "expire_some_account_authorization_tokens" + * "force_cap_exceeded" +These will be set in the "X-Bz-Test-Mode" header which is documented +in the [b2 integrations checklist](https://www.backblaze.com/b2/docs/integration_checklist.html). -Options: +Properties: -- "description": The optional description for the job. -- "lifetime": Lifetime of the active copy in days -- "priority": Priority of restore: Standard|Expedited|Bulk +- Config: test_mode +- Env Var: RCLONE_B2_TEST_MODE +- Type: string +- Required: false -### restore-status +#### --b2-versions -Show the restore status for objects being restored from GLACIER to normal storage +Include old versions in directory listings. - rclone backend restore-status remote: [options] [+] +Note that when using this no file write operations are permitted, +so you can't upload files or delete them. -This command can be used to show the status for objects being restored from GLACIER -to normal storage. +Properties: -Usage Examples: +- Config: versions +- Env Var: RCLONE_B2_VERSIONS +- Type: bool +- Default: false - rclone backend restore-status s3:bucket/path/to/object - rclone backend restore-status s3:bucket/path/to/directory - rclone backend restore-status -o all s3:bucket/path/to/directory +#### --b2-version-at -This command does not obey the filters. +Show file versions as they were at the specified time. -It returns a list of status dictionaries. +Note that when using this no file write operations are permitted, +so you can't upload files or delete them. - [ - { - "Remote": "file.txt", - "VersionID": null, - "RestoreStatus": { - "IsRestoreInProgress": true, - "RestoreExpiryDate": "2023-09-06T12:29:19+01:00" - }, - "StorageClass": "GLACIER" - }, - { - "Remote": "test.pdf", - "VersionID": null, - "RestoreStatus": { - "IsRestoreInProgress": false, - "RestoreExpiryDate": "2023-09-06T12:29:19+01:00" - }, - "StorageClass": "DEEP_ARCHIVE" - } - ] +Properties: +- Config: version_at +- Env Var: RCLONE_B2_VERSION_AT +- Type: Time +- Default: off -Options: +#### --b2-upload-cutoff -- "all": if set then show all objects, not just ones with restore status +Cutoff for switching to chunked upload. -### list-multipart-uploads +Files above this size will be uploaded in chunks of "--b2-chunk-size". -List the unfinished multipart uploads +This value should be set no larger than 4.657 GiB (== 5 GB). - rclone backend list-multipart-uploads remote: [options] [+] +Properties: -This command lists the unfinished multipart uploads in JSON format. +- Config: upload_cutoff +- Env Var: RCLONE_B2_UPLOAD_CUTOFF +- Type: SizeSuffix +- Default: 200Mi - rclone backend list-multipart s3:bucket/path/to/object +#### --b2-copy-cutoff -It returns a dictionary of buckets with values as lists of unfinished -multipart uploads. +Cutoff for switching to multipart copy. -You can call it with no bucket in which case it lists all bucket, with -a bucket or with a bucket and path. +Any files larger than this that need to be server-side copied will be +copied in chunks of this size. - { - "rclone": [ - { - "Initiated": "2020-06-26T14:20:36Z", - "Initiator": { - "DisplayName": "XXX", - "ID": "arn:aws:iam::XXX:user/XXX" - }, - "Key": "KEY", - "Owner": { - "DisplayName": null, - "ID": "XXX" - }, - "StorageClass": "STANDARD", - "UploadId": "XXX" - } - ], - "rclone-1000files": [], - "rclone-dst": [] - } +The minimum is 0 and the maximum is 4.6 GiB. +Properties: +- Config: copy_cutoff +- Env Var: RCLONE_B2_COPY_CUTOFF +- Type: SizeSuffix +- Default: 4Gi -### cleanup +#### --b2-chunk-size -Remove unfinished multipart uploads. +Upload chunk size. - rclone backend cleanup remote: [options] [+] +When uploading large files, chunk the file into this size. -This command removes unfinished multipart uploads of age greater than -max-age which defaults to 24 hours. +Must fit in memory. These chunks are buffered in memory and there +might a maximum of "--transfers" chunks in progress at once. -Note that you can use --interactive/-i or --dry-run with this command to see what -it would do. +5,000,000 Bytes is the minimum size. - rclone backend cleanup s3:bucket/path/to/object - rclone backend cleanup -o max-age=7w s3:bucket/path/to/object +Properties: -Durations are parsed as per the rest of rclone, 2h, 7d, 7w etc. +- Config: chunk_size +- Env Var: RCLONE_B2_CHUNK_SIZE +- Type: SizeSuffix +- Default: 96Mi +#### --b2-upload-concurrency -Options: +Concurrency for multipart uploads. -- "max-age": Max age of upload to delete +This is the number of chunks of the same file that are uploaded +concurrently. -### cleanup-hidden +Note that chunks are stored in memory and there may be up to +"--transfers" * "--b2-upload-concurrency" chunks stored at once +in memory. -Remove old versions of files. +Properties: - rclone backend cleanup-hidden remote: [options] [+] +- Config: upload_concurrency +- Env Var: RCLONE_B2_UPLOAD_CONCURRENCY +- Type: int +- Default: 4 -This command removes any old hidden versions of files -on a versions enabled bucket. +#### --b2-disable-checksum -Note that you can use --interactive/-i or --dry-run with this command to see what -it would do. +Disable checksums for large (> upload cutoff) files. - rclone backend cleanup-hidden s3:bucket/path/to/dir +Normally rclone will calculate the SHA1 checksum of the input before +uploading it so it can add it to metadata on the object. This is great +for data integrity checking but can cause long delays for large files +to start uploading. +Properties: -### versioning +- Config: disable_checksum +- Env Var: RCLONE_B2_DISABLE_CHECKSUM +- Type: bool +- Default: false -Set/get versioning support for a bucket. +#### --b2-download-url - rclone backend versioning remote: [options] [+] +Custom endpoint for downloads. -This command sets versioning support if a parameter is -passed and then returns the current versioning status for the bucket -supplied. +This is usually set to a Cloudflare CDN URL as Backblaze offers +free egress for data downloaded through the Cloudflare network. +Rclone works with private buckets by sending an "Authorization" header. +If the custom endpoint rewrites the requests for authentication, +e.g., in Cloudflare Workers, this header needs to be handled properly. +Leave blank if you want to use the endpoint provided by Backblaze. - rclone backend versioning s3:bucket # read status only - rclone backend versioning s3:bucket Enabled - rclone backend versioning s3:bucket Suspended +The URL provided here SHOULD have the protocol and SHOULD NOT have +a trailing slash or specify the /file/bucket subpath as rclone will +request files with "{download_url}/file/{bucket_name}/{path}". -It may return "Enabled", "Suspended" or "Unversioned". Note that once versioning -has been enabled the status can't be set back to "Unversioned". +Example: +> https://mysubdomain.mydomain.tld +(No trailing "/", "file" or "bucket") +Properties: -### set +- Config: download_url +- Env Var: RCLONE_B2_DOWNLOAD_URL +- Type: string +- Required: false -Set command for updating the config parameters. +#### --b2-download-auth-duration - rclone backend set remote: [options] [+] +Time before the authorization token will expire in s or suffix ms|s|m|h|d. -This set command can be used to update the config parameters -for a running s3 backend. +The duration before the download authorization token will expire. +The minimum value is 1 second. The maximum value is one week. -Usage Examples: +Properties: - rclone backend set s3: [-o opt_name=opt_value] [-o opt_name2=opt_value2] - rclone rc backend/command command=set fs=s3: [-o opt_name=opt_value] [-o opt_name2=opt_value2] - rclone rc backend/command command=set fs=s3: -o session_token=X -o access_key_id=X -o secret_access_key=X +- Config: download_auth_duration +- Env Var: RCLONE_B2_DOWNLOAD_AUTH_DURATION +- Type: Duration +- Default: 1w -The option keys are named as they are in the config file. +#### --b2-memory-pool-flush-time -This rebuilds the connection to the s3 backend when it is called with -the new parameters. Only new parameters need be passed as the values -will default to those currently in use. +How often internal memory buffer pools will be flushed. (no longer used) -It doesn't return anything. +Properties: +- Config: memory_pool_flush_time +- Env Var: RCLONE_B2_MEMORY_POOL_FLUSH_TIME +- Type: Duration +- Default: 1m0s +#### --b2-memory-pool-use-mmap +Whether to use mmap buffers in internal memory pool. (no longer used) -### Anonymous access to public buckets +Properties: -If you want to use rclone to access a public bucket, configure with a -blank `access_key_id` and `secret_access_key`. Your config should end -up looking like this: +- Config: memory_pool_use_mmap +- Env Var: RCLONE_B2_MEMORY_POOL_USE_MMAP +- Type: bool +- Default: false -``` -[anons3] -type = s3 -provider = AWS -env_auth = false -access_key_id = -secret_access_key = -region = us-east-1 -endpoint = -location_constraint = -acl = private -server_side_encryption = -storage_class = -``` +#### --b2-lifecycle -Then use it as normal with the name of the public bucket, e.g. +Set the number of days deleted files should be kept when creating a bucket. - rclone lsd anons3:1000genomes +On bucket creation, this parameter is used to create a lifecycle rule +for the entire bucket. -You will be able to list and copy data but not upload it. +If lifecycle is 0 (the default) it does not create a lifecycle rule so +the default B2 behaviour applies. This is to create versions of files +on delete and overwrite and to keep them indefinitely. -## Providers +If lifecycle is >0 then it creates a single rule setting the number of +days before a file that is deleted or overwritten is deleted +permanently. This is known as daysFromHidingToDeleting in the b2 docs. -### AWS S3 +The minimum value for this parameter is 1 day. -This is the provider used as main example and described in the [configuration](#configuration) section above. +You can also enable hard_delete in the config also which will mean +deletions won't cause versions but overwrites will still cause +versions to be made. -### AWS Snowball Edge +See: [rclone backend lifecycle](#lifecycle) for setting lifecycles after bucket creation. -[AWS Snowball](https://aws.amazon.com/snowball/) is a hardware -appliance used for transferring bulk data back to AWS. Its main -software interface is S3 object storage. -To use rclone with AWS Snowball Edge devices, configure as standard -for an 'S3 Compatible Service'. +Properties: -If using rclone pre v1.59 be sure to set `upload_cutoff = 0` otherwise -you will run into authentication header issues as the snowball device -does not support query parameter based authentication. +- Config: lifecycle +- Env Var: RCLONE_B2_LIFECYCLE +- Type: int +- Default: 0 -With rclone v1.59 or later setting `upload_cutoff` should not be necessary. +#### --b2-encoding -eg. -``` -[snowball] -type = s3 -provider = Other -access_key_id = YOUR_ACCESS_KEY -secret_access_key = YOUR_SECRET_KEY -endpoint = http://[IP of Snowball]:8080 -upload_cutoff = 0 -``` +The encoding for the backend. -### Ceph +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -[Ceph](https://ceph.com/) is an open-source, unified, distributed -storage system designed for excellent performance, reliability and -scalability. It has an S3 compatible object storage interface. +Properties: -To use rclone with Ceph, configure as above but leave the region blank -and set the endpoint. You should end up with something like this in -your config: +- Config: encoding +- Env Var: RCLONE_B2_ENCODING +- Type: Encoding +- Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot +## Backend commands -``` -[ceph] -type = s3 -provider = Ceph -env_auth = false -access_key_id = XXX -secret_access_key = YYY -region = -endpoint = https://ceph.endpoint.example.com -location_constraint = -acl = -server_side_encryption = -storage_class = -``` +Here are the commands specific to the b2 backend. -If you are using an older version of CEPH (e.g. 10.2.x Jewel) and a -version of rclone before v1.59 then you may need to supply the -parameter `--s3-upload-cutoff 0` or put this in the config file as -`upload_cutoff 0` to work around a bug which causes uploading of small -files to fail. +Run them with -Note also that Ceph sometimes puts `/` in the passwords it gives -users. If you read the secret access key using the command line tools -you will get a JSON blob with the `/` escaped as `\/`. Make sure you -only write `/` in the secret access key. + rclone backend COMMAND remote: -Eg the dump from Ceph looks something like this (irrelevant keys -removed). +The help below will explain what arguments each command takes. -``` -{ - "user_id": "xxx", - "display_name": "xxxx", - "keys": [ - { - "user": "xxx", - "access_key": "xxxxxx", - "secret_key": "xxxxxx\/xxxx" - } - ], -} -``` +See the [backend](https://rclone.org/commands/rclone_backend/) command for more +info on how to pass options and arguments. -Because this is a json dump, it is encoding the `/` as `\/`, so if you -use the secret key as `xxxxxx/xxxx` it will work fine. +These can be run on a running backend using the rc command +[backend/command](https://rclone.org/rc/#backend-command). -### Cloudflare R2 {#cloudflare-r2} +### lifecycle -[Cloudflare R2](https://blog.cloudflare.com/r2-open-beta/) Storage -allows developers to store large amounts of unstructured data without -the costly egress bandwidth fees associated with typical cloud storage -services. +Read or set the lifecycle for a bucket -Here is an example of making a Cloudflare R2 configuration. First run: + rclone backend lifecycle remote: [options] [+] - rclone config +This command can be used to read or set the lifecycle for a bucket. -This will guide you through an interactive setup process. +Usage Examples: -Note that all buckets are private, and all are stored in the same -"auto" region. It is necessary to use Cloudflare workers to share the -content of a bucket publicly. +To show the current lifecycle rules: -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> r2 -Option Storage. -Type of storage to configure. -Choose a number from below, or type in your own value. -... -XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi - \ (s3) -... -Storage> s3 -Option provider. -Choose your S3 provider. -Choose a number from below, or type in your own value. -Press Enter to leave empty. -... -XX / Cloudflare R2 Storage - \ (Cloudflare) -... -provider> Cloudflare -Option env_auth. -Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). -Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) -env_auth> 1 -Option access_key_id. -AWS Access Key ID. -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -access_key_id> ACCESS_KEY -Option secret_access_key. -AWS Secret Access Key (password). -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -secret_access_key> SECRET_ACCESS_KEY -Option region. -Region to connect to. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / R2 buckets are automatically distributed across Cloudflare's data centers for low latency. - \ (auto) -region> 1 -Option endpoint. -Endpoint for S3 API. -Required when using an S3 clone. -Enter a value. Press Enter to leave empty. -endpoint> https://ACCOUNT_ID.r2.cloudflarestorage.com -Edit advanced config? -y) Yes -n) No (default) -y/n> n --------------------- -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -``` + rclone backend lifecycle b2:bucket -This will leave your config looking something like: +This will dump something like this showing the lifecycle rules. -``` -[r2] -type = s3 -provider = Cloudflare -access_key_id = ACCESS_KEY -secret_access_key = SECRET_ACCESS_KEY -region = auto -endpoint = https://ACCOUNT_ID.r2.cloudflarestorage.com -acl = private -``` + [ + { + "daysFromHidingToDeleting": 1, + "daysFromUploadingToHiding": null, + "fileNamePrefix": "" + } + ] -Now run `rclone lsf r2:` to see your buckets and `rclone lsf -r2:bucket` to look within a bucket. +If there are no lifecycle rules (the default) then it will just return []. -### Dreamhost +To reset the current lifecycle rules: -Dreamhost [DreamObjects](https://www.dreamhost.com/cloud/storage/) is -an object storage system based on CEPH. + rclone backend lifecycle b2:bucket -o daysFromHidingToDeleting=30 + rclone backend lifecycle b2:bucket -o daysFromUploadingToHiding=5 -o daysFromHidingToDeleting=1 -To use rclone with Dreamhost, configure as above but leave the region blank -and set the endpoint. You should end up with something like this in -your config: +This will run and then print the new lifecycle rules as above. -``` -[dreamobjects] -type = s3 -provider = DreamHost -env_auth = false -access_key_id = your_access_key -secret_access_key = your_secret_key -region = -endpoint = objects-us-west-1.dream.io -location_constraint = -acl = private -server_side_encryption = -storage_class = -``` +Rclone only lets you set lifecycles for the whole bucket with the +fileNamePrefix = "". -### Google Cloud Storage +You can't disable versioning with B2. The best you can do is to set +the daysFromHidingToDeleting to 1 day. You can enable hard_delete in +the config also which will mean deletions won't cause versions but +overwrites will still cause versions to be made. -[GoogleCloudStorage](https://cloud.google.com/storage/docs) is an [S3-interoperable](https://cloud.google.com/storage/docs/interoperability) object storage service from Google Cloud Platform. + rclone backend lifecycle b2:bucket -o daysFromHidingToDeleting=1 -To connect to Google Cloud Storage you will need an access key and secret key. These can be retrieved by creating an [HMAC key](https://cloud.google.com/storage/docs/authentication/managing-hmackeys). +See: https://www.backblaze.com/docs/cloud-storage-lifecycle-rules -``` -[gs] -type = s3 -provider = GCS -access_key_id = your_access_key -secret_access_key = your_secret_key -endpoint = https://storage.googleapis.com -``` -### DigitalOcean Spaces +Options: -[Spaces](https://www.digitalocean.com/products/object-storage/) is an [S3-interoperable](https://developers.digitalocean.com/documentation/spaces/) object storage service from cloud provider DigitalOcean. +- "daysFromHidingToDeleting": After a file has been hidden for this many days it is deleted. 0 is off. +- "daysFromUploadingToHiding": This many days after uploading a file is hidden -To connect to DigitalOcean Spaces you will need an access key and secret key. These can be retrieved on the "[Applications & API](https://cloud.digitalocean.com/settings/api/tokens)" page of the DigitalOcean control panel. They will be needed when prompted by `rclone config` for your `access_key_id` and `secret_access_key`. -When prompted for a `region` or `location_constraint`, press enter to use the default value. The region must be included in the `endpoint` setting (e.g. `nyc3.digitaloceanspaces.com`). The default values can be used for other settings. -Going through the whole process of creating a new remote by running `rclone config`, each prompt should be answered as shown below: +## Limitations -``` -Storage> s3 -env_auth> 1 -access_key_id> YOUR_ACCESS_KEY -secret_access_key> YOUR_SECRET_KEY -region> -endpoint> nyc3.digitaloceanspaces.com -location_constraint> -acl> -storage_class> -``` +`rclone about` is not supported by the B2 backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. -The resulting configuration file should look like: +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -``` -[spaces] -type = s3 -provider = DigitalOcean -env_auth = false -access_key_id = YOUR_ACCESS_KEY -secret_access_key = YOUR_SECRET_KEY -region = -endpoint = nyc3.digitaloceanspaces.com -location_constraint = -acl = -server_side_encryption = -storage_class = -``` +# Box -Once configured, you can create a new Space and begin copying files. For example: +Paths are specified as `remote:path` -``` -rclone mkdir spaces:my-new-space -rclone copy /path/to/files spaces:my-new-space -``` -### Huawei OBS {#huawei-obs} +Paths may be as deep as required, e.g. `remote:directory/subdirectory`. -Object Storage Service (OBS) provides stable, secure, efficient, and easy-to-use cloud storage that lets you store virtually any volume of unstructured data in any format and access it from anywhere. +The initial setup for Box involves getting a token from Box which you +can do either in your browser, or with a config.json downloaded from Box +to use JWT authentication. `rclone config` walks you through it. -OBS provides an S3 interface, you can copy and modify the following configuration and add it to your rclone configuration file. -``` -[obs] -type = s3 -provider = HuaweiOBS -access_key_id = your-access-key-id -secret_access_key = your-secret-access-key -region = af-south-1 -endpoint = obs.af-south-1.myhuaweicloud.com -acl = private -``` +## Configuration + +Here is an example of how to make a remote called `remote`. First run: + + rclone config + +This will guide you through an interactive setup process: -Or you can also configure via the interactive command line: ``` No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n -name> obs -Option Storage. +name> remote Type of storage to configure. -Choose a number from below, or type in your own value. -[snip] - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi - \ (s3) -[snip] -Storage> 5 -Option provider. -Choose your S3 provider. -Choose a number from below, or type in your own value. -Press Enter to leave empty. -[snip] - 9 / Huawei Object Storage Service - \ (HuaweiOBS) -[snip] -provider> 9 -Option env_auth. -Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). -Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) -env_auth> 1 -Option access_key_id. -AWS Access Key ID. -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -access_key_id> your-access-key-id -Option secret_access_key. -AWS Secret Access Key (password). -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -secret_access_key> your-secret-access-key -Option region. -Region to connect to. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / AF-Johannesburg - \ (af-south-1) - 2 / AP-Bangkok - \ (ap-southeast-2) -[snip] -region> 1 -Option endpoint. -Endpoint for OBS API. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / AF-Johannesburg - \ (obs.af-south-1.myhuaweicloud.com) - 2 / AP-Bangkok - \ (obs.ap-southeast-2.myhuaweicloud.com) +Choose a number from below, or type in your own value [snip] -endpoint> 1 -Option acl. -Canned ACL used when creating buckets and storing or copying objects. -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -Note that this ACL is applied when server-side copying objects as S3 -doesn't copy the ACL from the source but rather writes a fresh one. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - / Owner gets FULL_CONTROL. - 1 | No one else has access rights (default). - \ (private) +XX / Box + \ "box" [snip] -acl> 1 -Edit advanced config? +Storage> box +Box App Client Id - leave blank normally. +client_id> +Box App Client Secret - leave blank normally. +client_secret> +Box App config.json location +Leave blank normally. +Enter a string value. Press Enter for the default (""). +box_config_file> +Box App Primary Access Token +Leave blank normally. +Enter a string value. Press Enter for the default (""). +access_token> + +Enter a string value. Press Enter for the default ("user"). +Choose a number from below, or type in your own value + 1 / Rclone should act on behalf of a user + \ "user" + 2 / Rclone should act on behalf of a service account + \ "enterprise" +box_sub_type> +Remote config +Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. y) Yes -n) No (default) -y/n> +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 -------------------- -[obs] -type = s3 -provider = HuaweiOBS -access_key_id = your-access-key-id -secret_access_key = your-secret-access-key -region = af-south-1 -endpoint = obs.af-south-1.myhuaweicloud.com -acl = private +[remote] +client_id = +client_secret = +token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"XXX"} -------------------- -y) Yes this is OK (default) +y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y -Current remotes: - -Name Type -==== ==== -obs s3 - -e) Edit existing remote -n) New remote -d) Delete remote -r) Rename remote -c) Copy remote -s) Set configuration password -q) Quit config -e/n/d/r/c/s/q> q -``` - -### IBM COS (S3) - -Information stored with IBM Cloud Object Storage is encrypted and dispersed across multiple geographic locations, and accessed through an implementation of the S3 API. This service makes use of the distributed storage technologies provided by IBM’s Cloud Object Storage System (formerly Cleversafe). For more information visit: (http://www.ibm.com/cloud/object-storage) - -To configure access to IBM COS S3, follow the steps below: - -1. Run rclone config and select n for a new remote. -``` - 2018/02/14 14:13:11 NOTICE: Config file "C:\\Users\\a\\.config\\rclone\\rclone.conf" not found - using defaults - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n -``` - -2. Enter the name for the configuration -``` - name> -``` - -3. Select "s3" storage. -``` -Choose a number from below, or type in your own value - 1 / Alias for an existing remote - \ "alias" - 2 / Amazon Drive - \ "amazon cloud drive" - 3 / Amazon S3 Complaint Storage Providers (Dreamhost, Ceph, ChinaMobile, Liara, ArvanCloud, Minio, IBM COS) - \ "s3" - 4 / Backblaze B2 - \ "b2" -[snip] - 23 / HTTP - \ "http" -Storage> 3 -``` - -4. Select IBM COS as the S3 Storage Provider. -``` -Choose the S3 provider. -Choose a number from below, or type in your own value - 1 / Choose this option to configure Storage to AWS S3 - \ "AWS" - 2 / Choose this option to configure Storage to Ceph Systems - \ "Ceph" - 3 / Choose this option to configure Storage to Dreamhost - \ "Dreamhost" - 4 / Choose this option to the configure Storage to IBM COS S3 - \ "IBMCOS" - 5 / Choose this option to the configure Storage to Minio - \ "Minio" - Provider>4 -``` - -5. Enter the Access Key and Secret. -``` - AWS Access Key ID - leave blank for anonymous access or runtime credentials. - access_key_id> <> - AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. - secret_access_key> <> -``` - -6. Specify the endpoint for IBM COS. For Public IBM COS, choose from the option below. For On Premise IBM COS, enter an endpoint address. -``` - Endpoint for IBM COS S3 API. - Specify if using an IBM COS On Premise. - Choose a number from below, or type in your own value - 1 / US Cross Region Endpoint - \ "s3-api.us-geo.objectstorage.softlayer.net" - 2 / US Cross Region Dallas Endpoint - \ "s3-api.dal.us-geo.objectstorage.softlayer.net" - 3 / US Cross Region Washington DC Endpoint - \ "s3-api.wdc-us-geo.objectstorage.softlayer.net" - 4 / US Cross Region San Jose Endpoint - \ "s3-api.sjc-us-geo.objectstorage.softlayer.net" - 5 / US Cross Region Private Endpoint - \ "s3-api.us-geo.objectstorage.service.networklayer.com" - 6 / US Cross Region Dallas Private Endpoint - \ "s3-api.dal-us-geo.objectstorage.service.networklayer.com" - 7 / US Cross Region Washington DC Private Endpoint - \ "s3-api.wdc-us-geo.objectstorage.service.networklayer.com" - 8 / US Cross Region San Jose Private Endpoint - \ "s3-api.sjc-us-geo.objectstorage.service.networklayer.com" - 9 / US Region East Endpoint - \ "s3.us-east.objectstorage.softlayer.net" - 10 / US Region East Private Endpoint - \ "s3.us-east.objectstorage.service.networklayer.com" - 11 / US Region South Endpoint -[snip] - 34 / Toronto Single Site Private Endpoint - \ "s3.tor01.objectstorage.service.networklayer.com" - endpoint>1 -``` - - -7. Specify a IBM COS Location Constraint. The location constraint must match endpoint when using IBM Cloud Public. For on-prem COS, do not make a selection from this list, hit enter -``` - 1 / US Cross Region Standard - \ "us-standard" - 2 / US Cross Region Vault - \ "us-vault" - 3 / US Cross Region Cold - \ "us-cold" - 4 / US Cross Region Flex - \ "us-flex" - 5 / US East Region Standard - \ "us-east-standard" - 6 / US East Region Vault - \ "us-east-vault" - 7 / US East Region Cold - \ "us-east-cold" - 8 / US East Region Flex - \ "us-east-flex" - 9 / US South Region Standard - \ "us-south-standard" - 10 / US South Region Vault - \ "us-south-vault" -[snip] - 32 / Toronto Flex - \ "tor01-flex" -location_constraint>1 -``` - -9. Specify a canned ACL. IBM Cloud (Storage) supports "public-read" and "private". IBM Cloud(Infra) supports all the canned ACLs. On-Premise COS supports all the canned ACLs. -``` -Canned ACL used when creating buckets and/or storing objects in S3. -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -Choose a number from below, or type in your own value - 1 / Owner gets FULL_CONTROL. No one else has access rights (default). This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise COS - \ "private" - 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access. This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise IBM COS - \ "public-read" - 3 / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. This acl is available on IBM Cloud (Infra), On-Premise IBM COS - \ "public-read-write" - 4 / Owner gets FULL_CONTROL. The AuthenticatedUsers group gets READ access. Not supported on Buckets. This acl is available on IBM Cloud (Infra) and On-Premise IBM COS - \ "authenticated-read" -acl> 1 ``` +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a +machine with no Internet browser available. -12. Review the displayed configuration and accept to save the "remote" then quit. The config file should look like this -``` - [xxx] - type = s3 - Provider = IBMCOS - access_key_id = xxx - secret_access_key = yyy - endpoint = s3-api.us-geo.objectstorage.softlayer.net - location_constraint = us-standard - acl = private -``` - -13. Execute rclone commands -``` - 1) Create a bucket. - rclone mkdir IBM-COS-XREGION:newbucket - 2) List available buckets. - rclone lsd IBM-COS-XREGION: - -1 2017-11-08 21:16:22 -1 test - -1 2018-02-14 20:16:39 -1 newbucket - 3) List contents of a bucket. - rclone ls IBM-COS-XREGION:newbucket - 18685952 test.exe - 4) Copy a file from local to remote. - rclone copy /Users/file.txt IBM-COS-XREGION:newbucket - 5) Copy a file from remote to local. - rclone copy IBM-COS-XREGION:newbucket/file.txt . - 6) Delete a file on remote. - rclone delete IBM-COS-XREGION:newbucket/file.txt -``` +Note that rclone runs a webserver on your local machine to collect the +token as returned from Box. This only runs from the moment it opens +your browser to the moment you get back the verification code. This +is on `http://127.0.0.1:53682/` and this it may require you to unblock +it temporarily if you are running a host firewall. -### IDrive e2 {#idrive-e2} +Once configured you can then use `rclone` like this, -Here is an example of making an [IDrive e2](https://www.idrive.com/e2/) -configuration. First run: +List directories in top level of your Box - rclone config + rclone lsd remote: -This will guide you through an interactive setup process. +List all the files in your Box -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n + rclone ls remote: -Enter name for new remote. -name> e2 +To copy a local directory to an Box directory called backup -Option Storage. -Type of storage to configure. -Choose a number from below, or type in your own value. -[snip] -XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi - \ (s3) -[snip] -Storage> s3 + rclone copy /home/source remote:backup -Option provider. -Choose your S3 provider. -Choose a number from below, or type in your own value. -Press Enter to leave empty. -[snip] -XX / IDrive e2 - \ (IDrive) -[snip] -provider> IDrive +### Using rclone with an Enterprise account with SSO -Option env_auth. -Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). -Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) -env_auth> +If you have an "Enterprise" account type with Box with single sign on +(SSO), you need to create a password to use Box with rclone. This can +be done at your Enterprise Box account by going to Settings, "Account" +Tab, and then set the password in the "Authentication" field. -Option access_key_id. -AWS Access Key ID. -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -access_key_id> YOUR_ACCESS_KEY +Once you have done this, you can setup your Enterprise Box account +using the same procedure detailed above in the, using the password you +have just set. -Option secret_access_key. -AWS Secret Access Key (password). -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -secret_access_key> YOUR_SECRET_KEY +### Invalid refresh token -Option acl. -Canned ACL used when creating buckets and storing or copying objects. -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -Note that this ACL is applied when server-side copying objects as S3 -doesn't copy the ACL from the source but rather writes a fresh one. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - / Owner gets FULL_CONTROL. - 1 | No one else has access rights (default). - \ (private) - / Owner gets FULL_CONTROL. - 2 | The AllUsers group gets READ access. - \ (public-read) - / Owner gets FULL_CONTROL. - 3 | The AllUsers group gets READ and WRITE access. - | Granting this on a bucket is generally not recommended. - \ (public-read-write) - / Owner gets FULL_CONTROL. - 4 | The AuthenticatedUsers group gets READ access. - \ (authenticated-read) - / Object owner gets FULL_CONTROL. - 5 | Bucket owner gets READ access. - | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. - \ (bucket-owner-read) - / Both the object owner and the bucket owner get FULL_CONTROL over the object. - 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. - \ (bucket-owner-full-control) -acl> +According to the [box docs](https://developer.box.com/v2.0/docs/oauth-20#section-6-using-the-access-and-refresh-tokens): -Edit advanced config? -y) Yes -n) No (default) -y/n> +> Each refresh_token is valid for one use in 60 days. -Configuration complete. -Options: -- type: s3 -- provider: IDrive -- access_key_id: YOUR_ACCESS_KEY -- secret_access_key: YOUR_SECRET_KEY -- endpoint: q9d9.la12.idrivee2-5.com -Keep this "e2" remote? -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +This means that if you -### IONOS Cloud {#ionos} + * Don't use the box remote for 60 days + * Copy the config file with a box refresh token in and use it in two places + * Get an error on a token refresh -[IONOS S3 Object Storage](https://cloud.ionos.com/storage/object-storage) is a service offered by IONOS for storing and accessing unstructured data. -To connect to the service, you will need an access key and a secret key. These can be found in the [Data Center Designer](https://dcd.ionos.com/), by selecting **Manager resources** > **Object Storage Key Manager**. +then rclone will return an error which includes the text `Invalid +refresh token`. +To fix this you will need to use oauth2 again to update the refresh +token. You can use the methods in [the remote setup +docs](https://rclone.org/remote_setup/), bearing in mind that if you use the copy the +config file method, you should not use that remote on the computer you +did the authentication on. -Here is an example of a configuration. First, run `rclone config`. This will walk you through an interactive setup process. Type `n` to add the new remote, and then enter a name: +Here is how to do it. ``` -Enter name for new remote. -name> ionos-fra -``` +$ rclone config +Current remotes: -Type `s3` to choose the connection type: -``` -Option Storage. -Type of storage to configure. -Choose a number from below, or type in your own value. -[snip] -XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi - \ (s3) -[snip] -Storage> s3 -``` +Name Type +==== ==== +remote box -Type `IONOS`: -``` -Option provider. -Choose your S3 provider. -Choose a number from below, or type in your own value. -Press Enter to leave empty. -[snip] -XX / IONOS Cloud - \ (IONOS) -[snip] -provider> IONOS +e) Edit existing remote +n) New remote +d) Delete remote +r) Rename remote +c) Copy remote +s) Set configuration password +q) Quit config +e/n/d/r/c/s/q> e +Choose a number from below, or type in an existing value + 1 > remote +remote> remote +-------------------- +[remote] +type = box +token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2017-07-08T23:40:08.059167677+01:00"} +-------------------- +Edit remote +Value "client_id" = "" +Edit? (y/n)> +y) Yes +n) No +y/n> n +Value "client_secret" = "" +Edit? (y/n)> +y) Yes +n) No +y/n> n +Remote config +Already have a token - refresh? +y) Yes +n) No +y/n> y +Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. +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] +type = box +token = {"access_token":"YYY","token_type":"bearer","refresh_token":"YYY","expiry":"2017-07-23T12:22:29.259137901+01:00"} +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y ``` -Press Enter to choose the default option `Enter AWS credentials in the next step`: -``` -Option env_auth. -Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). -Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) -env_auth> -``` +### Modification times and hashes -Enter your Access Key and Secret key. These can be retrieved in the [Data Center Designer](https://dcd.ionos.com/), click on the menu “Manager resources” / "Object Storage Key Manager". -``` -Option access_key_id. -AWS Access Key ID. -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -access_key_id> YOUR_ACCESS_KEY +Box allows modification times to be set on objects accurate to 1 +second. These will be used to detect whether objects need syncing or +not. -Option secret_access_key. -AWS Secret Access Key (password). -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -secret_access_key> YOUR_SECRET_KEY -``` +Box supports SHA1 type hashes, so you can use the `--checksum` +flag. -Choose the region where your bucket is located: -``` -Option region. -Region where your bucket will be created and your data stored. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / Frankfurt, Germany - \ (de) - 2 / Berlin, Germany - \ (eu-central-2) - 3 / Logrono, Spain - \ (eu-south-2) -region> 2 -``` +### Restricted filename characters -Choose the endpoint from the same region: -``` -Option endpoint. -Endpoint for IONOS S3 Object Storage. -Specify the endpoint from the same region. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / Frankfurt, Germany - \ (s3-eu-central-1.ionoscloud.com) - 2 / Berlin, Germany - \ (s3-eu-central-2.ionoscloud.com) - 3 / Logrono, Spain - \ (s3-eu-south-2.ionoscloud.com) -endpoint> 1 -``` +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) +the following characters are also replaced: -Press Enter to choose the default option or choose the desired ACL setting: -``` -Option acl. -Canned ACL used when creating buckets and storing or copying objects. -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -Note that this ACL is applied when server-side copying objects as S3 -doesn't copy the ACL from the source but rather writes a fresh one. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - / Owner gets FULL_CONTROL. - 1 | No one else has access rights (default). - \ (private) - / Owner gets FULL_CONTROL. -[snip] -acl> -``` +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| \ | 0x5C | \ | -Press Enter to skip the advanced config: -``` -Edit advanced config? -y) Yes -n) No (default) -y/n> -``` +File names can also not end with the following characters. +These only get replaced if they are the last character in the name: -Press Enter to save the configuration, and then `q` to quit the configuration process: -``` -Configuration complete. -Options: -- type: s3 -- provider: IONOS -- access_key_id: YOUR_ACCESS_KEY -- secret_access_key: YOUR_SECRET_KEY -- endpoint: s3-eu-central-1.ionoscloud.com -Keep this "ionos-fra" remote? -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| SP | 0x20 | ␠ | -Done! Now you can try some commands (for macOS, use `./rclone` instead of `rclone`). +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. -1) Create a bucket (the name must be unique within the whole IONOS S3) -``` -rclone mkdir ionos-fra:my-bucket -``` -2) List available buckets -``` -rclone lsd ionos-fra: -``` -4) Copy a file from local to remote -``` -rclone copy /Users/file.txt ionos-fra:my-bucket -``` -3) List contents of a bucket -``` -rclone ls ionos-fra:my-bucket -``` -5) Copy a file from remote to local -``` -rclone copy ionos-fra:my-bucket/file.txt -``` +### Transfers -### Minio +For files above 50 MiB rclone will use a chunked transfer. Rclone will +upload up to `--transfers` chunks at the same time (shared among all +the multipart uploads). Chunks are buffered in memory and are +normally 8 MiB so increasing `--transfers` will increase memory use. -[Minio](https://minio.io/) is an object storage server built for cloud application developers and devops. +### Deleting files -It is very easy to install and provides an S3 compatible server which can be used by rclone. +Depending on the enterprise settings for your user, the item will +either be actually deleted from Box or moved to the trash. -To use it, install Minio following the instructions [here](https://docs.minio.io/docs/minio-quickstart-guide). +Emptying the trash is supported via the rclone however cleanup command +however this deletes every trashed file and folder individually so it +may take a very long time. +Emptying the trash via the WebUI does not have this limitation +so it is advised to empty the trash via the WebUI. -When it configures itself Minio will print something like this +### Root folder ID -``` -Endpoint: http://192.168.1.106:9000 http://172.23.0.1:9000 -AccessKey: USWUXHGYZQYFYFFIT3RE -SecretKey: MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 -Region: us-east-1 -SQS ARNs: arn:minio:sqs:us-east-1:1:redis arn:minio:sqs:us-east-1:2:redis +You can set the `root_folder_id` for rclone. This is the directory +(identified by its `Folder ID`) that rclone considers to be the root +of your Box drive. -Browser Access: - http://192.168.1.106:9000 http://172.23.0.1:9000 +Normally you will leave this blank and rclone will determine the +correct root to use itself. -Command-line Access: https://docs.minio.io/docs/minio-client-quickstart-guide - $ mc config host add myminio http://192.168.1.106:9000 USWUXHGYZQYFYFFIT3RE MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 +However you can set this to restrict rclone to a specific folder +hierarchy. -Object API (Amazon S3 compatible): - Go: https://docs.minio.io/docs/golang-client-quickstart-guide - Java: https://docs.minio.io/docs/java-client-quickstart-guide - Python: https://docs.minio.io/docs/python-client-quickstart-guide - JavaScript: https://docs.minio.io/docs/javascript-client-quickstart-guide - .NET: https://docs.minio.io/docs/dotnet-client-quickstart-guide +In order to do this you will have to find the `Folder ID` of the +directory you wish rclone to display. This will be the last segment +of the URL when you open the relevant folder in the Box web +interface. -Drive Capacity: 26 GiB Free, 165 GiB Total -``` +So if the folder you want rclone to use has a URL which looks like +`https://app.box.com/folder/11xxxxxxxxx8` +in the browser, then you use `11xxxxxxxxx8` as +the `root_folder_id` in the config. -These details need to go into `rclone config` like this. Note that it -is important to put the region in as stated above. -``` -env_auth> 1 -access_key_id> USWUXHGYZQYFYFFIT3RE -secret_access_key> MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 -region> us-east-1 -endpoint> http://192.168.1.106:9000 -location_constraint> -server_side_encryption> -``` +### Standard options -Which makes the config file look like this +Here are the Standard options specific to box (Box). -``` -[minio] -type = s3 -provider = Minio -env_auth = false -access_key_id = USWUXHGYZQYFYFFIT3RE -secret_access_key = MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 -region = us-east-1 -endpoint = http://192.168.1.106:9000 -location_constraint = -server_side_encryption = -``` +#### --box-client-id -So once set up, for example, to copy files into a bucket +OAuth Client Id. -``` -rclone copy /path/to/files minio:bucket -``` +Leave blank normally. -### Qiniu Cloud Object Storage (Kodo) {#qiniu} +Properties: -[Qiniu Cloud Object Storage (Kodo)](https://www.qiniu.com/en/products/kodo), a completely independent-researched core technology which is proven by repeated customer experience has occupied absolute leading market leader position. Kodo can be widely applied to mass data management. +- Config: client_id +- Env Var: RCLONE_BOX_CLIENT_ID +- Type: string +- Required: false -To configure access to Qiniu Kodo, follow the steps below: +#### --box-client-secret -1. Run `rclone config` and select `n` for a new remote. +OAuth Client Secret. -``` -rclone config -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -``` +Leave blank normally. -2. Give the name of the configuration. For example, name it 'qiniu'. +Properties: -``` -name> qiniu -``` +- Config: client_secret +- Env Var: RCLONE_BOX_CLIENT_SECRET +- Type: string +- Required: false -3. Select `s3` storage. +#### --box-box-config-file -``` -Choose a number from below, or type in your own value - 1 / 1Fichier - \ (fichier) - 2 / Akamai NetStorage - \ (netstorage) - 3 / Alias for an existing remote - \ (alias) - 4 / Amazon Drive - \ (amazon cloud drive) - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi - \ (s3) -[snip] -Storage> s3 -``` +Box App config.json location -4. Select `Qiniu` provider. -``` -Choose a number from below, or type in your own value -1 / Amazon Web Services (AWS) S3 - \ "AWS" -[snip] -22 / Qiniu Object Storage (Kodo) - \ (Qiniu) -[snip] -provider> Qiniu -``` +Leave blank normally. -5. Enter your SecretId and SecretKey of Qiniu Kodo. +Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. -``` -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). -Only applies if access_key_id and secret_access_key is blank. -Enter a boolean value (true or false). Press Enter for the default ("false"). -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. -Enter a string value. Press Enter for the default (""). -access_key_id> AKIDxxxxxxxxxx -AWS Secret Access Key (password) -Leave blank for anonymous access or runtime credentials. -Enter a string value. Press Enter for the default (""). -secret_access_key> xxxxxxxxxxx -``` +Properties: -6. Select endpoint for Qiniu Kodo. This is the standard endpoint for different region. +- Config: box_config_file +- Env Var: RCLONE_BOX_BOX_CONFIG_FILE +- Type: string +- Required: false -``` - / The default endpoint - a good choice if you are unsure. - 1 | East China Region 1. - | Needs location constraint cn-east-1. - \ (cn-east-1) - / East China Region 2. - 2 | Needs location constraint cn-east-2. - \ (cn-east-2) - / North China Region 1. - 3 | Needs location constraint cn-north-1. - \ (cn-north-1) - / South China Region 1. - 4 | Needs location constraint cn-south-1. - \ (cn-south-1) - / North America Region. - 5 | Needs location constraint us-north-1. - \ (us-north-1) - / Southeast Asia Region 1. - 6 | Needs location constraint ap-southeast-1. - \ (ap-southeast-1) - / Northeast Asia Region 1. - 7 | Needs location constraint ap-northeast-1. - \ (ap-northeast-1) -[snip] -endpoint> 1 +#### --box-access-token -Option endpoint. -Endpoint for Qiniu Object Storage. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / East China Endpoint 1 - \ (s3-cn-east-1.qiniucs.com) - 2 / East China Endpoint 2 - \ (s3-cn-east-2.qiniucs.com) - 3 / North China Endpoint 1 - \ (s3-cn-north-1.qiniucs.com) - 4 / South China Endpoint 1 - \ (s3-cn-south-1.qiniucs.com) - 5 / North America Endpoint 1 - \ (s3-us-north-1.qiniucs.com) - 6 / Southeast Asia Endpoint 1 - \ (s3-ap-southeast-1.qiniucs.com) - 7 / Northeast Asia Endpoint 1 - \ (s3-ap-northeast-1.qiniucs.com) -endpoint> 1 +Box App Primary Access Token -Option location_constraint. -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. -Press Enter to leave empty. - 1 / East China Region 1 - \ (cn-east-1) - 2 / East China Region 2 - \ (cn-east-2) - 3 / North China Region 1 - \ (cn-north-1) - 4 / South China Region 1 - \ (cn-south-1) - 5 / North America Region 1 - \ (us-north-1) - 6 / Southeast Asia Region 1 - \ (ap-southeast-1) - 7 / Northeast Asia Region 1 - \ (ap-northeast-1) -location_constraint> 1 -``` +Leave blank normally. -7. Choose acl and storage class. +Properties: -``` -Note that this ACL is applied when server-side copying objects as S3 -doesn't copy the ACL from the source but rather writes a fresh one. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - / Owner gets FULL_CONTROL. - 1 | No one else has access rights (default). - \ (private) - / Owner gets FULL_CONTROL. - 2 | The AllUsers group gets READ access. - \ (public-read) -[snip] -acl> 2 -The storage class to use when storing new objects in Tencent COS. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 1 / Standard storage class - \ (STANDARD) - 2 / Infrequent access storage mode - \ (LINE) - 3 / Archive storage mode - \ (GLACIER) - 4 / Deep archive storage mode - \ (DEEP_ARCHIVE) -[snip] -storage_class> 1 -Edit advanced config? (y/n) -y) Yes -n) No (default) -y/n> n -Remote config --------------------- -[qiniu] -- type: s3 -- provider: Qiniu -- access_key_id: xxx -- secret_access_key: xxx -- region: cn-east-1 -- endpoint: s3-cn-east-1.qiniucs.com -- location_constraint: cn-east-1 -- acl: public-read -- storage_class: STANDARD --------------------- -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -Current remotes: +- Config: access_token +- Env Var: RCLONE_BOX_ACCESS_TOKEN +- Type: string +- Required: false -Name Type -==== ==== -qiniu s3 -``` +#### --box-box-sub-type -### RackCorp {#RackCorp} -[RackCorp Object Storage](https://www.rackcorp.com/storage/s3storage) is an S3 compatible object storage platform from your friendly cloud provider RackCorp. -The service is fast, reliable, well priced and located in many strategic locations unserviced by others, to ensure you can maintain data sovereignty. -Before you can use RackCorp Object Storage, you'll need to "[sign up](https://www.rackcorp.com/signup)" for an account on our "[portal](https://portal.rackcorp.com)". -Next you can create an `access key`, a `secret key` and `buckets`, in your location of choice with ease. -These details are required for the next steps of configuration, when `rclone config` asks for your `access_key_id` and `secret_access_key`. +Properties: -Your config should end up looking a bit like this: +- Config: box_sub_type +- Env Var: RCLONE_BOX_BOX_SUB_TYPE +- Type: string +- Default: "user" +- Examples: + - "user" + - Rclone should act on behalf of a user. + - "enterprise" + - Rclone should act on behalf of a service account. -``` -[RCS3-demo-config] -type = s3 -provider = RackCorp -env_auth = true -access_key_id = YOURACCESSKEY -secret_access_key = YOURSECRETACCESSKEY -region = au-nsw -endpoint = s3.rackcorp.com -location_constraint = au-nsw -``` +### Advanced options +Here are the Advanced options specific to box (Box). -### Scaleway +#### --box-token -[Scaleway](https://www.scaleway.com/object-storage/) The Object Storage platform allows you to store anything from backups, logs and web assets to documents and photos. -Files can be dropped from the Scaleway console or transferred through our API and CLI or using any S3-compatible tool. +OAuth Access Token as a JSON blob. -Scaleway provides an S3 interface which can be configured for use with rclone like this: +Properties: -``` -[scaleway] -type = s3 -provider = Scaleway -env_auth = false -endpoint = s3.nl-ams.scw.cloud -access_key_id = SCWXXXXXXXXXXXXXX -secret_access_key = 1111111-2222-3333-44444-55555555555555 -region = nl-ams -location_constraint = -acl = private -server_side_encryption = -storage_class = -``` +- Config: token +- Env Var: RCLONE_BOX_TOKEN +- Type: string +- Required: false -[C14 Cold Storage](https://www.online.net/en/storage/c14-cold-storage) is the low-cost S3 Glacier alternative from Scaleway and it works the same way as on S3 by accepting the "GLACIER" `storage_class`. -So you can configure your remote with the `storage_class = GLACIER` option to upload directly to C14. Don't forget that in this state you can't read files back after, you will need to restore them to "STANDARD" storage_class first before being able to read them (see "restore" section above) +#### --box-auth-url -### Seagate Lyve Cloud {#lyve} +Auth server URL. -[Seagate Lyve Cloud](https://www.seagate.com/gb/en/services/cloud/storage/) is an S3 -compatible object storage platform from [Seagate](https://seagate.com/) intended for enterprise use. +Leave blank to use the provider defaults. -Here is a config run through for a remote called `remote` - you may -choose a different name of course. Note that to create an access key -and secret key you will need to create a service account first. +Properties: -``` -$ rclone config -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> remote -``` +- Config: auth_url +- Env Var: RCLONE_BOX_AUTH_URL +- Type: string +- Required: false -Choose `s3` backend +#### --box-token-url -``` -Type of storage to configure. -Choose a number from below, or type in your own value. -[snip] -XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS - \ (s3) -[snip] -Storage> s3 -``` +Token server url. -Choose `LyveCloud` as S3 provider +Leave blank to use the provider defaults. -``` -Choose your S3 provider. -Choose a number from below, or type in your own value. -Press Enter to leave empty. -[snip] -XX / Seagate Lyve Cloud - \ (LyveCloud) -[snip] -provider> LyveCloud -``` +Properties: -Take the default (just press enter) to enter access key and secret in the config file. +- Config: token_url +- Env Var: RCLONE_BOX_TOKEN_URL +- Type: string +- Required: false -``` -Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). -Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) -env_auth> -``` +#### --box-root-folder-id -``` -AWS Access Key ID. -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -access_key_id> XXX -``` +Fill in for rclone to use a non root folder as its starting point. -``` -AWS Secret Access Key (password). -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -secret_access_key> YYY -``` +Properties: -Leave region blank +- Config: root_folder_id +- Env Var: RCLONE_BOX_ROOT_FOLDER_ID +- Type: string +- Default: "0" -``` -Region to connect to. -Leave blank if you are using an S3 clone and you don't have a region. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - / Use this if unsure. - 1 | Will use v4 signatures and an empty region. - \ () - / Use this only if v4 signatures don't work. - 2 | E.g. pre Jewel/v10 CEPH. - \ (other-v2-signature) -region> -``` +#### --box-upload-cutoff -Choose an endpoint from the list +Cutoff for switching to multipart upload (>= 50 MiB). -``` -Endpoint for S3 API. -Required when using an S3 clone. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / Seagate Lyve Cloud US East 1 (Virginia) - \ (s3.us-east-1.lyvecloud.seagate.com) - 2 / Seagate Lyve Cloud US West 1 (California) - \ (s3.us-west-1.lyvecloud.seagate.com) - 3 / Seagate Lyve Cloud AP Southeast 1 (Singapore) - \ (s3.ap-southeast-1.lyvecloud.seagate.com) -endpoint> 1 -``` +Properties: -Leave location constraint blank +- Config: upload_cutoff +- Env Var: RCLONE_BOX_UPLOAD_CUTOFF +- Type: SizeSuffix +- Default: 50Mi -``` -Location constraint - must be set to match the Region. -Leave blank if not sure. Used when creating buckets only. -Enter a value. Press Enter to leave empty. -location_constraint> -``` +#### --box-commit-retries -Choose default ACL (`private`). +Max number of times to try committing a multipart file. -``` -Canned ACL used when creating buckets and storing or copying objects. -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -Note that this ACL is applied when server-side copying objects as S3 -doesn't copy the ACL from the source but rather writes a fresh one. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - / Owner gets FULL_CONTROL. - 1 | No one else has access rights (default). - \ (private) -[snip] -acl> -``` +Properties: -And the config file should end up looking like this: +- Config: commit_retries +- Env Var: RCLONE_BOX_COMMIT_RETRIES +- Type: int +- Default: 100 -``` -[remote] -type = s3 -provider = LyveCloud -access_key_id = XXX -secret_access_key = YYY -endpoint = s3.us-east-1.lyvecloud.seagate.com -``` +#### --box-list-chunk -### SeaweedFS +Size of listing chunk 1-1000. -[SeaweedFS](https://github.com/chrislusf/seaweedfs/) is a distributed storage system for -blobs, objects, files, and data lake, with O(1) disk seek and a scalable file metadata store. -It has an S3 compatible object storage interface. SeaweedFS can also act as a -[gateway to remote S3 compatible object store](https://github.com/chrislusf/seaweedfs/wiki/Gateway-to-Remote-Object-Storage) -to cache data and metadata with asynchronous write back, for fast local speed and minimize access cost. +Properties: -Assuming the SeaweedFS are configured with `weed shell` as such: -``` -> s3.bucket.create -name foo -> s3.configure -access_key=any -secret_key=any -buckets=foo -user=me -actions=Read,Write,List,Tagging,Admin -apply -{ - "identities": [ - { - "name": "me", - "credentials": [ - { - "accessKey": "any", - "secretKey": "any" - } - ], - "actions": [ - "Read:foo", - "Write:foo", - "List:foo", - "Tagging:foo", - "Admin:foo" - ] - } - ] -} -``` +- Config: list_chunk +- Env Var: RCLONE_BOX_LIST_CHUNK +- Type: int +- Default: 1000 -To use rclone with SeaweedFS, above configuration should end up with something like this in -your config: +#### --box-owned-by -``` -[seaweedfs_s3] -type = s3 -provider = SeaweedFS -access_key_id = any -secret_access_key = any -endpoint = localhost:8333 -``` +Only show items owned by the login (email address) passed in. -So once set up, for example to copy files into a bucket +Properties: -``` -rclone copy /path/to/files seaweedfs_s3:foo -``` +- Config: owned_by +- Env Var: RCLONE_BOX_OWNED_BY +- Type: string +- Required: false -### Wasabi +#### --box-impersonate -[Wasabi](https://wasabi.com) is a cloud-based object storage service for a -broad range of applications and use cases. Wasabi is designed for -individuals and organizations that require a high-performance, -reliable, and secure data storage infrastructure at minimal cost. +Impersonate this user ID when using a service account. -Wasabi provides an S3 interface which can be configured for use with -rclone like this. +Setting this flag allows rclone, when using a JWT service account, to +act on behalf of another user by setting the as-user header. -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -n/s> n -name> wasabi -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Minio, Liara) - \ "s3" -[snip] -Storage> s3 -Get AWS credentials from runtime (environment variables or EC2/ECS 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> YOURACCESSKEY -AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. -secret_access_key> YOURSECRETACCESSKEY -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" -[snip] -region> us-east-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> s3.wasabisys.com -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. - \ "" -[snip] -location_constraint> -Canned ACL used when creating buckets and/or storing objects in S3. -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -Choose a number from below, or type in your own value - 1 / Owner gets FULL_CONTROL. No one else has access rights (default). - \ "private" -[snip] -acl> -The server-side encryption algorithm used when storing this object in S3. -Choose a number from below, or type in your own value - 1 / None - \ "" - 2 / AES256 - \ "AES256" -server_side_encryption> -The storage class to use when storing objects in S3. -Choose a number from below, or type in your own value - 1 / Default - \ "" - 2 / Standard storage class - \ "STANDARD" - 3 / Reduced redundancy storage class - \ "REDUCED_REDUNDANCY" - 4 / Standard Infrequent Access storage class - \ "STANDARD_IA" -storage_class> -Remote config --------------------- -[wasabi] -env_auth = false -access_key_id = YOURACCESSKEY -secret_access_key = YOURSECRETACCESSKEY -region = us-east-1 -endpoint = s3.wasabisys.com -location_constraint = -acl = -server_side_encryption = -storage_class = --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +The user ID is the Box identifier for a user. User IDs can found for +any user via the GET /users endpoint, which is only available to +admins, or by calling the GET /users/me endpoint with an authenticated +user session. + +See: https://developer.box.com/guides/authentication/jwt/as-user/ + + +Properties: + +- Config: impersonate +- Env Var: RCLONE_BOX_IMPERSONATE +- Type: string +- Required: false -This will leave the config file looking like this. +#### --box-encoding -``` -[wasabi] -type = s3 -provider = Wasabi -env_auth = false -access_key_id = YOURACCESSKEY -secret_access_key = YOURSECRETACCESSKEY -region = -endpoint = s3.wasabisys.com -location_constraint = -acl = -server_side_encryption = -storage_class = -``` +The encoding for the backend. -### Alibaba OSS {#alibaba-oss} +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -Here is an example of making an [Alibaba Cloud (Aliyun) OSS](https://www.alibabacloud.com/product/oss/) -configuration. First run: +Properties: - rclone config +- Config: encoding +- Env Var: RCLONE_BOX_ENCODING +- Type: Encoding +- Default: Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot -This will guide you through an interactive setup process. -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> oss -Type of storage to configure. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value -[snip] - 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Minio, and Tencent COS - \ "s3" -[snip] -Storage> s3 -Choose your S3 provider. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 1 / Amazon Web Services (AWS) S3 - \ "AWS" - 2 / Alibaba Cloud Object Storage System (OSS) formerly Aliyun - \ "Alibaba" - 3 / Ceph Object Storage - \ "Ceph" -[snip] -provider> Alibaba -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). -Only applies if access_key_id and secret_access_key is blank. -Enter a boolean value (true or false). Press Enter for the default ("false"). -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. -Enter a string value. Press Enter for the default (""). -access_key_id> accesskeyid -AWS Secret Access Key (password) -Leave blank for anonymous access or runtime credentials. -Enter a string value. Press Enter for the default (""). -secret_access_key> secretaccesskey -Endpoint for OSS API. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 1 / East China 1 (Hangzhou) - \ "oss-cn-hangzhou.aliyuncs.com" - 2 / East China 2 (Shanghai) - \ "oss-cn-shanghai.aliyuncs.com" - 3 / North China 1 (Qingdao) - \ "oss-cn-qingdao.aliyuncs.com" -[snip] -endpoint> 1 -Canned ACL used when creating buckets and storing or copying objects. -Note that this ACL is applied when server-side copying objects as S3 -doesn't copy the ACL from the source but rather writes a fresh one. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 1 / Owner gets FULL_CONTROL. No one else has access rights (default). - \ "private" - 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access. - \ "public-read" - / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. -[snip] -acl> 1 -The storage class to use when storing new objects in OSS. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 1 / Default - \ "" - 2 / Standard storage class - \ "STANDARD" - 3 / Archive storage mode. - \ "GLACIER" - 4 / Infrequent access storage mode. - \ "STANDARD_IA" -storage_class> 1 -Edit advanced config? (y/n) -y) Yes -n) No -y/n> n -Remote config --------------------- -[oss] -type = s3 -provider = Alibaba -env_auth = false -access_key_id = accesskeyid -secret_access_key = secretaccesskey -endpoint = oss-cn-hangzhou.aliyuncs.com -acl = private -storage_class = Standard --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +## Limitations -### China Mobile Ecloud Elastic Object Storage (EOS) {#china-mobile-ecloud-eos} +Note that Box is case insensitive so you can't have a file called +"Hello.doc" and one called "hello.doc". -Here is an example of making an [China Mobile Ecloud Elastic Object Storage (EOS)](https:///ecloud.10086.cn/home/product-introduction/eos/) -configuration. First run: +Box file names can't have the `\` character in. rclone maps this to +and from an identical looking unicode equivalent `\` (U+FF3C Fullwidth +Reverse Solidus). - rclone config +Box only supports filenames up to 255 characters in length. -This will guide you through an interactive setup process. +Box has [API rate limits](https://developer.box.com/guides/api-calls/permissions-and-errors/rate-limits/) that sometimes reduce the speed of rclone. -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> ChinaMobile -Option Storage. -Type of storage to configure. -Choose a number from below, or type in your own value. - ... - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS - \ (s3) - ... -Storage> s3 -Option provider. -Choose your S3 provider. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - ... - 4 / China Mobile Ecloud Elastic Object Storage (EOS) - \ (ChinaMobile) - ... -provider> ChinaMobile -Option env_auth. -Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). -Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) -env_auth> -Option access_key_id. -AWS Access Key ID. -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -access_key_id> accesskeyid -Option secret_access_key. -AWS Secret Access Key (password). -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -secret_access_key> secretaccesskey -Option endpoint. -Endpoint for China Mobile Ecloud Elastic Object Storage (EOS) API. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - / The default endpoint - a good choice if you are unsure. - 1 | East China (Suzhou) - \ (eos-wuxi-1.cmecloud.cn) - 2 / East China (Jinan) - \ (eos-jinan-1.cmecloud.cn) - 3 / East China (Hangzhou) - \ (eos-ningbo-1.cmecloud.cn) - 4 / East China (Shanghai-1) - \ (eos-shanghai-1.cmecloud.cn) - 5 / Central China (Zhengzhou) - \ (eos-zhengzhou-1.cmecloud.cn) - 6 / Central China (Changsha-1) - \ (eos-hunan-1.cmecloud.cn) - 7 / Central China (Changsha-2) - \ (eos-zhuzhou-1.cmecloud.cn) - 8 / South China (Guangzhou-2) - \ (eos-guangzhou-1.cmecloud.cn) - 9 / South China (Guangzhou-3) - \ (eos-dongguan-1.cmecloud.cn) -10 / North China (Beijing-1) - \ (eos-beijing-1.cmecloud.cn) -11 / North China (Beijing-2) - \ (eos-beijing-2.cmecloud.cn) -12 / North China (Beijing-3) - \ (eos-beijing-4.cmecloud.cn) -13 / North China (Huhehaote) - \ (eos-huhehaote-1.cmecloud.cn) -14 / Southwest China (Chengdu) - \ (eos-chengdu-1.cmecloud.cn) -15 / Southwest China (Chongqing) - \ (eos-chongqing-1.cmecloud.cn) -16 / Southwest China (Guiyang) - \ (eos-guiyang-1.cmecloud.cn) -17 / Nouthwest China (Xian) - \ (eos-xian-1.cmecloud.cn) -18 / Yunnan China (Kunming) - \ (eos-yunnan.cmecloud.cn) -19 / Yunnan China (Kunming-2) - \ (eos-yunnan-2.cmecloud.cn) -20 / Tianjin China (Tianjin) - \ (eos-tianjin-1.cmecloud.cn) -21 / Jilin China (Changchun) - \ (eos-jilin-1.cmecloud.cn) -22 / Hubei China (Xiangyan) - \ (eos-hubei-1.cmecloud.cn) -23 / Jiangxi China (Nanchang) - \ (eos-jiangxi-1.cmecloud.cn) -24 / Gansu China (Lanzhou) - \ (eos-gansu-1.cmecloud.cn) -25 / Shanxi China (Taiyuan) - \ (eos-shanxi-1.cmecloud.cn) -26 / Liaoning China (Shenyang) - \ (eos-liaoning-1.cmecloud.cn) -27 / Hebei China (Shijiazhuang) - \ (eos-hebei-1.cmecloud.cn) -28 / Fujian China (Xiamen) - \ (eos-fujian-1.cmecloud.cn) -29 / Guangxi China (Nanning) - \ (eos-guangxi-1.cmecloud.cn) -30 / Anhui China (Huainan) - \ (eos-anhui-1.cmecloud.cn) -endpoint> 1 -Option location_constraint. -Location constraint - must match endpoint. -Used when creating buckets only. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / East China (Suzhou) - \ (wuxi1) - 2 / East China (Jinan) - \ (jinan1) - 3 / East China (Hangzhou) - \ (ningbo1) - 4 / East China (Shanghai-1) - \ (shanghai1) - 5 / Central China (Zhengzhou) - \ (zhengzhou1) - 6 / Central China (Changsha-1) - \ (hunan1) - 7 / Central China (Changsha-2) - \ (zhuzhou1) - 8 / South China (Guangzhou-2) - \ (guangzhou1) - 9 / South China (Guangzhou-3) - \ (dongguan1) -10 / North China (Beijing-1) - \ (beijing1) -11 / North China (Beijing-2) - \ (beijing2) -12 / North China (Beijing-3) - \ (beijing4) -13 / North China (Huhehaote) - \ (huhehaote1) -14 / Southwest China (Chengdu) - \ (chengdu1) -15 / Southwest China (Chongqing) - \ (chongqing1) -16 / Southwest China (Guiyang) - \ (guiyang1) -17 / Nouthwest China (Xian) - \ (xian1) -18 / Yunnan China (Kunming) - \ (yunnan) -19 / Yunnan China (Kunming-2) - \ (yunnan2) -20 / Tianjin China (Tianjin) - \ (tianjin1) -21 / Jilin China (Changchun) - \ (jilin1) -22 / Hubei China (Xiangyan) - \ (hubei1) -23 / Jiangxi China (Nanchang) - \ (jiangxi1) -24 / Gansu China (Lanzhou) - \ (gansu1) -25 / Shanxi China (Taiyuan) - \ (shanxi1) -26 / Liaoning China (Shenyang) - \ (liaoning1) -27 / Hebei China (Shijiazhuang) - \ (hebei1) -28 / Fujian China (Xiamen) - \ (fujian1) -29 / Guangxi China (Nanning) - \ (guangxi1) -30 / Anhui China (Huainan) - \ (anhui1) -location_constraint> 1 -Option acl. -Canned ACL used when creating buckets and storing or copying objects. -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -Note that this ACL is applied when server-side copying objects as S3 -doesn't copy the ACL from the source but rather writes a fresh one. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - / Owner gets FULL_CONTROL. - 1 | No one else has access rights (default). - \ (private) - / Owner gets FULL_CONTROL. - 2 | The AllUsers group gets READ access. - \ (public-read) - / Owner gets FULL_CONTROL. - 3 | The AllUsers group gets READ and WRITE access. - | Granting this on a bucket is generally not recommended. - \ (public-read-write) - / Owner gets FULL_CONTROL. - 4 | The AuthenticatedUsers group gets READ access. - \ (authenticated-read) - / Object owner gets FULL_CONTROL. -acl> private -Option server_side_encryption. -The server-side encryption algorithm used when storing this object in S3. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / None - \ () - 2 / AES256 - \ (AES256) -server_side_encryption> -Option storage_class. -The storage class to use when storing new objects in ChinaMobile. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / Default - \ () - 2 / Standard storage class - \ (STANDARD) - 3 / Archive storage mode - \ (GLACIER) - 4 / Infrequent access storage mode - \ (STANDARD_IA) -storage_class> -Edit advanced config? -y) Yes -n) No (default) -y/n> n --------------------- -[ChinaMobile] -type = s3 -provider = ChinaMobile -access_key_id = accesskeyid -secret_access_key = secretaccesskey -endpoint = eos-wuxi-1.cmecloud.cn -location_constraint = wuxi1 -acl = private --------------------- -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -``` -### Leviia Cloud Object Storage {#leviia} +`rclone about` is not supported by the Box backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. -[Leviia Object Storage](https://www.leviia.com/object-storage/), backup and secure your data in a 100% French cloud, independent of GAFAM.. +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -To configure access to Leviia, follow the steps below: +## Get your own Box App ID -1. Run `rclone config` and select `n` for a new remote. +Here is how to create your own Box App ID for rclone: -``` -rclone config -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -``` +1. Go to the [Box Developer Console](https://app.box.com/developers/console) +and login, then click `My Apps` on the sidebar. Click `Create New App` +and select `Custom App`. -2. Give the name of the configuration. For example, name it 'leviia'. +2. In the first screen on the box that pops up, you can pretty much enter +whatever you want. The `App Name` can be whatever. For `Purpose` choose +automation to avoid having to fill out anything else. Click `Next`. -``` -name> leviia -``` +3. In the second screen of the creation screen, select +`User Authentication (OAuth 2.0)`. Then click `Create App`. -3. Select `s3` storage. +4. You should now be on the `Configuration` tab of your new app. If not, +click on it at the top of the webpage. Copy down `Client ID` +and `Client Secret`, you'll need those for rclone. -``` -Choose a number from below, or type in your own value - 1 / 1Fichier - \ (fichier) - 2 / Akamai NetStorage - \ (netstorage) - 3 / Alias for an existing remote - \ (alias) - 4 / Amazon Drive - \ (amazon cloud drive) - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi - \ (s3) -[snip] -Storage> s3 -``` +5. Under "OAuth 2.0 Redirect URI", add `http://127.0.0.1:53682/` -4. Select `Leviia` provider. -``` -Choose a number from below, or type in your own value -1 / Amazon Web Services (AWS) S3 - \ "AWS" -[snip] -15 / Leviia Object Storage - \ (Leviia) -[snip] -provider> Leviia -``` +6. For `Application Scopes`, select `Read all files and folders stored in Box` +and `Write all files and folders stored in box` (assuming you want to do both). +Leave others unchecked. Click `Save Changes` at the top right. -5. Enter your SecretId and SecretKey of Leviia. +# Cache -``` -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). -Only applies if access_key_id and secret_access_key is blank. -Enter a boolean value (true or false). Press Enter for the default ("false"). -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. -Enter a string value. Press Enter for the default (""). -access_key_id> ZnIx.xxxxxxxxxxxxxxx -AWS Secret Access Key (password) -Leave blank for anonymous access or runtime credentials. -Enter a string value. Press Enter for the default (""). -secret_access_key> xxxxxxxxxxx -``` +The `cache` remote wraps another existing remote and stores file structure +and its data for long running tasks like `rclone mount`. -6. Select endpoint for Leviia. +## Status -``` - / The default endpoint - 1 | Leviia. - \ (s3.leviia.com) -[snip] -endpoint> 1 -``` -7. Choose acl. +The cache backend code is working but it currently doesn't +have a maintainer so there are [outstanding bugs](https://github.com/rclone/rclone/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3A%22Remote%3A+Cache%22) which aren't getting fixed. -``` -Note that this ACL is applied when server-side copying objects as S3 -doesn't copy the ACL from the source but rather writes a fresh one. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - / Owner gets FULL_CONTROL. - 1 | No one else has access rights (default). - \ (private) - / Owner gets FULL_CONTROL. - 2 | The AllUsers group gets READ access. - \ (public-read) -[snip] -acl> 1 -Edit advanced config? (y/n) -y) Yes -n) No (default) -y/n> n -Remote config --------------------- -[leviia] -- type: s3 -- provider: Leviia -- access_key_id: ZnIx.xxxxxxx -- secret_access_key: xxxxxxxx -- endpoint: s3.leviia.com -- acl: private --------------------- -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -Current remotes: +The cache backend is due to be phased out in favour of the VFS caching +layer eventually which is more tightly integrated into rclone. -Name Type -==== ==== -leviia s3 -``` -### Liara {#liara-cloud} +Until this happens we recommend only using the cache backend if you +find you can't work without it. There are many docs online describing +the use of the cache backend to minimize API hits and by-and-large +these are out of date and the cache backend isn't needed in those +scenarios any more. -Here is an example of making a [Liara Object Storage](https://liara.ir/landing/object-storage) -configuration. First run: +## Configuration - rclone config +To get started you just need to have an existing remote which can be configured +with `cache`. -This will guide you through an interactive setup process. +Here is an example of how to make a remote called `test-cache`. First run: + + rclone config + +This will guide you through an interactive setup process: ``` No remotes found, make a new one? n) New remote +r) Rename remote +c) Copy remote s) Set configuration password -n/s> n -name> Liara +q) Quit config +n/r/c/s/q> n +name> test-cache Type of storage to configure. Choose a number from below, or type in your own value [snip] -XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Liara, Minio) - \ "s3" -[snip] -Storage> s3 -Get AWS credentials from runtime (environment variables or EC2/ECS 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> YOURACCESSKEY -AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. -secret_access_key> YOURSECRETACCESSKEY -Region to connect to. -Choose a number from below, or type in your own value - / The default endpoint - 1 | US Region, Northern Virginia, or Pacific Northwest. - | Leave location constraint empty. - \ "us-east-1" +XX / Cache a remote + \ "cache" [snip] -region> -Endpoint for S3 API. -Leave blank if using Liara to use the default endpoint for the region. -Specify if using an S3 clone such as Ceph. -endpoint> storage.iran.liara.space -Canned ACL used when creating buckets and/or storing objects in S3. -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Storage> cache +Remote to cache. +Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", +"myremote:bucket" or maybe "myremote:" (not recommended). +remote> local:/test +Optional: The URL of the Plex server +plex_url> http://127.0.0.1:32400 +Optional: The username of the Plex user +plex_username> dummyusername +Optional: The password of the Plex user +y) Yes type in my own password +g) Generate random password +n) No leave this optional password blank +y/g/n> y +Enter the password: +password: +Confirm the password: +password: +The size of a chunk. Lower value good for slow connections but can affect seamless reading. +Default: 5M Choose a number from below, or type in your own value - 1 / Owner gets FULL_CONTROL. No one else has access rights (default). - \ "private" -[snip] -acl> -The server-side encryption algorithm used when storing this object in S3. + 1 / 1 MiB + \ "1M" + 2 / 5 MiB + \ "5M" + 3 / 10 MiB + \ "10M" +chunk_size> 2 +How much time should object info (file size, file hashes, etc.) be stored in cache. Use a very high value if you don't plan on changing the source FS from outside the cache. +Accepted units are: "s", "m", "h". +Default: 5m Choose a number from below, or type in your own value - 1 / None - \ "" - 2 / AES256 - \ "AES256" -server_side_encryption> -The storage class to use when storing objects in S3. + 1 / 1 hour + \ "1h" + 2 / 24 hours + \ "24h" + 3 / 24 hours + \ "48h" +info_age> 2 +The maximum size of stored chunks. When the storage grows beyond this size, the oldest chunks will be deleted. +Default: 10G Choose a number from below, or type in your own value - 1 / Default - \ "" - 2 / Standard storage class - \ "STANDARD" -storage_class> + 1 / 500 MiB + \ "500M" + 2 / 1 GiB + \ "1G" + 3 / 10 GiB + \ "10G" +chunk_total_size> 3 Remote config -------------------- -[Liara] -env_auth = false -access_key_id = YOURACCESSKEY -secret_access_key = YOURSECRETACCESSKEY -endpoint = storage.iran.liara.space -location_constraint = -acl = -server_side_encryption = -storage_class = --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y +[test-cache] +remote = local:/test +plex_url = http://127.0.0.1:32400 +plex_username = dummyusername +plex_password = *** ENCRYPTED *** +chunk_size = 5M +info_age = 48h +chunk_total_size = 10G ``` -This will leave the config file looking like this. +You can then use it like this, -``` -[Liara] -type = s3 -provider = Liara -env_auth = false -access_key_id = YOURACCESSKEY -secret_access_key = YOURSECRETACCESSKEY -region = -endpoint = storage.iran.liara.space -location_constraint = -acl = -server_side_encryption = -storage_class = -``` +List directories in top level of your drive -### ArvanCloud {#arvan-cloud} + rclone lsd test-cache: -[ArvanCloud](https://www.arvancloud.com/en/products/cloud-storage) ArvanCloud Object Storage goes beyond the limited traditional file storage. -It gives you access to backup and archived files and allows sharing. -Files like profile image in the app, images sent by users or scanned documents can be stored securely and easily in our Object Storage service. +List all the files in your drive -ArvanCloud provides an S3 interface which can be configured for use with -rclone like this. + rclone ls test-cache: -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -n/s> n -name> ArvanCloud -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Liara, Minio) - \ "s3" -[snip] -Storage> s3 -Get AWS credentials from runtime (environment variables or EC2/ECS 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> YOURACCESSKEY -AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. -secret_access_key> YOURSECRETACCESSKEY -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" -[snip] -region> -Endpoint for S3 API. -Leave blank if using ArvanCloud to use the default endpoint for the region. -Specify if using an S3 clone such as Ceph. -endpoint> s3.arvanstorage.com -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 Iran-Tehran Region. - \ "" -[snip] -location_constraint> -Canned ACL used when creating buckets and/or storing objects in S3. -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -Choose a number from below, or type in your own value - 1 / Owner gets FULL_CONTROL. No one else has access rights (default). - \ "private" -[snip] -acl> -The server-side encryption algorithm used when storing this object in S3. -Choose a number from below, or type in your own value - 1 / None - \ "" - 2 / AES256 - \ "AES256" -server_side_encryption> -The storage class to use when storing objects in S3. -Choose a number from below, or type in your own value - 1 / Default - \ "" - 2 / Standard storage class - \ "STANDARD" -storage_class> -Remote config --------------------- -[ArvanCloud] -env_auth = false -access_key_id = YOURACCESSKEY -secret_access_key = YOURSECRETACCESSKEY -region = ir-thr-at1 -endpoint = s3.arvanstorage.com -location_constraint = -acl = -server_side_encryption = -storage_class = --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +To start a cached mount -This will leave the config file looking like this. + rclone mount --allow-other test-cache: /var/tmp/test-cache -``` -[ArvanCloud] -type = s3 -provider = ArvanCloud -env_auth = false -access_key_id = YOURACCESSKEY -secret_access_key = YOURSECRETACCESSKEY -region = -endpoint = s3.arvanstorage.com -location_constraint = -acl = -server_side_encryption = -storage_class = -``` +### Write Features ### -### Tencent COS {#tencent-cos} +### Offline uploading ### -[Tencent Cloud Object Storage (COS)](https://intl.cloud.tencent.com/product/cos) is a distributed storage service offered by Tencent Cloud for unstructured data. It is secure, stable, massive, convenient, low-delay and low-cost. +In an effort to make writing through cache more reliable, the backend +now supports this feature which can be activated by specifying a +`cache-tmp-upload-path`. -To configure access to Tencent COS, follow the steps below: +A files goes through these states when using this feature: -1. Run `rclone config` and select `n` for a new remote. +1. An upload is started (usually by copying a file on the cache remote) +2. When the copy to the temporary location is complete the file is part +of the cached remote and looks and behaves like any other file (reading included) +3. After `cache-tmp-wait-time` passes and the file is next in line, `rclone move` +is used to move the file to the cloud provider +4. Reading the file still works during the upload but most modifications on it will be prohibited +5. Once the move is complete the file is unlocked for modifications as it +becomes as any other regular file +6. If the file is being read through `cache` when it's actually +deleted from the temporary path then `cache` will simply swap the source +to the cloud provider without interrupting the reading (small blip can happen though) -``` -rclone config -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -``` +Files are uploaded in sequence and only one file is uploaded at a time. +Uploads will be stored in a queue and be processed based on the order they were added. +The queue and the temporary storage is persistent across restarts but +can be cleared on startup with the `--cache-db-purge` flag. -2. Give the name of the configuration. For example, name it 'cos'. +### Write Support ### -``` -name> cos -``` +Writes are supported through `cache`. +One caveat is that a mounted cache remote does not add any retry or fallback +mechanism to the upload operation. This will depend on the implementation +of the wrapped remote. Consider using `Offline uploading` for reliable writes. -3. Select `s3` storage. +One special case is covered with `cache-writes` which will cache the file +data at the same time as the upload when it is enabled making it available +from the cache store immediately once the upload is finished. -``` -Choose a number from below, or type in your own value -1 / 1Fichier - \ "fichier" - 2 / Alias for an existing remote - \ "alias" - 3 / Amazon Drive - \ "amazon cloud drive" - 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Minio, and Tencent COS - \ "s3" -[snip] -Storage> s3 -``` +### Read Features ### -4. Select `TencentCOS` provider. -``` -Choose a number from below, or type in your own value -1 / Amazon Web Services (AWS) S3 - \ "AWS" -[snip] -11 / Tencent Cloud Object Storage (COS) - \ "TencentCOS" -[snip] -provider> TencentCOS -``` +#### Multiple connections #### -5. Enter your SecretId and SecretKey of Tencent Cloud. +To counter the high latency between a local PC where rclone is running +and cloud providers, the cache remote can split multiple requests to the +cloud provider for smaller file chunks and combines them together locally +where they can be available almost immediately before the reader usually +needs them. -``` -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). -Only applies if access_key_id and secret_access_key is blank. -Enter a boolean value (true or false). Press Enter for the default ("false"). -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. -Enter a string value. Press Enter for the default (""). -access_key_id> AKIDxxxxxxxxxx -AWS Secret Access Key (password) -Leave blank for anonymous access or runtime credentials. -Enter a string value. Press Enter for the default (""). -secret_access_key> xxxxxxxxxxx -``` +This is similar to buffering when media files are played online. Rclone +will stay around the current marker but always try its best to stay ahead +and prepare the data before. -6. Select endpoint for Tencent COS. This is the standard endpoint for different region. +#### Plex Integration #### -``` - 1 / Beijing Region. - \ "cos.ap-beijing.myqcloud.com" - 2 / Nanjing Region. - \ "cos.ap-nanjing.myqcloud.com" - 3 / Shanghai Region. - \ "cos.ap-shanghai.myqcloud.com" - 4 / Guangzhou Region. - \ "cos.ap-guangzhou.myqcloud.com" -[snip] -endpoint> 4 -``` +There is a direct integration with Plex which allows cache to detect during reading +if the file is in playback or not. This helps cache to adapt how it queries +the cloud provider depending on what is needed for. -7. Choose acl and storage class. +Scans will have a minimum amount of workers (1) while in a confirmed playback cache +will deploy the configured number of workers. -``` -Note that this ACL is applied when server-side copying objects as S3 -doesn't copy the ACL from the source but rather writes a fresh one. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 1 / Owner gets Full_CONTROL. No one else has access rights (default). - \ "default" -[snip] -acl> 1 -The storage class to use when storing new objects in Tencent COS. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 1 / Default - \ "" -[snip] -storage_class> 1 -Edit advanced config? (y/n) -y) Yes -n) No (default) -y/n> n -Remote config --------------------- -[cos] -type = s3 -provider = TencentCOS -env_auth = false -access_key_id = xxx -secret_access_key = xxx -endpoint = cos.ap-guangzhou.myqcloud.com -acl = default --------------------- -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -Current remotes: +This integration opens the doorway to additional performance improvements +which will be explored in the near future. -Name Type -==== ==== -cos s3 -``` +**Note:** If Plex options are not configured, `cache` will function with its +configured options without adapting any of its settings. -### Netease NOS +How to enable? Run `rclone config` and add all the Plex options (endpoint, username +and password) in your remote and it will be automatically enabled. -For Netease NOS configure as per the configurator `rclone config` -setting the provider `Netease`. This will automatically set -`force_path_style = false` which is necessary for it to run properly. +Affected settings: +- `cache-workers`: _Configured value_ during confirmed playback or _1_ all the other times -### Petabox +##### Certificate Validation ##### -Here is an example of making a [Petabox](https://petabox.io/) -configuration. First run: +When the Plex server is configured to only accept secure connections, it is +possible to use `.plex.direct` URLs to ensure certificate validation succeeds. +These URLs are used by Plex internally to connect to the Plex server securely. -```bash -rclone config -``` +The format for these URLs is the following: -This will guide you through an interactive setup process. +`https://ip-with-dots-replaced.server-hash.plex.direct:32400/` -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -n/s> n +The `ip-with-dots-replaced` part can be any IPv4 address, where the dots +have been replaced with dashes, e.g. `127.0.0.1` becomes `127-0-0-1`. -Enter name for new remote. -name> My Petabox Storage +To get the `server-hash` part, the easiest way is to visit -Option Storage. -Type of storage to configure. -Choose a number from below, or type in your own value. -[snip] -XX / Amazon S3 Compliant Storage Providers including AWS, ... - \ "s3" -[snip] -Storage> s3 +https://plex.tv/api/resources?includeHttps=1&X-Plex-Token=your-plex-token -Option provider. -Choose your S3 provider. -Choose a number from below, or type in your own value. -Press Enter to leave empty. -[snip] -XX / Petabox Object Storage - \ (Petabox) -[snip] -provider> Petabox +This page will list all the available Plex servers for your account +with at least one `.plex.direct` link for each. Copy one URL and replace +the IP address with the desired address. This can be used as the +`plex_url` value. + +### Known issues ### + +#### Mount and --dir-cache-time #### + +--dir-cache-time controls the first layer of directory caching which works at the mount layer. +Being an independent caching mechanism from the `cache` backend, it will manage its own entries +based on the configured time. + +To avoid getting in a scenario where dir cache has obsolete data and cache would have the correct +one, try to set `--dir-cache-time` to a lower time than `--cache-info-age`. Default values are +already configured in this way. + +#### Windows support - Experimental #### + +There are a couple of issues with Windows `mount` functionality that still require some investigations. +It should be considered as experimental thus far as fixes come in for this OS. + +Most of the issues seem to be related to the difference between filesystems +on Linux flavors and Windows as cache is heavily dependent on them. + +Any reports or feedback on how cache behaves on this OS is greatly appreciated. + +- https://github.com/rclone/rclone/issues/1935 +- https://github.com/rclone/rclone/issues/1907 +- https://github.com/rclone/rclone/issues/1834 -Option env_auth. -Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). -Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) -env_auth> 1 +#### Risk of throttling #### -Option access_key_id. -AWS Access Key ID. -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -access_key_id> YOUR_ACCESS_KEY_ID +Future iterations of the cache backend will make use of the pooling functionality +of the cloud provider to synchronize and at the same time make writing through it +more tolerant to failures. -Option secret_access_key. -AWS Secret Access Key (password). -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -secret_access_key> YOUR_SECRET_ACCESS_KEY +There are a couple of enhancements in track to add these but in the meantime +there is a valid concern that the expiring cache listings can lead to cloud provider +throttles or bans due to repeated queries on it for very large mounts. -Option region. -Region where your bucket will be created and your data stored. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / US East (N. Virginia) - \ (us-east-1) - 2 / Europe (Frankfurt) - \ (eu-central-1) - 3 / Asia Pacific (Singapore) - \ (ap-southeast-1) - 4 / Middle East (Bahrain) - \ (me-south-1) - 5 / South America (São Paulo) - \ (sa-east-1) -region> 1 +Some recommendations: +- don't use a very small interval for entry information (`--cache-info-age`) +- while writes aren't yet optimised, you can still write through `cache` which gives you the advantage +of adding the file in the cache at the same time if configured to do so. -Option endpoint. -Endpoint for Petabox S3 Object Storage. -Specify the endpoint from the same region. -Choose a number from below, or type in your own value. - 1 / US East (N. Virginia) - \ (s3.petabox.io) - 2 / US East (N. Virginia) - \ (s3.us-east-1.petabox.io) - 3 / Europe (Frankfurt) - \ (s3.eu-central-1.petabox.io) - 4 / Asia Pacific (Singapore) - \ (s3.ap-southeast-1.petabox.io) - 5 / Middle East (Bahrain) - \ (s3.me-south-1.petabox.io) - 6 / South America (São Paulo) - \ (s3.sa-east-1.petabox.io) -endpoint> 1 +Future enhancements: -Option acl. -Canned ACL used when creating buckets and storing or copying objects. -This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -Note that this ACL is applied when server-side copying objects as S3 -doesn't copy the ACL from the source but rather writes a fresh one. -If the acl is an empty string then no X-Amz-Acl: header is added and -the default (private) will be used. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - / Owner gets FULL_CONTROL. - 1 | No one else has access rights (default). - \ (private) - / Owner gets FULL_CONTROL. - 2 | The AllUsers group gets READ access. - \ (public-read) - / Owner gets FULL_CONTROL. - 3 | The AllUsers group gets READ and WRITE access. - | Granting this on a bucket is generally not recommended. - \ (public-read-write) - / Owner gets FULL_CONTROL. - 4 | The AuthenticatedUsers group gets READ access. - \ (authenticated-read) - / Object owner gets FULL_CONTROL. - 5 | Bucket owner gets READ access. - | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. - \ (bucket-owner-read) - / Both the object owner and the bucket owner get FULL_CONTROL over the object. - 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. - \ (bucket-owner-full-control) -acl> 1 +- https://github.com/rclone/rclone/issues/1937 +- https://github.com/rclone/rclone/issues/1936 -Edit advanced config? -y) Yes -n) No (default) -y/n> No +#### cache and crypt #### -Configuration complete. -Options: -- type: s3 -- provider: Petabox -- access_key_id: YOUR_ACCESS_KEY_ID -- secret_access_key: YOUR_SECRET_ACCESS_KEY -- region: us-east-1 -- endpoint: s3.petabox.io -Keep this "My Petabox Storage" remote? -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +One common scenario is to keep your data encrypted in the cloud provider +using the `crypt` remote. `crypt` uses a similar technique to wrap around +an existing remote and handles this translation in a seamless way. -This will leave the config file looking like this. +There is an issue with wrapping the remotes in this order: +**cloud remote** -> **crypt** -> **cache** -``` -[My Petabox Storage] -type = s3 -provider = Petabox -access_key_id = YOUR_ACCESS_KEY_ID -secret_access_key = YOUR_SECRET_ACCESS_KEY -region = us-east-1 -endpoint = s3.petabox.io -``` +During testing, I experienced a lot of bans with the remotes in this order. +I suspect it might be related to how crypt opens files on the cloud provider +which makes it think we're downloading the full file instead of small chunks. +Organizing the remotes in this order yields better results: +**cloud remote** -> **cache** -> **crypt** -### Storj +#### absolute remote paths #### -Storj is a decentralized cloud storage which can be used through its -native protocol or an S3 compatible gateway. +`cache` can not differentiate between relative and absolute paths for the wrapped remote. +Any path given in the `remote` config setting and on the command line will be passed to +the wrapped remote as is, but for storing the chunks on disk the path will be made +relative by removing any leading `/` character. -The S3 compatible gateway is configured using `rclone config` with a -type of `s3` and with a provider name of `Storj`. Here is an example -run of the configurator. +This behavior is irrelevant for most backend types, but there are backends where a leading `/` +changes the effective directory, e.g. in the `sftp` backend paths starting with a `/` are +relative to the root of the SSH server and paths without are relative to the user home directory. +As a result `sftp:bin` and `sftp:/bin` will share the same cache folder, even if they represent +a different directory on the SSH server. -``` -Type of storage to configure. -Storage> s3 -Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). -Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) -env_auth> 1 -Option access_key_id. -AWS Access Key ID. -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -access_key_id> XXXX (as shown when creating the access grant) -Option secret_access_key. -AWS Secret Access Key (password). -Leave blank for anonymous access or runtime credentials. -Enter a value. Press Enter to leave empty. -secret_access_key> XXXX (as shown when creating the access grant) -Option endpoint. -Endpoint of the Shared Gateway. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / EU1 Shared Gateway - \ (gateway.eu1.storjshare.io) - 2 / US1 Shared Gateway - \ (gateway.us1.storjshare.io) - 3 / Asia-Pacific Shared Gateway - \ (gateway.ap1.storjshare.io) -endpoint> 1 (as shown when creating the access grant) -Edit advanced config? -y) Yes -n) No (default) -y/n> n -``` +### Cache and Remote Control (--rc) ### +Cache supports the new `--rc` mode in rclone and can be remote controlled through the following end points: +By default, the listener is disabled if you do not add the flag. -Note that s3 credentials are generated when you [create an access -grant](https://docs.storj.io/dcs/api-reference/s3-compatible-gateway#usage). +### rc cache/expire +Purge a remote from the cache backend. Supports either a directory or a file. +It supports both encrypted and unencrypted file names if cache is wrapped by crypt. -#### Backend quirks +Params: + - **remote** = path to remote **(required)** + - **withData** = true/false to delete cached data (chunks) as well _(optional, false by default)_ -- `--chunk-size` is forced to be 64 MiB or greater. This will use more - memory than the default of 5 MiB. -- Server side copy is disabled as it isn't currently supported in the - gateway. -- GetTier and SetTier are not supported. -#### Backend bugs +### Standard options -Due to [issue #39](https://github.com/storj/gateway-mt/issues/39) -uploading multipart files via the S3 gateway causes them to lose their -metadata. For rclone's purpose this means that the modification time -is not stored, nor is any MD5SUM (if one is available from the -source). +Here are the Standard options specific to cache (Cache a remote). -This has the following consequences: +#### --cache-remote -- Using `rclone rcat` will fail as the medatada doesn't match after upload -- Uploading files with `rclone mount` will fail for the same reason - - This can worked around by using `--vfs-cache-mode writes` or `--vfs-cache-mode full` or setting `--s3-upload-cutoff` large -- Files uploaded via a multipart upload won't have their modtimes - - This will mean that `rclone sync` will likely keep trying to upload files bigger than `--s3-upload-cutoff` - - This can be worked around with `--checksum` or `--size-only` or setting `--s3-upload-cutoff` large - - The maximum value for `--s3-upload-cutoff` is 5GiB though +Remote to cache. -One general purpose workaround is to set `--s3-upload-cutoff 5G`. This -means that rclone will upload files smaller than 5GiB as single parts. -Note that this can be set in the config file with `upload_cutoff = 5G` -or configured in the advanced settings. If you regularly transfer -files larger than 5G then using `--checksum` or `--size-only` in -`rclone sync` is the recommended workaround. +Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", +"myremote:bucket" or maybe "myremote:" (not recommended). -#### Comparison with the native protocol +Properties: -Use the [the native protocol](/storj) to take advantage of -client-side encryption as well as to achieve the best possible -download performance. Uploads will be erasure-coded locally, thus a -1gb upload will result in 2.68gb of data being uploaded to storage -nodes across the network. +- Config: remote +- Env Var: RCLONE_CACHE_REMOTE +- Type: string +- Required: true -Use this backend and the S3 compatible Hosted Gateway to increase -upload performance and reduce the load on your systems and network. -Uploads will be encrypted and erasure-coded server-side, thus a 1GB -upload will result in only in 1GB of data being uploaded to storage -nodes across the network. +#### --cache-plex-url -For more detailed comparison please check the documentation of the -[storj](/storj) backend. +The URL of the Plex server. -## Limitations +Properties: -`rclone about` is not supported by the S3 backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. +- Config: plex_url +- Env Var: RCLONE_CACHE_PLEX_URL +- Type: string +- Required: false -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) +#### --cache-plex-username +The username of the Plex user. +Properties: -### Synology C2 Object Storage {#synology-c2} +- Config: plex_username +- Env Var: RCLONE_CACHE_PLEX_USERNAME +- Type: string +- Required: false -[Synology C2 Object Storage](https://c2.synology.com/en-global/object-storage/overview) provides a secure, S3-compatible, and cost-effective cloud storage solution without API request, download fees, and deletion penalty. +#### --cache-plex-password -The S3 compatible gateway is configured using `rclone config` with a -type of `s3` and with a provider name of `Synology`. Here is an example -run of the configurator. +The password of the Plex user. -First run: +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -``` -rclone config -``` +Properties: -This will guide you through an interactive setup process. +- Config: plex_password +- Env Var: RCLONE_CACHE_PLEX_PASSWORD +- Type: string +- Required: false -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config +#### --cache-chunk-size -n/s/q> n +The size of a chunk (partial file data). -Enter name for new remote.1 -name> syno +Use lower numbers for slower connections. If the chunk size is +changed, any downloaded chunks will be invalid and cache-chunk-path +will need to be cleared or unexpected EOF errors will occur. -Type of storage to configure. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value +Properties: - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, GCS, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi - \ "s3" +- Config: chunk_size +- Env Var: RCLONE_CACHE_CHUNK_SIZE +- Type: SizeSuffix +- Default: 5Mi +- Examples: + - "1M" + - 1 MiB + - "5M" + - 5 MiB + - "10M" + - 10 MiB -Storage> s3 +#### --cache-info-age -Choose your S3 provider. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 24 / Synology C2 Object Storage - \ (Synology) +How long to cache file structure information (directory listings, file size, times, etc.). +If all write operations are done through the cache then you can safely make +this value very large as the cache store will also be updated in real time. -provider> Synology +Properties: -Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). -Only applies if access_key_id and secret_access_key is blank. -Enter a boolean value (true or false). Press Enter for the default ("false"). -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" +- Config: info_age +- Env Var: RCLONE_CACHE_INFO_AGE +- Type: Duration +- Default: 6h0m0s +- Examples: + - "1h" + - 1 hour + - "24h" + - 24 hours + - "48h" + - 48 hours -env_auth> 1 +#### --cache-chunk-total-size -AWS Access Key ID. -Leave blank for anonymous access or runtime credentials. -Enter a string value. Press Enter for the default (""). +The total size that the chunks can take up on the local disk. -access_key_id> accesskeyid +If the cache exceeds this value then it will start to delete the +oldest chunks until it goes under this value. -AWS Secret Access Key (password) -Leave blank for anonymous access or runtime credentials. -Enter a string value. Press Enter for the default (""). +Properties: -secret_access_key> secretaccesskey +- Config: chunk_total_size +- Env Var: RCLONE_CACHE_CHUNK_TOTAL_SIZE +- Type: SizeSuffix +- Default: 10Gi +- Examples: + - "500M" + - 500 MiB + - "1G" + - 1 GiB + - "10G" + - 10 GiB -Region where your data stored. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / Europe Region 1 - \ (eu-001) - 2 / Europe Region 2 - \ (eu-002) - 3 / US Region 1 - \ (us-001) - 4 / US Region 2 - \ (us-002) - 5 / Asia (Taiwan) - \ (tw-001) +### Advanced options -region > 1 +Here are the Advanced options specific to cache (Cache a remote). -Option endpoint. -Endpoint for Synology C2 Object Storage API. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / EU Endpoint 1 - \ (eu-001.s3.synologyc2.net) - 2 / US Endpoint 1 - \ (us-001.s3.synologyc2.net) - 3 / TW Endpoint 1 - \ (tw-001.s3.synologyc2.net) +#### --cache-plex-token -endpoint> 1 +The plex token for authentication - auto set normally. -Option location_constraint. -Location constraint - must be set to match the Region. -Leave blank if not sure. Used when creating buckets only. -Enter a value. Press Enter to leave empty. -location_constraint> +Properties: -Edit advanced config? (y/n) -y) Yes -n) No -y/n> y +- Config: plex_token +- Env Var: RCLONE_CACHE_PLEX_TOKEN +- Type: string +- Required: false -Option no_check_bucket. -If set, don't attempt to check the bucket exists or create it. -This can be useful when trying to minimise the number of transactions -rclone does if you know the bucket exists already. -It can also be needed if the user you are using does not have bucket -creation permissions. Before v1.52.0 this would have passed silently -due to a bug. -Enter a boolean value (true or false). Press Enter for the default (true). +#### --cache-plex-insecure -no_check_bucket> true +Skip all certificate verification when connecting to the Plex server. -Configuration complete. -Options: -- type: s3 -- provider: Synology -- region: eu-001 -- endpoint: eu-001.s3.synologyc2.net -- no_check_bucket: true -Keep this "syno" remote? -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote +Properties: -y/e/d> y +- Config: plex_insecure +- Env Var: RCLONE_CACHE_PLEX_INSECURE +- Type: string +- Required: false -# Backblaze B2 +#### --cache-db-path -B2 is [Backblaze's cloud storage system](https://www.backblaze.com/b2/). +Directory to store file structure metadata DB. -Paths are specified as `remote:bucket` (or `remote:` for the `lsd` -command.) You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`. +The remote name is used as the DB file name. -## Configuration +Properties: -Here is an example of making a b2 configuration. First run +- Config: db_path +- Env Var: RCLONE_CACHE_DB_PATH +- Type: string +- Default: "$HOME/.cache/rclone/cache-backend" - rclone config +#### --cache-chunk-path -This will guide you through an interactive setup process. To authenticate -you will either need your Account ID (a short hex number) and Master -Application Key (a long hex number) OR an Application Key, which is the -recommended method. See below for further details on generating and using -an Application Key. +Directory to cache chunk files. -``` -No remotes found, make a new one? -n) New remote -q) Quit config -n/q> n -name> remote -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Backblaze B2 - \ "b2" -[snip] -Storage> b2 -Account ID or Application Key ID -account> 123456789abc -Application Key -key> 0123456789abcdef0123456789abcdef0123456789 -Endpoint for the service - leave blank normally. -endpoint> -Remote config --------------------- -[remote] -account = 123456789abc -key = 0123456789abcdef0123456789abcdef0123456789 -endpoint = --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +Path to where partial file data (chunks) are stored locally. The remote +name is appended to the final path. -This remote is called `remote` and can now be used like this +This config follows the "--cache-db-path". If you specify a custom +location for "--cache-db-path" and don't specify one for "--cache-chunk-path" +then "--cache-chunk-path" will use the same path as "--cache-db-path". + +Properties: + +- Config: chunk_path +- Env Var: RCLONE_CACHE_CHUNK_PATH +- Type: string +- Default: "$HOME/.cache/rclone/cache-backend" -See all buckets +#### --cache-db-purge - rclone lsd remote: +Clear all the cached data for this remote on start. -Create a new bucket +Properties: - rclone mkdir remote:bucket +- Config: db_purge +- Env Var: RCLONE_CACHE_DB_PURGE +- Type: bool +- Default: false -List the contents of a bucket +#### --cache-chunk-clean-interval - rclone ls remote:bucket +How often should the cache perform cleanups of the chunk storage. -Sync `/home/local/directory` to the remote bucket, deleting any -excess files in the bucket. +The default value should be ok for most people. If you find that the +cache goes over "cache-chunk-total-size" too often then try to lower +this value to force it to perform cleanups more often. - rclone sync --interactive /home/local/directory remote:bucket +Properties: -### Application Keys +- Config: chunk_clean_interval +- Env Var: RCLONE_CACHE_CHUNK_CLEAN_INTERVAL +- Type: Duration +- Default: 1m0s -B2 supports multiple [Application Keys for different access permission -to B2 Buckets](https://www.backblaze.com/b2/docs/application_keys.html). +#### --cache-read-retries -You can use these with rclone too; you will need to use rclone version 1.43 -or later. +How many times to retry a read from a cache storage. -Follow Backblaze's docs to create an Application Key with the required -permission and add the `applicationKeyId` as the `account` and the -`Application Key` itself as the `key`. +Since reading from a cache stream is independent from downloading file +data, readers can get to a point where there's no more data in the +cache. Most of the times this can indicate a connectivity issue if +cache isn't able to provide file data anymore. -Note that you must put the _applicationKeyId_ as the `account` – you -can't use the master Account ID. If you try then B2 will return 401 -errors. +For really slow connections, increase this to a point where the stream is +able to provide data but your experience will be very stuttering. -### --fast-list +Properties: -This remote supports `--fast-list` which allows you to use fewer -transactions in exchange for more memory. See the [rclone -docs](https://rclone.org/docs/#fast-list) for more details. +- Config: read_retries +- Env Var: RCLONE_CACHE_READ_RETRIES +- Type: int +- Default: 10 -### Modified time +#### --cache-workers -The modified time is stored as metadata on the object as -`X-Bz-Info-src_last_modified_millis` as milliseconds since 1970-01-01 -in the Backblaze standard. Other tools should be able to use this as -a modified time. +How many workers should run in parallel to download chunks. -Modified times are used in syncing and are fully supported. Note that -if a modification time needs to be updated on an object then it will -create a new version of the object. +Higher values will mean more parallel processing (better CPU needed) +and more concurrent requests on the cloud provider. This impacts +several aspects like the cloud provider API limits, more stress on the +hardware that rclone runs on but it also means that streams will be +more fluid and data will be available much more faster to readers. -### Restricted filename characters +**Note**: If the optional Plex integration is enabled then this +setting will adapt to the type of reading performed and the value +specified here will be used as a maximum number of workers to use. -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) -the following characters are also replaced: +Properties: -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| \ | 0x5C | \ | +- Config: workers +- Env Var: RCLONE_CACHE_WORKERS +- Type: int +- Default: 4 -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in JSON strings. +#### --cache-chunk-no-memory -Note that in 2020-05 Backblaze started allowing \ characters in file -names. Rclone hasn't changed its encoding as this could cause syncs to -re-transfer files. If you want rclone not to replace \ then see the -`--b2-encoding` flag below and remove the `BackSlash` from the -string. This can be set in the config. +Disable the in-memory cache for storing chunks during streaming. -### SHA1 checksums +By default, cache will keep file data during streaming in RAM as well +to provide it to readers as fast as possible. -The SHA1 checksums of the files are checked on upload and download and -will be used in the syncing process. +This transient data is evicted as soon as it is read and the number of +chunks stored doesn't exceed the number of workers. However, depending +on other settings like "cache-chunk-size" and "cache-workers" this footprint +can increase if there are parallel streams too (multiple files being read +at the same time). -Large files (bigger than the limit in `--b2-upload-cutoff`) which are -uploaded in chunks will store their SHA1 on the object as -`X-Bz-Info-large_file_sha1` as recommended by Backblaze. +If the hardware permits it, use this feature to provide an overall better +performance during streaming but it can also be disabled if RAM is not +available on the local machine. -For a large file to be uploaded with an SHA1 checksum, the source -needs to support SHA1 checksums. The local disk supports SHA1 -checksums so large file transfers from local disk will have an SHA1. -See [the overview](https://rclone.org/overview/#features) for exactly which remotes -support SHA1. +Properties: -Sources which don't support SHA1, in particular `crypt` will upload -large files without SHA1 checksums. This may be fixed in the future -(see [#1767](https://github.com/rclone/rclone/issues/1767)). +- Config: chunk_no_memory +- Env Var: RCLONE_CACHE_CHUNK_NO_MEMORY +- Type: bool +- Default: false -Files sizes below `--b2-upload-cutoff` will always have an SHA1 -regardless of the source. +#### --cache-rps -### Transfers +Limits the number of requests per second to the source FS (-1 to disable). -Backblaze recommends that you do lots of transfers simultaneously for -maximum speed. In tests from my SSD equipped laptop the optimum -setting is about `--transfers 32` though higher numbers may be used -for a slight speed improvement. The optimum number for you may vary -depending on your hardware, how big the files are, how much you want -to load your computer, etc. The default of `--transfers 4` is -definitely too low for Backblaze B2 though. +This setting places a hard limit on the number of requests per second +that cache will be doing to the cloud provider remote and try to +respect that value by setting waits between reads. -Note that uploading big files (bigger than 200 MiB by default) will use -a 96 MiB RAM buffer by default. There can be at most `--transfers` of -these in use at any moment, so this sets the upper limit on the memory -used. +If you find that you're getting banned or limited on the cloud +provider through cache and know that a smaller number of requests per +second will allow you to work with it then you can use this setting +for that. -### Versions +A good balance of all the other settings should make this setting +useless but it is available to set for more special cases. -When rclone uploads a new version of a file it creates a [new version -of it](https://www.backblaze.com/b2/docs/file_versions.html). -Likewise when you delete a file, the old version will be marked hidden -and still be available. Conversely, you may opt in to a "hard delete" -of files with the `--b2-hard-delete` flag which would permanently remove -the file instead of hiding it. +**NOTE**: This will limit the number of requests during streams but +other API calls to the cloud provider like directory listings will +still pass. -Old versions of files, where available, are visible using the -`--b2-versions` flag. +Properties: -It is also possible to view a bucket as it was at a certain point in time, -using the `--b2-version-at` flag. This will show the file versions as they -were at that time, showing files that have been deleted afterwards, and -hiding files that were created since. +- Config: rps +- Env Var: RCLONE_CACHE_RPS +- Type: int +- Default: -1 -If you wish to remove all the old versions then you can use the -`rclone cleanup remote:bucket` command which will delete all the old -versions of files, leaving the current ones intact. You can also -supply a path and only old versions under that path will be deleted, -e.g. `rclone cleanup remote:bucket/path/to/stuff`. +#### --cache-writes -Note that `cleanup` will remove partially uploaded files from the bucket -if they are more than a day old. +Cache file data on writes through the FS. -When you `purge` a bucket, the current and the old versions will be -deleted then the bucket will be deleted. +If you need to read files immediately after you upload them through +cache you can enable this flag to have their data stored in the +cache store at the same time during upload. -However `delete` will cause the current versions of the files to -become hidden old versions. +Properties: -Here is a session showing the listing and retrieval of an old -version followed by a `cleanup` of the old versions. +- Config: writes +- Env Var: RCLONE_CACHE_WRITES +- Type: bool +- Default: false -Show current version and all the versions with `--b2-versions` flag. +#### --cache-tmp-upload-path -``` -$ rclone -q ls b2:cleanup-test - 9 one.txt +Directory to keep temporary files until they are uploaded. -$ rclone -q --b2-versions ls b2:cleanup-test - 9 one.txt - 8 one-v2016-07-04-141032-000.txt - 16 one-v2016-07-04-141003-000.txt - 15 one-v2016-07-02-155621-000.txt -``` +This is the path where cache will use as a temporary storage for new +files that need to be uploaded to the cloud provider. -Retrieve an old version +Specifying a value will enable this feature. Without it, it is +completely disabled and files will be uploaded directly to the cloud +provider -``` -$ rclone -q --b2-versions copy b2:cleanup-test/one-v2016-07-04-141003-000.txt /tmp +Properties: -$ ls -l /tmp/one-v2016-07-04-141003-000.txt --rw-rw-r-- 1 ncw ncw 16 Jul 2 17:46 /tmp/one-v2016-07-04-141003-000.txt -``` +- Config: tmp_upload_path +- Env Var: RCLONE_CACHE_TMP_UPLOAD_PATH +- Type: string +- Required: false -Clean up all the old versions and show that they've gone. +#### --cache-tmp-wait-time -``` -$ rclone -q cleanup b2:cleanup-test +How long should files be stored in local cache before being uploaded. -$ rclone -q ls b2:cleanup-test - 9 one.txt +This is the duration that a file must wait in the temporary location +_cache-tmp-upload-path_ before it is selected for upload. -$ rclone -q --b2-versions ls b2:cleanup-test - 9 one.txt -``` +Note that only one file is uploaded at a time and it can take longer +to start the upload if a queue formed for this purpose. -#### Versions naming caveat +Properties: -When using `--b2-versions` flag rclone is relying on the file name -to work out whether the objects are versions or not. Versions' names -are created by inserting timestamp between file name and its extension. -``` - 9 file.txt - 8 file-v2023-07-17-161032-000.txt - 16 file-v2023-06-15-141003-000.txt -``` -If there are real files present with the same names as versions, then -behaviour of `--b2-versions` can be unpredictable. +- Config: tmp_wait_time +- Env Var: RCLONE_CACHE_TMP_WAIT_TIME +- Type: Duration +- Default: 15s -### Data usage +#### --cache-db-wait-time -It is useful to know how many requests are sent to the server in different scenarios. +How long to wait for the DB to be available - 0 is unlimited. -All copy commands send the following 4 requests: +Only one process can have the DB open at any one time, so rclone waits +for this duration for the DB to become available before it gives an +error. -``` -/b2api/v1/b2_authorize_account -/b2api/v1/b2_create_bucket -/b2api/v1/b2_list_buckets -/b2api/v1/b2_list_file_names -``` +If you set it to 0 then it will wait forever. -The `b2_list_file_names` request will be sent once for every 1k files -in the remote path, providing the checksum and modification time of -the listed files. As of version 1.33 issue -[#818](https://github.com/rclone/rclone/issues/818) causes extra requests -to be sent when using B2 with Crypt. When a copy operation does not -require any files to be uploaded, no more requests will be sent. +Properties: -Uploading files that do not require chunking, will send 2 requests per -file upload: +- Config: db_wait_time +- Env Var: RCLONE_CACHE_DB_WAIT_TIME +- Type: Duration +- Default: 1s -``` -/b2api/v1/b2_get_upload_url -/b2api/v1/b2_upload_file/ -``` +## Backend commands -Uploading files requiring chunking, will send 2 requests (one each to -start and finish the upload) and another 2 requests for each chunk: +Here are the commands specific to the cache backend. -``` -/b2api/v1/b2_start_large_file -/b2api/v1/b2_get_upload_part_url -/b2api/v1/b2_upload_part/ -/b2api/v1/b2_finish_large_file -``` +Run them with -#### Versions + rclone backend COMMAND remote: -Versions can be viewed with the `--b2-versions` flag. When it is set -rclone will show and act on older versions of files. For example +The help below will explain what arguments each command takes. -Listing without `--b2-versions` +See the [backend](https://rclone.org/commands/rclone_backend/) command for more +info on how to pass options and arguments. -``` -$ rclone -q ls b2:cleanup-test - 9 one.txt -``` +These can be run on a running backend using the rc command +[backend/command](https://rclone.org/rc/#backend-command). -And with +### stats -``` -$ rclone -q --b2-versions ls b2:cleanup-test - 9 one.txt - 8 one-v2016-07-04-141032-000.txt - 16 one-v2016-07-04-141003-000.txt - 15 one-v2016-07-02-155621-000.txt -``` +Print stats on the cache backend in JSON format. -Showing that the current version is unchanged but older versions can -be seen. These have the UTC date that they were uploaded to the -server to the nearest millisecond appended to them. + rclone backend stats remote: [options] [+] -Note that when using `--b2-versions` no file write operations are -permitted, so you can't upload files or delete them. -### B2 and rclone link -Rclone supports generating file share links for private B2 buckets. -They can either be for a file for example: +# Chunker -``` -./rclone link B2:bucket/path/to/file.txt -https://f002.backblazeb2.com/file/bucket/path/to/file.txt?Authorization=xxxxxxxx +The `chunker` overlay transparently splits large files into smaller chunks +during upload to wrapped remote and transparently assembles them back +when the file is downloaded. This allows to effectively overcome size limits +imposed by storage providers. -``` +## Configuration -or if run on a directory you will get: +To use it, first set up the underlying remote following the configuration +instructions for that remote. You can also use a local pathname instead of +a remote. -``` -./rclone link B2:bucket/path -https://f002.backblazeb2.com/file/bucket/path?Authorization=xxxxxxxx -``` +First check your chosen remote is working - we'll call it `remote:path` here. +Note that anything inside `remote:path` will be chunked and anything outside +won't. This means that if you are using a bucket-based remote (e.g. S3, B2, swift) +then you should probably put the bucket in the remote `s3:bucket`. -you can then use the authorization token (the part of the url from the - `?Authorization=` on) on any file path under that directory. For example: +Now configure `chunker` using `rclone config`. We will call this one `overlay` +to separate it from the `remote` itself. ``` -https://f002.backblazeb2.com/file/bucket/path/to/file1?Authorization=xxxxxxxx -https://f002.backblazeb2.com/file/bucket/path/file2?Authorization=xxxxxxxx -https://f002.backblazeb2.com/file/bucket/path/folder/file3?Authorization=xxxxxxxx - +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> overlay +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Transparently chunk/split large files + \ "chunker" +[snip] +Storage> chunker +Remote to chunk/unchunk. +Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", +"myremote:bucket" or maybe "myremote:" (not recommended). +Enter a string value. Press Enter for the default (""). +remote> remote:path +Files larger than chunk size will be split in chunks. +Enter a size with suffix K,M,G,T. Press Enter for the default ("2G"). +chunk_size> 100M +Choose how chunker handles hash sums. All modes but "none" require metadata. +Enter a string value. Press Enter for the default ("md5"). +Choose a number from below, or type in your own value + 1 / Pass any hash supported by wrapped remote for non-chunked files, return nothing otherwise + \ "none" + 2 / MD5 for composite files + \ "md5" + 3 / SHA1 for composite files + \ "sha1" + 4 / MD5 for all files + \ "md5all" + 5 / SHA1 for all files + \ "sha1all" + 6 / Copying a file to chunker will request MD5 from the source falling back to SHA1 if unsupported + \ "md5quick" + 7 / Similar to "md5quick" but prefers SHA1 over MD5 + \ "sha1quick" +hash_type> md5 +Edit advanced config? (y/n) +y) Yes +n) No +y/n> n +Remote config +-------------------- +[overlay] +type = chunker +remote = remote:bucket +chunk_size = 100M +hash_type = md5 +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y ``` +### Specifying the remote -### Standard options - -Here are the Standard options specific to b2 (Backblaze B2). - -#### --b2-account - -Account ID or Application Key ID. +In normal use, make sure the remote has a `:` in. If you specify the remote +without a `:` then rclone will use a local directory of that name. +So if you use a remote of `/path/to/secret/files` then rclone will +chunk stuff in that directory. If you use a remote of `name` then rclone +will put files in a directory called `name` in the current directory. -Properties: -- Config: account -- Env Var: RCLONE_B2_ACCOUNT -- Type: string -- Required: true +### Chunking -#### --b2-key +When rclone starts a file upload, chunker checks the file size. If it +doesn't exceed the configured chunk size, chunker will just pass the file +to the wrapped remote (however, see caveat below). If a file is large, chunker will transparently cut +data in pieces with temporary names and stream them one by one, on the fly. +Each data chunk will contain the specified number of bytes, except for the +last one which may have less data. If file size is unknown in advance +(this is called a streaming upload), chunker will internally create +a temporary copy, record its size and repeat the above process. -Application Key. +When upload completes, temporary chunk files are finally renamed. +This scheme guarantees that operations can be run in parallel and look +from outside as atomic. +A similar method with hidden temporary chunks is used for other operations +(copy/move/rename, etc.). If an operation fails, hidden chunks are normally +destroyed, and the target composite file stays intact. -Properties: +When a composite file download is requested, chunker transparently +assembles it by concatenating data chunks in order. As the split is trivial +one could even manually concatenate data chunks together to obtain the +original content. -- Config: key -- Env Var: RCLONE_B2_KEY -- Type: string -- Required: true +When the `list` rclone command scans a directory on wrapped remote, +the potential chunk files are accounted for, grouped and assembled into +composite directory entries. Any temporary chunks are hidden. -#### --b2-hard-delete +List and other commands can sometimes come across composite files with +missing or invalid chunks, e.g. shadowed by like-named directory or +another file. This usually means that wrapped file system has been directly +tampered with or damaged. If chunker detects a missing chunk it will +by default print warning, skip the whole incomplete group of chunks but +proceed with current command. +You can set the `--chunker-fail-hard` flag to have commands abort with +error message in such cases. -Permanently delete files on remote removal, otherwise hide files. +**Caveat**: As it is now, chunker will always create a temporary file in the +backend and then rename it, even if the file is below the chunk threshold. +This will result in unnecessary API calls and can severely restrict throughput +when handling transfers primarily composed of small files on some backends (e.g. Box). +A workaround to this issue is to use chunker only for files above the chunk threshold +via `--min-size` and then perform a separate call without chunker on the remaining +files. -Properties: -- Config: hard_delete -- Env Var: RCLONE_B2_HARD_DELETE -- Type: bool -- Default: false +#### Chunk names -### Advanced options +The default chunk name format is `*.rclone_chunk.###`, hence by default +chunk names are `BIG_FILE_NAME.rclone_chunk.001`, +`BIG_FILE_NAME.rclone_chunk.002` etc. You can configure another name format +using the `name_format` configuration file option. The format uses asterisk +`*` as a placeholder for the base file name and one or more consecutive +hash characters `#` as a placeholder for sequential chunk number. +There must be one and only one asterisk. The number of consecutive hash +characters defines the minimum length of a string representing a chunk number. +If decimal chunk number has less digits than the number of hashes, it is +left-padded by zeros. If the decimal string is longer, it is left intact. +By default numbering starts from 1 but there is another option that allows +user to start from 0, e.g. for compatibility with legacy software. -Here are the Advanced options specific to b2 (Backblaze B2). +For example, if name format is `big_*-##.part` and original file name is +`data.txt` and numbering starts from 0, then the first chunk will be named +`big_data.txt-00.part`, the 99th chunk will be `big_data.txt-98.part` +and the 302nd chunk will become `big_data.txt-301.part`. -#### --b2-endpoint +Note that `list` assembles composite directory entries only when chunk names +match the configured format and treats non-conforming file names as normal +non-chunked files. -Endpoint for the service. +When using `norename` transactions, chunk names will additionally have a unique +file version suffix. For example, `BIG_FILE_NAME.rclone_chunk.001_bp562k`. -Leave blank normally. -Properties: +### Metadata -- Config: endpoint -- Env Var: RCLONE_B2_ENDPOINT -- Type: string -- Required: false +Besides data chunks chunker will by default create metadata object for +a composite file. The object is named after the original file. +Chunker allows user to disable metadata completely (the `none` format). +Note that metadata is normally not created for files smaller than the +configured chunk size. This may change in future rclone releases. -#### --b2-test-mode +#### Simple JSON metadata format -A flag string for X-Bz-Test-Mode header for debugging. +This is the default format. It supports hash sums and chunk validation +for composite files. Meta objects carry the following fields: -This is for debugging purposes only. Setting it to one of the strings -below will cause b2 to return specific errors: +- `ver` - version of format, currently `1` +- `size` - total size of composite file +- `nchunks` - number of data chunks in file +- `md5` - MD5 hashsum of composite file (if present) +- `sha1` - SHA1 hashsum (if present) +- `txn` - identifies current version of the file - * "fail_some_uploads" - * "expire_some_account_authorization_tokens" - * "force_cap_exceeded" +There is no field for composite file name as it's simply equal to the name +of meta object on the wrapped remote. Please refer to respective sections +for details on hashsums and modified time handling. -These will be set in the "X-Bz-Test-Mode" header which is documented -in the [b2 integrations checklist](https://www.backblaze.com/b2/docs/integration_checklist.html). +#### No metadata -Properties: +You can disable meta objects by setting the meta format option to `none`. +In this mode chunker will scan directory for all files that follow +configured chunk name format, group them by detecting chunks with the same +base name and show group names as virtual composite files. +This method is more prone to missing chunk errors (especially missing +last chunk) than format with metadata enabled. -- Config: test_mode -- Env Var: RCLONE_B2_TEST_MODE -- Type: string -- Required: false -#### --b2-versions +### Hashsums -Include old versions in directory listings. +Chunker supports hashsums only when a compatible metadata is present. +Hence, if you choose metadata format of `none`, chunker will report hashsum +as `UNSUPPORTED`. -Note that when using this no file write operations are permitted, -so you can't upload files or delete them. +Please note that by default metadata is stored only for composite files. +If a file is smaller than configured chunk size, chunker will transparently +redirect hash requests to wrapped remote, so support depends on that. +You will see the empty string as a hashsum of requested type for small +files if the wrapped remote doesn't support it. -Properties: +Many storage backends support MD5 and SHA1 hash types, so does chunker. +With chunker you can choose one or another but not both. +MD5 is set by default as the most supported type. +Since chunker keeps hashes for composite files and falls back to the +wrapped remote hash for non-chunked ones, we advise you to choose the same +hash type as supported by wrapped remote so that your file listings +look coherent. -- Config: versions -- Env Var: RCLONE_B2_VERSIONS -- Type: bool -- Default: false +If your storage backend does not support MD5 or SHA1 but you need consistent +file hashing, configure chunker with `md5all` or `sha1all`. These two modes +guarantee given hash for all files. If wrapped remote doesn't support it, +chunker will then add metadata to all files, even small. However, this can +double the amount of small files in storage and incur additional service charges. +You can even use chunker to force md5/sha1 support in any other remote +at expense of sidecar meta objects by setting e.g. `hash_type=sha1all` +to force hashsums and `chunk_size=1P` to effectively disable chunking. -#### --b2-version-at +Normally, when a file is copied to chunker controlled remote, chunker +will ask the file source for compatible file hash and revert to on-the-fly +calculation if none is found. This involves some CPU overhead but provides +a guarantee that given hashsum is available. Also, chunker will reject +a server-side copy or move operation if source and destination hashsum +types are different resulting in the extra network bandwidth, too. +In some rare cases this may be undesired, so chunker provides two optional +choices: `sha1quick` and `md5quick`. If the source does not support primary +hash type and the quick mode is enabled, chunker will try to fall back to +the secondary type. This will save CPU and bandwidth but can result in empty +hashsums at destination. Beware of consequences: the `sync` command will +revert (sometimes silently) to time/size comparison if compatible hashsums +between source and target are not found. -Show file versions as they were at the specified time. -Note that when using this no file write operations are permitted, -so you can't upload files or delete them. +### Modification times -Properties: +Chunker stores modification times using the wrapped remote so support +depends on that. For a small non-chunked file the chunker overlay simply +manipulates modification time of the wrapped remote file. +For a composite file with metadata chunker will get and set +modification time of the metadata object on the wrapped remote. +If file is chunked but metadata format is `none` then chunker will +use modification time of the first data chunk. -- Config: version_at -- Env Var: RCLONE_B2_VERSION_AT -- Type: Time -- Default: off -#### --b2-upload-cutoff +### Migrations -Cutoff for switching to chunked upload. +The idiomatic way to migrate to a different chunk size, hash type, transaction +style or chunk naming scheme is to: -Files above this size will be uploaded in chunks of "--b2-chunk-size". +- Collect all your chunked files under a directory and have your + chunker remote point to it. +- Create another directory (most probably on the same cloud storage) + and configure a new remote with desired metadata format, + hash type, chunk naming etc. +- Now run `rclone sync --interactive oldchunks: newchunks:` and all your data + will be transparently converted in transfer. + This may take some time, yet chunker will try server-side + copy if possible. +- After checking data integrity you may remove configuration section + of the old remote. -This value should be set no larger than 4.657 GiB (== 5 GB). +If rclone gets killed during a long operation on a big composite file, +hidden temporary chunks may stay in the directory. They will not be +shown by the `list` command but will eat up your account quota. +Please note that the `deletefile` command deletes only active +chunks of a file. As a workaround, you can use remote of the wrapped +file system to see them. +An easy way to get rid of hidden garbage is to copy littered directory +somewhere using the chunker remote and purge the original directory. +The `copy` command will copy only active chunks while the `purge` will +remove everything including garbage. -Properties: -- Config: upload_cutoff -- Env Var: RCLONE_B2_UPLOAD_CUTOFF -- Type: SizeSuffix -- Default: 200Mi +### Caveats and Limitations -#### --b2-copy-cutoff +Chunker requires wrapped remote to support server-side `move` (or `copy` + +`delete`) operations, otherwise it will explicitly refuse to start. +This is because it internally renames temporary chunk files to their final +names when an operation completes successfully. -Cutoff for switching to multipart copy. +Chunker encodes chunk number in file name, so with default `name_format` +setting it adds 17 characters. Also chunker adds 7 characters of temporary +suffix during operations. Many file systems limit base file name without path +by 255 characters. Using rclone's crypt remote as a base file system limits +file name by 143 characters. Thus, maximum name length is 231 for most files +and 119 for chunker-over-crypt. A user in need can change name format to +e.g. `*.rcc##` and save 10 characters (provided at most 99 chunks per file). -Any files larger than this that need to be server-side copied will be -copied in chunks of this size. +Note that a move implemented using the copy-and-delete method may incur +double charging with some cloud storage providers. -The minimum is 0 and the maximum is 4.6 GiB. +Chunker will not automatically rename existing chunks when you run +`rclone config` on a live remote and change the chunk name format. +Beware that in result of this some files which have been treated as chunks +before the change can pop up in directory listings as normal files +and vice versa. The same warning holds for the chunk size. +If you desperately need to change critical chunking settings, you should +run data migration as described above. -Properties: +If wrapped remote is case insensitive, the chunker overlay will inherit +that property (so you can't have a file called "Hello.doc" and "hello.doc" +in the same directory). -- Config: copy_cutoff -- Env Var: RCLONE_B2_COPY_CUTOFF -- Type: SizeSuffix -- Default: 4Gi +Chunker included in rclone releases up to `v1.54` can sometimes fail to +detect metadata produced by recent versions of rclone. We recommend users +to keep rclone up-to-date to avoid data corruption. -#### --b2-chunk-size +Changing `transactions` is dangerous and requires explicit migration. -Upload chunk size. -When uploading large files, chunk the file into this size. +### Standard options -Must fit in memory. These chunks are buffered in memory and there -might a maximum of "--transfers" chunks in progress at once. +Here are the Standard options specific to chunker (Transparently chunk/split large files). -5,000,000 Bytes is the minimum size. +#### --chunker-remote -Properties: +Remote to chunk/unchunk. -- Config: chunk_size -- Env Var: RCLONE_B2_CHUNK_SIZE -- Type: SizeSuffix -- Default: 96Mi +Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", +"myremote:bucket" or maybe "myremote:" (not recommended). -#### --b2-upload-concurrency +Properties: -Concurrency for multipart uploads. +- Config: remote +- Env Var: RCLONE_CHUNKER_REMOTE +- Type: string +- Required: true -This is the number of chunks of the same file that are uploaded -concurrently. +#### --chunker-chunk-size -Note that chunks are stored in memory and there may be up to -"--transfers" * "--b2-upload-concurrency" chunks stored at once -in memory. +Files larger than chunk size will be split in chunks. Properties: -- Config: upload_concurrency -- Env Var: RCLONE_B2_UPLOAD_CONCURRENCY -- Type: int -- Default: 16 +- Config: chunk_size +- Env Var: RCLONE_CHUNKER_CHUNK_SIZE +- Type: SizeSuffix +- Default: 2Gi -#### --b2-disable-checksum +#### --chunker-hash-type -Disable checksums for large (> upload cutoff) files. +Choose how chunker handles hash sums. -Normally rclone will calculate the SHA1 checksum of the input before -uploading it so it can add it to metadata on the object. This is great -for data integrity checking but can cause long delays for large files -to start uploading. +All modes but "none" require metadata. Properties: -- Config: disable_checksum -- Env Var: RCLONE_B2_DISABLE_CHECKSUM -- Type: bool -- Default: false +- Config: hash_type +- Env Var: RCLONE_CHUNKER_HASH_TYPE +- Type: string +- Default: "md5" +- Examples: + - "none" + - Pass any hash supported by wrapped remote for non-chunked files. + - Return nothing otherwise. + - "md5" + - MD5 for composite files. + - "sha1" + - SHA1 for composite files. + - "md5all" + - MD5 for all files. + - "sha1all" + - SHA1 for all files. + - "md5quick" + - Copying a file to chunker will request MD5 from the source. + - Falling back to SHA1 if unsupported. + - "sha1quick" + - Similar to "md5quick" but prefers SHA1 over MD5. -#### --b2-download-url +### Advanced options -Custom endpoint for downloads. +Here are the Advanced options specific to chunker (Transparently chunk/split large files). -This is usually set to a Cloudflare CDN URL as Backblaze offers -free egress for data downloaded through the Cloudflare network. -Rclone works with private buckets by sending an "Authorization" header. -If the custom endpoint rewrites the requests for authentication, -e.g., in Cloudflare Workers, this header needs to be handled properly. -Leave blank if you want to use the endpoint provided by Backblaze. +#### --chunker-name-format -The URL provided here SHOULD have the protocol and SHOULD NOT have -a trailing slash or specify the /file/bucket subpath as rclone will -request files with "{download_url}/file/{bucket_name}/{path}". +String format of chunk file names. -Example: -> https://mysubdomain.mydomain.tld -(No trailing "/", "file" or "bucket") +The two placeholders are: base file name (*) and chunk number (#...). +There must be one and only one asterisk and one or more consecutive hash characters. +If chunk number has less digits than the number of hashes, it is left-padded by zeros. +If there are more digits in the number, they are left as is. +Possible chunk files are ignored if their name does not match given format. Properties: -- Config: download_url -- Env Var: RCLONE_B2_DOWNLOAD_URL +- Config: name_format +- Env Var: RCLONE_CHUNKER_NAME_FORMAT - Type: string -- Required: false +- Default: "*.rclone_chunk.###" -#### --b2-download-auth-duration +#### --chunker-start-from -Time before the authorization token will expire in s or suffix ms|s|m|h|d. +Minimum valid chunk number. Usually 0 or 1. -The duration before the download authorization token will expire. -The minimum value is 1 second. The maximum value is one week. +By default chunk numbers start from 1. Properties: -- Config: download_auth_duration -- Env Var: RCLONE_B2_DOWNLOAD_AUTH_DURATION -- Type: Duration -- Default: 1w +- Config: start_from +- Env Var: RCLONE_CHUNKER_START_FROM +- Type: int +- Default: 1 -#### --b2-memory-pool-flush-time +#### --chunker-meta-format -How often internal memory buffer pools will be flushed. (no longer used) +Format of the metadata object or "none". + +By default "simplejson". +Metadata is a small JSON file named after the composite file. Properties: -- Config: memory_pool_flush_time -- Env Var: RCLONE_B2_MEMORY_POOL_FLUSH_TIME -- Type: Duration -- Default: 1m0s +- Config: meta_format +- Env Var: RCLONE_CHUNKER_META_FORMAT +- Type: string +- Default: "simplejson" +- Examples: + - "none" + - Do not use metadata files at all. + - Requires hash type "none". + - "simplejson" + - Simple JSON supports hash sums and chunk validation. + - + - It has the following fields: ver, size, nchunks, md5, sha1. -#### --b2-memory-pool-use-mmap +#### --chunker-fail-hard -Whether to use mmap buffers in internal memory pool. (no longer used) +Choose how chunker should handle files with missing or invalid chunks. Properties: -- Config: memory_pool_use_mmap -- Env Var: RCLONE_B2_MEMORY_POOL_USE_MMAP +- Config: fail_hard +- Env Var: RCLONE_CHUNKER_FAIL_HARD - Type: bool - Default: false +- Examples: + - "true" + - Report errors and abort current command. + - "false" + - Warn user, skip incomplete file and proceed. -#### --b2-encoding - -The encoding for the backend. +#### --chunker-transactions -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Choose how chunker should handle temporary files during transactions. Properties: -- Config: encoding -- Env Var: RCLONE_B2_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot - - - -## Limitations - -`rclone about` is not supported by the B2 backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. - -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) +- Config: transactions +- Env Var: RCLONE_CHUNKER_TRANSACTIONS +- Type: string +- Default: "rename" +- Examples: + - "rename" + - Rename temporary files after a successful transaction. + - "norename" + - Leave temporary file names and write transaction ID to metadata file. + - Metadata is required for no rename transactions (meta format cannot be "none"). + - If you are using norename transactions you should be careful not to downgrade Rclone + - as older versions of Rclone don't support this transaction style and will misinterpret + - files manipulated by norename transactions. + - This method is EXPERIMENTAL, don't use on production systems. + - "auto" + - Rename or norename will be used depending on capabilities of the backend. + - If meta format is set to "none", rename transactions will always be used. + - This method is EXPERIMENTAL, don't use on production systems. -# Box -Paths are specified as `remote:path` -Paths may be as deep as required, e.g. `remote:directory/subdirectory`. +# Citrix ShareFile -The initial setup for Box involves getting a token from Box which you -can do either in your browser, or with a config.json downloaded from Box -to use JWT authentication. `rclone config` walks you through it. +[Citrix ShareFile](https://sharefile.com) is a secure file sharing and transfer service aimed as business. ## Configuration +The initial setup for Citrix ShareFile involves getting a token from +Citrix ShareFile which you can in your browser. `rclone config` walks you +through it. + Here is an example of how to make a remote called `remote`. First run: rclone config @@ -27157,153 +29146,35 @@ q) Quit config n/s/q> n name> remote Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Box - \ "box" -[snip] -Storage> box -Box App Client Id - leave blank normally. -client_id> -Box App Client Secret - leave blank normally. -client_secret> -Box App config.json location -Leave blank normally. -Enter a string value. Press Enter for the default (""). -box_config_file> -Box App Primary Access Token -Leave blank normally. Enter a string value. Press Enter for the default (""). -access_token> - -Enter a string value. Press Enter for the default ("user"). Choose a number from below, or type in your own value - 1 / Rclone should act on behalf of a user - \ "user" - 2 / Rclone should act on behalf of a service account - \ "enterprise" -box_sub_type> -Remote config -Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. -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 = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"XXX"} --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` - -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a -machine with no Internet browser available. - -Note that rclone runs a webserver on your local machine to collect the -token as returned from Box. This only runs from the moment it opens -your browser to the moment you get back the verification code. This -is on `http://127.0.0.1:53682/` and this it may require you to unblock -it temporarily if you are running a host firewall. - -Once configured you can then use `rclone` like this, - -List directories in top level of your Box - - rclone lsd remote: - -List all the files in your Box - - rclone ls remote: - -To copy a local directory to an Box directory called backup - - rclone copy /home/source remote:backup - -### Using rclone with an Enterprise account with SSO - -If you have an "Enterprise" account type with Box with single sign on -(SSO), you need to create a password to use Box with rclone. This can -be done at your Enterprise Box account by going to Settings, "Account" -Tab, and then set the password in the "Authentication" field. - -Once you have done this, you can setup your Enterprise Box account -using the same procedure detailed above in the, using the password you -have just set. - -### Invalid refresh token - -According to the [box docs](https://developer.box.com/v2.0/docs/oauth-20#section-6-using-the-access-and-refresh-tokens): - -> Each refresh_token is valid for one use in 60 days. - -This means that if you - - * Don't use the box remote for 60 days - * Copy the config file with a box refresh token in and use it in two places - * Get an error on a token refresh - -then rclone will return an error which includes the text `Invalid -refresh token`. - -To fix this you will need to use oauth2 again to update the refresh -token. You can use the methods in [the remote setup -docs](https://rclone.org/remote_setup/), bearing in mind that if you use the copy the -config file method, you should not use that remote on the computer you -did the authentication on. - -Here is how to do it. - -``` -$ rclone config -Current remotes: - -Name Type -==== ==== -remote box - -e) Edit existing remote -n) New remote -d) Delete remote -r) Rename remote -c) Copy remote -s) Set configuration password -q) Quit config -e/n/d/r/c/s/q> e -Choose a number from below, or type in an existing value - 1 > remote -remote> remote --------------------- -[remote] -type = box -token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2017-07-08T23:40:08.059167677+01:00"} --------------------- -Edit remote -Value "client_id" = "" -Edit? (y/n)> -y) Yes -n) No -y/n> n -Value "client_secret" = "" -Edit? (y/n)> +XX / Citrix Sharefile + \ "sharefile" +Storage> sharefile +** See help for sharefile backend at: https://rclone.org/sharefile/ ** + +ID of the root folder + +Leave blank to access "Personal Folders". You can use one of the +standard values here or any folder ID (long hex number ID). +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 1 / Access the Personal Folders. (Default) + \ "" + 2 / Access the Favorites folder. + \ "favorites" + 3 / Access all the shared folders. + \ "allshared" + 4 / Access all the individual connectors. + \ "connectors" + 5 / Access the home, favorites, and shared folders as well as the connectors. + \ "top" +root_folder_id> +Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config -Already have a token - refresh? -y) Yes -n) No -y/n> y Use web browser to automatically authenticate rclone with remote? * Say Y if the machine running rclone has a web browser you can use * Say N if running rclone on a (remote) machine without web browser access @@ -27311,14 +29182,15 @@ If not sure try Y. If Y failed, try N. 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 +If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=XXX Log in and authorize rclone for access Waiting for code... Got code -------------------- [remote] -type = box -token = {"access_token":"YYY","token_type":"bearer","refresh_token":"YYY","expiry":"2017-07-23T12:22:29.259137901+01:00"} +type = sharefile +endpoint = https://XXX.sharefile.com +token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2019-09-30T19:41:45.878561877+01:00"} -------------------- y) Yes this is OK e) Edit this remote @@ -27326,15 +29198,47 @@ d) Delete this remote y/e/d> y ``` -### Modified time and hashes +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a +machine with no Internet browser available. -Box allows modification times to be set on objects accurate to 1 +Note that rclone runs a webserver on your local machine to collect the +token as returned from Citrix ShareFile. This only runs from the moment it opens +your browser to the moment you get back the verification code. This +is on `http://127.0.0.1:53682/` and this it may require you to unblock +it temporarily if you are running a host firewall. + +Once configured you can then use `rclone` like this, + +List directories in top level of your ShareFile + + rclone lsd remote: + +List all the files in your ShareFile + + rclone ls remote: + +To copy a local directory to an ShareFile directory called backup + + rclone copy /home/source remote:backup + +Paths may be as deep as required, e.g. `remote:directory/subdirectory`. + +### Modification times and hashes + +ShareFile allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or not. -Box supports SHA1 type hashes, so you can use the `--checksum` +ShareFile supports MD5 type hashes, so you can use the `--checksum` flag. +### Transfers + +For files above 128 MiB rclone will use a chunked transfer. Rclone will +upload up to `--transfers` chunks at the same time (shared among all +the multipart uploads). Chunks are buffered in memory and are +normally 64 MiB so increasing `--transfers` will increase memory use. + ### Restricted filename characters In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) @@ -27342,64 +29246,33 @@ the following characters are also replaced: | Character | Value | Replacement | | --------- |:-----:|:-----------:| -| \ | 0x5C | \ | +| \\ | 0x5C | \ | +| * | 0x2A | * | +| < | 0x3C | < | +| > | 0x3E | > | +| ? | 0x3F | ? | +| : | 0x3A | : | +| \| | 0x7C | | | +| " | 0x22 | " | -File names can also not end with the following characters. -These only get replaced if they are the last character in the name: +File names can also not start or end with the following characters. +These only get replaced if they are the first or last character in the +name: | Character | Value | Replacement | | --------- |:-----:|:-----------:| | SP | 0x20 | ␠ | +| . | 0x2E | . | Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), as they can't be used in JSON strings. -### Transfers - -For files above 50 MiB rclone will use a chunked transfer. Rclone will -upload up to `--transfers` chunks at the same time (shared among all -the multipart uploads). Chunks are buffered in memory and are -normally 8 MiB so increasing `--transfers` will increase memory use. - -### Deleting files - -Depending on the enterprise settings for your user, the item will -either be actually deleted from Box or moved to the trash. - -Emptying the trash is supported via the rclone however cleanup command -however this deletes every trashed file and folder individually so it -may take a very long time. -Emptying the trash via the WebUI does not have this limitation -so it is advised to empty the trash via the WebUI. - -### Root folder ID - -You can set the `root_folder_id` for rclone. This is the directory -(identified by its `Folder ID`) that rclone considers to be the root -of your Box drive. - -Normally you will leave this blank and rclone will determine the -correct root to use itself. - -However you can set this to restrict rclone to a specific folder -hierarchy. - -In order to do this you will have to find the `Folder ID` of the -directory you wish rclone to display. This will be the last segment -of the URL when you open the relevant folder in the Box web -interface. - -So if the folder you want rclone to use has a URL which looks like -`https://app.box.com/folder/11xxxxxxxxx8` -in the browser, then you use `11xxxxxxxxx8` as -the `root_folder_id` in the config. - ### Standard options -Here are the Standard options specific to box (Box). +Here are the Standard options specific to sharefile (Citrix Sharefile). -#### --box-client-id +#### --sharefile-client-id OAuth Client Id. @@ -27408,11 +29281,11 @@ Leave blank normally. Properties: - Config: client_id -- Env Var: RCLONE_BOX_CLIENT_ID +- Env Var: RCLONE_SHAREFILE_CLIENT_ID - Type: string - Required: false -#### --box-client-secret +#### --sharefile-client-secret OAuth Client Secret. @@ -27421,70 +29294,51 @@ Leave blank normally. Properties: - Config: client_secret -- Env Var: RCLONE_BOX_CLIENT_SECRET -- Type: string -- Required: false - -#### --box-box-config-file - -Box App config.json location - -Leave blank normally. - -Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. - -Properties: - -- Config: box_config_file -- Env Var: RCLONE_BOX_BOX_CONFIG_FILE +- Env Var: RCLONE_SHAREFILE_CLIENT_SECRET - Type: string - Required: false -#### --box-access-token +#### --sharefile-root-folder-id -Box App Primary Access Token +ID of the root folder. -Leave blank normally. +Leave blank to access "Personal Folders". You can use one of the +standard values here or any folder ID (long hex number ID). Properties: -- Config: access_token -- Env Var: RCLONE_BOX_ACCESS_TOKEN +- Config: root_folder_id +- Env Var: RCLONE_SHAREFILE_ROOT_FOLDER_ID - Type: string - Required: false - -#### --box-box-sub-type - - - -Properties: - -- Config: box_sub_type -- Env Var: RCLONE_BOX_BOX_SUB_TYPE -- Type: string -- Default: "user" - Examples: - - "user" - - Rclone should act on behalf of a user. - - "enterprise" - - Rclone should act on behalf of a service account. + - "" + - Access the Personal Folders (default). + - "favorites" + - Access the Favorites folder. + - "allshared" + - Access all the shared folders. + - "connectors" + - Access all the individual connectors. + - "top" + - Access the home, favorites, and shared folders as well as the connectors. ### Advanced options -Here are the Advanced options specific to box (Box). +Here are the Advanced options specific to sharefile (Citrix Sharefile). -#### --box-token +#### --sharefile-token OAuth Access Token as a JSON blob. Properties: - Config: token -- Env Var: RCLONE_BOX_TOKEN +- Env Var: RCLONE_SHAREFILE_TOKEN - Type: string - Required: false -#### --box-auth-url +#### --sharefile-auth-url Auth server URL. @@ -27493,11 +29347,11 @@ Leave blank to use the provider defaults. Properties: - Config: auth_url -- Env Var: RCLONE_BOX_AUTH_URL +- Env Var: RCLONE_SHAREFILE_AUTH_URL - Type: string - Required: false -#### --box-token-url +#### --sharefile-token-url Token server url. @@ -27506,88 +29360,55 @@ Leave blank to use the provider defaults. Properties: - Config: token_url -- Env Var: RCLONE_BOX_TOKEN_URL +- Env Var: RCLONE_SHAREFILE_TOKEN_URL - Type: string - Required: false -#### --box-root-folder-id - -Fill in for rclone to use a non root folder as its starting point. - -Properties: - -- Config: root_folder_id -- Env Var: RCLONE_BOX_ROOT_FOLDER_ID -- Type: string -- Default: "0" - -#### --box-upload-cutoff +#### --sharefile-upload-cutoff -Cutoff for switching to multipart upload (>= 50 MiB). +Cutoff for switching to multipart upload. Properties: - Config: upload_cutoff -- Env Var: RCLONE_BOX_UPLOAD_CUTOFF +- Env Var: RCLONE_SHAREFILE_UPLOAD_CUTOFF - Type: SizeSuffix -- Default: 50Mi - -#### --box-commit-retries - -Max number of times to try committing a multipart file. - -Properties: - -- Config: commit_retries -- Env Var: RCLONE_BOX_COMMIT_RETRIES -- Type: int -- Default: 100 - -#### --box-list-chunk +- Default: 128Mi -Size of listing chunk 1-1000. +#### --sharefile-chunk-size -Properties: +Upload chunk size. -- Config: list_chunk -- Env Var: RCLONE_BOX_LIST_CHUNK -- Type: int -- Default: 1000 +Must a power of 2 >= 256k. -#### --box-owned-by +Making this larger will improve performance, but note that each chunk +is buffered in memory one per transfer. -Only show items owned by the login (email address) passed in. +Reducing this will reduce memory usage but decrease performance. Properties: -- Config: owned_by -- Env Var: RCLONE_BOX_OWNED_BY -- Type: string -- Required: false - -#### --box-impersonate - -Impersonate this user ID when using a service account. +- Config: chunk_size +- Env Var: RCLONE_SHAREFILE_CHUNK_SIZE +- Type: SizeSuffix +- Default: 64Mi -Settng this flag allows rclone, when using a JWT service account, to -act on behalf of another user by setting the as-user header. +#### --sharefile-endpoint -The user ID is the Box identifier for a user. User IDs can found for -any user via the GET /users endpoint, which is only available to -admins, or by calling the GET /users/me endpoint with an authenticated -user session. +Endpoint for API calls. -See: https://developer.box.com/guides/authentication/jwt/as-user/ +This is usually auto discovered as part of the oauth process, but can +be set manually to something like: https://XXX.sharefile.com Properties: -- Config: impersonate -- Env Var: RCLONE_BOX_IMPERSONATE +- Config: endpoint +- Env Var: RCLONE_SHAREFILE_ENDPOINT - Type: string - Required: false -#### --box-encoding +#### --sharefile-encoding The encoding for the backend. @@ -27596,366 +29417,446 @@ See the [encoding section in the overview](https://rclone.org/overview/#encoding Properties: - Config: encoding -- Env Var: RCLONE_BOX_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot - +- Env Var: RCLONE_SHAREFILE_ENCODING +- Type: Encoding +- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot ## Limitations -Note that Box is case insensitive so you can't have a file called +Note that ShareFile is case insensitive so you can't have a file called "Hello.doc" and one called "hello.doc". -Box file names can't have the `\` character in. rclone maps this to -and from an identical looking unicode equivalent `\` (U+FF3C Fullwidth -Reverse Solidus). - -Box only supports filenames up to 255 characters in length. - -Box has [API rate limits](https://developer.box.com/guides/api-calls/permissions-and-errors/rate-limits/) that sometimes reduce the speed of rclone. +ShareFile only supports filenames up to 256 characters in length. -`rclone about` is not supported by the Box backend. Backends without +`rclone about` is not supported by the Citrix ShareFile backend. Backends without this capability cannot determine free space for an rclone mount or use policy `mfs` (most free space) as a member of an rclone union remote. See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -## Get your own Box App ID - -Here is how to create your own Box App ID for rclone: - -1. Go to the [Box Developer Console](https://app.box.com/developers/console) -and login, then click `My Apps` on the sidebar. Click `Create New App` -and select `Custom App`. - -2. In the first screen on the box that pops up, you can pretty much enter -whatever you want. The `App Name` can be whatever. For `Purpose` choose -automation to avoid having to fill out anything else. Click `Next`. - -3. In the second screen of the creation screen, select -`User Authentication (OAuth 2.0)`. Then click `Create App`. - -4. You should now be on the `Configuration` tab of your new app. If not, -click on it at the top of the webpage. Copy down `Client ID` -and `Client Secret`, you'll need those for rclone. - -5. Under "OAuth 2.0 Redirect URI", add `http://127.0.0.1:53682/` - -6. For `Application Scopes`, select `Read all files and folders stored in Box` -and `Write all files and folders stored in box` (assuming you want to do both). -Leave others unchecked. Click `Save Changes` at the top right. +# Crypt -# Cache +Rclone `crypt` remotes encrypt and decrypt other remotes. -The `cache` remote wraps another existing remote and stores file structure -and its data for long running tasks like `rclone mount`. +A remote of type `crypt` does not access a [storage system](https://rclone.org/overview/) +directly, but instead wraps another remote, which in turn accesses +the storage system. This is similar to how [alias](https://rclone.org/alias/), +[union](https://rclone.org/union/), [chunker](https://rclone.org/chunker/) +and a few others work. It makes the usage very flexible, as you can +add a layer, in this case an encryption layer, on top of any other +backend, even in multiple layers. Rclone's functionality +can be used as with any other remote, for example you can +[mount](https://rclone.org/commands/rclone_mount/) a crypt remote. -## Status +Accessing a storage system through a crypt remote realizes client-side +encryption, which makes it safe to keep your data in a location you do +not trust will not get compromised. +When working against the `crypt` remote, rclone will automatically +encrypt (before uploading) and decrypt (after downloading) on your local +system as needed on the fly, leaving the data encrypted at rest in the +wrapped remote. If you access the storage system using an application +other than rclone, or access the wrapped remote directly using rclone, +there will not be any encryption/decryption: Downloading existing content +will just give you the encrypted (scrambled) format, and anything you +upload will *not* become encrypted. -The cache backend code is working but it currently doesn't -have a maintainer so there are [outstanding bugs](https://github.com/rclone/rclone/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3A%22Remote%3A+Cache%22) which aren't getting fixed. +The encryption is a secret-key encryption (also called symmetric key encryption) +algorithm, where a password (or pass phrase) is used to generate real encryption key. +The password can be supplied by user, or you may chose to let rclone +generate one. It will be stored in the configuration file, in a lightly obscured form. +If you are in an environment where you are not able to keep your configuration +secured, you should add +[configuration encryption](https://rclone.org/docs/#configuration-encryption) +as protection. As long as you have this configuration file, you will be able to +decrypt your data. Without the configuration file, as long as you remember +the password (or keep it in a safe place), you can re-create the configuration +and gain access to the existing data. You may also configure a corresponding +remote in a different installation to access the same data. +See below for guidance to [changing password](#changing-password). -The cache backend is due to be phased out in favour of the VFS caching -layer eventually which is more tightly integrated into rclone. +Encryption uses [cryptographic salt](https://en.wikipedia.org/wiki/Salt_(cryptography)), +to permute the encryption key so that the same string may be encrypted in +different ways. When configuring the crypt remote it is optional to enter a salt, +or to let rclone generate a unique salt. If omitted, rclone uses a built-in unique string. +Normally in cryptography, the salt is stored together with the encrypted content, +and do not have to be memorized by the user. This is not the case in rclone, +because rclone does not store any additional information on the remotes. Use of +custom salt is effectively a second password that must be memorized. -Until this happens we recommend only using the cache backend if you -find you can't work without it. There are many docs online describing -the use of the cache backend to minimize API hits and by-and-large -these are out of date and the cache backend isn't needed in those -scenarios any more. +[File content](#file-encryption) encryption is performed using +[NaCl SecretBox](https://godoc.org/golang.org/x/crypto/nacl/secretbox), +based on XSalsa20 cipher and Poly1305 for integrity. +[Names](#name-encryption) (file- and directory names) are also encrypted +by default, but this has some implications and is therefore +possible to be turned off. ## Configuration -To get started you just need to have an existing remote which can be configured -with `cache`. +Here is an example of how to make a remote called `secret`. -Here is an example of how to make a remote called `test-cache`. First run: +To use `crypt`, first set up the underlying remote. Follow the +`rclone config` instructions for the specific backend. - rclone config +Before configuring the crypt remote, check the underlying remote is +working. In this example the underlying remote is called `remote`. +We will configure a path `path` within this remote to contain the +encrypted content. Anything inside `remote:path` will be encrypted +and anything outside will not. -This will guide you through an interactive setup process: +Configure `crypt` using `rclone config`. In this example the `crypt` +remote is called `secret`, to differentiate it from the underlying +`remote`. + +When you are done you can use the crypt remote named `secret` just +as you would with any other remote, e.g. `rclone copy D:\docs secret:\docs`, +and rclone will encrypt and decrypt as needed on the fly. +If you access the wrapped remote `remote:path` directly you will bypass +the encryption, and anything you read will be in encrypted form, and +anything you write will be unencrypted. To avoid issues it is best to +configure a dedicated path for encrypted content, and access it +exclusively through a crypt remote. ``` No remotes found, make a new one? n) New remote -r) Rename remote -c) Copy remote s) Set configuration password q) Quit config -n/r/c/s/q> n -name> test-cache +n/s/q> n +name> secret Type of storage to configure. +Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] -XX / Cache a remote - \ "cache" +XX / Encrypt/Decrypt a remote + \ "crypt" [snip] -Storage> cache -Remote to cache. -Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", +Storage> crypt +** See help for crypt backend at: https://rclone.org/crypt/ ** + +Remote to encrypt/decrypt. +Normally should contain a ':' and a path, eg "myremote:path/to/dir", "myremote:bucket" or maybe "myremote:" (not recommended). -remote> local:/test -Optional: The URL of the Plex server -plex_url> http://127.0.0.1:32400 -Optional: The username of the Plex user -plex_username> dummyusername -Optional: The password of the Plex user +Enter a string value. Press Enter for the default (""). +remote> remote:path +How to encrypt the filenames. +Enter a string value. Press Enter for the default ("standard"). +Choose a number from below, or type in your own value. + / Encrypt the filenames. + 1 | See the docs for the details. + \ "standard" + 2 / Very simple filename obfuscation. + \ "obfuscate" + / Don't encrypt the file names. + 3 | Adds a ".bin" extension only. + \ "off" +filename_encryption> +Option to either encrypt directory names or leave them intact. + +NB If filename_encryption is "off" then this option will do nothing. +Enter a boolean value (true or false). Press Enter for the default ("true"). +Choose a number from below, or type in your own value + 1 / Encrypt directory names. + \ "true" + 2 / Don't encrypt directory names, leave them intact. + \ "false" +directory_name_encryption> +Password or pass phrase for encryption. y) Yes type in my own password g) Generate random password -n) No leave this optional password blank -y/g/n> y +y/g> y Enter the password: password: Confirm the password: password: -The size of a chunk. Lower value good for slow connections but can affect seamless reading. -Default: 5M -Choose a number from below, or type in your own value - 1 / 1 MiB - \ "1M" - 2 / 5 MiB - \ "5M" - 3 / 10 MiB - \ "10M" -chunk_size> 2 -How much time should object info (file size, file hashes, etc.) be stored in cache. Use a very high value if you don't plan on changing the source FS from outside the cache. -Accepted units are: "s", "m", "h". -Default: 5m -Choose a number from below, or type in your own value - 1 / 1 hour - \ "1h" - 2 / 24 hours - \ "24h" - 3 / 24 hours - \ "48h" -info_age> 2 -The maximum size of stored chunks. When the storage grows beyond this size, the oldest chunks will be deleted. -Default: 10G -Choose a number from below, or type in your own value - 1 / 500 MiB - \ "500M" - 2 / 1 GiB - \ "1G" - 3 / 10 GiB - \ "10G" -chunk_total_size> 3 +Password or pass phrase for salt. Optional but recommended. +Should be different to the previous password. +y) Yes type in my own password +g) Generate random password +n) No leave this optional password blank (default) +y/g/n> g +Password strength in bits. +64 is just about memorable +128 is secure +1024 is the maximum +Bits> 128 +Your password is: JAsJvRcgR-_veXNfy_sGmQ +Use this password? Please note that an obscured version of this +password (and not the password itself) will be stored under your +configuration file, so keep this generated password in a safe place. +y) Yes (default) +n) No +y/n> +Edit advanced config? (y/n) +y) Yes +n) No (default) +y/n> Remote config -------------------- -[test-cache] -remote = local:/test -plex_url = http://127.0.0.1:32400 -plex_username = dummyusername -plex_password = *** ENCRYPTED *** -chunk_size = 5M -info_age = 48h -chunk_total_size = 10G +[secret] +type = crypt +remote = remote:path +password = *** ENCRYPTED *** +password2 = *** ENCRYPTED *** +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> ``` -You can then use it like this, - -List directories in top level of your drive - - rclone lsd test-cache: - -List all the files in your drive - - rclone ls test-cache: - -To start a cached mount +**Important** The crypt password stored in `rclone.conf` is lightly +obscured. That only protects it from cursory inspection. It is not +secure unless [configuration encryption](https://rclone.org/docs/#configuration-encryption) of `rclone.conf` is specified. - rclone mount --allow-other test-cache: /var/tmp/test-cache +A long passphrase is recommended, or `rclone config` can generate a +random one. -### Write Features ### +The obscured password is created using AES-CTR with a static key. The +salt is stored verbatim at the beginning of the obscured password. This +static key is shared between all versions of rclone. -### Offline uploading ### +If you reconfigure rclone with the same passwords/passphrases +elsewhere it will be compatible, but the obscured version will be different +due to the different salt. -In an effort to make writing through cache more reliable, the backend -now supports this feature which can be activated by specifying a -`cache-tmp-upload-path`. +Rclone does not encrypt -A files goes through these states when using this feature: + * file length - this can be calculated within 16 bytes + * modification time - used for syncing -1. An upload is started (usually by copying a file on the cache remote) -2. When the copy to the temporary location is complete the file is part -of the cached remote and looks and behaves like any other file (reading included) -3. After `cache-tmp-wait-time` passes and the file is next in line, `rclone move` -is used to move the file to the cloud provider -4. Reading the file still works during the upload but most modifications on it will be prohibited -5. Once the move is complete the file is unlocked for modifications as it -becomes as any other regular file -6. If the file is being read through `cache` when it's actually -deleted from the temporary path then `cache` will simply swap the source -to the cloud provider without interrupting the reading (small blip can happen though) +### Specifying the remote -Files are uploaded in sequence and only one file is uploaded at a time. -Uploads will be stored in a queue and be processed based on the order they were added. -The queue and the temporary storage is persistent across restarts but -can be cleared on startup with the `--cache-db-purge` flag. +When configuring the remote to encrypt/decrypt, you may specify any +string that rclone accepts as a source/destination of other commands. -### Write Support ### +The primary use case is to specify the path into an already configured +remote (e.g. `remote:path/to/dir` or `remote:bucket`), such that +data in a remote untrusted location can be stored encrypted. -Writes are supported through `cache`. -One caveat is that a mounted cache remote does not add any retry or fallback -mechanism to the upload operation. This will depend on the implementation -of the wrapped remote. Consider using `Offline uploading` for reliable writes. +You may also specify a local filesystem path, such as +`/path/to/dir` on Linux, `C:\path\to\dir` on Windows. By creating +a crypt remote pointing to such a local filesystem path, you can +use rclone as a utility for pure local file encryption, for example +to keep encrypted files on a removable USB drive. -One special case is covered with `cache-writes` which will cache the file -data at the same time as the upload when it is enabled making it available -from the cache store immediately once the upload is finished. +**Note**: A string which do not contain a `:` will by rclone be treated +as a relative path in the local filesystem. For example, if you enter +the name `remote` without the trailing `:`, it will be treated as +a subdirectory of the current directory with name "remote". -### Read Features ### +If a path `remote:path/to/dir` is specified, rclone stores encrypted +files in `path/to/dir` on the remote. With file name encryption, files +saved to `secret:subdir/subfile` are stored in the unencrypted path +`path/to/dir` but the `subdir/subpath` element is encrypted. -#### Multiple connections #### +The path you specify does not have to exist, rclone will create +it when needed. -To counter the high latency between a local PC where rclone is running -and cloud providers, the cache remote can split multiple requests to the -cloud provider for smaller file chunks and combines them together locally -where they can be available almost immediately before the reader usually -needs them. +If you intend to use the wrapped remote both directly for keeping +unencrypted content, as well as through a crypt remote for encrypted +content, it is recommended to point the crypt remote to a separate +directory within the wrapped remote. If you use a bucket-based storage +system (e.g. Swift, S3, Google Compute Storage, B2) it is generally +advisable to wrap the crypt remote around a specific bucket (`s3:bucket`). +If wrapping around the entire root of the storage (`s3:`), and use the +optional file name encryption, rclone will encrypt the bucket name. -This is similar to buffering when media files are played online. Rclone -will stay around the current marker but always try its best to stay ahead -and prepare the data before. +### Changing password -#### Plex Integration #### +Should the password, or the configuration file containing a lightly obscured +form of the password, be compromised, you need to re-encrypt your data with +a new password. Since rclone uses secret-key encryption, where the encryption +key is generated directly from the password kept on the client, it is not +possible to change the password/key of already encrypted content. Just changing +the password configured for an existing crypt remote means you will no longer +able to decrypt any of the previously encrypted content. The only possibility +is to re-upload everything via a crypt remote configured with your new password. -There is a direct integration with Plex which allows cache to detect during reading -if the file is in playback or not. This helps cache to adapt how it queries -the cloud provider depending on what is needed for. +Depending on the size of your data, your bandwidth, storage quota etc, there are +different approaches you can take: +- If you have everything in a different location, for example on your local system, +you could remove all of the prior encrypted files, change the password for your +configured crypt remote (or delete and re-create the crypt configuration), +and then re-upload everything from the alternative location. +- If you have enough space on the storage system you can create a new crypt +remote pointing to a separate directory on the same backend, and then use +rclone to copy everything from the original crypt remote to the new, +effectively decrypting everything on the fly using the old password and +re-encrypting using the new password. When done, delete the original crypt +remote directory and finally the rclone crypt configuration with the old password. +All data will be streamed from the storage system and back, so you will +get half the bandwidth and be charged twice if you have upload and download quota +on the storage system. -Scans will have a minimum amount of workers (1) while in a confirmed playback cache -will deploy the configured number of workers. +**Note**: A security problem related to the random password generator +was fixed in rclone version 1.53.3 (released 2020-11-19). Passwords generated +by rclone config in version 1.49.0 (released 2019-08-26) to 1.53.2 +(released 2020-10-26) are not considered secure and should be changed. +If you made up your own password, or used rclone version older than 1.49.0 or +newer than 1.53.2 to generate it, you are *not* affected by this issue. +See [issue #4783](https://github.com/rclone/rclone/issues/4783) for more +details, and a tool you can use to check if you are affected. -This integration opens the doorway to additional performance improvements -which will be explored in the near future. +### Example -**Note:** If Plex options are not configured, `cache` will function with its -configured options without adapting any of its settings. +Create the following file structure using "standard" file name +encryption. -How to enable? Run `rclone config` and add all the Plex options (endpoint, username -and password) in your remote and it will be automatically enabled. +``` +plaintext/ +├── file0.txt +├── file1.txt +└── subdir + ├── file2.txt + ├── file3.txt + └── subsubdir + └── file4.txt +``` -Affected settings: -- `cache-workers`: _Configured value_ during confirmed playback or _1_ all the other times +Copy these to the remote, and list them -##### Certificate Validation ##### +``` +$ rclone -q copy plaintext secret: +$ rclone -q ls secret: + 7 file1.txt + 6 file0.txt + 8 subdir/file2.txt + 10 subdir/subsubdir/file4.txt + 9 subdir/file3.txt +``` -When the Plex server is configured to only accept secure connections, it is -possible to use `.plex.direct` URLs to ensure certificate validation succeeds. -These URLs are used by Plex internally to connect to the Plex server securely. +The crypt remote looks like -The format for these URLs is the following: +``` +$ rclone -q ls remote:path + 55 hagjclgavj2mbiqm6u6cnjjqcg + 54 v05749mltvv1tf4onltun46gls + 57 86vhrsv86mpbtd3a0akjuqslj8/dlj7fkq4kdq72emafg7a7s41uo + 58 86vhrsv86mpbtd3a0akjuqslj8/7uu829995du6o42n32otfhjqp4/b9pausrfansjth5ob3jkdqd4lc + 56 86vhrsv86mpbtd3a0akjuqslj8/8njh1sk437gttmep3p70g81aps +``` -`https://ip-with-dots-replaced.server-hash.plex.direct:32400/` +The directory structure is preserved -The `ip-with-dots-replaced` part can be any IPv4 address, where the dots -have been replaced with dashes, e.g. `127.0.0.1` becomes `127-0-0-1`. +``` +$ rclone -q ls secret:subdir + 8 file2.txt + 9 file3.txt + 10 subsubdir/file4.txt +``` -To get the `server-hash` part, the easiest way is to visit +Without file name encryption `.bin` extensions are added to underlying +names. This prevents the cloud provider attempting to interpret file +content. -https://plex.tv/api/resources?includeHttps=1&X-Plex-Token=your-plex-token +``` +$ rclone -q ls remote:path + 54 file0.txt.bin + 57 subdir/file3.txt.bin + 56 subdir/file2.txt.bin + 58 subdir/subsubdir/file4.txt.bin + 55 file1.txt.bin +``` -This page will list all the available Plex servers for your account -with at least one `.plex.direct` link for each. Copy one URL and replace -the IP address with the desired address. This can be used as the -`plex_url` value. +### File name encryption modes -### Known issues ### +Off -#### Mount and --dir-cache-time #### + * doesn't hide file names or directory structure + * allows for longer file names (~246 characters) + * can use sub paths and copy single files ---dir-cache-time controls the first layer of directory caching which works at the mount layer. -Being an independent caching mechanism from the `cache` backend, it will manage its own entries -based on the configured time. +Standard -To avoid getting in a scenario where dir cache has obsolete data and cache would have the correct -one, try to set `--dir-cache-time` to a lower time than `--cache-info-age`. Default values are -already configured in this way. + * file names encrypted + * file names can't be as long (~143 characters) + * can use sub paths and copy single files + * directory structure visible + * identical files names will have identical uploaded names + * can use shortcuts to shorten the directory recursion -#### Windows support - Experimental #### +Obfuscation -There are a couple of issues with Windows `mount` functionality that still require some investigations. -It should be considered as experimental thus far as fixes come in for this OS. +This is a simple "rotate" of the filename, with each file having a rot +distance based on the filename. Rclone stores the distance at the +beginning of the filename. A file called "hello" may become "53.jgnnq". -Most of the issues seem to be related to the difference between filesystems -on Linux flavors and Windows as cache is heavily dependent on them. +Obfuscation is not a strong encryption of filenames, but hinders +automated scanning tools picking up on filename patterns. It is an +intermediate between "off" and "standard" which allows for longer path +segment names. -Any reports or feedback on how cache behaves on this OS is greatly appreciated. - -- https://github.com/rclone/rclone/issues/1935 -- https://github.com/rclone/rclone/issues/1907 -- https://github.com/rclone/rclone/issues/1834 +There is a possibility with some unicode based filenames that the +obfuscation is weak and may map lower case characters to upper case +equivalents. -#### Risk of throttling #### +Obfuscation cannot be relied upon for strong protection. -Future iterations of the cache backend will make use of the pooling functionality -of the cloud provider to synchronize and at the same time make writing through it -more tolerant to failures. + * file names very lightly obfuscated + * file names can be longer than standard encryption + * can use sub paths and copy single files + * directory structure visible + * identical files names will have identical uploaded names -There are a couple of enhancements in track to add these but in the meantime -there is a valid concern that the expiring cache listings can lead to cloud provider -throttles or bans due to repeated queries on it for very large mounts. +Cloud storage systems have limits on file name length and +total path length which rclone is more likely to breach using +"Standard" file name encryption. Where file names are less than 156 +characters in length issues should not be encountered, irrespective of +cloud storage provider. -Some recommendations: -- don't use a very small interval for entry information (`--cache-info-age`) -- while writes aren't yet optimised, you can still write through `cache` which gives you the advantage -of adding the file in the cache at the same time if configured to do so. +An experimental advanced option `filename_encoding` is now provided to +address this problem to a certain degree. +For cloud storage systems with case sensitive file names (e.g. Google Drive), +`base64` can be used to reduce file name length. +For cloud storage systems using UTF-16 to store file names internally +(e.g. OneDrive, Dropbox, Box), `base32768` can be used to drastically reduce +file name length. -Future enhancements: +An alternative, future rclone file name encryption mode may tolerate +backend provider path length limits. -- https://github.com/rclone/rclone/issues/1937 -- https://github.com/rclone/rclone/issues/1936 +### Directory name encryption -#### cache and crypt #### +Crypt offers the option of encrypting dir names or leaving them intact. +There are two options: -One common scenario is to keep your data encrypted in the cloud provider -using the `crypt` remote. `crypt` uses a similar technique to wrap around -an existing remote and handles this translation in a seamless way. +True -There is an issue with wrapping the remotes in this order: -**cloud remote** -> **crypt** -> **cache** +Encrypts the whole file path including directory names +Example: +`1/12/123.txt` is encrypted to +`p0e52nreeaj0a5ea7s64m4j72s/l42g6771hnv3an9cgc8cr2n1ng/qgm4avr35m5loi1th53ato71v0` -During testing, I experienced a lot of bans with the remotes in this order. -I suspect it might be related to how crypt opens files on the cloud provider -which makes it think we're downloading the full file instead of small chunks. -Organizing the remotes in this order yields better results: -**cloud remote** -> **cache** -> **crypt** +False -#### absolute remote paths #### +Only encrypts file names, skips directory names +Example: +`1/12/123.txt` is encrypted to +`1/12/qgm4avr35m5loi1th53ato71v0` -`cache` can not differentiate between relative and absolute paths for the wrapped remote. -Any path given in the `remote` config setting and on the command line will be passed to -the wrapped remote as is, but for storing the chunks on disk the path will be made -relative by removing any leading `/` character. -This behavior is irrelevant for most backend types, but there are backends where a leading `/` -changes the effective directory, e.g. in the `sftp` backend paths starting with a `/` are -relative to the root of the SSH server and paths without are relative to the user home directory. -As a result `sftp:bin` and `sftp:/bin` will share the same cache folder, even if they represent -a different directory on the SSH server. +### Modification times and hashes -### Cache and Remote Control (--rc) ### -Cache supports the new `--rc` mode in rclone and can be remote controlled through the following end points: -By default, the listener is disabled if you do not add the flag. +Crypt stores modification times using the underlying remote so support +depends on that. -### rc cache/expire -Purge a remote from the cache backend. Supports either a directory or a file. -It supports both encrypted and unencrypted file names if cache is wrapped by crypt. +Hashes are not stored for crypt. However the data integrity is +protected by an extremely strong crypto authenticator. -Params: - - **remote** = path to remote **(required)** - - **withData** = true/false to delete cached data (chunks) as well _(optional, false by default)_ +Use the `rclone cryptcheck` command to check the +integrity of an encrypted remote instead of `rclone check` which can't +check the checksums properly. ### Standard options -Here are the Standard options specific to cache (Cache a remote). +Here are the Standard options specific to crypt (Encrypt/Decrypt a remote). -#### --cache-remote +#### --crypt-remote -Remote to cache. +Remote to encrypt/decrypt. Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", "myremote:bucket" or maybe "myremote:" (not recommended). @@ -27963,855 +29864,705 @@ Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", Properties: - Config: remote -- Env Var: RCLONE_CACHE_REMOTE +- Env Var: RCLONE_CRYPT_REMOTE - Type: string - Required: true -#### --cache-plex-url +#### --crypt-filename-encryption -The URL of the Plex server. +How to encrypt the filenames. Properties: -- Config: plex_url -- Env Var: RCLONE_CACHE_PLEX_URL +- Config: filename_encryption +- Env Var: RCLONE_CRYPT_FILENAME_ENCRYPTION - Type: string -- Required: false +- Default: "standard" +- Examples: + - "standard" + - Encrypt the filenames. + - See the docs for the details. + - "obfuscate" + - Very simple filename obfuscation. + - "off" + - Don't encrypt the file names. + - Adds a ".bin", or "suffix" extension only. -#### --cache-plex-username +#### --crypt-directory-name-encryption -The username of the Plex user. +Option to either encrypt directory names or leave them intact. + +NB If filename_encryption is "off" then this option will do nothing. Properties: -- Config: plex_username -- Env Var: RCLONE_CACHE_PLEX_USERNAME -- Type: string -- Required: false +- Config: directory_name_encryption +- Env Var: RCLONE_CRYPT_DIRECTORY_NAME_ENCRYPTION +- Type: bool +- Default: true +- Examples: + - "true" + - Encrypt directory names. + - "false" + - Don't encrypt directory names, leave them intact. -#### --cache-plex-password +#### --crypt-password -The password of the Plex user. +Password or pass phrase for encryption. **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: -- Config: plex_password -- Env Var: RCLONE_CACHE_PLEX_PASSWORD +- Config: password +- Env Var: RCLONE_CRYPT_PASSWORD - Type: string -- Required: false +- Required: true -#### --cache-chunk-size +#### --crypt-password2 -The size of a chunk (partial file data). +Password or pass phrase for salt. -Use lower numbers for slower connections. If the chunk size is -changed, any downloaded chunks will be invalid and cache-chunk-path -will need to be cleared or unexpected EOF errors will occur. +Optional but recommended. +Should be different to the previous password. + +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: -- Config: chunk_size -- Env Var: RCLONE_CACHE_CHUNK_SIZE -- Type: SizeSuffix -- Default: 5Mi -- Examples: - - "1M" - - 1 MiB - - "5M" - - 5 MiB - - "10M" - - 10 MiB +- Config: password2 +- Env Var: RCLONE_CRYPT_PASSWORD2 +- Type: string +- Required: false -#### --cache-info-age +### Advanced options -How long to cache file structure information (directory listings, file size, times, etc.). -If all write operations are done through the cache then you can safely make -this value very large as the cache store will also be updated in real time. +Here are the Advanced options specific to crypt (Encrypt/Decrypt a remote). -Properties: +#### --crypt-server-side-across-configs -- Config: info_age -- Env Var: RCLONE_CACHE_INFO_AGE -- Type: Duration -- Default: 6h0m0s -- Examples: - - "1h" - - 1 hour - - "24h" - - 24 hours - - "48h" - - 48 hours +Deprecated: use --server-side-across-configs instead. -#### --cache-chunk-total-size +Allow server-side operations (e.g. copy) to work across different crypt configs. -The total size that the chunks can take up on the local disk. +Normally this option is not what you want, but if you have two crypts +pointing to the same backend you can use it. -If the cache exceeds this value then it will start to delete the -oldest chunks until it goes under this value. +This can be used, for example, to change file name encryption type +without re-uploading all the data. Just make two crypt backends +pointing to two different directories with the single changed +parameter and use rclone move to move the files between the crypt +remotes. Properties: -- Config: chunk_total_size -- Env Var: RCLONE_CACHE_CHUNK_TOTAL_SIZE -- Type: SizeSuffix -- Default: 10Gi -- Examples: - - "500M" - - 500 MiB - - "1G" - - 1 GiB - - "10G" - - 10 GiB +- Config: server_side_across_configs +- Env Var: RCLONE_CRYPT_SERVER_SIDE_ACROSS_CONFIGS +- Type: bool +- Default: false -### Advanced options +#### --crypt-show-mapping -Here are the Advanced options specific to cache (Cache a remote). +For all files listed show how the names encrypt. -#### --cache-plex-token +If this flag is set then for each file that the remote is asked to +list, it will log (at level INFO) a line stating the decrypted file +name and the encrypted file name. -The plex token for authentication - auto set normally. +This is so you can work out which encrypted names are which decrypted +names just in case you need to do something with the encrypted file +names, or for debugging purposes. Properties: -- Config: plex_token -- Env Var: RCLONE_CACHE_PLEX_TOKEN -- Type: string -- Required: false +- Config: show_mapping +- Env Var: RCLONE_CRYPT_SHOW_MAPPING +- Type: bool +- Default: false -#### --cache-plex-insecure +#### --crypt-no-data-encryption -Skip all certificate verification when connecting to the Plex server. +Option to either encrypt file data or leave it unencrypted. + +Properties: + +- Config: no_data_encryption +- Env Var: RCLONE_CRYPT_NO_DATA_ENCRYPTION +- Type: bool +- Default: false +- Examples: + - "true" + - Don't encrypt file data, leave it unencrypted. + - "false" + - Encrypt file data. + +#### --crypt-pass-bad-blocks + +If set this will pass bad blocks through as all 0. + +This should not be set in normal operation, it should only be set if +trying to recover an encrypted file with errors and it is desired to +recover as much of the file as possible. Properties: -- Config: plex_insecure -- Env Var: RCLONE_CACHE_PLEX_INSECURE -- Type: string -- Required: false +- Config: pass_bad_blocks +- Env Var: RCLONE_CRYPT_PASS_BAD_BLOCKS +- Type: bool +- Default: false -#### --cache-db-path +#### --crypt-filename-encoding -Directory to store file structure metadata DB. +How to encode the encrypted filename to text string. -The remote name is used as the DB file name. +This option could help with shortening the encrypted filename. The +suitable option would depend on the way your remote count the filename +length and if it's case sensitive. Properties: -- Config: db_path -- Env Var: RCLONE_CACHE_DB_PATH +- Config: filename_encoding +- Env Var: RCLONE_CRYPT_FILENAME_ENCODING - Type: string -- Default: "$HOME/.cache/rclone/cache-backend" - -#### --cache-chunk-path +- Default: "base32" +- Examples: + - "base32" + - Encode using base32. Suitable for all remote. + - "base64" + - Encode using base64. Suitable for case sensitive remote. + - "base32768" + - Encode using base32768. Suitable if your remote counts UTF-16 or + - Unicode codepoint instead of UTF-8 byte length. (Eg. Onedrive, Dropbox) -Directory to cache chunk files. +#### --crypt-suffix -Path to where partial file data (chunks) are stored locally. The remote -name is appended to the final path. +If this is set it will override the default suffix of ".bin". -This config follows the "--cache-db-path". If you specify a custom -location for "--cache-db-path" and don't specify one for "--cache-chunk-path" -then "--cache-chunk-path" will use the same path as "--cache-db-path". +Setting suffix to "none" will result in an empty suffix. This may be useful +when the path length is critical. Properties: -- Config: chunk_path -- Env Var: RCLONE_CACHE_CHUNK_PATH +- Config: suffix +- Env Var: RCLONE_CRYPT_SUFFIX - Type: string -- Default: "$HOME/.cache/rclone/cache-backend" +- Default: ".bin" -#### --cache-db-purge +### Metadata -Clear all the cached data for this remote on start. +Any metadata supported by the underlying remote is read and written. -Properties: +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -- Config: db_purge -- Env Var: RCLONE_CACHE_DB_PURGE -- Type: bool -- Default: false +## Backend commands -#### --cache-chunk-clean-interval +Here are the commands specific to the crypt backend. -How often should the cache perform cleanups of the chunk storage. +Run them with -The default value should be ok for most people. If you find that the -cache goes over "cache-chunk-total-size" too often then try to lower -this value to force it to perform cleanups more often. + rclone backend COMMAND remote: -Properties: +The help below will explain what arguments each command takes. -- Config: chunk_clean_interval -- Env Var: RCLONE_CACHE_CHUNK_CLEAN_INTERVAL -- Type: Duration -- Default: 1m0s +See the [backend](https://rclone.org/commands/rclone_backend/) command for more +info on how to pass options and arguments. -#### --cache-read-retries +These can be run on a running backend using the rc command +[backend/command](https://rclone.org/rc/#backend-command). -How many times to retry a read from a cache storage. +### encode -Since reading from a cache stream is independent from downloading file -data, readers can get to a point where there's no more data in the -cache. Most of the times this can indicate a connectivity issue if -cache isn't able to provide file data anymore. +Encode the given filename(s) -For really slow connections, increase this to a point where the stream is -able to provide data but your experience will be very stuttering. + rclone backend encode remote: [options] [+] -Properties: +This encodes the filenames given as arguments returning a list of +strings of the encoded results. -- Config: read_retries -- Env Var: RCLONE_CACHE_READ_RETRIES -- Type: int -- Default: 10 +Usage Example: -#### --cache-workers + rclone backend encode crypt: file1 [file2...] + rclone rc backend/command command=encode fs=crypt: file1 [file2...] -How many workers should run in parallel to download chunks. -Higher values will mean more parallel processing (better CPU needed) -and more concurrent requests on the cloud provider. This impacts -several aspects like the cloud provider API limits, more stress on the -hardware that rclone runs on but it also means that streams will be -more fluid and data will be available much more faster to readers. +### decode -**Note**: If the optional Plex integration is enabled then this -setting will adapt to the type of reading performed and the value -specified here will be used as a maximum number of workers to use. +Decode the given filename(s) -Properties: + rclone backend decode remote: [options] [+] -- Config: workers -- Env Var: RCLONE_CACHE_WORKERS -- Type: int -- Default: 4 +This decodes the filenames given as arguments returning a list of +strings of the decoded results. It will return an error if any of the +inputs are invalid. -#### --cache-chunk-no-memory +Usage Example: -Disable the in-memory cache for storing chunks during streaming. + rclone backend decode crypt: encryptedfile1 [encryptedfile2...] + rclone rc backend/command command=decode fs=crypt: encryptedfile1 [encryptedfile2...] -By default, cache will keep file data during streaming in RAM as well -to provide it to readers as fast as possible. -This transient data is evicted as soon as it is read and the number of -chunks stored doesn't exceed the number of workers. However, depending -on other settings like "cache-chunk-size" and "cache-workers" this footprint -can increase if there are parallel streams too (multiple files being read -at the same time). -If the hardware permits it, use this feature to provide an overall better -performance during streaming but it can also be disabled if RAM is not -available on the local machine. -Properties: +## Backing up an encrypted remote -- Config: chunk_no_memory -- Env Var: RCLONE_CACHE_CHUNK_NO_MEMORY -- Type: bool -- Default: false +If you wish to backup an encrypted remote, it is recommended that you use +`rclone sync` on the encrypted files, and make sure the passwords are +the same in the new encrypted remote. -#### --cache-rps +This will have the following advantages -Limits the number of requests per second to the source FS (-1 to disable). + * `rclone sync` will check the checksums while copying + * you can use `rclone check` between the encrypted remotes + * you don't decrypt and encrypt unnecessarily -This setting places a hard limit on the number of requests per second -that cache will be doing to the cloud provider remote and try to -respect that value by setting waits between reads. +For example, let's say you have your original remote at `remote:` with +the encrypted version at `eremote:` with path `remote:crypt`. You +would then set up the new remote `remote2:` and then the encrypted +version `eremote2:` with path `remote2:crypt` using the same passwords +as `eremote:`. -If you find that you're getting banned or limited on the cloud -provider through cache and know that a smaller number of requests per -second will allow you to work with it then you can use this setting -for that. +To sync the two remotes you would do -A good balance of all the other settings should make this setting -useless but it is available to set for more special cases. + rclone sync --interactive remote:crypt remote2:crypt -**NOTE**: This will limit the number of requests during streams but -other API calls to the cloud provider like directory listings will -still pass. +And to check the integrity you would do -Properties: + rclone check remote:crypt remote2:crypt -- Config: rps -- Env Var: RCLONE_CACHE_RPS -- Type: int -- Default: -1 +## File formats -#### --cache-writes +### File encryption -Cache file data on writes through the FS. +Files are encrypted 1:1 source file to destination object. The file +has a header and is divided into chunks. -If you need to read files immediately after you upload them through -cache you can enable this flag to have their data stored in the -cache store at the same time during upload. +#### Header -Properties: + * 8 bytes magic string `RCLONE\x00\x00` + * 24 bytes Nonce (IV) -- Config: writes -- Env Var: RCLONE_CACHE_WRITES -- Type: bool -- Default: false +The initial nonce is generated from the operating systems crypto +strong random number generator. The nonce is incremented for each +chunk read making sure each nonce is unique for each block written. +The chance of a nonce being reused is minuscule. If you wrote an +exabyte of data (10¹⁸ bytes) you would have a probability of +approximately 2×10⁻³² of re-using a nonce. -#### --cache-tmp-upload-path +#### Chunk -Directory to keep temporary files until they are uploaded. +Each chunk will contain 64 KiB of data, except for the last one which +may have less data. The data chunk is in standard NaCl SecretBox +format. SecretBox uses XSalsa20 and Poly1305 to encrypt and +authenticate messages. -This is the path where cache will use as a temporary storage for new -files that need to be uploaded to the cloud provider. +Each chunk contains: -Specifying a value will enable this feature. Without it, it is -completely disabled and files will be uploaded directly to the cloud -provider + * 16 Bytes of Poly1305 authenticator + * 1 - 65536 bytes XSalsa20 encrypted data -Properties: +64k chunk size was chosen as the best performing chunk size (the +authenticator takes too much time below this and the performance drops +off due to cache effects above this). Note that these chunks are +buffered in memory so they can't be too big. -- Config: tmp_upload_path -- Env Var: RCLONE_CACHE_TMP_UPLOAD_PATH -- Type: string -- Required: false +This uses a 32 byte (256 bit key) key derived from the user password. -#### --cache-tmp-wait-time +#### Examples -How long should files be stored in local cache before being uploaded. +1 byte file will encrypt to -This is the duration that a file must wait in the temporary location -_cache-tmp-upload-path_ before it is selected for upload. + * 32 bytes header + * 17 bytes data chunk -Note that only one file is uploaded at a time and it can take longer -to start the upload if a queue formed for this purpose. +49 bytes total -Properties: +1 MiB (1048576 bytes) file will encrypt to -- Config: tmp_wait_time -- Env Var: RCLONE_CACHE_TMP_WAIT_TIME -- Type: Duration -- Default: 15s + * 32 bytes header + * 16 chunks of 65568 bytes -#### --cache-db-wait-time +1049120 bytes total (a 0.05% overhead). This is the overhead for big +files. -How long to wait for the DB to be available - 0 is unlimited. +### Name encryption -Only one process can have the DB open at any one time, so rclone waits -for this duration for the DB to become available before it gives an -error. +File names are encrypted segment by segment - the path is broken up +into `/` separated strings and these are encrypted individually. -If you set it to 0 then it will wait forever. +File segments are padded using PKCS#7 to a multiple of 16 bytes +before encryption. -Properties: +They are then encrypted with EME using AES with 256 bit key. EME +(ECB-Mix-ECB) is a wide-block encryption mode presented in the 2003 +paper "A Parallelizable Enciphering Mode" by Halevi and Rogaway. -- Config: db_wait_time -- Env Var: RCLONE_CACHE_DB_WAIT_TIME -- Type: Duration -- Default: 1s +This makes for deterministic encryption which is what we want - the +same filename must encrypt to the same thing otherwise we can't find +it on the cloud storage system. -## Backend commands +This means that -Here are the commands specific to the cache backend. + * filenames with the same name will encrypt the same + * filenames which start the same won't have a common prefix -Run them with +This uses a 32 byte key (256 bits) and a 16 byte (128 bits) IV both of +which are derived from the user password. - rclone backend COMMAND remote: +After encryption they are written out using a modified version of +standard `base32` encoding as described in RFC4648. The standard +encoding is modified in two ways: -The help below will explain what arguments each command takes. + * it becomes lower case (no-one likes upper case filenames!) + * we strip the padding character `=` -See the [backend](https://rclone.org/commands/rclone_backend/) command for more -info on how to pass options and arguments. +`base32` is used rather than the more efficient `base64` so rclone can be +used on case insensitive remotes (e.g. Windows, Amazon Drive). -These can be run on a running backend using the rc command -[backend/command](https://rclone.org/rc/#backend-command). +### Key derivation -### stats +Rclone uses `scrypt` with parameters `N=16384, r=8, p=1` with an +optional user supplied salt (password2) to derive the 32+32+16 = 80 +bytes of key material required. If the user doesn't supply a salt +then rclone uses an internal one. -Print stats on the cache backend in JSON format. +`scrypt` makes it impractical to mount a dictionary attack on rclone +encrypted data. For full protection against this you should always use +a salt. - rclone backend stats remote: [options] [+] +## SEE ALSO +* [rclone cryptdecode](https://rclone.org/commands/rclone_cryptdecode/) - Show forward/reverse mapping of encrypted filenames +# Compress -# Chunker +## Warning -The `chunker` overlay transparently splits large files into smaller chunks -during upload to wrapped remote and transparently assembles them back -when the file is downloaded. This allows to effectively overcome size limits -imposed by storage providers. +This remote is currently **experimental**. Things may break and data may be lost. Anything you do with this remote is +at your own risk. Please understand the risks associated with using experimental code and don't use this remote in +critical applications. + +The `Compress` remote adds compression to another remote. It is best used with remotes containing +many large compressible files. ## Configuration -To use it, first set up the underlying remote following the configuration -instructions for that remote. You can also use a local pathname instead of -a remote. +To use this remote, all you need to do is specify another remote and a compression mode to use: -First check your chosen remote is working - we'll call it `remote:path` here. -Note that anything inside `remote:path` will be chunked and anything outside -won't. This means that if you are using a bucket-based remote (e.g. S3, B2, swift) -then you should probably put the bucket in the remote `s3:bucket`. +``` +Current remotes: -Now configure `chunker` using `rclone config`. We will call this one `overlay` -to separate it from the `remote` itself. +Name Type +==== ==== +remote_to_press sometype -``` -No remotes found, make a new one? +e) Edit existing remote +$ rclone config n) New remote +d) Delete remote +r) Rename remote +c) Copy remote s) Set configuration password q) Quit config -n/s/q> n -name> overlay -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Transparently chunk/split large files - \ "chunker" -[snip] -Storage> chunker -Remote to chunk/unchunk. -Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", -"myremote:bucket" or maybe "myremote:" (not recommended). +e/n/d/r/c/s/q> n +name> compress +... + 8 / Compress a remote + \ "compress" +... +Storage> compress +** See help for compress backend at: https://rclone.org/compress/ ** + +Remote to compress. Enter a string value. Press Enter for the default (""). -remote> remote:path -Files larger than chunk size will be split in chunks. -Enter a size with suffix K,M,G,T. Press Enter for the default ("2G"). -chunk_size> 100M -Choose how chunker handles hash sums. All modes but "none" require metadata. -Enter a string value. Press Enter for the default ("md5"). +remote> remote_to_press:subdir +Compression mode. +Enter a string value. Press Enter for the default ("gzip"). Choose a number from below, or type in your own value - 1 / Pass any hash supported by wrapped remote for non-chunked files, return nothing otherwise - \ "none" - 2 / MD5 for composite files - \ "md5" - 3 / SHA1 for composite files - \ "sha1" - 4 / MD5 for all files - \ "md5all" - 5 / SHA1 for all files - \ "sha1all" - 6 / Copying a file to chunker will request MD5 from the source falling back to SHA1 if unsupported - \ "md5quick" - 7 / Similar to "md5quick" but prefers SHA1 over MD5 - \ "sha1quick" -hash_type> md5 + 1 / Gzip compression balanced for speed and compression strength. + \ "gzip" +compression_mode> gzip Edit advanced config? (y/n) y) Yes -n) No +n) No (default) y/n> n Remote config -------------------- -[overlay] -type = chunker -remote = remote:bucket -chunk_size = 100M -hash_type = md5 +[compress] +type = compress +remote = remote_to_press:subdir +compression_mode = gzip -------------------- -y) Yes this is OK +y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y ``` -### Specifying the remote - -In normal use, make sure the remote has a `:` in. If you specify the remote -without a `:` then rclone will use a local directory of that name. -So if you use a remote of `/path/to/secret/files` then rclone will -chunk stuff in that directory. If you use a remote of `name` then rclone -will put files in a directory called `name` in the current directory. - - -### Chunking - -When rclone starts a file upload, chunker checks the file size. If it -doesn't exceed the configured chunk size, chunker will just pass the file -to the wrapped remote (however, see caveat below). If a file is large, chunker will transparently cut -data in pieces with temporary names and stream them one by one, on the fly. -Each data chunk will contain the specified number of bytes, except for the -last one which may have less data. If file size is unknown in advance -(this is called a streaming upload), chunker will internally create -a temporary copy, record its size and repeat the above process. - -When upload completes, temporary chunk files are finally renamed. -This scheme guarantees that operations can be run in parallel and look -from outside as atomic. -A similar method with hidden temporary chunks is used for other operations -(copy/move/rename, etc.). If an operation fails, hidden chunks are normally -destroyed, and the target composite file stays intact. - -When a composite file download is requested, chunker transparently -assembles it by concatenating data chunks in order. As the split is trivial -one could even manually concatenate data chunks together to obtain the -original content. - -When the `list` rclone command scans a directory on wrapped remote, -the potential chunk files are accounted for, grouped and assembled into -composite directory entries. Any temporary chunks are hidden. - -List and other commands can sometimes come across composite files with -missing or invalid chunks, e.g. shadowed by like-named directory or -another file. This usually means that wrapped file system has been directly -tampered with or damaged. If chunker detects a missing chunk it will -by default print warning, skip the whole incomplete group of chunks but -proceed with current command. -You can set the `--chunker-fail-hard` flag to have commands abort with -error message in such cases. - -**Caveat**: As it is now, chunker will always create a temporary file in the -backend and then rename it, even if the file is below the chunk threshold. -This will result in unnecessary API calls and can severely restrict throughput -when handling transfers primarily composed of small files on some backends (e.g. Box). -A workaround to this issue is to use chunker only for files above the chunk threshold -via `--min-size` and then perform a separate call without chunker on the remaining -files. - - -#### Chunk names - -The default chunk name format is `*.rclone_chunk.###`, hence by default -chunk names are `BIG_FILE_NAME.rclone_chunk.001`, -`BIG_FILE_NAME.rclone_chunk.002` etc. You can configure another name format -using the `name_format` configuration file option. The format uses asterisk -`*` as a placeholder for the base file name and one or more consecutive -hash characters `#` as a placeholder for sequential chunk number. -There must be one and only one asterisk. The number of consecutive hash -characters defines the minimum length of a string representing a chunk number. -If decimal chunk number has less digits than the number of hashes, it is -left-padded by zeros. If the decimal string is longer, it is left intact. -By default numbering starts from 1 but there is another option that allows -user to start from 0, e.g. for compatibility with legacy software. +### Compression Modes -For example, if name format is `big_*-##.part` and original file name is -`data.txt` and numbering starts from 0, then the first chunk will be named -`big_data.txt-00.part`, the 99th chunk will be `big_data.txt-98.part` -and the 302nd chunk will become `big_data.txt-301.part`. +Currently only gzip compression is supported. It provides a decent balance between speed and size and is well +supported by other applications. Compression strength can further be configured via an advanced setting where 0 is no +compression and 9 is strongest compression. -Note that `list` assembles composite directory entries only when chunk names -match the configured format and treats non-conforming file names as normal -non-chunked files. +### File types -When using `norename` transactions, chunk names will additionally have a unique -file version suffix. For example, `BIG_FILE_NAME.rclone_chunk.001_bp562k`. +If you open a remote wrapped by compress, you will see that there are many files with an extension corresponding to +the compression algorithm you chose. These files are standard files that can be opened by various archive programs, +but they have some hidden metadata that allows them to be used by rclone. +While you may download and decompress these files at will, do **not** manually delete or rename files. Files without +correct metadata files will not be recognized by rclone. +### File names -### Metadata +The compressed files will be named `*.###########.gz` where `*` is the base file and the `#` part is base64 encoded +size of the uncompressed file. The file names should not be changed by anything other than the rclone compression backend. -Besides data chunks chunker will by default create metadata object for -a composite file. The object is named after the original file. -Chunker allows user to disable metadata completely (the `none` format). -Note that metadata is normally not created for files smaller than the -configured chunk size. This may change in future rclone releases. -#### Simple JSON metadata format +### Standard options -This is the default format. It supports hash sums and chunk validation -for composite files. Meta objects carry the following fields: +Here are the Standard options specific to compress (Compress a remote). -- `ver` - version of format, currently `1` -- `size` - total size of composite file -- `nchunks` - number of data chunks in file -- `md5` - MD5 hashsum of composite file (if present) -- `sha1` - SHA1 hashsum (if present) -- `txn` - identifies current version of the file +#### --compress-remote -There is no field for composite file name as it's simply equal to the name -of meta object on the wrapped remote. Please refer to respective sections -for details on hashsums and modified time handling. +Remote to compress. -#### No metadata +Properties: -You can disable meta objects by setting the meta format option to `none`. -In this mode chunker will scan directory for all files that follow -configured chunk name format, group them by detecting chunks with the same -base name and show group names as virtual composite files. -This method is more prone to missing chunk errors (especially missing -last chunk) than format with metadata enabled. +- Config: remote +- Env Var: RCLONE_COMPRESS_REMOTE +- Type: string +- Required: true +#### --compress-mode -### Hashsums +Compression mode. -Chunker supports hashsums only when a compatible metadata is present. -Hence, if you choose metadata format of `none`, chunker will report hashsum -as `UNSUPPORTED`. +Properties: -Please note that by default metadata is stored only for composite files. -If a file is smaller than configured chunk size, chunker will transparently -redirect hash requests to wrapped remote, so support depends on that. -You will see the empty string as a hashsum of requested type for small -files if the wrapped remote doesn't support it. +- Config: mode +- Env Var: RCLONE_COMPRESS_MODE +- Type: string +- Default: "gzip" +- Examples: + - "gzip" + - Standard gzip compression with fastest parameters. -Many storage backends support MD5 and SHA1 hash types, so does chunker. -With chunker you can choose one or another but not both. -MD5 is set by default as the most supported type. -Since chunker keeps hashes for composite files and falls back to the -wrapped remote hash for non-chunked ones, we advise you to choose the same -hash type as supported by wrapped remote so that your file listings -look coherent. +### Advanced options -If your storage backend does not support MD5 or SHA1 but you need consistent -file hashing, configure chunker with `md5all` or `sha1all`. These two modes -guarantee given hash for all files. If wrapped remote doesn't support it, -chunker will then add metadata to all files, even small. However, this can -double the amount of small files in storage and incur additional service charges. -You can even use chunker to force md5/sha1 support in any other remote -at expense of sidecar meta objects by setting e.g. `hash_type=sha1all` -to force hashsums and `chunk_size=1P` to effectively disable chunking. +Here are the Advanced options specific to compress (Compress a remote). -Normally, when a file is copied to chunker controlled remote, chunker -will ask the file source for compatible file hash and revert to on-the-fly -calculation if none is found. This involves some CPU overhead but provides -a guarantee that given hashsum is available. Also, chunker will reject -a server-side copy or move operation if source and destination hashsum -types are different resulting in the extra network bandwidth, too. -In some rare cases this may be undesired, so chunker provides two optional -choices: `sha1quick` and `md5quick`. If the source does not support primary -hash type and the quick mode is enabled, chunker will try to fall back to -the secondary type. This will save CPU and bandwidth but can result in empty -hashsums at destination. Beware of consequences: the `sync` command will -revert (sometimes silently) to time/size comparison if compatible hashsums -between source and target are not found. +#### --compress-level +GZIP compression level (-2 to 9). -### Modified time +Generally -1 (default, equivalent to 5) is recommended. +Levels 1 to 9 increase compression at the cost of speed. Going past 6 +generally offers very little return. -Chunker stores modification times using the wrapped remote so support -depends on that. For a small non-chunked file the chunker overlay simply -manipulates modification time of the wrapped remote file. -For a composite file with metadata chunker will get and set -modification time of the metadata object on the wrapped remote. -If file is chunked but metadata format is `none` then chunker will -use modification time of the first data chunk. +Level -2 uses Huffman encoding only. Only use if you know what you +are doing. +Level 0 turns off compression. +Properties: -### Migrations +- Config: level +- Env Var: RCLONE_COMPRESS_LEVEL +- Type: int +- Default: -1 -The idiomatic way to migrate to a different chunk size, hash type, transaction -style or chunk naming scheme is to: +#### --compress-ram-cache-limit -- Collect all your chunked files under a directory and have your - chunker remote point to it. -- Create another directory (most probably on the same cloud storage) - and configure a new remote with desired metadata format, - hash type, chunk naming etc. -- Now run `rclone sync --interactive oldchunks: newchunks:` and all your data - will be transparently converted in transfer. - This may take some time, yet chunker will try server-side - copy if possible. -- After checking data integrity you may remove configuration section - of the old remote. +Some remotes don't allow the upload of files with unknown size. +In this case the compressed file will need to be cached to determine +it's size. -If rclone gets killed during a long operation on a big composite file, -hidden temporary chunks may stay in the directory. They will not be -shown by the `list` command but will eat up your account quota. -Please note that the `deletefile` command deletes only active -chunks of a file. As a workaround, you can use remote of the wrapped -file system to see them. -An easy way to get rid of hidden garbage is to copy littered directory -somewhere using the chunker remote and purge the original directory. -The `copy` command will copy only active chunks while the `purge` will -remove everything including garbage. +Files smaller than this limit will be cached in RAM, files larger than +this limit will be cached on disk. +Properties: -### Caveats and Limitations +- Config: ram_cache_limit +- Env Var: RCLONE_COMPRESS_RAM_CACHE_LIMIT +- Type: SizeSuffix +- Default: 20Mi -Chunker requires wrapped remote to support server-side `move` (or `copy` + -`delete`) operations, otherwise it will explicitly refuse to start. -This is because it internally renames temporary chunk files to their final -names when an operation completes successfully. +### Metadata -Chunker encodes chunk number in file name, so with default `name_format` -setting it adds 17 characters. Also chunker adds 7 characters of temporary -suffix during operations. Many file systems limit base file name without path -by 255 characters. Using rclone's crypt remote as a base file system limits -file name by 143 characters. Thus, maximum name length is 231 for most files -and 119 for chunker-over-crypt. A user in need can change name format to -e.g. `*.rcc##` and save 10 characters (provided at most 99 chunks per file). +Any metadata supported by the underlying remote is read and written. -Note that a move implemented using the copy-and-delete method may incur -double charging with some cloud storage providers. +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -Chunker will not automatically rename existing chunks when you run -`rclone config` on a live remote and change the chunk name format. -Beware that in result of this some files which have been treated as chunks -before the change can pop up in directory listings as normal files -and vice versa. The same warning holds for the chunk size. -If you desperately need to change critical chunking settings, you should -run data migration as described above. -If wrapped remote is case insensitive, the chunker overlay will inherit -that property (so you can't have a file called "Hello.doc" and "hello.doc" -in the same directory). -Chunker included in rclone releases up to `v1.54` can sometimes fail to -detect metadata produced by recent versions of rclone. We recommend users -to keep rclone up-to-date to avoid data corruption. +# Combine -Changing `transactions` is dangerous and requires explicit migration. +The `combine` backend joins remotes together into a single directory +tree. +For example you might have a remote for images on one provider: -### Standard options +``` +$ rclone tree s3:imagesbucket +/ +├── image1.jpg +└── image2.jpg +``` -Here are the Standard options specific to chunker (Transparently chunk/split large files). +And a remote for files on another: -#### --chunker-remote +``` +$ rclone tree drive:important/files +/ +├── file1.txt +└── file2.txt +``` -Remote to chunk/unchunk. +The `combine` backend can join these together into a synthetic +directory structure like this: -Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", -"myremote:bucket" or maybe "myremote:" (not recommended). +``` +$ rclone tree combined: +/ +├── files +│ ├── file1.txt +│ └── file2.txt +└── images + ├── image1.jpg + └── image2.jpg +``` -Properties: +You'd do this by specifying an `upstreams` parameter in the config +like this -- Config: remote -- Env Var: RCLONE_CHUNKER_REMOTE -- Type: string -- Required: true + upstreams = images=s3:imagesbucket files=drive:important/files -#### --chunker-chunk-size +During the initial setup with `rclone config` you will specify the +upstreams remotes as a space separated list. The upstream remotes can +either be a local paths or other remotes. -Files larger than chunk size will be split in chunks. +## Configuration -Properties: +Here is an example of how to make a combine called `remote` for the +example above. First run: -- Config: chunk_size -- Env Var: RCLONE_CHUNKER_CHUNK_SIZE -- Type: SizeSuffix -- Default: 2Gi + rclone config -#### --chunker-hash-type +This will guide you through an interactive setup process: -Choose how chunker handles hash sums. +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +... +XX / Combine several remotes into one + \ (combine) +... +Storage> combine +Option upstreams. +Upstreams for combining +These should be in the form + dir=remote:path dir2=remote2:path +Where before the = is specified the root directory and after is the remote to +put there. +Embedded spaces can be added using quotes + "dir=remote:path with space" "dir2=remote2:path with space" +Enter a fs.SpaceSepList value. +upstreams> images=s3:imagesbucket files=drive:important/files +-------------------- +[remote] +type = combine +upstreams = images=s3:imagesbucket files=drive:important/files +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -All modes but "none" require metadata. +### Configuring for Google Drive Shared Drives -Properties: +Rclone has a convenience feature for making a combine backend for all +the shared drives you have access to. -- Config: hash_type -- Env Var: RCLONE_CHUNKER_HASH_TYPE -- Type: string -- Default: "md5" -- Examples: - - "none" - - Pass any hash supported by wrapped remote for non-chunked files. - - Return nothing otherwise. - - "md5" - - MD5 for composite files. - - "sha1" - - SHA1 for composite files. - - "md5all" - - MD5 for all files. - - "sha1all" - - SHA1 for all files. - - "md5quick" - - Copying a file to chunker will request MD5 from the source. - - Falling back to SHA1 if unsupported. - - "sha1quick" - - Similar to "md5quick" but prefers SHA1 over MD5. +Assuming your main (non shared drive) Google drive remote is called +`drive:` you would run -### Advanced options + rclone backend -o config drives drive: -Here are the Advanced options specific to chunker (Transparently chunk/split large files). +This would produce something like this: -#### --chunker-name-format + [My Drive] + type = alias + remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=: -String format of chunk file names. + [Test Drive] + type = alias + remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=: -The two placeholders are: base file name (*) and chunk number (#...). -There must be one and only one asterisk and one or more consecutive hash characters. -If chunk number has less digits than the number of hashes, it is left-padded by zeros. -If there are more digits in the number, they are left as is. -Possible chunk files are ignored if their name does not match given format. + [AllDrives] + type = combine + upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:" -Properties: +If you then add that config to your config file (find it with `rclone +config file`) then you can access all the shared drives in one place +with the `AllDrives:` remote. -- Config: name_format -- Env Var: RCLONE_CHUNKER_NAME_FORMAT -- Type: string -- Default: "*.rclone_chunk.###" +See [the Google Drive docs](https://rclone.org/drive/#drives) for full info. -#### --chunker-start-from -Minimum valid chunk number. Usually 0 or 1. +### Standard options -By default chunk numbers start from 1. +Here are the Standard options specific to combine (Combine several remotes into one). -Properties: +#### --combine-upstreams -- Config: start_from -- Env Var: RCLONE_CHUNKER_START_FROM -- Type: int -- Default: 1 +Upstreams for combining -#### --chunker-meta-format +These should be in the form -Format of the metadata object or "none". + dir=remote:path dir2=remote2:path -By default "simplejson". -Metadata is a small JSON file named after the composite file. +Where before the = is specified the root directory and after is the remote to +put there. -Properties: +Embedded spaces can be added using quotes -- Config: meta_format -- Env Var: RCLONE_CHUNKER_META_FORMAT -- Type: string -- Default: "simplejson" -- Examples: - - "none" - - Do not use metadata files at all. - - Requires hash type "none". - - "simplejson" - - Simple JSON supports hash sums and chunk validation. - - - - It has the following fields: ver, size, nchunks, md5, sha1. + "dir=remote:path with space" "dir2=remote2:path with space" -#### --chunker-fail-hard -Choose how chunker should handle files with missing or invalid chunks. Properties: -- Config: fail_hard -- Env Var: RCLONE_CHUNKER_FAIL_HARD -- Type: bool -- Default: false -- Examples: - - "true" - - Report errors and abort current command. - - "false" - - Warn user, skip incomplete file and proceed. +- Config: upstreams +- Env Var: RCLONE_COMBINE_UPSTREAMS +- Type: SpaceSepList +- Default: -#### --chunker-transactions +### Metadata -Choose how chunker should handle temporary files during transactions. +Any metadata supported by the underlying remote is read and written. -Properties: +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -- Config: transactions -- Env Var: RCLONE_CHUNKER_TRANSACTIONS -- Type: string -- Default: "rename" -- Examples: - - "rename" - - Rename temporary files after a successful transaction. - - "norename" - - Leave temporary file names and write transaction ID to metadata file. - - Metadata is required for no rename transactions (meta format cannot be "none"). - - If you are using norename transactions you should be careful not to downgrade Rclone - - as older versions of Rclone don't support this transaction style and will misinterpret - - files manipulated by norename transactions. - - This method is EXPERIMENTAL, don't use on production systems. - - "auto" - - Rename or norename will be used depending on capabilities of the backend. - - If meta format is set to "none", rename transactions will always be used. - - This method is EXPERIMENTAL, don't use on production systems. +# Dropbox -# Citrix ShareFile +Paths are specified as `remote:path` -[Citrix ShareFile](https://sharefile.com) is a secure file sharing and transfer service aimed as business. +Dropbox paths may be as deep as required, e.g. +`remote:directory/subdirectory`. ## Configuration -The initial setup for Citrix ShareFile involves getting a token from -Citrix ShareFile which you can in your browser. `rclone config` walks you +The initial setup for dropbox involves getting a token from Dropbox +which you need to do in your browser. `rclone config` walks you through it. Here is an example of how to make a remote called `remote`. First run: @@ -28821,58 +30572,31 @@ Here is an example of how to make a remote called `remote`. First run: This will guide you through an interactive setup process: ``` -No remotes found, make a new one? n) New remote -s) Set configuration password +d) Delete remote q) Quit config -n/s/q> n +e/n/d/q> n name> remote Type of storage to configure. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value -XX / Citrix Sharefile - \ "sharefile" -Storage> sharefile -** See help for sharefile backend at: https://rclone.org/sharefile/ ** - -ID of the root folder - -Leave blank to access "Personal Folders". You can use one of the -standard values here or any folder ID (long hex number ID). -Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value - 1 / Access the Personal Folders. (Default) - \ "" - 2 / Access the Favorites folder. - \ "favorites" - 3 / Access all the shared folders. - \ "allshared" - 4 / Access all the individual connectors. - \ "connectors" - 5 / Access the home, favorites, and shared folders as well as the connectors. - \ "top" -root_folder_id> -Edit advanced config? (y/n) -y) Yes -n) No -y/n> n +[snip] +XX / Dropbox + \ "dropbox" +[snip] +Storage> dropbox +Dropbox App Key - leave blank normally. +app_key> +Dropbox App Secret - leave blank normally. +app_secret> Remote config -Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. -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?state=XXX -Log in and authorize rclone for access -Waiting for code... -Got code +Please visit: +https://www.dropbox.com/1/oauth2/authorize?client_id=XXXXXXXXXXXXXXX&response_type=code +Enter the code: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXXXXXXXX -------------------- [remote] -type = sharefile -endpoint = https://XXX.sharefile.com -token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2019-09-30T19:41:45.878561877+01:00"} +app_key = +app_secret = +token = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXX -------------------- y) Yes this is OK e) Edit this remote @@ -28880,81 +30604,146 @@ d) Delete this remote y/e/d> y ``` -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a -machine with no Internet browser available. +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a +machine with no Internet browser available. + +Note that rclone runs a webserver on your local machine to collect the +token as returned from Dropbox. This only +runs from the moment it opens your browser to the moment you get back +the verification code. This is on `http://127.0.0.1:53682/` and it +may require you to unblock it temporarily if you are running a host +firewall, or use manual mode. + +You can then use it like this, + +List directories in top level of your dropbox + + rclone lsd remote: + +List all the files in your dropbox + + rclone ls remote: + +To copy a local directory to a dropbox directory called backup + + rclone copy /home/source remote:backup + +### Dropbox for business + +Rclone supports Dropbox for business and Team Folders. + +When using Dropbox for business `remote:` and `remote:path/to/file` +will refer to your personal folder. + +If you wish to see Team Folders you must use a leading `/` in the +path, so `rclone lsd remote:/` will refer to the root and show you all +Team Folders and your User Folder. + +You can then use team folders like this `remote:/TeamFolder` and +`remote:/TeamFolder/path/to/file`. + +A leading `/` for a Dropbox personal account will do nothing, but it +will take an extra HTTP transaction so it should be avoided. + +### Modification times and hashes + +Dropbox supports modified times, but the only way to set a +modification time is to re-upload the file. + +This means that if you uploaded your data with an older version of +rclone which didn't support the v2 API and modified times, rclone will +decide to upload all your old data to fix the modification times. If +you don't want this to happen use `--size-only` or `--checksum` flag +to stop it. + +Dropbox supports [its own hash +type](https://www.dropbox.com/developers/reference/content-hash) which +is checked for all transfers. + +### Restricted filename characters + +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| NUL | 0x00 | ␀ | +| / | 0x2F | / | +| DEL | 0x7F | ␡ | +| \ | 0x5C | \ | + +File names can also not end with the following characters. +These only get replaced if they are the last character in the name: + +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| SP | 0x20 | ␠ | + +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. -Note that rclone runs a webserver on your local machine to collect the -token as returned from Citrix ShareFile. This only runs from the moment it opens -your browser to the moment you get back the verification code. This -is on `http://127.0.0.1:53682/` and this it may require you to unblock -it temporarily if you are running a host firewall. +### Batch mode uploads {#batch-mode} -Once configured you can then use `rclone` like this, +Using batch mode uploads is very important for performance when using +the Dropbox API. See [the dropbox performance guide](https://developers.dropbox.com/dbx-performance-guide) +for more info. -List directories in top level of your ShareFile +There are 3 modes rclone can use for uploads. - rclone lsd remote: +#### --dropbox-batch-mode off -List all the files in your ShareFile +In this mode rclone will not use upload batching. This was the default +before rclone v1.55. It has the disadvantage that it is very likely to +encounter `too_many_requests` errors like this - rclone ls remote: + NOTICE: too_many_requests/.: Too many requests or write operations. Trying again in 15 seconds. -To copy a local directory to an ShareFile directory called backup +When rclone receives these it has to wait for 15s or sometimes 300s +before continuing which really slows down transfers. - rclone copy /home/source remote:backup +This will happen especially if `--transfers` is large, so this mode +isn't recommended except for compatibility or investigating problems. -Paths may be as deep as required, e.g. `remote:directory/subdirectory`. +#### --dropbox-batch-mode sync -### Modified time and hashes +In this mode rclone will batch up uploads to the size specified by +`--dropbox-batch-size` and commit them together. -ShareFile allows modification times to be set on objects accurate to 1 -second. These will be used to detect whether objects need syncing or -not. +Using this mode means you can use a much higher `--transfers` +parameter (32 or 64 works fine) without receiving `too_many_requests` +errors. -ShareFile supports MD5 type hashes, so you can use the `--checksum` -flag. +This mode ensures full data integrity. -### Transfers +Note that there may be a pause when quitting rclone while rclone +finishes up the last batch using this mode. -For files above 128 MiB rclone will use a chunked transfer. Rclone will -upload up to `--transfers` chunks at the same time (shared among all -the multipart uploads). Chunks are buffered in memory and are -normally 64 MiB so increasing `--transfers` will increase memory use. +#### --dropbox-batch-mode async -### Restricted filename characters +In this mode rclone will batch up uploads to the size specified by +`--dropbox-batch-size` and commit them together. -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) -the following characters are also replaced: +However it will not wait for the status of the batch to be returned to +the caller. This means rclone can use a much bigger batch size (much +bigger than `--transfers`), at the cost of not being able to check the +status of the upload. -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| \\ | 0x5C | \ | -| * | 0x2A | * | -| < | 0x3C | < | -| > | 0x3E | > | -| ? | 0x3F | ? | -| : | 0x3A | : | -| \| | 0x7C | | | -| " | 0x22 | " | +This provides the maximum possible upload speed especially with lots +of small files, however rclone can't check the file got uploaded +properly using this mode. -File names can also not start or end with the following characters. -These only get replaced if they are the first or last character in the -name: +If you are using this mode then using "rclone check" after the +transfer completes is recommended. Or you could do an initial transfer +with `--dropbox-batch-mode async` then do a final transfer with +`--dropbox-batch-mode sync` (the default). -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| SP | 0x20 | ␠ | -| . | 0x2E | . | +Note that there may be a pause when quitting rclone while rclone +finishes up the last batch using this mode. -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in JSON strings. ### Standard options -Here are the Standard options specific to sharefile (Citrix Sharefile). +Here are the Standard options specific to dropbox (Dropbox). -#### --sharefile-client-id +#### --dropbox-client-id OAuth Client Id. @@ -28963,11 +30752,11 @@ Leave blank normally. Properties: - Config: client_id -- Env Var: RCLONE_SHAREFILE_CLIENT_ID +- Env Var: RCLONE_DROPBOX_CLIENT_ID - Type: string - Required: false -#### --sharefile-client-secret +#### --dropbox-client-secret OAuth Client Secret. @@ -28976,51 +30765,26 @@ Leave blank normally. Properties: - Config: client_secret -- Env Var: RCLONE_SHAREFILE_CLIENT_SECRET -- Type: string -- Required: false - -#### --sharefile-root-folder-id - -ID of the root folder. - -Leave blank to access "Personal Folders". You can use one of the -standard values here or any folder ID (long hex number ID). - -Properties: - -- Config: root_folder_id -- Env Var: RCLONE_SHAREFILE_ROOT_FOLDER_ID +- Env Var: RCLONE_DROPBOX_CLIENT_SECRET - Type: string - Required: false -- Examples: - - "" - - Access the Personal Folders (default). - - "favorites" - - Access the Favorites folder. - - "allshared" - - Access all the shared folders. - - "connectors" - - Access all the individual connectors. - - "top" - - Access the home, favorites, and shared folders as well as the connectors. ### Advanced options -Here are the Advanced options specific to sharefile (Citrix Sharefile). +Here are the Advanced options specific to dropbox (Dropbox). -#### --sharefile-token +#### --dropbox-token OAuth Access Token as a JSON blob. Properties: - Config: token -- Env Var: RCLONE_SHAREFILE_TOKEN +- Env Var: RCLONE_DROPBOX_TOKEN - Type: string - Required: false -#### --sharefile-auth-url +#### --dropbox-auth-url Auth server URL. @@ -29029,11 +30793,11 @@ Leave blank to use the provider defaults. Properties: - Config: auth_url -- Env Var: RCLONE_SHAREFILE_AUTH_URL +- Env Var: RCLONE_DROPBOX_AUTH_URL - Type: string - Required: false -#### --sharefile-token-url +#### --dropbox-token-url Token server url. @@ -29042,1958 +30806,1711 @@ Leave blank to use the provider defaults. Properties: - Config: token_url -- Env Var: RCLONE_SHAREFILE_TOKEN_URL +- Env Var: RCLONE_DROPBOX_TOKEN_URL - Type: string - Required: false -#### --sharefile-upload-cutoff - -Cutoff for switching to multipart upload. - -Properties: - -- Config: upload_cutoff -- Env Var: RCLONE_SHAREFILE_UPLOAD_CUTOFF -- Type: SizeSuffix -- Default: 128Mi - -#### --sharefile-chunk-size - -Upload chunk size. +#### --dropbox-chunk-size -Must a power of 2 >= 256k. +Upload chunk size (< 150Mi). -Making this larger will improve performance, but note that each chunk -is buffered in memory one per transfer. +Any files larger than this will be uploaded in chunks of this size. -Reducing this will reduce memory usage but decrease performance. +Note that chunks are buffered in memory (one at a time) so rclone can +deal with retries. Setting this larger will increase the speed +slightly (at most 10% for 128 MiB in tests) at the cost of using more +memory. It can be set smaller if you are tight on memory. Properties: - Config: chunk_size -- Env Var: RCLONE_SHAREFILE_CHUNK_SIZE +- Env Var: RCLONE_DROPBOX_CHUNK_SIZE - Type: SizeSuffix -- Default: 64Mi - -#### --sharefile-endpoint - -Endpoint for API calls. - -This is usually auto discovered as part of the oauth process, but can -be set manually to something like: https://XXX.sharefile.com - - -Properties: - -- Config: endpoint -- Env Var: RCLONE_SHAREFILE_ENDPOINT -- Type: string -- Required: false - -#### --sharefile-encoding - -The encoding for the backend. - -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. - -Properties: - -- Config: encoding -- Env Var: RCLONE_SHAREFILE_ENCODING -- Type: MultiEncoder -- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot - - -## Limitations - -Note that ShareFile is case insensitive so you can't have a file called -"Hello.doc" and one called "hello.doc". - -ShareFile only supports filenames up to 256 characters in length. - -`rclone about` is not supported by the Citrix ShareFile backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. - -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) - -# Crypt - -Rclone `crypt` remotes encrypt and decrypt other remotes. - -A remote of type `crypt` does not access a [storage system](https://rclone.org/overview/) -directly, but instead wraps another remote, which in turn accesses -the storage system. This is similar to how [alias](https://rclone.org/alias/), -[union](https://rclone.org/union/), [chunker](https://rclone.org/chunker/) -and a few others work. It makes the usage very flexible, as you can -add a layer, in this case an encryption layer, on top of any other -backend, even in multiple layers. Rclone's functionality -can be used as with any other remote, for example you can -[mount](https://rclone.org/commands/rclone_mount/) a crypt remote. - -Accessing a storage system through a crypt remote realizes client-side -encryption, which makes it safe to keep your data in a location you do -not trust will not get compromised. -When working against the `crypt` remote, rclone will automatically -encrypt (before uploading) and decrypt (after downloading) on your local -system as needed on the fly, leaving the data encrypted at rest in the -wrapped remote. If you access the storage system using an application -other than rclone, or access the wrapped remote directly using rclone, -there will not be any encryption/decryption: Downloading existing content -will just give you the encrypted (scrambled) format, and anything you -upload will *not* become encrypted. - -The encryption is a secret-key encryption (also called symmetric key encryption) -algorithm, where a password (or pass phrase) is used to generate real encryption key. -The password can be supplied by user, or you may chose to let rclone -generate one. It will be stored in the configuration file, in a lightly obscured form. -If you are in an environment where you are not able to keep your configuration -secured, you should add -[configuration encryption](https://rclone.org/docs/#configuration-encryption) -as protection. As long as you have this configuration file, you will be able to -decrypt your data. Without the configuration file, as long as you remember -the password (or keep it in a safe place), you can re-create the configuration -and gain access to the existing data. You may also configure a corresponding -remote in a different installation to access the same data. -See below for guidance to [changing password](#changing-password). - -Encryption uses [cryptographic salt](https://en.wikipedia.org/wiki/Salt_(cryptography)), -to permute the encryption key so that the same string may be encrypted in -different ways. When configuring the crypt remote it is optional to enter a salt, -or to let rclone generate a unique salt. If omitted, rclone uses a built-in unique string. -Normally in cryptography, the salt is stored together with the encrypted content, -and do not have to be memorized by the user. This is not the case in rclone, -because rclone does not store any additional information on the remotes. Use of -custom salt is effectively a second password that must be memorized. - -[File content](#file-encryption) encryption is performed using -[NaCl SecretBox](https://godoc.org/golang.org/x/crypto/nacl/secretbox), -based on XSalsa20 cipher and Poly1305 for integrity. -[Names](#name-encryption) (file- and directory names) are also encrypted -by default, but this has some implications and is therefore -possible to be turned off. - -## Configuration - -Here is an example of how to make a remote called `secret`. - -To use `crypt`, first set up the underlying remote. Follow the -`rclone config` instructions for the specific backend. - -Before configuring the crypt remote, check the underlying remote is -working. In this example the underlying remote is called `remote`. -We will configure a path `path` within this remote to contain the -encrypted content. Anything inside `remote:path` will be encrypted -and anything outside will not. - -Configure `crypt` using `rclone config`. In this example the `crypt` -remote is called `secret`, to differentiate it from the underlying -`remote`. - -When you are done you can use the crypt remote named `secret` just -as you would with any other remote, e.g. `rclone copy D:\docs secret:\docs`, -and rclone will encrypt and decrypt as needed on the fly. -If you access the wrapped remote `remote:path` directly you will bypass -the encryption, and anything you read will be in encrypted form, and -anything you write will be unencrypted. To avoid issues it is best to -configure a dedicated path for encrypted content, and access it -exclusively through a crypt remote. - -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> secret -Type of storage to configure. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value -[snip] -XX / Encrypt/Decrypt a remote - \ "crypt" -[snip] -Storage> crypt -** See help for crypt backend at: https://rclone.org/crypt/ ** - -Remote to encrypt/decrypt. -Normally should contain a ':' and a path, eg "myremote:path/to/dir", -"myremote:bucket" or maybe "myremote:" (not recommended). -Enter a string value. Press Enter for the default (""). -remote> remote:path -How to encrypt the filenames. -Enter a string value. Press Enter for the default ("standard"). -Choose a number from below, or type in your own value. - / Encrypt the filenames. - 1 | See the docs for the details. - \ "standard" - 2 / Very simple filename obfuscation. - \ "obfuscate" - / Don't encrypt the file names. - 3 | Adds a ".bin" extension only. - \ "off" -filename_encryption> -Option to either encrypt directory names or leave them intact. - -NB If filename_encryption is "off" then this option will do nothing. -Enter a boolean value (true or false). Press Enter for the default ("true"). -Choose a number from below, or type in your own value - 1 / Encrypt directory names. - \ "true" - 2 / Don't encrypt directory names, leave them intact. - \ "false" -directory_name_encryption> -Password or pass phrase for encryption. -y) Yes type in my own password -g) Generate random password -y/g> y -Enter the password: -password: -Confirm the password: -password: -Password or pass phrase for salt. Optional but recommended. -Should be different to the previous password. -y) Yes type in my own password -g) Generate random password -n) No leave this optional password blank (default) -y/g/n> g -Password strength in bits. -64 is just about memorable -128 is secure -1024 is the maximum -Bits> 128 -Your password is: JAsJvRcgR-_veXNfy_sGmQ -Use this password? Please note that an obscured version of this -password (and not the password itself) will be stored under your -configuration file, so keep this generated password in a safe place. -y) Yes (default) -n) No -y/n> -Edit advanced config? (y/n) -y) Yes -n) No (default) -y/n> -Remote config --------------------- -[secret] -type = crypt -remote = remote:path -password = *** ENCRYPTED *** -password2 = *** ENCRYPTED *** --------------------- -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> -``` - -**Important** The crypt password stored in `rclone.conf` is lightly -obscured. That only protects it from cursory inspection. It is not -secure unless [configuration encryption](https://rclone.org/docs/#configuration-encryption) of `rclone.conf` is specified. - -A long passphrase is recommended, or `rclone config` can generate a -random one. - -The obscured password is created using AES-CTR with a static key. The -salt is stored verbatim at the beginning of the obscured password. This -static key is shared between all versions of rclone. - -If you reconfigure rclone with the same passwords/passphrases -elsewhere it will be compatible, but the obscured version will be different -due to the different salt. - -Rclone does not encrypt - - * file length - this can be calculated within 16 bytes - * modification time - used for syncing - -### Specifying the remote - -When configuring the remote to encrypt/decrypt, you may specify any -string that rclone accepts as a source/destination of other commands. - -The primary use case is to specify the path into an already configured -remote (e.g. `remote:path/to/dir` or `remote:bucket`), such that -data in a remote untrusted location can be stored encrypted. - -You may also specify a local filesystem path, such as -`/path/to/dir` on Linux, `C:\path\to\dir` on Windows. By creating -a crypt remote pointing to such a local filesystem path, you can -use rclone as a utility for pure local file encryption, for example -to keep encrypted files on a removable USB drive. - -**Note**: A string which do not contain a `:` will by rclone be treated -as a relative path in the local filesystem. For example, if you enter -the name `remote` without the trailing `:`, it will be treated as -a subdirectory of the current directory with name "remote". - -If a path `remote:path/to/dir` is specified, rclone stores encrypted -files in `path/to/dir` on the remote. With file name encryption, files -saved to `secret:subdir/subfile` are stored in the unencrypted path -`path/to/dir` but the `subdir/subpath` element is encrypted. - -The path you specify does not have to exist, rclone will create -it when needed. - -If you intend to use the wrapped remote both directly for keeping -unencrypted content, as well as through a crypt remote for encrypted -content, it is recommended to point the crypt remote to a separate -directory within the wrapped remote. If you use a bucket-based storage -system (e.g. Swift, S3, Google Compute Storage, B2) it is generally -advisable to wrap the crypt remote around a specific bucket (`s3:bucket`). -If wrapping around the entire root of the storage (`s3:`), and use the -optional file name encryption, rclone will encrypt the bucket name. - -### Changing password - -Should the password, or the configuration file containing a lightly obscured -form of the password, be compromised, you need to re-encrypt your data with -a new password. Since rclone uses secret-key encryption, where the encryption -key is generated directly from the password kept on the client, it is not -possible to change the password/key of already encrypted content. Just changing -the password configured for an existing crypt remote means you will no longer -able to decrypt any of the previously encrypted content. The only possibility -is to re-upload everything via a crypt remote configured with your new password. - -Depending on the size of your data, your bandwidth, storage quota etc, there are -different approaches you can take: -- If you have everything in a different location, for example on your local system, -you could remove all of the prior encrypted files, change the password for your -configured crypt remote (or delete and re-create the crypt configuration), -and then re-upload everything from the alternative location. -- If you have enough space on the storage system you can create a new crypt -remote pointing to a separate directory on the same backend, and then use -rclone to copy everything from the original crypt remote to the new, -effectively decrypting everything on the fly using the old password and -re-encrypting using the new password. When done, delete the original crypt -remote directory and finally the rclone crypt configuration with the old password. -All data will be streamed from the storage system and back, so you will -get half the bandwidth and be charged twice if you have upload and download quota -on the storage system. - -**Note**: A security problem related to the random password generator -was fixed in rclone version 1.53.3 (released 2020-11-19). Passwords generated -by rclone config in version 1.49.0 (released 2019-08-26) to 1.53.2 -(released 2020-10-26) are not considered secure and should be changed. -If you made up your own password, or used rclone version older than 1.49.0 or -newer than 1.53.2 to generate it, you are *not* affected by this issue. -See [issue #4783](https://github.com/rclone/rclone/issues/4783) for more -details, and a tool you can use to check if you are affected. - -### Example - -Create the following file structure using "standard" file name -encryption. - -``` -plaintext/ -├── file0.txt -├── file1.txt -└── subdir - ├── file2.txt - ├── file3.txt - └── subsubdir - └── file4.txt -``` - -Copy these to the remote, and list them - -``` -$ rclone -q copy plaintext secret: -$ rclone -q ls secret: - 7 file1.txt - 6 file0.txt - 8 subdir/file2.txt - 10 subdir/subsubdir/file4.txt - 9 subdir/file3.txt -``` - -The crypt remote looks like - -``` -$ rclone -q ls remote:path - 55 hagjclgavj2mbiqm6u6cnjjqcg - 54 v05749mltvv1tf4onltun46gls - 57 86vhrsv86mpbtd3a0akjuqslj8/dlj7fkq4kdq72emafg7a7s41uo - 58 86vhrsv86mpbtd3a0akjuqslj8/7uu829995du6o42n32otfhjqp4/b9pausrfansjth5ob3jkdqd4lc - 56 86vhrsv86mpbtd3a0akjuqslj8/8njh1sk437gttmep3p70g81aps -``` +- Default: 48Mi -The directory structure is preserved +#### --dropbox-impersonate -``` -$ rclone -q ls secret:subdir - 8 file2.txt - 9 file3.txt - 10 subsubdir/file4.txt -``` +Impersonate this user when using a business account. -Without file name encryption `.bin` extensions are added to underlying -names. This prevents the cloud provider attempting to interpret file -content. +Note that if you want to use impersonate, you should make sure this +flag is set when running "rclone config" as this will cause rclone to +request the "members.read" scope which it won't normally. This is +needed to lookup a members email address into the internal ID that +dropbox uses in the API. -``` -$ rclone -q ls remote:path - 54 file0.txt.bin - 57 subdir/file3.txt.bin - 56 subdir/file2.txt.bin - 58 subdir/subsubdir/file4.txt.bin - 55 file1.txt.bin -``` +Using the "members.read" scope will require a Dropbox Team Admin +to approve during the OAuth flow. -### File name encryption modes +You will have to use your own App (setting your own client_id and +client_secret) to use this option as currently rclone's default set of +permissions doesn't include "members.read". This can be added once +v1.55 or later is in use everywhere. -Off - * doesn't hide file names or directory structure - * allows for longer file names (~246 characters) - * can use sub paths and copy single files +Properties: -Standard +- Config: impersonate +- Env Var: RCLONE_DROPBOX_IMPERSONATE +- Type: string +- Required: false - * file names encrypted - * file names can't be as long (~143 characters) - * can use sub paths and copy single files - * directory structure visible - * identical files names will have identical uploaded names - * can use shortcuts to shorten the directory recursion +#### --dropbox-shared-files -Obfuscation +Instructs rclone to work on individual shared files. -This is a simple "rotate" of the filename, with each file having a rot -distance based on the filename. Rclone stores the distance at the -beginning of the filename. A file called "hello" may become "53.jgnnq". +In this mode rclone's features are extremely limited - only list (ls, lsl, etc.) +operations and read operations (e.g. downloading) are supported in this mode. +All other operations will be disabled. -Obfuscation is not a strong encryption of filenames, but hinders -automated scanning tools picking up on filename patterns. It is an -intermediate between "off" and "standard" which allows for longer path -segment names. +Properties: -There is a possibility with some unicode based filenames that the -obfuscation is weak and may map lower case characters to upper case -equivalents. +- Config: shared_files +- Env Var: RCLONE_DROPBOX_SHARED_FILES +- Type: bool +- Default: false -Obfuscation cannot be relied upon for strong protection. +#### --dropbox-shared-folders - * file names very lightly obfuscated - * file names can be longer than standard encryption - * can use sub paths and copy single files - * directory structure visible - * identical files names will have identical uploaded names +Instructs rclone to work on shared folders. + +When this flag is used with no path only the List operation is supported and +all available shared folders will be listed. If you specify a path the first part +will be interpreted as the name of shared folder. Rclone will then try to mount this +shared to the root namespace. On success shared folder rclone proceeds normally. +The shared folder is now pretty much a normal folder and all normal operations +are supported. -Cloud storage systems have limits on file name length and -total path length which rclone is more likely to breach using -"Standard" file name encryption. Where file names are less than 156 -characters in length issues should not be encountered, irrespective of -cloud storage provider. +Note that we don't unmount the shared folder afterwards so the +--dropbox-shared-folders can be omitted after the first use of a particular +shared folder. -An experimental advanced option `filename_encoding` is now provided to -address this problem to a certain degree. -For cloud storage systems with case sensitive file names (e.g. Google Drive), -`base64` can be used to reduce file name length. -For cloud storage systems using UTF-16 to store file names internally -(e.g. OneDrive, Dropbox, Box), `base32768` can be used to drastically reduce -file name length. +Properties: -An alternative, future rclone file name encryption mode may tolerate -backend provider path length limits. +- Config: shared_folders +- Env Var: RCLONE_DROPBOX_SHARED_FOLDERS +- Type: bool +- Default: false -### Directory name encryption +#### --dropbox-pacer-min-sleep -Crypt offers the option of encrypting dir names or leaving them intact. -There are two options: +Minimum time to sleep between API calls. -True +Properties: -Encrypts the whole file path including directory names -Example: -`1/12/123.txt` is encrypted to -`p0e52nreeaj0a5ea7s64m4j72s/l42g6771hnv3an9cgc8cr2n1ng/qgm4avr35m5loi1th53ato71v0` +- Config: pacer_min_sleep +- Env Var: RCLONE_DROPBOX_PACER_MIN_SLEEP +- Type: Duration +- Default: 10ms -False +#### --dropbox-encoding -Only encrypts file names, skips directory names -Example: -`1/12/123.txt` is encrypted to -`1/12/qgm4avr35m5loi1th53ato71v0` +The encoding for the backend. +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -### Modified time and hashes +Properties: -Crypt stores modification times using the underlying remote so support -depends on that. +- Config: encoding +- Env Var: RCLONE_DROPBOX_ENCODING +- Type: Encoding +- Default: Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot -Hashes are not stored for crypt. However the data integrity is -protected by an extremely strong crypto authenticator. +#### --dropbox-batch-mode -Use the `rclone cryptcheck` command to check the -integrity of an encrypted remote instead of `rclone check` which can't -check the checksums properly. +Upload file batching sync|async|off. +This sets the batch mode used by rclone. -### Standard options +For full info see [the main docs](https://rclone.org/dropbox/#batch-mode) -Here are the Standard options specific to crypt (Encrypt/Decrypt a remote). +This has 3 possible values -#### --crypt-remote +- off - no batching +- sync - batch uploads and check completion (default) +- async - batch upload and don't check completion -Remote to encrypt/decrypt. +Rclone will close any outstanding batches when it exits which may make +a delay on quit. -Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", -"myremote:bucket" or maybe "myremote:" (not recommended). Properties: -- Config: remote -- Env Var: RCLONE_CRYPT_REMOTE +- Config: batch_mode +- Env Var: RCLONE_DROPBOX_BATCH_MODE - Type: string -- Required: true +- Default: "sync" -#### --crypt-filename-encryption +#### --dropbox-batch-size -How to encrypt the filenames. +Max number of files in upload batch. -Properties: +This sets the batch size of files to upload. It has to be less than 1000. -- Config: filename_encryption -- Env Var: RCLONE_CRYPT_FILENAME_ENCRYPTION -- Type: string -- Default: "standard" -- Examples: - - "standard" - - Encrypt the filenames. - - See the docs for the details. - - "obfuscate" - - Very simple filename obfuscation. - - "off" - - Don't encrypt the file names. - - Adds a ".bin", or "suffix" extension only. +By default this is 0 which means rclone which calculate the batch size +depending on the setting of batch_mode. -#### --crypt-directory-name-encryption +- batch_mode: async - default batch_size is 100 +- batch_mode: sync - default batch_size is the same as --transfers +- batch_mode: off - not in use -Option to either encrypt directory names or leave them intact. +Rclone will close any outstanding batches when it exits which may make +a delay on quit. + +Setting this is a great idea if you are uploading lots of small files +as it will make them a lot quicker. You can use --transfers 32 to +maximise throughput. -NB If filename_encryption is "off" then this option will do nothing. Properties: -- Config: directory_name_encryption -- Env Var: RCLONE_CRYPT_DIRECTORY_NAME_ENCRYPTION -- Type: bool -- Default: true -- Examples: - - "true" - - Encrypt directory names. - - "false" - - Don't encrypt directory names, leave them intact. +- Config: batch_size +- Env Var: RCLONE_DROPBOX_BATCH_SIZE +- Type: int +- Default: 0 -#### --crypt-password +#### --dropbox-batch-timeout -Password or pass phrase for encryption. +Max time to allow an idle upload batch before uploading. -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +If an upload batch is idle for more than this long then it will be +uploaded. -Properties: +The default for this is 0 which means rclone will choose a sensible +default based on the batch_mode in use. -- Config: password -- Env Var: RCLONE_CRYPT_PASSWORD -- Type: string -- Required: true +- batch_mode: async - default batch_timeout is 10s +- batch_mode: sync - default batch_timeout is 500ms +- batch_mode: off - not in use -#### --crypt-password2 -Password or pass phrase for salt. +Properties: -Optional but recommended. -Should be different to the previous password. +- Config: batch_timeout +- Env Var: RCLONE_DROPBOX_BATCH_TIMEOUT +- Type: Duration +- Default: 0s -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +#### --dropbox-batch-commit-timeout + +Max time to wait for a batch to finish committing Properties: -- Config: password2 -- Env Var: RCLONE_CRYPT_PASSWORD2 -- Type: string -- Required: false +- Config: batch_commit_timeout +- Env Var: RCLONE_DROPBOX_BATCH_COMMIT_TIMEOUT +- Type: Duration +- Default: 10m0s -### Advanced options -Here are the Advanced options specific to crypt (Encrypt/Decrypt a remote). -#### --crypt-server-side-across-configs +## Limitations -Deprecated: use --server-side-across-configs instead. +Note that Dropbox is case insensitive so you can't have a file called +"Hello.doc" and one called "hello.doc". -Allow server-side operations (e.g. copy) to work across different crypt configs. +There are some file names such as `thumbs.db` which Dropbox can't +store. There is a full list of them in the ["Ignored Files" section +of this document](https://www.dropbox.com/en/help/145). Rclone will +issue an error message `File name disallowed - not uploading` if it +attempts to upload one of those file names, but the sync won't fail. -Normally this option is not what you want, but if you have two crypts -pointing to the same backend you can use it. +Some errors may occur if you try to sync copyright-protected files +because Dropbox has its own [copyright detector](https://techcrunch.com/2014/03/30/how-dropbox-knows-when-youre-sharing-copyrighted-stuff-without-actually-looking-at-your-stuff/) that +prevents this sort of file being downloaded. This will return the error `ERROR : +/path/to/your/file: Failed to copy: failed to open source object: +path/restricted_content/.` -This can be used, for example, to change file name encryption type -without re-uploading all the data. Just make two crypt backends -pointing to two different directories with the single changed -parameter and use rclone move to move the files between the crypt -remotes. +If you have more than 10,000 files in a directory then `rclone purge +dropbox:dir` will return the error `Failed to purge: There are too +many files involved in this operation`. As a work-around do an +`rclone delete dropbox:dir` followed by an `rclone rmdir dropbox:dir`. -Properties: +When using `rclone link` you'll need to set `--expire` if using a +non-personal account otherwise the visibility may not be correct. +(Note that `--expire` isn't supported on personal accounts). See the +[forum discussion](https://forum.rclone.org/t/rclone-link-dropbox-permissions/23211) and the +[dropbox SDK issue](https://github.com/dropbox/dropbox-sdk-go-unofficial/issues/75). -- Config: server_side_across_configs -- Env Var: RCLONE_CRYPT_SERVER_SIDE_ACROSS_CONFIGS -- Type: bool -- Default: false +## Get your own Dropbox App ID -#### --crypt-show-mapping +When you use rclone with Dropbox in its default configuration you are using rclone's App ID. This is shared between all the rclone users. -For all files listed show how the names encrypt. +Here is how to create your own Dropbox App ID for rclone: -If this flag is set then for each file that the remote is asked to -list, it will log (at level INFO) a line stating the decrypted file -name and the encrypted file name. +1. Log into the [Dropbox App console](https://www.dropbox.com/developers/apps/create) with your Dropbox Account (It need not +to be the same account as the Dropbox you want to access) -This is so you can work out which encrypted names are which decrypted -names just in case you need to do something with the encrypted file -names, or for debugging purposes. +2. Choose an API => Usually this should be `Dropbox API` -Properties: +3. Choose the type of access you want to use => `Full Dropbox` or `App Folder`. If you want to use Team Folders, `Full Dropbox` is required ([see here](https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-create-team-folder-inside-my-app-s-folder/m-p/601005/highlight/true#M27911)). -- Config: show_mapping -- Env Var: RCLONE_CRYPT_SHOW_MAPPING -- Type: bool -- Default: false +4. Name your App. The app name is global, so you can't use `rclone` for example -#### --crypt-no-data-encryption +5. Click the button `Create App` -Option to either encrypt file data or leave it unencrypted. +6. Switch to the `Permissions` tab. Enable at least the following permissions: `account_info.read`, `files.metadata.write`, `files.content.write`, `files.content.read`, `sharing.write`. The `files.metadata.read` and `sharing.read` checkboxes will be marked too. Click `Submit` -Properties: +7. Switch to the `Settings` tab. Fill `OAuth2 - Redirect URIs` as `http://localhost:53682/` and click on `Add` -- Config: no_data_encryption -- Env Var: RCLONE_CRYPT_NO_DATA_ENCRYPTION -- Type: bool -- Default: false -- Examples: - - "true" - - Don't encrypt file data, leave it unencrypted. - - "false" - - Encrypt file data. +8. Find the `App key` and `App secret` values on the `Settings` tab. Use these values in rclone config to add a new remote or edit an existing remote. The `App key` setting corresponds to `client_id` in rclone config, the `App secret` corresponds to `client_secret` -#### --crypt-pass-bad-blocks +# Enterprise File Fabric -If set this will pass bad blocks through as all 0. +This backend supports [Storage Made Easy's Enterprise File +Fabric™](https://storagemadeeasy.com/about/) which provides a software +solution to integrate and unify File and Object Storage accessible +through a global file system. -This should not be set in normal operation, it should only be set if -trying to recover an encrypted file with errors and it is desired to -recover as much of the file as possible. +## Configuration -Properties: +The initial setup for the Enterprise File Fabric backend involves +getting a token from the Enterprise File Fabric which you need to +do in your browser. `rclone config` walks you through it. -- Config: pass_bad_blocks -- Env Var: RCLONE_CRYPT_PASS_BAD_BLOCKS -- Type: bool -- Default: false +Here is an example of how to make a remote called `remote`. First run: -#### --crypt-filename-encoding + rclone config -How to encode the encrypted filename to text string. +This will guide you through an interactive setup process: -This option could help with shortening the encrypted filename. The -suitable option would depend on the way your remote count the filename -length and if it's case sensitive. +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value +[snip] +XX / Enterprise File Fabric + \ "filefabric" +[snip] +Storage> filefabric +** See help for filefabric backend at: https://rclone.org/filefabric/ ** -Properties: +URL of the Enterprise File Fabric to connect to +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 1 / Storage Made Easy US + \ "https://storagemadeeasy.com" + 2 / Storage Made Easy EU + \ "https://eu.storagemadeeasy.com" + 3 / Connect to your Enterprise File Fabric + \ "https://yourfabric.smestorage.com" +url> https://yourfabric.smestorage.com/ +ID of the root folder +Leave blank normally. -- Config: filename_encoding -- Env Var: RCLONE_CRYPT_FILENAME_ENCODING -- Type: string -- Default: "base32" -- Examples: - - "base32" - - Encode using base32. Suitable for all remote. - - "base64" - - Encode using base64. Suitable for case sensitive remote. - - "base32768" - - Encode using base32768. Suitable if your remote counts UTF-16 or - - Unicode codepoint instead of UTF-8 byte length. (Eg. Onedrive, Dropbox) +Fill in to make rclone start with directory of a given ID. -#### --crypt-suffix +Enter a string value. Press Enter for the default (""). +root_folder_id> +Permanent Authentication Token -If this is set it will override the default suffix of ".bin". +A Permanent Authentication Token can be created in the Enterprise File +Fabric, on the users Dashboard under Security, there is an entry +you'll see called "My Authentication Tokens". Click the Manage button +to create one. -Setting suffix to "none" will result in an empty suffix. This may be useful -when the path length is critical. +These tokens are normally valid for several years. -Properties: +For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens -- Config: suffix -- Env Var: RCLONE_CRYPT_SUFFIX -- Type: string -- Default: ".bin" +Enter a string value. Press Enter for the default (""). +permanent_token> xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx +Edit advanced config? (y/n) +y) Yes +n) No (default) +y/n> n +Remote config +-------------------- +[remote] +type = filefabric +url = https://yourfabric.smestorage.com/ +permanent_token = xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -### Metadata +Once configured you can then use `rclone` like this, -Any metadata supported by the underlying remote is read and written. +List directories in top level of your Enterprise File Fabric -See the [metadata](https://rclone.org/docs/#metadata) docs for more info. + rclone lsd remote: -## Backend commands +List all the files in your Enterprise File Fabric -Here are the commands specific to the crypt backend. + rclone ls remote: -Run them with +To copy a local directory to an Enterprise File Fabric directory called backup - rclone backend COMMAND remote: + rclone copy /home/source remote:backup -The help below will explain what arguments each command takes. +### Modification times and hashes -See the [backend](https://rclone.org/commands/rclone_backend/) command for more -info on how to pass options and arguments. +The Enterprise File Fabric allows modification times to be set on +files accurate to 1 second. These will be used to detect whether +objects need syncing or not. -These can be run on a running backend using the rc command -[backend/command](https://rclone.org/rc/#backend-command). +The Enterprise File Fabric does not support any data hashes at this time. -### encode +### Restricted filename characters -Encode the given filename(s) +The [default restricted characters set](https://rclone.org/overview/#restricted-characters) +will be replaced. - rclone backend encode remote: [options] [+] +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. -This encodes the filenames given as arguments returning a list of -strings of the encoded results. +### Empty files -Usage Example: +Empty files aren't supported by the Enterprise File Fabric. Rclone will therefore +upload an empty file as a single space with a mime type of +`application/vnd.rclone.empty.file` and files with that mime type are +treated as empty. - rclone backend encode crypt: file1 [file2...] - rclone rc backend/command command=encode fs=crypt: file1 [file2...] +### Root folder ID ### +You can set the `root_folder_id` for rclone. This is the directory +(identified by its `Folder ID`) that rclone considers to be the root +of your Enterprise File Fabric. -### decode +Normally you will leave this blank and rclone will determine the +correct root to use itself. -Decode the given filename(s) +However you can set this to restrict rclone to a specific folder +hierarchy. - rclone backend decode remote: [options] [+] +In order to do this you will have to find the `Folder ID` of the +directory you wish rclone to display. These aren't displayed in the +web interface, but you can use `rclone lsf` to find them, for example -This decodes the filenames given as arguments returning a list of -strings of the decoded results. It will return an error if any of the -inputs are invalid. +``` +$ rclone lsf --dirs-only -Fip --csv filefabric: +120673758,Burnt PDFs/ +120673759,My Quick Uploads/ +120673755,My Syncs/ +120673756,My backups/ +120673757,My contacts/ +120673761,S3 Storage/ +``` -Usage Example: +The ID for "S3 Storage" would be `120673761`. - rclone backend decode crypt: encryptedfile1 [encryptedfile2...] - rclone rc backend/command command=decode fs=crypt: encryptedfile1 [encryptedfile2...] +### Standard options + +Here are the Standard options specific to filefabric (Enterprise File Fabric). +#### --filefabric-url +URL of the Enterprise File Fabric to connect to. -## Backing up an encrypted remote +Properties: + +- Config: url +- Env Var: RCLONE_FILEFABRIC_URL +- Type: string +- Required: true +- Examples: + - "https://storagemadeeasy.com" + - Storage Made Easy US + - "https://eu.storagemadeeasy.com" + - Storage Made Easy EU + - "https://yourfabric.smestorage.com" + - Connect to your Enterprise File Fabric -If you wish to backup an encrypted remote, it is recommended that you use -`rclone sync` on the encrypted files, and make sure the passwords are -the same in the new encrypted remote. +#### --filefabric-root-folder-id -This will have the following advantages +ID of the root folder. - * `rclone sync` will check the checksums while copying - * you can use `rclone check` between the encrypted remotes - * you don't decrypt and encrypt unnecessarily +Leave blank normally. -For example, let's say you have your original remote at `remote:` with -the encrypted version at `eremote:` with path `remote:crypt`. You -would then set up the new remote `remote2:` and then the encrypted -version `eremote2:` with path `remote2:crypt` using the same passwords -as `eremote:`. +Fill in to make rclone start with directory of a given ID. -To sync the two remotes you would do - rclone sync --interactive remote:crypt remote2:crypt +Properties: -And to check the integrity you would do +- Config: root_folder_id +- Env Var: RCLONE_FILEFABRIC_ROOT_FOLDER_ID +- Type: string +- Required: false - rclone check remote:crypt remote2:crypt +#### --filefabric-permanent-token -## File formats +Permanent Authentication Token. -### File encryption +A Permanent Authentication Token can be created in the Enterprise File +Fabric, on the users Dashboard under Security, there is an entry +you'll see called "My Authentication Tokens". Click the Manage button +to create one. -Files are encrypted 1:1 source file to destination object. The file -has a header and is divided into chunks. +These tokens are normally valid for several years. -#### Header +For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens - * 8 bytes magic string `RCLONE\x00\x00` - * 24 bytes Nonce (IV) -The initial nonce is generated from the operating systems crypto -strong random number generator. The nonce is incremented for each -chunk read making sure each nonce is unique for each block written. -The chance of a nonce being re-used is minuscule. If you wrote an -exabyte of data (10¹⁸ bytes) you would have a probability of -approximately 2×10⁻³² of re-using a nonce. +Properties: -#### Chunk +- Config: permanent_token +- Env Var: RCLONE_FILEFABRIC_PERMANENT_TOKEN +- Type: string +- Required: false -Each chunk will contain 64 KiB of data, except for the last one which -may have less data. The data chunk is in standard NaCl SecretBox -format. SecretBox uses XSalsa20 and Poly1305 to encrypt and -authenticate messages. +### Advanced options -Each chunk contains: +Here are the Advanced options specific to filefabric (Enterprise File Fabric). - * 16 Bytes of Poly1305 authenticator - * 1 - 65536 bytes XSalsa20 encrypted data +#### --filefabric-token -64k chunk size was chosen as the best performing chunk size (the -authenticator takes too much time below this and the performance drops -off due to cache effects above this). Note that these chunks are -buffered in memory so they can't be too big. +Session Token. -This uses a 32 byte (256 bit key) key derived from the user password. +This is a session token which rclone caches in the config file. It is +usually valid for 1 hour. -#### Examples +Don't set this value - rclone will set it automatically. -1 byte file will encrypt to - * 32 bytes header - * 17 bytes data chunk +Properties: -49 bytes total +- Config: token +- Env Var: RCLONE_FILEFABRIC_TOKEN +- Type: string +- Required: false -1 MiB (1048576 bytes) file will encrypt to +#### --filefabric-token-expiry - * 32 bytes header - * 16 chunks of 65568 bytes +Token expiry time. -1049120 bytes total (a 0.05% overhead). This is the overhead for big -files. +Don't set this value - rclone will set it automatically. -### Name encryption -File names are encrypted segment by segment - the path is broken up -into `/` separated strings and these are encrypted individually. +Properties: -File segments are padded using PKCS#7 to a multiple of 16 bytes -before encryption. +- Config: token_expiry +- Env Var: RCLONE_FILEFABRIC_TOKEN_EXPIRY +- Type: string +- Required: false -They are then encrypted with EME using AES with 256 bit key. EME -(ECB-Mix-ECB) is a wide-block encryption mode presented in the 2003 -paper "A Parallelizable Enciphering Mode" by Halevi and Rogaway. +#### --filefabric-version -This makes for deterministic encryption which is what we want - the -same filename must encrypt to the same thing otherwise we can't find -it on the cloud storage system. +Version read from the file fabric. -This means that +Don't set this value - rclone will set it automatically. - * filenames with the same name will encrypt the same - * filenames which start the same won't have a common prefix -This uses a 32 byte key (256 bits) and a 16 byte (128 bits) IV both of -which are derived from the user password. +Properties: -After encryption they are written out using a modified version of -standard `base32` encoding as described in RFC4648. The standard -encoding is modified in two ways: +- Config: version +- Env Var: RCLONE_FILEFABRIC_VERSION +- Type: string +- Required: false - * it becomes lower case (no-one likes upper case filenames!) - * we strip the padding character `=` +#### --filefabric-encoding -`base32` is used rather than the more efficient `base64` so rclone can be -used on case insensitive remotes (e.g. Windows, Amazon Drive). +The encoding for the backend. -### Key derivation +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -Rclone uses `scrypt` with parameters `N=16384, r=8, p=1` with an -optional user supplied salt (password2) to derive the 32+32+16 = 80 -bytes of key material required. If the user doesn't supply a salt -then rclone uses an internal one. +Properties: -`scrypt` makes it impractical to mount a dictionary attack on rclone -encrypted data. For full protection against this you should always use -a salt. +- Config: encoding +- Env Var: RCLONE_FILEFABRIC_ENCODING +- Type: Encoding +- Default: Slash,Del,Ctl,InvalidUtf8,Dot -## SEE ALSO -* [rclone cryptdecode](https://rclone.org/commands/rclone_cryptdecode/) - Show forward/reverse mapping of encrypted filenames -# Compress +# FTP -## Warning +FTP is the File Transfer Protocol. Rclone FTP support is provided using the +[github.com/jlaffaye/ftp](https://godoc.org/github.com/jlaffaye/ftp) +package. -This remote is currently **experimental**. Things may break and data may be lost. Anything you do with this remote is -at your own risk. Please understand the risks associated with using experimental code and don't use this remote in -critical applications. +[Limitations of Rclone's FTP backend](#limitations) -The `Compress` remote adds compression to another remote. It is best used with remotes containing -many large compressible files. +Paths are specified as `remote:path`. If the path does not begin with +a `/` it is relative to the home directory of the user. An empty path +`remote:` refers to the user's home directory. ## Configuration -To use this remote, all you need to do is specify another remote and a compression mode to use: +To create an FTP configuration named `remote`, run -``` -Current remotes: + rclone config -Name Type -==== ==== -remote_to_press sometype +Rclone config guides you through an interactive setup process. A minimal +rclone FTP remote definition only requires host, username and password. +For an anonymous FTP server, see [below](#anonymous-ftp). -e) Edit existing remote -$ rclone config +``` +No remotes found, make a new one? n) New remote -d) Delete remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config -e/n/d/r/c/s/q> n -name> compress -... - 8 / Compress a remote - \ "compress" -... -Storage> compress -** See help for compress backend at: https://rclone.org/compress/ ** +n/r/c/s/q> n +name> remote +Type of storage to configure. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value +[snip] +XX / FTP + \ "ftp" +[snip] +Storage> ftp +** See help for ftp backend at: https://rclone.org/ftp/ ** -Remote to compress. +FTP host to connect to Enter a string value. Press Enter for the default (""). -remote> remote_to_press:subdir -Compression mode. -Enter a string value. Press Enter for the default ("gzip"). Choose a number from below, or type in your own value - 1 / Gzip compression balanced for speed and compression strength. - \ "gzip" -compression_mode> gzip -Edit advanced config? (y/n) -y) Yes -n) No (default) -y/n> n + 1 / Connect to ftp.example.com + \ "ftp.example.com" +host> ftp.example.com +FTP username +Enter a string value. Press Enter for the default ("$USER"). +user> +FTP port number +Enter a signed integer. Press Enter for the default (21). +port> +FTP password +y) Yes type in my own password +g) Generate random password +y/g> y +Enter the password: +password: +Confirm the password: +password: +Use FTP over TLS (Implicit) +Enter a boolean value (true or false). Press Enter for the default ("false"). +tls> +Use FTP over TLS (Explicit) +Enter a boolean value (true or false). Press Enter for the default ("false"). +explicit_tls> Remote config -------------------- -[compress] -type = compress -remote = remote_to_press:subdir -compression_mode = gzip +[remote] +type = ftp +host = ftp.example.com +pass = *** ENCRYPTED *** -------------------- -y) Yes this is OK (default) +y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y ``` -### Compression Modes - -Currently only gzip compression is supported. It provides a decent balance between speed and size and is well -supported by other applications. Compression strength can further be configured via an advanced setting where 0 is no -compression and 9 is strongest compression. - -### File types - -If you open a remote wrapped by compress, you will see that there are many files with an extension corresponding to -the compression algorithm you chose. These files are standard files that can be opened by various archive programs, -but they have some hidden metadata that allows them to be used by rclone. -While you may download and decompress these files at will, do **not** manually delete or rename files. Files without -correct metadata files will not be recognized by rclone. - -### File names - -The compressed files will be named `*.###########.gz` where `*` is the base file and the `#` part is base64 encoded -size of the uncompressed file. The file names should not be changed by anything other than the rclone compression backend. - - -### Standard options - -Here are the Standard options specific to compress (Compress a remote). - -#### --compress-remote - -Remote to compress. - -Properties: - -- Config: remote -- Env Var: RCLONE_COMPRESS_REMOTE -- Type: string -- Required: true - -#### --compress-mode - -Compression mode. - -Properties: - -- Config: mode -- Env Var: RCLONE_COMPRESS_MODE -- Type: string -- Default: "gzip" -- Examples: - - "gzip" - - Standard gzip compression with fastest parameters. - -### Advanced options +To see all directories in the home directory of `remote` -Here are the Advanced options specific to compress (Compress a remote). + rclone lsd remote: -#### --compress-level +Make a new directory -GZIP compression level (-2 to 9). + rclone mkdir remote:path/to/directory -Generally -1 (default, equivalent to 5) is recommended. -Levels 1 to 9 increase compression at the cost of speed. Going past 6 -generally offers very little return. +List the contents of a directory -Level -2 uses Huffman encoding only. Only use if you know what you -are doing. -Level 0 turns off compression. + rclone ls remote:path/to/directory -Properties: +Sync `/home/local/directory` to the remote directory, deleting any +excess files in the directory. -- Config: level -- Env Var: RCLONE_COMPRESS_LEVEL -- Type: int -- Default: -1 + rclone sync --interactive /home/local/directory remote:directory -#### --compress-ram-cache-limit +### Anonymous FTP -Some remotes don't allow the upload of files with unknown size. -In this case the compressed file will need to be cached to determine -it's size. +When connecting to a FTP server that allows anonymous login, you can use the +special "anonymous" username. Traditionally, this user account accepts any +string as a password, although it is common to use either the password +"anonymous" or "guest". Some servers require the use of a valid e-mail +address as password. -Files smaller than this limit will be cached in RAM, files larger than -this limit will be cached on disk. +Using [on-the-fly](#backend-path-to-dir) or +[connection string](https://rclone.org/docs/#connection-strings) remotes makes it easy to access +such servers, without requiring any configuration in advance. The following +are examples of that: -Properties: + rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=$(rclone obscure dummy) + rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=$(rclone obscure dummy): -- Config: ram_cache_limit -- Env Var: RCLONE_COMPRESS_RAM_CACHE_LIMIT -- Type: SizeSuffix -- Default: 20Mi +The above examples work in Linux shells and in PowerShell, but not Windows +Command Prompt. They execute the [rclone obscure](https://rclone.org/commands/rclone_obscure/) +command to create a password string in the format required by the +[pass](#ftp-pass) option. The following examples are exactly the same, except use +an already obscured string representation of the same password "dummy", and +therefore works even in Windows Command Prompt: -### Metadata + rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM + rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM: -Any metadata supported by the underlying remote is read and written. +### Implicit TLS -See the [metadata](https://rclone.org/docs/#metadata) docs for more info. +Rlone FTP supports implicit FTP over TLS servers (FTPS). This has to +be enabled in the FTP backend config for the remote, or with +[`--ftp-tls`](#ftp-tls). The default FTPS port is `990`, not `21` and +can be set with [`--ftp-port`](#ftp-port). +### Restricted filename characters +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) +the following characters are also replaced: -# Combine +File names cannot end with the following characters. Replacement is +limited to the last character in a file name: -The `combine` backend joins remotes together into a single directory -tree. +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| SP | 0x20 | ␠ | -For example you might have a remote for images on one provider: +Not all FTP servers can have all characters in file names, for example: -``` -$ rclone tree s3:imagesbucket -/ -├── image1.jpg -└── image2.jpg -``` +| FTP Server| Forbidden characters | +| --------- |:--------------------:| +| proftpd | `*` | +| pureftpd | `\ [ ]` | -And a remote for files on another: +This backend's interactive configuration wizard provides a selection of +sensible encoding settings for major FTP servers: ProFTPd, PureFTPd, VsFTPd. +Just hit a selection number when prompted. -``` -$ rclone tree drive:important/files -/ -├── file1.txt -└── file2.txt -``` -The `combine` backend can join these together into a synthetic -directory structure like this: +### Standard options -``` -$ rclone tree combined: -/ -├── files -│ ├── file1.txt -│ └── file2.txt -└── images - ├── image1.jpg - └── image2.jpg -``` +Here are the Standard options specific to ftp (FTP). -You'd do this by specifying an `upstreams` parameter in the config -like this +#### --ftp-host - upstreams = images=s3:imagesbucket files=drive:important/files +FTP host to connect to. -During the initial setup with `rclone config` you will specify the -upstreams remotes as a space separated list. The upstream remotes can -either be a local paths or other remotes. +E.g. "ftp.example.com". -## Configuration +Properties: -Here is an example of how to make a combine called `remote` for the -example above. First run: +- Config: host +- Env Var: RCLONE_FTP_HOST +- Type: string +- Required: true - rclone config +#### --ftp-user -This will guide you through an interactive setup process: +FTP username. -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> remote -Option Storage. -Type of storage to configure. -Choose a number from below, or type in your own value. -... -XX / Combine several remotes into one - \ (combine) -... -Storage> combine -Option upstreams. -Upstreams for combining -These should be in the form - dir=remote:path dir2=remote2:path -Where before the = is specified the root directory and after is the remote to -put there. -Embedded spaces can be added using quotes - "dir=remote:path with space" "dir2=remote2:path with space" -Enter a fs.SpaceSepList value. -upstreams> images=s3:imagesbucket files=drive:important/files --------------------- -[remote] -type = combine -upstreams = images=s3:imagesbucket files=drive:important/files --------------------- -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +Properties: -### Configuring for Google Drive Shared Drives +- Config: user +- Env Var: RCLONE_FTP_USER +- Type: string +- Default: "$USER" -Rclone has a convenience feature for making a combine backend for all -the shared drives you have access to. +#### --ftp-port -Assuming your main (non shared drive) Google drive remote is called -`drive:` you would run +FTP port number. - rclone backend -o config drives drive: +Properties: -This would produce something like this: +- Config: port +- Env Var: RCLONE_FTP_PORT +- Type: int +- Default: 21 - [My Drive] - type = alias - remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=: +#### --ftp-pass - [Test Drive] - type = alias - remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=: +FTP password. - [AllDrives] - type = combine - upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:" +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -If you then add that config to your config file (find it with `rclone -config file`) then you can access all the shared drives in one place -with the `AllDrives:` remote. +Properties: -See [the Google Drive docs](https://rclone.org/drive/#drives) for full info. +- Config: pass +- Env Var: RCLONE_FTP_PASS +- Type: string +- Required: false +#### --ftp-tls -### Standard options +Use Implicit FTPS (FTP over TLS). -Here are the Standard options specific to combine (Combine several remotes into one). +When using implicit FTP over TLS the client connects using TLS +right from the start which breaks compatibility with +non-TLS-aware servers. This is usually served over port 990 rather +than port 21. Cannot be used in combination with explicit FTPS. -#### --combine-upstreams +Properties: -Upstreams for combining +- Config: tls +- Env Var: RCLONE_FTP_TLS +- Type: bool +- Default: false -These should be in the form +#### --ftp-explicit-tls - dir=remote:path dir2=remote2:path +Use Explicit FTPS (FTP over TLS). -Where before the = is specified the root directory and after is the remote to -put there. +When using explicit FTP over TLS the client explicitly requests +security from the server in order to upgrade a plain text connection +to an encrypted one. Cannot be used in combination with implicit FTPS. -Embedded spaces can be added using quotes +Properties: - "dir=remote:path with space" "dir2=remote2:path with space" +- Config: explicit_tls +- Env Var: RCLONE_FTP_EXPLICIT_TLS +- Type: bool +- Default: false +### Advanced options +Here are the Advanced options specific to ftp (FTP). -Properties: +#### --ftp-concurrency -- Config: upstreams -- Env Var: RCLONE_COMBINE_UPSTREAMS -- Type: SpaceSepList -- Default: +Maximum number of FTP simultaneous connections, 0 for unlimited. -### Metadata +Note that setting this is very likely to cause deadlocks so it should +be used with care. -Any metadata supported by the underlying remote is read and written. +If you are doing a sync or copy then make sure concurrency is one more +than the sum of `--transfers` and `--checkers`. -See the [metadata](https://rclone.org/docs/#metadata) docs for more info. +If you use `--check-first` then it just needs to be one more than the +maximum of `--checkers` and `--transfers`. +So for `concurrency 3` you'd use `--checkers 2 --transfers 2 +--check-first` or `--checkers 1 --transfers 1`. -# Dropbox -Paths are specified as `remote:path` +Properties: -Dropbox paths may be as deep as required, e.g. -`remote:directory/subdirectory`. +- Config: concurrency +- Env Var: RCLONE_FTP_CONCURRENCY +- Type: int +- Default: 0 -## Configuration +#### --ftp-no-check-certificate -The initial setup for dropbox involves getting a token from Dropbox -which you need to do in your browser. `rclone config` walks you -through it. +Do not verify the TLS certificate of the server. -Here is an example of how to make a remote called `remote`. First run: +Properties: - rclone config +- Config: no_check_certificate +- Env Var: RCLONE_FTP_NO_CHECK_CERTIFICATE +- Type: bool +- Default: false -This will guide you through an interactive setup process: +#### --ftp-disable-epsv -``` -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 -[snip] -XX / Dropbox - \ "dropbox" -[snip] -Storage> dropbox -Dropbox App Key - leave blank normally. -app_key> -Dropbox App Secret - leave blank normally. -app_secret> -Remote config -Please visit: -https://www.dropbox.com/1/oauth2/authorize?client_id=XXXXXXXXXXXXXXX&response_type=code -Enter the code: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXXXXXXXX --------------------- -[remote] -app_key = -app_secret = -token = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXX --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +Disable using EPSV even if server advertises support. -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a -machine with no Internet browser available. +Properties: -Note that rclone runs a webserver on your local machine to collect the -token as returned from Dropbox. This only -runs from the moment it opens your browser to the moment you get back -the verification code. This is on `http://127.0.0.1:53682/` and it -may require you to unblock it temporarily if you are running a host -firewall, or use manual mode. +- Config: disable_epsv +- Env Var: RCLONE_FTP_DISABLE_EPSV +- Type: bool +- Default: false -You can then use it like this, +#### --ftp-disable-mlsd -List directories in top level of your dropbox +Disable using MLSD even if server advertises support. - rclone lsd remote: +Properties: -List all the files in your dropbox +- Config: disable_mlsd +- Env Var: RCLONE_FTP_DISABLE_MLSD +- Type: bool +- Default: false - rclone ls remote: +#### --ftp-disable-utf8 -To copy a local directory to a dropbox directory called backup +Disable using UTF-8 even if server advertises support. - rclone copy /home/source remote:backup +Properties: -### Dropbox for business +- Config: disable_utf8 +- Env Var: RCLONE_FTP_DISABLE_UTF8 +- Type: bool +- Default: false -Rclone supports Dropbox for business and Team Folders. +#### --ftp-writing-mdtm -When using Dropbox for business `remote:` and `remote:path/to/file` -will refer to your personal folder. +Use MDTM to set modification time (VsFtpd quirk) -If you wish to see Team Folders you must use a leading `/` in the -path, so `rclone lsd remote:/` will refer to the root and show you all -Team Folders and your User Folder. +Properties: -You can then use team folders like this `remote:/TeamFolder` and -`remote:/TeamFolder/path/to/file`. +- Config: writing_mdtm +- Env Var: RCLONE_FTP_WRITING_MDTM +- Type: bool +- Default: false -A leading `/` for a Dropbox personal account will do nothing, but it -will take an extra HTTP transaction so it should be avoided. +#### --ftp-force-list-hidden -### Modified time and Hashes +Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD. -Dropbox supports modified times, but the only way to set a -modification time is to re-upload the file. +Properties: -This means that if you uploaded your data with an older version of -rclone which didn't support the v2 API and modified times, rclone will -decide to upload all your old data to fix the modification times. If -you don't want this to happen use `--size-only` or `--checksum` flag -to stop it. +- Config: force_list_hidden +- Env Var: RCLONE_FTP_FORCE_LIST_HIDDEN +- Type: bool +- Default: false -Dropbox supports [its own hash -type](https://www.dropbox.com/developers/reference/content-hash) which -is checked for all transfers. +#### --ftp-idle-timeout -### Restricted filename characters +Max time before closing idle connections. -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| NUL | 0x00 | ␀ | -| / | 0x2F | / | -| DEL | 0x7F | ␡ | -| \ | 0x5C | \ | +If no connections have been returned to the connection pool in the time +given, rclone will empty the connection pool. -File names can also not end with the following characters. -These only get replaced if they are the last character in the name: +Set to 0 to keep connections indefinitely. -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| SP | 0x20 | ␠ | -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in JSON strings. +Properties: -### Batch mode uploads {#batch-mode} +- Config: idle_timeout +- Env Var: RCLONE_FTP_IDLE_TIMEOUT +- Type: Duration +- Default: 1m0s -Using batch mode uploads is very important for performance when using -the Dropbox API. See [the dropbox performance guide](https://developers.dropbox.com/dbx-performance-guide) -for more info. +#### --ftp-close-timeout -There are 3 modes rclone can use for uploads. +Maximum time to wait for a response to close. -#### --dropbox-batch-mode off +Properties: -In this mode rclone will not use upload batching. This was the default -before rclone v1.55. It has the disadvantage that it is very likely to -encounter `too_many_requests` errors like this +- Config: close_timeout +- Env Var: RCLONE_FTP_CLOSE_TIMEOUT +- Type: Duration +- Default: 1m0s - NOTICE: too_many_requests/.: Too many requests or write operations. Trying again in 15 seconds. +#### --ftp-tls-cache-size -When rclone receives these it has to wait for 15s or sometimes 300s -before continuing which really slows down transfers. +Size of TLS session cache for all control and data connections. -This will happen especially if `--transfers` is large, so this mode -isn't recommended except for compatibility or investigating problems. +TLS cache allows to resume TLS sessions and reuse PSK between connections. +Increase if default size is not enough resulting in TLS resumption errors. +Enabled by default. Use 0 to disable. -#### --dropbox-batch-mode sync +Properties: -In this mode rclone will batch up uploads to the size specified by -`--dropbox-batch-size` and commit them together. +- Config: tls_cache_size +- Env Var: RCLONE_FTP_TLS_CACHE_SIZE +- Type: int +- Default: 32 -Using this mode means you can use a much higher `--transfers` -parameter (32 or 64 works fine) without receiving `too_many_requests` -errors. +#### --ftp-disable-tls13 -This mode ensures full data integrity. +Disable TLS 1.3 (workaround for FTP servers with buggy TLS) -Note that there may be a pause when quitting rclone while rclone -finishes up the last batch using this mode. +Properties: -#### --dropbox-batch-mode async +- Config: disable_tls13 +- Env Var: RCLONE_FTP_DISABLE_TLS13 +- Type: bool +- Default: false -In this mode rclone will batch up uploads to the size specified by -`--dropbox-batch-size` and commit them together. +#### --ftp-shut-timeout -However it will not wait for the status of the batch to be returned to -the caller. This means rclone can use a much bigger batch size (much -bigger than `--transfers`), at the cost of not being able to check the -status of the upload. +Maximum time to wait for data connection closing status. -This provides the maximum possible upload speed especially with lots -of small files, however rclone can't check the file got uploaded -properly using this mode. +Properties: -If you are using this mode then using "rclone check" after the -transfer completes is recommended. Or you could do an initial transfer -with `--dropbox-batch-mode async` then do a final transfer with -`--dropbox-batch-mode sync` (the default). +- Config: shut_timeout +- Env Var: RCLONE_FTP_SHUT_TIMEOUT +- Type: Duration +- Default: 1m0s -Note that there may be a pause when quitting rclone while rclone -finishes up the last batch using this mode. +#### --ftp-ask-password +Allow asking for FTP password when needed. +If this is set and no password is supplied then rclone will ask for a password -### Standard options -Here are the Standard options specific to dropbox (Dropbox). +Properties: -#### --dropbox-client-id +- Config: ask_password +- Env Var: RCLONE_FTP_ASK_PASSWORD +- Type: bool +- Default: false -OAuth Client Id. +#### --ftp-socks-proxy -Leave blank normally. +Socks 5 proxy host. + + Supports the format user:pass@host:port, user@host:port, host:port. + + Example: + + myUser:myPass@localhost:9005 + Properties: -- Config: client_id -- Env Var: RCLONE_DROPBOX_CLIENT_ID +- Config: socks_proxy +- Env Var: RCLONE_FTP_SOCKS_PROXY - Type: string - Required: false -#### --dropbox-client-secret +#### --ftp-encoding -OAuth Client Secret. +The encoding for the backend. -Leave blank normally. +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. Properties: -- Config: client_secret -- Env Var: RCLONE_DROPBOX_CLIENT_SECRET -- Type: string -- Required: false - -### Advanced options - -Here are the Advanced options specific to dropbox (Dropbox). +- Config: encoding +- Env Var: RCLONE_FTP_ENCODING +- Type: Encoding +- Default: Slash,Del,Ctl,RightSpace,Dot +- Examples: + - "Asterisk,Ctl,Dot,Slash" + - ProFTPd can't handle '*' in file names + - "BackSlash,Ctl,Del,Dot,RightSpace,Slash,SquareBracket" + - PureFTPd can't handle '[]' or '*' in file names + - "Ctl,LeftPeriod,Slash" + - VsFTPd can't handle file names starting with dot -#### --dropbox-token -OAuth Access Token as a JSON blob. -Properties: +## Limitations -- Config: token -- Env Var: RCLONE_DROPBOX_TOKEN -- Type: string -- Required: false +FTP servers acting as rclone remotes must support `passive` mode. +The mode cannot be configured as `passive` is the only supported one. +Rclone's FTP implementation is not compatible with `active` mode +as [the library it uses doesn't support it](https://github.com/jlaffaye/ftp/issues/29). +This will likely never be supported due to security concerns. -#### --dropbox-auth-url +Rclone's FTP backend does not support any checksums but can compare +file sizes. -Auth server URL. +`rclone about` is not supported by the FTP backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. -Leave blank to use the provider defaults. +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -Properties: +The implementation of : `--dump headers`, +`--dump bodies`, `--dump auth` for debugging isn't the same as +for rclone HTTP based backends - it has less fine grained control. -- Config: auth_url -- Env Var: RCLONE_DROPBOX_AUTH_URL -- Type: string -- Required: false +`--timeout` isn't supported (but `--contimeout` is). -#### --dropbox-token-url +`--bind` isn't supported. -Token server url. +Rclone's FTP backend could support server-side move but does not +at present. -Leave blank to use the provider defaults. +The `ftp_proxy` environment variable is not currently supported. -Properties: +### Modification times -- Config: token_url -- Env Var: RCLONE_DROPBOX_TOKEN_URL -- Type: string -- Required: false +File modification time (timestamps) is supported to 1 second resolution +for major FTP servers: ProFTPd, PureFTPd, VsFTPd, and FileZilla FTP server. +The `VsFTPd` server has non-standard implementation of time related protocol +commands and needs a special configuration setting: `writing_mdtm = true`. -#### --dropbox-chunk-size +Support for precise file time with other FTP servers varies depending on what +protocol extensions they advertise. If all the `MLSD`, `MDTM` and `MFTM` +extensions are present, rclone will use them together to provide precise time. +Otherwise the times you see on the FTP server through rclone are those of the +last file upload. -Upload chunk size (< 150Mi). +You can use the following command to check whether rclone can use precise time +with your FTP server: `rclone backend features your_ftp_remote:` (the trailing +colon is important). Look for the number in the line tagged by `Precision` +designating the remote time precision expressed as nanoseconds. A value of +`1000000000` means that file time precision of 1 second is available. +A value of `3153600000000000000` (or another large number) means "unsupported". -Any files larger than this will be uploaded in chunks of this size. +# Google Cloud Storage -Note that chunks are buffered in memory (one at a time) so rclone can -deal with retries. Setting this larger will increase the speed -slightly (at most 10% for 128 MiB in tests) at the cost of using more -memory. It can be set smaller if you are tight on memory. +Paths are specified as `remote:bucket` (or `remote:` for the `lsd` +command.) You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`. -Properties: +## Configuration -- Config: chunk_size -- Env Var: RCLONE_DROPBOX_CHUNK_SIZE -- Type: SizeSuffix -- Default: 48Mi +The initial setup for google cloud storage involves getting a token from Google Cloud Storage +which you need to do in your browser. `rclone config` walks you +through it. -#### --dropbox-impersonate +Here is an example of how to make a remote called `remote`. First run: -Impersonate this user when using a business account. + rclone config -Note that if you want to use impersonate, you should make sure this -flag is set when running "rclone config" as this will cause rclone to -request the "members.read" scope which it won't normally. This is -needed to lookup a members email address into the internal ID that -dropbox uses in the API. +This will guide you through an interactive setup process: -Using the "members.read" scope will require a Dropbox Team Admin -to approve during the OAuth flow. +``` +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 +[snip] +XX / Google Cloud Storage (this is not Google Drive) + \ "google cloud storage" +[snip] +Storage> google cloud storage +Google Application Client Id - leave blank normally. +client_id> +Google Application Client Secret - leave blank normally. +client_secret> +Project number optional - needed only for list/create/delete buckets - see your developer console. +project_number> 12345678 +Service Account Credentials JSON file path - needed only if you want use SA instead of interactive login. +service_account_file> +Access Control List for new objects. +Choose a number from below, or type in your own value + 1 / Object owner gets OWNER access, and all Authenticated Users get READER access. + \ "authenticatedRead" + 2 / Object owner gets OWNER access, and project team owners get OWNER access. + \ "bucketOwnerFullControl" + 3 / Object owner gets OWNER access, and project team owners get READER access. + \ "bucketOwnerRead" + 4 / Object owner gets OWNER access [default if left blank]. + \ "private" + 5 / Object owner gets OWNER access, and project team members get access according to their roles. + \ "projectPrivate" + 6 / Object owner gets OWNER access, and all Users get READER access. + \ "publicRead" +object_acl> 4 +Access Control List for new buckets. +Choose a number from below, or type in your own value + 1 / Project team owners get OWNER access, and all Authenticated Users get READER access. + \ "authenticatedRead" + 2 / Project team owners get OWNER access [default if left blank]. + \ "private" + 3 / Project team members get access according to their roles. + \ "projectPrivate" + 4 / Project team owners get OWNER access, and all Users get READER access. + \ "publicRead" + 5 / Project team owners get OWNER access, and all Users get WRITER access. + \ "publicReadWrite" +bucket_acl> 2 +Location for the newly created buckets. +Choose a number from below, or type in your own value + 1 / Empty for default location (US). + \ "" + 2 / Multi-regional location for Asia. + \ "asia" + 3 / Multi-regional location for Europe. + \ "eu" + 4 / Multi-regional location for United States. + \ "us" + 5 / Taiwan. + \ "asia-east1" + 6 / Tokyo. + \ "asia-northeast1" + 7 / Singapore. + \ "asia-southeast1" + 8 / Sydney. + \ "australia-southeast1" + 9 / Belgium. + \ "europe-west1" +10 / London. + \ "europe-west2" +11 / Iowa. + \ "us-central1" +12 / South Carolina. + \ "us-east1" +13 / Northern Virginia. + \ "us-east4" +14 / Oregon. + \ "us-west1" +location> 12 +The storage class to use when storing objects in Google Cloud Storage. +Choose a number from below, or type in your own value + 1 / Default + \ "" + 2 / Multi-regional storage class + \ "MULTI_REGIONAL" + 3 / Regional storage class + \ "REGIONAL" + 4 / Nearline storage class + \ "NEARLINE" + 5 / Coldline storage class + \ "COLDLINE" + 6 / Durable reduced availability storage class + \ "DURABLE_REDUCED_AVAILABILITY" +storage_class> 5 +Remote config +Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. +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] +type = google cloud storage +client_id = +client_secret = +token = {"AccessToken":"xxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","RefreshToken":"x/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxx","Expiry":"2014-07-17T20:49:14.929208288+01:00","Extra":null} +project_number = 12345678 +object_acl = private +bucket_acl = private +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -You will have to use your own App (setting your own client_id and -client_secret) to use this option as currently rclone's default set of -permissions doesn't include "members.read". This can be added once -v1.55 or later is in use everywhere. +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a +machine with no Internet browser available. +Note that rclone runs a webserver on your local machine to collect the +token as returned from Google if using web browser to automatically +authenticate. This only +runs from the moment it opens your browser to the moment you get back +the verification code. This is on `http://127.0.0.1:53682/` and this +it may require you to unblock it temporarily if you are running a host +firewall, or use manual mode. -Properties: +This remote is called `remote` and can now be used like this -- Config: impersonate -- Env Var: RCLONE_DROPBOX_IMPERSONATE -- Type: string -- Required: false +See all the buckets in your project -#### --dropbox-shared-files + rclone lsd remote: -Instructs rclone to work on individual shared files. +Make a new bucket -In this mode rclone's features are extremely limited - only list (ls, lsl, etc.) -operations and read operations (e.g. downloading) are supported in this mode. -All other operations will be disabled. + rclone mkdir remote:bucket -Properties: +List the contents of a bucket -- Config: shared_files -- Env Var: RCLONE_DROPBOX_SHARED_FILES -- Type: bool -- Default: false + rclone ls remote:bucket -#### --dropbox-shared-folders +Sync `/home/local/directory` to the remote bucket, deleting any excess +files in the bucket. -Instructs rclone to work on shared folders. - -When this flag is used with no path only the List operation is supported and -all available shared folders will be listed. If you specify a path the first part -will be interpreted as the name of shared folder. Rclone will then try to mount this -shared to the root namespace. On success shared folder rclone proceeds normally. -The shared folder is now pretty much a normal folder and all normal operations -are supported. + rclone sync --interactive /home/local/directory remote:bucket -Note that we don't unmount the shared folder afterwards so the ---dropbox-shared-folders can be omitted after the first use of a particular -shared folder. +### Service Account support -Properties: +You can set up rclone with Google Cloud Storage in an unattended mode, +i.e. not tied to a specific end-user Google account. This is useful +when you want to synchronise files onto machines that don't have +actively logged-in users, for example build machines. -- Config: shared_folders -- Env Var: RCLONE_DROPBOX_SHARED_FOLDERS -- Type: bool -- Default: false +To get credentials for Google Cloud Platform +[IAM Service Accounts](https://cloud.google.com/iam/docs/service-accounts), +please head to the +[Service Account](https://console.cloud.google.com/permissions/serviceaccounts) +section of the Google Developer Console. Service Accounts behave just +like normal `User` permissions in +[Google Cloud Storage ACLs](https://cloud.google.com/storage/docs/access-control), +so you can limit their access (e.g. make them read only). After +creating an account, a JSON file containing the Service Account's +credentials will be downloaded onto your machines. These credentials +are what rclone will use for authentication. -#### --dropbox-batch-mode +To use a Service Account instead of OAuth2 token flow, enter the path +to your Service Account credentials at the `service_account_file` +prompt and rclone won't use the browser based authentication +flow. If you'd rather stuff the contents of the credentials file into +the rclone config file, you can set `service_account_credentials` with +the actual contents of the file instead, or set the equivalent +environment variable. -Upload file batching sync|async|off. +### Anonymous Access -This sets the batch mode used by rclone. +For downloads of objects that permit public access you can configure rclone +to use anonymous access by setting `anonymous` to `true`. +With unauthorized access you can't write or create files but only read or list +those buckets and objects that have public read access. -For full info see [the main docs](https://rclone.org/dropbox/#batch-mode) +### Application Default Credentials -This has 3 possible values +If no other source of credentials is provided, rclone will fall back +to +[Application Default Credentials](https://cloud.google.com/video-intelligence/docs/common/auth#authenticating_with_application_default_credentials) +this is useful both when you already have configured authentication +for your developer account, or in production when running on a google +compute host. Note that if running in docker, you may need to run +additional commands on your google compute machine - +[see this page](https://cloud.google.com/container-registry/docs/advanced-authentication#gcloud_as_a_docker_credential_helper). -- off - no batching -- sync - batch uploads and check completion (default) -- async - batch upload and don't check completion +Note that in the case application default credentials are used, there +is no need to explicitly configure a project number. -Rclone will close any outstanding batches when it exits which may make -a delay on quit. +### --fast-list +This remote supports `--fast-list` which allows you to use fewer +transactions in exchange for more memory. See the [rclone +docs](https://rclone.org/docs/#fast-list) for more details. -Properties: +### Custom upload headers -- Config: batch_mode -- Env Var: RCLONE_DROPBOX_BATCH_MODE -- Type: string -- Default: "sync" +You can set custom upload headers with the `--header-upload` +flag. Google Cloud Storage supports the headers as described in the +[working with metadata documentation](https://cloud.google.com/storage/docs/gsutil/addlhelp/WorkingWithObjectMetadata) -#### --dropbox-batch-size +- Cache-Control +- Content-Disposition +- Content-Encoding +- Content-Language +- Content-Type +- X-Goog-Storage-Class +- X-Goog-Meta- -Max number of files in upload batch. +Eg `--header-upload "Content-Type text/potato"` -This sets the batch size of files to upload. It has to be less than 1000. +Note that the last of these is for setting custom metadata in the form +`--header-upload "x-goog-meta-key: value"` -By default this is 0 which means rclone which calculate the batch size -depending on the setting of batch_mode. +### Modification times -- batch_mode: async - default batch_size is 100 -- batch_mode: sync - default batch_size is the same as --transfers -- batch_mode: off - not in use +Google Cloud Storage stores md5sum natively. +Google's [gsutil](https://cloud.google.com/storage/docs/gsutil) tool stores modification time +with one-second precision as `goog-reserved-file-mtime` in file metadata. -Rclone will close any outstanding batches when it exits which may make -a delay on quit. +To ensure compatibility with gsutil, rclone stores modification time in 2 separate metadata entries. +`mtime` uses RFC3339 format with one-nanosecond precision. +`goog-reserved-file-mtime` uses Unix timestamp format with one-second precision. +To get modification time from object metadata, rclone reads the metadata in the following order: `mtime`, `goog-reserved-file-mtime`, object updated time. -Setting this is a great idea if you are uploading lots of small files -as it will make them a lot quicker. You can use --transfers 32 to -maximise throughput. +Note that rclone's default modify window is 1ns. +Files uploaded by gsutil only contain timestamps with one-second precision. +If you use rclone to sync files previously uploaded by gsutil, +rclone will attempt to update modification time for all these files. +To avoid these possibly unnecessary updates, use `--modify-window 1s`. +### Restricted filename characters -Properties: +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| NUL | 0x00 | ␀ | +| LF | 0x0A | ␊ | +| CR | 0x0D | ␍ | +| / | 0x2F | / | -- Config: batch_size -- Env Var: RCLONE_DROPBOX_BATCH_SIZE -- Type: int -- Default: 0 +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. -#### --dropbox-batch-timeout -Max time to allow an idle upload batch before uploading. +### Standard options -If an upload batch is idle for more than this long then it will be -uploaded. +Here are the Standard options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)). -The default for this is 0 which means rclone will choose a sensible -default based on the batch_mode in use. +#### --gcs-client-id -- batch_mode: async - default batch_timeout is 10s -- batch_mode: sync - default batch_timeout is 500ms -- batch_mode: off - not in use +OAuth Client Id. +Leave blank normally. Properties: -- Config: batch_timeout -- Env Var: RCLONE_DROPBOX_BATCH_TIMEOUT -- Type: Duration -- Default: 0s - -#### --dropbox-batch-commit-timeout - -Max time to wait for a batch to finish committing - -Properties: +- Config: client_id +- Env Var: RCLONE_GCS_CLIENT_ID +- Type: string +- Required: false -- Config: batch_commit_timeout -- Env Var: RCLONE_DROPBOX_BATCH_COMMIT_TIMEOUT -- Type: Duration -- Default: 10m0s +#### --gcs-client-secret -#### --dropbox-pacer-min-sleep +OAuth Client Secret. -Minimum time to sleep between API calls. +Leave blank normally. Properties: -- Config: pacer_min_sleep -- Env Var: RCLONE_DROPBOX_PACER_MIN_SLEEP -- Type: Duration -- Default: 10ms +- Config: client_secret +- Env Var: RCLONE_GCS_CLIENT_SECRET +- Type: string +- Required: false -#### --dropbox-encoding +#### --gcs-project-number -The encoding for the backend. +Project number. -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Optional - needed only for list/create/delete buckets - see your developer console. Properties: -- Config: encoding -- Env Var: RCLONE_DROPBOX_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot - +- Config: project_number +- Env Var: RCLONE_GCS_PROJECT_NUMBER +- Type: string +- Required: false +#### --gcs-user-project -## Limitations +User project. -Note that Dropbox is case insensitive so you can't have a file called -"Hello.doc" and one called "hello.doc". +Optional - needed only for requester pays. -There are some file names such as `thumbs.db` which Dropbox can't -store. There is a full list of them in the ["Ignored Files" section -of this document](https://www.dropbox.com/en/help/145). Rclone will -issue an error message `File name disallowed - not uploading` if it -attempts to upload one of those file names, but the sync won't fail. +Properties: -Some errors may occur if you try to sync copyright-protected files -because Dropbox has its own [copyright detector](https://techcrunch.com/2014/03/30/how-dropbox-knows-when-youre-sharing-copyrighted-stuff-without-actually-looking-at-your-stuff/) that -prevents this sort of file being downloaded. This will return the error `ERROR : -/path/to/your/file: Failed to copy: failed to open source object: -path/restricted_content/.` +- Config: user_project +- Env Var: RCLONE_GCS_USER_PROJECT +- Type: string +- Required: false -If you have more than 10,000 files in a directory then `rclone purge -dropbox:dir` will return the error `Failed to purge: There are too -many files involved in this operation`. As a work-around do an -`rclone delete dropbox:dir` followed by an `rclone rmdir dropbox:dir`. +#### --gcs-service-account-file -When using `rclone link` you'll need to set `--expire` if using a -non-personal account otherwise the visibility may not be correct. -(Note that `--expire` isn't supported on personal accounts). See the -[forum discussion](https://forum.rclone.org/t/rclone-link-dropbox-permissions/23211) and the -[dropbox SDK issue](https://github.com/dropbox/dropbox-sdk-go-unofficial/issues/75). +Service Account Credentials JSON file path. -## Get your own Dropbox App ID +Leave blank normally. +Needed only if you want use SA instead of interactive login. -When you use rclone with Dropbox in its default configuration you are using rclone's App ID. This is shared between all the rclone users. +Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. -Here is how to create your own Dropbox App ID for rclone: +Properties: -1. Log into the [Dropbox App console](https://www.dropbox.com/developers/apps/create) with your Dropbox Account (It need not -to be the same account as the Dropbox you want to access) +- Config: service_account_file +- Env Var: RCLONE_GCS_SERVICE_ACCOUNT_FILE +- Type: string +- Required: false -2. Choose an API => Usually this should be `Dropbox API` +#### --gcs-service-account-credentials -3. Choose the type of access you want to use => `Full Dropbox` or `App Folder`. If you want to use Team Folders, `Full Dropbox` is required ([see here](https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-create-team-folder-inside-my-app-s-folder/m-p/601005/highlight/true#M27911)). +Service Account Credentials JSON blob. -4. Name your App. The app name is global, so you can't use `rclone` for example +Leave blank normally. +Needed only if you want use SA instead of interactive login. -5. Click the button `Create App` +Properties: -6. Switch to the `Permissions` tab. Enable at least the following permissions: `account_info.read`, `files.metadata.write`, `files.content.write`, `files.content.read`, `sharing.write`. The `files.metadata.read` and `sharing.read` checkboxes will be marked too. Click `Submit` +- Config: service_account_credentials +- Env Var: RCLONE_GCS_SERVICE_ACCOUNT_CREDENTIALS +- Type: string +- Required: false -7. Switch to the `Settings` tab. Fill `OAuth2 - Redirect URIs` as `http://localhost:53682/` and click on `Add` +#### --gcs-anonymous -8. Find the `App key` and `App secret` values on the `Settings` tab. Use these values in rclone config to add a new remote or edit an existing remote. The `App key` setting corresponds to `client_id` in rclone config, the `App secret` corresponds to `client_secret` +Access public buckets and objects without credentials. -# Enterprise File Fabric +Set to 'true' if you just want to download files and don't configure credentials. -This backend supports [Storage Made Easy's Enterprise File -Fabric™](https://storagemadeeasy.com/about/) which provides a software -solution to integrate and unify File and Object Storage accessible -through a global file system. +Properties: -## Configuration +- Config: anonymous +- Env Var: RCLONE_GCS_ANONYMOUS +- Type: bool +- Default: false -The initial setup for the Enterprise File Fabric backend involves -getting a token from the Enterprise File Fabric which you need to -do in your browser. `rclone config` walks you through it. +#### --gcs-object-acl -Here is an example of how to make a remote called `remote`. First run: +Access Control List for new objects. - rclone config +Properties: -This will guide you through an interactive setup process: +- Config: object_acl +- Env Var: RCLONE_GCS_OBJECT_ACL +- Type: string +- Required: false +- Examples: + - "authenticatedRead" + - Object owner gets OWNER access. + - All Authenticated Users get READER access. + - "bucketOwnerFullControl" + - Object owner gets OWNER access. + - Project team owners get OWNER access. + - "bucketOwnerRead" + - Object owner gets OWNER access. + - Project team owners get READER access. + - "private" + - Object owner gets OWNER access. + - Default if left blank. + - "projectPrivate" + - Object owner gets OWNER access. + - Project team members get access according to their roles. + - "publicRead" + - Object owner gets OWNER access. + - All Users get READER access. -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> remote -Type of storage to configure. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value -[snip] -XX / Enterprise File Fabric - \ "filefabric" -[snip] -Storage> filefabric -** See help for filefabric backend at: https://rclone.org/filefabric/ ** +#### --gcs-bucket-acl -URL of the Enterprise File Fabric to connect to -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 1 / Storage Made Easy US - \ "https://storagemadeeasy.com" - 2 / Storage Made Easy EU - \ "https://eu.storagemadeeasy.com" - 3 / Connect to your Enterprise File Fabric - \ "https://yourfabric.smestorage.com" -url> https://yourfabric.smestorage.com/ -ID of the root folder -Leave blank normally. +Access Control List for new buckets. -Fill in to make rclone start with directory of a given ID. +Properties: -Enter a string value. Press Enter for the default (""). -root_folder_id> -Permanent Authentication Token +- Config: bucket_acl +- Env Var: RCLONE_GCS_BUCKET_ACL +- Type: string +- Required: false +- Examples: + - "authenticatedRead" + - Project team owners get OWNER access. + - All Authenticated Users get READER access. + - "private" + - Project team owners get OWNER access. + - Default if left blank. + - "projectPrivate" + - Project team members get access according to their roles. + - "publicRead" + - Project team owners get OWNER access. + - All Users get READER access. + - "publicReadWrite" + - Project team owners get OWNER access. + - All Users get WRITER access. -A Permanent Authentication Token can be created in the Enterprise File -Fabric, on the users Dashboard under Security, there is an entry -you'll see called "My Authentication Tokens". Click the Manage button -to create one. +#### --gcs-bucket-policy-only -These tokens are normally valid for several years. +Access checks should use bucket-level IAM policies. -For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens +If you want to upload objects to a bucket with Bucket Policy Only set +then you will need to set this. -Enter a string value. Press Enter for the default (""). -permanent_token> xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx -Edit advanced config? (y/n) -y) Yes -n) No (default) -y/n> n -Remote config --------------------- -[remote] -type = filefabric -url = https://yourfabric.smestorage.com/ -permanent_token = xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx --------------------- -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +When it is set, rclone: -Once configured you can then use `rclone` like this, +- ignores ACLs set on buckets +- ignores ACLs set on objects +- creates buckets with Bucket Policy Only set -List directories in top level of your Enterprise File Fabric +Docs: https://cloud.google.com/storage/docs/bucket-policy-only - rclone lsd remote: -List all the files in your Enterprise File Fabric +Properties: - rclone ls remote: +- Config: bucket_policy_only +- Env Var: RCLONE_GCS_BUCKET_POLICY_ONLY +- Type: bool +- Default: false -To copy a local directory to an Enterprise File Fabric directory called backup +#### --gcs-location - rclone copy /home/source remote:backup +Location for the newly created buckets. -### Modified time and hashes +Properties: -The Enterprise File Fabric allows modification times to be set on -files accurate to 1 second. These will be used to detect whether -objects need syncing or not. +- Config: location +- Env Var: RCLONE_GCS_LOCATION +- Type: string +- Required: false +- Examples: + - "" + - Empty for default location (US) + - "asia" + - Multi-regional location for Asia + - "eu" + - Multi-regional location for Europe + - "us" + - Multi-regional location for United States + - "asia-east1" + - Taiwan + - "asia-east2" + - Hong Kong + - "asia-northeast1" + - Tokyo + - "asia-northeast2" + - Osaka + - "asia-northeast3" + - Seoul + - "asia-south1" + - Mumbai + - "asia-south2" + - Delhi + - "asia-southeast1" + - Singapore + - "asia-southeast2" + - Jakarta + - "australia-southeast1" + - Sydney + - "australia-southeast2" + - Melbourne + - "europe-north1" + - Finland + - "europe-west1" + - Belgium + - "europe-west2" + - London + - "europe-west3" + - Frankfurt + - "europe-west4" + - Netherlands + - "europe-west6" + - Zürich + - "europe-central2" + - Warsaw + - "us-central1" + - Iowa + - "us-east1" + - South Carolina + - "us-east4" + - Northern Virginia + - "us-west1" + - Oregon + - "us-west2" + - California + - "us-west3" + - Salt Lake City + - "us-west4" + - Las Vegas + - "northamerica-northeast1" + - Montréal + - "northamerica-northeast2" + - Toronto + - "southamerica-east1" + - São Paulo + - "southamerica-west1" + - Santiago + - "asia1" + - Dual region: asia-northeast1 and asia-northeast2. + - "eur4" + - Dual region: europe-north1 and europe-west4. + - "nam4" + - Dual region: us-central1 and us-east1. -The Enterprise File Fabric does not support any data hashes at this time. +#### --gcs-storage-class -### Restricted filename characters +The storage class to use when storing objects in Google Cloud Storage. -The [default restricted characters set](https://rclone.org/overview/#restricted-characters) -will be replaced. +Properties: -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in JSON strings. +- Config: storage_class +- Env Var: RCLONE_GCS_STORAGE_CLASS +- Type: string +- Required: false +- Examples: + - "" + - Default + - "MULTI_REGIONAL" + - Multi-regional storage class + - "REGIONAL" + - Regional storage class + - "NEARLINE" + - Nearline storage class + - "COLDLINE" + - Coldline storage class + - "ARCHIVE" + - Archive storage class + - "DURABLE_REDUCED_AVAILABILITY" + - Durable reduced availability storage class -### Empty files +#### --gcs-env-auth -Empty files aren't supported by the Enterprise File Fabric. Rclone will therefore -upload an empty file as a single space with a mime type of -`application/vnd.rclone.empty.file` and files with that mime type are -treated as empty. +Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars). -### Root folder ID ### +Only applies if service_account_file and service_account_credentials is blank. -You can set the `root_folder_id` for rclone. This is the directory -(identified by its `Folder ID`) that rclone considers to be the root -of your Enterprise File Fabric. +Properties: -Normally you will leave this blank and rclone will determine the -correct root to use itself. +- Config: env_auth +- Env Var: RCLONE_GCS_ENV_AUTH +- Type: bool +- Default: false +- Examples: + - "false" + - Enter credentials in the next step. + - "true" + - Get GCP IAM credentials from the environment (env vars or IAM). -However you can set this to restrict rclone to a specific folder -hierarchy. +### Advanced options -In order to do this you will have to find the `Folder ID` of the -directory you wish rclone to display. These aren't displayed in the -web interface, but you can use `rclone lsf` to find them, for example +Here are the Advanced options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)). -``` -$ rclone lsf --dirs-only -Fip --csv filefabric: -120673758,Burnt PDFs/ -120673759,My Quick Uploads/ -120673755,My Syncs/ -120673756,My backups/ -120673757,My contacts/ -120673761,S3 Storage/ -``` +#### --gcs-token -The ID for "S3 Storage" would be `120673761`. +OAuth Access Token as a JSON blob. +Properties: -### Standard options +- Config: token +- Env Var: RCLONE_GCS_TOKEN +- Type: string +- Required: false -Here are the Standard options specific to filefabric (Enterprise File Fabric). +#### --gcs-auth-url -#### --filefabric-url +Auth server URL. -URL of the Enterprise File Fabric to connect to. +Leave blank to use the provider defaults. Properties: -- Config: url -- Env Var: RCLONE_FILEFABRIC_URL +- Config: auth_url +- Env Var: RCLONE_GCS_AUTH_URL - Type: string -- Required: true -- Examples: - - "https://storagemadeeasy.com" - - Storage Made Easy US - - "https://eu.storagemadeeasy.com" - - Storage Made Easy EU - - "https://yourfabric.smestorage.com" - - Connect to your Enterprise File Fabric - -#### --filefabric-root-folder-id - -ID of the root folder. +- Required: false -Leave blank normally. +#### --gcs-token-url -Fill in to make rclone start with directory of a given ID. +Token server url. +Leave blank to use the provider defaults. Properties: -- Config: root_folder_id -- Env Var: RCLONE_FILEFABRIC_ROOT_FOLDER_ID +- Config: token_url +- Env Var: RCLONE_GCS_TOKEN_URL - Type: string - Required: false -#### --filefabric-permanent-token - -Permanent Authentication Token. - -A Permanent Authentication Token can be created in the Enterprise File -Fabric, on the users Dashboard under Security, there is an entry -you'll see called "My Authentication Tokens". Click the Manage button -to create one. +#### --gcs-directory-markers -These tokens are normally valid for several years. +Upload an empty object with a trailing slash when a new directory is created -For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens +Empty folders are unsupported for bucket based remotes, this option creates an empty +object ending with "/", to persist the folder. Properties: -- Config: permanent_token -- Env Var: RCLONE_FILEFABRIC_PERMANENT_TOKEN -- Type: string -- Required: false - -### Advanced options - -Here are the Advanced options specific to filefabric (Enterprise File Fabric). - -#### --filefabric-token +- Config: directory_markers +- Env Var: RCLONE_GCS_DIRECTORY_MARKERS +- Type: bool +- Default: false -Session Token. +#### --gcs-no-check-bucket -This is a session token which rclone caches in the config file. It is -usually valid for 1 hour. +If set, don't attempt to check the bucket exists or create it. -Don't set this value - rclone will set it automatically. +This can be useful when trying to minimise the number of transactions +rclone does if you know the bucket exists already. Properties: -- Config: token -- Env Var: RCLONE_FILEFABRIC_TOKEN -- Type: string -- Required: false +- Config: no_check_bucket +- Env Var: RCLONE_GCS_NO_CHECK_BUCKET +- Type: bool +- Default: false -#### --filefabric-token-expiry +#### --gcs-decompress -Token expiry time. +If set this will decompress gzip encoded objects. -Don't set this value - rclone will set it automatically. +It is possible to upload objects to GCS with "Content-Encoding: gzip" +set. Normally rclone will download these files as compressed objects. + +If this flag is set then rclone will decompress these files with +"Content-Encoding: gzip" as they are received. This means that rclone +can't check the size and hash but the file contents will be decompressed. Properties: -- Config: token_expiry -- Env Var: RCLONE_FILEFABRIC_TOKEN_EXPIRY -- Type: string -- Required: false - -#### --filefabric-version +- Config: decompress +- Env Var: RCLONE_GCS_DECOMPRESS +- Type: bool +- Default: false -Version read from the file fabric. +#### --gcs-endpoint -Don't set this value - rclone will set it automatically. +Endpoint for the service. +Leave blank normally. Properties: -- Config: version -- Env Var: RCLONE_FILEFABRIC_VERSION +- Config: endpoint +- Env Var: RCLONE_GCS_ENDPOINT - Type: string - Required: false -#### --filefabric-encoding +#### --gcs-encoding The encoding for the backend. @@ -31002,33 +32519,38 @@ See the [encoding section in the overview](https://rclone.org/overview/#encoding Properties: - Config: encoding -- Env Var: RCLONE_FILEFABRIC_ENCODING -- Type: MultiEncoder -- Default: Slash,Del,Ctl,InvalidUtf8,Dot +- Env Var: RCLONE_GCS_ENCODING +- Type: Encoding +- Default: Slash,CrLf,InvalidUtf8,Dot -# FTP +## Limitations -FTP is the File Transfer Protocol. Rclone FTP support is provided using the -[github.com/jlaffaye/ftp](https://godoc.org/github.com/jlaffaye/ftp) -package. +`rclone about` is not supported by the Google Cloud Storage backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. -[Limitations of Rclone's FTP backend](#limitations) +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -Paths are specified as `remote:path`. If the path does not begin with -a `/` it is relative to the home directory of the user. An empty path -`remote:` refers to the user's home directory. +# Google Drive + +Paths are specified as `drive:path` + +Drive paths may be as deep as required, e.g. `drive:directory/subdirectory`. ## Configuration -To create an FTP configuration named `remote`, run +The initial setup for drive involves getting a token from Google drive +which you need to do in your browser. `rclone config` walks you +through it. - rclone config +Here is an example of how to make a remote called `remote`. First run: -Rclone config guides you through an interactive setup process. A minimal -rclone FTP remote definition only requires host, username and password. -For an anonymous FTP server, see [below](#anonymous-ftp). + rclone config + +This will guide you through an interactive setup process: ``` No remotes found, make a new one? @@ -31040,47 +32562,59 @@ q) Quit config n/r/c/s/q> n name> remote Type of storage to configure. -Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] -XX / FTP - \ "ftp" +XX / Google Drive + \ "drive" [snip] -Storage> ftp -** See help for ftp backend at: https://rclone.org/ftp/ ** - -FTP host to connect to -Enter a string value. Press Enter for the default (""). +Storage> drive +Google Application Client Id - leave blank normally. +client_id> +Google Application Client Secret - leave blank normally. +client_secret> +Scope that rclone should use when requesting access from drive. Choose a number from below, or type in your own value - 1 / Connect to ftp.example.com - \ "ftp.example.com" -host> ftp.example.com -FTP username -Enter a string value. Press Enter for the default ("$USER"). -user> -FTP port number -Enter a signed integer. Press Enter for the default (21). -port> -FTP password -y) Yes type in my own password -g) Generate random password -y/g> y -Enter the password: -password: -Confirm the password: -password: -Use FTP over TLS (Implicit) -Enter a boolean value (true or false). Press Enter for the default ("false"). -tls> -Use FTP over TLS (Explicit) -Enter a boolean value (true or false). Press Enter for the default ("false"). -explicit_tls> + 1 / Full access all files, excluding Application Data Folder. + \ "drive" + 2 / Read-only access to file metadata and file contents. + \ "drive.readonly" + / Access to files created by rclone only. + 3 | These are visible in the drive website. + | File authorization is revoked when the user deauthorizes the app. + \ "drive.file" + / Allows read and write access to the Application Data folder. + 4 | This is not visible in the drive website. + \ "drive.appfolder" + / Allows read-only access to file metadata but + 5 | does not allow any access to read or download file content. + \ "drive.metadata.readonly" +scope> 1 +Service Account Credentials JSON file path - needed only if you want use SA instead of interactive login. +service_account_file> Remote config +Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. +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 +Configure this as a Shared Drive (Team Drive)? +y) Yes +n) No +y/n> n -------------------- [remote] -type = ftp -host = ftp.example.com -pass = *** ENCRYPTED *** +client_id = +client_secret = +scope = drive +root_folder_id = +service_account_file = +token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2014-03-16T13:57:58.955387075Z"} -------------------- y) Yes this is OK e) Edit this remote @@ -31088,774 +32622,611 @@ d) Delete this remote y/e/d> y ``` -To see all directories in the home directory of `remote` - - rclone lsd remote: - -Make a new directory - - rclone mkdir remote:path/to/directory - -List the contents of a directory - - rclone ls remote:path/to/directory - -Sync `/home/local/directory` to the remote directory, deleting any -excess files in the directory. - - rclone sync --interactive /home/local/directory remote:directory - -### Anonymous FTP - -When connecting to a FTP server that allows anonymous login, you can use the -special "anonymous" username. Traditionally, this user account accepts any -string as a password, although it is common to use either the password -"anonymous" or "guest". Some servers require the use of a valid e-mail -address as password. - -Using [on-the-fly](#backend-path-to-dir) or -[connection string](https://rclone.org/docs/#connection-strings) remotes makes it easy to access -such servers, without requiring any configuration in advance. The following -are examples of that: - - rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=$(rclone obscure dummy) - rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=$(rclone obscure dummy): - -The above examples work in Linux shells and in PowerShell, but not Windows -Command Prompt. They execute the [rclone obscure](https://rclone.org/commands/rclone_obscure/) -command to create a password string in the format required by the -[pass](#ftp-pass) option. The following examples are exactly the same, except use -an already obscured string representation of the same password "dummy", and -therefore works even in Windows Command Prompt: - - rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM - rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM: - -### Implicit TLS - -Rlone FTP supports implicit FTP over TLS servers (FTPS). This has to -be enabled in the FTP backend config for the remote, or with -[`--ftp-tls`](#ftp-tls). The default FTPS port is `990`, not `21` and -can be set with [`--ftp-port`](#ftp-port). - -### Restricted filename characters - -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) -the following characters are also replaced: - -File names cannot end with the following characters. Replacement is -limited to the last character in a file name: - -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| SP | 0x20 | ␠ | - -Not all FTP servers can have all characters in file names, for example: - -| FTP Server| Forbidden characters | -| --------- |:--------------------:| -| proftpd | `*` | -| pureftpd | `\ [ ]` | - -This backend's interactive configuration wizard provides a selection of -sensible encoding settings for major FTP servers: ProFTPd, PureFTPd, VsFTPd. -Just hit a selection number when prompted. - - -### Standard options - -Here are the Standard options specific to ftp (FTP). - -#### --ftp-host - -FTP host to connect to. - -E.g. "ftp.example.com". - -Properties: - -- Config: host -- Env Var: RCLONE_FTP_HOST -- Type: string -- Required: true - -#### --ftp-user - -FTP username. - -Properties: - -- Config: user -- Env Var: RCLONE_FTP_USER -- Type: string -- Default: "$USER" - -#### --ftp-port - -FTP port number. - -Properties: - -- Config: port -- Env Var: RCLONE_FTP_PORT -- Type: int -- Default: 21 - -#### --ftp-pass - -FTP password. - -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). - -Properties: - -- Config: pass -- Env Var: RCLONE_FTP_PASS -- Type: string -- Required: false - -#### --ftp-tls - -Use Implicit FTPS (FTP over TLS). - -When using implicit FTP over TLS the client connects using TLS -right from the start which breaks compatibility with -non-TLS-aware servers. This is usually served over port 990 rather -than port 21. Cannot be used in combination with explicit FTPS. - -Properties: - -- Config: tls -- Env Var: RCLONE_FTP_TLS -- Type: bool -- Default: false - -#### --ftp-explicit-tls - -Use Explicit FTPS (FTP over TLS). - -When using explicit FTP over TLS the client explicitly requests -security from the server in order to upgrade a plain text connection -to an encrypted one. Cannot be used in combination with implicit FTPS. - -Properties: - -- Config: explicit_tls -- Env Var: RCLONE_FTP_EXPLICIT_TLS -- Type: bool -- Default: false - -### Advanced options - -Here are the Advanced options specific to ftp (FTP). - -#### --ftp-concurrency - -Maximum number of FTP simultaneous connections, 0 for unlimited. - -Note that setting this is very likely to cause deadlocks so it should -be used with care. - -If you are doing a sync or copy then make sure concurrency is one more -than the sum of `--transfers` and `--checkers`. - -If you use `--check-first` then it just needs to be one more than the -maximum of `--checkers` and `--transfers`. - -So for `concurrency 3` you'd use `--checkers 2 --transfers 2 ---check-first` or `--checkers 1 --transfers 1`. - - - -Properties: - -- Config: concurrency -- Env Var: RCLONE_FTP_CONCURRENCY -- Type: int -- Default: 0 - -#### --ftp-no-check-certificate - -Do not verify the TLS certificate of the server. +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a +machine with no Internet browser available. -Properties: +Note that rclone runs a webserver on your local machine to collect the +token as returned from Google if using web browser to automatically +authenticate. This only +runs from the moment it opens your browser to the moment you get back +the verification code. This is on `http://127.0.0.1:53682/` and it +may require you to unblock it temporarily if you are running a host +firewall, or use manual mode. -- Config: no_check_certificate -- Env Var: RCLONE_FTP_NO_CHECK_CERTIFICATE -- Type: bool -- Default: false +You can then use it like this, -#### --ftp-disable-epsv +List directories in top level of your drive -Disable using EPSV even if server advertises support. + rclone lsd remote: -Properties: +List all the files in your drive -- Config: disable_epsv -- Env Var: RCLONE_FTP_DISABLE_EPSV -- Type: bool -- Default: false + rclone ls remote: -#### --ftp-disable-mlsd +To copy a local directory to a drive directory called backup -Disable using MLSD even if server advertises support. + rclone copy /home/source remote:backup -Properties: +### Scopes -- Config: disable_mlsd -- Env Var: RCLONE_FTP_DISABLE_MLSD -- Type: bool -- Default: false +Rclone allows you to select which scope you would like for rclone to +use. This changes what type of token is granted to rclone. [The +scopes are defined +here](https://developers.google.com/drive/v3/web/about-auth). -#### --ftp-disable-utf8 +A comma-separated list is allowed e.g. `drive.readonly,drive.file`. -Disable using UTF-8 even if server advertises support. +The scope are -Properties: +#### drive -- Config: disable_utf8 -- Env Var: RCLONE_FTP_DISABLE_UTF8 -- Type: bool -- Default: false +This is the default scope and allows full access to all files, except +for the Application Data Folder (see below). -#### --ftp-writing-mdtm +Choose this one if you aren't sure. -Use MDTM to set modification time (VsFtpd quirk) +#### drive.readonly -Properties: +This allows read only access to all files. Files may be listed and +downloaded but not uploaded, renamed or deleted. -- Config: writing_mdtm -- Env Var: RCLONE_FTP_WRITING_MDTM -- Type: bool -- Default: false +#### drive.file -#### --ftp-force-list-hidden +With this scope rclone can read/view/modify only those files and +folders it creates. -Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD. +So if you uploaded files to drive via the web interface (or any other +means) they will not be visible to rclone. -Properties: +This can be useful if you are using rclone to backup data and you want +to be sure confidential data on your drive is not visible to rclone. -- Config: force_list_hidden -- Env Var: RCLONE_FTP_FORCE_LIST_HIDDEN -- Type: bool -- Default: false +Files created with this scope are visible in the web interface. -#### --ftp-idle-timeout +#### drive.appfolder -Max time before closing idle connections. +This gives rclone its own private area to store files. Rclone will +not be able to see any other files on your drive and you won't be able +to see rclone's files from the web interface either. -If no connections have been returned to the connection pool in the time -given, rclone will empty the connection pool. +#### drive.metadata.readonly -Set to 0 to keep connections indefinitely. +This allows read only access to file names only. It does not allow +rclone to download or upload data, or rename or delete files or +directories. +### Root folder ID -Properties: +This option has been moved to the advanced section. You can set the `root_folder_id` for rclone. This is the directory +(identified by its `Folder ID`) that rclone considers to be the root +of your drive. -- Config: idle_timeout -- Env Var: RCLONE_FTP_IDLE_TIMEOUT -- Type: Duration -- Default: 1m0s +Normally you will leave this blank and rclone will determine the +correct root to use itself. -#### --ftp-close-timeout +However you can set this to restrict rclone to a specific folder +hierarchy or to access data within the "Computers" tab on the drive +web interface (where files from Google's Backup and Sync desktop +program go). -Maximum time to wait for a response to close. +In order to do this you will have to find the `Folder ID` of the +directory you wish rclone to display. This will be the last segment +of the URL when you open the relevant folder in the drive web +interface. -Properties: +So if the folder you want rclone to use has a URL which looks like +`https://drive.google.com/drive/folders/1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh` +in the browser, then you use `1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh` as +the `root_folder_id` in the config. -- Config: close_timeout -- Env Var: RCLONE_FTP_CLOSE_TIMEOUT -- Type: Duration -- Default: 1m0s +**NB** folders under the "Computers" tab seem to be read only (drive +gives a 500 error) when using rclone. -#### --ftp-tls-cache-size +There doesn't appear to be an API to discover the folder IDs of the +"Computers" tab - please contact us if you know otherwise! -Size of TLS session cache for all control and data connections. +Note also that rclone can't access any data under the "Backups" tab on +the google drive web interface yet. -TLS cache allows to resume TLS sessions and reuse PSK between connections. -Increase if default size is not enough resulting in TLS resumption errors. -Enabled by default. Use 0 to disable. +### Service Account support -Properties: +You can set up rclone with Google Drive in an unattended mode, +i.e. not tied to a specific end-user Google account. This is useful +when you want to synchronise files onto machines that don't have +actively logged-in users, for example build machines. -- Config: tls_cache_size -- Env Var: RCLONE_FTP_TLS_CACHE_SIZE -- Type: int -- Default: 32 +To use a Service Account instead of OAuth2 token flow, enter the path +to your Service Account credentials at the `service_account_file` +prompt during `rclone config` and rclone won't use the browser based +authentication flow. If you'd rather stuff the contents of the +credentials file into the rclone config file, you can set +`service_account_credentials` with the actual contents of the file +instead, or set the equivalent environment variable. -#### --ftp-disable-tls13 +#### Use case - Google Apps/G-suite account and individual Drive -Disable TLS 1.3 (workaround for FTP servers with buggy TLS) +Let's say that you are the administrator of a Google Apps (old) or +G-suite account. +The goal is to store data on an individual's Drive account, who IS +a member of the domain. +We'll call the domain **example.com**, and the user +**foo@example.com**. -Properties: +There's a few steps we need to go through to accomplish this: -- Config: disable_tls13 -- Env Var: RCLONE_FTP_DISABLE_TLS13 -- Type: bool -- Default: false +##### 1. Create a service account for example.com + - To create a service account and obtain its credentials, go to the +[Google Developer Console](https://console.developers.google.com). + - You must have a project - create one if you don't. + - Then go to "IAM & admin" -> "Service Accounts". + - Use the "Create Service Account" button. Fill in "Service account name" +and "Service account ID" with something that identifies your client. + - Select "Create And Continue". Step 2 and 3 are optional. + - These credentials are what rclone will use for authentication. +If you ever need to remove access, press the "Delete service +account key" button. -#### --ftp-shut-timeout +##### 2. Allowing API access to example.com Google Drive + - Go to example.com's admin console + - Go into "Security" (or use the search bar) + - Select "Show more" and then "Advanced settings" + - Select "Manage API client access" in the "Authentication" section + - In the "Client Name" field enter the service account's +"Client ID" - this can be found in the Developer Console under +"IAM & Admin" -> "Service Accounts", then "View Client ID" for +the newly created service account. +It is a ~21 character numerical string. + - In the next field, "One or More API Scopes", enter +`https://www.googleapis.com/auth/drive` +to grant access to Google Drive specifically. -Maximum time to wait for data connection closing status. +##### 3. Configure rclone, assuming a new install -Properties: +``` +rclone config -- Config: shut_timeout -- Env Var: RCLONE_FTP_SHUT_TIMEOUT -- Type: Duration -- Default: 1m0s +n/s/q> n # New +name>gdrive # Gdrive is an example name +Storage> # Select the number shown for Google Drive +client_id> # Can be left blank +client_secret> # Can be left blank +scope> # Select your scope, 1 for example +root_folder_id> # Can be left blank +service_account_file> /home/foo/myJSONfile.json # This is where the JSON file goes! +y/n> # Auto config, n -#### --ftp-ask-password +``` -Allow asking for FTP password when needed. +##### 4. Verify that it's working + - `rclone -v --drive-impersonate foo@example.com lsf gdrive:backup` + - The arguments do: + - `-v` - verbose logging + - `--drive-impersonate foo@example.com` - this is what does +the magic, pretending to be user foo. + - `lsf` - list files in a parsing friendly way + - `gdrive:backup` - use the remote called gdrive, work in +the folder named backup. -If this is set and no password is supplied then rclone will ask for a password +Note: in case you configured a specific root folder on gdrive and rclone is unable to access the contents of that folder when using `--drive-impersonate`, do this instead: + - in the gdrive web interface, share your root folder with the user/email of the new Service Account you created/selected at step #1 + - use rclone without specifying the `--drive-impersonate` option, like this: + `rclone -v lsf gdrive:backup` -Properties: +### Shared drives (team drives) -- Config: ask_password -- Env Var: RCLONE_FTP_ASK_PASSWORD -- Type: bool -- Default: false +If you want to configure the remote to point to a Google Shared Drive +(previously known as Team Drives) then answer `y` to the question +`Configure this as a Shared Drive (Team Drive)?`. -#### --ftp-socks-proxy +This will fetch the list of Shared Drives from google and allow you to +configure which one you want to use. You can also type in a Shared +Drive ID if you prefer. -Socks 5 proxy host. - - Supports the format user:pass@host:port, user@host:port, host:port. - - Example: - - myUser:myPass@localhost:9005 - +For example: -Properties: +``` +Configure this as a Shared Drive (Team Drive)? +y) Yes +n) No +y/n> y +Fetching Shared Drive list... +Choose a number from below, or type in your own value + 1 / Rclone Test + \ "xxxxxxxxxxxxxxxxxxxx" + 2 / Rclone Test 2 + \ "yyyyyyyyyyyyyyyyyyyy" + 3 / Rclone Test 3 + \ "zzzzzzzzzzzzzzzzzzzz" +Enter a Shared Drive ID> 1 +-------------------- +[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} +team_drive = xxxxxxxxxxxxxxxxxxxx +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -- Config: socks_proxy -- Env Var: RCLONE_FTP_SOCKS_PROXY -- Type: string -- Required: false +### --fast-list -#### --ftp-encoding +This remote supports `--fast-list` which allows you to use fewer +transactions in exchange for more memory. See the [rclone +docs](https://rclone.org/docs/#fast-list) for more details. -The encoding for the backend. +It does this by combining multiple `list` calls into a single API request. -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +This works by combining many `'%s' in parents` filters into one expression. +To list the contents of directories a, b and c, the following requests will be send by the regular `List` function: +``` +trashed=false and 'a' in parents +trashed=false and 'b' in parents +trashed=false and 'c' in parents +``` +These can now be combined into a single request: +``` +trashed=false and ('a' in parents or 'b' in parents or 'c' in parents) +``` -Properties: +The implementation of `ListR` will put up to 50 `parents` filters into one request. +It will use the `--checkers` value to specify the number of requests to run in parallel. -- Config: encoding -- Env Var: RCLONE_FTP_ENCODING -- Type: MultiEncoder -- Default: Slash,Del,Ctl,RightSpace,Dot -- Examples: - - "Asterisk,Ctl,Dot,Slash" - - ProFTPd can't handle '*' in file names - - "BackSlash,Ctl,Del,Dot,RightSpace,Slash,SquareBracket" - - PureFTPd can't handle '[]' or '*' in file names - - "Ctl,LeftPeriod,Slash" - - VsFTPd can't handle file names starting with dot +In tests, these batch requests were up to 20x faster than the regular method. +Running the following command against different sized folders gives: +``` +rclone lsjson -vv -R --checkers=6 gdrive:folder +``` +small folder (220 directories, 700 files): +- without `--fast-list`: 38s +- with `--fast-list`: 10s -## Limitations +large folder (10600 directories, 39000 files): -FTP servers acting as rclone remotes must support `passive` mode. -The mode cannot be configured as `passive` is the only supported one. -Rclone's FTP implementation is not compatible with `active` mode -as [the library it uses doesn't support it](https://github.com/jlaffaye/ftp/issues/29). -This will likely never be supported due to security concerns. +- without `--fast-list`: 22:05 min +- with `--fast-list`: 58s -Rclone's FTP backend does not support any checksums but can compare -file sizes. +### Modification times and hashes -`rclone about` is not supported by the FTP backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. +Google drive stores modification times accurate to 1 ms. -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) +Hash algorithms MD5, SHA1 and SHA256 are supported. Note, however, +that a small fraction of files uploaded may not have SHA1 or SHA256 +hashes especially if they were uploaded before 2018. -The implementation of : `--dump headers`, -`--dump bodies`, `--dump auth` for debugging isn't the same as -for rclone HTTP based backends - it has less fine grained control. +### Restricted filename characters -`--timeout` isn't supported (but `--contimeout` is). +Only Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. -`--bind` isn't supported. +In contrast to other backends, `/` can also be used in names and `.` +or `..` are valid names. -Rclone's FTP backend could support server-side move but does not -at present. +### Revisions -The `ftp_proxy` environment variable is not currently supported. +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. -#### Modified time +Revisions follow the standard google policy which at time of writing +was -File modification time (timestamps) is supported to 1 second resolution -for major FTP servers: ProFTPd, PureFTPd, VsFTPd, and FileZilla FTP server. -The `VsFTPd` server has non-standard implementation of time related protocol -commands and needs a special configuration setting: `writing_mdtm = true`. + * They are deleted after 30 days or 100 revisions (whatever comes first). + * They do not count towards a user storage quota. -Support for precise file time with other FTP servers varies depending on what -protocol extensions they advertise. If all the `MLSD`, `MDTM` and `MFTM` -extensions are present, rclone will use them together to provide precise time. -Otherwise the times you see on the FTP server through rclone are those of the -last file upload. +### Deleting files -You can use the following command to check whether rclone can use precise time -with your FTP server: `rclone backend features your_ftp_remote:` (the trailing -colon is important). Look for the number in the line tagged by `Precision` -designating the remote time precision expressed as nanoseconds. A value of -`1000000000` means that file time precision of 1 second is available. -A value of `3153600000000000000` (or another large number) means "unsupported". +By default rclone will send all files to the trash when deleting +files. If deleting them permanently is required then use the +`--drive-use-trash=false` flag, or set the equivalent environment +variable. -# Google Cloud Storage +### Shortcuts -Paths are specified as `remote:bucket` (or `remote:` for the `lsd` -command.) You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`. +In March 2020 Google introduced a new feature in Google Drive called +[drive shortcuts](https://support.google.com/drive/answer/9700156) +([API](https://developers.google.com/drive/api/v3/shortcuts)). These +will (by September 2020) [replace the ability for files or folders to +be in multiple folders at once](https://cloud.google.com/blog/products/g-suite/simplifying-google-drives-folder-structure-and-sharing-models). -## Configuration +Shortcuts are files that link to other files on Google Drive somewhat +like a symlink in unix, except they point to the underlying file data +(e.g. the inode in unix terms) so they don't break if the source is +renamed or moved about. -The initial setup for google cloud storage involves getting a token from Google Cloud Storage -which you need to do in your browser. `rclone config` walks you -through it. +By default rclone treats these as follows. -Here is an example of how to make a remote called `remote`. First run: +For shortcuts pointing to files: - rclone config +- When listing a file shortcut appears as the destination file. +- When downloading the contents of the destination file is downloaded. +- When updating shortcut file with a non shortcut file, the shortcut is removed then a new file is uploaded in place of the shortcut. +- When server-side moving (renaming) the shortcut is renamed, not the destination file. +- When server-side copying the shortcut is copied, not the contents of the shortcut. (unless `--drive-copy-shortcut-content` is in use in which case the contents of the shortcut gets copied). +- When deleting the shortcut is deleted not the linked file. +- When setting the modification time, the modification time of the linked file will be set. -This will guide you through an interactive setup process: +For shortcuts pointing to folders: -``` -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 -[snip] -XX / Google Cloud Storage (this is not Google Drive) - \ "google cloud storage" -[snip] -Storage> google cloud storage -Google Application Client Id - leave blank normally. -client_id> -Google Application Client Secret - leave blank normally. -client_secret> -Project number optional - needed only for list/create/delete buckets - see your developer console. -project_number> 12345678 -Service Account Credentials JSON file path - needed only if you want use SA instead of interactive login. -service_account_file> -Access Control List for new objects. -Choose a number from below, or type in your own value - 1 / Object owner gets OWNER access, and all Authenticated Users get READER access. - \ "authenticatedRead" - 2 / Object owner gets OWNER access, and project team owners get OWNER access. - \ "bucketOwnerFullControl" - 3 / Object owner gets OWNER access, and project team owners get READER access. - \ "bucketOwnerRead" - 4 / Object owner gets OWNER access [default if left blank]. - \ "private" - 5 / Object owner gets OWNER access, and project team members get access according to their roles. - \ "projectPrivate" - 6 / Object owner gets OWNER access, and all Users get READER access. - \ "publicRead" -object_acl> 4 -Access Control List for new buckets. -Choose a number from below, or type in your own value - 1 / Project team owners get OWNER access, and all Authenticated Users get READER access. - \ "authenticatedRead" - 2 / Project team owners get OWNER access [default if left blank]. - \ "private" - 3 / Project team members get access according to their roles. - \ "projectPrivate" - 4 / Project team owners get OWNER access, and all Users get READER access. - \ "publicRead" - 5 / Project team owners get OWNER access, and all Users get WRITER access. - \ "publicReadWrite" -bucket_acl> 2 -Location for the newly created buckets. -Choose a number from below, or type in your own value - 1 / Empty for default location (US). - \ "" - 2 / Multi-regional location for Asia. - \ "asia" - 3 / Multi-regional location for Europe. - \ "eu" - 4 / Multi-regional location for United States. - \ "us" - 5 / Taiwan. - \ "asia-east1" - 6 / Tokyo. - \ "asia-northeast1" - 7 / Singapore. - \ "asia-southeast1" - 8 / Sydney. - \ "australia-southeast1" - 9 / Belgium. - \ "europe-west1" -10 / London. - \ "europe-west2" -11 / Iowa. - \ "us-central1" -12 / South Carolina. - \ "us-east1" -13 / Northern Virginia. - \ "us-east4" -14 / Oregon. - \ "us-west1" -location> 12 -The storage class to use when storing objects in Google Cloud Storage. -Choose a number from below, or type in your own value - 1 / Default - \ "" - 2 / Multi-regional storage class - \ "MULTI_REGIONAL" - 3 / Regional storage class - \ "REGIONAL" - 4 / Nearline storage class - \ "NEARLINE" - 5 / Coldline storage class - \ "COLDLINE" - 6 / Durable reduced availability storage class - \ "DURABLE_REDUCED_AVAILABILITY" -storage_class> 5 -Remote config -Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. -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] -type = google cloud storage -client_id = -client_secret = -token = {"AccessToken":"xxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","RefreshToken":"x/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxx","Expiry":"2014-07-17T20:49:14.929208288+01:00","Extra":null} -project_number = 12345678 -object_acl = private -bucket_acl = private --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +- When listing the shortcut appears as a folder and that folder will contain the contents of the linked folder appear (including any sub folders) +- When downloading the contents of the linked folder and sub contents are downloaded +- When uploading to a shortcut folder the file will be placed in the linked folder +- When server-side moving (renaming) the shortcut is renamed, not the destination folder +- When server-side copying the contents of the linked folder is copied, not the shortcut. +- When deleting with `rclone rmdir` or `rclone purge` the shortcut is deleted not the linked folder. +- **NB** When deleting with `rclone remove` or `rclone mount` the contents of the linked folder will be deleted. -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a -machine with no Internet browser available. +The [rclone backend](https://rclone.org/commands/rclone_backend/) command can be used to create shortcuts. -Note that rclone runs a webserver on your local machine to collect the -token as returned from Google if using web browser to automatically -authenticate. This only -runs from the moment it opens your browser to the moment you get back -the verification code. This is on `http://127.0.0.1:53682/` and this -it may require you to unblock it temporarily if you are running a host -firewall, or use manual mode. +Shortcuts can be completely ignored with the `--drive-skip-shortcuts` flag +or the corresponding `skip_shortcuts` configuration setting. -This remote is called `remote` and can now be used like this +### Emptying trash -See all the buckets in your project +If you wish to empty your trash you can use the `rclone cleanup remote:` +command which will permanently delete all your trashed files. This command +does not take any path arguments. - rclone lsd remote: +Note that Google Drive takes some time (minutes to days) to empty the +trash even though the command returns within a few seconds. No output +is echoed, so there will be no confirmation even using -v or -vv. -Make a new bucket +### Quota information - rclone mkdir remote:bucket +To view your current quota you can use the `rclone about remote:` +command which will display your usage limit (quota), the usage in Google +Drive, the size of all files in the Trash and the space used by other +Google services such as Gmail. This command does not take any path +arguments. -List the contents of a bucket +#### Import/Export of google documents - rclone ls remote:bucket +Google documents can be exported from and uploaded to Google Drive. -Sync `/home/local/directory` to the remote bucket, deleting any excess -files in the bucket. +When rclone downloads a Google doc it chooses a format to download +depending upon the `--drive-export-formats` setting. +By default the export formats are `docx,xlsx,pptx,svg` which are a +sensible default for an editable document. - rclone sync --interactive /home/local/directory remote:bucket +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. -### Service Account support +If you prefer an archive copy then you might use `--drive-export-formats +pdf`, or if you prefer openoffice/libreoffice formats you might use +`--drive-export-formats ods,odt,odp`. -You can set up rclone with Google Cloud Storage in an unattended mode, -i.e. not tied to a specific end-user Google account. This is useful -when you want to synchronise files onto machines that don't have -actively logged-in users, for example build machines. +Note that rclone adds the extension to the google doc, so if it is +called `My Spreadsheet` on google docs, it will be exported as `My +Spreadsheet.xlsx` or `My Spreadsheet.pdf` etc. -To get credentials for Google Cloud Platform -[IAM Service Accounts](https://cloud.google.com/iam/docs/service-accounts), -please head to the -[Service Account](https://console.cloud.google.com/permissions/serviceaccounts) -section of the Google Developer Console. Service Accounts behave just -like normal `User` permissions in -[Google Cloud Storage ACLs](https://cloud.google.com/storage/docs/access-control), -so you can limit their access (e.g. make them read only). After -creating an account, a JSON file containing the Service Account's -credentials will be downloaded onto your machines. These credentials -are what rclone will use for authentication. +When importing files into Google Drive, rclone will convert all +files with an extension in `--drive-import-formats` to their +associated document type. +rclone will not convert any files by default, since the conversion +is lossy process. -To use a Service Account instead of OAuth2 token flow, enter the path -to your Service Account credentials at the `service_account_file` -prompt and rclone won't use the browser based authentication -flow. If you'd rather stuff the contents of the credentials file into -the rclone config file, you can set `service_account_credentials` with -the actual contents of the file instead, or set the equivalent -environment variable. +The conversion must result in a file with the same extension when +the `--drive-export-formats` rules are applied to the uploaded document. -### Anonymous Access +Here are some examples for allowed and prohibited conversions. -For downloads of objects that permit public access you can configure rclone -to use anonymous access by setting `anonymous` to `true`. -With unauthorized access you can't write or create files but only read or list -those buckets and objects that have public read access. +| export-formats | import-formats | Upload Ext | Document Ext | Allowed | +| -------------- | -------------- | ---------- | ------------ | ------- | +| odt | odt | odt | odt | Yes | +| odt | docx,odt | odt | odt | Yes | +| | docx | docx | docx | Yes | +| | odt | odt | docx | No | +| odt,docx | docx,odt | docx | odt | No | +| docx,odt | docx,odt | docx | docx | Yes | +| docx,odt | docx,odt | odt | docx | No | -### Application Default Credentials +This limitation can be disabled by specifying `--drive-allow-import-name-change`. +When using this flag, rclone can convert multiple files types resulting +in the same document type at once, e.g. with `--drive-import-formats docx,odt,txt`, +all files having these extension would result in a document represented as a docx file. +This brings the additional risk of overwriting a document, if multiple files +have the same stem. Many rclone operations will not handle this name change +in any way. They assume an equal name when copying files and might copy the +file again or delete them when the name changes. -If no other source of credentials is provided, rclone will fall back -to -[Application Default Credentials](https://cloud.google.com/video-intelligence/docs/common/auth#authenticating_with_application_default_credentials) -this is useful both when you already have configured authentication -for your developer account, or in production when running on a google -compute host. Note that if running in docker, you may need to run -additional commands on your google compute machine - -[see this page](https://cloud.google.com/container-registry/docs/advanced-authentication#gcloud_as_a_docker_credential_helper). +Here are the possible export extensions with their corresponding mime types. +Most of these can also be used for importing, but there more that are not +listed here. Some of these additional ones might only be available when +the operating system provides the correct MIME type entries. -Note that in the case application default credentials are used, there -is no need to explicitly configure a project number. +This list can be changed by Google Drive at any time and might not +represent the currently available conversions. -### --fast-list +| Extension | Mime Type | Description | +| --------- |-----------| ------------| +| bmp | image/bmp | Windows Bitmap format | +| csv | text/csv | Standard CSV format for Spreadsheets | +| doc | application/msword | Classic Word file | +| docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document | Microsoft Office Document | +| epub | application/epub+zip | E-book format | +| html | text/html | An HTML Document | +| jpg | image/jpeg | A JPEG Image File | +| json | application/vnd.google-apps.script+json | JSON Text Format for Google Apps scripts | +| odp | application/vnd.oasis.opendocument.presentation | Openoffice Presentation | +| ods | application/vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet | +| ods | application/x-vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet | +| odt | application/vnd.oasis.opendocument.text | Openoffice Document | +| pdf | application/pdf | Adobe PDF Format | +| pjpeg | image/pjpeg | Progressive JPEG Image | +| png | image/png | PNG Image Format| +| pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation | Microsoft Office Powerpoint | +| rtf | application/rtf | Rich Text Format | +| svg | image/svg+xml | Scalable Vector Graphics Format | +| tsv | text/tab-separated-values | Standard TSV format for spreadsheets | +| txt | text/plain | Plain Text | +| wmf | application/x-msmetafile | Windows Meta File | +| xls | application/vnd.ms-excel | Classic Excel file | +| xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | Microsoft Office Spreadsheet | +| zip | application/zip | A ZIP file of HTML, Images CSS | -This remote supports `--fast-list` which allows you to use fewer -transactions in exchange for more memory. See the [rclone -docs](https://rclone.org/docs/#fast-list) for more details. +Google documents can also be exported as link files. These files will +open a browser window for the Google Docs website of that document +when opened. The link file extension has to be specified as a +`--drive-export-formats` parameter. They will match all available +Google Documents. -### Custom upload headers +| Extension | Description | OS Support | +| --------- | ----------- | ---------- | +| desktop | freedesktop.org specified desktop entry | Linux | +| link.html | An HTML Document with a redirect | All | +| url | INI style link file | macOS, Windows | +| webloc | macOS specific XML format | macOS | -You can set custom upload headers with the `--header-upload` -flag. Google Cloud Storage supports the headers as described in the -[working with metadata documentation](https://cloud.google.com/storage/docs/gsutil/addlhelp/WorkingWithObjectMetadata) -- Cache-Control -- Content-Disposition -- Content-Encoding -- Content-Language -- Content-Type -- X-Goog-Storage-Class -- X-Goog-Meta- +### Standard options -Eg `--header-upload "Content-Type text/potato"` +Here are the Standard options specific to drive (Google Drive). -Note that the last of these is for setting custom metadata in the form -`--header-upload "x-goog-meta-key: value"` +#### --drive-client-id -### Modification time +Google Application Client Id +Setting your own is recommended. +See https://rclone.org/drive/#making-your-own-client-id for how to create your own. +If you leave this blank, it will use an internal key which is low performance. -Google Cloud Storage stores md5sum natively. -Google's [gsutil](https://cloud.google.com/storage/docs/gsutil) tool stores modification time -with one-second precision as `goog-reserved-file-mtime` in file metadata. +Properties: -To ensure compatibility with gsutil, rclone stores modification time in 2 separate metadata entries. -`mtime` uses RFC3339 format with one-nanosecond precision. -`goog-reserved-file-mtime` uses Unix timestamp format with one-second precision. -To get modification time from object metadata, rclone reads the metadata in the following order: `mtime`, `goog-reserved-file-mtime`, object updated time. +- Config: client_id +- Env Var: RCLONE_DRIVE_CLIENT_ID +- Type: string +- Required: false -Note that rclone's default modify window is 1ns. -Files uploaded by gsutil only contain timestamps with one-second precision. -If you use rclone to sync files previously uploaded by gsutil, -rclone will attempt to update modification time for all these files. -To avoid these possibly unnecessary updates, use `--modify-window 1s`. +#### --drive-client-secret -### Restricted filename characters +OAuth Client Secret. -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| NUL | 0x00 | ␀ | -| LF | 0x0A | ␊ | -| CR | 0x0D | ␍ | -| / | 0x2F | / | +Leave blank normally. -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in JSON strings. +Properties: +- Config: client_secret +- Env Var: RCLONE_DRIVE_CLIENT_SECRET +- Type: string +- Required: false -### Standard options +#### --drive-scope -Here are the Standard options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)). +Comma separated list of scopes that rclone should use when requesting access from drive. -#### --gcs-client-id +Properties: -OAuth Client Id. +- Config: scope +- Env Var: RCLONE_DRIVE_SCOPE +- Type: string +- Required: false +- Examples: + - "drive" + - Full access all files, excluding Application Data Folder. + - "drive.readonly" + - Read-only access to file metadata and file contents. + - "drive.file" + - Access to files created by rclone only. + - These are visible in the drive website. + - File authorization is revoked when the user deauthorizes the app. + - "drive.appfolder" + - Allows read and write access to the Application Data folder. + - This is not visible in the drive website. + - "drive.metadata.readonly" + - Allows read-only access to file metadata but + - does not allow any access to read or download file content. + +#### --drive-service-account-file + +Service Account Credentials JSON file path. Leave blank normally. +Needed only if you want use SA instead of interactive login. + +Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. Properties: -- Config: client_id -- Env Var: RCLONE_GCS_CLIENT_ID +- Config: service_account_file +- Env Var: RCLONE_DRIVE_SERVICE_ACCOUNT_FILE - Type: string - Required: false -#### --gcs-client-secret +#### --drive-alternate-export -OAuth Client Secret. +Deprecated: No longer needed. -Leave blank normally. +Properties: + +- Config: alternate_export +- Env Var: RCLONE_DRIVE_ALTERNATE_EXPORT +- Type: bool +- Default: false + +### Advanced options + +Here are the Advanced options specific to drive (Google Drive). + +#### --drive-token + +OAuth Access Token as a JSON blob. Properties: -- Config: client_secret -- Env Var: RCLONE_GCS_CLIENT_SECRET +- Config: token +- Env Var: RCLONE_DRIVE_TOKEN - Type: string - Required: false -#### --gcs-project-number +#### --drive-auth-url -Project number. +Auth server URL. -Optional - needed only for list/create/delete buckets - see your developer console. +Leave blank to use the provider defaults. Properties: -- Config: project_number -- Env Var: RCLONE_GCS_PROJECT_NUMBER +- Config: auth_url +- Env Var: RCLONE_DRIVE_AUTH_URL - Type: string - Required: false -#### --gcs-user-project +#### --drive-token-url -User project. +Token server url. -Optional - needed only for requester pays. +Leave blank to use the provider defaults. Properties: -- Config: user_project -- Env Var: RCLONE_GCS_USER_PROJECT +- Config: token_url +- Env Var: RCLONE_DRIVE_TOKEN_URL - Type: string - Required: false -#### --gcs-service-account-file - -Service Account Credentials JSON file path. +#### --drive-root-folder-id +ID of the root folder. Leave blank normally. -Needed only if you want use SA instead of interactive login. -Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. +Fill in to access "Computers" folders (see docs), or for rclone to use +a non root folder as its starting point. + Properties: -- Config: service_account_file -- Env Var: RCLONE_GCS_SERVICE_ACCOUNT_FILE +- Config: root_folder_id +- Env Var: RCLONE_DRIVE_ROOT_FOLDER_ID - Type: string - Required: false -#### --gcs-service-account-credentials +#### --drive-service-account-credentials Service Account Credentials JSON blob. @@ -31865,1978 +33236,1962 @@ Needed only if you want use SA instead of interactive login. Properties: - Config: service_account_credentials -- Env Var: RCLONE_GCS_SERVICE_ACCOUNT_CREDENTIALS +- Env Var: RCLONE_DRIVE_SERVICE_ACCOUNT_CREDENTIALS - Type: string - Required: false -#### --gcs-anonymous +#### --drive-team-drive -Access public buckets and objects without credentials. +ID of the Shared Drive (Team Drive). -Set to 'true' if you just want to download files and don't configure credentials. +Properties: + +- Config: team_drive +- Env Var: RCLONE_DRIVE_TEAM_DRIVE +- Type: string +- Required: false + +#### --drive-auth-owner-only + +Only consider files owned by the authenticated user. Properties: -- Config: anonymous -- Env Var: RCLONE_GCS_ANONYMOUS +- Config: auth_owner_only +- Env Var: RCLONE_DRIVE_AUTH_OWNER_ONLY - Type: bool - Default: false -#### --gcs-object-acl +#### --drive-use-trash -Access Control List for new objects. +Send files to the trash instead of deleting permanently. + +Defaults to true, namely sending files to the trash. +Use `--drive-use-trash=false` to delete files permanently instead. Properties: -- Config: object_acl -- Env Var: RCLONE_GCS_OBJECT_ACL -- Type: string -- Required: false -- Examples: - - "authenticatedRead" - - Object owner gets OWNER access. - - All Authenticated Users get READER access. - - "bucketOwnerFullControl" - - Object owner gets OWNER access. - - Project team owners get OWNER access. - - "bucketOwnerRead" - - Object owner gets OWNER access. - - Project team owners get READER access. - - "private" - - Object owner gets OWNER access. - - Default if left blank. - - "projectPrivate" - - Object owner gets OWNER access. - - Project team members get access according to their roles. - - "publicRead" - - Object owner gets OWNER access. - - All Users get READER access. +- Config: use_trash +- Env Var: RCLONE_DRIVE_USE_TRASH +- Type: bool +- Default: true -#### --gcs-bucket-acl +#### --drive-copy-shortcut-content -Access Control List for new buckets. +Server side copy contents of shortcuts instead of the shortcut. + +When doing server side copies, normally rclone will copy shortcuts as +shortcuts. + +If this flag is used then rclone will copy the contents of shortcuts +rather than shortcuts themselves when doing server side copies. Properties: -- Config: bucket_acl -- Env Var: RCLONE_GCS_BUCKET_ACL -- Type: string -- Required: false -- Examples: - - "authenticatedRead" - - Project team owners get OWNER access. - - All Authenticated Users get READER access. - - "private" - - Project team owners get OWNER access. - - Default if left blank. - - "projectPrivate" - - Project team members get access according to their roles. - - "publicRead" - - Project team owners get OWNER access. - - All Users get READER access. - - "publicReadWrite" - - Project team owners get OWNER access. - - All Users get WRITER access. +- Config: copy_shortcut_content +- Env Var: RCLONE_DRIVE_COPY_SHORTCUT_CONTENT +- Type: bool +- Default: false -#### --gcs-bucket-policy-only +#### --drive-skip-gdocs -Access checks should use bucket-level IAM policies. +Skip google documents in all listings. -If you want to upload objects to a bucket with Bucket Policy Only set -then you will need to set this. +If given, gdocs practically become invisible to rclone. -When it is set, rclone: +Properties: -- ignores ACLs set on buckets -- ignores ACLs set on objects -- creates buckets with Bucket Policy Only set +- Config: skip_gdocs +- Env Var: RCLONE_DRIVE_SKIP_GDOCS +- Type: bool +- Default: false -Docs: https://cloud.google.com/storage/docs/bucket-policy-only +#### --drive-show-all-gdocs + +Show all Google Docs including non-exportable ones in listings. + +If you try a server side copy on a Google Form without this flag, you +will get this error: + + No export formats found for "application/vnd.google-apps.form" + +However adding this flag will allow the form to be server side copied. + +Note that rclone doesn't add extensions to the Google Docs file names +in this mode. + +Do **not** use this flag when trying to download Google Docs - rclone +will fail to download them. Properties: -- Config: bucket_policy_only -- Env Var: RCLONE_GCS_BUCKET_POLICY_ONLY +- Config: show_all_gdocs +- Env Var: RCLONE_DRIVE_SHOW_ALL_GDOCS - Type: bool - Default: false -#### --gcs-location - -Location for the newly created buckets. +#### --drive-skip-checksum-gphotos -Properties: +Skip checksums on Google photos and videos only. -- Config: location -- Env Var: RCLONE_GCS_LOCATION -- Type: string -- Required: false -- Examples: - - "" - - Empty for default location (US) - - "asia" - - Multi-regional location for Asia - - "eu" - - Multi-regional location for Europe - - "us" - - Multi-regional location for United States - - "asia-east1" - - Taiwan - - "asia-east2" - - Hong Kong - - "asia-northeast1" - - Tokyo - - "asia-northeast2" - - Osaka - - "asia-northeast3" - - Seoul - - "asia-south1" - - Mumbai - - "asia-south2" - - Delhi - - "asia-southeast1" - - Singapore - - "asia-southeast2" - - Jakarta - - "australia-southeast1" - - Sydney - - "australia-southeast2" - - Melbourne - - "europe-north1" - - Finland - - "europe-west1" - - Belgium - - "europe-west2" - - London - - "europe-west3" - - Frankfurt - - "europe-west4" - - Netherlands - - "europe-west6" - - Zürich - - "europe-central2" - - Warsaw - - "us-central1" - - Iowa - - "us-east1" - - South Carolina - - "us-east4" - - Northern Virginia - - "us-west1" - - Oregon - - "us-west2" - - California - - "us-west3" - - Salt Lake City - - "us-west4" - - Las Vegas - - "northamerica-northeast1" - - Montréal - - "northamerica-northeast2" - - Toronto - - "southamerica-east1" - - São Paulo - - "southamerica-west1" - - Santiago - - "asia1" - - Dual region: asia-northeast1 and asia-northeast2. - - "eur4" - - Dual region: europe-north1 and europe-west4. - - "nam4" - - Dual region: us-central1 and us-east1. +Use this if you get checksum errors when transferring Google photos or +videos. -#### --gcs-storage-class +Setting this flag will cause Google photos and videos to return a +blank checksums. -The storage class to use when storing objects in Google Cloud Storage. +Google photos are identified by being in the "photos" space. + +Corrupted checksums are caused by Google modifying the image/video but +not updating the checksum. Properties: -- Config: storage_class -- Env Var: RCLONE_GCS_STORAGE_CLASS -- Type: string -- Required: false -- Examples: - - "" - - Default - - "MULTI_REGIONAL" - - Multi-regional storage class - - "REGIONAL" - - Regional storage class - - "NEARLINE" - - Nearline storage class - - "COLDLINE" - - Coldline storage class - - "ARCHIVE" - - Archive storage class - - "DURABLE_REDUCED_AVAILABILITY" - - Durable reduced availability storage class +- Config: skip_checksum_gphotos +- Env Var: RCLONE_DRIVE_SKIP_CHECKSUM_GPHOTOS +- Type: bool +- Default: false -#### --gcs-env-auth +#### --drive-shared-with-me -Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars). +Only show files that are shared with me. -Only applies if service_account_file and service_account_credentials is blank. +Instructs rclone to operate on your "Shared with me" folder (where +Google Drive lets you access the files and folders others have shared +with you). + +This works both with the "list" (lsd, lsl, etc.) and the "copy" +commands (copy, sync, etc.), and with all other commands too. Properties: -- Config: env_auth -- Env Var: RCLONE_GCS_ENV_AUTH +- Config: shared_with_me +- Env Var: RCLONE_DRIVE_SHARED_WITH_ME - Type: bool - Default: false -- Examples: - - "false" - - Enter credentials in the next step. - - "true" - - Get GCP IAM credentials from the environment (env vars or IAM). -### Advanced options - -Here are the Advanced options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)). +#### --drive-trashed-only -#### --gcs-token +Only show files that are in the trash. -OAuth Access Token as a JSON blob. +This will show trashed files in their original directory structure. Properties: -- Config: token -- Env Var: RCLONE_GCS_TOKEN -- Type: string -- Required: false +- Config: trashed_only +- Env Var: RCLONE_DRIVE_TRASHED_ONLY +- Type: bool +- Default: false -#### --gcs-auth-url +#### --drive-starred-only -Auth server URL. +Only show files that are starred. -Leave blank to use the provider defaults. +Properties: + +- Config: starred_only +- Env Var: RCLONE_DRIVE_STARRED_ONLY +- Type: bool +- Default: false + +#### --drive-formats + +Deprecated: See export_formats. Properties: -- Config: auth_url -- Env Var: RCLONE_GCS_AUTH_URL +- Config: formats +- Env Var: RCLONE_DRIVE_FORMATS - Type: string - Required: false -#### --gcs-token-url +#### --drive-export-formats -Token server url. +Comma separated list of preferred formats for downloading Google docs. -Leave blank to use the provider defaults. +Properties: + +- Config: export_formats +- Env Var: RCLONE_DRIVE_EXPORT_FORMATS +- Type: string +- Default: "docx,xlsx,pptx,svg" + +#### --drive-import-formats + +Comma separated list of preferred formats for uploading Google docs. Properties: -- Config: token_url -- Env Var: RCLONE_GCS_TOKEN_URL +- Config: import_formats +- Env Var: RCLONE_DRIVE_IMPORT_FORMATS - Type: string - Required: false -#### --gcs-directory-markers - -Upload an empty object with a trailing slash when a new directory is created +#### --drive-allow-import-name-change -Empty folders are unsupported for bucket based remotes, this option creates an empty -object ending with "/", to persist the folder. +Allow the filetype to change when uploading Google docs. +E.g. file.doc to file.docx. This will confuse sync and reupload every time. Properties: -- Config: directory_markers -- Env Var: RCLONE_GCS_DIRECTORY_MARKERS +- Config: allow_import_name_change +- Env Var: RCLONE_DRIVE_ALLOW_IMPORT_NAME_CHANGE - Type: bool - Default: false -#### --gcs-no-check-bucket +#### --drive-use-created-date -If set, don't attempt to check the bucket exists or create it. +Use file created date instead of modified date. -This can be useful when trying to minimise the number of transactions -rclone does if you know the bucket exists already. +Useful when downloading data and you want the creation date used in +place of the last modified date. + +**WARNING**: This flag may have some unexpected consequences. +When uploading to your drive all files will be overwritten unless they +haven't been modified since their creation. And the inverse will occur +while downloading. This side effect can be avoided by using the +"--checksum" flag. + +This feature was implemented to retain photos capture date as recorded +by google photos. You will first need to check the "Create a Google +Photos folder" option in your google drive settings. You can then copy +or move the photos locally and use the date the image was taken +(created) set as the modification date. Properties: -- Config: no_check_bucket -- Env Var: RCLONE_GCS_NO_CHECK_BUCKET +- Config: use_created_date +- Env Var: RCLONE_DRIVE_USE_CREATED_DATE - Type: bool - Default: false -#### --gcs-decompress - -If set this will decompress gzip encoded objects. +#### --drive-use-shared-date -It is possible to upload objects to GCS with "Content-Encoding: gzip" -set. Normally rclone will download these files as compressed objects. +Use date file was shared instead of modified date. -If this flag is set then rclone will decompress these files with -"Content-Encoding: gzip" as they are received. This means that rclone -can't check the size and hash but the file contents will be decompressed. +Note that, as with "--drive-use-created-date", this flag may have +unexpected consequences when uploading/downloading files. +If both this flag and "--drive-use-created-date" are set, the created +date is used. Properties: -- Config: decompress -- Env Var: RCLONE_GCS_DECOMPRESS +- Config: use_shared_date +- Env Var: RCLONE_DRIVE_USE_SHARED_DATE - Type: bool - Default: false -#### --gcs-endpoint +#### --drive-list-chunk -Endpoint for the service. +Size of listing chunk 100-1000, 0 to disable. -Leave blank normally. +Properties: + +- Config: list_chunk +- Env Var: RCLONE_DRIVE_LIST_CHUNK +- Type: int +- Default: 1000 + +#### --drive-impersonate + +Impersonate this user when using a service account. Properties: -- Config: endpoint -- Env Var: RCLONE_GCS_ENDPOINT +- Config: impersonate +- Env Var: RCLONE_DRIVE_IMPERSONATE - Type: string - Required: false -#### --gcs-encoding +#### --drive-upload-cutoff -The encoding for the backend. +Cutoff for switching to chunked upload. -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Properties: + +- Config: upload_cutoff +- Env Var: RCLONE_DRIVE_UPLOAD_CUTOFF +- Type: SizeSuffix +- Default: 8Mi + +#### --drive-chunk-size + +Upload chunk size. + +Must a power of 2 >= 256k. + +Making this larger will improve performance, but note that each chunk +is buffered in memory one per transfer. + +Reducing this will reduce memory usage but decrease performance. Properties: -- Config: encoding -- Env Var: RCLONE_GCS_ENCODING -- Type: MultiEncoder -- Default: Slash,CrLf,InvalidUtf8,Dot +- Config: chunk_size +- Env Var: RCLONE_DRIVE_CHUNK_SIZE +- Type: SizeSuffix +- Default: 8Mi +#### --drive-acknowledge-abuse +Set to allow files which return cannotDownloadAbusiveFile to be downloaded. -## Limitations +If downloading a file returns the error "This file has been identified +as malware or spam and cannot be downloaded" with the error code +"cannotDownloadAbusiveFile" then supply this flag to rclone to +indicate you acknowledge the risks of downloading the file and rclone +will download it anyway. -`rclone about` is not supported by the Google Cloud Storage backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. +Note that if you are using service account it will need Manager +permission (not Content Manager) to for this flag to work. If the SA +does not have the right permission, Google will just ignore the flag. -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) +Properties: -# Google Drive +- Config: acknowledge_abuse +- Env Var: RCLONE_DRIVE_ACKNOWLEDGE_ABUSE +- Type: bool +- Default: false -Paths are specified as `drive:path` +#### --drive-keep-revision-forever -Drive paths may be as deep as required, e.g. `drive:directory/subdirectory`. +Keep new head revision of each file forever. -## Configuration +Properties: -The initial setup for drive involves getting a token from Google drive -which you need to do in your browser. `rclone config` walks you -through it. +- Config: keep_revision_forever +- Env Var: RCLONE_DRIVE_KEEP_REVISION_FOREVER +- Type: bool +- Default: false -Here is an example of how to make a remote called `remote`. First run: +#### --drive-size-as-quota - rclone config +Show sizes as storage quota usage, not actual size. -This will guide you through an interactive setup process: +Show the size of a file as the storage quota used. This is the +current version plus any older versions that have been set to keep +forever. -``` -No remotes found, make a new one? -n) New remote -r) Rename remote -c) Copy remote -s) Set configuration password -q) Quit config -n/r/c/s/q> n -name> remote -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Google Drive - \ "drive" -[snip] -Storage> drive -Google Application Client Id - leave blank normally. -client_id> -Google Application Client Secret - leave blank normally. -client_secret> -Scope that rclone should use when requesting access from drive. -Choose a number from below, or type in your own value - 1 / Full access all files, excluding Application Data Folder. - \ "drive" - 2 / Read-only access to file metadata and file contents. - \ "drive.readonly" - / Access to files created by rclone only. - 3 | These are visible in the drive website. - | File authorization is revoked when the user deauthorizes the app. - \ "drive.file" - / Allows read and write access to the Application Data folder. - 4 | This is not visible in the drive website. - \ "drive.appfolder" - / Allows read-only access to file metadata but - 5 | does not allow any access to read or download file content. - \ "drive.metadata.readonly" -scope> 1 -Service Account Credentials JSON file path - needed only if you want use SA instead of interactive login. -service_account_file> -Remote config -Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. -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 -Configure this as a Shared Drive (Team Drive)? -y) Yes -n) No -y/n> n --------------------- -[remote] -client_id = -client_secret = -scope = drive -root_folder_id = -service_account_file = -token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2014-03-16T13:57:58.955387075Z"} --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +**WARNING**: This flag may have some unexpected consequences. -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a -machine with no Internet browser available. +It is not recommended to set this flag in your config - the +recommended usage is using the flag form --drive-size-as-quota when +doing rclone ls/lsl/lsf/lsjson/etc only. -Note that rclone runs a webserver on your local machine to collect the -token as returned from Google if using web browser to automatically -authenticate. This only -runs from the moment it opens your browser to the moment you get back -the verification code. This is on `http://127.0.0.1:53682/` and it -may require you to unblock it temporarily if you are running a host -firewall, or use manual mode. +If you do use this flag for syncing (not recommended) then you will +need to use --ignore size also. -You can then use it like this, +Properties: -List directories in top level of your drive +- Config: size_as_quota +- Env Var: RCLONE_DRIVE_SIZE_AS_QUOTA +- Type: bool +- Default: false - rclone lsd remote: +#### --drive-v2-download-min-size -List all the files in your drive +If Object's are greater, use drive v2 API to download. - rclone ls remote: +Properties: -To copy a local directory to a drive directory called backup +- Config: v2_download_min_size +- Env Var: RCLONE_DRIVE_V2_DOWNLOAD_MIN_SIZE +- Type: SizeSuffix +- Default: off - rclone copy /home/source remote:backup +#### --drive-pacer-min-sleep -### Scopes +Minimum time to sleep between API calls. -Rclone allows you to select which scope you would like for rclone to -use. This changes what type of token is granted to rclone. [The -scopes are defined -here](https://developers.google.com/drive/v3/web/about-auth). +Properties: -The scope are +- Config: pacer_min_sleep +- Env Var: RCLONE_DRIVE_PACER_MIN_SLEEP +- Type: Duration +- Default: 100ms -#### drive +#### --drive-pacer-burst -This is the default scope and allows full access to all files, except -for the Application Data Folder (see below). +Number of API calls to allow without sleeping. -Choose this one if you aren't sure. +Properties: -#### drive.readonly +- Config: pacer_burst +- Env Var: RCLONE_DRIVE_PACER_BURST +- Type: int +- Default: 100 -This allows read only access to all files. Files may be listed and -downloaded but not uploaded, renamed or deleted. +#### --drive-server-side-across-configs -#### drive.file +Deprecated: use --server-side-across-configs instead. -With this scope rclone can read/view/modify only those files and -folders it creates. +Allow server-side operations (e.g. copy) to work across different drive configs. -So if you uploaded files to drive via the web interface (or any other -means) they will not be visible to rclone. +This can be useful if you wish to do a server-side copy between two +different Google drives. Note that this isn't enabled by default +because it isn't easy to tell if it will work between any two +configurations. -This can be useful if you are using rclone to backup data and you want -to be sure confidential data on your drive is not visible to rclone. +Properties: -Files created with this scope are visible in the web interface. +- Config: server_side_across_configs +- Env Var: RCLONE_DRIVE_SERVER_SIDE_ACROSS_CONFIGS +- Type: bool +- Default: false -#### drive.appfolder +#### --drive-disable-http2 -This gives rclone its own private area to store files. Rclone will -not be able to see any other files on your drive and you won't be able -to see rclone's files from the web interface either. +Disable drive using http2. -#### drive.metadata.readonly +There is currently an unsolved issue with the google drive backend and +HTTP/2. HTTP/2 is therefore disabled by default for the drive backend +but can be re-enabled here. When the issue is solved this flag will +be removed. -This allows read only access to file names only. It does not allow -rclone to download or upload data, or rename or delete files or -directories. +See: https://github.com/rclone/rclone/issues/3631 -### Root folder ID -This option has been moved to the advanced section. You can set the `root_folder_id` for rclone. This is the directory -(identified by its `Folder ID`) that rclone considers to be the root -of your drive. -Normally you will leave this blank and rclone will determine the -correct root to use itself. +Properties: -However you can set this to restrict rclone to a specific folder -hierarchy or to access data within the "Computers" tab on the drive -web interface (where files from Google's Backup and Sync desktop -program go). +- Config: disable_http2 +- Env Var: RCLONE_DRIVE_DISABLE_HTTP2 +- Type: bool +- Default: true -In order to do this you will have to find the `Folder ID` of the -directory you wish rclone to display. This will be the last segment -of the URL when you open the relevant folder in the drive web -interface. +#### --drive-stop-on-upload-limit -So if the folder you want rclone to use has a URL which looks like -`https://drive.google.com/drive/folders/1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh` -in the browser, then you use `1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh` as -the `root_folder_id` in the config. +Make upload limit errors be fatal. -**NB** folders under the "Computers" tab seem to be read only (drive -gives a 500 error) when using rclone. +At the time of writing it is only possible to upload 750 GiB of data to +Google Drive a day (this is an undocumented limit). When this limit is +reached Google Drive produces a slightly different error message. When +this flag is set it causes these errors to be fatal. These will stop +the in-progress sync. -There doesn't appear to be an API to discover the folder IDs of the -"Computers" tab - please contact us if you know otherwise! +Note that this detection is relying on error message strings which +Google don't document so it may break in the future. -Note also that rclone can't access any data under the "Backups" tab on -the google drive web interface yet. +See: https://github.com/rclone/rclone/issues/3857 -### Service Account support -You can set up rclone with Google Drive in an unattended mode, -i.e. not tied to a specific end-user Google account. This is useful -when you want to synchronise files onto machines that don't have -actively logged-in users, for example build machines. +Properties: -To use a Service Account instead of OAuth2 token flow, enter the path -to your Service Account credentials at the `service_account_file` -prompt during `rclone config` and rclone won't use the browser based -authentication flow. If you'd rather stuff the contents of the -credentials file into the rclone config file, you can set -`service_account_credentials` with the actual contents of the file -instead, or set the equivalent environment variable. +- Config: stop_on_upload_limit +- Env Var: RCLONE_DRIVE_STOP_ON_UPLOAD_LIMIT +- Type: bool +- Default: false -#### Use case - Google Apps/G-suite account and individual Drive +#### --drive-stop-on-download-limit -Let's say that you are the administrator of a Google Apps (old) or -G-suite account. -The goal is to store data on an individual's Drive account, who IS -a member of the domain. -We'll call the domain **example.com**, and the user -**foo@example.com**. +Make download limit errors be fatal. + +At the time of writing it is only possible to download 10 TiB of data from +Google Drive a day (this is an undocumented limit). When this limit is +reached Google Drive produces a slightly different error message. When +this flag is set it causes these errors to be fatal. These will stop +the in-progress sync. + +Note that this detection is relying on error message strings which +Google don't document so it may break in the future. + + +Properties: + +- Config: stop_on_download_limit +- Env Var: RCLONE_DRIVE_STOP_ON_DOWNLOAD_LIMIT +- Type: bool +- Default: false + +#### --drive-skip-shortcuts + +If set skip shortcut files. + +Normally rclone dereferences shortcut files making them appear as if +they are the original file (see [the shortcuts section](#shortcuts)). +If this flag is set then rclone will ignore shortcut files completely. + + +Properties: + +- Config: skip_shortcuts +- Env Var: RCLONE_DRIVE_SKIP_SHORTCUTS +- Type: bool +- Default: false -There's a few steps we need to go through to accomplish this: +#### --drive-skip-dangling-shortcuts -##### 1. Create a service account for example.com - - To create a service account and obtain its credentials, go to the -[Google Developer Console](https://console.developers.google.com). - - You must have a project - create one if you don't. - - Then go to "IAM & admin" -> "Service Accounts". - - Use the "Create Service Account" button. Fill in "Service account name" -and "Service account ID" with something that identifies your client. - - Select "Create And Continue". Step 2 and 3 are optional. - - These credentials are what rclone will use for authentication. -If you ever need to remove access, press the "Delete service -account key" button. +If set skip dangling shortcut files. -##### 2. Allowing API access to example.com Google Drive - - Go to example.com's admin console - - Go into "Security" (or use the search bar) - - Select "Show more" and then "Advanced settings" - - Select "Manage API client access" in the "Authentication" section - - In the "Client Name" field enter the service account's -"Client ID" - this can be found in the Developer Console under -"IAM & Admin" -> "Service Accounts", then "View Client ID" for -the newly created service account. -It is a ~21 character numerical string. - - In the next field, "One or More API Scopes", enter -`https://www.googleapis.com/auth/drive` -to grant access to Google Drive specifically. +If this is set then rclone will not show any dangling shortcuts in listings. -##### 3. Configure rclone, assuming a new install -``` -rclone config +Properties: -n/s/q> n # New -name>gdrive # Gdrive is an example name -Storage> # Select the number shown for Google Drive -client_id> # Can be left blank -client_secret> # Can be left blank -scope> # Select your scope, 1 for example -root_folder_id> # Can be left blank -service_account_file> /home/foo/myJSONfile.json # This is where the JSON file goes! -y/n> # Auto config, n +- Config: skip_dangling_shortcuts +- Env Var: RCLONE_DRIVE_SKIP_DANGLING_SHORTCUTS +- Type: bool +- Default: false -``` +#### --drive-resource-key -##### 4. Verify that it's working - - `rclone -v --drive-impersonate foo@example.com lsf gdrive:backup` - - The arguments do: - - `-v` - verbose logging - - `--drive-impersonate foo@example.com` - this is what does -the magic, pretending to be user foo. - - `lsf` - list files in a parsing friendly way - - `gdrive:backup` - use the remote called gdrive, work in -the folder named backup. +Resource key for accessing a link-shared file. -Note: in case you configured a specific root folder on gdrive and rclone is unable to access the contents of that folder when using `--drive-impersonate`, do this instead: - - in the gdrive web interface, share your root folder with the user/email of the new Service Account you created/selected at step #1 - - use rclone without specifying the `--drive-impersonate` option, like this: - `rclone -v lsf gdrive:backup` +If you need to access files shared with a link like this + https://drive.google.com/drive/folders/XXX?resourcekey=YYY&usp=sharing -### Shared drives (team drives) +Then you will need to use the first part "XXX" as the "root_folder_id" +and the second part "YYY" as the "resource_key" otherwise you will get +404 not found errors when trying to access the directory. -If you want to configure the remote to point to a Google Shared Drive -(previously known as Team Drives) then answer `y` to the question -`Configure this as a Shared Drive (Team Drive)?`. +See: https://developers.google.com/drive/api/guides/resource-keys -This will fetch the list of Shared Drives from google and allow you to -configure which one you want to use. You can also type in a Shared -Drive ID if you prefer. +This resource key requirement only applies to a subset of old files. -For example: +Note also that opening the folder once in the web interface (with the +user you've authenticated rclone with) seems to be enough so that the +resource key is not needed. -``` -Configure this as a Shared Drive (Team Drive)? -y) Yes -n) No -y/n> y -Fetching Shared Drive list... -Choose a number from below, or type in your own value - 1 / Rclone Test - \ "xxxxxxxxxxxxxxxxxxxx" - 2 / Rclone Test 2 - \ "yyyyyyyyyyyyyyyyyyyy" - 3 / Rclone Test 3 - \ "zzzzzzzzzzzzzzzzzzzz" -Enter a Shared Drive ID> 1 --------------------- -[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} -team_drive = xxxxxxxxxxxxxxxxxxxx --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` -### --fast-list +Properties: -This remote supports `--fast-list` which allows you to use fewer -transactions in exchange for more memory. See the [rclone -docs](https://rclone.org/docs/#fast-list) for more details. +- Config: resource_key +- Env Var: RCLONE_DRIVE_RESOURCE_KEY +- Type: string +- Required: false -It does this by combining multiple `list` calls into a single API request. +#### --drive-fast-list-bug-fix -This works by combining many `'%s' in parents` filters into one expression. -To list the contents of directories a, b and c, the following requests will be send by the regular `List` function: -``` -trashed=false and 'a' in parents -trashed=false and 'b' in parents -trashed=false and 'c' in parents -``` -These can now be combined into a single request: -``` -trashed=false and ('a' in parents or 'b' in parents or 'c' in parents) -``` +Work around a bug in Google Drive listing. -The implementation of `ListR` will put up to 50 `parents` filters into one request. -It will use the `--checkers` value to specify the number of requests to run in parallel. +Normally rclone will work around a bug in Google Drive when using +--fast-list (ListR) where the search "(A in parents) or (B in +parents)" returns nothing sometimes. See #3114, #4289 and +https://issuetracker.google.com/issues/149522397 -In tests, these batch requests were up to 20x faster than the regular method. -Running the following command against different sized folders gives: -``` -rclone lsjson -vv -R --checkers=6 gdrive:folder -``` +Rclone detects this by finding no items in more than one directory +when listing and retries them as lists of individual directories. -small folder (220 directories, 700 files): +This means that if you have a lot of empty directories rclone will end +up listing them all individually and this can take many more API +calls. -- without `--fast-list`: 38s -- with `--fast-list`: 10s +This flag allows the work-around to be disabled. This is **not** +recommended in normal use - only if you have a particular case you are +having trouble with like many empty directories. -large folder (10600 directories, 39000 files): -- without `--fast-list`: 22:05 min -- with `--fast-list`: 58s +Properties: -### Modified time +- Config: fast_list_bug_fix +- Env Var: RCLONE_DRIVE_FAST_LIST_BUG_FIX +- Type: bool +- Default: true -Google drive stores modification times accurate to 1 ms. +#### --drive-metadata-owner -### Restricted filename characters +Control whether owner should be read or written in metadata. -Only Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in JSON strings. +Owner is a standard part of the file metadata so is easy to read. But it +isn't always desirable to set the owner from the metadata. -In contrast to other backends, `/` can also be used in names and `.` -or `..` are valid names. +Note that you can't set the owner on Shared Drives, and that setting +ownership will generate an email to the new owner (this can't be +disabled), and you can't transfer ownership to someone outside your +organization. -### Revisions -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. +Properties: -Revisions follow the standard google policy which at time of writing -was +- Config: metadata_owner +- Env Var: RCLONE_DRIVE_METADATA_OWNER +- Type: Bits +- Default: read +- Examples: + - "off" + - Do not read or write the value + - "read" + - Read the value only + - "write" + - Write the value only + - "read,write" + - Read and Write the value. - * They are deleted after 30 days or 100 revisions (whatever comes first). - * They do not count towards a user storage quota. +#### --drive-metadata-permissions -### Deleting files +Control whether permissions should be read or written in metadata. -By default rclone will send all files to the trash when deleting -files. If deleting them permanently is required then use the -`--drive-use-trash=false` flag, or set the equivalent environment -variable. +Reading permissions metadata from files can be done quickly, but it +isn't always desirable to set the permissions from the metadata. -### Shortcuts +Note that rclone drops any inherited permissions on Shared Drives and +any owner permission on My Drives as these are duplicated in the owner +metadata. -In March 2020 Google introduced a new feature in Google Drive called -[drive shortcuts](https://support.google.com/drive/answer/9700156) -([API](https://developers.google.com/drive/api/v3/shortcuts)). These -will (by September 2020) [replace the ability for files or folders to -be in multiple folders at once](https://cloud.google.com/blog/products/g-suite/simplifying-google-drives-folder-structure-and-sharing-models). -Shortcuts are files that link to other files on Google Drive somewhat -like a symlink in unix, except they point to the underlying file data -(e.g. the inode in unix terms) so they don't break if the source is -renamed or moved about. +Properties: -By default rclone treats these as follows. +- Config: metadata_permissions +- Env Var: RCLONE_DRIVE_METADATA_PERMISSIONS +- Type: Bits +- Default: off +- Examples: + - "off" + - Do not read or write the value + - "read" + - Read the value only + - "write" + - Write the value only + - "read,write" + - Read and Write the value. -For shortcuts pointing to files: +#### --drive-metadata-labels -- When listing a file shortcut appears as the destination file. -- When downloading the contents of the destination file is downloaded. -- When updating shortcut file with a non shortcut file, the shortcut is removed then a new file is uploaded in place of the shortcut. -- When server-side moving (renaming) the shortcut is renamed, not the destination file. -- When server-side copying the shortcut is copied, not the contents of the shortcut. (unless `--drive-copy-shortcut-content` is in use in which case the contents of the shortcut gets copied). -- When deleting the shortcut is deleted not the linked file. -- When setting the modification time, the modification time of the linked file will be set. +Control whether labels should be read or written in metadata. -For shortcuts pointing to folders: +Reading labels metadata from files takes an extra API transaction and +will slow down listings. It isn't always desirable to set the labels +from the metadata. -- When listing the shortcut appears as a folder and that folder will contain the contents of the linked folder appear (including any sub folders) -- When downloading the contents of the linked folder and sub contents are downloaded -- When uploading to a shortcut folder the file will be placed in the linked folder -- When server-side moving (renaming) the shortcut is renamed, not the destination folder -- When server-side copying the contents of the linked folder is copied, not the shortcut. -- When deleting with `rclone rmdir` or `rclone purge` the shortcut is deleted not the linked folder. -- **NB** When deleting with `rclone remove` or `rclone mount` the contents of the linked folder will be deleted. +The format of labels is documented in the drive API documentation at +https://developers.google.com/drive/api/reference/rest/v3/Label - +rclone just provides a JSON dump of this format. -The [rclone backend](https://rclone.org/commands/rclone_backend/) command can be used to create shortcuts. +When setting labels, the label and fields must already exist - rclone +will not create them. This means that if you are transferring labels +from two different accounts you will have to create the labels in +advance and use the metadata mapper to translate the IDs between the +two accounts. -Shortcuts can be completely ignored with the `--drive-skip-shortcuts` flag -or the corresponding `skip_shortcuts` configuration setting. -### Emptying trash +Properties: -If you wish to empty your trash you can use the `rclone cleanup remote:` -command which will permanently delete all your trashed files. This command -does not take any path arguments. +- Config: metadata_labels +- Env Var: RCLONE_DRIVE_METADATA_LABELS +- Type: Bits +- Default: off +- Examples: + - "off" + - Do not read or write the value + - "read" + - Read the value only + - "write" + - Write the value only + - "read,write" + - Read and Write the value. -Note that Google Drive takes some time (minutes to days) to empty the -trash even though the command returns within a few seconds. No output -is echoed, so there will be no confirmation even using -v or -vv. +#### --drive-encoding -### Quota information +The encoding for the backend. -To view your current quota you can use the `rclone about remote:` -command which will display your usage limit (quota), the usage in Google -Drive, the size of all files in the Trash and the space used by other -Google services such as Gmail. This command does not take any path -arguments. +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -#### Import/Export of google documents +Properties: -Google documents can be exported from and uploaded to Google Drive. +- Config: encoding +- Env Var: RCLONE_DRIVE_ENCODING +- Type: Encoding +- Default: InvalidUtf8 -When rclone downloads a Google doc it chooses a format to download -depending upon the `--drive-export-formats` setting. -By default the export formats are `docx,xlsx,pptx,svg` which are a -sensible default for an editable document. +#### --drive-env-auth -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. +Get IAM credentials from runtime (environment variables or instance meta data if no env vars). -If you prefer an archive copy then you might use `--drive-export-formats -pdf`, or if you prefer openoffice/libreoffice formats you might use -`--drive-export-formats ods,odt,odp`. +Only applies if service_account_file and service_account_credentials is blank. -Note that rclone adds the extension to the google doc, so if it is -called `My Spreadsheet` on google docs, it will be exported as `My -Spreadsheet.xlsx` or `My Spreadsheet.pdf` etc. +Properties: -When importing files into Google Drive, rclone will convert all -files with an extension in `--drive-import-formats` to their -associated document type. -rclone will not convert any files by default, since the conversion -is lossy process. +- Config: env_auth +- Env Var: RCLONE_DRIVE_ENV_AUTH +- Type: bool +- Default: false +- Examples: + - "false" + - Enter credentials in the next step. + - "true" + - Get GCP IAM credentials from the environment (env vars or IAM). -The conversion must result in a file with the same extension when -the `--drive-export-formats` rules are applied to the uploaded document. +### Metadata -Here are some examples for allowed and prohibited conversions. +User metadata is stored in the properties field of the drive object. -| export-formats | import-formats | Upload Ext | Document Ext | Allowed | -| -------------- | -------------- | ---------- | ------------ | ------- | -| odt | odt | odt | odt | Yes | -| odt | docx,odt | odt | odt | Yes | -| | docx | docx | docx | Yes | -| | odt | odt | docx | No | -| odt,docx | docx,odt | docx | odt | No | -| docx,odt | docx,odt | docx | docx | Yes | -| docx,odt | docx,odt | odt | docx | No | +Here are the possible system metadata items for the drive backend. -This limitation can be disabled by specifying `--drive-allow-import-name-change`. -When using this flag, rclone can convert multiple files types resulting -in the same document type at once, e.g. with `--drive-import-formats docx,odt,txt`, -all files having these extension would result in a document represented as a docx file. -This brings the additional risk of overwriting a document, if multiple files -have the same stem. Many rclone operations will not handle this name change -in any way. They assume an equal name when copying files and might copy the -file again or delete them when the name changes. +| Name | Help | Type | Example | Read Only | +|------|------|------|---------|-----------| +| btime | Time of file birth (creation) with mS accuracy. Note that this is only writable on fresh uploads - it can't be written for updates. | RFC 3339 | 2006-01-02T15:04:05.999Z07:00 | N | +| content-type | The MIME type of the file. | string | text/plain | N | +| copy-requires-writer-permission | Whether the options to copy, print, or download this file, should be disabled for readers and commenters. | boolean | true | N | +| description | A short description of the file. | string | Contract for signing | N | +| folder-color-rgb | The color for a folder or a shortcut to a folder as an RGB hex string. | string | 881133 | N | +| labels | Labels attached to this file in a JSON dump of Googled drive format. Enable with --drive-metadata-labels. | JSON | [] | N | +| mtime | Time of last modification with mS accuracy. | RFC 3339 | 2006-01-02T15:04:05.999Z07:00 | N | +| owner | The owner of the file. Usually an email address. Enable with --drive-metadata-owner. | string | user@example.com | N | +| permissions | Permissions in a JSON dump of Google drive format. On shared drives these will only be present if they aren't inherited. Enable with --drive-metadata-permissions. | JSON | {} | N | +| starred | Whether the user has starred the file. | boolean | false | N | +| viewed-by-me | Whether the file has been viewed by this user. | boolean | true | **Y** | +| writers-can-share | Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives. | boolean | false | N | -Here are the possible export extensions with their corresponding mime types. -Most of these can also be used for importing, but there more that are not -listed here. Some of these additional ones might only be available when -the operating system provides the correct MIME type entries. +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -This list can be changed by Google Drive at any time and might not -represent the currently available conversions. +## Backend commands -| Extension | Mime Type | Description | -| --------- |-----------| ------------| -| bmp | image/bmp | Windows Bitmap format | -| csv | text/csv | Standard CSV format for Spreadsheets | -| doc | application/msword | Classic Word file | -| docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document | Microsoft Office Document | -| epub | application/epub+zip | E-book format | -| html | text/html | An HTML Document | -| jpg | image/jpeg | A JPEG Image File | -| json | application/vnd.google-apps.script+json | JSON Text Format for Google Apps scripts | -| odp | application/vnd.oasis.opendocument.presentation | Openoffice Presentation | -| ods | application/vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet | -| ods | application/x-vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet | -| odt | application/vnd.oasis.opendocument.text | Openoffice Document | -| pdf | application/pdf | Adobe PDF Format | -| pjpeg | image/pjpeg | Progressive JPEG Image | -| png | image/png | PNG Image Format| -| pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation | Microsoft Office Powerpoint | -| rtf | application/rtf | Rich Text Format | -| svg | image/svg+xml | Scalable Vector Graphics Format | -| tsv | text/tab-separated-values | Standard TSV format for spreadsheets | -| txt | text/plain | Plain Text | -| wmf | application/x-msmetafile | Windows Meta File | -| xls | application/vnd.ms-excel | Classic Excel file | -| xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | Microsoft Office Spreadsheet | -| zip | application/zip | A ZIP file of HTML, Images CSS | +Here are the commands specific to the drive backend. -Google documents can also be exported as link files. These files will -open a browser window for the Google Docs website of that document -when opened. The link file extension has to be specified as a -`--drive-export-formats` parameter. They will match all available -Google Documents. +Run them with -| Extension | Description | OS Support | -| --------- | ----------- | ---------- | -| desktop | freedesktop.org specified desktop entry | Linux | -| link.html | An HTML Document with a redirect | All | -| url | INI style link file | macOS, Windows | -| webloc | macOS specific XML format | macOS | + rclone backend COMMAND remote: +The help below will explain what arguments each command takes. -### Standard options +See the [backend](https://rclone.org/commands/rclone_backend/) command for more +info on how to pass options and arguments. -Here are the Standard options specific to drive (Google Drive). +These can be run on a running backend using the rc command +[backend/command](https://rclone.org/rc/#backend-command). -#### --drive-client-id +### get -Google Application Client Id -Setting your own is recommended. -See https://rclone.org/drive/#making-your-own-client-id for how to create your own. -If you leave this blank, it will use an internal key which is low performance. +Get command for fetching the drive config parameters -Properties: + rclone backend get remote: [options] [+] -- Config: client_id -- Env Var: RCLONE_DRIVE_CLIENT_ID -- Type: string -- Required: false +This is a get command which will be used to fetch the various drive config parameters -#### --drive-client-secret +Usage Examples: -OAuth Client Secret. + rclone backend get drive: [-o service_account_file] [-o chunk_size] + rclone rc backend/command command=get fs=drive: [-o service_account_file] [-o chunk_size] -Leave blank normally. -Properties: +Options: -- Config: client_secret -- Env Var: RCLONE_DRIVE_CLIENT_SECRET -- Type: string -- Required: false +- "chunk_size": show the current upload chunk size +- "service_account_file": show the current service account file -#### --drive-scope +### set -Scope that rclone should use when requesting access from drive. +Set command for updating the drive config parameters -Properties: + rclone backend set remote: [options] [+] -- Config: scope -- Env Var: RCLONE_DRIVE_SCOPE -- Type: string -- Required: false -- Examples: - - "drive" - - Full access all files, excluding Application Data Folder. - - "drive.readonly" - - Read-only access to file metadata and file contents. - - "drive.file" - - Access to files created by rclone only. - - These are visible in the drive website. - - File authorization is revoked when the user deauthorizes the app. - - "drive.appfolder" - - Allows read and write access to the Application Data folder. - - This is not visible in the drive website. - - "drive.metadata.readonly" - - Allows read-only access to file metadata but - - does not allow any access to read or download file content. +This is a set command which will be used to update the various drive config parameters -#### --drive-service-account-file +Usage Examples: -Service Account Credentials JSON file path. + rclone backend set drive: [-o service_account_file=sa.json] [-o chunk_size=67108864] + rclone rc backend/command command=set fs=drive: [-o service_account_file=sa.json] [-o chunk_size=67108864] -Leave blank normally. -Needed only if you want use SA instead of interactive login. -Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. +Options: -Properties: +- "chunk_size": update the current upload chunk size +- "service_account_file": update the current service account file -- Config: service_account_file -- Env Var: RCLONE_DRIVE_SERVICE_ACCOUNT_FILE -- Type: string -- Required: false +### shortcut -#### --drive-alternate-export +Create shortcuts from files or directories -Deprecated: No longer needed. + rclone backend shortcut remote: [options] [+] -Properties: +This command creates shortcuts from files or directories. -- Config: alternate_export -- Env Var: RCLONE_DRIVE_ALTERNATE_EXPORT -- Type: bool -- Default: false +Usage: -### Advanced options + rclone backend shortcut drive: source_item destination_shortcut + rclone backend shortcut drive: source_item -o target=drive2: destination_shortcut -Here are the Advanced options specific to drive (Google Drive). +In the first example this creates a shortcut from the "source_item" +which can be a file or a directory to the "destination_shortcut". The +"source_item" and the "destination_shortcut" should be relative paths +from "drive:" -#### --drive-token +In the second example this creates a shortcut from the "source_item" +relative to "drive:" to the "destination_shortcut" relative to +"drive2:". This may fail with a permission error if the user +authenticated with "drive2:" can't read files from "drive:". -OAuth Access Token as a JSON blob. -Properties: +Options: -- Config: token -- Env Var: RCLONE_DRIVE_TOKEN -- Type: string -- Required: false +- "target": optional target remote for the shortcut destination -#### --drive-auth-url +### drives -Auth server URL. +List the Shared Drives available to this account -Leave blank to use the provider defaults. + rclone backend drives remote: [options] [+] -Properties: +This command lists the Shared Drives (Team Drives) available to this +account. -- Config: auth_url -- Env Var: RCLONE_DRIVE_AUTH_URL -- Type: string -- Required: false +Usage: -#### --drive-token-url + rclone backend [-o config] drives drive: -Token server url. +This will return a JSON list of objects like this -Leave blank to use the provider defaults. + [ + { + "id": "0ABCDEF-01234567890", + "kind": "drive#teamDrive", + "name": "My Drive" + }, + { + "id": "0ABCDEFabcdefghijkl", + "kind": "drive#teamDrive", + "name": "Test Drive" + } + ] -Properties: +With the -o config parameter it will output the list in a format +suitable for adding to a config file to make aliases for all the +drives found and a combined drive. -- Config: token_url -- Env Var: RCLONE_DRIVE_TOKEN_URL -- Type: string -- Required: false + [My Drive] + type = alias + remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=: -#### --drive-root-folder-id + [Test Drive] + type = alias + remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=: + + [AllDrives] + type = combine + upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:" + +Adding this to the rclone config file will cause those team drives to +be accessible with the aliases shown. Any illegal characters will be +substituted with "_" and duplicate names will have numbers suffixed. +It will also add a remote called AllDrives which shows all the shared +drives combined into one directory tree. -ID of the root folder. -Leave blank normally. -Fill in to access "Computers" folders (see docs), or for rclone to use -a non root folder as its starting point. +### untrash +Untrash files and directories -Properties: + rclone backend untrash remote: [options] [+] -- Config: root_folder_id -- Env Var: RCLONE_DRIVE_ROOT_FOLDER_ID -- Type: string -- Required: false +This command untrashes all the files and directories in the directory +passed in recursively. -#### --drive-service-account-credentials +Usage: -Service Account Credentials JSON blob. +This takes an optional directory to trash which make this easier to +use via the API. -Leave blank normally. -Needed only if you want use SA instead of interactive login. + rclone backend untrash drive:directory + rclone backend --interactive untrash drive:directory subdir -Properties: +Use the --interactive/-i or --dry-run flag to see what would be restored before restoring it. -- Config: service_account_credentials -- Env Var: RCLONE_DRIVE_SERVICE_ACCOUNT_CREDENTIALS -- Type: string -- Required: false +Result: -#### --drive-team-drive + { + "Untrashed": 17, + "Errors": 0 + } -ID of the Shared Drive (Team Drive). -Properties: +### copyid -- Config: team_drive -- Env Var: RCLONE_DRIVE_TEAM_DRIVE -- Type: string -- Required: false +Copy files by ID -#### --drive-auth-owner-only + rclone backend copyid remote: [options] [+] -Only consider files owned by the authenticated user. +This command copies files by ID -Properties: +Usage: -- Config: auth_owner_only -- Env Var: RCLONE_DRIVE_AUTH_OWNER_ONLY -- Type: bool -- Default: false + rclone backend copyid drive: ID path + rclone backend copyid drive: ID1 path1 ID2 path2 -#### --drive-use-trash +It copies the drive file with ID given to the path (an rclone path which +will be passed internally to rclone copyto). The ID and path pairs can be +repeated. -Send files to the trash instead of deleting permanently. +The path should end with a / to indicate copy the file as named to +this directory. If it doesn't end with a / then the last path +component will be used as the file name. -Defaults to true, namely sending files to the trash. -Use `--drive-use-trash=false` to delete files permanently instead. +If the destination is a drive backend then server-side copying will be +attempted if possible. -Properties: +Use the --interactive/-i or --dry-run flag to see what would be copied before copying. -- Config: use_trash -- Env Var: RCLONE_DRIVE_USE_TRASH -- Type: bool -- Default: true -#### --drive-copy-shortcut-content +### exportformats -Server side copy contents of shortcuts instead of the shortcut. +Dump the export formats for debug purposes -When doing server side copies, normally rclone will copy shortcuts as -shortcuts. + rclone backend exportformats remote: [options] [+] -If this flag is used then rclone will copy the contents of shortcuts -rather than shortcuts themselves when doing server side copies. +### importformats -Properties: +Dump the import formats for debug purposes -- Config: copy_shortcut_content -- Env Var: RCLONE_DRIVE_COPY_SHORTCUT_CONTENT -- Type: bool -- Default: false + rclone backend importformats remote: [options] [+] -#### --drive-skip-gdocs -Skip google documents in all listings. -If given, gdocs practically become invisible to rclone. +## Limitations -Properties: +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 MiB/s but lots of +small files can take a long time. -- Config: skip_gdocs -- Env Var: RCLONE_DRIVE_SKIP_GDOCS -- Type: bool -- Default: false +Server side copies are also subject to a separate rate limit. If you +see User rate limit exceeded errors, wait at least 24 hours and retry. +You can disable server-side copies with `--disable copy` to download +and upload the files if you prefer. -#### --drive-skip-checksum-gphotos +### Limitations of Google Docs -Skip MD5 checksum on Google photos and videos only. +Google docs will appear as size -1 in `rclone ls`, `rclone ncdu` etc, +and as size 0 in anything which uses the VFS layer, e.g. `rclone mount` +and `rclone serve`. When calculating directory totals, e.g. in +`rclone size` and `rclone ncdu`, they will be counted in as empty +files. -Use this if you get checksum errors when transferring Google photos or -videos. +This is because rclone can't find out the size of the Google docs +without downloading them. -Setting this flag will cause Google photos and videos to return a -blank MD5 checksum. +Google docs will transfer correctly with `rclone sync`, `rclone copy` +etc as rclone knows to ignore the size when doing the transfer. -Google photos are identified by being in the "photos" space. +However an unfortunate consequence of this is that you may not be able +to download Google docs using `rclone mount`. If it doesn't work you +will get a 0 sized file. If you try again the doc may gain its +correct size and be downloadable. Whether it will work on not depends +on the application accessing the mount and the OS you are running - +experiment to find out if it does work for you! -Corrupted checksums are caused by Google modifying the image/video but -not updating the checksum. +### Duplicated files -Properties: +Sometimes, for no reason I've been able to track down, drive will +duplicate a file that rclone uploads. Drive unlike all the other +remotes can have duplicated files. -- Config: skip_checksum_gphotos -- Env Var: RCLONE_DRIVE_SKIP_CHECKSUM_GPHOTOS -- Type: bool -- Default: false +Duplicated files cause problems with the syncing and you will see +messages in the log about duplicates. -#### --drive-shared-with-me +Use `rclone dedupe` to fix duplicated files. -Only show files that are shared with me. +Note that this isn't just a problem with rclone, even Google Photos on +Android duplicates files on drive sometimes. -Instructs rclone to operate on your "Shared with me" folder (where -Google Drive lets you access the files and folders others have shared -with you). +### Rclone appears to be re-copying files it shouldn't -This works both with the "list" (lsd, lsl, etc.) and the "copy" -commands (copy, sync, etc.), and with all other commands too. +The most likely cause of this is the duplicated file issue above - run +`rclone dedupe` and check your logs for duplicate object or directory +messages. -Properties: +This can also be caused by a delay/caching on google drive's end when +comparing directory listings. Specifically with team drives used in +combination with --fast-list. Files that were uploaded recently may +not appear on the directory list sent to rclone when using --fast-list. -- Config: shared_with_me -- Env Var: RCLONE_DRIVE_SHARED_WITH_ME -- Type: bool -- Default: false +Waiting a moderate period of time between attempts (estimated to be +approximately 1 hour) and/or not using --fast-list both seem to be +effective in preventing the problem. -#### --drive-trashed-only +### SHA1 or SHA256 hashes may be missing -Only show files that are in the trash. +All files have MD5 hashes, but a small fraction of files uploaded may +not have SHA1 or SHA256 hashes especially if they were uploaded before 2018. -This will show trashed files in their original directory structure. +## Making your own client_id -Properties: +When you use rclone with Google drive in its default configuration you +are using rclone's client_id. This is shared between all the rclone +users. There is a global rate limit on the number of queries per +second that each client_id can do set by Google. rclone already has a +high quota and I will continue to make sure it is high enough by +contacting Google. -- Config: trashed_only -- Env Var: RCLONE_DRIVE_TRASHED_ONLY -- Type: bool -- Default: false +It is strongly recommended to use your own client ID as the default rclone ID is heavily used. If you have multiple services running, it is recommended to use an API key for each service. The default Google quota is 10 transactions per second so it is recommended to stay under that number as if you use more than that, it will cause rclone to rate limit and make things slower. -#### --drive-starred-only +Here is how to create your own Google Drive client ID for rclone: -Only show files that are starred. +1. Log into the [Google API +Console](https://console.developers.google.com/) with your Google +account. It doesn't matter what Google account you use. (It need not +be the same account as the Google Drive you want to access) -Properties: +2. Select a project or create a new project. -- Config: starred_only -- Env Var: RCLONE_DRIVE_STARRED_ONLY -- Type: bool -- Default: false +3. Under "ENABLE APIS AND SERVICES" search for "Drive", and enable the +"Google Drive API". -#### --drive-formats +4. Click "Credentials" in the left-side panel (not "Create +credentials", which opens the wizard). -Deprecated: See export_formats. +5. If you already configured an "Oauth Consent Screen", then skip +to the next step; if not, click on "CONFIGURE CONSENT SCREEN" button +(near the top right corner of the right panel), then select "External" +and click on "CREATE"; on the next screen, enter an "Application name" +("rclone" is OK); enter "User Support Email" (your own email is OK); +enter "Developer Contact Email" (your own email is OK); then click on +"Save" (all other data is optional). You will also have to add some scopes, +including `.../auth/docs` and `.../auth/drive` in order to be able to edit, +create and delete files with RClone. You may also want to include the +`../auth/drive.metadata.readonly` scope. After adding scopes, click +"Save and continue" to add test users. Be sure to add your own account to +the test users. Once you've added yourself as a test user and saved the +changes, click again on "Credentials" on the left panel to go back to +the "Credentials" screen. -Properties: + (PS: if you are a GSuite user, you could also select "Internal" instead +of "External" above, but this will restrict API use to Google Workspace +users in your organisation). -- Config: formats -- Env Var: RCLONE_DRIVE_FORMATS -- Type: string -- Required: false +6. Click on the "+ CREATE CREDENTIALS" button at the top of the screen, +then select "OAuth client ID". -#### --drive-export-formats +7. Choose an application type of "Desktop app" and click "Create". (the default name is fine) -Comma separated list of preferred formats for downloading Google docs. +8. It will show you a client ID and client secret. Make a note of these. + + (If you selected "External" at Step 5 continue to Step 9. + If you chose "Internal" you don't need to publish and can skip straight to + Step 10 but your destination drive must be part of the same Google Workspace.) -Properties: +9. Go to "Oauth consent screen" and then click "PUBLISH APP" button and confirm. + You will also want to add yourself as a test user. -- Config: export_formats -- Env Var: RCLONE_DRIVE_EXPORT_FORMATS -- Type: string -- Default: "docx,xlsx,pptx,svg" +10. Provide the noted client ID and client secret to rclone. -#### --drive-import-formats +Be aware that, due to the "enhanced security" recently introduced by +Google, you are theoretically expected to "submit your app for verification" +and then wait a few weeks(!) for their response; in practice, you can go right +ahead and use the client ID and client secret with rclone, the only issue will +be a very scary confirmation screen shown when you connect via your browser +for rclone to be able to get its token-id (but as this only happens during +the remote configuration, it's not such a big deal). Keeping the application in +"Testing" will work as well, but the limitation is that any grants will expire +after a week, which can be annoying to refresh constantly. If, for whatever +reason, a short grant time is not a problem, then keeping the application in +testing mode would also be sufficient. -Comma separated list of preferred formats for uploading Google docs. +(Thanks to @balazer on github for these instructions.) -Properties: +Sometimes, creation of an OAuth consent in Google API Console fails due to an error message +“The request failed because changes to one of the field of the resource is not supported”. +As a convenient workaround, the necessary Google Drive API key can be created on the +[Python Quickstart](https://developers.google.com/drive/api/v3/quickstart/python) page. +Just push the Enable the Drive API button to receive the Client ID and Secret. +Note that it will automatically create a new project in the API Console. -- Config: import_formats -- Env Var: RCLONE_DRIVE_IMPORT_FORMATS -- Type: string -- Required: false +# Google Photos -#### --drive-allow-import-name-change +The rclone backend for [Google Photos](https://www.google.com/photos/about/) is +a specialized backend for transferring photos and videos to and from +Google Photos. -Allow the filetype to change when uploading Google docs. +**NB** The Google Photos API which rclone uses has quite a few +limitations, so please read the [limitations section](#limitations) +carefully to make sure it is suitable for your use. -E.g. file.doc to file.docx. This will confuse sync and reupload every time. +## Configuration -Properties: +The initial setup for google cloud storage involves getting a token from Google Photos +which you need to do in your browser. `rclone config` walks you +through it. -- Config: allow_import_name_change -- Env Var: RCLONE_DRIVE_ALLOW_IMPORT_NAME_CHANGE -- Type: bool -- Default: false +Here is an example of how to make a remote called `remote`. First run: -#### --drive-use-created-date + rclone config -Use file created date instead of modified date. +This will guide you through an interactive setup process: -Useful when downloading data and you want the creation date used in -place of the last modified date. +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value +[snip] +XX / Google Photos + \ "google photos" +[snip] +Storage> google photos +** See help for google photos backend at: https://rclone.org/googlephotos/ ** -**WARNING**: This flag may have some unexpected consequences. +Google Application Client Id +Leave blank normally. +Enter a string value. Press Enter for the default (""). +client_id> +Google Application Client Secret +Leave blank normally. +Enter a string value. Press Enter for the default (""). +client_secret> +Set to make the Google Photos backend read only. -When uploading to your drive all files will be overwritten unless they -haven't been modified since their creation. And the inverse will occur -while downloading. This side effect can be avoided by using the -"--checksum" flag. +If you choose read only then rclone will only request read only access +to your photos, otherwise rclone will request full access. +Enter a boolean value (true or false). Press Enter for the default ("false"). +read_only> +Edit advanced config? (y/n) +y) Yes +n) No +y/n> n +Remote config +Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. +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 -This feature was implemented to retain photos capture date as recorded -by google photos. You will first need to check the "Create a Google -Photos folder" option in your google drive settings. You can then copy -or move the photos locally and use the date the image was taken -(created) set as the modification date. +*** IMPORTANT: All media items uploaded to Google Photos with rclone +*** are stored in full resolution at original quality. These uploads +*** will count towards storage in your Google Account. -Properties: +-------------------- +[remote] +type = google photos +token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2019-06-28T17:38:04.644930156+01:00"} +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -- Config: use_created_date -- Env Var: RCLONE_DRIVE_USE_CREATED_DATE -- Type: bool -- Default: false +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a +machine with no Internet browser available. -#### --drive-use-shared-date +Note that rclone runs a webserver on your local machine to collect the +token as returned from Google if using web browser to automatically +authenticate. This only +runs from the moment it opens your browser to the moment you get back +the verification code. This is on `http://127.0.0.1:53682/` and this +may require you to unblock it temporarily if you are running a host +firewall, or use manual mode. -Use date file was shared instead of modified date. +This remote is called `remote` and can now be used like this -Note that, as with "--drive-use-created-date", this flag may have -unexpected consequences when uploading/downloading files. +See all the albums in your photos -If both this flag and "--drive-use-created-date" are set, the created -date is used. + rclone lsd remote:album -Properties: +Make a new album -- Config: use_shared_date -- Env Var: RCLONE_DRIVE_USE_SHARED_DATE -- Type: bool -- Default: false + rclone mkdir remote:album/newAlbum -#### --drive-list-chunk +List the contents of an album -Size of listing chunk 100-1000, 0 to disable. + rclone ls remote:album/newAlbum -Properties: +Sync `/home/local/images` to the Google Photos, removing any excess +files in the album. -- Config: list_chunk -- Env Var: RCLONE_DRIVE_LIST_CHUNK -- Type: int -- Default: 1000 + rclone sync --interactive /home/local/image remote:album/newAlbum -#### --drive-impersonate +### Layout -Impersonate this user when using a service account. +As Google Photos is not a general purpose cloud storage system, the +backend is laid out to help you navigate it. -Properties: +The directories under `media` show different ways of categorizing the +media. Each file will appear multiple times. So if you want to make +a backup of your google photos you might choose to backup +`remote:media/by-month`. (**NB** `remote:media/by-day` is rather slow +at the moment so avoid for syncing.) -- Config: impersonate -- Env Var: RCLONE_DRIVE_IMPERSONATE -- Type: string -- Required: false +Note that all your photos and videos will appear somewhere under +`media`, but they may not appear under `album` unless you've put them +into albums. -#### --drive-upload-cutoff +``` +/ +- upload + - file1.jpg + - file2.jpg + - ... +- media + - all + - file1.jpg + - file2.jpg + - ... + - by-year + - 2000 + - file1.jpg + - ... + - 2001 + - file2.jpg + - ... + - ... + - by-month + - 2000 + - 2000-01 + - file1.jpg + - ... + - 2000-02 + - file2.jpg + - ... + - ... + - by-day + - 2000 + - 2000-01-01 + - file1.jpg + - ... + - 2000-01-02 + - file2.jpg + - ... + - ... +- album + - album name + - album name/sub +- shared-album + - album name + - album name/sub +- feature + - favorites + - file1.jpg + - file2.jpg +``` -Cutoff for switching to chunked upload. +There are two writable parts of the tree, the `upload` directory and +sub directories of the `album` directory. -Properties: +The `upload` directory is for uploading files you don't want to put +into albums. This will be empty to start with and will contain the +files you've uploaded for one rclone session only, becoming empty +again when you restart rclone. The use case for this would be if you +have a load of files you just want to once off dump into Google +Photos. For repeated syncing, uploading to `album` will work better. -- Config: upload_cutoff -- Env Var: RCLONE_DRIVE_UPLOAD_CUTOFF -- Type: SizeSuffix -- Default: 8Mi +Directories within the `album` directory are also writeable and you +may create new directories (albums) under `album`. If you copy files +with a directory hierarchy in there then rclone will create albums +with the `/` character in them. For example if you do -#### --drive-chunk-size + rclone copy /path/to/images remote:album/images -Upload chunk size. +and the images directory contains -Must a power of 2 >= 256k. +``` +images + - file1.jpg + dir + file2.jpg + dir2 + dir3 + file3.jpg +``` -Making this larger will improve performance, but note that each chunk -is buffered in memory one per transfer. +Then rclone will create the following albums with the following files in -Reducing this will reduce memory usage but decrease performance. +- images + - file1.jpg +- images/dir + - file2.jpg +- images/dir2/dir3 + - file3.jpg -Properties: +This means that you can use the `album` path pretty much like a normal +filesystem and it is a good target for repeated syncing. -- Config: chunk_size -- Env Var: RCLONE_DRIVE_CHUNK_SIZE -- Type: SizeSuffix -- Default: 8Mi +The `shared-album` directory shows albums shared with you or by you. +This is similar to the Sharing tab in the Google Photos web interface. -#### --drive-acknowledge-abuse -Set to allow files which return cannotDownloadAbusiveFile to be downloaded. +### Standard options -If downloading a file returns the error "This file has been identified -as malware or spam and cannot be downloaded" with the error code -"cannotDownloadAbusiveFile" then supply this flag to rclone to -indicate you acknowledge the risks of downloading the file and rclone -will download it anyway. +Here are the Standard options specific to google photos (Google Photos). -Note that if you are using service account it will need Manager -permission (not Content Manager) to for this flag to work. If the SA -does not have the right permission, Google will just ignore the flag. +#### --gphotos-client-id -Properties: +OAuth Client Id. -- Config: acknowledge_abuse -- Env Var: RCLONE_DRIVE_ACKNOWLEDGE_ABUSE -- Type: bool -- Default: false +Leave blank normally. -#### --drive-keep-revision-forever +Properties: -Keep new head revision of each file forever. +- Config: client_id +- Env Var: RCLONE_GPHOTOS_CLIENT_ID +- Type: string +- Required: false -Properties: +#### --gphotos-client-secret -- Config: keep_revision_forever -- Env Var: RCLONE_DRIVE_KEEP_REVISION_FOREVER -- Type: bool -- Default: false +OAuth Client Secret. -#### --drive-size-as-quota +Leave blank normally. -Show sizes as storage quota usage, not actual size. +Properties: -Show the size of a file as the storage quota used. This is the -current version plus any older versions that have been set to keep -forever. +- Config: client_secret +- Env Var: RCLONE_GPHOTOS_CLIENT_SECRET +- Type: string +- Required: false -**WARNING**: This flag may have some unexpected consequences. +#### --gphotos-read-only -It is not recommended to set this flag in your config - the -recommended usage is using the flag form --drive-size-as-quota when -doing rclone ls/lsl/lsf/lsjson/etc only. +Set to make the Google Photos backend read only. -If you do use this flag for syncing (not recommended) then you will -need to use --ignore size also. +If you choose read only then rclone will only request read only access +to your photos, otherwise rclone will request full access. Properties: -- Config: size_as_quota -- Env Var: RCLONE_DRIVE_SIZE_AS_QUOTA +- Config: read_only +- Env Var: RCLONE_GPHOTOS_READ_ONLY - Type: bool - Default: false -#### --drive-v2-download-min-size +### Advanced options -If Object's are greater, use drive v2 API to download. +Here are the Advanced options specific to google photos (Google Photos). + +#### --gphotos-token + +OAuth Access Token as a JSON blob. Properties: -- Config: v2_download_min_size -- Env Var: RCLONE_DRIVE_V2_DOWNLOAD_MIN_SIZE -- Type: SizeSuffix -- Default: off +- Config: token +- Env Var: RCLONE_GPHOTOS_TOKEN +- Type: string +- Required: false -#### --drive-pacer-min-sleep +#### --gphotos-auth-url -Minimum time to sleep between API calls. +Auth server URL. + +Leave blank to use the provider defaults. Properties: -- Config: pacer_min_sleep -- Env Var: RCLONE_DRIVE_PACER_MIN_SLEEP -- Type: Duration -- Default: 100ms +- Config: auth_url +- Env Var: RCLONE_GPHOTOS_AUTH_URL +- Type: string +- Required: false -#### --drive-pacer-burst +#### --gphotos-token-url -Number of API calls to allow without sleeping. +Token server url. -Properties: +Leave blank to use the provider defaults. -- Config: pacer_burst -- Env Var: RCLONE_DRIVE_PACER_BURST -- Type: int -- Default: 100 +Properties: -#### --drive-server-side-across-configs +- Config: token_url +- Env Var: RCLONE_GPHOTOS_TOKEN_URL +- Type: string +- Required: false -Deprecated: use --server-side-across-configs instead. +#### --gphotos-read-size -Allow server-side operations (e.g. copy) to work across different drive configs. +Set to read the size of media items. -This can be useful if you wish to do a server-side copy between two -different Google drives. Note that this isn't enabled by default -because it isn't easy to tell if it will work between any two -configurations. +Normally rclone does not read the size of media items since this takes +another transaction. This isn't necessary for syncing. However +rclone mount needs to know the size of files in advance of reading +them, so setting this flag when using rclone mount is recommended if +you want to read the media. Properties: -- Config: server_side_across_configs -- Env Var: RCLONE_DRIVE_SERVER_SIDE_ACROSS_CONFIGS +- Config: read_size +- Env Var: RCLONE_GPHOTOS_READ_SIZE - Type: bool - Default: false -#### --drive-disable-http2 - -Disable drive using http2. - -There is currently an unsolved issue with the google drive backend and -HTTP/2. HTTP/2 is therefore disabled by default for the drive backend -but can be re-enabled here. When the issue is solved this flag will -be removed. - -See: https://github.com/rclone/rclone/issues/3631 - +#### --gphotos-start-year +Year limits the photos to be downloaded to those which are uploaded after the given year. Properties: -- Config: disable_http2 -- Env Var: RCLONE_DRIVE_DISABLE_HTTP2 -- Type: bool -- Default: true +- Config: start_year +- Env Var: RCLONE_GPHOTOS_START_YEAR +- Type: int +- Default: 2000 -#### --drive-stop-on-upload-limit +#### --gphotos-include-archived -Make upload limit errors be fatal. +Also view and download archived media. -At the time of writing it is only possible to upload 750 GiB of data to -Google Drive a day (this is an undocumented limit). When this limit is -reached Google Drive produces a slightly different error message. When -this flag is set it causes these errors to be fatal. These will stop -the in-progress sync. +By default, rclone does not request archived media. Thus, when syncing, +archived media is not visible in directory listings or transferred. -Note that this detection is relying on error message strings which -Google don't document so it may break in the future. +Note that media in albums is always visible and synced, no matter +their archive status. -See: https://github.com/rclone/rclone/issues/3857 +With this flag, archived media are always visible in directory +listings and transferred. +Without this flag, archived media will not be visible in directory +listings and won't be transferred. Properties: -- Config: stop_on_upload_limit -- Env Var: RCLONE_DRIVE_STOP_ON_UPLOAD_LIMIT +- Config: include_archived +- Env Var: RCLONE_GPHOTOS_INCLUDE_ARCHIVED - Type: bool - Default: false -#### --drive-stop-on-download-limit - -Make download limit errors be fatal. - -At the time of writing it is only possible to download 10 TiB of data from -Google Drive a day (this is an undocumented limit). When this limit is -reached Google Drive produces a slightly different error message. When -this flag is set it causes these errors to be fatal. These will stop -the in-progress sync. +#### --gphotos-encoding -Note that this detection is relying on error message strings which -Google don't document so it may break in the future. +The encoding for the backend. +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. Properties: -- Config: stop_on_download_limit -- Env Var: RCLONE_DRIVE_STOP_ON_DOWNLOAD_LIMIT -- Type: bool -- Default: false - -#### --drive-skip-shortcuts +- Config: encoding +- Env Var: RCLONE_GPHOTOS_ENCODING +- Type: Encoding +- Default: Slash,CrLf,InvalidUtf8,Dot -If set skip shortcut files. +#### --gphotos-batch-mode -Normally rclone dereferences shortcut files making them appear as if -they are the original file (see [the shortcuts section](#shortcuts)). -If this flag is set then rclone will ignore shortcut files completely. +Upload file batching sync|async|off. +This sets the batch mode used by rclone. -Properties: +This has 3 possible values -- Config: skip_shortcuts -- Env Var: RCLONE_DRIVE_SKIP_SHORTCUTS -- Type: bool -- Default: false +- off - no batching +- sync - batch uploads and check completion (default) +- async - batch upload and don't check completion -#### --drive-skip-dangling-shortcuts +Rclone will close any outstanding batches when it exits which may make +a delay on quit. -If set skip dangling shortcut files. -If this is set then rclone will not show any dangling shortcuts in listings. +Properties: +- Config: batch_mode +- Env Var: RCLONE_GPHOTOS_BATCH_MODE +- Type: string +- Default: "sync" -Properties: +#### --gphotos-batch-size -- Config: skip_dangling_shortcuts -- Env Var: RCLONE_DRIVE_SKIP_DANGLING_SHORTCUTS -- Type: bool -- Default: false +Max number of files in upload batch. -#### --drive-resource-key +This sets the batch size of files to upload. It has to be less than 50. -Resource key for accessing a link-shared file. +By default this is 0 which means rclone which calculate the batch size +depending on the setting of batch_mode. -If you need to access files shared with a link like this +- batch_mode: async - default batch_size is 50 +- batch_mode: sync - default batch_size is the same as --transfers +- batch_mode: off - not in use - https://drive.google.com/drive/folders/XXX?resourcekey=YYY&usp=sharing +Rclone will close any outstanding batches when it exits which may make +a delay on quit. -Then you will need to use the first part "XXX" as the "root_folder_id" -and the second part "YYY" as the "resource_key" otherwise you will get -404 not found errors when trying to access the directory. +Setting this is a great idea if you are uploading lots of small files +as it will make them a lot quicker. You can use --transfers 32 to +maximise throughput. -See: https://developers.google.com/drive/api/guides/resource-keys -This resource key requirement only applies to a subset of old files. +Properties: -Note also that opening the folder once in the web interface (with the -user you've authenticated rclone with) seems to be enough so that the -resource key is not needed. +- Config: batch_size +- Env Var: RCLONE_GPHOTOS_BATCH_SIZE +- Type: int +- Default: 0 +#### --gphotos-batch-timeout -Properties: +Max time to allow an idle upload batch before uploading. -- Config: resource_key -- Env Var: RCLONE_DRIVE_RESOURCE_KEY -- Type: string -- Required: false +If an upload batch is idle for more than this long then it will be +uploaded. -#### --drive-fast-list-bug-fix +The default for this is 0 which means rclone will choose a sensible +default based on the batch_mode in use. -Work around a bug in Google Drive listing. +- batch_mode: async - default batch_timeout is 10s +- batch_mode: sync - default batch_timeout is 1s +- batch_mode: off - not in use -Normally rclone will work around a bug in Google Drive when using ---fast-list (ListR) where the search "(A in parents) or (B in -parents)" returns nothing sometimes. See #3114, #4289 and -https://issuetracker.google.com/issues/149522397 -Rclone detects this by finding no items in more than one directory -when listing and retries them as lists of individual directories. +Properties: -This means that if you have a lot of empty directories rclone will end -up listing them all individually and this can take many more API -calls. +- Config: batch_timeout +- Env Var: RCLONE_GPHOTOS_BATCH_TIMEOUT +- Type: Duration +- Default: 0s -This flag allows the work-around to be disabled. This is **not** -recommended in normal use - only if you have a particular case you are -having trouble with like many empty directories. +#### --gphotos-batch-commit-timeout +Max time to wait for a batch to finish committing Properties: -- Config: fast_list_bug_fix -- Env Var: RCLONE_DRIVE_FAST_LIST_BUG_FIX -- Type: bool -- Default: true +- Config: batch_commit_timeout +- Env Var: RCLONE_GPHOTOS_BATCH_COMMIT_TIMEOUT +- Type: Duration +- Default: 10m0s -#### --drive-encoding -The encoding for the backend. -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +## Limitations -Properties: +Only images and videos can be uploaded. If you attempt to upload non +videos or images or formats that Google Photos doesn't understand, +rclone will upload the file, then Google Photos will give an error +when it is put turned into a media item. -- Config: encoding -- Env Var: RCLONE_DRIVE_ENCODING -- Type: MultiEncoder -- Default: InvalidUtf8 +Note that all media items uploaded to Google Photos through the API +are stored in full resolution at "original quality" and **will** count +towards your storage quota in your Google Account. The API does +**not** offer a way to upload in "high quality" mode.. -#### --drive-env-auth +`rclone about` is not supported by the Google Photos backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. -Get IAM credentials from runtime (environment variables or instance meta data if no env vars). +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) +See [rclone about](https://rclone.org/commands/rclone_about/) -Only applies if service_account_file and service_account_credentials is blank. +### Downloading Images -Properties: +When Images are downloaded this strips EXIF location (according to the +docs and my tests). This is a limitation of the Google Photos API and +is covered by [bug #112096115](https://issuetracker.google.com/issues/112096115). -- Config: env_auth -- Env Var: RCLONE_DRIVE_ENV_AUTH -- Type: bool -- Default: false -- Examples: - - "false" - - Enter credentials in the next step. - - "true" - - Get GCP IAM credentials from the environment (env vars or IAM). +**The current google API does not allow photos to be downloaded at original resolution. This is very important if you are, for example, relying on "Google Photos" as a backup of your photos. You will not be able to use rclone to redownload original images. You could use 'google takeout' to recover the original photos as a last resort** -## Backend commands +### Downloading Videos -Here are the commands specific to the drive backend. +When videos are downloaded they are downloaded in a really compressed +version of the video compared to downloading it via the Google Photos +web interface. This is covered by [bug #113672044](https://issuetracker.google.com/issues/113672044). -Run them with +### Duplicates - rclone backend COMMAND remote: +If a file name is duplicated in a directory then rclone will add the +file ID into its name. So two files called `file.jpg` would then +appear as `file {123456}.jpg` and `file {ABCDEF}.jpg` (the actual IDs +are a lot longer alas!). -The help below will explain what arguments each command takes. +If you upload the same image (with the same binary data) twice then +Google Photos will deduplicate it. However it will retain the +filename from the first upload which may confuse rclone. For example +if you uploaded an image to `upload` then uploaded the same image to +`album/my_album` the filename of the image in `album/my_album` will be +what it was uploaded with initially, not what you uploaded it with to +`album`. In practise this shouldn't cause too many problems. -See the [backend](https://rclone.org/commands/rclone_backend/) command for more -info on how to pass options and arguments. +### Modification times -These can be run on a running backend using the rc command -[backend/command](https://rclone.org/rc/#backend-command). +The date shown of media in Google Photos is the creation date as +determined by the EXIF information, or the upload date if that is not +known. -### get +This is not changeable by rclone and is not the modification date of +the media on local disk. This means that rclone cannot use the dates +from Google Photos for syncing purposes. -Get command for fetching the drive config parameters +### Size - rclone backend get remote: [options] [+] +The Google Photos API does not return the size of media. This means +that when syncing to Google Photos, rclone can only do a file +existence check. -This is a get command which will be used to fetch the various drive config parameters +It is possible to read the size of the media, but this needs an extra +HTTP HEAD request per media item so is **very slow** and uses up a lot of +transactions. This can be enabled with the `--gphotos-read-size` +option or the `read_size = true` config parameter. -Usage Examples: +If you want to use the backend with `rclone mount` you may need to +enable this flag (depending on your OS and application using the +photos) otherwise you may not be able to read media off the mount. +You'll need to experiment to see if it works for you without the flag. - rclone backend get drive: [-o service_account_file] [-o chunk_size] - rclone rc backend/command command=get fs=drive: [-o service_account_file] [-o chunk_size] +### Albums +Rclone can only upload files to albums it created. This is a +[limitation of the Google Photos API](https://developers.google.com/photos/library/guides/manage-albums). -Options: +Rclone can remove files it uploaded from albums it created only. -- "chunk_size": show the current upload chunk size -- "service_account_file": show the current service account file +### Deleting files -### set +Rclone can remove files from albums it created, but note that the +Google Photos API does not allow media to be deleted permanently so +this media will still remain. See [bug #109759781](https://issuetracker.google.com/issues/109759781). -Set command for updating the drive config parameters +Rclone cannot delete files anywhere except under `album`. - rclone backend set remote: [options] [+] +### Deleting albums -This is a set command which will be used to update the various drive config parameters +The Google Photos API does not support deleting albums - see [bug #135714733](https://issuetracker.google.com/issues/135714733). -Usage Examples: +# Hasher - rclone backend set drive: [-o service_account_file=sa.json] [-o chunk_size=67108864] - rclone rc backend/command command=set fs=drive: [-o service_account_file=sa.json] [-o chunk_size=67108864] +Hasher is a special overlay backend to create remotes which handle +checksums for other remotes. It's main functions include: +- Emulate hash types unimplemented by backends +- Cache checksums to help with slow hashing of large local or (S)FTP files +- Warm up checksum cache from external SUM files +## Getting started -Options: +To use Hasher, first set up the underlying remote following the configuration +instructions for that remote. You can also use a local pathname instead of +a remote. Check that your base remote is working. -- "chunk_size": update the current upload chunk size -- "service_account_file": update the current service account file +Let's call the base remote `myRemote:path` here. Note that anything inside +`myRemote:path` will be handled by hasher and anything outside won't. +This means that if you are using a bucket based remote (S3, B2, Swift) +then you should put the bucket in the remote `s3:bucket`. -### shortcut +Now proceed to interactive or manual configuration. -Create shortcuts from files or directories +### Interactive configuration - rclone backend shortcut remote: [options] [+] +Run `rclone config`: +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> Hasher1 +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Handle checksums for other remotes + \ "hasher" +[snip] +Storage> hasher +Remote to cache checksums for, like myremote:mypath. +Enter a string value. Press Enter for the default (""). +remote> myRemote:path +Comma separated list of supported checksum types. +Enter a string value. Press Enter for the default ("md5,sha1"). +hashsums> md5 +Maximum time to keep checksums in cache. 0 = no cache, off = cache forever. +max_age> off +Edit advanced config? (y/n) +y) Yes +n) No +y/n> n +Remote config +-------------------- +[Hasher1] +type = hasher +remote = myRemote:path +hashsums = md5 +max_age = off +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -This command creates shortcuts from files or directories. +### Manual configuration -Usage: +Run `rclone config path` to see the path of current active config file, +usually `YOURHOME/.config/rclone/rclone.conf`. +Open it in your favorite text editor, find section for the base remote +and create new section for hasher like in the following examples: - rclone backend shortcut drive: source_item destination_shortcut - rclone backend shortcut drive: source_item -o target=drive2: destination_shortcut +``` +[Hasher1] +type = hasher +remote = myRemote:path +hashes = md5 +max_age = off -In the first example this creates a shortcut from the "source_item" -which can be a file or a directory to the "destination_shortcut". The -"source_item" and the "destination_shortcut" should be relative paths -from "drive:" +[Hasher2] +type = hasher +remote = /local/path +hashes = dropbox,sha1 +max_age = 24h +``` -In the second example this creates a shortcut from the "source_item" -relative to "drive:" to the "destination_shortcut" relative to -"drive2:". This may fail with a permission error if the user -authenticated with "drive2:" can't read files from "drive:". +Hasher takes basically the following parameters: +- `remote` is required, +- `hashes` is a comma separated list of supported checksums + (by default `md5,sha1`), +- `max_age` - maximum time to keep a checksum value in the cache, + `0` will disable caching completely, + `off` will cache "forever" (that is until the files get changed). + +Make sure the `remote` has `:` (colon) in. If you specify the remote without +a colon then rclone will use a local directory of that name. So if you use +a remote of `/local/path` then rclone will handle hashes for that directory. +If you use `remote = name` literally then rclone will put files +**in a directory called `name` located under current directory**. +## Usage -Options: +### Basic operations + +Now you can use it as `Hasher2:subdir/file` instead of base remote. +Hasher will transparently update cache with new checksums when a file +is fully read or overwritten, like: +``` +rclone copy External:path/file Hasher:dest/path -- "target": optional target remote for the shortcut destination +rclone cat Hasher:path/to/file > /dev/null +``` -### drives +The way to refresh **all** cached checksums (even unsupported by the base backend) +for a subtree is to **re-download** all files in the subtree. For example, +use `hashsum --download` using **any** supported hashsum on the command line +(we just care to re-read): +``` +rclone hashsum MD5 --download Hasher:path/to/subtree > /dev/null -List the Shared Drives available to this account +rclone backend dump Hasher:path/to/subtree +``` - rclone backend drives remote: [options] [+] +You can print or drop hashsum cache using custom backend commands: +``` +rclone backend dump Hasher:dir/subdir -This command lists the Shared Drives (Team Drives) available to this -account. +rclone backend drop Hasher: +``` -Usage: +### Pre-Seed from a SUM File - rclone backend [-o config] drives drive: +Hasher supports two backend commands: generic SUM file `import` and faster +but less consistent `stickyimport`. -This will return a JSON list of objects like this +``` +rclone backend import Hasher:dir/subdir SHA1 /path/to/SHA1SUM [--checkers 4] +``` - [ - { - "id": "0ABCDEF-01234567890", - "kind": "drive#teamDrive", - "name": "My Drive" - }, - { - "id": "0ABCDEFabcdefghijkl", - "kind": "drive#teamDrive", - "name": "Test Drive" - } - ] +Instead of SHA1 it can be any hash supported by the remote. The last argument +can point to either a local or an `other-remote:path` text file in SUM format. +The command will parse the SUM file, then walk down the path given by the +first argument, snapshot current fingerprints and fill in the cache entries +correspondingly. +- Paths in the SUM file are treated as relative to `hasher:dir/subdir`. +- The command will **not** check that supplied values are correct. + You **must know** what you are doing. +- This is a one-time action. The SUM file will not get "attached" to the + remote. Cache entries can still be overwritten later, should the object's + fingerprint change. +- The tree walk can take long depending on the tree size. You can increase + `--checkers` to make it faster. Or use `stickyimport` if you don't care + about fingerprints and consistency. -With the -o config parameter it will output the list in a format -suitable for adding to a config file to make aliases for all the -drives found and a combined drive. +``` +rclone backend stickyimport hasher:path/to/data sha1 remote:/path/to/sum.sha1 +``` - [My Drive] - type = alias - remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=: +`stickyimport` is similar to `import` but works much faster because it +does not need to stat existing files and skips initial tree walk. +Instead of binding cache entries to file fingerprints it creates _sticky_ +entries bound to the file name alone ignoring size, modification time etc. +Such hash entries can be replaced only by `purge`, `delete`, `backend drop` +or by full re-read/re-write of the files. - [Test Drive] - type = alias - remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=: +## Configuration reference - [AllDrives] - type = combine - upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:" -Adding this to the rclone config file will cause those team drives to -be accessible with the aliases shown. Any illegal characters will be -substituted with "_" and duplicate names will have numbers suffixed. -It will also add a remote called AllDrives which shows all the shared -drives combined into one directory tree. +### Standard options +Here are the Standard options specific to hasher (Better checksums for other remotes). -### untrash +#### --hasher-remote -Untrash files and directories +Remote to cache checksums for (e.g. myRemote:path). - rclone backend untrash remote: [options] [+] +Properties: -This command untrashes all the files and directories in the directory -passed in recursively. +- Config: remote +- Env Var: RCLONE_HASHER_REMOTE +- Type: string +- Required: true -Usage: +#### --hasher-hashes -This takes an optional directory to trash which make this easier to -use via the API. +Comma separated list of supported checksum types. - rclone backend untrash drive:directory - rclone backend --interactive untrash drive:directory subdir +Properties: -Use the --interactive/-i or --dry-run flag to see what would be restored before restoring it. +- Config: hashes +- Env Var: RCLONE_HASHER_HASHES +- Type: CommaSepList +- Default: md5,sha1 -Result: +#### --hasher-max-age - { - "Untrashed": 17, - "Errors": 0 - } +Maximum time to keep checksums in cache (0 = no cache, off = cache forever). +Properties: -### copyid +- Config: max_age +- Env Var: RCLONE_HASHER_MAX_AGE +- Type: Duration +- Default: off -Copy files by ID +### Advanced options - rclone backend copyid remote: [options] [+] +Here are the Advanced options specific to hasher (Better checksums for other remotes). -This command copies files by ID +#### --hasher-auto-size -Usage: +Auto-update checksum for files smaller than this size (disabled by default). - rclone backend copyid drive: ID path - rclone backend copyid drive: ID1 path1 ID2 path2 +Properties: -It copies the drive file with ID given to the path (an rclone path which -will be passed internally to rclone copyto). The ID and path pairs can be -repeated. +- Config: auto_size +- Env Var: RCLONE_HASHER_AUTO_SIZE +- Type: SizeSuffix +- Default: 0 -The path should end with a / to indicate copy the file as named to -this directory. If it doesn't end with a / then the last path -component will be used as the file name. +### Metadata -If the destination is a drive backend then server-side copying will be -attempted if possible. +Any metadata supported by the underlying remote is read and written. -Use the --interactive/-i or --dry-run flag to see what would be copied before copying. +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. +## Backend commands -### exportformats +Here are the commands specific to the hasher backend. -Dump the export formats for debug purposes +Run them with - rclone backend exportformats remote: [options] [+] + rclone backend COMMAND remote: -### importformats +The help below will explain what arguments each command takes. -Dump the import formats for debug purposes +See the [backend](https://rclone.org/commands/rclone_backend/) command for more +info on how to pass options and arguments. - rclone backend importformats remote: [options] [+] +These can be run on a running backend using the rc command +[backend/command](https://rclone.org/rc/#backend-command). +### drop +Drop cache -## Limitations + rclone backend drop remote: [options] [+] -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 MiB/s but lots of -small files can take a long time. +Completely drop checksum cache. +Usage Example: + rclone backend drop hasher: -Server side copies are also subject to a separate rate limit. If you -see User rate limit exceeded errors, wait at least 24 hours and retry. -You can disable server-side copies with `--disable copy` to download -and upload the files if you prefer. -### Limitations of Google Docs +### dump -Google docs will appear as size -1 in `rclone ls`, `rclone ncdu` etc, -and as size 0 in anything which uses the VFS layer, e.g. `rclone mount` -and `rclone serve`. When calculating directory totals, e.g. in -`rclone size` and `rclone ncdu`, they will be counted in as empty -files. +Dump the database -This is because rclone can't find out the size of the Google docs -without downloading them. + rclone backend dump remote: [options] [+] -Google docs will transfer correctly with `rclone sync`, `rclone copy` -etc as rclone knows to ignore the size when doing the transfer. +Dump cache records covered by the current remote -However an unfortunate consequence of this is that you may not be able -to download Google docs using `rclone mount`. If it doesn't work you -will get a 0 sized file. If you try again the doc may gain its -correct size and be downloadable. Whether it will work on not depends -on the application accessing the mount and the OS you are running - -experiment to find out if it does work for you! +### fulldump -### Duplicated files +Full dump of the database -Sometimes, for no reason I've been able to track down, drive will -duplicate a file that rclone uploads. Drive unlike all the other -remotes can have duplicated files. + rclone backend fulldump remote: [options] [+] -Duplicated files cause problems with the syncing and you will see -messages in the log about duplicates. +Dump all cache records in the database -Use `rclone dedupe` to fix duplicated files. +### import -Note that this isn't just a problem with rclone, even Google Photos on -Android duplicates files on drive sometimes. +Import a SUM file -### Rclone appears to be re-copying files it shouldn't + rclone backend import remote: [options] [+] -The most likely cause of this is the duplicated file issue above - run -`rclone dedupe` and check your logs for duplicate object or directory -messages. +Amend hash cache from a SUM file and bind checksums to files by size/time. +Usage Example: + rclone backend import hasher:subdir md5 /path/to/sum.md5 -This can also be caused by a delay/caching on google drive's end when -comparing directory listings. Specifically with team drives used in -combination with --fast-list. Files that were uploaded recently may -not appear on the directory list sent to rclone when using --fast-list. -Waiting a moderate period of time between attempts (estimated to be -approximately 1 hour) and/or not using --fast-list both seem to be -effective in preventing the problem. +### stickyimport -## Making your own client_id +Perform fast import of a SUM file -When you use rclone with Google drive in its default configuration you -are using rclone's client_id. This is shared between all the rclone -users. There is a global rate limit on the number of queries per -second that each client_id can do set by Google. rclone already has a -high quota and I will continue to make sure it is high enough by -contacting Google. + rclone backend stickyimport remote: [options] [+] -It is strongly recommended to use your own client ID as the default rclone ID is heavily used. If you have multiple services running, it is recommended to use an API key for each service. The default Google quota is 10 transactions per second so it is recommended to stay under that number as if you use more than that, it will cause rclone to rate limit and make things slower. +Fill hash cache from a SUM file without verifying file fingerprints. +Usage Example: + rclone backend stickyimport hasher:subdir md5 remote:path/to/sum.md5 -Here is how to create your own Google Drive client ID for rclone: -1. Log into the [Google API -Console](https://console.developers.google.com/) with your Google -account. It doesn't matter what Google account you use. (It need not -be the same account as the Google Drive you want to access) -2. Select a project or create a new project. -3. Under "ENABLE APIS AND SERVICES" search for "Drive", and enable the -"Google Drive API". +## Implementation details (advanced) -4. Click "Credentials" in the left-side panel (not "Create -credentials", which opens the wizard). +This section explains how various rclone operations work on a hasher remote. -5. If you already configured an "Oauth Consent Screen", then skip -to the next step; if not, click on "CONFIGURE CONSENT SCREEN" button -(near the top right corner of the right panel), then select "External" -and click on "CREATE"; on the next screen, enter an "Application name" -("rclone" is OK); enter "User Support Email" (your own email is OK); -enter "Developer Contact Email" (your own email is OK); then click on -"Save" (all other data is optional). You will also have to add some scopes, -including `.../auth/docs` and `.../auth/drive` in order to be able to edit, -create and delete files with RClone. You may also want to include the -`../auth/drive.metadata.readonly` scope. After adding scopes, click -"Save and continue" to add test users. Be sure to add your own account to -the test users. Once you've added yourself as a test user and saved the -changes, click again on "Credentials" on the left panel to go back to -the "Credentials" screen. +**Disclaimer. This section describes current implementation which can +change in future rclone versions!.** - (PS: if you are a GSuite user, you could also select "Internal" instead -of "External" above, but this will restrict API use to Google Workspace -users in your organisation). +### Hashsum command -6. Click on the "+ CREATE CREDENTIALS" button at the top of the screen, -then select "OAuth client ID". +The `rclone hashsum` (or `md5sum` or `sha1sum`) command will: -7. Choose an application type of "Desktop app" and click "Create". (the default name is fine) +1. if requested hash is supported by lower level, just pass it. +2. if object size is below `auto_size` then download object and calculate + _requested_ hashes on the fly. +3. if unsupported and the size is big enough, build object `fingerprint` + (including size, modtime if supported, first-found _other_ hash if any). +4. if the strict match is found in cache for the requested remote, return + the stored hash. +5. if remote found but fingerprint mismatched, then purge the entry and + proceed to step 6. +6. if remote not found or had no requested hash type or after step 5: + download object, calculate all _supported_ hashes on the fly and store + in cache; return requested hash. -8. It will show you a client ID and client secret. Make a note of these. - - (If you selected "External" at Step 5 continue to Step 9. - If you chose "Internal" you don't need to publish and can skip straight to - Step 10 but your destination drive must be part of the same Google Workspace.) +### Other operations -9. Go to "Oauth consent screen" and then click "PUBLISH APP" button and confirm. - You will also want to add yourself as a test user. +- whenever a file is uploaded or downloaded **in full**, capture the stream + to calculate all supported hashes on the fly and update database +- server-side `move` will update keys of existing cache entries +- `deletefile` will remove a single cache entry +- `purge` will remove all cache entries under the purged path -10. Provide the noted client ID and client secret to rclone. +Note that setting `max_age = 0` will disable checksum caching completely. -Be aware that, due to the "enhanced security" recently introduced by -Google, you are theoretically expected to "submit your app for verification" -and then wait a few weeks(!) for their response; in practice, you can go right -ahead and use the client ID and client secret with rclone, the only issue will -be a very scary confirmation screen shown when you connect via your browser -for rclone to be able to get its token-id (but as this only happens during -the remote configuration, it's not such a big deal). Keeping the application in -"Testing" will work as well, but the limitation is that any grants will expire -after a week, which can be annoying to refresh constantly. If, for whatever -reason, a short grant time is not a problem, then keeping the application in -testing mode would also be sufficient. +If you set `max_age = off`, checksums in cache will never age, unless you +fully rewrite or delete the file. -(Thanks to @balazer on github for these instructions.) +### Cache storage -Sometimes, creation of an OAuth consent in Google API Console fails due to an error message -“The request failed because changes to one of the field of the resource is not supported”. -As a convenient workaround, the necessary Google Drive API key can be created on the -[Python Quickstart](https://developers.google.com/drive/api/v3/quickstart/python) page. -Just push the Enable the Drive API button to receive the Client ID and Secret. -Note that it will automatically create a new project in the API Console. +Cached checksums are stored as `bolt` database files under rclone cache +directory, usually `~/.cache/rclone/kv/`. Databases are maintained +one per _base_ backend, named like `BaseRemote~hasher.bolt`. +Checksums for multiple `alias`-es into a single base backend +will be stored in the single database. All local paths are treated as +aliases into the `local` backend (unless encrypted or chunked) and stored +in `~/.cache/rclone/kv/local~hasher.bolt`. +Databases can be shared between multiple rclone processes. -# Google Photos +# HDFS -The rclone backend for [Google Photos](https://www.google.com/photos/about/) is -a specialized backend for transferring photos and videos to and from -Google Photos. +[HDFS](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html) is a +distributed file-system, part of the [Apache Hadoop](https://hadoop.apache.org/) framework. -**NB** The Google Photos API which rclone uses has quite a few -limitations, so please read the [limitations section](#limitations) -carefully to make sure it is suitable for your use. +Paths are specified as `remote:` or `remote:path/to/dir`. ## Configuration -The initial setup for google cloud storage involves getting a token from Google Photos -which you need to do in your browser. `rclone config` walks you -through it. - -Here is an example of how to make a remote called `remote`. First run: +Here is an example of how to make a remote called `remote`. First run: rclone config @@ -33852,793 +35207,691 @@ name> remote Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value -[snip] -XX / Google Photos - \ "google photos" -[snip] -Storage> google photos -** See help for google photos backend at: https://rclone.org/googlephotos/ ** +[skip] +XX / Hadoop distributed file system + \ "hdfs" +[skip] +Storage> hdfs +** See help for hdfs backend at: https://rclone.org/hdfs/ ** -Google Application Client Id -Leave blank normally. +hadoop name node and port Enter a string value. Press Enter for the default (""). -client_id> -Google Application Client Secret -Leave blank normally. +Choose a number from below, or type in your own value + 1 / Connect to host namenode at port 8020 + \ "namenode:8020" +namenode> namenode.hadoop:8020 +hadoop user name Enter a string value. Press Enter for the default (""). -client_secret> -Set to make the Google Photos backend read only. - -If you choose read only then rclone will only request read only access -to your photos, otherwise rclone will request full access. -Enter a boolean value (true or false). Press Enter for the default ("false"). -read_only> +Choose a number from below, or type in your own value + 1 / Connect to hdfs as root + \ "root" +username> root Edit advanced config? (y/n) y) Yes -n) No +n) No (default) y/n> n Remote config -Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. -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 - -*** IMPORTANT: All media items uploaded to Google Photos with rclone -*** are stored in full resolution at original quality. These uploads -*** will count towards storage in your Google Account. - -------------------- [remote] -type = google photos -token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2019-06-28T17:38:04.644930156+01:00"} --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` - -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a -machine with no Internet browser available. - -Note that rclone runs a webserver on your local machine to collect the -token as returned from Google if using web browser to automatically -authenticate. This only -runs from the moment it opens your browser to the moment you get back -the verification code. This is on `http://127.0.0.1:53682/` and this -may require you to unblock it temporarily if you are running a host -firewall, or use manual mode. - -This remote is called `remote` and can now be used like this - -See all the albums in your photos - - rclone lsd remote:album - -Make a new album - - rclone mkdir remote:album/newAlbum - -List the contents of an album - - rclone ls remote:album/newAlbum - -Sync `/home/local/images` to the Google Photos, removing any excess -files in the album. - - rclone sync --interactive /home/local/image remote:album/newAlbum - -### Layout - -As Google Photos is not a general purpose cloud storage system, the -backend is laid out to help you navigate it. - -The directories under `media` show different ways of categorizing the -media. Each file will appear multiple times. So if you want to make -a backup of your google photos you might choose to backup -`remote:media/by-month`. (**NB** `remote:media/by-day` is rather slow -at the moment so avoid for syncing.) - -Note that all your photos and videos will appear somewhere under -`media`, but they may not appear under `album` unless you've put them -into albums. - -``` -/ -- upload - - file1.jpg - - file2.jpg - - ... -- media - - all - - file1.jpg - - file2.jpg - - ... - - by-year - - 2000 - - file1.jpg - - ... - - 2001 - - file2.jpg - - ... - - ... - - by-month - - 2000 - - 2000-01 - - file1.jpg - - ... - - 2000-02 - - file2.jpg - - ... - - ... - - by-day - - 2000 - - 2000-01-01 - - file1.jpg - - ... - - 2000-01-02 - - file2.jpg - - ... - - ... -- album - - album name - - album name/sub -- shared-album - - album name - - album name/sub -- feature - - favorites - - file1.jpg - - file2.jpg +type = hdfs +namenode = namenode.hadoop:8020 +username = root +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +Current remotes: + +Name Type +==== ==== +hadoop hdfs + +e) Edit existing remote +n) New remote +d) Delete remote +r) Rename remote +c) Copy remote +s) Set configuration password +q) Quit config +e/n/d/r/c/s/q> q ``` -There are two writable parts of the tree, the `upload` directory and -sub directories of the `album` directory. +This remote is called `remote` and can now be used like this -The `upload` directory is for uploading files you don't want to put -into albums. This will be empty to start with and will contain the -files you've uploaded for one rclone session only, becoming empty -again when you restart rclone. The use case for this would be if you -have a load of files you just want to once off dump into Google -Photos. For repeated syncing, uploading to `album` will work better. +See all the top level directories -Directories within the `album` directory are also writeable and you -may create new directories (albums) under `album`. If you copy files -with a directory hierarchy in there then rclone will create albums -with the `/` character in them. For example if you do + rclone lsd remote: - rclone copy /path/to/images remote:album/images +List the contents of a directory -and the images directory contains + rclone ls remote:directory + +Sync the remote `directory` to `/home/local/directory`, deleting any excess files. + + rclone sync --interactive remote:directory /home/local/directory + +### Setting up your own HDFS instance for testing + +You may start with a [manual setup](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/SingleCluster.html) +or use the docker image from the tests: + +If you want to build the docker image ``` -images - - file1.jpg - dir - file2.jpg - dir2 - dir3 - file3.jpg +git clone https://github.com/rclone/rclone.git +cd rclone/fstest/testserver/images/test-hdfs +docker build --rm -t rclone/test-hdfs . ``` -Then rclone will create the following albums with the following files in +Or you can just use the latest one pushed -- images - - file1.jpg -- images/dir - - file2.jpg -- images/dir2/dir3 - - file3.jpg +``` +docker run --rm --name "rclone-hdfs" -p 127.0.0.1:9866:9866 -p 127.0.0.1:8020:8020 --hostname "rclone-hdfs" rclone/test-hdfs +``` -This means that you can use the `album` path pretty much like a normal -filesystem and it is a good target for repeated syncing. +**NB** it need few seconds to startup. -The `shared-album` directory shows albums shared with you or by you. -This is similar to the Sharing tab in the Google Photos web interface. +For this docker image the remote needs to be configured like this: +``` +[remote] +type = hdfs +namenode = 127.0.0.1:8020 +username = root +``` -### Standard options +You can stop this image with `docker kill rclone-hdfs` (**NB** it does not use volumes, so all data +uploaded will be lost.) -Here are the Standard options specific to google photos (Google Photos). +### Modification times -#### --gphotos-client-id +Time accurate to 1 second is stored. -OAuth Client Id. +### Checksum -Leave blank normally. +No checksums are implemented. -Properties: +### Usage information -- Config: client_id -- Env Var: RCLONE_GPHOTOS_CLIENT_ID -- Type: string -- Required: false +You can use the `rclone about remote:` command which will display filesystem size and current usage. -#### --gphotos-client-secret +### Restricted filename characters -OAuth Client Secret. +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) +the following characters are also replaced: -Leave blank normally. +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| : | 0x3A | : | -Properties: +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8). -- Config: client_secret -- Env Var: RCLONE_GPHOTOS_CLIENT_SECRET -- Type: string -- Required: false -#### --gphotos-read-only +### Standard options -Set to make the Google Photos backend read only. +Here are the Standard options specific to hdfs (Hadoop distributed file system). -If you choose read only then rclone will only request read only access -to your photos, otherwise rclone will request full access. +#### --hdfs-namenode -Properties: +Hadoop name nodes and ports. -- Config: read_only -- Env Var: RCLONE_GPHOTOS_READ_ONLY -- Type: bool -- Default: false +E.g. "namenode-1:8020,namenode-2:8020,..." to connect to host namenodes at port 8020. -### Advanced options +Properties: -Here are the Advanced options specific to google photos (Google Photos). +- Config: namenode +- Env Var: RCLONE_HDFS_NAMENODE +- Type: CommaSepList +- Default: -#### --gphotos-token +#### --hdfs-username -OAuth Access Token as a JSON blob. +Hadoop user name. Properties: -- Config: token -- Env Var: RCLONE_GPHOTOS_TOKEN +- Config: username +- Env Var: RCLONE_HDFS_USERNAME - Type: string - Required: false +- Examples: + - "root" + - Connect to hdfs as root. -#### --gphotos-auth-url +### Advanced options -Auth server URL. +Here are the Advanced options specific to hdfs (Hadoop distributed file system). -Leave blank to use the provider defaults. +#### --hdfs-service-principal-name + +Kerberos service principal name for the namenode. + +Enables KERBEROS authentication. Specifies the Service Principal Name +(SERVICE/FQDN) for the namenode. E.g. \"hdfs/namenode.hadoop.docker\" +for namenode running as service 'hdfs' with FQDN 'namenode.hadoop.docker'. Properties: -- Config: auth_url -- Env Var: RCLONE_GPHOTOS_AUTH_URL +- Config: service_principal_name +- Env Var: RCLONE_HDFS_SERVICE_PRINCIPAL_NAME - Type: string - Required: false -#### --gphotos-token-url +#### --hdfs-data-transfer-protection -Token server url. +Kerberos data transfer protection: authentication|integrity|privacy. -Leave blank to use the provider defaults. +Specifies whether or not authentication, data signature integrity +checks, and wire encryption are required when communicating with +the datanodes. Possible values are 'authentication', 'integrity' +and 'privacy'. Used only with KERBEROS enabled. Properties: -- Config: token_url -- Env Var: RCLONE_GPHOTOS_TOKEN_URL +- Config: data_transfer_protection +- Env Var: RCLONE_HDFS_DATA_TRANSFER_PROTECTION - Type: string - Required: false +- Examples: + - "privacy" + - Ensure authentication, integrity and encryption enabled. -#### --gphotos-read-size +#### --hdfs-encoding -Set to read the size of media items. +The encoding for the backend. -Normally rclone does not read the size of media items since this takes -another transaction. This isn't necessary for syncing. However -rclone mount needs to know the size of files in advance of reading -them, so setting this flag when using rclone mount is recommended if -you want to read the media. +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. Properties: -- Config: read_size -- Env Var: RCLONE_GPHOTOS_READ_SIZE -- Type: bool -- Default: false - -#### --gphotos-start-year +- Config: encoding +- Env Var: RCLONE_HDFS_ENCODING +- Type: Encoding +- Default: Slash,Colon,Del,Ctl,InvalidUtf8,Dot -Year limits the photos to be downloaded to those which are uploaded after the given year. -Properties: -- Config: start_year -- Env Var: RCLONE_GPHOTOS_START_YEAR -- Type: int -- Default: 2000 +## Limitations -#### --gphotos-include-archived +- No server-side `Move` or `DirMove`. +- Checksums not implemented. -Also view and download archived media. +# HiDrive -By default, rclone does not request archived media. Thus, when syncing, -archived media is not visible in directory listings or transferred. +Paths are specified as `remote:path` -Note that media in albums is always visible and synced, no matter -their archive status. +Paths may be as deep as required, e.g. `remote:directory/subdirectory`. -With this flag, archived media are always visible in directory -listings and transferred. +The initial setup for hidrive involves getting a token from HiDrive +which you need to do in your browser. +`rclone config` walks you through it. -Without this flag, archived media will not be visible in directory -listings and won't be transferred. +## Configuration -Properties: +Here is an example of how to make a remote called `remote`. First run: -- Config: include_archived -- Env Var: RCLONE_GPHOTOS_INCLUDE_ARCHIVED -- Type: bool -- Default: false + rclone config -#### --gphotos-encoding +This will guide you through an interactive setup process: -The encoding for the backend. +``` +No remotes found - make a new one +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / HiDrive + \ "hidrive" +[snip] +Storage> hidrive +OAuth Client Id - Leave blank normally. +client_id> +OAuth Client Secret - Leave blank normally. +client_secret> +Access permissions that rclone should use when requesting access from HiDrive. +Leave blank normally. +scope_access> +Edit advanced config? +y/n> n +Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. +y/n> y +If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=xxxxxxxxxxxxxxxxxxxxxx +Log in and authorize rclone for access +Waiting for code... +Got code +-------------------- +[remote] +type = hidrive +token = {"access_token":"xxxxxxxxxxxxxxxxxxxx","token_type":"Bearer","refresh_token":"xxxxxxxxxxxxxxxxxxxxxxx","expiry":"xxxxxxxxxxxxxxxxxxxxxxx"} +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +**You should be aware that OAuth-tokens can be used to access your account +and hence should not be shared with other persons.** +See the [below section](#keeping-your-tokens-safe) for more information. -Properties: +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a +machine with no Internet browser available. -- Config: encoding -- Env Var: RCLONE_GPHOTOS_ENCODING -- Type: MultiEncoder -- Default: Slash,CrLf,InvalidUtf8,Dot +Note that rclone runs a webserver on your local machine to collect the +token as returned from HiDrive. This only runs from the moment it opens +your browser to the moment you get back the verification code. +The webserver runs on `http://127.0.0.1:53682/`. +If local port `53682` is protected by a firewall you may need to temporarily +unblock the firewall to complete authorization. +Once configured you can then use `rclone` like this, +List directories in top level of your HiDrive root folder -## Limitations + rclone lsd remote: -Only images and videos can be uploaded. If you attempt to upload non -videos or images or formats that Google Photos doesn't understand, -rclone will upload the file, then Google Photos will give an error -when it is put turned into a media item. +List all the files in your HiDrive filesystem -Note that all media items uploaded to Google Photos through the API -are stored in full resolution at "original quality" and **will** count -towards your storage quota in your Google Account. The API does -**not** offer a way to upload in "high quality" mode.. + rclone ls remote: -`rclone about` is not supported by the Google Photos backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. +To copy a local directory to a HiDrive directory called backup -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) -See [rclone about](https://rclone.org/commands/rclone_about/) + rclone copy /home/source remote:backup -### Downloading Images +### Keeping your tokens safe -When Images are downloaded this strips EXIF location (according to the -docs and my tests). This is a limitation of the Google Photos API and -is covered by [bug #112096115](https://issuetracker.google.com/issues/112096115). +Any OAuth-tokens will be stored by rclone in the remote's configuration file as unencrypted text. +Anyone can use a valid refresh-token to access your HiDrive filesystem without knowing your password. +Therefore you should make sure no one else can access your configuration. -**The current google API does not allow photos to be downloaded at original resolution. This is very important if you are, for example, relying on "Google Photos" as a backup of your photos. You will not be able to use rclone to redownload original images. You could use 'google takeout' to recover the original photos as a last resort** +It is possible to encrypt rclone's configuration file. +You can find information on securing your configuration file by viewing the [configuration encryption docs](https://rclone.org/docs/#configuration-encryption). -### Downloading Videos +### Invalid refresh token -When videos are downloaded they are downloaded in a really compressed -version of the video compared to downloading it via the Google Photos -web interface. This is covered by [bug #113672044](https://issuetracker.google.com/issues/113672044). +As can be verified [here](https://developer.hidrive.com/basics-flows/), +each `refresh_token` (for Native Applications) is valid for 60 days. +If used to access HiDrivei, its validity will be automatically extended. -### Duplicates +This means that if you -If a file name is duplicated in a directory then rclone will add the -file ID into its name. So two files called `file.jpg` would then -appear as `file {123456}.jpg` and `file {ABCDEF}.jpg` (the actual IDs -are a lot longer alas!). + * Don't use the HiDrive remote for 60 days -If you upload the same image (with the same binary data) twice then -Google Photos will deduplicate it. However it will retain the -filename from the first upload which may confuse rclone. For example -if you uploaded an image to `upload` then uploaded the same image to -`album/my_album` the filename of the image in `album/my_album` will be -what it was uploaded with initially, not what you uploaded it with to -`album`. In practise this shouldn't cause too many problems. +then rclone will return an error which includes a text +that implies the refresh token is *invalid* or *expired*. -### Modified time +To fix this you will need to authorize rclone to access your HiDrive account again. -The date shown of media in Google Photos is the creation date as -determined by the EXIF information, or the upload date if that is not -known. +Using -This is not changeable by rclone and is not the modification date of -the media on local disk. This means that rclone cannot use the dates -from Google Photos for syncing purposes. + rclone config reconnect remote: -### Size +the process is very similar to the process of initial setup exemplified before. -The Google Photos API does not return the size of media. This means -that when syncing to Google Photos, rclone can only do a file -existence check. +### Modification times and hashes -It is possible to read the size of the media, but this needs an extra -HTTP HEAD request per media item so is **very slow** and uses up a lot of -transactions. This can be enabled with the `--gphotos-read-size` -option or the `read_size = true` config parameter. +HiDrive allows modification times to be set on objects accurate to 1 second. -If you want to use the backend with `rclone mount` you may need to -enable this flag (depending on your OS and application using the -photos) otherwise you may not be able to read media off the mount. -You'll need to experiment to see if it works for you without the flag. +HiDrive supports [its own hash type](https://static.hidrive.com/dev/0001) +which is used to verify the integrity of file contents after successful transfers. -### Albums +### Restricted filename characters -Rclone can only upload files to albums it created. This is a -[limitation of the Google Photos API](https://developers.google.com/photos/library/guides/manage-albums). +HiDrive cannot store files or folders that include +`/` (0x2F) or null-bytes (0x00) in their name. +Any other characters can be used in the names of files or folders. +Additionally, files or folders cannot be named either of the following: `.` or `..` -Rclone can remove files it uploaded from albums it created only. +Therefore rclone will automatically replace these characters, +if files or folders are stored or accessed with such names. -### Deleting files +You can read about how this filename encoding works in general +[here](overview/#restricted-filenames). -Rclone can remove files from albums it created, but note that the -Google Photos API does not allow media to be deleted permanently so -this media will still remain. See [bug #109759781](https://issuetracker.google.com/issues/109759781). +Keep in mind that HiDrive only supports file or folder names +with a length of 255 characters or less. -Rclone cannot delete files anywhere except under `album`. +### Transfers -### Deleting albums +HiDrive limits file sizes per single request to a maximum of 2 GiB. +To allow storage of larger files and allow for better upload performance, +the hidrive backend will use a chunked transfer for files larger than 96 MiB. +Rclone will upload multiple parts/chunks of the file at the same time. +Chunks in the process of being uploaded are buffered in memory, +so you may want to restrict this behaviour on systems with limited resources. -The Google Photos API does not support deleting albums - see [bug #135714733](https://issuetracker.google.com/issues/135714733). +You can customize this behaviour using the following options: -# Hasher +* `chunk_size`: size of file parts +* `upload_cutoff`: files larger or equal to this in size will use a chunked transfer +* `upload_concurrency`: number of file-parts to upload at the same time -Hasher is a special overlay backend to create remotes which handle -checksums for other remotes. It's main functions include: -- Emulate hash types unimplemented by backends -- Cache checksums to help with slow hashing of large local or (S)FTP files -- Warm up checksum cache from external SUM files +See the below section about configuration options for more details. -## Getting started +### Root folder -To use Hasher, first set up the underlying remote following the configuration -instructions for that remote. You can also use a local pathname instead of -a remote. Check that your base remote is working. +You can set the root folder for rclone. +This is the directory that rclone considers to be the root of your HiDrive. -Let's call the base remote `myRemote:path` here. Note that anything inside -`myRemote:path` will be handled by hasher and anything outside won't. -This means that if you are using a bucket based remote (S3, B2, Swift) -then you should put the bucket in the remote `s3:bucket`. +Usually, you will leave this blank, and rclone will use the root of the account. -Now proceed to interactive or manual configuration. +However, you can set this to restrict rclone to a specific folder hierarchy. -### Interactive configuration +This works by prepending the contents of the `root_prefix` option +to any paths accessed by rclone. +For example, the following two ways to access the home directory are equivalent: -Run `rclone config`: -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> Hasher1 -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Handle checksums for other remotes - \ "hasher" -[snip] -Storage> hasher -Remote to cache checksums for, like myremote:mypath. -Enter a string value. Press Enter for the default (""). -remote> myRemote:path -Comma separated list of supported checksum types. -Enter a string value. Press Enter for the default ("md5,sha1"). -hashsums> md5 -Maximum time to keep checksums in cache. 0 = no cache, off = cache forever. -max_age> off -Edit advanced config? (y/n) -y) Yes -n) No -y/n> n -Remote config --------------------- -[Hasher1] -type = hasher -remote = myRemote:path -hashsums = md5 -max_age = off --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` + rclone lsd --hidrive-root-prefix="/users/test/" remote:path -### Manual configuration + rclone lsd remote:/users/test/path -Run `rclone config path` to see the path of current active config file, -usually `YOURHOME/.config/rclone/rclone.conf`. -Open it in your favorite text editor, find section for the base remote -and create new section for hasher like in the following examples: +See the below section about configuration options for more details. -``` -[Hasher1] -type = hasher -remote = myRemote:path -hashes = md5 -max_age = off +### Directory member count -[Hasher2] -type = hasher -remote = /local/path -hashes = dropbox,sha1 -max_age = 24h -``` +By default, rclone will know the number of directory members contained in a directory. +For example, `rclone lsd` uses this information. -Hasher takes basically the following parameters: -- `remote` is required, -- `hashes` is a comma separated list of supported checksums - (by default `md5,sha1`), -- `max_age` - maximum time to keep a checksum value in the cache, - `0` will disable caching completely, - `off` will cache "forever" (that is until the files get changed). +The acquisition of this information will result in additional time costs for HiDrive's API. +When dealing with large directory structures, it may be desirable to circumvent this time cost, +especially when this information is not explicitly needed. +For this, the `disable_fetching_member_count` option can be used. -Make sure the `remote` has `:` (colon) in. If you specify the remote without -a colon then rclone will use a local directory of that name. So if you use -a remote of `/local/path` then rclone will handle hashes for that directory. -If you use `remote = name` literally then rclone will put files -**in a directory called `name` located under current directory**. +See the below section about configuration options for more details. -## Usage -### Basic operations +### Standard options -Now you can use it as `Hasher2:subdir/file` instead of base remote. -Hasher will transparently update cache with new checksums when a file -is fully read or overwritten, like: -``` -rclone copy External:path/file Hasher:dest/path +Here are the Standard options specific to hidrive (HiDrive). -rclone cat Hasher:path/to/file > /dev/null -``` +#### --hidrive-client-id -The way to refresh **all** cached checksums (even unsupported by the base backend) -for a subtree is to **re-download** all files in the subtree. For example, -use `hashsum --download` using **any** supported hashsum on the command line -(we just care to re-read): -``` -rclone hashsum MD5 --download Hasher:path/to/subtree > /dev/null +OAuth Client Id. -rclone backend dump Hasher:path/to/subtree -``` +Leave blank normally. -You can print or drop hashsum cache using custom backend commands: -``` -rclone backend dump Hasher:dir/subdir +Properties: -rclone backend drop Hasher: -``` +- Config: client_id +- Env Var: RCLONE_HIDRIVE_CLIENT_ID +- Type: string +- Required: false -### Pre-Seed from a SUM File +#### --hidrive-client-secret -Hasher supports two backend commands: generic SUM file `import` and faster -but less consistent `stickyimport`. +OAuth Client Secret. -``` -rclone backend import Hasher:dir/subdir SHA1 /path/to/SHA1SUM [--checkers 4] -``` +Leave blank normally. -Instead of SHA1 it can be any hash supported by the remote. The last argument -can point to either a local or an `other-remote:path` text file in SUM format. -The command will parse the SUM file, then walk down the path given by the -first argument, snapshot current fingerprints and fill in the cache entries -correspondingly. -- Paths in the SUM file are treated as relative to `hasher:dir/subdir`. -- The command will **not** check that supplied values are correct. - You **must know** what you are doing. -- This is a one-time action. The SUM file will not get "attached" to the - remote. Cache entries can still be overwritten later, should the object's - fingerprint change. -- The tree walk can take long depending on the tree size. You can increase - `--checkers` to make it faster. Or use `stickyimport` if you don't care - about fingerprints and consistency. +Properties: -``` -rclone backend stickyimport hasher:path/to/data sha1 remote:/path/to/sum.sha1 -``` +- Config: client_secret +- Env Var: RCLONE_HIDRIVE_CLIENT_SECRET +- Type: string +- Required: false -`stickyimport` is similar to `import` but works much faster because it -does not need to stat existing files and skips initial tree walk. -Instead of binding cache entries to file fingerprints it creates _sticky_ -entries bound to the file name alone ignoring size, modification time etc. -Such hash entries can be replaced only by `purge`, `delete`, `backend drop` -or by full re-read/re-write of the files. +#### --hidrive-scope-access -## Configuration reference +Access permissions that rclone should use when requesting access from HiDrive. +Properties: -### Standard options +- Config: scope_access +- Env Var: RCLONE_HIDRIVE_SCOPE_ACCESS +- Type: string +- Default: "rw" +- Examples: + - "rw" + - Read and write access to resources. + - "ro" + - Read-only access to resources. -Here are the Standard options specific to hasher (Better checksums for other remotes). +### Advanced options -#### --hasher-remote +Here are the Advanced options specific to hidrive (HiDrive). -Remote to cache checksums for (e.g. myRemote:path). +#### --hidrive-token + +OAuth Access Token as a JSON blob. Properties: -- Config: remote -- Env Var: RCLONE_HASHER_REMOTE +- Config: token +- Env Var: RCLONE_HIDRIVE_TOKEN - Type: string -- Required: true +- Required: false -#### --hasher-hashes +#### --hidrive-auth-url -Comma separated list of supported checksum types. +Auth server URL. + +Leave blank to use the provider defaults. Properties: -- Config: hashes -- Env Var: RCLONE_HASHER_HASHES -- Type: CommaSepList -- Default: md5,sha1 +- Config: auth_url +- Env Var: RCLONE_HIDRIVE_AUTH_URL +- Type: string +- Required: false -#### --hasher-max-age +#### --hidrive-token-url -Maximum time to keep checksums in cache (0 = no cache, off = cache forever). +Token server url. + +Leave blank to use the provider defaults. Properties: -- Config: max_age -- Env Var: RCLONE_HASHER_MAX_AGE -- Type: Duration -- Default: off +- Config: token_url +- Env Var: RCLONE_HIDRIVE_TOKEN_URL +- Type: string +- Required: false -### Advanced options +#### --hidrive-scope-role -Here are the Advanced options specific to hasher (Better checksums for other remotes). +User-level that rclone should use when requesting access from HiDrive. -#### --hasher-auto-size +Properties: -Auto-update checksum for files smaller than this size (disabled by default). +- Config: scope_role +- Env Var: RCLONE_HIDRIVE_SCOPE_ROLE +- Type: string +- Default: "user" +- Examples: + - "user" + - User-level access to management permissions. + - This will be sufficient in most cases. + - "admin" + - Extensive access to management permissions. + - "owner" + - Full access to management permissions. + +#### --hidrive-root-prefix + +The root/parent folder for all paths. + +Fill in to use the specified folder as the parent for all paths given to the remote. +This way rclone can use any folder as its starting point. Properties: -- Config: auto_size -- Env Var: RCLONE_HASHER_AUTO_SIZE -- Type: SizeSuffix -- Default: 0 +- Config: root_prefix +- Env Var: RCLONE_HIDRIVE_ROOT_PREFIX +- Type: string +- Default: "/" +- Examples: + - "/" + - The topmost directory accessible by rclone. + - This will be equivalent with "root" if rclone uses a regular HiDrive user account. + - "root" + - The topmost directory of the HiDrive user account + - "" + - This specifies that there is no root-prefix for your paths. + - When using this you will always need to specify paths to this remote with a valid parent e.g. "remote:/path/to/dir" or "remote:root/path/to/dir". -### Metadata +#### --hidrive-endpoint -Any metadata supported by the underlying remote is read and written. +Endpoint for the service. -See the [metadata](https://rclone.org/docs/#metadata) docs for more info. +This is the URL that API-calls will be made to. -## Backend commands +Properties: -Here are the commands specific to the hasher backend. +- Config: endpoint +- Env Var: RCLONE_HIDRIVE_ENDPOINT +- Type: string +- Default: "https://api.hidrive.strato.com/2.1" -Run them with +#### --hidrive-disable-fetching-member-count - rclone backend COMMAND remote: +Do not fetch number of objects in directories unless it is absolutely necessary. -The help below will explain what arguments each command takes. +Requests may be faster if the number of objects in subdirectories is not fetched. -See the [backend](https://rclone.org/commands/rclone_backend/) command for more -info on how to pass options and arguments. +Properties: -These can be run on a running backend using the rc command -[backend/command](https://rclone.org/rc/#backend-command). +- Config: disable_fetching_member_count +- Env Var: RCLONE_HIDRIVE_DISABLE_FETCHING_MEMBER_COUNT +- Type: bool +- Default: false -### drop +#### --hidrive-chunk-size -Drop cache +Chunksize for chunked uploads. - rclone backend drop remote: [options] [+] +Any files larger than the configured cutoff (or files of unknown size) will be uploaded in chunks of this size. -Completely drop checksum cache. -Usage Example: - rclone backend drop hasher: +The upper limit for this is 2147483647 bytes (about 2.000Gi). +That is the maximum amount of bytes a single upload-operation will support. +Setting this above the upper limit or to a negative value will cause uploads to fail. +Setting this to larger values may increase the upload speed at the cost of using more memory. +It can be set to smaller values smaller to save on memory. -### dump +Properties: -Dump the database +- Config: chunk_size +- Env Var: RCLONE_HIDRIVE_CHUNK_SIZE +- Type: SizeSuffix +- Default: 48Mi - rclone backend dump remote: [options] [+] +#### --hidrive-upload-cutoff -Dump cache records covered by the current remote +Cutoff/Threshold for chunked uploads. -### fulldump +Any files larger than this will be uploaded in chunks of the configured chunksize. -Full dump of the database +The upper limit for this is 2147483647 bytes (about 2.000Gi). +That is the maximum amount of bytes a single upload-operation will support. +Setting this above the upper limit will cause uploads to fail. - rclone backend fulldump remote: [options] [+] +Properties: -Dump all cache records in the database +- Config: upload_cutoff +- Env Var: RCLONE_HIDRIVE_UPLOAD_CUTOFF +- Type: SizeSuffix +- Default: 96Mi -### import +#### --hidrive-upload-concurrency -Import a SUM file +Concurrency for chunked uploads. - rclone backend import remote: [options] [+] +This is the upper limit for how many transfers for the same file are running concurrently. +Setting this above to a value smaller than 1 will cause uploads to deadlock. -Amend hash cache from a SUM file and bind checksums to files by size/time. -Usage Example: - rclone backend import hasher:subdir md5 /path/to/sum.md5 +If you are uploading small numbers of large files over high-speed links +and these uploads do not fully utilize your bandwidth, then increasing +this may help to speed up the transfers. +Properties: -### stickyimport +- Config: upload_concurrency +- Env Var: RCLONE_HIDRIVE_UPLOAD_CONCURRENCY +- Type: int +- Default: 4 -Perform fast import of a SUM file +#### --hidrive-encoding - rclone backend stickyimport remote: [options] [+] +The encoding for the backend. -Fill hash cache from a SUM file without verifying file fingerprints. -Usage Example: - rclone backend stickyimport hasher:subdir md5 remote:path/to/sum.md5 +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Properties: +- Config: encoding +- Env Var: RCLONE_HIDRIVE_ENCODING +- Type: Encoding +- Default: Slash,Dot -## Implementation details (advanced) -This section explains how various rclone operations work on a hasher remote. +## Limitations -**Disclaimer. This section describes current implementation which can -change in future rclone versions!.** +### Symbolic links -### Hashsum command +HiDrive is able to store symbolic links (*symlinks*) by design, +for example, when unpacked from a zip archive. -The `rclone hashsum` (or `md5sum` or `sha1sum`) command will: +There exists no direct mechanism to manage native symlinks in remotes. +As such this implementation has chosen to ignore any native symlinks present in the remote. +rclone will not be able to access or show any symlinks stored in the hidrive-remote. +This means symlinks cannot be individually removed, copied, or moved, +except when removing, copying, or moving the parent folder. -1. if requested hash is supported by lower level, just pass it. -2. if object size is below `auto_size` then download object and calculate - _requested_ hashes on the fly. -3. if unsupported and the size is big enough, build object `fingerprint` - (including size, modtime if supported, first-found _other_ hash if any). -4. if the strict match is found in cache for the requested remote, return - the stored hash. -5. if remote found but fingerprint mismatched, then purge the entry and - proceed to step 6. -6. if remote not found or had no requested hash type or after step 5: - download object, calculate all _supported_ hashes on the fly and store - in cache; return requested hash. +*This does not affect the `.rclonelink`-files +that rclone uses to encode and store symbolic links.* -### Other operations +### Sparse files -- whenever a file is uploaded or downloaded **in full**, capture the stream - to calculate all supported hashes on the fly and update database -- server-side `move` will update keys of existing cache entries -- `deletefile` will remove a single cache entry -- `purge` will remove all cache entries under the purged path +It is possible to store sparse files in HiDrive. -Note that setting `max_age = 0` will disable checksum caching completely. +Note that copying a sparse file will expand the holes +into null-byte (0x00) regions that will then consume disk space. +Likewise, when downloading a sparse file, +the resulting file will have null-byte regions in the place of file holes. -If you set `max_age = off`, checksums in cache will never age, unless you -fully rewrite or delete the file. +# HTTP -### Cache storage +The HTTP remote is a read only remote for reading files of a +webserver. The webserver should provide file listings which rclone +will read and turn into a remote. This has been tested with common +webservers such as Apache/Nginx/Caddy and will likely work with file +listings from most web servers. (If it doesn't then please file an +issue, or send a pull request!) -Cached checksums are stored as `bolt` database files under rclone cache -directory, usually `~/.cache/rclone/kv/`. Databases are maintained -one per _base_ backend, named like `BaseRemote~hasher.bolt`. -Checksums for multiple `alias`-es into a single base backend -will be stored in the single database. All local paths are treated as -aliases into the `local` backend (unless encrypted or chunked) and stored -in `~/.cache/rclone/kv/local~hasher.bolt`. -Databases can be shared between multiple rclone processes. +Paths are specified as `remote:` or `remote:path`. -# HDFS +The `remote:` represents the configured [url](#http-url), and any path following +it will be resolved relative to this url, according to the URL standard. This +means with remote url `https://beta.rclone.org/branch` and path `fix`, the +resolved URL will be `https://beta.rclone.org/branch/fix`, while with path +`/fix` the resolved URL will be `https://beta.rclone.org/fix` as the absolute +path is resolved from the root of the domain. -[HDFS](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html) is a -distributed file-system, part of the [Apache Hadoop](https://hadoop.apache.org/) framework. +If the path following the `remote:` ends with `/` it will be assumed to point +to a directory. If the path does not end with `/`, then a HEAD request is sent +and the response used to decide if it it is treated as a file or a directory +(run with `-vv` to see details). When [--http-no-head](#http-no-head) is +specified, a path without ending `/` is always assumed to be a file. If rclone +incorrectly assumes the path is a file, the solution is to specify the path with +ending `/`. When you know the path is a directory, ending it with `/` is always +better as it avoids the initial HEAD request. -Paths are specified as `remote:` or `remote:path/to/dir`. +To just download a single file it is easier to use +[copyurl](https://rclone.org/commands/rclone_copyurl/). ## Configuration -Here is an example of how to make a remote called `remote`. First run: +Here is an example of how to make a remote called `remote`. First +run: rclone config @@ -34652,39 +35905,23 @@ q) Quit config n/s/q> n name> remote Type of storage to configure. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value -[skip] -XX / Hadoop distributed file system - \ "hdfs" -[skip] -Storage> hdfs -** See help for hdfs backend at: https://rclone.org/hdfs/ ** - -hadoop name node and port -Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value - 1 / Connect to host namenode at port 8020 - \ "namenode:8020" -namenode> namenode.hadoop:8020 -hadoop user name -Enter a string value. Press Enter for the default (""). +[snip] +XX / HTTP + \ "http" +[snip] +Storage> http +URL of http host to connect to Choose a number from below, or type in your own value - 1 / Connect to hdfs as root - \ "root" -username> root -Edit advanced config? (y/n) -y) Yes -n) No (default) -y/n> n + 1 / Connect to example.com + \ "https://example.com" +url> https://beta.rclone.org Remote config -------------------- [remote] -type = hdfs -namenode = namenode.hadoop:8020 -username = root +url = https://beta.rclone.org -------------------- -y) Yes this is OK (default) +y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y @@ -34692,7 +35929,7 @@ Current remotes: Name Type ==== ==== -hadoop hdfs +remote http e) Edit existing remote n) New remote @@ -34718,629 +35955,768 @@ Sync the remote `directory` to `/home/local/directory`, deleting any excess file rclone sync --interactive remote:directory /home/local/directory -### Setting up your own HDFS instance for testing +### Read only -You may start with a [manual setup](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/SingleCluster.html) -or use the docker image from the tests: +This remote is read only - you can't upload files to an HTTP server. -If you want to build the docker image +### Modification times -``` -git clone https://github.com/rclone/rclone.git -cd rclone/fstest/testserver/images/test-hdfs -docker build --rm -t rclone/test-hdfs . -``` +Most HTTP servers store time accurate to 1 second. -Or you can just use the latest one pushed +### Checksum -``` -docker run --rm --name "rclone-hdfs" -p 127.0.0.1:9866:9866 -p 127.0.0.1:8020:8020 --hostname "rclone-hdfs" rclone/test-hdfs -``` +No checksums are stored. -**NB** it need few seconds to startup. +### Usage without a config file -For this docker image the remote needs to be configured like this: +Since the http remote only has one config parameter it is easy to use +without a config file: -``` -[remote] -type = hdfs -namenode = 127.0.0.1:8020 -username = root -``` + rclone lsd --http-url https://beta.rclone.org :http: -You can stop this image with `docker kill rclone-hdfs` (**NB** it does not use volumes, so all data -uploaded will be lost.) +or: -### Modified time + rclone lsd :http,url='https://beta.rclone.org': -Time accurate to 1 second is stored. -### Checksum +### Standard options -No checksums are implemented. +Here are the Standard options specific to http (HTTP). -### Usage information +#### --http-url -You can use the `rclone about remote:` command which will display filesystem size and current usage. +URL of HTTP host to connect to. -### Restricted filename characters +E.g. "https://example.com", or "https://user:pass@example.com" to use a username and password. -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) -the following characters are also replaced: +Properties: -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| : | 0x3A | : | +- Config: url +- Env Var: RCLONE_HTTP_URL +- Type: string +- Required: true -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8). +### Advanced options + +Here are the Advanced options specific to http (HTTP). +#### --http-headers -### Standard options +Set HTTP headers for all transactions. -Here are the Standard options specific to hdfs (Hadoop distributed file system). +Use this to set additional HTTP headers for all transactions. -#### --hdfs-namenode +The input format is comma separated list of key,value pairs. Standard +[CSV encoding](https://godoc.org/encoding/csv) may be used. -Hadoop name node and port. +For example, to set a Cookie use 'Cookie,name=value', or '"Cookie","name=value"'. -E.g. "namenode:8020" to connect to host namenode at port 8020. +You can set multiple headers, e.g. '"Cookie","name=value","Authorization","xxx"'. Properties: -- Config: namenode -- Env Var: RCLONE_HDFS_NAMENODE -- Type: string -- Required: true +- Config: headers +- Env Var: RCLONE_HTTP_HEADERS +- Type: CommaSepList +- Default: -#### --hdfs-username +#### --http-no-slash -Hadoop user name. +Set this if the site doesn't end directories with /. + +Use this if your target website does not use / on the end of +directories. + +A / on the end of a path is how rclone normally tells the difference +between files and directories. If this flag is set, then rclone will +treat all files with Content-Type: text/html as directories and read +URLs from them rather than downloading them. + +Note that this may cause rclone to confuse genuine HTML files with +directories. + +Properties: + +- Config: no_slash +- Env Var: RCLONE_HTTP_NO_SLASH +- Type: bool +- Default: false + +#### --http-no-head + +Don't use HEAD requests. + +HEAD requests are mainly used to find file sizes in dir listing. +If your site is being very slow to load then you can try this option. +Normally rclone does a HEAD request for each potential file in a +directory listing to: + +- find its size +- check it really exists +- check to see if it is a directory + +If you set this option, rclone will not do the HEAD request. This will mean +that directory listings are much quicker, but rclone won't have the times or +sizes of any files, and some files that don't exist may be in the listing. + +Properties: + +- Config: no_head +- Env Var: RCLONE_HTTP_NO_HEAD +- Type: bool +- Default: false -Properties: +## Backend commands -- Config: username -- Env Var: RCLONE_HDFS_USERNAME -- Type: string -- Required: false -- Examples: - - "root" - - Connect to hdfs as root. +Here are the commands specific to the http backend. -### Advanced options +Run them with -Here are the Advanced options specific to hdfs (Hadoop distributed file system). + rclone backend COMMAND remote: -#### --hdfs-service-principal-name +The help below will explain what arguments each command takes. -Kerberos service principal name for the namenode. +See the [backend](https://rclone.org/commands/rclone_backend/) command for more +info on how to pass options and arguments. -Enables KERBEROS authentication. Specifies the Service Principal Name -(SERVICE/FQDN) for the namenode. E.g. \"hdfs/namenode.hadoop.docker\" -for namenode running as service 'hdfs' with FQDN 'namenode.hadoop.docker'. +These can be run on a running backend using the rc command +[backend/command](https://rclone.org/rc/#backend-command). -Properties: +### set -- Config: service_principal_name -- Env Var: RCLONE_HDFS_SERVICE_PRINCIPAL_NAME -- Type: string -- Required: false +Set command for updating the config parameters. -#### --hdfs-data-transfer-protection + rclone backend set remote: [options] [+] -Kerberos data transfer protection: authentication|integrity|privacy. +This set command can be used to update the config parameters +for a running http backend. -Specifies whether or not authentication, data signature integrity -checks, and wire encryption are required when communicating with -the datanodes. Possible values are 'authentication', 'integrity' -and 'privacy'. Used only with KERBEROS enabled. +Usage Examples: -Properties: + rclone backend set remote: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=remote: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=remote: -o url=https://example.com -- Config: data_transfer_protection -- Env Var: RCLONE_HDFS_DATA_TRANSFER_PROTECTION -- Type: string -- Required: false -- Examples: - - "privacy" - - Ensure authentication, integrity and encryption enabled. +The option keys are named as they are in the config file. -#### --hdfs-encoding +This rebuilds the connection to the http backend when it is called with +the new parameters. Only new parameters need be passed as the values +will default to those currently in use. -The encoding for the backend. +It doesn't return anything. -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -Properties: -- Config: encoding -- Env Var: RCLONE_HDFS_ENCODING -- Type: MultiEncoder -- Default: Slash,Colon,Del,Ctl,InvalidUtf8,Dot +## Limitations +`rclone about` is not supported by the HTTP backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. -## Limitations +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -- No server-side `Move` or `DirMove`. -- Checksums not implemented. +# ImageKit +This is a backend for the [ImageKit.io](https://imagekit.io/) storage service. -# HiDrive +#### About ImageKit +[ImageKit.io](https://imagekit.io/) provides real-time image and video optimizations, transformations, and CDN delivery. Over 1,000 businesses and 70,000 developers trust ImageKit with their images and videos on the web. -Paths are specified as `remote:path` -Paths may be as deep as required, e.g. `remote:directory/subdirectory`. +#### Accounts & Pricing -The initial setup for hidrive involves getting a token from HiDrive -which you need to do in your browser. -`rclone config` walks you through it. +To use this backend, you need to [create an account](https://imagekit.io/registration/) on ImageKit. Start with a free plan with generous usage limits. Then, as your requirements grow, upgrade to a plan that best fits your needs. See [the pricing details](https://imagekit.io/plans). ## Configuration -Here is an example of how to make a remote called `remote`. First run: +Here is an example of making an imagekit configuration. - rclone config +Firstly create a [ImageKit.io](https://imagekit.io/) account and choose a plan. + +You will need to log in and get the `publicKey` and `privateKey` for your account from the developer section. + +Now run +``` +rclone config +``` This will guide you through an interactive setup process: ``` -No remotes found - make a new one +No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n -name> remote + +Enter the name for the new remote. +name> imagekit-media-library + +Option Storage. Type of storage to configure. -Choose a number from below, or type in your own value +Choose a number from below, or type in your own value. [snip] -XX / HiDrive - \ "hidrive" +XX / ImageKit.io +\ (imagekit) [snip] -Storage> hidrive -OAuth Client Id - Leave blank normally. -client_id> -OAuth Client Secret - Leave blank normally. -client_secret> -Access permissions that rclone should use when requesting access from HiDrive. -Leave blank normally. -scope_access> +Storage> imagekit + +Option endpoint. +You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) +Enter a value. +endpoint> https://ik.imagekit.io/imagekit_id + +Option public_key. +You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) +Enter a value. +public_key> public_**************************** + +Option private_key. +You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) +Enter a value. +private_key> private_**************************** + Edit advanced config? +y) Yes +n) No (default) y/n> n -Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. -y/n> y -If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=xxxxxxxxxxxxxxxxxxxxxx -Log in and authorize rclone for access -Waiting for code... -Got code --------------------- -[remote] -type = hidrive -token = {"access_token":"xxxxxxxxxxxxxxxxxxxx","token_type":"Bearer","refresh_token":"xxxxxxxxxxxxxxxxxxxxxxx","expiry":"xxxxxxxxxxxxxxxxxxxxxxx"} --------------------- + +Configuration complete. +Options: +- type: imagekit +- endpoint: https://ik.imagekit.io/imagekit_id +- public_key: public_**************************** +- private_key: private_**************************** + +Keep this "imagekit-media-library" remote? y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y ``` +List directories in the top level of your Media Library +``` +rclone lsd imagekit-media-library: +``` +Make a new directory. +``` +rclone mkdir imagekit-media-library:directory +``` +List the contents of a directory. +``` +rclone ls imagekit-media-library:directory +``` -**You should be aware that OAuth-tokens can be used to access your account -and hence should not be shared with other persons.** -See the [below section](#keeping-your-tokens-safe) for more information. +### Modified time and hashes -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a -machine with no Internet browser available. +ImageKit does not support modification times or hashes yet. -Note that rclone runs a webserver on your local machine to collect the -token as returned from HiDrive. This only runs from the moment it opens -your browser to the moment you get back the verification code. -The webserver runs on `http://127.0.0.1:53682/`. -If local port `53682` is protected by a firewall you may need to temporarily -unblock the firewall to complete authorization. +### Checksums -Once configured you can then use `rclone` like this, +No checksums are supported. -List directories in top level of your HiDrive root folder - rclone lsd remote: +### Standard options -List all the files in your HiDrive filesystem +Here are the Standard options specific to imagekit (ImageKit.io). - rclone ls remote: +#### --imagekit-endpoint -To copy a local directory to a HiDrive directory called backup +You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) - rclone copy /home/source remote:backup +Properties: -### Keeping your tokens safe +- Config: endpoint +- Env Var: RCLONE_IMAGEKIT_ENDPOINT +- Type: string +- Required: true -Any OAuth-tokens will be stored by rclone in the remote's configuration file as unencrypted text. -Anyone can use a valid refresh-token to access your HiDrive filesystem without knowing your password. -Therefore you should make sure no one else can access your configuration. +#### --imagekit-public-key -It is possible to encrypt rclone's configuration file. -You can find information on securing your configuration file by viewing the [configuration encryption docs](https://rclone.org/docs/#configuration-encryption). +You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) -### Invalid refresh token +Properties: -As can be verified [here](https://developer.hidrive.com/basics-flows/), -each `refresh_token` (for Native Applications) is valid for 60 days. -If used to access HiDrivei, its validity will be automatically extended. +- Config: public_key +- Env Var: RCLONE_IMAGEKIT_PUBLIC_KEY +- Type: string +- Required: true -This means that if you +#### --imagekit-private-key - * Don't use the HiDrive remote for 60 days +You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) -then rclone will return an error which includes a text -that implies the refresh token is *invalid* or *expired*. +Properties: -To fix this you will need to authorize rclone to access your HiDrive account again. +- Config: private_key +- Env Var: RCLONE_IMAGEKIT_PRIVATE_KEY +- Type: string +- Required: true -Using +### Advanced options - rclone config reconnect remote: +Here are the Advanced options specific to imagekit (ImageKit.io). -the process is very similar to the process of initial setup exemplified before. +#### --imagekit-only-signed -### Modified time and hashes +If you have configured `Restrict unsigned image URLs` in your dashboard settings, set this to true. -HiDrive allows modification times to be set on objects accurate to 1 second. +Properties: -HiDrive supports [its own hash type](https://static.hidrive.com/dev/0001) -which is used to verify the integrity of file contents after successful transfers. +- Config: only_signed +- Env Var: RCLONE_IMAGEKIT_ONLY_SIGNED +- Type: bool +- Default: false -### Restricted filename characters +#### --imagekit-versions -HiDrive cannot store files or folders that include -`/` (0x2F) or null-bytes (0x00) in their name. -Any other characters can be used in the names of files or folders. -Additionally, files or folders cannot be named either of the following: `.` or `..` +Include old versions in directory listings. -Therefore rclone will automatically replace these characters, -if files or folders are stored or accessed with such names. +Properties: -You can read about how this filename encoding works in general -[here](overview/#restricted-filenames). +- Config: versions +- Env Var: RCLONE_IMAGEKIT_VERSIONS +- Type: bool +- Default: false -Keep in mind that HiDrive only supports file or folder names -with a length of 255 characters or less. +#### --imagekit-upload-tags -### Transfers +Tags to add to the uploaded files, e.g. "tag1,tag2". -HiDrive limits file sizes per single request to a maximum of 2 GiB. -To allow storage of larger files and allow for better upload performance, -the hidrive backend will use a chunked transfer for files larger than 96 MiB. -Rclone will upload multiple parts/chunks of the file at the same time. -Chunks in the process of being uploaded are buffered in memory, -so you may want to restrict this behaviour on systems with limited resources. +Properties: -You can customize this behaviour using the following options: +- Config: upload_tags +- Env Var: RCLONE_IMAGEKIT_UPLOAD_TAGS +- Type: string +- Required: false -* `chunk_size`: size of file parts -* `upload_cutoff`: files larger or equal to this in size will use a chunked transfer -* `upload_concurrency`: number of file-parts to upload at the same time +#### --imagekit-encoding -See the below section about configuration options for more details. +The encoding for the backend. -### Root folder +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -You can set the root folder for rclone. -This is the directory that rclone considers to be the root of your HiDrive. +Properties: -Usually, you will leave this blank, and rclone will use the root of the account. +- Config: encoding +- Env Var: RCLONE_IMAGEKIT_ENCODING +- Type: Encoding +- Default: Slash,LtGt,DoubleQuote,Dollar,Question,Hash,Percent,BackSlash,Del,Ctl,InvalidUtf8,Dot,SquareBracket -However, you can set this to restrict rclone to a specific folder hierarchy. +### Metadata -This works by prepending the contents of the `root_prefix` option -to any paths accessed by rclone. -For example, the following two ways to access the home directory are equivalent: +Any metadata supported by the underlying remote is read and written. - rclone lsd --hidrive-root-prefix="/users/test/" remote:path +Here are the possible system metadata items for the imagekit backend. - rclone lsd remote:/users/test/path +| Name | Help | Type | Example | Read Only | +|------|------|------|---------|-----------| +| aws-tags | AI generated tags by AWS Rekognition associated with the image | string | tag1,tag2 | **Y** | +| btime | Time of file birth (creation) read from Last-Modified header | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** | +| custom-coordinates | Custom coordinates of the file | string | 0,0,100,100 | **Y** | +| file-type | Type of the file | string | image | **Y** | +| google-tags | AI generated tags by Google Cloud Vision associated with the image | string | tag1,tag2 | **Y** | +| has-alpha | Whether the image has alpha channel or not | bool | | **Y** | +| height | Height of the image or video in pixels | int | | **Y** | +| is-private-file | Whether the file is private or not | bool | | **Y** | +| size | Size of the object in bytes | int64 | | **Y** | +| tags | Tags associated with the file | string | tag1,tag2 | **Y** | +| width | Width of the image or video in pixels | int | | **Y** | -See the below section about configuration options for more details. +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -### Directory member count -By default, rclone will know the number of directory members contained in a directory. -For example, `rclone lsd` uses this information. -The acquisition of this information will result in additional time costs for HiDrive's API. -When dealing with large directory structures, it may be desirable to circumvent this time cost, -especially when this information is not explicitly needed. -For this, the `disable_fetching_member_count` option can be used. +# Internet Archive -See the below section about configuration options for more details. +The Internet Archive backend utilizes Items on [archive.org](https://archive.org/) +Refer to [IAS3 API documentation](https://archive.org/services/docs/api/ias3.html) for the API this backend uses. -### Standard options +Paths are specified as `remote:bucket` (or `remote:` for the `lsd` +command.) You may put subdirectories in too, e.g. `remote:item/path/to/dir`. -Here are the Standard options specific to hidrive (HiDrive). +Unlike S3, listing up all items uploaded by you isn't supported. -#### --hidrive-client-id +Once you have made a remote, you can use it like this: -OAuth Client Id. +Make a new item -Leave blank normally. + rclone mkdir remote:item -Properties: +List the contents of a item -- Config: client_id -- Env Var: RCLONE_HIDRIVE_CLIENT_ID -- Type: string -- Required: false + rclone ls remote:item -#### --hidrive-client-secret +Sync `/home/local/directory` to the remote item, deleting any excess +files in the item. -OAuth Client Secret. + rclone sync --interactive /home/local/directory remote:item -Leave blank normally. +## Notes +Because of Internet Archive's architecture, it enqueues write operations (and extra post-processings) in a per-item queue. You can check item's queue at https://catalogd.archive.org/history/item-name-here . Because of that, all uploads/deletes will not show up immediately and takes some time to be available. +The per-item queue is enqueued to an another queue, Item Deriver Queue. [You can check the status of Item Deriver Queue here.](https://catalogd.archive.org/catalog.php?whereami=1) This queue has a limit, and it may block you from uploading, or even deleting. You should avoid uploading a lot of small files for better behavior. -Properties: +You can optionally wait for the server's processing to finish, by setting non-zero value to `wait_archive` key. +By making it wait, rclone can do normal file comparison. +Make sure to set a large enough value (e.g. `30m0s` for smaller files) as it can take a long time depending on server's queue. -- Config: client_secret -- Env Var: RCLONE_HIDRIVE_CLIENT_SECRET -- Type: string -- Required: false +## About metadata +This backend supports setting, updating and reading metadata of each file. +The metadata will appear as file metadata on Internet Archive. +However, some fields are reserved by both Internet Archive and rclone. -#### --hidrive-scope-access +The following are reserved by Internet Archive: +- `name` +- `source` +- `size` +- `md5` +- `crc32` +- `sha1` +- `format` +- `old_version` +- `viruscheck` +- `summation` -Access permissions that rclone should use when requesting access from HiDrive. +Trying to set values to these keys is ignored with a warning. +Only setting `mtime` is an exception. Doing so make it the identical behavior as setting ModTime. -Properties: +rclone reserves all the keys starting with `rclone-`. Setting value for these keys will give you warnings, but values are set according to request. -- Config: scope_access -- Env Var: RCLONE_HIDRIVE_SCOPE_ACCESS -- Type: string -- Default: "rw" -- Examples: - - "rw" - - Read and write access to resources. - - "ro" - - Read-only access to resources. +If there are multiple values for a key, only the first one is returned. +This is a limitation of rclone, that supports one value per one key. +It can be triggered when you did a server-side copy. -### Advanced options +Reading metadata will also provide custom (non-standard nor reserved) ones. -Here are the Advanced options specific to hidrive (HiDrive). +## Filtering auto generated files -#### --hidrive-token +The Internet Archive automatically creates metadata files after +upload. These can cause problems when doing an `rclone sync` as rclone +will try, and fail, to delete them. These metadata files are not +changeable, as they are created by the Internet Archive automatically. -OAuth Access Token as a JSON blob. +These auto-created files can be excluded from the sync using [metadata +filtering](https://rclone.org/filtering/#metadata). -Properties: + rclone sync ... --metadata-exclude "source=metadata" --metadata-exclude "format=Metadata" -- Config: token -- Env Var: RCLONE_HIDRIVE_TOKEN -- Type: string -- Required: false +Which excludes from the sync any files which have the +`source=metadata` or `format=Metadata` flags which are added to +Internet Archive auto-created files. -#### --hidrive-auth-url +## Configuration -Auth server URL. +Here is an example of making an internetarchive configuration. +Most applies to the other providers as well, any differences are described [below](#providers). -Leave blank to use the provider defaults. +First run -Properties: + rclone config -- Config: auth_url -- Env Var: RCLONE_HIDRIVE_AUTH_URL -- Type: string -- Required: false +This will guide you through an interactive setup process. -#### --hidrive-token-url +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +XX / InternetArchive Items + \ (internetarchive) +Storage> internetarchive +Option access_key_id. +IAS3 Access Key. +Leave blank for anonymous access. +You can find one here: https://archive.org/account/s3.php +Enter a value. Press Enter to leave empty. +access_key_id> XXXX +Option secret_access_key. +IAS3 Secret Key (password). +Leave blank for anonymous access. +Enter a value. Press Enter to leave empty. +secret_access_key> XXXX +Edit advanced config? +y) Yes +n) No (default) +y/n> y +Option endpoint. +IAS3 Endpoint. +Leave blank for default value. +Enter a string value. Press Enter for the default (https://s3.us.archive.org). +endpoint> +Option front_endpoint. +Host of InternetArchive Frontend. +Leave blank for default value. +Enter a string value. Press Enter for the default (https://archive.org). +front_endpoint> +Option disable_checksum. +Don't store MD5 checksum with object metadata. +Normally rclone will calculate the MD5 checksum of the input before +uploading it so it can ask the server to check the object against checksum. +This is great for data integrity checking but can cause long delays for +large files to start uploading. +Enter a boolean value (true or false). Press Enter for the default (true). +disable_checksum> true +Option encoding. +The encoding for the backend. +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Enter a encoder.MultiEncoder value. Press Enter for the default (Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot). +encoding> +Edit advanced config? +y) Yes +n) No (default) +y/n> n +-------------------- +[remote] +type = internetarchive +access_key_id = XXXX +secret_access_key = XXXX +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -Token server url. -Leave blank to use the provider defaults. +### Standard options + +Here are the Standard options specific to internetarchive (Internet Archive). + +#### --internetarchive-access-key-id + +IAS3 Access Key. + +Leave blank for anonymous access. +You can find one here: https://archive.org/account/s3.php Properties: -- Config: token_url -- Env Var: RCLONE_HIDRIVE_TOKEN_URL +- Config: access_key_id +- Env Var: RCLONE_INTERNETARCHIVE_ACCESS_KEY_ID - Type: string - Required: false -#### --hidrive-scope-role +#### --internetarchive-secret-access-key -User-level that rclone should use when requesting access from HiDrive. +IAS3 Secret Key (password). + +Leave blank for anonymous access. Properties: -- Config: scope_role -- Env Var: RCLONE_HIDRIVE_SCOPE_ROLE +- Config: secret_access_key +- Env Var: RCLONE_INTERNETARCHIVE_SECRET_ACCESS_KEY - Type: string -- Default: "user" -- Examples: - - "user" - - User-level access to management permissions. - - This will be sufficient in most cases. - - "admin" - - Extensive access to management permissions. - - "owner" - - Full access to management permissions. +- Required: false -#### --hidrive-root-prefix +### Advanced options -The root/parent folder for all paths. +Here are the Advanced options specific to internetarchive (Internet Archive). -Fill in to use the specified folder as the parent for all paths given to the remote. -This way rclone can use any folder as its starting point. +#### --internetarchive-endpoint + +IAS3 Endpoint. + +Leave blank for default value. Properties: -- Config: root_prefix -- Env Var: RCLONE_HIDRIVE_ROOT_PREFIX +- Config: endpoint +- Env Var: RCLONE_INTERNETARCHIVE_ENDPOINT - Type: string -- Default: "/" -- Examples: - - "/" - - The topmost directory accessible by rclone. - - This will be equivalent with "root" if rclone uses a regular HiDrive user account. - - "root" - - The topmost directory of the HiDrive user account - - "" - - This specifies that there is no root-prefix for your paths. - - When using this you will always need to specify paths to this remote with a valid parent e.g. "remote:/path/to/dir" or "remote:root/path/to/dir". +- Default: "https://s3.us.archive.org" -#### --hidrive-endpoint +#### --internetarchive-front-endpoint -Endpoint for the service. +Host of InternetArchive Frontend. -This is the URL that API-calls will be made to. +Leave blank for default value. Properties: -- Config: endpoint -- Env Var: RCLONE_HIDRIVE_ENDPOINT +- Config: front_endpoint +- Env Var: RCLONE_INTERNETARCHIVE_FRONT_ENDPOINT - Type: string -- Default: "https://api.hidrive.strato.com/2.1" - -#### --hidrive-disable-fetching-member-count +- Default: "https://archive.org" -Do not fetch number of objects in directories unless it is absolutely necessary. +#### --internetarchive-disable-checksum -Requests may be faster if the number of objects in subdirectories is not fetched. +Don't ask the server to test against MD5 checksum calculated by rclone. +Normally rclone will calculate the MD5 checksum of the input before +uploading it so it can ask the server to check the object against checksum. +This is great for data integrity checking but can cause long delays for +large files to start uploading. Properties: -- Config: disable_fetching_member_count -- Env Var: RCLONE_HIDRIVE_DISABLE_FETCHING_MEMBER_COUNT +- Config: disable_checksum +- Env Var: RCLONE_INTERNETARCHIVE_DISABLE_CHECKSUM - Type: bool -- Default: false +- Default: true -#### --hidrive-chunk-size +#### --internetarchive-wait-archive -Chunksize for chunked uploads. +Timeout for waiting the server's processing tasks (specifically archive and book_op) to finish. +Only enable if you need to be guaranteed to be reflected after write operations. +0 to disable waiting. No errors to be thrown in case of timeout. -Any files larger than the configured cutoff (or files of unknown size) will be uploaded in chunks of this size. +Properties: -The upper limit for this is 2147483647 bytes (about 2.000Gi). -That is the maximum amount of bytes a single upload-operation will support. -Setting this above the upper limit or to a negative value will cause uploads to fail. +- Config: wait_archive +- Env Var: RCLONE_INTERNETARCHIVE_WAIT_ARCHIVE +- Type: Duration +- Default: 0s -Setting this to larger values may increase the upload speed at the cost of using more memory. -It can be set to smaller values smaller to save on memory. +#### --internetarchive-encoding -Properties: +The encoding for the backend. -- Config: chunk_size -- Env Var: RCLONE_HIDRIVE_CHUNK_SIZE -- Type: SizeSuffix -- Default: 48Mi +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -#### --hidrive-upload-cutoff +Properties: -Cutoff/Threshold for chunked uploads. +- Config: encoding +- Env Var: RCLONE_INTERNETARCHIVE_ENCODING +- Type: Encoding +- Default: Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot -Any files larger than this will be uploaded in chunks of the configured chunksize. +### Metadata -The upper limit for this is 2147483647 bytes (about 2.000Gi). -That is the maximum amount of bytes a single upload-operation will support. -Setting this above the upper limit will cause uploads to fail. +Metadata fields provided by Internet Archive. +If there are multiple values for a key, only the first one is returned. +This is a limitation of Rclone, that supports one value per one key. -Properties: +Owner is able to add custom keys. Metadata feature grabs all the keys including them. -- Config: upload_cutoff -- Env Var: RCLONE_HIDRIVE_UPLOAD_CUTOFF -- Type: SizeSuffix -- Default: 96Mi +Here are the possible system metadata items for the internetarchive backend. -#### --hidrive-upload-concurrency +| Name | Help | Type | Example | Read Only | +|------|------|------|---------|-----------| +| crc32 | CRC32 calculated by Internet Archive | string | 01234567 | **Y** | +| format | Name of format identified by Internet Archive | string | Comma-Separated Values | **Y** | +| md5 | MD5 hash calculated by Internet Archive | string | 01234567012345670123456701234567 | **Y** | +| mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | **Y** | +| name | Full file path, without the bucket part | filename | backend/internetarchive/internetarchive.go | **Y** | +| old_version | Whether the file was replaced and moved by keep-old-version flag | boolean | true | **Y** | +| rclone-ia-mtime | Time of last modification, managed by Internet Archive | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N | +| rclone-mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N | +| rclone-update-track | Random value used by Rclone for tracking changes inside Internet Archive | string | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | N | +| sha1 | SHA1 hash calculated by Internet Archive | string | 0123456701234567012345670123456701234567 | **Y** | +| size | File size in bytes | decimal number | 123456 | **Y** | +| source | The source of the file | string | original | **Y** | +| summation | Check https://forum.rclone.org/t/31922 for how it is used | string | md5 | **Y** | +| viruscheck | The last time viruscheck process was run for the file (?) | unixtime | 1654191352 | **Y** | -Concurrency for chunked uploads. +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -This is the upper limit for how many transfers for the same file are running concurrently. -Setting this above to a value smaller than 1 will cause uploads to deadlock. -If you are uploading small numbers of large files over high-speed links -and these uploads do not fully utilize your bandwidth, then increasing -this may help to speed up the transfers. -Properties: +# Jottacloud -- Config: upload_concurrency -- Env Var: RCLONE_HIDRIVE_UPLOAD_CONCURRENCY -- Type: int -- Default: 4 +Jottacloud is a cloud storage service provider from a Norwegian company, using its own datacenters +in Norway. In addition to the official service at [jottacloud.com](https://www.jottacloud.com/), +it also provides white-label solutions to different companies, such as: +* Telia + * Telia Cloud (cloud.telia.se) + * Telia Sky (sky.telia.no) +* Tele2 + * Tele2 Cloud (mittcloud.tele2.se) +* Onlime + * Onlime Cloud Storage (onlime.dk) +* Elkjøp (with subsidiaries): + * Elkjøp Cloud (cloud.elkjop.no) + * Elgiganten Sweden (cloud.elgiganten.se) + * Elgiganten Denmark (cloud.elgiganten.dk) + * Giganti Cloud (cloud.gigantti.fi) + * ELKO Cloud (cloud.elko.is) -#### --hidrive-encoding +Most of the white-label versions are supported by this backend, although may require different +authentication setup - described below. -The encoding for the backend. +Paths are specified as `remote:path` -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Paths may be as deep as required, e.g. `remote:directory/subdirectory`. -Properties: +## Authentication types -- Config: encoding -- Env Var: RCLONE_HIDRIVE_ENCODING -- Type: MultiEncoder -- Default: Slash,Dot +Some of the whitelabel versions uses a different authentication method than the official service, +and you have to choose the correct one when setting up the remote. +### Standard authentication +The standard authentication method used by the official service (jottacloud.com), as well as +some of the whitelabel services, requires you to generate a single-use personal login token +from the account security settings in the service's web interface. Log in to your account, +go to "Settings" and then "Security", or use the direct link presented to you by rclone when +configuring the remote: . Scroll down to the section +"Personal login token", and click the "Generate" button. Note that if you are using a +whitelabel service you probably can't use the direct link, you need to find the same page in +their dedicated web interface, and also it may be in a different location than described above. -## Limitations +To access your account from multiple instances of rclone, you need to configure each of them +with a separate personal login token. E.g. you create a Jottacloud remote with rclone in one +location, and copy the configuration file to a second location where you also want to run +rclone and access the same remote. Then you need to replace the token for one of them, using +the [config reconnect](https://rclone.org/commands/rclone_config_reconnect/) command, which +requires you to generate a new personal login token and supply as input. If you do not +do this, the token may easily end up being invalidated, resulting in both instances failing +with an error message something along the lines of: -### Symbolic links + oauth2: cannot fetch token: 400 Bad Request + Response: {"error":"invalid_grant","error_description":"Stale token"} -HiDrive is able to store symbolic links (*symlinks*) by design, -for example, when unpacked from a zip archive. +When this happens, you need to replace the token as described above to be able to use your +remote again. -There exists no direct mechanism to manage native symlinks in remotes. -As such this implementation has chosen to ignore any native symlinks present in the remote. -rclone will not be able to access or show any symlinks stored in the hidrive-remote. -This means symlinks cannot be individually removed, copied, or moved, -except when removing, copying, or moving the parent folder. +All personal login tokens you have taken into use will be listed in the web interface under +"My logged in devices", and from the right side of that list you can click the "X" button to +revoke individual tokens. -*This does not affect the `.rclonelink`-files -that rclone uses to encode and store symbolic links.* +### Legacy authentication -### Sparse files +If you are using one of the whitelabel versions (e.g. from Elkjøp) you may not have the option +to generate a CLI token. In this case you'll have to use the legacy authentication. To do this select +yes when the setup asks for legacy authentication and enter your username and password. +The rest of the setup is identical to the default setup. -It is possible to store sparse files in HiDrive. +### Telia Cloud authentication -Note that copying a sparse file will expand the holes -into null-byte (0x00) regions that will then consume disk space. -Likewise, when downloading a sparse file, -the resulting file will have null-byte regions in the place of file holes. +Similar to other whitelabel versions Telia Cloud doesn't offer the option of creating a CLI token, and +additionally uses a separate authentication flow where the username is generated internally. To setup +rclone to use Telia Cloud, choose Telia Cloud authentication in the setup. The rest of the setup is +identical to the default setup. -# HTTP +### Tele2 Cloud authentication -The HTTP remote is a read only remote for reading files of a -webserver. The webserver should provide file listings which rclone -will read and turn into a remote. This has been tested with common -webservers such as Apache/Nginx/Caddy and will likely work with file -listings from most web servers. (If it doesn't then please file an -issue, or send a pull request!) +As Tele2-Com Hem merger was completed this authentication can be used for former Com Hem Cloud and +Tele2 Cloud customers as no support for creating a CLI token exists, and additionally uses a separate +authentication flow where the username is generated internally. To setup rclone to use Tele2 Cloud, +choose Tele2 Cloud authentication in the setup. The rest of the setup is identical to the default setup. -Paths are specified as `remote:` or `remote:path`. +### Onlime Cloud Storage authentication -The `remote:` represents the configured [url](#http-url), and any path following -it will be resolved relative to this url, according to the URL standard. This -means with remote url `https://beta.rclone.org/branch` and path `fix`, the -resolved URL will be `https://beta.rclone.org/branch/fix`, while with path -`/fix` the resolved URL will be `https://beta.rclone.org/fix` as the absolute -path is resolved from the root of the domain. +Onlime has sold access to Jottacloud proper, while providing localized support to Danish Customers, but +have recently set up their own hosting, transferring their customers from Jottacloud servers to their +own ones. -If the path following the `remote:` ends with `/` it will be assumed to point -to a directory. If the path does not end with `/`, then a HEAD request is sent -and the response used to decide if it it is treated as a file or a directory -(run with `-vv` to see details). When [--http-no-head](#http-no-head) is -specified, a path without ending `/` is always assumed to be a file. If rclone -incorrectly assumes the path is a file, the solution is to specify the path with -ending `/`. When you know the path is a directory, ending it with `/` is always -better as it avoids the initial HEAD request. +This, of course, necessitates using their servers for authentication, but otherwise functionality and +architecture seems equivalent to Jottacloud. -To just download a single file it is easier to use -[copyurl](https://rclone.org/commands/rclone_copyurl/). +To setup rclone to use Onlime Cloud Storage, choose Onlime Cloud authentication in the setup. The rest +of the setup is identical to the default setup. ## Configuration -Here is an example of how to make a remote called `remote`. First -run: +Here is an example of how to make a remote called `remote` with the default setup. First run: - rclone config + rclone config This will guide you through an interactive setup process: @@ -35351,267 +36727,390 @@ s) Set configuration password q) Quit config n/s/q> n name> remote +Option Storage. Type of storage to configure. -Choose a number from below, or type in your own value +Choose a number from below, or type in your own value. [snip] -XX / HTTP - \ "http" +XX / Jottacloud + \ (jottacloud) [snip] -Storage> http -URL of http host to connect to -Choose a number from below, or type in your own value - 1 / Connect to example.com - \ "https://example.com" -url> https://beta.rclone.org -Remote config +Storage> jottacloud +Edit advanced config? +y) Yes +n) No (default) +y/n> n +Option config_type. +Select authentication type. +Choose a number from below, or type in an existing string value. +Press Enter for the default (standard). + / Standard authentication. + 1 | Use this if you're a normal Jottacloud user. + \ (standard) + / Legacy authentication. + 2 | This is only required for certain whitelabel versions of Jottacloud and not recommended for normal users. + \ (legacy) + / Telia Cloud authentication. + 3 | Use this if you are using Telia Cloud. + \ (telia) + / Tele2 Cloud authentication. + 4 | Use this if you are using Tele2 Cloud. + \ (tele2) + / Onlime Cloud authentication. + 5 | Use this if you are using Onlime Cloud. + \ (onlime) +config_type> 1 +Personal login token. +Generate here: https://www.jottacloud.com/web/secure +Login Token> +Use a non-standard device/mountpoint? +Choosing no, the default, will let you access the storage used for the archive +section of the official Jottacloud client. If you instead want to access the +sync or the backup section, for example, you must choose yes. +y) Yes +n) No (default) +y/n> y +Option config_device. +The device to use. In standard setup the built-in Jotta device is used, +which contains predefined mountpoints for archive, sync etc. All other devices +are treated as backup devices by the official Jottacloud client. You may create +a new by entering a unique name. +Choose a number from below, or type in your own string value. +Press Enter for the default (DESKTOP-3H31129). + 1 > DESKTOP-3H31129 + 2 > Jotta +config_device> 2 +Option config_mountpoint. +The mountpoint to use for the built-in device Jotta. +The standard setup is to use the Archive mountpoint. Most other mountpoints +have very limited support in rclone and should generally be avoided. +Choose a number from below, or type in an existing string value. +Press Enter for the default (Archive). + 1 > Archive + 2 > Shared + 3 > Sync +config_mountpoint> 1 -------------------- [remote] -url = https://beta.rclone.org +type = jottacloud +configVersion = 1 +client_id = jottacli +client_secret = +tokenURL = https://id.jottacloud.com/auth/realms/jottacloud/protocol/openid-connect/token +token = {........} +username = 2940e57271a93d987d6f8a21 +device = Jotta +mountpoint = Archive -------------------- -y) Yes this is OK +y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y -Current remotes: - -Name Type -==== ==== -remote http - -e) Edit existing remote -n) New remote -d) Delete remote -r) Rename remote -c) Copy remote -s) Set configuration password -q) Quit config -e/n/d/r/c/s/q> q ``` -This remote is called `remote` and can now be used like this +Once configured you can then use `rclone` like this, -See all the top level directories +List directories in top level of your Jottacloud rclone lsd remote: -List the contents of a directory +List all the files in your Jottacloud - rclone ls remote:directory + rclone ls remote: -Sync the remote `directory` to `/home/local/directory`, deleting any excess files. +To copy a local directory to an Jottacloud directory called backup - rclone sync --interactive remote:directory /home/local/directory + rclone copy /home/source remote:backup -### Read only +### Devices and Mountpoints -This remote is read only - you can't upload files to an HTTP server. +The official Jottacloud client registers a device for each computer you install +it on, and shows them in the backup section of the user interface. For each +folder you select for backup it will create a mountpoint within this device. +A built-in device called Jotta is special, and contains mountpoints Archive, +Sync and some others, used for corresponding features in official clients. -### Modified time +With rclone you'll want to use the standard Jotta/Archive device/mountpoint in +most cases. However, you may for example want to access files from the sync or +backup functionality provided by the official clients, and rclone therefore +provides the option to select other devices and mountpoints during config. -Most HTTP servers store time accurate to 1 second. +You are allowed to create new devices and mountpoints. All devices except the +built-in Jotta device are treated as backup devices by official Jottacloud +clients, and the mountpoints on them are individual backup sets. -### Checksum +With the built-in Jotta device, only existing, built-in, mountpoints can be +selected. In addition to the mentioned Archive and Sync, it may contain +several other mountpoints such as: Latest, Links, Shared and Trash. All of +these are special mountpoints with a different internal representation than +the "regular" mountpoints. Rclone will only to a very limited degree support +them. Generally you should avoid these, unless you know what you are doing. -No checksums are stored. +### --fast-list -### Usage without a config file +This backend supports `--fast-list` which allows you to use fewer +transactions in exchange for more memory. See the [rclone +docs](https://rclone.org/docs/#fast-list) for more details. -Since the http remote only has one config parameter it is easy to use -without a config file: +Note that the implementation in Jottacloud always uses only a single +API request to get the entire list, so for large folders this could +lead to long wait time before the first results are shown. - rclone lsd --http-url https://beta.rclone.org :http: +Note also that with rclone version 1.58 and newer, information about +[MIME types](https://rclone.org/overview/#mime-type) and metadata item [utime](#metadata) +are not available when using `--fast-list`. -or: +### Modification times and hashes - rclone lsd :http,url='https://beta.rclone.org': +Jottacloud allows modification times to be set on objects accurate to 1 +second. These will be used to detect whether objects need syncing or +not. + +Jottacloud supports MD5 type hashes, so you can use the `--checksum` +flag. + +Note that Jottacloud requires the MD5 hash before upload so if the +source does not have an MD5 checksum then the file will be cached +temporarily on disk (in location given by +[--temp-dir](https://rclone.org/docs/#temp-dir-dir)) before it is uploaded. +Small files will be cached in memory - see the +[--jottacloud-md5-memory-limit](#jottacloud-md5-memory-limit) flag. +When uploading from local disk the source checksum is always available, +so this does not apply. Starting with rclone version 1.52 the same is +true for encrypted remotes (in older versions the crypt backend would not +calculate hashes for uploads from local disk, so the Jottacloud +backend had to do it as described above). + +### Restricted filename characters + +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) +the following characters are also replaced: + +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| " | 0x22 | " | +| * | 0x2A | * | +| : | 0x3A | : | +| < | 0x3C | < | +| > | 0x3E | > | +| ? | 0x3F | ? | +| \| | 0x7C | | | + +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in XML strings. + +### Deleting files + +By default, rclone will send all files to the trash when deleting files. They will be permanently +deleted automatically after 30 days. You may bypass the trash and permanently delete files immediately +by using the [--jottacloud-hard-delete](#jottacloud-hard-delete) flag, or set the equivalent environment variable. +Emptying the trash is supported by the [cleanup](https://rclone.org/commands/rclone_cleanup/) command. + +### Versions + +Jottacloud supports file versioning. When rclone uploads a new version of a file it creates a new version of it. +Currently rclone only supports retrieving the current version but older versions can be accessed via the Jottacloud Website. + +Versioning can be disabled by `--jottacloud-no-versions` option. This is achieved by deleting the remote file prior to uploading +a new version. If the upload the fails no version of the file will be available in the remote. + +### Quota information + +To view your current quota you can use the `rclone about remote:` +command which will display your usage limit (unless it is unlimited) +and the current usage. ### Standard options -Here are the Standard options specific to http (HTTP). +Here are the Standard options specific to jottacloud (Jottacloud). -#### --http-url +#### --jottacloud-client-id -URL of HTTP host to connect to. +OAuth Client Id. -E.g. "https://example.com", or "https://user:pass@example.com" to use a username and password. +Leave blank normally. Properties: -- Config: url -- Env Var: RCLONE_HTTP_URL +- Config: client_id +- Env Var: RCLONE_JOTTACLOUD_CLIENT_ID - Type: string -- Required: true +- Required: false + +#### --jottacloud-client-secret + +OAuth Client Secret. + +Leave blank normally. + +Properties: + +- Config: client_secret +- Env Var: RCLONE_JOTTACLOUD_CLIENT_SECRET +- Type: string +- Required: false ### Advanced options -Here are the Advanced options specific to http (HTTP). +Here are the Advanced options specific to jottacloud (Jottacloud). -#### --http-headers +#### --jottacloud-token -Set HTTP headers for all transactions. +OAuth Access Token as a JSON blob. -Use this to set additional HTTP headers for all transactions. +Properties: -The input format is comma separated list of key,value pairs. Standard -[CSV encoding](https://godoc.org/encoding/csv) may be used. +- Config: token +- Env Var: RCLONE_JOTTACLOUD_TOKEN +- Type: string +- Required: false -For example, to set a Cookie use 'Cookie,name=value', or '"Cookie","name=value"'. +#### --jottacloud-auth-url -You can set multiple headers, e.g. '"Cookie","name=value","Authorization","xxx"'. +Auth server URL. + +Leave blank to use the provider defaults. Properties: -- Config: headers -- Env Var: RCLONE_HTTP_HEADERS -- Type: CommaSepList -- Default: +- Config: auth_url +- Env Var: RCLONE_JOTTACLOUD_AUTH_URL +- Type: string +- Required: false -#### --http-no-slash +#### --jottacloud-token-url -Set this if the site doesn't end directories with /. +Token server url. -Use this if your target website does not use / on the end of -directories. +Leave blank to use the provider defaults. -A / on the end of a path is how rclone normally tells the difference -between files and directories. If this flag is set, then rclone will -treat all files with Content-Type: text/html as directories and read -URLs from them rather than downloading them. +Properties: -Note that this may cause rclone to confuse genuine HTML files with -directories. +- Config: token_url +- Env Var: RCLONE_JOTTACLOUD_TOKEN_URL +- Type: string +- Required: false + +#### --jottacloud-md5-memory-limit + +Files bigger than this will be cached on disk to calculate the MD5 if required. Properties: -- Config: no_slash -- Env Var: RCLONE_HTTP_NO_SLASH -- Type: bool -- Default: false +- Config: md5_memory_limit +- Env Var: RCLONE_JOTTACLOUD_MD5_MEMORY_LIMIT +- Type: SizeSuffix +- Default: 10Mi -#### --http-no-head +#### --jottacloud-trashed-only -Don't use HEAD requests. +Only show files that are in the trash. -HEAD requests are mainly used to find file sizes in dir listing. -If your site is being very slow to load then you can try this option. -Normally rclone does a HEAD request for each potential file in a -directory listing to: +This will show trashed files in their original directory structure. -- find its size -- check it really exists -- check to see if it is a directory +Properties: -If you set this option, rclone will not do the HEAD request. This will mean -that directory listings are much quicker, but rclone won't have the times or -sizes of any files, and some files that don't exist may be in the listing. +- Config: trashed_only +- Env Var: RCLONE_JOTTACLOUD_TRASHED_ONLY +- Type: bool +- Default: false + +#### --jottacloud-hard-delete + +Delete files permanently rather than putting them into the trash. Properties: -- Config: no_head -- Env Var: RCLONE_HTTP_NO_HEAD +- Config: hard_delete +- Env Var: RCLONE_JOTTACLOUD_HARD_DELETE - Type: bool - Default: false +#### --jottacloud-upload-resume-limit +Files bigger than this can be resumed if the upload fail's. -## Limitations - -`rclone about` is not supported by the HTTP backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. +Properties: -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) +- Config: upload_resume_limit +- Env Var: RCLONE_JOTTACLOUD_UPLOAD_RESUME_LIMIT +- Type: SizeSuffix +- Default: 10Mi -# Internet Archive +#### --jottacloud-no-versions -The Internet Archive backend utilizes Items on [archive.org](https://archive.org/) +Avoid server side versioning by deleting files and recreating files instead of overwriting them. -Refer to [IAS3 API documentation](https://archive.org/services/docs/api/ias3.html) for the API this backend uses. +Properties: -Paths are specified as `remote:bucket` (or `remote:` for the `lsd` -command.) You may put subdirectories in too, e.g. `remote:item/path/to/dir`. +- Config: no_versions +- Env Var: RCLONE_JOTTACLOUD_NO_VERSIONS +- Type: bool +- Default: false -Unlike S3, listing up all items uploaded by you isn't supported. +#### --jottacloud-encoding -Once you have made a remote, you can use it like this: +The encoding for the backend. -Make a new item +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. - rclone mkdir remote:item +Properties: -List the contents of a item +- Config: encoding +- Env Var: RCLONE_JOTTACLOUD_ENCODING +- Type: Encoding +- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot - rclone ls remote:item +### Metadata -Sync `/home/local/directory` to the remote item, deleting any excess -files in the item. +Jottacloud has limited support for metadata, currently an extended set of timestamps. - rclone sync --interactive /home/local/directory remote:item +Here are the possible system metadata items for the jottacloud backend. -## Notes -Because of Internet Archive's architecture, it enqueues write operations (and extra post-processings) in a per-item queue. You can check item's queue at https://catalogd.archive.org/history/item-name-here . Because of that, all uploads/deletes will not show up immediately and takes some time to be available. -The per-item queue is enqueued to an another queue, Item Deriver Queue. [You can check the status of Item Deriver Queue here.](https://catalogd.archive.org/catalog.php?whereami=1) This queue has a limit, and it may block you from uploading, or even deleting. You should avoid uploading a lot of small files for better behavior. +| Name | Help | Type | Example | Read Only | +|------|------|------|---------|-----------| +| btime | Time of file birth (creation), read from rclone metadata | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | N | +| content-type | MIME type, also known as media type | string | text/plain | **Y** | +| mtime | Time of last modification, read from rclone metadata | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | N | +| utime | Time of last upload, when current revision was created, generated by backend | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** | -You can optionally wait for the server's processing to finish, by setting non-zero value to `wait_archive` key. -By making it wait, rclone can do normal file comparison. -Make sure to set a large enough value (e.g. `30m0s` for smaller files) as it can take a long time depending on server's queue. +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -## About metadata -This backend supports setting, updating and reading metadata of each file. -The metadata will appear as file metadata on Internet Archive. -However, some fields are reserved by both Internet Archive and rclone. -The following are reserved by Internet Archive: -- `name` -- `source` -- `size` -- `md5` -- `crc32` -- `sha1` -- `format` -- `old_version` -- `viruscheck` -- `summation` -Trying to set values to these keys is ignored with a warning. -Only setting `mtime` is an exception. Doing so make it the identical behavior as setting ModTime. +## Limitations -rclone reserves all the keys starting with `rclone-`. Setting value for these keys will give you warnings, but values are set according to request. +Note that Jottacloud is case insensitive so you can't have a file called +"Hello.doc" and one called "hello.doc". -If there are multiple values for a key, only the first one is returned. -This is a limitation of rclone, that supports one value per one key. -It can be triggered when you did a server-side copy. +There are quite a few characters that can't be in Jottacloud file names. Rclone will map these names to and from an identical +looking unicode equivalent. For example if a file has a ? in it will be mapped to ? instead. -Reading metadata will also provide custom (non-standard nor reserved) ones. +Jottacloud only supports filenames up to 255 characters in length. -## Filtering auto generated files +## Troubleshooting -The Internet Archive automatically creates metadata files after -upload. These can cause problems when doing an `rclone sync` as rclone -will try, and fail, to delete them. These metadata files are not -changeable, as they are created by the Internet Archive automatically. +Jottacloud exhibits some inconsistent behaviours regarding deleted files and folders which may cause Copy, Move and DirMove +operations to previously deleted paths to fail. Emptying the trash should help in such cases. -These auto-created files can be excluded from the sync using [metadata -filtering](https://rclone.org/filtering/#metadata). +# Koofr - rclone sync ... --metadata-exclude "source=metadata" --metadata-exclude "format=Metadata" +Paths are specified as `remote:path` -Which excludes from the sync any files which have the -`source=metadata` or `format=Metadata` flags which are added to -Internet Archive auto-created files. +Paths may be as deep as required, e.g. `remote:directory/subdirectory`. ## Configuration -Here is an example of making an internetarchive configuration. -Most applies to the other providers as well, any differences are described [below](#providers). +The initial setup for Koofr involves creating an application password for +rclone. You can do that by opening the Koofr +[web application](https://app.koofr.net/app/admin/preferences/password), +giving the password a nice name like `rclone` and clicking on generate. -First run +Here is an example of how to make a remote called `koofr`. First run: - rclone config + rclone config -This will guide you through an interactive setup process. +This will guide you through an interactive setup process: ``` No remotes found, make a new one? @@ -35619,60 +37118,51 @@ n) New remote s) Set configuration password q) Quit config n/s/q> n -name> remote +name> koofr Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. -XX / InternetArchive Items - \ (internetarchive) -Storage> internetarchive -Option access_key_id. -IAS3 Access Key. -Leave blank for anonymous access. -You can find one here: https://archive.org/account/s3.php -Enter a value. Press Enter to leave empty. -access_key_id> XXXX -Option secret_access_key. -IAS3 Secret Key (password). -Leave blank for anonymous access. -Enter a value. Press Enter to leave empty. -secret_access_key> XXXX -Edit advanced config? -y) Yes -n) No (default) -y/n> y -Option endpoint. -IAS3 Endpoint. -Leave blank for default value. -Enter a string value. Press Enter for the default (https://s3.us.archive.org). -endpoint> -Option front_endpoint. -Host of InternetArchive Frontend. -Leave blank for default value. -Enter a string value. Press Enter for the default (https://archive.org). -front_endpoint> -Option disable_checksum. -Don't store MD5 checksum with object metadata. -Normally rclone will calculate the MD5 checksum of the input before -uploading it so it can ask the server to check the object against checksum. -This is great for data integrity checking but can cause long delays for -large files to start uploading. -Enter a boolean value (true or false). Press Enter for the default (true). -disable_checksum> true -Option encoding. -The encoding for the backend. -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -Enter a encoder.MultiEncoder value. Press Enter for the default (Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot). -encoding> +[snip] +22 / Koofr, Digi Storage and other Koofr-compatible storage providers + \ (koofr) +[snip] +Storage> koofr +Option provider. +Choose your storage provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / Koofr, https://app.koofr.net/ + \ (koofr) + 2 / Digi Storage, https://storage.rcs-rds.ro/ + \ (digistorage) + 3 / Any other Koofr API compatible storage service + \ (other) +provider> 1 +Option user. +Your user name. +Enter a value. +user> USERNAME +Option password. +Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password). +Choose an alternative below. +y) Yes, type in my own password +g) Generate random password +y/g> y +Enter the password: +password: +Confirm the password: +password: Edit advanced config? y) Yes n) No (default) y/n> n +Remote config -------------------- -[remote] -type = internetarchive -access_key_id = XXXX -secret_access_key = XXXX +[koofr] +type = koofr +provider = koofr +user = USERNAME +password = *** ENCRYPTED *** -------------------- y) Yes this is OK (default) e) Edit this remote @@ -35680,97 +37170,127 @@ d) Delete this remote y/e/d> y ``` +You can choose to edit advanced config in order to enter your own service URL +if you use an on-premise or white label Koofr instance, or choose an alternative +mount instead of your primary storage. -### Standard options +Once configured you can then use `rclone` like this, -Here are the Standard options specific to internetarchive (Internet Archive). +List directories in top level of your Koofr -#### --internetarchive-access-key-id + rclone lsd koofr: -IAS3 Access Key. +List all the files in your Koofr -Leave blank for anonymous access. -You can find one here: https://archive.org/account/s3.php + rclone ls koofr: -Properties: +To copy a local directory to an Koofr directory called backup -- Config: access_key_id -- Env Var: RCLONE_INTERNETARCHIVE_ACCESS_KEY_ID -- Type: string -- Required: false + rclone copy /home/source koofr:backup -#### --internetarchive-secret-access-key +### Restricted filename characters -IAS3 Secret Key (password). +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) +the following characters are also replaced: -Leave blank for anonymous access. +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| \ | 0x5C | \ | + +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in XML strings. + + +### Standard options + +Here are the Standard options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers). + +#### --koofr-provider + +Choose your storage provider. Properties: -- Config: secret_access_key -- Env Var: RCLONE_INTERNETARCHIVE_SECRET_ACCESS_KEY +- Config: provider +- Env Var: RCLONE_KOOFR_PROVIDER - Type: string - Required: false +- Examples: + - "koofr" + - Koofr, https://app.koofr.net/ + - "digistorage" + - Digi Storage, https://storage.rcs-rds.ro/ + - "other" + - Any other Koofr API compatible storage service -### Advanced options +#### --koofr-endpoint -Here are the Advanced options specific to internetarchive (Internet Archive). +The Koofr API endpoint to use. -#### --internetarchive-endpoint +Properties: -IAS3 Endpoint. +- Config: endpoint +- Env Var: RCLONE_KOOFR_ENDPOINT +- Provider: other +- Type: string +- Required: true -Leave blank for default value. +#### --koofr-user + +Your user name. Properties: -- Config: endpoint -- Env Var: RCLONE_INTERNETARCHIVE_ENDPOINT +- Config: user +- Env Var: RCLONE_KOOFR_USER - Type: string -- Default: "https://s3.us.archive.org" +- Required: true -#### --internetarchive-front-endpoint +#### --koofr-password -Host of InternetArchive Frontend. +Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password). -Leave blank for default value. +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: -- Config: front_endpoint -- Env Var: RCLONE_INTERNETARCHIVE_FRONT_ENDPOINT +- Config: password +- Env Var: RCLONE_KOOFR_PASSWORD +- Provider: koofr - Type: string -- Default: "https://archive.org" +- Required: true -#### --internetarchive-disable-checksum +### Advanced options -Don't ask the server to test against MD5 checksum calculated by rclone. -Normally rclone will calculate the MD5 checksum of the input before -uploading it so it can ask the server to check the object against checksum. -This is great for data integrity checking but can cause long delays for -large files to start uploading. +Here are the Advanced options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers). + +#### --koofr-mountid + +Mount ID of the mount to use. + +If omitted, the primary mount is used. Properties: -- Config: disable_checksum -- Env Var: RCLONE_INTERNETARCHIVE_DISABLE_CHECKSUM -- Type: bool -- Default: true +- Config: mountid +- Env Var: RCLONE_KOOFR_MOUNTID +- Type: string +- Required: false -#### --internetarchive-wait-archive +#### --koofr-setmtime -Timeout for waiting the server's processing tasks (specifically archive and book_op) to finish. -Only enable if you need to be guaranteed to be reflected after write operations. -0 to disable waiting. No errors to be thrown in case of timeout. +Does the backend support setting modification time. + +Set this to false if you use a mount ID that points to a Dropbox or Amazon Drive backend. Properties: -- Config: wait_archive -- Env Var: RCLONE_INTERNETARCHIVE_WAIT_ARCHIVE -- Type: Duration -- Default: 0s +- Config: setmtime +- Env Var: RCLONE_KOOFR_SETMTIME +- Type: bool +- Default: true -#### --internetarchive-encoding +#### --koofr-encoding The encoding for the backend. @@ -35779,138 +37299,268 @@ See the [encoding section in the overview](https://rclone.org/overview/#encoding Properties: - Config: encoding -- Env Var: RCLONE_INTERNETARCHIVE_ENCODING -- Type: MultiEncoder -- Default: Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot +- Env Var: RCLONE_KOOFR_ENCODING +- Type: Encoding +- Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot -### Metadata -Metadata fields provided by Internet Archive. -If there are multiple values for a key, only the first one is returned. -This is a limitation of Rclone, that supports one value per one key. -Owner is able to add custom keys. Metadata feature grabs all the keys including them. +## Limitations -Here are the possible system metadata items for the internetarchive backend. +Note that Koofr is case insensitive so you can't have a file called +"Hello.doc" and one called "hello.doc". -| Name | Help | Type | Example | Read Only | -|------|------|------|---------|-----------| -| crc32 | CRC32 calculated by Internet Archive | string | 01234567 | **Y** | -| format | Name of format identified by Internet Archive | string | Comma-Separated Values | **Y** | -| md5 | MD5 hash calculated by Internet Archive | string | 01234567012345670123456701234567 | **Y** | -| mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | **Y** | -| name | Full file path, without the bucket part | filename | backend/internetarchive/internetarchive.go | **Y** | -| old_version | Whether the file was replaced and moved by keep-old-version flag | boolean | true | **Y** | -| rclone-ia-mtime | Time of last modification, managed by Internet Archive | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N | -| rclone-mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N | -| rclone-update-track | Random value used by Rclone for tracking changes inside Internet Archive | string | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | N | -| sha1 | SHA1 hash calculated by Internet Archive | string | 0123456701234567012345670123456701234567 | **Y** | -| size | File size in bytes | decimal number | 123456 | **Y** | -| source | The source of the file | string | original | **Y** | -| summation | Check https://forum.rclone.org/t/31922 for how it is used | string | md5 | **Y** | -| viruscheck | The last time viruscheck process was run for the file (?) | unixtime | 1654191352 | **Y** | +## Providers -See the [metadata](https://rclone.org/docs/#metadata) docs for more info. +### Koofr + +This is the original [Koofr](https://koofr.eu) storage provider used as main example and described in the [configuration](#configuration) section above. + +### Digi Storage + +[Digi Storage](https://www.digi.ro/servicii/online/digi-storage) is a cloud storage service run by [Digi.ro](https://www.digi.ro/) that +provides a Koofr API. + +Here is an example of how to make a remote called `ds`. First run: + + rclone config + +This will guide you through an interactive setup process: + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> ds +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] +22 / Koofr, Digi Storage and other Koofr-compatible storage providers + \ (koofr) +[snip] +Storage> koofr +Option provider. +Choose your storage provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / Koofr, https://app.koofr.net/ + \ (koofr) + 2 / Digi Storage, https://storage.rcs-rds.ro/ + \ (digistorage) + 3 / Any other Koofr API compatible storage service + \ (other) +provider> 2 +Option user. +Your user name. +Enter a value. +user> USERNAME +Option password. +Your password for rclone (generate one at https://storage.rcs-rds.ro/app/admin/preferences/password). +Choose an alternative below. +y) Yes, type in my own password +g) Generate random password +y/g> y +Enter the password: +password: +Confirm the password: +password: +Edit advanced config? +y) Yes +n) No (default) +y/n> n +-------------------- +[ds] +type = koofr +provider = digistorage +user = USERNAME +password = *** ENCRYPTED *** +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` + +### Other + +You may also want to use another, public or private storage provider that runs a Koofr API compatible service, by simply providing the base URL to connect to. + +Here is an example of how to make a remote called `other`. First run: + + rclone config + +This will guide you through an interactive setup process: + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> other +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] +22 / Koofr, Digi Storage and other Koofr-compatible storage providers + \ (koofr) +[snip] +Storage> koofr +Option provider. +Choose your storage provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / Koofr, https://app.koofr.net/ + \ (koofr) + 2 / Digi Storage, https://storage.rcs-rds.ro/ + \ (digistorage) + 3 / Any other Koofr API compatible storage service + \ (other) +provider> 3 +Option endpoint. +The Koofr API endpoint to use. +Enter a value. +endpoint> https://koofr.other.org +Option user. +Your user name. +Enter a value. +user> USERNAME +Option password. +Your password for rclone (generate one at your service's settings page). +Choose an alternative below. +y) Yes, type in my own password +g) Generate random password +y/g> y +Enter the password: +password: +Confirm the password: +password: +Edit advanced config? +y) Yes +n) No (default) +y/n> n +-------------------- +[other] +type = koofr +provider = other +endpoint = https://koofr.other.org +user = USERNAME +password = *** ENCRYPTED *** +-------------------- +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +``` +# Linkbox + +Linkbox is [a private cloud drive](https://linkbox.to/). + +## Configuration + +Here is an example of making a remote for Linkbox. + +First run: + + rclone config + +This will guide you through an interactive setup process: + +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +Enter name for new remote. +name> remote -# Jottacloud +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +XX / Linkbox + \ (linkbox) +Storage> XX -Jottacloud is a cloud storage service provider from a Norwegian company, using its own datacenters -in Norway. In addition to the official service at [jottacloud.com](https://www.jottacloud.com/), -it also provides white-label solutions to different companies, such as: -* Telia - * Telia Cloud (cloud.telia.se) - * Telia Sky (sky.telia.no) -* Tele2 - * Tele2 Cloud (mittcloud.tele2.se) -* Onlime - * Onlime Cloud Storage (onlime.dk) -* Elkjøp (with subsidiaries): - * Elkjøp Cloud (cloud.elkjop.no) - * Elgiganten Sweden (cloud.elgiganten.se) - * Elgiganten Denmark (cloud.elgiganten.dk) - * Giganti Cloud (cloud.gigantti.fi) - * ELKO Cloud (cloud.elko.is) +Option token. +Token from https://www.linkbox.to/admin/account +Enter a value. +token> testFromCLToken -Most of the white-label versions are supported by this backend, although may require different -authentication setup - described below. +Configuration complete. +Options: +- type: linkbox +- token: XXXXXXXXXXX +Keep this "linkbox" remote? +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y -Paths are specified as `remote:path` +``` -Paths may be as deep as required, e.g. `remote:directory/subdirectory`. -## Authentication types +### Standard options -Some of the whitelabel versions uses a different authentication method than the official service, -and you have to choose the correct one when setting up the remote. +Here are the Standard options specific to linkbox (Linkbox). -### Standard authentication +#### --linkbox-token -The standard authentication method used by the official service (jottacloud.com), as well as -some of the whitelabel services, requires you to generate a single-use personal login token -from the account security settings in the service's web interface. Log in to your account, -go to "Settings" and then "Security", or use the direct link presented to you by rclone when -configuring the remote: . Scroll down to the section -"Personal login token", and click the "Generate" button. Note that if you are using a -whitelabel service you probably can't use the direct link, you need to find the same page in -their dedicated web interface, and also it may be in a different location than described above. +Token from https://www.linkbox.to/admin/account -To access your account from multiple instances of rclone, you need to configure each of them -with a separate personal login token. E.g. you create a Jottacloud remote with rclone in one -location, and copy the configuration file to a second location where you also want to run -rclone and access the same remote. Then you need to replace the token for one of them, using -the [config reconnect](https://rclone.org/commands/rclone_config_reconnect/) command, which -requires you to generate a new personal login token and supply as input. If you do not -do this, the token may easily end up being invalidated, resulting in both instances failing -with an error message something along the lines of: +Properties: - oauth2: cannot fetch token: 400 Bad Request - Response: {"error":"invalid_grant","error_description":"Stale token"} +- Config: token +- Env Var: RCLONE_LINKBOX_TOKEN +- Type: string +- Required: true -When this happens, you need to replace the token as described above to be able to use your -remote again. -All personal login tokens you have taken into use will be listed in the web interface under -"My logged in devices", and from the right side of that list you can click the "X" button to -revoke individual tokens. -### Legacy authentication +## Limitations -If you are using one of the whitelabel versions (e.g. from Elkjøp) you may not have the option -to generate a CLI token. In this case you'll have to use the legacy authentication. To do this select -yes when the setup asks for legacy authentication and enter your username and password. -The rest of the setup is identical to the default setup. +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. -### Telia Cloud authentication +# Mail.ru Cloud -Similar to other whitelabel versions Telia Cloud doesn't offer the option of creating a CLI token, and -additionally uses a separate authentication flow where the username is generated internally. To setup -rclone to use Telia Cloud, choose Telia Cloud authentication in the setup. The rest of the setup is -identical to the default setup. +[Mail.ru Cloud](https://cloud.mail.ru/) is a cloud storage provided by a Russian internet company [Mail.Ru Group](https://mail.ru). The official desktop client is [Disk-O:](https://disk-o.cloud/en), available on Windows and Mac OS. -### Tele2 Cloud authentication +## Features highlights -As Tele2-Com Hem merger was completed this authentication can be used for former Com Hem Cloud and -Tele2 Cloud customers as no support for creating a CLI token exists, and additionally uses a separate -authentication flow where the username is generated internally. To setup rclone to use Tele2 Cloud, -choose Tele2 Cloud authentication in the setup. The rest of the setup is identical to the default setup. +- Paths may be as deep as required, e.g. `remote:directory/subdirectory` +- Files have a `last modified time` property, directories don't +- Deleted files are by default moved to the trash +- Files and directories can be shared via public links +- Partial uploads or streaming are not supported, file size must be known before upload +- Maximum file size is limited to 2G for a free account, unlimited for paid accounts +- Storage keeps hash for all files and performs transparent deduplication, + the hash algorithm is a modified SHA1 +- If a particular file is already present in storage, one can quickly submit file hash + instead of long file upload (this optimization is supported by rclone) -### Onlime Cloud Storage authentication +## Configuration -Onlime has sold access to Jottacloud proper, while providing localized support to Danish Customers, but -have recently set up their own hosting, transferring their customers from Jottacloud servers to their -own ones. +Here is an example of making a mailru configuration. -This, of course, necessitates using their servers for authentication, but otherwise functionality and -architecture seems equivalent to Jottacloud. +First create a Mail.ru Cloud account and choose a tariff. -To setup rclone to use Onlime Cloud Storage, choose Onlime Cloud authentication in the setup. The rest -of the setup is identical to the default setup. +You will need to log in and create an app password for rclone. Rclone +**will not work** with your normal username and password - it will +give an error like `oauth2: server response missing access_token`. -## Configuration +- Click on your user icon in the top right +- Go to Security / "Пароль и безопасность" +- Click password for apps / "Пароли для внешних приложений" +- Add the password - give it a name - eg "rclone" +- Copy the password and use this password below - your normal login password won't work. -Here is an example of how to make a remote called `remote` with the default setup. First run: +Now run rclone config @@ -35923,157 +37573,103 @@ s) Set configuration password q) Quit config n/s/q> n name> remote -Option Storage. Type of storage to configure. -Choose a number from below, or type in your own value. +Type of storage to configure. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value [snip] -XX / Jottacloud - \ (jottacloud) +XX / Mail.ru Cloud + \ "mailru" [snip] -Storage> jottacloud -Edit advanced config? +Storage> mailru +User name (usually email) +Enter a string value. Press Enter for the default (""). +user> username@mail.ru +Password + +This must be an app password - rclone will not work with your normal +password. See the Configuration section in the docs for how to make an +app password. +y) Yes type in my own password +g) Generate random password +y/g> y +Enter the password: +password: +Confirm the password: +password: +Skip full upload if there is another file with same data hash. +This feature is called "speedup" or "put by hash". It is especially efficient +in case of generally available files like popular books, video or audio clips +[snip] +Enter a boolean value (true or false). Press Enter for the default ("true"). +Choose a number from below, or type in your own value + 1 / Enable + \ "true" + 2 / Disable + \ "false" +speedup_enable> 1 +Edit advanced config? (y/n) y) Yes -n) No (default) +n) No y/n> n -Option config_type. -Select authentication type. -Choose a number from below, or type in an existing string value. -Press Enter for the default (standard). - / Standard authentication. - 1 | Use this if you're a normal Jottacloud user. - \ (standard) - / Legacy authentication. - 2 | This is only required for certain whitelabel versions of Jottacloud and not recommended for normal users. - \ (legacy) - / Telia Cloud authentication. - 3 | Use this if you are using Telia Cloud. - \ (telia) - / Tele2 Cloud authentication. - 4 | Use this if you are using Tele2 Cloud. - \ (tele2) - / Onlime Cloud authentication. - 5 | Use this if you are using Onlime Cloud. - \ (onlime) -config_type> 1 -Personal login token. -Generate here: https://www.jottacloud.com/web/secure -Login Token> -Use a non-standard device/mountpoint? -Choosing no, the default, will let you access the storage used for the archive -section of the official Jottacloud client. If you instead want to access the -sync or the backup section, for example, you must choose yes. -y) Yes -n) No (default) -y/n> y -Option config_device. -The device to use. In standard setup the built-in Jotta device is used, -which contains predefined mountpoints for archive, sync etc. All other devices -are treated as backup devices by the official Jottacloud client. You may create -a new by entering a unique name. -Choose a number from below, or type in your own string value. -Press Enter for the default (DESKTOP-3H31129). - 1 > DESKTOP-3H31129 - 2 > Jotta -config_device> 2 -Option config_mountpoint. -The mountpoint to use for the built-in device Jotta. -The standard setup is to use the Archive mountpoint. Most other mountpoints -have very limited support in rclone and should generally be avoided. -Choose a number from below, or type in an existing string value. -Press Enter for the default (Archive). - 1 > Archive - 2 > Shared - 3 > Sync -config_mountpoint> 1 +Remote config -------------------- [remote] -type = jottacloud -configVersion = 1 -client_id = jottacli -client_secret = -tokenURL = https://id.jottacloud.com/auth/realms/jottacloud/protocol/openid-connect/token -token = {........} -username = 2940e57271a93d987d6f8a21 -device = Jotta -mountpoint = Archive +type = mailru +user = username@mail.ru +pass = *** ENCRYPTED *** +speedup_enable = true -------------------- -y) Yes this is OK (default) +y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y ``` -Once configured you can then use `rclone` like this, +Configuration of this backend does not require a local web browser. +You can use the configured backend as shown below: -List directories in top level of your Jottacloud +See top level directories rclone lsd remote: -List all the files in your Jottacloud - - rclone ls remote: - -To copy a local directory to an Jottacloud directory called backup - - rclone copy /home/source remote:backup - -### Devices and Mountpoints +Make a new directory -The official Jottacloud client registers a device for each computer you install -it on, and shows them in the backup section of the user interface. For each -folder you select for backup it will create a mountpoint within this device. -A built-in device called Jotta is special, and contains mountpoints Archive, -Sync and some others, used for corresponding features in official clients. + rclone mkdir remote:directory -With rclone you'll want to use the standard Jotta/Archive device/mountpoint in -most cases. However, you may for example want to access files from the sync or -backup functionality provided by the official clients, and rclone therefore -provides the option to select other devices and mountpoints during config. +List the contents of a directory -You are allowed to create new devices and mountpoints. All devices except the -built-in Jotta device are treated as backup devices by official Jottacloud -clients, and the mountpoints on them are individual backup sets. + rclone ls remote:directory -With the built-in Jotta device, only existing, built-in, mountpoints can be -selected. In addition to the mentioned Archive and Sync, it may contain -several other mountpoints such as: Latest, Links, Shared and Trash. All of -these are special mountpoints with a different internal representation than -the "regular" mountpoints. Rclone will only to a very limited degree support -them. Generally you should avoid these, unless you know what you are doing. +Sync `/home/local/directory` to the remote path, deleting any +excess files in the path. -### --fast-list + rclone sync --interactive /home/local/directory remote:directory -This remote supports `--fast-list` which allows you to use fewer -transactions in exchange for more memory. See the [rclone -docs](https://rclone.org/docs/#fast-list) for more details. +### Modification times and hashes -Note that the implementation in Jottacloud always uses only a single -API request to get the entire list, so for large folders this could -lead to long wait time before the first results are shown. +Files support a modification time attribute with up to 1 second precision. +Directories do not have a modification time, which is shown as "Jan 1 1970". -Note also that with rclone version 1.58 and newer information about -[MIME types](https://rclone.org/overview/#mime-type) are not available when using `--fast-list`. +File hashes are supported, with a custom Mail.ru algorithm based on SHA1. +If file size is less than or equal to the SHA1 block size (20 bytes), +its hash is simply its data right-padded with zero bytes. +Hashes of a larger file is computed as a SHA1 of the file data +bytes concatenated with a decimal representation of the data length. -### Modified time and hashes +### Emptying Trash -Jottacloud allows modification times to be set on objects accurate to 1 -second. These will be used to detect whether objects need syncing or -not. +Removing a file or directory actually moves it to the trash, which is not +visible to rclone but can be seen in a web browser. The trashed file +still occupies part of total quota. If you wish to empty your trash +and free some quota, you can use the `rclone cleanup remote:` command, +which will permanently delete all your trashed files. +This command does not take any path arguments. -Jottacloud supports MD5 type hashes, so you can use the `--checksum` -flag. +### Quota information -Note that Jottacloud requires the MD5 hash before upload so if the -source does not have an MD5 checksum then the file will be cached -temporarily on disk (in location given by -[--temp-dir](https://rclone.org/docs/#temp-dir-dir)) before it is uploaded. -Small files will be cached in memory - see the -[--jottacloud-md5-memory-limit](#jottacloud-md5-memory-limit) flag. -When uploading from local disk the source checksum is always available, -so this does not apply. Starting with rclone version 1.52 the same is -true for encrypted remotes (in older versions the crypt backend would not -calculate hashes for uploads from local disk, so the Jottacloud -backend had to do it as described above). +To view your current quota you can use the `rclone about remote:` +command which will display your usage limit (quota) and the current usage. ### Restricted filename characters @@ -36088,38 +37684,18 @@ the following characters are also replaced: | < | 0x3C | < | | > | 0x3E | > | | ? | 0x3F | ? | +| \ | 0x5C | \ | | \| | 0x7C | | | Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in XML strings. - -### Deleting files - -By default, rclone will send all files to the trash when deleting files. They will be permanently -deleted automatically after 30 days. You may bypass the trash and permanently delete files immediately -by using the [--jottacloud-hard-delete](#jottacloud-hard-delete) flag, or set the equivalent environment variable. -Emptying the trash is supported by the [cleanup](https://rclone.org/commands/rclone_cleanup/) command. - -### Versions - -Jottacloud supports file versioning. When rclone uploads a new version of a file it creates a new version of it. -Currently rclone only supports retrieving the current version but older versions can be accessed via the Jottacloud Website. - -Versioning can be disabled by `--jottacloud-no-versions` option. This is achieved by deleting the remote file prior to uploading -a new version. If the upload the fails no version of the file will be available in the remote. - -### Quota information - -To view your current quota you can use the `rclone about remote:` -command which will display your usage limit (unless it is unlimited) -and the current usage. +as they can't be used in JSON strings. ### Standard options -Here are the Standard options specific to jottacloud (Jottacloud). +Here are the Standard options specific to mailru (Mail.ru Cloud). -#### --jottacloud-client-id +#### --mailru-client-id OAuth Client Id. @@ -36128,11 +37704,11 @@ Leave blank normally. Properties: - Config: client_id -- Env Var: RCLONE_JOTTACLOUD_CLIENT_ID +- Env Var: RCLONE_MAILRU_CLIENT_ID - Type: string - Required: false -#### --jottacloud-client-secret +#### --mailru-client-secret OAuth Client Secret. @@ -36141,26 +37717,80 @@ Leave blank normally. Properties: - Config: client_secret -- Env Var: RCLONE_JOTTACLOUD_CLIENT_SECRET +- Env Var: RCLONE_MAILRU_CLIENT_SECRET - Type: string - Required: false +#### --mailru-user + +User name (usually email). + +Properties: + +- Config: user +- Env Var: RCLONE_MAILRU_USER +- Type: string +- Required: true + +#### --mailru-pass + +Password. + +This must be an app password - rclone will not work with your normal +password. See the Configuration section in the docs for how to make an +app password. + + +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + +Properties: + +- Config: pass +- Env Var: RCLONE_MAILRU_PASS +- Type: string +- Required: true + +#### --mailru-speedup-enable + +Skip full upload if there is another file with same data hash. + +This feature is called "speedup" or "put by hash". It is especially efficient +in case of generally available files like popular books, video or audio clips, +because files are searched by hash in all accounts of all mailru users. +It is meaningless and ineffective if source file is unique or encrypted. +Please note that rclone may need local memory and disk space to calculate +content hash in advance and decide whether full upload is required. +Also, if rclone does not know file size in advance (e.g. in case of +streaming or partial uploads), it will not even try this optimization. + +Properties: + +- Config: speedup_enable +- Env Var: RCLONE_MAILRU_SPEEDUP_ENABLE +- Type: bool +- Default: true +- Examples: + - "true" + - Enable + - "false" + - Disable + ### Advanced options -Here are the Advanced options specific to jottacloud (Jottacloud). +Here are the Advanced options specific to mailru (Mail.ru Cloud). -#### --jottacloud-token +#### --mailru-token OAuth Access Token as a JSON blob. Properties: - Config: token -- Env Var: RCLONE_JOTTACLOUD_TOKEN +- Env Var: RCLONE_MAILRU_TOKEN - Type: string - Required: false -#### --jottacloud-auth-url +#### --mailru-auth-url Auth server URL. @@ -36169,11 +37799,11 @@ Leave blank to use the provider defaults. Properties: - Config: auth_url -- Env Var: RCLONE_JOTTACLOUD_AUTH_URL +- Env Var: RCLONE_MAILRU_AUTH_URL - Type: string - Required: false -#### --jottacloud-token-url +#### --mailru-token-url Token server url. @@ -36182,68 +37812,117 @@ Leave blank to use the provider defaults. Properties: - Config: token_url -- Env Var: RCLONE_JOTTACLOUD_TOKEN_URL +- Env Var: RCLONE_MAILRU_TOKEN_URL - Type: string - Required: false -#### --jottacloud-md5-memory-limit +#### --mailru-speedup-file-patterns -Files bigger than this will be cached on disk to calculate the MD5 if required. +Comma separated list of file name patterns eligible for speedup (put by hash). + +Patterns are case insensitive and can contain '*' or '?' meta characters. Properties: -- Config: md5_memory_limit -- Env Var: RCLONE_JOTTACLOUD_MD5_MEMORY_LIMIT -- Type: SizeSuffix -- Default: 10Mi +- Config: speedup_file_patterns +- Env Var: RCLONE_MAILRU_SPEEDUP_FILE_PATTERNS +- Type: string +- Default: "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf" +- Examples: + - "" + - Empty list completely disables speedup (put by hash). + - "*" + - All files will be attempted for speedup. + - "*.mkv,*.avi,*.mp4,*.mp3" + - Only common audio/video files will be tried for put by hash. + - "*.zip,*.gz,*.rar,*.pdf" + - Only common archives or PDF books will be tried for speedup. -#### --jottacloud-trashed-only +#### --mailru-speedup-max-disk -Only show files that are in the trash. +This option allows you to disable speedup (put by hash) for large files. -This will show trashed files in their original directory structure. +Reason is that preliminary hashing can exhaust your RAM or disk space. Properties: -- Config: trashed_only -- Env Var: RCLONE_JOTTACLOUD_TRASHED_ONLY -- Type: bool -- Default: false +- Config: speedup_max_disk +- Env Var: RCLONE_MAILRU_SPEEDUP_MAX_DISK +- Type: SizeSuffix +- Default: 3Gi +- Examples: + - "0" + - Completely disable speedup (put by hash). + - "1G" + - Files larger than 1Gb will be uploaded directly. + - "3G" + - Choose this option if you have less than 3Gb free on local disk. -#### --jottacloud-hard-delete +#### --mailru-speedup-max-memory -Delete files permanently rather than putting them into the trash. +Files larger than the size given below will always be hashed on disk. Properties: -- Config: hard_delete -- Env Var: RCLONE_JOTTACLOUD_HARD_DELETE +- Config: speedup_max_memory +- Env Var: RCLONE_MAILRU_SPEEDUP_MAX_MEMORY +- Type: SizeSuffix +- Default: 32Mi +- Examples: + - "0" + - Preliminary hashing will always be done in a temporary disk location. + - "32M" + - Do not dedicate more than 32Mb RAM for preliminary hashing. + - "256M" + - You have at most 256Mb RAM free for hash calculations. + +#### --mailru-check-hash + +What should copy do if file checksum is mismatched or invalid. + +Properties: + +- Config: check_hash +- Env Var: RCLONE_MAILRU_CHECK_HASH - Type: bool -- Default: false +- Default: true +- Examples: + - "true" + - Fail with error. + - "false" + - Ignore and continue. -#### --jottacloud-upload-resume-limit +#### --mailru-user-agent -Files bigger than this can be resumed if the upload fail's. +HTTP user agent used internally by client. + +Defaults to "rclone/VERSION" or "--user-agent" provided on command line. Properties: -- Config: upload_resume_limit -- Env Var: RCLONE_JOTTACLOUD_UPLOAD_RESUME_LIMIT -- Type: SizeSuffix -- Default: 10Mi +- Config: user_agent +- Env Var: RCLONE_MAILRU_USER_AGENT +- Type: string +- Required: false -#### --jottacloud-no-versions +#### --mailru-quirks -Avoid server side versioning by deleting files and recreating files instead of overwriting them. +Comma separated list of internal maintenance flags. + +This option must not be used by an ordinary user. It is intended only to +facilitate remote troubleshooting of backend issues. Strict meaning of +flags is not documented and not guaranteed to persist between releases. +Quirks will be removed when the backend grows stable. +Supported quirks: atomicmkdir binlist unknowndirs Properties: -- Config: no_versions -- Env Var: RCLONE_JOTTACLOUD_NO_VERSIONS -- Type: bool -- Default: false +- Config: quirks +- Env Var: RCLONE_MAILRU_QUIRKS +- Type: string +- Required: false -#### --jottacloud-encoding +#### --mailru-encoding The encoding for the backend. @@ -36252,28 +37931,31 @@ See the [encoding section in the overview](https://rclone.org/overview/#encoding Properties: - Config: encoding -- Env Var: RCLONE_JOTTACLOUD_ENCODING -- Type: MultiEncoder -- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot +- Env Var: RCLONE_MAILRU_ENCODING +- Type: Encoding +- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot ## Limitations -Note that Jottacloud is case insensitive so you can't have a file called -"Hello.doc" and one called "hello.doc". - -There are quite a few characters that can't be in Jottacloud file names. Rclone will map these names to and from an identical -looking unicode equivalent. For example if a file has a ? in it will be mapped to ? instead. +File size limits depend on your account. A single file size is limited by 2G +for a free account and unlimited for paid tariffs. Please refer to the Mail.ru +site for the total uploaded size limits. -Jottacloud only supports filenames up to 255 characters in length. +Note that Mailru is case insensitive so you can't have a file called +"Hello.doc" and one called "hello.doc". -## Troubleshooting +# Mega -Jottacloud exhibits some inconsistent behaviours regarding deleted files and folders which may cause Copy, Move and DirMove -operations to previously deleted paths to fail. Emptying the trash should help in such cases. +[Mega](https://mega.nz/) is a cloud storage and file hosting service +known for its security feature where all files are encrypted locally +before they are uploaded. This prevents anyone (including employees of +Mega) from accessing the files without knowledge of the key used for +encryption. -# Koofr +This is an rclone backend for Mega which supports the file transfer +features of Mega using the same client side encryption. Paths are specified as `remote:path` @@ -36281,12 +37963,7 @@ Paths may be as deep as required, e.g. `remote:directory/subdirectory`. ## Configuration -The initial setup for Koofr involves creating an application password for -rclone. You can do that by opening the Koofr -[web application](https://app.koofr.net/app/admin/preferences/password), -giving the password a nice name like `rclone` and clicking on generate. - -Here is an example of how to make a remote called `koofr`. First run: +Here is an example of how to make a remote called `remote`. First run: rclone config @@ -36298,207 +37975,243 @@ n) New remote s) Set configuration password q) Quit config n/s/q> n -name> koofr -Option Storage. +name> remote Type of storage to configure. -Choose a number from below, or type in your own value. +Choose a number from below, or type in your own value [snip] -22 / Koofr, Digi Storage and other Koofr-compatible storage providers - \ (koofr) +XX / Mega + \ "mega" [snip] -Storage> koofr -Option provider. -Choose your storage provider. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / Koofr, https://app.koofr.net/ - \ (koofr) - 2 / Digi Storage, https://storage.rcs-rds.ro/ - \ (digistorage) - 3 / Any other Koofr API compatible storage service - \ (other) -provider> 1 -Option user. -Your user name. -Enter a value. -user> USERNAME -Option password. -Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password). -Choose an alternative below. -y) Yes, type in my own password +Storage> mega +User name +user> you@example.com +Password. +y) Yes type in my own password g) Generate random password -y/g> y +n) No leave this optional password blank +y/g/n> y Enter the password: password: Confirm the password: password: -Edit advanced config? -y) Yes -n) No (default) -y/n> n Remote config -------------------- -[koofr] -type = koofr -provider = koofr -user = USERNAME -password = *** ENCRYPTED *** +[remote] +type = mega +user = you@example.com +pass = *** ENCRYPTED *** -------------------- -y) Yes this is OK (default) +y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y ``` -You can choose to edit advanced config in order to enter your own service URL -if you use an on-premise or white label Koofr instance, or choose an alternative -mount instead of your primary storage. +**NOTE:** The encryption keys need to have been already generated after a regular login +via the browser, otherwise attempting to use the credentials in `rclone` will fail. Once configured you can then use `rclone` like this, -List directories in top level of your Koofr +List directories in top level of your Mega - rclone lsd koofr: + rclone lsd remote: -List all the files in your Koofr +List all the files in your Mega - rclone ls koofr: + rclone ls remote: -To copy a local directory to an Koofr directory called backup +To copy a local directory to an Mega directory called backup - rclone copy /home/source koofr:backup + rclone copy /home/source remote:backup -### Restricted filename characters +### Modification times and hashes -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) -the following characters are also replaced: +Mega does not support modification times or hashes yet. + +### Restricted filename characters | Character | Value | Replacement | | --------- |:-----:|:-----------:| -| \ | 0x5C | \ | +| NUL | 0x00 | ␀ | +| / | 0x2F | / | Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in XML strings. +as they can't be used in JSON strings. +### Duplicated files -### Standard options +Mega can have two files with exactly the same name and path (unlike a +normal file system). -Here are the Standard options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers). +Duplicated files cause problems with the syncing and you will see +messages in the log about duplicates. -#### --koofr-provider +Use `rclone dedupe` to fix duplicated files. -Choose your storage provider. +### Failure to log-in -Properties: +#### Object not found -- Config: provider -- Env Var: RCLONE_KOOFR_PROVIDER -- Type: string -- Required: false -- Examples: - - "koofr" - - Koofr, https://app.koofr.net/ - - "digistorage" - - Digi Storage, https://storage.rcs-rds.ro/ - - "other" - - Any other Koofr API compatible storage service +If you are connecting to your Mega remote for the first time, +to test access and synchronization, you may receive an error such as -#### --koofr-endpoint +``` +Failed to create file system for "my-mega-remote:": +couldn't login: Object (typically, node or user) not found +``` -The Koofr API endpoint to use. +The diagnostic steps often recommended in the [rclone forum](https://forum.rclone.org/search?q=mega) +start with the **MEGAcmd** utility. Note that this refers to +the official C++ command from https://github.com/meganz/MEGAcmd +and not the go language built command from t3rm1n4l/megacmd +that is no longer maintained. -Properties: +Follow the instructions for installing MEGAcmd and try accessing +your remote as they recommend. You can establish whether or not +you can log in using MEGAcmd, and obtain diagnostic information +to help you, and search or work with others in the forum. -- Config: endpoint -- Env Var: RCLONE_KOOFR_ENDPOINT -- Provider: other -- Type: string -- Required: true +``` +MEGA CMD> login me@example.com +Password: +Fetching nodes ... +Loading transfers from local cache +Login complete as me@example.com +me@example.com:/$ +``` -#### --koofr-user +Note that some have found issues with passwords containing special +characters. If you can not log on with rclone, but MEGAcmd logs on +just fine, then consider changing your password temporarily to +pure alphanumeric characters, in case that helps. -Your user name. -Properties: +#### Repeated commands blocks access -- Config: user -- Env Var: RCLONE_KOOFR_USER -- Type: string -- Required: true +Mega remotes seem to get blocked (reject logins) under "heavy use". +We haven't worked out the exact blocking rules but it seems to be +related to fast paced, successive rclone commands. -#### --koofr-password +For example, executing this command 90 times in a row `rclone link +remote:file` will cause the remote to become "blocked". This is not an +abnormal situation, for example if you wish to get the public links of +a directory with hundred of files... After more or less a week, the +remote will remote accept rclone logins normally again. -Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password). +You can mitigate this issue by mounting the remote it with `rclone +mount`. This will log-in when mounting and a log-out when unmounting +only. You can also run `rclone rcd` and then use `rclone rc` to run +the commands over the API to avoid logging in each time. -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +Rclone does not currently close mega sessions (you can see them in the +web interface), however closing the sessions does not solve the issue. -Properties: +If you space rclone commands by 3 seconds it will avoid blocking the +remote. We haven't identified the exact blocking rules, so perhaps one +could execute the command 80 times without waiting and avoid blocking +by waiting 3 seconds, then continuing... -- Config: password -- Env Var: RCLONE_KOOFR_PASSWORD -- Provider: koofr -- Type: string -- Required: true +Note that this has been observed by trial and error and might not be +set in stone. -#### --koofr-password +Other tools seem not to produce this blocking effect, as they use a +different working approach (state-based, using sessionIDs instead of +log-in) which isn't compatible with the current stateless rclone +approach. -Your password for rclone (generate one at https://storage.rcs-rds.ro/app/admin/preferences/password). +Note that once blocked, the use of other tools (such as megacmd) is +not a sure workaround: following megacmd login times have been +observed in succession for blocked remote: 7 minutes, 20 min, 30min, 30 +min, 30min. Web access looks unaffected though. -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +Investigation is continuing in relation to workarounds based on +timeouts, pacers, retrials and tpslimits - if you discover something +relevant, please post on the forum. + +So, if rclone was working nicely and suddenly you are unable to log-in +and you are sure the user and the password are correct, likely you +have got the remote blocked for a while. + + +### Standard options + +Here are the Standard options specific to mega (Mega). + +#### --mega-user + +User name. Properties: -- Config: password -- Env Var: RCLONE_KOOFR_PASSWORD -- Provider: digistorage +- Config: user +- Env Var: RCLONE_MEGA_USER - Type: string - Required: true -#### --koofr-password +#### --mega-pass -Your password for rclone (generate one at your service's settings page). +Password. **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: -- Config: password -- Env Var: RCLONE_KOOFR_PASSWORD -- Provider: other +- Config: pass +- Env Var: RCLONE_MEGA_PASS - Type: string - Required: true ### Advanced options -Here are the Advanced options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers). +Here are the Advanced options specific to mega (Mega). -#### --koofr-mountid +#### --mega-debug -Mount ID of the mount to use. +Output more debug from Mega. -If omitted, the primary mount is used. +If this flag is set (along with -vv) it will print further debugging +information from the mega backend. Properties: -- Config: mountid -- Env Var: RCLONE_KOOFR_MOUNTID -- Type: string -- Required: false +- Config: debug +- Env Var: RCLONE_MEGA_DEBUG +- Type: bool +- Default: false -#### --koofr-setmtime +#### --mega-hard-delete -Does the backend support setting modification time. +Delete files permanently rather than putting them into the trash. -Set this to false if you use a mount ID that points to a Dropbox or Amazon Drive backend. +Normally the mega backend will put all deletions into the trash rather +than permanently deleting them. If you specify this then rclone will +permanently delete objects instead. Properties: -- Config: setmtime -- Env Var: RCLONE_KOOFR_SETMTIME +- Config: hard_delete +- Env Var: RCLONE_MEGA_HARD_DELETE - Type: bool -- Default: true +- Default: false -#### --koofr-encoding +#### --mega-use-https + +Use HTTPS for transfers. + +MEGA uses plain text HTTP connections by default. +Some ISPs throttle HTTP connections, this causes transfers to become very slow. +Enabling this will force MEGA to use HTTPS for all transfers. +HTTPS is normally not necessary since all data is already encrypted anyway. +Enabling it will increase CPU usage and add network overhead. + +Properties: + +- Config: use_https +- Env Var: RCLONE_MEGA_USE_HTTPS +- Type: bool +- Default: false + +#### --mega-encoding The encoding for the backend. @@ -36507,33 +38220,38 @@ See the [encoding section in the overview](https://rclone.org/overview/#encoding Properties: - Config: encoding -- Env Var: RCLONE_KOOFR_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot +- Env Var: RCLONE_MEGA_ENCODING +- Type: Encoding +- Default: Slash,InvalidUtf8,Dot -## Limitations +### Process `killed` -Note that Koofr is case insensitive so you can't have a file called -"Hello.doc" and one called "hello.doc". +On accounts with large files or something else, memory usage can significantly increase when executing list/sync instructions. When running on cloud providers (like AWS with EC2), check if the instance type has sufficient memory/CPU to execute the commands. Use the resource monitoring tools to inspect after sending the commands. Look [at this issue](https://forum.rclone.org/t/rclone-with-mega-appears-to-work-only-in-some-accounts/40233/4). -## Providers +## Limitations -### Koofr +This backend uses the [go-mega go library](https://github.com/t3rm1n4l/go-mega) which is an opensource +go library implementing the Mega API. There doesn't appear to be any +documentation for the mega protocol beyond the [mega C++ SDK](https://github.com/meganz/sdk) source code +so there are likely quite a few errors still remaining in this library. -This is the original [Koofr](https://koofr.eu) storage provider used as main example and described in the [configuration](#configuration) section above. +Mega allows duplicate files which may confuse rclone. -### Digi Storage +# Memory -[Digi Storage](https://www.digi.ro/servicii/online/digi-storage) is a cloud storage service run by [Digi.ro](https://www.digi.ro/) that -provides a Koofr API. +The memory backend is an in RAM backend. It does not persist its +data - use the local backend for that. -Here is an example of how to make a remote called `ds`. First run: +The memory backend behaves like a bucket-based remote (e.g. like +s3). Because it has no parameters you can just use it with the +`:memory:` remote name. - rclone config +## Configuration -This will guide you through an interactive setup process: +You can configure it as a remote like this with `rclone config` too if +you want to: ``` No remotes found, make a new one? @@ -36541,50 +38259,22 @@ n) New remote s) Set configuration password q) Quit config n/s/q> n -name> ds -Option Storage. +name> remote Type of storage to configure. -Choose a number from below, or type in your own value. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value [snip] -22 / Koofr, Digi Storage and other Koofr-compatible storage providers - \ (koofr) +XX / Memory + \ "memory" [snip] -Storage> koofr -Option provider. -Choose your storage provider. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / Koofr, https://app.koofr.net/ - \ (koofr) - 2 / Digi Storage, https://storage.rcs-rds.ro/ - \ (digistorage) - 3 / Any other Koofr API compatible storage service - \ (other) -provider> 2 -Option user. -Your user name. -Enter a value. -user> USERNAME -Option password. -Your password for rclone (generate one at https://storage.rcs-rds.ro/app/admin/preferences/password). -Choose an alternative below. -y) Yes, type in my own password -g) Generate random password -y/g> y -Enter the password: -password: -Confirm the password: -password: -Edit advanced config? -y) Yes -n) No (default) -y/n> n +Storage> memory +** See help for memory backend at: https://rclone.org/memory/ ** + +Remote config + -------------------- -[ds] -type = koofr -provider = digistorage -user = USERNAME -password = *** ENCRYPTED *** +[remote] +type = memory -------------------- y) Yes this is OK (default) e) Edit this remote @@ -36592,141 +38282,106 @@ d) Delete this remote y/e/d> y ``` -### Other +Because the memory backend isn't persistent it is most useful for +testing or with an rclone server or rclone mount, e.g. -You may also want to use another, public or private storage provider that runs a Koofr API compatible service, by simply providing the base URL to connect to. + rclone mount :memory: /mnt/tmp + rclone serve webdav :memory: + rclone serve sftp :memory: -Here is an example of how to make a remote called `other`. First run: +### Modification times and hashes - rclone config +The memory backend supports MD5 hashes and modification times accurate to 1 nS. -This will guide you through an interactive setup process: +### Restricted filename characters -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> other -Option Storage. -Type of storage to configure. -Choose a number from below, or type in your own value. -[snip] -22 / Koofr, Digi Storage and other Koofr-compatible storage providers - \ (koofr) -[snip] -Storage> koofr -Option provider. -Choose your storage provider. -Choose a number from below, or type in your own value. -Press Enter to leave empty. - 1 / Koofr, https://app.koofr.net/ - \ (koofr) - 2 / Digi Storage, https://storage.rcs-rds.ro/ - \ (digistorage) - 3 / Any other Koofr API compatible storage service - \ (other) -provider> 3 -Option endpoint. -The Koofr API endpoint to use. -Enter a value. -endpoint> https://koofr.other.org -Option user. -Your user name. -Enter a value. -user> USERNAME -Option password. -Your password for rclone (generate one at your service's settings page). -Choose an alternative below. -y) Yes, type in my own password -g) Generate random password -y/g> y -Enter the password: -password: -Confirm the password: -password: -Edit advanced config? -y) Yes -n) No (default) -y/n> n --------------------- -[other] -type = koofr -provider = other -endpoint = https://koofr.other.org -user = USERNAME -password = *** ENCRYPTED *** --------------------- -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +The memory backend replaces the [default restricted characters +set](https://rclone.org/overview/#restricted-characters). -# Mail.ru Cloud -[Mail.ru Cloud](https://cloud.mail.ru/) is a cloud storage provided by a Russian internet company [Mail.Ru Group](https://mail.ru). The official desktop client is [Disk-O:](https://disk-o.cloud/en), available on Windows and Mac OS. -## Features highlights -- Paths may be as deep as required, e.g. `remote:directory/subdirectory` -- Files have a `last modified time` property, directories don't -- Deleted files are by default moved to the trash -- Files and directories can be shared via public links -- Partial uploads or streaming are not supported, file size must be known before upload -- Maximum file size is limited to 2G for a free account, unlimited for paid accounts -- Storage keeps hash for all files and performs transparent deduplication, - the hash algorithm is a modified SHA1 -- If a particular file is already present in storage, one can quickly submit file hash - instead of long file upload (this optimization is supported by rclone) +# Akamai NetStorage + +Paths are specified as `remote:` +You may put subdirectories in too, e.g. `remote:/path/to/dir`. +If you have a CP code you can use that as the folder after the domain such as \\/\\/\. + +For example, this is commonly configured with or without a CP code: +* **With a CP code**. `[your-domain-prefix]-nsu.akamaihd.net/123456/subdirectory/` +* **Without a CP code**. `[your-domain-prefix]-nsu.akamaihd.net` + + +See all buckets + rclone lsd remote: +The initial setup for Netstorage involves getting an account and secret. Use `rclone config` to walk you through the setup process. + +## Configuration + +Here's an example of how to make a remote called `ns1`. + +1. To begin the interactive configuration process, enter this command: + +``` +rclone config +``` + +2. Type `n` to create a new remote. + +``` +n) New remote +d) Delete remote +q) Quit config +e/n/d/q> n +``` -## Configuration +3. For this example, enter `ns1` when you reach the name> prompt. -Here is an example of making a mailru configuration. +``` +name> ns1 +``` -First create a Mail.ru Cloud account and choose a tariff. +4. Enter `netstorage` as the type of storage to configure. -You will need to log in and create an app password for rclone. Rclone -**will not work** with your normal username and password - it will -give an error like `oauth2: server response missing access_token`. +``` +Type of storage to configure. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value +XX / NetStorage + \ "netstorage" +Storage> netstorage +``` -- Click on your user icon in the top right -- Go to Security / "Пароль и безопасность" -- Click password for apps / "Пароли для внешних приложений" -- Add the password - give it a name - eg "rclone" -- Copy the password and use this password below - your normal login password won't work. +5. Select between the HTTP or HTTPS protocol. Most users should choose HTTPS, which is the default. HTTP is provided primarily for debugging purposes. -Now run - rclone config +``` +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 1 / HTTP protocol + \ "http" + 2 / HTTPS protocol + \ "https" +protocol> 1 +``` -This will guide you through an interactive setup process: +6. Specify your NetStorage host, CP code, and any necessary content paths using this format: `///` ``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> remote -Type of storage to configure. -Type of storage to configure. Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value -[snip] -XX / Mail.ru Cloud - \ "mailru" -[snip] -Storage> mailru -User name (usually email) +host> baseball-nsu.akamaihd.net/123456/content/ +``` + +7. Set the netstorage account name +``` Enter a string value. Press Enter for the default (""). -user> username@mail.ru -Password +account> username +``` -This must be an app password - rclone will not work with your normal -password. See the Configuration section in the docs for how to make an -app password. +8. Set the Netstorage account secret/G2O key which will be used for authentication purposes. Select the `y` option to set your own password then enter your secret. +Note: The secret is stored in the `rclone.conf` file with hex-encoded encryption. + +``` y) Yes type in my own password g) Generate random password y/g> y @@ -36734,997 +38389,1072 @@ Enter the password: password: Confirm the password: password: -Skip full upload if there is another file with same data hash. -This feature is called "speedup" or "put by hash". It is especially efficient -in case of generally available files like popular books, video or audio clips -[snip] -Enter a boolean value (true or false). Press Enter for the default ("true"). -Choose a number from below, or type in your own value - 1 / Enable - \ "true" - 2 / Disable - \ "false" -speedup_enable> 1 -Edit advanced config? (y/n) -y) Yes -n) No -y/n> n -Remote config --------------------- -[remote] -type = mailru -user = username@mail.ru -pass = *** ENCRYPTED *** -speedup_enable = true +``` + +9. View the summary and confirm your remote configuration. + +``` +[ns1] +type = netstorage +protocol = http +host = baseball-nsu.akamaihd.net/123456/content/ +account = username +secret = *** ENCRYPTED *** -------------------- -y) Yes this is OK +y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y ``` -Configuration of this backend does not require a local web browser. -You can use the configured backend as shown below: +This remote is called `ns1` and can now be used. -See top level directories +## Example operations - rclone lsd remote: +Get started with rclone and NetStorage with these examples. For additional rclone commands, visit https://rclone.org/commands/. -Make a new directory +### See contents of a directory in your project - rclone mkdir remote:directory + rclone lsd ns1:/974012/testing/ -List the contents of a directory +### Sync the contents local with remote - rclone ls remote:directory + rclone sync . ns1:/974012/testing/ -Sync `/home/local/directory` to the remote path, deleting any -excess files in the path. +### Upload local content to remote + rclone copy notes.txt ns1:/974012/testing/ - rclone sync --interactive /home/local/directory remote:directory +### Delete content on remote + rclone delete ns1:/974012/testing/notes.txt -### Modified time +### Move or copy content between CP codes. -Files support a modification time attribute with up to 1 second precision. -Directories do not have a modification time, which is shown as "Jan 1 1970". +Your credentials must have access to two CP codes on the same remote. You can't perform operations between different remotes. -### Hash checksums + rclone move ns1:/974012/testing/notes.txt ns1:/974450/testing2/ -Hash sums use a custom Mail.ru algorithm based on SHA1. -If file size is less than or equal to the SHA1 block size (20 bytes), -its hash is simply its data right-padded with zero bytes. -Hash sum of a larger file is computed as a SHA1 sum of the file data -bytes concatenated with a decimal representation of the data length. +## Features -### Emptying Trash +### Symlink Support -Removing a file or directory actually moves it to the trash, which is not -visible to rclone but can be seen in a web browser. The trashed file -still occupies part of total quota. If you wish to empty your trash -and free some quota, you can use the `rclone cleanup remote:` command, -which will permanently delete all your trashed files. -This command does not take any path arguments. +The Netstorage backend changes the rclone `--links, -l` behavior. When uploading, instead of creating the .rclonelink file, use the "symlink" API in order to create the corresponding symlink on the remote. The .rclonelink file will not be created, the upload will be intercepted and only the symlink file that matches the source file name with no suffix will be created on the remote. -### Quota information +This will effectively allow commands like copy/copyto, move/moveto and sync to upload from local to remote and download from remote to local directories with symlinks. Due to internal rclone limitations, it is not possible to upload an individual symlink file to any remote backend. You can always use the "backend symlink" command to create a symlink on the NetStorage server, refer to "symlink" section below. -To view your current quota you can use the `rclone about remote:` -command which will display your usage limit (quota) and the current usage. +Individual symlink files on the remote can be used with the commands like "cat" to print the destination name, or "delete" to delete symlink, or copy, copy/to and move/moveto to download from the remote to local. Note: individual symlink files on the remote should be specified including the suffix .rclonelink. -### Restricted filename characters +**Note**: No file with the suffix .rclonelink should ever exist on the server since it is not possible to actually upload/create a file with .rclonelink suffix with rclone, it can only exist if it is manually created through a non-rclone method on the remote. -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) -the following characters are also replaced: +### Implicit vs. Explicit Directories -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| " | 0x22 | " | -| * | 0x2A | * | -| : | 0x3A | : | -| < | 0x3C | < | -| > | 0x3E | > | -| ? | 0x3F | ? | -| \ | 0x5C | \ | -| \| | 0x7C | | | +With NetStorage, directories can exist in one of two forms: -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in JSON strings. +1. **Explicit Directory**. This is an actual, physical directory that you have created in a storage group. +2. **Implicit Directory**. This refers to a directory within a path that has not been physically created. For example, during upload of a file, nonexistent subdirectories can be specified in the target path. NetStorage creates these as "implicit." While the directories aren't physically created, they exist implicitly and the noted path is connected with the uploaded file. +Rclone will intercept all file uploads and mkdir commands for the NetStorage remote and will explicitly issue the mkdir command for each directory in the uploading path. This will help with the interoperability with the other Akamai services such as SFTP and the Content Management Shell (CMShell). Rclone will not guarantee correctness of operations with implicit directories which might have been created as a result of using an upload API directly. -### Standard options +### `--fast-list` / ListR support -Here are the Standard options specific to mailru (Mail.ru Cloud). +NetStorage remote supports the ListR feature by using the "list" NetStorage API action to return a lexicographical list of all objects within the specified CP code, recursing into subdirectories as they're encountered. -#### --mailru-client-id +* **Rclone will use the ListR method for some commands by default**. Commands such as `lsf -R` will use ListR by default. To disable this, include the `--disable listR` option to use the non-recursive method of listing objects. -OAuth Client Id. +* **Rclone will not use the ListR method for some commands**. Commands such as `sync` don't use ListR by default. To force using the ListR method, include the `--fast-list` option. -Leave blank normally. +There are pros and cons of using the ListR method, refer to [rclone documentation](https://rclone.org/docs/#fast-list). In general, the sync command over an existing deep tree on the remote will run faster with the "--fast-list" flag but with extra memory usage as a side effect. It might also result in higher CPU utilization but the whole task can be completed faster. -Properties: +**Note**: There is a known limitation that "lsf -R" will display number of files in the directory and directory size as -1 when ListR method is used. The workaround is to pass "--disable listR" flag if these numbers are important in the output. -- Config: client_id -- Env Var: RCLONE_MAILRU_CLIENT_ID -- Type: string -- Required: false +### Purge -#### --mailru-client-secret +NetStorage remote supports the purge feature by using the "quick-delete" NetStorage API action. The quick-delete action is disabled by default for security reasons and can be enabled for the account through the Akamai portal. Rclone will first try to use quick-delete action for the purge command and if this functionality is disabled then will fall back to a standard delete method. -OAuth Client Secret. +**Note**: Read the [NetStorage Usage API](https://learn.akamai.com/en-us/webhelp/netstorage/netstorage-http-api-developer-guide/GUID-15836617-9F50-405A-833C-EA2556756A30.html) for considerations when using "quick-delete". In general, using quick-delete method will not delete the tree immediately and objects targeted for quick-delete may still be accessible. -Leave blank normally. + +### Standard options + +Here are the Standard options specific to netstorage (Akamai NetStorage). + +#### --netstorage-host + +Domain+path of NetStorage host to connect to. + +Format should be `/` Properties: -- Config: client_secret -- Env Var: RCLONE_MAILRU_CLIENT_SECRET +- Config: host +- Env Var: RCLONE_NETSTORAGE_HOST - Type: string -- Required: false +- Required: true -#### --mailru-user +#### --netstorage-account -User name (usually email). +Set the NetStorage account name Properties: -- Config: user -- Env Var: RCLONE_MAILRU_USER +- Config: account +- Env Var: RCLONE_NETSTORAGE_ACCOUNT - Type: string - Required: true -#### --mailru-pass - -Password. +#### --netstorage-secret -This must be an app password - rclone will not work with your normal -password. See the Configuration section in the docs for how to make an -app password. +Set the NetStorage account secret/G2O key for authentication. +Please choose the 'y' option to set your own password then enter your secret. **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: -- Config: pass -- Env Var: RCLONE_MAILRU_PASS +- Config: secret +- Env Var: RCLONE_NETSTORAGE_SECRET - Type: string - Required: true -#### --mailru-speedup-enable +### Advanced options -Skip full upload if there is another file with same data hash. +Here are the Advanced options specific to netstorage (Akamai NetStorage). -This feature is called "speedup" or "put by hash". It is especially efficient -in case of generally available files like popular books, video or audio clips, -because files are searched by hash in all accounts of all mailru users. -It is meaningless and ineffective if source file is unique or encrypted. -Please note that rclone may need local memory and disk space to calculate -content hash in advance and decide whether full upload is required. -Also, if rclone does not know file size in advance (e.g. in case of -streaming or partial uploads), it will not even try this optimization. +#### --netstorage-protocol + +Select between HTTP or HTTPS protocol. + +Most users should choose HTTPS, which is the default. +HTTP is provided primarily for debugging purposes. Properties: -- Config: speedup_enable -- Env Var: RCLONE_MAILRU_SPEEDUP_ENABLE -- Type: bool -- Default: true +- Config: protocol +- Env Var: RCLONE_NETSTORAGE_PROTOCOL +- Type: string +- Default: "https" - Examples: - - "true" - - Enable - - "false" - - Disable + - "http" + - HTTP protocol + - "https" + - HTTPS protocol -### Advanced options +## Backend commands -Here are the Advanced options specific to mailru (Mail.ru Cloud). +Here are the commands specific to the netstorage backend. -#### --mailru-token +Run them with -OAuth Access Token as a JSON blob. + rclone backend COMMAND remote: -Properties: +The help below will explain what arguments each command takes. -- Config: token -- Env Var: RCLONE_MAILRU_TOKEN -- Type: string -- Required: false +See the [backend](https://rclone.org/commands/rclone_backend/) command for more +info on how to pass options and arguments. -#### --mailru-auth-url +These can be run on a running backend using the rc command +[backend/command](https://rclone.org/rc/#backend-command). -Auth server URL. +### du -Leave blank to use the provider defaults. +Return disk usage information for a specified directory -Properties: + rclone backend du remote: [options] [+] -- Config: auth_url -- Env Var: RCLONE_MAILRU_AUTH_URL -- Type: string -- Required: false +The usage information returned, includes the targeted directory as well as all +files stored in any sub-directories that may exist. -#### --mailru-token-url +### symlink -Token server url. +You can create a symbolic link in ObjectStore with the symlink action. -Leave blank to use the provider defaults. + rclone backend symlink remote: [options] [+] -Properties: +The desired path location (including applicable sub-directories) ending in +the object that will be the target of the symlink (for example, /links/mylink). +Include the file extension for the object, if applicable. +`rclone backend symlink ` -- Config: token_url -- Env Var: RCLONE_MAILRU_TOKEN_URL -- Type: string -- Required: false -#### --mailru-speedup-file-patterns -Comma separated list of file name patterns eligible for speedup (put by hash). +# Microsoft Azure Blob Storage -Patterns are case insensitive and can contain '*' or '?' meta characters. +Paths are specified as `remote:container` (or `remote:` for the `lsd` +command.) You may put subdirectories in too, e.g. +`remote:container/path/to/dir`. -Properties: +## Configuration -- Config: speedup_file_patterns -- Env Var: RCLONE_MAILRU_SPEEDUP_FILE_PATTERNS -- Type: string -- Default: "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf" -- Examples: - - "" - - Empty list completely disables speedup (put by hash). - - "*" - - All files will be attempted for speedup. - - "*.mkv,*.avi,*.mp4,*.mp3" - - Only common audio/video files will be tried for put by hash. - - "*.zip,*.gz,*.rar,*.pdf" - - Only common archives or PDF books will be tried for speedup. +Here is an example of making a Microsoft Azure Blob Storage +configuration. For a remote called `remote`. First run: -#### --mailru-speedup-max-disk + rclone config -This option allows you to disable speedup (put by hash) for large files. +This will guide you through an interactive setup process: -Reason is that preliminary hashing can exhaust your RAM or disk space. +``` +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Microsoft Azure Blob Storage + \ "azureblob" +[snip] +Storage> azureblob +Storage Account Name +account> account_name +Storage Account Key +key> base64encodedkey== +Endpoint for the service - leave blank normally. +endpoint> +Remote config +-------------------- +[remote] +account = account_name +key = base64encodedkey== +endpoint = +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +``` -Properties: +See all containers -- Config: speedup_max_disk -- Env Var: RCLONE_MAILRU_SPEEDUP_MAX_DISK -- Type: SizeSuffix -- Default: 3Gi -- Examples: - - "0" - - Completely disable speedup (put by hash). - - "1G" - - Files larger than 1Gb will be uploaded directly. - - "3G" - - Choose this option if you have less than 3Gb free on local disk. + rclone lsd remote: + +Make a new container + + rclone mkdir remote:container + +List the contents of a container + + rclone ls remote:container + +Sync `/home/local/directory` to the remote container, deleting any excess +files in the container. + + rclone sync --interactive /home/local/directory remote:container + +### --fast-list + +This remote supports `--fast-list` which allows you to use fewer +transactions in exchange for more memory. See the [rclone +docs](https://rclone.org/docs/#fast-list) for more details. + +### Modification times and hashes + +The modification time is stored as metadata on the object with the +`mtime` key. It is stored using RFC3339 Format time with nanosecond +precision. The metadata is supplied during directory listings so +there is no performance overhead to using it. + +If you wish to use the Azure standard `LastModified` time stored on +the object as the modified time, then use the `--use-server-modtime` +flag. Note that rclone can't set `LastModified`, so using the +`--update` flag when syncing is recommended if using +`--use-server-modtime`. + +MD5 hashes are stored with blobs. However blobs that were uploaded in +chunks only have an MD5 if the source remote was capable of MD5 +hashes, e.g. the local disk. + +### Performance + +When uploading large files, increasing the value of +`--azureblob-upload-concurrency` will increase performance at the cost +of using more memory. The default of 16 is set quite conservatively to +use less memory. It maybe be necessary raise it to 64 or higher to +fully utilize a 1 GBit/s link with a single file transfer. + +### Restricted filename characters + +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) +the following characters are also replaced: + +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| / | 0x2F | / | +| \ | 0x5C | \ | + +File names can also not end with the following characters. +These only get replaced if they are the last character in the name: + +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| . | 0x2E | . | + +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can't be used in JSON strings. + +### Authentication {#authentication} + +There are a number of ways of supplying credentials for Azure Blob +Storage. Rclone tries them in the order of the sections below. + +#### Env Auth + +If the `env_auth` config parameter is `true` then rclone will pull +credentials from the environment or runtime. + +It tries these authentication methods in this order: + +1. Environment Variables +2. Managed Service Identity Credentials +3. Azure CLI credentials (as used by the az tool) + +These are described in the following sections + +##### Env Auth: 1. Environment Variables + +If `env_auth` is set and environment variables are present rclone +authenticates a service principal with a secret or certificate, or a +user with a password, depending on which environment variable are set. +It reads configuration from these variables, in the following order: + +1. Service principal with client secret + - `AZURE_TENANT_ID`: ID of the service principal's tenant. Also called its "directory" ID. + - `AZURE_CLIENT_ID`: the service principal's client ID + - `AZURE_CLIENT_SECRET`: one of the service principal's client secrets +2. Service principal with certificate + - `AZURE_TENANT_ID`: ID of the service principal's tenant. Also called its "directory" ID. + - `AZURE_CLIENT_ID`: the service principal's client ID + - `AZURE_CLIENT_CERTIFICATE_PATH`: path to a PEM or PKCS12 certificate file including the private key. + - `AZURE_CLIENT_CERTIFICATE_PASSWORD`: (optional) password for the certificate file. + - `AZURE_CLIENT_SEND_CERTIFICATE_CHAIN`: (optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to "true" or "1", authentication requests include the x5c header. +3. User with username and password + - `AZURE_TENANT_ID`: (optional) tenant to authenticate in. Defaults to "organizations". + - `AZURE_CLIENT_ID`: client ID of the application the user will authenticate to + - `AZURE_USERNAME`: a username (usually an email address) + - `AZURE_PASSWORD`: the user's password +4. Workload Identity + - `AZURE_TENANT_ID`: Tenant to authenticate in. + - `AZURE_CLIENT_ID`: Client ID of the application the user will authenticate to. + - `AZURE_FEDERATED_TOKEN_FILE`: Path to projected service account token file. + - `AZURE_AUTHORITY_HOST`: Authority of an Azure Active Directory endpoint (default: login.microsoftonline.com). + + +##### Env Auth: 2. Managed Service Identity Credentials + +When using Managed Service Identity if the VM(SS) on which this +program is running has a system-assigned identity, it will be used by +default. If the resource has no system-assigned but exactly one +user-assigned identity, the user-assigned identity will be used by +default. + +If the resource has multiple user-assigned identities you will need to +unset `env_auth` and set `use_msi` instead. See the [`use_msi` +section](#use_msi). + +##### Env Auth: 3. Azure CLI credentials (as used by the az tool) + +Credentials created with the `az` tool can be picked up using `env_auth`. + +For example if you were to login with a service principal like this: + + az login --service-principal -u XXX -p XXX --tenant XXX -#### --mailru-speedup-max-memory +Then you could access rclone resources like this: -Files larger than the size given below will always be hashed on disk. + rclone lsf :azureblob,env_auth,account=ACCOUNT:CONTAINER -Properties: +Or -- Config: speedup_max_memory -- Env Var: RCLONE_MAILRU_SPEEDUP_MAX_MEMORY -- Type: SizeSuffix -- Default: 32Mi -- Examples: - - "0" - - Preliminary hashing will always be done in a temporary disk location. - - "32M" - - Do not dedicate more than 32Mb RAM for preliminary hashing. - - "256M" - - You have at most 256Mb RAM free for hash calculations. + rclone lsf --azureblob-env-auth --azureblob-account=ACCOUNT :azureblob:CONTAINER -#### --mailru-check-hash +Which is analogous to using the `az` tool: -What should copy do if file checksum is mismatched or invalid. + az storage blob list --container-name CONTAINER --account-name ACCOUNT --auth-mode login -Properties: +#### Account and Shared Key -- Config: check_hash -- Env Var: RCLONE_MAILRU_CHECK_HASH -- Type: bool -- Default: true -- Examples: - - "true" - - Fail with error. - - "false" - - Ignore and continue. +This is the most straight forward and least flexible way. Just fill +in the `account` and `key` lines and leave the rest blank. -#### --mailru-user-agent +#### SAS URL -HTTP user agent used internally by client. +This can be an account level SAS URL or container level SAS URL. -Defaults to "rclone/VERSION" or "--user-agent" provided on command line. +To use it leave `account` and `key` blank and fill in `sas_url`. -Properties: +An account level SAS URL or container level SAS URL can be obtained +from the Azure portal or the Azure Storage Explorer. To get a +container level SAS URL right click on a container in the Azure Blob +explorer in the Azure portal. -- Config: user_agent -- Env Var: RCLONE_MAILRU_USER_AGENT -- Type: string -- Required: false +If you use a container level SAS URL, rclone operations are permitted +only on a particular container, e.g. -#### --mailru-quirks + rclone ls azureblob:container -Comma separated list of internal maintenance flags. +You can also list the single container from the root. This will only +show the container specified by the SAS URL. -This option must not be used by an ordinary user. It is intended only to -facilitate remote troubleshooting of backend issues. Strict meaning of -flags is not documented and not guaranteed to persist between releases. -Quirks will be removed when the backend grows stable. -Supported quirks: atomicmkdir binlist unknowndirs + $ rclone lsd azureblob: + container/ -Properties: +Note that you can't see or access any other containers - this will +fail -- Config: quirks -- Env Var: RCLONE_MAILRU_QUIRKS -- Type: string -- Required: false + rclone ls azureblob:othercontainer -#### --mailru-encoding +Container level SAS URLs are useful for temporarily allowing third +parties access to a single container or putting credentials into an +untrusted environment such as a CI build server. -The encoding for the backend. +#### Service principal with client secret -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +If these variables are set, rclone will authenticate with a service principal with a client secret. -Properties: +- `tenant`: ID of the service principal's tenant. Also called its "directory" ID. +- `client_id`: the service principal's client ID +- `client_secret`: one of the service principal's client secrets -- Config: encoding -- Env Var: RCLONE_MAILRU_ENCODING -- Type: MultiEncoder -- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot +The credentials can also be placed in a file using the +`service_principal_file` configuration option. +#### Service principal with certificate +If these variables are set, rclone will authenticate with a service principal with certificate. -## Limitations +- `tenant`: ID of the service principal's tenant. Also called its "directory" ID. +- `client_id`: the service principal's client ID +- `client_certificate_path`: path to a PEM or PKCS12 certificate file including the private key. +- `client_certificate_password`: (optional) password for the certificate file. +- `client_send_certificate_chain`: (optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to "true" or "1", authentication requests include the x5c header. -File size limits depend on your account. A single file size is limited by 2G -for a free account and unlimited for paid tariffs. Please refer to the Mail.ru -site for the total uploaded size limits. +**NB** `client_certificate_password` must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -Note that Mailru is case insensitive so you can't have a file called -"Hello.doc" and one called "hello.doc". +#### User with username and password -# Mega +If these variables are set, rclone will authenticate with username and password. -[Mega](https://mega.nz/) is a cloud storage and file hosting service -known for its security feature where all files are encrypted locally -before they are uploaded. This prevents anyone (including employees of -Mega) from accessing the files without knowledge of the key used for -encryption. +- `tenant`: (optional) tenant to authenticate in. Defaults to "organizations". +- `client_id`: client ID of the application the user will authenticate to +- `username`: a username (usually an email address) +- `password`: the user's password -This is an rclone backend for Mega which supports the file transfer -features of Mega using the same client side encryption. +Microsoft doesn't recommend this kind of authentication, because it's +less secure than other authentication flows. This method is not +interactive, so it isn't compatible with any form of multi-factor +authentication, and the application must already have user or admin +consent. This credential can only authenticate work and school +accounts; it can't authenticate Microsoft accounts. -Paths are specified as `remote:path` +**NB** `password` must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -Paths may be as deep as required, e.g. `remote:directory/subdirectory`. +#### Managed Service Identity Credentials {#use_msi} -## Configuration +If `use_msi` is set then managed service identity credentials are +used. This authentication only works when running in an Azure service. +`env_auth` needs to be unset to use this. -Here is an example of how to make a remote called `remote`. First run: +However if you have multiple user identities to choose from these must +be explicitly specified using exactly one of the `msi_object_id`, +`msi_client_id`, or `msi_mi_res_id` parameters. - rclone config +If none of `msi_object_id`, `msi_client_id`, or `msi_mi_res_id` is +set, this is is equivalent to using `env_auth`. -This will guide you through an interactive setup process: -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> remote -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Mega - \ "mega" -[snip] -Storage> mega -User name -user> you@example.com -Password. -y) Yes type in my own password -g) Generate random password -n) No leave this optional password blank -y/g/n> y -Enter the password: -password: -Confirm the password: -password: -Remote config --------------------- -[remote] -type = mega -user = you@example.com -pass = *** ENCRYPTED *** --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +### Standard options -**NOTE:** The encryption keys need to have been already generated after a regular login -via the browser, otherwise attempting to use the credentials in `rclone` will fail. +Here are the Standard options specific to azureblob (Microsoft Azure Blob Storage). -Once configured you can then use `rclone` like this, +#### --azureblob-account -List directories in top level of your Mega +Azure Storage Account Name. - rclone lsd remote: +Set this to the Azure Storage Account Name in use. -List all the files in your Mega +Leave blank to use SAS URL or Emulator, otherwise it needs to be set. - rclone ls remote: +If this is blank and if env_auth is set it will be read from the +environment variable `AZURE_STORAGE_ACCOUNT_NAME` if possible. -To copy a local directory to an Mega directory called backup - rclone copy /home/source remote:backup +Properties: -### Modified time and hashes +- Config: account +- Env Var: RCLONE_AZUREBLOB_ACCOUNT +- Type: string +- Required: false -Mega does not support modification times or hashes yet. +#### --azureblob-env-auth -### Restricted filename characters +Read credentials from runtime (environment variables, CLI or MSI). -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| NUL | 0x00 | ␀ | -| / | 0x2F | / | +See the [authentication docs](/azureblob#authentication) for full info. -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can't be used in JSON strings. +Properties: -### Duplicated files +- Config: env_auth +- Env Var: RCLONE_AZUREBLOB_ENV_AUTH +- Type: bool +- Default: false -Mega can have two files with exactly the same name and path (unlike a -normal file system). +#### --azureblob-key -Duplicated files cause problems with the syncing and you will see -messages in the log about duplicates. +Storage Account Shared Key. -Use `rclone dedupe` to fix duplicated files. +Leave blank to use SAS URL or Emulator. -### Failure to log-in +Properties: -#### Object not found +- Config: key +- Env Var: RCLONE_AZUREBLOB_KEY +- Type: string +- Required: false -If you are connecting to your Mega remote for the first time, -to test access and synchronization, you may receive an error such as +#### --azureblob-sas-url -``` -Failed to create file system for "my-mega-remote:": -couldn't login: Object (typically, node or user) not found -``` +SAS URL for container level access only. -The diagnostic steps often recommended in the [rclone forum](https://forum.rclone.org/search?q=mega) -start with the **MEGAcmd** utility. Note that this refers to -the official C++ command from https://github.com/meganz/MEGAcmd -and not the go language built command from t3rm1n4l/megacmd -that is no longer maintained. +Leave blank if using account/key or Emulator. -Follow the instructions for installing MEGAcmd and try accessing -your remote as they recommend. You can establish whether or not -you can log in using MEGAcmd, and obtain diagnostic information -to help you, and search or work with others in the forum. +Properties: -``` -MEGA CMD> login me@example.com -Password: -Fetching nodes ... -Loading transfers from local cache -Login complete as me@example.com -me@example.com:/$ -``` +- Config: sas_url +- Env Var: RCLONE_AZUREBLOB_SAS_URL +- Type: string +- Required: false -Note that some have found issues with passwords containing special -characters. If you can not log on with rclone, but MEGAcmd logs on -just fine, then consider changing your password temporarily to -pure alphanumeric characters, in case that helps. +#### --azureblob-tenant +ID of the service principal's tenant. Also called its directory ID. -#### Repeated commands blocks access +Set this if using +- Service principal with client secret +- Service principal with certificate +- User with username and password -Mega remotes seem to get blocked (reject logins) under "heavy use". -We haven't worked out the exact blocking rules but it seems to be -related to fast paced, successive rclone commands. -For example, executing this command 90 times in a row `rclone link -remote:file` will cause the remote to become "blocked". This is not an -abnormal situation, for example if you wish to get the public links of -a directory with hundred of files... After more or less a week, the -remote will remote accept rclone logins normally again. +Properties: -You can mitigate this issue by mounting the remote it with `rclone -mount`. This will log-in when mounting and a log-out when unmounting -only. You can also run `rclone rcd` and then use `rclone rc` to run -the commands over the API to avoid logging in each time. +- Config: tenant +- Env Var: RCLONE_AZUREBLOB_TENANT +- Type: string +- Required: false -Rclone does not currently close mega sessions (you can see them in the -web interface), however closing the sessions does not solve the issue. +#### --azureblob-client-id -If you space rclone commands by 3 seconds it will avoid blocking the -remote. We haven't identified the exact blocking rules, so perhaps one -could execute the command 80 times without waiting and avoid blocking -by waiting 3 seconds, then continuing... +The ID of the client in use. -Note that this has been observed by trial and error and might not be -set in stone. +Set this if using +- Service principal with client secret +- Service principal with certificate +- User with username and password -Other tools seem not to produce this blocking effect, as they use a -different working approach (state-based, using sessionIDs instead of -log-in) which isn't compatible with the current stateless rclone -approach. -Note that once blocked, the use of other tools (such as megacmd) is -not a sure workaround: following megacmd login times have been -observed in succession for blocked remote: 7 minutes, 20 min, 30min, 30 -min, 30min. Web access looks unaffected though. +Properties: -Investigation is continuing in relation to workarounds based on -timeouts, pacers, retrials and tpslimits - if you discover something -relevant, please post on the forum. +- Config: client_id +- Env Var: RCLONE_AZUREBLOB_CLIENT_ID +- Type: string +- Required: false -So, if rclone was working nicely and suddenly you are unable to log-in -and you are sure the user and the password are correct, likely you -have got the remote blocked for a while. +#### --azureblob-client-secret +One of the service principal's client secrets -### Standard options +Set this if using +- Service principal with client secret -Here are the Standard options specific to mega (Mega). -#### --mega-user +Properties: + +- Config: client_secret +- Env Var: RCLONE_AZUREBLOB_CLIENT_SECRET +- Type: string +- Required: false + +#### --azureblob-client-certificate-path + +Path to a PEM or PKCS12 certificate file including the private key. + +Set this if using +- Service principal with certificate -User name. Properties: -- Config: user -- Env Var: RCLONE_MEGA_USER +- Config: client_certificate_path +- Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PATH - Type: string -- Required: true +- Required: false -#### --mega-pass +#### --azureblob-client-certificate-password + +Password for the certificate file (optional). + +Optionally set this if using +- Service principal with certificate + +And the certificate has a password. -Password. **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: -- Config: pass -- Env Var: RCLONE_MEGA_PASS +- Config: client_certificate_password +- Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PASSWORD - Type: string -- Required: true +- Required: false ### Advanced options -Here are the Advanced options specific to mega (Mega). +Here are the Advanced options specific to azureblob (Microsoft Azure Blob Storage). -#### --mega-debug +#### --azureblob-client-send-certificate-chain -Output more debug from Mega. +Send the certificate chain when using certificate auth. + +Specifies whether an authentication request will include an x5c header +to support subject name / issuer based authentication. When set to +true, authentication requests include the x5c header. + +Optionally set this if using +- Service principal with certificate -If this flag is set (along with -vv) it will print further debugging -information from the mega backend. Properties: -- Config: debug -- Env Var: RCLONE_MEGA_DEBUG +- Config: client_send_certificate_chain +- Env Var: RCLONE_AZUREBLOB_CLIENT_SEND_CERTIFICATE_CHAIN - Type: bool - Default: false -#### --mega-hard-delete +#### --azureblob-username -Delete files permanently rather than putting them into the trash. +User name (usually an email address) + +Set this if using +- User with username and password -Normally the mega backend will put all deletions into the trash rather -than permanently deleting them. If you specify this then rclone will -permanently delete objects instead. Properties: -- Config: hard_delete -- Env Var: RCLONE_MEGA_HARD_DELETE -- Type: bool -- Default: false +- Config: username +- Env Var: RCLONE_AZUREBLOB_USERNAME +- Type: string +- Required: false -#### --mega-use-https +#### --azureblob-password -Use HTTPS for transfers. +The user's password -MEGA uses plain text HTTP connections by default. -Some ISPs throttle HTTP connections, this causes transfers to become very slow. -Enabling this will force MEGA to use HTTPS for all transfers. -HTTPS is normally not necessary since all data is already encrypted anyway. -Enabling it will increase CPU usage and add network overhead. +Set this if using +- User with username and password + + +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: -- Config: use_https -- Env Var: RCLONE_MEGA_USE_HTTPS -- Type: bool -- Default: false +- Config: password +- Env Var: RCLONE_AZUREBLOB_PASSWORD +- Type: string +- Required: false -#### --mega-encoding +#### --azureblob-service-principal-file -The encoding for the backend. +Path to file containing credentials for use with a service principal. -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Leave blank normally. Needed only if you want to use a service principal instead of interactive login. -Properties: + $ az ad sp create-for-rbac --name "" \ + --role "Storage Blob Data Owner" \ + --scopes "/subscriptions//resourceGroups//providers/Microsoft.Storage/storageAccounts//blobServices/default/containers/" \ + > azure-principal.json -- Config: encoding -- Env Var: RCLONE_MEGA_ENCODING -- Type: MultiEncoder -- Default: Slash,InvalidUtf8,Dot +See ["Create an Azure service principal"](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) and ["Assign an Azure role for access to blob data"](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli) pages for more details. +It may be more convenient to put the credentials directly into the +rclone config file under the `client_id`, `tenant` and `client_secret` +keys instead of setting `service_principal_file`. -### Process `killed` +Properties: -On accounts with large files or something else, memory usage can significantly increase when executing list/sync instructions. When running on cloud providers (like AWS with EC2), check if the instance type has sufficient memory/CPU to execute the commands. Use the resource monitoring tools to inspect after sending the commands. Look [at this issue](https://forum.rclone.org/t/rclone-with-mega-appears-to-work-only-in-some-accounts/40233/4). +- Config: service_principal_file +- Env Var: RCLONE_AZUREBLOB_SERVICE_PRINCIPAL_FILE +- Type: string +- Required: false -## Limitations +#### --azureblob-use-msi -This backend uses the [go-mega go library](https://github.com/t3rm1n4l/go-mega) which is an opensource -go library implementing the Mega API. There doesn't appear to be any -documentation for the mega protocol beyond the [mega C++ SDK](https://github.com/meganz/sdk) source code -so there are likely quite a few errors still remaining in this library. +Use a managed service identity to authenticate (only works in Azure). -Mega allows duplicate files which may confuse rclone. +When true, use a [managed service identity](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/) +to authenticate to Azure Storage instead of a SAS token or account key. -# Memory +If the VM(SS) on which this program is running has a system-assigned identity, it will +be used by default. If the resource has no system-assigned but exactly one user-assigned identity, +the user-assigned identity will be used by default. If the resource has multiple user-assigned +identities, the identity to use must be explicitly specified using exactly one of the msi_object_id, +msi_client_id, or msi_mi_res_id parameters. -The memory backend is an in RAM backend. It does not persist its -data - use the local backend for that. +Properties: -The memory backend behaves like a bucket-based remote (e.g. like -s3). Because it has no parameters you can just use it with the -`:memory:` remote name. +- Config: use_msi +- Env Var: RCLONE_AZUREBLOB_USE_MSI +- Type: bool +- Default: false -## Configuration +#### --azureblob-msi-object-id -You can configure it as a remote like this with `rclone config` too if -you want to: +Object ID of the user-assigned MSI to use, if any. -``` -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> remote -Type of storage to configure. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value -[snip] -XX / Memory - \ "memory" -[snip] -Storage> memory -** See help for memory backend at: https://rclone.org/memory/ ** +Leave blank if msi_client_id or msi_mi_res_id specified. -Remote config +Properties: --------------------- -[remote] -type = memory --------------------- -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +- Config: msi_object_id +- Env Var: RCLONE_AZUREBLOB_MSI_OBJECT_ID +- Type: string +- Required: false -Because the memory backend isn't persistent it is most useful for -testing or with an rclone server or rclone mount, e.g. +#### --azureblob-msi-client-id - rclone mount :memory: /mnt/tmp - rclone serve webdav :memory: - rclone serve sftp :memory: +Object ID of the user-assigned MSI to use, if any. -### Modified time and hashes +Leave blank if msi_object_id or msi_mi_res_id specified. -The memory backend supports MD5 hashes and modification times accurate to 1 nS. +Properties: -### Restricted filename characters +- Config: msi_client_id +- Env Var: RCLONE_AZUREBLOB_MSI_CLIENT_ID +- Type: string +- Required: false -The memory backend replaces the [default restricted characters -set](https://rclone.org/overview/#restricted-characters). +#### --azureblob-msi-mi-res-id +Azure resource ID of the user-assigned MSI to use, if any. +Leave blank if msi_client_id or msi_object_id specified. +Properties: -# Akamai NetStorage +- Config: msi_mi_res_id +- Env Var: RCLONE_AZUREBLOB_MSI_MI_RES_ID +- Type: string +- Required: false -Paths are specified as `remote:` -You may put subdirectories in too, e.g. `remote:/path/to/dir`. -If you have a CP code you can use that as the folder after the domain such as \\/\\/\. +#### --azureblob-use-emulator -For example, this is commonly configured with or without a CP code: -* **With a CP code**. `[your-domain-prefix]-nsu.akamaihd.net/123456/subdirectory/` -* **Without a CP code**. `[your-domain-prefix]-nsu.akamaihd.net` +Uses local storage emulator if provided as 'true'. +Leave blank if using real azure storage endpoint. -See all buckets - rclone lsd remote: -The initial setup for Netstorage involves getting an account and secret. Use `rclone config` to walk you through the setup process. +Properties: -## Configuration +- Config: use_emulator +- Env Var: RCLONE_AZUREBLOB_USE_EMULATOR +- Type: bool +- Default: false -Here's an example of how to make a remote called `ns1`. +#### --azureblob-endpoint -1. To begin the interactive configuration process, enter this command: +Endpoint for the service. -``` -rclone config -``` +Leave blank normally. -2. Type `n` to create a new remote. +Properties: -``` -n) New remote -d) Delete remote -q) Quit config -e/n/d/q> n -``` +- Config: endpoint +- Env Var: RCLONE_AZUREBLOB_ENDPOINT +- Type: string +- Required: false -3. For this example, enter `ns1` when you reach the name> prompt. +#### --azureblob-upload-cutoff -``` -name> ns1 -``` +Cutoff for switching to chunked upload (<= 256 MiB) (deprecated). -4. Enter `netstorage` as the type of storage to configure. +Properties: -``` -Type of storage to configure. -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value -XX / NetStorage - \ "netstorage" -Storage> netstorage -``` +- Config: upload_cutoff +- Env Var: RCLONE_AZUREBLOB_UPLOAD_CUTOFF +- Type: string +- Required: false -5. Select between the HTTP or HTTPS protocol. Most users should choose HTTPS, which is the default. HTTP is provided primarily for debugging purposes. +#### --azureblob-chunk-size +Upload chunk size. -``` -Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value - 1 / HTTP protocol - \ "http" - 2 / HTTPS protocol - \ "https" -protocol> 1 -``` +Note that this is stored in memory and there may be up to +"--transfers" * "--azureblob-upload-concurrency" chunks stored at once +in memory. -6. Specify your NetStorage host, CP code, and any necessary content paths using this format: `///` +Properties: -``` -Enter a string value. Press Enter for the default (""). -host> baseball-nsu.akamaihd.net/123456/content/ -``` +- Config: chunk_size +- Env Var: RCLONE_AZUREBLOB_CHUNK_SIZE +- Type: SizeSuffix +- Default: 4Mi -7. Set the netstorage account name -``` -Enter a string value. Press Enter for the default (""). -account> username -``` +#### --azureblob-upload-concurrency -8. Set the Netstorage account secret/G2O key which will be used for authentication purposes. Select the `y` option to set your own password then enter your secret. -Note: The secret is stored in the `rclone.conf` file with hex-encoded encryption. +Concurrency for multipart uploads. -``` -y) Yes type in my own password -g) Generate random password -y/g> y -Enter the password: -password: -Confirm the password: -password: -``` +This is the number of chunks of the same file that are uploaded +concurrently. -9. View the summary and confirm your remote configuration. +If you are uploading small numbers of large files over high-speed +links and these uploads do not fully utilize your bandwidth, then +increasing this may help to speed up the transfers. -``` -[ns1] -type = netstorage -protocol = http -host = baseball-nsu.akamaihd.net/123456/content/ -account = username -secret = *** ENCRYPTED *** --------------------- -y) Yes this is OK (default) -e) Edit this remote -d) Delete this remote -y/e/d> y -``` +In tests, upload speed increases almost linearly with upload +concurrency. For example to fill a gigabit pipe it may be necessary to +raise this to 64. Note that this will use more memory. -This remote is called `ns1` and can now be used. +Note that chunks are stored in memory and there may be up to +"--transfers" * "--azureblob-upload-concurrency" chunks stored at once +in memory. -## Example operations +Properties: -Get started with rclone and NetStorage with these examples. For additional rclone commands, visit https://rclone.org/commands/. +- Config: upload_concurrency +- Env Var: RCLONE_AZUREBLOB_UPLOAD_CONCURRENCY +- Type: int +- Default: 16 -### See contents of a directory in your project +#### --azureblob-list-chunk - rclone lsd ns1:/974012/testing/ +Size of blob list. -### Sync the contents local with remote +This sets the number of blobs requested in each listing chunk. Default +is the maximum, 5000. "List blobs" requests are permitted 2 minutes +per megabyte to complete. If an operation is taking longer than 2 +minutes per megabyte on average, it will time out ( +[source](https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-blob-service-operations#exceptions-to-default-timeout-interval) +). This can be used to limit the number of blobs items to return, to +avoid the time out. - rclone sync . ns1:/974012/testing/ +Properties: -### Upload local content to remote - rclone copy notes.txt ns1:/974012/testing/ +- Config: list_chunk +- Env Var: RCLONE_AZUREBLOB_LIST_CHUNK +- Type: int +- Default: 5000 -### Delete content on remote - rclone delete ns1:/974012/testing/notes.txt +#### --azureblob-access-tier -### Move or copy content between CP codes. +Access tier of blob: hot, cool, cold or archive. -Your credentials must have access to two CP codes on the same remote. You can't perform operations between different remotes. +Archived blobs can be restored by setting access tier to hot, cool or +cold. Leave blank if you intend to use default access tier, which is +set at account level - rclone move ns1:/974012/testing/notes.txt ns1:/974450/testing2/ +If there is no "access tier" specified, rclone doesn't apply any tier. +rclone performs "Set Tier" operation on blobs while uploading, if objects +are not modified, specifying "access tier" to new one will have no effect. +If blobs are in "archive tier" at remote, trying to perform data transfer +operations from remote will not be allowed. User should first restore by +tiering blob to "Hot", "Cool" or "Cold". -## Features +Properties: -### Symlink Support +- Config: access_tier +- Env Var: RCLONE_AZUREBLOB_ACCESS_TIER +- Type: string +- Required: false -The Netstorage backend changes the rclone `--links, -l` behavior. When uploading, instead of creating the .rclonelink file, use the "symlink" API in order to create the corresponding symlink on the remote. The .rclonelink file will not be created, the upload will be intercepted and only the symlink file that matches the source file name with no suffix will be created on the remote. +#### --azureblob-archive-tier-delete -This will effectively allow commands like copy/copyto, move/moveto and sync to upload from local to remote and download from remote to local directories with symlinks. Due to internal rclone limitations, it is not possible to upload an individual symlink file to any remote backend. You can always use the "backend symlink" command to create a symlink on the NetStorage server, refer to "symlink" section below. +Delete archive tier blobs before overwriting. -Individual symlink files on the remote can be used with the commands like "cat" to print the destination name, or "delete" to delete symlink, or copy, copy/to and move/moveto to download from the remote to local. Note: individual symlink files on the remote should be specified including the suffix .rclonelink. +Archive tier blobs cannot be updated. So without this flag, if you +attempt to update an archive tier blob, then rclone will produce the +error: -**Note**: No file with the suffix .rclonelink should ever exist on the server since it is not possible to actually upload/create a file with .rclonelink suffix with rclone, it can only exist if it is manually created through a non-rclone method on the remote. + can't update archive tier blob without --azureblob-archive-tier-delete -### Implicit vs. Explicit Directories +With this flag set then before rclone attempts to overwrite an archive +tier blob, it will delete the existing blob before uploading its +replacement. This has the potential for data loss if the upload fails +(unlike updating a normal blob) and also may cost more since deleting +archive tier blobs early may be chargable. -With NetStorage, directories can exist in one of two forms: -1. **Explicit Directory**. This is an actual, physical directory that you have created in a storage group. -2. **Implicit Directory**. This refers to a directory within a path that has not been physically created. For example, during upload of a file, nonexistent subdirectories can be specified in the target path. NetStorage creates these as "implicit." While the directories aren't physically created, they exist implicitly and the noted path is connected with the uploaded file. +Properties: -Rclone will intercept all file uploads and mkdir commands for the NetStorage remote and will explicitly issue the mkdir command for each directory in the uploading path. This will help with the interoperability with the other Akamai services such as SFTP and the Content Management Shell (CMShell). Rclone will not guarantee correctness of operations with implicit directories which might have been created as a result of using an upload API directly. +- Config: archive_tier_delete +- Env Var: RCLONE_AZUREBLOB_ARCHIVE_TIER_DELETE +- Type: bool +- Default: false -### `--fast-list` / ListR support +#### --azureblob-disable-checksum -NetStorage remote supports the ListR feature by using the "list" NetStorage API action to return a lexicographical list of all objects within the specified CP code, recursing into subdirectories as they're encountered. +Don't store MD5 checksum with object metadata. -* **Rclone will use the ListR method for some commands by default**. Commands such as `lsf -R` will use ListR by default. To disable this, include the `--disable listR` option to use the non-recursive method of listing objects. +Normally rclone will calculate the MD5 checksum of the input before +uploading it so it can add it to metadata on the object. This is great +for data integrity checking but can cause long delays for large files +to start uploading. -* **Rclone will not use the ListR method for some commands**. Commands such as `sync` don't use ListR by default. To force using the ListR method, include the `--fast-list` option. +Properties: -There are pros and cons of using the ListR method, refer to [rclone documentation](https://rclone.org/docs/#fast-list). In general, the sync command over an existing deep tree on the remote will run faster with the "--fast-list" flag but with extra memory usage as a side effect. It might also result in higher CPU utilization but the whole task can be completed faster. +- Config: disable_checksum +- Env Var: RCLONE_AZUREBLOB_DISABLE_CHECKSUM +- Type: bool +- Default: false -**Note**: There is a known limitation that "lsf -R" will display number of files in the directory and directory size as -1 when ListR method is used. The workaround is to pass "--disable listR" flag if these numbers are important in the output. +#### --azureblob-memory-pool-flush-time -### Purge +How often internal memory buffer pools will be flushed. (no longer used) -NetStorage remote supports the purge feature by using the "quick-delete" NetStorage API action. The quick-delete action is disabled by default for security reasons and can be enabled for the account through the Akamai portal. Rclone will first try to use quick-delete action for the purge command and if this functionality is disabled then will fall back to a standard delete method. +Properties: -**Note**: Read the [NetStorage Usage API](https://learn.akamai.com/en-us/webhelp/netstorage/netstorage-http-api-developer-guide/GUID-15836617-9F50-405A-833C-EA2556756A30.html) for considerations when using "quick-delete". In general, using quick-delete method will not delete the tree immediately and objects targeted for quick-delete may still be accessible. +- Config: memory_pool_flush_time +- Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_FLUSH_TIME +- Type: Duration +- Default: 1m0s +#### --azureblob-memory-pool-use-mmap -### Standard options +Whether to use mmap buffers in internal memory pool. (no longer used) -Here are the Standard options specific to netstorage (Akamai NetStorage). +Properties: -#### --netstorage-host +- Config: memory_pool_use_mmap +- Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_USE_MMAP +- Type: bool +- Default: false -Domain+path of NetStorage host to connect to. +#### --azureblob-encoding -Format should be `/` +The encoding for the backend. + +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. Properties: -- Config: host -- Env Var: RCLONE_NETSTORAGE_HOST -- Type: string -- Required: true +- Config: encoding +- Env Var: RCLONE_AZUREBLOB_ENCODING +- Type: Encoding +- Default: Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8 -#### --netstorage-account +#### --azureblob-public-access -Set the NetStorage account name +Public access level of a container: blob or container. Properties: -- Config: account -- Env Var: RCLONE_NETSTORAGE_ACCOUNT +- Config: public_access +- Env Var: RCLONE_AZUREBLOB_PUBLIC_ACCESS - Type: string -- Required: true +- Required: false +- Examples: + - "" + - The container and its blobs can be accessed only with an authorized request. + - It's a default value. + - "blob" + - Blob data within this container can be read via anonymous request. + - "container" + - Allow full public read access for container and blob data. -#### --netstorage-secret +#### --azureblob-directory-markers -Set the NetStorage account secret/G2O key for authentication. +Upload an empty object with a trailing slash when a new directory is created -Please choose the 'y' option to set your own password then enter your secret. +Empty folders are unsupported for bucket based remotes, this option +creates an empty object ending with "/", to persist the folder. -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +This object also has the metadata "hdi_isfolder = true" to conform to +the Microsoft standard. + Properties: -- Config: secret -- Env Var: RCLONE_NETSTORAGE_SECRET -- Type: string -- Required: true - -### Advanced options +- Config: directory_markers +- Env Var: RCLONE_AZUREBLOB_DIRECTORY_MARKERS +- Type: bool +- Default: false -Here are the Advanced options specific to netstorage (Akamai NetStorage). +#### --azureblob-no-check-container -#### --netstorage-protocol +If set, don't attempt to check the container exists or create it. -Select between HTTP or HTTPS protocol. +This can be useful when trying to minimise the number of transactions +rclone does if you know the container exists already. -Most users should choose HTTPS, which is the default. -HTTP is provided primarily for debugging purposes. Properties: -- Config: protocol -- Env Var: RCLONE_NETSTORAGE_PROTOCOL -- Type: string -- Default: "https" -- Examples: - - "http" - - HTTP protocol - - "https" - - HTTPS protocol +- Config: no_check_container +- Env Var: RCLONE_AZUREBLOB_NO_CHECK_CONTAINER +- Type: bool +- Default: false -## Backend commands +#### --azureblob-no-head-object -Here are the commands specific to the netstorage backend. +If set, do not do HEAD before GET when getting objects. -Run them with +Properties: - rclone backend COMMAND remote: +- Config: no_head_object +- Env Var: RCLONE_AZUREBLOB_NO_HEAD_OBJECT +- Type: bool +- Default: false -The help below will explain what arguments each command takes. -See the [backend](https://rclone.org/commands/rclone_backend/) command for more -info on how to pass options and arguments. -These can be run on a running backend using the rc command -[backend/command](https://rclone.org/rc/#backend-command). +### Custom upload headers -### du +You can set custom upload headers with the `--header-upload` flag. -Return disk usage information for a specified directory +- Cache-Control +- Content-Disposition +- Content-Encoding +- Content-Language +- Content-Type - rclone backend du remote: [options] [+] +Eg `--header-upload "Content-Type: text/potato"` -The usage information returned, includes the targeted directory as well as all -files stored in any sub-directories that may exist. +## Limitations -### symlink +MD5 sums are only uploaded with chunked files if the source has an MD5 +sum. This will always be the case for a local to azure copy. -You can create a symbolic link in ObjectStore with the symlink action. +`rclone about` is not supported by the Microsoft Azure Blob storage backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy `mfs` (most free space) as a member of an rclone union +remote. - rclone backend symlink remote: [options] [+] +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -The desired path location (including applicable sub-directories) ending in -the object that will be the target of the symlink (for example, /links/mylink). -Include the file extension for the object, if applicable. -`rclone backend symlink ` +## Azure Storage Emulator Support +You can run rclone with the storage emulator (usually _azurite_). + +To do this, just set up a new remote with `rclone config` following +the instructions in the introduction and set `use_emulator` in the +advanced settings as `true`. You do not need to provide a default +account name nor an account key. But you can override them in the +`account` and `key` options. (Prior to v1.61 they were hard coded to +_azurite_'s `devstoreaccount1`.) +Also, if you want to access a storage emulator instance running on a +different machine, you can override the `endpoint` parameter in the +advanced settings, setting it to +`http(s)://:/devstoreaccount1` +(e.g. `http://10.254.2.5:10000/devstoreaccount1`). -# Microsoft Azure Blob Storage +# Microsoft Azure Files Storage -Paths are specified as `remote:container` (or `remote:` for the `lsd` -command.) You may put subdirectories in too, e.g. -`remote:container/path/to/dir`. +Paths are specified as `remote:` You may put subdirectories in too, +e.g. `remote:path/to/dir`. ## Configuration -Here is an example of making a Microsoft Azure Blob Storage +Here is an example of making a Microsoft Azure Files Storage configuration. For a remote called `remote`. First run: rclone config @@ -37741,69 +39471,90 @@ name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] -XX / Microsoft Azure Blob Storage - \ "azureblob" +XX / Microsoft Azure Files Storage + \ "azurefiles" [snip] -Storage> azureblob -Storage Account Name + +Option account. +Azure Storage Account Name. +Set this to the Azure Storage Account Name in use. +Leave blank to use SAS URL or connection string, otherwise it needs to be set. +If this is blank and if env_auth is set it will be read from the +environment variable `AZURE_STORAGE_ACCOUNT_NAME` if possible. +Enter a value. Press Enter to leave empty. account> account_name -Storage Account Key + +Option share_name. +Azure Files Share Name. +This is required and is the name of the share to access. +Enter a value. Press Enter to leave empty. +share_name> share_name + +Option env_auth. +Read credentials from runtime (environment variables, CLI or MSI). +See the [authentication docs](/azurefiles#authentication) for full info. +Enter a boolean value (true or false). Press Enter for the default (false). +env_auth> + +Option key. +Storage Account Shared Key. +Leave blank to use SAS URL or connection string. +Enter a value. Press Enter to leave empty. key> base64encodedkey== -Endpoint for the service - leave blank normally. -endpoint> -Remote config --------------------- -[remote] -account = account_name -key = base64encodedkey== -endpoint = --------------------- -y) Yes this is OK + +Option sas_url. +SAS URL. +Leave blank if using account/key or connection string. +Enter a value. Press Enter to leave empty. +sas_url> + +Option connection_string. +Azure Files Connection String. +Enter a value. Press Enter to leave empty. +connection_string> +[snip] + +Configuration complete. +Options: +- type: azurefiles +- account: account_name +- share_name: share_name +- key: base64encodedkey== +Keep this "remote" remote? +y) Yes this is OK (default) e) Edit this remote d) Delete this remote -y/e/d> y +y/e/d> ``` -See all containers - - rclone lsd remote: +Once configured you can use rclone. -Make a new container +See all files in the top level: - rclone mkdir remote:container + rclone lsf remote: -List the contents of a container +Make a new directory in the root: - rclone ls remote:container + rclone mkdir remote:dir -Sync `/home/local/directory` to the remote container, deleting any excess -files in the container. +Recursively List the contents: - rclone sync --interactive /home/local/directory remote:container + rclone ls remote: -### --fast-list +Sync `/home/local/directory` to the remote directory, deleting any +excess files in the directory. -This remote supports `--fast-list` which allows you to use fewer -transactions in exchange for more memory. See the [rclone -docs](https://rclone.org/docs/#fast-list) for more details. + rclone sync --interactive /home/local/directory remote:dir ### Modified time -The modified time is stored as metadata on the object with the `mtime` -key. It is stored using RFC3339 Format time with nanosecond -precision. The metadata is supplied during directory listings so -there is no performance overhead to using it. - -If you wish to use the Azure standard `LastModified` time stored on -the object as the modified time, then use the `--use-server-modtime` -flag. Note that rclone can't set `LastModified`, so using the -`--update` flag when syncing is recommended if using -`--use-server-modtime`. +The modified time is stored as Azure standard `LastModified` time on +files ### Performance When uploading large files, increasing the value of -`--azureblob-upload-concurrency` will increase performance at the cost +`--azurefiles-upload-concurrency` will increase performance at the cost of using more memory. The default of 16 is set quite conservatively to use less memory. It maybe be necessary raise it to 64 or higher to fully utilize a 1 GBit/s link with a single file transfer. @@ -37815,8 +39566,14 @@ the following characters are also replaced: | Character | Value | Replacement | | --------- |:-----:|:-----------:| -| / | 0x2F | / | -| \ | 0x5C | \ | +| " | 0x22 | " | +| * | 0x2A | * | +| : | 0x3A | : | +| < | 0x3C | < | +| > | 0x3E | > | +| ? | 0x3F | ? | +| \ | 0x5C | \ | +| \| | 0x7C | | | File names can also not end with the following characters. These only get replaced if they are the last character in the name: @@ -37830,13 +39587,12 @@ as they can't be used in JSON strings. ### Hashes -MD5 hashes are stored with blobs. However blobs that were uploaded in -chunks only have an MD5 if the source remote was capable of MD5 -hashes, e.g. the local disk. +MD5 hashes are stored with files. Not all files will have MD5 hashes +as these have to be uploaded with the file. ### Authentication {#authentication} -There are a number of ways of supplying credentials for Azure Blob +There are a number of ways of supplying credentials for Azure Files Storage. Rclone tries them in the order of the sections below. #### Env Auth @@ -37903,15 +39659,11 @@ For example if you were to login with a service principal like this: Then you could access rclone resources like this: - rclone lsf :azureblob,env_auth,account=ACCOUNT:CONTAINER + rclone lsf :azurefiles,env_auth,account=ACCOUNT: Or - rclone lsf --azureblob-env-auth --azureblob-account=ACCOUNT :azureblob:CONTAINER - -Which is analogous to using the `az` tool: - - az storage blob list --container-name CONTAINER --account-name ACCOUNT --auth-mode login + rclone lsf --azurefiles-env-auth --azurefiles-account=ACCOUNT :azurefiles: #### Account and Shared Key @@ -37920,34 +39672,11 @@ in the `account` and `key` lines and leave the rest blank. #### SAS URL -This can be an account level SAS URL or container level SAS URL. - -To use it leave `account` and `key` blank and fill in `sas_url`. - -An account level SAS URL or container level SAS URL can be obtained -from the Azure portal or the Azure Storage Explorer. To get a -container level SAS URL right click on a container in the Azure Blob -explorer in the Azure portal. - -If you use a container level SAS URL, rclone operations are permitted -only on a particular container, e.g. - - rclone ls azureblob:container - -You can also list the single container from the root. This will only -show the container specified by the SAS URL. - - $ rclone lsd azureblob: - container/ - -Note that you can't see or access any other containers - this will -fail +To use it leave `account`, `key` and `connection_string` blank and fill in `sas_url`. - rclone ls azureblob:othercontainer +#### Connection String -Container level SAS URLs are useful for temporarily allowing third -parties access to a single container or putting credentials into an -untrusted environment such as a CI build server. +To use it leave `account`, `key` and "sas_url" blank and fill in `connection_string`. #### Service principal with client secret @@ -38006,15 +39735,15 @@ set, this is is equivalent to using `env_auth`. ### Standard options -Here are the Standard options specific to azureblob (Microsoft Azure Blob Storage). +Here are the Standard options specific to azurefiles (Microsoft Azure Files). -#### --azureblob-account +#### --azurefiles-account Azure Storage Account Name. Set this to the Azure Storage Account Name in use. -Leave blank to use SAS URL or Emulator, otherwise it needs to be set. +Leave blank to use SAS URL or connection string, otherwise it needs to be set. If this is blank and if env_auth is set it will be read from the environment variable `AZURE_STORAGE_ACCOUNT_NAME` if possible. @@ -38023,50 +39752,75 @@ environment variable `AZURE_STORAGE_ACCOUNT_NAME` if possible. Properties: - Config: account -- Env Var: RCLONE_AZUREBLOB_ACCOUNT +- Env Var: RCLONE_AZUREFILES_ACCOUNT - Type: string - Required: false -#### --azureblob-env-auth +#### --azurefiles-share-name + +Azure Files Share Name. + +This is required and is the name of the share to access. + + +Properties: + +- Config: share_name +- Env Var: RCLONE_AZUREFILES_SHARE_NAME +- Type: string +- Required: false + +#### --azurefiles-env-auth Read credentials from runtime (environment variables, CLI or MSI). -See the [authentication docs](/azureblob#authentication) for full info. +See the [authentication docs](/azurefiles#authentication) for full info. Properties: - Config: env_auth -- Env Var: RCLONE_AZUREBLOB_ENV_AUTH +- Env Var: RCLONE_AZUREFILES_ENV_AUTH - Type: bool - Default: false -#### --azureblob-key +#### --azurefiles-key Storage Account Shared Key. -Leave blank to use SAS URL or Emulator. +Leave blank to use SAS URL or connection string. Properties: - Config: key -- Env Var: RCLONE_AZUREBLOB_KEY +- Env Var: RCLONE_AZUREFILES_KEY - Type: string - Required: false -#### --azureblob-sas-url +#### --azurefiles-sas-url -SAS URL for container level access only. +SAS URL. -Leave blank if using account/key or Emulator. +Leave blank if using account/key or connection string. Properties: - Config: sas_url -- Env Var: RCLONE_AZUREBLOB_SAS_URL +- Env Var: RCLONE_AZUREFILES_SAS_URL - Type: string - Required: false -#### --azureblob-tenant +#### --azurefiles-connection-string + +Azure Files Connection String. + +Properties: + +- Config: connection_string +- Env Var: RCLONE_AZUREFILES_CONNECTION_STRING +- Type: string +- Required: false + +#### --azurefiles-tenant ID of the service principal's tenant. Also called its directory ID. @@ -38079,11 +39833,11 @@ Set this if using Properties: - Config: tenant -- Env Var: RCLONE_AZUREBLOB_TENANT +- Env Var: RCLONE_AZUREFILES_TENANT - Type: string - Required: false -#### --azureblob-client-id +#### --azurefiles-client-id The ID of the client in use. @@ -38096,11 +39850,11 @@ Set this if using Properties: - Config: client_id -- Env Var: RCLONE_AZUREBLOB_CLIENT_ID +- Env Var: RCLONE_AZUREFILES_CLIENT_ID - Type: string - Required: false -#### --azureblob-client-secret +#### --azurefiles-client-secret One of the service principal's client secrets @@ -38111,11 +39865,11 @@ Set this if using Properties: - Config: client_secret -- Env Var: RCLONE_AZUREBLOB_CLIENT_SECRET +- Env Var: RCLONE_AZUREFILES_CLIENT_SECRET - Type: string - Required: false -#### --azureblob-client-certificate-path +#### --azurefiles-client-certificate-path Path to a PEM or PKCS12 certificate file including the private key. @@ -38126,11 +39880,11 @@ Set this if using Properties: - Config: client_certificate_path -- Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PATH +- Env Var: RCLONE_AZUREFILES_CLIENT_CERTIFICATE_PATH - Type: string - Required: false -#### --azureblob-client-certificate-password +#### --azurefiles-client-certificate-password Password for the certificate file (optional). @@ -38145,15 +39899,15 @@ And the certificate has a password. Properties: - Config: client_certificate_password -- Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PASSWORD +- Env Var: RCLONE_AZUREFILES_CLIENT_CERTIFICATE_PASSWORD - Type: string - Required: false ### Advanced options -Here are the Advanced options specific to azureblob (Microsoft Azure Blob Storage). +Here are the Advanced options specific to azurefiles (Microsoft Azure Files). -#### --azureblob-client-send-certificate-chain +#### --azurefiles-client-send-certificate-chain Send the certificate chain when using certificate auth. @@ -38168,11 +39922,11 @@ Optionally set this if using Properties: - Config: client_send_certificate_chain -- Env Var: RCLONE_AZUREBLOB_CLIENT_SEND_CERTIFICATE_CHAIN +- Env Var: RCLONE_AZUREFILES_CLIENT_SEND_CERTIFICATE_CHAIN - Type: bool - Default: false -#### --azureblob-username +#### --azurefiles-username User name (usually an email address) @@ -38183,11 +39937,11 @@ Set this if using Properties: - Config: username -- Env Var: RCLONE_AZUREBLOB_USERNAME +- Env Var: RCLONE_AZUREFILES_USERNAME - Type: string - Required: false -#### --azureblob-password +#### --azurefiles-password The user's password @@ -38200,22 +39954,24 @@ Set this if using Properties: - Config: password -- Env Var: RCLONE_AZUREBLOB_PASSWORD +- Env Var: RCLONE_AZUREFILES_PASSWORD - Type: string - Required: false -#### --azureblob-service-principal-file +#### --azurefiles-service-principal-file Path to file containing credentials for use with a service principal. Leave blank normally. Needed only if you want to use a service principal instead of interactive login. $ az ad sp create-for-rbac --name "" \ - --role "Storage Blob Data Owner" \ + --role "Storage Files Data Owner" \ --scopes "/subscriptions//resourceGroups//providers/Microsoft.Storage/storageAccounts//blobServices/default/containers/" \ > azure-principal.json -See ["Create an Azure service principal"](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) and ["Assign an Azure role for access to blob data"](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli) pages for more details. +See ["Create an Azure service principal"](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) and ["Assign an Azure role for access to files data"](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli) pages for more details. + +**NB** this section needs updating for Azure Files - pull requests appreciated! It may be more convenient to put the credentials directly into the rclone config file under the `client_id`, `tenant` and `client_secret` @@ -38225,11 +39981,11 @@ keys instead of setting `service_principal_file`. Properties: - Config: service_principal_file -- Env Var: RCLONE_AZUREBLOB_SERVICE_PRINCIPAL_FILE +- Env Var: RCLONE_AZUREFILES_SERVICE_PRINCIPAL_FILE - Type: string - Required: false -#### --azureblob-use-msi +#### --azurefiles-use-msi Use a managed service identity to authenticate (only works in Azure). @@ -38245,11 +40001,11 @@ msi_client_id, or msi_mi_res_id parameters. Properties: - Config: use_msi -- Env Var: RCLONE_AZUREBLOB_USE_MSI +- Env Var: RCLONE_AZUREFILES_USE_MSI - Type: bool - Default: false -#### --azureblob-msi-object-id +#### --azurefiles-msi-object-id Object ID of the user-assigned MSI to use, if any. @@ -38258,11 +40014,11 @@ Leave blank if msi_client_id or msi_mi_res_id specified. Properties: - Config: msi_object_id -- Env Var: RCLONE_AZUREBLOB_MSI_OBJECT_ID +- Env Var: RCLONE_AZUREFILES_MSI_OBJECT_ID - Type: string - Required: false -#### --azureblob-msi-client-id +#### --azurefiles-msi-client-id Object ID of the user-assigned MSI to use, if any. @@ -38271,11 +40027,11 @@ Leave blank if msi_object_id or msi_mi_res_id specified. Properties: - Config: msi_client_id -- Env Var: RCLONE_AZUREBLOB_MSI_CLIENT_ID +- Env Var: RCLONE_AZUREFILES_MSI_CLIENT_ID - Type: string - Required: false -#### --azureblob-msi-mi-res-id +#### --azurefiles-msi-mi-res-id Azure resource ID of the user-assigned MSI to use, if any. @@ -38284,24 +40040,11 @@ Leave blank if msi_client_id or msi_object_id specified. Properties: - Config: msi_mi_res_id -- Env Var: RCLONE_AZUREBLOB_MSI_MI_RES_ID +- Env Var: RCLONE_AZUREFILES_MSI_MI_RES_ID - Type: string - Required: false -#### --azureblob-use-emulator - -Uses local storage emulator if provided as 'true'. - -Leave blank if using real azure storage endpoint. - -Properties: - -- Config: use_emulator -- Env Var: RCLONE_AZUREBLOB_USE_EMULATOR -- Type: bool -- Default: false - -#### --azureblob-endpoint +#### --azurefiles-endpoint Endpoint for the service. @@ -38310,37 +40053,26 @@ Leave blank normally. Properties: - Config: endpoint -- Env Var: RCLONE_AZUREBLOB_ENDPOINT -- Type: string -- Required: false - -#### --azureblob-upload-cutoff - -Cutoff for switching to chunked upload (<= 256 MiB) (deprecated). - -Properties: - -- Config: upload_cutoff -- Env Var: RCLONE_AZUREBLOB_UPLOAD_CUTOFF +- Env Var: RCLONE_AZUREFILES_ENDPOINT - Type: string - Required: false -#### --azureblob-chunk-size +#### --azurefiles-chunk-size Upload chunk size. Note that this is stored in memory and there may be up to -"--transfers" * "--azureblob-upload-concurrency" chunks stored at once +"--transfers" * "--azurefile-upload-concurrency" chunks stored at once in memory. Properties: - Config: chunk_size -- Env Var: RCLONE_AZUREBLOB_CHUNK_SIZE +- Env Var: RCLONE_AZUREFILES_CHUNK_SIZE - Type: SizeSuffix - Default: 4Mi -#### --azureblob-upload-concurrency +#### --azurefiles-upload-concurrency Concurrency for multipart uploads. @@ -38351,125 +40083,41 @@ If you are uploading small numbers of large files over high-speed links and these uploads do not fully utilize your bandwidth, then increasing this may help to speed up the transfers. -In tests, upload speed increases almost linearly with upload -concurrency. For example to fill a gigabit pipe it may be necessary to -raise this to 64. Note that this will use more memory. - Note that chunks are stored in memory and there may be up to -"--transfers" * "--azureblob-upload-concurrency" chunks stored at once +"--transfers" * "--azurefile-upload-concurrency" chunks stored at once in memory. Properties: - Config: upload_concurrency -- Env Var: RCLONE_AZUREBLOB_UPLOAD_CONCURRENCY +- Env Var: RCLONE_AZUREFILES_UPLOAD_CONCURRENCY - Type: int - Default: 16 -#### --azureblob-list-chunk - -Size of blob list. - -This sets the number of blobs requested in each listing chunk. Default -is the maximum, 5000. "List blobs" requests are permitted 2 minutes -per megabyte to complete. If an operation is taking longer than 2 -minutes per megabyte on average, it will time out ( -[source](https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-blob-service-operations#exceptions-to-default-timeout-interval) -). This can be used to limit the number of blobs items to return, to -avoid the time out. - -Properties: - -- Config: list_chunk -- Env Var: RCLONE_AZUREBLOB_LIST_CHUNK -- Type: int -- Default: 5000 - -#### --azureblob-access-tier - -Access tier of blob: hot, cool or archive. - -Archived blobs can be restored by setting access tier to hot or -cool. Leave blank if you intend to use default access tier, which is -set at account level - -If there is no "access tier" specified, rclone doesn't apply any tier. -rclone performs "Set Tier" operation on blobs while uploading, if objects -are not modified, specifying "access tier" to new one will have no effect. -If blobs are in "archive tier" at remote, trying to perform data transfer -operations from remote will not be allowed. User should first restore by -tiering blob to "Hot" or "Cool". - -Properties: - -- Config: access_tier -- Env Var: RCLONE_AZUREBLOB_ACCESS_TIER -- Type: string -- Required: false - -#### --azureblob-archive-tier-delete - -Delete archive tier blobs before overwriting. - -Archive tier blobs cannot be updated. So without this flag, if you -attempt to update an archive tier blob, then rclone will produce the -error: - - can't update archive tier blob without --azureblob-archive-tier-delete - -With this flag set then before rclone attempts to overwrite an archive -tier blob, it will delete the existing blob before uploading its -replacement. This has the potential for data loss if the upload fails -(unlike updating a normal blob) and also may cost more since deleting -archive tier blobs early may be chargable. +#### --azurefiles-max-stream-size +Max size for streamed files. -Properties: +Azure files needs to know in advance how big the file will be. When +rclone doesn't know it uses this value instead. -- Config: archive_tier_delete -- Env Var: RCLONE_AZUREBLOB_ARCHIVE_TIER_DELETE -- Type: bool -- Default: false +This will be used when rclone is streaming data, the most common uses are: -#### --azureblob-disable-checksum +- Uploading files with `--vfs-cache-mode off` with `rclone mount` +- Using `rclone rcat` +- Copying files with unknown length -Don't store MD5 checksum with object metadata. +You will need this much free space in the share as the file will be this size temporarily. -Normally rclone will calculate the MD5 checksum of the input before -uploading it so it can add it to metadata on the object. This is great -for data integrity checking but can cause long delays for large files -to start uploading. Properties: -- Config: disable_checksum -- Env Var: RCLONE_AZUREBLOB_DISABLE_CHECKSUM -- Type: bool -- Default: false - -#### --azureblob-memory-pool-flush-time - -How often internal memory buffer pools will be flushed. (no longer used) - -Properties: - -- Config: memory_pool_flush_time -- Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_FLUSH_TIME -- Type: Duration -- Default: 1m0s - -#### --azureblob-memory-pool-use-mmap - -Whether to use mmap buffers in internal memory pool. (no longer used) - -Properties: - -- Config: memory_pool_use_mmap -- Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_USE_MMAP -- Type: bool -- Default: false +- Config: max_stream_size +- Env Var: RCLONE_AZUREFILES_MAX_STREAM_SIZE +- Type: SizeSuffix +- Default: 10Gi -#### --azureblob-encoding +#### --azurefiles-encoding The encoding for the backend. @@ -38478,72 +40126,9 @@ See the [encoding section in the overview](https://rclone.org/overview/#encoding Properties: - Config: encoding -- Env Var: RCLONE_AZUREBLOB_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8 - -#### --azureblob-public-access - -Public access level of a container: blob or container. - -Properties: - -- Config: public_access -- Env Var: RCLONE_AZUREBLOB_PUBLIC_ACCESS -- Type: string -- Required: false -- Examples: - - "" - - The container and its blobs can be accessed only with an authorized request. - - It's a default value. - - "blob" - - Blob data within this container can be read via anonymous request. - - "container" - - Allow full public read access for container and blob data. - -#### --azureblob-directory-markers - -Upload an empty object with a trailing slash when a new directory is created - -Empty folders are unsupported for bucket based remotes, this option -creates an empty object ending with "/", to persist the folder. - -This object also has the metadata "hdi_isfolder = true" to conform to -the Microsoft standard. - - -Properties: - -- Config: directory_markers -- Env Var: RCLONE_AZUREBLOB_DIRECTORY_MARKERS -- Type: bool -- Default: false - -#### --azureblob-no-check-container - -If set, don't attempt to check the container exists or create it. - -This can be useful when trying to minimise the number of transactions -rclone does if you know the container exists already. - - -Properties: - -- Config: no_check_container -- Env Var: RCLONE_AZUREBLOB_NO_CHECK_CONTAINER -- Type: bool -- Default: false - -#### --azureblob-no-head-object - -If set, do not do HEAD before GET when getting objects. - -Properties: - -- Config: no_head_object -- Env Var: RCLONE_AZUREBLOB_NO_HEAD_OBJECT -- Type: bool -- Default: false +- Env Var: RCLONE_AZUREFILES_ENCODING +- Type: Encoding +- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8,Dot @@ -38564,30 +40149,6 @@ Eg `--header-upload "Content-Type: text/potato"` MD5 sums are only uploaded with chunked files if the source has an MD5 sum. This will always be the case for a local to azure copy. -`rclone about` is not supported by the Microsoft Azure Blob storage backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. - -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) - -## Azure Storage Emulator Support - -You can run rclone with the storage emulator (usually _azurite_). - -To do this, just set up a new remote with `rclone config` following -the instructions in the introduction and set `use_emulator` in the -advanced settings as `true`. You do not need to provide a default -account name nor an account key. But you can override them in the -`account` and `key` options. (Prior to v1.61 they were hard coded to -_azurite_'s `devstoreaccount1`.) - -Also, if you want to access a storage emulator instance running on a -different machine, you can override the `endpoint` parameter in the -advanced settings, setting it to -`http(s)://:/devstoreaccount1` -(e.g. `http://10.254.2.5:10000/devstoreaccount1`). - # Microsoft OneDrive Paths are specified as `remote:path` @@ -38746,7 +40307,7 @@ You may try to [verify you account](https://docs.microsoft.com/en-us/azure/activ Note: If you have a special region, you may need a different host in step 4 and 5. Here are [some hints](https://github.com/rclone/rclone/blob/bc23bf11db1c78c6ebbf8ea538fbebf7058b4176/backend/onedrive/onedrive.go#L86). -### Modification time and hashes +### Modification times and hashes OneDrive allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or @@ -38767,6 +40328,32 @@ your workflow. For all types of OneDrive you can use the `--checksum` flag. +### --fast-list + +This remote supports `--fast-list` which allows you to use fewer +transactions in exchange for more memory. See the [rclone +docs](https://rclone.org/docs/#fast-list) for more details. + +This must be enabled with the `--onedrive-delta` flag (or `delta = +true` in the config file) as it can cause performance degradation. + +It does this by using the delta listing facilities of OneDrive which +returns all the files in the remote very efficiently. This is much +more efficient than listing directories recursively and is Microsoft's +recommended way of reading all the file information from a drive. + +This can be useful with `rclone mount` and [rclone rc vfs/refresh +recursive=true](https://rclone.org/rc/#vfs-refresh)) to very quickly fill the mount with +information about all the files. + +The API used for the recursive listing (`ListR`) only supports listing +from the root of the drive. This will become increasingly inefficient +the further away you get from the root as rclone will have to discard +files outside of the directory you are using. + +Some commands (like `rclone lsf -R`) will use `ListR` by default - you +can turn this off with `--disable ListR` if you need to. + ### Restricted filename characters In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) @@ -39178,6 +40765,43 @@ Properties: - Type: bool - Default: false +#### --onedrive-delta + +If set rclone will use delta listing to implement recursive listings. + +If this flag is set the the onedrive backend will advertise `ListR` +support for recursive listings. + +Setting this flag speeds up these things greatly: + + rclone lsf -R onedrive: + rclone size onedrive: + rclone rc vfs/refresh recursive=true + +**However** the delta listing API **only** works at the root of the +drive. If you use it not at the root then it recurses from the root +and discards all the data that is not under the directory you asked +for. So it will be correct but may not be very efficient. + +This is why this flag is not set as the default. + +As a rule of thumb if nearly all of your data is under rclone's root +directory (the `root/directory` in `onedrive:root/directory`) then +using this flag will be be a big performance win. If your data is +mostly not under the root then using this flag will be a big +performance loss. + +It is recommended if you are mounting your onedrive at the root +(or near the root when using crypt) and using rclone `rc vfs/refresh`. + + +Properties: + +- Config: delta +- Env Var: RCLONE_ONEDRIVE_DELTA +- Type: bool +- Default: false + #### --onedrive-encoding The encoding for the backend. @@ -39188,7 +40812,7 @@ Properties: - Config: encoding - Env Var: RCLONE_ONEDRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot @@ -39482,12 +41106,14 @@ To copy a local directory to an OpenDrive directory called backup rclone copy /home/source remote:backup -### Modified time and MD5SUMs +### Modification times and hashes OpenDrive allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or not. +The MD5 hash algorithm is supported. + ### Restricted filename characters | Character | Value | Replacement | @@ -39561,7 +41187,7 @@ Properties: - Config: encoding - Env Var: RCLONE_OPENDRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot #### --opendrive-chunk-size @@ -39747,6 +41373,7 @@ Rclone supports the following OCI authentication provider. No authentication ### User Principal + Sample rclone config file for Authentication Provider User Principal: [oos] @@ -39767,6 +41394,7 @@ Considerations: - If the user is deleted, the config file will no longer work and may cause automation regressions that use the user's credentials. ### Instance Principal + An OCI compute instance can be authorized to use rclone by using it's identity and certificates as an instance principal. With this approach no credentials have to be stored and managed. @@ -39796,6 +41424,7 @@ Considerations: - It is applicable for oci compute instances only. It cannot be used on external instance or resources. ### Resource Principal + Resource principal auth is very similar to instance principal auth but used for resources that are not compute instances such as [serverless functions](https://docs.oracle.com/en-us/iaas/Content/Functions/Concepts/functionsoverview.htm). To use resource principal ensure Rclone process is started with these environment variables set in its process. @@ -39815,6 +41444,7 @@ Sample rclone configuration file for Authentication Provider Resource Principal: provider = resource_principal_auth ### No authentication + Public buckets do not require any authentication mechanism to read objects. Sample rclone configuration file for No authentication: @@ -39825,10 +41455,9 @@ Sample rclone configuration file for No authentication: region = us-ashburn-1 provider = no_auth -## Options -### Modified time +### Modification times and hashes -The modified time is stored as metadata on the object as +The modification time is stored as metadata on the object as `opc-meta-mtime` as floating point since the epoch, accurate to 1 ns. If the modification time needs to be updated rclone will attempt to perform a server @@ -39838,6 +41467,8 @@ In the case the object is larger than 5Gb, the object will be uploaded rather th Note that reading this from the object takes an additional `HEAD` request as the metadata isn't returned in object listings. +The MD5 hash algorithm is supported. + ### Multipart uploads rclone supports multipart uploads with OOS which means that it can @@ -40140,7 +41771,7 @@ Properties: - Config: encoding - Env Var: RCLONE_OOS_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,InvalidUtf8,Dot #### --oos-leave-parts-on-error @@ -40667,7 +42298,7 @@ Properties: - Config: encoding - Env Var: RCLONE_QINGSTOR_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Ctl,InvalidUtf8 @@ -40798,7 +42429,7 @@ d) Delete this remote y/e/d> y ``` -### Modified time and hashes +### Modification times and hashes Quatrix allows modification times to be set on objects accurate to 1 microsecond. These will be used to detect whether objects need syncing or not. @@ -40866,7 +42497,7 @@ Properties: - Config: encoding - Env Var: RCLONE_QUATRIX_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot #### --quatrix-effective-upload-time @@ -41111,7 +42742,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SIA_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot @@ -41350,7 +42981,7 @@ sufficient to determine if it is "dirty". By using `--update` along with `--use-server-modtime`, you can avoid the extra API call and simply upload files whose local modtime is newer than the time it was last uploaded. -### Modified time +### Modification times and hashes The modified time is stored as metadata on the object as `X-Object-Meta-Mtime` as floating point since the epoch accurate to 1 @@ -41359,6 +42990,8 @@ ns. This is a de facto standard (used in the official python-swiftclient amongst others) for storing the modification time for an object. +The MD5 hash algorithm is supported. + ### Restricted filename characters | Character | Value | Replacement | @@ -41705,7 +43338,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SWIFT_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,InvalidUtf8 @@ -41833,7 +43466,7 @@ To copy a local directory to a pCloud directory called backup rclone copy /home/source remote:backup -### Modified time and hashes ### +### Modification times and hashes pCloud allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or @@ -41972,7 +43605,7 @@ Properties: - Config: encoding - Env Var: RCLONE_PCLOUD_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot #### --pcloud-root-folder-id @@ -42104,6 +43737,13 @@ d) Delete this remote y/e/d> y ``` +### Modification times and hashes + +PikPak keeps modification times on objects, and updates them when uploading objects, +but it does not support changing only the modification time + +The MD5 hash algorithm is supported. + ### Standard options @@ -42263,7 +43903,7 @@ Properties: - Config: encoding - Env Var: RCLONE_PIKPAK_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot ## Backend commands @@ -42327,15 +43967,16 @@ Result: -## Limitations ## +## Limitations -### Hashes ### +### Hashes may be empty PikPak supports MD5 hash, but sometimes given empty especially for user-uploaded files. -### Deleted files ### +### Deleted files still visible with trashed-only -Deleted files will still be visible with `--pikpak-trashed-only` even after the trash emptied. This goes away after few days. +Deleted files will still be visible with `--pikpak-trashed-only` even after the +trash emptied. This goes away after few days. # premiumize.me @@ -42417,7 +44058,7 @@ To copy a local directory to an premiumize.me directory called backup rclone copy /home/source remote:backup -### Modified time and hashes +### Modification times and hashes premiumize.me does not support modification times or hashes, therefore syncing will default to `--size-only` checking. Note that using @@ -42532,7 +44173,7 @@ Properties: - Config: encoding - Env Var: RCLONE_PREMIUMIZEME_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot @@ -42638,10 +44279,12 @@ To copy a local directory to an Proton Drive directory called backup rclone copy /home/source remote:backup -### Modified time +### Modification times and hashes Proton Drive Bridge does not support updating modification times yet. +The SHA1 hash algorithm is supported. + ### Restricted filename characters Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), also left and @@ -42787,7 +44430,7 @@ Properties: - Config: encoding - Env Var: RCLONE_PROTONDRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LeftSpace,RightSpace,InvalidUtf8,Dot #### --protondrive-original-file-size @@ -43091,7 +44734,7 @@ Properties: - Config: encoding - Env Var: RCLONE_PUTIO_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot @@ -43195,10 +44838,12 @@ To copy a local directory to an Proton Drive directory called backup rclone copy /home/source remote:backup -### Modified time +### Modification times and hashes Proton Drive Bridge does not support updating modification times yet. +The SHA1 hash algorithm is supported. + ### Restricted filename characters Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), also left and @@ -43344,7 +44989,7 @@ Properties: - Config: encoding - Env Var: RCLONE_PROTONDRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LeftSpace,RightSpace,InvalidUtf8,Dot #### --protondrive-original-file-size @@ -43838,7 +45483,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SEAFILE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8 @@ -44198,7 +45843,7 @@ commands is prohibited. Set the configuration option `disable_hashcheck` to `true` to disable checksumming entirely, or set `shell_type` to `none` to disable all functionality based on remote shell command execution. -### Modified time +### Modification times and hashes Modified times are stored on the server to 1 second precision. @@ -44855,6 +46500,32 @@ Properties: - Type: string - Required: false +#### --sftp-copy-is-hardlink + +Set to enable server side copies using hardlinks. + +The SFTP protocol does not define a copy command so normally server +side copies are not allowed with the sftp backend. + +However the SFTP protocol does support hardlinking, and if you enable +this flag then the sftp backend will support server side copies. These +will be implemented by doing a hardlink from the source to the +destination. + +Not all sftp servers support this. + +Note that hardlinking two files together will use no additional space +as the source and the destination will be the same file. + +This feature may be useful backups made with --copy-dest. + +Properties: + +- Config: copy_is_hardlink +- Env Var: RCLONE_SFTP_COPY_IS_HARDLINK +- Type: bool +- Default: false + ## Limitations @@ -45133,7 +46804,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SMB_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot @@ -45652,7 +47323,7 @@ Paths may be as deep as required, e.g. `remote:directory/subdirectory`. create a folder, which rclone will create as a "Sync Folder" with SugarSync. -### Modified time and hashes +### Modification times and hashes SugarSync does not support modification times or hashes, therefore syncing will default to `--size-only` checking. Note that using @@ -45823,7 +47494,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SUGARSYNC_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Ctl,InvalidUtf8,Dot @@ -45920,7 +47591,7 @@ To copy a local directory to an Uptobox directory called backup rclone copy /home/source remote:backup -### Modified time and hashes +### Modification times and hashes Uptobox supports neither modified times nor checksums. All timestamps will read as that set by `--default-time`. @@ -45981,7 +47652,7 @@ Properties: - Config: encoding - Env Var: RCLONE_UPTOBOX_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot @@ -46001,7 +47672,7 @@ During the initial setup with `rclone config` you will specify the upstream remotes as a space separated list. The upstream remotes can either be a local paths or other remotes. -The attributes `:ro`, `:nc` and `:nc` can be attached to the end of the remote +The attributes `:ro`, `:nc` and `:writeback` can be attached to the end of the remote to tag the remote as **read only**, **no create** or **writeback**, e.g. `remote:directory/subdirectory:ro` or `remote:directory/subdirectory:nc`. @@ -46333,7 +48004,9 @@ Choose a number from below, or type in your own value \ (sharepoint) 5 / Sharepoint with NTLM authentication, usually self-hosted or on-premises \ (sharepoint-ntlm) - 6 / Other site/service or software + 6 / rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol + \ (rclone) + 7 / Other site/service or software \ (other) vendor> 2 User name @@ -46379,7 +48052,7 @@ To copy a local directory to an WebDAV directory called backup rclone copy /home/source remote:backup -### Modified time and hashes ### +### Modification times and hashes Plain WebDAV does not support modified times. However when used with Fastmail Files, Owncloud or Nextcloud rclone will support modified times. @@ -46429,6 +48102,8 @@ Properties: - Sharepoint Online, authenticated by Microsoft account - "sharepoint-ntlm" - Sharepoint with NTLM authentication, usually self-hosted or on-premises + - "rclone" + - rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol - "other" - Other site/service or software @@ -46659,6 +48334,14 @@ For Rclone calls copying files (especially Office files such as .docx, .xlsx, et --ignore-size --ignore-checksum --update ``` +## Rclone + +Use this option if you are hosting remotes over WebDAV provided by rclone. +Read [rclone serve webdav](commands/rclone_serve_webdav/) for more details. + +rclone serve supports modified times using the `X-OC-Mtime` header. + + ### dCache dCache is a storage system that supports many protocols and @@ -46819,14 +48502,12 @@ excess files in the path. Yandex paths may be as deep as required, e.g. `remote:directory/subdirectory`. -### Modified time +### Modification times and hashes Modified times are supported and are stored accurate to 1 ns in custom metadata called `rclone_modified` in RFC3339 with nanoseconds format. -### MD5 checksums - -MD5 checksums are natively supported by Yandex Disk. +The MD5 hash algorithm is natively supported by Yandex Disk. ### Emptying Trash @@ -46940,7 +48621,7 @@ Properties: - Config: encoding - Env Var: RCLONE_YANDEX_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Del,Ctl,InvalidUtf8,Dot @@ -47067,13 +48748,11 @@ excess files in the path. Zoho paths may be as deep as required, eg `remote:directory/subdirectory`. -### Modified time +### Modification times and hashes Modified times are currently not supported for Zoho Workdrive -### Checksums - -No checksums are supported. +No hash algorithms are supported. ### Usage information @@ -47196,7 +48875,7 @@ Properties: - Config: encoding - Env Var: RCLONE_ZOHO_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Del,Ctl,InvalidUtf8 @@ -47228,10 +48907,10 @@ For consistencies sake one can also configure a remote of type rclone remote paths, e.g. `remote:path/to/wherever`, but it is probably easier not to. -### Modified time ### +### Modification times -Rclone reads and writes the modified time using an accuracy determined by -the OS. Typically this is 1ns on Linux, 10 ns on Windows and 1 Second +Rclone reads and writes the modification times using an accuracy determined +by the OS. Typically this is 1ns on Linux, 10 ns on Windows and 1 Second on OS X. ### Filenames ### @@ -47660,6 +49339,11 @@ time we: - Only checksum the size that stat gave - Don't update the stat info for the file +**NB** do not use this flag on a Windows Volume Shadow (VSS). For some +unknown reason, files in a VSS sometimes show different sizes from the +directory listing (where the initial stat value comes from on Windows) +and when stat is called on them directly. Other copy tools always use +the direct stat value and setting this flag will disable that. Properties: @@ -47770,7 +49454,7 @@ Properties: - Config: encoding - Env Var: RCLONE_LOCAL_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Dot ### Metadata @@ -47832,6 +49516,153 @@ Options: # Changelog +## v1.65.0 - 2023-11-26 + +[See commits](https://github.com/rclone/rclone/compare/v1.64.0...v1.65.0) + +* New backends + * Azure Files (karan, moongdal, Nick Craig-Wood) + * ImageKit (Abhinav Dhiman) + * Linkbox (viktor, Nick Craig-Wood) +* New commands + * `serve s3`: Let rclone act as an S3 compatible server (Mikubill, Artur Neumann, Saw-jan, Nick Craig-Wood) + * `nfsmount`: mount command to provide mount mechanism on macOS without FUSE (Saleh Dindar) + * `serve nfs`: to serve a remote for use by `nfsmount` (Saleh Dindar) +* New Features + * install.sh: Clean up temp files in install script (Jacob Hands) + * build + * Update all dependencies (Nick Craig-Wood) + * Refactor version info and icon resource handling on windows (albertony) + * doc updates (albertony, alfish2000, asdffdsazqqq, Dimitri Papadopoulos, Herby Gillot, Joda Stößer, Manoj Ghosh, Nick Craig-Wood) + * Implement `--metadata-mapper` to transform metatadata with a user supplied program (Nick Craig-Wood) + * Add `ChunkWriterDoesntSeek` feature flag and set it for b2 (Nick Craig-Wood) + * lib/http: Export basic go string functions for use in `--template` (Gabriel Espinoza) + * makefile: Use POSIX compatible install arguments (Mina Galić) + * operations + * Use less memory when doing multithread uploads (Nick Craig-Wood) + * Implement `--partial-suffix` to control extension of temporary file names (Volodymyr) + * rc + * Add `operations/check` to the rc API (Nick Craig-Wood) + * Always report an error as JSON (Nick Craig-Wood) + * Set `Last-Modified` header for files served by `--rc-serve` (Nikita Shoshin) + * size: Dont show duplicate object count when less than 1k (albertony) +* Bug Fixes + * fshttp: Fix `--contimeout` being ignored (你知道未来吗) + * march: Fix excessive parallelism when using `--no-traverse` (Nick Craig-Wood) + * ncdu: Fix crash when re-entering changed directory after rescan (Nick Craig-Wood) + * operations + * Fix overwrite of destination when multi-thread transfer fails (Nick Craig-Wood) + * Fix invalid UTF-8 when truncating file names when not using `--inplace` (Nick Craig-Wood) + * serve dnla: Fix crash on graceful exit (wuxingzhong) +* Mount + * Disable mount for freebsd and alias cmount as mount on that platform (Nick Craig-Wood) +* VFS + * Add `--vfs-refresh` flag to read all the directories on start (Beyond Meat) + * Implement Name() method in WriteFileHandle and ReadFileHandle (Saleh Dindar) + * Add go-billy dependency and make sure vfs.Handle implements billy.File (Saleh Dindar) + * Error out early if can't upload 0 length file (Nick Craig-Wood) +* Local + * Fix copying from Windows Volume Shadows (Nick Craig-Wood) +* Azure Blob + * Add support for cold tier (Ivan Yanitra) +* B2 + * Implement "rclone backend lifecycle" to read and set bucket lifecycles (Nick Craig-Wood) + * Implement `--b2-lifecycle` to control lifecycle when creating buckets (Nick Craig-Wood) + * Fix listing all buckets when not needed (Nick Craig-Wood) + * Fix multi-thread upload with copyto going to wrong name (Nick Craig-Wood) + * Fix server side chunked copy when file size was exactly `--b2-copy-cutoff` (Nick Craig-Wood) + * Fix streaming chunked files an exact multiple of chunk size (Nick Craig-Wood) +* Box + * Filter more EventIDs when polling (David Sze) + * Add more logging for polling (David Sze) + * Fix performance problem reading metadata for single files (Nick Craig-Wood) +* Drive + * Add read/write metadata support (Nick Craig-Wood) + * Add support for SHA-1 and SHA-256 checksums (rinsuki) + * Add `--drive-show-all-gdocs` to allow unexportable gdocs to be server side copied (Nick Craig-Wood) + * Add a note that `--drive-scope` accepts comma-separated list of scopes (Keigo Imai) + * Fix error updating created time metadata on existing object (Nick Craig-Wood) + * Fix integration tests by enabling metadata support from the context (Nick Craig-Wood) +* Dropbox + * Factor batcher into lib/batcher (Nick Craig-Wood) + * Fix missing encoding for rclone purge (Nick Craig-Wood) +* Google Cloud Storage + * Fix 400 Bad request errors when using multi-thread copy (Nick Craig-Wood) +* Googlephotos + * Implement batcher for uploads (Nick Craig-Wood) +* Hdfs + * Added support for list of namenodes in hdfs remote config (Tayo-pasedaRJ) +* HTTP + * Implement set backend command to update running backend (Nick Craig-Wood) + * Enable methods used with WebDAV (Alen Šiljak) +* Jottacloud + * Add support for reading and writing metadata (albertony) +* Onedrive + * Implement ListR method which gives `--fast-list` support (Nick Craig-Wood) + * This must be enabled with the `--onedrive-delta` flag +* Quatrix + * Add partial upload support (Oksana Zhykina) + * Overwrite files on conflict during server-side move (Oksana Zhykina) +* S3 + * Add Linode provider (Nick Craig-Wood) + * Add docs on how to add a new provider (Nick Craig-Wood) + * Fix no error being returned when creating a bucket we don't own (Nick Craig-Wood) + * Emit a debug message if anonymous credentials are in use (Nick Craig-Wood) + * Add `--s3-disable-multipart-uploads` flag (Nick Craig-Wood) + * Detect looping when using gcs and versions (Nick Craig-Wood) +* SFTP + * Implement `--sftp-copy-is-hardlink` to server side copy as hardlink (Nick Craig-Wood) +* Smb + * Fix incorrect `about` size by switching to `github.com/cloudsoda/go-smb2` fork (Nick Craig-Wood) + * Fix modtime of multithread uploads by setting PartialUploads (Nick Craig-Wood) +* WebDAV + * Added an rclone vendor to work with `rclone serve webdav` (Adithya Kumar) + +## v1.64.2 - 2023-10-19 + +[See commits](https://github.com/rclone/rclone/compare/v1.64.1...v1.64.2) + +* Bug Fixes + * selfupdate: Fix "invalid hashsum signature" error (Nick Craig-Wood) + * build: Fix docker build running out of space (Nick Craig-Wood) + +## v1.64.1 - 2023-10-17 + +[See commits](https://github.com/rclone/rclone/compare/v1.64.0...v1.64.1) + +* Bug Fixes + * cmd: Make `--progress` output logs in the same format as without (Nick Craig-Wood) + * docs fixes (Dimitri Papadopoulos Orfanos, Herby Gillot, Manoj Ghosh, Nick Craig-Wood) + * lsjson: Make sure we set the global metadata flag too (Nick Craig-Wood) + * operations + * Ensure concurrency is no greater than the number of chunks (Pat Patterson) + * Fix OpenOptions ignored in copy if operation was a multiThreadCopy (Vitor Gomes) + * Fix error message on delete to have file name (Nick Craig-Wood) + * serve sftp: Return not supported error for not supported commands (Nick Craig-Wood) + * build: Upgrade golang.org/x/net to v0.17.0 to fix HTTP/2 rapid reset (Nick Craig-Wood) + * pacer: Fix b2 deadlock by defaulting max connections to unlimited (Nick Craig-Wood) +* Mount + * Fix automount not detecting drive is ready (Nick Craig-Wood) +* VFS + * Fix update dir modification time (Saleh Dindar) +* Azure Blob + * Fix "fatal error: concurrent map writes" (Nick Craig-Wood) +* B2 + * Fix multipart upload: corrupted on transfer: sizes differ XXX vs 0 (Nick Craig-Wood) + * Fix locking window when getting mutipart upload URL (Nick Craig-Wood) + * Fix server side copies greater than 4GB (Nick Craig-Wood) + * Fix chunked streaming uploads (Nick Craig-Wood) + * Reduce default `--b2-upload-concurrency` to 4 to reduce memory usage (Nick Craig-Wood) +* Onedrive + * Fix the configurator to allow `/teams/ID` in the config (Nick Craig-Wood) +* Oracleobjectstorage + * Fix OpenOptions being ignored in uploadMultipart with chunkWriter (Nick Craig-Wood) +* S3 + * Fix slice bounds out of range error when listing (Nick Craig-Wood) + * Fix OpenOptions being ignored in uploadMultipart with chunkWriter (Vitor Gomes) +* Storj + * Update storj.io/uplink to v1.12.0 (Kaloyan Raev) + ## v1.64.0 - 2023-09-11 [See commits](https://github.com/rclone/rclone/compare/v1.63.0...v1.64.0) @@ -47932,14 +49763,14 @@ Options: * Fix 425 "TLS session of data connection not resumed" errors (Nick Craig-Wood) * Hdfs * Retry "replication in progress" errors when uploading (Nick Craig-Wood) - * Fix uploading to the wrong object on Update with overriden remote name (Nick Craig-Wood) + * Fix uploading to the wrong object on Update with overridden remote name (Nick Craig-Wood) * HTTP * CORS should not be sent if not set (yuudi) * Fix webdav OPTIONS response (yuudi) * Opendrive * Fix List on a just deleted and remade directory (Nick Craig-Wood) * Oracleobjectstorage - * Use rclone's rate limiter in mutipart transfers (Manoj Ghosh) + * Use rclone's rate limiter in multipart transfers (Manoj Ghosh) * Implement `OpenChunkWriter` and multi-thread uploads (Manoj Ghosh) * S3 * Refactor multipart upload to use `OpenChunkWriter` and `ChunkWriter` (Vitor Gomes) @@ -48112,14 +49943,14 @@ Options: * Fix quickxorhash on 32 bit architectures (Nick Craig-Wood) * Report any list errors during `rclone cleanup` (albertony) * Putio - * Fix uploading to the wrong object on Update with overriden remote name (Nick Craig-Wood) + * Fix uploading to the wrong object on Update with overridden remote name (Nick Craig-Wood) * Fix modification times not being preserved for server side copy and move (Nick Craig-Wood) * Fix server side copy failures (400 errors) (Nick Craig-Wood) * S3 * Empty directory markers (Jānis Bebrītis, Nick Craig-Wood) * Update Scaleway storage classes (Brian Starkey) * Fix `--s3-versions` on individual objects (Nick Craig-Wood) - * Fix hang on aborting multpart upload with iDrive e2 (Nick Craig-Wood) + * Fix hang on aborting multipart upload with iDrive e2 (Nick Craig-Wood) * Fix missing "tier" metadata (Nick Craig-Wood) * Fix V3sign: add missing subresource delete (cc) * Fix Arvancloud Domain and region changes and alphabetise the provider (Ehsan Tadayon) @@ -48136,7 +49967,7 @@ Options: * Code cleanup to avoid overwriting ctx before first use (fixes issue reported by the staticcheck linter) (albertony) * Storj * Fix "uplink: too many requests" errors when uploading to the same file (Nick Craig-Wood) - * Fix uploading to the wrong object on Update with overriden remote name (Nick Craig-Wood) + * Fix uploading to the wrong object on Update with overridden remote name (Nick Craig-Wood) * Swift * Ignore 404 error when deleting an object (Nick Craig-Wood) * Union @@ -51765,7 +53596,7 @@ Point release to fix hubic and azureblob backends. * Revert to copy when moving file across file system boundaries * `--skip-links` to suppress symlink warnings (thanks Zhiming Wang) * Mount - * Re-use `rcat` internals to support uploads from all remotes + * Reuse `rcat` internals to support uploads from all remotes * Dropbox * Fix "entry doesn't belong in directory" error * Stop using deprecated API methods @@ -53437,7 +55268,7 @@ put them back in again.` >}} * HNGamingUK * Jonta <359397+Jonta@users.noreply.github.com> * YenForYang - * Joda Stößer + * SimJoSt / Joda Stößer * Logeshwaran * Rajat Goel * r0kk3rz @@ -53684,6 +55515,38 @@ put them back in again.` >}} * Volodymyr Kit * David Pedersen * Drew Stinnett + * Pat Patterson + * Herby Gillot + * Nikita Shoshin + * rinsuki <428rinsuki+git@gmail.com> + * Beyond Meat <51850644+beyondmeat@users.noreply.github.com> + * Saleh Dindar + * Volodymyr <142890760+vkit-maytech@users.noreply.github.com> + * Gabriel Espinoza <31670639+gspinoza@users.noreply.github.com> + * Keigo Imai + * Ivan Yanitra + * alfish2000 + * wuxingzhong + * Adithya Kumar + * Tayo-pasedaRJ <138471223+Tayo-pasedaRJ@users.noreply.github.com> + * Peter Kreuser + * Piyush + * fotile96 + * Luc Ritchie + * cynful + * wjielai + * Jack Deng + * Mikubill <31246794+Mikubill@users.noreply.github.com> + * Artur Neumann + * Saw-jan + * Oksana Zhykina + * karan + * viktor + * moongdal + * Mina Galić + * Alen Šiljak + * 你知道未来吗 + * Abhinav Dhiman <8640877+ahnv@users.noreply.github.com> # Contact the rclone project diff --git a/MANUAL.txt b/MANUAL.txt index 2d0f92187f59c..11a38590b18d9 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -1,6 +1,6 @@ rclone(1) User Manual Nick Craig-Wood -Sep 11, 2023 +Nov 26, 2023 Rclone syncs your files to cloud storage @@ -124,11 +124,14 @@ S3, that work out of the box.) - Koofr - Leviia Object Storage - Liara Object Storage +- Linkbox +- Linode Object Storage - Mail.ru Cloud - Memset Memstore - Mega - Memory - Microsoft Azure Blob Storage +- Microsoft Azure Files Storage - Microsoft OneDrive - Minio - Nextcloud @@ -265,6 +268,19 @@ developers so it may be out of date. Its current version is as below. [Homebrew package] +Installation with MacPorts (#macos-macports) + +On macOS, rclone can also be installed via MacPorts: + + sudo port install rclone + +Note that this is a third party installer not controlled by the rclone +developers so it may be out of date. Its current version is as below. + +[MacPorts port] + +More information here. + Precompiled binary, using curl To avoid problems with macOS gatekeeper enforcing the binary to be @@ -483,7 +499,7 @@ Make sure you have Snapd installed $ sudo snap install rclone -Due to the strict confinement of Snap, rclone snap cannot acess real +Due to the strict confinement of Snap, rclone snap cannot access real /home/$USER/.config/rclone directory, default config path is as below. - Default config directory: @@ -502,8 +518,8 @@ developers so it may be out of date. Its current version is as below. Source installation -Make sure you have git and Go installed. Go version 1.17 or newer is -required, latest release is recommended. You can get it from your +Make sure you have git and Go installed. Go version 1.18 or newer is +required, the latest release is recommended. You can get it from your package manager, or download it from golang.org/dl. Then you can run the following: @@ -531,22 +547,51 @@ cgo on Windows as well, by using the MinGW port of GCC, e.g. by installing it in a MSYS2 distribution (make sure you install it in the classic mingw64 subsystem, the ucrt64 version is not compatible). -Additionally, on Windows, you must install the third party utility -WinFsp, with the "Developer" feature selected. If building with cgo, you -must also set environment variable CPATH pointing to the fuse include -directory within the WinFsp installation (normally +Additionally, to build with mount on Windows, you must install the third +party utility WinFsp, with the "Developer" feature selected. If building +with cgo, you must also set environment variable CPATH pointing to the +fuse include directory within the WinFsp installation (normally C:\Program Files (x86)\WinFsp\inc\fuse). -You may also add arguments -ldflags -s (with or without -tags cmount), -to omit symbol table and debug information, making the executable file -smaller, and -trimpath to remove references to local file system paths. -This is how the official rclone releases are built. +You may add arguments -ldflags -s to omit symbol table and debug +information, making the executable file smaller, and -trimpath to remove +references to local file system paths. The official rclone releases are +built with both of these. go build -trimpath -ldflags -s -tags cmount +If you want to customize the version string, as reported by the +rclone version command, you can set one of the variables fs.Version, +fs.VersionTag (to keep default suffix but customize the number), or +fs.VersionSuffix (to keep default number but customize the suffix). This +can be done from the build command, by adding to the -ldflags argument +value as shown below. + + go build -trimpath -ldflags "-s -X github.com/rclone/rclone/fs.Version=v9.9.9-test" -tags cmount + +On Windows, the official executables also have the version information, +as well as a file icon, embedded as binary resources. To get that with +your own build you need to run the following command before the build +command. It generates a Windows resource system object file, with +extension .syso, e.g. resource_windows_amd64.syso, that will be +automatically picked up by future build commands. + + go run bin/resource_windows.go + +The above command will generate a resource file containing version +information based on the fs.Version variable in source at the time you +run the command, which means if the value of this variable changes you +need to re-run the command for it to be reflected in the version +information. Also, if you override this version variable in the build +command as described above, you need to do that also when generating the +resource file, or else it will still use the value from the source. + + go run bin/resource_windows.go -version v9.9.9-test + Instead of executing the go build command directly, you can run it via -the Makefile. It changes the version number suffix from "-DEV" to -"-beta" and appends commit details. It also copies the resulting rclone +the Makefile. The default target changes the version suffix from "-DEV" +to "-beta" followed by additional commit details, embeds version +information binary resources on Windows, and copies the resulting rclone executable into your GOPATH bin folder ($(go env GOPATH)/bin, which corresponds to ~/go/bin/rclone by default). @@ -557,27 +602,18 @@ To include mount command on macOS and Windows with Makefile build: make GOTAGS=cmount There are other make targets that can be used for more advanced builds, -such as cross-compiling for all supported os/architectures, embedding -icon and version info resources into windows executable, and packaging -results into release artifacts. See Makefile and cross-compile.go for -details. - -Another alternative is to download the source, build and install rclone -in one operation, as a regular Go package. The source will be stored it -in the Go module cache, and the resulting executable will be in your -GOPATH bin folder ($(go env GOPATH)/bin, which corresponds to -~/go/bin/rclone by default). +such as cross-compiling for all supported os/architectures, and +packaging results into release artifacts. See Makefile and +cross-compile.go for details. -With Go version 1.17 or newer: +Another alternative method for source installation is to download the +source, build and install rclone - all in one operation, as a regular Go +package. The source will be stored it in the Go module cache, and the +resulting executable will be in your GOPATH bin folder +($(go env GOPATH)/bin, which corresponds to ~/go/bin/rclone by default). go install github.com/rclone/rclone@latest -With Go versions older than 1.17 (do not use the -u flag, it causes Go -to try to update the dependencies that rclone uses and sometimes these -don't work with the current version): - - go get github.com/rclone/rclone - Ansible installation This can be done with Stefan Weichinger's ansible role. @@ -739,7 +775,7 @@ also provides alternative standalone distributions which includes necessary runtime (.NET 5). WinSW is a command-line only utility, where you have to manually create an XML file with service configuration. This may be a drawback for some, but it can also be an advantage as it is -easy to back up and re-use the configuration settings, without having go +easy to back up and reuse the configuration settings, without having go through manual steps in a GUI. One thing to note is that by default it does not restart the service on error, one have to explicit enable this in the configuration file (via the "onfailure" parameter). @@ -808,10 +844,12 @@ See the following for detailed instructions for - Internet Archive - Jottacloud - Koofr +- Linkbox - Mail.ru Cloud - Mega - Memory - Microsoft Azure Blob Storage +- Microsoft Azure Files Storage - Microsoft OneDrive - OpenStack Swift / Rackspace Cloudfiles / Blomp Cloud Storage / Memset Memstore @@ -980,11 +1018,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -999,11 +1037,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination @@ -1111,11 +1150,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -1130,11 +1169,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination @@ -1250,11 +1290,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -1269,11 +1309,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination @@ -2525,11 +2566,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -2544,11 +2585,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination @@ -2684,16 +2726,19 @@ SEE ALSO rclone checksum -Checks the files in the source against a SUM file. +Checks the files in the destination against a SUM file. Synopsis -Checks that hashsums of source files match the SUM file. It compares -hashes (MD5, SHA1, etc) and logs a report of files which don't match. It -doesn't alter the file system. +Checks that hashsums of destination files match the SUM file. It +compares hashes (MD5, SHA1, etc) and logs a report of files which don't +match. It doesn't alter the file system. -If you supply the --download flag, it will download the data from remote -and calculate the contents hash on the fly. This can be useful for +The sumfile is treated as the source and the dst:path is treated as the +destination for the purposes of the output. + +If you supply the --download flag, it will download the data from the +remote and calculate the content hash on the fly. This can be useful for remotes that don't support hashes or if you really want to check all the data. @@ -2728,7 +2773,7 @@ what happened to it. These are reminiscent of diff files. The default number of parallel checks is 8. See the --checkers=N option for more information. - rclone checksum sumfile src:path [flags] + rclone checksum sumfile dst:path [flags] Options @@ -3500,11 +3545,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -3519,11 +3564,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination @@ -3984,10 +4030,6 @@ Run without a hash to see the list of all supported hashes, e.g. * whirlpool * crc32 * sha256 - * dropbox - * hidrive - * mailru - * quickxor Then @@ -3996,7 +4038,7 @@ Then Note that hash names are case insensitive and values are output in lower case. - rclone hashsum remote:path [flags] + rclone hashsum [ remote:path] [flags] Options @@ -4712,10 +4754,17 @@ not suffer from the same limitations. Mounting on macOS -Mounting on macOS can be done either via macFUSE (also known as osxfuse) -or FUSE-T. macFUSE is a traditional FUSE driver utilizing a macOS kernel -extension (kext). FUSE-T is an alternative FUSE system which "mounts" -via an NFSv4 local server. +Mounting on macOS can be done either via built-in NFS server, macFUSE +(also known as osxfuse) or FUSE-T. macFUSE is a traditional FUSE driver +utilizing a macOS kernel extension (kext). FUSE-T is an alternative FUSE +system which "mounts" via an NFSv4 local server. + +NFS mount + +This method spins up an NFS server using serve nfs command and mounts it +to the specified mountpoint. If you run this in background mode using +|--daemon|, you will need to send SIGTERM signal to the rclone process +using |kill| command to stop the mount. macFUSE Notes @@ -4764,7 +4813,8 @@ Without the use of --vfs-cache-mode this can only write files sequentially, it can only seek when reading. This means that many applications won't work with their files on an rclone mount without --vfs-cache-mode writes or --vfs-cache-mode full. See the VFS File -Caching section for more info. +Caching section for more info. When using NFS mount on macOS, if you +don't specify |--vfs-cache-mode| the mount point will be read-only. The bucket-based remotes (e.g. Swift, S3, Google Compute Storage, B2) do not support the concept of empty directories, so empty directories will @@ -4904,9 +4954,8 @@ Mount option syntax includes a few extra options treated specially: pgrep. - vv... will be transformed into appropriate --verbose=N - standard mount options like x-systemd.automount, _netdev, nosuid and - alike are intended only for Automountd and ignored by rclone. - -VFS - Virtual File System + alike are intended only for Automountd and ignored by rclone. ## + VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing @@ -5283,6 +5332,7 @@ Options --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -5373,11 +5423,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -5392,11 +5442,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination @@ -5844,6 +5895,27 @@ be used within the template to server pages: -- .ModTime The UTC timestamp of an entry. ----------------------------------------------------------------------- +The server also makes the following functions available so that they can +be used within the template. These functions help extend the options for +dynamic rendering of HTML. They can be used to render HTML based on +specific conditions. + + ----------------------------------------------------------------------- + Function Description + ----------------------------------- ----------------------------------- + afterEpoch Returns the time since the epoch + for the given time. + + contains Checks whether a given substring is + present or not in a given string. + + hasPrefix Checks whether the given string + begins with the specified prefix. + + hasSuffix Checks whether the given string end + with the specified suffix. + ----------------------------------------------------------------------- + Authentication By default this will serve files without needing a login. @@ -6063,7 +6135,9 @@ SEE ALSO API. - rclone serve ftp - Serve remote:path over FTP. - rclone serve http - Serve the remote over HTTP. +- rclone serve nfs - Serve the remote as an NFS mount - rclone serve restic - Serve the remote for restic's REST API. +- rclone serve s3 - Serve remote:path over s3. - rclone serve sftp - Serve the remote over SFTP. - rclone serve webdav - Serve remote:path over WebDAV. @@ -6093,9 +6167,7 @@ Use --name to choose the friendly server name, which is by default "rclone (hostname)". Use --log-trace in conjunction with -vv to enable additional debug -logging of all UPNP traffic. - -VFS - Virtual File System +logging of all UPNP traffic. ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing @@ -6459,6 +6531,7 @@ Options --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -6539,8 +6612,7 @@ directory with book-keeping records of created and mounted volumes. All mount and VFS options are submitted by the docker daemon via API, but you can also provide defaults on the command line as well as set path to the config file and cache directory or adjust logging verbosity. - -VFS - Virtual File System +## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing @@ -6922,6 +6994,7 @@ Options --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -6986,9 +7059,7 @@ Authentication By default this will serve files without needing a login. You can set a single username and password with the --user and --pass -flags. - -VFS - Virtual File System +flags. ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing @@ -7426,6 +7497,7 @@ Options --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -7579,6 +7651,27 @@ be used within the template to server pages: -- .ModTime The UTC timestamp of an entry. ----------------------------------------------------------------------- +The server also makes the following functions available so that they can +be used within the template. These functions help extend the options for +dynamic rendering of HTML. They can be used to render HTML based on +specific conditions. + + ----------------------------------------------------------------------- + Function Description + ----------------------------------- ----------------------------------- + afterEpoch Returns the time since the epoch + for the given time. + + contains Checks whether a given substring is + present or not in a given string. + + hasPrefix Checks whether the given string + begins with the specified prefix. + + hasSuffix Checks whether the given string end + with the specified suffix. + ----------------------------------------------------------------------- + Authentication By default this will serve files without needing a login. @@ -7605,9 +7698,8 @@ The password file can be updated while rclone is running. Use --realm to set the authentication realm. -Use --salt to change the password hashing salt from the default. - -VFS - Virtual File System +Use --salt to change the password hashing salt from the default. ## VFS +- Virtual File System This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing @@ -8054,6 +8146,7 @@ Options --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -8091,254 +8184,44 @@ SEE ALSO - rclone serve - Serve a remote over a protocol. -rclone serve restic +rclone serve nfs -Serve the remote for restic's REST API. +Serve the remote as an NFS mount Synopsis -Run a basic web server to serve a remote over restic's REST backend API -over HTTP. This allows restic to use rclone as a data storage mechanism -for cloud providers that restic does not support directly. - -Restic is a command-line program for doing backups. - -The server will log errors. Use -v to see access logs. - ---bwlimit will be respected for file transfers. Use --stats to control -the stats printing. - -Setting up rclone for use by restic - -First set up a remote for your chosen cloud provider. - -Once you have set up the remote, check it is working with, for example -"rclone lsd remote:". You may have called the remote something other -than "remote:" - just substitute whatever you called it in the following -instructions. - -Now start the rclone restic server - - rclone serve restic -v remote:backup - -Where you can replace "backup" in the above by whatever path in the -remote you wish to use. - -By default this will serve on "localhost:8080" you can change this with -use of the --addr flag. +Create an NFS server that serves the given remote over the network. -You might wish to start this server on boot. +The primary purpose for this command is to enable mount command on +recent macOS versions where installing FUSE is very cumbersome. -Adding --cache-objects=false will cause rclone to stop caching objects -returned from the List call. Caching is normally desirable as it speeds -up downloading objects, saves transactions and uses very little memory. +Since this is running on NFSv3, no authentication method is available. +Any client will be able to access the data. To limit access, you can use +serve NFS on loopback address and rely on secure tunnels (such as SSH). +For this reason, by default, a random TCP port is chosen and loopback +interface is used for the listening address; meaning that it is only +available to the local machine. If you want other machines to access the +NFS mount over local network, you need to specify the listening address +and port using --addr flag. -Setting up restic to use rclone +Modifying files through NFS protocol requires VFS caching. Usually you +will need to specify --vfs-cache-mode in order to be able to write to +the mountpoint (full is recommended). If you don't specify VFS cache +mode, the mount will be read-only. -Now you can follow the restic instructions on setting up restic. - -Note that you will need restic 0.8.2 or later to interoperate with -rclone. +To serve NFS over the network use following command: -For the example above you will want to use "http://localhost:8080/" as -the URL for the REST server. + rclone serve nfs remote: --addr 0.0.0.0:$PORT --vfs-cache-mode=full -For example: +We specify a specific port that we can use in the mount command: - $ export RESTIC_REPOSITORY=rest:http://localhost:8080/ - $ export RESTIC_PASSWORD=yourpassword - $ restic init - created restic backend 8b1a4b56ae at rest:http://localhost:8080/ +To mount the server under Linux/macOS, use the following command: - Please note that knowledge of your password is required to access - the repository. Losing your password means that your data is - irrecoverably lost. - $ restic backup /path/to/files/to/backup - scan [/path/to/files/to/backup] - scanned 189 directories, 312 files in 0:00 - [0:00] 100.00% 38.128 MiB / 38.128 MiB 501 / 501 items 0 errors ETA 0:00 - duration: 0:00 - snapshot 45c8fdd8 saved + mount -oport=$PORT,mountport=$PORT $HOSTNAME: path/to/mountpoint -Multiple repositories +Where $PORT is the same port number we used in the serve nfs command. -Note that you can use the endpoint to host multiple repositories. Do -this by adding a directory name or path after the URL. Note that these -must end with /. Eg - - $ export RESTIC_REPOSITORY=rest:http://localhost:8080/user1repo/ - # backup user1 stuff - $ export RESTIC_REPOSITORY=rest:http://localhost:8080/user2repo/ - # backup user2 stuff - -Private repositories - -The--private-repos flag can be used to limit users to repositories -starting with a path of //. - -Server options - -Use --addr to specify which IP address and port the server should listen -on, eg --addr 1.2.3.4:8000 or --addr :8080 to listen to all IPs. By -default it only listens on localhost. You can use port :0 to let the OS -choose an available port. - -If you set --addr to listen on a public or LAN accessible IP address -then using Authentication is advised - see the next section for info. - -You can use a unix socket by setting the url to unix:///path/to/socket -or just by using an absolute path name. Note that unix sockets bypass -the authentication - this is expected to be done with file system -permissions. - ---addr may be repeated to listen on multiple IPs/ports/sockets. - ---server-read-timeout and --server-write-timeout can be used to control -the timeouts on the server. Note that this is the total time for a -transfer. - ---max-header-bytes controls the maximum number of bytes the server will -accept in the HTTP header. - ---baseurl controls the URL prefix that rclone serves from. By default -rclone will serve from the root. If you used --baseurl "/rclone" then -rclone would serve from a URL starting with "/rclone/". This is useful -if you wish to proxy rclone serve. Rclone automatically inserts leading -and trailing "/" on --baseurl, so --baseurl "rclone", ---baseurl "/rclone" and --baseurl "/rclone/" are all treated -identically. - -TLS (SSL) - -By default this will serve over http. If you want you can serve over -https. You will need to supply the --cert and --key flags. If you wish -to do client side certificate validation then you will need to supply ---client-ca also. - ---cert should be a either a PEM encoded certificate or a concatenation -of that with the CA certificate. --key should be the PEM encoded private -key and --client-ca should be the PEM encoded client certificate -authority certificate. - ---min-tls-version is minimum TLS version that is acceptable. Valid -values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default "tls1.0"). - -Authentication - -By default this will serve files without needing a login. - -You can either use an htpasswd file which can take lots of users, or set -a single username and password with the --user and --pass flags. - -If no static users are configured by either of the above methods, and -client certificates are required by the --client-ca flag passed to the -server, the client certificate common name will be considered as the -username. - -Use --htpasswd /path/to/htpasswd to provide an htpasswd file. This is in -standard apache format and supports MD5, SHA1 and BCrypt for basic -authentication. Bcrypt is recommended. - -To create an htpasswd file: - - touch htpasswd - htpasswd -B htpasswd user - htpasswd -B htpasswd anotherUser - -The password file can be updated while rclone is running. - -Use --realm to set the authentication realm. - -Use --salt to change the password hashing salt from the default. - - rclone serve restic remote:path [flags] - -Options - - --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) - --allow-origin string Origin which cross-domain request (CORS) can be executed from - --append-only Disallow deletion of repository data - --baseurl string Prefix for URLs - leave blank for root - --cache-objects Cache listed objects (default true) - --cert string TLS PEM key (concatenation of certificate and CA certificate) - --client-ca string Client certificate authority to verify clients with - -h, --help help for restic - --htpasswd string A htpasswd file - if not provided no authentication is done - --key string TLS PEM Private key - --max-header-bytes int Maximum size of request header (default 4096) - --min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") - --pass string Password for authentication - --private-repos Users can only access their private repo - --realm string Realm for authentication - --salt string Password hashing salt (default "dlPL2MqE") - --server-read-timeout Duration Timeout for server reading data (default 1h0m0s) - --server-write-timeout Duration Timeout for server writing data (default 1h0m0s) - --stdio Run an HTTP2 server on stdin/stdout - --user string User name for authentication - -See the global flags page for global options not listed here. - -SEE ALSO - -- rclone serve - Serve a remote over a protocol. - -rclone serve sftp - -Serve the remote over SFTP. - -Synopsis - -Run an SFTP server to serve a remote over SFTP. This can be used with an -SFTP client or you can make a remote of type sftp to use with it. - -You can use the filter flags (e.g. --include, --exclude) to control what -is served. - -The server will respond to a small number of shell commands, mainly -md5sum, sha1sum and df, which enable it to provide support for checksums -and the about feature when accessed from an sftp remote. - -Note that this server uses standard 32 KiB packet payload size, which -means you must not configure the client to expect anything else, e.g. -with the chunk_size option on an sftp remote. - -The server will log errors. Use -v to see access logs. - ---bwlimit will be respected for file transfers. Use --stats to control -the stats printing. - -You must provide some means of authentication, either with ---user/--pass, an authorized keys file (specify location with ---authorized-keys - the default is the same as ssh), an --auth-proxy, or -set the --no-auth flag for no authentication when logging in. - -If you don't supply a host --key then rclone will generate rsa, ecdsa -and ed25519 variants, and cache them for later use in rclone's cache -directory (see rclone help flags cache-dir) in the "serve-sftp" -directory. - -By default the server binds to localhost:2022 - if you want it to be -reachable externally then supply --addr :2022 for example. - -Note that the default of --vfs-cache-mode off is fine for the rclone -sftp backend, but it may not be with other SFTP clients. - -If --stdio is specified, rclone will serve SFTP over stdio, which can be -used with sshd via ~/.ssh/authorized_keys, for example: - - restrict,command="rclone serve sftp --stdio ./photos" ssh-rsa ... - -On the client you need to set --transfers 1 when using --stdio. -Otherwise multiple instances of the rclone server are started by OpenSSH -which can lead to "corrupted on transfer" errors. This is the case -because the client chooses indiscriminately which server to send -commands to while the servers all have different views of the state of -the filing system. - -The "restrict" in authorized_keys prevents SHA1SUMs and MD5SUMs from -being used. Omitting "restrict" and using --sftp-path-override to enable -checksumming is possible but less secure and you could use the SFTP -server provided by OpenSSH in this case. +This feature is only available on Unix platforms. VFS - Virtual File System @@ -8671,101 +8554,23 @@ result is accurate. However, this is very inefficient and may cost lots of API calls resulting in extra charges. Use it as a last resort and only with caching. -Auth Proxy - -If you supply the parameter --auth-proxy /path/to/program then rclone -will use that program to generate backends on the fly which then are -used to authenticate incoming requests. This uses a simple JSON based -protocol with input on STDIN and output on STDOUT. - -PLEASE NOTE: --auth-proxy and --authorized-keys cannot be used together, -if --auth-proxy is set the authorized keys option will be ignored. - -There is an example program bin/test_proxy.py in the rclone source code. - -The program's job is to take a user and pass on the input and turn those -into the config for a backend on STDOUT in JSON format. This config will -have any default parameters for the backend added, but it won't use -configuration from environment variables or command line options - it is -the job of the proxy program to make a complete config. - -This config generated must have this extra parameter - _root - root to -use for the backend - -And it may have this parameter - _obscure - comma separated strings for -parameters to obscure - -If password authentication was used by the client, input to the proxy -process (on STDIN) would look similar to this: - - { - "user": "me", - "pass": "mypassword" - } - -If public-key authentication was used by the client, input to the proxy -process (on STDIN) would look similar to this: - - { - "user": "me", - "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDuwESFdAe14hVS6omeyX7edc...JQdf" - } - -And as an example return this on STDOUT - - { - "type": "sftp", - "_root": "", - "_obscure": "pass", - "user": "me", - "pass": "mypassword", - "host": "sftp.example.com" - } - -This would mean that an SFTP backend would be created on the fly for the -user and pass/public_key returned in the output to the host given. Note -that since _obscure is set to pass, rclone will obscure the pass -parameter before creating the backend (which is required for sftp -backends). - -The program can manipulate the supplied user in any way, for example to -make proxy to many different sftp backends, you could make the user be -user@example.com and then set the host to example.com in the output and -the user to user. For security you'd probably want to restrict the host -to a limited list. - -Note that an internal cache is keyed on user so only use that for -configuration, don't use pass or public_key. This also means that if a -user's password or public-key is changed the cache will need to expire -(which takes 5 mins) before it takes effect. - -This can be used to build general purpose proxies to any kind of backend -that rclone supports. - - rclone serve sftp remote:path [flags] + rclone serve nfs remote:path [flags] Options - --addr string IPaddress:Port or :Port to bind server to (default "localhost:2022") - --auth-proxy string A program to use to create the backend from the auth - --authorized-keys string Authorized keys file (default "~/.ssh/authorized_keys") + --addr string IPaddress:Port or :Port to bind server to --dir-cache-time Duration Time to cache directory entries for (default 5m0s) --dir-perms FileMode Directory permissions (default 0777) --file-perms FileMode File permissions (default 0666) --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) - -h, --help help for sftp - --key stringArray SSH private host key file (Can be multi-valued, leave blank to auto generate) - --no-auth Allow connections with no authentication if set + -h, --help help for nfs --no-checksum Don't compare checksums on up/download --no-modtime Don't read/write the modification time (can speed things up) --no-seek Don't allow seeking in files - --pass string Password for authentication --poll-interval Duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s) --read-only Only allow read-only access - --stdio Run an sftp server on stdin/stdout --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) - --user string User name for authentication --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) @@ -8778,6 +8583,7 @@ Options --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -8815,52 +8621,90 @@ SEE ALSO - rclone serve - Serve a remote over a protocol. -rclone serve webdav +rclone serve restic -Serve remote:path over WebDAV. +Serve the remote for restic's REST API. Synopsis -Run a basic WebDAV server to serve a remote over HTTP via the WebDAV -protocol. This can be viewed with a WebDAV client, through a web -browser, or you can make a remote of type WebDAV to read and write it. +Run a basic web server to serve a remote over restic's REST backend API +over HTTP. This allows restic to use rclone as a data storage mechanism +for cloud providers that restic does not support directly. -WebDAV options +Restic is a command-line program for doing backups. ---etag-hash +The server will log errors. Use -v to see access logs. -This controls the ETag header. Without this flag the ETag will be based -on the ModTime and Size of the object. +--bwlimit will be respected for file transfers. Use --stats to control +the stats printing. -If this flag is set to "auto" then rclone will choose the first -supported hash on the backend or you can use a named hash such as "MD5" -or "SHA-1". Use the hashsum command to see the full list. +Setting up rclone for use by restic -Access WebDAV on Windows +First set up a remote for your chosen cloud provider. -WebDAV shared folder can be mapped as a drive on Windows, however the -default settings prevent it. Windows will fail to connect to the server -using insecure Basic authentication. It will not even display any login -dialog. Windows requires SSL / HTTPS connection to be used with Basic. -If you try to connect via Add Network Location Wizard you will get the -following error: "The folder you entered does not appear to be valid. -Please choose another". However, you still can connect if you set the -following registry key on a client machine: HKEY_LOCAL_MACHINEto 2. The -BasicAuthLevel can be set to the following values: 0 - Basic -authentication disabled 1 - Basic authentication enabled for SSL -connections only 2 - Basic authentication enabled for SSL connections -and for non-SSL connections If required, increase the -FileSizeLimitInBytes to a higher value. Navigate to the Services -interface, then restart the WebClient service. +Once you have set up the remote, check it is working with, for example +"rclone lsd remote:". You may have called the remote something other +than "remote:" - just substitute whatever you called it in the following +instructions. -Access Office applications on WebDAV +Now start the rclone restic server -Navigate to following registry HKEY_CURRENT_USER[14.0/15.0/16.0] Create -a new DWORD BasicAuthLevel with value 2. 0 - Basic authentication -disabled 1 - Basic authentication enabled for SSL connections only 2 - -Basic authentication enabled for SSL and for non-SSL connections + rclone serve restic -v remote:backup -https://learn.microsoft.com/en-us/office/troubleshoot/powerpoint/office-opens-blank-from-sharepoint +Where you can replace "backup" in the above by whatever path in the +remote you wish to use. + +By default this will serve on "localhost:8080" you can change this with +use of the --addr flag. + +You might wish to start this server on boot. + +Adding --cache-objects=false will cause rclone to stop caching objects +returned from the List call. Caching is normally desirable as it speeds +up downloading objects, saves transactions and uses very little memory. + +Setting up restic to use rclone + +Now you can follow the restic instructions on setting up restic. + +Note that you will need restic 0.8.2 or later to interoperate with +rclone. + +For the example above you will want to use "http://localhost:8080/" as +the URL for the REST server. + +For example: + + $ export RESTIC_REPOSITORY=rest:http://localhost:8080/ + $ export RESTIC_PASSWORD=yourpassword + $ restic init + created restic backend 8b1a4b56ae at rest:http://localhost:8080/ + + Please note that knowledge of your password is required to access + the repository. Losing your password means that your data is + irrecoverably lost. + $ restic backup /path/to/files/to/backup + scan [/path/to/files/to/backup] + scanned 189 directories, 312 files in 0:00 + [0:00] 100.00% 38.128 MiB / 38.128 MiB 501 / 501 items 0 errors ETA 0:00 + duration: 0:00 + snapshot 45c8fdd8 saved + +Multiple repositories + +Note that you can use the endpoint to host multiple repositories. Do +this by adding a directory name or path after the URL. Note that these +must end with /. Eg + + $ export RESTIC_REPOSITORY=rest:http://localhost:8080/user1repo/ + # backup user1 stuff + $ export RESTIC_REPOSITORY=rest:http://localhost:8080/user2repo/ + # backup user2 stuff + +Private repositories + +The--private-repos flag can be used to limit users to repositories +starting with a path of //. Server options @@ -8909,58 +8753,6 @@ authority certificate. --min-tls-version is minimum TLS version that is acceptable. Valid values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default "tls1.0"). -Template - ---template allows a user to specify a custom markup template for HTTP -and WebDAV serve functions. The server exports the following markup to -be used within the template to server pages: - - ----------------------------------------------------------------------- - Parameter Description - ----------------------------------- ----------------------------------- - .Name The full path of a file/directory. - - .Title Directory listing of .Name - - .Sort The current sort used. This is - changeable via ?sort= parameter - - Sort Options: - namedirfirst,name,size,time - (default namedirfirst) - - .Order The current ordering used. This is - changeable via ?order= parameter - - Order Options: asc,desc (default - asc) - - .Query Currently unused. - - .Breadcrumb Allows for creating a relative - navigation - - -- .Link The relative to the root link of - the Text. - - -- .Text The Name of the directory. - - .Entries Information about a specific - file/directory. - - -- .URL The 'url' of an entry. - - -- .Leaf Currently same as 'URL' but - intended to be 'just' the name. - - -- .IsDir Boolean for if an entry is a - directory or not. - - -- .Size Size in Bytes of the entry. - - -- .ModTime The UTC timestamp of an entry. - ----------------------------------------------------------------------- - Authentication By default this will serve files without needing a login. @@ -8989,7 +8781,196 @@ Use --realm to set the authentication realm. Use --salt to change the password hashing salt from the default. -VFS - Virtual File System + rclone serve restic remote:path [flags] + +Options + + --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) + --allow-origin string Origin which cross-domain request (CORS) can be executed from + --append-only Disallow deletion of repository data + --baseurl string Prefix for URLs - leave blank for root + --cache-objects Cache listed objects (default true) + --cert string TLS PEM key (concatenation of certificate and CA certificate) + --client-ca string Client certificate authority to verify clients with + -h, --help help for restic + --htpasswd string A htpasswd file - if not provided no authentication is done + --key string TLS PEM Private key + --max-header-bytes int Maximum size of request header (default 4096) + --min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") + --pass string Password for authentication + --private-repos Users can only access their private repo + --realm string Realm for authentication + --salt string Password hashing salt (default "dlPL2MqE") + --server-read-timeout Duration Timeout for server reading data (default 1h0m0s) + --server-write-timeout Duration Timeout for server writing data (default 1h0m0s) + --stdio Run an HTTP2 server on stdin/stdout + --user string User name for authentication + +See the global flags page for global options not listed here. + +SEE ALSO + +- rclone serve - Serve a remote over a protocol. + +rclone serve s3 + +Serve remote:path over s3. + +Synopsis + +serve s3 implements a basic s3 server that serves a remote via s3. This +can be viewed with an s3 client, or you can make an s3 type remote to +read and write to it with rclone. + +serve s3 is considered Experimental so use with care. + +S3 server supports Signature Version 4 authentication. Just use +--auth-key accessKey,secretKey and set the Authorization header +correctly in the request. (See the AWS docs). + +--auth-key can be repeated for multiple auth pairs. If --auth-key is not +provided then serve s3 will allow anonymous access. + +Please note that some clients may require HTTPS endpoints. See the SSL +docs for more information. + +This command uses the VFS directory cache. All the functionality will +work with --vfs-cache-mode off. Using --vfs-cache-mode full (or writes) +can be used to cache objects locally to improve performance. + +Use --force-path-style=false if you want to use the bucket name as a +part of the hostname (such as mybucket.local) + +Use --etag-hash if you want to change the hash uses for the ETag. Note +that using anything other than MD5 (the default) is likely to cause +problems for S3 clients which rely on the Etag being the MD5. + +Quickstart + +For a simple set up, to serve remote:path over s3, run the server like +this: + + rclone serve s3 --auth-key ACCESS_KEY_ID,SECRET_ACCESS_KEY remote:path + +This will be compatible with an rclone remote which is defined like +this: + + [serves3] + type = s3 + provider = Rclone + endpoint = http://127.0.0.1:8080/ + access_key_id = ACCESS_KEY_ID + secret_access_key = SECRET_ACCESS_KEY + use_multipart_uploads = false + +Note that setting disable_multipart_uploads = true is to work around a +bug which will be fixed in due course. + +Bugs + +When uploading multipart files serve s3 holds all the parts in memory +(see #7453). This is a limitaton of the library rclone uses for serving +S3 and will hopefully be fixed at some point. + +Multipart server side copies do not work (see #7454). These take a very +long time and eventually fail. The default threshold for multipart +server side copies is 5G which is the maximum it can be, so files above +this side will fail to be server side copied. + +For a current list of serve s3 bugs see the serve s3 bug category on +GitHub. + +Limitations + +serve s3 will treat all directories in the root as buckets and ignore +all files in the root. You can use CreateBucket to create folders under +the root, but you can't create empty folders under other folders not in +the root. + +When using PutObject or DeleteObject, rclone will automatically create +or clean up empty folders. If you don't want to clean up empty folders +automatically, use --no-cleanup. + +When using ListObjects, rclone will use / when the delimiter is empty. +This reduces backend requests with no effect on most operations, but if +the delimiter is something other than / and empty, rclone will do a full +recursive search of the backend, which can take some time. + +Versioning is not currently supported. + +Metadata will only be saved in memory other than the rclone mtime +metadata which will be set as the modification time of the file. + +Supported operations + +serve s3 currently supports the following operations. + +- Bucket + - ListBuckets + - CreateBucket + - DeleteBucket +- Object + - HeadObject + - ListObjects + - GetObject + - PutObject + - DeleteObject + - DeleteObjects + - CreateMultipartUpload + - CompleteMultipartUpload + - AbortMultipartUpload + - CopyObject + - UploadPart + +Other operations will return error Unimplemented. + +Server options + +Use --addr to specify which IP address and port the server should listen +on, eg --addr 1.2.3.4:8000 or --addr :8080 to listen to all IPs. By +default it only listens on localhost. You can use port :0 to let the OS +choose an available port. + +If you set --addr to listen on a public or LAN accessible IP address +then using Authentication is advised - see the next section for info. + +You can use a unix socket by setting the url to unix:///path/to/socket +or just by using an absolute path name. Note that unix sockets bypass +the authentication - this is expected to be done with file system +permissions. + +--addr may be repeated to listen on multiple IPs/ports/sockets. + +--server-read-timeout and --server-write-timeout can be used to control +the timeouts on the server. Note that this is the total time for a +transfer. + +--max-header-bytes controls the maximum number of bytes the server will +accept in the HTTP header. + +--baseurl controls the URL prefix that rclone serves from. By default +rclone will serve from the root. If you used --baseurl "/rclone" then +rclone would serve from a URL starting with "/rclone/". This is useful +if you wish to proxy rclone serve. Rclone automatically inserts leading +and trailing "/" on --baseurl, so --baseurl "rclone", +--baseurl "/rclone" and --baseurl "/rclone/" are all treated +identically. + +TLS (SSL) + +By default this will serve over http. If you want you can serve over +https. You will need to supply the --cert and --key flags. If you wish +to do client side certificate validation then you will need to supply +--client-ca also. + +--cert should be a either a PEM encoded certificate or a concatenation +of that with the CA certificate. --key should be the PEM encoded private +key and --client-ca should be the PEM encoded client certificate +authority certificate. + +--min-tls-version is minimum TLS version that is acceptable. Valid +values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default "tls1.0"). +## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing @@ -9320,112 +9301,36 @@ result is accurate. However, this is very inefficient and may cost lots of API calls resulting in extra charges. Use it as a last resort and only with caching. -Auth Proxy - -If you supply the parameter --auth-proxy /path/to/program then rclone -will use that program to generate backends on the fly which then are -used to authenticate incoming requests. This uses a simple JSON based -protocol with input on STDIN and output on STDOUT. - -PLEASE NOTE: --auth-proxy and --authorized-keys cannot be used together, -if --auth-proxy is set the authorized keys option will be ignored. - -There is an example program bin/test_proxy.py in the rclone source code. - -The program's job is to take a user and pass on the input and turn those -into the config for a backend on STDOUT in JSON format. This config will -have any default parameters for the backend added, but it won't use -configuration from environment variables or command line options - it is -the job of the proxy program to make a complete config. - -This config generated must have this extra parameter - _root - root to -use for the backend - -And it may have this parameter - _obscure - comma separated strings for -parameters to obscure - -If password authentication was used by the client, input to the proxy -process (on STDIN) would look similar to this: - - { - "user": "me", - "pass": "mypassword" - } - -If public-key authentication was used by the client, input to the proxy -process (on STDIN) would look similar to this: - - { - "user": "me", - "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDuwESFdAe14hVS6omeyX7edc...JQdf" - } - -And as an example return this on STDOUT - - { - "type": "sftp", - "_root": "", - "_obscure": "pass", - "user": "me", - "pass": "mypassword", - "host": "sftp.example.com" - } - -This would mean that an SFTP backend would be created on the fly for the -user and pass/public_key returned in the output to the host given. Note -that since _obscure is set to pass, rclone will obscure the pass -parameter before creating the backend (which is required for sftp -backends). - -The program can manipulate the supplied user in any way, for example to -make proxy to many different sftp backends, you could make the user be -user@example.com and then set the host to example.com in the output and -the user to user. For security you'd probably want to restrict the host -to a limited list. - -Note that an internal cache is keyed on user so only use that for -configuration, don't use pass or public_key. This also means that if a -user's password or public-key is changed the cache will need to expire -(which takes 5 mins) before it takes effect. - -This can be used to build general purpose proxies to any kind of backend -that rclone supports. - - rclone serve webdav remote:path [flags] + rclone serve s3 remote:path [flags] Options --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) --allow-origin string Origin which cross-domain request (CORS) can be executed from - --auth-proxy string A program to use to create the backend from the auth + --auth-key stringArray Set key pair for v4 authorization: access_key_id,secret_access_key --baseurl string Prefix for URLs - leave blank for root --cert string TLS PEM key (concatenation of certificate and CA certificate) --client-ca string Client certificate authority to verify clients with --dir-cache-time Duration Time to cache directory entries for (default 5m0s) --dir-perms FileMode Directory permissions (default 0777) - --disable-dir-list Disable HTML directory list on GET request for a directory - --etag-hash string Which hash to use for the ETag, or auto or blank for off + --etag-hash string Which hash to use for the ETag, or auto or blank for off (default "MD5") --file-perms FileMode File permissions (default 0666) + --force-path-style If true use path style access if false use virtual hosted style (default true) (default true) --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) - -h, --help help for webdav - --htpasswd string A htpasswd file - if not provided no authentication is done + -h, --help help for s3 --key string TLS PEM Private key --max-header-bytes int Maximum size of request header (default 4096) --min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") --no-checksum Don't compare checksums on up/download + --no-cleanup Not to cleanup empty folder after object is deleted --no-modtime Don't read/write the modification time (can speed things up) --no-seek Don't allow seeking in files - --pass string Password for authentication --poll-interval Duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s) --read-only Only allow read-only access - --realm string Realm for authentication - --salt string Password hashing salt (default "dlPL2MqE") --server-read-timeout Duration Timeout for server reading data (default 1h0m0s) --server-write-timeout Duration Timeout for server writing data (default 1h0m0s) - --template string User-specified template --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) - --user string User name for authentication --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) @@ -9438,6 +9343,7 @@ Options --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -9475,268 +9381,506 @@ SEE ALSO - rclone serve - Serve a remote over a protocol. -rclone settier +rclone serve sftp -Changes storage class/tier of objects in remote. +Serve the remote over SFTP. Synopsis -rclone settier changes storage tier or class at remote if supported. Few -cloud storage services provides different storage classes on objects, -for example AWS S3 and Glacier, Azure Blob storage - Hot, Cool and -Archive, Google Cloud Storage, Regional Storage, Nearline, Coldline etc. - -Note that, certain tier changes make objects not available to access -immediately. For example tiering to archive in azure blob storage makes -objects in frozen state, user can restore by setting tier to Hot/Cool, -similarly S3 to Glacier makes object inaccessible.true +Run an SFTP server to serve a remote over SFTP. This can be used with an +SFTP client or you can make a remote of type sftp to use with it. -You can use it to tier single object +You can use the filter flags (e.g. --include, --exclude) to control what +is served. - rclone settier Cool remote:path/file +The server will respond to a small number of shell commands, mainly +md5sum, sha1sum and df, which enable it to provide support for checksums +and the about feature when accessed from an sftp remote. -Or use rclone filters to set tier on only specific files +Note that this server uses standard 32 KiB packet payload size, which +means you must not configure the client to expect anything else, e.g. +with the chunk_size option on an sftp remote. - rclone --include "*.txt" settier Hot remote:path/dir +The server will log errors. Use -v to see access logs. -Or just provide remote directory and all files in directory will be -tiered +--bwlimit will be respected for file transfers. Use --stats to control +the stats printing. - rclone settier tier remote:path/dir +You must provide some means of authentication, either with +--user/--pass, an authorized keys file (specify location with +--authorized-keys - the default is the same as ssh), an --auth-proxy, or +set the --no-auth flag for no authentication when logging in. - rclone settier tier remote:path [flags] +If you don't supply a host --key then rclone will generate rsa, ecdsa +and ed25519 variants, and cache them for later use in rclone's cache +directory (see rclone help flags cache-dir) in the "serve-sftp" +directory. -Options +By default the server binds to localhost:2022 - if you want it to be +reachable externally then supply --addr :2022 for example. - -h, --help help for settier +Note that the default of --vfs-cache-mode off is fine for the rclone +sftp backend, but it may not be with other SFTP clients. -See the global flags page for global options not listed here. +If --stdio is specified, rclone will serve SFTP over stdio, which can be +used with sshd via ~/.ssh/authorized_keys, for example: -SEE ALSO + restrict,command="rclone serve sftp --stdio ./photos" ssh-rsa ... -- rclone - Show help for rclone commands, flags and backends. +On the client you need to set --transfers 1 when using --stdio. +Otherwise multiple instances of the rclone server are started by OpenSSH +which can lead to "corrupted on transfer" errors. This is the case +because the client chooses indiscriminately which server to send +commands to while the servers all have different views of the state of +the filing system. -rclone test +The "restrict" in authorized_keys prevents SHA1SUMs and MD5SUMs from +being used. Omitting "restrict" and using --sftp-path-override to enable +checksumming is possible but less secure and you could use the SFTP +server provided by OpenSSH in this case. -Run a test command +VFS - Virtual File System -Synopsis +This command uses the VFS layer. This adapts the cloud storage objects +that rclone uses into something which looks much more like a disk filing +system. -Rclone test is used to run test commands. +Cloud storage objects have lots of properties which aren't like disk +files - you can't extend them or write to the middle of them, so the VFS +layer has to deal with that. Because there is no one right way of doing +this there are various options explained below. -Select which test command you want with the subcommand, eg +The VFS layer also implements a directory cache - this caches info about +files and directories (but not the data) in memory. - rclone test memory remote: +VFS Directory Cache -Each subcommand has its own options which you can see in their help. +Using the --dir-cache-time flag, you can control how long a directory +should be considered up to date and not refreshed from the backend. +Changes made through the VFS will appear immediately or invalidate the +cache. -NB Be careful running these commands, they may do strange things so -reading their documentation first is recommended. + --dir-cache-time duration Time to cache directory entries for (default 5m0s) + --poll-interval duration Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable (default 1m0s) -Options +However, changes made directly on the cloud storage by the web interface +or a different copy of rclone will only be picked up once the directory +cache expires if the backend configured does not support polling for +changes. If the backend supports polling, changes will be picked up +within the polling interval. - -h, --help help for test +You can send a SIGHUP signal to rclone for it to flush all directory +caches, regardless of how old they are. Assuming only one rclone +instance is running, you can reset the cache like this: -See the global flags page for global options not listed here. + kill -SIGHUP $(pidof rclone) -SEE ALSO +If you configure rclone with a remote control then you can use rclone rc +to flush the whole directory cache: -- rclone - Show help for rclone commands, flags and backends. -- rclone test changenotify - Log any change notify requests for the - remote passed in. -- rclone test histogram - Makes a histogram of file name characters. -- rclone test info - Discovers file name or other limitations for - paths. -- rclone test makefile - Make files with random contents of the size - given -- rclone test makefiles - Make a random file hierarchy in a directory -- rclone test memory - Load all the objects at remote:path into memory - and report memory stats. + rclone rc vfs/forget -rclone test changenotify +Or individual files or directories: -Log any change notify requests for the remote passed in. + rclone rc vfs/forget file=path/to/file dir=path/to/dir - rclone test changenotify remote: [flags] +VFS File Buffering -Options +The --buffer-size flag determines the amount of memory, that will be +used to buffer data in advance. - -h, --help help for changenotify - --poll-interval Duration Time to wait between polling for changes (default 10s) +Each open file will try to keep the specified amount of data in memory +at all times. The buffered data is bound to one open file and won't be +shared. -See the global flags page for global options not listed here. +This flag is a upper limit for the used memory per open file. The buffer +will only use memory for data that is downloaded but not not yet read. +If the buffer is empty, only a small amount of memory will be used. -SEE ALSO +The maximum memory used by rclone for buffering can be up to +--buffer-size * open files. -- rclone test - Run a test command +VFS File Caching -rclone test histogram +These flags control the VFS file caching options. File caching is +necessary to make the VFS layer appear compatible with a normal file +system. It can be disabled at the cost of some compatibility. -Makes a histogram of file name characters. +For example you'll need to enable VFS caching if you want to read and +write simultaneously to a file. See below for more details. -Synopsis +Note that the VFS cache is separate from the cache backend and you may +find that you need one or the other or both. -This command outputs JSON which shows the histogram of characters used -in filenames in the remote:path specified. + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) -The data doesn't contain any identifying information but is useful for -the rclone developers when developing filename compression. +If run with -vv rclone will print the location of the file cache. The +files are stored in the user cache file area which is OS dependent but +can be controlled with --cache-dir or setting the appropriate +environment variable. - rclone test histogram [remote:path] [flags] +The cache has 4 different modes selected by --vfs-cache-mode. The higher +the cache mode the more compatible rclone becomes at the cost of using +disk space. -Options +Note that files are written back to the remote only when they are closed +and if they haven't been accessed for --vfs-write-back seconds. If +rclone is quit or dies with files that haven't been uploaded, these will +be uploaded next time rclone is run with the same flags. - -h, --help help for histogram +If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the +cache may exceed these quotas for two reasons. Firstly because it is +only checked every --vfs-cache-poll-interval. Secondly because open +files cannot be evicted from the cache. When --vfs-cache-max-size or +--vfs-cache-min-free-size is exceeded, rclone will attempt to evict the +least accessed files from the cache first. rclone will start with files +that haven't been accessed for the longest. This cache flushing strategy +is efficient and more relevant files are likely to remain cached. -See the global flags page for global options not listed here. +The --vfs-cache-max-age will evict files from the cache after the set +time since last access has passed. The default value of 1 hour will +start evicting files from cache that haven't been accessed for 1 hour. +When a cached file is accessed the 1 hour timer is reset to 0 and will +wait for 1 more hour before evicting. Specify the time with standard +notation, s, m, h, d, w . -SEE ALSO +You should not run two copies of rclone using the same VFS cache with +the same or overlapping remotes if using --vfs-cache-mode > off. This +can potentially cause data corruption if you do. You can work around +this by giving each rclone its own cache hierarchy with --cache-dir. You +don't need to worry about this if the remotes in use don't overlap. -- rclone test - Run a test command +--vfs-cache-mode off -rclone test info +In this mode (the default) the cache will read directly from the remote +and write directly to the remote without caching anything on disk. -Discovers file name or other limitations for paths. +This will mean some operations are not possible -Synopsis +- Files can't be opened for both read AND write +- Files opened for write can't be seeked +- Existing files opened for write must have O_TRUNC set +- Files open for read with O_TRUNC will be opened write only +- Files open for write only will behave as if O_TRUNC was supplied +- Open modes O_APPEND, O_TRUNC are ignored +- If an upload fails it can't be retried -rclone info discovers what filenames and upload methods are possible to -write to the paths passed in and how long they can be. It can take some -time. It will write test files into the remote:path passed in. It -outputs a bit of go code for each one. +--vfs-cache-mode minimal -NB this can create undeletable files and other hazards - use with care +This is very similar to "off" except that files opened for read AND +write will be buffered to disk. This means that files opened for write +will be a lot more compatible, but uses the minimal disk space. - rclone test info [remote:path]+ [flags] +These operations are not possible -Options +- Files opened for write only can't be seeked +- Existing files opened for write must have O_TRUNC set +- Files opened for write only will ignore O_APPEND, O_TRUNC +- If an upload fails it can't be retried - --all Run all tests - --check-base32768 Check can store all possible base32768 characters - --check-control Check control characters - --check-length Check max filename length - --check-normalization Check UTF-8 Normalization - --check-streaming Check uploads with indeterminate file size - -h, --help help for info - --upload-wait Duration Wait after writing a file (default 0s) - --write-json string Write results to file +--vfs-cache-mode writes -See the global flags page for global options not listed here. +In this mode files opened for read only are still read directly from the +remote, write only and read/write files are buffered to disk first. -SEE ALSO +This mode should support all normal file system operations. -- rclone test - Run a test command +If an upload fails it will be retried at exponentially increasing +intervals up to 1 minute. -rclone test makefile +--vfs-cache-mode full -Make files with random contents of the size given +In this mode all reads and writes are buffered to and from disk. When +data is read from the remote this is buffered to disk as well. - rclone test makefile []+ [flags] +In this mode the files in the cache will be sparse files and rclone will +keep track of which bits of the files it has downloaded. -Options +So if an application only reads the starts of each file, then rclone +will only buffer the start of the file. These files will appear to be +their full size in the cache, but they will be sparse files with only +the data that has been downloaded present in them. - --ascii Fill files with random ASCII printable bytes only - --chargen Fill files with a ASCII chargen pattern - -h, --help help for makefile - --pattern Fill files with a periodic pattern - --seed int Seed for the random number generator (0 for random) (default 1) - --sparse Make the files sparse (appear to be filled with ASCII 0x00) - --zero Fill files with ASCII 0x00 +This mode should support all normal file system operations and is +otherwise identical to --vfs-cache-mode writes. -See the global flags page for global options not listed here. +When reading a file rclone will read --buffer-size plus --vfs-read-ahead +bytes ahead. The --buffer-size is buffered in memory whereas the +--vfs-read-ahead is buffered on disk. -SEE ALSO +When using this mode it is recommended that --buffer-size is not set too +large and --vfs-read-ahead is set large if required. -- rclone test - Run a test command +IMPORTANT not all file systems support sparse files. In particular +FAT/exFAT do not. Rclone will perform very badly if the cache directory +is on a filesystem which doesn't support sparse files and it will log an +ERROR message if one is detected. -rclone test makefiles +Fingerprinting -Make a random file hierarchy in a directory +Various parts of the VFS use fingerprinting to see if a local file copy +has changed relative to a remote file. Fingerprints are made from: - rclone test makefiles [flags] +- size +- modification time +- hash -Options +where available on an object. - --ascii Fill files with random ASCII printable bytes only - --chargen Fill files with a ASCII chargen pattern - --files int Number of files to create (default 1000) - --files-per-directory int Average number of files per directory (default 10) - -h, --help help for makefiles - --max-depth int Maximum depth of directory hierarchy (default 10) - --max-file-size SizeSuffix Maximum size of files to create (default 100) - --max-name-length int Maximum size of file names (default 12) - --min-file-size SizeSuffix Minimum size of file to create - --min-name-length int Minimum size of file names (default 4) - --pattern Fill files with a periodic pattern - --seed int Seed for the random number generator (0 for random) (default 1) - --sparse Make the files sparse (appear to be filled with ASCII 0x00) - --zero Fill files with ASCII 0x00 +On some backends some of these attributes are slow to read (they take an +extra API call per object, or extra work per object). -See the global flags page for global options not listed here. +For example hash is slow with the local and sftp backends as they have +to read the entire file and hash it, and modtime is slow with the s3, +swift, ftp and qinqstor backends because they need to do an extra API +call to fetch it. -SEE ALSO +If you use the --vfs-fast-fingerprint flag then rclone will not include +the slow operations in the fingerprint. This makes the fingerprinting +less accurate but much faster and will improve the opening time of +cached files. -- rclone test - Run a test command +If you are running a vfs cache over local, s3 or swift backends then +using this flag is recommended. -rclone test memory +Note that if you change the value of this flag, the fingerprints of the +files in the cache may be invalidated and the files will need to be +downloaded again. -Load all the objects at remote:path into memory and report memory stats. +VFS Chunked Reading - rclone test memory remote:path [flags] +When rclone reads files from a remote it reads them in chunks. This +means that rather than requesting the whole file rclone reads the chunk +specified. This can reduce the used download quota for some remotes by +requesting only chunks from the remote that are actually read, at the +cost of an increased number of requests. -Options +These flags control the chunking: - -h, --help help for memory + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128M) + --vfs-read-chunk-size-limit SizeSuffix Max chunk doubling size (default off) -See the global flags page for global options not listed here. +Rclone will start reading a chunk of size --vfs-read-chunk-size, and +then double the size for each read. When --vfs-read-chunk-size-limit is +specified, and greater than --vfs-read-chunk-size, the chunk size for +each open file will get doubled only until the specified value is +reached. If the value is "off", which is the default, the limit is +disabled and the chunk size will grow indefinitely. -SEE ALSO +With --vfs-read-chunk-size 100M and --vfs-read-chunk-size-limit 0 the +following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, +300M-400M and so on. When --vfs-read-chunk-size-limit 500M is specified, +the result would be 0-100M, 100M-300M, 300M-700M, 700M-1200M, +1200M-1700M and so on. -- rclone test - Run a test command +Setting --vfs-read-chunk-size to 0 or "off" disables chunked reading. -rclone touch +VFS Performance -Create new file or change file modification time. +These flags may be used to enable/disable features of the VFS for +performance or other reasons. See also the chunked reading feature. -Synopsis +In particular S3 and Swift benefit hugely from the --no-modtime flag (or +use --use-server-modtime for a slightly different effect) as each read +of the modification time takes a transaction. -Set the modification time on file(s) as specified by remote:path to have -the current time. + --no-checksum Don't compare checksums on up/download. + --no-modtime Don't read/write the modification time (can speed things up). + --no-seek Don't allow seeking in files. + --read-only Only allow read-only access. -If remote:path does not exist then a zero sized file will be created, -unless --no-create or --recursive is provided. +Sometimes rclone is delivered reads or writes out of order. Rather than +seeking rclone will wait a short time for the in sequence read or write +to come in. These flags only come into effect when not using an on disk +cache file. -If --recursive is used then recursively sets the modification time on -all existing files that is found under the path. Filters are supported, -and you can test with the --dry-run or the --interactive/-i flag. + --vfs-read-wait duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-write-wait duration Time to wait for in-sequence write before giving error (default 1s) -If --timestamp is used then sets the modification time to that time -instead of the current time. Times may be specified as one of: +When using VFS write caching (--vfs-cache-mode with value writes or +full), the global flag --transfers can be set to adjust the number of +parallel uploads of modified files from the cache (the related global +flag --checkers has no effect on the VFS). -- 'YYMMDD' - e.g. 17.10.30 -- 'YYYY-MM-DDTHH:MM:SS' - e.g. 2006-01-02T15:04:05 -- 'YYYY-MM-DDTHH:MM:SS.SSS' - e.g. 2006-01-02T15:04:05.123456789 + --transfers int Number of file transfers to run in parallel (default 4) -Note that value of --timestamp is in UTC. If you want local time then -add the --localtime flag. +VFS Case Sensitivity - rclone touch remote:path [flags] +Linux file systems are case-sensitive: two files can differ only by +case, and the exact case must be used when opening a file. -Options +File systems in modern Windows are case-insensitive but case-preserving: +although existing files can be opened using any case, the exact case +used to create the file is preserved and available for programs to +query. It is not allowed for two files in the same directory to differ +only by case. - -h, --help help for touch - --localtime Use localtime for timestamp, not UTC - -C, --no-create Do not create the file if it does not exist (implied with --recursive) - -R, --recursive Recursively touch all files - -t, --timestamp string Use specified time instead of the current time of day +Usually file systems on macOS are case-insensitive. It is possible to +make macOS file systems case-sensitive but that is not the default. -Important Options +The --vfs-case-insensitive VFS flag controls how rclone handles these +two cases. If its value is "false", rclone passes file names to the +remote as-is. If the flag is "true" (or appears without a value on the +command line), rclone may perform a "fixup" as explained below. -Important flags useful for most commands. +The user may specify a file name to open/delete/rename/etc with a case +different than what is stored on the remote. If an argument refers to an +existing file with exactly the same name, then the case of the existing +file on the disk will be used. However, if a file name with exactly the +same name is not found but a name differing only by case exists, rclone +will transparently fixup the name. This fixup happens only when an +existing file is requested. Case sensitivity of file names created anew +by rclone is controlled by the underlying remote. - -n, --dry-run Do a trial run with no permanent changes - -i, --interactive Enable interactive mode - -v, --verbose count Print lots more stuff (repeat for more) +Note that case sensitivity of the operating system running rclone (the +target) may differ from case sensitivity of a file system presented by +rclone (the source). The flag controls whether "fixup" is performed to +satisfy the target. + +If the flag is not provided on the command line, then its default value +depends on the operating system where rclone runs: "true" on Windows and +macOS, "false" otherwise. If the flag is provided without a value, then +it is "true". + +VFS Disk Options + +This flag allows you to manually set the statistics about the filing +system. It can be useful when those statistics cannot be read correctly +automatically. + + --vfs-disk-space-total-size Manually set the total disk space size (example: 256G, default: -1) + +Alternate report of used bytes + +Some backends, most notably S3, do not report the amount of bytes used. +If you need this information to be available when running df on the +filesystem, then pass the flag --vfs-used-is-size to rclone. With this +flag set, instead of relying on the backend to report this information, +rclone will scan the whole remote similar to rclone size and compute the +total used space itself. + +WARNING. Contrary to rclone size, this flag ignores filters so that the +result is accurate. However, this is very inefficient and may cost lots +of API calls resulting in extra charges. Use it as a last resort and +only with caching. + +Auth Proxy + +If you supply the parameter --auth-proxy /path/to/program then rclone +will use that program to generate backends on the fly which then are +used to authenticate incoming requests. This uses a simple JSON based +protocol with input on STDIN and output on STDOUT. + +PLEASE NOTE: --auth-proxy and --authorized-keys cannot be used together, +if --auth-proxy is set the authorized keys option will be ignored. + +There is an example program bin/test_proxy.py in the rclone source code. + +The program's job is to take a user and pass on the input and turn those +into the config for a backend on STDOUT in JSON format. This config will +have any default parameters for the backend added, but it won't use +configuration from environment variables or command line options - it is +the job of the proxy program to make a complete config. + +This config generated must have this extra parameter - _root - root to +use for the backend + +And it may have this parameter - _obscure - comma separated strings for +parameters to obscure + +If password authentication was used by the client, input to the proxy +process (on STDIN) would look similar to this: + + { + "user": "me", + "pass": "mypassword" + } + +If public-key authentication was used by the client, input to the proxy +process (on STDIN) would look similar to this: + + { + "user": "me", + "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDuwESFdAe14hVS6omeyX7edc...JQdf" + } + +And as an example return this on STDOUT + + { + "type": "sftp", + "_root": "", + "_obscure": "pass", + "user": "me", + "pass": "mypassword", + "host": "sftp.example.com" + } + +This would mean that an SFTP backend would be created on the fly for the +user and pass/public_key returned in the output to the host given. Note +that since _obscure is set to pass, rclone will obscure the pass +parameter before creating the backend (which is required for sftp +backends). + +The program can manipulate the supplied user in any way, for example to +make proxy to many different sftp backends, you could make the user be +user@example.com and then set the host to example.com in the output and +the user to user. For security you'd probably want to restrict the host +to a limited list. + +Note that an internal cache is keyed on user so only use that for +configuration, don't use pass or public_key. This also means that if a +user's password or public-key is changed the cache will need to expire +(which takes 5 mins) before it takes effect. + +This can be used to build general purpose proxies to any kind of backend +that rclone supports. + + rclone serve sftp remote:path [flags] + +Options + + --addr string IPaddress:Port or :Port to bind server to (default "localhost:2022") + --auth-proxy string A program to use to create the backend from the auth + --authorized-keys string Authorized keys file (default "~/.ssh/authorized_keys") + --dir-cache-time Duration Time to cache directory entries for (default 5m0s) + --dir-perms FileMode Directory permissions (default 0777) + --file-perms FileMode File permissions (default 0666) + --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) + -h, --help help for sftp + --key stringArray SSH private host key file (Can be multi-valued, leave blank to auto generate) + --no-auth Allow connections with no authentication if set + --no-checksum Don't compare checksums on up/download + --no-modtime Don't read/write the modification time (can speed things up) + --no-seek Don't allow seeking in files + --pass string Password for authentication + --poll-interval Duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s) + --read-only Only allow read-only access + --stdio Run an sftp server on stdin/stdout + --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) + --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) + --user string User name for authentication + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-case-insensitive If a file name not found, find a case insensitive match + --vfs-disk-space-total-size SizeSuffix Specify the total space of disk (default off) + --vfs-fast-fingerprint Use fast (less accurate) fingerprints for change detection + --vfs-read-ahead SizeSuffix Extra read ahead over --buffer-size when using cache-mode full + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) + --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) + --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start + --vfs-used-is-size rclone size Use the rclone size algorithm for Used size + --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) + --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) Filter Options @@ -9765,16529 +9909,18246 @@ Flags for filtering directory listings. --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) -Listing Options - -Flags for listing directories. - - --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) - --fast-list Use recursive list if available; uses more memory but fewer transactions - See the global flags page for global options not listed here. SEE ALSO -- rclone - Show help for rclone commands, flags and backends. +- rclone serve - Serve a remote over a protocol. -rclone tree +rclone serve webdav -List the contents of the remote in a tree like fashion. +Serve remote:path over WebDAV. Synopsis -rclone tree lists the contents of a remote in a similar way to the unix -tree command. +Run a basic WebDAV server to serve a remote over HTTP via the WebDAV +protocol. This can be viewed with a WebDAV client, through a web +browser, or you can make a remote of type WebDAV to read and write it. -For example +WebDAV options - $ rclone tree remote:path - / - ├── file1 - ├── file2 - ├── file3 - └── subdir - ├── file4 - └── file5 - - 1 directories, 5 files - -You can use any of the filtering options with the tree command (e.g. ---include and --exclude. You can also use --fast-list. +--etag-hash -The tree command has many options for controlling the listing which are -compatible with the tree command, for example you can include file sizes -with --size. Note that not all of them have short options as they -conflict with rclone's short options. +This controls the ETag header. Without this flag the ETag will be based +on the ModTime and Size of the object. -For a more interactive navigation of the remote see the ncdu command. +If this flag is set to "auto" then rclone will choose the first +supported hash on the backend or you can use a named hash such as "MD5" +or "SHA-1". Use the hashsum command to see the full list. - rclone tree remote:path [flags] +Access WebDAV on Windows -Options +WebDAV shared folder can be mapped as a drive on Windows, however the +default settings prevent it. Windows will fail to connect to the server +using insecure Basic authentication. It will not even display any login +dialog. Windows requires SSL / HTTPS connection to be used with Basic. +If you try to connect via Add Network Location Wizard you will get the +following error: "The folder you entered does not appear to be valid. +Please choose another". However, you still can connect if you set the +following registry key on a client machine: HKEY_LOCAL_MACHINEto 2. The +BasicAuthLevel can be set to the following values: 0 - Basic +authentication disabled 1 - Basic authentication enabled for SSL +connections only 2 - Basic authentication enabled for SSL connections +and for non-SSL connections If required, increase the +FileSizeLimitInBytes to a higher value. Navigate to the Services +interface, then restart the WebClient service. - -a, --all All files are listed (list . files too) - -d, --dirs-only List directories only - --dirsfirst List directories before files (-U disables) - --full-path Print the full path prefix for each file - -h, --help help for tree - --level int Descend only level directories deep - -D, --modtime Print the date of last modification. - --noindent Don't print indentation lines - --noreport Turn off file/directory count at end of tree listing - -o, --output string Output to file instead of stdout - -p, --protections Print the protections for each file. - -Q, --quote Quote filenames with double quotes. - -s, --size Print the size in bytes of each file. - --sort string Select sort: name,version,size,mtime,ctime - --sort-ctime Sort files by last status change time - -t, --sort-modtime Sort files by last modification time - -r, --sort-reverse Reverse the order of the sort - -U, --unsorted Leave files unsorted - --version Sort files alphanumerically by version +Access Office applications on WebDAV -Filter Options +Navigate to following registry HKEY_CURRENT_USER[14.0/15.0/16.0] Create +a new DWORD BasicAuthLevel with value 2. 0 - Basic authentication +disabled 1 - Basic authentication enabled for SSL connections only 2 - +Basic authentication enabled for SSL and for non-SSL connections -Flags for filtering directory listings. +https://learn.microsoft.com/en-us/office/troubleshoot/powerpoint/office-opens-blank-from-sharepoint - --delete-excluded Delete files on dest excluded from sync - --exclude stringArray Exclude files matching pattern - --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) - --exclude-if-present stringArray Exclude directories if filename is present - --files-from stringArray Read list of source-file names from file (use - to read from stdin) - --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) - -f, --filter stringArray Add a file filtering rule - --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) - --ignore-case Ignore case in filters (case insensitive) - --include stringArray Include files matching pattern - --include-from stringArray Read file include patterns from file (use - to read from stdin) - --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) - --max-depth int If set limits the recursion depth to this (default -1) - --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) - --metadata-exclude stringArray Exclude metadatas matching pattern - --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) - --metadata-filter stringArray Add a metadata filtering rule - --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) - --metadata-include stringArray Include metadatas matching pattern - --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) - --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) - --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +Server options -Listing Options +Use --addr to specify which IP address and port the server should listen +on, eg --addr 1.2.3.4:8000 or --addr :8080 to listen to all IPs. By +default it only listens on localhost. You can use port :0 to let the OS +choose an available port. -Flags for listing directories. +If you set --addr to listen on a public or LAN accessible IP address +then using Authentication is advised - see the next section for info. - --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) - --fast-list Use recursive list if available; uses more memory but fewer transactions +You can use a unix socket by setting the url to unix:///path/to/socket +or just by using an absolute path name. Note that unix sockets bypass +the authentication - this is expected to be done with file system +permissions. -See the global flags page for global options not listed here. +--addr may be repeated to listen on multiple IPs/ports/sockets. -SEE ALSO +--server-read-timeout and --server-write-timeout can be used to control +the timeouts on the server. Note that this is the total time for a +transfer. -- rclone - Show help for rclone commands, flags and backends. +--max-header-bytes controls the maximum number of bytes the server will +accept in the HTTP header. -Copying single files +--baseurl controls the URL prefix that rclone serves from. By default +rclone will serve from the root. If you used --baseurl "/rclone" then +rclone would serve from a URL starting with "/rclone/". This is useful +if you wish to proxy rclone serve. Rclone automatically inserts leading +and trailing "/" on --baseurl, so --baseurl "rclone", +--baseurl "/rclone" and --baseurl "/rclone/" are all treated +identically. -rclone normally syncs or copies directories. However, if the source -remote points to a file, rclone will just copy that file. The -destination remote must point to a directory - rclone will give the -error -Failed to create file system for "remote:file": is a file not a directory -if it isn't. +TLS (SSL) -For example, suppose you have a remote with a file in called test.jpg, -then you could copy just that file like this +By default this will serve over http. If you want you can serve over +https. You will need to supply the --cert and --key flags. If you wish +to do client side certificate validation then you will need to supply +--client-ca also. - rclone copy remote:test.jpg /tmp/download +--cert should be a either a PEM encoded certificate or a concatenation +of that with the CA certificate. --key should be the PEM encoded private +key and --client-ca should be the PEM encoded client certificate +authority certificate. -The file test.jpg will be placed inside /tmp/download. +--min-tls-version is minimum TLS version that is acceptable. Valid +values are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default "tls1.0"). -This is equivalent to specifying +Template - rclone copy --files-from /tmp/files remote: /tmp/download +--template allows a user to specify a custom markup template for HTTP +and WebDAV serve functions. The server exports the following markup to +be used within the template to server pages: -Where /tmp/files contains the single line + ----------------------------------------------------------------------- + Parameter Description + ----------------------------------- ----------------------------------- + .Name The full path of a file/directory. - test.jpg + .Title Directory listing of .Name -It is recommended to use copy when copying individual files, not sync. -They have pretty much the same effect but copy will use a lot less -memory. + .Sort The current sort used. This is + changeable via ?sort= parameter -Syntax of remote paths + Sort Options: + namedirfirst,name,size,time + (default namedirfirst) -The syntax of the paths passed to the rclone command are as follows. + .Order The current ordering used. This is + changeable via ?order= parameter -/path/to/dir + Order Options: asc,desc (default + asc) -This refers to the local file system. + .Query Currently unused. -On Windows \ may be used instead of / in local paths only, non local -paths must use /. See local filesystem documentation for more about -Windows-specific paths. + .Breadcrumb Allows for creating a relative + navigation -These paths needn't start with a leading / - if they don't then they -will be relative to the current directory. + -- .Link The relative to the root link of + the Text. -remote:path/to/dir + -- .Text The Name of the directory. -This refers to a directory path/to/dir on remote: as defined in the -config file (configured with rclone config). + .Entries Information about a specific + file/directory. -remote:/path/to/dir + -- .URL The 'url' of an entry. -On most backends this is refers to the same directory as -remote:path/to/dir and that format should be preferred. On a very small -number of remotes (FTP, SFTP, Dropbox for business) this will refer to a -different directory. On these, paths without a leading / will refer to -your "home" directory and paths with a leading / will refer to the root. + -- .Leaf Currently same as 'URL' but + intended to be 'just' the name. -:backend:path/to/dir + -- .IsDir Boolean for if an entry is a + directory or not. -This is an advanced form for creating remotes on the fly. backend should -be the name or prefix of a backend (the type in the config file) and all -the configuration for the backend should be provided on the command line -(or in environment variables). + -- .Size Size in Bytes of the entry. -Here are some examples: + -- .ModTime The UTC timestamp of an entry. + ----------------------------------------------------------------------- - rclone lsd --http-url https://pub.rclone.org :http: +The server also makes the following functions available so that they can +be used within the template. These functions help extend the options for +dynamic rendering of HTML. They can be used to render HTML based on +specific conditions. -To list all the directories in the root of https://pub.rclone.org/. + ----------------------------------------------------------------------- + Function Description + ----------------------------------- ----------------------------------- + afterEpoch Returns the time since the epoch + for the given time. - rclone lsf --http-url https://example.com :http:path/to/dir + contains Checks whether a given substring is + present or not in a given string. -To list files and directories in https://example.com/path/to/dir/ + hasPrefix Checks whether the given string + begins with the specified prefix. - rclone copy --http-url https://example.com :http:path/to/dir /tmp/dir + hasSuffix Checks whether the given string end + with the specified suffix. + ----------------------------------------------------------------------- -To copy files and directories in https://example.com/path/to/dir to -/tmp/dir. +Authentication - rclone copy --sftp-host example.com :sftp:path/to/dir /tmp/dir +By default this will serve files without needing a login. -To copy files and directories from example.com in the relative directory -path/to/dir to /tmp/dir using sftp. +You can either use an htpasswd file which can take lots of users, or set +a single username and password with the --user and --pass flags. -Connection strings +If no static users are configured by either of the above methods, and +client certificates are required by the --client-ca flag passed to the +server, the client certificate common name will be considered as the +username. -The above examples can also be written using a connection string syntax, -so instead of providing the arguments as command line parameters ---http-url https://pub.rclone.org they are provided as part of the -remote specification as a kind of connection string. +Use --htpasswd /path/to/htpasswd to provide an htpasswd file. This is in +standard apache format and supports MD5, SHA1 and BCrypt for basic +authentication. Bcrypt is recommended. - rclone lsd ":http,url='https://pub.rclone.org':" - rclone lsf ":http,url='https://example.com':path/to/dir" - rclone copy ":http,url='https://example.com':path/to/dir" /tmp/dir - rclone copy :sftp,host=example.com:path/to/dir /tmp/dir +To create an htpasswd file: -These can apply to modify existing remotes as well as create new remotes -with the on the fly syntax. This example is equivalent to adding the ---drive-shared-with-me parameter to the remote gdrive:. + touch htpasswd + htpasswd -B htpasswd user + htpasswd -B htpasswd anotherUser - rclone lsf "gdrive,shared_with_me:path/to/dir" +The password file can be updated while rclone is running. -The major advantage to using the connection string style syntax is that -it only applies to the remote, not to all the remotes of that type of -the command line. A common confusion is this attempt to copy a file -shared on google drive to the normal drive which does not work because -the --drive-shared-with-me flag applies to both the source and the -destination. +Use --realm to set the authentication realm. - rclone copy --drive-shared-with-me gdrive:shared-file.txt gdrive: +Use --salt to change the password hashing salt from the default. ## VFS +- Virtual File System -However using the connection string syntax, this does work. +This command uses the VFS layer. This adapts the cloud storage objects +that rclone uses into something which looks much more like a disk filing +system. - rclone copy "gdrive,shared_with_me:shared-file.txt" gdrive: +Cloud storage objects have lots of properties which aren't like disk +files - you can't extend them or write to the middle of them, so the VFS +layer has to deal with that. Because there is no one right way of doing +this there are various options explained below. -Note that the connection string only affects the options of the -immediate backend. If for example gdriveCrypt is a crypt based on -gdrive, then the following command will not work as intended, because -shared_with_me is ignored by the crypt backend: +The VFS layer also implements a directory cache - this caches info about +files and directories (but not the data) in memory. - rclone copy "gdriveCrypt,shared_with_me:shared-file.txt" gdriveCrypt: +VFS Directory Cache -The connection strings have the following syntax +Using the --dir-cache-time flag, you can control how long a directory +should be considered up to date and not refreshed from the backend. +Changes made through the VFS will appear immediately or invalidate the +cache. - remote,parameter=value,parameter2=value2:path/to/dir - :backend,parameter=value,parameter2=value2:path/to/dir + --dir-cache-time duration Time to cache directory entries for (default 5m0s) + --poll-interval duration Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable (default 1m0s) -If the parameter has a : or , then it must be placed in quotes " or ', -so +However, changes made directly on the cloud storage by the web interface +or a different copy of rclone will only be picked up once the directory +cache expires if the backend configured does not support polling for +changes. If the backend supports polling, changes will be picked up +within the polling interval. - remote,parameter="colon:value",parameter2="comma,value":path/to/dir - :backend,parameter='colon:value',parameter2='comma,value':path/to/dir +You can send a SIGHUP signal to rclone for it to flush all directory +caches, regardless of how old they are. Assuming only one rclone +instance is running, you can reset the cache like this: -If a quoted value needs to include that quote, then it should be -doubled, so + kill -SIGHUP $(pidof rclone) - remote,parameter="with""quote",parameter2='with''quote':path/to/dir +If you configure rclone with a remote control then you can use rclone rc +to flush the whole directory cache: -This will make parameter be with"quote and parameter2 be with'quote. + rclone rc vfs/forget -If you leave off the =parameter then rclone will substitute =true which -works very well with flags. For example, to use s3 configured in the -environment you could use: +Or individual files or directories: - rclone lsd :s3,env_auth: + rclone rc vfs/forget file=path/to/file dir=path/to/dir -Which is equivalent to +VFS File Buffering - rclone lsd :s3,env_auth=true: +The --buffer-size flag determines the amount of memory, that will be +used to buffer data in advance. -Note that on the command line you might need to surround these -connection strings with " or ' to stop the shell interpreting any -special characters within them. +Each open file will try to keep the specified amount of data in memory +at all times. The buffered data is bound to one open file and won't be +shared. -If you are a shell master then you'll know which strings are OK and -which aren't, but if you aren't sure then enclose them in " and use ' as -the inside quote. This syntax works on all OSes. +This flag is a upper limit for the used memory per open file. The buffer +will only use memory for data that is downloaded but not not yet read. +If the buffer is empty, only a small amount of memory will be used. - rclone copy ":http,url='https://example.com':path/to/dir" /tmp/dir +The maximum memory used by rclone for buffering can be up to +--buffer-size * open files. -On Linux/macOS some characters are still interpreted inside " strings in -the shell (notably \ and $ and ") so if your strings contain those you -can swap the roles of " and ' thus. (This syntax does not work on -Windows.) +VFS File Caching - rclone copy ':http,url="https://example.com":path/to/dir' /tmp/dir +These flags control the VFS file caching options. File caching is +necessary to make the VFS layer appear compatible with a normal file +system. It can be disabled at the cost of some compatibility. -Connection strings, config and logging +For example you'll need to enable VFS caching if you want to read and +write simultaneously to a file. See below for more details. -If you supply extra configuration to a backend by command line flag, -environment variable or connection string then rclone will add a suffix -based on the hash of the config to the name of the remote, eg +Note that the VFS cache is separate from the cache backend and you may +find that you need one or the other or both. - rclone -vv lsf --s3-chunk-size 20M s3: + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) -Has the log message +If run with -vv rclone will print the location of the file cache. The +files are stored in the user cache file area which is OS dependent but +can be controlled with --cache-dir or setting the appropriate +environment variable. - DEBUG : s3: detected overridden config - adding "{Srj1p}" suffix to name +The cache has 4 different modes selected by --vfs-cache-mode. The higher +the cache mode the more compatible rclone becomes at the cost of using +disk space. -This is so rclone can tell the modified remote apart from the unmodified -remote when caching the backends. +Note that files are written back to the remote only when they are closed +and if they haven't been accessed for --vfs-write-back seconds. If +rclone is quit or dies with files that haven't been uploaded, these will +be uploaded next time rclone is run with the same flags. -This should only be noticeable in the logs. +If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the +cache may exceed these quotas for two reasons. Firstly because it is +only checked every --vfs-cache-poll-interval. Secondly because open +files cannot be evicted from the cache. When --vfs-cache-max-size or +--vfs-cache-min-free-size is exceeded, rclone will attempt to evict the +least accessed files from the cache first. rclone will start with files +that haven't been accessed for the longest. This cache flushing strategy +is efficient and more relevant files are likely to remain cached. -This means that on the fly backends such as +The --vfs-cache-max-age will evict files from the cache after the set +time since last access has passed. The default value of 1 hour will +start evicting files from cache that haven't been accessed for 1 hour. +When a cached file is accessed the 1 hour timer is reset to 0 and will +wait for 1 more hour before evicting. Specify the time with standard +notation, s, m, h, d, w . - rclone -vv lsf :s3,env_auth: +You should not run two copies of rclone using the same VFS cache with +the same or overlapping remotes if using --vfs-cache-mode > off. This +can potentially cause data corruption if you do. You can work around +this by giving each rclone its own cache hierarchy with --cache-dir. You +don't need to worry about this if the remotes in use don't overlap. -Will get their own names +--vfs-cache-mode off - DEBUG : :s3: detected overridden config - adding "{YTu53}" suffix to name +In this mode (the default) the cache will read directly from the remote +and write directly to the remote without caching anything on disk. -Valid remote names +This will mean some operations are not possible -Remote names are case sensitive, and must adhere to the following rules: -- May contain number, letter, _, -, ., +, @ and space. - May not start -with - or space. - May not end with space. +- Files can't be opened for both read AND write +- Files opened for write can't be seeked +- Existing files opened for write must have O_TRUNC set +- Files open for read with O_TRUNC will be opened write only +- Files open for write only will behave as if O_TRUNC was supplied +- Open modes O_APPEND, O_TRUNC are ignored +- If an upload fails it can't be retried -Starting with rclone version 1.61, any Unicode numbers and letters are -allowed, while in older versions it was limited to plain ASCII (0-9, -A-Z, a-z). If you use the same rclone configuration from different -shells, which may be configured with different character encoding, you -must be cautious to use characters that are possible to write in all of -them. This is mostly a problem on Windows, where the console -traditionally uses a non-Unicode character set - defined by the -so-called "code page". +--vfs-cache-mode minimal -Do not use single character names on Windows as it creates ambiguity -with Windows drives' names, e.g.: remote called C is indistinguishable -from C drive. Rclone will always assume that single letter name refers -to a drive. +This is very similar to "off" except that files opened for read AND +write will be buffered to disk. This means that files opened for write +will be a lot more compatible, but uses the minimal disk space. -Quoting and the shell +These operations are not possible -When you are typing commands to your computer you are using something -called the command line shell. This interprets various characters in an -OS specific way. +- Files opened for write only can't be seeked +- Existing files opened for write must have O_TRUNC set +- Files opened for write only will ignore O_APPEND, O_TRUNC +- If an upload fails it can't be retried -Here are some gotchas which may help users unfamiliar with the shell -rules +--vfs-cache-mode writes -Linux / OSX +In this mode files opened for read only are still read directly from the +remote, write only and read/write files are buffered to disk first. -If your names have spaces or shell metacharacters (e.g. *, ?, $, ', ", -etc.) then you must quote them. Use single quotes ' by default. +This mode should support all normal file system operations. - rclone copy 'Important files?' remote:backup +If an upload fails it will be retried at exponentially increasing +intervals up to 1 minute. -If you want to send a ' you will need to use ", e.g. +--vfs-cache-mode full - rclone copy "O'Reilly Reviews" remote:backup +In this mode all reads and writes are buffered to and from disk. When +data is read from the remote this is buffered to disk as well. -The rules for quoting metacharacters are complicated and if you want the -full details you'll have to consult the manual page for your shell. +In this mode the files in the cache will be sparse files and rclone will +keep track of which bits of the files it has downloaded. -Windows +So if an application only reads the starts of each file, then rclone +will only buffer the start of the file. These files will appear to be +their full size in the cache, but they will be sparse files with only +the data that has been downloaded present in them. -If your names have spaces in you need to put them in ", e.g. +This mode should support all normal file system operations and is +otherwise identical to --vfs-cache-mode writes. - rclone copy "E:\folder name\folder name\folder name" remote:backup +When reading a file rclone will read --buffer-size plus --vfs-read-ahead +bytes ahead. The --buffer-size is buffered in memory whereas the +--vfs-read-ahead is buffered on disk. -If you are using the root directory on its own then don't quote it (see -#464 for why), e.g. +When using this mode it is recommended that --buffer-size is not set too +large and --vfs-read-ahead is set large if required. - rclone copy E:\ remote:backup +IMPORTANT not all file systems support sparse files. In particular +FAT/exFAT do not. Rclone will perform very badly if the cache directory +is on a filesystem which doesn't support sparse files and it will log an +ERROR message if one is detected. -Copying files or directories with : in the names +Fingerprinting -rclone uses : to mark a remote name. This is, however, a valid filename -component in non-Windows OSes. The remote name parser will only search -for a : up to the first / so if you need to act on a file or directory -like this then use the full path starting with a /, or use ./ as a -current directory prefix. +Various parts of the VFS use fingerprinting to see if a local file copy +has changed relative to a remote file. Fingerprints are made from: -So to sync a directory called sync:me to a remote called remote: use +- size +- modification time +- hash - rclone sync --interactive ./sync:me remote:path +where available on an object. -or +On some backends some of these attributes are slow to read (they take an +extra API call per object, or extra work per object). - rclone sync --interactive /full/path/to/sync:me remote:path +For example hash is slow with the local and sftp backends as they have +to read the entire file and hash it, and modtime is slow with the s3, +swift, ftp and qinqstor backends because they need to do an extra API +call to fetch it. -Server Side Copy +If you use the --vfs-fast-fingerprint flag then rclone will not include +the slow operations in the fingerprint. This makes the fingerprinting +less accurate but much faster and will improve the opening time of +cached files. -Most remotes (but not all - see the overview) support server-side copy. +If you are running a vfs cache over local, s3 or swift backends then +using this flag is recommended. -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. +Note that if you change the value of this flag, the fingerprints of the +files in the cache may be invalidated and the files will need to be +downloaded again. -Eg +VFS Chunked Reading - rclone copy s3:oldbucket s3:newbucket - -Will copy the contents of oldbucket to newbucket without downloading and -re-uploading. - -Remotes which don't support server-side copy will download and re-upload -in this case. +When rclone reads files from a remote it reads them in chunks. This +means that rather than requesting the whole file rclone reads the chunk +specified. This can reduce the used download quota for some remotes by +requesting only chunks from the remote that are actually read, at the +cost of an increased number of requests. -Server side copies are used with sync and copy and will be identified in -the log when using the -v flag. The move command may also use them if -remote doesn't support server-side move directly. This is done by -issuing a server-side copy then a delete which is much quicker than a -download and re-upload. +These flags control the chunking: -Server side copies will only be attempted if the remote names are the -same. + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128M) + --vfs-read-chunk-size-limit SizeSuffix Max chunk doubling size (default off) -This can be used when scripting to make aged backups efficiently, e.g. +Rclone will start reading a chunk of size --vfs-read-chunk-size, and +then double the size for each read. When --vfs-read-chunk-size-limit is +specified, and greater than --vfs-read-chunk-size, the chunk size for +each open file will get doubled only until the specified value is +reached. If the value is "off", which is the default, the limit is +disabled and the chunk size will grow indefinitely. - rclone sync --interactive remote:current-backup remote:previous-backup - rclone sync --interactive /path/to/files remote:current-backup +With --vfs-read-chunk-size 100M and --vfs-read-chunk-size-limit 0 the +following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, +300M-400M and so on. When --vfs-read-chunk-size-limit 500M is specified, +the result would be 0-100M, 100M-300M, 300M-700M, 700M-1200M, +1200M-1700M and so on. -Metadata support +Setting --vfs-read-chunk-size to 0 or "off" disables chunked reading. -Metadata is data about a file which isn't the contents of the file. -Normally rclone only preserves the modification time and the content -(MIME) type where possible. +VFS Performance -Rclone supports preserving all the available metadata on files (not -directories) when using the --metadata or -M flag. +These flags may be used to enable/disable features of the VFS for +performance or other reasons. See also the chunked reading feature. -Exactly what metadata is supported and what that support means depends -on the backend. Backends that support metadata have a metadata section -in their docs and are listed in the features table (Eg local, s3) +In particular S3 and Swift benefit hugely from the --no-modtime flag (or +use --use-server-modtime for a slightly different effect) as each read +of the modification time takes a transaction. -Rclone only supports a one-time sync of metadata. This means that -metadata will be synced from the source object to the destination object -only when the source object has changed and needs to be re-uploaded. If -the metadata subsequently changes on the source object without changing -the object itself then it won't be synced to the destination object. -This is in line with the way rclone syncs Content-Type without the ---metadata flag. + --no-checksum Don't compare checksums on up/download. + --no-modtime Don't read/write the modification time (can speed things up). + --no-seek Don't allow seeking in files. + --read-only Only allow read-only access. -Using --metadata when syncing from local to local will preserve file -attributes such as file mode, owner, extended attributes (not Windows). +Sometimes rclone is delivered reads or writes out of order. Rather than +seeking rclone will wait a short time for the in sequence read or write +to come in. These flags only come into effect when not using an on disk +cache file. -Note that arbitrary metadata may be added to objects using the ---metadata-set key=value flag when the object is first uploaded. This -flag can be repeated as many times as necessary. + --vfs-read-wait duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-write-wait duration Time to wait for in-sequence write before giving error (default 1s) -Types of metadata +When using VFS write caching (--vfs-cache-mode with value writes or +full), the global flag --transfers can be set to adjust the number of +parallel uploads of modified files from the cache (the related global +flag --checkers has no effect on the VFS). -Metadata is divided into two type. System metadata and User metadata. + --transfers int Number of file transfers to run in parallel (default 4) -Metadata which the backend uses itself is called system metadata. For -example on the local backend the system metadata uid will store the user -ID of the file when used on a unix based platform. +VFS Case Sensitivity -Arbitrary metadata is called user metadata and this can be set however -is desired. +Linux file systems are case-sensitive: two files can differ only by +case, and the exact case must be used when opening a file. -When objects are copied from backend to backend, they will attempt to -interpret system metadata if it is supplied. Metadata may change from -being user metadata to system metadata as objects are copied between -different backends. For example copying an object from s3 sets the -content-type metadata. In a backend which understands this (like -azureblob) this will become the Content-Type of the object. In a backend -which doesn't understand this (like the local backend) this will become -user metadata. However should the local object be copied back to s3, the -Content-Type will be set correctly. +File systems in modern Windows are case-insensitive but case-preserving: +although existing files can be opened using any case, the exact case +used to create the file is preserved and available for programs to +query. It is not allowed for two files in the same directory to differ +only by case. -Metadata framework +Usually file systems on macOS are case-insensitive. It is possible to +make macOS file systems case-sensitive but that is not the default. -Rclone implements a metadata framework which can read metadata from an -object and write it to the object when (and only when) it is being -uploaded. +The --vfs-case-insensitive VFS flag controls how rclone handles these +two cases. If its value is "false", rclone passes file names to the +remote as-is. If the flag is "true" (or appears without a value on the +command line), rclone may perform a "fixup" as explained below. -This metadata is stored as a dictionary with string keys and string -values. +The user may specify a file name to open/delete/rename/etc with a case +different than what is stored on the remote. If an argument refers to an +existing file with exactly the same name, then the case of the existing +file on the disk will be used. However, if a file name with exactly the +same name is not found but a name differing only by case exists, rclone +will transparently fixup the name. This fixup happens only when an +existing file is requested. Case sensitivity of file names created anew +by rclone is controlled by the underlying remote. -There are some limits on the names of the keys (these may be clarified -further in the future). +Note that case sensitivity of the operating system running rclone (the +target) may differ from case sensitivity of a file system presented by +rclone (the source). The flag controls whether "fixup" is performed to +satisfy the target. -- must be lower case -- may be a-z 0-9 containing . - or _ -- length is backend dependent +If the flag is not provided on the command line, then its default value +depends on the operating system where rclone runs: "true" on Windows and +macOS, "false" otherwise. If the flag is provided without a value, then +it is "true". -Each backend can provide system metadata that it understands. Some -backends can also store arbitrary user metadata. +VFS Disk Options -Where possible the key names are standardized, so, for example, it is -possible to copy object metadata from s3 to azureblob for example and -metadata will be translated appropriately. +This flag allows you to manually set the statistics about the filing +system. It can be useful when those statistics cannot be read correctly +automatically. -Some backends have limits on the size of the metadata and rclone will -give errors on upload if they are exceeded. + --vfs-disk-space-total-size Manually set the total disk space size (example: 256G, default: -1) -Metadata preservation +Alternate report of used bytes -The goal of the implementation is to +Some backends, most notably S3, do not report the amount of bytes used. +If you need this information to be available when running df on the +filesystem, then pass the flag --vfs-used-is-size to rclone. With this +flag set, instead of relying on the backend to report this information, +rclone will scan the whole remote similar to rclone size and compute the +total used space itself. -1. Preserve metadata if at all possible -2. Interpret metadata if at all possible +WARNING. Contrary to rclone size, this flag ignores filters so that the +result is accurate. However, this is very inefficient and may cost lots +of API calls resulting in extra charges. Use it as a last resort and +only with caching. -The consequences of 1 is that you can copy an S3 object to a local disk -then back to S3 losslessly. Likewise you can copy a local file with file -attributes and xattrs from local disk to s3 and back again losslessly. +Auth Proxy -The consequence of 2 is that you can copy an S3 object with metadata to -Azureblob (say) and have the metadata appear on the Azureblob object -also. +If you supply the parameter --auth-proxy /path/to/program then rclone +will use that program to generate backends on the fly which then are +used to authenticate incoming requests. This uses a simple JSON based +protocol with input on STDIN and output on STDOUT. -Standard system metadata +PLEASE NOTE: --auth-proxy and --authorized-keys cannot be used together, +if --auth-proxy is set the authorized keys option will be ignored. -Here is a table of standard system metadata which, if appropriate, a -backend may implement. +There is an example program bin/test_proxy.py in the rclone source code. - ---------------------------------------------------------------------------------------------- - key description example - ---------------------------------- --------------------- ------------------------------------- - mode File type and mode: 0100664 - octal, unix style +The program's job is to take a user and pass on the input and turn those +into the config for a backend on STDOUT in JSON format. This config will +have any default parameters for the backend added, but it won't use +configuration from environment variables or command line options - it is +the job of the proxy program to make a complete config. - uid User ID of owner: 500 - decimal number +This config generated must have this extra parameter - _root - root to +use for the backend - gid Group ID of owner: 500 - decimal number +And it may have this parameter - _obscure - comma separated strings for +parameters to obscure - rdev Device ID (if special 0 - file) => hexadecimal +If password authentication was used by the client, input to the proxy +process (on STDIN) would look similar to this: - atime Time of last access: 2006-01-02T15:04:05.999999999Z07:00 - RFC 3339 + { + "user": "me", + "pass": "mypassword" + } - mtime Time of last 2006-01-02T15:04:05.999999999Z07:00 - modification: RFC - 3339 +If public-key authentication was used by the client, input to the proxy +process (on STDIN) would look similar to this: - btime Time of file creation 2006-01-02T15:04:05.999999999Z07:00 - (birth): RFC 3339 + { + "user": "me", + "public_key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDuwESFdAe14hVS6omeyX7edc...JQdf" + } - cache-control Cache-Control header no-cache +And as an example return this on STDOUT - content-disposition Content-Disposition inline - header + { + "type": "sftp", + "_root": "", + "_obscure": "pass", + "user": "me", + "pass": "mypassword", + "host": "sftp.example.com" + } - content-encoding Content-Encoding gzip - header +This would mean that an SFTP backend would be created on the fly for the +user and pass/public_key returned in the output to the host given. Note +that since _obscure is set to pass, rclone will obscure the pass +parameter before creating the backend (which is required for sftp +backends). - content-language Content-Language en-US - header +The program can manipulate the supplied user in any way, for example to +make proxy to many different sftp backends, you could make the user be +user@example.com and then set the host to example.com in the output and +the user to user. For security you'd probably want to restrict the host +to a limited list. - content-type Content-Type header text/plain - ---------------------------------------------------------------------------------------------- +Note that an internal cache is keyed on user so only use that for +configuration, don't use pass or public_key. This also means that if a +user's password or public-key is changed the cache will need to expire +(which takes 5 mins) before it takes effect. -The metadata keys mtime and content-type will take precedence if -supplied in the metadata over reading the Content-Type or modification -time of the source object. +This can be used to build general purpose proxies to any kind of backend +that rclone supports. -Hashes are not included in system metadata as there is a well defined -way of reading those already. + rclone serve webdav remote:path [flags] Options -Rclone has a number of options to control its behaviour. + --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) + --allow-origin string Origin which cross-domain request (CORS) can be executed from + --auth-proxy string A program to use to create the backend from the auth + --baseurl string Prefix for URLs - leave blank for root + --cert string TLS PEM key (concatenation of certificate and CA certificate) + --client-ca string Client certificate authority to verify clients with + --dir-cache-time Duration Time to cache directory entries for (default 5m0s) + --dir-perms FileMode Directory permissions (default 0777) + --disable-dir-list Disable HTML directory list on GET request for a directory + --etag-hash string Which hash to use for the ETag, or auto or blank for off + --file-perms FileMode File permissions (default 0666) + --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) + -h, --help help for webdav + --htpasswd string A htpasswd file - if not provided no authentication is done + --key string TLS PEM Private key + --max-header-bytes int Maximum size of request header (default 4096) + --min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") + --no-checksum Don't compare checksums on up/download + --no-modtime Don't read/write the modification time (can speed things up) + --no-seek Don't allow seeking in files + --pass string Password for authentication + --poll-interval Duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s) + --read-only Only allow read-only access + --realm string Realm for authentication + --salt string Password hashing salt (default "dlPL2MqE") + --server-read-timeout Duration Timeout for server reading data (default 1h0m0s) + --server-write-timeout Duration Timeout for server writing data (default 1h0m0s) + --template string User-specified template + --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) + --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) + --user string User name for authentication + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-case-insensitive If a file name not found, find a case insensitive match + --vfs-disk-space-total-size SizeSuffix Specify the total space of disk (default off) + --vfs-fast-fingerprint Use fast (less accurate) fingerprints for change detection + --vfs-read-ahead SizeSuffix Extra read ahead over --buffer-size when using cache-mode full + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) + --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) + --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start + --vfs-used-is-size rclone size Use the rclone size algorithm for Used size + --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) + --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) -Options that take parameters can have the values passed in two ways, ---option=value or --option value. However boolean (true/false) options -behave slightly differently to the other options in that --boolean sets -the option to true and the absence of the flag sets it to false. It is -also possible to specify --boolean=false or --boolean=true. Note that ---boolean false is not valid - this is parsed as --boolean and the false -is parsed as an extra command line argument for rclone. +Filter Options -Time or duration options +Flags for filtering directory listings. -TIME or DURATION options can be specified as a duration string or a time -string. + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) -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". Default units are seconds or the following abbreviations are -valid: +See the global flags page for global options not listed here. -- ms - Milliseconds -- s - Seconds -- m - Minutes -- h - Hours -- d - Days -- w - Weeks -- M - Months -- y - Years +SEE ALSO -These can also be specified as an absolute time in the following -formats: +- rclone serve - Serve a remote over a protocol. -- RFC3339 - e.g. 2006-01-02T15:04:05Z or 2006-01-02T15:04:05+07:00 -- ISO8601 Date and time, local timezone - 2006-01-02T15:04:05 -- ISO8601 Date and time, local timezone - 2006-01-02 15:04:05 -- ISO8601 Date - 2006-01-02 (YYYY-MM-DD) +rclone settier -Size options +Changes storage class/tier of objects in remote. -Options which use SIZE use KiB (multiples of 1024 bytes) by default. -However, a suffix of B for Byte, K for KiB, M for MiB, G for GiB, T for -TiB and P for PiB may be used. These are the binary units, e.g. 1, -2**10, 2**20, 2**30 respectively. +Synopsis ---backup-dir=DIR +rclone settier changes storage tier or class at remote if supported. Few +cloud storage services provides different storage classes on objects, +for example AWS S3 and Glacier, Azure Blob storage - Hot, Cool and +Archive, Google Cloud Storage, Regional Storage, Nearline, Coldline etc. -When using sync, copy or move any files which would have been -overwritten or deleted are moved in their original hierarchy into this -directory. +Note that, certain tier changes make objects not available to access +immediately. For example tiering to archive in azure blob storage makes +objects in frozen state, user can restore by setting tier to Hot/Cool, +similarly S3 to Glacier makes object inaccessible.true -If --suffix is set, then the moved files will have the suffix added to -them. If there is a file with the same path (after the suffix has been -added) in DIR, then it will be overwritten. +You can use it to tier single object -The remote in use must support server-side move or copy and you must use -the same remote as the destination of the sync. The backup directory -must not overlap the destination directory without it being excluded by -a filter rule. + rclone settier Cool remote:path/file -For example +Or use rclone filters to set tier on only specific files - rclone sync --interactive /path/to/local remote:current --backup-dir remote:old + rclone --include "*.txt" settier Hot remote:path/dir -will sync /path/to/local to remote:current, but for any files which -would have been updated or deleted will be stored in remote:old. +Or just provide remote directory and all files in directory will be +tiered -If running rclone from a script you might want to use today's date as -the directory name passed to --backup-dir to store the old files, or you -might want to pass --suffix with today's date. + rclone settier tier remote:path/dir -See --compare-dest and --copy-dest. + rclone settier tier remote:path [flags] ---bind string +Options -Local address to bind to for outgoing connections. This can be an IPv4 -address (1.2.3.4), an IPv6 address (1234::789A) or host name. If the -host name doesn't resolve or resolves to more than one IP address it -will give an error. + -h, --help help for settier -You can use --bind 0.0.0.0 to force rclone to use IPv4 addresses and ---bind ::0 to force rclone to use IPv6 addresses. +See the global flags page for global options not listed here. ---bwlimit=BANDWIDTH_SPEC +SEE ALSO -This option controls the bandwidth limit. For example +- rclone - Show help for rclone commands, flags and backends. - --bwlimit 10M +rclone test -would mean limit the upload and download bandwidth to 10 MiB/s. NB this -is bytes per second not bits per second. To use a single limit, specify -the desired bandwidth in KiB/s, or use a suffix B|K|M|G|T|P. The default -is 0 which means to not limit bandwidth. +Run a test command -The upload and download bandwidth can be specified separately, as ---bwlimit UP:DOWN, so +Synopsis - --bwlimit 10M:100k +Rclone test is used to run test commands. -would mean limit the upload bandwidth to 10 MiB/s and the download -bandwidth to 100 KiB/s. Either limit can be "off" meaning no limit, so -to just limit the upload bandwidth you would use +Select which test command you want with the subcommand, eg - --bwlimit 10M:off + rclone test memory remote: -this would limit the upload bandwidth to 10 MiB/s but the download -bandwidth would be unlimited. +Each subcommand has its own options which you can see in their help. -When specified as above the bandwidth limits last for the duration of -run of the rclone binary. +NB Be careful running these commands, they may do strange things so +reading their documentation first is recommended. -It is also possible to specify a "timetable" of limits, which will cause -certain limits to be applied at certain times. To specify a timetable, -format your entries as -WEEKDAY-HH:MM,BANDWIDTH WEEKDAY-HH:MM,BANDWIDTH... where: WEEKDAY is -optional element. +Options -- BANDWIDTH can be a single number, e.g.100k or a pair of numbers for - upload:download, e.g.10M:1M. -- WEEKDAY can be written as the whole word or only using the first 3 - characters. It is optional. -- HH:MM is an hour from 00:00 to 23:59. + -h, --help help for test -An example of a typical timetable to avoid link saturation during -daytime working hours could be: +See the global flags page for global options not listed here. ---bwlimit "08:00,512k 12:00,10M 13:00,512k 18:00,30M 23:00,off" +SEE ALSO -In this example, the transfer bandwidth will be set to 512 KiB/s at 8am -every day. At noon, it will rise to 10 MiB/s, and drop back to 512 -KiB/sec at 1pm. At 6pm, the bandwidth limit will be set to 30 MiB/s, and -at 11pm it will be completely disabled (full speed). Anything between -11pm and 8am will remain unlimited. +- rclone - Show help for rclone commands, flags and backends. +- rclone test changenotify - Log any change notify requests for the + remote passed in. +- rclone test histogram - Makes a histogram of file name characters. +- rclone test info - Discovers file name or other limitations for + paths. +- rclone test makefile - Make files with random contents of the size + given +- rclone test makefiles - Make a random file hierarchy in a directory +- rclone test memory - Load all the objects at remote:path into memory + and report memory stats. -An example of timetable with WEEKDAY could be: +rclone test changenotify ---bwlimit "Mon-00:00,512 Fri-23:59,10M Sat-10:00,1M Sun-20:00,off" +Log any change notify requests for the remote passed in. -It means that, the transfer bandwidth will be set to 512 KiB/s on -Monday. It will rise to 10 MiB/s before the end of Friday. At 10:00 on -Saturday it will be set to 1 MiB/s. From 20:00 on Sunday it will be -unlimited. + rclone test changenotify remote: [flags] -Timeslots without WEEKDAY are extended to the whole week. So this -example: +Options ---bwlimit "Mon-00:00,512 12:00,1M Sun-20:00,off" + -h, --help help for changenotify + --poll-interval Duration Time to wait between polling for changes (default 10s) -Is equivalent to this: +See the global flags page for global options not listed here. ---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" +SEE ALSO -Bandwidth limit apply to the data transfer for all backends. For most -backends the directory listing bandwidth is also included (exceptions -being the non HTTP backends, ftp, sftp and storj). +- rclone test - Run a test command -Note that the units are Byte/s, not bit/s. Typically connections are -measured in bit/s - to convert divide by 8. For example, let's say you -have a 10 Mbit/s connection and you wish rclone to use half of it - 5 -Mbit/s. This is 5/8 = 0.625 MiB/s so you would use a --bwlimit 0.625M -parameter for rclone. +rclone test histogram -On Unix systems (Linux, macOS, …) the bandwidth limiter can be toggled -by sending a SIGUSR2 signal to rclone. This allows to remove the -limitations of a long running rclone transfer and to restore it back to -the value specified with --bwlimit quickly when needed. Assuming there -is only one rclone instance running, you can toggle the limiter like -this: +Makes a histogram of file name characters. - kill -SIGUSR2 $(pidof rclone) +Synopsis -If you configure rclone with a remote control then you can use change -the bwlimit dynamically: +This command outputs JSON which shows the histogram of characters used +in filenames in the remote:path specified. - rclone rc core/bwlimit rate=1M +The data doesn't contain any identifying information but is useful for +the rclone developers when developing filename compression. ---bwlimit-file=BANDWIDTH_SPEC + rclone test histogram [remote:path] [flags] -This option controls per file bandwidth limit. For the options see the ---bwlimit flag. +Options -For example use this to allow no transfers to be faster than 1 MiB/s + -h, --help help for histogram - --bwlimit-file 1M +See the global flags page for global options not listed here. -This can be used in conjunction with --bwlimit. +SEE ALSO -Note that if a schedule is provided the file will use the schedule in -effect at the start of the transfer. +- rclone test - Run a test command ---buffer-size=SIZE +rclone test info -Use this sized buffer to speed up file transfers. Each --transfer will -use this much memory for buffering. +Discovers file name or other limitations for paths. -When using mount or cmount each open file descriptor will use this much -memory for buffering. See the mount documentation for more details. +Synopsis -Set to 0 to disable the buffering for the minimum memory usage. +rclone info discovers what filenames and upload methods are possible to +write to the paths passed in and how long they can be. It can take some +time. It will write test files into the remote:path passed in. It +outputs a bit of go code for each one. -Note that the memory allocation of the buffers is influenced by the ---use-mmap flag. +NB this can create undeletable files and other hazards - use with care ---cache-dir=DIR + rclone test info [remote:path]+ [flags] -Specify the directory rclone will use for caching, to override the -default. +Options -Default value is depending on operating system: - Windows -%LocalAppData%\rclone, if LocalAppData is defined. - macOS -$HOME/Library/Caches/rclone if HOME is defined. - Unix -$XDG_CACHE_HOME/rclone if XDG_CACHE_HOME is defined, else -$HOME/.cache/rclone if HOME is defined. - Fallback (on all OS) to -$TMPDIR/rclone, where TMPDIR is the value from --temp-dir. + --all Run all tests + --check-base32768 Check can store all possible base32768 characters + --check-control Check control characters + --check-length Check max filename length + --check-normalization Check UTF-8 Normalization + --check-streaming Check uploads with indeterminate file size + -h, --help help for info + --upload-wait Duration Wait after writing a file (default 0s) + --write-json string Write results to file -You can use the config paths command to see the current value. +See the global flags page for global options not listed here. -Cache directory is heavily used by the VFS File Caching mount feature, -but also by serve, GUI and other parts of rclone. +SEE ALSO ---check-first +- rclone test - Run a test command -If this flag is set then in a sync, copy or move, rclone will do all the -checks to see whether files need to be transferred before doing any of -the transfers. Normally rclone would start running transfers as soon as -possible. +rclone test makefile -This flag can be useful on IO limited systems where transfers interfere -with checking. +Make files with random contents of the size given -It can also be useful to ensure perfect ordering when using --order-by. + rclone test makefile []+ [flags] -If both --check-first and --order-by are set when doing rclone move then -rclone will use the transfer thread to delete source files which don't -need transferring. This will enable perfect ordering of the transfers -and deletes but will cause the transfer stats to have more items in than -expected. +Options -Using this flag can use more memory as it effectively sets --max-backlog -to infinite. This means that all the info on the objects to transfer is -held in memory before the transfers start. + --ascii Fill files with random ASCII printable bytes only + --chargen Fill files with a ASCII chargen pattern + -h, --help help for makefile + --pattern Fill files with a periodic pattern + --seed int Seed for the random number generator (0 for random) (default 1) + --sparse Make the files sparse (appear to be filled with ASCII 0x00) + --zero Fill files with ASCII 0x00 ---checkers=N +See the global flags page for global options not listed here. -Originally controlling just the number of file checkers to run in -parallel, e.g. by rclone copy. Now a fairly universal parallelism -control used by rclone in several places. +SEE ALSO -Note: checkers do the equality checking of files during a sync. For some -storage systems (e.g. S3, Swift, Dropbox) this can take a significant -amount of time so they are run in parallel. +- rclone test - Run a test command -The default is to run 8 checkers in parallel. However, in case of -slow-reacting backends you may need to lower (rather than increase) this -default by setting --checkers to 4 or less threads. This is especially -advised if you are experiencing backend server crashes during file -checking phase (e.g. on subsequent or top-up backups where little or no -file copying is done and checking takes up most of the time). Increase -this setting only with utmost care, while monitoring your server health -and file checking throughput. +rclone test makefiles --c, --checksum +Make a random file hierarchy in a directory -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. + rclone test makefiles [flags] -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. +Options -This is very useful when transferring between remotes which store the -same hash type on the object, e.g. Drive and Swift. For details of which -remotes support which hash type see the table in the overview section. + --ascii Fill files with random ASCII printable bytes only + --chargen Fill files with a ASCII chargen pattern + --files int Number of files to create (default 1000) + --files-per-directory int Average number of files per directory (default 10) + -h, --help help for makefiles + --max-depth int Maximum depth of directory hierarchy (default 10) + --max-file-size SizeSuffix Maximum size of files to create (default 100) + --max-name-length int Maximum size of file names (default 12) + --min-file-size SizeSuffix Minimum size of file to create + --min-name-length int Minimum size of file names (default 4) + --pattern Fill files with a periodic pattern + --seed int Seed for the random number generator (0 for random) (default 1) + --sparse Make the files sparse (appear to be filled with ASCII 0x00) + --zero Fill files with ASCII 0x00 -Eg rclone --checksum sync s3:/bucket swift:/bucket would run much -quicker than without the --checksum flag. +See the global flags page for global options not listed here. -When using this flag, rclone won't update mtimes of remote files if they -are incorrect as it would normally. +SEE ALSO ---color WHEN +- rclone test - Run a test command -Specify when colors (and other ANSI codes) should be added to the -output. +rclone test memory -AUTO (default) only allows ANSI codes when the output is a terminal +Load all the objects at remote:path into memory and report memory stats. -NEVER never allow ANSI codes + rclone test memory remote:path [flags] -ALWAYS always add ANSI codes, regardless of the output format (terminal -or file) +Options ---compare-dest=DIR + -h, --help help for memory -When using sync, copy or move DIR is checked in addition to the -destination for files. If a file identical to the source is found that -file is NOT copied from source. This is useful to copy just files that -have changed since the last backup. +See the global flags page for global options not listed here. -You must use the same remote as the destination of the sync. The compare -directory must not overlap the destination directory. +SEE ALSO -See --copy-dest and --backup-dir. +- rclone test - Run a test command ---config=CONFIG_FILE +rclone touch -Specify the location of the rclone configuration file, to override the -default. E.g. rclone config --config="rclone.conf". +Create new file or change file modification time. -The exact default is a bit complex to describe, due to changes -introduced through different versions of rclone while preserving -backwards compatibility, but in most cases it is as simple as: +Synopsis -- %APPDATA%/rclone/rclone.conf on Windows -- ~/.config/rclone/rclone.conf on other +Set the modification time on file(s) as specified by remote:path to have +the current time. -The complete logic is as follows: Rclone will look for an existing -configuration file in any of the following locations, in priority order: +If remote:path does not exist then a zero sized file will be created, +unless --no-create or --recursive is provided. -1. rclone.conf (in program directory, where rclone executable is) -2. %APPDATA%/rclone/rclone.conf (only on Windows) -3. $XDG_CONFIG_HOME/rclone/rclone.conf (on all systems, including - Windows) -4. ~/.config/rclone/rclone.conf (see below for explanation of ~ symbol) -5. ~/.rclone.conf +If --recursive is used then recursively sets the modification time on +all existing files that is found under the path. Filters are supported, +and you can test with the --dry-run or the --interactive/-i flag. -If no existing configuration file is found, then a new one will be -created in the following location: +If --timestamp is used then sets the modification time to that time +instead of the current time. Times may be specified as one of: -- On Windows: Location 2 listed above, except in the unlikely event - that APPDATA is not defined, then location 4 is used instead. -- On Unix: Location 3 if XDG_CONFIG_HOME is defined, else location 4. -- Fallback to location 5 (on all OS), when the rclone directory cannot - be created, but if also a home directory was not found then path - .rclone.conf relative to current working directory will be used as a - final resort. +- 'YYMMDD' - e.g. 17.10.30 +- 'YYYY-MM-DDTHH:MM:SS' - e.g. 2006-01-02T15:04:05 +- 'YYYY-MM-DDTHH:MM:SS.SSS' - e.g. 2006-01-02T15:04:05.123456789 -The ~ symbol in paths above represent the home directory of the current -user on any OS, and the value is defined as following: +Note that value of --timestamp is in UTC. If you want local time then +add the --localtime flag. -- On Windows: %HOME% if defined, else %USERPROFILE%, or else - %HOMEDRIVE%\%HOMEPATH%. -- On Unix: $HOME if defined, else by looking up current user in - OS-specific user database (e.g. passwd file), or else use the result - from shell command cd && pwd. + rclone touch remote:path [flags] -If you run rclone config file you will see where the default location is -for you. +Options -The fact that an existing file rclone.conf in the same directory as the -rclone executable is always preferred, means that it is easy to run in -"portable" mode by downloading rclone executable to a writable directory -and then create an empty file rclone.conf in the same directory. + -h, --help help for touch + --localtime Use localtime for timestamp, not UTC + -C, --no-create Do not create the file if it does not exist (implied with --recursive) + -R, --recursive Recursively touch all files + -t, --timestamp string Use specified time instead of the current time of day -If the location is set to empty string "" or path to a file with name -notfound, or the os null device represented by value NUL on Windows and -/dev/null on Unix systems, then rclone will keep the config file in -memory only. +Important Options -The file format is basic INI: Sections of text, led by a [section] -header and followed by key=value entries on separate lines. In rclone -each remote is represented by its own section, where the section name -defines the name of the remote. Options are specified as the key=value -entries, where the key is the option name without the --backend- prefix, -in lowercase and with _ instead of -. E.g. option --mega-hard-delete -corresponds to key hard_delete. Only backend options can be specified. A -special, and required, key type identifies the storage system, where the -value is the internal lowercase name as returned by command -rclone help backends. Comments are indicated by ; or # at the beginning -of a line. +Important flags useful for most commands. -Example: + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) - [megaremote] - type = mega - user = you@example.com - pass = PDPcQVVjVtzFY-GTdDFozqBhTdsPg3qH +Filter Options -Note that passwords are in obscured form. Also, many storage systems -uses token-based authentication instead of passwords, and this requires -additional steps. It is easier, and safer, to use the interactive -command rclone config instead of manually editing the configuration -file. +Flags for filtering directory listings. -The configuration file will typically contain login information, and -should therefore have restricted permissions so that only the current -user can read it. Rclone tries to ensure this when it writes the file. -You may also choose to encrypt the file. + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) -When token-based authentication are used, the configuration file must be -writable, because rclone needs to update the tokens inside it. +Listing Options -To reduce risk of corrupting an existing configuration file, rclone will -not write directly to it when saving changes. Instead it will first -write to a new, temporary, file. If a configuration file already -existed, it will (on Unix systems) try to mirror its permissions to the -new file. Then it will rename the existing file to a temporary name as -backup. Next, rclone will rename the new file to the correct name, -before finally cleaning up by deleting the backup file. +Flags for listing directories. -If the configuration file path used by rclone is a symbolic link, then -this will be evaluated and rclone will write to the resolved path, -instead of overwriting the symbolic link. Temporary files used in the -process (described above) will be written to the same parent directory -as that of the resolved configuration file, but if this directory is -also a symbolic link it will not be resolved and the temporary files -will be written to the location of the directory symbolic link. + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions ---contimeout=TIME +See the global flags page for global options not listed here. -Set the connection timeout. This should be in go time format which looks -like 5s for 5 seconds, 10m for 10 minutes, or 3h30m. +SEE ALSO -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 1m by -default. +- rclone - Show help for rclone commands, flags and backends. ---copy-dest=DIR +rclone tree -When using sync, copy or move DIR is checked in addition to the -destination for files. If a file identical to the source is found that -file is server-side copied from DIR to the destination. This is useful -for incremental backup. +List the contents of the remote in a tree like fashion. -The remote in use must support server-side copy and you must use the -same remote as the destination of the sync. The compare directory must -not overlap the destination directory. +Synopsis -See --compare-dest and --backup-dir. +rclone tree lists the contents of a remote in a similar way to the unix +tree command. ---dedupe-mode MODE +For example -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. + $ rclone tree remote:path + / + ├── file1 + ├── file2 + ├── file3 + └── subdir + ├── file4 + └── file5 ---default-time TIME + 1 directories, 5 files -If a file or directory does have a modification time rclone can read -then rclone will display this fixed time instead. +You can use any of the filtering options with the tree command (e.g. +--include and --exclude. You can also use --fast-list. -The default is 2000-01-01 00:00:00 UTC. This can be configured in any of -the ways shown in the time or duration options. +The tree command has many options for controlling the listing which are +compatible with the tree command, for example you can include file sizes +with --size. Note that not all of them have short options as they +conflict with rclone's short options. -For example --default-time 2020-06-01 to set the default time to the 1st -of June 2020 or --default-time 0s to set the default time to the time -rclone started up. +For a more interactive navigation of the remote see the ncdu command. ---disable FEATURE,FEATURE,... + rclone tree remote:path [flags] -This disables a comma separated list of optional features. For example -to disable server-side move and server-side copy use: +Options - --disable move,copy + -a, --all All files are listed (list . files too) + -d, --dirs-only List directories only + --dirsfirst List directories before files (-U disables) + --full-path Print the full path prefix for each file + -h, --help help for tree + --level int Descend only level directories deep + -D, --modtime Print the date of last modification. + --noindent Don't print indentation lines + --noreport Turn off file/directory count at end of tree listing + -o, --output string Output to file instead of stdout + -p, --protections Print the protections for each file. + -Q, --quote Quote filenames with double quotes. + -s, --size Print the size in bytes of each file. + --sort string Select sort: name,version,size,mtime,ctime + --sort-ctime Sort files by last status change time + -t, --sort-modtime Sort files by last modification time + -r, --sort-reverse Reverse the order of the sort + -U, --unsorted Leave files unsorted + --version Sort files alphanumerically by version -The features can be put in any case. +Filter Options -To see a list of which features can be disabled use: +Flags for filtering directory listings. - --disable help + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) -The features a remote has can be seen in JSON format with: +Listing Options - rclone backend features remote: +Flags for listing directories. -See the overview features and optional features to get an idea of which -feature does what. + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions -Note that some features can be set to true if they are true/false -feature flag features by prefixing them with !. For example the -CaseInsensitive feature can be forced to false with ---disable CaseInsensitive and forced to true with ---disable '!CaseInsensitive'. In general it isn't a good idea doing this -but it may be useful in extremis. +See the global flags page for global options not listed here. -(Note that ! is a shell command which you will need to escape with -single quotes or a backslash on unix like platforms.) +SEE ALSO -This flag can be useful for debugging and in exceptional circumstances -(e.g. Google Drive limiting the total volume of Server Side Copies to -100 GiB/day). +- rclone - Show help for rclone commands, flags and backends. ---disable-http2 +Copying single files -This stops rclone from trying to use HTTP/2 if available. This can -sometimes speed up transfers due to a problem in the Go standard -library. +rclone normally syncs or copies directories. However, if the source +remote points to a file, rclone will just copy that file. The +destination remote must point to a directory - rclone will give the +error +Failed to create file system for "remote:file": is a file not a directory +if it isn't. ---dscp VALUE +For example, suppose you have a remote with a file in called test.jpg, +then you could copy just that file like this -Specify a DSCP value or name to use in connections. This could help QoS -system to identify traffic class. BE, EF, DF, LE, CSx and AFxx are -allowed. + rclone copy remote:test.jpg /tmp/download -See the description of differentiated services to get an idea of this -field. Setting this to 1 (LE) to identify the flow to SCAVENGER class -can avoid occupying too much bandwidth in a network with DiffServ -support (RFC 8622). +The file test.jpg will be placed inside /tmp/download. -For example, if you configured QoS on router to handle LE properly. -Running: +This is equivalent to specifying - rclone copy --dscp LE from:/from to:/to + rclone copy --files-from /tmp/files remote: /tmp/download -would make the priority lower than usual internet flows. +Where /tmp/files contains the single line -This option has no effect on Windows (see golang/go#42728). + test.jpg --n, --dry-run +It is recommended to use copy when copying individual files, not sync. +They have pretty much the same effect but copy will use a lot less +memory. -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 sync -command which deletes files in the destination. +Syntax of remote paths ---expect-continue-timeout=TIME +The syntax of the paths passed to the rclone command are as follows. -This specifies the amount of time to wait for a server's first response -headers after fully writing the request headers if the request has an -"Expect: 100-continue" header. Not all backends support using this. +/path/to/dir -Zero means no timeout and causes the body to be sent immediately, -without waiting for the server to approve. This time does not include -the time to send the request header. +This refers to the local file system. -The default is 1s. Set to 0 to disable. +On Windows \ may be used instead of / in local paths only, non local +paths must use /. See local filesystem documentation for more about +Windows-specific paths. ---error-on-no-transfer +These paths needn't start with a leading / - if they don't then they +will be relative to the current directory. -By default, rclone will exit with return code 0 if there were no errors. +remote:path/to/dir -This option allows rclone to return exit code 9 if no files were -transferred between the source and destination. This allows using rclone -in scripts, and triggering follow-on actions if data was copied, or -skipping if not. +This refers to a directory path/to/dir on remote: as defined in the +config file (configured with rclone config). -NB: Enabling this option turns a usually non-fatal error into a -potentially fatal one - please check and adjust your scripts -accordingly! +remote:/path/to/dir ---fs-cache-expire-duration=TIME +On most backends this is refers to the same directory as +remote:path/to/dir and that format should be preferred. On a very small +number of remotes (FTP, SFTP, Dropbox for business) this will refer to a +different directory. On these, paths without a leading / will refer to +your "home" directory and paths with a leading / will refer to the root. -When using rclone via the API rclone caches created remotes for 5 -minutes by default in the "fs cache". This means that if you do repeated -actions on the same remote then rclone won't have to build it again from -scratch, which makes it more efficient. +:backend:path/to/dir -This flag sets the time that the remotes are cached for. If you set it -to 0 (or negative) then rclone won't cache the remotes at all. +This is an advanced form for creating remotes on the fly. backend should +be the name or prefix of a backend (the type in the config file) and all +the configuration for the backend should be provided on the command line +(or in environment variables). -Note that if you use some flags, eg --backup-dir and if this is set to 0 -rclone may build two remotes (one for the source or destination and one -for the --backup-dir where it may have only built one before. +Here are some examples: ---fs-cache-expire-interval=TIME + rclone lsd --http-url https://pub.rclone.org :http: -This controls how often rclone checks for cached remotes to expire. See -the --fs-cache-expire-duration documentation above for more info. The -default is 60s, set to 0 to disable expiry. +To list all the directories in the root of https://pub.rclone.org/. ---header + rclone lsf --http-url https://example.com :http:path/to/dir -Add an HTTP header for all transactions. The flag can be repeated to add -multiple headers. +To list files and directories in https://example.com/path/to/dir/ -If you want to add headers only for uploads use --header-upload and if -you want to add headers only for downloads use --header-download. + rclone copy --http-url https://example.com :http:path/to/dir /tmp/dir -This flag is supported for all HTTP based backends even those not -supported by --header-upload and --header-download so may be used as a -workaround for those with care. +To copy files and directories in https://example.com/path/to/dir to +/tmp/dir. - rclone ls remote:test --header "X-Rclone: Foo" --header "X-LetMeIn: Yes" + rclone copy --sftp-host example.com :sftp:path/to/dir /tmp/dir ---header-download +To copy files and directories from example.com in the relative directory +path/to/dir to /tmp/dir using sftp. -Add an HTTP header for all download transactions. The flag can be -repeated to add multiple headers. +Connection strings - rclone sync --interactive s3:test/src ~/dst --header-download "X-Amz-Meta-Test: Foo" --header-download "X-Amz-Meta-Test2: Bar" +The above examples can also be written using a connection string syntax, +so instead of providing the arguments as command line parameters +--http-url https://pub.rclone.org they are provided as part of the +remote specification as a kind of connection string. -See the GitHub issue here for currently supported backends. + rclone lsd ":http,url='https://pub.rclone.org':" + rclone lsf ":http,url='https://example.com':path/to/dir" + rclone copy ":http,url='https://example.com':path/to/dir" /tmp/dir + rclone copy :sftp,host=example.com:path/to/dir /tmp/dir ---header-upload +These can apply to modify existing remotes as well as create new remotes +with the on the fly syntax. This example is equivalent to adding the +--drive-shared-with-me parameter to the remote gdrive:. -Add an HTTP header for all upload transactions. The flag can be repeated -to add multiple headers. + rclone lsf "gdrive,shared_with_me:path/to/dir" - rclone sync --interactive ~/src s3:test/dst --header-upload "Content-Disposition: attachment; filename='cool.html'" --header-upload "X-Amz-Meta-Test: FooBar" +The major advantage to using the connection string style syntax is that +it only applies to the remote, not to all the remotes of that type of +the command line. A common confusion is this attempt to copy a file +shared on google drive to the normal drive which does not work because +the --drive-shared-with-me flag applies to both the source and the +destination. -See the GitHub issue here for currently supported backends. + rclone copy --drive-shared-with-me gdrive:shared-file.txt gdrive: ---human-readable +However using the connection string syntax, this does work. -Rclone commands output values for sizes (e.g. number of bytes) and -counts (e.g. number of files) either as raw numbers, or in -human-readable format. + rclone copy "gdrive,shared_with_me:shared-file.txt" gdrive: -In human-readable format the values are scaled to larger units, -indicated with a suffix shown after the value, and rounded to three -decimals. Rclone consistently uses binary units (powers of 2) for sizes -and decimal units (powers of 10) for counts. The unit prefix for size is -according to IEC standard notation, e.g. Ki for kibi. Used with byte -unit, 1 KiB means 1024 Byte. In list type of output, only the unit -prefix appended to the value (e.g. 9.762Ki), while in more textual -output the full unit is shown (e.g. 9.762 KiB). For counts the SI -standard notation is used, e.g. prefix k for kilo. Used with file -counts, 1k means 1000 files. +Note that the connection string only affects the options of the +immediate backend. If for example gdriveCrypt is a crypt based on +gdrive, then the following command will not work as intended, because +shared_with_me is ignored by the crypt backend: -The various list commands output raw numbers by default. Option ---human-readable will make them output values in human-readable format -instead (with the short unit prefix). + rclone copy "gdriveCrypt,shared_with_me:shared-file.txt" gdriveCrypt: -The about command outputs human-readable by default, with a -command-specific option --full to output the raw numbers instead. +The connection strings have the following syntax -Command size outputs both human-readable and raw numbers in the same -output. + remote,parameter=value,parameter2=value2:path/to/dir + :backend,parameter=value,parameter2=value2:path/to/dir -The tree command also considers --human-readable, but it will not use -the exact same notation as the other commands: It rounds to one decimal, -and uses single letter suffix, e.g. K instead of Ki. The reason for this -is that it relies on an external library. +If the parameter has a : or , then it must be placed in quotes " or ', +so -The interactive command ncdu shows human-readable by default, and -responds to key u for toggling human-readable format. + remote,parameter="colon:value",parameter2="comma,value":path/to/dir + :backend,parameter='colon:value',parameter2='comma,value':path/to/dir ---ignore-case-sync +If a quoted value needs to include that quote, then it should be +doubled, so -Using this option will cause rclone to ignore the case of the files when -synchronizing so files will not be copied/synced when the existing -filenames are the same, even if the casing is different. + remote,parameter="with""quote",parameter2='with''quote':path/to/dir ---ignore-checksum +This will make parameter be with"quote and parameter2 be with'quote. -Normally rclone will check that the checksums of transferred files -match, and give an error "corrupted on transfer" if they don't. +If you leave off the =parameter then rclone will substitute =true which +works very well with flags. For example, to use s3 configured in the +environment you could use: -You can use this option to skip that check. You should only use it if -you have had the "corrupted on transfer" error message and you are sure -you might want to transfer potentially corrupted data. + rclone lsd :s3,env_auth: ---ignore-existing +Which is equivalent to -Using this option will make rclone unconditionally skip all files that -exist on the destination, no matter the content of these files. + rclone lsd :s3,env_auth=true: -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. +Note that on the command line you might need to surround these +connection strings with " or ' to stop the shell interpreting any +special characters within them. -When performing a move/moveto command, this flag will leave skipped -files in the source location unchanged when a file with the same name -exists on the destination. +If you are a shell master then you'll know which strings are OK and +which aren't, but if you aren't sure then enclose them in " and use ' as +the inside quote. This syntax works on all OSes. ---ignore-size + rclone copy ":http,url='https://example.com':path/to/dir" /tmp/dir -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 -modification time. If --checksum is set then it only checks the -checksum. +On Linux/macOS some characters are still interpreted inside " strings in +the shell (notably \ and $ and ") so if your strings contain those you +can swap the roles of " and ' thus. (This syntax does not work on +Windows.) -It will also cause rclone to skip verifying the sizes are the same after -transfer. + rclone copy ':http,url="https://example.com":path/to/dir' /tmp/dir -This can be useful for transferring files to and from OneDrive which -occasionally misreports the size of image files (see #399 for more -info). +Connection strings, config and logging --I, --ignore-times +If you supply extra configuration to a backend by command line flag, +environment variable or connection string then rclone will add a suffix +based on the hash of the config to the name of the remote, eg -Using this option will cause rclone to unconditionally upload all files -regardless of the state of files on the destination. + rclone -vv lsf --s3-chunk-size 20M s3: -Normally rclone would skip any files that have the same modification -time and are the same size (or have the same checksum if using ---checksum). +Has the log message ---immutable + DEBUG : s3: detected overridden config - adding "{Srj1p}" suffix to name -Treat source and destination files as immutable and disallow -modification. +This is so rclone can tell the modified remote apart from the unmodified +remote when caching the backends. -With this option set, files will be created and deleted as requested, -but existing files will never be updated. If an existing file does not -match between the source and destination, rclone will give the error -Source and destination exist but do not match: immutable file modified. +This should only be noticeable in the logs. -Note that only commands which transfer files (e.g. sync, copy, move) are -affected by this behavior, and only modification is disallowed. Files -may still be deleted explicitly (e.g. delete, purge) or implicitly (e.g. -sync, move). Use copy --immutable if it is desired to avoid deletion as -well as modification. +This means that on the fly backends such as -This can be useful as an additional layer of protection for immutable or -append-only data sets (notably backup archives), where modification -implies corruption and should not be propagated. + rclone -vv lsf :s3,env_auth: ---inplace +Will get their own names -The --inplace flag changes the behaviour of rclone when uploading files -to some backends (backends with the PartialUploads feature flag set) -such as: + DEBUG : :s3: detected overridden config - adding "{YTu53}" suffix to name -- local -- ftp -- sftp +Valid remote names -Without --inplace (the default) rclone will first upload to a temporary -file with an extension like this where XXXXXX represents a random -string. +Remote names are case sensitive, and must adhere to the following rules: +- May contain number, letter, _, -, ., +, @ and space. - May not start +with - or space. - May not end with space. - original-file-name.XXXXXX.partial +Starting with rclone version 1.61, any Unicode numbers and letters are +allowed, while in older versions it was limited to plain ASCII (0-9, +A-Z, a-z). If you use the same rclone configuration from different +shells, which may be configured with different character encoding, you +must be cautious to use characters that are possible to write in all of +them. This is mostly a problem on Windows, where the console +traditionally uses a non-Unicode character set - defined by the +so-called "code page". -(rclone will make sure the final name is no longer than 100 characters -by truncating the original-file-name part if necessary). +Do not use single character names on Windows as it creates ambiguity +with Windows drives' names, e.g.: remote called C is indistinguishable +from C drive. Rclone will always assume that single letter name refers +to a drive. -When the upload is complete, rclone will rename the .partial file to the -correct name, overwriting any existing file at that point. If the upload -fails then the .partial file will be deleted. +Quoting and the shell -This prevents other users of the backend from seeing partially uploaded -files in their new names and prevents overwriting the old file until the -new one is completely uploaded. +When you are typing commands to your computer you are using something +called the command line shell. This interprets various characters in an +OS specific way. -If the --inplace flag is supplied, rclone will upload directly to the -final name without creating a .partial file. +Here are some gotchas which may help users unfamiliar with the shell +rules -This means that an incomplete file will be visible in the directory -listings while the upload is in progress and any existing files will be -overwritten as soon as the upload starts. If the transfer fails then the -file will be deleted. This can cause data loss of the existing file if -the transfer fails. +Linux / OSX -Note that on the local file system if you don't use --inplace hard links -(Unix only) will be broken. And if you do use --inplace you won't be -able to update in use executables. +If your names have spaces or shell metacharacters (e.g. *, ?, $, ', ", +etc.) then you must quote them. Use single quotes ' by default. -Note also that versions of rclone prior to v1.63.0 behave as if the ---inplace flag is always supplied. + rclone copy 'Important files?' remote:backup --i, --interactive +If you want to send a ' you will need to use ", e.g. -This flag can be used to tell rclone that you wish a manual confirmation -before destructive operations. + rclone copy "O'Reilly Reviews" remote:backup -It is recommended that you use this flag while learning rclone -especially with rclone sync. +The rules for quoting metacharacters are complicated and if you want the +full details you'll have to consult the manual page for your shell. -For example +Windows - $ rclone delete --interactive /tmp/dir - rclone: delete "important-file.txt"? - y) Yes, this is OK (default) - n) No, skip this - s) Skip all delete operations with no more questions - !) Do all delete operations with no more questions - q) Exit rclone now. - y/n/s/!/q> n +If your names have spaces in you need to put them in ", e.g. -The options mean + rclone copy "E:\folder name\folder name\folder name" remote:backup -- y: Yes, this operation should go ahead. You can also press Return - for this to happen. You'll be asked every time unless you choose s - or !. -- n: No, do not do this operation. You'll be asked every time unless - you choose s or !. -- s: Skip all the following operations of this type with no more - questions. This takes effect until rclone exits. If there are any - different kind of operations you'll be prompted for them. -- !: Do all the following operations with no more questions. Useful if - you've decided that you don't mind rclone doing that kind of - operation. This takes effect until rclone exits . If there are any - different kind of operations you'll be prompted for them. -- q: Quit rclone now, just in case! +If you are using the root directory on its own then don't quote it (see +#464 for why), e.g. ---leave-root + rclone copy E:\ remote:backup -During rmdirs it will not remove root directory, even if it's empty. +Copying files or directories with : in the names ---log-file=FILE +rclone uses : to mark a remote name. This is, however, a valid filename +component in non-Windows OSes. The remote name parser will only search +for a : up to the first / so if you need to act on a file or directory +like this then use the full path starting with a /, or use ./ as a +current directory prefix. -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 -v flag. See the Logging section for more info. +So to sync a directory called sync:me to a remote called remote: use -If FILE exists then rclone will append to it. + rclone sync --interactive ./sync:me remote:path -Note that if you are using the logrotate program to manage rclone's -logs, then you should use the copytruncate option as rclone doesn't have -a signal to rotate logs. +or ---log-format LIST + rclone sync --interactive /full/path/to/sync:me remote:path -Comma separated list of log format options. Accepted options are date, -time, microseconds, pid, longfile, shortfile, UTC. Any other keywords -will be silently ignored. pid will tag log messages with process -identifier which useful with rclone mount --daemon. Other accepted -options are explained in the go documentation. The default log format is -"date,time". +Server Side Copy ---log-level LEVEL +Most remotes (but not all - see the overview) support server-side copy. -This sets the log level for rclone. The default log level is NOTICE. +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. -DEBUG is equivalent to -vv. It outputs lots of debug info - useful for -bug reports and really finding out what rclone is doing. +Eg -INFO is equivalent to -v. It outputs information about each transfer and -prints stats once a minute by default. + rclone copy s3:oldbucket s3:newbucket -NOTICE is the default log level if no logging flags are supplied. It -outputs very little when things are working normally. It outputs -warnings and significant events. +Will copy the contents of oldbucket to newbucket without downloading and +re-uploading. -ERROR is equivalent to -q. It only outputs error messages. +Remotes which don't support server-side copy will download and re-upload +in this case. ---use-json-log +Server side copies are used with sync and copy and will be identified in +the log when using the -v flag. The move command may also use them if +remote doesn't support server-side move directly. This is done by +issuing a server-side copy then a delete which is much quicker than a +download and re-upload. -This switches the log format to JSON for rclone. The fields of json log -are level, msg, source, time. +Server side copies will only be attempted if the remote names are the +same. ---low-level-retries NUMBER +This can be used when scripting to make aged backups efficiently, e.g. -This controls the number of low level retries rclone does. + rclone sync --interactive remote:current-backup remote:previous-backup + rclone sync --interactive /path/to/files remote:current-backup -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 -v flag. +Metadata support -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 --retries -flag) quicker. +Metadata is data about a file which isn't the contents of the file. +Normally rclone only preserves the modification time and the content +(MIME) type where possible. -Disable low level retries with --low-level-retries 1. +Rclone supports preserving all the available metadata on files (not +directories) when using the --metadata or -M flag. ---max-backlog=N +Exactly what metadata is supported and what that support means depends +on the backend. Backends that support metadata have a metadata section +in their docs and are listed in the features table (Eg local, s3) -This is the maximum allowable backlog of files in a sync/copy/move -queued for being checked or transferred. +Rclone only supports a one-time sync of metadata. This means that +metadata will be synced from the source object to the destination object +only when the source object has changed and needs to be re-uploaded. If +the metadata subsequently changes on the source object without changing +the object itself then it won't be synced to the destination object. +This is in line with the way rclone syncs Content-Type without the +--metadata flag. -This can be set arbitrarily large. It will only use memory when the -queue is in use. Note that it will use in the order of N KiB of memory -when the backlog is in use. +Using --metadata when syncing from local to local will preserve file +attributes such as file mode, owner, extended attributes (not Windows). -Setting this large allows rclone to calculate how many files are pending -more accurately, give a more accurate estimated finish time and make ---order-by work more accurately. +Note that arbitrary metadata may be added to objects using the +--metadata-set key=value flag when the object is first uploaded. This +flag can be repeated as many times as necessary. -Setting this small will make rclone more synchronous to the listings of -the remote which may be desirable. +The --metadata-mapper flag can be used to pass the name of a program in +which can transform metadata when it is being copied from source to +destination. -Setting this to a negative number will make the backlog as large as -possible. +Types of metadata ---max-delete=N +Metadata is divided into two type. System metadata and User metadata. -This tells rclone not to delete more than N files. If that limit is -exceeded then a fatal error will be generated and rclone will stop the -operation in progress. +Metadata which the backend uses itself is called system metadata. For +example on the local backend the system metadata uid will store the user +ID of the file when used on a unix based platform. ---max-delete-size=SIZE +Arbitrary metadata is called user metadata and this can be set however +is desired. -Rclone will stop deleting files when the total size of deletions has -reached the size specified. It defaults to off. +When objects are copied from backend to backend, they will attempt to +interpret system metadata if it is supplied. Metadata may change from +being user metadata to system metadata as objects are copied between +different backends. For example copying an object from s3 sets the +content-type metadata. In a backend which understands this (like +azureblob) this will become the Content-Type of the object. In a backend +which doesn't understand this (like the local backend) this will become +user metadata. However should the local object be copied back to s3, the +Content-Type will be set correctly. -If that limit is exceeded then a fatal error will be generated and -rclone will stop the operation in progress. +Metadata framework ---max-depth=N +Rclone implements a metadata framework which can read metadata from an +object and write it to the object when (and only when) it is being +uploaded. -This modifies the recursion depth for all the commands except purge. +This metadata is stored as a dictionary with string keys and string +values. -So if you do rclone --max-depth 1 ls remote:path you will see only the -files in the top level directory. Using --max-depth 2 means you will see -all the files in first two directory levels and so on. +There are some limits on the names of the keys (these may be clarified +further in the future). -For historical reasons the lsd command defaults to using a --max-depth -of 1 - you can override this with the command line flag. +- must be lower case +- may be a-z 0-9 containing . - or _ +- length is backend dependent -You can use this command to disable recursion (with --max-depth 1). +Each backend can provide system metadata that it understands. Some +backends can also store arbitrary user metadata. -Note that if you use this with sync and --delete-excluded the files not -recursed through are considered excluded and will be deleted on the -destination. Test first with --dry-run if you are not sure what will -happen. +Where possible the key names are standardized, so, for example, it is +possible to copy object metadata from s3 to azureblob for example and +metadata will be translated appropriately. ---max-duration=TIME +Some backends have limits on the size of the metadata and rclone will +give errors on upload if they are exceeded. -Rclone will stop transferring when it has run for the duration -specified. Defaults to off. +Metadata preservation -When the limit is reached all transfers will stop immediately. Use ---cutoff-mode to modify this behaviour. +The goal of the implementation is to -Rclone will exit with exit code 10 if the duration limit is reached. +1. Preserve metadata if at all possible +2. Interpret metadata if at all possible ---max-transfer=SIZE +The consequences of 1 is that you can copy an S3 object to a local disk +then back to S3 losslessly. Likewise you can copy a local file with file +attributes and xattrs from local disk to s3 and back again losslessly. -Rclone will stop transferring when it has reached the size specified. -Defaults to off. +The consequence of 2 is that you can copy an S3 object with metadata to +Azureblob (say) and have the metadata appear on the Azureblob object +also. -When the limit is reached all transfers will stop immediately. Use ---cutoff-mode to modify this behaviour. +Standard system metadata -Rclone will exit with exit code 8 if the transfer limit is reached. +Here is a table of standard system metadata which, if appropriate, a +backend may implement. ---cutoff-mode=hard|soft|cautious + ---------------------------------------------------------------------------------------------- + key description example + ---------------------------------- --------------------- ------------------------------------- + mode File type and mode: 0100664 + octal, unix style -This modifies the behavior of --max-transfer and --max-duration Defaults -to --cutoff-mode=hard. + uid User ID of owner: 500 + decimal number -Specifying --cutoff-mode=hard will stop transferring immediately when -Rclone reaches the limit. + gid Group ID of owner: 500 + decimal number -Specifying --cutoff-mode=soft will stop starting new transfers when -Rclone reaches the limit. + rdev Device ID (if special 0 + file) => hexadecimal -Specifying --cutoff-mode=cautious will try to prevent Rclone from -reaching the limit. Only applicable for --max-transfer + atime Time of last access: 2006-01-02T15:04:05.999999999Z07:00 + RFC 3339 --M, --metadata + mtime Time of last 2006-01-02T15:04:05.999999999Z07:00 + modification: RFC + 3339 -Setting this flag enables rclone to copy the metadata from the source to -the destination. For local backends this is ownership, permissions, -xattr etc. See the #metadata for more info. + btime Time of file creation 2006-01-02T15:04:05.999999999Z07:00 + (birth): RFC 3339 ---metadata-set key=value + utime Time of file upload: 2006-01-02T15:04:05.999999999Z07:00 + RFC 3339 -Add metadata key = value when uploading. This can be repeated as many -times as required. See the #metadata for more info. + cache-control Cache-Control header no-cache ---modify-window=TIME + content-disposition Content-Disposition inline + header -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. - -The default is 1ns 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 1s by default. + content-encoding Content-Encoding gzip + header -This command line flag allows you to override that computed default. + content-language Content-Language en-US + header ---multi-thread-write-buffer-size=SIZE + content-type Content-Type header text/plain + ---------------------------------------------------------------------------------------------- -When transferring with multiple threads, rclone will buffer SIZE bytes -in memory before writing to disk for each thread. +The metadata keys mtime and content-type will take precedence if +supplied in the metadata over reading the Content-Type or modification +time of the source object. -This can improve performance if the underlying filesystem does not deal -well with a lot of small writes in different positions of the file, so -if you see transfers being limited by disk write speed, you might want -to experiment with different values. Specially for magnetic drives and -remote file systems a higher value can be useful. +Hashes are not included in system metadata as there is a well defined +way of reading those already. -Nevertheless, the default of 128k should be fine for almost all use -cases, so before changing it ensure that network is not really your -bottleneck. +Options -As a final hint, size is not the only factor: block size (or similar -concept) can have an impact. In one case, we observed that exact -multiples of 16k performed much better than other values. +Rclone has a number of options to control its behaviour. ---multi-thread-chunk-size=SizeSuffix +Options that take parameters can have the values passed in two ways, +--option=value or --option value. However boolean (true/false) options +behave slightly differently to the other options in that --boolean sets +the option to true and the absence of the flag sets it to false. It is +also possible to specify --boolean=false or --boolean=true. Note that +--boolean false is not valid - this is parsed as --boolean and the false +is parsed as an extra command line argument for rclone. -Normally the chunk size for multi thread transfers is set by the -backend. However some backends such as local and smb (which implement -OpenWriterAt but not OpenChunkWriter) don't have a natural chunk size. +Time or duration options -In this case the value of this option is used (default 64Mi). +TIME or DURATION options can be specified as a duration string or a time +string. ---multi-thread-cutoff=SIZE +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". Default units are seconds or the following abbreviations are +valid: -When transferring files above SIZE to capable backends, rclone will use -multiple threads to transfer the file (default 256M). +- ms - Milliseconds +- s - Seconds +- m - Minutes +- h - Hours +- d - Days +- w - Weeks +- M - Months +- y - Years -Capable backends are marked in the overview as MultithreadUpload. (They -need to implement either the OpenWriterAt or OpenChunkedWriter internal -interfaces). These include include, local, s3, azureblob, b2, -oracleobjectstorage and smb at the time of writing. +These can also be specified as an absolute time in the following +formats: -On the local disk, rclone preallocates the file (using -fallocate(FALLOC_FL_KEEP_SIZE) on unix or NTSetInformationFile on -Windows both of which takes no time) then each thread writes directly -into the file at the correct place. This means that rclone won't create -fragmented or sparse files and there won't be any assembly time at the -end of the transfer. +- RFC3339 - e.g. 2006-01-02T15:04:05Z or 2006-01-02T15:04:05+07:00 +- ISO8601 Date and time, local timezone - 2006-01-02T15:04:05 +- ISO8601 Date and time, local timezone - 2006-01-02 15:04:05 +- ISO8601 Date - 2006-01-02 (YYYY-MM-DD) -The number of threads used to transfer is controlled by ---multi-thread-streams. +Size options -Use -vv if you wish to see info about the threads. +Options which use SIZE use KiB (multiples of 1024 bytes) by default. +However, a suffix of B for Byte, K for KiB, M for MiB, G for GiB, T for +TiB and P for PiB may be used. These are the binary units, e.g. 1, +2**10, 2**20, 2**30 respectively. -This will work with the sync/copy/move commands and friends -copyto/moveto. Multi thread transfers will be used with rclone mount and -rclone serve if --vfs-cache-mode is set to writes or above. +--backup-dir=DIR -NB that this only works with supported backends as the destination but -will work with any backend as the source. +When using sync, copy or move any files which would have been +overwritten or deleted are moved in their original hierarchy into this +directory. -NB that multi-thread copies are disabled for local to local copies as -they are faster without unless --multi-thread-streams is set explicitly. +If --suffix is set, then the moved files will have the suffix added to +them. If there is a file with the same path (after the suffix has been +added) in DIR, then it will be overwritten. -NB on Windows using multi-thread transfers to the local disk will cause -the resulting files to be sparse. Use --local-no-sparse to disable -sparse files (which may cause long delays at the start of transfers) or -disable multi-thread transfers with --multi-thread-streams 0 +The remote in use must support server-side move or copy and you must use +the same remote as the destination of the sync. The backup directory +must not overlap the destination directory without it being excluded by +a filter rule. ---multi-thread-streams=N +For example -When using multi thread transfers (see above --multi-thread-cutoff) this -sets the number of streams to use. Set to 0 to disable multi thread -transfers (Default 4). + rclone sync --interactive /path/to/local remote:current --backup-dir remote:old -If the backend has a --backend-upload-concurrency setting (eg ---s3-upload-concurrency) then this setting will be used as the number of -transfers instead if it is larger than the value of ---multi-thread-streams or --multi-thread-streams isn't set. +will sync /path/to/local to remote:current, but for any files which +would have been updated or deleted will be stored in remote:old. ---no-check-dest +If running rclone from a script you might want to use today's date as +the directory name passed to --backup-dir to store the old files, or you +might want to pass --suffix with today's date. -The --no-check-dest can be used with move or copy and it causes rclone -not to check the destination at all when copying files. +See --compare-dest and --copy-dest. -This means that: +--bind string -- the destination is not listed minimising the API calls -- files are always transferred -- this can cause duplicates on remotes which allow it (e.g. Google - Drive) -- --retries 1 is recommended otherwise you'll transfer everything - again on a retry +Local address to bind to for outgoing connections. This can be an IPv4 +address (1.2.3.4), an IPv6 address (1234::789A) or host name. If the +host name doesn't resolve or resolves to more than one IP address it +will give an error. -This flag is useful to minimise the transactions if you know that none -of the files are on the destination. +You can use --bind 0.0.0.0 to force rclone to use IPv4 addresses and +--bind ::0 to force rclone to use IPv6 addresses. -This is a specialized flag which should be ignored by most users! +--bwlimit=BANDWIDTH_SPEC ---no-gzip-encoding +This option controls the bandwidth limit. For example -Don't set Accept-Encoding: gzip. This means that rclone won't ask the -server for compressed files automatically. Useful if you've set the -server to return files with Content-Encoding: gzip but you uploaded -compressed files. + --bwlimit 10M -There is no need to set this in normal operation, and doing so will -decrease the network transfer efficiency of rclone. +would mean limit the upload and download bandwidth to 10 MiB/s. NB this +is bytes per second not bits per second. To use a single limit, specify +the desired bandwidth in KiB/s, or use a suffix B|K|M|G|T|P. The default +is 0 which means to not limit bandwidth. ---no-traverse +The upload and download bandwidth can be specified separately, as +--bwlimit UP:DOWN, so -The --no-traverse flag controls whether the destination file system is -traversed when using the copy or move commands. --no-traverse is not -compatible with sync and will be ignored if you supply it with sync. + --bwlimit 10M:100k -If you are only copying a small number of files (or are filtering most -of the files) and/or have a large number of files on the destination -then --no-traverse will stop rclone listing the destination and save -time. +would mean limit the upload bandwidth to 10 MiB/s and the download +bandwidth to 100 KiB/s. Either limit can be "off" meaning no limit, so +to just limit the upload bandwidth you would use -However, if you are copying a large number of files, especially if you -are doing a copy where lots of the files under consideration haven't -changed and won't need copying then you shouldn't use --no-traverse. + --bwlimit 10M:off -See rclone copy for an example of how to use it. +this would limit the upload bandwidth to 10 MiB/s but the download +bandwidth would be unlimited. ---no-unicode-normalization +When specified as above the bandwidth limits last for the duration of +run of the rclone binary. -Don't normalize unicode characters in filenames during the sync routine. +It is also possible to specify a "timetable" of limits, which will cause +certain limits to be applied at certain times. To specify a timetable, +format your entries as +WEEKDAY-HH:MM,BANDWIDTH WEEKDAY-HH:MM,BANDWIDTH... where: WEEKDAY is +optional element. -Sometimes, an operating system will store filenames containing unicode -parts in their decomposed form (particularly macOS). Some cloud storage -systems will then recompose the unicode, resulting in duplicate files if -the data is ever copied back to a local filesystem. +- BANDWIDTH can be a single number, e.g.100k or a pair of numbers for + upload:download, e.g.10M:1M. +- WEEKDAY can be written as the whole word or only using the first 3 + characters. It is optional. +- HH:MM is an hour from 00:00 to 23:59. -Using this flag will disable that functionality, treating each unicode -character as unique. For example, by default é and é will be normalized -into the same character. With --no-unicode-normalization they will be -treated as unique characters. +An example of a typical timetable to avoid link saturation during +daytime working hours could be: ---no-update-modtime +--bwlimit "08:00,512k 12:00,10M 13:00,512k 18:00,30M 23:00,off" -When using this flag, rclone won't update modification times of remote -files if they are incorrect as it would normally. +In this example, the transfer bandwidth will be set to 512 KiB/s at 8am +every day. At noon, it will rise to 10 MiB/s, and drop back to 512 +KiB/sec at 1pm. At 6pm, the bandwidth limit will be set to 30 MiB/s, and +at 11pm it will be completely disabled (full speed). Anything between +11pm and 8am will remain unlimited. -This can be used if the remote is being synced with another tool also -(e.g. the Google Drive client). +An example of timetable with WEEKDAY could be: ---order-by string +--bwlimit "Mon-00:00,512 Fri-23:59,10M Sat-10:00,1M Sun-20:00,off" -The --order-by flag controls the order in which files in the backlog are -processed in rclone sync, rclone copy and rclone move. +It means that, the transfer bandwidth will be set to 512 KiB/s on +Monday. It will rise to 10 MiB/s before the end of Friday. At 10:00 on +Saturday it will be set to 1 MiB/s. From 20:00 on Sunday it will be +unlimited. -The order by string is constructed like this. The first part describes -what aspect is being measured: +Timeslots without WEEKDAY are extended to the whole week. So this +example: -- size - order by the size of the files -- name - order by the full path of the files -- modtime - order by the modification date of the files +--bwlimit "Mon-00:00,512 12:00,1M Sun-20:00,off" -This can have a modifier appended with a comma: +Is equivalent to this: -- ascending or asc - order so that the smallest (or oldest) is - processed first -- descending or desc - order so that the largest (or newest) is - processed first -- mixed - order so that the smallest is processed first for some - threads and the largest for others +--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" -If the modifier is mixed then it can have an optional percentage (which -defaults to 50), e.g. size,mixed,25 which means that 25% of the threads -should be taking the smallest items and 75% the largest. The threads -which take the smallest first will always take the smallest first and -likewise the largest first threads. The mixed mode can be useful to -minimise the transfer time when you are transferring a mixture of large -and small files - the large files are guaranteed upload threads and -bandwidth and the small files will be processed continuously. +Bandwidth limit apply to the data transfer for all backends. For most +backends the directory listing bandwidth is also included (exceptions +being the non HTTP backends, ftp, sftp and storj). -If no modifier is supplied then the order is ascending. +Note that the units are Byte/s, not bit/s. Typically connections are +measured in bit/s - to convert divide by 8. For example, let's say you +have a 10 Mbit/s connection and you wish rclone to use half of it - 5 +Mbit/s. This is 5/8 = 0.625 MiB/s so you would use a --bwlimit 0.625M +parameter for rclone. -For example +On Unix systems (Linux, macOS, …) the bandwidth limiter can be toggled +by sending a SIGUSR2 signal to rclone. This allows to remove the +limitations of a long running rclone transfer and to restore it back to +the value specified with --bwlimit quickly when needed. Assuming there +is only one rclone instance running, you can toggle the limiter like +this: -- --order-by size,desc - send the largest files first -- --order-by modtime,ascending - send the oldest files first -- --order-by name - send the files with alphabetically by path first + kill -SIGUSR2 $(pidof rclone) -If the --order-by flag is not supplied or it is supplied with an empty -string then the default ordering will be used which is as scanned. With ---checkers 1 this is mostly alphabetical, however with the default ---checkers 8 it is somewhat random. +If you configure rclone with a remote control then you can use change +the bwlimit dynamically: -Limitations + rclone rc core/bwlimit rate=1M -The --order-by flag does not do a separate pass over the data. This -means that it may transfer some files out of the order specified if +--bwlimit-file=BANDWIDTH_SPEC -- there are no files in the backlog or the source has not been fully - scanned yet -- there are more than --max-backlog files in the backlog +This option controls per file bandwidth limit. For the options see the +--bwlimit flag. -Rclone will do its best to transfer the best file it has so in practice -this should not cause a problem. Think of --order-by as being more of a -best efforts flag rather than a perfect ordering. +For example use this to allow no transfers to be faster than 1 MiB/s -If you want perfect ordering then you will need to specify --check-first -which will find all the files which need transferring first before -transferring any. + --bwlimit-file 1M ---password-command SpaceSepList +This can be used in conjunction with --bwlimit. -This flag supplies a program which should supply the config password -when run. This is an alternative to rclone prompting for the password or -setting the RCLONE_CONFIG_PASS variable. +Note that if a schedule is provided the file will use the schedule in +effect at the start of the transfer. -The argument to this should be a command with a space separated list of -arguments. If one of the arguments has a space in then enclose it in ", -if you want a literal " in an argument then enclose the argument in " -and double the ". See CSV encoding for more info. +--buffer-size=SIZE -Eg +Use this sized buffer to speed up file transfers. Each --transfer will +use this much memory for buffering. - --password-command echo hello - --password-command echo "hello with space" - --password-command echo "hello with ""quotes"" and space" +When using mount or cmount each open file descriptor will use this much +memory for buffering. See the mount documentation for more details. -See the Configuration Encryption for more info. +Set to 0 to disable the buffering for the minimum memory usage. -See a Windows PowerShell example on the Wiki. +Note that the memory allocation of the buffers is influenced by the +--use-mmap flag. --P, --progress +--cache-dir=DIR -This flag makes rclone update the stats in a static block in the -terminal providing a realtime overview of the transfer. +Specify the directory rclone will use for caching, to override the +default. -Any log messages will scroll above the static block. Log messages will -push the static block down to the bottom of the terminal where it will -stay. +Default value is depending on operating system: - Windows +%LocalAppData%\rclone, if LocalAppData is defined. - macOS +$HOME/Library/Caches/rclone if HOME is defined. - Unix +$XDG_CACHE_HOME/rclone if XDG_CACHE_HOME is defined, else +$HOME/.cache/rclone if HOME is defined. - Fallback (on all OS) to +$TMPDIR/rclone, where TMPDIR is the value from --temp-dir. -Normally this is updated every 500mS but this period can be overridden -with the --stats flag. +You can use the config paths command to see the current value. -This can be used with the --stats-one-line flag for a simpler display. +Cache directory is heavily used by the VFS File Caching mount feature, +but also by serve, GUI and other parts of rclone. -Note: On Windows until this bug is fixed all non-ASCII characters will -be replaced with . when --progress is in use. +--check-first ---progress-terminal-title +If this flag is set then in a sync, copy or move, rclone will do all the +checks to see whether files need to be transferred before doing any of +the transfers. Normally rclone would start running transfers as soon as +possible. -This flag, when used with -P/--progress, will print the string ETA: %s -to the terminal title. +This flag can be useful on IO limited systems where transfers interfere +with checking. --q, --quiet +It can also be useful to ensure perfect ordering when using --order-by. -This flag will limit rclone's output to error messages only. +If both --check-first and --order-by are set when doing rclone move then +rclone will use the transfer thread to delete source files which don't +need transferring. This will enable perfect ordering of the transfers +and deletes but will cause the transfer stats to have more items in than +expected. ---refresh-times +Using this flag can use more memory as it effectively sets --max-backlog +to infinite. This means that all the info on the objects to transfer is +held in memory before the transfers start. -The --refresh-times flag can be used to update modification times of -existing files when they are out of sync on backends which don't support -hashes. +--checkers=N -This is useful if you uploaded files with the incorrect timestamps and -you now wish to correct them. +Originally controlling just the number of file checkers to run in +parallel, e.g. by rclone copy. Now a fairly universal parallelism +control used by rclone in several places. -This flag is only useful for destinations which don't support hashes -(e.g. crypt). +Note: checkers do the equality checking of files during a sync. For some +storage systems (e.g. S3, Swift, Dropbox) this can take a significant +amount of time so they are run in parallel. -This can be used any of the sync commands sync, copy or move. +The default is to run 8 checkers in parallel. However, in case of +slow-reacting backends you may need to lower (rather than increase) this +default by setting --checkers to 4 or less threads. This is especially +advised if you are experiencing backend server crashes during file +checking phase (e.g. on subsequent or top-up backups where little or no +file copying is done and checking takes up most of the time). Increase +this setting only with utmost care, while monitoring your server health +and file checking throughput. -To use this flag you will need to be doing a modification time sync (so -not using --size-only or --checksum). The flag will have no effect when -using --size-only or --checksum. +-c, --checksum -If this flag is used when rclone comes to upload a file it will check to -see if there is an existing file on the destination. If this file -matches the source with size (and checksum if available) but has a -differing timestamp then instead of re-uploading it, rclone will update -the timestamp on the destination file. If the checksum does not match -rclone will upload the new file. If the checksum is absent (e.g. on a -crypt backend) then rclone will update the timestamp. +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. -Note that some remotes can't set the modification time without -re-uploading the file so this flag is less useful on them. +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. -Normally if you are doing a modification time sync rclone will update -modification times without --refresh-times provided that the remote -supports checksums and the checksums match on the file. However if the -checksums are absent then rclone will upload the file rather than -setting the timestamp as this is the safe behaviour. +This is very useful when transferring between remotes which store the +same hash type on the object, e.g. Drive and Swift. For details of which +remotes support which hash type see the table in the overview section. ---retries int +Eg rclone --checksum sync s3:/bucket swift:/bucket would run much +quicker than without the --checksum flag. -Retry the entire sync if it fails this many times it fails (default 3). +When using this flag, rclone won't update mtimes of remote files if they +are incorrect as it would normally. -Some remotes can be unreliable and a few retries help pick up the files -which didn't get transferred because of errors. +--color WHEN -Disable retries with --retries 1. +Specify when colors (and other ANSI codes) should be added to the +output. ---retries-sleep=TIME +AUTO (default) only allows ANSI codes when the output is a terminal -This sets the interval between each retry specified by --retries +NEVER never allow ANSI codes -The default is 0. Use 0 to disable. +ALWAYS always add ANSI codes, regardless of the output format (terminal +or file) ---server-side-across-configs +--compare-dest=DIR -Allow server-side operations (e.g. copy or move) to work across -different configurations. +When using sync, copy or move DIR is checked in addition to the +destination for files. If a file identical to the source is found that +file is NOT copied from source. This is useful to copy just files that +have changed since the last backup. -This can be useful if you wish to do a server-side copy or move between -two remotes which use the same backend but are configured differently. +You must use the same remote as the destination of the sync. The compare +directory must not overlap the destination directory. -Note that this isn't enabled by default because it isn't easy for rclone -to tell if it will work between any two configurations. +See --copy-dest and --backup-dir. ---size-only +--config=CONFIG_FILE -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. +Specify the location of the rclone configuration file, to override the +default. E.g. rclone config --config="rclone.conf". -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. +The exact default is a bit complex to describe, due to changes +introduced through different versions of rclone while preserving +backwards compatibility, but in most cases it is as simple as: ---stats=TIME +- %APPDATA%/rclone/rclone.conf on Windows +- ~/.config/rclone/rclone.conf on other -Commands which transfer data (sync, copy, copyto, move, moveto) will -print data transfer stats at regular intervals to show their progress. +The complete logic is as follows: Rclone will look for an existing +configuration file in any of the following locations, in priority order: -This sets the interval. +1. rclone.conf (in program directory, where rclone executable is) +2. %APPDATA%/rclone/rclone.conf (only on Windows) +3. $XDG_CONFIG_HOME/rclone/rclone.conf (on all systems, including + Windows) +4. ~/.config/rclone/rclone.conf (see below for explanation of ~ symbol) +5. ~/.rclone.conf -The default is 1m. Use 0 to disable. +If no existing configuration file is found, then a new one will be +created in the following location: -If you set the stats interval then all commands can show stats. This can -be useful when running other commands, check or mount for example. +- On Windows: Location 2 listed above, except in the unlikely event + that APPDATA is not defined, then location 4 is used instead. +- On Unix: Location 3 if XDG_CONFIG_HOME is defined, else location 4. +- Fallback to location 5 (on all OS), when the rclone directory cannot + be created, but if also a home directory was not found then path + .rclone.conf relative to current working directory will be used as a + final resort. -Stats are logged at INFO level by default which means they won't show at -default log level NOTICE. Use --stats-log-level NOTICE or -v to make -them show. See the Logging section for more info on log levels. +The ~ symbol in paths above represent the home directory of the current +user on any OS, and the value is defined as following: -Note that on macOS you can send a SIGINFO (which is normally ctrl-T in -the terminal) to make the stats print immediately. +- On Windows: %HOME% if defined, else %USERPROFILE%, or else + %HOMEDRIVE%\%HOMEPATH%. +- On Unix: $HOME if defined, else by looking up current user in + OS-specific user database (e.g. passwd file), or else use the result + from shell command cd && pwd. ---stats-file-name-length integer +If you run rclone config file you will see where the default location is +for you. -By default, the --stats output will truncate file names and paths longer -than 40 characters. This is equivalent to providing ---stats-file-name-length 40. Use --stats-file-name-length 0 to disable -any truncation of file names printed by stats. +The fact that an existing file rclone.conf in the same directory as the +rclone executable is always preferred, means that it is easy to run in +"portable" mode by downloading rclone executable to a writable directory +and then create an empty file rclone.conf in the same directory. ---stats-log-level string +If the location is set to empty string "" or path to a file with name +notfound, or the os null device represented by value NUL on Windows and +/dev/null on Unix systems, then rclone will keep the config file in +memory only. -Log level to show --stats output at. This can be DEBUG, INFO, NOTICE, or -ERROR. The default is INFO. This means at the default level of logging -which is NOTICE the stats won't show - if you want them to then use ---stats-log-level NOTICE. See the Logging section for more info on log -levels. - ---stats-one-line +The file format is basic INI: Sections of text, led by a [section] +header and followed by key=value entries on separate lines. In rclone +each remote is represented by its own section, where the section name +defines the name of the remote. Options are specified as the key=value +entries, where the key is the option name without the --backend- prefix, +in lowercase and with _ instead of -. E.g. option --mega-hard-delete +corresponds to key hard_delete. Only backend options can be specified. A +special, and required, key type identifies the storage system, where the +value is the internal lowercase name as returned by command +rclone help backends. Comments are indicated by ; or # at the beginning +of a line. -When this is specified, rclone condenses the stats into a single line -showing the most important stats only. +Example: ---stats-one-line-date + [megaremote] + type = mega + user = you@example.com + pass = PDPcQVVjVtzFY-GTdDFozqBhTdsPg3qH -When this is specified, rclone enables the single-line stats and -prepends the display with a date string. The default is -2006/01/02 15:04:05 - +Note that passwords are in obscured form. Also, many storage systems +uses token-based authentication instead of passwords, and this requires +additional steps. It is easier, and safer, to use the interactive +command rclone config instead of manually editing the configuration +file. ---stats-one-line-date-format +The configuration file will typically contain login information, and +should therefore have restricted permissions so that only the current +user can read it. Rclone tries to ensure this when it writes the file. +You may also choose to encrypt the file. -When this is specified, rclone enables the single-line stats and -prepends the display with a user-supplied date string. The date string -MUST be enclosed in quotes. Follow golang specs for date formatting -syntax. +When token-based authentication are used, the configuration file must be +writable, because rclone needs to update the tokens inside it. ---stats-unit=bits|bytes +To reduce risk of corrupting an existing configuration file, rclone will +not write directly to it when saving changes. Instead it will first +write to a new, temporary, file. If a configuration file already +existed, it will (on Unix systems) try to mirror its permissions to the +new file. Then it will rename the existing file to a temporary name as +backup. Next, rclone will rename the new file to the correct name, +before finally cleaning up by deleting the backup file. -By default, data transfer rates will be printed in bytes per second. +If the configuration file path used by rclone is a symbolic link, then +this will be evaluated and rclone will write to the resolved path, +instead of overwriting the symbolic link. Temporary files used in the +process (described above) will be written to the same parent directory +as that of the resolved configuration file, but if this directory is +also a symbolic link it will not be resolved and the temporary files +will be written to the location of the directory symbolic link. -This option allows the data rate to be printed in bits per second. +--contimeout=TIME -Data transfer volume will still be reported in bytes. +Set the connection timeout. This should be in go time format which looks +like 5s for 5 seconds, 10m for 10 minutes, or 3h30m. -The rate is reported as a binary unit, not SI unit. So 1 Mbit/s equals -1,048,576 bit/s and not 1,000,000 bit/s. +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 1m by +default. -The default is bytes. +--copy-dest=DIR ---suffix=SUFFIX +When using sync, copy or move DIR is checked in addition to the +destination for files. If a file identical to the source is found that +file is server-side copied from DIR to the destination. This is useful +for incremental backup. -When using sync, copy or move any files which would have been -overwritten or deleted will have the suffix added to them. If there is a -file with the same path (after the suffix has been added), then it will -be overwritten. +The remote in use must support server-side copy and you must use the +same remote as the destination of the sync. The compare directory must +not overlap the destination directory. -The remote in use must support server-side move or copy and you must use -the same remote as the destination of the sync. +See --compare-dest and --backup-dir. -This is for use with files to add the suffix in the current directory or -with --backup-dir. See --backup-dir for more info. +--dedupe-mode MODE -For example +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. - rclone copy --interactive /path/to/local/file remote:current --suffix .bak +--default-time TIME -will copy /path/to/local to remote:current, but for any files which -would have been updated or deleted have .bak added. +If a file or directory does have a modification time rclone can read +then rclone will display this fixed time instead. -If using rclone sync with --suffix and without --backup-dir then it is -recommended to put a filter rule in excluding the suffix otherwise the -sync will delete the backup files. +The default is 2000-01-01 00:00:00 UTC. This can be configured in any of +the ways shown in the time or duration options. - rclone sync --interactive /path/to/local/file remote:current --suffix .bak --exclude "*.bak" +For example --default-time 2020-06-01 to set the default time to the 1st +of June 2020 or --default-time 0s to set the default time to the time +rclone started up. ---suffix-keep-extension +--disable FEATURE,FEATURE,... -When using --suffix, setting this causes rclone put the SUFFIX before -the extension of the files that it backs up rather than after. +This disables a comma separated list of optional features. For example +to disable server-side move and server-side copy use: -So let's say we had --suffix -2019-01-01, without the flag file.txt -would be backed up to file.txt-2019-01-01 and with the flag it would be -backed up to file-2019-01-01.txt. This can be helpful to make sure the -suffixed files can still be opened. + --disable move,copy -If a file has two (or more) extensions and the second (or subsequent) -extension is recognised as a valid mime type, then the suffix will go -before that extension. So file.tar.gz would be backed up to -file-2019-01-01.tar.gz whereas file.badextension.gz would be backed up -to file.badextension-2019-01-01.gz. +The features can be put in any case. ---syslog +To see a list of which features can be disabled use: -On capable OSes (not Windows or Plan9) send all log output to syslog. + --disable help -This can be useful for running rclone in a script or rclone mount. +The features a remote has can be seen in JSON format with: ---syslog-facility string + rclone backend features remote: -If using --syslog this sets the syslog facility (e.g. KERN, USER). See -man syslog for a list of possible facilities. The default facility is -DAEMON. +See the overview features and optional features to get an idea of which +feature does what. ---temp-dir=DIR +Note that some features can be set to true if they are true/false +feature flag features by prefixing them with !. For example the +CaseInsensitive feature can be forced to false with +--disable CaseInsensitive and forced to true with +--disable '!CaseInsensitive'. In general it isn't a good idea doing this +but it may be useful in extremis. -Specify the directory rclone will use for temporary files, to override -the default. Make sure the directory exists and have accessible -permissions. +(Note that ! is a shell command which you will need to escape with +single quotes or a backslash on unix like platforms.) -By default the operating system's temp directory will be used: - On Unix -systems, $TMPDIR if non-empty, else /tmp. - On Windows, the first -non-empty value from %TMP%, %TEMP%, %USERPROFILE%, or the Windows -directory. +This flag can be useful for debugging and in exceptional circumstances +(e.g. Google Drive limiting the total volume of Server Side Copies to +100 GiB/day). -When overriding the default with this option, the specified path will be -set as value of environment variable TMPDIR on Unix systems and TMP and -TEMP on Windows. +--disable-http2 -You can use the config paths command to see the current value. +This stops rclone from trying to use HTTP/2 if available. This can +sometimes speed up transfers due to a problem in the Go standard +library. ---tpslimit float +--dscp VALUE -Limit transactions per second to this number. Default is 0 which is used -to mean unlimited transactions per second. +Specify a DSCP value or name to use in connections. This could help QoS +system to identify traffic class. BE, EF, DF, LE, CSx and AFxx are +allowed. -A transaction is roughly defined as an API call; its exact meaning will -depend on the backend. For HTTP based backends it is an HTTP -PUT/GET/POST/etc and its response. For FTP/SFTP it is a round trip -transaction over TCP. +See the description of differentiated services to get an idea of this +field. Setting this to 1 (LE) to identify the flow to SCAVENGER class +can avoid occupying too much bandwidth in a network with DiffServ +support (RFC 8622). -For example, to limit rclone to 10 transactions per second use ---tpslimit 10, or to 1 transaction every 2 seconds use --tpslimit 0.5. +For example, if you configured QoS on router to handle LE properly. +Running: -Use this when the number of transactions per second from rclone is -causing a problem with the cloud storage provider (e.g. getting you -banned or rate limited). + rclone copy --dscp LE from:/from to:/to -This can be very useful for rclone mount to control the behaviour of -applications using it. +would make the priority lower than usual internet flows. -This limit applies to all HTTP based backends and to the FTP and SFTP -backends. It does not apply to the local backend or the Storj backend. +This option has no effect on Windows (see golang/go#42728). -See also --tpslimit-burst. +-n, --dry-run ---tpslimit-burst int +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 sync +command which deletes files in the destination. -Max burst of transactions for --tpslimit (default 1). +--expect-continue-timeout=TIME -Normally --tpslimit will do exactly the number of transaction per second -specified. However if you supply --tps-burst then rclone can save up -some transactions from when it was idle giving a burst of up to the -parameter supplied. +This specifies the amount of time to wait for a server's first response +headers after fully writing the request headers if the request has an +"Expect: 100-continue" header. Not all backends support using this. -For example if you provide --tpslimit-burst 10 then if rclone has been -idle for more than 10*--tpslimit then it can do 10 transactions very -quickly before they are limited again. +Zero means no timeout and causes the body to be sent immediately, +without waiting for the server to approve. This time does not include +the time to send the request header. -This may be used to increase performance of --tpslimit without changing -the long term average number of transactions per second. +The default is 1s. Set to 0 to disable. ---track-renames +--error-on-no-transfer -By default, rclone doesn't keep track of renamed files, so if you rename -a file locally then sync it to a remote, rclone will delete the old file -on the remote and upload a new copy. +By default, rclone will exit with return code 0 if there were no errors. -An rclone sync with --track-renames runs like a normal sync, but keeps -track of objects which exist in the destination but not in the source -(which would normally be deleted), and which objects exist in the source -but not the destination (which would normally be transferred). These -objects are then candidates for renaming. +This option allows rclone to return exit code 9 if no files were +transferred between the source and destination. This allows using rclone +in scripts, and triggering follow-on actions if data was copied, or +skipping if not. -After the sync, rclone matches up the source only and destination only -objects using the --track-renames-strategy specified and either renames -the destination object or transfers the source and deletes the -destination object. --track-renames is stateless like all of rclone's -syncs. +NB: Enabling this option turns a usually non-fatal error into a +potentially fatal one - please check and adjust your scripts +accordingly! -To use this flag the destination must support server-side copy or -server-side move, and to use a hash based --track-renames-strategy (the -default) the source and the destination must have a compatible hash. +--fs-cache-expire-duration=TIME -If the destination does not support server-side copy or move, rclone -will fall back to the default behaviour and log an error level message -to the console. +When using rclone via the API rclone caches created remotes for 5 +minutes by default in the "fs cache". This means that if you do repeated +actions on the same remote then rclone won't have to build it again from +scratch, which makes it more efficient. -Encrypted destinations are not currently supported by --track-renames if ---track-renames-strategy includes hash. +This flag sets the time that the remotes are cached for. If you set it +to 0 (or negative) then rclone won't cache the remotes at all. -Note that --track-renames is incompatible with --no-traverse and that it -uses extra memory to keep track of all the rename candidates. +Note that if you use some flags, eg --backup-dir and if this is set to 0 +rclone may build two remotes (one for the source or destination and one +for the --backup-dir where it may have only built one before. -Note also that --track-renames is incompatible with --delete-before and -will select --delete-after instead of --delete-during. +--fs-cache-expire-interval=TIME ---track-renames-strategy (hash,modtime,leaf,size) +This controls how often rclone checks for cached remotes to expire. See +the --fs-cache-expire-duration documentation above for more info. The +default is 60s, set to 0 to disable expiry. -This option changes the file matching criteria for --track-renames. +--header -The matching is controlled by a comma separated selection of these -tokens: +Add an HTTP header for all transactions. The flag can be repeated to add +multiple headers. -- modtime - the modification time of the file - not supported on all - backends -- hash - the hash of the file contents - not supported on all backends -- leaf - the name of the file not including its directory name -- size - the size of the file (this is always enabled) +If you want to add headers only for uploads use --header-upload and if +you want to add headers only for downloads use --header-download. -The default option is hash. +This flag is supported for all HTTP based backends even those not +supported by --header-upload and --header-download so may be used as a +workaround for those with care. -Using --track-renames-strategy modtime,leaf would match files based on -modification time, the leaf of the file name and the size only. + rclone ls remote:test --header "X-Rclone: Foo" --header "X-LetMeIn: Yes" -Using --track-renames-strategy modtime or leaf can enable ---track-renames support for encrypted destinations. +--header-download -Note that the hash strategy is not supported with encrypted -destinations. +Add an HTTP header for all download transactions. The flag can be +repeated to add multiple headers. ---delete-(before,during,after) + rclone sync --interactive s3:test/src ~/dst --header-download "X-Amz-Meta-Test: Foo" --header-download "X-Amz-Meta-Test2: Bar" -This option allows you to specify when files on your destination are -deleted when you sync folders. +See the GitHub issue here for currently supported backends. -Specifying the value --delete-before will delete all files present on -the destination, but not on the source before starting the transfer of -any new or updated files. This uses two passes through the file systems, -one for the deletions and one for the copies. +--header-upload -Specifying --delete-during will delete files while checking and -uploading files. This is the fastest option and uses the least memory. +Add an HTTP header for all upload transactions. The flag can be repeated +to add multiple headers. -Specifying --delete-after (the default value) will delay deletion of -files until all new/updated files have been successfully transferred. -The files to be deleted are collected in the copy pass then deleted -after the copy pass has completed successfully. The files to be deleted -are held in memory so this mode may use more memory. This is the safest -mode as it will only delete files if there have been no errors -subsequent to that. If there have been errors before the deletions start -then you will get the message -not deleting files as there were IO errors. + rclone sync --interactive ~/src s3:test/dst --header-upload "Content-Disposition: attachment; filename='cool.html'" --header-upload "X-Amz-Meta-Test: FooBar" ---fast-list +See the GitHub issue here for currently supported backends. -When doing anything which involves a directory listing (e.g. sync, copy, -ls - in fact nearly every command), rclone normally lists a directory -and processes it before using more directory lists to process any -subdirectories. This can be parallelised and works very quickly using -the least amount of memory. +--human-readable -However, some remotes have a way of listing all files beneath a -directory in one (or a small number) of transactions. These tend to be -the bucket-based remotes (e.g. S3, B2, GCS, Swift). +Rclone commands output values for sizes (e.g. number of bytes) and +counts (e.g. number of files) either as raw numbers, or in +human-readable format. -If you use the --fast-list flag then rclone will use this method for -listing directories. This will have the following consequences for the -listing: +In human-readable format the values are scaled to larger units, +indicated with a suffix shown after the value, and rounded to three +decimals. Rclone consistently uses binary units (powers of 2) for sizes +and decimal units (powers of 10) for counts. The unit prefix for size is +according to IEC standard notation, e.g. Ki for kibi. Used with byte +unit, 1 KiB means 1024 Byte. In list type of output, only the unit +prefix appended to the value (e.g. 9.762Ki), while in more textual +output the full unit is shown (e.g. 9.762 KiB). For counts the SI +standard notation is used, e.g. prefix k for kilo. Used with file +counts, 1k means 1000 files. -- It will use fewer transactions (important if you pay for them) -- It will use more memory. Rclone has to load the whole listing into - memory. -- It may be faster because it uses fewer transactions -- It may be slower because it can't be parallelized +The various list commands output raw numbers by default. Option +--human-readable will make them output values in human-readable format +instead (with the short unit prefix). -rclone should always give identical results with and without ---fast-list. +The about command outputs human-readable by default, with a +command-specific option --full to output the raw numbers instead. -If you pay for transactions and can fit your entire sync listing into -memory then --fast-list is recommended. If you have a very big sync to -do then don't use --fast-list otherwise you will run out of memory. +Command size outputs both human-readable and raw numbers in the same +output. -If you use --fast-list on a remote which doesn't support it, then rclone -will just ignore it. +The tree command also considers --human-readable, but it will not use +the exact same notation as the other commands: It rounds to one decimal, +and uses single letter suffix, e.g. K instead of Ki. The reason for this +is that it relies on an external library. ---timeout=TIME +The interactive command ncdu shows human-readable by default, and +responds to key u for toggling human-readable format. -This sets the IO idle timeout. If a transfer has started but then -becomes idle for this long it is considered broken and disconnected. +--ignore-case-sync -The default is 5m. Set to 0 to disable. +Using this option will cause rclone to ignore the case of the files when +synchronizing so files will not be copied/synced when the existing +filenames are the same, even if the casing is different. ---transfers=N +--ignore-checksum -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. +Normally rclone will check that the checksums of transferred files +match, and give an error "corrupted on transfer" if they don't. -The default is to run 4 file transfers in parallel. +You can use this option to skip that check. You should only use it if +you have had the "corrupted on transfer" error message and you are sure +you might want to transfer potentially corrupted data. -Look at --multi-thread-streams if you would like to control single file -transfers. +--ignore-existing --u, --update +Using this option will make rclone unconditionally skip all files that +exist on the destination, no matter the content of these files. -This forces rclone to skip any files which exist on the destination and -have a modified time that is newer than the source file. +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. -This can be useful in avoiding needless transfers when transferring to a -remote which doesn't support modification times directly (or when using ---use-server-modtime to avoid extra API calls) as it is more accurate -than a --size-only check and faster than using --checksum. On such -remotes (or when using --use-server-modtime) the time checked will be -the uploaded time. +When performing a move/moveto command, this flag will leave skipped +files in the source location unchanged when a file with the same name +exists on the destination. -If an existing destination file has a modification time older than the -source file's, it will be updated if the sizes are different. If the -sizes are the same, it will be updated if the checksum is different or -not available. +--ignore-size -If an existing destination file has a modification time equal (within -the computed modify window) to the source file's, it will be updated if -the sizes are different. The checksum will not be checked in this case -unless the --checksum flag is provided. +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 +modification time. If --checksum is set then it only checks the +checksum. -In all other cases the file will not be updated. +It will also cause rclone to skip verifying the sizes are the same after +transfer. -Consider using the --modify-window flag to compensate for time skews -between the source and the backend, for backends that do not support mod -times, and instead use uploaded times. However, if the backend does not -support checksums, note that syncing or copying within the time skew -window may still result in additional transfers for safety. +This can be useful for transferring files to and from OneDrive which +occasionally misreports the size of image files (see #399 for more +info). ---use-mmap +-I, --ignore-times -If this flag is set then rclone will use anonymous memory allocated by -mmap on Unix based platforms and VirtualAlloc on Windows for its -transfer buffers (size controlled by --buffer-size). Memory allocated -like this does not go on the Go heap and can be returned to the OS -immediately when it is finished with. +Using this option will cause rclone to unconditionally upload all files +regardless of the state of files on the destination. -If this flag is not set then rclone will allocate and free the buffers -using the Go memory allocator which may use more memory as memory pages -are returned less aggressively to the OS. +Normally rclone would skip any files that have the same modification +time and are the same size (or have the same checksum if using +--checksum). -It is possible this does not work well on all platforms so it is -disabled by default; in the future it may be enabled by default. +--immutable ---use-server-modtime +Treat source and destination files as immutable and disallow +modification. -Some object-store backends (e.g, Swift, S3) do not preserve file -modification times (modtime). On these backends, rclone stores the -original modtime as additional metadata on the object. By default it -will make an API call to retrieve the metadata when the modtime is -needed by an operation. +With this option set, files will be created and deleted as requested, +but existing files will never be updated. If an existing file does not +match between the source and destination, rclone will give the error +Source and destination exist but do not match: immutable file modified. -Use this flag to disable the extra API call and rely instead on the -server's modified time. In cases such as a local to remote sync using ---update, knowing the local file is newer than the time it was last -uploaded to the remote is sufficient. In those cases, this flag can -speed up the process and reduce the number of API calls necessary. +Note that only commands which transfer files (e.g. sync, copy, move) are +affected by this behavior, and only modification is disallowed. Files +may still be deleted explicitly (e.g. delete, purge) or implicitly (e.g. +sync, move). Use copy --immutable if it is desired to avoid deletion as +well as modification. -Using this flag on a sync operation without also using --update would -cause all files modified at any time other than the last upload time to -be uploaded again, which is probably not what you want. +This can be useful as an additional layer of protection for immutable or +append-only data sets (notably backup archives), where modification +implies corruption and should not be propagated. --v, -vv, --verbose +--inplace -With -v rclone will tell you about each file that is transferred and a -small number of significant events. +The --inplace flag changes the behaviour of rclone when uploading files +to some backends (backends with the PartialUploads feature flag set) +such as: -With -vv rclone will become very verbose telling you about every file it -considers and transfers. Please send bug reports with a log with this -setting. +- local +- ftp +- sftp -When setting verbosity as an environment variable, use RCLONE_VERBOSE=1 -or RCLONE_VERBOSE=2 for -v and -vv respectively. +Without --inplace (the default) rclone will first upload to a temporary +file with an extension like this, where XXXXXX represents a random +string and .partial is --partial-suffix value (.partial by default). --V, --version + original-file-name.XXXXXX.partial -Prints the version number +(rclone will make sure the final name is no longer than 100 characters +by truncating the original-file-name part if necessary). -SSL/TLS options +When the upload is complete, rclone will rename the .partial file to the +correct name, overwriting any existing file at that point. If the upload +fails then the .partial file will be deleted. -The outgoing SSL/TLS connections rclone makes can be controlled with -these options. For example this can be very useful with the HTTP or -WebDAV backends. Rclone HTTP servers have their own set of configuration -for SSL/TLS which you can find in their documentation. +This prevents other users of the backend from seeing partially uploaded +files in their new names and prevents overwriting the old file until the +new one is completely uploaded. ---ca-cert stringArray +If the --inplace flag is supplied, rclone will upload directly to the +final name without creating a .partial file. -This loads the PEM encoded certificate authority certificates and uses -it to verify the certificates of the servers rclone connects to. +This means that an incomplete file will be visible in the directory +listings while the upload is in progress and any existing files will be +overwritten as soon as the upload starts. If the transfer fails then the +file will be deleted. This can cause data loss of the existing file if +the transfer fails. -If you have generated certificates signed with a local CA then you will -need this flag to connect to servers using those certificates. +Note that on the local file system if you don't use --inplace hard links +(Unix only) will be broken. And if you do use --inplace you won't be +able to update in use executables. ---client-cert string +Note also that versions of rclone prior to v1.63.0 behave as if the +--inplace flag is always supplied. -This loads the PEM encoded client side certificate. +-i, --interactive -This is used for mutual TLS authentication. +This flag can be used to tell rclone that you wish a manual confirmation +before destructive operations. -The --client-key flag is required too when using this. +It is recommended that you use this flag while learning rclone +especially with rclone sync. ---client-key string +For example -This loads the PEM encoded client side private key used for mutual TLS -authentication. Used in conjunction with --client-cert. + $ rclone delete --interactive /tmp/dir + rclone: delete "important-file.txt"? + y) Yes, this is OK (default) + n) No, skip this + s) Skip all delete operations with no more questions + !) Do all delete operations with no more questions + q) Exit rclone now. + y/n/s/!/q> n ---no-check-certificate=true/false +The options mean ---no-check-certificate controls whether a client verifies the server's -certificate chain and host name. If --no-check-certificate 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. +- y: Yes, this operation should go ahead. You can also press Return + for this to happen. You'll be asked every time unless you choose s + or !. +- n: No, do not do this operation. You'll be asked every time unless + you choose s or !. +- s: Skip all the following operations of this type with no more + questions. This takes effect until rclone exits. If there are any + different kind of operations you'll be prompted for them. +- !: Do all the following operations with no more questions. Useful if + you've decided that you don't mind rclone doing that kind of + operation. This takes effect until rclone exits . If there are any + different kind of operations you'll be prompted for them. +- q: Quit rclone now, just in case! -This option defaults to false. +--leave-root -This should be used only for testing. +During rmdirs it will not remove root directory, even if it's empty. -Configuration Encryption +--log-file=FILE -Your configuration file contains information for logging in to your -cloud services. This means that you should keep your rclone.conf file in -a secure location. +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 -v flag. See the Logging section for more info. -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 supply -the password every time you start rclone. +If FILE exists then rclone will append to it. -To add a password to your rclone configuration, execute rclone config. +Note that if you are using the logrotate program to manage rclone's +logs, then you should use the copytruncate option as rclone doesn't have +a signal to rotate logs. - >rclone config - Current remotes: +--log-format LIST - e) Edit existing remote - n) New remote - d) Delete remote - s) Set configuration password - q) Quit config - e/n/d/s/q> +Comma separated list of log format options. Accepted options are date, +time, microseconds, pid, longfile, shortfile, UTC. Any other keywords +will be silently ignored. pid will tag log messages with process +identifier which useful with rclone mount --daemon. Other accepted +options are explained in the go documentation. The default log format is +"date,time". -Go into s, Set configuration password: +--log-level LEVEL - 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> +This sets the log level for rclone. The default log level is NOTICE. -Your configuration is now encrypted, and every time you start rclone you -will have to supply the password. See below for details. In the same -menu, you can change the password or completely remove encryption from -your configuration. +DEBUG is equivalent to -vv. It outputs lots of debug info - useful for +bug reports and really finding out what rclone is doing. -There is no way to recover the configuration if you lose your password. +INFO is equivalent to -v. It outputs information about each transfer and +prints stats once a minute by default. -rclone uses nacl secretbox which in turn 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. +NOTICE is the default log level if no logging flags are supplied. It +outputs very little when things are working normally. It outputs +warnings and significant events. -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. +ERROR is equivalent to -q. It only outputs error messages. -If it is safe in your environment, you can set the RCLONE_CONFIG_PASS -environment variable to contain your password, in which case it will be -used for decrypting the configuration. +--use-json-log -You can set this for a session from a script. For unix like systems save -this to a file called set-rclone-password: +This switches the log format to JSON for rclone. The fields of json log +are level, msg, source, time. - #!/bin/echo Source this file don't run it +--low-level-retries NUMBER - read -s RCLONE_CONFIG_PASS - export RCLONE_CONFIG_PASS +This controls the number of low level retries rclone does. -Then source the file when you want to use it. From the shell you would -do source set-rclone-password. It will then ask you for the password and -set it in the environment variable. +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 -v flag. -An alternate means of supplying the password is to provide a script -which will retrieve the password and print on standard output. This -script should have a fully specified path name and not rely on any -environment variables. The script is supplied either via ---password-command="..." command line argument or via the -RCLONE_PASSWORD_COMMAND environment variable. +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 --retries +flag) quicker. -One useful example of this is using the passwordstore application to -retrieve the password: +Disable low level retries with --low-level-retries 1. - export RCLONE_PASSWORD_COMMAND="pass rclone/config" +--max-backlog=N -If the passwordstore password manager holds the password for the rclone -configuration, using the script method means the password is primarily -protected by the passwordstore system, and is never embedded in the -clear in scripts, nor available for examination using the standard -commands available. It is quite possible with long running rclone -sessions for copies of passwords to be innocently captured in log files -or terminal scroll buffers, etc. Using the script method of supplying -the password enhances the security of the config password considerably. +This is the maximum allowable backlog of files in a sync/copy/move +queued for being checked or transferred. -If you are running rclone inside a script, unless you are using the ---password-command method, you might want to disable password prompts. -To do that, pass the parameter --ask-password=false to rclone. This will -make rclone fail instead of asking for a password if RCLONE_CONFIG_PASS -doesn't contain a valid password, and --password-command has not been -supplied. +This can be set arbitrarily large. It will only use memory when the +queue is in use. Note that it will use in the order of N KiB of memory +when the backlog is in use. -Whenever running commands that may be affected by options in a -configuration file, rclone will look for an existing file according to -the rules described above, and load any it finds. If an encrypted file -is found, this includes decrypting it, with the possible consequence of -a password prompt. When executing a command line that you know are not -actually using anything from such a configuration file, you can avoid it -being loaded by overriding the location, e.g. with one of the documented -special values for memory-only configuration. Since only backend options -can be stored in configuration files, this is normally unnecessary for -commands that do not operate on backends, e.g. genautocomplete. However, -it will be relevant for commands that do operate on backends in general, -but are used without referencing a stored remote, e.g. listing local -filesystem paths, or connection strings: rclone --config="" ls . +Setting this large allows rclone to calculate how many files are pending +more accurately, give a more accurate estimated finish time and make +--order-by work more accurately. -Developer options +Setting this small will make rclone more synchronous to the listings of +the remote which may be desirable. -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 e.g. ---drive-test-option - see the docs for the remote in question. +Setting this to a negative number will make the backlog as large as +possible. ---cpuprofile=FILE +--max-delete=N -Write CPU profile to file. This can be analysed with go tool pprof. +This tells rclone not to delete more than N files. If that limit is +exceeded then a fatal error will be generated and rclone will stop the +operation in progress. ---dump flag,flag,flag +--max-delete-size=SIZE -The --dump flag takes a comma separated list of flags to dump info -about. +Rclone will stop deleting files when the total size of deletions has +reached the size specified. It defaults to off. -Note that some headers including Accept-Encoding as shown may not be -correct in the request and the response may not show Content-Encoding if -the go standard libraries auto gzip encoding was in effect. In this case -the body of the request will be gunzipped before showing it. +If that limit is exceeded then a fatal error will be generated and +rclone will stop the operation in progress. -The available flags are: +--max-depth=N ---dump headers +This modifies the recursion depth for all the commands except purge. -Dump HTTP headers with Authorization: lines removed. May still contain -sensitive info. Can be very verbose. Useful for debugging only. +So if you do rclone --max-depth 1 ls remote:path you will see only the +files in the top level directory. Using --max-depth 2 means you will see +all the files in first two directory levels and so on. -Use --dump auth if you do want the Authorization: headers. +For historical reasons the lsd command defaults to using a --max-depth +of 1 - you can override this with the command line flag. ---dump bodies +You can use this command to disable recursion (with --max-depth 1). -Dump HTTP headers and bodies - may contain sensitive info. Can be very -verbose. Useful for debugging only. +Note that if you use this with sync and --delete-excluded the files not +recursed through are considered excluded and will be deleted on the +destination. Test first with --dry-run if you are not sure what will +happen. -Note that the bodies are buffered in memory so don't use this for -enormous files. +--max-duration=TIME ---dump requests +Rclone will stop transferring when it has run for the duration +specified. Defaults to off. -Like --dump bodies but dumps the request bodies and the response -headers. Useful for debugging download problems. +When the limit is reached all transfers will stop immediately. Use +--cutoff-mode to modify this behaviour. ---dump responses +Rclone will exit with exit code 10 if the duration limit is reached. -Like --dump bodies but dumps the response bodies and the request -headers. Useful for debugging upload problems. +--max-transfer=SIZE ---dump auth +Rclone will stop transferring when it has reached the size specified. +Defaults to off. -Dump HTTP headers - will contain sensitive info such as Authorization: -headers - use --dump headers to dump without Authorization: headers. Can -be very verbose. Useful for debugging only. +When the limit is reached all transfers will stop immediately. Use +--cutoff-mode to modify this behaviour. ---dump filters +Rclone will exit with exit code 8 if the transfer limit is reached. -Dump the filters to the output. Useful to see exactly what include and -exclude options are filtering on. +--cutoff-mode=hard|soft|cautious ---dump goroutines +This modifies the behavior of --max-transfer and --max-duration Defaults +to --cutoff-mode=hard. -This dumps a list of the running go-routines at the end of the command -to standard output. +Specifying --cutoff-mode=hard will stop transferring immediately when +Rclone reaches the limit. ---dump openfiles +Specifying --cutoff-mode=soft will stop starting new transfers when +Rclone reaches the limit. -This dumps a list of the open files at the end of the command. It uses -the lsof command to do that so you'll need that installed to use it. +Specifying --cutoff-mode=cautious will try to prevent Rclone from +reaching the limit. Only applicable for --max-transfer ---memprofile=FILE +-M, --metadata -Write memory profile to file. This can be analysed with go tool pprof. +Setting this flag enables rclone to copy the metadata from the source to +the destination. For local backends this is ownership, permissions, +xattr etc. See the metadata section for more info. + +--metadata-mapper SpaceSepList + +If you supply the parameter --metadata-mapper /path/to/program then +rclone will use that program to map metadata from source object to +destination object. + +The argument to this flag should be a command with an optional space +separated list of arguments. If one of the arguments has a space in then +enclose it in ", if you want a literal " in an argument then enclose the +argument in " and double the ". See CSV encoding for more info. + + --metadata-mapper "python bin/test_metadata_mapper.py" + --metadata-mapper 'python bin/test_metadata_mapper.py "argument with a space"' + --metadata-mapper 'python bin/test_metadata_mapper.py "argument with ""two"" quotes"' + +This uses a simple JSON based protocol with input on STDIN and output on +STDOUT. This will be called for every file and directory copied and may +be called concurrently. + +The program's job is to take a metadata blob on the input and turn it +into a metadata blob on the output suitable for the destination backend. + +Input to the program (via STDIN) might look like this. This provides +some context for the Metadata which may be important. + +- SrcFs is the config string for the remote that the object is + currently on. +- SrcFsType is the name of the source backend. +- DstFs is the config string for the remote that the object is being + copied to +- DstFsType is the name of the destination backend. +- Remote is the path of the file relative to the root. +- Size, MimeType, ModTime are attributes of the file. +- IsDir is true if this is a directory (not yet implemented). +- ID is the source ID of the file if known. +- Metadata is the backend specific metadata as described in the + backend docs. -Filtering + { + "SrcFs": "gdrive:", + "SrcFsType": "drive", + "DstFs": "newdrive:user", + "DstFsType": "onedrive", + "Remote": "test.txt", + "Size": 6, + "MimeType": "text/plain; charset=utf-8", + "ModTime": "2022-10-11T17:53:10.286745272+01:00", + "IsDir": false, + "ID": "xyz", + "Metadata": { + "btime": "2022-10-11T16:53:11Z", + "content-type": "text/plain; charset=utf-8", + "mtime": "2022-10-11T17:53:10.286745272+01:00", + "owner": "user1@domain1.com", + "permissions": "...", + "description": "my nice file", + "starred": "false" + } + } -For the filtering options +The program should then modify the input as desired and send it to +STDOUT. The returned Metadata field will be used in its entirety for the +destination object. Any other fields will be ignored. Note in this +example we translate user names and permissions and add something to the +description: -- --delete-excluded -- --filter -- --filter-from -- --exclude -- --exclude-from -- --exclude-if-present -- --include -- --include-from -- --files-from -- --files-from-raw -- --min-size -- --max-size -- --min-age -- --max-age -- --dump filters -- --metadata-include -- --metadata-include-from -- --metadata-exclude -- --metadata-exclude-from -- --metadata-filter -- --metadata-filter-from + { + "Metadata": { + "btime": "2022-10-11T16:53:11Z", + "content-type": "text/plain; charset=utf-8", + "mtime": "2022-10-11T17:53:10.286745272+01:00", + "owner": "user1@domain2.com", + "permissions": "...", + "description": "my nice file [migrated from domain1]", + "starred": "false" + } + } -See the filtering section. +Metadata can be removed here too. -Remote control +An example python program might look something like this to implement +the above transformations. -For the remote control options and for instructions on how to remote -control rclone + import sys, json -- --rc -- and anything starting with --rc- + i = json.load(sys.stdin) + metadata = i["Metadata"] + # Add tag to description + if "description" in metadata: + metadata["description"] += " [migrated from domain1]" + else: + metadata["description"] = "[migrated from domain1]" + # Modify owner + if "owner" in metadata: + metadata["owner"] = metadata["owner"].replace("domain1.com", "domain2.com") + o = { "Metadata": metadata } + json.dump(o, sys.stdout, indent="\t") -See the remote control section. +You can find this example (slightly expanded) in the rclone source code +at bin/test_metadata_mapper.py. -Logging +If you want to see the input to the metadata mapper and the output +returned from it in the log you can use -vv --dump mapper. -rclone has 4 levels of logging, ERROR, NOTICE, INFO and DEBUG. +See the metadata section for more info. -By default, rclone logs to standard error. This means you can redirect -standard error and still see the normal output of rclone commands (e.g. -rclone ls). +--metadata-set key=value -By default, rclone will produce Error and Notice level messages. +Add metadata key = value when uploading. This can be repeated as many +times as required. See the metadata section for more info. -If you use the -q flag, rclone will only produce Error messages. +--modify-window=TIME -If you use the -v flag, rclone will produce Error, Notice and Info -messages. +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. -If you use the -vv flag, rclone will produce Error, Notice, Info and -Debug messages. +The default is 1ns 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 1s by default. -You can also control the log levels with the --log-level flag. +This command line flag allows you to override that computed default. -If you use the --log-file=FILE option, rclone will redirect Error, Info -and Debug messages along with standard error to FILE. +--multi-thread-write-buffer-size=SIZE -If you use the --syslog flag then rclone will log to syslog and the ---syslog-facility control which facility it uses. +When transferring with multiple threads, rclone will buffer SIZE bytes +in memory before writing to disk for each thread. -Rclone prefixes all log messages with their level in capitals, e.g. INFO -which makes it easy to grep the log file for different kinds of -information. +This can improve performance if the underlying filesystem does not deal +well with a lot of small writes in different positions of the file, so +if you see transfers being limited by disk write speed, you might want +to experiment with different values. Specially for magnetic drives and +remote file systems a higher value can be useful. -Exit Code +Nevertheless, the default of 128k should be fine for almost all use +cases, so before changing it ensure that network is not really your +bottleneck. -If any errors occur during the command execution, rclone will exit with -a non-zero exit code. This allows scripts to detect when rclone -operations have failed. +As a final hint, size is not the only factor: block size (or similar +concept) can have an impact. In one case, we observed that exact +multiples of 16k performed much better than other values. -During the startup phase, rclone will exit immediately if an error is -detected in the configuration. There will always be a log message -immediately before exiting. +--multi-thread-chunk-size=SizeSuffix -When rclone is running it will accumulate errors as it goes along, and -only exit with a non-zero exit code if (after retries) there were still -failed transfers. For every error counted there will be a high priority -log message (visible with -q) showing the message and which file caused -the problem. A high priority message is also shown when starting a retry -so the user can see that any previous error messages may not be valid -after the retry. If rclone has done a retry it will log a high priority -message if the retry was successful. +Normally the chunk size for multi thread transfers is set by the +backend. However some backends such as local and smb (which implement +OpenWriterAt but not OpenChunkWriter) don't have a natural chunk size. -List of exit codes +In this case the value of this option is used (default 64Mi). -- 0 - success -- 1 - Syntax or usage error -- 2 - Error not otherwise categorised -- 3 - Directory not found -- 4 - File not found -- 5 - Temporary error (one that more retries might fix) (Retry errors) -- 6 - Less serious errors (like 461 errors from dropbox) (NoRetry - errors) -- 7 - Fatal error (one that more retries won't fix, like account - suspended) (Fatal errors) -- 8 - Transfer exceeded - limit set by --max-transfer reached -- 9 - Operation successful, but no files transferred -- 10 - Duration exceeded - limit set by --max-duration reached +--multi-thread-cutoff=SIZE -Environment Variables +When transferring files above SIZE to capable backends, rclone will use +multiple threads to transfer the file (default 256M). -Rclone can be configured entirely using environment variables. These can -be used to set defaults for options or config file entries. +Capable backends are marked in the overview as MultithreadUpload. (They +need to implement either the OpenWriterAt or OpenChunkedWriter internal +interfaces). These include include, local, s3, azureblob, b2, +oracleobjectstorage and smb at the time of writing. -Options +On the local disk, rclone preallocates the file (using +fallocate(FALLOC_FL_KEEP_SIZE) on unix or NTSetInformationFile on +Windows both of which takes no time) then each thread writes directly +into the file at the correct place. This means that rclone won't create +fragmented or sparse files and there won't be any assembly time at the +end of the transfer. -Every option in rclone can have its default set by environment variable. +The number of threads used to transfer is controlled by +--multi-thread-streams. -To find the name of the environment variable, first, take the long -option name, strip the leading --, change - to _, make upper case and -prepend RCLONE_. +Use -vv if you wish to see info about the threads. -For example, to always set --stats 5s, set the environment variable -RCLONE_STATS=5s. If you set stats on the command line this will override -the environment variable setting. +This will work with the sync/copy/move commands and friends +copyto/moveto. Multi thread transfers will be used with rclone mount and +rclone serve if --vfs-cache-mode is set to writes or above. -Or to always use the trash in drive --drive-use-trash, set -RCLONE_DRIVE_USE_TRASH=true. +NB that this only works with supported backends as the destination but +will work with any backend as the source. -Verbosity is slightly different, the environment variable equivalent of ---verbose or -v is RCLONE_VERBOSE=1, or for -vv, RCLONE_VERBOSE=2. +NB that multi-thread copies are disabled for local to local copies as +they are faster without unless --multi-thread-streams is set explicitly. -The same parser is used for the options and the environment variables so -they take exactly the same form. +NB on Windows using multi-thread transfers to the local disk will cause +the resulting files to be sparse. Use --local-no-sparse to disable +sparse files (which may cause long delays at the start of transfers) or +disable multi-thread transfers with --multi-thread-streams 0 -The options set by environment variables can be seen with the -vv flag, -e.g. rclone version -vv. +--multi-thread-streams=N -Config file +When using multi thread transfers (see above --multi-thread-cutoff) this +sets the number of streams to use. Set to 0 to disable multi thread +transfers (Default 4). -You can set defaults for values in the config file on an individual -remote basis. The names of the config items are documented in the page -for each backend. +If the backend has a --backend-upload-concurrency setting (eg +--s3-upload-concurrency) then this setting will be used as the number of +transfers instead if it is larger than the value of +--multi-thread-streams or --multi-thread-streams isn't set. -To find the name of the environment variable, you need to set, take -RCLONE_CONFIG_ + name of remote + _ + name of config file option and -make it all uppercase. Note one implication here is the remote's name -must be convertible into a valid environment variable name, so it can -only contain letters, digits, or the _ (underscore) character. +--no-check-dest -For example, to configure an S3 remote named mys3: without a config file -(using unix ways of setting environment variables): +The --no-check-dest can be used with move or copy and it causes rclone +not to check the destination at all when copying files. - $ export RCLONE_CONFIG_MYS3_TYPE=s3 - $ export RCLONE_CONFIG_MYS3_ACCESS_KEY_ID=XXX - $ export RCLONE_CONFIG_MYS3_SECRET_ACCESS_KEY=XXX - $ rclone lsd mys3: - -1 2016-09-21 12:54:21 -1 my-bucket - $ rclone listremotes | grep mys3 - mys3: +This means that: -Note that if you want to create a remote using environment variables you -must create the ..._TYPE variable as above. +- the destination is not listed minimising the API calls +- files are always transferred +- this can cause duplicates on remotes which allow it (e.g. Google + Drive) +- --retries 1 is recommended otherwise you'll transfer everything + again on a retry -Note that the name of a remote created using environment variable is -case insensitive, in contrast to regular remotes stored in config file -as documented above. You must write the name in uppercase in the -environment variable, but as seen from example above it will be listed -and can be accessed in lowercase, while you can also refer to the same -remote in uppercase: +This flag is useful to minimise the transactions if you know that none +of the files are on the destination. - $ rclone lsd mys3: - -1 2016-09-21 12:54:21 -1 my-bucket - $ rclone lsd MYS3: - -1 2016-09-21 12:54:21 -1 my-bucket +This is a specialized flag which should be ignored by most users! -Note that you can only set the options of the immediate backend, so -RCLONE_CONFIG_MYS3CRYPT_ACCESS_KEY_ID has no effect, if myS3Crypt is a -crypt remote based on an S3 remote. However RCLONE_S3_ACCESS_KEY_ID will -set the access key of all remotes using S3, including myS3Crypt. +--no-gzip-encoding -Note also that now rclone has connection strings, it is probably easier -to use those instead which makes the above example +Don't set Accept-Encoding: gzip. This means that rclone won't ask the +server for compressed files automatically. Useful if you've set the +server to return files with Content-Encoding: gzip but you uploaded +compressed files. - rclone lsd :s3,access_key_id=XXX,secret_access_key=XXX: +There is no need to set this in normal operation, and doing so will +decrease the network transfer efficiency of rclone. -Precedence +--no-traverse -The various different methods of backend configuration are read in this -order and the first one with a value is used. +The --no-traverse flag controls whether the destination file system is +traversed when using the copy or move commands. --no-traverse is not +compatible with sync and will be ignored if you supply it with sync. -- Parameters in connection strings, e.g. myRemote,skip_links: -- Flag values as supplied on the command line, e.g. --skip-links -- Remote specific environment vars, e.g. - RCLONE_CONFIG_MYREMOTE_SKIP_LINKS (see above). -- Backend-specific environment vars, e.g. RCLONE_LOCAL_SKIP_LINKS. -- Backend generic environment vars, e.g. RCLONE_SKIP_LINKS. -- Config file, e.g. skip_links = true. -- Default values, e.g. false - these can't be changed. +If you are only copying a small number of files (or are filtering most +of the files) and/or have a large number of files on the destination +then --no-traverse will stop rclone listing the destination and save +time. -So if both --skip-links is supplied on the command line and an -environment variable RCLONE_LOCAL_SKIP_LINKS is set, the command line -flag will take preference. +However, if you are copying a large number of files, especially if you +are doing a copy where lots of the files under consideration haven't +changed and won't need copying then you shouldn't use --no-traverse. -The backend configurations set by environment variables can be seen with -the -vv flag, e.g. rclone about myRemote: -vv. +See rclone copy for an example of how to use it. -For non backend configuration the order is as follows: +--no-unicode-normalization -- Flag values as supplied on the command line, e.g. --stats 5s. -- Environment vars, e.g. RCLONE_STATS=5s. -- Default values, e.g. 1m - these can't be changed. +Don't normalize unicode characters in filenames during the sync routine. -Other environment variables +Sometimes, an operating system will store filenames containing unicode +parts in their decomposed form (particularly macOS). Some cloud storage +systems will then recompose the unicode, resulting in duplicate files if +the data is ever copied back to a local filesystem. -- RCLONE_CONFIG_PASS set to contain your config file password (see - Configuration Encryption section) -- HTTP_PROXY, HTTPS_PROXY and NO_PROXY (or the lowercase versions - thereof). - - HTTPS_PROXY takes precedence over HTTP_PROXY for https requests. - - The environment values may be either a complete URL or a - "host[:port]" for, in which case the "http" scheme is assumed. -- USER and LOGNAME values are used as fallbacks for current username. - The primary method for looking up username is OS-specific: Windows - API on Windows, real user ID in /etc/passwd on Unix systems. In the - documentation the current username is simply referred to as $USER. -- RCLONE_CONFIG_DIR - rclone sets this variable for use in config - files and sub processes to point to the directory holding the config - file. +Using this flag will disable that functionality, treating each unicode +character as unique. For example, by default é and é will be normalized +into the same character. With --no-unicode-normalization they will be +treated as unique characters. -The options set by environment variables can be seen with the -vv and ---log-level=DEBUG flags, e.g. rclone version -vv. +--no-update-modtime -Configuring rclone on a remote / headless machine +When using this flag, rclone won't update modification times of remote +files if they are incorrect as it would normally. -Some of the configurations (those involving oauth2) require an Internet -connected web browser. +This can be used if the remote is being synced with another tool also +(e.g. the Google Drive client). -If you are trying to set rclone up on a remote or headless box with no -browser available on it (e.g. 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. +--order-by string -Configuring using rclone authorize +The --order-by flag controls the order in which files in the backlog are +processed in rclone sync, rclone copy and rclone move. -On the headless box run rclone config but answer N to the -Use web browser to automatically authenticate? question. +The order by string is constructed like this. The first part describes +what aspect is being measured: - ... - Remote config - Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access - If not sure try Y. If Y failed, try N. - y) Yes (default) - n) No - y/n> n - For this to work, you will need rclone available on a machine that has - a web browser available. +- size - order by the size of the files +- name - order by the full path of the files +- modtime - order by the modification date of the files - For more help and alternate methods see: https://rclone.org/remote_setup/ +This can have a modifier appended with a comma: - Execute the following on the machine with the web browser (same rclone - version recommended): +- ascending or asc - order so that the smallest (or oldest) is + processed first +- descending or desc - order so that the largest (or newest) is + processed first +- mixed - order so that the smallest is processed first for some + threads and the largest for others - rclone authorize "amazon cloud drive" +If the modifier is mixed then it can have an optional percentage (which +defaults to 50), e.g. size,mixed,25 which means that 25% of the threads +should be taking the smallest items and 75% the largest. The threads +which take the smallest first will always take the smallest first and +likewise the largest first threads. The mixed mode can be useful to +minimise the transfer time when you are transferring a mixture of large +and small files - the large files are guaranteed upload threads and +bandwidth and the small files will be processed continuously. - Then paste the result below: - result> +If no modifier is supplied then the order is ascending. -Then on your main desktop machine +For example - 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 +- --order-by size,desc - send the largest files first +- --order-by modtime,ascending - send the oldest files first +- --order-by name - send the files with alphabetically by path first -Then back to the headless box, paste in the code +If the --order-by flag is not supplied or it is supplied with an empty +string then the default ordering will be used which is as scanned. With +--checkers 1 this is mostly alphabetical, however with the default +--checkers 8 it is somewhat random. - 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> +Limitations -Configuring by copying the config file +The --order-by flag does not do a separate pass over the data. This +means that it may transfer some files out of the order specified if -Rclone stores all of its config in a single configuration file. This can -easily be copied to configure a remote rclone. +- there are no files in the backlog or the source has not been fully + scanned yet +- there are more than --max-backlog files in the backlog -So first configure rclone on your desktop machine with +Rclone will do its best to transfer the best file it has so in practice +this should not cause a problem. Think of --order-by as being more of a +best efforts flag rather than a perfect ordering. - rclone config +If you want perfect ordering then you will need to specify --check-first +which will find all the files which need transferring first before +transferring any. -to set up the config file. +--partial-suffix -Find the config file by running rclone config file, for example +When --inplace is not used, it causes rclone to use the --partial-suffix +as suffix for temporary files. - $ rclone config file - Configuration file is stored at: - /home/user/.rclone.conf +Suffix length limit is 16 characters. -Now transfer it to the remote box (scp, cut paste, ftp, sftp, etc.) and -place it in the correct place (use rclone config file on the remote box -to find out where). +The default is .partial. -Configuring using SSH Tunnel +--password-command SpaceSepList -Linux and MacOS users can utilize SSH Tunnel to redirect the headless -box port 53682 to local machine by using the following command: +This flag supplies a program which should supply the config password +when run. This is an alternative to rclone prompting for the password or +setting the RCLONE_CONFIG_PASS variable. - ssh -L localhost:53682:localhost:53682 username@remote_server +The argument to this should be a command with a space separated list of +arguments. If one of the arguments has a space in then enclose it in ", +if you want a literal " in an argument then enclose the argument in " +and double the ". See CSV encoding for more info. -Then on the headless box run rclone config and answer Y to the -Use web browser to automatically authenticate? question. +Eg - ... - Remote config - Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access - If not sure try Y. If Y failed, try N. - y) Yes (default) - n) No - y/n> y + --password-command "echo hello" + --password-command 'echo "hello with space"' + --password-command 'echo "hello with ""quotes"" and space"' -Then copy and paste the auth url -http://127.0.0.1:53682/auth?state=xxxxxxxxxxxx to the browser on your -local machine, complete the auth and it is done. +See the Configuration Encryption for more info. -Filtering, includes and excludes +See a Windows PowerShell example on the Wiki. -Filter flags determine which files rclone sync, move, ls, lsl, md5sum, -sha1sum, size, delete, check and similar commands apply to. +-P, --progress -They are specified in terms of path/file name patterns; path/file lists; -file age and size, or presence of a file in a directory. Bucket based -remotes without the concept of directory apply filters to object key, -age and size in an analogous way. +This flag makes rclone update the stats in a static block in the +terminal providing a realtime overview of the transfer. -Rclone purge does not obey filters. +Any log messages will scroll above the static block. Log messages will +push the static block down to the bottom of the terminal where it will +stay. -To test filters without risk of damage to data, apply them to rclone ls, -or with the --dry-run and -vv flags. +Normally this is updated every 500mS but this period can be overridden +with the --stats flag. -Rclone filter patterns can only be used in filter command line options, -not in the specification of a remote. +This can be used with the --stats-one-line flag for a simpler display. -E.g. rclone copy "remote:dir*.jpg" /path/to/dir does not have a filter -effect. rclone copy remote:dir /path/to/dir --include "*.jpg" does. +Note: On Windows until this bug is fixed all non-ASCII characters will +be replaced with . when --progress is in use. -Important Avoid mixing any two of --include..., --exclude... or ---filter... flags in an rclone command. The results might not be what -you expect. Instead use a --filter... flag. +--progress-terminal-title -Patterns for matching path/file names +This flag, when used with -P/--progress, will print the string ETA: %s +to the terminal title. -Pattern syntax +-q, --quiet -Here is a formal definition of the pattern syntax, examples are below. +This flag will limit rclone's output to error messages only. -Rclone matching rules follow a glob style: +--refresh-times - * matches any sequence of non-separator (/) characters - ** matches any sequence of characters including / separators - ? matches any single non-separator (/) character - [ [ ! ] { character-range } ] - character class (must be non-empty) - { pattern-list } - pattern alternatives - {{ regexp }} - regular expression to match - c matches character c (c != *, **, ?, \, [, {, }) - \c matches reserved character c (c = *, **, ?, \, [, {, }) or character class +The --refresh-times flag can be used to update modification times of +existing files when they are out of sync on backends which don't support +hashes. -character-range: +This is useful if you uploaded files with the incorrect timestamps and +you now wish to correct them. - c matches character c (c != \, -, ]) - \c matches reserved character c (c = \, -, ]) - lo - hi matches character c for lo <= c <= hi +This flag is only useful for destinations which don't support hashes +(e.g. crypt). -pattern-list: +This can be used any of the sync commands sync, copy or move. - pattern { , pattern } - comma-separated (without spaces) patterns +To use this flag you will need to be doing a modification time sync (so +not using --size-only or --checksum). The flag will have no effect when +using --size-only or --checksum. -character classes (see Go regular expression reference) include: +If this flag is used when rclone comes to upload a file it will check to +see if there is an existing file on the destination. If this file +matches the source with size (and checksum if available) but has a +differing timestamp then instead of re-uploading it, rclone will update +the timestamp on the destination file. If the checksum does not match +rclone will upload the new file. If the checksum is absent (e.g. on a +crypt backend) then rclone will update the timestamp. - Named character classes (e.g. [\d], [^\d], [\D], [^\D]) - Perl character classes (e.g. \s, \S, \w, \W) - ASCII character classes (e.g. [[:alnum:]], [[:alpha:]], [[:punct:]], [[:xdigit:]]) +Note that some remotes can't set the modification time without +re-uploading the file so this flag is less useful on them. -regexp for advanced users to insert a regular expression - see below for -more info: +Normally if you are doing a modification time sync rclone will update +modification times without --refresh-times provided that the remote +supports checksums and the checksums match on the file. However if the +checksums are absent then rclone will upload the file rather than +setting the timestamp as this is the safe behaviour. - Any re2 regular expression not containing `}}` +--retries int -If the filter pattern starts with a / then it only matches at the top -level of the directory tree, relative to the root of the remote (not -necessarily the root of the drive). If it does not start with / then it -is matched starting at the end of the path/file name but it only matches -a complete path element - it must match from a / separator or the -beginning of the path/file. +Retry the entire sync if it fails this many times it fails (default 3). - 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" +Some remotes can be unreliable and a few retries help pick up the files +which didn't get transferred because of errors. -The top level of the remote might not be the top level of the drive. +Disable retries with --retries 1. -E.g. for a Microsoft Windows local directory structure +--retries-sleep=TIME - F: - ├── bkp - ├── data - │ ├── excl - │ │ ├── 123.jpg - │ │ └── 456.jpg - │ ├── incl - │ │ └── document.pdf +This sets the interval between each retry specified by --retries -To copy the contents of folder data into folder bkp excluding the -contents of subfolder exclthe following command treats F:\data and -F:\bkp as top level for filtering. +The default is 0. Use 0 to disable. -rclone copy F:\data\ F:\bkp\ --exclude=/excl/** +--server-side-across-configs -Important Use / in path/file name patterns and not \ even if running on -Microsoft Windows. +Allow server-side operations (e.g. copy or move) to work across +different configurations. -Simple patterns are case sensitive unless the --ignore-case flag is -used. +This can be useful if you wish to do a server-side copy or move between +two remotes which use the same backend but are configured differently. -Without --ignore-case (default) +Note that this isn't enabled by default because it isn't easy for rclone +to tell if it will work between any two configurations. - potato - matches "potato" - - doesn't match "POTATO" +--size-only -With --ignore-case +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. - potato - matches "potato" - - matches "POTATO" +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. -Using regular expressions in filter patterns +--stats=TIME -The syntax of filter patterns is glob style matching (like bash uses) to -make things easy for users. However this does not provide absolute -control over the matching, so for advanced users rclone also provides a -regular expression syntax. +Commands which transfer data (sync, copy, copyto, move, moveto) will +print data transfer stats at regular intervals to show their progress. -The regular expressions used are as defined in the Go regular expression -reference. Regular expressions should be enclosed in {{ }}. They will -match only the last path segment if the glob doesn't start with / or the -whole path name if it does. Note that rclone does not attempt to parse -the supplied regular expression, meaning that using any regular -expression filter will prevent rclone from using directory filter rules, -as it will instead check every path against the supplied regular -expression(s). +This sets the interval. -Here is how the {{regexp}} is transformed into an full regular -expression to match the entire path: +The default is 1m. Use 0 to disable. - {{regexp}} becomes (^|/)(regexp)$ - /{{regexp}} becomes ^(regexp)$ +If you set the stats interval then all commands can show stats. This can +be useful when running other commands, check or mount for example. -Regexp syntax can be mixed with glob syntax, for example +Stats are logged at INFO level by default which means they won't show at +default log level NOTICE. Use --stats-log-level NOTICE or -v to make +them show. See the Logging section for more info on log levels. - *.{{jpe?g}} to match file.jpg, file.jpeg but not file.png +Note that on macOS you can send a SIGINFO (which is normally ctrl-T in +the terminal) to make the stats print immediately. -You can also use regexp flags - to set case insensitive, for example +--stats-file-name-length integer - *.{{(?i)jpg}} to match file.jpg, file.JPG but not file.png +By default, the --stats output will truncate file names and paths longer +than 40 characters. This is equivalent to providing +--stats-file-name-length 40. Use --stats-file-name-length 0 to disable +any truncation of file names printed by stats. -Be careful with wildcards in regular expressions - you don't want them -to match path separators normally. To match any file name starting with -start and ending with end write +--stats-log-level string - {{start[^/]*end\.jpg}} +Log level to show --stats output at. This can be DEBUG, INFO, NOTICE, or +ERROR. The default is INFO. This means at the default level of logging +which is NOTICE the stats won't show - if you want them to then use +--stats-log-level NOTICE. See the Logging section for more info on log +levels. -Not +--stats-one-line - {{start.*end\.jpg}} +When this is specified, rclone condenses the stats into a single line +showing the most important stats only. -Which will match a directory called start with a file called end.jpg in -it as the .* will match / characters. +--stats-one-line-date -Note that you can use -vv --dump filters to show the filter patterns in -regexp format - rclone implements the glob patterns by transforming them -into regular expressions. +When this is specified, rclone enables the single-line stats and +prepends the display with a date string. The default is +2006/01/02 15:04:05 - -Filter pattern examples +--stats-one-line-date-format - Description Pattern Matches Does not match - --------------- ---------------- ------------------------------- ------------------ - Wildcard *.jpg /file.jpg /file.png - /dir/file.jpg /dir/file.png - Rooted /*.jpg /file.jpg /file.png - /file2.jpg /dir/file.jpg - Alternates *.{jpg,png} /file.jpg /file.gif - /dir/file.png /dir/file.gif - Path Wildcard dir/** /dir/anyfile file.png - /subdir/dir/subsubdir/anyfile /subdir/file.png - Any Char *.t?t /file.txt /file.qxt - /dir/file.tzt /dir/file.png - Range *.[a-z] /file.a /file.0 - /dir/file.b /dir/file.1 - Escape *.\?\?\? /file.??? /file.abc - /dir/file.??? /dir/file.def - Class *.\d\d\d /file.012 /file.abc - /dir/file.345 /dir/file.def - Regexp *.{{jpe?g}} /file.jpeg /file.png - /dir/file.jpg /dir/file.jpeeg - Rooted Regexp /{{.*\.jpe?g}} /file.jpeg /file.png - /file.jpg /dir/file.jpg +When this is specified, rclone enables the single-line stats and +prepends the display with a user-supplied date string. The date string +MUST be enclosed in quotes. Follow golang specs for date formatting +syntax. -How filter rules are applied to files +--stats-unit=bits|bytes -Rclone path/file name filters are made up of one or more of the -following flags: +By default, data transfer rates will be printed in bytes per second. -- --include -- --include-from -- --exclude -- --exclude-from -- --filter -- --filter-from +This option allows the data rate to be printed in bits per second. -There can be more than one instance of individual flags. +Data transfer volume will still be reported in bytes. -Rclone internally uses a combined list of all the include and exclude -rules. The order in which rules are processed can influence the result -of the filter. +The rate is reported as a binary unit, not SI unit. So 1 Mbit/s equals +1,048,576 bit/s and not 1,000,000 bit/s. -All flags of the same type are processed together in the order above, -regardless of what order the different types of flags are included on -the command line. +The default is bytes. -Multiple instances of the same flag are processed from left to right -according to their position in the command line. +--suffix=SUFFIX -To mix up the order of processing includes and excludes use --filter... -flags. +When using sync, copy or move any files which would have been +overwritten or deleted will have the suffix added to them. If there is a +file with the same path (after the suffix has been added), then it will +be overwritten. -Within --include-from, --exclude-from and --filter-from flags rules are -processed from top to bottom of the referenced file. +The remote in use must support server-side move or copy and you must use +the same remote as the destination of the sync. -If there is an --include or --include-from flag specified, rclone -implies a - ** rule which it adds to the bottom of the internal rule -list. Specifying a + rule with a --filter... flag does not imply that -rule. +This is for use with files to add the suffix in the current directory or +with --backup-dir. See --backup-dir for more info. -Each path/file name passed through rclone is matched against the -combined filter list. At first match to a rule the path/file name is -included or excluded and no further filter rules are processed for that -path/file. +For example -If rclone does not find a match, after testing against all rules -(including the implied rule if appropriate), the path/file name is -included. + rclone copy --interactive /path/to/local/file remote:current --suffix .bak -Any path/file included at that stage is processed by the rclone command. +will copy /path/to/local to remote:current, but for any files which +would have been updated or deleted have .bak added. ---files-from and --files-from-raw flags over-ride and cannot be combined -with other filter options. +If using rclone sync with --suffix and without --backup-dir then it is +recommended to put a filter rule in excluding the suffix otherwise the +sync will delete the backup files. -To see the internal combined rule list, in regular expression form, for -a command add the --dump filters flag. Running an rclone command with ---dump filters and -vv flags lists the internal filter elements and -shows how they are applied to each source path/file. There is not -currently a means provided to pass regular expression filter options -into rclone directly though character class filter rules contain -character classes. Go regular expression reference + rclone sync --interactive /path/to/local/file remote:current --suffix .bak --exclude "*.bak" -How filter rules are applied to directories +--suffix-keep-extension -Rclone commands are applied to path/file names not directories. The -entire contents of a directory can be matched to a filter by the pattern -directory/* or recursively by directory/**. +When using --suffix, setting this causes rclone put the SUFFIX before +the extension of the files that it backs up rather than after. -Directory filter rules are defined with a closing / separator. +So let's say we had --suffix -2019-01-01, without the flag file.txt +would be backed up to file.txt-2019-01-01 and with the flag it would be +backed up to file-2019-01-01.txt. This can be helpful to make sure the +suffixed files can still be opened. -E.g. /directory/subdirectory/ is an rclone directory filter rule. +If a file has two (or more) extensions and the second (or subsequent) +extension is recognised as a valid mime type, then the suffix will go +before that extension. So file.tar.gz would be backed up to +file-2019-01-01.tar.gz whereas file.badextension.gz would be backed up +to file.badextension-2019-01-01.gz. -Rclone commands can use directory filter rules to determine whether they -recurse into subdirectories. This potentially optimises access to a -remote by avoiding listing unnecessary directories. Whether optimisation -is desirable depends on the specific filter rules and source remote -content. +--syslog -If any regular expression filters are in use, then no directory -recursion optimisation is possible, as rclone must check every path -against the supplied regular expression(s). +On capable OSes (not Windows or Plan9) send all log output to syslog. -Directory recursion optimisation occurs if either: +This can be useful for running rclone in a script or rclone mount. -- A source remote does not support the rclone ListR primitive. local, - sftp, Microsoft OneDrive and WebDAV do not support ListR. Google - Drive and most bucket type storage do. Full list +--syslog-facility string -- On other remotes (those that support ListR), if the rclone command - is not naturally recursive, and provided it is not run with the - --fast-list flag. ls, lsf -R and size are naturally recursive but - sync, copy and move are not. +If using --syslog this sets the syslog facility (e.g. KERN, USER). See +man syslog for a list of possible facilities. The default facility is +DAEMON. -- Whenever the --disable ListR flag is applied to an rclone command. +--temp-dir=DIR -Rclone commands imply directory filter rules from path/file filter -rules. To view the directory filter rules rclone has implied for a -command specify the --dump filters flag. +Specify the directory rclone will use for temporary files, to override +the default. Make sure the directory exists and have accessible +permissions. -E.g. for an include rule +By default the operating system's temp directory will be used: - On Unix +systems, $TMPDIR if non-empty, else /tmp. - On Windows, the first +non-empty value from %TMP%, %TEMP%, %USERPROFILE%, or the Windows +directory. - /a/*.jpg +When overriding the default with this option, the specified path will be +set as value of environment variable TMPDIR on Unix systems and TMP and +TEMP on Windows. -Rclone implies the directory include rule +You can use the config paths command to see the current value. - /a/ +--tpslimit float -Directory filter rules specified in an rclone command can limit the -scope of an rclone command but path/file filters still have to be -specified. +Limit transactions per second to this number. Default is 0 which is used +to mean unlimited transactions per second. -E.g. rclone ls remote: --include /directory/ will not match any files. -Because it is an --include option the --exclude ** rule is implied, and -the /directory/ pattern serves only to optimise access to the remote by -ignoring everything outside of that directory. +A transaction is roughly defined as an API call; its exact meaning will +depend on the backend. For HTTP based backends it is an HTTP +PUT/GET/POST/etc and its response. For FTP/SFTP it is a round trip +transaction over TCP. -E.g. rclone ls remote: --filter-from filter-list.txt with a file -filter-list.txt: +For example, to limit rclone to 10 transactions per second use +--tpslimit 10, or to 1 transaction every 2 seconds use --tpslimit 0.5. - - /dir1/ - - /dir2/ - + *.pdf - - ** +Use this when the number of transactions per second from rclone is +causing a problem with the cloud storage provider (e.g. getting you +banned or rate limited). -All files in directories dir1 or dir2 or their subdirectories are -completely excluded from the listing. Only files of suffix pdf in the -root of remote: or its subdirectories are listed. The - ** rule prevents -listing of any path/files not previously matched by the rules above. +This can be very useful for rclone mount to control the behaviour of +applications using it. -Option exclude-if-present creates a directory exclude rule based on the -presence of a file in a directory and takes precedence over other rclone -directory filter rules. +This limit applies to all HTTP based backends and to the FTP and SFTP +backends. It does not apply to the local backend or the Storj backend. -When using pattern list syntax, if a pattern item contains either / or -**, then rclone will not able to imply a directory filter rule from this -pattern list. +See also --tpslimit-burst. -E.g. for an include rule +--tpslimit-burst int - {dir1/**,dir2/**} +Max burst of transactions for --tpslimit (default 1). -Rclone will match files below directories dir1 or dir2 only, but will -not be able to use this filter to exclude a directory dir3 from being -traversed. +Normally --tpslimit will do exactly the number of transaction per second +specified. However if you supply --tps-burst then rclone can save up +some transactions from when it was idle giving a burst of up to the +parameter supplied. -Directory recursion optimisation may affect performance, but normally -not the result. One exception to this is sync operations with option ---create-empty-src-dirs, where any traversed empty directories will be -created. With the pattern list example {dir1/**,dir2/**} above, this -would create an empty directory dir3 on destination (when it exists on -source). Changing the filter to {dir1,dir2}/**, or splitting it into two -include rules --include dir1/** --include dir2/**, will match the same -files while also filtering directories, with the result that an empty -directory dir3 will no longer be created. +For example if you provide --tpslimit-burst 10 then if rclone has been +idle for more than 10*--tpslimit then it can do 10 transactions very +quickly before they are limited again. ---exclude - Exclude files matching pattern +This may be used to increase performance of --tpslimit without changing +the long term average number of transactions per second. -Excludes path/file names from an rclone command based on a single -exclude rule. +--track-renames -This flag can be repeated. See above for the order filter flags are -processed in. +By default, rclone doesn't keep track of renamed files, so if you rename +a file locally then sync it to a remote, rclone will delete the old file +on the remote and upload a new copy. ---exclude should not be used with --include, --include-from, --filter or ---filter-from flags. +An rclone sync with --track-renames runs like a normal sync, but keeps +track of objects which exist in the destination but not in the source +(which would normally be deleted), and which objects exist in the source +but not the destination (which would normally be transferred). These +objects are then candidates for renaming. ---exclude has no effect when combined with --files-from or ---files-from-raw flags. +After the sync, rclone matches up the source only and destination only +objects using the --track-renames-strategy specified and either renames +the destination object or transfers the source and deletes the +destination object. --track-renames is stateless like all of rclone's +syncs. -E.g. rclone ls remote: --exclude *.bak excludes all .bak files from -listing. +To use this flag the destination must support server-side copy or +server-side move, and to use a hash based --track-renames-strategy (the +default) the source and the destination must have a compatible hash. -E.g. rclone size remote: "--exclude /dir/**" returns the total size of -all files on remote: excluding those in root directory dir and sub -directories. +If the destination does not support server-side copy or move, rclone +will fall back to the default behaviour and log an error level message +to the console. -E.g. on Microsoft Windows rclone ls remote: --exclude "*\[{JP,KR,HK}\]*" -lists the files in remote: without [JP] or [KR] or [HK] in their name. -Quotes prevent the shell from interpreting the \ characters.\ characters -escape the [ and ] so an rclone filter treats them literally rather than -as a character-range. The { and } define an rclone pattern list. For -other operating systems single quotes are required ie -rclone ls remote: --exclude '*\[{JP,KR,HK}\]*' +Encrypted destinations are not currently supported by --track-renames if +--track-renames-strategy includes hash. ---exclude-from - Read exclude patterns from file +Note that --track-renames is incompatible with --no-traverse and that it +uses extra memory to keep track of all the rename candidates. -Excludes path/file names from an rclone command based on rules in a -named file. The file contains a list of remarks and pattern rules. +Note also that --track-renames is incompatible with --delete-before and +will select --delete-after instead of --delete-during. -For an example exclude-file.txt: +--track-renames-strategy (hash,modtime,leaf,size) - # a sample exclude rule file - *.bak - file2.jpg +This option changes the file matching criteria for --track-renames. -rclone ls remote: --exclude-from exclude-file.txt lists the files on -remote: except those named file2.jpg or with a suffix .bak. That is -equivalent to rclone ls remote: --exclude file2.jpg --exclude "*.bak". +The matching is controlled by a comma separated selection of these +tokens: -This flag can be repeated. See above for the order filter flags are -processed in. +- modtime - the modification time of the file - not supported on all + backends +- hash - the hash of the file contents - not supported on all backends +- leaf - the name of the file not including its directory name +- size - the size of the file (this is always enabled) -The --exclude-from flag is useful where multiple exclude filter rules -are applied to an rclone command. +The default option is hash. ---exclude-from should not be used with --include, --include-from, ---filter or --filter-from flags. +Using --track-renames-strategy modtime,leaf would match files based on +modification time, the leaf of the file name and the size only. ---exclude-from has no effect when combined with --files-from or ---files-from-raw flags. +Using --track-renames-strategy modtime or leaf can enable +--track-renames support for encrypted destinations. ---exclude-from followed by - reads filter rules from standard input. +Note that the hash strategy is not supported with encrypted +destinations. ---include - Include files matching pattern +--delete-(before,during,after) -Adds a single include rule based on path/file names to an rclone -command. +This option allows you to specify when files on your destination are +deleted when you sync folders. -This flag can be repeated. See above for the order filter flags are -processed in. +Specifying the value --delete-before will delete all files present on +the destination, but not on the source before starting the transfer of +any new or updated files. This uses two passes through the file systems, +one for the deletions and one for the copies. ---include has no effect when combined with --files-from or ---files-from-raw flags. +Specifying --delete-during will delete files while checking and +uploading files. This is the fastest option and uses the least memory. ---include implies --exclude ** at the end of an rclone internal filter -list. Therefore if you mix --include and --include-from flags with ---exclude, --exclude-from, --filter or --filter-from, you must use -include rules for all the files you want in the include statement. For -more flexibility use the --filter-from flag. +Specifying --delete-after (the default value) will delay deletion of +files until all new/updated files have been successfully transferred. +The files to be deleted are collected in the copy pass then deleted +after the copy pass has completed successfully. The files to be deleted +are held in memory so this mode may use more memory. This is the safest +mode as it will only delete files if there have been no errors +subsequent to that. If there have been errors before the deletions start +then you will get the message +not deleting files as there were IO errors. -E.g. rclone ls remote: --include "*.{png,jpg}" lists the files on -remote: with suffix .png and .jpg. All other files are excluded. +--fast-list -E.g. multiple rclone copy commands can be combined with --include and a -pattern-list. +When doing anything which involves a directory listing (e.g. sync, copy, +ls - in fact nearly every command), rclone has different strategies to +choose from. + +The basic strategy is to list one directory and processes it before +using more directory lists to process any subdirectories. This is a +mandatory backend feature, called List, which means it is supported by +all backends. This strategy uses small amount of memory, and because it +can be parallelised it is fast for operations involving processing of +the list results. + +Some backends provide the support for an alternative strategy, where all +files beneath a directory can be listed in one (or a small number) of +transactions. Rclone supports this alternative strategy through an +optional backend feature called ListR. You can see in the storage system +overview documentation's optional features section which backends it is +enabled for (these tend to be the bucket-based ones, e.g. S3, B2, GCS, +Swift). This strategy requires fewer transactions for highly recursive +operations, which is important on backends where this is charged or +heavily rate limited. It may be faster (due to fewer transactions) or +slower (because it can't be parallelized) depending on different +parameters, and may require more memory if rclone has to keep the whole +listing in memory. + +Which listing strategy rclone picks for a given operation is +complicated, but in general it tries to choose the best possible. It +will prefer ListR in situations where it doesn't need to store the +listed files in memory, e.g. for unlimited recursive ls command +variants. In other situations it will prefer List, e.g. for sync and +copy, where it needs to keep the listed files in memory, and is +performing operations on them where parallelization may be a huge +advantage. + +Rclone is not able to take all relevant parameters into account for +deciding the best strategy, and therefore allows you to influence the +choice in two ways: You can stop rclone from using ListR by disabling +the feature, using the --disable option (--disable ListR), or you can +allow rclone to use ListR where it would normally choose not to do so +due to higher memory usage, using the --fast-list option. Rclone should +always produce identical results either way. Using --disable ListR or +--fast-list on a remote which doesn't support ListR does nothing, rclone +will just ignore it. - rclone copy /vol1/A remote:A - rclone copy /vol1/B remote:B +A rule of thumb is that if you pay for transactions and can fit your +entire sync listing into memory, then --fast-list is recommended. If you +have a very big sync to do, then don't use --fast-list, otherwise you +will run out of memory. Run some tests and compare before you decide, +and if in doubt then just leave the default, let rclone decide, i.e. not +use --fast-list. -is equivalent to: +--timeout=TIME - rclone copy /vol1 remote: --include "{A,B}/**" +This sets the IO idle timeout. If a transfer has started but then +becomes idle for this long it is considered broken and disconnected. -E.g. rclone ls remote:/wheat --include "??[^[:punct:]]*" lists the files -remote: directory wheat (and subdirectories) whose third character is -not punctuation. This example uses an ASCII character class. +The default is 5m. Set to 0 to disable. ---include-from - Read include patterns from file +--transfers=N -Adds path/file names to an rclone command based on rules in a named -file. The file contains a list of remarks and pattern rules. +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. -For an example include-file.txt: +The default is to run 4 file transfers in parallel. - # a sample include rule file - *.jpg - file2.avi +Look at --multi-thread-streams if you would like to control single file +transfers. -rclone ls remote: --include-from include-file.txt lists the files on -remote: with name file2.avi or suffix .jpg. That is equivalent to -rclone ls remote: --include file2.avi --include "*.jpg". +-u, --update -This flag can be repeated. See above for the order filter flags are -processed in. +This forces rclone to skip any files which exist on the destination and +have a modified time that is newer than the source file. -The --include-from flag is useful where multiple include filter rules -are applied to an rclone command. +This can be useful in avoiding needless transfers when transferring to a +remote which doesn't support modification times directly (or when using +--use-server-modtime to avoid extra API calls) as it is more accurate +than a --size-only check and faster than using --checksum. On such +remotes (or when using --use-server-modtime) the time checked will be +the uploaded time. ---include-from implies --exclude ** at the end of an rclone internal -filter list. Therefore if you mix --include and --include-from flags -with --exclude, --exclude-from, --filter or --filter-from, you must use -include rules for all the files you want in the include statement. For -more flexibility use the --filter-from flag. +If an existing destination file has a modification time older than the +source file's, it will be updated if the sizes are different. If the +sizes are the same, it will be updated if the checksum is different or +not available. ---exclude-from has no effect when combined with --files-from or ---files-from-raw flags. +If an existing destination file has a modification time equal (within +the computed modify window) to the source file's, it will be updated if +the sizes are different. The checksum will not be checked in this case +unless the --checksum flag is provided. ---exclude-from followed by - reads filter rules from standard input. +In all other cases the file will not be updated. ---filter - Add a file-filtering rule +Consider using the --modify-window flag to compensate for time skews +between the source and the backend, for backends that do not support mod +times, and instead use uploaded times. However, if the backend does not +support checksums, note that syncing or copying within the time skew +window may still result in additional transfers for safety. -Specifies path/file names to an rclone command, based on a single -include or exclude rule, in + or - format. +--use-mmap -This flag can be repeated. See above for the order filter flags are -processed in. +If this flag is set then rclone will use anonymous memory allocated by +mmap on Unix based platforms and VirtualAlloc on Windows for its +transfer buffers (size controlled by --buffer-size). Memory allocated +like this does not go on the Go heap and can be returned to the OS +immediately when it is finished with. ---filter + differs from --include. In the case of --include rclone -implies an --exclude * rule which it adds to the bottom of the internal -rule list. --filter...+ does not imply that rule. +If this flag is not set then rclone will allocate and free the buffers +using the Go memory allocator which may use more memory as memory pages +are returned less aggressively to the OS. ---filter has no effect when combined with --files-from or ---files-from-raw flags. +It is possible this does not work well on all platforms so it is +disabled by default; in the future it may be enabled by default. ---filter should not be used with --include, --include-from, --exclude or ---exclude-from flags. +--use-server-modtime -E.g. rclone ls remote: --filter "- *.bak" excludes all .bak files from a -list of remote:. +Some object-store backends (e.g, Swift, S3) do not preserve file +modification times (modtime). On these backends, rclone stores the +original modtime as additional metadata on the object. By default it +will make an API call to retrieve the metadata when the modtime is +needed by an operation. ---filter-from - Read filtering patterns from a file +Use this flag to disable the extra API call and rely instead on the +server's modified time. In cases such as a local to remote sync using +--update, knowing the local file is newer than the time it was last +uploaded to the remote is sufficient. In those cases, this flag can +speed up the process and reduce the number of API calls necessary. -Adds path/file names to an rclone command based on rules in a named -file. The file contains a list of remarks and pattern rules. Include -rules start with + and exclude rules with -. ! clears existing rules. -Rules are processed in the order they are defined. +Using this flag on a sync operation without also using --update would +cause all files modified at any time other than the last upload time to +be uploaded again, which is probably not what you want. -This flag can be repeated. See above for the order filter flags are -processed in. +-v, -vv, --verbose -Arrange the order of filter rules with the most restrictive first and -work down. +With -v rclone will tell you about each file that is transferred and a +small number of significant events. -E.g. for filter-file.txt: +With -vv rclone will become very verbose telling you about every file it +considers and transfers. Please send bug reports with a log with this +setting. - # a sample filter rule file - - secret*.jpg - + *.jpg - + *.png - + file2.avi - - /dir/Trash/** - + /dir/** - # exclude everything else - - * +When setting verbosity as an environment variable, use RCLONE_VERBOSE=1 +or RCLONE_VERBOSE=2 for -v and -vv respectively. -rclone ls remote: --filter-from filter-file.txt lists the path/files on -remote: including all jpg and png files, excluding any matching -secret*.jpg and including file2.avi. It also includes everything in the -directory dir at the root of remote, except remote:dir/Trash which it -excludes. Everything else is excluded. +-V, --version -E.g. for an alternative filter-file.txt: +Prints the version number - - secret*.jpg - + *.jpg - + *.png - + file2.avi - - * +SSL/TLS options -Files file1.jpg, file3.png and file2.avi are listed whilst secret17.jpg -and files without the suffix .jpgor.png` are excluded. +The outgoing SSL/TLS connections rclone makes can be controlled with +these options. For example this can be very useful with the HTTP or +WebDAV backends. Rclone HTTP servers have their own set of configuration +for SSL/TLS which you can find in their documentation. -E.g. for an alternative filter-file.txt: +--ca-cert stringArray - + *.jpg - + *.gif - ! - + 42.doc - - * +This loads the PEM encoded certificate authority certificates and uses +it to verify the certificates of the servers rclone connects to. -Only file 42.doc is listed. Prior rules are cleared by the !. +If you have generated certificates signed with a local CA then you will +need this flag to connect to servers using those certificates. ---files-from - Read list of source-file names +--client-cert string -Adds path/files to an rclone command from a list in a named file. Rclone -processes the path/file names in the order of the list, and no others. +This loads the PEM encoded client side certificate. -Other filter flags (--include, --include-from, --exclude, ---exclude-from, --filter and --filter-from) are ignored when ---files-from is used. +This is used for mutual TLS authentication. ---files-from expects a list of files as its input. Leading or trailing -whitespace is stripped from the input lines. Lines starting with # or ; -are ignored. +The --client-key flag is required too when using this. -Rclone commands with a --files-from flag traverse the remote, treating -the names in --files-from as a set of filters. +--client-key string -If the --no-traverse and --files-from flags are used together an rclone -command does not traverse the remote. Instead it addresses each -path/file named in the file individually. For each path/file name, that -requires typically 1 API call. This can be efficient for a short ---files-from list and a remote containing many files. +This loads the PEM encoded client side private key used for mutual TLS +authentication. Used in conjunction with --client-cert. -Rclone commands do not error if any names in the --files-from file are -missing from the source remote. +--no-check-certificate=true/false -The --files-from flag can be repeated in a single rclone command to read -path/file names from more than one file. The files are read from left to -right along the command line. +--no-check-certificate controls whether a client verifies the server's +certificate chain and host name. If --no-check-certificate 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. -Paths within the --files-from file are interpreted as starting with the -root specified in the rclone command. Leading / separators are ignored. -See --files-from-raw if you need the input to be processed in a raw -manner. +This option defaults to false. -E.g. for a file files-from.txt: +This should be used only for testing. - # comment - file1.jpg - subdir/file2.jpg +Configuration Encryption -rclone copy --files-from files-from.txt /home/me/pics remote:pics copies -the following, if they exist, and only those files. +Your configuration file contains information for logging in to your +cloud services. This means that you should keep your rclone.conf file in +a secure location. - /home/me/pics/file1.jpg → remote:pics/file1.jpg - /home/me/pics/subdir/file2.jpg → remote:pics/subdir/file2.jpg +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 supply +the password every time you start rclone. -E.g. to copy the following files referenced by their absolute paths: +To add a password to your rclone configuration, execute rclone config. - /home/user1/42 - /home/user1/dir/ford - /home/user2/prefect + >rclone config + Current remotes: -First find a common subdirectory - in this case /home and put the -remaining files in files-from.txt with or without leading /, e.g. + e) Edit existing remote + n) New remote + d) Delete remote + s) Set configuration password + q) Quit config + e/n/d/s/q> - user1/42 - user1/dir/ford - user2/prefect +Go into s, Set configuration password: -Then copy these to a remote: + 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> - rclone copy --files-from files-from.txt /home remote:backup +Your configuration is now encrypted, and every time you start rclone you +will have to supply the password. See below for details. In the same +menu, you can change the password or completely remove encryption from +your configuration. -The three files are transferred as follows: +There is no way to recover the configuration if you lose your password. - /home/user1/42 → remote:backup/user1/important - /home/user1/dir/ford → remote:backup/user1/dir/file - /home/user2/prefect → remote:backup/user2/stuff +rclone uses nacl secretbox which in turn 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. -Alternatively if / is chosen as root files-from.txt will be: +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. - /home/user1/42 - /home/user1/dir/ford - /home/user2/prefect +If it is safe in your environment, you can set the RCLONE_CONFIG_PASS +environment variable to contain your password, in which case it will be +used for decrypting the configuration. -The copy command will be: +You can set this for a session from a script. For unix like systems save +this to a file called set-rclone-password: - rclone copy --files-from files-from.txt / remote:backup + #!/bin/echo Source this file don't run it -Then there will be an extra home directory on the remote: + read -s RCLONE_CONFIG_PASS + export RCLONE_CONFIG_PASS - /home/user1/42 → remote:backup/home/user1/42 - /home/user1/dir/ford → remote:backup/home/user1/dir/ford - /home/user2/prefect → remote:backup/home/user2/prefect +Then source the file when you want to use it. From the shell you would +do source set-rclone-password. It will then ask you for the password and +set it in the environment variable. ---files-from-raw - Read list of source-file names without any processing +An alternate means of supplying the password is to provide a script +which will retrieve the password and print on standard output. This +script should have a fully specified path name and not rely on any +environment variables. The script is supplied either via +--password-command="..." command line argument or via the +RCLONE_PASSWORD_COMMAND environment variable. -This flag is the same as --files-from except that input is read in a raw -manner. Lines with leading / trailing whitespace, and lines starting -with ; or # are read without any processing. rclone lsf has a compatible -format that can be used to export file lists from remotes for input to ---files-from-raw. +One useful example of this is using the passwordstore application to +retrieve the password: ---ignore-case - make searches case insensitive + export RCLONE_PASSWORD_COMMAND="pass rclone/config" -By default, rclone filter patterns are case sensitive. The --ignore-case -flag makes all of the filters patterns on the command line case -insensitive. +If the passwordstore password manager holds the password for the rclone +configuration, using the script method means the password is primarily +protected by the passwordstore system, and is never embedded in the +clear in scripts, nor available for examination using the standard +commands available. It is quite possible with long running rclone +sessions for copies of passwords to be innocently captured in log files +or terminal scroll buffers, etc. Using the script method of supplying +the password enhances the security of the config password considerably. -E.g. --include "zaphod.txt" does not match a file Zaphod.txt. With ---ignore-case a match is made. +If you are running rclone inside a script, unless you are using the +--password-command method, you might want to disable password prompts. +To do that, pass the parameter --ask-password=false to rclone. This will +make rclone fail instead of asking for a password if RCLONE_CONFIG_PASS +doesn't contain a valid password, and --password-command has not been +supplied. -Quoting shell metacharacters +Whenever running commands that may be affected by options in a +configuration file, rclone will look for an existing file according to +the rules described above, and load any it finds. If an encrypted file +is found, this includes decrypting it, with the possible consequence of +a password prompt. When executing a command line that you know are not +actually using anything from such a configuration file, you can avoid it +being loaded by overriding the location, e.g. with one of the documented +special values for memory-only configuration. Since only backend options +can be stored in configuration files, this is normally unnecessary for +commands that do not operate on backends, e.g. genautocomplete. However, +it will be relevant for commands that do operate on backends in general, +but are used without referencing a stored remote, e.g. listing local +filesystem paths, or connection strings: rclone --config="" ls . -Rclone commands with filter patterns containing shell metacharacters may -not as work as expected in your shell and may require quoting. +Developer options -E.g. linux, OSX (* metacharacter) +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 e.g. +--drive-test-option - see the docs for the remote in question. -- --include \*.jpg -- --include '*.jpg' -- --include='*.jpg' +--cpuprofile=FILE -Microsoft Windows expansion is done by the command, not shell, so ---include *.jpg does not require quoting. +Write CPU profile to file. This can be analysed with go tool pprof. -If the rclone error -Command .... needs .... arguments maximum: you provided .... non flag arguments: -is encountered, the cause is commonly spaces within the name of a remote -or flag value. The fix then is to quote values containing spaces. +--dump flag,flag,flag -Other filters +The --dump flag takes a comma separated list of flags to dump info +about. ---min-size - Don't transfer any file smaller than this +Note that some headers including Accept-Encoding as shown may not be +correct in the request and the response may not show Content-Encoding if +the go standard libraries auto gzip encoding was in effect. In this case +the body of the request will be gunzipped before showing it. -Controls the minimum size file within the scope of an rclone command. -Default units are KiB but abbreviations K, M, G, T or P are valid. +The available flags are: -E.g. rclone ls remote: --min-size 50k lists files on remote: of 50 KiB -size or larger. +--dump headers -See the size option docs for more info. +Dump HTTP headers with Authorization: lines removed. May still contain +sensitive info. Can be very verbose. Useful for debugging only. ---max-size - Don't transfer any file larger than this +Use --dump auth if you do want the Authorization: headers. -Controls the maximum size file within the scope of an rclone command. -Default units are KiB but abbreviations K, M, G, T or P are valid. +--dump bodies -E.g. rclone ls remote: --max-size 1G lists files on remote: of 1 GiB -size or smaller. +Dump HTTP headers and bodies - may contain sensitive info. Can be very +verbose. Useful for debugging only. -See the size option docs for more info. +Note that the bodies are buffered in memory so don't use this for +enormous files. ---max-age - Don't transfer any file older than this +--dump requests -Controls the maximum age of files within the scope of an rclone command. +Like --dump bodies but dumps the request bodies and the response +headers. Useful for debugging download problems. ---max-age applies only to files and not to directories. +--dump responses -E.g. rclone ls remote: --max-age 2d lists files on remote: of 2 days old -or less. +Like --dump bodies but dumps the response bodies and the request +headers. Useful for debugging upload problems. -See the time option docs for valid formats. +--dump auth ---min-age - Don't transfer any file younger than this +Dump HTTP headers - will contain sensitive info such as Authorization: +headers - use --dump headers to dump without Authorization: headers. Can +be very verbose. Useful for debugging only. -Controls the minimum age of files within the scope of an rclone command. -(see --max-age for valid formats) +--dump filters ---min-age applies only to files and not to directories. +Dump the filters to the output. Useful to see exactly what include and +exclude options are filtering on. -E.g. rclone ls remote: --min-age 2d lists files on remote: of 2 days old -or more. +--dump goroutines -See the time option docs for valid formats. +This dumps a list of the running go-routines at the end of the command +to standard output. -Other flags +--dump openfiles ---delete-excluded - Delete files on dest excluded from sync +This dumps a list of the open files at the end of the command. It uses +the lsof command to do that so you'll need that installed to use it. -Important this flag is dangerous to your data - use with --dry-run and --v first. +--dump mapper -In conjunction with rclone sync, --delete-excluded deletes any files on -the destination which are excluded from the command. +This shows the JSON blobs being sent to the program supplied with +--metadata-mapper and received from it. It can be useful for debugging +the metadata mapper interface. -E.g. the scope of rclone sync --interactive A: B: can be restricted: +--memprofile=FILE - rclone --min-size 50k --delete-excluded sync A: B: +Write memory profile to file. This can be analysed with go tool pprof. -All files on B: which are less than 50 KiB are deleted because they are -excluded from the rclone sync command. +Filtering ---dump filters - dump the filters to the output +For the filtering options -Dumps the defined filters to standard output in regular expression -format. +- --delete-excluded +- --filter +- --filter-from +- --exclude +- --exclude-from +- --exclude-if-present +- --include +- --include-from +- --files-from +- --files-from-raw +- --min-size +- --max-size +- --min-age +- --max-age +- --dump filters +- --metadata-include +- --metadata-include-from +- --metadata-exclude +- --metadata-exclude-from +- --metadata-filter +- --metadata-filter-from -Useful for debugging. +See the filtering section. -Exclude directory based on a file +Remote control -The --exclude-if-present flag controls whether a directory is within the -scope of an rclone command based on the presence of a named file within -it. The flag can be repeated to check for multiple file names, presence -of any of them will exclude the directory. +For the remote control options and for instructions on how to remote +control rclone -This flag has a priority over other filter flags. +- --rc +- and anything starting with --rc- -E.g. for the following directory structure: +See the remote control section. - dir1/file1 - dir1/dir2/file2 - dir1/dir2/dir3/file3 - dir1/dir2/dir3/.ignore +Logging -The command rclone ls --exclude-if-present .ignore dir1 does not list -dir3, file3 or .ignore. +rclone has 4 levels of logging, ERROR, NOTICE, INFO and DEBUG. -Metadata filters +By default, rclone logs to standard error. This means you can redirect +standard error and still see the normal output of rclone commands (e.g. +rclone ls). -The metadata filters work in a very similar way to the normal file name -filters, except they match metadata on the object. +By default, rclone will produce Error and Notice level messages. -The metadata should be specified as key=value patterns. This may be -wildcarded using the normal filter patterns or regular expressions. +If you use the -q flag, rclone will only produce Error messages. -For example if you wished to list only local files with a mode of 100664 -you could do that with: +If you use the -v flag, rclone will produce Error, Notice and Info +messages. - rclone lsf -M --files-only --metadata-include "mode=100664" . +If you use the -vv flag, rclone will produce Error, Notice, Info and +Debug messages. -Or if you wished to show files with an atime, mtime or btime at a given -date: +You can also control the log levels with the --log-level flag. - rclone lsf -M --files-only --metadata-include "[abm]time=2022-12-16*" . +If you use the --log-file=FILE option, rclone will redirect Error, Info +and Debug messages along with standard error to FILE. -Like file filtering, metadata filtering only applies to files not to -directories. +If you use the --syslog flag then rclone will log to syslog and the +--syslog-facility control which facility it uses. -The filters can be applied using these flags. +Rclone prefixes all log messages with their level in capitals, e.g. INFO +which makes it easy to grep the log file for different kinds of +information. -- --metadata-include - Include metadatas matching pattern -- --metadata-include-from - Read metadata include patterns from file - (use - to read from stdin) -- --metadata-exclude - Exclude metadatas matching pattern -- --metadata-exclude-from - Read metadata exclude patterns from file - (use - to read from stdin) -- --metadata-filter - Add a metadata filtering rule -- --metadata-filter-from - Read metadata filtering patterns from a - file (use - to read from stdin) +Exit Code -Each flag can be repeated. See the section on how filter rules are -applied for more details - these flags work in an identical way to the -file name filtering flags, but instead of file name patterns have -metadata patterns. +If any errors occur during the command execution, rclone will exit with +a non-zero exit code. This allows scripts to detect when rclone +operations have failed. -Common pitfalls +During the startup phase, rclone will exit immediately if an error is +detected in the configuration. There will always be a log message +immediately before exiting. -The most frequent filter support issues on the rclone forum are: +When rclone is running it will accumulate errors as it goes along, and +only exit with a non-zero exit code if (after retries) there were still +failed transfers. For every error counted there will be a high priority +log message (visible with -q) showing the message and which file caused +the problem. A high priority message is also shown when starting a retry +so the user can see that any previous error messages may not be valid +after the retry. If rclone has done a retry it will log a high priority +message if the retry was successful. -- Not using paths relative to the root of the remote -- Not using / to match from the root of a remote -- Not using ** to match the contents of a directory +List of exit codes -GUI (Experimental) +- 0 - success +- 1 - Syntax or usage error +- 2 - Error not otherwise categorised +- 3 - Directory not found +- 4 - File not found +- 5 - Temporary error (one that more retries might fix) (Retry errors) +- 6 - Less serious errors (like 461 errors from dropbox) (NoRetry + errors) +- 7 - Fatal error (one that more retries won't fix, like account + suspended) (Fatal errors) +- 8 - Transfer exceeded - limit set by --max-transfer reached +- 9 - Operation successful, but no files transferred +- 10 - Duration exceeded - limit set by --max-duration reached -Rclone can serve a web based GUI (graphical user interface). This is -somewhat experimental at the moment so things may be subject to change. +Environment Variables -Run this command in a terminal and rclone will download and then display -the GUI in a web browser. +Rclone can be configured entirely using environment variables. These can +be used to set defaults for options or config file entries. - rclone rcd --rc-web-gui +Options -This will produce logs like this and rclone needs to continue to run to -serve the GUI: +Every option in rclone can have its default set by environment variable. - 2019/08/25 11:40:14 NOTICE: A new release for gui is present at https://github.com/rclone/rclone-webui-react/releases/download/v0.0.6/currentbuild.zip - 2019/08/25 11:40:14 NOTICE: Downloading webgui binary. Please wait. [Size: 3813937, Path : /home/USER/.cache/rclone/webgui/v0.0.6.zip] - 2019/08/25 11:40:16 NOTICE: Unzipping - 2019/08/25 11:40:16 NOTICE: Serving remote control on http://127.0.0.1:5572/ +To find the name of the environment variable, first, take the long +option name, strip the leading --, change - to _, make upper case and +prepend RCLONE_. -This assumes you are running rclone locally on your machine. It is -possible to separate the rclone and the GUI - see below for details. +For example, to always set --stats 5s, set the environment variable +RCLONE_STATS=5s. If you set stats on the command line this will override +the environment variable setting. -If you wish to check for updates then you can add --rc-web-gui-update to -the command line. +Or to always use the trash in drive --drive-use-trash, set +RCLONE_DRIVE_USE_TRASH=true. -If you find your GUI broken, you may force it to update by add ---rc-web-gui-force-update. +Verbosity is slightly different, the environment variable equivalent of +--verbose or -v is RCLONE_VERBOSE=1, or for -vv, RCLONE_VERBOSE=2. -By default, rclone will open your browser. Add ---rc-web-gui-no-open-browser to disable this feature. +The same parser is used for the options and the environment variables so +they take exactly the same form. -Using the GUI +The options set by environment variables can be seen with the -vv flag, +e.g. rclone version -vv. -Once the GUI opens, you will be looking at the dashboard which has an -overall overview. +Config file -On the left hand side you will see a series of view buttons you can -click on: +You can set defaults for values in the config file on an individual +remote basis. The names of the config items are documented in the page +for each backend. -- Dashboard - main overview -- Configs - examine and create new configurations -- Explorer - view, download and upload files to the cloud storage - systems -- Backend - view or alter the backend config -- Log out +To find the name of the environment variable, you need to set, take +RCLONE_CONFIG_ + name of remote + _ + name of config file option and +make it all uppercase. Note one implication here is the remote's name +must be convertible into a valid environment variable name, so it can +only contain letters, digits, or the _ (underscore) character. -(More docs and walkthrough video to come!) +For example, to configure an S3 remote named mys3: without a config file +(using unix ways of setting environment variables): -How it works + $ export RCLONE_CONFIG_MYS3_TYPE=s3 + $ export RCLONE_CONFIG_MYS3_ACCESS_KEY_ID=XXX + $ export RCLONE_CONFIG_MYS3_SECRET_ACCESS_KEY=XXX + $ rclone lsd mys3: + -1 2016-09-21 12:54:21 -1 my-bucket + $ rclone listremotes | grep mys3 + mys3: -When you run the rclone rcd --rc-web-gui this is what happens +Note that if you want to create a remote using environment variables you +must create the ..._TYPE variable as above. -- Rclone starts but only runs the remote control API ("rc"). -- The API is bound to localhost with an auto-generated username and - password. -- If the API bundle is missing then rclone will download it. -- rclone will start serving the files from the API bundle over the - same port as the API -- rclone will open the browser with a login_token so it can log - straight in. +Note that the name of a remote created using environment variable is +case insensitive, in contrast to regular remotes stored in config file +as documented above. You must write the name in uppercase in the +environment variable, but as seen from example above it will be listed +and can be accessed in lowercase, while you can also refer to the same +remote in uppercase: -Advanced use + $ rclone lsd mys3: + -1 2016-09-21 12:54:21 -1 my-bucket + $ rclone lsd MYS3: + -1 2016-09-21 12:54:21 -1 my-bucket -The rclone rcd may use any of the flags documented on the rc page. +Note that you can only set the options of the immediate backend, so +RCLONE_CONFIG_MYS3CRYPT_ACCESS_KEY_ID has no effect, if myS3Crypt is a +crypt remote based on an S3 remote. However RCLONE_S3_ACCESS_KEY_ID will +set the access key of all remotes using S3, including myS3Crypt. -The flag --rc-web-gui is shorthand for +Note also that now rclone has connection strings, it is probably easier +to use those instead which makes the above example -- Download the web GUI if necessary -- Check we are using some authentication -- --rc-user gui -- --rc-pass -- --rc-serve + rclone lsd :s3,access_key_id=XXX,secret_access_key=XXX: -These flags can be overridden as desired. +Precedence -See also the rclone rcd documentation. +The various different methods of backend configuration are read in this +order and the first one with a value is used. -Example: Running a public GUI +- Parameters in connection strings, e.g. myRemote,skip_links: +- Flag values as supplied on the command line, e.g. --skip-links +- Remote specific environment vars, e.g. + RCLONE_CONFIG_MYREMOTE_SKIP_LINKS (see above). +- Backend-specific environment vars, e.g. RCLONE_LOCAL_SKIP_LINKS. +- Backend generic environment vars, e.g. RCLONE_SKIP_LINKS. +- Config file, e.g. skip_links = true. +- Default values, e.g. false - these can't be changed. -For example the GUI could be served on a public port over SSL using an -htpasswd file using the following flags: +So if both --skip-links is supplied on the command line and an +environment variable RCLONE_LOCAL_SKIP_LINKS is set, the command line +flag will take preference. -- --rc-web-gui -- --rc-addr :443 -- --rc-htpasswd /path/to/htpasswd -- --rc-cert /path/to/ssl.crt -- --rc-key /path/to/ssl.key +The backend configurations set by environment variables can be seen with +the -vv flag, e.g. rclone about myRemote: -vv. -Example: Running a GUI behind a proxy +For non backend configuration the order is as follows: -If you want to run the GUI behind a proxy at /rclone you could use these -flags: +- Flag values as supplied on the command line, e.g. --stats 5s. +- Environment vars, e.g. RCLONE_STATS=5s. +- Default values, e.g. 1m - these can't be changed. -- --rc-web-gui -- --rc-baseurl rclone -- --rc-htpasswd /path/to/htpasswd +Other environment variables -Or instead of htpasswd if you just want a single user and password: +- RCLONE_CONFIG_PASS set to contain your config file password (see + Configuration Encryption section) +- HTTP_PROXY, HTTPS_PROXY and NO_PROXY (or the lowercase versions + thereof). + - HTTPS_PROXY takes precedence over HTTP_PROXY for https requests. + - The environment values may be either a complete URL or a + "host[:port]" for, in which case the "http" scheme is assumed. +- USER and LOGNAME values are used as fallbacks for current username. + The primary method for looking up username is OS-specific: Windows + API on Windows, real user ID in /etc/passwd on Unix systems. In the + documentation the current username is simply referred to as $USER. +- RCLONE_CONFIG_DIR - rclone sets this variable for use in config + files and sub processes to point to the directory holding the config + file. -- --rc-user me -- --rc-pass mypassword +The options set by environment variables can be seen with the -vv and +--log-level=DEBUG flags, e.g. rclone version -vv. -Project +Configuring rclone on a remote / headless machine -The GUI is being developed in the: rclone/rclone-webui-react repository. +Some of the configurations (those involving oauth2) require an Internet +connected web browser. -Bug reports and contributions are very welcome :-) +If you are trying to set rclone up on a remote or headless box with no +browser available on it (e.g. 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. -If you have questions then please ask them on the rclone forum. +Configuring using rclone authorize -Remote controlling rclone with its API +On the headless box run rclone config but answer N to the +Use web browser to automatically authenticate? question. -If rclone is run with the --rc flag then it starts an HTTP server which -can be used to remote control rclone using its API. + ... + Remote config + Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access + If not sure try Y. If Y failed, try N. + y) Yes (default) + n) No + y/n> n + For this to work, you will need rclone available on a machine that has + a web browser available. -You can either use the rc command to access the API or use HTTP -directly. + For more help and alternate methods see: https://rclone.org/remote_setup/ -If you just want to run a remote control then see the rcd command. + Execute the following on the machine with the web browser (same rclone + version recommended): -Supported parameters + rclone authorize "amazon cloud drive" ---rc + Then paste the result below: + result> -Flag to start the http server listen on remote requests +Then on your main desktop machine ---rc-addr=IP + 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 -IPaddress:Port or :Port to bind server to. (default "localhost:5572") +Then back to the headless box, paste in the code ---rc-cert=KEY + 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> -SSL PEM key (concatenation of certificate and CA certificate) +Configuring by copying the config file ---rc-client-ca=PATH +Rclone stores all of its config in a single configuration file. This can +easily be copied to configure a remote rclone. -Client certificate authority to verify clients with +So first configure rclone on your desktop machine with ---rc-htpasswd=PATH + rclone config -htpasswd file - if not provided no authentication is done +to set up the config file. ---rc-key=PATH +Find the config file by running rclone config file, for example -SSL PEM Private key + $ rclone config file + Configuration file is stored at: + /home/user/.rclone.conf ---rc-max-header-bytes=VALUE +Now transfer it to the remote box (scp, cut paste, ftp, sftp, etc.) and +place it in the correct place (use rclone config file on the remote box +to find out where). -Maximum size of request header (default 4096) +Configuring using SSH Tunnel ---rc-min-tls-version=VALUE +Linux and MacOS users can utilize SSH Tunnel to redirect the headless +box port 53682 to local machine by using the following command: -The minimum TLS version that is acceptable. Valid values are "tls1.0", -"tls1.1", "tls1.2" and "tls1.3" (default "tls1.0"). + ssh -L localhost:53682:localhost:53682 username@remote_server ---rc-user=VALUE +Then on the headless box run rclone config and answer Y to the +Use web browser to automatically authenticate? question. -User name for authentication. + ... + Remote config + Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access + If not sure try Y. If Y failed, try N. + y) Yes (default) + n) No + y/n> y ---rc-pass=VALUE +Then copy and paste the auth url +http://127.0.0.1:53682/auth?state=xxxxxxxxxxxx to the browser on your +local machine, complete the auth and it is done. -Password for authentication. +Filtering, includes and excludes ---rc-realm=VALUE +Filter flags determine which files rclone sync, move, ls, lsl, md5sum, +sha1sum, size, delete, check and similar commands apply to. -Realm for authentication (default "rclone") +They are specified in terms of path/file name patterns; path/file lists; +file age and size, or presence of a file in a directory. Bucket based +remotes without the concept of directory apply filters to object key, +age and size in an analogous way. ---rc-server-read-timeout=DURATION +Rclone purge does not obey filters. -Timeout for server reading data (default 1h0m0s) +To test filters without risk of damage to data, apply them to rclone ls, +or with the --dry-run and -vv flags. ---rc-server-write-timeout=DURATION +Rclone filter patterns can only be used in filter command line options, +not in the specification of a remote. -Timeout for server writing data (default 1h0m0s) +E.g. rclone copy "remote:dir*.jpg" /path/to/dir does not have a filter +effect. rclone copy remote:dir /path/to/dir --include "*.jpg" does. ---rc-serve +Important Avoid mixing any two of --include..., --exclude... or +--filter... flags in an rclone command. The results might not be what +you expect. Instead use a --filter... flag. -Enable the serving of remote objects via the HTTP interface. This means -objects will be accessible at http://127.0.0.1:5572/ by default, so you -can browse to http://127.0.0.1:5572/ or http://127.0.0.1:5572/* to see a -listing of the remotes. Objects may be requested from remotes using this -syntax http://127.0.0.1:5572/[remote:path]/path/to/object +Patterns for matching path/file names -Default Off. +Pattern syntax ---rc-files /path/to/directory +Here is a formal definition of the pattern syntax, examples are below. -Path to local files to serve on the HTTP server. +Rclone matching rules follow a glob style: -If this is set then rclone will serve the files in that directory. It -will also open the root in the web browser if specified. This is for -implementing browser based GUIs for rclone functions. + * matches any sequence of non-separator (/) characters + ** matches any sequence of characters including / separators + ? matches any single non-separator (/) character + [ [ ! ] { character-range } ] + character class (must be non-empty) + { pattern-list } + pattern alternatives + {{ regexp }} + regular expression to match + c matches character c (c != *, **, ?, \, [, {, }) + \c matches reserved character c (c = *, **, ?, \, [, {, }) or character class -If --rc-user or --rc-pass is set then the URL that is opened will have -the authorization in the URL in the http://user:pass@localhost/ style. +character-range: -Default Off. + c matches character c (c != \, -, ]) + \c matches reserved character c (c = \, -, ]) + lo - hi matches character c for lo <= c <= hi ---rc-enable-metrics +pattern-list: -Enable OpenMetrics/Prometheus compatible endpoint at /metrics. + pattern { , pattern } + comma-separated (without spaces) patterns -Default Off. +character classes (see Go regular expression reference) include: ---rc-web-gui + Named character classes (e.g. [\d], [^\d], [\D], [^\D]) + Perl character classes (e.g. \s, \S, \w, \W) + ASCII character classes (e.g. [[:alnum:]], [[:alpha:]], [[:punct:]], [[:xdigit:]]) -Set this flag to serve the default web gui on the same port as rclone. +regexp for advanced users to insert a regular expression - see below for +more info: -Default Off. + Any re2 regular expression not containing `}}` ---rc-allow-origin +If the filter pattern starts with a / then it only matches at the top +level of the directory tree, relative to the root of the remote (not +necessarily the root of the drive). If it does not start with / then it +is matched starting at the end of the path/file name but it only matches +a complete path element - it must match from a / separator or the +beginning of the path/file. -Set the allowed Access-Control-Allow-Origin for rc requests. + 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" -Can be used with --rc-web-gui if the rclone is running on different IP -than the web-gui. +The top level of the remote might not be the top level of the drive. -Default is IP address on which rc is running. +E.g. for a Microsoft Windows local directory structure ---rc-web-fetch-url + F: + ├── bkp + ├── data + │ ├── excl + │ │ ├── 123.jpg + │ │ └── 456.jpg + │ ├── incl + │ │ └── document.pdf -Set the URL to fetch the rclone-web-gui files from. +To copy the contents of folder data into folder bkp excluding the +contents of subfolder exclthe following command treats F:\data and +F:\bkp as top level for filtering. -Default -https://api.github.com/repos/rclone/rclone-webui-react/releases/latest. +rclone copy F:\data\ F:\bkp\ --exclude=/excl/** ---rc-web-gui-update +Important Use / in path/file name patterns and not \ even if running on +Microsoft Windows. -Set this flag to check and update rclone-webui-react from the -rc-web-fetch-url. +Simple patterns are case sensitive unless the --ignore-case flag is +used. -Default Off. +Without --ignore-case (default) ---rc-web-gui-force-update + potato - matches "potato" + - doesn't match "POTATO" -Set this flag to force update rclone-webui-react from the -rc-web-fetch-url. +With --ignore-case -Default Off. + potato - matches "potato" + - matches "POTATO" ---rc-web-gui-no-open-browser +Using regular expressions in filter patterns -Set this flag to disable opening browser automatically when using -web-gui. +The syntax of filter patterns is glob style matching (like bash uses) to +make things easy for users. However this does not provide absolute +control over the matching, so for advanced users rclone also provides a +regular expression syntax. -Default Off. +The regular expressions used are as defined in the Go regular expression +reference. Regular expressions should be enclosed in {{ }}. They will +match only the last path segment if the glob doesn't start with / or the +whole path name if it does. Note that rclone does not attempt to parse +the supplied regular expression, meaning that using any regular +expression filter will prevent rclone from using directory filter rules, +as it will instead check every path against the supplied regular +expression(s). ---rc-job-expire-duration=DURATION +Here is how the {{regexp}} is transformed into an full regular +expression to match the entire path: -Expire finished async jobs older than DURATION (default 60s). + {{regexp}} becomes (^|/)(regexp)$ + /{{regexp}} becomes ^(regexp)$ ---rc-job-expire-interval=DURATION +Regexp syntax can be mixed with glob syntax, for example -Interval duration to check for expired async jobs (default 10s). + *.{{jpe?g}} to match file.jpg, file.jpeg but not file.png ---rc-no-auth +You can also use regexp flags - to set case insensitive, for example -By default rclone will require authorisation to have been set up on the -rc interface in order to use any methods which access any rclone -remotes. Eg operations/list is denied as it involved creating a remote -as is sync/copy. + *.{{(?i)jpg}} to match file.jpg, file.JPG but not file.png -If this is set then no authorisation will be required on the server to -use these methods. The alternative is to use --rc-user and --rc-pass and -use these credentials in the request. +Be careful with wildcards in regular expressions - you don't want them +to match path separators normally. To match any file name starting with +start and ending with end write -Default Off. + {{start[^/]*end\.jpg}} ---rc-baseurl +Not -Prefix for URLs. + {{start.*end\.jpg}} -Default is root +Which will match a directory called start with a file called end.jpg in +it as the .* will match / characters. ---rc-template +Note that you can use -vv --dump filters to show the filter patterns in +regexp format - rclone implements the glob patterns by transforming them +into regular expressions. -User-specified template. +Filter pattern examples -Accessing the remote control via the rclone rc command + Description Pattern Matches Does not match + --------------- ---------------- ------------------------------- ------------------ + Wildcard *.jpg /file.jpg /file.png + /dir/file.jpg /dir/file.png + Rooted /*.jpg /file.jpg /file.png + /file2.jpg /dir/file.jpg + Alternates *.{jpg,png} /file.jpg /file.gif + /dir/file.png /dir/file.gif + Path Wildcard dir/** /dir/anyfile file.png + /subdir/dir/subsubdir/anyfile /subdir/file.png + Any Char *.t?t /file.txt /file.qxt + /dir/file.tzt /dir/file.png + Range *.[a-z] /file.a /file.0 + /dir/file.b /dir/file.1 + Escape *.\?\?\? /file.??? /file.abc + /dir/file.??? /dir/file.def + Class *.\d\d\d /file.012 /file.abc + /dir/file.345 /dir/file.def + Regexp *.{{jpe?g}} /file.jpeg /file.png + /dir/file.jpg /dir/file.jpeeg + Rooted Regexp /{{.*\.jpe?g}} /file.jpeg /file.png + /file.jpg /dir/file.jpg -Rclone itself implements the remote control protocol in its rclone rc -command. +How filter rules are applied to files -You can use it like this +Rclone path/file name filters are made up of one or more of the +following flags: - $ rclone rc rc/noop param1=one param2=two - { - "param1": "one", - "param2": "two" - } +- --include +- --include-from +- --exclude +- --exclude-from +- --filter +- --filter-from -Run rclone rc on its own to see the help for the installed remote -control commands. +There can be more than one instance of individual flags. -JSON input +Rclone internally uses a combined list of all the include and exclude +rules. The order in which rules are processed can influence the result +of the filter. -rclone rc also supports a --json flag which can be used to send more -complicated input parameters. +All flags of the same type are processed together in the order above, +regardless of what order the different types of flags are included on +the command line. - $ rclone rc --json '{ "p1": [1,"2",null,4], "p2": { "a":1, "b":2 } }' rc/noop - { - "p1": [ - 1, - "2", - null, - 4 - ], - "p2": { - "a": 1, - "b": 2 - } - } +Multiple instances of the same flag are processed from left to right +according to their position in the command line. -If the parameter being passed is an object then it can be passed as a -JSON string rather than using the --json flag which simplifies the -command line. +To mix up the order of processing includes and excludes use --filter... +flags. - rclone rc operations/list fs=/tmp remote=test opt='{"showHash": true}' +Within --include-from, --exclude-from and --filter-from flags rules are +processed from top to bottom of the referenced file. -Rather than +If there is an --include or --include-from flag specified, rclone +implies a - ** rule which it adds to the bottom of the internal rule +list. Specifying a + rule with a --filter... flag does not imply that +rule. - rclone rc operations/list --json '{"fs": "/tmp", "remote": "test", "opt": {"showHash": true}}' +Each path/file name passed through rclone is matched against the +combined filter list. At first match to a rule the path/file name is +included or excluded and no further filter rules are processed for that +path/file. -Special parameters +If rclone does not find a match, after testing against all rules +(including the implied rule if appropriate), the path/file name is +included. -The rc interface supports some special parameters which apply to all -commands. These start with _ to show they are different. +Any path/file included at that stage is processed by the rclone command. -Running asynchronous jobs with _async = true +--files-from and --files-from-raw flags over-ride and cannot be combined +with other filter options. -Each rc call is classified as a job and it is assigned its own id. By -default jobs are executed immediately as they are created or -synchronously. +To see the internal combined rule list, in regular expression form, for +a command add the --dump filters flag. Running an rclone command with +--dump filters and -vv flags lists the internal filter elements and +shows how they are applied to each source path/file. There is not +currently a means provided to pass regular expression filter options +into rclone directly though character class filter rules contain +character classes. Go regular expression reference -If _async has a true value when supplied to an rc call then it will -return immediately with a job id and the task will be run in the -background. The job/status call can be used to get information of the -background job. The job can be queried for up to 1 minute after it has -finished. +How filter rules are applied to directories -It is recommended that potentially long running jobs, e.g. sync/sync, -sync/copy, sync/move, operations/purge are run with the _async flag to -avoid any potential problems with the HTTP request and response timing -out. +Rclone commands are applied to path/file names not directories. The +entire contents of a directory can be matched to a filter by the pattern +directory/* or recursively by directory/**. -Starting a job with the _async flag: +Directory filter rules are defined with a closing / separator. - $ rclone rc --json '{ "p1": [1,"2",null,4], "p2": { "a":1, "b":2 }, "_async": true }' rc/noop - { - "jobid": 2 - } +E.g. /directory/subdirectory/ is an rclone directory filter rule. -Query the status to see if the job has finished. For more information on -the meaning of these return parameters see the job/status call. +Rclone commands can use directory filter rules to determine whether they +recurse into subdirectories. This potentially optimises access to a +remote by avoiding listing unnecessary directories. Whether optimisation +is desirable depends on the specific filter rules and source remote +content. - $ rclone rc --json '{ "jobid":2 }' job/status - { - "duration": 0.000124163, - "endTime": "2018-10-27T11:38:07.911245881+01:00", - "error": "", - "finished": true, - "id": 2, - "output": { - "_async": true, - "p1": [ - 1, - "2", - null, - 4 - ], - "p2": { - "a": 1, - "b": 2 - } - }, - "startTime": "2018-10-27T11:38:07.911121728+01:00", - "success": true - } +If any regular expression filters are in use, then no directory +recursion optimisation is possible, as rclone must check every path +against the supplied regular expression(s). -job/list can be used to show the running or recently completed jobs +Directory recursion optimisation occurs if either: - $ rclone rc job/list - { - "jobids": [ - 2 - ] - } +- A source remote does not support the rclone ListR primitive. local, + sftp, Microsoft OneDrive and WebDAV do not support ListR. Google + Drive and most bucket type storage do. Full list -Setting config flags with _config +- On other remotes (those that support ListR), if the rclone command + is not naturally recursive, and provided it is not run with the + --fast-list flag. ls, lsf -R and size are naturally recursive but + sync, copy and move are not. -If you wish to set config (the equivalent of the global flags) for the -duration of an rc call only then pass in the _config parameter. +- Whenever the --disable ListR flag is applied to an rclone command. -This should be in the same format as the config key returned by -options/get. +Rclone commands imply directory filter rules from path/file filter +rules. To view the directory filter rules rclone has implied for a +command specify the --dump filters flag. -For example, if you wished to run a sync with the --checksum parameter, -you would pass this parameter in your JSON blob. +E.g. for an include rule - "_config":{"CheckSum": true} + /a/*.jpg -If using rclone rc this could be passed as +Rclone implies the directory include rule - rclone rc sync/sync ... _config='{"CheckSum": true}' + /a/ -Any config parameters you don't set will inherit the global defaults -which were set with command line flags or environment variables. +Directory filter rules specified in an rclone command can limit the +scope of an rclone command but path/file filters still have to be +specified. -Note that it is possible to set some values as strings or integers - see -data types for more info. Here is an example setting the equivalent of ---buffer-size in string or integer format. +E.g. rclone ls remote: --include /directory/ will not match any files. +Because it is an --include option the --exclude ** rule is implied, and +the /directory/ pattern serves only to optimise access to the remote by +ignoring everything outside of that directory. - "_config":{"BufferSize": "42M"} - "_config":{"BufferSize": 44040192} +E.g. rclone ls remote: --filter-from filter-list.txt with a file +filter-list.txt: -If you wish to check the _config assignment has worked properly then -calling options/local will show what the value got set to. + - /dir1/ + - /dir2/ + + *.pdf + - ** -Setting filter flags with _filter +All files in directories dir1 or dir2 or their subdirectories are +completely excluded from the listing. Only files of suffix pdf in the +root of remote: or its subdirectories are listed. The - ** rule prevents +listing of any path/files not previously matched by the rules above. -If you wish to set filters for the duration of an rc call only then pass -in the _filter parameter. +Option exclude-if-present creates a directory exclude rule based on the +presence of a file in a directory and takes precedence over other rclone +directory filter rules. -This should be in the same format as the filter key returned by -options/get. +When using pattern list syntax, if a pattern item contains either / or +**, then rclone will not able to imply a directory filter rule from this +pattern list. -For example, if you wished to run a sync with these flags +E.g. for an include rule - --max-size 1M --max-age 42s --include "a" --include "b" + {dir1/**,dir2/**} -you would pass this parameter in your JSON blob. +Rclone will match files below directories dir1 or dir2 only, but will +not be able to use this filter to exclude a directory dir3 from being +traversed. - "_filter":{"MaxSize":"1M", "IncludeRule":["a","b"], "MaxAge":"42s"} +Directory recursion optimisation may affect performance, but normally +not the result. One exception to this is sync operations with option +--create-empty-src-dirs, where any traversed empty directories will be +created. With the pattern list example {dir1/**,dir2/**} above, this +would create an empty directory dir3 on destination (when it exists on +source). Changing the filter to {dir1,dir2}/**, or splitting it into two +include rules --include dir1/** --include dir2/**, will match the same +files while also filtering directories, with the result that an empty +directory dir3 will no longer be created. -If using rclone rc this could be passed as +--exclude - Exclude files matching pattern - rclone rc ... _filter='{"MaxSize":"1M", "IncludeRule":["a","b"], "MaxAge":"42s"}' +Excludes path/file names from an rclone command based on a single +exclude rule. -Any filter parameters you don't set will inherit the global defaults -which were set with command line flags or environment variables. +This flag can be repeated. See above for the order filter flags are +processed in. -Note that it is possible to set some values as strings or integers - see -data types for more info. Here is an example setting the equivalent of ---buffer-size in string or integer format. +--exclude should not be used with --include, --include-from, --filter or +--filter-from flags. - "_filter":{"MinSize": "42M"} - "_filter":{"MinSize": 44040192} +--exclude has no effect when combined with --files-from or +--files-from-raw flags. -If you wish to check the _filter assignment has worked properly then -calling options/local will show what the value got set to. +E.g. rclone ls remote: --exclude *.bak excludes all .bak files from +listing. -Assigning operations to groups with _group = value +E.g. rclone size remote: "--exclude /dir/**" returns the total size of +all files on remote: excluding those in root directory dir and sub +directories. -Each rc call has its own stats group for tracking its metrics. By -default grouping is done by the composite group name from prefix job/ -and id of the job like so job/1. +E.g. on Microsoft Windows rclone ls remote: --exclude "*\[{JP,KR,HK}\]*" +lists the files in remote: without [JP] or [KR] or [HK] in their name. +Quotes prevent the shell from interpreting the \ characters.\ characters +escape the [ and ] so an rclone filter treats them literally rather than +as a character-range. The { and } define an rclone pattern list. For +other operating systems single quotes are required ie +rclone ls remote: --exclude '*\[{JP,KR,HK}\]*' -If _group has a value then stats for that request will be grouped under -that value. This allows caller to group stats under their own name. +--exclude-from - Read exclude patterns from file -Stats for specific group can be accessed by passing group to core/stats: +Excludes path/file names from an rclone command based on rules in a +named file. The file contains a list of remarks and pattern rules. - $ rclone rc --json '{ "group": "job/1" }' core/stats - { - "speed": 12345 - ... - } +For an example exclude-file.txt: -Data types + # a sample exclude rule file + *.bak + file2.jpg -When the API returns types, these will mostly be straight forward -integer, string or boolean types. +rclone ls remote: --exclude-from exclude-file.txt lists the files on +remote: except those named file2.jpg or with a suffix .bak. That is +equivalent to rclone ls remote: --exclude file2.jpg --exclude "*.bak". -However some of the types returned by the options/get call and taken by -the options/set calls as well as the vfsOpt, mountOpt and the _config -parameters. +This flag can be repeated. See above for the order filter flags are +processed in. -- Duration - these are returned as an integer duration in nanoseconds. - They may be set as an integer, or they may be set with time string, - eg "5s". See the options section for more info. -- Size - these are returned as an integer number of bytes. They may be - set as an integer or they may be set with a size suffix string, eg - "10M". See the options section for more info. -- Enumerated type (such as CutoffMode, DumpFlags, LogLevel, - VfsCacheMode - these will be returned as an integer and may be set - as an integer but more conveniently they can be set as a string, eg - "HARD" for CutoffMode or DEBUG for LogLevel. -- BandwidthSpec - this will be set and returned as a string, eg "1M". +The --exclude-from flag is useful where multiple exclude filter rules +are applied to an rclone command. -Specifying remotes to work on +--exclude-from should not be used with --include, --include-from, +--filter or --filter-from flags. -Remotes are specified with the fs=, srcFs=, dstFs= parameters depending -on the command being used. +--exclude-from has no effect when combined with --files-from or +--files-from-raw flags. -The parameters can be a string as per the rest of rclone, eg -s3:bucket/path or :sftp:/my/dir. They can also be specified as JSON -blobs. +--exclude-from followed by - reads filter rules from standard input. -If specifying a JSON blob it should be a object mapping strings to -strings. These values will be used to configure the remote. There are 3 -special values which may be set: +--include - Include files matching pattern -- type - set to type to specify a remote called :type: -- _name - set to name to specify a remote called name: -- _root - sets the root of the remote - may be empty +Adds a single include rule based on path/file names to an rclone +command. -One of _name or type should normally be set. If the local backend is -desired then type should be set to local. If _root isn't specified then -it defaults to the root of the remote. +This flag can be repeated. See above for the order filter flags are +processed in. -For example this JSON is equivalent to remote:/tmp +--include has no effect when combined with --files-from or +--files-from-raw flags. - { - "_name": "remote", - "_path": "/tmp" - } +--include implies --exclude ** at the end of an rclone internal filter +list. Therefore if you mix --include and --include-from flags with +--exclude, --exclude-from, --filter or --filter-from, you must use +include rules for all the files you want in the include statement. For +more flexibility use the --filter-from flag. -And this is equivalent to :sftp,host='example.com':/tmp +E.g. rclone ls remote: --include "*.{png,jpg}" lists the files on +remote: with suffix .png and .jpg. All other files are excluded. - { - "type": "sftp", - "host": "example.com", - "_path": "/tmp" - } +E.g. multiple rclone copy commands can be combined with --include and a +pattern-list. -And this is equivalent to /tmp/dir + rclone copy /vol1/A remote:A + rclone copy /vol1/B remote:B - { - type = "local", - _ path = "/tmp/dir" - } +is equivalent to: -Supported commands + rclone copy /vol1 remote: --include "{A,B}/**" -backend/command: Runs a backend command. +E.g. rclone ls remote:/wheat --include "??[^[:punct:]]*" lists the files +remote: directory wheat (and subdirectories) whose third character is +not punctuation. This example uses an ASCII character class. -This takes the following parameters: +--include-from - Read include patterns from file -- command - a string with the command name -- fs - a remote name string e.g. "drive:" -- arg - a list of arguments for the backend command -- opt - a map of string to string of options +Adds path/file names to an rclone command based on rules in a named +file. The file contains a list of remarks and pattern rules. -Returns: +For an example include-file.txt: -- result - result from the backend command + # a sample include rule file + *.jpg + file2.avi -Example: +rclone ls remote: --include-from include-file.txt lists the files on +remote: with name file2.avi or suffix .jpg. That is equivalent to +rclone ls remote: --include file2.avi --include "*.jpg". - rclone rc backend/command command=noop fs=. -o echo=yes -o blue -a path1 -a path2 +This flag can be repeated. See above for the order filter flags are +processed in. -Returns +The --include-from flag is useful where multiple include filter rules +are applied to an rclone command. - { - "result": { - "arg": [ - "path1", - "path2" - ], - "name": "noop", - "opt": { - "blue": "", - "echo": "yes" - } - } - } +--include-from implies --exclude ** at the end of an rclone internal +filter list. Therefore if you mix --include and --include-from flags +with --exclude, --exclude-from, --filter or --filter-from, you must use +include rules for all the files you want in the include statement. For +more flexibility use the --filter-from flag. -Note that this is the direct equivalent of using this "backend" command: +--exclude-from has no effect when combined with --files-from or +--files-from-raw flags. - rclone backend noop . -o echo=yes -o blue path1 path2 +--exclude-from followed by - reads filter rules from standard input. -Note that arguments must be preceded by the "-a" flag +--filter - Add a file-filtering rule -See the backend command for more information. +Specifies path/file names to an rclone command, based on a single +include or exclude rule, in + or - format. -Authentication is required for this call. +This flag can be repeated. See above for the order filter flags are +processed in. -cache/expire: Purge a remote from cache +--filter + differs from --include. In the case of --include rclone +implies an --exclude * rule which it adds to the bottom of the internal +rule list. --filter...+ does not imply that rule. -Purge a remote from the cache backend. Supports either a directory or a -file. Params: - remote = path to remote (required) - withData = -true/false to delete cached data (chunks) as well (optional) +--filter has no effect when combined with --files-from or +--files-from-raw flags. -Eg +--filter should not be used with --include, --include-from, --exclude or +--exclude-from flags. - rclone rc cache/expire remote=path/to/sub/folder/ - rclone rc cache/expire remote=/ withData=true +E.g. rclone ls remote: --filter "- *.bak" excludes all .bak files from a +list of remote:. -cache/fetch: Fetch file chunks +--filter-from - Read filtering patterns from a file -Ensure the specified file chunks are cached on disk. +Adds path/file names to an rclone command based on rules in a named +file. The file contains a list of remarks and pattern rules. Include +rules start with + and exclude rules with -. ! clears existing rules. +Rules are processed in the order they are defined. -The chunks= parameter specifies the file chunks to check. It takes a -comma separated list of array slice indices. The slice indices are -similar to Python slices: start[:end] +This flag can be repeated. See above for the order filter flags are +processed in. -start is the 0 based chunk number from the beginning of the file to -fetch inclusive. end is 0 based chunk number from the beginning of the -file to fetch exclusive. Both values can be negative, in which case they -count from the back of the file. The value "-5:" represents the last 5 -chunks of a file. +Arrange the order of filter rules with the most restrictive first and +work down. -Some valid examples are: ":5,-5:" -> the first and last five chunks -"0,-2" -> the first and the second last chunk "0:10" -> the first ten -chunks +E.g. for filter-file.txt: -Any parameter with a key that starts with "file" can be used to specify -files to fetch, e.g. + # a sample filter rule file + - secret*.jpg + + *.jpg + + *.png + + file2.avi + - /dir/Trash/** + + /dir/** + # exclude everything else + - * - rclone rc cache/fetch chunks=0 file=hello file2=home/goodbye +rclone ls remote: --filter-from filter-file.txt lists the path/files on +remote: including all jpg and png files, excluding any matching +secret*.jpg and including file2.avi. It also includes everything in the +directory dir at the root of remote, except remote:dir/Trash which it +excludes. Everything else is excluded. -File names will automatically be encrypted when the a crypt remote is -used on top of the cache. +E.g. for an alternative filter-file.txt: -cache/stats: Get cache stats + - secret*.jpg + + *.jpg + + *.png + + file2.avi + - * -Show statistics for the cache remote. +Files file1.jpg, file3.png and file2.avi are listed whilst secret17.jpg +and files without the suffix .jpgor.png` are excluded. -config/create: create the config for a remote. +E.g. for an alternative filter-file.txt: -This takes the following parameters: + + *.jpg + + *.gif + ! + + 42.doc + - * -- name - name of remote -- parameters - a map of { "key": "value" } pairs -- type - type of the new remote -- opt - a dictionary of options to control the configuration - - obscure - declare passwords are plain and need obscuring - - noObscure - declare passwords are already obscured and don't - need obscuring - - nonInteractive - don't interact with a user, return questions - - continue - continue the config process with an answer - - all - ask all the config questions not just the post config ones - - state - state to restart with - used with continue - - result - result to restart with - used with continue +Only file 42.doc is listed. Prior rules are cleared by the !. -See the config create command for more information on the above. +--files-from - Read list of source-file names -Authentication is required for this call. +Adds path/files to an rclone command from a list in a named file. Rclone +processes the path/file names in the order of the list, and no others. -config/delete: Delete a remote in the config file. +Other filter flags (--include, --include-from, --exclude, +--exclude-from, --filter and --filter-from) are ignored when +--files-from is used. -Parameters: +--files-from expects a list of files as its input. Leading or trailing +whitespace is stripped from the input lines. Lines starting with # or ; +are ignored. -- name - name of remote to delete +Rclone commands with a --files-from flag traverse the remote, treating +the names in --files-from as a set of filters. -See the config delete command for more information on the above. +If the --no-traverse and --files-from flags are used together an rclone +command does not traverse the remote. Instead it addresses each +path/file named in the file individually. For each path/file name, that +requires typically 1 API call. This can be efficient for a short +--files-from list and a remote containing many files. -Authentication is required for this call. +Rclone commands do not error if any names in the --files-from file are +missing from the source remote. -config/dump: Dumps the config file. +The --files-from flag can be repeated in a single rclone command to read +path/file names from more than one file. The files are read from left to +right along the command line. -Returns a JSON object: - key: value +Paths within the --files-from file are interpreted as starting with the +root specified in the rclone command. Leading / separators are ignored. +See --files-from-raw if you need the input to be processed in a raw +manner. -Where keys are remote names and values are the config parameters. +E.g. for a file files-from.txt: -See the config dump command for more information on the above. + # comment + file1.jpg + subdir/file2.jpg -Authentication is required for this call. +rclone copy --files-from files-from.txt /home/me/pics remote:pics copies +the following, if they exist, and only those files. -config/get: Get a remote in the config file. + /home/me/pics/file1.jpg → remote:pics/file1.jpg + /home/me/pics/subdir/file2.jpg → remote:pics/subdir/file2.jpg -Parameters: +E.g. to copy the following files referenced by their absolute paths: -- name - name of remote to get + /home/user1/42 + /home/user1/dir/ford + /home/user2/prefect -See the config dump command for more information on the above. +First find a common subdirectory - in this case /home and put the +remaining files in files-from.txt with or without leading /, e.g. -Authentication is required for this call. + user1/42 + user1/dir/ford + user2/prefect -config/listremotes: Lists the remotes in the config file and defined in environment variables. +Then copy these to a remote: -Returns - remotes - array of remote names + rclone copy --files-from files-from.txt /home remote:backup -See the listremotes command for more information on the above. +The three files are transferred as follows: -Authentication is required for this call. + /home/user1/42 → remote:backup/user1/important + /home/user1/dir/ford → remote:backup/user1/dir/file + /home/user2/prefect → remote:backup/user2/stuff -config/password: password the config for a remote. +Alternatively if / is chosen as root files-from.txt will be: -This takes the following parameters: + /home/user1/42 + /home/user1/dir/ford + /home/user2/prefect -- name - name of remote -- parameters - a map of { "key": "value" } pairs +The copy command will be: -See the config password command for more information on the above. + rclone copy --files-from files-from.txt / remote:backup -Authentication is required for this call. +Then there will be an extra home directory on the remote: -config/providers: Shows how providers are configured in the config file. + /home/user1/42 → remote:backup/home/user1/42 + /home/user1/dir/ford → remote:backup/home/user1/dir/ford + /home/user2/prefect → remote:backup/home/user2/prefect -Returns a JSON object: - providers - array of objects +--files-from-raw - Read list of source-file names without any processing -See the config providers command for more information on the above. +This flag is the same as --files-from except that input is read in a raw +manner. Lines with leading / trailing whitespace, and lines starting +with ; or # are read without any processing. rclone lsf has a compatible +format that can be used to export file lists from remotes for input to +--files-from-raw. -Authentication is required for this call. +--ignore-case - make searches case insensitive -config/setpath: Set the path of the config file +By default, rclone filter patterns are case sensitive. The --ignore-case +flag makes all of the filters patterns on the command line case +insensitive. -Parameters: +E.g. --include "zaphod.txt" does not match a file Zaphod.txt. With +--ignore-case a match is made. -- path - path to the config file to use +Quoting shell metacharacters -Authentication is required for this call. +Rclone commands with filter patterns containing shell metacharacters may +not as work as expected in your shell and may require quoting. -config/update: update the config for a remote. +E.g. linux, OSX (* metacharacter) -This takes the following parameters: +- --include \*.jpg +- --include '*.jpg' +- --include='*.jpg' -- name - name of remote -- parameters - a map of { "key": "value" } pairs -- opt - a dictionary of options to control the configuration - - obscure - declare passwords are plain and need obscuring - - noObscure - declare passwords are already obscured and don't - need obscuring - - nonInteractive - don't interact with a user, return questions - - continue - continue the config process with an answer - - all - ask all the config questions not just the post config ones - - state - state to restart with - used with continue - - result - result to restart with - used with continue +Microsoft Windows expansion is done by the command, not shell, so +--include *.jpg does not require quoting. -See the config update command for more information on the above. +If the rclone error +Command .... needs .... arguments maximum: you provided .... non flag arguments: +is encountered, the cause is commonly spaces within the name of a remote +or flag value. The fix then is to quote values containing spaces. -Authentication is required for this call. +Other filters -core/bwlimit: Set the bandwidth limit. +--min-size - Don't transfer any file smaller than this -This sets the bandwidth limit to the string passed in. This should be a -single bandwidth limit entry or a pair of upload:download bandwidth. +Controls the minimum size file within the scope of an rclone command. +Default units are KiB but abbreviations K, M, G, T or P are valid. -Eg +E.g. rclone ls remote: --min-size 50k lists files on remote: of 50 KiB +size or larger. - rclone rc core/bwlimit rate=off - { - "bytesPerSecond": -1, - "bytesPerSecondTx": -1, - "bytesPerSecondRx": -1, - "rate": "off" - } - rclone rc core/bwlimit rate=1M - { - "bytesPerSecond": 1048576, - "bytesPerSecondTx": 1048576, - "bytesPerSecondRx": 1048576, - "rate": "1M" - } - rclone rc core/bwlimit rate=1M:100k - { - "bytesPerSecond": 1048576, - "bytesPerSecondTx": 1048576, - "bytesPerSecondRx": 131072, - "rate": "1M" - } +See the size option docs for more info. -If the rate parameter is not supplied then the bandwidth is queried +--max-size - Don't transfer any file larger than this - rclone rc core/bwlimit - { - "bytesPerSecond": 1048576, - "bytesPerSecondTx": 1048576, - "bytesPerSecondRx": 1048576, - "rate": "1M" - } +Controls the maximum size file within the scope of an rclone command. +Default units are KiB but abbreviations K, M, G, T or P are valid. -The format of the parameter is exactly the same as passed to --bwlimit -except only one bandwidth may be specified. +E.g. rclone ls remote: --max-size 1G lists files on remote: of 1 GiB +size or smaller. -In either case "rate" is returned as a human-readable string, and -"bytesPerSecond" is returned as a number. +See the size option docs for more info. -core/command: Run a rclone terminal command over rc. +--max-age - Don't transfer any file older than this -This takes the following parameters: +Controls the maximum age of files within the scope of an rclone command. -- command - a string with the command name. -- arg - a list of arguments for the backend command. -- opt - a map of string to string of options. -- returnType - one of ("COMBINED_OUTPUT", "STREAM", - "STREAM_ONLY_STDOUT", "STREAM_ONLY_STDERR"). - - Defaults to "COMBINED_OUTPUT" if not set. - - The STREAM returnTypes will write the output to the body of the - HTTP message. - - The COMBINED_OUTPUT will write the output to the "result" - parameter. +--max-age applies only to files and not to directories. -Returns: +E.g. rclone ls remote: --max-age 2d lists files on remote: of 2 days old +or less. -- result - result from the backend command. - - Only set when using returnType "COMBINED_OUTPUT". -- error - set if rclone exits with an error code. -- returnType - one of ("COMBINED_OUTPUT", "STREAM", - "STREAM_ONLY_STDOUT", "STREAM_ONLY_STDERR"). +See the time option docs for valid formats. -Example: +--min-age - Don't transfer any file younger than this - rclone rc core/command command=ls -a mydrive:/ -o max-depth=1 - rclone rc core/command -a ls -a mydrive:/ -o max-depth=1 +Controls the minimum age of files within the scope of an rclone command. +(see --max-age for valid formats) -Returns: +--min-age applies only to files and not to directories. - { - "error": false, - "result": "" - } +E.g. rclone ls remote: --min-age 2d lists files on remote: of 2 days old +or more. - OR - { - "error": true, - "result": "" - } +See the time option docs for valid formats. -Authentication is required for this call. +Other flags -core/du: Returns disk usage of a locally attached disk. +--delete-excluded - Delete files on dest excluded from sync -This returns the disk usage for the local directory passed in as dir. +Important this flag is dangerous to your data - use with --dry-run and +-v first. -If the directory is not passed in, it defaults to the directory pointed -to by --cache-dir. +In conjunction with rclone sync, --delete-excluded deletes any files on +the destination which are excluded from the command. -- dir - string (optional) +E.g. the scope of rclone sync --interactive A: B: can be restricted: -Returns: + rclone --min-size 50k --delete-excluded sync A: B: - { - "dir": "/", - "info": { - "Available": 361769115648, - "Free": 361785892864, - "Total": 982141468672 - } - } +All files on B: which are less than 50 KiB are deleted because they are +excluded from the rclone sync command. -core/gc: Runs a garbage collection. +--dump filters - dump the filters to the output -This tells the go runtime to do a garbage collection run. It isn't -necessary to call this normally, but it can be useful for debugging -memory problems. +Dumps the defined filters to standard output in regular expression +format. -core/group-list: Returns list of stats. +Useful for debugging. -This returns list of stats groups currently in memory. +Exclude directory based on a file -Returns the following values: +The --exclude-if-present flag controls whether a directory is within the +scope of an rclone command based on the presence of a named file within +it. The flag can be repeated to check for multiple file names, presence +of any of them will exclude the directory. - { - "groups": an array of group names: - [ - "group1", - "group2", - ... - ] - } +This flag has a priority over other filter flags. -core/memstats: Returns the memory statistics +E.g. for the following directory structure: -This returns the memory statistics of the running program. What the -values mean are explained in the go docs: -https://golang.org/pkg/runtime/#MemStats + dir1/file1 + dir1/dir2/file2 + dir1/dir2/dir3/file3 + dir1/dir2/dir3/.ignore -The most interesting values for most people are: - -- HeapAlloc - this is the amount of memory rclone is actually using -- HeapSys - this is the amount of memory rclone has obtained from the - OS -- Sys - this is the total amount of memory requested from the OS - - It is virtual memory so may include unused memory +The command rclone ls --exclude-if-present .ignore dir1 does not list +dir3, file3 or .ignore. -core/obscure: Obscures a string passed in. +Metadata filters -Pass a clear string and rclone will obscure it for the config file: - -clear - string +The metadata filters work in a very similar way to the normal file name +filters, except they match metadata on the object. -Returns: - obscured - string +The metadata should be specified as key=value patterns. This may be +wildcarded using the normal filter patterns or regular expressions. -core/pid: Return PID of current process +For example if you wished to list only local files with a mode of 100664 +you could do that with: -This returns PID of current process. Useful for stopping rclone process. + rclone lsf -M --files-only --metadata-include "mode=100664" . -core/quit: Terminates the app. +Or if you wished to show files with an atime, mtime or btime at a given +date: -(Optional) Pass an exit code to be used for terminating the app: - -exitCode - int + rclone lsf -M --files-only --metadata-include "[abm]time=2022-12-16*" . -core/stats: Returns stats about current transfers. +Like file filtering, metadata filtering only applies to files not to +directories. -This returns all available stats: +The filters can be applied using these flags. - rclone rc core/stats +- --metadata-include - Include metadatas matching pattern +- --metadata-include-from - Read metadata include patterns from file + (use - to read from stdin) +- --metadata-exclude - Exclude metadatas matching pattern +- --metadata-exclude-from - Read metadata exclude patterns from file + (use - to read from stdin) +- --metadata-filter - Add a metadata filtering rule +- --metadata-filter-from - Read metadata filtering patterns from a + file (use - to read from stdin) -If group is not provided then summed up stats for all groups will be -returned. +Each flag can be repeated. See the section on how filter rules are +applied for more details - these flags work in an identical way to the +file name filtering flags, but instead of file name patterns have +metadata patterns. -Parameters +Common pitfalls -- group - name of the stats group (string) +The most frequent filter support issues on the rclone forum are: -Returns the following values: +- Not using paths relative to the root of the remote +- Not using / to match from the root of a remote +- Not using ** to match the contents of a directory - { - "bytes": total transferred bytes since the start of the group, - "checks": number of files checked, - "deletes" : number of files deleted, - "elapsedTime": time in floating point seconds since rclone was started, - "errors": number of errors, - "eta": estimated time in seconds until the group completes, - "fatalError": boolean whether there has been at least one fatal error, - "lastError": last error string, - "renames" : number of files renamed, - "retryError": boolean showing whether there has been at least one non-NoRetryError, - "serverSideCopies": number of server side copies done, - "serverSideCopyBytes": number bytes server side copied, - "serverSideMoves": number of server side moves done, - "serverSideMoveBytes": number bytes server side moved, - "speed": average speed in bytes per second since start of the group, - "totalBytes": total number of bytes in the group, - "totalChecks": total number of checks in the group, - "totalTransfers": total number of transfers in the group, - "transferTime" : total time spent on running jobs, - "transfers": number of transferred files, - "transferring": an array of currently active file transfers: - [ - { - "bytes": total transferred bytes for this file, - "eta": estimated time in seconds until file transfer completion - "name": name of the file, - "percentage": progress of the file transfer in percent, - "speed": average speed over the whole transfer in bytes per second, - "speedAvg": current speed in bytes per second as an exponentially weighted moving average, - "size": size of the file in bytes - } - ], - "checking": an array of names of currently active file checks - [] - } +GUI (Experimental) -Values for "transferring", "checking" and "lastError" are only assigned -if data is available. The value for "eta" is null if an eta cannot be -determined. +Rclone can serve a web based GUI (graphical user interface). This is +somewhat experimental at the moment so things may be subject to change. -core/stats-delete: Delete stats group. +Run this command in a terminal and rclone will download and then display +the GUI in a web browser. -This deletes entire stats group. + rclone rcd --rc-web-gui -Parameters +This will produce logs like this and rclone needs to continue to run to +serve the GUI: -- group - name of the stats group (string) + 2019/08/25 11:40:14 NOTICE: A new release for gui is present at https://github.com/rclone/rclone-webui-react/releases/download/v0.0.6/currentbuild.zip + 2019/08/25 11:40:14 NOTICE: Downloading webgui binary. Please wait. [Size: 3813937, Path : /home/USER/.cache/rclone/webgui/v0.0.6.zip] + 2019/08/25 11:40:16 NOTICE: Unzipping + 2019/08/25 11:40:16 NOTICE: Serving remote control on http://127.0.0.1:5572/ -core/stats-reset: Reset stats. +This assumes you are running rclone locally on your machine. It is +possible to separate the rclone and the GUI - see below for details. -This clears counters, errors and finished transfers for all stats or -specific stats group if group is provided. +If you wish to check for updates then you can add --rc-web-gui-update to +the command line. -Parameters +If you find your GUI broken, you may force it to update by add +--rc-web-gui-force-update. -- group - name of the stats group (string) +By default, rclone will open your browser. Add +--rc-web-gui-no-open-browser to disable this feature. -core/transferred: Returns stats about completed transfers. +Using the GUI -This returns stats about completed transfers: +Once the GUI opens, you will be looking at the dashboard which has an +overall overview. - rclone rc core/transferred +On the left hand side you will see a series of view buttons you can +click on: -If group is not provided then completed transfers for all groups will be -returned. +- Dashboard - main overview +- Configs - examine and create new configurations +- Explorer - view, download and upload files to the cloud storage + systems +- Backend - view or alter the backend config +- Log out -Note only the last 100 completed transfers are returned. +(More docs and walkthrough video to come!) -Parameters +How it works -- group - name of the stats group (string) +When you run the rclone rcd --rc-web-gui this is what happens -Returns the following values: +- Rclone starts but only runs the remote control API ("rc"). +- The API is bound to localhost with an auto-generated username and + password. +- If the API bundle is missing then rclone will download it. +- rclone will start serving the files from the API bundle over the + same port as the API +- rclone will open the browser with a login_token so it can log + straight in. - { - "transferred": an array of completed transfers (including failed ones): - [ - { - "name": name of the file, - "size": size of the file in bytes, - "bytes": total transferred bytes for this file, - "checked": if the transfer is only checked (skipped, deleted), - "timestamp": integer representing millisecond unix epoch, - "error": string description of the error (empty if successful), - "jobid": id of the job that this transfer belongs to - } - ] - } +Advanced use -core/version: Shows the current version of rclone and the go runtime. +The rclone rcd may use any of the flags documented on the rc page. -This shows the current version of go and the go runtime: +The flag --rc-web-gui is shorthand for -- version - rclone version, e.g. "v1.53.0" -- decomposed - version number as [major, minor, patch] -- isGit - boolean - true if this was compiled from the git version -- isBeta - boolean - true if this is a beta version -- os - OS in use as according to Go -- arch - cpu architecture in use according to Go -- goVersion - version of Go runtime in use -- linking - type of rclone executable (static or dynamic) -- goTags - space separated build tags or "none" +- Download the web GUI if necessary +- Check we are using some authentication +- --rc-user gui +- --rc-pass +- --rc-serve -debug/set-block-profile-rate: Set runtime.SetBlockProfileRate for blocking profiling. +These flags can be overridden as desired. -SetBlockProfileRate controls the fraction of goroutine blocking events -that are reported in the blocking profile. The profiler aims to sample -an average of one blocking event per rate nanoseconds spent blocked. +See also the rclone rcd documentation. -To include every blocking event in the profile, pass rate = 1. To turn -off profiling entirely, pass rate <= 0. +Example: Running a public GUI -After calling this you can use this to see the blocking profile: +For example the GUI could be served on a public port over SSL using an +htpasswd file using the following flags: - go tool pprof http://localhost:5572/debug/pprof/block +- --rc-web-gui +- --rc-addr :443 +- --rc-htpasswd /path/to/htpasswd +- --rc-cert /path/to/ssl.crt +- --rc-key /path/to/ssl.key -Parameters: +Example: Running a GUI behind a proxy -- rate - int +If you want to run the GUI behind a proxy at /rclone you could use these +flags: -debug/set-gc-percent: Call runtime/debug.SetGCPercent for setting the garbage collection target percentage. +- --rc-web-gui +- --rc-baseurl rclone +- --rc-htpasswd /path/to/htpasswd -SetGCPercent sets the garbage collection target percentage: a collection -is triggered when the ratio of freshly allocated data to live data -remaining after the previous collection reaches this percentage. -SetGCPercent returns the previous setting. The initial setting is the -value of the GOGC environment variable at startup, or 100 if the -variable is not set. +Or instead of htpasswd if you just want a single user and password: -This setting may be effectively reduced in order to maintain a memory -limit. A negative percentage effectively disables garbage collection, -unless the memory limit is reached. +- --rc-user me +- --rc-pass mypassword -See https://pkg.go.dev/runtime/debug#SetMemoryLimit for more details. +Project -Parameters: +The GUI is being developed in the: rclone/rclone-webui-react repository. -- gc-percent - int +Bug reports and contributions are very welcome :-) -debug/set-mutex-profile-fraction: Set runtime.SetMutexProfileFraction for mutex profiling. +If you have questions then please ask them on the rclone forum. -SetMutexProfileFraction controls the fraction of mutex contention events -that are reported in the mutex profile. On average 1/rate events are -reported. The previous rate is returned. +Remote controlling rclone with its API -To turn off profiling entirely, pass rate 0. To just read the current -rate, pass rate < 0. (For n>1 the details of sampling may change.) +If rclone is run with the --rc flag then it starts an HTTP server which +can be used to remote control rclone using its API. -Once this is set you can look use this to profile the mutex contention: +You can either use the rc command to access the API or use HTTP +directly. - go tool pprof http://localhost:5572/debug/pprof/mutex +If you just want to run a remote control then see the rcd command. -Parameters: +Supported parameters -- rate - int +--rc -Results: +Flag to start the http server listen on remote requests -- previousRate - int +--rc-addr=IP -debug/set-soft-memory-limit: Call runtime/debug.SetMemoryLimit for setting a soft memory limit for the runtime. +IPaddress:Port or :Port to bind server to. (default "localhost:5572") -SetMemoryLimit provides the runtime with a soft memory limit. +--rc-cert=KEY -The runtime undertakes several processes to try to respect this memory -limit, including adjustments to the frequency of garbage collections and -returning memory to the underlying system more aggressively. This limit -will be respected even if GOGC=off (or, if SetGCPercent(-1) is -executed). +SSL PEM key (concatenation of certificate and CA certificate) -The input limit is provided as bytes, and includes all memory mapped, -managed, and not released by the Go runtime. Notably, it does not -account for space used by the Go binary and memory external to Go, such -as memory managed by the underlying system on behalf of the process, or -memory managed by non-Go code inside the same process. Examples of -excluded memory sources include: OS kernel memory held on behalf of the -process, memory allocated by C code, and memory mapped by syscall.Mmap -(because it is not managed by the Go runtime). +--rc-client-ca=PATH -A zero limit or a limit that's lower than the amount of memory used by -the Go runtime may cause the garbage collector to run nearly -continuously. However, the application may still make progress. +Client certificate authority to verify clients with -The memory limit is always respected by the Go runtime, so to -effectively disable this behavior, set the limit very high. -math.MaxInt64 is the canonical value for disabling the limit, but values -much greater than the available memory on the underlying system work -just as well. +--rc-htpasswd=PATH -See https://go.dev/doc/gc-guide for a detailed guide explaining the soft -memory limit in more detail, as well as a variety of common use-cases -and scenarios. +htpasswd file - if not provided no authentication is done -SetMemoryLimit returns the previously set memory limit. A negative input -does not adjust the limit, and allows for retrieval of the currently set -memory limit. +--rc-key=PATH -Parameters: +SSL PEM Private key -- mem-limit - int +--rc-max-header-bytes=VALUE -fscache/clear: Clear the Fs cache. +Maximum size of request header (default 4096) -This clears the fs cache. This is where remotes created from backends -are cached for a short while to make repeated rc calls more efficient. +--rc-min-tls-version=VALUE -If you change the parameters of a backend then you may want to call this -to clear an existing remote out of the cache before re-creating it. +The minimum TLS version that is acceptable. Valid values are "tls1.0", +"tls1.1", "tls1.2" and "tls1.3" (default "tls1.0"). -Authentication is required for this call. +--rc-user=VALUE -fscache/entries: Returns the number of entries in the fs cache. +User name for authentication. -This returns the number of entries in the fs cache. +--rc-pass=VALUE -Returns - entries - number of items in the cache +Password for authentication. -Authentication is required for this call. +--rc-realm=VALUE -job/list: Lists the IDs of the running jobs +Realm for authentication (default "rclone") -Parameters: None. +--rc-server-read-timeout=DURATION -Results: +Timeout for server reading data (default 1h0m0s) -- executeId - string id of rclone executing (change after restart) -- jobids - array of integer job ids (starting at 1 on each restart) +--rc-server-write-timeout=DURATION -job/status: Reads the status of the job ID +Timeout for server writing data (default 1h0m0s) -Parameters: +--rc-serve -- jobid - id of the job (integer). +Enable the serving of remote objects via the HTTP interface. This means +objects will be accessible at http://127.0.0.1:5572/ by default, so you +can browse to http://127.0.0.1:5572/ or http://127.0.0.1:5572/* to see a +listing of the remotes. Objects may be requested from remotes using this +syntax http://127.0.0.1:5572/[remote:path]/path/to/object -Results: +Default Off. -- finished - boolean -- duration - time in seconds that the job ran for -- endTime - time the job finished (e.g. - "2018-10-26T18:50:20.528746884+01:00") -- error - error from the job or empty string for no error -- finished - boolean whether the job has finished or not -- id - as passed in above -- startTime - time the job started (e.g. - "2018-10-26T18:50:20.528336039+01:00") -- success - boolean - true for success false otherwise -- output - output of the job as would have been returned if called - synchronously -- progress - output of the progress related to the underlying job +--rc-files /path/to/directory -job/stop: Stop the running job +Path to local files to serve on the HTTP server. -Parameters: +If this is set then rclone will serve the files in that directory. It +will also open the root in the web browser if specified. This is for +implementing browser based GUIs for rclone functions. -- jobid - id of the job (integer). +If --rc-user or --rc-pass is set then the URL that is opened will have +the authorization in the URL in the http://user:pass@localhost/ style. -job/stopgroup: Stop all running jobs in a group +Default Off. -Parameters: +--rc-enable-metrics -- group - name of the group (string). +Enable OpenMetrics/Prometheus compatible endpoint at /metrics. -mount/listmounts: Show current mount points +Default Off. -This shows currently mounted points, which can be used for performing an -unmount. +--rc-web-gui -This takes no parameters and returns +Set this flag to serve the default web gui on the same port as rclone. -- mountPoints: list of current mount points +Default Off. -Eg +--rc-allow-origin - rclone rc mount/listmounts +Set the allowed Access-Control-Allow-Origin for rc requests. -Authentication is required for this call. +Can be used with --rc-web-gui if the rclone is running on different IP +than the web-gui. -mount/mount: Create a new mount point +Default is IP address on which rc is running. -rclone allows Linux, FreeBSD, macOS and Windows to mount any of Rclone's -cloud storage systems as a file system with FUSE. +--rc-web-fetch-url -If no mountType is provided, the priority is given as follows: 1. mount -2.cmount 3.mount2 +Set the URL to fetch the rclone-web-gui files from. -This takes the following parameters: +Default +https://api.github.com/repos/rclone/rclone-webui-react/releases/latest. -- fs - a remote path to be mounted (required) -- mountPoint: valid path on the local machine (required) -- mountType: one of the values (mount, cmount, mount2) specifies the - mount implementation to use -- mountOpt: a JSON object with Mount options in. -- vfsOpt: a JSON object with VFS options in. +--rc-web-gui-update -Example: +Set this flag to check and update rclone-webui-react from the +rc-web-fetch-url. - rclone rc mount/mount fs=mydrive: mountPoint=/home//mountPoint - rclone rc mount/mount fs=mydrive: mountPoint=/home//mountPoint mountType=mount - rclone rc mount/mount fs=TestDrive: mountPoint=/mnt/tmp vfsOpt='{"CacheMode": 2}' mountOpt='{"AllowOther": true}' +Default Off. -The vfsOpt are as described in options/get and can be seen in the the -"vfs" section when running and the mountOpt can be seen in the "mount" -section: +--rc-web-gui-force-update - rclone rc options/get +Set this flag to force update rclone-webui-react from the +rc-web-fetch-url. -Authentication is required for this call. +Default Off. -mount/types: Show all possible mount types +--rc-web-gui-no-open-browser -This shows all possible mount types and returns them as a list. +Set this flag to disable opening browser automatically when using +web-gui. -This takes no parameters and returns +Default Off. -- mountTypes: list of mount types +--rc-job-expire-duration=DURATION -The mount types are strings like "mount", "mount2", "cmount" and can be -passed to mount/mount as the mountType parameter. +Expire finished async jobs older than DURATION (default 60s). -Eg +--rc-job-expire-interval=DURATION - rclone rc mount/types +Interval duration to check for expired async jobs (default 10s). -Authentication is required for this call. +--rc-no-auth -mount/unmount: Unmount selected active mount +By default rclone will require authorisation to have been set up on the +rc interface in order to use any methods which access any rclone +remotes. Eg operations/list is denied as it involved creating a remote +as is sync/copy. -rclone allows Linux, FreeBSD, macOS and Windows to mount any of Rclone's -cloud storage systems as a file system with FUSE. +If this is set then no authorisation will be required on the server to +use these methods. The alternative is to use --rc-user and --rc-pass and +use these credentials in the request. -This takes the following parameters: +Default Off. -- mountPoint: valid path on the local machine where the mount was - created (required) +--rc-baseurl -Example: +Prefix for URLs. - rclone rc mount/unmount mountPoint=/home//mountPoint +Default is root -Authentication is required for this call. +--rc-template -mount/unmountall: Unmount all active mounts +User-specified template. -rclone allows Linux, FreeBSD, macOS and Windows to mount any of Rclone's -cloud storage systems as a file system with FUSE. +Accessing the remote control via the rclone rc command -This takes no parameters and returns error if unmount does not succeed. +Rclone itself implements the remote control protocol in its rclone rc +command. -Eg +You can use it like this - rclone rc mount/unmountall + $ rclone rc rc/noop param1=one param2=two + { + "param1": "one", + "param2": "two" + } -Authentication is required for this call. +Run rclone rc on its own to see the help for the installed remote +control commands. -operations/about: Return the space used on the remote +JSON input -This takes the following parameters: +rclone rc also supports a --json flag which can be used to send more +complicated input parameters. -- fs - a remote name string e.g. "drive:" + $ rclone rc --json '{ "p1": [1,"2",null,4], "p2": { "a":1, "b":2 } }' rc/noop + { + "p1": [ + 1, + "2", + null, + 4 + ], + "p2": { + "a": 1, + "b": 2 + } + } -The result is as returned from rclone about --json +If the parameter being passed is an object then it can be passed as a +JSON string rather than using the --json flag which simplifies the +command line. -See the about command for more information on the above. + rclone rc operations/list fs=/tmp remote=test opt='{"showHash": true}' -Authentication is required for this call. +Rather than -operations/cleanup: Remove trashed files in the remote or path + rclone rc operations/list --json '{"fs": "/tmp", "remote": "test", "opt": {"showHash": true}}' -This takes the following parameters: +Special parameters -- fs - a remote name string e.g. "drive:" +The rc interface supports some special parameters which apply to all +commands. These start with _ to show they are different. -See the cleanup command for more information on the above. +Running asynchronous jobs with _async = true -Authentication is required for this call. +Each rc call is classified as a job and it is assigned its own id. By +default jobs are executed immediately as they are created or +synchronously. -operations/copyfile: Copy a file from source remote to destination remote +If _async has a true value when supplied to an rc call then it will +return immediately with a job id and the task will be run in the +background. The job/status call can be used to get information of the +background job. The job can be queried for up to 1 minute after it has +finished. -This takes the following parameters: +It is recommended that potentially long running jobs, e.g. sync/sync, +sync/copy, sync/move, operations/purge are run with the _async flag to +avoid any potential problems with the HTTP request and response timing +out. -- srcFs - a remote name string e.g. "drive:" for the source, "/" for - local filesystem -- srcRemote - a path within that remote e.g. "file.txt" for the source -- dstFs - a remote name string e.g. "drive2:" for the destination, "/" - for local filesystem -- dstRemote - a path within that remote e.g. "file2.txt" for the - destination +Starting a job with the _async flag: -Authentication is required for this call. + $ rclone rc --json '{ "p1": [1,"2",null,4], "p2": { "a":1, "b":2 }, "_async": true }' rc/noop + { + "jobid": 2 + } -operations/copyurl: Copy the URL to the object +Query the status to see if the job has finished. For more information on +the meaning of these return parameters see the job/status call. -This takes the following parameters: + $ rclone rc --json '{ "jobid":2 }' job/status + { + "duration": 0.000124163, + "endTime": "2018-10-27T11:38:07.911245881+01:00", + "error": "", + "finished": true, + "id": 2, + "output": { + "_async": true, + "p1": [ + 1, + "2", + null, + 4 + ], + "p2": { + "a": 1, + "b": 2 + } + }, + "startTime": "2018-10-27T11:38:07.911121728+01:00", + "success": true + } -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" -- url - string, URL to read from -- autoFilename - boolean, set to true to retrieve destination file - name from url +job/list can be used to show the running or recently completed jobs -See the copyurl command for more information on the above. + $ rclone rc job/list + { + "jobids": [ + 2 + ] + } -Authentication is required for this call. +Setting config flags with _config -operations/delete: Remove files in the path +If you wish to set config (the equivalent of the global flags) for the +duration of an rc call only then pass in the _config parameter. -This takes the following parameters: +This should be in the same format as the config key returned by +options/get. -- fs - a remote name string e.g. "drive:" +For example, if you wished to run a sync with the --checksum parameter, +you would pass this parameter in your JSON blob. -See the delete command for more information on the above. + "_config":{"CheckSum": true} -Authentication is required for this call. +If using rclone rc this could be passed as -operations/deletefile: Remove the single file pointed to + rclone rc sync/sync ... _config='{"CheckSum": true}' -This takes the following parameters: +Any config parameters you don't set will inherit the global defaults +which were set with command line flags or environment variables. -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" +Note that it is possible to set some values as strings or integers - see +data types for more info. Here is an example setting the equivalent of +--buffer-size in string or integer format. -See the deletefile command for more information on the above. + "_config":{"BufferSize": "42M"} + "_config":{"BufferSize": 44040192} -Authentication is required for this call. +If you wish to check the _config assignment has worked properly then +calling options/local will show what the value got set to. -operations/fsinfo: Return information about the remote +Setting filter flags with _filter -This takes the following parameters: +If you wish to set filters for the duration of an rc call only then pass +in the _filter parameter. -- fs - a remote name string e.g. "drive:" +This should be in the same format as the filter key returned by +options/get. -This returns info about the remote passed in; +For example, if you wished to run a sync with these flags - { - // optional features and whether they are available or not - "Features": { - "About": true, - "BucketBased": false, - "BucketBasedRootOK": false, - "CanHaveEmptyDirectories": true, - "CaseInsensitive": false, - "ChangeNotify": false, - "CleanUp": false, - "Command": true, - "Copy": false, - "DirCacheFlush": false, - "DirMove": true, - "Disconnect": false, - "DuplicateFiles": false, - "GetTier": false, - "IsLocal": true, - "ListR": false, - "MergeDirs": false, - "MetadataInfo": true, - "Move": true, - "OpenWriterAt": true, - "PublicLink": false, - "Purge": true, - "PutStream": true, - "PutUnchecked": false, - "ReadMetadata": true, - "ReadMimeType": false, - "ServerSideAcrossConfigs": false, - "SetTier": false, - "SetWrapper": false, - "Shutdown": false, - "SlowHash": true, - "SlowModTime": false, - "UnWrap": false, - "UserInfo": false, - "UserMetadata": true, - "WrapFs": false, - "WriteMetadata": true, - "WriteMimeType": false - }, - // Names of hashes available - "Hashes": [ - "md5", - "sha1", - "whirlpool", - "crc32", - "sha256", - "dropbox", - "mailru", - "quickxor" - ], - "Name": "local", // Name as created - "Precision": 1, // Precision of timestamps in ns - "Root": "/", // Path as created - "String": "Local file system at /", // how the remote will appear in logs - // Information about the system metadata for this backend - "MetadataInfo": { - "System": { - "atime": { - "Help": "Time of last access", - "Type": "RFC 3339", - "Example": "2006-01-02T15:04:05.999999999Z07:00" - }, - "btime": { - "Help": "Time of file birth (creation)", - "Type": "RFC 3339", - "Example": "2006-01-02T15:04:05.999999999Z07:00" - }, - "gid": { - "Help": "Group ID of owner", - "Type": "decimal number", - "Example": "500" - }, - "mode": { - "Help": "File type and mode", - "Type": "octal, unix style", - "Example": "0100664" - }, - "mtime": { - "Help": "Time of last modification", - "Type": "RFC 3339", - "Example": "2006-01-02T15:04:05.999999999Z07:00" - }, - "rdev": { - "Help": "Device ID (if special file)", - "Type": "hexadecimal", - "Example": "1abc" - }, - "uid": { - "Help": "User ID of owner", - "Type": "decimal number", - "Example": "500" - } - }, - "Help": "Textual help string\n" - } - } + --max-size 1M --max-age 42s --include "a" --include "b" -This command does not have a command line equivalent so use this -instead: +you would pass this parameter in your JSON blob. - rclone rc --loopback operations/fsinfo fs=remote: + "_filter":{"MaxSize":"1M", "IncludeRule":["a","b"], "MaxAge":"42s"} -operations/list: List the given remote and path in JSON format +If using rclone rc this could be passed as -This takes the following parameters: + rclone rc ... _filter='{"MaxSize":"1M", "IncludeRule":["a","b"], "MaxAge":"42s"}' -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" -- opt - a dictionary of options to control the listing (optional) - - recurse - If set recurse directories - - noModTime - If set return modification time - - showEncrypted - If set show decrypted names - - showOrigIDs - If set show the IDs for each item if known - - showHash - If set return a dictionary of hashes - - noMimeType - If set don't show mime types - - dirsOnly - If set only show directories - - filesOnly - If set only show files - - metadata - If set return metadata of objects also - - hashTypes - array of strings of hash types to show if showHash - set +Any filter parameters you don't set will inherit the global defaults +which were set with command line flags or environment variables. -Returns: +Note that it is possible to set some values as strings or integers - see +data types for more info. Here is an example setting the equivalent of +--buffer-size in string or integer format. -- list - - This is an array of objects as described in the lsjson command + "_filter":{"MinSize": "42M"} + "_filter":{"MinSize": 44040192} -See the lsjson command for more information on the above and examples. +If you wish to check the _filter assignment has worked properly then +calling options/local will show what the value got set to. -Authentication is required for this call. +Assigning operations to groups with _group = value -operations/mkdir: Make a destination directory or container +Each rc call has its own stats group for tracking its metrics. By +default grouping is done by the composite group name from prefix job/ +and id of the job like so job/1. -This takes the following parameters: +If _group has a value then stats for that request will be grouped under +that value. This allows caller to group stats under their own name. -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" +Stats for specific group can be accessed by passing group to core/stats: -See the mkdir command for more information on the above. + $ rclone rc --json '{ "group": "job/1" }' core/stats + { + "speed": 12345 + ... + } -Authentication is required for this call. +Data types -operations/movefile: Move a file from source remote to destination remote +When the API returns types, these will mostly be straight forward +integer, string or boolean types. -This takes the following parameters: +However some of the types returned by the options/get call and taken by +the options/set calls as well as the vfsOpt, mountOpt and the _config +parameters. -- srcFs - a remote name string e.g. "drive:" for the source, "/" for - local filesystem -- srcRemote - a path within that remote e.g. "file.txt" for the source -- dstFs - a remote name string e.g. "drive2:" for the destination, "/" - for local filesystem -- dstRemote - a path within that remote e.g. "file2.txt" for the - destination +- Duration - these are returned as an integer duration in nanoseconds. + They may be set as an integer, or they may be set with time string, + eg "5s". See the options section for more info. +- Size - these are returned as an integer number of bytes. They may be + set as an integer or they may be set with a size suffix string, eg + "10M". See the options section for more info. +- Enumerated type (such as CutoffMode, DumpFlags, LogLevel, + VfsCacheMode - these will be returned as an integer and may be set + as an integer but more conveniently they can be set as a string, eg + "HARD" for CutoffMode or DEBUG for LogLevel. +- BandwidthSpec - this will be set and returned as a string, eg "1M". -Authentication is required for this call. +Specifying remotes to work on -operations/publiclink: Create or retrieve a public link to the given file or folder. +Remotes are specified with the fs=, srcFs=, dstFs= parameters depending +on the command being used. -This takes the following parameters: +The parameters can be a string as per the rest of rclone, eg +s3:bucket/path or :sftp:/my/dir. They can also be specified as JSON +blobs. -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" -- unlink - boolean - if set removes the link rather than adding it - (optional) -- expire - string - the expiry time of the link e.g. "1d" (optional) +If specifying a JSON blob it should be a object mapping strings to +strings. These values will be used to configure the remote. There are 3 +special values which may be set: -Returns: +- type - set to type to specify a remote called :type: +- _name - set to name to specify a remote called name: +- _root - sets the root of the remote - may be empty -- url - URL of the resource +One of _name or type should normally be set. If the local backend is +desired then type should be set to local. If _root isn't specified then +it defaults to the root of the remote. -See the link command for more information on the above. +For example this JSON is equivalent to remote:/tmp -Authentication is required for this call. + { + "_name": "remote", + "_path": "/tmp" + } -operations/purge: Remove a directory or container and all of its contents +And this is equivalent to :sftp,host='example.com':/tmp -This takes the following parameters: + { + "type": "sftp", + "host": "example.com", + "_path": "/tmp" + } -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" +And this is equivalent to /tmp/dir -See the purge command for more information on the above. + { + type = "local", + _ path = "/tmp/dir" + } -Authentication is required for this call. +Supported commands -operations/rmdir: Remove an empty directory or container +backend/command: Runs a backend command. This takes the following parameters: +- command - a string with the command name - fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" - -See the rmdir command for more information on the above. +- arg - a list of arguments for the backend command +- opt - a map of string to string of options -Authentication is required for this call. +Returns: -operations/rmdirs: Remove all the empty directories in the path +- result - result from the backend command -This takes the following parameters: +Example: -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" -- leaveRoot - boolean, set to true not to delete the root + rclone rc backend/command command=noop fs=. -o echo=yes -o blue -a path1 -a path2 -See the rmdirs command for more information on the above. +Returns -Authentication is required for this call. + { + "result": { + "arg": [ + "path1", + "path2" + ], + "name": "noop", + "opt": { + "blue": "", + "echo": "yes" + } + } + } -operations/settier: Changes storage tier or class on all files in the path +Note that this is the direct equivalent of using this "backend" command: -This takes the following parameters: + rclone backend noop . -o echo=yes -o blue path1 path2 -- fs - a remote name string e.g. "drive:" +Note that arguments must be preceded by the "-a" flag -See the settier command for more information on the above. +See the backend command for more information. Authentication is required for this call. -operations/settierfile: Changes storage tier or class on the single file pointed to - -This takes the following parameters: +cache/expire: Purge a remote from cache -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" +Purge a remote from the cache backend. Supports either a directory or a +file. Params: - remote = path to remote (required) - withData = +true/false to delete cached data (chunks) as well (optional) -See the settierfile command for more information on the above. +Eg -Authentication is required for this call. + rclone rc cache/expire remote=path/to/sub/folder/ + rclone rc cache/expire remote=/ withData=true -operations/size: Count the number of bytes and files in remote +cache/fetch: Fetch file chunks -This takes the following parameters: +Ensure the specified file chunks are cached on disk. -- fs - a remote name string e.g. "drive:path/to/dir" +The chunks= parameter specifies the file chunks to check. It takes a +comma separated list of array slice indices. The slice indices are +similar to Python slices: start[:end] -Returns: +start is the 0 based chunk number from the beginning of the file to +fetch inclusive. end is 0 based chunk number from the beginning of the +file to fetch exclusive. Both values can be negative, in which case they +count from the back of the file. The value "-5:" represents the last 5 +chunks of a file. -- count - number of files -- bytes - number of bytes in those files +Some valid examples are: ":5,-5:" -> the first and last five chunks +"0,-2" -> the first and the second last chunk "0:10" -> the first ten +chunks -See the size command for more information on the above. +Any parameter with a key that starts with "file" can be used to specify +files to fetch, e.g. -Authentication is required for this call. + rclone rc cache/fetch chunks=0 file=hello file2=home/goodbye -operations/stat: Give information about the supplied file or directory +File names will automatically be encrypted when the a crypt remote is +used on top of the cache. -This takes the following parameters +cache/stats: Get cache stats -- fs - a remote name string eg "drive:" -- remote - a path within that remote eg "dir" -- opt - a dictionary of options to control the listing (optional) - - see operations/list for the options +Show statistics for the cache remote. -The result is +config/create: create the config for a remote. -- item - an object as described in the lsjson command. Will be null if - not found. +This takes the following parameters: -Note that if you are only interested in files then it is much more -efficient to set the filesOnly flag in the options. +- name - name of remote +- parameters - a map of { "key": "value" } pairs +- type - type of the new remote +- opt - a dictionary of options to control the configuration + - obscure - declare passwords are plain and need obscuring + - noObscure - declare passwords are already obscured and don't + need obscuring + - nonInteractive - don't interact with a user, return questions + - continue - continue the config process with an answer + - all - ask all the config questions not just the post config ones + - state - state to restart with - used with continue + - result - result to restart with - used with continue -See the lsjson command for more information on the above and examples. +See the config create command for more information on the above. Authentication is required for this call. -operations/uploadfile: Upload file using multiform/form-data +config/delete: Delete a remote in the config file. -This takes the following parameters: +Parameters: -- fs - a remote name string e.g. "drive:" -- remote - a path within that remote e.g. "dir" -- each part in body represents a file to be uploaded +- name - name of remote to delete -See the uploadfile command for more information on the above. +See the config delete command for more information on the above. Authentication is required for this call. -options/blocks: List all the option blocks +config/dump: Dumps the config file. -Returns: - options - a list of the options block names +Returns a JSON object: - key: value -options/get: Get all the global options +Where keys are remote names and values are the config parameters. -Returns an object where keys are option block names and values are an -object with the current option values in. +See the config dump command for more information on the above. -Note that these are the global options which are unaffected by use of -the _config and _filter parameters. If you wish to read the parameters -set in _config then use options/config and for _filter use -options/filter. +Authentication is required for this call. -This shows the internal names of the option within rclone which should -map to the external options very easily with a few exceptions. +config/get: Get a remote in the config file. -options/local: Get the currently active config for this call +Parameters: -Returns an object with the keys "config" and "filter". The "config" key -contains the local config and the "filter" key contains the local -filters. +- name - name of remote to get -Note that these are the local options specific to this rc call. If -_config was not supplied then they will be the global options. Likewise -with "_filter". +See the config dump command for more information on the above. -This call is mostly useful for seeing if _config and _filter passing is -working. +Authentication is required for this call. -This shows the internal names of the option within rclone which should -map to the external options very easily with a few exceptions. +config/listremotes: Lists the remotes in the config file and defined in environment variables. -options/set: Set an option +Returns - remotes - array of remote names -Parameters: +See the listremotes command for more information on the above. -- option block name containing an object with - - key: value +Authentication is required for this call. -Repeated as often as required. +config/password: password the config for a remote. -Only supply the options you wish to change. If an option is unknown it -will be silently ignored. Not all options will have an effect when -changed like this. +This takes the following parameters: -For example: +- name - name of remote +- parameters - a map of { "key": "value" } pairs -This sets DEBUG level logs (-vv) (these can be set by number or string) +See the config password command for more information on the above. - rclone rc options/set --json '{"main": {"LogLevel": "DEBUG"}}' - rclone rc options/set --json '{"main": {"LogLevel": 8}}' - -And this sets INFO level logs (-v) - - rclone rc options/set --json '{"main": {"LogLevel": "INFO"}}' - -And this sets NOTICE level logs (normal without -v) +Authentication is required for this call. - rclone rc options/set --json '{"main": {"LogLevel": "NOTICE"}}' +config/providers: Shows how providers are configured in the config file. -pluginsctl/addPlugin: Add a plugin using url +Returns a JSON object: - providers - array of objects -Used for adding a plugin to the webgui. +See the config providers command for more information on the above. -This takes the following parameters: +Authentication is required for this call. -- url - http url of the github repo where the plugin is hosted - (http://github.com/rclone/rclone-webui-react). +config/setpath: Set the path of the config file -Example: +Parameters: -rclone rc pluginsctl/addPlugin +- path - path to the config file to use Authentication is required for this call. -pluginsctl/getPluginsForType: Get plugins with type criteria - -This shows all possible plugins by a mime type. +config/update: update the config for a remote. This takes the following parameters: -- type - supported mime type by a loaded plugin e.g. (video/mp4, - audio/mp3). -- pluginType - filter plugins based on their type e.g. (DASHBOARD, - FILE_HANDLER, TERMINAL). - -Returns: - -- loadedPlugins - list of current production plugins. -- testPlugins - list of temporarily loaded development plugins, - usually running on a different server. - -Example: +- name - name of remote +- parameters - a map of { "key": "value" } pairs +- opt - a dictionary of options to control the configuration + - obscure - declare passwords are plain and need obscuring + - noObscure - declare passwords are already obscured and don't + need obscuring + - nonInteractive - don't interact with a user, return questions + - continue - continue the config process with an answer + - all - ask all the config questions not just the post config ones + - state - state to restart with - used with continue + - result - result to restart with - used with continue -rclone rc pluginsctl/getPluginsForType type=video/mp4 +See the config update command for more information on the above. Authentication is required for this call. -pluginsctl/listPlugins: Get the list of currently loaded plugins - -This allows you to get the currently enabled plugins and their details. - -This takes no parameters and returns: +core/bwlimit: Set the bandwidth limit. -- loadedPlugins - list of current production plugins. -- testPlugins - list of temporarily loaded development plugins, - usually running on a different server. +This sets the bandwidth limit to the string passed in. This should be a +single bandwidth limit entry or a pair of upload:download bandwidth. -E.g. +Eg -rclone rc pluginsctl/listPlugins + rclone rc core/bwlimit rate=off + { + "bytesPerSecond": -1, + "bytesPerSecondTx": -1, + "bytesPerSecondRx": -1, + "rate": "off" + } + rclone rc core/bwlimit rate=1M + { + "bytesPerSecond": 1048576, + "bytesPerSecondTx": 1048576, + "bytesPerSecondRx": 1048576, + "rate": "1M" + } + rclone rc core/bwlimit rate=1M:100k + { + "bytesPerSecond": 1048576, + "bytesPerSecondTx": 1048576, + "bytesPerSecondRx": 131072, + "rate": "1M" + } -Authentication is required for this call. +If the rate parameter is not supplied then the bandwidth is queried -pluginsctl/listTestPlugins: Show currently loaded test plugins + rclone rc core/bwlimit + { + "bytesPerSecond": 1048576, + "bytesPerSecondTx": 1048576, + "bytesPerSecondRx": 1048576, + "rate": "1M" + } -Allows listing of test plugins with the rclone.test set to true in -package.json of the plugin. +The format of the parameter is exactly the same as passed to --bwlimit +except only one bandwidth may be specified. -This takes no parameters and returns: +In either case "rate" is returned as a human-readable string, and +"bytesPerSecond" is returned as a number. -- loadedTestPlugins - list of currently available test plugins. +core/command: Run a rclone terminal command over rc. -E.g. +This takes the following parameters: - rclone rc pluginsctl/listTestPlugins +- command - a string with the command name. +- arg - a list of arguments for the backend command. +- opt - a map of string to string of options. +- returnType - one of ("COMBINED_OUTPUT", "STREAM", + "STREAM_ONLY_STDOUT", "STREAM_ONLY_STDERR"). + - Defaults to "COMBINED_OUTPUT" if not set. + - The STREAM returnTypes will write the output to the body of the + HTTP message. + - The COMBINED_OUTPUT will write the output to the "result" + parameter. -Authentication is required for this call. +Returns: -pluginsctl/removePlugin: Remove a loaded plugin +- result - result from the backend command. + - Only set when using returnType "COMBINED_OUTPUT". +- error - set if rclone exits with an error code. +- returnType - one of ("COMBINED_OUTPUT", "STREAM", + "STREAM_ONLY_STDOUT", "STREAM_ONLY_STDERR"). -This allows you to remove a plugin using it's name. +Example: -This takes parameters: + rclone rc core/command command=ls -a mydrive:/ -o max-depth=1 + rclone rc core/command -a ls -a mydrive:/ -o max-depth=1 -- name - name of the plugin in the format author/plugin_name. +Returns: -E.g. + { + "error": false, + "result": "" + } -rclone rc pluginsctl/removePlugin name=rclone/video-plugin + OR + { + "error": true, + "result": "" + } Authentication is required for this call. -pluginsctl/removeTestPlugin: Remove a test plugin - -This allows you to remove a plugin using it's name. +core/du: Returns disk usage of a locally attached disk. -This takes the following parameters: +This returns the disk usage for the local directory passed in as dir. -- name - name of the plugin in the format author/plugin_name. +If the directory is not passed in, it defaults to the directory pointed +to by --cache-dir. -Example: +- dir - string (optional) - rclone rc pluginsctl/removeTestPlugin name=rclone/rclone-webui-react +Returns: -Authentication is required for this call. + { + "dir": "/", + "info": { + "Available": 361769115648, + "Free": 361785892864, + "Total": 982141468672 + } + } -rc/error: This returns an error +core/gc: Runs a garbage collection. -This returns an error with the input as part of its error string. Useful -for testing error handling. +This tells the go runtime to do a garbage collection run. It isn't +necessary to call this normally, but it can be useful for debugging +memory problems. -rc/list: List all the registered remote control commands +core/group-list: Returns list of stats. -This lists all the registered remote control commands as a JSON map in -the commands response. +This returns list of stats groups currently in memory. -rc/noop: Echo the input to the output parameters +Returns the following values: -This echoes the input parameters to the output parameters for testing -purposes. It can be used to check that rclone is still alive and to -check that parameter passing is working properly. + { + "groups": an array of group names: + [ + "group1", + "group2", + ... + ] + } -rc/noopauth: Echo the input to the output parameters requiring auth +core/memstats: Returns the memory statistics -This echoes the input parameters to the output parameters for testing -purposes. It can be used to check that rclone is still alive and to -check that parameter passing is working properly. +This returns the memory statistics of the running program. What the +values mean are explained in the go docs: +https://golang.org/pkg/runtime/#MemStats -Authentication is required for this call. +The most interesting values for most people are: -sync/bisync: Perform bidirectional synchronization between two paths. +- HeapAlloc - this is the amount of memory rclone is actually using +- HeapSys - this is the amount of memory rclone has obtained from the + OS +- Sys - this is the total amount of memory requested from the OS + - It is virtual memory so may include unused memory -This takes the following parameters +core/obscure: Obscures a string passed in. -- path1 - a remote directory string e.g. drive:path1 -- path2 - a remote directory string e.g. drive:path2 -- dryRun - dry-run mode -- resync - performs the resync run -- checkAccess - abort if RCLONE_TEST files are not found on both - filesystems -- checkFilename - file name for checkAccess (default: RCLONE_TEST) -- maxDelete - abort sync if percentage of deleted files is above this - threshold (default: 50) -- force - Bypass maxDelete safety check and run the sync -- checkSync - true by default, false disables comparison of final - listings, only will skip sync, only compare listings from the last - run -- createEmptySrcDirs - Sync creation and deletion of empty - directories. (Not compatible with --remove-empty-dirs) -- removeEmptyDirs - remove empty directories at the final cleanup step -- filtersFile - read filtering patterns from a file -- ignoreListingChecksum - Do not use checksums for listings -- resilient - Allow future runs to retry after certain less-serious - errors, instead of requiring resync. Use at your own risk! -- workdir - server directory for history files (default: - /home/ncw/.cache/rclone/bisync) -- noCleanup - retain working files +Pass a clear string and rclone will obscure it for the config file: - +clear - string -See bisync command help and full bisync description for more -information. +Returns: - obscured - string -Authentication is required for this call. +core/pid: Return PID of current process -sync/copy: copy a directory from source remote to destination remote +This returns PID of current process. Useful for stopping rclone process. -This takes the following parameters: +core/quit: Terminates the app. -- srcFs - a remote name string e.g. "drive:src" for the source -- dstFs - a remote name string e.g. "drive:dst" for the destination -- createEmptySrcDirs - create empty src directories on destination if - set +(Optional) Pass an exit code to be used for terminating the app: - +exitCode - int -See the copy command for more information on the above. +core/stats: Returns stats about current transfers. -Authentication is required for this call. +This returns all available stats: -sync/move: move a directory from source remote to destination remote + rclone rc core/stats -This takes the following parameters: +If group is not provided then summed up stats for all groups will be +returned. -- srcFs - a remote name string e.g. "drive:src" for the source -- dstFs - a remote name string e.g. "drive:dst" for the destination -- createEmptySrcDirs - create empty src directories on destination if - set -- deleteEmptySrcDirs - delete empty src directories if set +Parameters -See the move command for more information on the above. +- group - name of the stats group (string) -Authentication is required for this call. +Returns the following values: -sync/sync: sync a directory from source remote to destination remote + { + "bytes": total transferred bytes since the start of the group, + "checks": number of files checked, + "deletes" : number of files deleted, + "elapsedTime": time in floating point seconds since rclone was started, + "errors": number of errors, + "eta": estimated time in seconds until the group completes, + "fatalError": boolean whether there has been at least one fatal error, + "lastError": last error string, + "renames" : number of files renamed, + "retryError": boolean showing whether there has been at least one non-NoRetryError, + "serverSideCopies": number of server side copies done, + "serverSideCopyBytes": number bytes server side copied, + "serverSideMoves": number of server side moves done, + "serverSideMoveBytes": number bytes server side moved, + "speed": average speed in bytes per second since start of the group, + "totalBytes": total number of bytes in the group, + "totalChecks": total number of checks in the group, + "totalTransfers": total number of transfers in the group, + "transferTime" : total time spent on running jobs, + "transfers": number of transferred files, + "transferring": an array of currently active file transfers: + [ + { + "bytes": total transferred bytes for this file, + "eta": estimated time in seconds until file transfer completion + "name": name of the file, + "percentage": progress of the file transfer in percent, + "speed": average speed over the whole transfer in bytes per second, + "speedAvg": current speed in bytes per second as an exponentially weighted moving average, + "size": size of the file in bytes + } + ], + "checking": an array of names of currently active file checks + [] + } -This takes the following parameters: +Values for "transferring", "checking" and "lastError" are only assigned +if data is available. The value for "eta" is null if an eta cannot be +determined. -- srcFs - a remote name string e.g. "drive:src" for the source -- dstFs - a remote name string e.g. "drive:dst" for the destination -- createEmptySrcDirs - create empty src directories on destination if - set +core/stats-delete: Delete stats group. -See the sync command for more information on the above. +This deletes entire stats group. -Authentication is required for this call. +Parameters -vfs/forget: Forget files or directories in the directory cache. +- group - name of the stats group (string) -This forgets the paths in the directory cache causing them to be re-read -from the remote when needed. +core/stats-reset: Reset stats. -If no paths are passed in then it will forget all the paths in the -directory cache. +This clears counters, errors and finished transfers for all stats or +specific stats group if group is provided. - rclone rc vfs/forget +Parameters -Otherwise pass files or dirs in as file=path or dir=path. Any parameter -key starting with file will forget that file and any starting with dir -will forget that dir, e.g. +- group - name of the stats group (string) - rclone rc vfs/forget file=hello file2=goodbye dir=home/junk +core/transferred: Returns stats about completed transfers. -This command takes an "fs" parameter. If this parameter is not supplied -and if there is only one VFS in use then that VFS will be used. If there -is more than one VFS in use then the "fs" parameter must be supplied. +This returns stats about completed transfers: -vfs/list: List active VFSes. + rclone rc core/transferred -This lists the active VFSes. +If group is not provided then completed transfers for all groups will be +returned. -It returns a list under the key "vfses" where the values are the VFS -names that could be passed to the other VFS commands in the "fs" -parameter. +Note only the last 100 completed transfers are returned. -vfs/poll-interval: Get the status or update the value of the poll-interval option. +Parameters -Without any parameter given this returns the current status of the -poll-interval setting. +- group - name of the stats group (string) -When the interval=duration parameter is set, the poll-interval value is -updated and the polling function is notified. Setting interval=0 -disables poll-interval. +Returns the following values: - rclone rc vfs/poll-interval interval=5m + { + "transferred": an array of completed transfers (including failed ones): + [ + { + "name": name of the file, + "size": size of the file in bytes, + "bytes": total transferred bytes for this file, + "checked": if the transfer is only checked (skipped, deleted), + "timestamp": integer representing millisecond unix epoch, + "error": string description of the error (empty if successful), + "jobid": id of the job that this transfer belongs to + } + ] + } -The timeout=duration parameter can be used to specify a time to wait for -the current poll function to apply the new value. If timeout is less or -equal 0, which is the default, wait indefinitely. +core/version: Shows the current version of rclone and the go runtime. -The new poll-interval value will only be active when the timeout is not -reached. +This shows the current version of go and the go runtime: -If poll-interval is updated or disabled temporarily, some changes might -not get picked up by the polling function, depending on the used remote. +- version - rclone version, e.g. "v1.53.0" +- decomposed - version number as [major, minor, patch] +- isGit - boolean - true if this was compiled from the git version +- isBeta - boolean - true if this is a beta version +- os - OS in use as according to Go +- arch - cpu architecture in use according to Go +- goVersion - version of Go runtime in use +- linking - type of rclone executable (static or dynamic) +- goTags - space separated build tags or "none" -This command takes an "fs" parameter. If this parameter is not supplied -and if there is only one VFS in use then that VFS will be used. If there -is more than one VFS in use then the "fs" parameter must be supplied. +debug/set-block-profile-rate: Set runtime.SetBlockProfileRate for blocking profiling. -vfs/refresh: Refresh the directory cache. +SetBlockProfileRate controls the fraction of goroutine blocking events +that are reported in the blocking profile. The profiler aims to sample +an average of one blocking event per rate nanoseconds spent blocked. -This reads the directories for the specified paths and freshens the -directory cache. +To include every blocking event in the profile, pass rate = 1. To turn +off profiling entirely, pass rate <= 0. -If no paths are passed in then it will refresh the root directory. +After calling this you can use this to see the blocking profile: - rclone rc vfs/refresh + go tool pprof http://localhost:5572/debug/pprof/block -Otherwise pass directories in as dir=path. Any parameter key starting -with dir will refresh that directory, e.g. +Parameters: - rclone rc vfs/refresh dir=home/junk dir2=data/misc +- rate - int -If the parameter recursive=true is given the whole directory tree will -get refreshed. This refresh will use --fast-list if enabled. +debug/set-gc-percent: Call runtime/debug.SetGCPercent for setting the garbage collection target percentage. -This command takes an "fs" parameter. If this parameter is not supplied -and if there is only one VFS in use then that VFS will be used. If there -is more than one VFS in use then the "fs" parameter must be supplied. +SetGCPercent sets the garbage collection target percentage: a collection +is triggered when the ratio of freshly allocated data to live data +remaining after the previous collection reaches this percentage. +SetGCPercent returns the previous setting. The initial setting is the +value of the GOGC environment variable at startup, or 100 if the +variable is not set. -vfs/stats: Stats for a VFS. +This setting may be effectively reduced in order to maintain a memory +limit. A negative percentage effectively disables garbage collection, +unless the memory limit is reached. -This returns stats for the selected VFS. +See https://pkg.go.dev/runtime/debug#SetMemoryLimit for more details. - { - // Status of the disk cache - only present if --vfs-cache-mode > off - "diskCache": { - "bytesUsed": 0, - "erroredFiles": 0, - "files": 0, - "hashType": 1, - "outOfSpace": false, - "path": "/home/user/.cache/rclone/vfs/local/mnt/a", - "pathMeta": "/home/user/.cache/rclone/vfsMeta/local/mnt/a", - "uploadsInProgress": 0, - "uploadsQueued": 0 - }, - "fs": "/mnt/a", - "inUse": 1, - // Status of the in memory metadata cache - "metadataCache": { - "dirs": 1, - "files": 0 - }, - // Options as returned by options/get - "opt": { - "CacheMaxAge": 3600000000000, - // ... - "WriteWait": 1000000000 - } - } +Parameters: -This command takes an "fs" parameter. If this parameter is not supplied -and if there is only one VFS in use then that VFS will be used. If there -is more than one VFS in use then the "fs" parameter must be supplied. +- gc-percent - int -Accessing the remote control via HTTP +debug/set-mutex-profile-fraction: Set runtime.SetMutexProfileFraction for mutex profiling. -Rclone implements a simple HTTP based protocol. +SetMutexProfileFraction controls the fraction of mutex contention events +that are reported in the mutex profile. On average 1/rate events are +reported. The previous rate is returned. -Each endpoint takes an JSON object and returns a JSON object or an -error. The JSON objects are essentially a map of string names to values. +To turn off profiling entirely, pass rate 0. To just read the current +rate, pass rate < 0. (For n>1 the details of sampling may change.) -All calls must made using POST. +Once this is set you can look use this to profile the mutex contention: -The input objects can be supplied using URL parameters, POST parameters -or by supplying "Content-Type: application/json" and a JSON blob in the -body. There are examples of these below using curl. + go tool pprof http://localhost:5572/debug/pprof/mutex -The response will be a JSON blob in the body of the response. This is -formatted to be reasonably human-readable. +Parameters: -Error returns +- rate - int -If an error occurs then there will be an HTTP error status (e.g. 500) -and the body of the response will contain a JSON encoded error object, -e.g. +Results: - { - "error": "Expecting string value for key \"remote\" (was float64)", - "input": { - "fs": "/tmp", - "remote": 3 - }, - "status": 400 - "path": "operations/rmdir", - } +- previousRate - int -The keys in the error response are - error - error string - input - the -input parameters to the call - status - the HTTP status code - path - -the path of the call +debug/set-soft-memory-limit: Call runtime/debug.SetMemoryLimit for setting a soft memory limit for the runtime. -CORS +SetMemoryLimit provides the runtime with a soft memory limit. -The sever implements basic CORS support and allows all origins for that. -The response to a preflight OPTIONS request will echo the requested -"Access-Control-Request-Headers" back. +The runtime undertakes several processes to try to respect this memory +limit, including adjustments to the frequency of garbage collections and +returning memory to the underlying system more aggressively. This limit +will be respected even if GOGC=off (or, if SetGCPercent(-1) is +executed). -Using POST with URL parameters only - - curl -X POST 'http://localhost:5572/rc/noop?potato=1&sausage=2' +The input limit is provided as bytes, and includes all memory mapped, +managed, and not released by the Go runtime. Notably, it does not +account for space used by the Go binary and memory external to Go, such +as memory managed by the underlying system on behalf of the process, or +memory managed by non-Go code inside the same process. Examples of +excluded memory sources include: OS kernel memory held on behalf of the +process, memory allocated by C code, and memory mapped by syscall.Mmap +(because it is not managed by the Go runtime). -Response +A zero limit or a limit that's lower than the amount of memory used by +the Go runtime may cause the garbage collector to run nearly +continuously. However, the application may still make progress. - { - "potato": "1", - "sausage": "2" - } +The memory limit is always respected by the Go runtime, so to +effectively disable this behavior, set the limit very high. +math.MaxInt64 is the canonical value for disabling the limit, but values +much greater than the available memory on the underlying system work +just as well. -Here is what an error response looks like: +See https://go.dev/doc/gc-guide for a detailed guide explaining the soft +memory limit in more detail, as well as a variety of common use-cases +and scenarios. - curl -X POST 'http://localhost:5572/rc/error?potato=1&sausage=2' +SetMemoryLimit returns the previously set memory limit. A negative input +does not adjust the limit, and allows for retrieval of the currently set +memory limit. - { - "error": "arbitrary error on input map[potato:1 sausage:2]", - "input": { - "potato": "1", - "sausage": "2" - } - } +Parameters: -Note that curl doesn't return errors to the shell unless you use the -f -option +- mem-limit - int - $ curl -f -X POST 'http://localhost:5572/rc/error?potato=1&sausage=2' - curl: (22) The requested URL returned error: 400 Bad Request - $ echo $? - 22 +fscache/clear: Clear the Fs cache. -Using POST with a form +This clears the fs cache. This is where remotes created from backends +are cached for a short while to make repeated rc calls more efficient. - curl --data "potato=1" --data "sausage=2" http://localhost:5572/rc/noop +If you change the parameters of a backend then you may want to call this +to clear an existing remote out of the cache before re-creating it. -Response +Authentication is required for this call. - { - "potato": "1", - "sausage": "2" - } +fscache/entries: Returns the number of entries in the fs cache. -Note that you can combine these with URL parameters too with the POST -parameters taking precedence. +This returns the number of entries in the fs cache. - curl --data "potato=1" --data "sausage=2" "http://localhost:5572/rc/noop?rutabaga=3&sausage=4" +Returns - entries - number of items in the cache -Response +Authentication is required for this call. - { - "potato": "1", - "rutabaga": "3", - "sausage": "4" - } +job/list: Lists the IDs of the running jobs -Using POST with a JSON blob +Parameters: None. - curl -H "Content-Type: application/json" -X POST -d '{"potato":2,"sausage":1}' http://localhost:5572/rc/noop +Results: -response +- executeId - string id of rclone executing (change after restart) +- jobids - array of integer job ids (starting at 1 on each restart) - { - "password": "xyz", - "username": "xyz" - } +job/status: Reads the status of the job ID -This can be combined with URL parameters too if required. The JSON blob -takes precedence. +Parameters: - curl -H "Content-Type: application/json" -X POST -d '{"potato":2,"sausage":1}' 'http://localhost:5572/rc/noop?rutabaga=3&potato=4' +- jobid - id of the job (integer). - { - "potato": 2, - "rutabaga": "3", - "sausage": 1 - } +Results: -Debugging rclone with pprof +- finished - boolean +- duration - time in seconds that the job ran for +- endTime - time the job finished (e.g. + "2018-10-26T18:50:20.528746884+01:00") +- error - error from the job or empty string for no error +- finished - boolean whether the job has finished or not +- id - as passed in above +- startTime - time the job started (e.g. + "2018-10-26T18:50:20.528336039+01:00") +- success - boolean - true for success false otherwise +- output - output of the job as would have been returned if called + synchronously +- progress - output of the progress related to the underlying job -If you use the --rc flag this will also enable the use of the go -profiling tools on the same port. +job/stop: Stop the running job -To use these, first install go. +Parameters: -Debugging memory use +- jobid - id of the job (integer). -To profile rclone's memory use you can run: +job/stopgroup: Stop all running jobs in a group - go tool pprof -web http://localhost:5572/debug/pprof/heap +Parameters: -This should open a page in your browser showing what is using what -memory. +- group - name of the group (string). -You can also use the -text flag to produce a textual summary +mount/listmounts: Show current mount points - $ go tool pprof -text http://localhost:5572/debug/pprof/heap - Showing nodes accounting for 1537.03kB, 100% of 1537.03kB total - flat flat% sum% cum cum% - 1024.03kB 66.62% 66.62% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.addDecoderNode - 513kB 33.38% 100% 513kB 33.38% net/http.newBufioWriterSize - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/all.init - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/serve.init - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/serve/restic.init - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2.init - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.init - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.init.0 - 0 0% 100% 1024.03kB 66.62% main.init - 0 0% 100% 513kB 33.38% net/http.(*conn).readRequest - 0 0% 100% 513kB 33.38% net/http.(*conn).serve - 0 0% 100% 1024.03kB 66.62% runtime.main +This shows currently mounted points, which can be used for performing an +unmount. -Debugging go routine leaks +This takes no parameters and returns -Memory leaks are most often caused by go routine leaks keeping memory -alive which should have been garbage collected. +- mountPoints: list of current mount points -See all active go routines using +Eg - curl http://localhost:5572/debug/pprof/goroutine?debug=1 + rclone rc mount/listmounts -Or go to http://localhost:5572/debug/pprof/goroutine?debug=1 in your -browser. +Authentication is required for this call. -Other profiles to look at +mount/mount: Create a new mount point -You can see a summary of profiles available at -http://localhost:5572/debug/pprof/ +rclone allows Linux, FreeBSD, macOS and Windows to mount any of Rclone's +cloud storage systems as a file system with FUSE. -Here is how to use some of them: +If no mountType is provided, the priority is given as follows: 1. mount +2.cmount 3.mount2 -- Memory: go tool pprof http://localhost:5572/debug/pprof/heap -- Go routines: - curl http://localhost:5572/debug/pprof/goroutine?debug=1 -- 30-second CPU profile: - go tool pprof http://localhost:5572/debug/pprof/profile -- 5-second execution trace: - wget http://localhost:5572/debug/pprof/trace?seconds=5 -- Goroutine blocking profile - - Enable first with: rclone rc debug/set-block-profile-rate rate=1 - (docs) - - go tool pprof http://localhost:5572/debug/pprof/block -- Contended mutexes: - - Enable first with: - rclone rc debug/set-mutex-profile-fraction rate=1 (docs) - - go tool pprof http://localhost:5572/debug/pprof/mutex +This takes the following parameters: -See the net/http/pprof docs for more info on how to use the profiling -and for a general overview see the Go team's blog post on profiling go -programs. +- fs - a remote path to be mounted (required) +- mountPoint: valid path on the local machine (required) +- mountType: one of the values (mount, cmount, mount2) specifies the + mount implementation to use +- mountOpt: a JSON object with Mount options in. +- vfsOpt: a JSON object with VFS options in. -The profiling hook is zero overhead unless it is used. +Example: -Overview of cloud storage systems + rclone rc mount/mount fs=mydrive: mountPoint=/home//mountPoint + rclone rc mount/mount fs=mydrive: mountPoint=/home//mountPoint mountType=mount + rclone rc mount/mount fs=TestDrive: mountPoint=/mnt/tmp vfsOpt='{"CacheMode": 2}' mountOpt='{"AllowOther": true}' -Each cloud storage system is slightly different. Rclone attempts to -provide a unified interface to them, but some underlying differences -show through. +The vfsOpt are as described in options/get and can be seen in the the +"vfs" section when running and the mountOpt can be seen in the "mount" +section: -Features + rclone rc options/get -Here is an overview of the major features of each cloud storage system. +Authentication is required for this call. - Name Hash ModTime Case Insensitive Duplicate Files MIME Type Metadata - ------------------------------ ------------------ --------- ------------------ ----------------- ----------- ---------- - 1Fichier Whirlpool - No Yes R - - Akamai Netstorage MD5, SHA256 R/W No No R - - Amazon Drive MD5 - Yes No R - - Amazon S3 (or S3 compatible) MD5 R/W No No R/W RWU - Backblaze B2 SHA1 R/W No No R/W - - Box SHA1 R/W Yes No - - - Citrix ShareFile MD5 R/W Yes No - - - Dropbox DBHASH ¹ R Yes No - - - Enterprise File Fabric - R/W Yes No R/W - - FTP - R/W ¹⁰ No No - - - Google Cloud Storage MD5 R/W No No R/W - - Google Drive MD5 R/W No Yes R/W - - Google Photos - - No Yes R - - HDFS - R/W No No - - - HiDrive HiDrive ¹² R/W No No - - - HTTP - R No No R - - Internet Archive MD5, SHA1, CRC32 R/W ¹¹ No No - RWU - Jottacloud MD5 R/W Yes No R - - Koofr MD5 - Yes No - - - Mail.ru Cloud Mailru ⁶ R/W Yes No - - - Mega - - No Yes - - - Memory MD5 R/W No No - - - Microsoft Azure Blob Storage MD5 R/W No No R/W - - Microsoft OneDrive QuickXorHash ⁵ R/W Yes No R - - OpenDrive MD5 R/W Yes Partial ⁸ - - - OpenStack Swift MD5 R/W No No R/W - - Oracle Object Storage MD5 R/W No No R/W - - pCloud MD5, SHA1 ⁷ R No No W - - PikPak MD5 R No No R - - premiumize.me - - Yes No R - - put.io CRC-32 R/W No Yes R - - Proton Drive SHA1 R/W No No R - - QingStor MD5 - ⁹ No No R/W - - Quatrix by Maytech - R/W No No - - - Seafile - - No No - - - SFTP MD5, SHA1 ² R/W Depends No - - - Sia - - No No - - - SMB - - Yes No - - - SugarSync - - No No - - - Storj - R No No - - - Uptobox - - No Yes - - - WebDAV MD5, SHA1 ³ R ⁴ Depends No - - - Yandex Disk MD5 R/W No No R - - Zoho WorkDrive - - No No - - - The local filesystem All R/W Depends No - RWU +mount/types: Show all possible mount types -Notes +This shows all possible mount types and returns them as a list. -¹ Dropbox supports its own custom hash. This is an SHA256 sum of all the -4 MiB block SHA256s. +This takes no parameters and returns -² SFTP supports checksums if the same login has shell access and md5sum -or sha1sum as well as echo are in the remote's PATH. +- mountTypes: list of mount types -³ WebDAV supports hashes when used with Fastmail Files, Owncloud and -Nextcloud only. +The mount types are strings like "mount", "mount2", "cmount" and can be +passed to mount/mount as the mountType parameter. -⁴ WebDAV supports modtimes when used with Fastmail Files, Owncloud and -Nextcloud only. +Eg -⁵ QuickXorHash is Microsoft's own hash. + rclone rc mount/types -⁶ Mail.ru uses its own modified SHA1 hash +Authentication is required for this call. -⁷ pCloud only supports SHA1 (not MD5) in its EU region +mount/unmount: Unmount selected active mount -⁸ Opendrive does not support creation of duplicate files using their web -client interface or other stock clients, but the underlying storage -platform has been determined to allow duplicate files, and it is -possible to create them with rclone. It may be that this is a mistake or -an unsupported feature. +rclone allows Linux, FreeBSD, macOS and Windows to mount any of Rclone's +cloud storage systems as a file system with FUSE. -⁹ QingStor does not support SetModTime for objects bigger than 5 GiB. +This takes the following parameters: -¹⁰ FTP supports modtimes for the major FTP servers, and also others if -they advertised required protocol extensions. See this for more details. +- mountPoint: valid path on the local machine where the mount was + created (required) -¹¹ Internet Archive requires option wait_archive to be set to a non-zero -value for full modtime support. +Example: -¹² HiDrive supports its own custom hash. It combines SHA1 sums for each -4 KiB block hierarchically to a single top-level sum. + rclone rc mount/unmount mountPoint=/home//mountPoint -Hash +Authentication is required for this call. -The cloud storage system supports various hash types of the objects. The -hashes are used when transferring data as an integrity check and can be -specifically used with the --checksum flag in syncs and in the check -command. +mount/unmountall: Unmount all active mounts -To use the verify checksums when transferring between cloud storage -systems they must support a common hash type. +rclone allows Linux, FreeBSD, macOS and Windows to mount any of Rclone's +cloud storage systems as a file system with FUSE. -ModTime +This takes no parameters and returns error if unmount does not succeed. -Almost all cloud storage systems store some sort of timestamp on -objects, but several of them not something that is appropriate to use -for syncing. E.g. some backends will only write a timestamp that -represent the time of the upload. To be relevant for syncing it should -be able to store the modification time of the source object. If this is -not the case, rclone will only check the file size by default, though -can be configured to check the file hash (with the --checksum flag). -Ideally it should also be possible to change the timestamp of an -existing file without having to re-upload it. +Eg -Storage systems with a - in the ModTime column, means the modification -read on objects is not the modification time of the file when uploaded. -It is most likely the time the file was uploaded, or possibly something -else (like the time the picture was taken in Google Photos). + rclone rc mount/unmountall -Storage systems with a R (for read-only) in the ModTime column, means -the it keeps modification times on objects, and updates them when -uploading objects, but it does not support changing only the -modification time (SetModTime operation) without re-uploading, possibly -not even without deleting existing first. Some operations in rclone, -such as copy and sync commands, will automatically check for SetModTime -support and re-upload if necessary to keep the modification times in -sync. Other commands will not work without SetModTime support, e.g. -touch command on an existing file will fail, and changes to modification -time only on a files in a mount will be silently ignored. +Authentication is required for this call. -Storage systems with R/W (for read/write) in the ModTime column, means -they do also support modtime-only operations. +operations/about: Return the space used on the remote -Case Insensitive +This takes the following parameters: -If a cloud storage systems is case sensitive then it is possible to have -two files which differ only in case, e.g. file.txt and FILE.txt. If a -cloud storage system is case insensitive then that isn't possible. +- fs - a remote name string e.g. "drive:" -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. +The result is as returned from rclone about --json -The local filesystem and SFTP may or may not be case sensitive depending -on OS. +See the about command for more information on the above. -- Windows - usually case insensitive, though case is preserved -- OSX - usually case insensitive, though it is possible to format case - sensitive -- Linux - usually case sensitive, but there are case insensitive file - systems (e.g. FAT formatted USB keys) +Authentication is required for this call. -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. +operations/check: check the source and destination are the same -Duplicate files +Checks the files in the source and destination match. It compares sizes +and hashes and logs a report of files that don't match. It doesn't alter +the source or destination. -If a cloud storage system allows duplicate files then it can have two -objects with the same name. +This takes the following parameters: -This confuses rclone greatly when syncing - use the rclone dedupe -command to rename or remove duplicates. +- srcFs - a remote name string e.g. "drive:" for the source, "/" for + local filesystem +- dstFs - a remote name string e.g. "drive2:" for the destination, "/" + for local filesystem +- download - check by downloading rather than with hash +- checkFileHash - treat checkFileFs:checkFileRemote as a SUM file with + hashes of given type +- checkFileFs - treat checkFileFs:checkFileRemote as a SUM file with + hashes of given type +- checkFileRemote - treat checkFileFs:checkFileRemote as a SUM file + with hashes of given type +- oneWay - check one way only, source files must exist on remote +- combined - make a combined report of changes (default false) +- missingOnSrc - report all files missing from the source (default + true) +- missingOnDst - report all files missing from the destination + (default true) +- match - report all matching files (default false) +- differ - report all non-matching files (default true) +- error - report all files with errors (hashing or reading) (default + true) + +If you supply the download flag, it will download the data from both +remotes and check them against each other on the fly. This can be useful +for remotes that don't support hashes or if you really want to check all +the data. -Restricted filenames +If you supply the size-only global flag, it will only compare the sizes +not the hashes as well. Use this for a quick check. -Some cloud storage systems might have restrictions on the characters -that are usable in file or directory names. When rclone detects such a -name during a file upload, it will transparently replace the restricted -characters with similar looking Unicode characters. To handle the -different sets of restricted characters for different backends, rclone -uses something it calls encoding. +If you supply the checkFileHash option with a valid hash name, the +checkFileFs:checkFileRemote must point to a text file in the SUM format. +This treats the checksum file as the source and dstFs as the +destination. Note that srcFs is not used and should not be supplied in +this case. -This process is designed to avoid ambiguous file names as much as -possible and allow to move files between many cloud storage systems -transparently. +Returns: -The name shown by rclone to the user or during log output will only -contain a minimal set of replaced characters to ensure correct -formatting and not necessarily the actual name used on the cloud -storage. +- success - true if no error, false otherwise +- status - textual summary of check, OK or text string +- hashType - hash used in check, may be missing +- combined - array of strings of combined report of changes +- missingOnSrc - array of strings of all files missing from the source +- missingOnDst - array of strings of all files missing from the + destination +- match - array of strings of all matching files +- differ - array of strings of all non-matching files +- error - array of strings of all files with errors (hashing or + reading) -This transformation is reversed when downloading a file or parsing -rclone arguments. For example, when uploading a file named my file?.txt -to Onedrive, it will be displayed as my file?.txt on the console, but -stored as my file?.txt to Onedrive (the ? gets replaced by the similar -looking ? character, the so-called "fullwidth question mark"). The -reverse transformation allows to read a file unusual/name.txt from -Google Drive, by passing the name unusual/name.txt on the command line -(the / needs to be replaced by the similar looking / character). +Authentication is required for this call. -Caveats +operations/cleanup: Remove trashed files in the remote or path -The filename encoding system works well in most cases, at least where -file names are written in English or similar languages. You might not -even notice it: It just works. In some cases it may lead to issues, -though. E.g. when file names are written in Chinese, or Japanese, where -it is always the Unicode fullwidth variants of the punctuation marks -that are used. +This takes the following parameters: -On Windows, the characters :, * and ? are examples of restricted -characters. If these are used in filenames on a remote that supports it, -Rclone will transparently convert them to their fullwidth Unicode -variants *, ? and : when downloading to Windows, and back again when -uploading. This way files with names that are not allowed on Windows can -still be stored. +- fs - a remote name string e.g. "drive:" -However, if you have files on your Windows system originally with these -same Unicode characters in their names, they will be included in the -same conversion process. E.g. if you create a file in your Windows -filesystem with name Test:1.jpg, where : is the Unicode fullwidth -colon symbol, and use rclone to upload it to Google Drive, which -supports regular : (halfwidth question mark), rclone will replace the -fullwidth : with the halfwidth : and store the file as Test:1.jpg in -Google Drive. Since both Windows and Google Drive allows the name -Test:1.jpg, it would probably be better if rclone just kept the name as -is in this case. +See the cleanup command for more information on the above. -With the opposite situation; if you have a file named Test:1.jpg, in -your Google Drive, e.g. uploaded from a Linux system where : is valid in -file names. Then later use rclone to copy this file to your Windows -computer you will notice that on your local disk it gets renamed to -Test:1.jpg. The original filename is not legal on Windows, due to the -:, and rclone therefore renames it to make the copy possible. That is -all good. However, this can also lead to an issue: If you already had a -different file named Test:1.jpg on Windows, and then use rclone to copy -either way. Rclone will then treat the file originally named Test:1.jpg -on Google Drive and the file originally named Test:1.jpg on Windows as -the same file, and replace the contents from one with the other. +Authentication is required for this call. -Its virtually impossible to handle all cases like these correctly in all -situations, but by customizing the encoding option, changing the set of -characters that rclone should convert, you should be able to create a -configuration that works well for your specific situation. See also the -example below. +operations/copyfile: Copy a file from source remote to destination remote -(Windows was used as an example of a file system with many restricted -characters, and Google drive a storage system with few.) +This takes the following parameters: -Default restricted characters +- srcFs - a remote name string e.g. "drive:" for the source, "/" for + local filesystem +- srcRemote - a path within that remote e.g. "file.txt" for the source +- dstFs - a remote name string e.g. "drive2:" for the destination, "/" + for local filesystem +- dstRemote - a path within that remote e.g. "file2.txt" for the + destination -The table below shows the characters that are replaced by default. +Authentication is required for this call. -When a replacement character is found in a filename, this character will -be escaped with the ‛ character to avoid ambiguous file names. (e.g. a -file named ␀.txt would shown as ‛␀.txt) +operations/copyurl: Copy the URL to the object -Each cloud storage backend can use a different set of characters, which -will be specified in the documentation for each backend. +This takes the following parameters: - Character Value Replacement - ----------- ------- ------------- - NUL 0x00 ␀ - SOH 0x01 ␁ - STX 0x02 ␂ - ETX 0x03 ␃ - EOT 0x04 ␄ - ENQ 0x05 ␅ - ACK 0x06 ␆ - BEL 0x07 ␇ - BS 0x08 ␈ - HT 0x09 ␉ - LF 0x0A ␊ - VT 0x0B ␋ - FF 0x0C ␌ - CR 0x0D ␍ - SO 0x0E ␎ - SI 0x0F ␏ - DLE 0x10 ␐ - DC1 0x11 ␑ - DC2 0x12 ␒ - DC3 0x13 ␓ - DC4 0x14 ␔ - NAK 0x15 ␕ - SYN 0x16 ␖ - ETB 0x17 ␗ - CAN 0x18 ␘ - EM 0x19 ␙ - SUB 0x1A ␚ - ESC 0x1B ␛ - FS 0x1C ␜ - GS 0x1D ␝ - RS 0x1E ␞ - US 0x1F ␟ - / 0x2F / - DEL 0x7F ␡ +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" +- url - string, URL to read from +- autoFilename - boolean, set to true to retrieve destination file + name from url -The default encoding will also encode these file names as they are -problematic with many cloud storage systems. +See the copyurl command for more information on the above. - File name Replacement - ----------- ------------- - . . - .. .. +Authentication is required for this call. -Invalid UTF-8 bytes +operations/delete: Remove files in the path -Some backends only support a sequence of well formed UTF-8 bytes as file -or directory names. +This takes the following parameters: -In this case all invalid UTF-8 bytes will be replaced with a quoted -representation of the byte value to allow uploading a file to such a -backend. For example, the invalid byte 0xFE will be encoded as ‛FE. +- fs - a remote name string e.g. "drive:" -A common source of invalid UTF-8 bytes are local filesystems, that store -names in a different encoding than UTF-8 or UTF-16, like latin1. See the -local filenames section for details. +See the delete command for more information on the above. -Encoding option +Authentication is required for this call. -Most backends have an encoding option, specified as a flag ---backend-encoding where backend is the name of the backend, or as a -config parameter encoding (you'll need to select the Advanced config in -rclone config to see it). +operations/deletefile: Remove the single file pointed to -This will have default value which encodes and decodes characters in -such a way as to preserve the maximum number of characters (see above). +This takes the following parameters: -However this can be incorrect in some scenarios, for example if you have -a Windows file system with Unicode fullwidth characters *, ? or :, -that you want to remain as those characters on the remote rather than -being translated to regular (halfwidth) *, ? and :. +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" -The --backend-encoding flags allow you to change that. You can disable -the encoding completely with --backend-encoding None or set -encoding = None in the config file. +See the deletefile command for more information on the above. -Encoding takes a comma separated list of encodings. You can see the list -of all possible values by passing an invalid value to this flag, e.g. ---local-encoding "help". The command rclone help flags encoding will -show you the defaults for the backends. +Authentication is required for this call. - ---------------------------------------------------------------------------------- - Encoding Characters Encoded as - ---------------------- ------------------------ ---------------------------------- - Asterisk * * +operations/fsinfo: Return information about the remote - BackQuote ` ` +This takes the following parameters: - BackSlash \ \ +- fs - a remote name string e.g. "drive:" - Colon : : +This returns info about the remote passed in; - CrLf CR 0x0D, LF 0x0A ␍, ␊ + { + // optional features and whether they are available or not + "Features": { + "About": true, + "BucketBased": false, + "BucketBasedRootOK": false, + "CanHaveEmptyDirectories": true, + "CaseInsensitive": false, + "ChangeNotify": false, + "CleanUp": false, + "Command": true, + "Copy": false, + "DirCacheFlush": false, + "DirMove": true, + "Disconnect": false, + "DuplicateFiles": false, + "GetTier": false, + "IsLocal": true, + "ListR": false, + "MergeDirs": false, + "MetadataInfo": true, + "Move": true, + "OpenWriterAt": true, + "PublicLink": false, + "Purge": true, + "PutStream": true, + "PutUnchecked": false, + "ReadMetadata": true, + "ReadMimeType": false, + "ServerSideAcrossConfigs": false, + "SetTier": false, + "SetWrapper": false, + "Shutdown": false, + "SlowHash": true, + "SlowModTime": false, + "UnWrap": false, + "UserInfo": false, + "UserMetadata": true, + "WrapFs": false, + "WriteMetadata": true, + "WriteMimeType": false + }, + // Names of hashes available + "Hashes": [ + "md5", + "sha1", + "whirlpool", + "crc32", + "sha256", + "dropbox", + "mailru", + "quickxor" + ], + "Name": "local", // Name as created + "Precision": 1, // Precision of timestamps in ns + "Root": "/", // Path as created + "String": "Local file system at /", // how the remote will appear in logs + // Information about the system metadata for this backend + "MetadataInfo": { + "System": { + "atime": { + "Help": "Time of last access", + "Type": "RFC 3339", + "Example": "2006-01-02T15:04:05.999999999Z07:00" + }, + "btime": { + "Help": "Time of file birth (creation)", + "Type": "RFC 3339", + "Example": "2006-01-02T15:04:05.999999999Z07:00" + }, + "gid": { + "Help": "Group ID of owner", + "Type": "decimal number", + "Example": "500" + }, + "mode": { + "Help": "File type and mode", + "Type": "octal, unix style", + "Example": "0100664" + }, + "mtime": { + "Help": "Time of last modification", + "Type": "RFC 3339", + "Example": "2006-01-02T15:04:05.999999999Z07:00" + }, + "rdev": { + "Help": "Device ID (if special file)", + "Type": "hexadecimal", + "Example": "1abc" + }, + "uid": { + "Help": "User ID of owner", + "Type": "decimal number", + "Example": "500" + } + }, + "Help": "Textual help string\n" + } + } - Ctl All control characters ␀␁␂␃␄␅␆␇␈␉␊␋␌␍␎␏␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟ - 0x00-0x1F +This command does not have a command line equivalent so use this +instead: - Del DEL 0x7F ␡ + rclone rc --loopback operations/fsinfo fs=remote: - Dollar $ $ +operations/list: List the given remote and path in JSON format - Dot . or .. as entire string ., .. +This takes the following parameters: - DoubleQuote " " +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" +- opt - a dictionary of options to control the listing (optional) + - recurse - If set recurse directories + - noModTime - If set return modification time + - showEncrypted - If set show decrypted names + - showOrigIDs - If set show the IDs for each item if known + - showHash - If set return a dictionary of hashes + - noMimeType - If set don't show mime types + - dirsOnly - If set only show directories + - filesOnly - If set only show files + - metadata - If set return metadata of objects also + - hashTypes - array of strings of hash types to show if showHash + set - Hash # # +Returns: - InvalidUtf8 An invalid UTF-8 � - character (e.g. latin1) +- list + - This is an array of objects as described in the lsjson command - LeftCrLfHtVt CR 0x0D, LF 0x0A, HT ␍, ␊, ␉, ␋ - 0x09, VT 0x0B on the - left of a string +See the lsjson command for more information on the above and examples. - LeftPeriod . on the left of a . - string +Authentication is required for this call. - LeftSpace SPACE on the left of a ␠ - string +operations/mkdir: Make a destination directory or container - LeftTilde ~ on the left of a ~ - string +This takes the following parameters: - LtGt <, > <, > +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" - None No characters are - encoded +See the mkdir command for more information on the above. - Percent % % +Authentication is required for this call. - Pipe | | +operations/movefile: Move a file from source remote to destination remote - Question ? ? +This takes the following parameters: - RightCrLfHtVt CR 0x0D, LF 0x0A, HT ␍, ␊, ␉, ␋ - 0x09, VT 0x0B on the - right of a string +- srcFs - a remote name string e.g. "drive:" for the source, "/" for + local filesystem +- srcRemote - a path within that remote e.g. "file.txt" for the source +- dstFs - a remote name string e.g. "drive2:" for the destination, "/" + for local filesystem +- dstRemote - a path within that remote e.g. "file2.txt" for the + destination - RightPeriod . on the right of a . - string +Authentication is required for this call. - RightSpace SPACE on the right of a ␠ - string +operations/publiclink: Create or retrieve a public link to the given file or folder. - Semicolon ; ; +This takes the following parameters: - SingleQuote ' ' +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" +- unlink - boolean - if set removes the link rather than adding it + (optional) +- expire - string - the expiry time of the link e.g. "1d" (optional) - Slash / / +Returns: - SquareBracket [, ] [, ] - ---------------------------------------------------------------------------------- +- url - URL of the resource -Encoding example: FTP +See the link command for more information on the above. -To take a specific example, the FTP backend's default encoding is +Authentication is required for this call. - --ftp-encoding "Slash,Del,Ctl,RightSpace,Dot" +operations/purge: Remove a directory or container and all of its contents -However, let's say the FTP server is running on Windows and can't have -any of the invalid Windows characters in file names. You are backing up -Linux servers to this FTP server which do have those characters in file -names. So you would add the Windows set which are +This takes the following parameters: - Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" -to the existing ones, giving: +See the purge command for more information on the above. - Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot,Del,RightSpace +Authentication is required for this call. -This can be specified using the --ftp-encoding flag or using an encoding -parameter in the config file. +operations/rmdir: Remove an empty directory or container -Encoding example: Windows +This takes the following parameters: -As a nother example, take a Windows system where there is a file with -name Test:1.jpg, where : is the Unicode fullwidth colon symbol. When -using rclone to copy this to a remote which supports :, the regular -(halfwidth) colon (such as Google Drive), you will notice that the file -gets renamed to Test:1.jpg. +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" -To avoid this you can change the set of characters rclone should convert -for the local filesystem, using command-line argument --local-encoding. -Rclone's default behavior on Windows corresponds to +See the rmdir command for more information on the above. - --local-encoding "Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot" +Authentication is required for this call. -If you want to use fullwidth characters :, * and ? in your filenames -without rclone changing them when uploading to a remote, then set the -same as the default value but without Colon,Question,Asterisk: +operations/rmdirs: Remove all the empty directories in the path - --local-encoding "Slash,LtGt,DoubleQuote,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot" +This takes the following parameters: -Alternatively, you can disable the conversion of any characters with ---local-encoding None. +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" +- leaveRoot - boolean, set to true not to delete the root -Instead of using command-line argument --local-encoding, you may also -set it as environment variable RCLONE_LOCAL_ENCODING, or configure a -remote of type local in your config, and set the encoding option there. +See the rmdirs command for more information on the above. -The risk by doing this is that if you have a filename with the regular -(halfwidth) :, * and ? in your cloud storage, and you try to download it -to your Windows filesystem, this will fail. These characters are not -valid in filenames on Windows, and you have told rclone not to work -around this by converting them to valid fullwidth variants. +Authentication is required for this call. -MIME Type +operations/settier: Changes storage tier or class on all files in the path -MIME types (also known as media types) classify types of documents using -a simple text classification, e.g. text/html or application/pdf. +This takes the following parameters: -Some cloud storage systems support reading (R) the MIME type of objects -and some support writing (W) the MIME type of objects. +- fs - a remote name string e.g. "drive:" -The MIME type can be important if you are serving files directly to HTTP -from the storage system. +See the settier command for more information on the above. -If you are copying from a remote which supports reading (R) to a remote -which supports writing (W) then rclone will preserve the MIME types. -Otherwise they will be guessed from the extension, or the remote itself -may assign the MIME type. +Authentication is required for this call. -Metadata +operations/settierfile: Changes storage tier or class on the single file pointed to -Backends may or may support reading or writing metadata. They may -support reading and writing system metadata (metadata intrinsic to that -backend) and/or user metadata (general purpose metadata). +This takes the following parameters: -The levels of metadata support are +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" - Key Explanation - ----- ----------------------------------------------------------------- - R Read only System Metadata - RW Read and write System Metadata - RWU Read and write System Metadata and read and write User Metadata +See the settierfile command for more information on the above. -See the metadata docs for more info. +Authentication is required for this call. -Optional Features +operations/size: Count the number of bytes and files in remote -All rclone remotes support a base command set. Other features depend -upon backend-specific capabilities. +This takes the following parameters: - ------------------------------------------------------------------------------------------------------------------------------------- - Name Purge Copy Move DirMove CleanUp ListR StreamUpload MultithreadUpload LinkSharing About EmptyDir - --------------- ------- ------ ------ --------- --------- ------- -------------- ------------------- ------------- ------- ---------- - 1Fichier No Yes Yes No No No No No Yes No Yes +- fs - a remote name string e.g. "drive:path/to/dir" - Akamai Yes No No No No Yes Yes No No No Yes - Netstorage +Returns: - Amazon Drive Yes No Yes Yes No No No No No No Yes +- count - number of files +- bytes - number of bytes in those files - Amazon S3 (or No Yes No No Yes Yes Yes Yes Yes No No - S3 compatible) +See the size command for more information on the above. - Backblaze B2 No Yes No No Yes Yes Yes Yes Yes No No +Authentication is required for this call. - Box Yes Yes Yes Yes Yes ‡‡ No Yes No Yes Yes Yes +operations/stat: Give information about the supplied file or directory - Citrix Yes Yes Yes Yes No No No No No No Yes - ShareFile +This takes the following parameters - Dropbox Yes Yes Yes Yes No No Yes No Yes Yes Yes +- fs - a remote name string eg "drive:" +- remote - a path within that remote eg "dir" +- opt - a dictionary of options to control the listing (optional) + - see operations/list for the options - Enterprise File Yes Yes Yes Yes Yes No No No No No Yes - Fabric +The result is - FTP No No Yes Yes No No Yes No No No Yes +- item - an object as described in the lsjson command. Will be null if + not found. - Google Cloud Yes Yes No No No Yes Yes No No No No - Storage +Note that if you are only interested in files then it is much more +efficient to set the filesOnly flag in the options. - Google Drive Yes Yes Yes Yes Yes Yes Yes No Yes Yes Yes +See the lsjson command for more information on the above and examples. - Google Photos No No No No No No No No No No No +Authentication is required for this call. - HDFS Yes No Yes Yes No No Yes No No Yes Yes +operations/uploadfile: Upload file using multiform/form-data - HiDrive Yes Yes Yes Yes No No Yes No No No Yes +This takes the following parameters: - HTTP No No No No No No No No No No Yes +- fs - a remote name string e.g. "drive:" +- remote - a path within that remote e.g. "dir" +- each part in body represents a file to be uploaded - Internet No Yes No No Yes Yes No No Yes Yes No - Archive +See the uploadfile command for more information on the above. - Jottacloud Yes Yes Yes Yes Yes Yes No No Yes Yes Yes +Authentication is required for this call. - Koofr Yes Yes Yes Yes No No Yes No Yes Yes Yes +options/blocks: List all the option blocks - Mail.ru Cloud Yes Yes Yes Yes Yes No No No Yes Yes Yes +Returns: - options - a list of the options block names - Mega Yes No Yes Yes Yes No No No Yes Yes Yes +options/get: Get all the global options - Memory No Yes No No No Yes Yes No No No No +Returns an object where keys are option block names and values are an +object with the current option values in. - Microsoft Azure Yes Yes No No No Yes Yes Yes No No No - Blob Storage +Note that these are the global options which are unaffected by use of +the _config and _filter parameters. If you wish to read the parameters +set in _config then use options/config and for _filter use +options/filter. - Microsoft Yes Yes Yes Yes Yes No No No Yes Yes Yes - OneDrive +This shows the internal names of the option within rclone which should +map to the external options very easily with a few exceptions. - OpenDrive Yes Yes Yes Yes No No No No No No Yes +options/local: Get the currently active config for this call - OpenStack Swift Yes † Yes No No No Yes Yes No No Yes No +Returns an object with the keys "config" and "filter". The "config" key +contains the local config and the "filter" key contains the local +filters. - Oracle Object No Yes No No Yes Yes Yes No No No No - Storage +Note that these are the local options specific to this rc call. If +_config was not supplied then they will be the global options. Likewise +with "_filter". - pCloud Yes Yes Yes Yes Yes No No No Yes Yes Yes +This call is mostly useful for seeing if _config and _filter passing is +working. - PikPak Yes Yes Yes Yes Yes No No No Yes Yes Yes +This shows the internal names of the option within rclone which should +map to the external options very easily with a few exceptions. - premiumize.me Yes No Yes Yes No No No No Yes Yes Yes +options/set: Set an option - put.io Yes No Yes Yes Yes No Yes No No Yes Yes +Parameters: - Proton Drive Yes No Yes Yes Yes No No No No Yes Yes +- option block name containing an object with + - key: value - QingStor No Yes No No Yes Yes No No No No No +Repeated as often as required. - Quatrix by Yes Yes Yes Yes No No No No No Yes Yes - Maytech +Only supply the options you wish to change. If an option is unknown it +will be silently ignored. Not all options will have an effect when +changed like this. - Seafile Yes Yes Yes Yes Yes Yes Yes No Yes Yes Yes +For example: - SFTP No No Yes Yes No No Yes No No Yes Yes +This sets DEBUG level logs (-vv) (these can be set by number or string) - Sia No No No No No No Yes No No No Yes + rclone rc options/set --json '{"main": {"LogLevel": "DEBUG"}}' + rclone rc options/set --json '{"main": {"LogLevel": 8}}' - SMB No No Yes Yes No No Yes Yes No No Yes +And this sets INFO level logs (-v) - SugarSync Yes Yes Yes Yes No No Yes No Yes No Yes + rclone rc options/set --json '{"main": {"LogLevel": "INFO"}}' - Storj Yes ☨ Yes Yes No No Yes Yes No Yes No No +And this sets NOTICE level logs (normal without -v) - Uptobox No Yes Yes Yes No No No No No No No + rclone rc options/set --json '{"main": {"LogLevel": "NOTICE"}}' - WebDAV Yes Yes Yes Yes No No Yes ‡ No No Yes Yes +pluginsctl/addPlugin: Add a plugin using url - Yandex Disk Yes Yes Yes Yes Yes No Yes No Yes Yes Yes +Used for adding a plugin to the webgui. - Zoho WorkDrive Yes Yes Yes Yes No No No No No Yes Yes +This takes the following parameters: - The local Yes No Yes Yes No No Yes Yes No Yes Yes - filesystem - ------------------------------------------------------------------------------------------------------------------------------------- +- url - http url of the github repo where the plugin is hosted + (http://github.com/rclone/rclone-webui-react). -Purge +Example: -This deletes a directory quicker than just deleting all the files in the -directory. +rclone rc pluginsctl/addPlugin -† Note Swift implements this in order to delete directory markers but -they don't actually have a quicker way of deleting files other than -deleting them individually. +Authentication is required for this call. -☨ Storj implements this efficiently only for entire buckets. If purging -a directory inside a bucket, files are deleted individually. +pluginsctl/getPluginsForType: Get plugins with type criteria -‡ StreamUpload is not supported with Nextcloud +This shows all possible plugins by a mime type. -Copy +This takes the following parameters: -Used when copying an object to and from the same remote. This known as a -server-side copy so you can copy a file without downloading it and -uploading it again. It is used if you use rclone copy or rclone move if -the remote doesn't support Move directly. +- type - supported mime type by a loaded plugin e.g. (video/mp4, + audio/mp3). +- pluginType - filter plugins based on their type e.g. (DASHBOARD, + FILE_HANDLER, TERMINAL). -If the server doesn't support Copy directly then for copy operations the -file is downloaded then re-uploaded. +Returns: -Move +- loadedPlugins - list of current production plugins. +- testPlugins - list of temporarily loaded development plugins, + usually running on a different server. -Used when moving/renaming an object on the same remote. This is known as -a server-side move of a file. This is used in rclone move if the server -doesn't support DirMove. +Example: -If the server isn't capable of Move then rclone simulates it with Copy -then delete. If the server doesn't support Copy then rclone will -download the file and re-upload it. +rclone rc pluginsctl/getPluginsForType type=video/mp4 -DirMove +Authentication is required for this call. -This is used to implement rclone move to move a directory if possible. -If it isn't then it will use Move on each file (which falls back to Copy -then download and upload - see Move section). +pluginsctl/listPlugins: Get the list of currently loaded plugins -CleanUp +This allows you to get the currently enabled plugins and their details. -This is used for emptying the trash for a remote by rclone cleanup. +This takes no parameters and returns: -If the server can't do CleanUp then rclone cleanup will return an error. +- loadedPlugins - list of current production plugins. +- testPlugins - list of temporarily loaded development plugins, + usually running on a different server. -‡‡ Note that while Box implements this it has to delete every file -individually so it will be slower than emptying the trash via the WebUI +E.g. -ListR +rclone rc pluginsctl/listPlugins -The remote supports a recursive list to list all the contents beneath a -directory quickly. This enables the --fast-list flag to work. See the -rclone docs for more details. +Authentication is required for this call. -StreamUpload +pluginsctl/listTestPlugins: Show currently loaded test plugins -Some remotes allow files to be uploaded without knowing the file size in -advance. This allows certain operations to work without spooling the -file to local disk first, e.g. rclone rcat. +Allows listing of test plugins with the rclone.test set to true in +package.json of the plugin. -MultithreadUpload +This takes no parameters and returns: -Some remotes allow transfers to the remote to be sent as chunks in -parallel. If this is supported then rclone will use multi-thread copying -to transfer files much faster. +- loadedTestPlugins - list of currently available test plugins. -LinkSharing +E.g. -Sets the necessary permissions on a file or folder and prints a link -that allows others to access them, even if they don't have an account on -the particular cloud provider. + rclone rc pluginsctl/listTestPlugins -About +Authentication is required for this call. -Rclone about prints quota information for a remote. Typical output -includes bytes used, free, quota and in trash. +pluginsctl/removePlugin: Remove a loaded plugin -If a remote lacks about capability rclone about remote:returns an error. +This allows you to remove a plugin using it's name. -Backends without about capability cannot determine free space for an -rclone mount, or use policy mfs (most free space) as a member of an -rclone union remote. +This takes parameters: -See rclone about command +- name - name of the plugin in the format author/plugin_name. -EmptyDir +E.g. -The remote supports empty directories. See Limitations for details. Most -Object/Bucket-based remotes do not support this. +rclone rc pluginsctl/removePlugin name=rclone/video-plugin -Global Flags +Authentication is required for this call. -This describes the global flags available to every rclone command split -into groups. +pluginsctl/removeTestPlugin: Remove a test plugin -Copy +This allows you to remove a plugin using it's name. -Flags for anything which can Copy a file. +This takes the following parameters: - --check-first Do all the checks before starting transfers - -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). - --compare-dest stringArray Include additional comma separated server-side paths during comparison - --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") - --ignore-case-sync Ignore case when synchronizing - --ignore-checksum Skip post copy check of checksums - --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum - -I, --ignore-times Don't skip files that match size and time - transfer all files - --immutable Do not modify files, fail if existing files have been modified - --inplace Download directly to destination file instead of atomic download to temp/rename - --max-backlog int Maximum number of objects in sync or check backlog (default 10000) - --max-duration Duration Maximum duration rclone will transfer data for (default 0s) - --max-transfer SizeSuffix Maximum size of data to transfer (default off) - -M, --metadata If set, preserve metadata when copying objects - --modify-window Duration Max time diff to be considered the same (default 1ns) - --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) - --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) - --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) - --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) - --no-check-dest Don't check the destination, copy regardless - --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical - --order-by string Instructions on how to order the transfers, e.g. 'size,descending' - --refresh-times Refresh the modtime of remote files - --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum - --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) - -u, --update Skip files that are newer on the destination +- name - name of the plugin in the format author/plugin_name. -Sync +Example: -Flags just used for rclone sync. + rclone rc pluginsctl/removeTestPlugin name=rclone/rclone-webui-react - --backup-dir string Make backups into hierarchy based in DIR - --delete-after When synchronizing, delete files on destination after transferring (default) - --delete-before When synchronizing, delete files on destination before transferring - --delete-during When synchronizing, delete files during transfer - --ignore-errors Delete even if there are I/O errors - --max-delete int When synchronizing, limit the number of deletes (default -1) - --max-delete-size SizeSuffix When synchronizing, limit the total size of deletes (default off) - --suffix string Suffix to add to changed files - --suffix-keep-extension Preserve the extension when using --suffix - --track-renames When synchronizing, track file renames and do a server-side move if possible - --track-renames-strategy string Strategies to use when synchronizing using track-renames hash|modtime|leaf (default "hash") +Authentication is required for this call. -Important +rc/error: This returns an error -Important flags useful for most commands. +This returns an error with the input as part of its error string. Useful +for testing error handling. - -n, --dry-run Do a trial run with no permanent changes - -i, --interactive Enable interactive mode - -v, --verbose count Print lots more stuff (repeat for more) +rc/list: List all the registered remote control commands -Check +This lists all the registered remote control commands as a JSON map in +the commands response. -Flags used for rclone check. +rc/noop: Echo the input to the output parameters - --max-backlog int Maximum number of objects in sync or check backlog (default 10000) +This echoes the input parameters to the output parameters for testing +purposes. It can be used to check that rclone is still alive and to +check that parameter passing is working properly. -Networking +rc/noopauth: Echo the input to the output parameters requiring auth -General networking and HTTP stuff. +This echoes the input parameters to the output parameters for testing +purposes. It can be used to check that rclone is still alive and to +check that parameter passing is working properly. - --bind string Local address to bind to for outgoing connections, IPv4, IPv6 or name - --bwlimit BwTimetable Bandwidth limit in KiB/s, or use suffix B|K|M|G|T|P or a full timetable - --bwlimit-file BwTimetable Bandwidth limit per file in KiB/s, or use suffix B|K|M|G|T|P or a full timetable - --ca-cert stringArray CA certificate used to verify servers - --client-cert string Client SSL certificate (PEM) for mutual TLS auth - --client-key string Client SSL private key (PEM) for mutual TLS auth - --contimeout Duration Connect timeout (default 1m0s) - --disable-http-keep-alives Disable HTTP keep-alives and use each connection once. - --disable-http2 Disable HTTP/2 in the global transport - --dscp string Set DSCP value to connections, value or name, e.g. CS1, LE, DF, AF21 - --expect-continue-timeout Duration Timeout when using expect / 100-continue in HTTP (default 1s) - --header stringArray Set HTTP header for all transactions - --header-download stringArray Set HTTP header for download transactions - --header-upload stringArray Set HTTP header for upload transactions - --no-check-certificate Do not verify the server SSL certificate (insecure) - --no-gzip-encoding Don't set Accept-Encoding: gzip - --timeout Duration IO idle timeout (default 5m0s) - --tpslimit float Limit HTTP transactions per second to this - --tpslimit-burst int Max burst of transactions for --tpslimit (default 1) - --use-cookies Enable session cookiejar - --user-agent string Set the user-agent to a specified string (default "rclone/v1.64.0") +Authentication is required for this call. -Performance +sync/bisync: Perform bidirectional synchronization between two paths. -Flags helpful for increasing performance. +This takes the following parameters - --buffer-size SizeSuffix In memory buffer size when reading files for each --transfer (default 16Mi) - --checkers int Number of checkers to run in parallel (default 8) - --transfers int Number of file transfers to run in parallel (default 4) +- path1 - a remote directory string e.g. drive:path1 +- path2 - a remote directory string e.g. drive:path2 +- dryRun - dry-run mode +- resync - performs the resync run +- checkAccess - abort if RCLONE_TEST files are not found on both + filesystems +- checkFilename - file name for checkAccess (default: RCLONE_TEST) +- maxDelete - abort sync if percentage of deleted files is above this + threshold (default: 50) +- force - Bypass maxDelete safety check and run the sync +- checkSync - true by default, false disables comparison of final + listings, only will skip sync, only compare listings from the last + run +- createEmptySrcDirs - Sync creation and deletion of empty + directories. (Not compatible with --remove-empty-dirs) +- removeEmptyDirs - remove empty directories at the final cleanup step +- filtersFile - read filtering patterns from a file +- ignoreListingChecksum - Do not use checksums for listings +- resilient - Allow future runs to retry after certain less-serious + errors, instead of requiring resync. Use at your own risk! +- workdir - server directory for history files (default: + /home/ncw/.cache/rclone/bisync) +- noCleanup - retain working files -Config +See bisync command help and full bisync description for more +information. -General configuration of rclone. +Authentication is required for this call. - --ask-password Allow prompt for password for encrypted configuration (default true) - --auto-confirm If enabled, do not request console confirmation - --cache-dir string Directory rclone will use for caching (default "$HOME/.cache/rclone") - --color string When to show colors (and other ANSI codes) AUTO|NEVER|ALWAYS (default "AUTO") - --config string Config file (default "$HOME/.config/rclone/rclone.conf") - --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) - --disable string Disable a comma separated list of features (use --disable help to see a list) - -n, --dry-run Do a trial run with no permanent changes - --error-on-no-transfer Sets exit code 9 if no files are transferred, useful in scripts - --fs-cache-expire-duration Duration Cache remotes for this long (0 to disable caching) (default 5m0s) - --fs-cache-expire-interval Duration Interval to check for expired remotes (default 1m0s) - --human-readable Print numbers in a human-readable format, sizes with suffix Ki|Mi|Gi|Ti|Pi - -i, --interactive Enable interactive mode - --kv-lock-time Duration Maximum time to keep key-value database locked by process (default 1s) - --low-level-retries int Number of low level retries to do (default 10) - --no-console Hide console window (supported on Windows only) - --no-unicode-normalization Don't normalize unicode characters in filenames - --password-command SpaceSepList Command for supplying password for encrypted configuration - --retries int Retry operations this many times if they fail (default 3) - --retries-sleep Duration Interval between retrying operations if they fail, e.g. 500ms, 60s, 5m (0 to disable) (default 0s) - --temp-dir string Directory rclone will use for temporary files (default "/tmp") - --use-mmap Use mmap allocator (see docs) - --use-server-modtime Use server modified time instead of object metadata +sync/copy: copy a directory from source remote to destination remote -Debugging +This takes the following parameters: -Flags for developers. +- srcFs - a remote name string e.g. "drive:src" for the source +- dstFs - a remote name string e.g. "drive:dst" for the destination +- createEmptySrcDirs - create empty src directories on destination if + set - --cpuprofile string Write cpu profile to file - --dump DumpFlags List of items to dump from: headers,bodies,requests,responses,auth,filters,goroutines,openfiles - --dump-bodies Dump HTTP headers and bodies - may contain sensitive info - --dump-headers Dump HTTP headers - may contain sensitive info - --memprofile string Write memory profile to file +See the copy command for more information on the above. -Filter +Authentication is required for this call. -Flags for filtering directory listings. +sync/move: move a directory from source remote to destination remote - --delete-excluded Delete files on dest excluded from sync - --exclude stringArray Exclude files matching pattern - --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) - --exclude-if-present stringArray Exclude directories if filename is present - --files-from stringArray Read list of source-file names from file (use - to read from stdin) - --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) - -f, --filter stringArray Add a file filtering rule - --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) - --ignore-case Ignore case in filters (case insensitive) - --include stringArray Include files matching pattern - --include-from stringArray Read file include patterns from file (use - to read from stdin) - --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) - --max-depth int If set limits the recursion depth to this (default -1) - --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) - --metadata-exclude stringArray Exclude metadatas matching pattern - --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) - --metadata-filter stringArray Add a metadata filtering rule - --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) - --metadata-include stringArray Include metadatas matching pattern - --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) - --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) - --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +This takes the following parameters: -Listing +- srcFs - a remote name string e.g. "drive:src" for the source +- dstFs - a remote name string e.g. "drive:dst" for the destination +- createEmptySrcDirs - create empty src directories on destination if + set +- deleteEmptySrcDirs - delete empty src directories if set -Flags for listing directories. +See the move command for more information on the above. - --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) - --fast-list Use recursive list if available; uses more memory but fewer transactions +Authentication is required for this call. -Logging +sync/sync: sync a directory from source remote to destination remote -Logging and statistics. +This takes the following parameters: - --log-file string Log everything to this file - --log-format string Comma separated list of log format options (default "date,time") - --log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "NOTICE") - --log-systemd Activate systemd integration for the logger - --max-stats-groups int Maximum number of stats groups to keep in memory, on max oldest is discarded (default 1000) - -P, --progress Show progress during transfer - --progress-terminal-title Show progress on the terminal title (requires -P/--progress) - -q, --quiet Print as little stuff as possible - --stats Duration Interval between printing stats, e.g. 500ms, 60s, 5m (0 to disable) (default 1m0s) - --stats-file-name-length int Max file name length in stats (0 for no limit) (default 45) - --stats-log-level string Log level to show --stats output DEBUG|INFO|NOTICE|ERROR (default "INFO") - --stats-one-line Make the stats fit on one line - --stats-one-line-date Enable --stats-one-line and add current date/time prefix - --stats-one-line-date-format string Enable --stats-one-line-date and use custom formatted date: Enclose date string in double quotes ("), see https://golang.org/pkg/time/#Time.Format - --stats-unit string Show data rate in stats as either 'bits' or 'bytes' per second (default "bytes") - --syslog Use Syslog for logging - --syslog-facility string Facility for syslog, e.g. KERN,USER,... (default "DAEMON") - --use-json-log Use json log format - -v, --verbose count Print lots more stuff (repeat for more) +- srcFs - a remote name string e.g. "drive:src" for the source +- dstFs - a remote name string e.g. "drive:dst" for the destination +- createEmptySrcDirs - create empty src directories on destination if + set -Metadata +See the sync command for more information on the above. -Flags to control metadata. +Authentication is required for this call. - -M, --metadata If set, preserve metadata when copying objects - --metadata-exclude stringArray Exclude metadatas matching pattern - --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) - --metadata-filter stringArray Add a metadata filtering rule - --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) - --metadata-include stringArray Include metadatas matching pattern - --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) - --metadata-set stringArray Add metadata key=value when uploading +vfs/forget: Forget files or directories in the directory cache. -RC +This forgets the paths in the directory cache causing them to be re-read +from the remote when needed. -Flags to control the Remote Control API. +If no paths are passed in then it will forget all the paths in the +directory cache. - --rc Enable the remote control server - --rc-addr stringArray IPaddress:Port or :Port to bind server to (default [localhost:5572]) - --rc-allow-origin string Origin which cross-domain request (CORS) can be executed from - --rc-baseurl string Prefix for URLs - leave blank for root - --rc-cert string TLS PEM key (concatenation of certificate and CA certificate) - --rc-client-ca string Client certificate authority to verify clients with - --rc-enable-metrics Enable prometheus metrics on /metrics - --rc-files string Path to local files to serve on the HTTP server - --rc-htpasswd string A htpasswd file - if not provided no authentication is done - --rc-job-expire-duration Duration Expire finished async jobs older than this value (default 1m0s) - --rc-job-expire-interval Duration Interval to check for expired async jobs (default 10s) - --rc-key string TLS PEM Private key - --rc-max-header-bytes int Maximum size of request header (default 4096) - --rc-min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") - --rc-no-auth Don't require auth for certain methods - --rc-pass string Password for authentication - --rc-realm string Realm for authentication - --rc-salt string Password hashing salt (default "dlPL2MqE") - --rc-serve Enable the serving of remote objects - --rc-server-read-timeout Duration Timeout for server reading data (default 1h0m0s) - --rc-server-write-timeout Duration Timeout for server writing data (default 1h0m0s) - --rc-template string User-specified template - --rc-user string User name for authentication - --rc-web-fetch-url string URL to fetch the releases for webgui (default "https://api.github.com/repos/rclone/rclone-webui-react/releases/latest") - --rc-web-gui Launch WebGUI on localhost - --rc-web-gui-force-update Force update to latest version of web gui - --rc-web-gui-no-open-browser Don't open the browser automatically - --rc-web-gui-update Check and update to latest version of web gui + rclone rc vfs/forget -Backend +Otherwise pass files or dirs in as file=path or dir=path. Any parameter +key starting with file will forget that file and any starting with dir +will forget that dir, e.g. -Backend only flags. These can be set in the config file also. + rclone rc vfs/forget file=hello file2=goodbye dir=home/junk - --acd-auth-url string Auth server URL - --acd-client-id string OAuth Client Id - --acd-client-secret string OAuth Client Secret - --acd-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) - --acd-templink-threshold SizeSuffix Files >= this size will be downloaded via their tempLink (default 9Gi) - --acd-token string OAuth Access Token as a JSON blob - --acd-token-url string Token server url - --acd-upload-wait-per-gb Duration Additional time per GiB to wait after a failed complete upload to see if it appears (default 3m0s) - --alias-remote string Remote or path to alias - --azureblob-access-tier string Access tier of blob: hot, cool or archive - --azureblob-account string Azure Storage Account Name - --azureblob-archive-tier-delete Delete archive tier blobs before overwriting - --azureblob-chunk-size SizeSuffix Upload chunk size (default 4Mi) - --azureblob-client-certificate-password string Password for the certificate file (optional) (obscured) - --azureblob-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key - --azureblob-client-id string The ID of the client in use - --azureblob-client-secret string One of the service principal's client secrets - --azureblob-client-send-certificate-chain Send the certificate chain when using certificate auth - --azureblob-directory-markers Upload an empty object with a trailing slash when a new directory is created - --azureblob-disable-checksum Don't store MD5 checksum with object metadata - --azureblob-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8) - --azureblob-endpoint string Endpoint for the service - --azureblob-env-auth Read credentials from runtime (environment variables, CLI or MSI) - --azureblob-key string Storage Account Shared Key - --azureblob-list-chunk int Size of blob list (default 5000) - --azureblob-msi-client-id string Object ID of the user-assigned MSI to use, if any - --azureblob-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any - --azureblob-msi-object-id string Object ID of the user-assigned MSI to use, if any - --azureblob-no-check-container If set, don't attempt to check the container exists or create it - --azureblob-no-head-object If set, do not do HEAD before GET when getting objects - --azureblob-password string The user's password (obscured) - --azureblob-public-access string Public access level of a container: blob or container - --azureblob-sas-url string SAS URL for container level access only - --azureblob-service-principal-file string Path to file containing credentials for use with a service principal - --azureblob-tenant string ID of the service principal's tenant. Also called its directory ID - --azureblob-upload-concurrency int Concurrency for multipart uploads (default 16) - --azureblob-upload-cutoff string Cutoff for switching to chunked upload (<= 256 MiB) (deprecated) - --azureblob-use-emulator Uses local storage emulator if provided as 'true' - --azureblob-use-msi Use a managed service identity to authenticate (only works in Azure) - --azureblob-username string User name (usually an email address) - --b2-account string Account ID or Application Key ID - --b2-chunk-size SizeSuffix Upload chunk size (default 96Mi) - --b2-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4Gi) - --b2-disable-checksum Disable checksums for large (> upload cutoff) files - --b2-download-auth-duration Duration Time before the authorization token will expire in s or suffix ms|s|m|h|d (default 1w) - --b2-download-url string Custom endpoint for downloads - --b2-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --b2-endpoint string Endpoint for the service - --b2-hard-delete Permanently delete files on remote removal, otherwise hide files - --b2-key string Application Key - --b2-test-mode string A flag string for X-Bz-Test-Mode header for debugging - --b2-upload-concurrency int Concurrency for multipart uploads (default 16) - --b2-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) - --b2-version-at Time Show file versions as they were at the specified time (default off) - --b2-versions Include old versions in directory listings - --box-access-token string Box App Primary Access Token - --box-auth-url string Auth server URL - --box-box-config-file string Box App config.json location - --box-box-sub-type string (default "user") - --box-client-id string OAuth Client Id - --box-client-secret string OAuth Client Secret - --box-commit-retries int Max number of times to try committing a multipart file (default 100) - --box-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot) - --box-impersonate string Impersonate this user ID when using a service account - --box-list-chunk int Size of listing chunk 1-1000 (default 1000) - --box-owned-by string Only show items owned by the login (email address) passed in - --box-root-folder-id string Fill in for rclone to use a non root folder as its starting point - --box-token string OAuth Access Token as a JSON blob - --box-token-url string Token server url - --box-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (>= 50 MiB) (default 50Mi) - --cache-chunk-clean-interval Duration How often should the cache perform cleanups of the chunk storage (default 1m0s) - --cache-chunk-no-memory Disable the in-memory cache for storing chunks during streaming - --cache-chunk-path string Directory to cache chunk files (default "$HOME/.cache/rclone/cache-backend") - --cache-chunk-size SizeSuffix The size of a chunk (partial file data) (default 5Mi) - --cache-chunk-total-size SizeSuffix The total size that the chunks can take up on the local disk (default 10Gi) - --cache-db-path string Directory to store file structure metadata DB (default "$HOME/.cache/rclone/cache-backend") - --cache-db-purge Clear all the cached data for this remote on start - --cache-db-wait-time Duration How long to wait for the DB to be available - 0 is unlimited (default 1s) - --cache-info-age Duration How long to cache file structure information (directory listings, file size, times, etc.) (default 6h0m0s) - --cache-plex-insecure string Skip all certificate verification when connecting to the Plex server - --cache-plex-password string The password of the Plex user (obscured) - --cache-plex-url string The URL of the Plex server - --cache-plex-username string The username of the Plex user - --cache-read-retries int How many times to retry a read from a cache storage (default 10) - --cache-remote string Remote to cache - --cache-rps int Limits the number of requests per second to the source FS (-1 to disable) (default -1) - --cache-tmp-upload-path string Directory to keep temporary files until they are uploaded - --cache-tmp-wait-time Duration How long should files be stored in local cache before being uploaded (default 15s) - --cache-workers int How many workers should run in parallel to download chunks (default 4) - --cache-writes Cache file data on writes through the FS - --chunker-chunk-size SizeSuffix Files larger than chunk size will be split in chunks (default 2Gi) - --chunker-fail-hard Choose how chunker should handle files with missing or invalid chunks - --chunker-hash-type string Choose how chunker handles hash sums (default "md5") - --chunker-remote string Remote to chunk/unchunk - --combine-upstreams SpaceSepList Upstreams for combining - --compress-level int GZIP compression level (-2 to 9) (default -1) - --compress-mode string Compression mode (default "gzip") - --compress-ram-cache-limit SizeSuffix Some remotes don't allow the upload of files with unknown size (default 20Mi) - --compress-remote string Remote to compress - -L, --copy-links Follow symlinks and copy the pointed to item - --crypt-directory-name-encryption Option to either encrypt directory names or leave them intact (default true) - --crypt-filename-encoding string How to encode the encrypted filename to text string (default "base32") - --crypt-filename-encryption string How to encrypt the filenames (default "standard") - --crypt-no-data-encryption Option to either encrypt file data or leave it unencrypted - --crypt-pass-bad-blocks If set this will pass bad blocks through as all 0 - --crypt-password string Password or pass phrase for encryption (obscured) - --crypt-password2 string Password or pass phrase for salt (obscured) - --crypt-remote string Remote to encrypt/decrypt - --crypt-server-side-across-configs Deprecated: use --server-side-across-configs instead - --crypt-show-mapping For all files listed show how the names encrypt - --crypt-suffix string If this is set it will override the default suffix of ".bin" (default ".bin") - --drive-acknowledge-abuse Set to allow files which return cannotDownloadAbusiveFile to be downloaded - --drive-allow-import-name-change Allow the filetype to change when uploading Google docs - --drive-auth-owner-only Only consider files owned by the authenticated user - --drive-auth-url string Auth server URL - --drive-chunk-size SizeSuffix Upload chunk size (default 8Mi) - --drive-client-id string Google Application Client Id - --drive-client-secret string OAuth Client Secret - --drive-copy-shortcut-content Server side copy contents of shortcuts instead of the shortcut - --drive-disable-http2 Disable drive using http2 (default true) - --drive-encoding MultiEncoder The encoding for the backend (default InvalidUtf8) - --drive-env-auth Get IAM credentials from runtime (environment variables or instance meta data if no env vars) - --drive-export-formats string Comma separated list of preferred formats for downloading Google docs (default "docx,xlsx,pptx,svg") - --drive-fast-list-bug-fix Work around a bug in Google Drive listing (default true) - --drive-formats string Deprecated: See export_formats - --drive-impersonate string Impersonate this user when using a service account - --drive-import-formats string Comma separated list of preferred formats for uploading Google docs - --drive-keep-revision-forever Keep new head revision of each file forever - --drive-list-chunk int Size of listing chunk 100-1000, 0 to disable (default 1000) - --drive-pacer-burst int Number of API calls to allow without sleeping (default 100) - --drive-pacer-min-sleep Duration Minimum time to sleep between API calls (default 100ms) - --drive-resource-key string Resource key for accessing a link-shared file - --drive-root-folder-id string ID of the root folder - --drive-scope string Scope that rclone should use when requesting access from drive - --drive-server-side-across-configs Deprecated: use --server-side-across-configs instead - --drive-service-account-credentials string Service Account Credentials JSON blob - --drive-service-account-file string Service Account Credentials JSON file path - --drive-shared-with-me Only show files that are shared with me - --drive-size-as-quota Show sizes as storage quota usage, not actual size - --drive-skip-checksum-gphotos Skip MD5 checksum on Google photos and videos only - --drive-skip-dangling-shortcuts If set skip dangling shortcut files - --drive-skip-gdocs Skip google documents in all listings - --drive-skip-shortcuts If set skip shortcut files - --drive-starred-only Only show files that are starred - --drive-stop-on-download-limit Make download limit errors be fatal - --drive-stop-on-upload-limit Make upload limit errors be fatal - --drive-team-drive string ID of the Shared Drive (Team Drive) - --drive-token string OAuth Access Token as a JSON blob - --drive-token-url string Token server url - --drive-trashed-only Only show files that are in the trash - --drive-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 8Mi) - --drive-use-created-date Use file created date instead of modified date - --drive-use-shared-date Use date file was shared instead of modified date - --drive-use-trash Send files to the trash instead of deleting permanently (default true) - --drive-v2-download-min-size SizeSuffix If Object's are greater, use drive v2 API to download (default off) - --dropbox-auth-url string Auth server URL - --dropbox-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) - --dropbox-batch-mode string Upload file batching sync|async|off (default "sync") - --dropbox-batch-size int Max number of files in upload batch - --dropbox-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) - --dropbox-chunk-size SizeSuffix Upload chunk size (< 150Mi) (default 48Mi) - --dropbox-client-id string OAuth Client Id - --dropbox-client-secret string OAuth Client Secret - --dropbox-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot) - --dropbox-impersonate string Impersonate this user when using a business account - --dropbox-pacer-min-sleep Duration Minimum time to sleep between API calls (default 10ms) - --dropbox-shared-files Instructs rclone to work on individual shared files - --dropbox-shared-folders Instructs rclone to work on shared folders - --dropbox-token string OAuth Access Token as a JSON blob - --dropbox-token-url string Token server url - --fichier-api-key string Your API Key, get it from https://1fichier.com/console/params.pl - --fichier-cdn Set if you wish to use CDN download links - --fichier-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot) - --fichier-file-password string If you want to download a shared file that is password protected, add this parameter (obscured) - --fichier-folder-password string If you want to list the files in a shared folder that is password protected, add this parameter (obscured) - --fichier-shared-folder string If you want to download a shared folder, add this parameter - --filefabric-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) - --filefabric-permanent-token string Permanent Authentication Token - --filefabric-root-folder-id string ID of the root folder - --filefabric-token string Session Token - --filefabric-token-expiry string Token expiry time - --filefabric-url string URL of the Enterprise File Fabric to connect to - --filefabric-version string Version read from the file fabric - --ftp-ask-password Allow asking for FTP password when needed - --ftp-close-timeout Duration Maximum time to wait for a response to close (default 1m0s) - --ftp-concurrency int Maximum number of FTP simultaneous connections, 0 for unlimited - --ftp-disable-epsv Disable using EPSV even if server advertises support - --ftp-disable-mlsd Disable using MLSD even if server advertises support - --ftp-disable-tls13 Disable TLS 1.3 (workaround for FTP servers with buggy TLS) - --ftp-disable-utf8 Disable using UTF-8 even if server advertises support - --ftp-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,RightSpace,Dot) - --ftp-explicit-tls Use Explicit FTPS (FTP over TLS) - --ftp-force-list-hidden Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD - --ftp-host string FTP host to connect to - --ftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) - --ftp-no-check-certificate Do not verify the TLS certificate of the server - --ftp-pass string FTP password (obscured) - --ftp-port int FTP port number (default 21) - --ftp-shut-timeout Duration Maximum time to wait for data connection closing status (default 1m0s) - --ftp-socks-proxy string Socks 5 proxy host - --ftp-tls Use Implicit FTPS (FTP over TLS) - --ftp-tls-cache-size int Size of TLS session cache for all control and data connections (default 32) - --ftp-user string FTP username (default "$USER") - --ftp-writing-mdtm Use MDTM to set modification time (VsFtpd quirk) - --gcs-anonymous Access public buckets and objects without credentials - --gcs-auth-url string Auth server URL - --gcs-bucket-acl string Access Control List for new buckets - --gcs-bucket-policy-only Access checks should use bucket-level IAM policies - --gcs-client-id string OAuth Client Id - --gcs-client-secret string OAuth Client Secret - --gcs-decompress If set this will decompress gzip encoded objects - --gcs-directory-markers Upload an empty object with a trailing slash when a new directory is created - --gcs-encoding MultiEncoder The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) - --gcs-endpoint string Endpoint for the service - --gcs-env-auth Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars) - --gcs-location string Location for the newly created buckets - --gcs-no-check-bucket If set, don't attempt to check the bucket exists or create it - --gcs-object-acl string Access Control List for new objects - --gcs-project-number string Project number - --gcs-service-account-file string Service Account Credentials JSON file path - --gcs-storage-class string The storage class to use when storing objects in Google Cloud Storage - --gcs-token string OAuth Access Token as a JSON blob - --gcs-token-url string Token server url - --gcs-user-project string User project - --gphotos-auth-url string Auth server URL - --gphotos-client-id string OAuth Client Id - --gphotos-client-secret string OAuth Client Secret - --gphotos-encoding MultiEncoder The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) - --gphotos-include-archived Also view and download archived media - --gphotos-read-only Set to make the Google Photos backend read only - --gphotos-read-size Set to read the size of media items - --gphotos-start-year int Year limits the photos to be downloaded to those which are uploaded after the given year (default 2000) - --gphotos-token string OAuth Access Token as a JSON blob - --gphotos-token-url string Token server url - --hasher-auto-size SizeSuffix Auto-update checksum for files smaller than this size (disabled by default) - --hasher-hashes CommaSepList Comma separated list of supported checksum types (default md5,sha1) - --hasher-max-age Duration Maximum time to keep checksums in cache (0 = no cache, off = cache forever) (default off) - --hasher-remote string Remote to cache checksums for (e.g. myRemote:path) - --hdfs-data-transfer-protection string Kerberos data transfer protection: authentication|integrity|privacy - --hdfs-encoding MultiEncoder The encoding for the backend (default Slash,Colon,Del,Ctl,InvalidUtf8,Dot) - --hdfs-namenode string Hadoop name node and port - --hdfs-service-principal-name string Kerberos service principal name for the namenode - --hdfs-username string Hadoop user name - --hidrive-auth-url string Auth server URL - --hidrive-chunk-size SizeSuffix Chunksize for chunked uploads (default 48Mi) - --hidrive-client-id string OAuth Client Id - --hidrive-client-secret string OAuth Client Secret - --hidrive-disable-fetching-member-count Do not fetch number of objects in directories unless it is absolutely necessary - --hidrive-encoding MultiEncoder The encoding for the backend (default Slash,Dot) - --hidrive-endpoint string Endpoint for the service (default "https://api.hidrive.strato.com/2.1") - --hidrive-root-prefix string The root/parent folder for all paths (default "/") - --hidrive-scope-access string Access permissions that rclone should use when requesting access from HiDrive (default "rw") - --hidrive-scope-role string User-level that rclone should use when requesting access from HiDrive (default "user") - --hidrive-token string OAuth Access Token as a JSON blob - --hidrive-token-url string Token server url - --hidrive-upload-concurrency int Concurrency for chunked uploads (default 4) - --hidrive-upload-cutoff SizeSuffix Cutoff/Threshold for chunked uploads (default 96Mi) - --http-headers CommaSepList Set HTTP headers for all transactions - --http-no-head Don't use HEAD requests - --http-no-slash Set this if the site doesn't end directories with / - --http-url string URL of HTTP host to connect to - --internetarchive-access-key-id string IAS3 Access Key - --internetarchive-disable-checksum Don't ask the server to test against MD5 checksum calculated by rclone (default true) - --internetarchive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot) - --internetarchive-endpoint string IAS3 Endpoint (default "https://s3.us.archive.org") - --internetarchive-front-endpoint string Host of InternetArchive Frontend (default "https://archive.org") - --internetarchive-secret-access-key string IAS3 Secret Key (password) - --internetarchive-wait-archive Duration Timeout for waiting the server's processing tasks (specifically archive and book_op) to finish (default 0s) - --jottacloud-auth-url string Auth server URL - --jottacloud-client-id string OAuth Client Id - --jottacloud-client-secret string OAuth Client Secret - --jottacloud-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot) - --jottacloud-hard-delete Delete files permanently rather than putting them into the trash - --jottacloud-md5-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate the MD5 if required (default 10Mi) - --jottacloud-no-versions Avoid server side versioning by deleting files and recreating files instead of overwriting them - --jottacloud-token string OAuth Access Token as a JSON blob - --jottacloud-token-url string Token server url - --jottacloud-trashed-only Only show files that are in the trash - --jottacloud-upload-resume-limit SizeSuffix Files bigger than this can be resumed if the upload fail's (default 10Mi) - --koofr-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --koofr-endpoint string The Koofr API endpoint to use - --koofr-mountid string Mount ID of the mount to use - --koofr-password string Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password) (obscured) - --koofr-provider string Choose your storage provider - --koofr-setmtime Does the backend support setting modification time (default true) - --koofr-user string Your user name - -l, --links Translate symlinks to/from regular files with a '.rclonelink' extension - --local-case-insensitive Force the filesystem to report itself as case insensitive - --local-case-sensitive Force the filesystem to report itself as case sensitive - --local-encoding MultiEncoder The encoding for the backend (default Slash,Dot) - --local-no-check-updated Don't check to see if the files change during upload - --local-no-preallocate Disable preallocation of disk space for transferred files - --local-no-set-modtime Disable setting modtime - --local-no-sparse Disable sparse files for multi-thread downloads - --local-nounc Disable UNC (long path names) conversion on Windows - --local-unicode-normalization Apply unicode NFC normalization to paths and filenames - --local-zero-size-links Assume the Stat size of links is zero (and read them instead) (deprecated) - --mailru-auth-url string Auth server URL - --mailru-check-hash What should copy do if file checksum is mismatched or invalid (default true) - --mailru-client-id string OAuth Client Id - --mailru-client-secret string OAuth Client Secret - --mailru-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --mailru-pass string Password (obscured) - --mailru-speedup-enable Skip full upload if there is another file with same data hash (default true) - --mailru-speedup-file-patterns string Comma separated list of file name patterns eligible for speedup (put by hash) (default "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf") - --mailru-speedup-max-disk SizeSuffix This option allows you to disable speedup (put by hash) for large files (default 3Gi) - --mailru-speedup-max-memory SizeSuffix Files larger than the size given below will always be hashed on disk (default 32Mi) - --mailru-token string OAuth Access Token as a JSON blob - --mailru-token-url string Token server url - --mailru-user string User name (usually email) - --mega-debug Output more debug from Mega - --mega-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) - --mega-hard-delete Delete files permanently rather than putting them into the trash - --mega-pass string Password (obscured) - --mega-use-https Use HTTPS for transfers - --mega-user string User name - --netstorage-account string Set the NetStorage account name - --netstorage-host string Domain+path of NetStorage host to connect to - --netstorage-protocol string Select between HTTP or HTTPS protocol (default "https") - --netstorage-secret string Set the NetStorage account secret/G2O key for authentication (obscured) - -x, --one-file-system Don't cross filesystem boundaries (unix/macOS only) - --onedrive-access-scopes SpaceSepList Set scopes to be requested by rclone (default Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All Sites.Read.All offline_access) - --onedrive-auth-url string Auth server URL - --onedrive-av-override Allows download of files the server thinks has a virus - --onedrive-chunk-size SizeSuffix Chunk size to upload files with - must be multiple of 320k (327,680 bytes) (default 10Mi) - --onedrive-client-id string OAuth Client Id - --onedrive-client-secret string OAuth Client Secret - --onedrive-drive-id string The ID of the drive to use - --onedrive-drive-type string The type of the drive (personal | business | documentLibrary) - --onedrive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot) - --onedrive-expose-onenote-files Set to make OneNote files show up in directory listings - --onedrive-hash-type string Specify the hash in use for the backend (default "auto") - --onedrive-link-password string Set the password for links created by the link command - --onedrive-link-scope string Set the scope of the links created by the link command (default "anonymous") - --onedrive-link-type string Set the type of the links created by the link command (default "view") - --onedrive-list-chunk int Size of listing chunk (default 1000) - --onedrive-no-versions Remove all versions on modifying operations - --onedrive-region string Choose national cloud region for OneDrive (default "global") - --onedrive-root-folder-id string ID of the root folder - --onedrive-server-side-across-configs Deprecated: use --server-side-across-configs instead - --onedrive-token string OAuth Access Token as a JSON blob - --onedrive-token-url string Token server url - --oos-attempt-resume-upload If true attempt to resume previously started multipart upload for the object - --oos-chunk-size SizeSuffix Chunk size to use for uploading (default 5Mi) - --oos-compartment string Object storage compartment OCID - --oos-config-file string Path to OCI config file (default "~/.oci/config") - --oos-config-profile string Profile name inside the oci config file (default "Default") - --oos-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) - --oos-copy-timeout Duration Timeout for copy (default 1m0s) - --oos-disable-checksum Don't store MD5 checksum with object metadata - --oos-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) - --oos-endpoint string Endpoint for Object storage API - --oos-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts for manual recovery - --oos-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) - --oos-namespace string Object storage namespace - --oos-no-check-bucket If set, don't attempt to check the bucket exists or create it - --oos-provider string Choose your Auth Provider (default "env_auth") - --oos-region string Object storage Region - --oos-sse-customer-algorithm string If using SSE-C, the optional header that specifies "AES256" as the encryption algorithm - --oos-sse-customer-key string To use SSE-C, the optional header that specifies the base64-encoded 256-bit encryption key to use to - --oos-sse-customer-key-file string To use SSE-C, a file containing the base64-encoded string of the AES-256 encryption key associated - --oos-sse-customer-key-sha256 string If using SSE-C, The optional header that specifies the base64-encoded SHA256 hash of the encryption - --oos-sse-kms-key-id string if using your own master key in vault, this header specifies the - --oos-storage-tier string The storage class to use when storing new objects in storage. https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/understandingstoragetiers.htm (default "Standard") - --oos-upload-concurrency int Concurrency for multipart uploads (default 10) - --oos-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) - --opendrive-chunk-size SizeSuffix Files will be uploaded in chunks this size (default 10Mi) - --opendrive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot) - --opendrive-password string Password (obscured) - --opendrive-username string Username - --pcloud-auth-url string Auth server URL - --pcloud-client-id string OAuth Client Id - --pcloud-client-secret string OAuth Client Secret - --pcloud-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --pcloud-hostname string Hostname to connect to (default "api.pcloud.com") - --pcloud-password string Your pcloud password (obscured) - --pcloud-root-folder-id string Fill in for rclone to use a non root folder as its starting point (default "d0") - --pcloud-token string OAuth Access Token as a JSON blob - --pcloud-token-url string Token server url - --pcloud-username string Your pcloud username - --pikpak-auth-url string Auth server URL - --pikpak-client-id string OAuth Client Id - --pikpak-client-secret string OAuth Client Secret - --pikpak-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot) - --pikpak-hash-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate hash if required (default 10Mi) - --pikpak-pass string Pikpak password (obscured) - --pikpak-root-folder-id string ID of the root folder - --pikpak-token string OAuth Access Token as a JSON blob - --pikpak-token-url string Token server url - --pikpak-trashed-only Only show files that are in the trash - --pikpak-use-trash Send files to the trash instead of deleting permanently (default true) - --pikpak-user string Pikpak username - --premiumizeme-auth-url string Auth server URL - --premiumizeme-client-id string OAuth Client Id - --premiumizeme-client-secret string OAuth Client Secret - --premiumizeme-encoding MultiEncoder The encoding for the backend (default Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --premiumizeme-token string OAuth Access Token as a JSON blob - --premiumizeme-token-url string Token server url - --protondrive-2fa string The 2FA code - --protondrive-app-version string The app version string (default "macos-drive@1.0.0-alpha.1+rclone") - --protondrive-enable-caching Caches the files and folders metadata to reduce API calls (default true) - --protondrive-encoding MultiEncoder The encoding for the backend (default Slash,LeftSpace,RightSpace,InvalidUtf8,Dot) - --protondrive-mailbox-password string The mailbox password of your two-password proton account (obscured) - --protondrive-original-file-size Return the file size before encryption (default true) - --protondrive-password string The password of your proton account (obscured) - --protondrive-replace-existing-draft Create a new revision when filename conflict is detected - --protondrive-username string The username of your proton account - --putio-auth-url string Auth server URL - --putio-client-id string OAuth Client Id - --putio-client-secret string OAuth Client Secret - --putio-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --putio-token string OAuth Access Token as a JSON blob - --putio-token-url string Token server url - --qingstor-access-key-id string QingStor Access Key ID - --qingstor-chunk-size SizeSuffix Chunk size to use for uploading (default 4Mi) - --qingstor-connection-retries int Number of connection retries (default 3) - --qingstor-encoding MultiEncoder The encoding for the backend (default Slash,Ctl,InvalidUtf8) - --qingstor-endpoint string Enter an endpoint URL to connection QingStor API - --qingstor-env-auth Get QingStor credentials from runtime - --qingstor-secret-access-key string QingStor Secret Access Key (password) - --qingstor-upload-concurrency int Concurrency for multipart uploads (default 1) - --qingstor-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) - --qingstor-zone string Zone to connect to - --quatrix-api-key string API key for accessing Quatrix account - --quatrix-effective-upload-time string Wanted upload time for one chunk (default "4s") - --quatrix-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --quatrix-hard-delete Delete files permanently rather than putting them into the trash - --quatrix-host string Host name of Quatrix account - --quatrix-maximal-summary-chunk-size SizeSuffix The maximal summary for all chunks. It should not be less than 'transfers'*'minimal_chunk_size' (default 95.367Mi) - --quatrix-minimal-chunk-size SizeSuffix The minimal size for one chunk (default 9.537Mi) - --s3-access-key-id string AWS Access Key ID - --s3-acl string Canned ACL used when creating buckets and storing or copying objects - --s3-bucket-acl string Canned ACL used when creating buckets - --s3-chunk-size SizeSuffix Chunk size to use for uploading (default 5Mi) - --s3-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) - --s3-decompress If set this will decompress gzip encoded objects - --s3-directory-markers Upload an empty object with a trailing slash when a new directory is created - --s3-disable-checksum Don't store MD5 checksum with object metadata - --s3-disable-http2 Disable usage of http2 for S3 backends - --s3-download-url string Custom endpoint for downloads - --s3-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) - --s3-endpoint string Endpoint for S3 API - --s3-env-auth Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars) - --s3-force-path-style If true use path style access if false use virtual hosted style (default true) - --s3-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery - --s3-list-chunk int Size of listing chunk (response list for each ListObject S3 request) (default 1000) - --s3-list-url-encode Tristate Whether to url encode listings: true/false/unset (default unset) - --s3-list-version int Version of ListObjects to use: 1,2 or 0 for auto - --s3-location-constraint string Location constraint - must be set to match the Region - --s3-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) - --s3-might-gzip Tristate Set this if the backend might gzip objects (default unset) - --s3-no-check-bucket If set, don't attempt to check the bucket exists or create it - --s3-no-head If set, don't HEAD uploaded objects to check integrity - --s3-no-head-object If set, do not do HEAD before GET when getting objects - --s3-no-system-metadata Suppress setting and reading of system metadata - --s3-profile string Profile to use in the shared credentials file - --s3-provider string Choose your S3 provider - --s3-region string Region to connect to - --s3-requester-pays Enables requester pays option when interacting with S3 bucket - --s3-secret-access-key string AWS Secret Access Key (password) - --s3-server-side-encryption string The server-side encryption algorithm used when storing this object in S3 - --s3-session-token string An AWS session token - --s3-shared-credentials-file string Path to the shared credentials file - --s3-sse-customer-algorithm string If using SSE-C, the server-side encryption algorithm used when storing this object in S3 - --s3-sse-customer-key string To use SSE-C you may provide the secret encryption key used to encrypt/decrypt your data - --s3-sse-customer-key-base64 string If using SSE-C you must provide the secret encryption key encoded in base64 format to encrypt/decrypt your data - --s3-sse-customer-key-md5 string If using SSE-C you may provide the secret encryption key MD5 checksum (optional) - --s3-sse-kms-key-id string If using KMS ID you must provide the ARN of Key - --s3-storage-class string The storage class to use when storing new objects in S3 - --s3-sts-endpoint string Endpoint for STS - --s3-upload-concurrency int Concurrency for multipart uploads (default 4) - --s3-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) - --s3-use-accelerate-endpoint If true use the AWS S3 accelerated endpoint - --s3-use-accept-encoding-gzip Accept-Encoding: gzip Whether to send Accept-Encoding: gzip header (default unset) - --s3-use-multipart-etag Tristate Whether to use ETag in multipart uploads for verification (default unset) - --s3-use-presigned-request Whether to use a presigned request or PutObject for single part uploads - --s3-v2-auth If true use v2 authentication - --s3-version-at Time Show file versions as they were at the specified time (default off) - --s3-versions Include old versions in directory listings - --seafile-2fa Two-factor authentication ('true' if the account has 2FA enabled) - --seafile-create-library Should rclone create a library if it doesn't exist - --seafile-encoding MultiEncoder The encoding for the backend (default Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8) - --seafile-library string Name of the library - --seafile-library-key string Library password (for encrypted libraries only) (obscured) - --seafile-pass string Password (obscured) - --seafile-url string URL of seafile host to connect to - --seafile-user string User name (usually email address) - --sftp-ask-password Allow asking for SFTP password when needed - --sftp-chunk-size SizeSuffix Upload and download chunk size (default 32Ki) - --sftp-ciphers SpaceSepList Space separated list of ciphers to be used for session encryption, ordered by preference - --sftp-concurrency int The maximum number of outstanding requests for one file (default 64) - --sftp-disable-concurrent-reads If set don't use concurrent reads - --sftp-disable-concurrent-writes If set don't use concurrent writes - --sftp-disable-hashcheck Disable the execution of SSH commands to determine if remote file hashing is available - --sftp-host string SSH host to connect to - --sftp-host-key-algorithms SpaceSepList Space separated list of host key algorithms, ordered by preference - --sftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) - --sftp-key-exchange SpaceSepList Space separated list of key exchange algorithms, ordered by preference - --sftp-key-file string Path to PEM-encoded private key file - --sftp-key-file-pass string The passphrase to decrypt the PEM-encoded private key file (obscured) - --sftp-key-pem string Raw PEM-encoded private key - --sftp-key-use-agent When set forces the usage of the ssh-agent - --sftp-known-hosts-file string Optional path to known_hosts file - --sftp-macs SpaceSepList Space separated list of MACs (message authentication code) algorithms, ordered by preference - --sftp-md5sum-command string The command used to read md5 hashes - --sftp-pass string SSH password, leave blank to use ssh-agent (obscured) - --sftp-path-override string Override path used by SSH shell commands - --sftp-port int SSH port number (default 22) - --sftp-pubkey-file string Optional path to public key file - --sftp-server-command string Specifies the path or command to run a sftp server on the remote host - --sftp-set-env SpaceSepList Environment variables to pass to sftp and commands - --sftp-set-modtime Set the modified time on the remote if set (default true) - --sftp-sha1sum-command string The command used to read sha1 hashes - --sftp-shell-type string The type of SSH shell on remote server, if any - --sftp-skip-links Set to skip any symlinks and any other non regular files - --sftp-socks-proxy string Socks 5 proxy host - --sftp-ssh SpaceSepList Path and arguments to external ssh binary - --sftp-subsystem string Specifies the SSH2 subsystem on the remote host (default "sftp") - --sftp-use-fstat If set use fstat instead of stat - --sftp-use-insecure-cipher Enable the use of insecure ciphers and key exchange methods - --sftp-user string SSH username (default "$USER") - --sharefile-auth-url string Auth server URL - --sharefile-chunk-size SizeSuffix Upload chunk size (default 64Mi) - --sharefile-client-id string OAuth Client Id - --sharefile-client-secret string OAuth Client Secret - --sharefile-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot) - --sharefile-endpoint string Endpoint for API calls - --sharefile-root-folder-id string ID of the root folder - --sharefile-token string OAuth Access Token as a JSON blob - --sharefile-token-url string Token server url - --sharefile-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (default 128Mi) - --sia-api-password string Sia Daemon API Password (obscured) - --sia-api-url string Sia daemon API URL, like http://sia.daemon.host:9980 (default "http://127.0.0.1:9980") - --sia-encoding MultiEncoder The encoding for the backend (default Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot) - --sia-user-agent string Siad User Agent (default "Sia-Agent") - --skip-links Don't warn about skipped symlinks - --smb-case-insensitive Whether the server is configured to be case-insensitive (default true) - --smb-domain string Domain name for NTLM authentication (default "WORKGROUP") - --smb-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot) - --smb-hide-special-share Hide special shares (e.g. print$) which users aren't supposed to access (default true) - --smb-host string SMB server hostname to connect to - --smb-idle-timeout Duration Max time before closing idle connections (default 1m0s) - --smb-pass string SMB password (obscured) - --smb-port int SMB port number (default 445) - --smb-spn string Service principal name - --smb-user string SMB username (default "$USER") - --storj-access-grant string Access grant - --storj-api-key string API key - --storj-passphrase string Encryption passphrase - --storj-provider string Choose an authentication method (default "existing") - --storj-satellite-address string Satellite address (default "us1.storj.io") - --sugarsync-access-key-id string Sugarsync Access Key ID - --sugarsync-app-id string Sugarsync App ID - --sugarsync-authorization string Sugarsync authorization - --sugarsync-authorization-expiry string Sugarsync authorization expiry - --sugarsync-deleted-id string Sugarsync deleted folder id - --sugarsync-encoding MultiEncoder The encoding for the backend (default Slash,Ctl,InvalidUtf8,Dot) - --sugarsync-hard-delete Permanently delete files if true - --sugarsync-private-access-key string Sugarsync Private Access Key - --sugarsync-refresh-token string Sugarsync refresh token - --sugarsync-root-id string Sugarsync root id - --sugarsync-user string Sugarsync user - --swift-application-credential-id string Application Credential ID (OS_APPLICATION_CREDENTIAL_ID) - --swift-application-credential-name string Application Credential Name (OS_APPLICATION_CREDENTIAL_NAME) - --swift-application-credential-secret string Application Credential Secret (OS_APPLICATION_CREDENTIAL_SECRET) - --swift-auth string Authentication URL for server (OS_AUTH_URL) - --swift-auth-token string Auth Token from alternate authentication - optional (OS_AUTH_TOKEN) - --swift-auth-version int AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION) - --swift-chunk-size SizeSuffix Above this size files will be chunked into a _segments container (default 5Gi) - --swift-domain string User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME) - --swift-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8) - --swift-endpoint-type string Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE) (default "public") - --swift-env-auth Get swift credentials from environment variables in standard OpenStack form - --swift-key string API key or password (OS_PASSWORD) - --swift-leave-parts-on-error If true avoid calling abort upload on a failure - --swift-no-chunk Don't chunk files during streaming upload - --swift-no-large-objects Disable support for static and dynamic large objects - --swift-region string Region name - optional (OS_REGION_NAME) - --swift-storage-policy string The storage policy to use when creating a new container - --swift-storage-url string Storage URL - optional (OS_STORAGE_URL) - --swift-tenant string Tenant name - optional for v1 auth, this or tenant_id required otherwise (OS_TENANT_NAME or OS_PROJECT_NAME) - --swift-tenant-domain string Tenant domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME) - --swift-tenant-id string Tenant ID - optional for v1 auth, this or tenant required otherwise (OS_TENANT_ID) - --swift-user string User name to log in (OS_USERNAME) - --swift-user-id string User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) (OS_USER_ID) - --union-action-policy string Policy to choose upstream on ACTION category (default "epall") - --union-cache-time int Cache time of usage and free space (in seconds) (default 120) - --union-create-policy string Policy to choose upstream on CREATE category (default "epmfs") - --union-min-free-space SizeSuffix Minimum viable free space for lfs/eplfs policies (default 1Gi) - --union-search-policy string Policy to choose upstream on SEARCH category (default "ff") - --union-upstreams string List of space separated upstreams - --uptobox-access-token string Your access token - --uptobox-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot) - --uptobox-private Set to make uploaded files private - --webdav-bearer-token string Bearer token instead of user/pass (e.g. a Macaroon) - --webdav-bearer-token-command string Command to run to get a bearer token - --webdav-encoding string The encoding for the backend - --webdav-headers CommaSepList Set HTTP headers for all transactions - --webdav-nextcloud-chunk-size SizeSuffix Nextcloud upload chunk size (default 10Mi) - --webdav-pacer-min-sleep Duration Minimum time to sleep between API calls (default 10ms) - --webdav-pass string Password (obscured) - --webdav-url string URL of http host to connect to - --webdav-user string User name - --webdav-vendor string Name of the WebDAV site/service/software you are using - --yandex-auth-url string Auth server URL - --yandex-client-id string OAuth Client Id - --yandex-client-secret string OAuth Client Secret - --yandex-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) - --yandex-hard-delete Delete files permanently rather than putting them into the trash - --yandex-token string OAuth Access Token as a JSON blob - --yandex-token-url string Token server url - --zoho-auth-url string Auth server URL - --zoho-client-id string OAuth Client Id - --zoho-client-secret string OAuth Client Secret - --zoho-encoding MultiEncoder The encoding for the backend (default Del,Ctl,InvalidUtf8) - --zoho-region string Zoho region to connect to - --zoho-token string OAuth Access Token as a JSON blob - --zoho-token-url string Token server url +This command takes an "fs" parameter. If this parameter is not supplied +and if there is only one VFS in use then that VFS will be used. If there +is more than one VFS in use then the "fs" parameter must be supplied. -Docker Volume Plugin +vfs/list: List active VFSes. -Introduction +This lists the active VFSes. -Docker 1.9 has added support for creating named volumes via command-line -interface and mounting them in containers as a way to share data between -them. Since Docker 1.10 you can create named volumes with Docker Compose -by descriptions in docker-compose.yml files for use by container groups -on a single host. As of Docker 1.12 volumes are supported by Docker -Swarm included with Docker Engine and created from descriptions in swarm -compose v3 files for use with swarm stacks across multiple cluster -nodes. +It returns a list under the key "vfses" where the values are the VFS +names that could be passed to the other VFS commands in the "fs" +parameter. -Docker Volume Plugins augment the default local volume driver included -in Docker with stateful volumes shared across containers and hosts. -Unlike local volumes, your data will not be deleted when such volume is -removed. Plugins can run managed by the docker daemon, as a native -system service (under systemd, sysv or upstart) or as a standalone -executable. Rclone can run as docker volume plugin in all these modes. -It interacts with the local docker daemon via plugin API and handles -mounting of remote file systems into docker containers so it must run on -the same host as the docker daemon or on every Swarm node. +vfs/poll-interval: Get the status or update the value of the poll-interval option. -Getting started +Without any parameter given this returns the current status of the +poll-interval setting. -In the first example we will use the SFTP rclone volume with Docker -engine on a standalone Ubuntu machine. +When the interval=duration parameter is set, the poll-interval value is +updated and the polling function is notified. Setting interval=0 +disables poll-interval. -Start from installing Docker on the host. + rclone rc vfs/poll-interval interval=5m -The FUSE driver is a prerequisite for rclone mounting and should be -installed on host: +The timeout=duration parameter can be used to specify a time to wait for +the current poll function to apply the new value. If timeout is less or +equal 0, which is the default, wait indefinitely. - sudo apt-get -y install fuse +The new poll-interval value will only be active when the timeout is not +reached. -Create two directories required by rclone docker plugin: +If poll-interval is updated or disabled temporarily, some changes might +not get picked up by the polling function, depending on the used remote. - sudo mkdir -p /var/lib/docker-plugins/rclone/config - sudo mkdir -p /var/lib/docker-plugins/rclone/cache +This command takes an "fs" parameter. If this parameter is not supplied +and if there is only one VFS in use then that VFS will be used. If there +is more than one VFS in use then the "fs" parameter must be supplied. -Install the managed rclone docker plugin for your architecture (here -amd64): +vfs/refresh: Refresh the directory cache. - docker plugin install rclone/docker-volume-rclone:amd64 args="-v" --alias rclone --grant-all-permissions - docker plugin list +This reads the directories for the specified paths and freshens the +directory cache. -Create your SFTP volume: +If no paths are passed in then it will refresh the root directory. - docker volume create firstvolume -d rclone -o type=sftp -o sftp-host=_hostname_ -o sftp-user=_username_ -o sftp-pass=_password_ -o allow-other=true + rclone rc vfs/refresh -Note that since all options are static, you don't even have to run -rclone config or create the rclone.conf file (but the config directory -should still be present). In the simplest case you can use localhost as -hostname and your SSH credentials as username and password. You can also -change the remote path to your home directory on the host, for example --o path=/home/username. +Otherwise pass directories in as dir=path. Any parameter key starting +with dir will refresh that directory, e.g. -Time to create a test container and mount the volume into it: + rclone rc vfs/refresh dir=home/junk dir2=data/misc - docker run --rm -it -v firstvolume:/mnt --workdir /mnt ubuntu:latest bash +If the parameter recursive=true is given the whole directory tree will +get refreshed. This refresh will use --fast-list if enabled. -If all goes well, you will enter the new container and change right to -the mounted SFTP remote. You can type ls to list the mounted directory -or otherwise play with it. Type exit when you are done. The container -will stop but the volume will stay, ready to be reused. When it's not -needed anymore, remove it: +This command takes an "fs" parameter. If this parameter is not supplied +and if there is only one VFS in use then that VFS will be used. If there +is more than one VFS in use then the "fs" parameter must be supplied. - docker volume list - docker volume remove firstvolume +vfs/stats: Stats for a VFS. -Now let us try something more elaborate: Google Drive volume on -multi-node Docker Swarm. +This returns stats for the selected VFS. -You should start from installing Docker and FUSE, creating plugin -directories and installing rclone plugin on every swarm node. Then setup -the Swarm. + { + // Status of the disk cache - only present if --vfs-cache-mode > off + "diskCache": { + "bytesUsed": 0, + "erroredFiles": 0, + "files": 0, + "hashType": 1, + "outOfSpace": false, + "path": "/home/user/.cache/rclone/vfs/local/mnt/a", + "pathMeta": "/home/user/.cache/rclone/vfsMeta/local/mnt/a", + "uploadsInProgress": 0, + "uploadsQueued": 0 + }, + "fs": "/mnt/a", + "inUse": 1, + // Status of the in memory metadata cache + "metadataCache": { + "dirs": 1, + "files": 0 + }, + // Options as returned by options/get + "opt": { + "CacheMaxAge": 3600000000000, + // ... + "WriteWait": 1000000000 + } + } -Google Drive volumes need an access token which can be setup via web -browser and will be periodically renewed by rclone. The managed plugin -cannot run a browser so we will use a technique similar to the rclone -setup on a headless box. +This command takes an "fs" parameter. If this parameter is not supplied +and if there is only one VFS in use then that VFS will be used. If there +is more than one VFS in use then the "fs" parameter must be supplied. -Run rclone config on another machine equipped with web browser and -graphical user interface. Create the Google Drive remote. When done, -transfer the resulting rclone.conf to the Swarm cluster and save as -/var/lib/docker-plugins/rclone/config/rclone.conf on every node. By -default this location is accessible only to the root user so you will -need appropriate privileges. The resulting config will look like this: +Accessing the remote control via HTTP - [gdrive] - type = drive - scope = drive - drive_id = 1234567... - root_folder_id = 0Abcd... - token = {"access_token":...} +Rclone implements a simple HTTP based protocol. -Now create the file named example.yml with a swarm stack description -like this: +Each endpoint takes an JSON object and returns a JSON object or an +error. The JSON objects are essentially a map of string names to values. - version: '3' - services: - heimdall: - image: linuxserver/heimdall:latest - ports: [8080:80] - volumes: [configdata:/config] - volumes: - configdata: - driver: rclone - driver_opts: - remote: 'gdrive:heimdall' - allow_other: 'true' - vfs_cache_mode: full - poll_interval: 0 +All calls must made using POST. -and run the stack: +The input objects can be supplied using URL parameters, POST parameters +or by supplying "Content-Type: application/json" and a JSON blob in the +body. There are examples of these below using curl. - docker stack deploy example -c ./example.yml +The response will be a JSON blob in the body of the response. This is +formatted to be reasonably human-readable. -After a few seconds docker will spread the parsed stack description over -cluster, create the example_heimdall service on port 8080, run service -containers on one or more cluster nodes and request the -example_configdata volume from rclone plugins on the node hosts. You can -use the following commands to confirm results: +Error returns - docker service ls - docker service ps example_heimdall - docker volume ls +If an error occurs then there will be an HTTP error status (e.g. 500) +and the body of the response will contain a JSON encoded error object, +e.g. -Point your browser to http://cluster.host.address:8080 and play with the -service. Stop it with docker stack remove example when you are done. -Note that the example_configdata volume(s) created on demand at the -cluster nodes will not be automatically removed together with the stack -but stay for future reuse. You can remove them manually by invoking the -docker volume remove example_configdata command on every node. - -Creating Volumes via CLI - -Volumes can be created with docker volume create. Here are a few -examples: + { + "error": "Expecting string value for key \"remote\" (was float64)", + "input": { + "fs": "/tmp", + "remote": 3 + }, + "status": 400 + "path": "operations/rmdir", + } - docker volume create vol1 -d rclone -o remote=storj: -o vfs-cache-mode=full - docker volume create vol2 -d rclone -o remote=:storj,access_grant=xxx:heimdall - docker volume create vol3 -d rclone -o type=storj -o path=heimdall -o storj-access-grant=xxx -o poll-interval=0 +The keys in the error response are - error - error string - input - the +input parameters to the call - status - the HTTP status code - path - +the path of the call -Note the -d rclone flag that tells docker to request volume from the -rclone driver. This works even if you installed managed driver by its -full name rclone/docker-volume-rclone because you provided the ---alias rclone option. +CORS -Volumes can be inspected as follows: +The sever implements basic CORS support and allows all origins for that. +The response to a preflight OPTIONS request will echo the requested +"Access-Control-Request-Headers" back. - docker volume list - docker volume inspect vol1 +Using POST with URL parameters only -Volume Configuration + curl -X POST 'http://localhost:5572/rc/noop?potato=1&sausage=2' -Rclone flags and volume options are set via the -o flag to the -docker volume create command. They include backend-specific parameters -as well as mount and VFS options. Also there are a few special -o -options: remote, fs, type, path, mount-type and persist. +Response -remote determines an existing remote name from the config file, with -trailing colon and optionally with a remote path. See the full syntax in -the rclone documentation. This option can be aliased as fs to prevent -confusion with the remote parameter of such backends as crypt or alias. + { + "potato": "1", + "sausage": "2" + } -The remote=:backend:dir/subdir syntax can be used to create on-the-fly -(config-less) remotes, while the type and path options provide a simpler -alternative for this. Using two split options +Here is what an error response looks like: - -o type=backend -o path=dir/subdir + curl -X POST 'http://localhost:5572/rc/error?potato=1&sausage=2' -is equivalent to the combined syntax + { + "error": "arbitrary error on input map[potato:1 sausage:2]", + "input": { + "potato": "1", + "sausage": "2" + } + } - -o remote=:backend:dir/subdir +Note that curl doesn't return errors to the shell unless you use the -f +option -but is arguably easier to parameterize in scripts. The path part is -optional. + $ curl -f -X POST 'http://localhost:5572/rc/error?potato=1&sausage=2' + curl: (22) The requested URL returned error: 400 Bad Request + $ echo $? + 22 -Mount and VFS options as well as backend parameters are named like their -twin command-line flags without the -- CLI prefix. Optionally you can -use underscores instead of dashes in option names. For example, ---vfs-cache-mode full becomes -o vfs-cache-mode=full or --o vfs_cache_mode=full. Boolean CLI flags without value will gain the -true value, e.g. --allow-other becomes -o allow-other=true or --o allow_other=true. +Using POST with a form -Please note that you can provide parameters only for the backend -immediately referenced by the backend type of mounted remote. If this is -a wrapping backend like alias, chunker or crypt, you cannot provide -options for the referred to remote or backend. This limitation is -imposed by the rclone connection string parser. The only workaround is -to feed plugin with rclone.conf or configure plugin arguments (see -below). + curl --data "potato=1" --data "sausage=2" http://localhost:5572/rc/noop -Special Volume Options +Response -mount-type determines the mount method and in general can be one of: -mount, cmount, or mount2. This can be aliased as mount_type. It should -be noted that the managed rclone docker plugin currently does not -support the cmount method and mount2 is rarely needed. This option -defaults to the first found method, which is usually mount so you -generally won't need it. + { + "potato": "1", + "sausage": "2" + } -persist is a reserved boolean (true/false) option. In future it will -allow to persist on-the-fly remotes in the plugin rclone.conf file. +Note that you can combine these with URL parameters too with the POST +parameters taking precedence. -Connection Strings + curl --data "potato=1" --data "sausage=2" "http://localhost:5572/rc/noop?rutabaga=3&sausage=4" -The remote value can be extended with connection strings as an -alternative way to supply backend parameters. This is equivalent to the --o backend options with one syntactic difference. Inside connection -string the backend prefix must be dropped from parameter names but in -the -o param=value array it must be present. For instance, compare the -following option array +Response - -o remote=:sftp:/home -o sftp-host=localhost + { + "potato": "1", + "rutabaga": "3", + "sausage": "4" + } -with equivalent connection string: +Using POST with a JSON blob - -o remote=:sftp,host=localhost:/home + curl -H "Content-Type: application/json" -X POST -d '{"potato":2,"sausage":1}' http://localhost:5572/rc/noop -This difference exists because flag options -o key=val include not only -backend parameters but also mount/VFS flags and possibly other settings. -Also it allows to discriminate the remote option from the crypt-remote -(or similarly named backend parameters) and arguably simplifies -scripting due to clearer value substitution. +response -Using with Swarm or Compose + { + "password": "xyz", + "username": "xyz" + } -Both Docker Swarm and Docker Compose use YAML-formatted text files to -describe groups (stacks) of containers, their properties, networks and -volumes. Compose uses the compose v2 format, Swarm uses the compose v3 -format. They are mostly similar, differences are explained in the docker -documentation. +This can be combined with URL parameters too if required. The JSON blob +takes precedence. -Volumes are described by the children of the top-level volumes: node. -Each of them should be named after its volume and have at least two -elements, the self-explanatory driver: rclone value and the driver_opts: -structure playing the same role as -o key=val CLI flags: + curl -H "Content-Type: application/json" -X POST -d '{"potato":2,"sausage":1}' 'http://localhost:5572/rc/noop?rutabaga=3&potato=4' - volumes: - volume_name_1: - driver: rclone - driver_opts: - remote: 'gdrive:' - allow_other: 'true' - vfs_cache_mode: full - token: '{"type": "borrower", "expires": "2021-12-31"}' - poll_interval: 0 + { + "potato": 2, + "rutabaga": "3", + "sausage": 1 + } -Notice a few important details: - YAML prefers _ in option names instead -of -. - YAML treats single and double quotes interchangeably. Simple -strings and integers can be left unquoted. - Boolean values must be -quoted like 'true' or "false" because these two words are reserved by -YAML. - The filesystem string is keyed with remote (or with fs). -Normally you can omit quotes here, but if the string ends with colon, -you must quote it like remote: "storage_box:". - YAML is picky about -surrounding braces in values as this is in fact another syntax for -key/value mappings. For example, JSON access tokens usually contain -double quotes and surrounding braces, so you must put them in single -quotes. +Debugging rclone with pprof -Installing as Managed Plugin +If you use the --rc flag this will also enable the use of the go +profiling tools on the same port. -Docker daemon can install plugins from an image registry and run them -managed. We maintain the docker-volume-rclone plugin image on Docker -Hub. +To use these, first install go. -Rclone volume plugin requires Docker Engine >= 19.03.15 +Debugging memory use -The plugin requires presence of two directories on the host before it -can be installed. Note that plugin will not create them automatically. -By default they must exist on host at the following locations (though -you can tweak the paths): - /var/lib/docker-plugins/rclone/config is -reserved for the rclone.conf config file and must exist even if it's -empty and the config file is not present. - -/var/lib/docker-plugins/rclone/cache holds the plugin state file as well -as optional VFS caches. +To profile rclone's memory use you can run: -You can install managed plugin with default settings as follows: + go tool pprof -web http://localhost:5572/debug/pprof/heap - docker plugin install rclone/docker-volume-rclone:amd64 --grant-all-permissions --alias rclone +This should open a page in your browser showing what is using what +memory. -The :amd64 part of the image specification after colon is called a tag. -Usually you will want to install the latest plugin for your -architecture. In this case the tag will just name it, like amd64 above. -The following plugin architectures are currently available: - amd64 - -arm64 - arm-v7 +You can also use the -text flag to produce a textual summary -Sometimes you might want a concrete plugin version, not the latest one. -Then you should use image tag in the form :ARCHITECTURE-VERSION. For -example, to install plugin version v1.56.2 on architecture arm64 you -will use tag arm64-1.56.2 (note the removed v) so the full image -specification becomes rclone/docker-volume-rclone:arm64-1.56.2. + $ go tool pprof -text http://localhost:5572/debug/pprof/heap + Showing nodes accounting for 1537.03kB, 100% of 1537.03kB total + flat flat% sum% cum cum% + 1024.03kB 66.62% 66.62% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.addDecoderNode + 513kB 33.38% 100% 513kB 33.38% net/http.newBufioWriterSize + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/all.init + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/serve.init + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/serve/restic.init + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2.init + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.init + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.init.0 + 0 0% 100% 1024.03kB 66.62% main.init + 0 0% 100% 513kB 33.38% net/http.(*conn).readRequest + 0 0% 100% 513kB 33.38% net/http.(*conn).serve + 0 0% 100% 1024.03kB 66.62% runtime.main -We also provide the latest plugin tag, but since docker does not support -multi-architecture plugins as of the time of this writing, this tag is -currently an alias for amd64. By convention the latest tag is the -default one and can be omitted, thus both -rclone/docker-volume-rclone:latest and just rclone/docker-volume-rclone -will refer to the latest plugin release for the amd64 platform. +Debugging go routine leaks -Also the amd64 part can be omitted from the versioned rclone plugin -tags. For example, rclone image reference -rclone/docker-volume-rclone:amd64-1.56.2 can be abbreviated as -rclone/docker-volume-rclone:1.56.2 for convenience. However, for -non-intel architectures you still have to use the full tag as amd64 or -latest will fail to start. +Memory leaks are most often caused by go routine leaks keeping memory +alive which should have been garbage collected. -Managed plugin is in fact a special container running in a namespace -separate from normal docker containers. Inside it runs the -rclone serve docker command. The config and cache directories are -bind-mounted into the container at start. The docker daemon connects to -a unix socket created by the command inside the container. The command -creates on-demand remote mounts right inside, then docker machinery -propagates them through kernel mount namespaces and bind-mounts into -requesting user containers. +See all active go routines using -You can tweak a few plugin settings after installation when it's -disabled (not in use), for instance: + curl http://localhost:5572/debug/pprof/goroutine?debug=1 - docker plugin disable rclone - docker plugin set rclone RCLONE_VERBOSE=2 config=/etc/rclone args="--vfs-cache-mode=writes --allow-other" - docker plugin enable rclone - docker plugin inspect rclone +Or go to http://localhost:5572/debug/pprof/goroutine?debug=1 in your +browser. -Note that if docker refuses to disable the plugin, you should find and -remove all active volumes connected with it as well as containers and -swarm services that use them. This is rather tedious so please carefully -plan in advance. +Other profiles to look at -You can tweak the following settings: args, config, cache, HTTP_PROXY, -HTTPS_PROXY, NO_PROXY and RCLONE_VERBOSE. It's your task to keep plugin -settings in sync across swarm cluster nodes. +You can see a summary of profiles available at +http://localhost:5572/debug/pprof/ -args sets command-line arguments for the rclone serve docker command -(none by default). Arguments should be separated by space so you will -normally want to put them in quotes on the docker plugin set command -line. Both serve docker flags and generic rclone flags are supported, -including backend parameters that will be used as defaults for volume -creation. Note that plugin will fail (due to this docker bug) if the -args value is empty. Use e.g. args="-v" as a workaround. +Here is how to use some of them: -config=/host/dir sets alternative host location for the config -directory. Plugin will look for rclone.conf here. It's not an error if -the config file is not present but the directory must exist. Please note -that plugin can periodically rewrite the config file, for example when -it renews storage access tokens. Keep this in mind and try to avoid -races between the plugin and other instances of rclone on the host that -might try to change the config simultaneously resulting in corrupted -rclone.conf. You can also put stuff like private key files for SFTP -remotes in this directory. Just note that it's bind-mounted inside the -plugin container at the predefined path /data/config. For example, if -your key file is named sftp-box1.key on the host, the corresponding -volume config option should read --o sftp-key-file=/data/config/sftp-box1.key. +- Memory: go tool pprof http://localhost:5572/debug/pprof/heap +- Go routines: + curl http://localhost:5572/debug/pprof/goroutine?debug=1 +- 30-second CPU profile: + go tool pprof http://localhost:5572/debug/pprof/profile +- 5-second execution trace: + wget http://localhost:5572/debug/pprof/trace?seconds=5 +- Goroutine blocking profile + - Enable first with: rclone rc debug/set-block-profile-rate rate=1 + (docs) + - go tool pprof http://localhost:5572/debug/pprof/block +- Contended mutexes: + - Enable first with: + rclone rc debug/set-mutex-profile-fraction rate=1 (docs) + - go tool pprof http://localhost:5572/debug/pprof/mutex -cache=/host/dir sets alternative host location for the cache directory. -The plugin will keep VFS caches here. Also it will create and maintain -the docker-plugin.state file in this directory. When the plugin is -restarted or reinstalled, it will look in this file to recreate any -volumes that existed previously. However, they will not be re-mounted -into consuming containers after restart. Usually this is not a problem -as the docker daemon normally will restart affected user containers -after failures, daemon restarts or host reboots. +See the net/http/pprof docs for more info on how to use the profiling +and for a general overview see the Go team's blog post on profiling go +programs. -RCLONE_VERBOSE sets plugin verbosity from 0 (errors only, by default) to -2 (debugging). Verbosity can be also tweaked via args="-v [-v] ...". -Since arguments are more generic, you will rarely need this setting. The -plugin output by default feeds the docker daemon log on local host. Log -entries are reflected as errors in the docker log but retain their -actual level assigned by rclone in the encapsulated message string. +The profiling hook is zero overhead unless it is used. -HTTP_PROXY, HTTPS_PROXY, NO_PROXY customize the plugin proxy settings. +Overview of cloud storage systems -You can set custom plugin options right when you install it, in one go: +Each cloud storage system is slightly different. Rclone attempts to +provide a unified interface to them, but some underlying differences +show through. - docker plugin remove rclone - docker plugin install rclone/docker-volume-rclone:amd64 \ - --alias rclone --grant-all-permissions \ - args="-v --allow-other" config=/etc/rclone - docker plugin inspect rclone +Features -Healthchecks +Here is an overview of the major features of each cloud storage system. -The docker plugin volume protocol doesn't provide a way for plugins to -inform the docker daemon that a volume is (un-)available. As a -workaround you can setup a healthcheck to verify that the mount is -responding, for example: + Name Hash ModTime Case Insensitive Duplicate Files MIME Type Metadata + ------------------------------- ------------------- --------- ------------------ ----------------- ----------- ---------- + 1Fichier Whirlpool - No Yes R - + Akamai Netstorage MD5, SHA256 R/W No No R - + Amazon Drive MD5 - Yes No R - + Amazon S3 (or S3 compatible) MD5 R/W No No R/W RWU + Backblaze B2 SHA1 R/W No No R/W - + Box SHA1 R/W Yes No - - + Citrix ShareFile MD5 R/W Yes No - - + Dropbox DBHASH ¹ R Yes No - - + Enterprise File Fabric - R/W Yes No R/W - + FTP - R/W ¹⁰ No No - - + Google Cloud Storage MD5 R/W No No R/W - + Google Drive MD5, SHA1, SHA256 R/W No Yes R/W - + Google Photos - - No Yes R - + HDFS - R/W No No - - + HiDrive HiDrive ¹² R/W No No - - + HTTP - R No No R - + Internet Archive MD5, SHA1, CRC32 R/W ¹¹ No No - RWU + Jottacloud MD5 R/W Yes No R RW + Koofr MD5 - Yes No - - + Linkbox - R No No - - + Mail.ru Cloud Mailru ⁶ R/W Yes No - - + Mega - - No Yes - - + Memory MD5 R/W No No - - + Microsoft Azure Blob Storage MD5 R/W No No R/W - + Microsoft Azure Files Storage MD5 R/W Yes No R/W - + Microsoft OneDrive QuickXorHash ⁵ R/W Yes No R - + OpenDrive MD5 R/W Yes Partial ⁸ - - + OpenStack Swift MD5 R/W No No R/W - + Oracle Object Storage MD5 R/W No No R/W - + pCloud MD5, SHA1 ⁷ R No No W - + PikPak MD5 R No No R - + premiumize.me - - Yes No R - + put.io CRC-32 R/W No Yes R - + Proton Drive SHA1 R/W No No R - + QingStor MD5 - ⁹ No No R/W - + Quatrix by Maytech - R/W No No - - + Seafile - - No No - - + SFTP MD5, SHA1 ² R/W Depends No - - + Sia - - No No - - + SMB - R/W Yes No - - + SugarSync - - No No - - + Storj - R No No - - + Uptobox - - No Yes - - + WebDAV MD5, SHA1 ³ R ⁴ Depends No - - + Yandex Disk MD5 R/W No No R - + Zoho WorkDrive - - No No - - + The local filesystem All R/W Depends No - RWU - services: - my_service: - image: my_image - healthcheck: - test: ls /path/to/rclone/mount || exit 1 - interval: 1m - timeout: 15s - retries: 3 - start_period: 15s +¹ Dropbox supports its own custom hash. This is an SHA256 sum of all the +4 MiB block SHA256s. -Running Plugin under Systemd +² SFTP supports checksums if the same login has shell access and md5sum +or sha1sum as well as echo are in the remote's PATH. -In most cases you should prefer managed mode. Moreover, MacOS and -Windows do not support native Docker plugins. Please use managed mode on -these systems. Proceed further only if you are on Linux. +³ WebDAV supports hashes when used with Fastmail Files, Owncloud and +Nextcloud only. -First, install rclone. You can just run it (type rclone serve docker and -hit enter) for the test. +⁴ WebDAV supports modtimes when used with Fastmail Files, Owncloud and +Nextcloud only. -Install FUSE: +⁵ QuickXorHash is Microsoft's own hash. - sudo apt-get -y install fuse +⁶ Mail.ru uses its own modified SHA1 hash -Download two systemd configuration files: docker-volume-rclone.service -and docker-volume-rclone.socket. +⁷ pCloud only supports SHA1 (not MD5) in its EU region -Put them to the /etc/systemd/system/ directory: +⁸ Opendrive does not support creation of duplicate files using their web +client interface or other stock clients, but the underlying storage +platform has been determined to allow duplicate files, and it is +possible to create them with rclone. It may be that this is a mistake or +an unsupported feature. - cp docker-volume-plugin.service /etc/systemd/system/ - cp docker-volume-plugin.socket /etc/systemd/system/ +⁹ QingStor does not support SetModTime for objects bigger than 5 GiB. -Please note that all commands in this section must be run as root but we -omit sudo prefix for brevity. Now create directories required by the -service: +¹⁰ FTP supports modtimes for the major FTP servers, and also others if +they advertised required protocol extensions. See this for more details. - mkdir -p /var/lib/docker-volumes/rclone - mkdir -p /var/lib/docker-plugins/rclone/config - mkdir -p /var/lib/docker-plugins/rclone/cache +¹¹ Internet Archive requires option wait_archive to be set to a non-zero +value for full modtime support. -Run the docker plugin service in the socket activated mode: +¹² HiDrive supports its own custom hash. It combines SHA1 sums for each +4 KiB block hierarchically to a single top-level sum. - systemctl daemon-reload - systemctl start docker-volume-rclone.service - systemctl enable docker-volume-rclone.socket - systemctl start docker-volume-rclone.socket - systemctl restart docker +Hash -Or run the service directly: - run systemctl daemon-reload to let -systemd pick up new config - run -systemctl enable docker-volume-rclone.service to make the new service -start automatically when you power on your machine. - run -systemctl start docker-volume-rclone.service to start the service now. - -run systemctl restart docker to restart docker daemon and let it detect -the new plugin socket. Note that this step is not needed in managed mode -where docker knows about plugin state changes. +The cloud storage system supports various hash types of the objects. The +hashes are used when transferring data as an integrity check and can be +specifically used with the --checksum flag in syncs and in the check +command. -The two methods are equivalent from the user perspective, but I -personally prefer socket activation. +To use the verify checksums when transferring between cloud storage +systems they must support a common hash type. -Troubleshooting +ModTime -You can see managed plugin settings with +Almost all cloud storage systems store some sort of timestamp on +objects, but several of them not something that is appropriate to use +for syncing. E.g. some backends will only write a timestamp that +represent the time of the upload. To be relevant for syncing it should +be able to store the modification time of the source object. If this is +not the case, rclone will only check the file size by default, though +can be configured to check the file hash (with the --checksum flag). +Ideally it should also be possible to change the timestamp of an +existing file without having to re-upload it. - docker plugin list - docker plugin inspect rclone +Storage systems with a - in the ModTime column, means the modification +read on objects is not the modification time of the file when uploaded. +It is most likely the time the file was uploaded, or possibly something +else (like the time the picture was taken in Google Photos). -Note that docker (including latest 20.10.7) will not show actual values -of args, just the defaults. +Storage systems with a R (for read-only) in the ModTime column, means +the it keeps modification times on objects, and updates them when +uploading objects, but it does not support changing only the +modification time (SetModTime operation) without re-uploading, possibly +not even without deleting existing first. Some operations in rclone, +such as copy and sync commands, will automatically check for SetModTime +support and re-upload if necessary to keep the modification times in +sync. Other commands will not work without SetModTime support, e.g. +touch command on an existing file will fail, and changes to modification +time only on a files in a mount will be silently ignored. -Use journalctl --unit docker to see managed plugin output as part of the -docker daemon log. Note that docker reflects plugin lines as errors but -their actual level can be seen from encapsulated message string. +Storage systems with R/W (for read/write) in the ModTime column, means +they do also support modtime-only operations. -You will usually install the latest version of managed plugin for your -platform. Use the following commands to print the actual installed -version: +Case Insensitive - PLUGID=$(docker plugin list --no-trunc | awk '/rclone/{print$1}') - sudo runc --root /run/docker/runtime-runc/plugins.moby exec $PLUGID rclone version +If a cloud storage systems is case sensitive then it is possible to have +two files which differ only in case, e.g. file.txt and FILE.txt. If a +cloud storage system is case insensitive then that isn't possible. -You can even use runc to run shell inside the plugin container: +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. - sudo runc --root /run/docker/runtime-runc/plugins.moby exec --tty $PLUGID bash +The local filesystem and SFTP may or may not be case sensitive depending +on OS. -Also you can use curl to check the plugin socket connectivity: +- Windows - usually case insensitive, though case is preserved +- OSX - usually case insensitive, though it is possible to format case + sensitive +- Linux - usually case sensitive, but there are case insensitive file + systems (e.g. FAT formatted USB keys) - docker plugin list --no-trunc - PLUGID=123abc... - sudo curl -H Content-Type:application/json -XPOST -d {} --unix-socket /run/docker/plugins/$PLUGID/rclone.sock http://localhost/Plugin.Activate +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. -though this is rarely needed. +Duplicate files -Caveats +If a cloud storage system allows duplicate files then it can have two +objects with the same name. -Finally I'd like to mention a caveat with updating volume settings. -Docker CLI does not have a dedicated command like docker volume update. -It may be tempting to invoke docker volume create with updated options -on existing volume, but there is a gotcha. The command will do nothing, -it won't even return an error. I hope that docker maintainers will fix -this some day. In the meantime be aware that you must remove your volume -before recreating it with new settings: +This confuses rclone greatly when syncing - use the rclone dedupe +command to rename or remove duplicates. - docker volume remove my_vol - docker volume create my_vol -d rclone -o opt1=new_val1 ... +Restricted filenames -and verify that settings did update: +Some cloud storage systems might have restrictions on the characters +that are usable in file or directory names. When rclone detects such a +name during a file upload, it will transparently replace the restricted +characters with similar looking Unicode characters. To handle the +different sets of restricted characters for different backends, rclone +uses something it calls encoding. - docker volume list - docker volume inspect my_vol +This process is designed to avoid ambiguous file names as much as +possible and allow to move files between many cloud storage systems +transparently. -If docker refuses to remove the volume, you should find containers or -swarm services that use it and stop them first. +The name shown by rclone to the user or during log output will only +contain a minimal set of replaced characters to ensure correct +formatting and not necessarily the actual name used on the cloud +storage. -Getting started +This transformation is reversed when downloading a file or parsing +rclone arguments. For example, when uploading a file named my file?.txt +to Onedrive, it will be displayed as my file?.txt on the console, but +stored as my file?.txt to Onedrive (the ? gets replaced by the similar +looking ? character, the so-called "fullwidth question mark"). The +reverse transformation allows to read a file unusual/name.txt from +Google Drive, by passing the name unusual/name.txt on the command line +(the / needs to be replaced by the similar looking / character). -- Install rclone and setup your remotes. -- Bisync will create its working directory at ~/.cache/rclone/bisync - on Linux or C:\Users\MyLogin\AppData\Local\rclone\bisync on Windows. - Make sure that this location is writable. -- Run bisync with the --resync flag, specifying the paths to the local - and remote sync directory roots. -- For successive sync runs, leave off the --resync flag. -- Consider using a filters file for excluding unnecessary files and - directories from the sync. -- Consider setting up the --check-access feature for safety. -- On Linux, consider setting up a crontab entry. bisync can safely run - in concurrent cron jobs thanks to lock files it maintains. +Caveats -Here is a typical run log (with timestamps removed for clarity): +The filename encoding system works well in most cases, at least where +file names are written in English or similar languages. You might not +even notice it: It just works. In some cases it may lead to issues, +though. E.g. when file names are written in Chinese, or Japanese, where +it is always the Unicode fullwidth variants of the punctuation marks +that are used. - rclone bisync /testdir/path1/ /testdir/path2/ --verbose - INFO : Synching Path1 "/testdir/path1/" with Path2 "/testdir/path2/" - INFO : Path1 checking for diffs - INFO : - Path1 File is new - file11.txt - INFO : - Path1 File is newer - file2.txt - INFO : - Path1 File is newer - file5.txt - INFO : - Path1 File is newer - file7.txt - INFO : - Path1 File was deleted - file4.txt - INFO : - Path1 File was deleted - file6.txt - INFO : - Path1 File was deleted - file8.txt - INFO : Path1: 7 changes: 1 new, 3 newer, 0 older, 3 deleted - INFO : Path2 checking for diffs - INFO : - Path2 File is new - file10.txt - INFO : - Path2 File is newer - file1.txt - INFO : - Path2 File is newer - file5.txt - INFO : - Path2 File is newer - file6.txt - INFO : - Path2 File was deleted - file3.txt - INFO : - Path2 File was deleted - file7.txt - INFO : - Path2 File was deleted - file8.txt - INFO : Path2: 7 changes: 1 new, 3 newer, 0 older, 3 deleted - INFO : Applying changes - INFO : - Path1 Queue copy to Path2 - /testdir/path2/file11.txt - INFO : - Path1 Queue copy to Path2 - /testdir/path2/file2.txt - INFO : - Path2 Queue delete - /testdir/path2/file4.txt - NOTICE: - WARNING New or changed in both paths - file5.txt - NOTICE: - Path1 Renaming Path1 copy - /testdir/path1/file5.txt..path1 - NOTICE: - Path1 Queue copy to Path2 - /testdir/path2/file5.txt..path1 - NOTICE: - Path2 Renaming Path2 copy - /testdir/path2/file5.txt..path2 - NOTICE: - Path2 Queue copy to Path1 - /testdir/path1/file5.txt..path2 - INFO : - Path2 Queue copy to Path1 - /testdir/path1/file6.txt - INFO : - Path1 Queue copy to Path2 - /testdir/path2/file7.txt - INFO : - Path2 Queue copy to Path1 - /testdir/path1/file1.txt - INFO : - Path2 Queue copy to Path1 - /testdir/path1/file10.txt - INFO : - Path1 Queue delete - /testdir/path1/file3.txt - INFO : - Path2 Do queued copies to - Path1 - INFO : - Path1 Do queued copies to - Path2 - INFO : - Do queued deletes on - Path1 - INFO : - Do queued deletes on - Path2 - INFO : Updating listings - INFO : Validating listings for Path1 "/testdir/path1/" vs Path2 "/testdir/path2/" - INFO : Bisync successful +On Windows, the characters :, * and ? are examples of restricted +characters. If these are used in filenames on a remote that supports it, +Rclone will transparently convert them to their fullwidth Unicode +variants *, ? and : when downloading to Windows, and back again when +uploading. This way files with names that are not allowed on Windows can +still be stored. -Command line syntax +However, if you have files on your Windows system originally with these +same Unicode characters in their names, they will be included in the +same conversion process. E.g. if you create a file in your Windows +filesystem with name Test:1.jpg, where : is the Unicode fullwidth +colon symbol, and use rclone to upload it to Google Drive, which +supports regular : (halfwidth question mark), rclone will replace the +fullwidth : with the halfwidth : and store the file as Test:1.jpg in +Google Drive. Since both Windows and Google Drive allows the name +Test:1.jpg, it would probably be better if rclone just kept the name as +is in this case. - $ rclone bisync --help - Usage: - rclone bisync remote1:path1 remote2:path2 [flags] +With the opposite situation; if you have a file named Test:1.jpg, in +your Google Drive, e.g. uploaded from a Linux system where : is valid in +file names. Then later use rclone to copy this file to your Windows +computer you will notice that on your local disk it gets renamed to +Test:1.jpg. The original filename is not legal on Windows, due to the +:, and rclone therefore renames it to make the copy possible. That is +all good. However, this can also lead to an issue: If you already had a +different file named Test:1.jpg on Windows, and then use rclone to copy +either way. Rclone will then treat the file originally named Test:1.jpg +on Google Drive and the file originally named Test:1.jpg on Windows as +the same file, and replace the contents from one with the other. - Positional arguments: - Path1, Path2 Local path, or remote storage with ':' plus optional path. - Type 'rclone listremotes' for list of configured remotes. +Its virtually impossible to handle all cases like these correctly in all +situations, but by customizing the encoding option, changing the set of +characters that rclone should convert, you should be able to create a +configuration that works well for your specific situation. See also the +example below. - Optional Flags: - --check-access Ensure expected `RCLONE_TEST` files are found on - both Path1 and Path2 filesystems, else abort. - --check-filename FILENAME Filename for `--check-access` (default: `RCLONE_TEST`) - --check-sync CHOICE Controls comparison of final listings: - `true | false | only` (default: true) - If set to `only`, bisync will only compare listings - from the last run but skip actual sync. - --filters-file PATH Read filtering patterns from a file - --max-delete PERCENT Safety check on maximum percentage of deleted files allowed. - If exceeded, the bisync run will abort. (default: 50%) - --force Bypass `--max-delete` safety check and run the sync. - Consider using with `--verbose` - --create-empty-src-dirs Sync creation and deletion of empty directories. - (Not compatible with --remove-empty-dirs) - --remove-empty-dirs Remove empty directories at the final cleanup step. - -1, --resync Performs the resync run. - Warning: Path1 files may overwrite Path2 versions. - Consider using `--verbose` or `--dry-run` first. - --ignore-listing-checksum Do not use checksums for listings - (add --ignore-checksum to additionally skip post-copy checksum checks) - --resilient Allow future runs to retry after certain less-serious errors, - instead of requiring --resync. Use at your own risk! - --localtime Use local time in listings (default: UTC) - --no-cleanup Retain working files (useful for troubleshooting and testing). - --workdir PATH Use custom working directory (useful for testing). - (default: `~/.cache/rclone/bisync`) - -n, --dry-run Go through the motions - No files are copied/deleted. - -v, --verbose Increases logging verbosity. - May be specified more than once for more details. - -h, --help help for bisync +(Windows was used as an example of a file system with many restricted +characters, and Google drive a storage system with few.) -Arbitrary rclone flags may be specified on the bisync command line, for -example -rclone bisync ./testdir/path1/ gdrive:testdir/path2/ --drive-skip-gdocs -v -v --timeout 10s -Note that interactions of various rclone flags with bisync process flow -has not been fully tested yet. +Default restricted characters -Paths +The table below shows the characters that are replaced by default. -Path1 and Path2 arguments may be references to any mix of local -directory paths (absolute or relative), UNC paths (//server/share/path), -Windows drive paths (with a drive letter and :) or configured remotes -with optional subdirectory paths. Cloud references are distinguished by -having a : in the argument (see Windows support below). +When a replacement character is found in a filename, this character will +be escaped with the ‛ character to avoid ambiguous file names. (e.g. a +file named ␀.txt would shown as ‛␀.txt) -Path1 and Path2 are treated equally, in that neither has priority for -file changes (except during --resync), and access efficiency does not -change whether a remote is on Path1 or Path2. +Each cloud storage backend can use a different set of characters, which +will be specified in the documentation for each backend. -The listings in bisync working directory (default: -~/.cache/rclone/bisync) are named based on the Path1 and Path2 arguments -so that separate syncs to individual directories within the tree may be -set up, e.g.: path_to_local_tree..dropbox_subdir.lst. + Character Value Replacement + ----------- ------- ------------- + NUL 0x00 ␀ + SOH 0x01 ␁ + STX 0x02 ␂ + ETX 0x03 ␃ + EOT 0x04 ␄ + ENQ 0x05 ␅ + ACK 0x06 ␆ + BEL 0x07 ␇ + BS 0x08 ␈ + HT 0x09 ␉ + LF 0x0A ␊ + VT 0x0B ␋ + FF 0x0C ␌ + CR 0x0D ␍ + SO 0x0E ␎ + SI 0x0F ␏ + DLE 0x10 ␐ + DC1 0x11 ␑ + DC2 0x12 ␒ + DC3 0x13 ␓ + DC4 0x14 ␔ + NAK 0x15 ␕ + SYN 0x16 ␖ + ETB 0x17 ␗ + CAN 0x18 ␘ + EM 0x19 ␙ + SUB 0x1A ␚ + ESC 0x1B ␛ + FS 0x1C ␜ + GS 0x1D ␝ + RS 0x1E ␞ + US 0x1F ␟ + / 0x2F / + DEL 0x7F ␡ -Any empty directories after the sync on both the Path1 and Path2 -filesystems are not deleted by default, unless --create-empty-src-dirs -is specified. If the --remove-empty-dirs flag is specified, then both -paths will have ALL empty directories purged as the last step in the -process. +The default encoding will also encode these file names as they are +problematic with many cloud storage systems. -Command-line flags + File name Replacement + ----------- ------------- + . . + .. .. ---resync +Invalid UTF-8 bytes -This will effectively make both Path1 and Path2 filesystems contain a -matching superset of all files. Path2 files that do not exist in Path1 -will be copied to Path1, and the process will then copy the Path1 tree -to Path2. +Some backends only support a sequence of well formed UTF-8 bytes as file +or directory names. -The --resync sequence is roughly equivalent to: +In this case all invalid UTF-8 bytes will be replaced with a quoted +representation of the byte value to allow uploading a file to such a +backend. For example, the invalid byte 0xFE will be encoded as ‛FE. - rclone copy Path2 Path1 --ignore-existing - rclone copy Path1 Path2 +A common source of invalid UTF-8 bytes are local filesystems, that store +names in a different encoding than UTF-8 or UTF-16, like latin1. See the +local filenames section for details. -Or, if using --create-empty-src-dirs: +Encoding option - rclone copy Path2 Path1 --ignore-existing - rclone copy Path1 Path2 --create-empty-src-dirs - rclone copy Path2 Path1 --create-empty-src-dirs +Most backends have an encoding option, specified as a flag +--backend-encoding where backend is the name of the backend, or as a +config parameter encoding (you'll need to select the Advanced config in +rclone config to see it). -The base directories on both Path1 and Path2 filesystems must exist or -bisync will fail. This is required for safety - that bisync can verify -that both paths are valid. +This will have default value which encodes and decodes characters in +such a way as to preserve the maximum number of characters (see above). -When using --resync, a newer version of a file on the Path2 filesystem -will be overwritten by the Path1 filesystem version. (Note that this is -NOT entirely symmetrical.) Carefully evaluate deltas using --dry-run. +However this can be incorrect in some scenarios, for example if you have +a Windows file system with Unicode fullwidth characters *, ? or :, +that you want to remain as those characters on the remote rather than +being translated to regular (halfwidth) *, ? and :. -For a resync run, one of the paths may be empty (no files in the path -tree). The resync run should result in files on both paths, else a -normal non-resync run will fail. +The --backend-encoding flags allow you to change that. You can disable +the encoding completely with --backend-encoding None or set +encoding = None in the config file. -For a non-resync run, either path being empty (no files in the tree) -fails with -Empty current PathN listing. Cannot sync to an empty directory: X.pathN.lst -This is a safety check that an unexpected empty path does not result in -deleting everything in the other path. +Encoding takes a comma separated list of encodings. You can see the list +of all possible values by passing an invalid value to this flag, e.g. +--local-encoding "help". The command rclone help flags encoding will +show you the defaults for the backends. ---check-access + ---------------------------------------------------------------------------------- + Encoding Characters Encoded as + ---------------------- ------------------------ ---------------------------------- + Asterisk * * -Access check files are an additional safety measure against data loss. -bisync will ensure it can find matching RCLONE_TEST files in the same -places in the Path1 and Path2 filesystems. RCLONE_TEST files are not -generated automatically. For --check-access to succeed, you must first -either: A) Place one or more RCLONE_TEST files in both systems, or B) -Set --check-filename to a filename already in use in various locations -throughout your sync'd fileset. Recommended methods for A) include: * -rclone touch Path1/RCLONE_TEST (create a new file) * -rclone copyto Path1/RCLONE_TEST Path2/RCLONE_TEST (copy an existing -file) * -rclone copy Path1/RCLONE_TEST Path2/RCLONE_TEST --include "RCLONE_TEST" -(copy multiple files at once, recursively) * create the files manually -(outside of rclone) * run bisync once without --check-access to set -matching files on both filesystems will also work, but is not preferred, -due to potential for user error (you are temporarily disabling the -safety feature). + BackQuote ` ` -Note that --check-access is still enforced on --resync, so -bisync --resync --check-access will not work as a method of initially -setting the files (this is to ensure that bisync can't inadvertently -circumvent its own safety switch.) + BackSlash \ \ -Time stamps and file contents for RCLONE_TEST files are not important, -just the names and locations. If you have symbolic links in your sync -tree it is recommended to place RCLONE_TEST files in the linked-to -directory tree to protect against bisync assuming a bunch of deleted -files if the linked-to tree should not be accessible. See also the ---check-filename flag. + Colon : : ---check-filename + CrLf CR 0x0D, LF 0x0A ␍, ␊ -Name of the file(s) used in access health validation. The default ---check-filename is RCLONE_TEST. One or more files having this filename -must exist, synchronized between your source and destination filesets, -in order for --check-access to succeed. See --check-access for -additional details. + Ctl All control characters ␀␁␂␃␄␅␆␇␈␉␊␋␌␍␎␏␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟ + 0x00-0x1F ---max-delete + Del DEL 0x7F ␡ -As a safety check, if greater than the --max-delete percent of files -were deleted on either the Path1 or Path2 filesystem, then bisync will -abort with a warning message, without making any changes. The default ---max-delete is 50%. One way to trigger this limit is to rename a -directory that contains more than half of your files. This will appear -to bisync as a bunch of deleted files and a bunch of new files. This -safety check is intended to block bisync from deleting all of the files -on both filesystems due to a temporary network access issue, or if the -user had inadvertently deleted the files on one side or the other. To -force the sync, either set a different delete percentage limit, e.g. ---max-delete 75 (allows up to 75% deletion), or use --force to bypass -the check. + Dollar $ $ -Also see the all files changed check. + Dot . or .. as entire string ., .. ---filters-file + DoubleQuote " " -By using rclone filter features you can exclude file types or directory -sub-trees from the sync. See the bisync filters section and generic ---filter-from documentation. An example filters file contains filters -for non-allowed files for synching with Dropbox. + Hash # # -If you make changes to your filters file then bisync requires a run with ---resync. This is a safety feature, which prevents existing files on the -Path1 and/or Path2 side from seeming to disappear from view (since they -are excluded in the new listings), which would fool bisync into seeing -them as deleted (as compared to the prior run listings), and then bisync -would proceed to delete them for real. + InvalidUtf8 An invalid UTF-8 � + character (e.g. latin1) -To block this from happening, bisync calculates an MD5 hash of the -filters file and stores the hash in a .md5 file in the same place as -your filters file. On the next run with --filters-file set, bisync -re-calculates the MD5 hash of the current filters file and compares it -to the hash stored in the .md5 file. If they don't match, the run aborts -with a critical error and thus forces you to do a --resync, likely -avoiding a disaster. + LeftCrLfHtVt CR 0x0D, LF 0x0A, HT ␍, ␊, ␉, ␋ + 0x09, VT 0x0B on the + left of a string ---check-sync + LeftPeriod . on the left of a . + string -Enabled by default, the check-sync function checks that all of the same -files exist in both the Path1 and Path2 history listings. This -check-sync integrity check is performed at the end of the sync run by -default. Any untrapped failing copy/deletes between the two paths might -result in differences between the two listings and in the untracked file -content differences between the two paths. A resync run would correct -the error. + LeftSpace SPACE on the left of a ␠ + string -Note that the default-enabled integrity check locally executes a load of -both the final Path1 and Path2 listings, and thus adds to the run time -of a sync. Using --check-sync=false will disable it and may -significantly reduce the sync run times for very large numbers of files. + LeftTilde ~ on the left of a ~ + string -The check may be run manually with --check-sync=only. It runs only the -integrity check and terminates without actually synching. + LtGt <, > <, > -See also: Concurrent modifications + None No characters are + encoded ---ignore-listing-checksum + Percent % % -By default, bisync will retrieve (or generate) checksums (for backends -that support them) when creating the listings for both paths, and store -the checksums in the listing files. --ignore-listing-checksum will -disable this behavior, which may speed things up considerably, -especially on backends (such as local) where hashes must be computed on -the fly instead of retrieved. Please note the following: + Pipe | | -- While checksums are (by default) generated and stored in the listing - files, they are NOT currently used for determining diffs (deltas). - It is anticipated that full checksum support will be added in a - future version. -- --ignore-listing-checksum is NOT the same as --ignore-checksum, and - you may wish to use one or the other, or both. In a nutshell: - --ignore-listing-checksum controls whether checksums are considered - when scanning for diffs, while --ignore-checksum controls whether - checksums are considered during the copy/sync operations that - follow, if there ARE diffs. -- Unless --ignore-listing-checksum is passed, bisync currently - computes hashes for one path even when there's no common hash with - the other path (for example, a crypt remote.) -- If both paths support checksums and have a common hash, AND - --ignore-listing-checksum was not specified when creating the - listings, --check-sync=only can be used to compare Path1 vs. Path2 - checksums (as of the time the previous listings were created.) - However, --check-sync=only will NOT include checksums if the - previous listings were generated on a run using - --ignore-listing-checksum. For a more robust integrity check of the - current state, consider using check (or cryptcheck, if at least one - path is a crypt remote.) + Question ? ? ---resilient + RightCrLfHtVt CR 0x0D, LF 0x0A, HT ␍, ␊, ␉, ␋ + 0x09, VT 0x0B on the + right of a string -Caution: this is an experimental feature. Use at your own risk! + RightPeriod . on the right of a . + string -By default, most errors or interruptions will cause bisync to abort and -require --resync to recover. This is a safety feature, to prevent bisync -from running again until a user checks things out. However, in some -cases, bisync can go too far and enforce a lockout when one isn't -actually necessary, like for certain less-serious errors that might -resolve themselves on the next run. When --resilient is specified, -bisync tries its best to recover and self-correct, and only requires ---resync as a last resort when a human's involvement is absolutely -necessary. The intended use case is for running bisync as a background -process (such as via scheduled cron). + RightSpace SPACE on the right of a ␠ + string -When using --resilient mode, bisync will still report the error and -abort, however it will not lock out future runs -- allowing the -possibility of retrying at the next normally scheduled time, without -requiring a --resync first. Examples of such retryable errors include -access test failures, missing listing files, and filter change -detections. These safety features will still prevent the current run -from proceeding -- the difference is that if conditions have improved by -the time of the next run, that next run will be allowed to proceed. -Certain more serious errors will still enforce a --resync lockout, even -in --resilient mode, to prevent data loss. + Semicolon ; ; -Behavior of --resilient may change in a future version. + SingleQuote ' ' -Operation + Slash / / -Runtime flow details + SquareBracket [, ] [, ] + ---------------------------------------------------------------------------------- -bisync retains the listings of the Path1 and Path2 filesystems from the -prior run. On each successive run it will: +Encoding example: FTP -- list files on path1 and path2, and check for changes on each side. - Changes include New, Newer, Older, and Deleted files. -- Propagate changes on path1 to path2, and vice-versa. +To take a specific example, the FTP backend's default encoding is -Safety measures + --ftp-encoding "Slash,Del,Ctl,RightSpace,Dot" -- Lock file prevents multiple simultaneous runs when taking a while. - This can be particularly useful if bisync is run by cron scheduler. -- Handle change conflicts non-destructively by creating ..path1 and - ..path2 file versions. -- File system access health check using RCLONE_TEST files (see the - --check-access flag). -- Abort on excessive deletes - protects against a failed listing being - interpreted as all the files were deleted. See the --max-delete and - --force flags. -- If something evil happens, bisync goes into a safe state to block - damage by later runs. (See Error Handling) +However, let's say the FTP server is running on Windows and can't have +any of the invalid Windows characters in file names. You are backing up +Linux servers to this FTP server which do have those characters in file +names. So you would add the Windows set which are -Normal sync checks + Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot - ------------------------------------------------------------------------ - Type Description Result Implementation - --------- ---------------------------- --------------- ----------------- - Path2 new File is new on Path2, does Path2 version rclone copy Path2 - not exist on Path1 survives to Path1 +to the existing ones, giving: - Path2 File is newer on Path2, Path2 version rclone copy Path2 - newer unchanged on Path1 survives to Path1 + Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot,Del,RightSpace - Path2 File is deleted on Path2, File is deleted rclone delete - deleted unchanged on Path1 Path1 +This can be specified using the --ftp-encoding flag or using an encoding +parameter in the config file. - Path1 new File is new on Path1, does Path1 version rclone copy Path1 - not exist on Path2 survives to Path2 +Encoding example: Windows - Path1 File is newer on Path1, Path1 version rclone copy Path1 - newer unchanged on Path2 survives to Path2 +As a nother example, take a Windows system where there is a file with +name Test:1.jpg, where : is the Unicode fullwidth colon symbol. When +using rclone to copy this to a remote which supports :, the regular +(halfwidth) colon (such as Google Drive), you will notice that the file +gets renamed to Test:1.jpg. - Path1 File is older on Path1, Path1 version rclone copy Path1 - older unchanged on Path2 survives to Path2 +To avoid this you can change the set of characters rclone should convert +for the local filesystem, using command-line argument --local-encoding. +Rclone's default behavior on Windows corresponds to - Path2 File is older on Path2, Path2 version rclone copy Path2 - older unchanged on Path1 survives to Path1 + --local-encoding "Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot" - Path1 File no longer exists on File is deleted rclone delete - deleted Path1 Path2 - ------------------------------------------------------------------------ +If you want to use fullwidth characters :, * and ? in your filenames +without rclone changing them when uploading to a remote, then set the +same as the default value but without Colon,Question,Asterisk: -Unusual sync checks + --local-encoding "Slash,LtGt,DoubleQuote,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot" - ---------------------------------------------------------------------------- - Type Description Result Implementation - ----------------- --------------------- ------------------- ---------------- - Path1 new/changed File is new/changed No change None - AND Path2 on Path1 AND - new/changed AND new/changed on Path2 - Path1 == Path2 AND Path1 version is - currently identical - to Path2 +Alternatively, you can disable the conversion of any characters with +--local-encoding None. - Path1 new AND File is new on Path1 Files renamed to rclone copy - Path2 new AND new on Path2 (and _Path1 and _Path2 _Path2 file to - Path1 version is NOT Path1, - identical to Path2) rclone copy - _Path1 file to - Path2 +Instead of using command-line argument --local-encoding, you may also +set it as environment variable RCLONE_LOCAL_ENCODING, or configure a +remote of type local in your config, and set the encoding option there. - Path2 newer AND File is newer on Files renamed to rclone copy - Path1 changed Path2 AND also _Path1 and _Path2 _Path2 file to - changed Path1, - (newer/older/size) on rclone copy - Path1 (and Path1 _Path1 file to - version is NOT Path2 - identical to Path2) +The risk by doing this is that if you have a filename with the regular +(halfwidth) :, * and ? in your cloud storage, and you try to download it +to your Windows filesystem, this will fail. These characters are not +valid in filenames on Windows, and you have told rclone not to work +around this by converting them to valid fullwidth variants. - Path2 newer AND File is newer on Path2 version rclone copy - Path1 deleted Path2 AND also survives Path2 to Path1 - deleted on Path1 +MIME Type - Path2 deleted AND File is deleted on Path1 version rclone copy - Path1 changed Path2 AND changed survives Path1 to Path2 - (newer/older/size) on - Path1 +MIME types (also known as media types) classify types of documents using +a simple text classification, e.g. text/html or application/pdf. - Path1 deleted AND File is deleted on Path2 version rclone copy - Path2 changed Path1 AND changed survives Path2 to Path1 - (newer/older/size) on - Path2 - ---------------------------------------------------------------------------- +Some cloud storage systems support reading (R) the MIME type of objects +and some support writing (W) the MIME type of objects. -As of rclone v1.64, bisync is now better at detecting false positive -sync conflicts, which would previously have resulted in unnecessary -renames and duplicates. Now, when bisync comes to a file that it wants -to rename (because it is new/changed on both sides), it first checks -whether the Path1 and Path2 versions are currently identical (using the -same underlying function as check.) If bisync concludes that the files -are identical, it will skip them and move on. Otherwise, it will create -renamed ..Path1 and ..Path2 duplicates, as before. This behavior also -improves the experience of renaming directories, as a --resync is no -longer required, so long as the same change has been made on both sides. +The MIME type can be important if you are serving files directly to HTTP +from the storage system. -All files changed check +If you are copying from a remote which supports reading (R) to a remote +which supports writing (W) then rclone will preserve the MIME types. +Otherwise they will be guessed from the extension, or the remote itself +may assign the MIME type. -If all prior existing files on either of the filesystems have changed -(e.g. timestamps have changed due to changing the system's timezone) -then bisync will abort without making any changes. Any new files are not -considered for this check. You could use --force to force the sync -(whichever side has the changed timestamp files wins). Alternately, a ---resync may be used (Path1 versions will be pushed to Path2). Consider -the situation carefully and perhaps use --dry-run before you commit to -the changes. +Metadata -Modification time +Backends may or may support reading or writing metadata. They may +support reading and writing system metadata (metadata intrinsic to that +backend) and/or user metadata (general purpose metadata). -Bisync relies on file timestamps to identify changed files and will -refuse to operate if backend lacks the modification time support. +The levels of metadata support are -If you or your application should change the content of a file without -changing the modification time then bisync will not notice the change, -and thus will not copy it to the other side. + Key Explanation + ----- ----------------------------------------------------------------- + R Read only System Metadata + RW Read and write System Metadata + RWU Read and write System Metadata and read and write User Metadata -Note that on some cloud storage systems it is not possible to have file -timestamps that match precisely between the local and other filesystems. +See the metadata docs for more info. -Bisync's approach to this problem is by tracking the changes on each -side separately over time with a local database of files in that side -then applying the resulting changes on the other side. +Optional Features -Error handling +All rclone remotes support a base command set. Other features depend +upon backend-specific capabilities. -Certain bisync critical errors, such as file copy/move failing, will -result in a bisync lockout of following runs. The lockout is asserted -because the sync status and history of the Path1 and Path2 filesystems -cannot be trusted, so it is safer to block any further changes until -someone checks things out. The recovery is to do a --resync again. + ------------------------------------------------------------------------------------------------------------------------------------- + Name Purge Copy Move DirMove CleanUp ListR StreamUpload MultithreadUpload LinkSharing About EmptyDir + --------------- ------- ------ ------ --------- --------- ------- -------------- ------------------- ------------- ------- ---------- + 1Fichier No Yes Yes No No No No No Yes No Yes -It is recommended to use --resync --dry-run --verbose initially and -carefully review what changes will be made before running the --resync -without --dry-run. + Akamai Yes No No No No Yes Yes No No No Yes + Netstorage -Most of these events come up due to an error status from an internal -call. On such a critical error the {...}.path1.lst and {...}.path2.lst -listing files are renamed to extension .lst-err, which blocks any future -bisync runs (since the normal .lst files are not found). Bisync keeps -them under bisync subdirectory of the rclone cache directory, typically -at ${HOME}/.cache/rclone/bisync/ on Linux. + Amazon Drive Yes No Yes Yes No No No No No No Yes -Some errors are considered temporary and re-running the bisync is not -blocked. The critical return blocks further bisync runs. + Amazon S3 (or No Yes No No Yes Yes Yes Yes Yes No No + S3 compatible) -See also: --resilient + Backblaze B2 No Yes No No Yes Yes Yes Yes Yes No No -Lock file + Box Yes Yes Yes Yes Yes No Yes No Yes Yes Yes -When bisync is running, a lock file is created in the bisync working -directory, typically at ~/.cache/rclone/bisync/PATH1..PATH2.lck on -Linux. If bisync should crash or hang, the lock file will remain in -place and block any further runs of bisync for the same paths. Delete -the lock file as part of debugging the situation. The lock file -effectively blocks follow-on (e.g., scheduled by cron) runs when the -prior invocation is taking a long time. The lock file contains PID of -the blocking process, which may help in debug. + Citrix Yes Yes Yes Yes No No No No No No Yes + ShareFile -Note that while concurrent bisync runs are allowed, be very cautious -that there is no overlap in the trees being synched between concurrent -runs, lest there be replicated files, deleted files and general mayhem. + Dropbox Yes Yes Yes Yes No No Yes No Yes Yes Yes -Return codes + Enterprise File Yes Yes Yes Yes Yes No No No No No Yes + Fabric -rclone bisync returns the following codes to calling program: - 0 on a -successful run, - 1 for a non-critical failing run (a rerun may be -successful), - 2 for a critically aborted run (requires a --resync to -recover). + FTP No No Yes Yes No No Yes No No No Yes -Limitations + Google Cloud Yes Yes No No No Yes Yes No No No No + Storage -Supported backends + Google Drive Yes Yes Yes Yes Yes Yes Yes No Yes Yes Yes -Bisync is considered BETA and has been tested with the following -backends: - Local filesystem - Google Drive - Dropbox - OneDrive - S3 - -SFTP - Yandex Disk + Google Photos No No No No No No No No No No No -It has not been fully tested with other services yet. If it works, or -sorta works, please let us know and we'll update the list. Run the test -suite to check for proper operation as described below. + HDFS Yes No Yes Yes No No Yes No No Yes Yes -First release of rclone bisync requires that underlying backend supports -the modification time feature and will refuse to run otherwise. This -limitation will be lifted in a future rclone bisync release. + HiDrive Yes Yes Yes Yes No No Yes No No No Yes -Concurrent modifications + HTTP No No No No No No No No No No Yes -When using Local, FTP or SFTP remotes rclone does not create temporary -files at the destination when copying, and thus if the connection is -lost the created file may be corrupt, which will likely propagate back -to the original path on the next sync, resulting in data loss. This will -be solved in a future release, there is no workaround at the moment. + Internet No Yes No No Yes Yes No No Yes Yes No + Archive -Files that change during a bisync run may result in data loss. This has -been seen in a highly dynamic environment, where the filesystem is -getting hammered by running processes during the sync. The currently -recommended solution is to sync at quiet times or filter out unnecessary -directories and files. + Jottacloud Yes Yes Yes Yes Yes Yes No No Yes Yes Yes -As an alternative approach, consider using --check-sync=false (and -possibly --resilient) to make bisync more forgiving of filesystems that -change during the sync. Be advised that this may cause bisync to miss -events that occur during a bisync run, so it is a good idea to -supplement this with a periodic independent integrity check, and -corrective sync if diffs are found. For example, a possible sequence -could look like this: + Koofr Yes Yes Yes Yes No No Yes No Yes Yes Yes -1. Normally scheduled bisync run: + Mail.ru Cloud Yes Yes Yes Yes Yes No No No Yes Yes Yes - rclone bisync Path1 Path2 -MPc --check-access --max-delete 10 --filters-file /path/to/filters.txt -v --check-sync=false --no-cleanup --ignore-listing-checksum --disable ListR --checkers=16 --drive-pacer-min-sleep=10ms --create-empty-src-dirs --resilient + Mega Yes No Yes Yes Yes No No No Yes Yes Yes -2. Periodic independent integrity check (perhaps scheduled nightly or - weekly): + Memory No Yes No No No Yes Yes No No No No - rclone check -MvPc Path1 Path2 --filter-from /path/to/filters.txt + Microsoft Azure Yes Yes No No No Yes Yes Yes No No No + Blob Storage -3. If diffs are found, you have some choices to correct them. If one - side is more up-to-date and you want to make the other side match - it, you could run: + Microsoft Azure No Yes Yes Yes No No Yes Yes No Yes Yes + Files Storage - rclone sync Path1 Path2 --filter-from /path/to/filters.txt --create-empty-src-dirs -MPc -v + Microsoft Yes Yes Yes Yes Yes Yes ⁵ No No Yes Yes Yes + OneDrive -(or switch Path1 and Path2 to make Path2 the source-of-truth) + OpenDrive Yes Yes Yes Yes No No No No No No Yes -Or, if neither side is totally up-to-date, you could run a --resync to -bring them back into agreement (but remember that this could cause -deleted files to re-appear.) + OpenStack Swift Yes ¹ Yes No No No Yes Yes No No Yes No -*Note also that rclone check does not currently include empty -directories, so if you want to know if any empty directories are out of -sync, consider alternatively running the above rclone sync command with ---dry-run added. + Oracle Object No Yes No No Yes Yes Yes Yes No No No + Storage -Empty directories + pCloud Yes Yes Yes Yes Yes No No No Yes Yes Yes -By default, new/deleted empty directories on one path are not propagated -to the other side. This is because bisync (and rclone) natively works on -files, not directories. However, this can be changed with the ---create-empty-src-dirs flag, which works in much the same way as in -sync and copy. When used, empty directories created or deleted on one -side will also be created or deleted on the other side. The following -should be noted: * --create-empty-src-dirs is not compatible with ---remove-empty-dirs. Use only one or the other (or neither). * It is not -recommended to switch back and forth between --create-empty-src-dirs and -the default (no --create-empty-src-dirs) without running --resync. This -is because it may appear as though all directories (not just the empty -ones) were created/deleted, when actually you've just toggled between -making them visible/invisible to bisync. It looks scarier than it is, -but it's still probably best to stick to one or the other, and use ---resync when you need to switch. + PikPak Yes Yes Yes Yes Yes No No No Yes Yes Yes -Renamed directories + premiumize.me Yes No Yes Yes No No No No Yes Yes Yes -Renaming a folder on the Path1 side results in deleting all files on the -Path2 side and then copying all files again from Path1 to Path2. Bisync -sees this as all files in the old directory name as deleted and all -files in the new directory name as new. Currently, the most effective -and efficient method of renaming a directory is to rename it to the same -name on both sides. (As of rclone v1.64, a --resync is no longer -required after doing so, as bisync will automatically detect that Path1 -and Path2 are in agreement.) + put.io Yes No Yes Yes Yes No Yes No No Yes Yes ---fast-list used by default + Proton Drive Yes No Yes Yes Yes No No No No Yes Yes -Unlike most other rclone commands, bisync uses --fast-list by default, -for backends that support it. In many cases this is desirable, however, -there are some scenarios in which bisync could be faster without ---fast-list, and there is also a known issue concerning Google Drive -users with many empty directories. For now, the recommended way to avoid -using --fast-list is to add --disable ListR to all bisync commands. The -default behavior may change in a future version. + QingStor No Yes No No Yes Yes No No No No No -Overridden Configs + Quatrix by Yes Yes Yes Yes No No No No No Yes Yes + Maytech -When rclone detects an overridden config, it adds a suffix like {ABCDE} -on the fly to the internal name of the remote. Bisync follows suit by -including this suffix in its listing filenames. However, this suffix -does not necessarily persist from run to run, especially if different -flags are provided. So if next time the suffix assigned is {FGHIJ}, -bisync will get confused, because it's looking for a listing file with -{FGHIJ}, when the file it wants has {ABCDE}. As a result, it throws -Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run -and refuses to run again until the user runs a --resync (unless using ---resilient). The best workaround at the moment is to set any -backend-specific flags in the config file instead of specifying them -with command flags. (You can still override them as needed for other -rclone commands.) + Seafile Yes Yes Yes Yes Yes Yes Yes No Yes Yes Yes -Case sensitivity + SFTP No Yes ⁴ Yes Yes No No Yes No No Yes Yes -Synching with case-insensitive filesystems, such as Windows or Box, can -result in file name conflicts. This will be fixed in a future release. -The near-term workaround is to make sure that files on both sides don't -have spelling case differences (Smile.jpg vs. smile.jpg). + Sia No No No No No No Yes No No No Yes -Windows support + SMB No No Yes Yes No No Yes Yes No No Yes -Bisync has been tested on Windows 8.1, Windows 10 Pro 64-bit and on -Windows GitHub runners. + SugarSync Yes Yes Yes Yes No No Yes No Yes No Yes -Drive letters are allowed, including drive letters mapped to network -drives (rclone bisync J:\localsync GDrive:). If a drive letter is -omitted, the shell current drive is the default. Drive letters are a -single character follows by :, so cloud names must be more than one -character long. + Storj Yes ² Yes Yes No No Yes Yes No Yes No No -Absolute paths (with or without a drive letter), and relative paths -(with or without a drive letter) are supported. + Uptobox No Yes Yes Yes No No No No No No No -Working directory is created at -C:\Users\MyLogin\AppData\Local\rclone\bisync. + WebDAV Yes Yes Yes Yes No No Yes ³ No No Yes Yes -Note that bisync output may show a mix of forward / and back \ slashes. + Yandex Disk Yes Yes Yes Yes Yes No Yes No Yes Yes Yes -Be careful of case independent directory and file naming on Windows vs. -case dependent Linux + Zoho WorkDrive Yes Yes Yes Yes No No No No No Yes Yes -Filtering + The local Yes No Yes Yes No No Yes Yes No Yes Yes + filesystem + ------------------------------------------------------------------------------------------------------------------------------------- -See filtering documentation for how filter rules are written and -interpreted. +¹ Note Swift implements this in order to delete directory markers but it +doesn't actually have a quicker way of deleting files other than +deleting them individually. -Bisync's --filters-file flag slightly extends the rclone's --filter-from -filtering mechanism. For a given bisync run you may provide only one ---filters-file. The --include*, --exclude*, and --filter flags are also -supported. +² Storj implements this efficiently only for entire buckets. If purging +a directory inside a bucket, files are deleted individually. -How to filter directories +³ StreamUpload is not supported with Nextcloud -Filtering portions of the directory tree is a critical feature for -synching. +⁴ Use the --sftp-copy-is-hardlink flag to enable. -Examples of directory trees (always beneath the Path1/Path2 root level) -you may want to exclude from your sync: - Directory trees containing -only software build intermediate files. - Directory trees containing -application temporary files and data such as the Windows -C:\Users\MyLogin\AppData\ tree. - Directory trees containing files that -are large, less important, or are getting thrashed continuously by -ongoing processes. +⁵ Use the --onedrive-delta flag to enable. -On the other hand, there may be only select directories that you -actually want to sync, and exclude all others. See the Example -include-style filters for Windows user directories below. +Purge -Filters file writing guidelines +This deletes a directory quicker than just deleting all the files in the +directory. -1. Begin with excluding directory trees: - - e.g. `- /AppData/` - - ** on the end is not necessary. Once a given directory level is - excluded then everything beneath it won't be looked at by - rclone. - - Exclude such directories that are unneeded, are big, dynamically - thrashed, or where there may be access permission issues. - - Excluding such dirs first will make rclone operations (much) - faster. - - Specific files may also be excluded, as with the Dropbox - exclusions example below. -2. Decide if it's easier (or cleaner) to: - - Include select directories and therefore exclude everything else - -- or -- - - Exclude select directories and therefore include everything else -3. Include select directories: - - Add lines like: `+ /Documents/PersonalFiles/**` to select which - directories to include in the sync. - - ** on the end specifies to include the full depth of the - specified tree. - - With Include-style filters, files at the Path1/Path2 root are - not included. They may be included with `+ /*`. - - Place RCLONE_TEST files within these included directory trees. - They will only be looked for in these directory trees. - - Finish by excluding everything else by adding `- **` at the end - of the filters file. - - Disregard step 4. -4. Exclude select directories: - - Add more lines like in step 1. For example: - -/Desktop/tempfiles/, or `- /testdir/. Again, a**` on the end - is not necessary. - - Do not add a `- **` in the file. Without this line, everything - will be included that has not been explicitly excluded. - - Disregard step 3. +Copy -A few rules for the syntax of a filter file expanding on filtering -documentation: +Used when copying an object to and from the same remote. This known as a +server-side copy so you can copy a file without downloading it and +uploading it again. It is used if you use rclone copy or rclone move if +the remote doesn't support Move directly. -- Lines may start with spaces and tabs - rclone strips leading - whitespace. -- If the first non-whitespace character is a # then the line is a - comment and will be ignored. -- Blank lines are ignored. -- The first non-whitespace character on a filter line must be a + or - -. -- Exactly 1 space is allowed between the +/- and the path term. -- Only forward slashes (/) are used in path terms, even on Windows. -- The rest of the line is taken as the path term. Trailing whitespace - is taken literally, and probably is an error. +If the server doesn't support Copy directly then for copy operations the +file is downloaded then re-uploaded. -Example include-style filters for Windows user directories +Move -This Windows include-style example is based on the sync root (Path1) set -to C:\Users\MyLogin. The strategy is to select specific directories to -be synched with a network drive (Path2). +Used when moving/renaming an object on the same remote. This is known as +a server-side move of a file. This is used in rclone move if the server +doesn't support DirMove. -- `- /AppData/` excludes an entire tree of Windows stored stuff that - need not be synched. In my case, AppData has >11 GB of stuff I don't - care about, and there are some subdirectories beneath AppData that - are not accessible to my user login, resulting in bisync critical - aborts. -- Windows creates cache files starting with both upper and lowercase - NTUSER at C:\Users\MyLogin. These files may be dynamic, locked, and - are generally don't care. -- There are just a few directories with my data that I do want - synched, in the form of `+ - /. By selecting only the directory trees I want to avoid the dozen plus directories that various apps make atC:`. -- Include files in the root of the sync point, C:\Users\MyLogin, by - adding the `+ /*` line. -- This is an Include-style filters file, therefore it ends with `- **` - which excludes everything not explicitly included. +If the server isn't capable of Move then rclone simulates it with Copy +then delete. If the server doesn't support Copy then rclone will +download the file and re-upload it. - - /AppData/ - - NTUSER* - - ntuser* - + /Documents/Family/** - + /Documents/Sketchup/** - + /Documents/Microcapture_Photo/** - + /Documents/Microcapture_Video/** - + /Desktop/** - + /Pictures/** - + /* - - ** +DirMove -Note also that Windows implements several "library" links such as -C:\Users\MyLogin\My Documents\My Music pointing to -C:\Users\MyLogin\Music. rclone sees these as links, so you must add ---links to the bisync command line if you which to follow these links. I -find that I get permission errors in trying to follow the links, so I -don't include the rclone --links flag, but then you get lots of -Can't follow symlink… noise from rclone about not following the links. -This noise can be quashed by adding --quiet to the bisync command line. +This is used to implement rclone move to move a directory if possible. +If it isn't then it will use Move on each file (which falls back to Copy +then download and upload - see Move section). -Example exclude-style filters files for use with Dropbox +CleanUp -- Dropbox disallows synching the listed temporary and - configuration/data files. The `- ` filters exclude these files where - ever they may occur in the sync tree. Consider adding similar - exclusions for file types you don't need to sync, such as core dump - and software build files. -- bisync testing creates /testdir/ at the top level of the sync tree, - and usually deletes the tree after the test. If a normal sync should - run while the /testdir/ tree exists the --check-access phase may - fail due to unbalanced RCLONE_TEST files. The `- /testdir/` filter - blocks this tree from being synched. You don't need this exclusion - if you are not doing bisync development testing. -- Everything else beneath the Path1/Path2 root will be synched. -- RCLONE_TEST files may be placed anywhere within the tree, including - the root. +This is used for emptying the trash for a remote by rclone cleanup. -Example filters file for Dropbox +If the server can't do CleanUp then rclone cleanup will return an error. - # Filter file for use with bisync - # See https://rclone.org/filtering/ for filtering rules - # NOTICE: If you make changes to this file you MUST do a --resync run. - # Run with --dry-run to see what changes will be made. +‡‡ Note that while Box implements this it has to delete every file +individually so it will be slower than emptying the trash via the WebUI - # Dropbox won't sync some files so filter them away here. - # See https://help.dropbox.com/installs-integrations/sync-uploads/files-not-syncing - - .dropbox.attr - - ~*.tmp - - ~$* - - .~* - - desktop.ini - - .dropbox +ListR - # Used for bisync testing, so excluded from normal runs - - /testdir/ +The remote supports a recursive list to list all the contents beneath a +directory quickly. This enables the --fast-list flag to work. See the +rclone docs for more details. - # Other example filters - #- /TiBU/ - #- /Photos/ +StreamUpload -How --check-access handles filters +Some remotes allow files to be uploaded without knowing the file size in +advance. This allows certain operations to work without spooling the +file to local disk first, e.g. rclone rcat. -At the start of a bisync run, listings are gathered for Path1 and Path2 -while using the user's --filters-file. During the check access phase, -bisync scans these listings for RCLONE_TEST files. Any RCLONE_TEST files -hidden by the --filters-file are not in the listings and thus not -checked during the check access phase. +MultithreadUpload -Troubleshooting +Some remotes allow transfers to the remote to be sent as chunks in +parallel. If this is supported then rclone will use multi-thread copying +to transfer files much faster. -Reading bisync logs +LinkSharing -Here are two normal runs. The first one has a newer file on the remote. -The second has no deltas between local and remote. +Sets the necessary permissions on a file or folder and prints a link +that allows others to access them, even if they don't have an account on +the particular cloud provider. - 2021/05/16 00:24:38 INFO : Synching Path1 "/path/to/local/tree/" with Path2 "dropbox:/" - 2021/05/16 00:24:38 INFO : Path1 checking for diffs - 2021/05/16 00:24:38 INFO : - Path1 File is new - file.txt - 2021/05/16 00:24:38 INFO : Path1: 1 changes: 1 new, 0 newer, 0 older, 0 deleted - 2021/05/16 00:24:38 INFO : Path2 checking for diffs - 2021/05/16 00:24:38 INFO : Applying changes - 2021/05/16 00:24:38 INFO : - Path1 Queue copy to Path2 - dropbox:/file.txt - 2021/05/16 00:24:38 INFO : - Path1 Do queued copies to - Path2 - 2021/05/16 00:24:38 INFO : Updating listings - 2021/05/16 00:24:38 INFO : Validating listings for Path1 "/path/to/local/tree/" vs Path2 "dropbox:/" - 2021/05/16 00:24:38 INFO : Bisync successful +About - 2021/05/16 00:36:52 INFO : Synching Path1 "/path/to/local/tree/" with Path2 "dropbox:/" - 2021/05/16 00:36:52 INFO : Path1 checking for diffs - 2021/05/16 00:36:52 INFO : Path2 checking for diffs - 2021/05/16 00:36:52 INFO : No changes found - 2021/05/16 00:36:52 INFO : Updating listings - 2021/05/16 00:36:52 INFO : Validating listings for Path1 "/path/to/local/tree/" vs Path2 "dropbox:/" - 2021/05/16 00:36:52 INFO : Bisync successful +Rclone about prints quota information for a remote. Typical output +includes bytes used, free, quota and in trash. -Dry run oddity - -The --dry-run messages may indicate that it would try to delete some -files. For example, if a file is new on Path2 and does not exist on -Path1 then it would normally be copied to Path1, but with --dry-run -enabled those copies don't happen, which leads to the attempted delete -on Path2, blocked again by --dry-run: ... Not deleting as --dry-run. - -This whole confusing situation is an artifact of the --dry-run flag. -Scrutinize the proposed deletes carefully, and if the files would have -been copied to Path1 then the threatened deletes on Path2 may be -disregarded. - -Retries - -Rclone has built-in retries. If you run with --verbose you'll see error -and retry messages such as shown below. This is usually not a bug. If at -the end of the run, you see Bisync successful and not -Bisync critical error or Bisync aborted then the run was successful, and -you can ignore the error messages. - -The following run shows an intermittent fail. Lines 5 and _6- are -low-level messages. Line 6 is a bubbled-up warning message, conveying -the error. Rclone normally retries failing commands, so there may be -numerous such messages in the log. - -Since there are no final error/warning messages on line 7, rclone has -recovered from failure after a retry, and the overall sync was -successful. - - 1: 2021/05/14 00:44:12 INFO : Synching Path1 "/path/to/local/tree" with Path2 "dropbox:" - 2: 2021/05/14 00:44:12 INFO : Path1 checking for diffs - 3: 2021/05/14 00:44:12 INFO : Path2 checking for diffs - 4: 2021/05/14 00:44:12 INFO : Path2: 113 changes: 22 new, 0 newer, 0 older, 91 deleted - 5: 2021/05/14 00:44:12 ERROR : /path/to/local/tree/objects/af: error listing: unexpected end of JSON input - 6: 2021/05/14 00:44:12 NOTICE: WARNING listing try 1 failed. - dropbox: - 7: 2021/05/14 00:44:12 INFO : Bisync successful - -This log shows a Critical failure which requires a --resync to recover -from. See the Runtime Error Handling section. +If a remote lacks about capability rclone about remote:returns an error. - 2021/05/12 00:49:40 INFO : Google drive root '': Waiting for checks to finish - 2021/05/12 00:49:40 INFO : Google drive root '': Waiting for transfers to finish - 2021/05/12 00:49:40 INFO : Google drive root '': not deleting files as there were IO errors - 2021/05/12 00:49:40 ERROR : Attempt 3/3 failed with 3 errors and: not deleting files as there were IO errors - 2021/05/12 00:49:40 ERROR : Failed to sync: not deleting files as there were IO errors - 2021/05/12 00:49:40 NOTICE: WARNING rclone sync try 3 failed. - /path/to/local/tree/ - 2021/05/12 00:49:40 ERROR : Bisync aborted. Must run --resync to recover. +Backends without about capability cannot determine free space for an +rclone mount, or use policy mfs (most free space) as a member of an +rclone union remote. -Denied downloads of "infected" or "abusive" files +See rclone about command -Google Drive has a filter for certain file types (.exe, .apk, et cetera) -that by default cannot be copied from Google Drive to the local -filesystem. If you are having problems, run with --verbose to see -specifically which files are generating complaints. If the error is -This file has been identified as malware or spam and cannot be downloaded, -consider using the flag --drive-acknowledge-abuse. +EmptyDir -Google Doc files +The remote supports empty directories. See Limitations for details. Most +Object/Bucket-based remotes do not support this. -Google docs exist as virtual files on Google Drive and cannot be -transferred to other filesystems natively. While it is possible to -export a Google doc to a normal file (with .xlsx extension, for -example), it is not possible to import a normal file back into a Google -document. +Global Flags -Bisync's handling of Google Doc files is to flag them in the run log -output for user's attention and ignore them for any file transfers, -deletes, or syncs. They will show up with a length of -1 in the -listings. This bisync run is otherwise successful: +This describes the global flags available to every rclone command split +into groups. - 2021/05/11 08:23:15 INFO : Synching Path1 "/path/to/local/tree/base/" with Path2 "GDrive:" - 2021/05/11 08:23:15 INFO : ...path2.lst-new: Ignoring incorrect line: "- -1 - - 2018-07-29T08:49:30.136000000+0000 GoogleDoc.docx" - 2021/05/11 08:23:15 INFO : Bisync successful +Copy -Usage examples +Flags for anything which can Copy a file. -Cron + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don't skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don't check the destination, copy regardless + --no-traverse Don't traverse destination file system on copy + --no-update-modtime Don't update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination -Rclone does not yet have a built-in capability to monitor the local file -system for changes and must be blindly run periodically. On Windows this -can be done using a Task Scheduler, on Linux you can use Cron which is -described below. +Sync -The 1st example runs a sync every 5 minutes between a local directory -and an OwnCloud server, with output logged to a runlog file: +Flags just used for rclone sync. - # Minute (0-59) - # Hour (0-23) - # Day of Month (1-31) - # Month (1-12 or Jan-Dec) - # Day of Week (0-6 or Sun-Sat) - # Command - */5 * * * * /path/to/rclone bisync /local/files MyCloud: --check-access --filters-file /path/to/bysync-filters.txt --log-file /path/to//bisync.log + --backup-dir string Make backups into hierarchy based in DIR + --delete-after When synchronizing, delete files on destination after transferring (default) + --delete-before When synchronizing, delete files on destination before transferring + --delete-during When synchronizing, delete files during transfer + --ignore-errors Delete even if there are I/O errors + --max-delete int When synchronizing, limit the number of deletes (default -1) + --max-delete-size SizeSuffix When synchronizing, limit the total size of deletes (default off) + --suffix string Suffix to add to changed files + --suffix-keep-extension Preserve the extension when using --suffix + --track-renames When synchronizing, track file renames and do a server-side move if possible + --track-renames-strategy string Strategies to use when synchronizing using track-renames hash|modtime|leaf (default "hash") -See crontab syntax for the details of crontab time interval expressions. +Important -If you run rclone bisync as a cron job, redirect stdout/stderr to a -file. The 2nd example runs a sync to Dropbox every hour and logs all -stdout (via the >>) and stderr (via 2>&1) to a log file. +Important flags useful for most commands. - 0 * * * * /path/to/rclone bisync /path/to/local/dropbox Dropbox: --check-access --filters-file /home/user/filters.txt >> /path/to/logs/dropbox-run.log 2>&1 + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) -Sharing an encrypted folder tree between hosts +Check -bisync can keep a local folder in sync with a cloud service, but what if -you have some highly sensitive files to be synched? +Flags used for rclone check. -Usage of a cloud service is for exchanging both routine and sensitive -personal files between one's home network, one's personal notebook when -on the road, and with one's work computer. The routine data is not -sensitive. For the sensitive data, configure an rclone crypt remote to -point to a subdirectory within the local disk tree that is bisync'd to -Dropbox, and then set up an bisync for this local crypt directory to a -directory outside of the main sync tree. + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) -Linux server setup +Networking -- /path/to/DBoxroot is the root of my local sync tree. There are - numerous subdirectories. -- /path/to/DBoxroot/crypt is the root subdirectory for files that are - encrypted. This local directory target is setup as an rclone crypt - remote named Dropcrypt:. See rclone.conf snippet below. -- /path/to/my/unencrypted/files is the root of my sensitive files - - not encrypted, not within the tree synched to Dropbox. -- To sync my local unencrypted files with the encrypted Dropbox - versions I manually run - bisync /path/to/my/unencrypted/files DropCrypt:. This step could be - bundled into a script to run before and after the full Dropbox tree - sync in the last step, thus actively keeping the sensitive files in - sync. -- bisync /path/to/DBoxroot Dropbox: runs periodically via cron, - keeping my full local sync tree in sync with Dropbox. +General networking and HTTP stuff. -Windows notebook setup + --bind string Local address to bind to for outgoing connections, IPv4, IPv6 or name + --bwlimit BwTimetable Bandwidth limit in KiB/s, or use suffix B|K|M|G|T|P or a full timetable + --bwlimit-file BwTimetable Bandwidth limit per file in KiB/s, or use suffix B|K|M|G|T|P or a full timetable + --ca-cert stringArray CA certificate used to verify servers + --client-cert string Client SSL certificate (PEM) for mutual TLS auth + --client-key string Client SSL private key (PEM) for mutual TLS auth + --contimeout Duration Connect timeout (default 1m0s) + --disable-http-keep-alives Disable HTTP keep-alives and use each connection once. + --disable-http2 Disable HTTP/2 in the global transport + --dscp string Set DSCP value to connections, value or name, e.g. CS1, LE, DF, AF21 + --expect-continue-timeout Duration Timeout when using expect / 100-continue in HTTP (default 1s) + --header stringArray Set HTTP header for all transactions + --header-download stringArray Set HTTP header for download transactions + --header-upload stringArray Set HTTP header for upload transactions + --no-check-certificate Do not verify the server SSL certificate (insecure) + --no-gzip-encoding Don't set Accept-Encoding: gzip + --timeout Duration IO idle timeout (default 5m0s) + --tpslimit float Limit HTTP transactions per second to this + --tpslimit-burst int Max burst of transactions for --tpslimit (default 1) + --use-cookies Enable session cookiejar + --user-agent string Set the user-agent to a specified string (default "rclone/v1.65.0") -- The Dropbox client runs keeping the local tree - C:\Users\MyLogin\Dropbox always in sync with Dropbox. I could have - used rclone bisync instead. -- A separate directory tree at C:\Users\MyLogin\Documents\DropLocal - hosts the tree of unencrypted files/folders. -- To sync my local unencrypted files with the encrypted Dropbox - versions I manually run the following command: - rclone bisync C:\Users\MyLogin\Documents\DropLocal Dropcrypt:. -- The Dropbox client then syncs the changes with Dropbox. +Performance -rclone.conf snippet +Flags helpful for increasing performance. - [Dropbox] - type = dropbox - ... + --buffer-size SizeSuffix In memory buffer size when reading files for each --transfer (default 16Mi) + --checkers int Number of checkers to run in parallel (default 8) + --transfers int Number of file transfers to run in parallel (default 4) - [Dropcrypt] - type = crypt - remote = /path/to/DBoxroot/crypt # on the Linux server - remote = C:\Users\MyLogin\Dropbox\crypt # on the Windows notebook - filename_encryption = standard - directory_name_encryption = true - password = ... - ... +Config -Testing +General configuration of rclone. -You should read this section only if you are developing for rclone. You -need to have rclone source code locally to work with bisync tests. + --ask-password Allow prompt for password for encrypted configuration (default true) + --auto-confirm If enabled, do not request console confirmation + --cache-dir string Directory rclone will use for caching (default "$HOME/.cache/rclone") + --color AUTO|NEVER|ALWAYS When to show colors (and other ANSI codes) AUTO|NEVER|ALWAYS (default AUTO) + --config string Config file (default "$HOME/.config/rclone/rclone.conf") + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --disable string Disable a comma separated list of features (use --disable help to see a list) + -n, --dry-run Do a trial run with no permanent changes + --error-on-no-transfer Sets exit code 9 if no files are transferred, useful in scripts + --fs-cache-expire-duration Duration Cache remotes for this long (0 to disable caching) (default 5m0s) + --fs-cache-expire-interval Duration Interval to check for expired remotes (default 1m0s) + --human-readable Print numbers in a human-readable format, sizes with suffix Ki|Mi|Gi|Ti|Pi + -i, --interactive Enable interactive mode + --kv-lock-time Duration Maximum time to keep key-value database locked by process (default 1s) + --low-level-retries int Number of low level retries to do (default 10) + --no-console Hide console window (supported on Windows only) + --no-unicode-normalization Don't normalize unicode characters in filenames + --password-command SpaceSepList Command for supplying password for encrypted configuration + --retries int Retry operations this many times if they fail (default 3) + --retries-sleep Duration Interval between retrying operations if they fail, e.g. 500ms, 60s, 5m (0 to disable) (default 0s) + --temp-dir string Directory rclone will use for temporary files (default "/tmp") + --use-mmap Use mmap allocator (see docs) + --use-server-modtime Use server modified time instead of object metadata -Bisync has a dedicated test framework implemented in the bisync_test.go -file located in the rclone source tree. The test suite is based on the -go test command. Series of tests are stored in subdirectories below the -cmd/bisync/testdata directory. Individual tests can be invoked by their -directory name, e.g. -go test . -case basic -remote local -remote2 gdrive: -v +Debugging -Tests will make a temporary folder on remote and purge it afterwards. If -during test run there are intermittent errors and rclone retries, these -errors will be captured and flagged as invalid MISCOMPAREs. Rerunning -the test will let it pass. Consider such failures as noise. +Flags for developers. -Test command syntax + --cpuprofile string Write cpu profile to file + --dump DumpFlags List of items to dump from: headers, bodies, requests, responses, auth, filters, goroutines, openfiles, mapper + --dump-bodies Dump HTTP headers and bodies - may contain sensitive info + --dump-headers Dump HTTP headers - may contain sensitive info + --memprofile string Write memory profile to file - usage: go test ./cmd/bisync [options...] +Filter - Options: - -case NAME Name(s) of the test case(s) to run. Multiple names should - be separated by commas. You can remove the `test_` prefix - and replace `_` by `-` in test name for convenience. - If not `all`, the name(s) should map to a directory under - `./cmd/bisync/testdata`. - Use `all` to run all tests (default: all) - -remote PATH1 `local` or name of cloud service with `:` (default: local) - -remote2 PATH2 `local` or name of cloud service with `:` (default: local) - -no-compare Disable comparing test results with the golden directory - (default: compare) - -no-cleanup Disable cleanup of Path1 and Path2 testdirs. - Useful for troubleshooting. (default: cleanup) - -golden Store results in the golden directory (default: false) - This flag can be used with multiple tests. - -debug Print debug messages - -stop-at NUM Stop test after given step number. (default: run to the end) - Implies `-no-compare` and `-no-cleanup`, if the test really - ends prematurely. Only meaningful for a single test case. - -refresh-times Force refreshing the target modtime, useful for Dropbox - (default: false) - -verbose Run tests verbosely +Flags for filtering directory listings. -Note: unlike rclone flags which must be prefixed by double dash (--), -the test command flags can be equally prefixed by a single - or double -dash. + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) -Running tests +Listing -- go test . -case basic -remote local -remote2 local runs the - test_basic test case using only the local filesystem, synching one - local directory with another local directory. Test script output is - to the console, while commands within scenario.txt have their output - sent to the .../workdir/test.log file, which is finally compared to - the golden copy. -- The first argument after go test should be a relative name of the - directory containing bisync source code. If you run tests right from - there, the argument will be . (current directory) as in most - examples below. If you run bisync tests from the rclone source - directory, the command should be go test ./cmd/bisync .... -- The test engine will mangle rclone output to ensure comparability - with golden listings and logs. -- Test scenarios are located in ./cmd/bisync/testdata. The test -case - argument should match the full name of a subdirectory under that - directory. Every test subdirectory name on disk must start with - test_, this prefix can be omitted on command line for brevity. Also, - underscores in the name can be replaced by dashes for convenience. -- go test . -remote local -remote2 local -case all runs all tests. -- Path1 and Path2 may either be the keyword local or may be names of - configured cloud services. - go test . -remote gdrive: -remote2 dropbox: -case basic will run the - test between these two services, without transferring any files to - the local filesystem. -- Test run stdout and stderr console output may be directed to a file, - e.g. - go test . -remote gdrive: -remote2 local -case all > runlog.txt 2>&1 +Flags for listing directories. -Test execution flow + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions -1. The base setup in the initial directory of the testcase is applied - on the Path1 and Path2 filesystems (via rclone copy the initial - directory to Path1, then rclone sync Path1 to Path2). -2. The commands in the scenario.txt file are applied, with output - directed to the test.log file in the test working directory. - Typically, the first actual command in the scenario.txt file is to - do a --resync, which establishes the baseline {...}.path1.lst and - {...}.path2.lst files in the test working directory (.../workdir/ - relative to the temporary test directory). Various commands and - listing snapshots are done within the test. -3. Finally, the contents of the test working directory are compared to - the contents of the testcase's golden directory. +Logging -Notes about testing +Logging and statistics. -- Test cases are in individual directories beneath - ./cmd/bisync/testdata. A command line reference to a test is - understood to reference a directory beneath testdata. For example, - go test ./cmd/bisync -case dry-run -remote gdrive: -remote2 local - refers to the test case in ./cmd/bisync/testdata/test_dry_run. -- The test working directory is located at .../workdir relative to a - temporary test directory, usually under /tmp on Linux. -- The local test sync tree is created at a temporary directory named - like bisync.XXX under system temporary directory. -- The remote test sync tree is located at a temporary directory under - /bisync.XXX/. -- path1 and/or path2 subdirectories are created in a temporary - directory under the respective local or cloud test remote. -- By default, the Path1 and Path2 test dirs and workdir will be - deleted after each test run. The -no-cleanup flag disables purging - these directories when validating and debugging a given test. These - directories will be flushed before running another test, independent - of the -no-cleanup usage. -- You will likely want to add `- - /testdir/to your normal bisync--filters-fileso that normal syncs do not attempt to sync the test temporary directories, which may haveRCLONE_TESTmiscompares in some testcases which would otherwise trip the--check-accesssystem. The--check-accessmechanism is hard-coded to ignoreRCLONE_TESTfiles beneathbisync/testdata`, - so the test cases may reside on the synched tree even if there are - check file mismatches in the test tree. -- Some Dropbox tests can fail, notably printing the following message: - src and dst identical but can't set mod time without deleting and re-uploading - This is expected and happens due to the way Dropbox handles - modification times. You should use the -refresh-times test flag to - make up for this. -- If Dropbox tests hit request limit for you and print error message - too_many_requests/...: Too many requests or write operations. then - follow the Dropbox App ID instructions. + --log-file string Log everything to this file + --log-format string Comma separated list of log format options (default "date,time") + --log-level LogLevel Log level DEBUG|INFO|NOTICE|ERROR (default NOTICE) + --log-systemd Activate systemd integration for the logger + --max-stats-groups int Maximum number of stats groups to keep in memory, on max oldest is discarded (default 1000) + -P, --progress Show progress during transfer + --progress-terminal-title Show progress on the terminal title (requires -P/--progress) + -q, --quiet Print as little stuff as possible + --stats Duration Interval between printing stats, e.g. 500ms, 60s, 5m (0 to disable) (default 1m0s) + --stats-file-name-length int Max file name length in stats (0 for no limit) (default 45) + --stats-log-level LogLevel Log level to show --stats output DEBUG|INFO|NOTICE|ERROR (default INFO) + --stats-one-line Make the stats fit on one line + --stats-one-line-date Enable --stats-one-line and add current date/time prefix + --stats-one-line-date-format string Enable --stats-one-line-date and use custom formatted date: Enclose date string in double quotes ("), see https://golang.org/pkg/time/#Time.Format + --stats-unit string Show data rate in stats as either 'bits' or 'bytes' per second (default "bytes") + --syslog Use Syslog for logging + --syslog-facility string Facility for syslog, e.g. KERN,USER,... (default "DAEMON") + --use-json-log Use json log format + -v, --verbose count Print lots more stuff (repeat for more) -Updating golden results +Metadata -Sometimes even a slight change in the bisync source can cause little -changes spread around many log files. Updating them manually would be a -nightmare. +Flags to control metadata. -The -golden flag will store the test.log and *.lst listings from each -test case into respective golden directories. Golden results will -automatically contain generic strings instead of local or cloud paths -which means that they should match when run with a different cloud -service. + -M, --metadata If set, preserve metadata when copying objects + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --metadata-mapper SpaceSepList Program to run to transforming metadata before upload + --metadata-set stringArray Add metadata key=value when uploading -Your normal workflow might be as follows: 1. Git-clone the rclone -sources locally 2. Modify bisync source and check that it builds 3. Run -the whole test suite go test ./cmd/bisync -remote local 4. If some tests -show log difference, recheck them individually, e.g.: -go test ./cmd/bisync -remote local -case basic 5. If you are convinced -with the difference, goldenize all tests at once: -go test ./cmd/bisync -remote local -golden 6. Use word diff: -git diff --word-diff ./cmd/bisync/testdata/. Please note that normal -line-level diff is generally useless here. 7. Check the difference -carefully! 8. Commit the change (git commit) only if you are sure. If -unsure, save your code changes then wipe the log diffs from git: -git reset [--hard]. +RC -Structure of test scenarios +Flags to control the Remote Control API. -- /initial/ contains a tree of files that will be set as the - initial condition on both Path1 and Path2 testdirs. -- /modfiles/ contains files that will be used to modify the - Path1 and/or Path2 filesystems. -- /golden/ contains the expected content of the test working - directory (workdir) at the completion of the testcase. -- /scenario.txt contains the body of the test, in the form - of various commands to modify files, run bisync, and snapshot - listings. Output from these commands is captured to - .../workdir/test.log for comparison to the golden files. + --rc Enable the remote control server + --rc-addr stringArray IPaddress:Port or :Port to bind server to (default [localhost:5572]) + --rc-allow-origin string Origin which cross-domain request (CORS) can be executed from + --rc-baseurl string Prefix for URLs - leave blank for root + --rc-cert string TLS PEM key (concatenation of certificate and CA certificate) + --rc-client-ca string Client certificate authority to verify clients with + --rc-enable-metrics Enable prometheus metrics on /metrics + --rc-files string Path to local files to serve on the HTTP server + --rc-htpasswd string A htpasswd file - if not provided no authentication is done + --rc-job-expire-duration Duration Expire finished async jobs older than this value (default 1m0s) + --rc-job-expire-interval Duration Interval to check for expired async jobs (default 10s) + --rc-key string TLS PEM Private key + --rc-max-header-bytes int Maximum size of request header (default 4096) + --rc-min-tls-version string Minimum TLS version that is acceptable (default "tls1.0") + --rc-no-auth Don't require auth for certain methods + --rc-pass string Password for authentication + --rc-realm string Realm for authentication + --rc-salt string Password hashing salt (default "dlPL2MqE") + --rc-serve Enable the serving of remote objects + --rc-server-read-timeout Duration Timeout for server reading data (default 1h0m0s) + --rc-server-write-timeout Duration Timeout for server writing data (default 1h0m0s) + --rc-template string User-specified template + --rc-user string User name for authentication + --rc-web-fetch-url string URL to fetch the releases for webgui (default "https://api.github.com/repos/rclone/rclone-webui-react/releases/latest") + --rc-web-gui Launch WebGUI on localhost + --rc-web-gui-force-update Force update to latest version of web gui + --rc-web-gui-no-open-browser Don't open the browser automatically + --rc-web-gui-update Check and update to latest version of web gui -Supported test commands +Backend -- test Print the line to the console and to the - test.log: test sync is working correctly with options x, y, z -- copy-listings Save a copy of all .lst listings in the test - working directory with the specified prefix: - save-listings exclude-pass-run -- move-listings Similar to copy-listings but removes the - source -- purge-children This will delete all child files and purge all - child subdirs under given directory but keep the parent intact. This - behavior is important for tests with Google Drive because removing - and re-creating the parent would change its ID. -- delete-file Delete a single file. -- delete-glob Delete a group of files located one - level deep in the given directory with names matching a given glob - pattern. -- touch-glob YYYY-MM-DD Change modification time on a - group of files. -- touch-copy YYYY-MM-DD Change file - modification time then copy it to destination. -- copy-file Copy a single file to given - directory. -- copy-as Similar to above but destination - must include both directory and the new file name at destination. -- copy-dir and sync-dir Copy/sync a directory. - Equivalent of rclone copy and rclone sync. -- list-dirs Equivalent to rclone lsf -R --dirs-only -- bisync [options] Runs bisync against -remote and -remote2. +Backend only flags. These can be set in the config file also. + + --acd-auth-url string Auth server URL + --acd-client-id string OAuth Client Id + --acd-client-secret string OAuth Client Secret + --acd-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --acd-templink-threshold SizeSuffix Files >= this size will be downloaded via their tempLink (default 9Gi) + --acd-token string OAuth Access Token as a JSON blob + --acd-token-url string Token server url + --acd-upload-wait-per-gb Duration Additional time per GiB to wait after a failed complete upload to see if it appears (default 3m0s) + --alias-remote string Remote or path to alias + --azureblob-access-tier string Access tier of blob: hot, cool, cold or archive + --azureblob-account string Azure Storage Account Name + --azureblob-archive-tier-delete Delete archive tier blobs before overwriting + --azureblob-chunk-size SizeSuffix Upload chunk size (default 4Mi) + --azureblob-client-certificate-password string Password for the certificate file (optional) (obscured) + --azureblob-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key + --azureblob-client-id string The ID of the client in use + --azureblob-client-secret string One of the service principal's client secrets + --azureblob-client-send-certificate-chain Send the certificate chain when using certificate auth + --azureblob-directory-markers Upload an empty object with a trailing slash when a new directory is created + --azureblob-disable-checksum Don't store MD5 checksum with object metadata + --azureblob-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8) + --azureblob-endpoint string Endpoint for the service + --azureblob-env-auth Read credentials from runtime (environment variables, CLI or MSI) + --azureblob-key string Storage Account Shared Key + --azureblob-list-chunk int Size of blob list (default 5000) + --azureblob-msi-client-id string Object ID of the user-assigned MSI to use, if any + --azureblob-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any + --azureblob-msi-object-id string Object ID of the user-assigned MSI to use, if any + --azureblob-no-check-container If set, don't attempt to check the container exists or create it + --azureblob-no-head-object If set, do not do HEAD before GET when getting objects + --azureblob-password string The user's password (obscured) + --azureblob-public-access string Public access level of a container: blob or container + --azureblob-sas-url string SAS URL for container level access only + --azureblob-service-principal-file string Path to file containing credentials for use with a service principal + --azureblob-tenant string ID of the service principal's tenant. Also called its directory ID + --azureblob-upload-concurrency int Concurrency for multipart uploads (default 16) + --azureblob-upload-cutoff string Cutoff for switching to chunked upload (<= 256 MiB) (deprecated) + --azureblob-use-emulator Uses local storage emulator if provided as 'true' + --azureblob-use-msi Use a managed service identity to authenticate (only works in Azure) + --azureblob-username string User name (usually an email address) + --azurefiles-account string Azure Storage Account Name + --azurefiles-chunk-size SizeSuffix Upload chunk size (default 4Mi) + --azurefiles-client-certificate-password string Password for the certificate file (optional) (obscured) + --azurefiles-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key + --azurefiles-client-id string The ID of the client in use + --azurefiles-client-secret string One of the service principal's client secrets + --azurefiles-client-send-certificate-chain Send the certificate chain when using certificate auth + --azurefiles-connection-string string Azure Files Connection String + --azurefiles-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8,Dot) + --azurefiles-endpoint string Endpoint for the service + --azurefiles-env-auth Read credentials from runtime (environment variables, CLI or MSI) + --azurefiles-key string Storage Account Shared Key + --azurefiles-max-stream-size SizeSuffix Max size for streamed files (default 10Gi) + --azurefiles-msi-client-id string Object ID of the user-assigned MSI to use, if any + --azurefiles-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any + --azurefiles-msi-object-id string Object ID of the user-assigned MSI to use, if any + --azurefiles-password string The user's password (obscured) + --azurefiles-sas-url string SAS URL + --azurefiles-service-principal-file string Path to file containing credentials for use with a service principal + --azurefiles-share-name string Azure Files Share Name + --azurefiles-tenant string ID of the service principal's tenant. Also called its directory ID + --azurefiles-upload-concurrency int Concurrency for multipart uploads (default 16) + --azurefiles-use-msi Use a managed service identity to authenticate (only works in Azure) + --azurefiles-username string User name (usually an email address) + --b2-account string Account ID or Application Key ID + --b2-chunk-size SizeSuffix Upload chunk size (default 96Mi) + --b2-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4Gi) + --b2-disable-checksum Disable checksums for large (> upload cutoff) files + --b2-download-auth-duration Duration Time before the authorization token will expire in s or suffix ms|s|m|h|d (default 1w) + --b2-download-url string Custom endpoint for downloads + --b2-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --b2-endpoint string Endpoint for the service + --b2-hard-delete Permanently delete files on remote removal, otherwise hide files + --b2-key string Application Key + --b2-lifecycle int Set the number of days deleted files should be kept when creating a bucket + --b2-test-mode string A flag string for X-Bz-Test-Mode header for debugging + --b2-upload-concurrency int Concurrency for multipart uploads (default 4) + --b2-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --b2-version-at Time Show file versions as they were at the specified time (default off) + --b2-versions Include old versions in directory listings + --box-access-token string Box App Primary Access Token + --box-auth-url string Auth server URL + --box-box-config-file string Box App config.json location + --box-box-sub-type string (default "user") + --box-client-id string OAuth Client Id + --box-client-secret string OAuth Client Secret + --box-commit-retries int Max number of times to try committing a multipart file (default 100) + --box-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot) + --box-impersonate string Impersonate this user ID when using a service account + --box-list-chunk int Size of listing chunk 1-1000 (default 1000) + --box-owned-by string Only show items owned by the login (email address) passed in + --box-root-folder-id string Fill in for rclone to use a non root folder as its starting point + --box-token string OAuth Access Token as a JSON blob + --box-token-url string Token server url + --box-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (>= 50 MiB) (default 50Mi) + --cache-chunk-clean-interval Duration How often should the cache perform cleanups of the chunk storage (default 1m0s) + --cache-chunk-no-memory Disable the in-memory cache for storing chunks during streaming + --cache-chunk-path string Directory to cache chunk files (default "$HOME/.cache/rclone/cache-backend") + --cache-chunk-size SizeSuffix The size of a chunk (partial file data) (default 5Mi) + --cache-chunk-total-size SizeSuffix The total size that the chunks can take up on the local disk (default 10Gi) + --cache-db-path string Directory to store file structure metadata DB (default "$HOME/.cache/rclone/cache-backend") + --cache-db-purge Clear all the cached data for this remote on start + --cache-db-wait-time Duration How long to wait for the DB to be available - 0 is unlimited (default 1s) + --cache-info-age Duration How long to cache file structure information (directory listings, file size, times, etc.) (default 6h0m0s) + --cache-plex-insecure string Skip all certificate verification when connecting to the Plex server + --cache-plex-password string The password of the Plex user (obscured) + --cache-plex-url string The URL of the Plex server + --cache-plex-username string The username of the Plex user + --cache-read-retries int How many times to retry a read from a cache storage (default 10) + --cache-remote string Remote to cache + --cache-rps int Limits the number of requests per second to the source FS (-1 to disable) (default -1) + --cache-tmp-upload-path string Directory to keep temporary files until they are uploaded + --cache-tmp-wait-time Duration How long should files be stored in local cache before being uploaded (default 15s) + --cache-workers int How many workers should run in parallel to download chunks (default 4) + --cache-writes Cache file data on writes through the FS + --chunker-chunk-size SizeSuffix Files larger than chunk size will be split in chunks (default 2Gi) + --chunker-fail-hard Choose how chunker should handle files with missing or invalid chunks + --chunker-hash-type string Choose how chunker handles hash sums (default "md5") + --chunker-remote string Remote to chunk/unchunk + --combine-upstreams SpaceSepList Upstreams for combining + --compress-level int GZIP compression level (-2 to 9) (default -1) + --compress-mode string Compression mode (default "gzip") + --compress-ram-cache-limit SizeSuffix Some remotes don't allow the upload of files with unknown size (default 20Mi) + --compress-remote string Remote to compress + -L, --copy-links Follow symlinks and copy the pointed to item + --crypt-directory-name-encryption Option to either encrypt directory names or leave them intact (default true) + --crypt-filename-encoding string How to encode the encrypted filename to text string (default "base32") + --crypt-filename-encryption string How to encrypt the filenames (default "standard") + --crypt-no-data-encryption Option to either encrypt file data or leave it unencrypted + --crypt-pass-bad-blocks If set this will pass bad blocks through as all 0 + --crypt-password string Password or pass phrase for encryption (obscured) + --crypt-password2 string Password or pass phrase for salt (obscured) + --crypt-remote string Remote to encrypt/decrypt + --crypt-server-side-across-configs Deprecated: use --server-side-across-configs instead + --crypt-show-mapping For all files listed show how the names encrypt + --crypt-suffix string If this is set it will override the default suffix of ".bin" (default ".bin") + --drive-acknowledge-abuse Set to allow files which return cannotDownloadAbusiveFile to be downloaded + --drive-allow-import-name-change Allow the filetype to change when uploading Google docs + --drive-auth-owner-only Only consider files owned by the authenticated user + --drive-auth-url string Auth server URL + --drive-chunk-size SizeSuffix Upload chunk size (default 8Mi) + --drive-client-id string Google Application Client Id + --drive-client-secret string OAuth Client Secret + --drive-copy-shortcut-content Server side copy contents of shortcuts instead of the shortcut + --drive-disable-http2 Disable drive using http2 (default true) + --drive-encoding Encoding The encoding for the backend (default InvalidUtf8) + --drive-env-auth Get IAM credentials from runtime (environment variables or instance meta data if no env vars) + --drive-export-formats string Comma separated list of preferred formats for downloading Google docs (default "docx,xlsx,pptx,svg") + --drive-fast-list-bug-fix Work around a bug in Google Drive listing (default true) + --drive-formats string Deprecated: See export_formats + --drive-impersonate string Impersonate this user when using a service account + --drive-import-formats string Comma separated list of preferred formats for uploading Google docs + --drive-keep-revision-forever Keep new head revision of each file forever + --drive-list-chunk int Size of listing chunk 100-1000, 0 to disable (default 1000) + --drive-metadata-labels Bits Control whether labels should be read or written in metadata (default off) + --drive-metadata-owner Bits Control whether owner should be read or written in metadata (default read) + --drive-metadata-permissions Bits Control whether permissions should be read or written in metadata (default off) + --drive-pacer-burst int Number of API calls to allow without sleeping (default 100) + --drive-pacer-min-sleep Duration Minimum time to sleep between API calls (default 100ms) + --drive-resource-key string Resource key for accessing a link-shared file + --drive-root-folder-id string ID of the root folder + --drive-scope string Comma separated list of scopes that rclone should use when requesting access from drive + --drive-server-side-across-configs Deprecated: use --server-side-across-configs instead + --drive-service-account-credentials string Service Account Credentials JSON blob + --drive-service-account-file string Service Account Credentials JSON file path + --drive-shared-with-me Only show files that are shared with me + --drive-show-all-gdocs Show all Google Docs including non-exportable ones in listings + --drive-size-as-quota Show sizes as storage quota usage, not actual size + --drive-skip-checksum-gphotos Skip checksums on Google photos and videos only + --drive-skip-dangling-shortcuts If set skip dangling shortcut files + --drive-skip-gdocs Skip google documents in all listings + --drive-skip-shortcuts If set skip shortcut files + --drive-starred-only Only show files that are starred + --drive-stop-on-download-limit Make download limit errors be fatal + --drive-stop-on-upload-limit Make upload limit errors be fatal + --drive-team-drive string ID of the Shared Drive (Team Drive) + --drive-token string OAuth Access Token as a JSON blob + --drive-token-url string Token server url + --drive-trashed-only Only show files that are in the trash + --drive-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 8Mi) + --drive-use-created-date Use file created date instead of modified date + --drive-use-shared-date Use date file was shared instead of modified date + --drive-use-trash Send files to the trash instead of deleting permanently (default true) + --drive-v2-download-min-size SizeSuffix If Object's are greater, use drive v2 API to download (default off) + --dropbox-auth-url string Auth server URL + --dropbox-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) + --dropbox-batch-mode string Upload file batching sync|async|off (default "sync") + --dropbox-batch-size int Max number of files in upload batch + --dropbox-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) + --dropbox-chunk-size SizeSuffix Upload chunk size (< 150Mi) (default 48Mi) + --dropbox-client-id string OAuth Client Id + --dropbox-client-secret string OAuth Client Secret + --dropbox-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot) + --dropbox-impersonate string Impersonate this user when using a business account + --dropbox-pacer-min-sleep Duration Minimum time to sleep between API calls (default 10ms) + --dropbox-shared-files Instructs rclone to work on individual shared files + --dropbox-shared-folders Instructs rclone to work on shared folders + --dropbox-token string OAuth Access Token as a JSON blob + --dropbox-token-url string Token server url + --fichier-api-key string Your API Key, get it from https://1fichier.com/console/params.pl + --fichier-cdn Set if you wish to use CDN download links + --fichier-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot) + --fichier-file-password string If you want to download a shared file that is password protected, add this parameter (obscured) + --fichier-folder-password string If you want to list the files in a shared folder that is password protected, add this parameter (obscured) + --fichier-shared-folder string If you want to download a shared folder, add this parameter + --filefabric-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) + --filefabric-permanent-token string Permanent Authentication Token + --filefabric-root-folder-id string ID of the root folder + --filefabric-token string Session Token + --filefabric-token-expiry string Token expiry time + --filefabric-url string URL of the Enterprise File Fabric to connect to + --filefabric-version string Version read from the file fabric + --ftp-ask-password Allow asking for FTP password when needed + --ftp-close-timeout Duration Maximum time to wait for a response to close (default 1m0s) + --ftp-concurrency int Maximum number of FTP simultaneous connections, 0 for unlimited + --ftp-disable-epsv Disable using EPSV even if server advertises support + --ftp-disable-mlsd Disable using MLSD even if server advertises support + --ftp-disable-tls13 Disable TLS 1.3 (workaround for FTP servers with buggy TLS) + --ftp-disable-utf8 Disable using UTF-8 even if server advertises support + --ftp-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,RightSpace,Dot) + --ftp-explicit-tls Use Explicit FTPS (FTP over TLS) + --ftp-force-list-hidden Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD + --ftp-host string FTP host to connect to + --ftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) + --ftp-no-check-certificate Do not verify the TLS certificate of the server + --ftp-pass string FTP password (obscured) + --ftp-port int FTP port number (default 21) + --ftp-shut-timeout Duration Maximum time to wait for data connection closing status (default 1m0s) + --ftp-socks-proxy string Socks 5 proxy host + --ftp-tls Use Implicit FTPS (FTP over TLS) + --ftp-tls-cache-size int Size of TLS session cache for all control and data connections (default 32) + --ftp-user string FTP username (default "$USER") + --ftp-writing-mdtm Use MDTM to set modification time (VsFtpd quirk) + --gcs-anonymous Access public buckets and objects without credentials + --gcs-auth-url string Auth server URL + --gcs-bucket-acl string Access Control List for new buckets + --gcs-bucket-policy-only Access checks should use bucket-level IAM policies + --gcs-client-id string OAuth Client Id + --gcs-client-secret string OAuth Client Secret + --gcs-decompress If set this will decompress gzip encoded objects + --gcs-directory-markers Upload an empty object with a trailing slash when a new directory is created + --gcs-encoding Encoding The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) + --gcs-endpoint string Endpoint for the service + --gcs-env-auth Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars) + --gcs-location string Location for the newly created buckets + --gcs-no-check-bucket If set, don't attempt to check the bucket exists or create it + --gcs-object-acl string Access Control List for new objects + --gcs-project-number string Project number + --gcs-service-account-file string Service Account Credentials JSON file path + --gcs-storage-class string The storage class to use when storing objects in Google Cloud Storage + --gcs-token string OAuth Access Token as a JSON blob + --gcs-token-url string Token server url + --gcs-user-project string User project + --gphotos-auth-url string Auth server URL + --gphotos-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) + --gphotos-batch-mode string Upload file batching sync|async|off (default "sync") + --gphotos-batch-size int Max number of files in upload batch + --gphotos-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) + --gphotos-client-id string OAuth Client Id + --gphotos-client-secret string OAuth Client Secret + --gphotos-encoding Encoding The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) + --gphotos-include-archived Also view and download archived media + --gphotos-read-only Set to make the Google Photos backend read only + --gphotos-read-size Set to read the size of media items + --gphotos-start-year int Year limits the photos to be downloaded to those which are uploaded after the given year (default 2000) + --gphotos-token string OAuth Access Token as a JSON blob + --gphotos-token-url string Token server url + --hasher-auto-size SizeSuffix Auto-update checksum for files smaller than this size (disabled by default) + --hasher-hashes CommaSepList Comma separated list of supported checksum types (default md5,sha1) + --hasher-max-age Duration Maximum time to keep checksums in cache (0 = no cache, off = cache forever) (default off) + --hasher-remote string Remote to cache checksums for (e.g. myRemote:path) + --hdfs-data-transfer-protection string Kerberos data transfer protection: authentication|integrity|privacy + --hdfs-encoding Encoding The encoding for the backend (default Slash,Colon,Del,Ctl,InvalidUtf8,Dot) + --hdfs-namenode CommaSepList Hadoop name nodes and ports + --hdfs-service-principal-name string Kerberos service principal name for the namenode + --hdfs-username string Hadoop user name + --hidrive-auth-url string Auth server URL + --hidrive-chunk-size SizeSuffix Chunksize for chunked uploads (default 48Mi) + --hidrive-client-id string OAuth Client Id + --hidrive-client-secret string OAuth Client Secret + --hidrive-disable-fetching-member-count Do not fetch number of objects in directories unless it is absolutely necessary + --hidrive-encoding Encoding The encoding for the backend (default Slash,Dot) + --hidrive-endpoint string Endpoint for the service (default "https://api.hidrive.strato.com/2.1") + --hidrive-root-prefix string The root/parent folder for all paths (default "/") + --hidrive-scope-access string Access permissions that rclone should use when requesting access from HiDrive (default "rw") + --hidrive-scope-role string User-level that rclone should use when requesting access from HiDrive (default "user") + --hidrive-token string OAuth Access Token as a JSON blob + --hidrive-token-url string Token server url + --hidrive-upload-concurrency int Concurrency for chunked uploads (default 4) + --hidrive-upload-cutoff SizeSuffix Cutoff/Threshold for chunked uploads (default 96Mi) + --http-headers CommaSepList Set HTTP headers for all transactions + --http-no-head Don't use HEAD requests + --http-no-slash Set this if the site doesn't end directories with / + --http-url string URL of HTTP host to connect to + --imagekit-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Dollar,Question,Hash,Percent,BackSlash,Del,Ctl,InvalidUtf8,Dot,SquareBracket) + --imagekit-endpoint string You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-only-signed Restrict unsigned image URLs If you have configured Restrict unsigned image URLs in your dashboard settings, set this to true + --imagekit-private-key string You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-public-key string You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-upload-tags string Tags to add to the uploaded files, e.g. "tag1,tag2" + --imagekit-versions Include old versions in directory listings + --internetarchive-access-key-id string IAS3 Access Key + --internetarchive-disable-checksum Don't ask the server to test against MD5 checksum calculated by rclone (default true) + --internetarchive-encoding Encoding The encoding for the backend (default Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot) + --internetarchive-endpoint string IAS3 Endpoint (default "https://s3.us.archive.org") + --internetarchive-front-endpoint string Host of InternetArchive Frontend (default "https://archive.org") + --internetarchive-secret-access-key string IAS3 Secret Key (password) + --internetarchive-wait-archive Duration Timeout for waiting the server's processing tasks (specifically archive and book_op) to finish (default 0s) + --jottacloud-auth-url string Auth server URL + --jottacloud-client-id string OAuth Client Id + --jottacloud-client-secret string OAuth Client Secret + --jottacloud-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot) + --jottacloud-hard-delete Delete files permanently rather than putting them into the trash + --jottacloud-md5-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate the MD5 if required (default 10Mi) + --jottacloud-no-versions Avoid server side versioning by deleting files and recreating files instead of overwriting them + --jottacloud-token string OAuth Access Token as a JSON blob + --jottacloud-token-url string Token server url + --jottacloud-trashed-only Only show files that are in the trash + --jottacloud-upload-resume-limit SizeSuffix Files bigger than this can be resumed if the upload fail's (default 10Mi) + --koofr-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --koofr-endpoint string The Koofr API endpoint to use + --koofr-mountid string Mount ID of the mount to use + --koofr-password string Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password) (obscured) + --koofr-provider string Choose your storage provider + --koofr-setmtime Does the backend support setting modification time (default true) + --koofr-user string Your user name + --linkbox-token string Token from https://www.linkbox.to/admin/account + -l, --links Translate symlinks to/from regular files with a '.rclonelink' extension + --local-case-insensitive Force the filesystem to report itself as case insensitive + --local-case-sensitive Force the filesystem to report itself as case sensitive + --local-encoding Encoding The encoding for the backend (default Slash,Dot) + --local-no-check-updated Don't check to see if the files change during upload + --local-no-preallocate Disable preallocation of disk space for transferred files + --local-no-set-modtime Disable setting modtime + --local-no-sparse Disable sparse files for multi-thread downloads + --local-nounc Disable UNC (long path names) conversion on Windows + --local-unicode-normalization Apply unicode NFC normalization to paths and filenames + --local-zero-size-links Assume the Stat size of links is zero (and read them instead) (deprecated) + --mailru-auth-url string Auth server URL + --mailru-check-hash What should copy do if file checksum is mismatched or invalid (default true) + --mailru-client-id string OAuth Client Id + --mailru-client-secret string OAuth Client Secret + --mailru-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --mailru-pass string Password (obscured) + --mailru-speedup-enable Skip full upload if there is another file with same data hash (default true) + --mailru-speedup-file-patterns string Comma separated list of file name patterns eligible for speedup (put by hash) (default "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf") + --mailru-speedup-max-disk SizeSuffix This option allows you to disable speedup (put by hash) for large files (default 3Gi) + --mailru-speedup-max-memory SizeSuffix Files larger than the size given below will always be hashed on disk (default 32Mi) + --mailru-token string OAuth Access Token as a JSON blob + --mailru-token-url string Token server url + --mailru-user string User name (usually email) + --mega-debug Output more debug from Mega + --mega-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --mega-hard-delete Delete files permanently rather than putting them into the trash + --mega-pass string Password (obscured) + --mega-use-https Use HTTPS for transfers + --mega-user string User name + --netstorage-account string Set the NetStorage account name + --netstorage-host string Domain+path of NetStorage host to connect to + --netstorage-protocol string Select between HTTP or HTTPS protocol (default "https") + --netstorage-secret string Set the NetStorage account secret/G2O key for authentication (obscured) + -x, --one-file-system Don't cross filesystem boundaries (unix/macOS only) + --onedrive-access-scopes SpaceSepList Set scopes to be requested by rclone (default Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All Sites.Read.All offline_access) + --onedrive-auth-url string Auth server URL + --onedrive-av-override Allows download of files the server thinks has a virus + --onedrive-chunk-size SizeSuffix Chunk size to upload files with - must be multiple of 320k (327,680 bytes) (default 10Mi) + --onedrive-client-id string OAuth Client Id + --onedrive-client-secret string OAuth Client Secret + --onedrive-delta If set rclone will use delta listing to implement recursive listings + --onedrive-drive-id string The ID of the drive to use + --onedrive-drive-type string The type of the drive (personal | business | documentLibrary) + --onedrive-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot) + --onedrive-expose-onenote-files Set to make OneNote files show up in directory listings + --onedrive-hash-type string Specify the hash in use for the backend (default "auto") + --onedrive-link-password string Set the password for links created by the link command + --onedrive-link-scope string Set the scope of the links created by the link command (default "anonymous") + --onedrive-link-type string Set the type of the links created by the link command (default "view") + --onedrive-list-chunk int Size of listing chunk (default 1000) + --onedrive-no-versions Remove all versions on modifying operations + --onedrive-region string Choose national cloud region for OneDrive (default "global") + --onedrive-root-folder-id string ID of the root folder + --onedrive-server-side-across-configs Deprecated: use --server-side-across-configs instead + --onedrive-token string OAuth Access Token as a JSON blob + --onedrive-token-url string Token server url + --oos-attempt-resume-upload If true attempt to resume previously started multipart upload for the object + --oos-chunk-size SizeSuffix Chunk size to use for uploading (default 5Mi) + --oos-compartment string Object storage compartment OCID + --oos-config-file string Path to OCI config file (default "~/.oci/config") + --oos-config-profile string Profile name inside the oci config file (default "Default") + --oos-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) + --oos-copy-timeout Duration Timeout for copy (default 1m0s) + --oos-disable-checksum Don't store MD5 checksum with object metadata + --oos-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --oos-endpoint string Endpoint for Object storage API + --oos-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts for manual recovery + --oos-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) + --oos-namespace string Object storage namespace + --oos-no-check-bucket If set, don't attempt to check the bucket exists or create it + --oos-provider string Choose your Auth Provider (default "env_auth") + --oos-region string Object storage Region + --oos-sse-customer-algorithm string If using SSE-C, the optional header that specifies "AES256" as the encryption algorithm + --oos-sse-customer-key string To use SSE-C, the optional header that specifies the base64-encoded 256-bit encryption key to use to + --oos-sse-customer-key-file string To use SSE-C, a file containing the base64-encoded string of the AES-256 encryption key associated + --oos-sse-customer-key-sha256 string If using SSE-C, The optional header that specifies the base64-encoded SHA256 hash of the encryption + --oos-sse-kms-key-id string if using your own master key in vault, this header specifies the + --oos-storage-tier string The storage class to use when storing new objects in storage. https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/understandingstoragetiers.htm (default "Standard") + --oos-upload-concurrency int Concurrency for multipart uploads (default 10) + --oos-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --opendrive-chunk-size SizeSuffix Files will be uploaded in chunks this size (default 10Mi) + --opendrive-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot) + --opendrive-password string Password (obscured) + --opendrive-username string Username + --pcloud-auth-url string Auth server URL + --pcloud-client-id string OAuth Client Id + --pcloud-client-secret string OAuth Client Secret + --pcloud-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --pcloud-hostname string Hostname to connect to (default "api.pcloud.com") + --pcloud-password string Your pcloud password (obscured) + --pcloud-root-folder-id string Fill in for rclone to use a non root folder as its starting point (default "d0") + --pcloud-token string OAuth Access Token as a JSON blob + --pcloud-token-url string Token server url + --pcloud-username string Your pcloud username + --pikpak-auth-url string Auth server URL + --pikpak-client-id string OAuth Client Id + --pikpak-client-secret string OAuth Client Secret + --pikpak-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot) + --pikpak-hash-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate hash if required (default 10Mi) + --pikpak-pass string Pikpak password (obscured) + --pikpak-root-folder-id string ID of the root folder + --pikpak-token string OAuth Access Token as a JSON blob + --pikpak-token-url string Token server url + --pikpak-trashed-only Only show files that are in the trash + --pikpak-use-trash Send files to the trash instead of deleting permanently (default true) + --pikpak-user string Pikpak username + --premiumizeme-auth-url string Auth server URL + --premiumizeme-client-id string OAuth Client Id + --premiumizeme-client-secret string OAuth Client Secret + --premiumizeme-encoding Encoding The encoding for the backend (default Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --premiumizeme-token string OAuth Access Token as a JSON blob + --premiumizeme-token-url string Token server url + --protondrive-2fa string The 2FA code + --protondrive-app-version string The app version string (default "macos-drive@1.0.0-alpha.1+rclone") + --protondrive-enable-caching Caches the files and folders metadata to reduce API calls (default true) + --protondrive-encoding Encoding The encoding for the backend (default Slash,LeftSpace,RightSpace,InvalidUtf8,Dot) + --protondrive-mailbox-password string The mailbox password of your two-password proton account (obscured) + --protondrive-original-file-size Return the file size before encryption (default true) + --protondrive-password string The password of your proton account (obscured) + --protondrive-replace-existing-draft Create a new revision when filename conflict is detected + --protondrive-username string The username of your proton account + --putio-auth-url string Auth server URL + --putio-client-id string OAuth Client Id + --putio-client-secret string OAuth Client Secret + --putio-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --putio-token string OAuth Access Token as a JSON blob + --putio-token-url string Token server url + --qingstor-access-key-id string QingStor Access Key ID + --qingstor-chunk-size SizeSuffix Chunk size to use for uploading (default 4Mi) + --qingstor-connection-retries int Number of connection retries (default 3) + --qingstor-encoding Encoding The encoding for the backend (default Slash,Ctl,InvalidUtf8) + --qingstor-endpoint string Enter an endpoint URL to connection QingStor API + --qingstor-env-auth Get QingStor credentials from runtime + --qingstor-secret-access-key string QingStor Secret Access Key (password) + --qingstor-upload-concurrency int Concurrency for multipart uploads (default 1) + --qingstor-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --qingstor-zone string Zone to connect to + --quatrix-api-key string API key for accessing Quatrix account + --quatrix-effective-upload-time string Wanted upload time for one chunk (default "4s") + --quatrix-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --quatrix-hard-delete Delete files permanently rather than putting them into the trash + --quatrix-host string Host name of Quatrix account + --quatrix-maximal-summary-chunk-size SizeSuffix The maximal summary for all chunks. It should not be less than 'transfers'*'minimal_chunk_size' (default 95.367Mi) + --quatrix-minimal-chunk-size SizeSuffix The minimal size for one chunk (default 9.537Mi) + --s3-access-key-id string AWS Access Key ID + --s3-acl string Canned ACL used when creating buckets and storing or copying objects + --s3-bucket-acl string Canned ACL used when creating buckets + --s3-chunk-size SizeSuffix Chunk size to use for uploading (default 5Mi) + --s3-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) + --s3-decompress If set this will decompress gzip encoded objects + --s3-directory-markers Upload an empty object with a trailing slash when a new directory is created + --s3-disable-checksum Don't store MD5 checksum with object metadata + --s3-disable-http2 Disable usage of http2 for S3 backends + --s3-download-url string Custom endpoint for downloads + --s3-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --s3-endpoint string Endpoint for S3 API + --s3-env-auth Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars) + --s3-force-path-style If true use path style access if false use virtual hosted style (default true) + --s3-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery + --s3-list-chunk int Size of listing chunk (response list for each ListObject S3 request) (default 1000) + --s3-list-url-encode Tristate Whether to url encode listings: true/false/unset (default unset) + --s3-list-version int Version of ListObjects to use: 1,2 or 0 for auto + --s3-location-constraint string Location constraint - must be set to match the Region + --s3-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) + --s3-might-gzip Tristate Set this if the backend might gzip objects (default unset) + --s3-no-check-bucket If set, don't attempt to check the bucket exists or create it + --s3-no-head If set, don't HEAD uploaded objects to check integrity + --s3-no-head-object If set, do not do HEAD before GET when getting objects + --s3-no-system-metadata Suppress setting and reading of system metadata + --s3-profile string Profile to use in the shared credentials file + --s3-provider string Choose your S3 provider + --s3-region string Region to connect to + --s3-requester-pays Enables requester pays option when interacting with S3 bucket + --s3-secret-access-key string AWS Secret Access Key (password) + --s3-server-side-encryption string The server-side encryption algorithm used when storing this object in S3 + --s3-session-token string An AWS session token + --s3-shared-credentials-file string Path to the shared credentials file + --s3-sse-customer-algorithm string If using SSE-C, the server-side encryption algorithm used when storing this object in S3 + --s3-sse-customer-key string To use SSE-C you may provide the secret encryption key used to encrypt/decrypt your data + --s3-sse-customer-key-base64 string If using SSE-C you must provide the secret encryption key encoded in base64 format to encrypt/decrypt your data + --s3-sse-customer-key-md5 string If using SSE-C you may provide the secret encryption key MD5 checksum (optional) + --s3-sse-kms-key-id string If using KMS ID you must provide the ARN of Key + --s3-storage-class string The storage class to use when storing new objects in S3 + --s3-sts-endpoint string Endpoint for STS + --s3-upload-concurrency int Concurrency for multipart uploads (default 4) + --s3-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --s3-use-accelerate-endpoint If true use the AWS S3 accelerated endpoint + --s3-use-accept-encoding-gzip Accept-Encoding: gzip Whether to send Accept-Encoding: gzip header (default unset) + --s3-use-already-exists Tristate Set if rclone should report BucketAlreadyExists errors on bucket creation (default unset) + --s3-use-multipart-etag Tristate Whether to use ETag in multipart uploads for verification (default unset) + --s3-use-multipart-uploads Tristate Set if rclone should use multipart uploads (default unset) + --s3-use-presigned-request Whether to use a presigned request or PutObject for single part uploads + --s3-v2-auth If true use v2 authentication + --s3-version-at Time Show file versions as they were at the specified time (default off) + --s3-versions Include old versions in directory listings + --seafile-2fa Two-factor authentication ('true' if the account has 2FA enabled) + --seafile-create-library Should rclone create a library if it doesn't exist + --seafile-encoding Encoding The encoding for the backend (default Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8) + --seafile-library string Name of the library + --seafile-library-key string Library password (for encrypted libraries only) (obscured) + --seafile-pass string Password (obscured) + --seafile-url string URL of seafile host to connect to + --seafile-user string User name (usually email address) + --sftp-ask-password Allow asking for SFTP password when needed + --sftp-chunk-size SizeSuffix Upload and download chunk size (default 32Ki) + --sftp-ciphers SpaceSepList Space separated list of ciphers to be used for session encryption, ordered by preference + --sftp-concurrency int The maximum number of outstanding requests for one file (default 64) + --sftp-copy-is-hardlink Set to enable server side copies using hardlinks + --sftp-disable-concurrent-reads If set don't use concurrent reads + --sftp-disable-concurrent-writes If set don't use concurrent writes + --sftp-disable-hashcheck Disable the execution of SSH commands to determine if remote file hashing is available + --sftp-host string SSH host to connect to + --sftp-host-key-algorithms SpaceSepList Space separated list of host key algorithms, ordered by preference + --sftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) + --sftp-key-exchange SpaceSepList Space separated list of key exchange algorithms, ordered by preference + --sftp-key-file string Path to PEM-encoded private key file + --sftp-key-file-pass string The passphrase to decrypt the PEM-encoded private key file (obscured) + --sftp-key-pem string Raw PEM-encoded private key + --sftp-key-use-agent When set forces the usage of the ssh-agent + --sftp-known-hosts-file string Optional path to known_hosts file + --sftp-macs SpaceSepList Space separated list of MACs (message authentication code) algorithms, ordered by preference + --sftp-md5sum-command string The command used to read md5 hashes + --sftp-pass string SSH password, leave blank to use ssh-agent (obscured) + --sftp-path-override string Override path used by SSH shell commands + --sftp-port int SSH port number (default 22) + --sftp-pubkey-file string Optional path to public key file + --sftp-server-command string Specifies the path or command to run a sftp server on the remote host + --sftp-set-env SpaceSepList Environment variables to pass to sftp and commands + --sftp-set-modtime Set the modified time on the remote if set (default true) + --sftp-sha1sum-command string The command used to read sha1 hashes + --sftp-shell-type string The type of SSH shell on remote server, if any + --sftp-skip-links Set to skip any symlinks and any other non regular files + --sftp-socks-proxy string Socks 5 proxy host + --sftp-ssh SpaceSepList Path and arguments to external ssh binary + --sftp-subsystem string Specifies the SSH2 subsystem on the remote host (default "sftp") + --sftp-use-fstat If set use fstat instead of stat + --sftp-use-insecure-cipher Enable the use of insecure ciphers and key exchange methods + --sftp-user string SSH username (default "$USER") + --sharefile-auth-url string Auth server URL + --sharefile-chunk-size SizeSuffix Upload chunk size (default 64Mi) + --sharefile-client-id string OAuth Client Id + --sharefile-client-secret string OAuth Client Secret + --sharefile-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot) + --sharefile-endpoint string Endpoint for API calls + --sharefile-root-folder-id string ID of the root folder + --sharefile-token string OAuth Access Token as a JSON blob + --sharefile-token-url string Token server url + --sharefile-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (default 128Mi) + --sia-api-password string Sia Daemon API Password (obscured) + --sia-api-url string Sia daemon API URL, like http://sia.daemon.host:9980 (default "http://127.0.0.1:9980") + --sia-encoding Encoding The encoding for the backend (default Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot) + --sia-user-agent string Siad User Agent (default "Sia-Agent") + --skip-links Don't warn about skipped symlinks + --smb-case-insensitive Whether the server is configured to be case-insensitive (default true) + --smb-domain string Domain name for NTLM authentication (default "WORKGROUP") + --smb-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot) + --smb-hide-special-share Hide special shares (e.g. print$) which users aren't supposed to access (default true) + --smb-host string SMB server hostname to connect to + --smb-idle-timeout Duration Max time before closing idle connections (default 1m0s) + --smb-pass string SMB password (obscured) + --smb-port int SMB port number (default 445) + --smb-spn string Service principal name + --smb-user string SMB username (default "$USER") + --storj-access-grant string Access grant + --storj-api-key string API key + --storj-passphrase string Encryption passphrase + --storj-provider string Choose an authentication method (default "existing") + --storj-satellite-address string Satellite address (default "us1.storj.io") + --sugarsync-access-key-id string Sugarsync Access Key ID + --sugarsync-app-id string Sugarsync App ID + --sugarsync-authorization string Sugarsync authorization + --sugarsync-authorization-expiry string Sugarsync authorization expiry + --sugarsync-deleted-id string Sugarsync deleted folder id + --sugarsync-encoding Encoding The encoding for the backend (default Slash,Ctl,InvalidUtf8,Dot) + --sugarsync-hard-delete Permanently delete files if true + --sugarsync-private-access-key string Sugarsync Private Access Key + --sugarsync-refresh-token string Sugarsync refresh token + --sugarsync-root-id string Sugarsync root id + --sugarsync-user string Sugarsync user + --swift-application-credential-id string Application Credential ID (OS_APPLICATION_CREDENTIAL_ID) + --swift-application-credential-name string Application Credential Name (OS_APPLICATION_CREDENTIAL_NAME) + --swift-application-credential-secret string Application Credential Secret (OS_APPLICATION_CREDENTIAL_SECRET) + --swift-auth string Authentication URL for server (OS_AUTH_URL) + --swift-auth-token string Auth Token from alternate authentication - optional (OS_AUTH_TOKEN) + --swift-auth-version int AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION) + --swift-chunk-size SizeSuffix Above this size files will be chunked into a _segments container (default 5Gi) + --swift-domain string User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME) + --swift-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8) + --swift-endpoint-type string Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE) (default "public") + --swift-env-auth Get swift credentials from environment variables in standard OpenStack form + --swift-key string API key or password (OS_PASSWORD) + --swift-leave-parts-on-error If true avoid calling abort upload on a failure + --swift-no-chunk Don't chunk files during streaming upload + --swift-no-large-objects Disable support for static and dynamic large objects + --swift-region string Region name - optional (OS_REGION_NAME) + --swift-storage-policy string The storage policy to use when creating a new container + --swift-storage-url string Storage URL - optional (OS_STORAGE_URL) + --swift-tenant string Tenant name - optional for v1 auth, this or tenant_id required otherwise (OS_TENANT_NAME or OS_PROJECT_NAME) + --swift-tenant-domain string Tenant domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME) + --swift-tenant-id string Tenant ID - optional for v1 auth, this or tenant required otherwise (OS_TENANT_ID) + --swift-user string User name to log in (OS_USERNAME) + --swift-user-id string User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) (OS_USER_ID) + --union-action-policy string Policy to choose upstream on ACTION category (default "epall") + --union-cache-time int Cache time of usage and free space (in seconds) (default 120) + --union-create-policy string Policy to choose upstream on CREATE category (default "epmfs") + --union-min-free-space SizeSuffix Minimum viable free space for lfs/eplfs policies (default 1Gi) + --union-search-policy string Policy to choose upstream on SEARCH category (default "ff") + --union-upstreams string List of space separated upstreams + --uptobox-access-token string Your access token + --uptobox-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot) + --uptobox-private Set to make uploaded files private + --webdav-bearer-token string Bearer token instead of user/pass (e.g. a Macaroon) + --webdav-bearer-token-command string Command to run to get a bearer token + --webdav-encoding string The encoding for the backend + --webdav-headers CommaSepList Set HTTP headers for all transactions + --webdav-nextcloud-chunk-size SizeSuffix Nextcloud upload chunk size (default 10Mi) + --webdav-pacer-min-sleep Duration Minimum time to sleep between API calls (default 10ms) + --webdav-pass string Password (obscured) + --webdav-url string URL of http host to connect to + --webdav-user string User name + --webdav-vendor string Name of the WebDAV site/service/software you are using + --yandex-auth-url string Auth server URL + --yandex-client-id string OAuth Client Id + --yandex-client-secret string OAuth Client Secret + --yandex-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) + --yandex-hard-delete Delete files permanently rather than putting them into the trash + --yandex-token string OAuth Access Token as a JSON blob + --yandex-token-url string Token server url + --zoho-auth-url string Auth server URL + --zoho-client-id string OAuth Client Id + --zoho-client-secret string OAuth Client Secret + --zoho-encoding Encoding The encoding for the backend (default Del,Ctl,InvalidUtf8) + --zoho-region string Zoho region to connect to + --zoho-token string OAuth Access Token as a JSON blob + --zoho-token-url string Token server url + +Docker Volume Plugin + +Introduction + +Docker 1.9 has added support for creating named volumes via command-line +interface and mounting them in containers as a way to share data between +them. Since Docker 1.10 you can create named volumes with Docker Compose +by descriptions in docker-compose.yml files for use by container groups +on a single host. As of Docker 1.12 volumes are supported by Docker +Swarm included with Docker Engine and created from descriptions in swarm +compose v3 files for use with swarm stacks across multiple cluster +nodes. + +Docker Volume Plugins augment the default local volume driver included +in Docker with stateful volumes shared across containers and hosts. +Unlike local volumes, your data will not be deleted when such volume is +removed. Plugins can run managed by the docker daemon, as a native +system service (under systemd, sysv or upstart) or as a standalone +executable. Rclone can run as docker volume plugin in all these modes. +It interacts with the local docker daemon via plugin API and handles +mounting of remote file systems into docker containers so it must run on +the same host as the docker daemon or on every Swarm node. + +Getting started + +In the first example we will use the SFTP rclone volume with Docker +engine on a standalone Ubuntu machine. + +Start from installing Docker on the host. + +The FUSE driver is a prerequisite for rclone mounting and should be +installed on host: + + sudo apt-get -y install fuse + +Create two directories required by rclone docker plugin: + + sudo mkdir -p /var/lib/docker-plugins/rclone/config + sudo mkdir -p /var/lib/docker-plugins/rclone/cache + +Install the managed rclone docker plugin for your architecture (here +amd64): + + docker plugin install rclone/docker-volume-rclone:amd64 args="-v" --alias rclone --grant-all-permissions + docker plugin list + +Create your SFTP volume: + + docker volume create firstvolume -d rclone -o type=sftp -o sftp-host=_hostname_ -o sftp-user=_username_ -o sftp-pass=_password_ -o allow-other=true + +Note that since all options are static, you don't even have to run +rclone config or create the rclone.conf file (but the config directory +should still be present). In the simplest case you can use localhost as +hostname and your SSH credentials as username and password. You can also +change the remote path to your home directory on the host, for example +-o path=/home/username. + +Time to create a test container and mount the volume into it: + + docker run --rm -it -v firstvolume:/mnt --workdir /mnt ubuntu:latest bash + +If all goes well, you will enter the new container and change right to +the mounted SFTP remote. You can type ls to list the mounted directory +or otherwise play with it. Type exit when you are done. The container +will stop but the volume will stay, ready to be reused. When it's not +needed anymore, remove it: + + docker volume list + docker volume remove firstvolume + +Now let us try something more elaborate: Google Drive volume on +multi-node Docker Swarm. + +You should start from installing Docker and FUSE, creating plugin +directories and installing rclone plugin on every swarm node. Then setup +the Swarm. + +Google Drive volumes need an access token which can be setup via web +browser and will be periodically renewed by rclone. The managed plugin +cannot run a browser so we will use a technique similar to the rclone +setup on a headless box. + +Run rclone config on another machine equipped with web browser and +graphical user interface. Create the Google Drive remote. When done, +transfer the resulting rclone.conf to the Swarm cluster and save as +/var/lib/docker-plugins/rclone/config/rclone.conf on every node. By +default this location is accessible only to the root user so you will +need appropriate privileges. The resulting config will look like this: + + [gdrive] + type = drive + scope = drive + drive_id = 1234567... + root_folder_id = 0Abcd... + token = {"access_token":...} + +Now create the file named example.yml with a swarm stack description +like this: + + version: '3' + services: + heimdall: + image: linuxserver/heimdall:latest + ports: [8080:80] + volumes: [configdata:/config] + volumes: + configdata: + driver: rclone + driver_opts: + remote: 'gdrive:heimdall' + allow_other: 'true' + vfs_cache_mode: full + poll_interval: 0 + +and run the stack: + + docker stack deploy example -c ./example.yml + +After a few seconds docker will spread the parsed stack description over +cluster, create the example_heimdall service on port 8080, run service +containers on one or more cluster nodes and request the +example_configdata volume from rclone plugins on the node hosts. You can +use the following commands to confirm results: + + docker service ls + docker service ps example_heimdall + docker volume ls + +Point your browser to http://cluster.host.address:8080 and play with the +service. Stop it with docker stack remove example when you are done. +Note that the example_configdata volume(s) created on demand at the +cluster nodes will not be automatically removed together with the stack +but stay for future reuse. You can remove them manually by invoking the +docker volume remove example_configdata command on every node. + +Creating Volumes via CLI + +Volumes can be created with docker volume create. Here are a few +examples: + + docker volume create vol1 -d rclone -o remote=storj: -o vfs-cache-mode=full + docker volume create vol2 -d rclone -o remote=:storj,access_grant=xxx:heimdall + docker volume create vol3 -d rclone -o type=storj -o path=heimdall -o storj-access-grant=xxx -o poll-interval=0 + +Note the -d rclone flag that tells docker to request volume from the +rclone driver. This works even if you installed managed driver by its +full name rclone/docker-volume-rclone because you provided the +--alias rclone option. + +Volumes can be inspected as follows: + + docker volume list + docker volume inspect vol1 + +Volume Configuration + +Rclone flags and volume options are set via the -o flag to the +docker volume create command. They include backend-specific parameters +as well as mount and VFS options. Also there are a few special -o +options: remote, fs, type, path, mount-type and persist. + +remote determines an existing remote name from the config file, with +trailing colon and optionally with a remote path. See the full syntax in +the rclone documentation. This option can be aliased as fs to prevent +confusion with the remote parameter of such backends as crypt or alias. + +The remote=:backend:dir/subdir syntax can be used to create on-the-fly +(config-less) remotes, while the type and path options provide a simpler +alternative for this. Using two split options + + -o type=backend -o path=dir/subdir + +is equivalent to the combined syntax + + -o remote=:backend:dir/subdir + +but is arguably easier to parameterize in scripts. The path part is +optional. + +Mount and VFS options as well as backend parameters are named like their +twin command-line flags without the -- CLI prefix. Optionally you can +use underscores instead of dashes in option names. For example, +--vfs-cache-mode full becomes -o vfs-cache-mode=full or +-o vfs_cache_mode=full. Boolean CLI flags without value will gain the +true value, e.g. --allow-other becomes -o allow-other=true or +-o allow_other=true. + +Please note that you can provide parameters only for the backend +immediately referenced by the backend type of mounted remote. If this is +a wrapping backend like alias, chunker or crypt, you cannot provide +options for the referred to remote or backend. This limitation is +imposed by the rclone connection string parser. The only workaround is +to feed plugin with rclone.conf or configure plugin arguments (see +below). + +Special Volume Options + +mount-type determines the mount method and in general can be one of: +mount, cmount, or mount2. This can be aliased as mount_type. It should +be noted that the managed rclone docker plugin currently does not +support the cmount method and mount2 is rarely needed. This option +defaults to the first found method, which is usually mount so you +generally won't need it. + +persist is a reserved boolean (true/false) option. In future it will +allow to persist on-the-fly remotes in the plugin rclone.conf file. + +Connection Strings + +The remote value can be extended with connection strings as an +alternative way to supply backend parameters. This is equivalent to the +-o backend options with one syntactic difference. Inside connection +string the backend prefix must be dropped from parameter names but in +the -o param=value array it must be present. For instance, compare the +following option array + + -o remote=:sftp:/home -o sftp-host=localhost + +with equivalent connection string: + + -o remote=:sftp,host=localhost:/home + +This difference exists because flag options -o key=val include not only +backend parameters but also mount/VFS flags and possibly other settings. +Also it allows to discriminate the remote option from the crypt-remote +(or similarly named backend parameters) and arguably simplifies +scripting due to clearer value substitution. + +Using with Swarm or Compose + +Both Docker Swarm and Docker Compose use YAML-formatted text files to +describe groups (stacks) of containers, their properties, networks and +volumes. Compose uses the compose v2 format, Swarm uses the compose v3 +format. They are mostly similar, differences are explained in the docker +documentation. + +Volumes are described by the children of the top-level volumes: node. +Each of them should be named after its volume and have at least two +elements, the self-explanatory driver: rclone value and the driver_opts: +structure playing the same role as -o key=val CLI flags: + + volumes: + volume_name_1: + driver: rclone + driver_opts: + remote: 'gdrive:' + allow_other: 'true' + vfs_cache_mode: full + token: '{"type": "borrower", "expires": "2021-12-31"}' + poll_interval: 0 + +Notice a few important details: - YAML prefers _ in option names instead +of -. - YAML treats single and double quotes interchangeably. Simple +strings and integers can be left unquoted. - Boolean values must be +quoted like 'true' or "false" because these two words are reserved by +YAML. - The filesystem string is keyed with remote (or with fs). +Normally you can omit quotes here, but if the string ends with colon, +you must quote it like remote: "storage_box:". - YAML is picky about +surrounding braces in values as this is in fact another syntax for +key/value mappings. For example, JSON access tokens usually contain +double quotes and surrounding braces, so you must put them in single +quotes. + +Installing as Managed Plugin + +Docker daemon can install plugins from an image registry and run them +managed. We maintain the docker-volume-rclone plugin image on Docker +Hub. + +Rclone volume plugin requires Docker Engine >= 19.03.15 + +The plugin requires presence of two directories on the host before it +can be installed. Note that plugin will not create them automatically. +By default they must exist on host at the following locations (though +you can tweak the paths): - /var/lib/docker-plugins/rclone/config is +reserved for the rclone.conf config file and must exist even if it's +empty and the config file is not present. - +/var/lib/docker-plugins/rclone/cache holds the plugin state file as well +as optional VFS caches. + +You can install managed plugin with default settings as follows: + + docker plugin install rclone/docker-volume-rclone:amd64 --grant-all-permissions --alias rclone + +The :amd64 part of the image specification after colon is called a tag. +Usually you will want to install the latest plugin for your +architecture. In this case the tag will just name it, like amd64 above. +The following plugin architectures are currently available: - amd64 - +arm64 - arm-v7 + +Sometimes you might want a concrete plugin version, not the latest one. +Then you should use image tag in the form :ARCHITECTURE-VERSION. For +example, to install plugin version v1.56.2 on architecture arm64 you +will use tag arm64-1.56.2 (note the removed v) so the full image +specification becomes rclone/docker-volume-rclone:arm64-1.56.2. + +We also provide the latest plugin tag, but since docker does not support +multi-architecture plugins as of the time of this writing, this tag is +currently an alias for amd64. By convention the latest tag is the +default one and can be omitted, thus both +rclone/docker-volume-rclone:latest and just rclone/docker-volume-rclone +will refer to the latest plugin release for the amd64 platform. + +Also the amd64 part can be omitted from the versioned rclone plugin +tags. For example, rclone image reference +rclone/docker-volume-rclone:amd64-1.56.2 can be abbreviated as +rclone/docker-volume-rclone:1.56.2 for convenience. However, for +non-intel architectures you still have to use the full tag as amd64 or +latest will fail to start. + +Managed plugin is in fact a special container running in a namespace +separate from normal docker containers. Inside it runs the +rclone serve docker command. The config and cache directories are +bind-mounted into the container at start. The docker daemon connects to +a unix socket created by the command inside the container. The command +creates on-demand remote mounts right inside, then docker machinery +propagates them through kernel mount namespaces and bind-mounts into +requesting user containers. + +You can tweak a few plugin settings after installation when it's +disabled (not in use), for instance: + + docker plugin disable rclone + docker plugin set rclone RCLONE_VERBOSE=2 config=/etc/rclone args="--vfs-cache-mode=writes --allow-other" + docker plugin enable rclone + docker plugin inspect rclone + +Note that if docker refuses to disable the plugin, you should find and +remove all active volumes connected with it as well as containers and +swarm services that use them. This is rather tedious so please carefully +plan in advance. + +You can tweak the following settings: args, config, cache, HTTP_PROXY, +HTTPS_PROXY, NO_PROXY and RCLONE_VERBOSE. It's your task to keep plugin +settings in sync across swarm cluster nodes. + +args sets command-line arguments for the rclone serve docker command +(none by default). Arguments should be separated by space so you will +normally want to put them in quotes on the docker plugin set command +line. Both serve docker flags and generic rclone flags are supported, +including backend parameters that will be used as defaults for volume +creation. Note that plugin will fail (due to this docker bug) if the +args value is empty. Use e.g. args="-v" as a workaround. + +config=/host/dir sets alternative host location for the config +directory. Plugin will look for rclone.conf here. It's not an error if +the config file is not present but the directory must exist. Please note +that plugin can periodically rewrite the config file, for example when +it renews storage access tokens. Keep this in mind and try to avoid +races between the plugin and other instances of rclone on the host that +might try to change the config simultaneously resulting in corrupted +rclone.conf. You can also put stuff like private key files for SFTP +remotes in this directory. Just note that it's bind-mounted inside the +plugin container at the predefined path /data/config. For example, if +your key file is named sftp-box1.key on the host, the corresponding +volume config option should read +-o sftp-key-file=/data/config/sftp-box1.key. + +cache=/host/dir sets alternative host location for the cache directory. +The plugin will keep VFS caches here. Also it will create and maintain +the docker-plugin.state file in this directory. When the plugin is +restarted or reinstalled, it will look in this file to recreate any +volumes that existed previously. However, they will not be re-mounted +into consuming containers after restart. Usually this is not a problem +as the docker daemon normally will restart affected user containers +after failures, daemon restarts or host reboots. + +RCLONE_VERBOSE sets plugin verbosity from 0 (errors only, by default) to +2 (debugging). Verbosity can be also tweaked via args="-v [-v] ...". +Since arguments are more generic, you will rarely need this setting. The +plugin output by default feeds the docker daemon log on local host. Log +entries are reflected as errors in the docker log but retain their +actual level assigned by rclone in the encapsulated message string. + +HTTP_PROXY, HTTPS_PROXY, NO_PROXY customize the plugin proxy settings. + +You can set custom plugin options right when you install it, in one go: + + docker plugin remove rclone + docker plugin install rclone/docker-volume-rclone:amd64 \ + --alias rclone --grant-all-permissions \ + args="-v --allow-other" config=/etc/rclone + docker plugin inspect rclone + +Healthchecks + +The docker plugin volume protocol doesn't provide a way for plugins to +inform the docker daemon that a volume is (un-)available. As a +workaround you can setup a healthcheck to verify that the mount is +responding, for example: + + services: + my_service: + image: my_image + healthcheck: + test: ls /path/to/rclone/mount || exit 1 + interval: 1m + timeout: 15s + retries: 3 + start_period: 15s + +Running Plugin under Systemd + +In most cases you should prefer managed mode. Moreover, MacOS and +Windows do not support native Docker plugins. Please use managed mode on +these systems. Proceed further only if you are on Linux. + +First, install rclone. You can just run it (type rclone serve docker and +hit enter) for the test. + +Install FUSE: + + sudo apt-get -y install fuse + +Download two systemd configuration files: docker-volume-rclone.service +and docker-volume-rclone.socket. + +Put them to the /etc/systemd/system/ directory: + + cp docker-volume-plugin.service /etc/systemd/system/ + cp docker-volume-plugin.socket /etc/systemd/system/ + +Please note that all commands in this section must be run as root but we +omit sudo prefix for brevity. Now create directories required by the +service: + + mkdir -p /var/lib/docker-volumes/rclone + mkdir -p /var/lib/docker-plugins/rclone/config + mkdir -p /var/lib/docker-plugins/rclone/cache + +Run the docker plugin service in the socket activated mode: + + systemctl daemon-reload + systemctl start docker-volume-rclone.service + systemctl enable docker-volume-rclone.socket + systemctl start docker-volume-rclone.socket + systemctl restart docker + +Or run the service directly: - run systemctl daemon-reload to let +systemd pick up new config - run +systemctl enable docker-volume-rclone.service to make the new service +start automatically when you power on your machine. - run +systemctl start docker-volume-rclone.service to start the service now. - +run systemctl restart docker to restart docker daemon and let it detect +the new plugin socket. Note that this step is not needed in managed mode +where docker knows about plugin state changes. + +The two methods are equivalent from the user perspective, but I +personally prefer socket activation. + +Troubleshooting + +You can see managed plugin settings with + + docker plugin list + docker plugin inspect rclone + +Note that docker (including latest 20.10.7) will not show actual values +of args, just the defaults. + +Use journalctl --unit docker to see managed plugin output as part of the +docker daemon log. Note that docker reflects plugin lines as errors but +their actual level can be seen from encapsulated message string. + +You will usually install the latest version of managed plugin for your +platform. Use the following commands to print the actual installed +version: + + PLUGID=$(docker plugin list --no-trunc | awk '/rclone/{print$1}') + sudo runc --root /run/docker/runtime-runc/plugins.moby exec $PLUGID rclone version + +You can even use runc to run shell inside the plugin container: + + sudo runc --root /run/docker/runtime-runc/plugins.moby exec --tty $PLUGID bash + +Also you can use curl to check the plugin socket connectivity: + + docker plugin list --no-trunc + PLUGID=123abc... + sudo curl -H Content-Type:application/json -XPOST -d {} --unix-socket /run/docker/plugins/$PLUGID/rclone.sock http://localhost/Plugin.Activate + +though this is rarely needed. + +Caveats + +Finally I'd like to mention a caveat with updating volume settings. +Docker CLI does not have a dedicated command like docker volume update. +It may be tempting to invoke docker volume create with updated options +on existing volume, but there is a gotcha. The command will do nothing, +it won't even return an error. I hope that docker maintainers will fix +this some day. In the meantime be aware that you must remove your volume +before recreating it with new settings: + + docker volume remove my_vol + docker volume create my_vol -d rclone -o opt1=new_val1 ... + +and verify that settings did update: + + docker volume list + docker volume inspect my_vol + +If docker refuses to remove the volume, you should find containers or +swarm services that use it and stop them first. + +Getting started + +- Install rclone and setup your remotes. +- Bisync will create its working directory at ~/.cache/rclone/bisync + on Linux or C:\Users\MyLogin\AppData\Local\rclone\bisync on Windows. + Make sure that this location is writable. +- Run bisync with the --resync flag, specifying the paths to the local + and remote sync directory roots. +- For successive sync runs, leave off the --resync flag. +- Consider using a filters file for excluding unnecessary files and + directories from the sync. +- Consider setting up the --check-access feature for safety. +- On Linux, consider setting up a crontab entry. bisync can safely run + in concurrent cron jobs thanks to lock files it maintains. + +Here is a typical run log (with timestamps removed for clarity): + + rclone bisync /testdir/path1/ /testdir/path2/ --verbose + INFO : Synching Path1 "/testdir/path1/" with Path2 "/testdir/path2/" + INFO : Path1 checking for diffs + INFO : - Path1 File is new - file11.txt + INFO : - Path1 File is newer - file2.txt + INFO : - Path1 File is newer - file5.txt + INFO : - Path1 File is newer - file7.txt + INFO : - Path1 File was deleted - file4.txt + INFO : - Path1 File was deleted - file6.txt + INFO : - Path1 File was deleted - file8.txt + INFO : Path1: 7 changes: 1 new, 3 newer, 0 older, 3 deleted + INFO : Path2 checking for diffs + INFO : - Path2 File is new - file10.txt + INFO : - Path2 File is newer - file1.txt + INFO : - Path2 File is newer - file5.txt + INFO : - Path2 File is newer - file6.txt + INFO : - Path2 File was deleted - file3.txt + INFO : - Path2 File was deleted - file7.txt + INFO : - Path2 File was deleted - file8.txt + INFO : Path2: 7 changes: 1 new, 3 newer, 0 older, 3 deleted + INFO : Applying changes + INFO : - Path1 Queue copy to Path2 - /testdir/path2/file11.txt + INFO : - Path1 Queue copy to Path2 - /testdir/path2/file2.txt + INFO : - Path2 Queue delete - /testdir/path2/file4.txt + NOTICE: - WARNING New or changed in both paths - file5.txt + NOTICE: - Path1 Renaming Path1 copy - /testdir/path1/file5.txt..path1 + NOTICE: - Path1 Queue copy to Path2 - /testdir/path2/file5.txt..path1 + NOTICE: - Path2 Renaming Path2 copy - /testdir/path2/file5.txt..path2 + NOTICE: - Path2 Queue copy to Path1 - /testdir/path1/file5.txt..path2 + INFO : - Path2 Queue copy to Path1 - /testdir/path1/file6.txt + INFO : - Path1 Queue copy to Path2 - /testdir/path2/file7.txt + INFO : - Path2 Queue copy to Path1 - /testdir/path1/file1.txt + INFO : - Path2 Queue copy to Path1 - /testdir/path1/file10.txt + INFO : - Path1 Queue delete - /testdir/path1/file3.txt + INFO : - Path2 Do queued copies to - Path1 + INFO : - Path1 Do queued copies to - Path2 + INFO : - Do queued deletes on - Path1 + INFO : - Do queued deletes on - Path2 + INFO : Updating listings + INFO : Validating listings for Path1 "/testdir/path1/" vs Path2 "/testdir/path2/" + INFO : Bisync successful + +Command line syntax + + $ rclone bisync --help + Usage: + rclone bisync remote1:path1 remote2:path2 [flags] + + Positional arguments: + Path1, Path2 Local path, or remote storage with ':' plus optional path. + Type 'rclone listremotes' for list of configured remotes. + + Optional Flags: + --check-access Ensure expected `RCLONE_TEST` files are found on + both Path1 and Path2 filesystems, else abort. + --check-filename FILENAME Filename for `--check-access` (default: `RCLONE_TEST`) + --check-sync CHOICE Controls comparison of final listings: + `true | false | only` (default: true) + If set to `only`, bisync will only compare listings + from the last run but skip actual sync. + --filters-file PATH Read filtering patterns from a file + --max-delete PERCENT Safety check on maximum percentage of deleted files allowed. + If exceeded, the bisync run will abort. (default: 50%) + --force Bypass `--max-delete` safety check and run the sync. + Consider using with `--verbose` + --create-empty-src-dirs Sync creation and deletion of empty directories. + (Not compatible with --remove-empty-dirs) + --remove-empty-dirs Remove empty directories at the final cleanup step. + -1, --resync Performs the resync run. + Warning: Path1 files may overwrite Path2 versions. + Consider using `--verbose` or `--dry-run` first. + --ignore-listing-checksum Do not use checksums for listings + (add --ignore-checksum to additionally skip post-copy checksum checks) + --resilient Allow future runs to retry after certain less-serious errors, + instead of requiring --resync. Use at your own risk! + --localtime Use local time in listings (default: UTC) + --no-cleanup Retain working files (useful for troubleshooting and testing). + --workdir PATH Use custom working directory (useful for testing). + (default: `~/.cache/rclone/bisync`) + -n, --dry-run Go through the motions - No files are copied/deleted. + -v, --verbose Increases logging verbosity. + May be specified more than once for more details. + -h, --help help for bisync + +Arbitrary rclone flags may be specified on the bisync command line, for +example +rclone bisync ./testdir/path1/ gdrive:testdir/path2/ --drive-skip-gdocs -v -v --timeout 10s +Note that interactions of various rclone flags with bisync process flow +has not been fully tested yet. + +Paths + +Path1 and Path2 arguments may be references to any mix of local +directory paths (absolute or relative), UNC paths (//server/share/path), +Windows drive paths (with a drive letter and :) or configured remotes +with optional subdirectory paths. Cloud references are distinguished by +having a : in the argument (see Windows support below). + +Path1 and Path2 are treated equally, in that neither has priority for +file changes (except during --resync), and access efficiency does not +change whether a remote is on Path1 or Path2. + +The listings in bisync working directory (default: +~/.cache/rclone/bisync) are named based on the Path1 and Path2 arguments +so that separate syncs to individual directories within the tree may be +set up, e.g.: path_to_local_tree..dropbox_subdir.lst. + +Any empty directories after the sync on both the Path1 and Path2 +filesystems are not deleted by default, unless --create-empty-src-dirs +is specified. If the --remove-empty-dirs flag is specified, then both +paths will have ALL empty directories purged as the last step in the +process. + +Command-line flags + +--resync + +This will effectively make both Path1 and Path2 filesystems contain a +matching superset of all files. Path2 files that do not exist in Path1 +will be copied to Path1, and the process will then copy the Path1 tree +to Path2. + +The --resync sequence is roughly equivalent to: + + rclone copy Path2 Path1 --ignore-existing + rclone copy Path1 Path2 + +Or, if using --create-empty-src-dirs: + + rclone copy Path2 Path1 --ignore-existing + rclone copy Path1 Path2 --create-empty-src-dirs + rclone copy Path2 Path1 --create-empty-src-dirs + +The base directories on both Path1 and Path2 filesystems must exist or +bisync will fail. This is required for safety - that bisync can verify +that both paths are valid. + +When using --resync, a newer version of a file on the Path2 filesystem +will be overwritten by the Path1 filesystem version. (Note that this is +NOT entirely symmetrical.) Carefully evaluate deltas using --dry-run. + +For a resync run, one of the paths may be empty (no files in the path +tree). The resync run should result in files on both paths, else a +normal non-resync run will fail. + +For a non-resync run, either path being empty (no files in the tree) +fails with +Empty current PathN listing. Cannot sync to an empty directory: X.pathN.lst +This is a safety check that an unexpected empty path does not result in +deleting everything in the other path. + +--check-access + +Access check files are an additional safety measure against data loss. +bisync will ensure it can find matching RCLONE_TEST files in the same +places in the Path1 and Path2 filesystems. RCLONE_TEST files are not +generated automatically. For --check-access to succeed, you must first +either: A) Place one or more RCLONE_TEST files in both systems, or B) +Set --check-filename to a filename already in use in various locations +throughout your sync'd fileset. Recommended methods for A) include: * +rclone touch Path1/RCLONE_TEST (create a new file) * +rclone copyto Path1/RCLONE_TEST Path2/RCLONE_TEST (copy an existing +file) * +rclone copy Path1/RCLONE_TEST Path2/RCLONE_TEST --include "RCLONE_TEST" +(copy multiple files at once, recursively) * create the files manually +(outside of rclone) * run bisync once without --check-access to set +matching files on both filesystems will also work, but is not preferred, +due to potential for user error (you are temporarily disabling the +safety feature). + +Note that --check-access is still enforced on --resync, so +bisync --resync --check-access will not work as a method of initially +setting the files (this is to ensure that bisync can't inadvertently +circumvent its own safety switch.) + +Time stamps and file contents for RCLONE_TEST files are not important, +just the names and locations. If you have symbolic links in your sync +tree it is recommended to place RCLONE_TEST files in the linked-to +directory tree to protect against bisync assuming a bunch of deleted +files if the linked-to tree should not be accessible. See also the +--check-filename flag. + +--check-filename + +Name of the file(s) used in access health validation. The default +--check-filename is RCLONE_TEST. One or more files having this filename +must exist, synchronized between your source and destination filesets, +in order for --check-access to succeed. See --check-access for +additional details. + +--max-delete + +As a safety check, if greater than the --max-delete percent of files +were deleted on either the Path1 or Path2 filesystem, then bisync will +abort with a warning message, without making any changes. The default +--max-delete is 50%. One way to trigger this limit is to rename a +directory that contains more than half of your files. This will appear +to bisync as a bunch of deleted files and a bunch of new files. This +safety check is intended to block bisync from deleting all of the files +on both filesystems due to a temporary network access issue, or if the +user had inadvertently deleted the files on one side or the other. To +force the sync, either set a different delete percentage limit, e.g. +--max-delete 75 (allows up to 75% deletion), or use --force to bypass +the check. + +Also see the all files changed check. + +--filters-file + +By using rclone filter features you can exclude file types or directory +sub-trees from the sync. See the bisync filters section and generic +--filter-from documentation. An example filters file contains filters +for non-allowed files for synching with Dropbox. + +If you make changes to your filters file then bisync requires a run with +--resync. This is a safety feature, which prevents existing files on the +Path1 and/or Path2 side from seeming to disappear from view (since they +are excluded in the new listings), which would fool bisync into seeing +them as deleted (as compared to the prior run listings), and then bisync +would proceed to delete them for real. + +To block this from happening, bisync calculates an MD5 hash of the +filters file and stores the hash in a .md5 file in the same place as +your filters file. On the next run with --filters-file set, bisync +re-calculates the MD5 hash of the current filters file and compares it +to the hash stored in the .md5 file. If they don't match, the run aborts +with a critical error and thus forces you to do a --resync, likely +avoiding a disaster. + +--check-sync + +Enabled by default, the check-sync function checks that all of the same +files exist in both the Path1 and Path2 history listings. This +check-sync integrity check is performed at the end of the sync run by +default. Any untrapped failing copy/deletes between the two paths might +result in differences between the two listings and in the untracked file +content differences between the two paths. A resync run would correct +the error. + +Note that the default-enabled integrity check locally executes a load of +both the final Path1 and Path2 listings, and thus adds to the run time +of a sync. Using --check-sync=false will disable it and may +significantly reduce the sync run times for very large numbers of files. + +The check may be run manually with --check-sync=only. It runs only the +integrity check and terminates without actually synching. + +See also: Concurrent modifications + +--ignore-listing-checksum + +By default, bisync will retrieve (or generate) checksums (for backends +that support them) when creating the listings for both paths, and store +the checksums in the listing files. --ignore-listing-checksum will +disable this behavior, which may speed things up considerably, +especially on backends (such as local) where hashes must be computed on +the fly instead of retrieved. Please note the following: + +- While checksums are (by default) generated and stored in the listing + files, they are NOT currently used for determining diffs (deltas). + It is anticipated that full checksum support will be added in a + future version. +- --ignore-listing-checksum is NOT the same as --ignore-checksum, and + you may wish to use one or the other, or both. In a nutshell: + --ignore-listing-checksum controls whether checksums are considered + when scanning for diffs, while --ignore-checksum controls whether + checksums are considered during the copy/sync operations that + follow, if there ARE diffs. +- Unless --ignore-listing-checksum is passed, bisync currently + computes hashes for one path even when there's no common hash with + the other path (for example, a crypt remote.) +- If both paths support checksums and have a common hash, AND + --ignore-listing-checksum was not specified when creating the + listings, --check-sync=only can be used to compare Path1 vs. Path2 + checksums (as of the time the previous listings were created.) + However, --check-sync=only will NOT include checksums if the + previous listings were generated on a run using + --ignore-listing-checksum. For a more robust integrity check of the + current state, consider using check (or cryptcheck, if at least one + path is a crypt remote.) + +--resilient + +Caution: this is an experimental feature. Use at your own risk! + +By default, most errors or interruptions will cause bisync to abort and +require --resync to recover. This is a safety feature, to prevent bisync +from running again until a user checks things out. However, in some +cases, bisync can go too far and enforce a lockout when one isn't +actually necessary, like for certain less-serious errors that might +resolve themselves on the next run. When --resilient is specified, +bisync tries its best to recover and self-correct, and only requires +--resync as a last resort when a human's involvement is absolutely +necessary. The intended use case is for running bisync as a background +process (such as via scheduled cron). + +When using --resilient mode, bisync will still report the error and +abort, however it will not lock out future runs -- allowing the +possibility of retrying at the next normally scheduled time, without +requiring a --resync first. Examples of such retryable errors include +access test failures, missing listing files, and filter change +detections. These safety features will still prevent the current run +from proceeding -- the difference is that if conditions have improved by +the time of the next run, that next run will be allowed to proceed. +Certain more serious errors will still enforce a --resync lockout, even +in --resilient mode, to prevent data loss. + +Behavior of --resilient may change in a future version. + +Operation + +Runtime flow details + +bisync retains the listings of the Path1 and Path2 filesystems from the +prior run. On each successive run it will: + +- list files on path1 and path2, and check for changes on each side. + Changes include New, Newer, Older, and Deleted files. +- Propagate changes on path1 to path2, and vice-versa. + +Safety measures + +- Lock file prevents multiple simultaneous runs when taking a while. + This can be particularly useful if bisync is run by cron scheduler. +- Handle change conflicts non-destructively by creating ..path1 and + ..path2 file versions. +- File system access health check using RCLONE_TEST files (see the + --check-access flag). +- Abort on excessive deletes - protects against a failed listing being + interpreted as all the files were deleted. See the --max-delete and + --force flags. +- If something evil happens, bisync goes into a safe state to block + damage by later runs. (See Error Handling) + +Normal sync checks + + ------------------------------------------------------------------------ + Type Description Result Implementation + --------- ---------------------------- --------------- ----------------- + Path2 new File is new on Path2, does Path2 version rclone copy Path2 + not exist on Path1 survives to Path1 + + Path2 File is newer on Path2, Path2 version rclone copy Path2 + newer unchanged on Path1 survives to Path1 + + Path2 File is deleted on Path2, File is deleted rclone delete + deleted unchanged on Path1 Path1 + + Path1 new File is new on Path1, does Path1 version rclone copy Path1 + not exist on Path2 survives to Path2 + + Path1 File is newer on Path1, Path1 version rclone copy Path1 + newer unchanged on Path2 survives to Path2 + + Path1 File is older on Path1, Path1 version rclone copy Path1 + older unchanged on Path2 survives to Path2 + + Path2 File is older on Path2, Path2 version rclone copy Path2 + older unchanged on Path1 survives to Path1 + + Path1 File no longer exists on File is deleted rclone delete + deleted Path1 Path2 + ------------------------------------------------------------------------ + +Unusual sync checks + + ---------------------------------------------------------------------------- + Type Description Result Implementation + ----------------- --------------------- ------------------- ---------------- + Path1 new/changed File is new/changed No change None + AND Path2 on Path1 AND + new/changed AND new/changed on Path2 + Path1 == Path2 AND Path1 version is + currently identical + to Path2 + + Path1 new AND File is new on Path1 Files renamed to rclone copy + Path2 new AND new on Path2 (and _Path1 and _Path2 _Path2 file to + Path1 version is NOT Path1, + identical to Path2) rclone copy + _Path1 file to + Path2 + + Path2 newer AND File is newer on Files renamed to rclone copy + Path1 changed Path2 AND also _Path1 and _Path2 _Path2 file to + changed Path1, + (newer/older/size) on rclone copy + Path1 (and Path1 _Path1 file to + version is NOT Path2 + identical to Path2) + + Path2 newer AND File is newer on Path2 version rclone copy + Path1 deleted Path2 AND also survives Path2 to Path1 + deleted on Path1 + + Path2 deleted AND File is deleted on Path1 version rclone copy + Path1 changed Path2 AND changed survives Path1 to Path2 + (newer/older/size) on + Path1 + + Path1 deleted AND File is deleted on Path2 version rclone copy + Path2 changed Path1 AND changed survives Path2 to Path1 + (newer/older/size) on + Path2 + ---------------------------------------------------------------------------- + +As of rclone v1.64, bisync is now better at detecting false positive +sync conflicts, which would previously have resulted in unnecessary +renames and duplicates. Now, when bisync comes to a file that it wants +to rename (because it is new/changed on both sides), it first checks +whether the Path1 and Path2 versions are currently identical (using the +same underlying function as check.) If bisync concludes that the files +are identical, it will skip them and move on. Otherwise, it will create +renamed ..Path1 and ..Path2 duplicates, as before. This behavior also +improves the experience of renaming directories, as a --resync is no +longer required, so long as the same change has been made on both sides. + +All files changed check + +If all prior existing files on either of the filesystems have changed +(e.g. timestamps have changed due to changing the system's timezone) +then bisync will abort without making any changes. Any new files are not +considered for this check. You could use --force to force the sync +(whichever side has the changed timestamp files wins). Alternately, a +--resync may be used (Path1 versions will be pushed to Path2). Consider +the situation carefully and perhaps use --dry-run before you commit to +the changes. + +Modification times + +Bisync relies on file timestamps to identify changed files and will +refuse to operate if backend lacks the modification time support. + +If you or your application should change the content of a file without +changing the modification time then bisync will not notice the change, +and thus will not copy it to the other side. + +Note that on some cloud storage systems it is not possible to have file +timestamps that match precisely between the local and other filesystems. + +Bisync's approach to this problem is by tracking the changes on each +side separately over time with a local database of files in that side +then applying the resulting changes on the other side. + +Error handling + +Certain bisync critical errors, such as file copy/move failing, will +result in a bisync lockout of following runs. The lockout is asserted +because the sync status and history of the Path1 and Path2 filesystems +cannot be trusted, so it is safer to block any further changes until +someone checks things out. The recovery is to do a --resync again. + +It is recommended to use --resync --dry-run --verbose initially and +carefully review what changes will be made before running the --resync +without --dry-run. + +Most of these events come up due to an error status from an internal +call. On such a critical error the {...}.path1.lst and {...}.path2.lst +listing files are renamed to extension .lst-err, which blocks any future +bisync runs (since the normal .lst files are not found). Bisync keeps +them under bisync subdirectory of the rclone cache directory, typically +at ${HOME}/.cache/rclone/bisync/ on Linux. + +Some errors are considered temporary and re-running the bisync is not +blocked. The critical return blocks further bisync runs. + +See also: --resilient + +Lock file + +When bisync is running, a lock file is created in the bisync working +directory, typically at ~/.cache/rclone/bisync/PATH1..PATH2.lck on +Linux. If bisync should crash or hang, the lock file will remain in +place and block any further runs of bisync for the same paths. Delete +the lock file as part of debugging the situation. The lock file +effectively blocks follow-on (e.g., scheduled by cron) runs when the +prior invocation is taking a long time. The lock file contains PID of +the blocking process, which may help in debug. + +Note that while concurrent bisync runs are allowed, be very cautious +that there is no overlap in the trees being synched between concurrent +runs, lest there be replicated files, deleted files and general mayhem. + +Return codes + +rclone bisync returns the following codes to calling program: - 0 on a +successful run, - 1 for a non-critical failing run (a rerun may be +successful), - 2 for a critically aborted run (requires a --resync to +recover). + +Limitations + +Supported backends + +Bisync is considered BETA and has been tested with the following +backends: - Local filesystem - Google Drive - Dropbox - OneDrive - S3 - +SFTP - Yandex Disk + +It has not been fully tested with other services yet. If it works, or +sorta works, please let us know and we'll update the list. Run the test +suite to check for proper operation as described below. + +First release of rclone bisync requires that underlying backend supports +the modification time feature and will refuse to run otherwise. This +limitation will be lifted in a future rclone bisync release. + +Concurrent modifications + +When using Local, FTP or SFTP remotes rclone does not create temporary +files at the destination when copying, and thus if the connection is +lost the created file may be corrupt, which will likely propagate back +to the original path on the next sync, resulting in data loss. This will +be solved in a future release, there is no workaround at the moment. + +Files that change during a bisync run may result in data loss. This has +been seen in a highly dynamic environment, where the filesystem is +getting hammered by running processes during the sync. The currently +recommended solution is to sync at quiet times or filter out unnecessary +directories and files. + +As an alternative approach, consider using --check-sync=false (and +possibly --resilient) to make bisync more forgiving of filesystems that +change during the sync. Be advised that this may cause bisync to miss +events that occur during a bisync run, so it is a good idea to +supplement this with a periodic independent integrity check, and +corrective sync if diffs are found. For example, a possible sequence +could look like this: + +1. Normally scheduled bisync run: + + rclone bisync Path1 Path2 -MPc --check-access --max-delete 10 --filters-file /path/to/filters.txt -v --check-sync=false --no-cleanup --ignore-listing-checksum --disable ListR --checkers=16 --drive-pacer-min-sleep=10ms --create-empty-src-dirs --resilient + +2. Periodic independent integrity check (perhaps scheduled nightly or + weekly): + + rclone check -MvPc Path1 Path2 --filter-from /path/to/filters.txt + +3. If diffs are found, you have some choices to correct them. If one + side is more up-to-date and you want to make the other side match + it, you could run: + + rclone sync Path1 Path2 --filter-from /path/to/filters.txt --create-empty-src-dirs -MPc -v + +(or switch Path1 and Path2 to make Path2 the source-of-truth) + +Or, if neither side is totally up-to-date, you could run a --resync to +bring them back into agreement (but remember that this could cause +deleted files to re-appear.) + +*Note also that rclone check does not currently include empty +directories, so if you want to know if any empty directories are out of +sync, consider alternatively running the above rclone sync command with +--dry-run added. + +Empty directories + +By default, new/deleted empty directories on one path are not propagated +to the other side. This is because bisync (and rclone) natively works on +files, not directories. However, this can be changed with the +--create-empty-src-dirs flag, which works in much the same way as in +sync and copy. When used, empty directories created or deleted on one +side will also be created or deleted on the other side. The following +should be noted: * --create-empty-src-dirs is not compatible with +--remove-empty-dirs. Use only one or the other (or neither). * It is not +recommended to switch back and forth between --create-empty-src-dirs and +the default (no --create-empty-src-dirs) without running --resync. This +is because it may appear as though all directories (not just the empty +ones) were created/deleted, when actually you've just toggled between +making them visible/invisible to bisync. It looks scarier than it is, +but it's still probably best to stick to one or the other, and use +--resync when you need to switch. + +Renamed directories + +Renaming a folder on the Path1 side results in deleting all files on the +Path2 side and then copying all files again from Path1 to Path2. Bisync +sees this as all files in the old directory name as deleted and all +files in the new directory name as new. Currently, the most effective +and efficient method of renaming a directory is to rename it to the same +name on both sides. (As of rclone v1.64, a --resync is no longer +required after doing so, as bisync will automatically detect that Path1 +and Path2 are in agreement.) + +--fast-list used by default + +Unlike most other rclone commands, bisync uses --fast-list by default, +for backends that support it. In many cases this is desirable, however, +there are some scenarios in which bisync could be faster without +--fast-list, and there is also a known issue concerning Google Drive +users with many empty directories. For now, the recommended way to avoid +using --fast-list is to add --disable ListR to all bisync commands. The +default behavior may change in a future version. + +Overridden Configs + +When rclone detects an overridden config, it adds a suffix like {ABCDE} +on the fly to the internal name of the remote. Bisync follows suit by +including this suffix in its listing filenames. However, this suffix +does not necessarily persist from run to run, especially if different +flags are provided. So if next time the suffix assigned is {FGHIJ}, +bisync will get confused, because it's looking for a listing file with +{FGHIJ}, when the file it wants has {ABCDE}. As a result, it throws +Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run +and refuses to run again until the user runs a --resync (unless using +--resilient). The best workaround at the moment is to set any +backend-specific flags in the config file instead of specifying them +with command flags. (You can still override them as needed for other +rclone commands.) + +Case sensitivity + +Synching with case-insensitive filesystems, such as Windows or Box, can +result in file name conflicts. This will be fixed in a future release. +The near-term workaround is to make sure that files on both sides don't +have spelling case differences (Smile.jpg vs. smile.jpg). + +Windows support + +Bisync has been tested on Windows 8.1, Windows 10 Pro 64-bit and on +Windows GitHub runners. + +Drive letters are allowed, including drive letters mapped to network +drives (rclone bisync J:\localsync GDrive:). If a drive letter is +omitted, the shell current drive is the default. Drive letters are a +single character follows by :, so cloud names must be more than one +character long. + +Absolute paths (with or without a drive letter), and relative paths +(with or without a drive letter) are supported. + +Working directory is created at +C:\Users\MyLogin\AppData\Local\rclone\bisync. + +Note that bisync output may show a mix of forward / and back \ slashes. + +Be careful of case independent directory and file naming on Windows vs. +case dependent Linux + +Filtering + +See filtering documentation for how filter rules are written and +interpreted. + +Bisync's --filters-file flag slightly extends the rclone's --filter-from +filtering mechanism. For a given bisync run you may provide only one +--filters-file. The --include*, --exclude*, and --filter flags are also +supported. + +How to filter directories + +Filtering portions of the directory tree is a critical feature for +synching. + +Examples of directory trees (always beneath the Path1/Path2 root level) +you may want to exclude from your sync: - Directory trees containing +only software build intermediate files. - Directory trees containing +application temporary files and data such as the Windows +C:\Users\MyLogin\AppData\ tree. - Directory trees containing files that +are large, less important, or are getting thrashed continuously by +ongoing processes. + +On the other hand, there may be only select directories that you +actually want to sync, and exclude all others. See the Example +include-style filters for Windows user directories below. + +Filters file writing guidelines + +1. Begin with excluding directory trees: + - e.g. `- /AppData/` + - ** on the end is not necessary. Once a given directory level is + excluded then everything beneath it won't be looked at by + rclone. + - Exclude such directories that are unneeded, are big, dynamically + thrashed, or where there may be access permission issues. + - Excluding such dirs first will make rclone operations (much) + faster. + - Specific files may also be excluded, as with the Dropbox + exclusions example below. +2. Decide if it's easier (or cleaner) to: + - Include select directories and therefore exclude everything else + -- or -- + - Exclude select directories and therefore include everything else +3. Include select directories: + - Add lines like: `+ /Documents/PersonalFiles/**` to select which + directories to include in the sync. + - ** on the end specifies to include the full depth of the + specified tree. + - With Include-style filters, files at the Path1/Path2 root are + not included. They may be included with `+ /*`. + - Place RCLONE_TEST files within these included directory trees. + They will only be looked for in these directory trees. + - Finish by excluding everything else by adding `- **` at the end + of the filters file. + - Disregard step 4. +4. Exclude select directories: + - Add more lines like in step 1. For example: + -/Desktop/tempfiles/, or `- /testdir/. Again, a**` on the end + is not necessary. + - Do not add a `- **` in the file. Without this line, everything + will be included that has not been explicitly excluded. + - Disregard step 3. + +A few rules for the syntax of a filter file expanding on filtering +documentation: + +- Lines may start with spaces and tabs - rclone strips leading + whitespace. +- If the first non-whitespace character is a # then the line is a + comment and will be ignored. +- Blank lines are ignored. +- The first non-whitespace character on a filter line must be a + or + -. +- Exactly 1 space is allowed between the +/- and the path term. +- Only forward slashes (/) are used in path terms, even on Windows. +- The rest of the line is taken as the path term. Trailing whitespace + is taken literally, and probably is an error. + +Example include-style filters for Windows user directories + +This Windows include-style example is based on the sync root (Path1) set +to C:\Users\MyLogin. The strategy is to select specific directories to +be synched with a network drive (Path2). + +- `- /AppData/` excludes an entire tree of Windows stored stuff that + need not be synched. In my case, AppData has >11 GB of stuff I don't + care about, and there are some subdirectories beneath AppData that + are not accessible to my user login, resulting in bisync critical + aborts. +- Windows creates cache files starting with both upper and lowercase + NTUSER at C:\Users\MyLogin. These files may be dynamic, locked, and + are generally don't care. +- There are just a few directories with my data that I do want + synched, in the form of `+ + /. By selecting only the directory trees I want to avoid the dozen plus directories that various apps make atC:`. +- Include files in the root of the sync point, C:\Users\MyLogin, by + adding the `+ /*` line. +- This is an Include-style filters file, therefore it ends with `- **` + which excludes everything not explicitly included. + + - /AppData/ + - NTUSER* + - ntuser* + + /Documents/Family/** + + /Documents/Sketchup/** + + /Documents/Microcapture_Photo/** + + /Documents/Microcapture_Video/** + + /Desktop/** + + /Pictures/** + + /* + - ** + +Note also that Windows implements several "library" links such as +C:\Users\MyLogin\My Documents\My Music pointing to +C:\Users\MyLogin\Music. rclone sees these as links, so you must add +--links to the bisync command line if you which to follow these links. I +find that I get permission errors in trying to follow the links, so I +don't include the rclone --links flag, but then you get lots of +Can't follow symlink… noise from rclone about not following the links. +This noise can be quashed by adding --quiet to the bisync command line. + +Example exclude-style filters files for use with Dropbox + +- Dropbox disallows synching the listed temporary and + configuration/data files. The `- ` filters exclude these files where + ever they may occur in the sync tree. Consider adding similar + exclusions for file types you don't need to sync, such as core dump + and software build files. +- bisync testing creates /testdir/ at the top level of the sync tree, + and usually deletes the tree after the test. If a normal sync should + run while the /testdir/ tree exists the --check-access phase may + fail due to unbalanced RCLONE_TEST files. The `- /testdir/` filter + blocks this tree from being synched. You don't need this exclusion + if you are not doing bisync development testing. +- Everything else beneath the Path1/Path2 root will be synched. +- RCLONE_TEST files may be placed anywhere within the tree, including + the root. + +Example filters file for Dropbox + + # Filter file for use with bisync + # See https://rclone.org/filtering/ for filtering rules + # NOTICE: If you make changes to this file you MUST do a --resync run. + # Run with --dry-run to see what changes will be made. + + # Dropbox won't sync some files so filter them away here. + # See https://help.dropbox.com/installs-integrations/sync-uploads/files-not-syncing + - .dropbox.attr + - ~*.tmp + - ~$* + - .~* + - desktop.ini + - .dropbox + + # Used for bisync testing, so excluded from normal runs + - /testdir/ + + # Other example filters + #- /TiBU/ + #- /Photos/ + +How --check-access handles filters + +At the start of a bisync run, listings are gathered for Path1 and Path2 +while using the user's --filters-file. During the check access phase, +bisync scans these listings for RCLONE_TEST files. Any RCLONE_TEST files +hidden by the --filters-file are not in the listings and thus not +checked during the check access phase. + +Troubleshooting + +Reading bisync logs + +Here are two normal runs. The first one has a newer file on the remote. +The second has no deltas between local and remote. + + 2021/05/16 00:24:38 INFO : Synching Path1 "/path/to/local/tree/" with Path2 "dropbox:/" + 2021/05/16 00:24:38 INFO : Path1 checking for diffs + 2021/05/16 00:24:38 INFO : - Path1 File is new - file.txt + 2021/05/16 00:24:38 INFO : Path1: 1 changes: 1 new, 0 newer, 0 older, 0 deleted + 2021/05/16 00:24:38 INFO : Path2 checking for diffs + 2021/05/16 00:24:38 INFO : Applying changes + 2021/05/16 00:24:38 INFO : - Path1 Queue copy to Path2 - dropbox:/file.txt + 2021/05/16 00:24:38 INFO : - Path1 Do queued copies to - Path2 + 2021/05/16 00:24:38 INFO : Updating listings + 2021/05/16 00:24:38 INFO : Validating listings for Path1 "/path/to/local/tree/" vs Path2 "dropbox:/" + 2021/05/16 00:24:38 INFO : Bisync successful + + 2021/05/16 00:36:52 INFO : Synching Path1 "/path/to/local/tree/" with Path2 "dropbox:/" + 2021/05/16 00:36:52 INFO : Path1 checking for diffs + 2021/05/16 00:36:52 INFO : Path2 checking for diffs + 2021/05/16 00:36:52 INFO : No changes found + 2021/05/16 00:36:52 INFO : Updating listings + 2021/05/16 00:36:52 INFO : Validating listings for Path1 "/path/to/local/tree/" vs Path2 "dropbox:/" + 2021/05/16 00:36:52 INFO : Bisync successful + +Dry run oddity + +The --dry-run messages may indicate that it would try to delete some +files. For example, if a file is new on Path2 and does not exist on +Path1 then it would normally be copied to Path1, but with --dry-run +enabled those copies don't happen, which leads to the attempted delete +on Path2, blocked again by --dry-run: ... Not deleting as --dry-run. + +This whole confusing situation is an artifact of the --dry-run flag. +Scrutinize the proposed deletes carefully, and if the files would have +been copied to Path1 then the threatened deletes on Path2 may be +disregarded. + +Retries + +Rclone has built-in retries. If you run with --verbose you'll see error +and retry messages such as shown below. This is usually not a bug. If at +the end of the run, you see Bisync successful and not +Bisync critical error or Bisync aborted then the run was successful, and +you can ignore the error messages. + +The following run shows an intermittent fail. Lines 5 and _6- are +low-level messages. Line 6 is a bubbled-up warning message, conveying +the error. Rclone normally retries failing commands, so there may be +numerous such messages in the log. + +Since there are no final error/warning messages on line 7, rclone has +recovered from failure after a retry, and the overall sync was +successful. + + 1: 2021/05/14 00:44:12 INFO : Synching Path1 "/path/to/local/tree" with Path2 "dropbox:" + 2: 2021/05/14 00:44:12 INFO : Path1 checking for diffs + 3: 2021/05/14 00:44:12 INFO : Path2 checking for diffs + 4: 2021/05/14 00:44:12 INFO : Path2: 113 changes: 22 new, 0 newer, 0 older, 91 deleted + 5: 2021/05/14 00:44:12 ERROR : /path/to/local/tree/objects/af: error listing: unexpected end of JSON input + 6: 2021/05/14 00:44:12 NOTICE: WARNING listing try 1 failed. - dropbox: + 7: 2021/05/14 00:44:12 INFO : Bisync successful + +This log shows a Critical failure which requires a --resync to recover +from. See the Runtime Error Handling section. + + 2021/05/12 00:49:40 INFO : Google drive root '': Waiting for checks to finish + 2021/05/12 00:49:40 INFO : Google drive root '': Waiting for transfers to finish + 2021/05/12 00:49:40 INFO : Google drive root '': not deleting files as there were IO errors + 2021/05/12 00:49:40 ERROR : Attempt 3/3 failed with 3 errors and: not deleting files as there were IO errors + 2021/05/12 00:49:40 ERROR : Failed to sync: not deleting files as there were IO errors + 2021/05/12 00:49:40 NOTICE: WARNING rclone sync try 3 failed. - /path/to/local/tree/ + 2021/05/12 00:49:40 ERROR : Bisync aborted. Must run --resync to recover. + +Denied downloads of "infected" or "abusive" files + +Google Drive has a filter for certain file types (.exe, .apk, et cetera) +that by default cannot be copied from Google Drive to the local +filesystem. If you are having problems, run with --verbose to see +specifically which files are generating complaints. If the error is +This file has been identified as malware or spam and cannot be downloaded, +consider using the flag --drive-acknowledge-abuse. + +Google Doc files + +Google docs exist as virtual files on Google Drive and cannot be +transferred to other filesystems natively. While it is possible to +export a Google doc to a normal file (with .xlsx extension, for +example), it is not possible to import a normal file back into a Google +document. + +Bisync's handling of Google Doc files is to flag them in the run log +output for user's attention and ignore them for any file transfers, +deletes, or syncs. They will show up with a length of -1 in the +listings. This bisync run is otherwise successful: + + 2021/05/11 08:23:15 INFO : Synching Path1 "/path/to/local/tree/base/" with Path2 "GDrive:" + 2021/05/11 08:23:15 INFO : ...path2.lst-new: Ignoring incorrect line: "- -1 - - 2018-07-29T08:49:30.136000000+0000 GoogleDoc.docx" + 2021/05/11 08:23:15 INFO : Bisync successful + +Usage examples + +Cron + +Rclone does not yet have a built-in capability to monitor the local file +system for changes and must be blindly run periodically. On Windows this +can be done using a Task Scheduler, on Linux you can use Cron which is +described below. + +The 1st example runs a sync every 5 minutes between a local directory +and an OwnCloud server, with output logged to a runlog file: + + # Minute (0-59) + # Hour (0-23) + # Day of Month (1-31) + # Month (1-12 or Jan-Dec) + # Day of Week (0-6 or Sun-Sat) + # Command + */5 * * * * /path/to/rclone bisync /local/files MyCloud: --check-access --filters-file /path/to/bysync-filters.txt --log-file /path/to//bisync.log + +See crontab syntax for the details of crontab time interval expressions. + +If you run rclone bisync as a cron job, redirect stdout/stderr to a +file. The 2nd example runs a sync to Dropbox every hour and logs all +stdout (via the >>) and stderr (via 2>&1) to a log file. + + 0 * * * * /path/to/rclone bisync /path/to/local/dropbox Dropbox: --check-access --filters-file /home/user/filters.txt >> /path/to/logs/dropbox-run.log 2>&1 + +Sharing an encrypted folder tree between hosts + +bisync can keep a local folder in sync with a cloud service, but what if +you have some highly sensitive files to be synched? + +Usage of a cloud service is for exchanging both routine and sensitive +personal files between one's home network, one's personal notebook when +on the road, and with one's work computer. The routine data is not +sensitive. For the sensitive data, configure an rclone crypt remote to +point to a subdirectory within the local disk tree that is bisync'd to +Dropbox, and then set up an bisync for this local crypt directory to a +directory outside of the main sync tree. + +Linux server setup + +- /path/to/DBoxroot is the root of my local sync tree. There are + numerous subdirectories. +- /path/to/DBoxroot/crypt is the root subdirectory for files that are + encrypted. This local directory target is setup as an rclone crypt + remote named Dropcrypt:. See rclone.conf snippet below. +- /path/to/my/unencrypted/files is the root of my sensitive files - + not encrypted, not within the tree synched to Dropbox. +- To sync my local unencrypted files with the encrypted Dropbox + versions I manually run + bisync /path/to/my/unencrypted/files DropCrypt:. This step could be + bundled into a script to run before and after the full Dropbox tree + sync in the last step, thus actively keeping the sensitive files in + sync. +- bisync /path/to/DBoxroot Dropbox: runs periodically via cron, + keeping my full local sync tree in sync with Dropbox. + +Windows notebook setup + +- The Dropbox client runs keeping the local tree + C:\Users\MyLogin\Dropbox always in sync with Dropbox. I could have + used rclone bisync instead. +- A separate directory tree at C:\Users\MyLogin\Documents\DropLocal + hosts the tree of unencrypted files/folders. +- To sync my local unencrypted files with the encrypted Dropbox + versions I manually run the following command: + rclone bisync C:\Users\MyLogin\Documents\DropLocal Dropcrypt:. +- The Dropbox client then syncs the changes with Dropbox. + +rclone.conf snippet + + [Dropbox] + type = dropbox + ... + + [Dropcrypt] + type = crypt + remote = /path/to/DBoxroot/crypt # on the Linux server + remote = C:\Users\MyLogin\Dropbox\crypt # on the Windows notebook + filename_encryption = standard + directory_name_encryption = true + password = ... + ... + +Testing + +You should read this section only if you are developing for rclone. You +need to have rclone source code locally to work with bisync tests. + +Bisync has a dedicated test framework implemented in the bisync_test.go +file located in the rclone source tree. The test suite is based on the +go test command. Series of tests are stored in subdirectories below the +cmd/bisync/testdata directory. Individual tests can be invoked by their +directory name, e.g. +go test . -case basic -remote local -remote2 gdrive: -v + +Tests will make a temporary folder on remote and purge it afterwards. If +during test run there are intermittent errors and rclone retries, these +errors will be captured and flagged as invalid MISCOMPAREs. Rerunning +the test will let it pass. Consider such failures as noise. + +Test command syntax + + usage: go test ./cmd/bisync [options...] + + Options: + -case NAME Name(s) of the test case(s) to run. Multiple names should + be separated by commas. You can remove the `test_` prefix + and replace `_` by `-` in test name for convenience. + If not `all`, the name(s) should map to a directory under + `./cmd/bisync/testdata`. + Use `all` to run all tests (default: all) + -remote PATH1 `local` or name of cloud service with `:` (default: local) + -remote2 PATH2 `local` or name of cloud service with `:` (default: local) + -no-compare Disable comparing test results with the golden directory + (default: compare) + -no-cleanup Disable cleanup of Path1 and Path2 testdirs. + Useful for troubleshooting. (default: cleanup) + -golden Store results in the golden directory (default: false) + This flag can be used with multiple tests. + -debug Print debug messages + -stop-at NUM Stop test after given step number. (default: run to the end) + Implies `-no-compare` and `-no-cleanup`, if the test really + ends prematurely. Only meaningful for a single test case. + -refresh-times Force refreshing the target modtime, useful for Dropbox + (default: false) + -verbose Run tests verbosely + +Note: unlike rclone flags which must be prefixed by double dash (--), +the test command flags can be equally prefixed by a single - or double +dash. + +Running tests + +- go test . -case basic -remote local -remote2 local runs the + test_basic test case using only the local filesystem, synching one + local directory with another local directory. Test script output is + to the console, while commands within scenario.txt have their output + sent to the .../workdir/test.log file, which is finally compared to + the golden copy. +- The first argument after go test should be a relative name of the + directory containing bisync source code. If you run tests right from + there, the argument will be . (current directory) as in most + examples below. If you run bisync tests from the rclone source + directory, the command should be go test ./cmd/bisync .... +- The test engine will mangle rclone output to ensure comparability + with golden listings and logs. +- Test scenarios are located in ./cmd/bisync/testdata. The test -case + argument should match the full name of a subdirectory under that + directory. Every test subdirectory name on disk must start with + test_, this prefix can be omitted on command line for brevity. Also, + underscores in the name can be replaced by dashes for convenience. +- go test . -remote local -remote2 local -case all runs all tests. +- Path1 and Path2 may either be the keyword local or may be names of + configured cloud services. + go test . -remote gdrive: -remote2 dropbox: -case basic will run the + test between these two services, without transferring any files to + the local filesystem. +- Test run stdout and stderr console output may be directed to a file, + e.g. + go test . -remote gdrive: -remote2 local -case all > runlog.txt 2>&1 + +Test execution flow + +1. The base setup in the initial directory of the testcase is applied + on the Path1 and Path2 filesystems (via rclone copy the initial + directory to Path1, then rclone sync Path1 to Path2). +2. The commands in the scenario.txt file are applied, with output + directed to the test.log file in the test working directory. + Typically, the first actual command in the scenario.txt file is to + do a --resync, which establishes the baseline {...}.path1.lst and + {...}.path2.lst files in the test working directory (.../workdir/ + relative to the temporary test directory). Various commands and + listing snapshots are done within the test. +3. Finally, the contents of the test working directory are compared to + the contents of the testcase's golden directory. + +Notes about testing + +- Test cases are in individual directories beneath + ./cmd/bisync/testdata. A command line reference to a test is + understood to reference a directory beneath testdata. For example, + go test ./cmd/bisync -case dry-run -remote gdrive: -remote2 local + refers to the test case in ./cmd/bisync/testdata/test_dry_run. +- The test working directory is located at .../workdir relative to a + temporary test directory, usually under /tmp on Linux. +- The local test sync tree is created at a temporary directory named + like bisync.XXX under system temporary directory. +- The remote test sync tree is located at a temporary directory under + /bisync.XXX/. +- path1 and/or path2 subdirectories are created in a temporary + directory under the respective local or cloud test remote. +- By default, the Path1 and Path2 test dirs and workdir will be + deleted after each test run. The -no-cleanup flag disables purging + these directories when validating and debugging a given test. These + directories will be flushed before running another test, independent + of the -no-cleanup usage. +- You will likely want to add `- + /testdir/to your normal bisync--filters-fileso that normal syncs do not attempt to sync the test temporary directories, which may haveRCLONE_TESTmiscompares in some testcases which would otherwise trip the--check-accesssystem. The--check-accessmechanism is hard-coded to ignoreRCLONE_TESTfiles beneathbisync/testdata`, + so the test cases may reside on the synched tree even if there are + check file mismatches in the test tree. +- Some Dropbox tests can fail, notably printing the following message: + src and dst identical but can't set mod time without deleting and re-uploading + This is expected and happens due to the way Dropbox handles + modification times. You should use the -refresh-times test flag to + make up for this. +- If Dropbox tests hit request limit for you and print error message + too_many_requests/...: Too many requests or write operations. then + follow the Dropbox App ID instructions. + +Updating golden results + +Sometimes even a slight change in the bisync source can cause little +changes spread around many log files. Updating them manually would be a +nightmare. + +The -golden flag will store the test.log and *.lst listings from each +test case into respective golden directories. Golden results will +automatically contain generic strings instead of local or cloud paths +which means that they should match when run with a different cloud +service. + +Your normal workflow might be as follows: 1. Git-clone the rclone +sources locally 2. Modify bisync source and check that it builds 3. Run +the whole test suite go test ./cmd/bisync -remote local 4. If some tests +show log difference, recheck them individually, e.g.: +go test ./cmd/bisync -remote local -case basic 5. If you are convinced +with the difference, goldenize all tests at once: +go test ./cmd/bisync -remote local -golden 6. Use word diff: +git diff --word-diff ./cmd/bisync/testdata/. Please note that normal +line-level diff is generally useless here. 7. Check the difference +carefully! 8. Commit the change (git commit) only if you are sure. If +unsure, save your code changes then wipe the log diffs from git: +git reset [--hard]. + +Structure of test scenarios + +- /initial/ contains a tree of files that will be set as the + initial condition on both Path1 and Path2 testdirs. +- /modfiles/ contains files that will be used to modify the + Path1 and/or Path2 filesystems. +- /golden/ contains the expected content of the test working + directory (workdir) at the completion of the testcase. +- /scenario.txt contains the body of the test, in the form + of various commands to modify files, run bisync, and snapshot + listings. Output from these commands is captured to + .../workdir/test.log for comparison to the golden files. + +Supported test commands + +- test Print the line to the console and to the + test.log: test sync is working correctly with options x, y, z +- copy-listings Save a copy of all .lst listings in the test + working directory with the specified prefix: + save-listings exclude-pass-run +- move-listings Similar to copy-listings but removes the + source +- purge-children This will delete all child files and purge all + child subdirs under given directory but keep the parent intact. This + behavior is important for tests with Google Drive because removing + and re-creating the parent would change its ID. +- delete-file Delete a single file. +- delete-glob Delete a group of files located one + level deep in the given directory with names matching a given glob + pattern. +- touch-glob YYYY-MM-DD Change modification time on a + group of files. +- touch-copy YYYY-MM-DD Change file + modification time then copy it to destination. +- copy-file Copy a single file to given + directory. +- copy-as Similar to above but destination + must include both directory and the new file name at destination. +- copy-dir and sync-dir Copy/sync a directory. + Equivalent of rclone copy and rclone sync. +- list-dirs Equivalent to rclone lsf -R --dirs-only +- bisync [options] Runs bisync against -remote and -remote2. Supported substitution terms -- {testdir/} - the root dir of the testcase -- {datadir/} - the modfiles dir under the testcase root -- {workdir/} - the temporary test working directory -- {path1/} - the root of the Path1 test directory tree -- {path2/} - the root of the Path2 test directory tree -- {session} - base name of the test listings -- {/} - OS-specific path separator -- {spc}, {tab}, {eol} - whitespace -- {chr:HH} - raw byte with given hexadecimal code +- {testdir/} - the root dir of the testcase +- {datadir/} - the modfiles dir under the testcase root +- {workdir/} - the temporary test working directory +- {path1/} - the root of the Path1 test directory tree +- {path2/} - the root of the Path2 test directory tree +- {session} - base name of the test listings +- {/} - OS-specific path separator +- {spc}, {tab}, {eol} - whitespace +- {chr:HH} - raw byte with given hexadecimal code + +Substitution results of the terms named like {dir/} will end with / (or +backslash on Windows), so it is not necessary to include slash in the +usage, for example delete-file {path1/}file1.txt. + +Benchmarks + +This section is work in progress. + +Here are a few data points for scale, execution times, and memory usage. + +The first set of data was taken between a local disk to Dropbox. The +speedtest.net download speed was ~170 Mbps, and upload speed was ~10 +Mbps. 500 files (~9.5 MB each) had been already synched. 50 files were +added in a new directory, each ~9.5 MB, ~475 MB total. + + ------------------------------------------------------------------------ + Change Operations and times Overall run + time + ------------------------ ----------------------------------- ----------- + 500 files synched 1x listings for Path1 & Path2 1.5 sec + (nothing to move) + + 500 files synched with 1x listings for Path1 & Path2 1.5 sec + --check-access + + 50 new files on remote Queued 50 copies down: 27 sec 29 sec + + Moved local dir Queued 50 copies up: 410 sec, 50 421 sec + deletes up: 9 sec + + Moved remote dir Queued 50 copies down: 31 sec, 50 33 sec + deletes down: <1 sec + + Delete local dir Queued 50 deletes up: 9 sec 13 sec + ------------------------------------------------------------------------ + +This next data is from a user's application. They had ~400GB of data +over 1.96 million files being sync'ed between a Windows local disk and +some remote cloud. The file full path length was on average 35 +characters (which factors into load time and RAM required). + +- Loading the prior listing into memory (1.96 million files, listing + file size 140 MB) took ~30 sec and occupied about 1 GB of RAM. +- Getting a fresh listing of the local file system (producing the 140 + MB output file) took about XXX sec. +- Getting a fresh listing of the remote file system (producing the 140 + MB output file) took about XXX sec. The network download speed was + measured at XXX Mb/s. +- Once the prior and current Path1 and Path2 listings were loaded (a + total of four to be loaded, two at a time), determining the deltas + was pretty quick (a few seconds for this test case), and the + transfer time for any files to be copied was dominated by the + network bandwidth. + +References + +rclone's bisync implementation was derived from the rclonesync-V2 +project, including documentation and test mechanisms, with +[@cjnaz](https://github.com/cjnaz)'s full support and encouragement. + +rclone bisync is similar in nature to a range of other projects: + +- unison +- syncthing +- cjnaz/rclonesync +- ConorWilliams/rsinc +- jwink3101/syncrclone +- DavideRossi/upback + +Bisync adopts the differential synchronization technique, which is based +on keeping history of changes performed by both synchronizing sides. See +the Dual Shadow Method section in Neil Fraser's article. + +Also note a number of academic publications by Benjamin Pierce about +Unison and synchronization in general. + +Changelog + +v1.64 + +- Fixed an issue causing dry runs to inadvertently commit filter + changes +- Fixed an issue causing --resync to erroneously delete empty folders + and duplicate files unique to Path2 +- --check-access is now enforced during --resync, preventing data loss + in certain user error scenarios +- Fixed an issue causing bisync to consider more files than necessary + due to overbroad filters during delete operations +- Improved detection of false positive change conflicts (identical + files are now left alone instead of renamed) +- Added support for --create-empty-src-dirs +- Added experimental --resilient mode to allow recovery from + self-correctable errors +- Added new --ignore-listing-checksum flag to distinguish from + --ignore-checksum +- Performance improvements for large remotes +- Documentation and testing improvements + +Release signing + +The hashes of the binary artefacts of the rclone release are signed with +a public PGP/GPG key. This can be verified manually as described below. + +The same mechanism is also used by rclone selfupdate to verify that the +release has not been tampered with before the new update is installed. +This checks the SHA256 hash and the signature with a public key compiled +into the rclone binary. + +Release signing key + +You may obtain the release signing key from: + +- From KEYS on this website - this file contains all past signing keys + also. +- The git repository hosted on GitHub - + https://github.com/rclone/rclone/blob/master/docs/content/KEYS +- gpg --keyserver hkps://keys.openpgp.org --search nick@craig-wood.com +- gpg --keyserver hkps://keyserver.ubuntu.com --search nick@craig-wood.com +- https://www.craig-wood.com/nick/pub/pgp-key.txt + +After importing the key, verify that the fingerprint of one of the keys +matches: FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA as this key is used +for signing. + +We recommend that you cross-check the fingerprint shown above through +the domains listed below. By cross-checking the integrity of the +fingerprint across multiple domains you can be confident that you +obtained the correct key. + +- The source for this page on GitHub. +- Through DNS dig key.rclone.org txt + +If you find anything that doesn't not match, please contact the +developers at once. + +How to verify the release + +In the release directory you will see the release files and some files +called MD5SUMS, SHA1SUMS and SHA256SUMS. + + $ rclone lsf --http-url https://downloads.rclone.org/v1.63.1 :http: + MD5SUMS + SHA1SUMS + SHA256SUMS + rclone-v1.63.1-freebsd-386.zip + rclone-v1.63.1-freebsd-amd64.zip + ... + rclone-v1.63.1-windows-arm64.zip + rclone-v1.63.1.tar.gz + version.txt + +The MD5SUMS, SHA1SUMS and SHA256SUMS contain hashes of the binary files +in the release directory along with a signature. + +For example: + + $ rclone cat --http-url https://downloads.rclone.org/v1.63.1 :http:SHA256SUMS + -----BEGIN PGP SIGNED MESSAGE----- + Hash: SHA1 + + f6d1b2d7477475ce681bdce8cb56f7870f174cb6b2a9ac5d7b3764296ea4a113 rclone-v1.63.1-freebsd-386.zip + 7266febec1f01a25d6575de51c44ddf749071a4950a6384e4164954dff7ac37e rclone-v1.63.1-freebsd-amd64.zip + ... + 66ca083757fb22198309b73879831ed2b42309892394bf193ff95c75dff69c73 rclone-v1.63.1-windows-amd64.zip + bbb47c16882b6c5f2e8c1b04229378e28f68734c613321ef0ea2263760f74cd0 rclone-v1.63.1-windows-arm64.zip + -----BEGIN PGP SIGNATURE----- + + iF0EARECAB0WIQT79zfs6firGGBL0qyTk14C/ztU+gUCZLVKJQAKCRCTk14C/ztU + +pZuAJ0XJ+QWLP/3jCtkmgcgc4KAwd/rrwCcCRZQ7E+oye1FPY46HOVzCFU3L7g= + =8qrL + -----END PGP SIGNATURE----- + +Download the files + +The first step is to download the binary and SUMs file and verify that +the SUMs you have downloaded match. Here we download +rclone-v1.63.1-windows-amd64.zip - choose the binary (or binaries) +appropriate to your architecture. We've also chosen the SHA256SUMS as +these are the most secure. You could verify the other types of hash also +for extra security. rclone selfupdate verifies just the SHA256SUMS. + + $ mkdir /tmp/check + $ cd /tmp/check + $ rclone copy --http-url https://downloads.rclone.org/v1.63.1 :http:SHA256SUMS . + $ rclone copy --http-url https://downloads.rclone.org/v1.63.1 :http:rclone-v1.63.1-windows-amd64.zip . + +Verify the signatures + +First verify the signatures on the SHA256 file. + +Import the key. See above for ways to verify this key is correct. + + $ gpg --keyserver keyserver.ubuntu.com --receive-keys FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA + gpg: key 93935E02FF3B54FA: public key "Nick Craig-Wood " imported + gpg: Total number processed: 1 + gpg: imported: 1 + +Then check the signature: + + $ gpg --verify SHA256SUMS + gpg: Signature made Mon 17 Jul 2023 15:03:17 BST + gpg: using DSA key FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA + gpg: Good signature from "Nick Craig-Wood " [ultimate] + +Verify the signature was good and is using the fingerprint shown above. + +Repeat for MD5SUMS and SHA1SUMS if desired. + +Verify the hashes + +Now that we know the signatures on the hashes are OK we can verify the +binaries match the hashes, completing the verification. + + $ sha256sum -c SHA256SUMS 2>&1 | grep OK + rclone-v1.63.1-windows-amd64.zip: OK + +Or do the check with rclone + + $ rclone hashsum sha256 -C SHA256SUMS rclone-v1.63.1-windows-amd64.zip + 2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 0 + 2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 1 + 2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 49 + 2023/09/11 10:53:58 NOTICE: SHA256SUMS: 4 warning(s) suppressed... + = rclone-v1.63.1-windows-amd64.zip + 2023/09/11 10:53:58 NOTICE: Local file system at /tmp/check: 0 differences found + 2023/09/11 10:53:58 NOTICE: Local file system at /tmp/check: 1 matching files + +Verify signatures and hashes together + +You can verify the signatures and hashes in one command line like this: + + $ gpg --decrypt SHA256SUMS | sha256sum -c --ignore-missing + gpg: Signature made Mon 17 Jul 2023 15:03:17 BST + gpg: using DSA key FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA + gpg: Good signature from "Nick Craig-Wood " [ultimate] + gpg: aka "Nick Craig-Wood " [unknown] + rclone-v1.63.1-windows-amd64.zip: OK + +1Fichier + +This is a backend for the 1fichier cloud storage service. Note that a +Premium subscription is required to use the API. + +Paths are specified as remote:path + +Paths may be as deep as required, e.g. remote:directory/subdirectory. + +Configuration + +The initial setup for 1Fichier involves getting the API key from the +website which you need to do in your browser. + +Here is an example of how to make a remote called remote. First run: + + rclone config + +This will guide you through an interactive setup process: + + No remotes found, make a new one? + n) New remote + s) Set configuration password + q) Quit config + n/s/q> n + name> remote + Type of storage to configure. + Enter a string value. Press Enter for the default (""). + Choose a number from below, or type in your own value + [snip] + XX / 1Fichier + \ "fichier" + [snip] + Storage> fichier + ** See help for fichier backend at: https://rclone.org/fichier/ ** + + Your API Key, get it from https://1fichier.com/console/params.pl + Enter a string value. Press Enter for the default (""). + api_key> example_key + + Edit advanced config? (y/n) + y) Yes + n) No + y/n> + Remote config + -------------------- + [remote] + type = fichier + api_key = example_key + -------------------- + y) Yes this is OK + e) Edit this remote + d) Delete this remote + y/e/d> y + +Once configured you can then use rclone like this, + +List directories in top level of your 1Fichier account + + rclone lsd remote: + +List all the files in your 1Fichier account + + rclone ls remote: + +To copy a local directory to a 1Fichier directory called backup + + rclone copy /home/source remote:backup + +Modification times and hashes + +1Fichier does not support modification times. It supports the Whirlpool +hash algorithm. + +Duplicated files + +1Fichier can have two files with exactly the same name and path (unlike +a normal file system). + +Duplicated files cause problems with the syncing and you will see +messages in the log about duplicates. + +Restricted filename characters + +In addition to the default restricted characters set the following +characters are also replaced: + + Character Value Replacement + ----------- ------- ------------- + \ 0x5C \ + < 0x3C < + > 0x3E > + " 0x22 " + $ 0x24 $ + ` 0x60 ` + ' 0x27 ' + +File names can also not start or end with the following characters. +These only get replaced if they are the first or last character in the +name: + + Character Value Replacement + ----------- ------- ------------- + SP 0x20 ␠ + +Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON +strings. + +Standard options + +Here are the Standard options specific to fichier (1Fichier). + +--fichier-api-key + +Your API Key, get it from https://1fichier.com/console/params.pl. + +Properties: + +- Config: api_key +- Env Var: RCLONE_FICHIER_API_KEY +- Type: string +- Required: false + +Advanced options + +Here are the Advanced options specific to fichier (1Fichier). + +--fichier-shared-folder + +If you want to download a shared folder, add this parameter. + +Properties: + +- Config: shared_folder +- Env Var: RCLONE_FICHIER_SHARED_FOLDER +- Type: string +- Required: false + +--fichier-file-password + +If you want to download a shared file that is password protected, add +this parameter. + +NB Input to this must be obscured - see rclone obscure. + +Properties: + +- Config: file_password +- Env Var: RCLONE_FICHIER_FILE_PASSWORD +- Type: string +- Required: false + +--fichier-folder-password + +If you want to list the files in a shared folder that is password +protected, add this parameter. + +NB Input to this must be obscured - see rclone obscure. + +Properties: + +- Config: folder_password +- Env Var: RCLONE_FICHIER_FOLDER_PASSWORD +- Type: string +- Required: false + +--fichier-cdn + +Set if you wish to use CDN download links. + +Properties: + +- Config: cdn +- Env Var: RCLONE_FICHIER_CDN +- Type: bool +- Default: false + +--fichier-encoding + +The encoding for the backend. + +See the encoding section in the overview for more info. + +Properties: + +- Config: encoding +- Env Var: RCLONE_FICHIER_ENCODING +- Type: Encoding +- Default: + Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot + +Limitations + +rclone about is not supported by the 1Fichier backend. Backends without +this capability cannot determine free space for an rclone mount or use +policy mfs (most free space) as a member of an rclone union remote. + +See List of backends that do not support rclone about and rclone about + +Alias + +The alias remote provides a new name for another remote. + +Paths may be as deep as required or a local path, e.g. +remote:directory/subdirectory or /directory/subdirectory. + +During the initial setup with rclone config you will specify the target +remote. The target remote can either be a local path or another remote. + +Subfolders can be used in target remote. Assume an alias remote named +backup with the target mydrive:private/backup. Invoking +rclone mkdir backup:desktop is exactly the same as invoking +rclone mkdir mydrive:private/backup/desktop. + +There will be no special handling of paths containing .. segments. +Invoking rclone mkdir backup:../desktop is exactly the same as invoking +rclone mkdir mydrive:private/backup/../desktop. The empty path is not +allowed as a remote. To alias the current directory use . instead. + +The target remote can also be a connection string. This can be used to +modify the config of a remote for different uses, e.g. the alias +myDriveTrash with the target remote myDrive,trashed_only: can be used to +only show the trashed files in myDrive. + +Configuration + +Here is an example of how to make an alias called remote for local +folder. First run: + + rclone config + +This will guide you through an interactive setup process: + + No remotes found, make a new one? + n) New remote + s) Set configuration password + q) Quit config + n/s/q> n + name> remote + Type of storage to configure. + Choose a number from below, or type in your own value + [snip] + XX / Alias for an existing remote + \ "alias" + [snip] + Storage> alias + Remote or path to alias. + Can be "myremote:path/to/dir", "myremote:bucket", "myremote:" or "/local/path". + remote> /mnt/storage/backup + Remote config + -------------------- + [remote] + remote = /mnt/storage/backup + -------------------- + y) Yes this is OK + e) Edit this remote + d) Delete this remote + y/e/d> y + Current remotes: + + Name Type + ==== ==== + remote alias + + e) Edit existing remote + n) New remote + d) Delete remote + r) Rename remote + c) Copy remote + s) Set configuration password + q) Quit config + e/n/d/r/c/s/q> q + +Once configured you can then use rclone like this, + +List directories in top level in /mnt/storage/backup + + rclone lsd remote: + +List all the files in /mnt/storage/backup + + rclone ls remote: + +Copy another local directory to the alias directory called source + + rclone copy /home/source remote:source + +Standard options + +Here are the Standard options specific to alias (Alias for an existing +remote). + +--alias-remote + +Remote or path to alias. + +Can be "myremote:path/to/dir", "myremote:bucket", "myremote:" or +"/local/path". + +Properties: + +- Config: remote +- Env Var: RCLONE_ALIAS_REMOTE +- Type: string +- Required: true + +Amazon Drive + +Amazon Drive, formerly known as Amazon Cloud Drive, is a cloud storage +service run by Amazon for consumers. + +Status + +Important: rclone supports Amazon Drive only if you have your own set of +API keys. Unfortunately the Amazon Drive developer program is now closed +to new entries so if you don't already have your own set of keys you +will not be able to use rclone with Amazon Drive. + +For the history on why rclone no longer has a set of Amazon Drive API +keys see the forum. + +If you happen to know anyone who works at Amazon then please ask them to +re-instate rclone into the Amazon Drive developer program - thanks! + +Configuration + +The initial setup for Amazon Drive involves getting a token from Amazon +which you need to do in your browser. rclone config walks you through +it. + +The configuration process for Amazon Drive may involve using an oauth +proxy. This is used to keep the Amazon credentials out of the source +code. The proxy runs in Google's very secure App Engine environment and +doesn't store any credentials which pass through it. + +Since rclone doesn't currently have its own Amazon Drive credentials so +you will either need to have your own client_id and client_secret with +Amazon Drive, or use a third-party oauth proxy in which case you will +need to enter client_id, client_secret, auth_url and token_url. + +Note also if you are not using Amazon's auth_url and token_url, (ie you +filled in something for those) then if setting up on a remote machine +you can only use the copying the config method of configuration - +rclone authorize will not work. + +Here is an example of how to make a remote called remote. First run: + + rclone config + +This will guide you through an interactive setup process: + + No remotes found, make a new one? + n) New remote + r) Rename remote + c) Copy remote + s) Set configuration password + q) Quit config + n/r/c/s/q> n + name> remote + Type of storage to configure. + Choose a number from below, or type in your own value + [snip] + XX / Amazon Drive + \ "amazon cloud drive" + [snip] + Storage> amazon cloud drive + Amazon Application Client Id - required. + client_id> your client ID goes here + Amazon Application Client Secret - required. + client_secret> your client secret goes here + Auth server URL - leave blank to use Amazon's. + auth_url> Optional auth URL + Token server url - leave blank to use Amazon's. + token_url> Optional token URL + Remote config + Make sure your Redirect URL is set to "http://127.0.0.1:53682/" in your custom config. + Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access + If not sure try Y. If Y failed, try N. + 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 = your client ID goes here + client_secret = your client secret goes here + auth_url = Optional auth URL + token_url = Optional token URL + token = {"access_token":"xxxxxxxxxxxxxxxxxxxxxxx","token_type":"bearer","refresh_token":"xxxxxxxxxxxxxxxxxx","expiry":"2015-09-06T16:07:39.658438471+01:00"} + -------------------- + y) Yes this is OK + e) Edit this remote + d) Delete this remote + y/e/d> y + +See the remote setup docs for how to set it up on a machine with no +Internet browser available. + +Note that rclone runs a webserver on your local machine to collect the +token as returned from Amazon. This only runs from the moment it opens +your browser to the moment you get back the verification code. This is +on http://127.0.0.1:53682/ and this it may require you to unblock it +temporarily if you are running a host firewall. + +Once configured you can then use rclone like this, + +List directories in top level of your Amazon Drive + + rclone lsd remote: + +List all the files in your Amazon Drive + + rclone ls remote: + +To copy a local directory to an Amazon Drive directory called backup + + rclone copy /home/source remote:backup + +Modification times and hashes + +Amazon Drive doesn't allow modification times to be changed via the API +so these won't be accurate or used for syncing. + +It does support the MD5 hash algorithm, so for a more accurate sync, you +can use the --checksum flag. + +Restricted filename characters + + Character Value Replacement + ----------- ------- ------------- + NUL 0x00 ␀ + / 0x2F / + +Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON +strings. + +Deleting files + +Any files you delete with rclone will end up in the trash. Amazon don't +provide an API to permanently delete files, nor to empty the trash, so +you will have to do that with one of Amazon's apps or via the Amazon +Drive website. As of November 17, 2016, files are automatically deleted +by Amazon from the trash after 30 days. + +Using with non .com Amazon accounts + +Let's say you usually use amazon.co.uk. When you authenticate with +rclone it will take you to an amazon.com page to log in. Your +amazon.co.uk email and password should work here just fine. + +Standard options + +Here are the Standard options specific to amazon cloud drive (Amazon +Drive). + +--acd-client-id + +OAuth Client Id. + +Leave blank normally. + +Properties: + +- Config: client_id +- Env Var: RCLONE_ACD_CLIENT_ID +- Type: string +- Required: false + +--acd-client-secret + +OAuth Client Secret. + +Leave blank normally. + +Properties: + +- Config: client_secret +- Env Var: RCLONE_ACD_CLIENT_SECRET +- Type: string +- Required: false + +Advanced options + +Here are the Advanced options specific to amazon cloud drive (Amazon +Drive). + +--acd-token + +OAuth Access Token as a JSON blob. + +Properties: + +- Config: token +- Env Var: RCLONE_ACD_TOKEN +- Type: string +- Required: false + +--acd-auth-url + +Auth server URL. + +Leave blank to use the provider defaults. + +Properties: + +- Config: auth_url +- Env Var: RCLONE_ACD_AUTH_URL +- Type: string +- Required: false + +--acd-token-url + +Token server url. + +Leave blank to use the provider defaults. + +Properties: + +- Config: token_url +- Env Var: RCLONE_ACD_TOKEN_URL +- Type: string +- Required: false + +--acd-checkpoint + +Checkpoint for internal polling (debug). + +Properties: + +- Config: checkpoint +- Env Var: RCLONE_ACD_CHECKPOINT +- Type: string +- Required: false + +--acd-upload-wait-per-gb + +Additional time per GiB to wait after a failed complete upload to see if +it appears. + +Sometimes Amazon Drive gives an error when a file has been fully +uploaded but the file appears anyway after a little while. This happens +sometimes for files over 1 GiB in size and nearly every time for files +bigger than 10 GiB. This parameter controls the time rclone waits for +the file to appear. + +The default value for this parameter is 3 minutes per GiB, so by default +it will wait 3 minutes for every GiB uploaded to see if the file +appears. + +You can disable this feature by setting it to 0. This may cause conflict +errors as rclone retries the failed upload but the file will most likely +appear correctly eventually. + +These values were determined empirically by observing lots of uploads of +big files for a range of file sizes. + +Upload with the "-v" flag to see more info about what rclone is doing in +this situation. + +Properties: + +- Config: upload_wait_per_gb +- Env Var: RCLONE_ACD_UPLOAD_WAIT_PER_GB +- Type: Duration +- Default: 3m0s + +--acd-templink-threshold + +Files >= this size will be downloaded via their tempLink. + +Files this size or more will be downloaded via their "tempLink". This is +to work around a problem with Amazon Drive which blocks downloads of +files bigger than about 10 GiB. The default for this is 9 GiB which +shouldn't need to be changed. + +To download files above this threshold, rclone requests a "tempLink" +which downloads the file through a temporary URL directly from the +underlying S3 storage. + +Properties: + +- Config: templink_threshold +- Env Var: RCLONE_ACD_TEMPLINK_THRESHOLD +- Type: SizeSuffix +- Default: 9Gi + +--acd-encoding + +The encoding for the backend. + +See the encoding section in the overview for more info. + +Properties: + +- Config: encoding +- Env Var: RCLONE_ACD_ENCODING +- Type: Encoding +- Default: Slash,InvalidUtf8,Dot + +Limitations + +Note that Amazon Drive is case insensitive so you can't have a file +called "Hello.doc" and one called "hello.doc". + +Amazon Drive has rate limiting so you may notice errors in the sync (429 +errors). rclone will automatically retry the sync up to 3 times by +default (see --retries flag) which should hopefully work around this +problem. + +Amazon Drive has an internal limit of file sizes that can be uploaded to +the service. This limit is not officially published, but all files +larger than this will fail. + +At the time of writing (Jan 2016) is in the area of 50 GiB per file. +This means that larger files are likely to fail. + +Unfortunately there is no way for rclone to see that this failure is +because of file size, so it will retry the operation, as any other +failure. To avoid this problem, use --max-size 50000M option to limit +the maximum size of uploaded files. Note that --max-size does not split +files into segments, it only ignores files over this size. + +rclone about is not supported by the Amazon Drive backend. Backends +without this capability cannot determine free space for an rclone mount +or use policy mfs (most free space) as a member of an rclone union +remote. + +See List of backends that do not support rclone about and rclone about + +Amazon S3 Storage Providers + +The S3 backend can be used with a number of different providers: + +- AWS S3 +- Alibaba Cloud (Aliyun) Object Storage System (OSS) +- Ceph +- China Mobile Ecloud Elastic Object Storage (EOS) +- Cloudflare R2 +- Arvan Cloud Object Storage (AOS) +- DigitalOcean Spaces +- Dreamhost +- GCS +- Huawei OBS +- IBM COS S3 +- IDrive e2 +- IONOS Cloud +- Leviia Object Storage +- Liara Object Storage +- Linode Object Storage +- Minio +- Petabox +- Qiniu Cloud Object Storage (Kodo) +- RackCorp Object Storage +- Rclone Serve S3 +- Scaleway +- Seagate Lyve Cloud +- SeaweedFS +- StackPath +- Storj +- Synology C2 Object Storage +- Tencent Cloud Object Storage (COS) +- Wasabi + +Paths are specified as remote:bucket (or remote: for the lsd command.) +You may put subdirectories in too, e.g. remote:bucket/path/to/dir. + +Once you have made a remote (see the provider specific section above) +you can use it like this: + +See all buckets + + rclone lsd remote: + +Make a new bucket + + rclone mkdir remote:bucket + +List the contents of a bucket + + rclone ls remote:bucket + +Sync /home/local/directory to the remote bucket, deleting any excess +files in the bucket. + + rclone sync --interactive /home/local/directory remote:bucket + +Configuration + +Here is an example of making an s3 configuration for the AWS S3 +provider. Most applies to the other providers as well, any differences +are described below. + +First run + + rclone config + +This will guide you through an interactive setup process. + + No remotes found, make a new one? + n) New remote + s) Set configuration password + q) Quit config + n/s/q> n + name> remote + Type of storage to configure. + Choose a number from below, or type in your own value + [snip] + XX / Amazon S3 Compliant Storage Providers including AWS, Ceph, ChinaMobile, ArvanCloud, Dreamhost, IBM COS, Liara, Minio, and Tencent COS + \ "s3" + [snip] + Storage> s3 + Choose your S3 provider. + Choose a number from below, or type in your own value + 1 / Amazon Web Services (AWS) S3 + \ "AWS" + 2 / Ceph Object Storage + \ "Ceph" + 3 / DigitalOcean Spaces + \ "DigitalOcean" + 4 / Dreamhost DreamObjects + \ "Dreamhost" + 5 / IBM COS S3 + \ "IBMCOS" + 6 / Minio Object Storage + \ "Minio" + 7 / Wasabi Object Storage + \ "Wasabi" + 8 / Any other S3 compatible provider + \ "Other" + provider> 1 + Get AWS credentials from runtime (environment variables or EC2/ECS 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> XXX + AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. + secret_access_key> YYY + 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 East (Ohio) Region + 2 | Needs location constraint us-east-2. + \ "us-east-2" + / US West (Oregon) Region + 3 | Needs location constraint us-west-2. + \ "us-west-2" + / US West (Northern California) Region + 4 | Needs location constraint us-west-1. + \ "us-west-1" + / Canada (Central) Region + 5 | Needs location constraint ca-central-1. + \ "ca-central-1" + / EU (Ireland) Region + 6 | Needs location constraint EU or eu-west-1. + \ "eu-west-1" + / EU (London) Region + 7 | Needs location constraint eu-west-2. + \ "eu-west-2" + / EU (Frankfurt) Region + 8 | Needs location constraint eu-central-1. + \ "eu-central-1" + / Asia Pacific (Singapore) Region + 9 | Needs location constraint ap-southeast-1. + \ "ap-southeast-1" + / Asia Pacific (Sydney) Region + 10 | Needs location constraint ap-southeast-2. + \ "ap-southeast-2" + / Asia Pacific (Tokyo) Region + 11 | Needs location constraint ap-northeast-1. + \ "ap-northeast-1" + / Asia Pacific (Seoul) + 12 | Needs location constraint ap-northeast-2. + \ "ap-northeast-2" + / Asia Pacific (Mumbai) + 13 | Needs location constraint ap-south-1. + \ "ap-south-1" + / Asia Pacific (Hong Kong) Region + 14 | Needs location constraint ap-east-1. + \ "ap-east-1" + / South America (Sao Paulo) Region + 15 | Needs location constraint sa-east-1. + \ "sa-east-1" + region> 1 + Endpoint for S3 API. + Leave blank if using AWS to use the default endpoint for the region. + 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 East (Ohio) Region. + \ "us-east-2" + 3 / US West (Oregon) Region. + \ "us-west-2" + 4 / US West (Northern California) Region. + \ "us-west-1" + 5 / Canada (Central) Region. + \ "ca-central-1" + 6 / EU (Ireland) Region. + \ "eu-west-1" + 7 / EU (London) Region. + \ "eu-west-2" + 8 / EU Region. + \ "EU" + 9 / Asia Pacific (Singapore) Region. + \ "ap-southeast-1" + 10 / Asia Pacific (Sydney) Region. + \ "ap-southeast-2" + 11 / Asia Pacific (Tokyo) Region. + \ "ap-northeast-1" + 12 / Asia Pacific (Seoul) + \ "ap-northeast-2" + 13 / Asia Pacific (Mumbai) + \ "ap-south-1" + 14 / Asia Pacific (Hong Kong) + \ "ap-east-1" + 15 / South America (Sao Paulo) Region. + \ "sa-east-1" + location_constraint> 1 + Canned ACL used when creating buckets and/or storing objects in S3. + For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl + Choose a number from below, or type in your own value + 1 / Owner gets FULL_CONTROL. No one else has access rights (default). + \ "private" + 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access. + \ "public-read" + / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. + 3 | Granting this on a bucket is generally not recommended. + \ "public-read-write" + 4 / Owner gets FULL_CONTROL. The AuthenticatedUsers group gets READ access. + \ "authenticated-read" + / Object owner gets FULL_CONTROL. Bucket owner gets READ access. + 5 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \ "bucket-owner-read" + / Both the object owner and the bucket owner get FULL_CONTROL over the object. + 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \ "bucket-owner-full-control" + acl> 1 + The server-side encryption algorithm used when storing this object in S3. + Choose a number from below, or type in your own value + 1 / None + \ "" + 2 / AES256 + \ "AES256" + server_side_encryption> 1 + The storage class to use when storing objects in S3. + Choose a number from below, or type in your own value + 1 / Default + \ "" + 2 / Standard storage class + \ "STANDARD" + 3 / Reduced redundancy storage class + \ "REDUCED_REDUNDANCY" + 4 / Standard Infrequent Access storage class + \ "STANDARD_IA" + 5 / One Zone Infrequent Access storage class + \ "ONEZONE_IA" + 6 / Glacier storage class + \ "GLACIER" + 7 / Glacier Deep Archive storage class + \ "DEEP_ARCHIVE" + 8 / Intelligent-Tiering storage class + \ "INTELLIGENT_TIERING" + 9 / Glacier Instant Retrieval storage class + \ "GLACIER_IR" + storage_class> 1 + Remote config + -------------------- + [remote] + type = s3 + provider = AWS + env_auth = false + access_key_id = XXX + secret_access_key = YYY + region = us-east-1 + endpoint = + location_constraint = + acl = private + server_side_encryption = + storage_class = + -------------------- + y) Yes this is OK + e) Edit this remote + d) Delete this remote + y/e/d> + +Modification times and hashes -Substitution results of the terms named like {dir/} will end with / (or -backslash on Windows), so it is not necessary to include slash in the -usage, for example delete-file {path1/}file1.txt. +Modification times -Benchmarks +The modified time is stored as metadata on the object as +X-Amz-Meta-Mtime as floating point since the epoch, accurate to 1 ns. -This section is work in progress. +If the modification time needs to be updated rclone will attempt to +perform a server side copy to update the modification if the object can +be copied in a single part. In the case the object is larger than 5Gb or +is in Glacier or Glacier Deep Archive storage the object will be +uploaded rather than copied. -Here are a few data points for scale, execution times, and memory usage. +Note that reading this from the object takes an additional HEAD request +as the metadata isn't returned in object listings. -The first set of data was taken between a local disk to Dropbox. The -speedtest.net download speed was ~170 Mbps, and upload speed was ~10 -Mbps. 500 files (~9.5 MB each) had been already synched. 50 files were -added in a new directory, each ~9.5 MB, ~475 MB total. +Hashes - ------------------------------------------------------------------------ - Change Operations and times Overall run - time - ------------------------ ----------------------------------- ----------- - 500 files synched 1x listings for Path1 & Path2 1.5 sec - (nothing to move) +For small objects which weren't uploaded as multipart uploads (objects +sized below --s3-upload-cutoff if uploaded with rclone) rclone uses the +ETag: header as an MD5 checksum. - 500 files synched with 1x listings for Path1 & Path2 1.5 sec - --check-access +However for objects which were uploaded as multipart uploads or with +server side encryption (SSE-AWS or SSE-C) the ETag header is no longer +the MD5 sum of the data, so rclone adds an additional piece of metadata +X-Amz-Meta-Md5chksum which is a base64 encoded MD5 hash (in the same +format as is required for Content-MD5). You can use base64 -d and +hexdump to check this value manually: - 50 new files on remote Queued 50 copies down: 27 sec 29 sec + echo 'VWTGdNx3LyXQDfA0e2Edxw==' | base64 -d | hexdump - Moved local dir Queued 50 copies up: 410 sec, 50 421 sec - deletes up: 9 sec +or you can use rclone check to verify the hashes are OK. - Moved remote dir Queued 50 copies down: 31 sec, 50 33 sec - deletes down: <1 sec +For large objects, calculating this hash can take some time so the +addition of this hash can be disabled with --s3-disable-checksum. This +will mean that these objects do not have an MD5 checksum. - Delete local dir Queued 50 deletes up: 9 sec 13 sec - ------------------------------------------------------------------------ +Note that reading this from the object takes an additional HEAD request +as the metadata isn't returned in object listings. -This next data is from a user's application. They had ~400GB of data -over 1.96 million files being sync'ed between a Windows local disk and -some remote cloud. The file full path length was on average 35 -characters (which factors into load time and RAM required). +Reducing costs -- Loading the prior listing into memory (1.96 million files, listing - file size 140 MB) took ~30 sec and occupied about 1 GB of RAM. -- Getting a fresh listing of the local file system (producing the 140 - MB output file) took about XXX sec. -- Getting a fresh listing of the remote file system (producing the 140 - MB output file) took about XXX sec. The network download speed was - measured at XXX Mb/s. -- Once the prior and current Path1 and Path2 listings were loaded (a - total of four to be loaded, two at a time), determining the deltas - was pretty quick (a few seconds for this test case), and the - transfer time for any files to be copied was dominated by the - network bandwidth. +Avoiding HEAD requests to read the modification time -References +By default, rclone will use the modification time of objects stored in +S3 for syncing. This is stored in object metadata which unfortunately +takes an extra HEAD request to read which can be expensive (in time and +money). -rclone's bisync implementation was derived from the rclonesync-V2 -project, including documentation and test mechanisms, with -[@cjnaz](https://github.com/cjnaz)'s full support and encouragement. +The modification time is used by default for all operations that require +checking the time a file was last updated. It allows rclone to treat the +remote more like a true filesystem, but it is inefficient on S3 because +it requires an extra API call to retrieve the metadata. -rclone bisync is similar in nature to a range of other projects: +The extra API calls can be avoided when syncing (using rclone sync or +rclone copy) in a few different ways, each with its own tradeoffs. -- unison -- syncthing -- cjnaz/rclonesync -- ConorWilliams/rsinc -- jwink3101/syncrclone -- DavideRossi/upback +- --size-only + - Only checks the size of files. + - Uses no extra transactions. + - If the file doesn't change size then rclone won't detect it has + changed. + - rclone sync --size-only /path/to/source s3:bucket +- --checksum + - Checks the size and MD5 checksum of files. + - Uses no extra transactions. + - The most accurate detection of changes possible. + - Will cause the source to read an MD5 checksum which, if it is a + local disk, will cause lots of disk activity. + - If the source and destination are both S3 this is the + recommended flag to use for maximum efficiency. + - rclone sync --checksum /path/to/source s3:bucket +- --update --use-server-modtime + - Uses no extra transactions. + - Modification time becomes the time the object was uploaded. + - For many operations this is sufficient to determine if it needs + uploading. + - Using --update along with --use-server-modtime, avoids the extra + API call and uploads files whose local modification time is + newer than the time it was last uploaded. + - Files created with timestamps in the past will be missed by the + sync. + - rclone sync --update --use-server-modtime /path/to/source s3:bucket -Bisync adopts the differential synchronization technique, which is based -on keeping history of changes performed by both synchronizing sides. See -the Dual Shadow Method section in Neil Fraser's article. +These flags can and should be used in combination with --fast-list - see +below. -Also note a number of academic publications by Benjamin Pierce about -Unison and synchronization in general. +If using rclone mount or any command using the VFS (eg rclone serve) +commands then you might want to consider using the VFS flag --no-modtime +which will stop rclone reading the modification time for every object. +You could also use --use-server-modtime if you are happy with the +modification times of the objects being the time of upload. -Changelog +Avoiding GET requests to read directory listings -v1.64 +Rclone's default directory traversal is to process each directory +individually. This takes one API call per directory. Using the +--fast-list flag will read all info about the objects into memory first +using a smaller number of API calls (one per 1000 objects). See the +rclone docs for more details. -- Fixed an issue causing dry runs to inadvertently commit filter - changes -- Fixed an issue causing --resync to erroneously delete empty folders - and duplicate files unique to Path2 -- --check-access is now enforced during --resync, preventing data loss - in certain user error scenarios -- Fixed an issue causing bisync to consider more files than necessary - due to overbroad filters during delete operations -- Improved detection of false positive change conflicts (identical - files are now left alone instead of renamed) -- Added support for --create-empty-src-dirs -- Added experimental --resilient mode to allow recovery from - self-correctable errors -- Added new --ignore-listing-checksum flag to distinguish from - --ignore-checksum -- Performance improvements for large remotes -- Documentation and testing improvements + rclone sync --fast-list --checksum /path/to/source s3:bucket -Release signing +--fast-list trades off API transactions for memory use. As a rough guide +rclone uses 1k of memory per object stored, so using --fast-list on a +sync of a million objects will use roughly 1 GiB of RAM. -The hashes of the binary artefacts of the rclone release are signed with -a public PGP/GPG key. This can be verified manually as described below. +If you are only copying a small number of files into a big repository +then using --no-traverse is a good idea. This finds objects directly +instead of through directory listings. You can do a "top-up" sync very +cheaply by using --max-age and --no-traverse to copy only recent files, +eg -The same mechanism is also used by rclone selfupdate to verify that the -release has not been tampered with before the new update is installed. -This checks the SHA256 hash and the signature with a public key compiled -into the rclone binary. + rclone copy --max-age 24h --no-traverse /path/to/source s3:bucket -Release signing key +You'd then do a full rclone sync less often. + +Note that --fast-list isn't required in the top-up sync. + +Avoiding HEAD requests after PUT + +By default, rclone will HEAD every object it uploads. It does this to +check the object got uploaded correctly. + +You can disable this with the --s3-no-head option - see there for more +details. + +Setting this flag increases the chance for undetected upload failures. + +Versions + +When bucket versioning is enabled (this can be done with rclone with the +rclone backend versioning command) when rclone uploads a new version of +a file it creates a new version of it Likewise when you delete a file, +the old version will be marked hidden and still be available. + +Old versions of files, where available, are visible using the +--s3-versions flag. + +It is also possible to view a bucket as it was at a certain point in +time, using the --s3-version-at flag. This will show the file versions +as they were at that time, showing files that have been deleted +afterwards, and hiding files that were created since. + +If you wish to remove all the old versions then you can use the +rclone backend cleanup-hidden remote:bucket command which will delete +all the old hidden versions of files, leaving the current ones intact. +You can also supply a path and only old versions under that path will be +deleted, e.g. rclone backend cleanup-hidden remote:bucket/path/to/stuff. + +When you purge a bucket, the current and the old versions will be +deleted then the bucket will be deleted. + +However delete will cause the current versions of the files to become +hidden old versions. + +Here is a session showing the listing and retrieval of an old version +followed by a cleanup of the old versions. + +Show current version and all the versions with --s3-versions flag. + + $ rclone -q ls s3:cleanup-test + 9 one.txt + + $ rclone -q --s3-versions ls s3:cleanup-test + 9 one.txt + 8 one-v2016-07-04-141032-000.txt + 16 one-v2016-07-04-141003-000.txt + 15 one-v2016-07-02-155621-000.txt + +Retrieve an old version + + $ rclone -q --s3-versions copy s3:cleanup-test/one-v2016-07-04-141003-000.txt /tmp + + $ ls -l /tmp/one-v2016-07-04-141003-000.txt + -rw-rw-r-- 1 ncw ncw 16 Jul 2 17:46 /tmp/one-v2016-07-04-141003-000.txt + +Clean up all the old versions and show that they've gone. + + $ rclone -q backend cleanup-hidden s3:cleanup-test + + $ rclone -q ls s3:cleanup-test + 9 one.txt + + $ rclone -q --s3-versions ls s3:cleanup-test + 9 one.txt + +Versions naming caveat + +When using --s3-versions flag rclone is relying on the file name to work +out whether the objects are versions or not. Versions' names are created +by inserting timestamp between file name and its extension. + + 9 file.txt + 8 file-v2023-07-17-161032-000.txt + 16 file-v2023-06-15-141003-000.txt + +If there are real files present with the same names as versions, then +behaviour of --s3-versions can be unpredictable. + +Cleanup + +If you run rclone cleanup s3:bucket then it will remove all pending +multipart uploads older than 24 hours. You can use the --interactive/i +or --dry-run flag to see exactly what it will do. If you want more +control over the expiry date then run +rclone backend cleanup s3:bucket -o max-age=1h to expire all uploads +older than one hour. You can use +rclone backend list-multipart-uploads s3:bucket to see the pending +multipart uploads. + +Restricted filename characters + +S3 allows any valid UTF-8 string as a key. + +Invalid UTF-8 bytes will be replaced, as they can't be used in XML. + +The following characters are replaced since these are problematic when +dealing with the REST API: + + Character Value Replacement + ----------- ------- ------------- + NUL 0x00 ␀ + / 0x2F / + +The encoding will also encode these file names as they don't seem to +work with the SDK properly: + + File name Replacement + ----------- ------------- + . . + .. .. + +Multipart uploads + +rclone supports multipart uploads with S3 which means that it can upload +files bigger than 5 GiB. + +Note that files uploaded both with multipart upload and through crypt +remotes do not have MD5 sums. + +rclone switches from single part uploads to multipart uploads at the +point specified by --s3-upload-cutoff. This can be a maximum of 5 GiB +and a minimum of 0 (ie always upload multipart files). + +The chunk sizes used in the multipart upload are specified by +--s3-chunk-size and the number of chunks uploaded concurrently is +specified by --s3-upload-concurrency. + +Multipart uploads will use --transfers * --s3-upload-concurrency * +--s3-chunk-size extra memory. Single part uploads to not use extra +memory. + +Single part transfers can be faster than multipart transfers or slower +depending on your latency from S3 - the more latency, the more likely +single part transfers will be faster. + +Increasing --s3-upload-concurrency will increase throughput (8 would be +a sensible value) and increasing --s3-chunk-size also increases +throughput (16M would be sensible). Increasing either of these will use +more memory. The default values are high enough to gain most of the +possible performance without using too much memory. + +Buckets and Regions + +With Amazon S3 you can list buckets (rclone lsd) using any region, but +you can only access the content of a bucket from the region it was +created in. If you attempt to access a bucket from the wrong region, you +will get an error, incorrect region, the bucket is not in 'XXX' region. + +Authentication + +There are a number of ways to supply rclone with a set of AWS +credentials, with and without using the environment. + +The different authentication methods are tried in this order: + +- Directly in the rclone configuration file (env_auth = false in the + config file): + - access_key_id and secret_access_key are required. + - session_token can be optionally set when using AWS STS. +- Runtime configuration (env_auth = true in the config file): + - Export the following environment variables before running + rclone: + - Access Key ID: AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY + - Secret Access Key: AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY + - Session Token: AWS_SESSION_TOKEN (optional) + - Or, use a named profile: + - Profile files are standard files used by AWS CLI tools + - By default it will use the profile in your home directory + (e.g. ~/.aws/credentials on unix based systems) file and the + "default" profile, to change set these environment + variables: + - AWS_SHARED_CREDENTIALS_FILE to control which file. + - AWS_PROFILE to control which profile to use. + - Or, run rclone in an ECS task with an IAM role (AWS only). + - Or, run rclone on an EC2 instance with an IAM role (AWS only). + - Or, run rclone in an EKS pod with an IAM role that is associated + with a service account (AWS only). + +If none of these option actually end up providing rclone with AWS +credentials then S3 interaction will be non-authenticated (see below). + +S3 Permissions + +When using the sync subcommand of rclone the following minimum +permissions are required to be available on the bucket being written to: + +- ListBucket +- DeleteObject +- GetObject +- PutObject +- PutObjectACL + +When using the lsd subcommand, the ListAllMyBuckets permission is +required. + +Example policy: + + { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "AWS": "arn:aws:iam::USER_SID:user/USER_NAME" + }, + "Action": [ + "s3:ListBucket", + "s3:DeleteObject", + "s3:GetObject", + "s3:PutObject", + "s3:PutObjectAcl" + ], + "Resource": [ + "arn:aws:s3:::BUCKET_NAME/*", + "arn:aws:s3:::BUCKET_NAME" + ] + }, + { + "Effect": "Allow", + "Action": "s3:ListAllMyBuckets", + "Resource": "arn:aws:s3:::*" + } + ] + } -You may obtain the release signing key from: +Notes on above: -- From KEYS on this website - this file contains all past signing keys - also. -- The git repository hosted on GitHub - - https://github.com/rclone/rclone/blob/master/docs/content/KEYS -- gpg --keyserver hkps://keys.openpgp.org --search nick@craig-wood.com -- gpg --keyserver hkps://keyserver.ubuntu.com --search nick@craig-wood.com -- https://www.craig-wood.com/nick/pub/pgp-key.txt +1. This is a policy that can be used when creating bucket. It assumes + that USER_NAME has been created. +2. The Resource entry must include both resource ARNs, as one implies + the bucket and the other implies the bucket's objects. -After importing the key, verify that the fingerprint of one of the keys -matches: FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA as this key is used -for signing. +For reference, here's an Ansible script that will generate one or more +buckets that will work with rclone sync. -We recommend that you cross-check the fingerprint shown above through -the domains listed below. By cross-checking the integrity of the -fingerprint across multiple domains you can be confident that you -obtained the correct key. +Key Management System (KMS) -- The source for this page on GitHub. -- Through DNS dig key.rclone.org txt +If you are using server-side encryption with KMS then you must make sure +rclone is configured with server_side_encryption = aws:kms otherwise you +will find you can't transfer small objects - these will create checksum +errors. -If you find anything that doesn't not match, please contact the -developers at once. +Glacier and Glacier Deep Archive -How to verify the release +You can upload objects using the glacier storage class or transition +them to glacier using a lifecycle policy. The bucket can still be synced +or copied into normally, but if rclone tries to access data from the +glacier storage class you will see an error like below. -In the release directory you will see the release files and some files -called MD5SUMS, SHA1SUMS and SHA256SUMS. + 2017/09/11 19:07:43 Failed to sync: failed to open source object: Object in GLACIER, restore first: path/to/file - $ rclone lsf --http-url https://downloads.rclone.org/v1.63.1 :http: - MD5SUMS - SHA1SUMS - SHA256SUMS - rclone-v1.63.1-freebsd-386.zip - rclone-v1.63.1-freebsd-amd64.zip - ... - rclone-v1.63.1-windows-arm64.zip - rclone-v1.63.1.tar.gz - version.txt +In this case you need to restore the object(s) in question before using +rclone. -The MD5SUMS, SHA1SUMS and SHA256SUMS contain hashes of the binary files -in the release directory along with a signature. +Note that rclone only speaks the S3 API it does not speak the Glacier +Vault API, so rclone cannot directly access Glacier Vaults. -For example: +Object-lock enabled S3 bucket - $ rclone cat --http-url https://downloads.rclone.org/v1.63.1 :http:SHA256SUMS - -----BEGIN PGP SIGNED MESSAGE----- - Hash: SHA1 +According to AWS's documentation on S3 Object Lock: - f6d1b2d7477475ce681bdce8cb56f7870f174cb6b2a9ac5d7b3764296ea4a113 rclone-v1.63.1-freebsd-386.zip - 7266febec1f01a25d6575de51c44ddf749071a4950a6384e4164954dff7ac37e rclone-v1.63.1-freebsd-amd64.zip - ... - 66ca083757fb22198309b73879831ed2b42309892394bf193ff95c75dff69c73 rclone-v1.63.1-windows-amd64.zip - bbb47c16882b6c5f2e8c1b04229378e28f68734c613321ef0ea2263760f74cd0 rclone-v1.63.1-windows-arm64.zip - -----BEGIN PGP SIGNATURE----- + If you configure a default retention period on a bucket, requests to + upload objects in such a bucket must include the Content-MD5 header. - iF0EARECAB0WIQT79zfs6firGGBL0qyTk14C/ztU+gUCZLVKJQAKCRCTk14C/ztU - +pZuAJ0XJ+QWLP/3jCtkmgcgc4KAwd/rrwCcCRZQ7E+oye1FPY46HOVzCFU3L7g= - =8qrL - -----END PGP SIGNATURE----- +As mentioned in the Modification times and hashes section, small files +that are not uploaded as multipart, use a different tag, causing the +upload to fail. A simple solution is to set the --s3-upload-cutoff 0 and +force all the files to be uploaded as multipart. -Download the files +Standard options -The first step is to download the binary and SUMs file and verify that -the SUMs you have downloaded match. Here we download -rclone-v1.63.1-windows-amd64.zip - choose the binary (or binaries) -appropriate to your architecture. We've also chosen the SHA256SUMS as -these are the most secure. You could verify the other types of hash also -for extra security. rclone selfupdate verifies just the SHA256SUMS. +Here are the Standard options specific to s3 (Amazon S3 Compliant +Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, +Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, +IONOS, LyveCloud, Leviia, Liara, Linode, Minio, Netease, Petabox, +RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, +TencentCOS, Wasabi, Qiniu and others). - $ mkdir /tmp/check - $ cd /tmp/check - $ rclone copy --http-url https://downloads.rclone.org/v1.63.1 :http:SHA256SUMS . - $ rclone copy --http-url https://downloads.rclone.org/v1.63.1 :http:rclone-v1.63.1-windows-amd64.zip . +--s3-provider -Verify the signatures +Choose your S3 provider. -First verify the signatures on the SHA256 file. +Properties: -Import the key. See above for ways to verify this key is correct. +- Config: provider +- Env Var: RCLONE_S3_PROVIDER +- Type: string +- Required: false +- Examples: + - "AWS" + - Amazon Web Services (AWS) S3 + - "Alibaba" + - Alibaba Cloud Object Storage System (OSS) formerly Aliyun + - "ArvanCloud" + - Arvan Cloud Object Storage (AOS) + - "Ceph" + - Ceph Object Storage + - "ChinaMobile" + - China Mobile Ecloud Elastic Object Storage (EOS) + - "Cloudflare" + - Cloudflare R2 Storage + - "DigitalOcean" + - DigitalOcean Spaces + - "Dreamhost" + - Dreamhost DreamObjects + - "GCS" + - Google Cloud Storage + - "HuaweiOBS" + - Huawei Object Storage Service + - "IBMCOS" + - IBM COS S3 + - "IDrive" + - IDrive e2 + - "IONOS" + - IONOS Cloud + - "LyveCloud" + - Seagate Lyve Cloud + - "Leviia" + - Leviia Object Storage + - "Liara" + - Liara Object Storage + - "Linode" + - Linode Object Storage + - "Minio" + - Minio Object Storage + - "Netease" + - Netease Object Storage (NOS) + - "Petabox" + - Petabox Object Storage + - "RackCorp" + - RackCorp Object Storage + - "Rclone" + - Rclone S3 Server + - "Scaleway" + - Scaleway Object Storage + - "SeaweedFS" + - SeaweedFS S3 + - "StackPath" + - StackPath Object Storage + - "Storj" + - Storj (S3 Compatible Gateway) + - "Synology" + - Synology C2 Object Storage + - "TencentCOS" + - Tencent Cloud Object Storage (COS) + - "Wasabi" + - Wasabi Object Storage + - "Qiniu" + - Qiniu Object Storage (Kodo) + - "Other" + - Any other S3 compatible provider - $ gpg --keyserver keyserver.ubuntu.com --receive-keys FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA - gpg: key 93935E02FF3B54FA: public key "Nick Craig-Wood " imported - gpg: Total number processed: 1 - gpg: imported: 1 +--s3-env-auth -Then check the signature: +Get AWS credentials from runtime (environment variables or EC2/ECS meta +data if no env vars). - $ gpg --verify SHA256SUMS - gpg: Signature made Mon 17 Jul 2023 15:03:17 BST - gpg: using DSA key FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA - gpg: Good signature from "Nick Craig-Wood " [ultimate] +Only applies if access_key_id and secret_access_key is blank. -Verify the signature was good and is using the fingerprint shown above. +Properties: -Repeat for MD5SUMS and SHA1SUMS if desired. +- Config: env_auth +- Env Var: RCLONE_S3_ENV_AUTH +- Type: bool +- Default: false +- Examples: + - "false" + - Enter AWS credentials in the next step. + - "true" + - Get AWS credentials from the environment (env vars or IAM). -Verify the hashes +--s3-access-key-id -Now that we know the signatures on the hashes are OK we can verify the -binaries match the hashes, completing the verification. +AWS Access Key ID. - $ sha256sum -c SHA256SUMS 2>&1 | grep OK - rclone-v1.63.1-windows-amd64.zip: OK +Leave blank for anonymous access or runtime credentials. -Or do the check with rclone +Properties: - $ rclone hashsum sha256 -C SHA256SUMS rclone-v1.63.1-windows-amd64.zip - 2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 0 - 2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 1 - 2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 49 - 2023/09/11 10:53:58 NOTICE: SHA256SUMS: 4 warning(s) suppressed... - = rclone-v1.63.1-windows-amd64.zip - 2023/09/11 10:53:58 NOTICE: Local file system at /tmp/check: 0 differences found - 2023/09/11 10:53:58 NOTICE: Local file system at /tmp/check: 1 matching files +- Config: access_key_id +- Env Var: RCLONE_S3_ACCESS_KEY_ID +- Type: string +- Required: false -Verify signatures and hashes together +--s3-secret-access-key -You can verify the signatures and hashes in one command line like this: +AWS Secret Access Key (password). - $ gpg --decrypt SHA256SUMS | sha256sum -c --ignore-missing - gpg: Signature made Mon 17 Jul 2023 15:03:17 BST - gpg: using DSA key FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA - gpg: Good signature from "Nick Craig-Wood " [ultimate] - gpg: aka "Nick Craig-Wood " [unknown] - rclone-v1.63.1-windows-amd64.zip: OK +Leave blank for anonymous access or runtime credentials. -1Fichier +Properties: -This is a backend for the 1fichier cloud storage service. Note that a -Premium subscription is required to use the API. +- Config: secret_access_key +- Env Var: RCLONE_S3_SECRET_ACCESS_KEY +- Type: string +- Required: false -Paths are specified as remote:path +--s3-region -Paths may be as deep as required, e.g. remote:directory/subdirectory. +Region to connect to. -Configuration +Properties: -The initial setup for 1Fichier involves getting the API key from the -website which you need to do in your browser. +- Config: region +- Env Var: RCLONE_S3_REGION +- Provider: AWS +- Type: string +- Required: false +- Examples: + - "us-east-1" + - The default endpoint - a good choice if you are unsure. + - US Region, Northern Virginia, or Pacific Northwest. + - Leave location constraint empty. + - "us-east-2" + - US East (Ohio) Region. + - Needs location constraint us-east-2. + - "us-west-1" + - US West (Northern California) Region. + - Needs location constraint us-west-1. + - "us-west-2" + - US West (Oregon) Region. + - Needs location constraint us-west-2. + - "ca-central-1" + - Canada (Central) Region. + - Needs location constraint ca-central-1. + - "eu-west-1" + - EU (Ireland) Region. + - Needs location constraint EU or eu-west-1. + - "eu-west-2" + - EU (London) Region. + - Needs location constraint eu-west-2. + - "eu-west-3" + - EU (Paris) Region. + - Needs location constraint eu-west-3. + - "eu-north-1" + - EU (Stockholm) Region. + - Needs location constraint eu-north-1. + - "eu-south-1" + - EU (Milan) Region. + - Needs location constraint eu-south-1. + - "eu-central-1" + - EU (Frankfurt) Region. + - Needs location constraint eu-central-1. + - "ap-southeast-1" + - Asia Pacific (Singapore) Region. + - Needs location constraint ap-southeast-1. + - "ap-southeast-2" + - Asia Pacific (Sydney) Region. + - Needs location constraint ap-southeast-2. + - "ap-northeast-1" + - Asia Pacific (Tokyo) Region. + - Needs location constraint ap-northeast-1. + - "ap-northeast-2" + - Asia Pacific (Seoul). + - Needs location constraint ap-northeast-2. + - "ap-northeast-3" + - Asia Pacific (Osaka-Local). + - Needs location constraint ap-northeast-3. + - "ap-south-1" + - Asia Pacific (Mumbai). + - Needs location constraint ap-south-1. + - "ap-east-1" + - Asia Pacific (Hong Kong) Region. + - Needs location constraint ap-east-1. + - "sa-east-1" + - South America (Sao Paulo) Region. + - Needs location constraint sa-east-1. + - "me-south-1" + - Middle East (Bahrain) Region. + - Needs location constraint me-south-1. + - "af-south-1" + - Africa (Cape Town) Region. + - Needs location constraint af-south-1. + - "cn-north-1" + - China (Beijing) Region. + - Needs location constraint cn-north-1. + - "cn-northwest-1" + - China (Ningxia) Region. + - Needs location constraint cn-northwest-1. + - "us-gov-east-1" + - AWS GovCloud (US-East) Region. + - Needs location constraint us-gov-east-1. + - "us-gov-west-1" + - AWS GovCloud (US) Region. + - Needs location constraint us-gov-west-1. -Here is an example of how to make a remote called remote. First run: +--s3-endpoint - rclone config +Endpoint for S3 API. -This will guide you through an interactive setup process: +Leave blank if using AWS to use the default endpoint for the region. - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> remote - Type of storage to configure. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - [snip] - XX / 1Fichier - \ "fichier" - [snip] - Storage> fichier - ** See help for fichier backend at: https://rclone.org/fichier/ ** +Properties: - Your API Key, get it from https://1fichier.com/console/params.pl - Enter a string value. Press Enter for the default (""). - api_key> example_key +- Config: endpoint +- Env Var: RCLONE_S3_ENDPOINT +- Provider: AWS +- Type: string +- Required: false - Edit advanced config? (y/n) - y) Yes - n) No - y/n> - Remote config - -------------------- - [remote] - type = fichier - api_key = example_key - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y +--s3-location-constraint -Once configured you can then use rclone like this, +Location constraint - must be set to match the Region. -List directories in top level of your 1Fichier account +Used when creating buckets only. - rclone lsd remote: +Properties: -List all the files in your 1Fichier account +- Config: location_constraint +- Env Var: RCLONE_S3_LOCATION_CONSTRAINT +- Provider: AWS +- Type: string +- Required: false +- Examples: + - "" + - Empty for US Region, Northern Virginia, or Pacific Northwest + - "us-east-2" + - US East (Ohio) Region + - "us-west-1" + - US West (Northern California) Region + - "us-west-2" + - US West (Oregon) Region + - "ca-central-1" + - Canada (Central) Region + - "eu-west-1" + - EU (Ireland) Region + - "eu-west-2" + - EU (London) Region + - "eu-west-3" + - EU (Paris) Region + - "eu-north-1" + - EU (Stockholm) Region + - "eu-south-1" + - EU (Milan) Region + - "EU" + - EU Region + - "ap-southeast-1" + - Asia Pacific (Singapore) Region + - "ap-southeast-2" + - Asia Pacific (Sydney) Region + - "ap-northeast-1" + - Asia Pacific (Tokyo) Region + - "ap-northeast-2" + - Asia Pacific (Seoul) Region + - "ap-northeast-3" + - Asia Pacific (Osaka-Local) Region + - "ap-south-1" + - Asia Pacific (Mumbai) Region + - "ap-east-1" + - Asia Pacific (Hong Kong) Region + - "sa-east-1" + - South America (Sao Paulo) Region + - "me-south-1" + - Middle East (Bahrain) Region + - "af-south-1" + - Africa (Cape Town) Region + - "cn-north-1" + - China (Beijing) Region + - "cn-northwest-1" + - China (Ningxia) Region + - "us-gov-east-1" + - AWS GovCloud (US-East) Region + - "us-gov-west-1" + - AWS GovCloud (US) Region - rclone ls remote: +--s3-acl -To copy a local directory to a 1Fichier directory called backup +Canned ACL used when creating buckets and storing or copying objects. - rclone copy /home/source remote:backup +This ACL is used for creating objects and if bucket_acl isn't set, for +creating buckets too. -Modified time and hashes +For more info visit +https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -1Fichier does not support modification times. It supports the Whirlpool -hash algorithm. +Note that this ACL is applied when server-side copying objects as S3 +doesn't copy the ACL from the source but rather writes a fresh one. -Duplicated files +If the acl is an empty string then no X-Amz-Acl: header is added and the +default (private) will be used. -1Fichier can have two files with exactly the same name and path (unlike -a normal file system). +Properties: -Duplicated files cause problems with the syncing and you will see -messages in the log about duplicates. +- Config: acl +- Env Var: RCLONE_S3_ACL +- Provider: !Storj,Synology,Cloudflare +- Type: string +- Required: false +- Examples: + - "default" + - Owner gets Full_CONTROL. + - No one else has access rights (default). + - "private" + - Owner gets FULL_CONTROL. + - No one else has access rights (default). + - "public-read" + - Owner gets FULL_CONTROL. + - The AllUsers group gets READ access. + - "public-read-write" + - Owner gets FULL_CONTROL. + - The AllUsers group gets READ and WRITE access. + - Granting this on a bucket is generally not recommended. + - "authenticated-read" + - Owner gets FULL_CONTROL. + - The AuthenticatedUsers group gets READ access. + - "bucket-owner-read" + - Object owner gets FULL_CONTROL. + - Bucket owner gets READ access. + - If you specify this canned ACL when creating a bucket, + Amazon S3 ignores it. + - "bucket-owner-full-control" + - Both the object owner and the bucket owner get FULL_CONTROL + over the object. + - If you specify this canned ACL when creating a bucket, + Amazon S3 ignores it. + - "private" + - Owner gets FULL_CONTROL. + - No one else has access rights (default). + - This acl is available on IBM Cloud (Infra), IBM Cloud + (Storage), On-Premise COS. + - "public-read" + - Owner gets FULL_CONTROL. + - The AllUsers group gets READ access. + - This acl is available on IBM Cloud (Infra), IBM Cloud + (Storage), On-Premise IBM COS. + - "public-read-write" + - Owner gets FULL_CONTROL. + - The AllUsers group gets READ and WRITE access. + - This acl is available on IBM Cloud (Infra), On-Premise IBM + COS. + - "authenticated-read" + - Owner gets FULL_CONTROL. + - The AuthenticatedUsers group gets READ access. + - Not supported on Buckets. + - This acl is available on IBM Cloud (Infra) and On-Premise + IBM COS. -Restricted filename characters +--s3-server-side-encryption -In addition to the default restricted characters set the following -characters are also replaced: +The server-side encryption algorithm used when storing this object in +S3. - Character Value Replacement - ----------- ------- ------------- - \ 0x5C \ - < 0x3C < - > 0x3E > - " 0x22 " - $ 0x24 $ - ` 0x60 ` - ' 0x27 ' +Properties: -File names can also not start or end with the following characters. -These only get replaced if they are the first or last character in the -name: +- Config: server_side_encryption +- Env Var: RCLONE_S3_SERVER_SIDE_ENCRYPTION +- Provider: AWS,Ceph,ChinaMobile,Minio +- Type: string +- Required: false +- Examples: + - "" + - None + - "AES256" + - AES256 + - "aws:kms" + - aws:kms - Character Value Replacement - ----------- ------- ------------- - SP 0x20 ␠ +--s3-sse-kms-key-id -Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON -strings. +If using KMS ID you must provide the ARN of Key. -Standard options +Properties: -Here are the Standard options specific to fichier (1Fichier). +- Config: sse_kms_key_id +- Env Var: RCLONE_S3_SSE_KMS_KEY_ID +- Provider: AWS,Ceph,Minio +- Type: string +- Required: false +- Examples: + - "" + - None + - "arn:aws:kms:us-east-1:*" + - arn:aws:kms:* ---fichier-api-key +--s3-storage-class -Your API Key, get it from https://1fichier.com/console/params.pl. +The storage class to use when storing new objects in S3. Properties: -- Config: api_key -- Env Var: RCLONE_FICHIER_API_KEY +- Config: storage_class +- Env Var: RCLONE_S3_STORAGE_CLASS +- Provider: AWS - Type: string - Required: false +- Examples: + - "" + - Default + - "STANDARD" + - Standard storage class + - "REDUCED_REDUNDANCY" + - Reduced redundancy storage class + - "STANDARD_IA" + - Standard Infrequent Access storage class + - "ONEZONE_IA" + - One Zone Infrequent Access storage class + - "GLACIER" + - Glacier storage class + - "DEEP_ARCHIVE" + - Glacier Deep Archive storage class + - "INTELLIGENT_TIERING" + - Intelligent-Tiering storage class + - "GLACIER_IR" + - Glacier Instant Retrieval storage class Advanced options -Here are the Advanced options specific to fichier (1Fichier). +Here are the Advanced options specific to s3 (Amazon S3 Compliant +Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, +Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, +IONOS, LyveCloud, Leviia, Liara, Linode, Minio, Netease, Petabox, +RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, +TencentCOS, Wasabi, Qiniu and others). ---fichier-shared-folder +--s3-bucket-acl -If you want to download a shared folder, add this parameter. +Canned ACL used when creating buckets. + +For more info visit +https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl + +Note that this ACL is applied when only when creating buckets. If it +isn't set then "acl" is used instead. + +If the "acl" and "bucket_acl" are empty strings then no X-Amz-Acl: +header is added and the default (private) will be used. Properties: -- Config: shared_folder -- Env Var: RCLONE_FICHIER_SHARED_FOLDER +- Config: bucket_acl +- Env Var: RCLONE_S3_BUCKET_ACL - Type: string - Required: false +- Examples: + - "private" + - Owner gets FULL_CONTROL. + - No one else has access rights (default). + - "public-read" + - Owner gets FULL_CONTROL. + - The AllUsers group gets READ access. + - "public-read-write" + - Owner gets FULL_CONTROL. + - The AllUsers group gets READ and WRITE access. + - Granting this on a bucket is generally not recommended. + - "authenticated-read" + - Owner gets FULL_CONTROL. + - The AuthenticatedUsers group gets READ access. ---fichier-file-password +--s3-requester-pays -If you want to download a shared file that is password protected, add -this parameter. +Enables requester pays option when interacting with S3 bucket. -NB Input to this must be obscured - see rclone obscure. +Properties: + +- Config: requester_pays +- Env Var: RCLONE_S3_REQUESTER_PAYS +- Provider: AWS +- Type: bool +- Default: false + +--s3-sse-customer-algorithm + +If using SSE-C, the server-side encryption algorithm used when storing +this object in S3. Properties: -- Config: file_password -- Env Var: RCLONE_FICHIER_FILE_PASSWORD +- Config: sse_customer_algorithm +- Env Var: RCLONE_S3_SSE_CUSTOMER_ALGORITHM +- Provider: AWS,Ceph,ChinaMobile,Minio - Type: string - Required: false +- Examples: + - "" + - None + - "AES256" + - AES256 ---fichier-folder-password +--s3-sse-customer-key -If you want to list the files in a shared folder that is password -protected, add this parameter. +To use SSE-C you may provide the secret encryption key used to +encrypt/decrypt your data. -NB Input to this must be obscured - see rclone obscure. +Alternatively you can provide --sse-customer-key-base64. Properties: -- Config: folder_password -- Env Var: RCLONE_FICHIER_FOLDER_PASSWORD +- Config: sse_customer_key +- Env Var: RCLONE_S3_SSE_CUSTOMER_KEY +- Provider: AWS,Ceph,ChinaMobile,Minio - Type: string - Required: false +- Examples: + - "" + - None ---fichier-cdn +--s3-sse-customer-key-base64 -Set if you wish to use CDN download links. +If using SSE-C you must provide the secret encryption key encoded in +base64 format to encrypt/decrypt your data. + +Alternatively you can provide --sse-customer-key. Properties: -- Config: cdn -- Env Var: RCLONE_FICHIER_CDN -- Type: bool -- Default: false +- Config: sse_customer_key_base64 +- Env Var: RCLONE_S3_SSE_CUSTOMER_KEY_BASE64 +- Provider: AWS,Ceph,ChinaMobile,Minio +- Type: string +- Required: false +- Examples: + - "" + - None ---fichier-encoding +--s3-sse-customer-key-md5 -The encoding for the backend. +If using SSE-C you may provide the secret encryption key MD5 checksum +(optional). -See the encoding section in the overview for more info. +If you leave it blank, this is calculated automatically from the +sse_customer_key provided. Properties: -- Config: encoding -- Env Var: RCLONE_FICHIER_ENCODING -- Type: MultiEncoder -- Default: - Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot - -Limitations - -rclone about is not supported by the 1Fichier backend. Backends without -this capability cannot determine free space for an rclone mount or use -policy mfs (most free space) as a member of an rclone union remote. - -See List of backends that do not support rclone about and rclone about +- Config: sse_customer_key_md5 +- Env Var: RCLONE_S3_SSE_CUSTOMER_KEY_MD5 +- Provider: AWS,Ceph,ChinaMobile,Minio +- Type: string +- Required: false +- Examples: + - "" + - None -Alias +--s3-upload-cutoff -The alias remote provides a new name for another remote. +Cutoff for switching to chunked upload. -Paths may be as deep as required or a local path, e.g. -remote:directory/subdirectory or /directory/subdirectory. +Any files larger than this will be uploaded in chunks of chunk_size. The +minimum is 0 and the maximum is 5 GiB. -During the initial setup with rclone config you will specify the target -remote. The target remote can either be a local path or another remote. +Properties: -Subfolders can be used in target remote. Assume an alias remote named -backup with the target mydrive:private/backup. Invoking -rclone mkdir backup:desktop is exactly the same as invoking -rclone mkdir mydrive:private/backup/desktop. +- Config: upload_cutoff +- Env Var: RCLONE_S3_UPLOAD_CUTOFF +- Type: SizeSuffix +- Default: 200Mi -There will be no special handling of paths containing .. segments. -Invoking rclone mkdir backup:../desktop is exactly the same as invoking -rclone mkdir mydrive:private/backup/../desktop. The empty path is not -allowed as a remote. To alias the current directory use . instead. +--s3-chunk-size -The target remote can also be a connection string. This can be used to -modify the config of a remote for different uses, e.g. the alias -myDriveTrash with the target remote myDrive,trashed_only: can be used to -only show the trashed files in myDrive. +Chunk size to use for uploading. -Configuration +When uploading files larger than upload_cutoff or files with unknown +size (e.g. from "rclone rcat" or uploaded with "rclone mount" or google +photos or google docs) they will be uploaded as multipart uploads using +this chunk size. -Here is an example of how to make an alias called remote for local -folder. First run: +Note that "--s3-upload-concurrency" chunks of this size are buffered in +memory per transfer. - rclone config +If you are transferring large files over high-speed links and you have +enough memory, then increasing this will speed up the transfers. -This will guide you through an interactive setup process: +Rclone will automatically increase the chunk size when uploading a large +file of known size to stay below the 10,000 chunks limit. - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> remote - Type of storage to configure. - Choose a number from below, or type in your own value - [snip] - XX / Alias for an existing remote - \ "alias" - [snip] - Storage> alias - Remote or path to alias. - Can be "myremote:path/to/dir", "myremote:bucket", "myremote:" or "/local/path". - remote> /mnt/storage/backup - Remote config - -------------------- - [remote] - remote = /mnt/storage/backup - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y - Current remotes: +Files of unknown size are uploaded with the configured chunk_size. Since +the default chunk size is 5 MiB and there can be at most 10,000 chunks, +this means that by default the maximum size of a file you can stream +upload is 48 GiB. If you wish to stream upload larger files then you +will need to increase chunk_size. - Name Type - ==== ==== - remote alias +Increasing the chunk size decreases the accuracy of the progress +statistics displayed with "-P" flag. Rclone treats chunk as sent when +it's buffered by the AWS SDK, when in fact it may still be uploading. A +bigger chunk size means a bigger AWS SDK buffer and progress reporting +more deviating from the truth. - e) Edit existing remote - n) New remote - d) Delete remote - r) Rename remote - c) Copy remote - s) Set configuration password - q) Quit config - e/n/d/r/c/s/q> q +Properties: -Once configured you can then use rclone like this, +- Config: chunk_size +- Env Var: RCLONE_S3_CHUNK_SIZE +- Type: SizeSuffix +- Default: 5Mi -List directories in top level in /mnt/storage/backup +--s3-max-upload-parts - rclone lsd remote: +Maximum number of parts in a multipart upload. -List all the files in /mnt/storage/backup +This option defines the maximum number of multipart chunks to use when +doing a multipart upload. - rclone ls remote: +This can be useful if a service does not support the AWS S3 +specification of 10,000 chunks. -Copy another local directory to the alias directory called source +Rclone will automatically increase the chunk size when uploading a large +file of a known size to stay below this number of chunks limit. - rclone copy /home/source remote:source +Properties: -Standard options +- Config: max_upload_parts +- Env Var: RCLONE_S3_MAX_UPLOAD_PARTS +- Type: int +- Default: 10000 -Here are the Standard options specific to alias (Alias for an existing -remote). +--s3-copy-cutoff ---alias-remote +Cutoff for switching to multipart copy. -Remote or path to alias. +Any files larger than this that need to be server-side copied will be +copied in chunks of this size. -Can be "myremote:path/to/dir", "myremote:bucket", "myremote:" or -"/local/path". +The minimum is 0 and the maximum is 5 GiB. Properties: -- Config: remote -- Env Var: RCLONE_ALIAS_REMOTE -- Type: string -- Required: true - -Amazon Drive +- Config: copy_cutoff +- Env Var: RCLONE_S3_COPY_CUTOFF +- Type: SizeSuffix +- Default: 4.656Gi -Amazon Drive, formerly known as Amazon Cloud Drive, is a cloud storage -service run by Amazon for consumers. +--s3-disable-checksum -Status +Don't store MD5 checksum with object metadata. -Important: rclone supports Amazon Drive only if you have your own set of -API keys. Unfortunately the Amazon Drive developer program is now closed -to new entries so if you don't already have your own set of keys you -will not be able to use rclone with Amazon Drive. +Normally rclone will calculate the MD5 checksum of the input before +uploading it so it can add it to metadata on the object. This is great +for data integrity checking but can cause long delays for large files to +start uploading. -For the history on why rclone no longer has a set of Amazon Drive API -keys see the forum. +Properties: -If you happen to know anyone who works at Amazon then please ask them to -re-instate rclone into the Amazon Drive developer program - thanks! +- Config: disable_checksum +- Env Var: RCLONE_S3_DISABLE_CHECKSUM +- Type: bool +- Default: false -Configuration +--s3-shared-credentials-file -The initial setup for Amazon Drive involves getting a token from Amazon -which you need to do in your browser. rclone config walks you through -it. +Path to the shared credentials file. -The configuration process for Amazon Drive may involve using an oauth -proxy. This is used to keep the Amazon credentials out of the source -code. The proxy runs in Google's very secure App Engine environment and -doesn't store any credentials which pass through it. +If env_auth = true then rclone can use a shared credentials file. -Since rclone doesn't currently have its own Amazon Drive credentials so -you will either need to have your own client_id and client_secret with -Amazon Drive, or use a third-party oauth proxy in which case you will -need to enter client_id, client_secret, auth_url and token_url. +If this variable is empty rclone will look for the +"AWS_SHARED_CREDENTIALS_FILE" env variable. If the env value is empty it +will default to the current user's home directory. -Note also if you are not using Amazon's auth_url and token_url, (ie you -filled in something for those) then if setting up on a remote machine -you can only use the copying the config method of configuration - -rclone authorize will not work. + Linux/OSX: "$HOME/.aws/credentials" + Windows: "%USERPROFILE%\.aws\credentials" -Here is an example of how to make a remote called remote. First run: +Properties: - rclone config +- Config: shared_credentials_file +- Env Var: RCLONE_S3_SHARED_CREDENTIALS_FILE +- Type: string +- Required: false -This will guide you through an interactive setup process: +--s3-profile - No remotes found, make a new one? - n) New remote - r) Rename remote - c) Copy remote - s) Set configuration password - q) Quit config - n/r/c/s/q> n - name> remote - Type of storage to configure. - Choose a number from below, or type in your own value - [snip] - XX / Amazon Drive - \ "amazon cloud drive" - [snip] - Storage> amazon cloud drive - Amazon Application Client Id - required. - client_id> your client ID goes here - Amazon Application Client Secret - required. - client_secret> your client secret goes here - Auth server URL - leave blank to use Amazon's. - auth_url> Optional auth URL - Token server url - leave blank to use Amazon's. - token_url> Optional token URL - Remote config - Make sure your Redirect URL is set to "http://127.0.0.1:53682/" in your custom config. - Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access - If not sure try Y. If Y failed, try N. - 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 = your client ID goes here - client_secret = your client secret goes here - auth_url = Optional auth URL - token_url = Optional token URL - token = {"access_token":"xxxxxxxxxxxxxxxxxxxxxxx","token_type":"bearer","refresh_token":"xxxxxxxxxxxxxxxxxx","expiry":"2015-09-06T16:07:39.658438471+01:00"} - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y +Profile to use in the shared credentials file. -See the remote setup docs for how to set it up on a machine with no -Internet browser available. +If env_auth = true then rclone can use a shared credentials file. This +variable controls which profile is used in that file. -Note that rclone runs a webserver on your local machine to collect the -token as returned from Amazon. This only runs from the moment it opens -your browser to the moment you get back the verification code. This is -on http://127.0.0.1:53682/ and this it may require you to unblock it -temporarily if you are running a host firewall. +If empty it will default to the environment variable "AWS_PROFILE" or +"default" if that environment variable is also not set. -Once configured you can then use rclone like this, +Properties: -List directories in top level of your Amazon Drive +- Config: profile +- Env Var: RCLONE_S3_PROFILE +- Type: string +- Required: false - rclone lsd remote: +--s3-session-token -List all the files in your Amazon Drive +An AWS session token. - rclone ls remote: +Properties: -To copy a local directory to an Amazon Drive directory called backup +- Config: session_token +- Env Var: RCLONE_S3_SESSION_TOKEN +- Type: string +- Required: false - rclone copy /home/source remote:backup +--s3-upload-concurrency -Modified time and MD5SUMs +Concurrency for multipart uploads. -Amazon Drive doesn't allow modification times to be changed via the API -so these won't be accurate or used for syncing. +This is the number of chunks of the same file that are uploaded +concurrently. -It does store MD5SUMs so for a more accurate sync, you can use the ---checksum flag. +If you are uploading small numbers of large files over high-speed links +and these uploads do not fully utilize your bandwidth, then increasing +this may help to speed up the transfers. -Restricted filename characters +Properties: - Character Value Replacement - ----------- ------- ------------- - NUL 0x00 ␀ - / 0x2F / +- Config: upload_concurrency +- Env Var: RCLONE_S3_UPLOAD_CONCURRENCY +- Type: int +- Default: 4 -Invalid UTF-8 bytes will also be replaced, as they can't be used in JSON -strings. +--s3-force-path-style -Deleting files +If true use path style access if false use virtual hosted style. -Any files you delete with rclone will end up in the trash. Amazon don't -provide an API to permanently delete files, nor to empty the trash, so -you will have to do that with one of Amazon's apps or via the Amazon -Drive website. As of November 17, 2016, files are automatically deleted -by Amazon from the trash after 30 days. +If this is true (the default) then rclone will use path style access, if +false then rclone will use virtual path style. See the AWS S3 docs for +more info. -Using with non .com Amazon accounts +Some providers (e.g. AWS, Aliyun OSS, Netease COS, or Tencent COS) +require this set to false - rclone will do this automatically based on +the provider setting. -Let's say you usually use amazon.co.uk. When you authenticate with -rclone it will take you to an amazon.com page to log in. Your -amazon.co.uk email and password should work here just fine. +Properties: -Standard options +- Config: force_path_style +- Env Var: RCLONE_S3_FORCE_PATH_STYLE +- Type: bool +- Default: true -Here are the Standard options specific to amazon cloud drive (Amazon -Drive). +--s3-v2-auth ---acd-client-id +If true use v2 authentication. -OAuth Client Id. +If this is false (the default) then rclone will use v4 authentication. +If it is set then rclone will use v2 authentication. -Leave blank normally. +Use this only if v4 signatures don't work, e.g. pre Jewel/v10 CEPH. Properties: -- Config: client_id -- Env Var: RCLONE_ACD_CLIENT_ID -- Type: string -- Required: false +- Config: v2_auth +- Env Var: RCLONE_S3_V2_AUTH +- Type: bool +- Default: false ---acd-client-secret +--s3-use-accelerate-endpoint -OAuth Client Secret. +If true use the AWS S3 accelerated endpoint. -Leave blank normally. +See: AWS S3 Transfer acceleration Properties: -- Config: client_secret -- Env Var: RCLONE_ACD_CLIENT_SECRET -- Type: string -- Required: false +- Config: use_accelerate_endpoint +- Env Var: RCLONE_S3_USE_ACCELERATE_ENDPOINT +- Provider: AWS +- Type: bool +- Default: false -Advanced options +--s3-leave-parts-on-error -Here are the Advanced options specific to amazon cloud drive (Amazon -Drive). +If true avoid calling abort upload on a failure, leaving all +successfully uploaded parts on S3 for manual recovery. ---acd-token +It should be set to true for resuming uploads across different sessions. -OAuth Access Token as a JSON blob. +WARNING: Storing parts of an incomplete multipart upload counts towards +space usage on S3 and will add additional costs if not cleaned up. Properties: -- Config: token -- Env Var: RCLONE_ACD_TOKEN -- Type: string -- Required: false +- Config: leave_parts_on_error +- Env Var: RCLONE_S3_LEAVE_PARTS_ON_ERROR +- Provider: AWS +- Type: bool +- Default: false ---acd-auth-url +--s3-list-chunk -Auth server URL. +Size of listing chunk (response list for each ListObject S3 request). -Leave blank to use the provider defaults. +This option is also known as "MaxKeys", "max-items", or "page-size" from +the AWS S3 specification. Most services truncate the response list to +1000 objects even if requested more than that. In AWS S3 this is a +global maximum and cannot be changed, see AWS S3. In Ceph, this can be +increased with the "rgw list buckets max chunk" option. Properties: -- Config: auth_url -- Env Var: RCLONE_ACD_AUTH_URL -- Type: string -- Required: false - ---acd-token-url - -Token server url. +- Config: list_chunk +- Env Var: RCLONE_S3_LIST_CHUNK +- Type: int +- Default: 1000 -Leave blank to use the provider defaults. +--s3-list-version -Properties: +Version of ListObjects to use: 1,2 or 0 for auto. -- Config: token_url -- Env Var: RCLONE_ACD_TOKEN_URL -- Type: string -- Required: false +When S3 originally launched it only provided the ListObjects call to +enumerate objects in a bucket. ---acd-checkpoint +However in May 2016 the ListObjectsV2 call was introduced. This is much +higher performance and should be used if at all possible. -Checkpoint for internal polling (debug). +If set to the default, 0, rclone will guess according to the provider +set which list objects method to call. If it guesses wrong, then it may +be set manually here. Properties: -- Config: checkpoint -- Env Var: RCLONE_ACD_CHECKPOINT -- Type: string -- Required: false +- Config: list_version +- Env Var: RCLONE_S3_LIST_VERSION +- Type: int +- Default: 0 ---acd-upload-wait-per-gb +--s3-list-url-encode -Additional time per GiB to wait after a failed complete upload to see if -it appears. +Whether to url encode listings: true/false/unset -Sometimes Amazon Drive gives an error when a file has been fully -uploaded but the file appears anyway after a little while. This happens -sometimes for files over 1 GiB in size and nearly every time for files -bigger than 10 GiB. This parameter controls the time rclone waits for -the file to appear. +Some providers support URL encoding listings and where this is available +this is more reliable when using control characters in file names. If +this is set to unset (the default) then rclone will choose according to +the provider setting what to apply, but you can override rclone's choice +here. -The default value for this parameter is 3 minutes per GiB, so by default -it will wait 3 minutes for every GiB uploaded to see if the file -appears. +Properties: -You can disable this feature by setting it to 0. This may cause conflict -errors as rclone retries the failed upload but the file will most likely -appear correctly eventually. +- Config: list_url_encode +- Env Var: RCLONE_S3_LIST_URL_ENCODE +- Type: Tristate +- Default: unset -These values were determined empirically by observing lots of uploads of -big files for a range of file sizes. +--s3-no-check-bucket -Upload with the "-v" flag to see more info about what rclone is doing in -this situation. +If set, don't attempt to check the bucket exists or create it. -Properties: +This can be useful when trying to minimise the number of transactions +rclone does if you know the bucket exists already. -- Config: upload_wait_per_gb -- Env Var: RCLONE_ACD_UPLOAD_WAIT_PER_GB -- Type: Duration -- Default: 3m0s +It can also be needed if the user you are using does not have bucket +creation permissions. Before v1.52.0 this would have passed silently due +to a bug. ---acd-templink-threshold +Properties: -Files >= this size will be downloaded via their tempLink. +- Config: no_check_bucket +- Env Var: RCLONE_S3_NO_CHECK_BUCKET +- Type: bool +- Default: false -Files this size or more will be downloaded via their "tempLink". This is -to work around a problem with Amazon Drive which blocks downloads of -files bigger than about 10 GiB. The default for this is 9 GiB which -shouldn't need to be changed. +--s3-no-head -To download files above this threshold, rclone requests a "tempLink" -which downloads the file through a temporary URL directly from the -underlying S3 storage. +If set, don't HEAD uploaded objects to check integrity. -Properties: +This can be useful when trying to minimise the number of transactions +rclone does. -- Config: templink_threshold -- Env Var: RCLONE_ACD_TEMPLINK_THRESHOLD -- Type: SizeSuffix -- Default: 9Gi +Setting it means that if rclone receives a 200 OK message after +uploading an object with PUT then it will assume that it got uploaded +properly. ---acd-encoding +In particular it will assume: -The encoding for the backend. +- the metadata, including modtime, storage class and content type was + as uploaded +- the size was as uploaded -See the encoding section in the overview for more info. +It reads the following items from the response for a single part PUT: -Properties: +- the MD5SUM +- The uploaded date -- Config: encoding -- Env Var: RCLONE_ACD_ENCODING -- Type: MultiEncoder -- Default: Slash,InvalidUtf8,Dot +For multipart uploads these items aren't read. -Limitations +If an source object of unknown length is uploaded then rclone will do a +HEAD request. -Note that Amazon Drive is case insensitive so you can't have a file -called "Hello.doc" and one called "hello.doc". +Setting this flag increases the chance for undetected upload failures, +in particular an incorrect size, so it isn't recommended for normal +operation. In practice the chance of an undetected upload failure is +very small even with this flag. -Amazon Drive has rate limiting so you may notice errors in the sync (429 -errors). rclone will automatically retry the sync up to 3 times by -default (see --retries flag) which should hopefully work around this -problem. +Properties: -Amazon Drive has an internal limit of file sizes that can be uploaded to -the service. This limit is not officially published, but all files -larger than this will fail. +- Config: no_head +- Env Var: RCLONE_S3_NO_HEAD +- Type: bool +- Default: false -At the time of writing (Jan 2016) is in the area of 50 GiB per file. -This means that larger files are likely to fail. +--s3-no-head-object -Unfortunately there is no way for rclone to see that this failure is -because of file size, so it will retry the operation, as any other -failure. To avoid this problem, use --max-size 50000M option to limit -the maximum size of uploaded files. Note that --max-size does not split -files into segments, it only ignores files over this size. +If set, do not do HEAD before GET when getting objects. -rclone about is not supported by the Amazon Drive backend. Backends -without this capability cannot determine free space for an rclone mount -or use policy mfs (most free space) as a member of an rclone union -remote. +Properties: -See List of backends that do not support rclone about and rclone about +- Config: no_head_object +- Env Var: RCLONE_S3_NO_HEAD_OBJECT +- Type: bool +- Default: false -Amazon S3 Storage Providers +--s3-encoding -The S3 backend can be used with a number of different providers: +The encoding for the backend. -- AWS S3 -- Alibaba Cloud (Aliyun) Object Storage System (OSS) -- Ceph -- China Mobile Ecloud Elastic Object Storage (EOS) -- Cloudflare R2 -- Arvan Cloud Object Storage (AOS) -- DigitalOcean Spaces -- Dreamhost -- GCS -- Huawei OBS -- IBM COS S3 -- IDrive e2 -- IONOS Cloud -- Leviia Object Storage -- Liara Object Storage -- Minio -- Petabox -- Qiniu Cloud Object Storage (Kodo) -- RackCorp Object Storage -- Scaleway -- Seagate Lyve Cloud -- SeaweedFS -- StackPath -- Storj -- Synology C2 Object Storage -- Tencent Cloud Object Storage (COS) -- Wasabi +See the encoding section in the overview for more info. -Paths are specified as remote:bucket (or remote: for the lsd command.) -You may put subdirectories in too, e.g. remote:bucket/path/to/dir. +Properties: -Once you have made a remote (see the provider specific section above) -you can use it like this: +- Config: encoding +- Env Var: RCLONE_S3_ENCODING +- Type: Encoding +- Default: Slash,InvalidUtf8,Dot -See all buckets +--s3-memory-pool-flush-time - rclone lsd remote: +How often internal memory buffer pools will be flushed. (no longer used) -Make a new bucket +Properties: - rclone mkdir remote:bucket +- Config: memory_pool_flush_time +- Env Var: RCLONE_S3_MEMORY_POOL_FLUSH_TIME +- Type: Duration +- Default: 1m0s -List the contents of a bucket +--s3-memory-pool-use-mmap - rclone ls remote:bucket +Whether to use mmap buffers in internal memory pool. (no longer used) -Sync /home/local/directory to the remote bucket, deleting any excess -files in the bucket. +Properties: - rclone sync --interactive /home/local/directory remote:bucket +- Config: memory_pool_use_mmap +- Env Var: RCLONE_S3_MEMORY_POOL_USE_MMAP +- Type: bool +- Default: false -Configuration +--s3-disable-http2 -Here is an example of making an s3 configuration for the AWS S3 -provider. Most applies to the other providers as well, any differences -are described below. +Disable usage of http2 for S3 backends. -First run +There is currently an unsolved issue with the s3 (specifically minio) +backend and HTTP/2. HTTP/2 is enabled by default for the s3 backend but +can be disabled here. When the issue is solved this flag will be +removed. - rclone config +See: https://github.com/rclone/rclone/issues/4673, +https://github.com/rclone/rclone/issues/3631 -This will guide you through an interactive setup process. +Properties: - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> remote - Type of storage to configure. - Choose a number from below, or type in your own value - [snip] - XX / Amazon S3 Compliant Storage Providers including AWS, Ceph, ChinaMobile, ArvanCloud, Dreamhost, IBM COS, Liara, Minio, and Tencent COS - \ "s3" - [snip] - Storage> s3 - Choose your S3 provider. - Choose a number from below, or type in your own value - 1 / Amazon Web Services (AWS) S3 - \ "AWS" - 2 / Ceph Object Storage - \ "Ceph" - 3 / DigitalOcean Spaces - \ "DigitalOcean" - 4 / Dreamhost DreamObjects - \ "Dreamhost" - 5 / IBM COS S3 - \ "IBMCOS" - 6 / Minio Object Storage - \ "Minio" - 7 / Wasabi Object Storage - \ "Wasabi" - 8 / Any other S3 compatible provider - \ "Other" - provider> 1 - Get AWS credentials from runtime (environment variables or EC2/ECS 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> XXX - AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. - secret_access_key> YYY - 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 East (Ohio) Region - 2 | Needs location constraint us-east-2. - \ "us-east-2" - / US West (Oregon) Region - 3 | Needs location constraint us-west-2. - \ "us-west-2" - / US West (Northern California) Region - 4 | Needs location constraint us-west-1. - \ "us-west-1" - / Canada (Central) Region - 5 | Needs location constraint ca-central-1. - \ "ca-central-1" - / EU (Ireland) Region - 6 | Needs location constraint EU or eu-west-1. - \ "eu-west-1" - / EU (London) Region - 7 | Needs location constraint eu-west-2. - \ "eu-west-2" - / EU (Frankfurt) Region - 8 | Needs location constraint eu-central-1. - \ "eu-central-1" - / Asia Pacific (Singapore) Region - 9 | Needs location constraint ap-southeast-1. - \ "ap-southeast-1" - / Asia Pacific (Sydney) Region - 10 | Needs location constraint ap-southeast-2. - \ "ap-southeast-2" - / Asia Pacific (Tokyo) Region - 11 | Needs location constraint ap-northeast-1. - \ "ap-northeast-1" - / Asia Pacific (Seoul) - 12 | Needs location constraint ap-northeast-2. - \ "ap-northeast-2" - / Asia Pacific (Mumbai) - 13 | Needs location constraint ap-south-1. - \ "ap-south-1" - / Asia Pacific (Hong Kong) Region - 14 | Needs location constraint ap-east-1. - \ "ap-east-1" - / South America (Sao Paulo) Region - 15 | Needs location constraint sa-east-1. - \ "sa-east-1" - region> 1 - Endpoint for S3 API. - Leave blank if using AWS to use the default endpoint for the region. - 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 East (Ohio) Region. - \ "us-east-2" - 3 / US West (Oregon) Region. - \ "us-west-2" - 4 / US West (Northern California) Region. - \ "us-west-1" - 5 / Canada (Central) Region. - \ "ca-central-1" - 6 / EU (Ireland) Region. - \ "eu-west-1" - 7 / EU (London) Region. - \ "eu-west-2" - 8 / EU Region. - \ "EU" - 9 / Asia Pacific (Singapore) Region. - \ "ap-southeast-1" - 10 / Asia Pacific (Sydney) Region. - \ "ap-southeast-2" - 11 / Asia Pacific (Tokyo) Region. - \ "ap-northeast-1" - 12 / Asia Pacific (Seoul) - \ "ap-northeast-2" - 13 / Asia Pacific (Mumbai) - \ "ap-south-1" - 14 / Asia Pacific (Hong Kong) - \ "ap-east-1" - 15 / South America (Sao Paulo) Region. - \ "sa-east-1" - location_constraint> 1 - Canned ACL used when creating buckets and/or storing objects in S3. - For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl - Choose a number from below, or type in your own value - 1 / Owner gets FULL_CONTROL. No one else has access rights (default). - \ "private" - 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access. - \ "public-read" - / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. - 3 | Granting this on a bucket is generally not recommended. - \ "public-read-write" - 4 / Owner gets FULL_CONTROL. The AuthenticatedUsers group gets READ access. - \ "authenticated-read" - / Object owner gets FULL_CONTROL. Bucket owner gets READ access. - 5 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. - \ "bucket-owner-read" - / Both the object owner and the bucket owner get FULL_CONTROL over the object. - 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. - \ "bucket-owner-full-control" - acl> 1 - The server-side encryption algorithm used when storing this object in S3. - Choose a number from below, or type in your own value - 1 / None - \ "" - 2 / AES256 - \ "AES256" - server_side_encryption> 1 - The storage class to use when storing objects in S3. - Choose a number from below, or type in your own value - 1 / Default - \ "" - 2 / Standard storage class - \ "STANDARD" - 3 / Reduced redundancy storage class - \ "REDUCED_REDUNDANCY" - 4 / Standard Infrequent Access storage class - \ "STANDARD_IA" - 5 / One Zone Infrequent Access storage class - \ "ONEZONE_IA" - 6 / Glacier storage class - \ "GLACIER" - 7 / Glacier Deep Archive storage class - \ "DEEP_ARCHIVE" - 8 / Intelligent-Tiering storage class - \ "INTELLIGENT_TIERING" - 9 / Glacier Instant Retrieval storage class - \ "GLACIER_IR" - storage_class> 1 - Remote config - -------------------- - [remote] - type = s3 - provider = AWS - env_auth = false - access_key_id = XXX - secret_access_key = YYY - region = us-east-1 - endpoint = - location_constraint = - acl = private - server_side_encryption = - storage_class = - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> +- Config: disable_http2 +- Env Var: RCLONE_S3_DISABLE_HTTP2 +- Type: bool +- Default: false -Modified time +--s3-download-url -The modified time is stored as metadata on the object as -X-Amz-Meta-Mtime as floating point since the epoch, accurate to 1 ns. +Custom endpoint for downloads. This is usually set to a CloudFront CDN +URL as AWS S3 offers cheaper egress for data downloaded through the +CloudFront network. -If the modification time needs to be updated rclone will attempt to -perform a server side copy to update the modification if the object can -be copied in a single part. In the case the object is larger than 5Gb or -is in Glacier or Glacier Deep Archive storage the object will be -uploaded rather than copied. +Properties: -Note that reading this from the object takes an additional HEAD request -as the metadata isn't returned in object listings. +- Config: download_url +- Env Var: RCLONE_S3_DOWNLOAD_URL +- Type: string +- Required: false -Reducing costs +--s3-directory-markers -Avoiding HEAD requests to read the modification time +Upload an empty object with a trailing slash when a new directory is +created -By default, rclone will use the modification time of objects stored in -S3 for syncing. This is stored in object metadata which unfortunately -takes an extra HEAD request to read which can be expensive (in time and -money). +Empty folders are unsupported for bucket based remotes, this option +creates an empty object ending with "/", to persist the folder. -The modification time is used by default for all operations that require -checking the time a file was last updated. It allows rclone to treat the -remote more like a true filesystem, but it is inefficient on S3 because -it requires an extra API call to retrieve the metadata. +Properties: -The extra API calls can be avoided when syncing (using rclone sync or -rclone copy) in a few different ways, each with its own tradeoffs. +- Config: directory_markers +- Env Var: RCLONE_S3_DIRECTORY_MARKERS +- Type: bool +- Default: false -- --size-only - - Only checks the size of files. - - Uses no extra transactions. - - If the file doesn't change size then rclone won't detect it has - changed. - - rclone sync --size-only /path/to/source s3:bucket -- --checksum - - Checks the size and MD5 checksum of files. - - Uses no extra transactions. - - The most accurate detection of changes possible. - - Will cause the source to read an MD5 checksum which, if it is a - local disk, will cause lots of disk activity. - - If the source and destination are both S3 this is the - recommended flag to use for maximum efficiency. - - rclone sync --checksum /path/to/source s3:bucket -- --update --use-server-modtime - - Uses no extra transactions. - - Modification time becomes the time the object was uploaded. - - For many operations this is sufficient to determine if it needs - uploading. - - Using --update along with --use-server-modtime, avoids the extra - API call and uploads files whose local modification time is - newer than the time it was last uploaded. - - Files created with timestamps in the past will be missed by the - sync. - - rclone sync --update --use-server-modtime /path/to/source s3:bucket +--s3-use-multipart-etag -These flags can and should be used in combination with --fast-list - see -below. +Whether to use ETag in multipart uploads for verification -If using rclone mount or any command using the VFS (eg rclone serve) -commands then you might want to consider using the VFS flag --no-modtime -which will stop rclone reading the modification time for every object. -You could also use --use-server-modtime if you are happy with the -modification times of the objects being the time of upload. +This should be true, false or left unset to use the default for the +provider. -Avoiding GET requests to read directory listings +Properties: -Rclone's default directory traversal is to process each directory -individually. This takes one API call per directory. Using the ---fast-list flag will read all info about the objects into memory first -using a smaller number of API calls (one per 1000 objects). See the -rclone docs for more details. +- Config: use_multipart_etag +- Env Var: RCLONE_S3_USE_MULTIPART_ETAG +- Type: Tristate +- Default: unset - rclone sync --fast-list --checksum /path/to/source s3:bucket +--s3-use-presigned-request ---fast-list trades off API transactions for memory use. As a rough guide -rclone uses 1k of memory per object stored, so using --fast-list on a -sync of a million objects will use roughly 1 GiB of RAM. +Whether to use a presigned request or PutObject for single part uploads -If you are only copying a small number of files into a big repository -then using --no-traverse is a good idea. This finds objects directly -instead of through directory listings. You can do a "top-up" sync very -cheaply by using --max-age and --no-traverse to copy only recent files, -eg +If this is false rclone will use PutObject from the AWS SDK to upload an +object. - rclone copy --max-age 24h --no-traverse /path/to/source s3:bucket +Versions of rclone < 1.59 use presigned requests to upload a single part +object and setting this flag to true will re-enable that functionality. +This shouldn't be necessary except in exceptional circumstances or for +testing. -You'd then do a full rclone sync less often. +Properties: -Note that --fast-list isn't required in the top-up sync. +- Config: use_presigned_request +- Env Var: RCLONE_S3_USE_PRESIGNED_REQUEST +- Type: bool +- Default: false -Avoiding HEAD requests after PUT +--s3-versions -By default, rclone will HEAD every object it uploads. It does this to -check the object got uploaded correctly. +Include old versions in directory listings. -You can disable this with the --s3-no-head option - see there for more -details. +Properties: -Setting this flag increases the chance for undetected upload failures. +- Config: versions +- Env Var: RCLONE_S3_VERSIONS +- Type: bool +- Default: false -Hashes +--s3-version-at -For small objects which weren't uploaded as multipart uploads (objects -sized below --s3-upload-cutoff if uploaded with rclone) rclone uses the -ETag: header as an MD5 checksum. +Show file versions as they were at the specified time. -However for objects which were uploaded as multipart uploads or with -server side encryption (SSE-AWS or SSE-C) the ETag header is no longer -the MD5 sum of the data, so rclone adds an additional piece of metadata -X-Amz-Meta-Md5chksum which is a base64 encoded MD5 hash (in the same -format as is required for Content-MD5). You can use base64 -d and -hexdump to check this value manually: +The parameter should be a date, "2006-01-02", datetime "2006-01-02 +15:04:05" or a duration for that long ago, eg "100d" or "1h". - echo 'VWTGdNx3LyXQDfA0e2Edxw==' | base64 -d | hexdump +Note that when using this no file write operations are permitted, so you +can't upload files or delete them. -or you can use rclone check to verify the hashes are OK. +See the time option docs for valid formats. -For large objects, calculating this hash can take some time so the -addition of this hash can be disabled with --s3-disable-checksum. This -will mean that these objects do not have an MD5 checksum. +Properties: -Note that reading this from the object takes an additional HEAD request -as the metadata isn't returned in object listings. +- Config: version_at +- Env Var: RCLONE_S3_VERSION_AT +- Type: Time +- Default: off -Versions +--s3-decompress -When bucket versioning is enabled (this can be done with rclone with the -rclone backend versioning command) when rclone uploads a new version of -a file it creates a new version of it Likewise when you delete a file, -the old version will be marked hidden and still be available. +If set this will decompress gzip encoded objects. -Old versions of files, where available, are visible using the ---s3-versions flag. +It is possible to upload objects to S3 with "Content-Encoding: gzip" +set. Normally rclone will download these files as compressed objects. -It is also possible to view a bucket as it was at a certain point in -time, using the --s3-version-at flag. This will show the file versions -as they were at that time, showing files that have been deleted -afterwards, and hiding files that were created since. +If this flag is set then rclone will decompress these files with +"Content-Encoding: gzip" as they are received. This means that rclone +can't check the size and hash but the file contents will be +decompressed. -If you wish to remove all the old versions then you can use the -rclone backend cleanup-hidden remote:bucket command which will delete -all the old hidden versions of files, leaving the current ones intact. -You can also supply a path and only old versions under that path will be -deleted, e.g. rclone backend cleanup-hidden remote:bucket/path/to/stuff. +Properties: -When you purge a bucket, the current and the old versions will be -deleted then the bucket will be deleted. +- Config: decompress +- Env Var: RCLONE_S3_DECOMPRESS +- Type: bool +- Default: false -However delete will cause the current versions of the files to become -hidden old versions. +--s3-might-gzip -Here is a session showing the listing and retrieval of an old version -followed by a cleanup of the old versions. +Set this if the backend might gzip objects. -Show current version and all the versions with --s3-versions flag. +Normally providers will not alter objects when they are downloaded. If +an object was not uploaded with Content-Encoding: gzip then it won't be +set on download. - $ rclone -q ls s3:cleanup-test - 9 one.txt +However some providers may gzip objects even if they weren't uploaded +with Content-Encoding: gzip (eg Cloudflare). - $ rclone -q --s3-versions ls s3:cleanup-test - 9 one.txt - 8 one-v2016-07-04-141032-000.txt - 16 one-v2016-07-04-141003-000.txt - 15 one-v2016-07-02-155621-000.txt +A symptom of this would be receiving errors like -Retrieve an old version + ERROR corrupted on transfer: sizes differ NNN vs MMM - $ rclone -q --s3-versions copy s3:cleanup-test/one-v2016-07-04-141003-000.txt /tmp +If you set this flag and rclone downloads an object with +Content-Encoding: gzip set and chunked transfer encoding, then rclone +will decompress the object on the fly. - $ ls -l /tmp/one-v2016-07-04-141003-000.txt - -rw-rw-r-- 1 ncw ncw 16 Jul 2 17:46 /tmp/one-v2016-07-04-141003-000.txt +If this is set to unset (the default) then rclone will choose according +to the provider setting what to apply, but you can override rclone's +choice here. -Clean up all the old versions and show that they've gone. +Properties: - $ rclone -q backend cleanup-hidden s3:cleanup-test +- Config: might_gzip +- Env Var: RCLONE_S3_MIGHT_GZIP +- Type: Tristate +- Default: unset - $ rclone -q ls s3:cleanup-test - 9 one.txt +--s3-use-accept-encoding-gzip - $ rclone -q --s3-versions ls s3:cleanup-test - 9 one.txt +Whether to send Accept-Encoding: gzip header. -Versions naming caveat +By default, rclone will append Accept-Encoding: gzip to the request to +download compressed objects whenever possible. -When using --s3-versions flag rclone is relying on the file name to work -out whether the objects are versions or not. Versions' names are created -by inserting timestamp between file name and its extension. +However some providers such as Google Cloud Storage may alter the HTTP +headers, breaking the signature of the request. - 9 file.txt - 8 file-v2023-07-17-161032-000.txt - 16 file-v2023-06-15-141003-000.txt +A symptom of this would be receiving errors like -If there are real files present with the same names as versions, then -behaviour of --s3-versions can be unpredictable. + SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. -Cleanup +In this case, you might want to try disabling this option. -If you run rclone cleanup s3:bucket then it will remove all pending -multipart uploads older than 24 hours. You can use the --interactive/i -or --dry-run flag to see exactly what it will do. If you want more -control over the expiry date then run -rclone backend cleanup s3:bucket -o max-age=1h to expire all uploads -older than one hour. You can use -rclone backend list-multipart-uploads s3:bucket to see the pending -multipart uploads. +Properties: -Restricted filename characters +- Config: use_accept_encoding_gzip +- Env Var: RCLONE_S3_USE_ACCEPT_ENCODING_GZIP +- Type: Tristate +- Default: unset -S3 allows any valid UTF-8 string as a key. +--s3-no-system-metadata -Invalid UTF-8 bytes will be replaced, as they can't be used in XML. +Suppress setting and reading of system metadata -The following characters are replaced since these are problematic when -dealing with the REST API: +Properties: - Character Value Replacement - ----------- ------- ------------- - NUL 0x00 ␀ - / 0x2F / +- Config: no_system_metadata +- Env Var: RCLONE_S3_NO_SYSTEM_METADATA +- Type: bool +- Default: false -The encoding will also encode these file names as they don't seem to -work with the SDK properly: +--s3-sts-endpoint - File name Replacement - ----------- ------------- - . . - .. .. +Endpoint for STS. -Multipart uploads +Leave blank if using AWS to use the default endpoint for the region. -rclone supports multipart uploads with S3 which means that it can upload -files bigger than 5 GiB. +Properties: -Note that files uploaded both with multipart upload and through crypt -remotes do not have MD5 sums. +- Config: sts_endpoint +- Env Var: RCLONE_S3_STS_ENDPOINT +- Provider: AWS +- Type: string +- Required: false -rclone switches from single part uploads to multipart uploads at the -point specified by --s3-upload-cutoff. This can be a maximum of 5 GiB -and a minimum of 0 (ie always upload multipart files). +--s3-use-already-exists -The chunk sizes used in the multipart upload are specified by ---s3-chunk-size and the number of chunks uploaded concurrently is -specified by --s3-upload-concurrency. +Set if rclone should report BucketAlreadyExists errors on bucket +creation. -Multipart uploads will use --transfers * --s3-upload-concurrency * ---s3-chunk-size extra memory. Single part uploads to not use extra -memory. +At some point during the evolution of the s3 protocol, AWS started +returning an AlreadyOwnedByYou error when attempting to create a bucket +that the user already owned, rather than a BucketAlreadyExists error. -Single part transfers can be faster than multipart transfers or slower -depending on your latency from S3 - the more latency, the more likely -single part transfers will be faster. +Unfortunately exactly what has been implemented by s3 clones is a little +inconsistent, some return AlreadyOwnedByYou, some return +BucketAlreadyExists and some return no error at all. -Increasing --s3-upload-concurrency will increase throughput (8 would be -a sensible value) and increasing --s3-chunk-size also increases -throughput (16M would be sensible). Increasing either of these will use -more memory. The default values are high enough to gain most of the -possible performance without using too much memory. +This is important to rclone because it ensures the bucket exists by +creating it on quite a lot of operations (unless --s3-no-check-bucket is +used). -Buckets and Regions +If rclone knows the provider can return AlreadyOwnedByYou or returns no +error then it can report BucketAlreadyExists errors when the user +attempts to create a bucket not owned by them. Otherwise rclone ignores +the BucketAlreadyExists error which can lead to confusion. -With Amazon S3 you can list buckets (rclone lsd) using any region, but -you can only access the content of a bucket from the region it was -created in. If you attempt to access a bucket from the wrong region, you -will get an error, incorrect region, the bucket is not in 'XXX' region. +This should be automatically set correctly for all providers rclone +knows about - please make a bug report if not. -Authentication +Properties: -There are a number of ways to supply rclone with a set of AWS -credentials, with and without using the environment. +- Config: use_already_exists +- Env Var: RCLONE_S3_USE_ALREADY_EXISTS +- Type: Tristate +- Default: unset -The different authentication methods are tried in this order: +--s3-use-multipart-uploads -- Directly in the rclone configuration file (env_auth = false in the - config file): - - access_key_id and secret_access_key are required. - - session_token can be optionally set when using AWS STS. -- Runtime configuration (env_auth = true in the config file): - - Export the following environment variables before running - rclone: - - Access Key ID: AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY - - Secret Access Key: AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY - - Session Token: AWS_SESSION_TOKEN (optional) - - Or, use a named profile: - - Profile files are standard files used by AWS CLI tools - - By default it will use the profile in your home directory - (e.g. ~/.aws/credentials on unix based systems) file and the - "default" profile, to change set these environment - variables: - - AWS_SHARED_CREDENTIALS_FILE to control which file. - - AWS_PROFILE to control which profile to use. - - Or, run rclone in an ECS task with an IAM role (AWS only). - - Or, run rclone on an EC2 instance with an IAM role (AWS only). - - Or, run rclone in an EKS pod with an IAM role that is associated - with a service account (AWS only). +Set if rclone should use multipart uploads. -If none of these option actually end up providing rclone with AWS -credentials then S3 interaction will be non-authenticated (see below). +You can change this if you want to disable the use of multipart uploads. +This shouldn't be necessary in normal operation. -S3 Permissions +This should be automatically set correctly for all providers rclone +knows about - please make a bug report if not. -When using the sync subcommand of rclone the following minimum -permissions are required to be available on the bucket being written to: +Properties: -- ListBucket -- DeleteObject -- GetObject -- PutObject -- PutObjectACL +- Config: use_multipart_uploads +- Env Var: RCLONE_S3_USE_MULTIPART_UPLOADS +- Type: Tristate +- Default: unset -When using the lsd subcommand, the ListAllMyBuckets permission is -required. +Metadata -Example policy: +User metadata is stored as x-amz-meta- keys. S3 metadata keys are case +insensitive and are always returned in lower case. - { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "AWS": "arn:aws:iam::USER_SID:user/USER_NAME" - }, - "Action": [ - "s3:ListBucket", - "s3:DeleteObject", - "s3:GetObject", - "s3:PutObject", - "s3:PutObjectAcl" - ], - "Resource": [ - "arn:aws:s3:::BUCKET_NAME/*", - "arn:aws:s3:::BUCKET_NAME" - ] +Here are the possible system metadata items for the s3 backend. + + ------------------------------------------------------------------------------------------------------------------ + Name Help Type Example Read Only + --------------------- --------------------- ----------- ------------------------------------- -------------------- + btime Time of file birth RFC 3339 2006-01-02T15:04:05.999999999Z07:00 Y + (creation) read from + Last-Modified header + + cache-control Cache-Control header string no-cache N + + content-disposition Content-Disposition string inline N + header + + content-encoding Content-Encoding string gzip N + header + + content-language Content-Language string en-US N + header + + content-type Content-Type header string text/plain N + + mtime Time of last RFC 3339 2006-01-02T15:04:05.999999999Z07:00 N + modification, read + from rclone metadata + + tier Tier of the object string GLACIER Y + ------------------------------------------------------------------------------------------------------------------ + +See the metadata docs for more info. + +Backend commands + +Here are the commands specific to the s3 backend. + +Run them with + + rclone backend COMMAND remote: + +The help below will explain what arguments each command takes. + +See the backend command for more info on how to pass options and +arguments. + +These can be run on a running backend using the rc command +backend/command. + +restore + +Restore objects from GLACIER to normal storage + + rclone backend restore remote: [options] [+] + +This command can be used to restore one or more objects from GLACIER to +normal storage. + +Usage Examples: + + rclone backend restore s3:bucket/path/to/object -o priority=PRIORITY -o lifetime=DAYS + rclone backend restore s3:bucket/path/to/directory -o priority=PRIORITY -o lifetime=DAYS + rclone backend restore s3:bucket -o priority=PRIORITY -o lifetime=DAYS + +This flag also obeys the filters. Test first with --interactive/-i or +--dry-run flags + + rclone --interactive backend restore --include "*.txt" s3:bucket/path -o priority=Standard -o lifetime=1 + +All the objects shown will be marked for restore, then + + rclone backend restore --include "*.txt" s3:bucket/path -o priority=Standard -o lifetime=1 + +It returns a list of status dictionaries with Remote and Status keys. +The Status will be OK if it was successful or an error message if not. + + [ + { + "Status": "OK", + "Remote": "test.txt" + }, + { + "Status": "OK", + "Remote": "test/file4.txt" + } + ] + +Options: + +- "description": The optional description for the job. +- "lifetime": Lifetime of the active copy in days +- "priority": Priority of restore: Standard|Expedited|Bulk + +restore-status + +Show the restore status for objects being restored from GLACIER to +normal storage + + rclone backend restore-status remote: [options] [+] + +This command can be used to show the status for objects being restored +from GLACIER to normal storage. + +Usage Examples: + + rclone backend restore-status s3:bucket/path/to/object + rclone backend restore-status s3:bucket/path/to/directory + rclone backend restore-status -o all s3:bucket/path/to/directory + +This command does not obey the filters. + +It returns a list of status dictionaries. + + [ + { + "Remote": "file.txt", + "VersionID": null, + "RestoreStatus": { + "IsRestoreInProgress": true, + "RestoreExpiryDate": "2023-09-06T12:29:19+01:00" + }, + "StorageClass": "GLACIER" + }, + { + "Remote": "test.pdf", + "VersionID": null, + "RestoreStatus": { + "IsRestoreInProgress": false, + "RestoreExpiryDate": "2023-09-06T12:29:19+01:00" }, - { - "Effect": "Allow", - "Action": "s3:ListAllMyBuckets", - "Resource": "arn:aws:s3:::*" - } - ] - } + "StorageClass": "DEEP_ARCHIVE" + } + ] -Notes on above: +Options: -1. This is a policy that can be used when creating bucket. It assumes - that USER_NAME has been created. -2. The Resource entry must include both resource ARNs, as one implies - the bucket and the other implies the bucket's objects. +- "all": if set then show all objects, not just ones with restore + status -For reference, here's an Ansible script that will generate one or more -buckets that will work with rclone sync. +list-multipart-uploads -Key Management System (KMS) +List the unfinished multipart uploads -If you are using server-side encryption with KMS then you must make sure -rclone is configured with server_side_encryption = aws:kms otherwise you -will find you can't transfer small objects - these will create checksum -errors. + rclone backend list-multipart-uploads remote: [options] [+] -Glacier and Glacier Deep Archive +This command lists the unfinished multipart uploads in JSON format. -You can upload objects using the glacier storage class or transition -them to glacier using a lifecycle policy. The bucket can still be synced -or copied into normally, but if rclone tries to access data from the -glacier storage class you will see an error like below. + rclone backend list-multipart s3:bucket/path/to/object - 2017/09/11 19:07:43 Failed to sync: failed to open source object: Object in GLACIER, restore first: path/to/file +It returns a dictionary of buckets with values as lists of unfinished +multipart uploads. -In this case you need to restore the object(s) in question before using -rclone. +You can call it with no bucket in which case it lists all bucket, with a +bucket or with a bucket and path. -Note that rclone only speaks the S3 API it does not speak the Glacier -Vault API, so rclone cannot directly access Glacier Vaults. + { + "rclone": [ + { + "Initiated": "2020-06-26T14:20:36Z", + "Initiator": { + "DisplayName": "XXX", + "ID": "arn:aws:iam::XXX:user/XXX" + }, + "Key": "KEY", + "Owner": { + "DisplayName": null, + "ID": "XXX" + }, + "StorageClass": "STANDARD", + "UploadId": "XXX" + } + ], + "rclone-1000files": [], + "rclone-dst": [] + } -Object-lock enabled S3 bucket +cleanup -According to AWS's documentation on S3 Object Lock: +Remove unfinished multipart uploads. - If you configure a default retention period on a bucket, requests to - upload objects in such a bucket must include the Content-MD5 header. + rclone backend cleanup remote: [options] [+] -As mentioned in the Hashes section, small files that are not uploaded as -multipart, use a different tag, causing the upload to fail. A simple -solution is to set the --s3-upload-cutoff 0 and force all the files to -be uploaded as multipart. +This command removes unfinished multipart uploads of age greater than +max-age which defaults to 24 hours. -Standard options +Note that you can use --interactive/-i or --dry-run with this command to +see what it would do. -Here are the Standard options specific to s3 (Amazon S3 Compliant -Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, China -Mobile, Cloudflare, GCS, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, -IDrive e2, IONOS Cloud, Leviia, Liara, Lyve Cloud, Minio, Netease, -Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, -Tencent COS, Qiniu and Wasabi). + rclone backend cleanup s3:bucket/path/to/object + rclone backend cleanup -o max-age=7w s3:bucket/path/to/object ---s3-provider +Durations are parsed as per the rest of rclone, 2h, 7d, 7w etc. -Choose your S3 provider. +Options: -Properties: +- "max-age": Max age of upload to delete -- Config: provider -- Env Var: RCLONE_S3_PROVIDER -- Type: string -- Required: false -- Examples: - - "AWS" - - Amazon Web Services (AWS) S3 - - "Alibaba" - - Alibaba Cloud Object Storage System (OSS) formerly Aliyun - - "ArvanCloud" - - Arvan Cloud Object Storage (AOS) - - "Ceph" - - Ceph Object Storage - - "ChinaMobile" - - China Mobile Ecloud Elastic Object Storage (EOS) - - "Cloudflare" - - Cloudflare R2 Storage - - "DigitalOcean" - - DigitalOcean Spaces - - "Dreamhost" - - Dreamhost DreamObjects - - "GCS" - - Google Cloud Storage - - "HuaweiOBS" - - Huawei Object Storage Service - - "IBMCOS" - - IBM COS S3 - - "IDrive" - - IDrive e2 - - "IONOS" - - IONOS Cloud - - "LyveCloud" - - Seagate Lyve Cloud - - "Leviia" - - Leviia Object Storage - - "Liara" - - Liara Object Storage - - "Minio" - - Minio Object Storage - - "Netease" - - Netease Object Storage (NOS) - - "Petabox" - - Petabox Object Storage - - "RackCorp" - - RackCorp Object Storage - - "Scaleway" - - Scaleway Object Storage - - "SeaweedFS" - - SeaweedFS S3 - - "StackPath" - - StackPath Object Storage - - "Storj" - - Storj (S3 Compatible Gateway) - - "Synology" - - Synology C2 Object Storage - - "TencentCOS" - - Tencent Cloud Object Storage (COS) - - "Wasabi" - - Wasabi Object Storage - - "Qiniu" - - Qiniu Object Storage (Kodo) - - "Other" - - Any other S3 compatible provider +cleanup-hidden ---s3-env-auth +Remove old versions of files. -Get AWS credentials from runtime (environment variables or EC2/ECS meta -data if no env vars). + rclone backend cleanup-hidden remote: [options] [+] -Only applies if access_key_id and secret_access_key is blank. +This command removes any old hidden versions of files on a versions +enabled bucket. -Properties: +Note that you can use --interactive/-i or --dry-run with this command to +see what it would do. -- Config: env_auth -- Env Var: RCLONE_S3_ENV_AUTH -- Type: bool -- Default: false -- Examples: - - "false" - - Enter AWS credentials in the next step. - - "true" - - Get AWS credentials from the environment (env vars or IAM). + rclone backend cleanup-hidden s3:bucket/path/to/dir ---s3-access-key-id +versioning -AWS Access Key ID. +Set/get versioning support for a bucket. -Leave blank for anonymous access or runtime credentials. + rclone backend versioning remote: [options] [+] -Properties: +This command sets versioning support if a parameter is passed and then +returns the current versioning status for the bucket supplied. -- Config: access_key_id -- Env Var: RCLONE_S3_ACCESS_KEY_ID -- Type: string -- Required: false + rclone backend versioning s3:bucket # read status only + rclone backend versioning s3:bucket Enabled + rclone backend versioning s3:bucket Suspended ---s3-secret-access-key +It may return "Enabled", "Suspended" or "Unversioned". Note that once +versioning has been enabled the status can't be set back to +"Unversioned". -AWS Secret Access Key (password). +set -Leave blank for anonymous access or runtime credentials. +Set command for updating the config parameters. -Properties: + rclone backend set remote: [options] [+] -- Config: secret_access_key -- Env Var: RCLONE_S3_SECRET_ACCESS_KEY -- Type: string -- Required: false +This set command can be used to update the config parameters for a +running s3 backend. ---s3-region +Usage Examples: -Region to connect to. + rclone backend set s3: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=s3: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=s3: -o session_token=X -o access_key_id=X -o secret_access_key=X -Properties: +The option keys are named as they are in the config file. -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: AWS -- Type: string -- Required: false -- Examples: - - "us-east-1" - - The default endpoint - a good choice if you are unsure. - - US Region, Northern Virginia, or Pacific Northwest. - - Leave location constraint empty. - - "us-east-2" - - US East (Ohio) Region. - - Needs location constraint us-east-2. - - "us-west-1" - - US West (Northern California) Region. - - Needs location constraint us-west-1. - - "us-west-2" - - US West (Oregon) Region. - - Needs location constraint us-west-2. - - "ca-central-1" - - Canada (Central) Region. - - Needs location constraint ca-central-1. - - "eu-west-1" - - EU (Ireland) Region. - - Needs location constraint EU or eu-west-1. - - "eu-west-2" - - EU (London) Region. - - Needs location constraint eu-west-2. - - "eu-west-3" - - EU (Paris) Region. - - Needs location constraint eu-west-3. - - "eu-north-1" - - EU (Stockholm) Region. - - Needs location constraint eu-north-1. - - "eu-south-1" - - EU (Milan) Region. - - Needs location constraint eu-south-1. - - "eu-central-1" - - EU (Frankfurt) Region. - - Needs location constraint eu-central-1. - - "ap-southeast-1" - - Asia Pacific (Singapore) Region. - - Needs location constraint ap-southeast-1. - - "ap-southeast-2" - - Asia Pacific (Sydney) Region. - - Needs location constraint ap-southeast-2. - - "ap-northeast-1" - - Asia Pacific (Tokyo) Region. - - Needs location constraint ap-northeast-1. - - "ap-northeast-2" - - Asia Pacific (Seoul). - - Needs location constraint ap-northeast-2. - - "ap-northeast-3" - - Asia Pacific (Osaka-Local). - - Needs location constraint ap-northeast-3. - - "ap-south-1" - - Asia Pacific (Mumbai). - - Needs location constraint ap-south-1. - - "ap-east-1" - - Asia Pacific (Hong Kong) Region. - - Needs location constraint ap-east-1. - - "sa-east-1" - - South America (Sao Paulo) Region. - - Needs location constraint sa-east-1. - - "me-south-1" - - Middle East (Bahrain) Region. - - Needs location constraint me-south-1. - - "af-south-1" - - Africa (Cape Town) Region. - - Needs location constraint af-south-1. - - "cn-north-1" - - China (Beijing) Region. - - Needs location constraint cn-north-1. - - "cn-northwest-1" - - China (Ningxia) Region. - - Needs location constraint cn-northwest-1. - - "us-gov-east-1" - - AWS GovCloud (US-East) Region. - - Needs location constraint us-gov-east-1. - - "us-gov-west-1" - - AWS GovCloud (US) Region. - - Needs location constraint us-gov-west-1. +This rebuilds the connection to the s3 backend when it is called with +the new parameters. Only new parameters need be passed as the values +will default to those currently in use. ---s3-region +It doesn't return anything. -region - the location where your bucket will be created and your data -stored. +Anonymous access to public buckets -Properties: +If you want to use rclone to access a public bucket, configure with a +blank access_key_id and secret_access_key. Your config should end up +looking like this: -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: RackCorp -- Type: string -- Required: false -- Examples: - - "global" - - Global CDN (All locations) Region - - "au" - - Australia (All states) - - "au-nsw" - - NSW (Australia) Region - - "au-qld" - - QLD (Australia) Region - - "au-vic" - - VIC (Australia) Region - - "au-wa" - - Perth (Australia) Region - - "ph" - - Manila (Philippines) Region - - "th" - - Bangkok (Thailand) Region - - "hk" - - HK (Hong Kong) Region - - "mn" - - Ulaanbaatar (Mongolia) Region - - "kg" - - Bishkek (Kyrgyzstan) Region - - "id" - - Jakarta (Indonesia) Region - - "jp" - - Tokyo (Japan) Region - - "sg" - - SG (Singapore) Region - - "de" - - Frankfurt (Germany) Region - - "us" - - USA (AnyCast) Region - - "us-east-1" - - New York (USA) Region - - "us-west-1" - - Freemont (USA) Region - - "nz" - - Auckland (New Zealand) Region + [anons3] + type = s3 + provider = AWS + env_auth = false + access_key_id = + secret_access_key = + region = us-east-1 + endpoint = + location_constraint = + acl = private + server_side_encryption = + storage_class = ---s3-region +Then use it as normal with the name of the public bucket, e.g. -Region to connect to. + rclone lsd anons3:1000genomes -Properties: +You will be able to list and copy data but not upload it. -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: Scaleway -- Type: string -- Required: false -- Examples: - - "nl-ams" - - Amsterdam, The Netherlands - - "fr-par" - - Paris, France - - "pl-waw" - - Warsaw, Poland +Providers ---s3-region +AWS S3 -Region to connect to. - the location where your bucket will be created -and your data stored. Need bo be same with your endpoint. +This is the provider used as main example and described in the +configuration section above. -Properties: +AWS Snowball Edge -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: HuaweiOBS -- Type: string -- Required: false -- Examples: - - "af-south-1" - - AF-Johannesburg - - "ap-southeast-2" - - AP-Bangkok - - "ap-southeast-3" - - AP-Singapore - - "cn-east-3" - - CN East-Shanghai1 - - "cn-east-2" - - CN East-Shanghai2 - - "cn-north-1" - - CN North-Beijing1 - - "cn-north-4" - - CN North-Beijing4 - - "cn-south-1" - - CN South-Guangzhou - - "ap-southeast-1" - - CN-Hong Kong - - "sa-argentina-1" - - LA-Buenos Aires1 - - "sa-peru-1" - - LA-Lima1 - - "na-mexico-1" - - LA-Mexico City1 - - "sa-chile-1" - - LA-Santiago2 - - "sa-brazil-1" - - LA-Sao Paulo1 - - "ru-northwest-2" - - RU-Moscow2 +AWS Snowball is a hardware appliance used for transferring bulk data +back to AWS. Its main software interface is S3 object storage. ---s3-region +To use rclone with AWS Snowball Edge devices, configure as standard for +an 'S3 Compatible Service'. -Region to connect to. +If using rclone pre v1.59 be sure to set upload_cutoff = 0 otherwise you +will run into authentication header issues as the snowball device does +not support query parameter based authentication. -Properties: +With rclone v1.59 or later setting upload_cutoff should not be +necessary. -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: Cloudflare -- Type: string -- Required: false -- Examples: - - "auto" - - R2 buckets are automatically distributed across Cloudflare's - data centers for low latency. +eg. ---s3-region + [snowball] + type = s3 + provider = Other + access_key_id = YOUR_ACCESS_KEY + secret_access_key = YOUR_SECRET_KEY + endpoint = http://[IP of Snowball]:8080 + upload_cutoff = 0 -Region to connect to. +Ceph -Properties: +Ceph is an open-source, unified, distributed storage system designed for +excellent performance, reliability and scalability. It has an S3 +compatible object storage interface. -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: Qiniu -- Type: string -- Required: false -- Examples: - - "cn-east-1" - - The default endpoint - a good choice if you are unsure. - - East China Region 1. - - Needs location constraint cn-east-1. - - "cn-east-2" - - East China Region 2. - - Needs location constraint cn-east-2. - - "cn-north-1" - - North China Region 1. - - Needs location constraint cn-north-1. - - "cn-south-1" - - South China Region 1. - - Needs location constraint cn-south-1. - - "us-north-1" - - North America Region. - - Needs location constraint us-north-1. - - "ap-southeast-1" - - Southeast Asia Region 1. - - Needs location constraint ap-southeast-1. - - "ap-northeast-1" - - Northeast Asia Region 1. - - Needs location constraint ap-northeast-1. +To use rclone with Ceph, configure as above but leave the region blank +and set the endpoint. You should end up with something like this in your +config: ---s3-region + [ceph] + type = s3 + provider = Ceph + env_auth = false + access_key_id = XXX + secret_access_key = YYY + region = + endpoint = https://ceph.endpoint.example.com + location_constraint = + acl = + server_side_encryption = + storage_class = -Region where your bucket will be created and your data stored. +If you are using an older version of CEPH (e.g. 10.2.x Jewel) and a +version of rclone before v1.59 then you may need to supply the parameter +--s3-upload-cutoff 0 or put this in the config file as upload_cutoff 0 +to work around a bug which causes uploading of small files to fail. -Properties: +Note also that Ceph sometimes puts / in the passwords it gives users. If +you read the secret access key using the command line tools you will get +a JSON blob with the / escaped as \/. Make sure you only write / in the +secret access key. -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: IONOS -- Type: string -- Required: false -- Examples: - - "de" - - Frankfurt, Germany - - "eu-central-2" - - Berlin, Germany - - "eu-south-2" - - Logrono, Spain +Eg the dump from Ceph looks something like this (irrelevant keys +removed). ---s3-region + { + "user_id": "xxx", + "display_name": "xxxx", + "keys": [ + { + "user": "xxx", + "access_key": "xxxxxx", + "secret_key": "xxxxxx\/xxxx" + } + ], + } -Region where your bucket will be created and your data stored. +Because this is a json dump, it is encoding the / as \/, so if you use +the secret key as xxxxxx/xxxx it will work fine. -Properties: +Cloudflare R2 -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: Petabox -- Type: string -- Required: false -- Examples: - - "us-east-1" - - US East (N. Virginia) - - "eu-central-1" - - Europe (Frankfurt) - - "ap-southeast-1" - - Asia Pacific (Singapore) - - "me-south-1" - - Middle East (Bahrain) - - "sa-east-1" - - South America (São Paulo) +Cloudflare R2 Storage allows developers to store large amounts of +unstructured data without the costly egress bandwidth fees associated +with typical cloud storage services. ---s3-region +Here is an example of making a Cloudflare R2 configuration. First run: + + rclone config + +This will guide you through an interactive setup process. + +Note that all buckets are private, and all are stored in the same "auto" +region. It is necessary to use Cloudflare workers to share the content +of a bucket publicly. + + No remotes found, make a new one? + n) New remote + s) Set configuration password + q) Quit config + n/s/q> n + name> r2 + Option Storage. + Type of storage to configure. + Choose a number from below, or type in your own value. + ... + XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi + \ (s3) + ... + Storage> s3 + Option provider. + Choose your S3 provider. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + ... + XX / Cloudflare R2 Storage + \ (Cloudflare) + ... + provider> Cloudflare + Option env_auth. + Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). + Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) + env_auth> 1 + Option access_key_id. + AWS Access Key ID. + Leave blank for anonymous access or runtime credentials. + Enter a value. Press Enter to leave empty. + access_key_id> ACCESS_KEY + Option secret_access_key. + AWS Secret Access Key (password). + Leave blank for anonymous access or runtime credentials. + Enter a value. Press Enter to leave empty. + secret_access_key> SECRET_ACCESS_KEY + Option region. + Region to connect to. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + 1 / R2 buckets are automatically distributed across Cloudflare's data centers for low latency. + \ (auto) + region> 1 + Option endpoint. + Endpoint for S3 API. + Required when using an S3 clone. + Enter a value. Press Enter to leave empty. + endpoint> https://ACCOUNT_ID.r2.cloudflarestorage.com + Edit advanced config? + y) Yes + n) No (default) + y/n> n + -------------------- + y) Yes this is OK (default) + e) Edit this remote + d) Delete this remote + y/e/d> y -Region where your data stored. +This will leave your config looking something like: -Properties: + [r2] + type = s3 + provider = Cloudflare + access_key_id = ACCESS_KEY + secret_access_key = SECRET_ACCESS_KEY + region = auto + endpoint = https://ACCOUNT_ID.r2.cloudflarestorage.com + acl = private -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: Synology -- Type: string -- Required: false -- Examples: - - "eu-001" - - Europe Region 1 - - "eu-002" - - Europe Region 2 - - "us-001" - - US Region 1 - - "us-002" - - US Region 2 - - "tw-001" - - Asia (Taiwan) +Now run rclone lsf r2: to see your buckets and rclone lsf r2:bucket to +look within a bucket. ---s3-region +Dreamhost -Region to connect to. +Dreamhost DreamObjects is an object storage system based on CEPH. -Leave blank if you are using an S3 clone and you don't have a region. +To use rclone with Dreamhost, configure as above but leave the region +blank and set the endpoint. You should end up with something like this +in your config: -Properties: + [dreamobjects] + type = s3 + provider = DreamHost + env_auth = false + access_key_id = your_access_key + secret_access_key = your_secret_key + region = + endpoint = objects-us-west-1.dream.io + location_constraint = + acl = private + server_side_encryption = + storage_class = -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: - !AWS,Alibaba,ArvanCloud,ChinaMobile,Cloudflare,IONOS,Petabox,Liara,Qiniu,RackCorp,Scaleway,Storj,Synology,TencentCOS,HuaweiOBS,IDrive -- Type: string -- Required: false -- Examples: - - "" - - Use this if unsure. - - Will use v4 signatures and an empty region. - - "other-v2-signature" - - Use this only if v4 signatures don't work. - - E.g. pre Jewel/v10 CEPH. +Google Cloud Storage ---s3-endpoint +GoogleCloudStorage is an S3-interoperable object storage service from +Google Cloud Platform. -Endpoint for S3 API. +To connect to Google Cloud Storage you will need an access key and +secret key. These can be retrieved by creating an HMAC key. -Leave blank if using AWS to use the default endpoint for the region. + [gs] + type = s3 + provider = GCS + access_key_id = your_access_key + secret_access_key = your_secret_key + endpoint = https://storage.googleapis.com -Properties: +Note that --s3-versions does not work with GCS when it needs to do +directory paging. Rclone will return the error: -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: AWS -- Type: string -- Required: false + s3 protocol error: received versions listing with IsTruncated set with no NextKeyMarker ---s3-endpoint +This is Google bug #312292516. -Endpoint for China Mobile Ecloud Elastic Object Storage (EOS) API. +DigitalOcean Spaces -Properties: +Spaces is an S3-interoperable object storage service from cloud provider +DigitalOcean. -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: ChinaMobile -- Type: string -- Required: false -- Examples: - - "eos-wuxi-1.cmecloud.cn" - - The default endpoint - a good choice if you are unsure. - - East China (Suzhou) - - "eos-jinan-1.cmecloud.cn" - - East China (Jinan) - - "eos-ningbo-1.cmecloud.cn" - - East China (Hangzhou) - - "eos-shanghai-1.cmecloud.cn" - - East China (Shanghai-1) - - "eos-zhengzhou-1.cmecloud.cn" - - Central China (Zhengzhou) - - "eos-hunan-1.cmecloud.cn" - - Central China (Changsha-1) - - "eos-zhuzhou-1.cmecloud.cn" - - Central China (Changsha-2) - - "eos-guangzhou-1.cmecloud.cn" - - South China (Guangzhou-2) - - "eos-dongguan-1.cmecloud.cn" - - South China (Guangzhou-3) - - "eos-beijing-1.cmecloud.cn" - - North China (Beijing-1) - - "eos-beijing-2.cmecloud.cn" - - North China (Beijing-2) - - "eos-beijing-4.cmecloud.cn" - - North China (Beijing-3) - - "eos-huhehaote-1.cmecloud.cn" - - North China (Huhehaote) - - "eos-chengdu-1.cmecloud.cn" - - Southwest China (Chengdu) - - "eos-chongqing-1.cmecloud.cn" - - Southwest China (Chongqing) - - "eos-guiyang-1.cmecloud.cn" - - Southwest China (Guiyang) - - "eos-xian-1.cmecloud.cn" - - Nouthwest China (Xian) - - "eos-yunnan.cmecloud.cn" - - Yunnan China (Kunming) - - "eos-yunnan-2.cmecloud.cn" - - Yunnan China (Kunming-2) - - "eos-tianjin-1.cmecloud.cn" - - Tianjin China (Tianjin) - - "eos-jilin-1.cmecloud.cn" - - Jilin China (Changchun) - - "eos-hubei-1.cmecloud.cn" - - Hubei China (Xiangyan) - - "eos-jiangxi-1.cmecloud.cn" - - Jiangxi China (Nanchang) - - "eos-gansu-1.cmecloud.cn" - - Gansu China (Lanzhou) - - "eos-shanxi-1.cmecloud.cn" - - Shanxi China (Taiyuan) - - "eos-liaoning-1.cmecloud.cn" - - Liaoning China (Shenyang) - - "eos-hebei-1.cmecloud.cn" - - Hebei China (Shijiazhuang) - - "eos-fujian-1.cmecloud.cn" - - Fujian China (Xiamen) - - "eos-guangxi-1.cmecloud.cn" - - Guangxi China (Nanning) - - "eos-anhui-1.cmecloud.cn" - - Anhui China (Huainan) +To connect to DigitalOcean Spaces you will need an access key and secret +key. These can be retrieved on the "Applications & API" page of the +DigitalOcean control panel. They will be needed when prompted by +rclone config for your access_key_id and secret_access_key. ---s3-endpoint +When prompted for a region or location_constraint, press enter to use +the default value. The region must be included in the endpoint setting +(e.g. nyc3.digitaloceanspaces.com). The default values can be used for +other settings. -Endpoint for Arvan Cloud Object Storage (AOS) API. +Going through the whole process of creating a new remote by running +rclone config, each prompt should be answered as shown below: -Properties: + Storage> s3 + env_auth> 1 + access_key_id> YOUR_ACCESS_KEY + secret_access_key> YOUR_SECRET_KEY + region> + endpoint> nyc3.digitaloceanspaces.com + location_constraint> + acl> + storage_class> -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: ArvanCloud -- Type: string -- Required: false -- Examples: - - "s3.ir-thr-at1.arvanstorage.ir" - - The default endpoint - a good choice if you are unsure. - - Tehran Iran (Simin) - - "s3.ir-tbz-sh1.arvanstorage.ir" - - Tabriz Iran (Shahriar) +The resulting configuration file should look like: ---s3-endpoint + [spaces] + type = s3 + provider = DigitalOcean + env_auth = false + access_key_id = YOUR_ACCESS_KEY + secret_access_key = YOUR_SECRET_KEY + region = + endpoint = nyc3.digitaloceanspaces.com + location_constraint = + acl = + server_side_encryption = + storage_class = -Endpoint for IBM COS S3 API. +Once configured, you can create a new Space and begin copying files. For +example: -Specify if using an IBM COS On Premise. + rclone mkdir spaces:my-new-space + rclone copy /path/to/files spaces:my-new-space -Properties: +Huawei OBS -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: IBMCOS -- Type: string -- Required: false -- Examples: - - "s3.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Endpoint - - "s3.dal.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Dallas Endpoint - - "s3.wdc.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Washington DC Endpoint - - "s3.sjc.us.cloud-object-storage.appdomain.cloud" - - US Cross Region San Jose Endpoint - - "s3.private.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Private Endpoint - - "s3.private.dal.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Dallas Private Endpoint - - "s3.private.wdc.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Washington DC Private Endpoint - - "s3.private.sjc.us.cloud-object-storage.appdomain.cloud" - - US Cross Region San Jose Private Endpoint - - "s3.us-east.cloud-object-storage.appdomain.cloud" - - US Region East Endpoint - - "s3.private.us-east.cloud-object-storage.appdomain.cloud" - - US Region East Private Endpoint - - "s3.us-south.cloud-object-storage.appdomain.cloud" - - US Region South Endpoint - - "s3.private.us-south.cloud-object-storage.appdomain.cloud" - - US Region South Private Endpoint - - "s3.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Endpoint - - "s3.fra.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Frankfurt Endpoint - - "s3.mil.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Milan Endpoint - - "s3.ams.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Amsterdam Endpoint - - "s3.private.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Private Endpoint - - "s3.private.fra.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Frankfurt Private Endpoint - - "s3.private.mil.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Milan Private Endpoint - - "s3.private.ams.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Amsterdam Private Endpoint - - "s3.eu-gb.cloud-object-storage.appdomain.cloud" - - Great Britain Endpoint - - "s3.private.eu-gb.cloud-object-storage.appdomain.cloud" - - Great Britain Private Endpoint - - "s3.eu-de.cloud-object-storage.appdomain.cloud" - - EU Region DE Endpoint - - "s3.private.eu-de.cloud-object-storage.appdomain.cloud" - - EU Region DE Private Endpoint - - "s3.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Endpoint - - "s3.tok.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Tokyo Endpoint - - "s3.hkg.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional HongKong Endpoint - - "s3.seo.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Seoul Endpoint - - "s3.private.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Private Endpoint - - "s3.private.tok.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Tokyo Private Endpoint - - "s3.private.hkg.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional HongKong Private Endpoint - - "s3.private.seo.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Seoul Private Endpoint - - "s3.jp-tok.cloud-object-storage.appdomain.cloud" - - APAC Region Japan Endpoint - - "s3.private.jp-tok.cloud-object-storage.appdomain.cloud" - - APAC Region Japan Private Endpoint - - "s3.au-syd.cloud-object-storage.appdomain.cloud" - - APAC Region Australia Endpoint - - "s3.private.au-syd.cloud-object-storage.appdomain.cloud" - - APAC Region Australia Private Endpoint - - "s3.ams03.cloud-object-storage.appdomain.cloud" - - Amsterdam Single Site Endpoint - - "s3.private.ams03.cloud-object-storage.appdomain.cloud" - - Amsterdam Single Site Private Endpoint - - "s3.che01.cloud-object-storage.appdomain.cloud" - - Chennai Single Site Endpoint - - "s3.private.che01.cloud-object-storage.appdomain.cloud" - - Chennai Single Site Private Endpoint - - "s3.mel01.cloud-object-storage.appdomain.cloud" - - Melbourne Single Site Endpoint - - "s3.private.mel01.cloud-object-storage.appdomain.cloud" - - Melbourne Single Site Private Endpoint - - "s3.osl01.cloud-object-storage.appdomain.cloud" - - Oslo Single Site Endpoint - - "s3.private.osl01.cloud-object-storage.appdomain.cloud" - - Oslo Single Site Private Endpoint - - "s3.tor01.cloud-object-storage.appdomain.cloud" - - Toronto Single Site Endpoint - - "s3.private.tor01.cloud-object-storage.appdomain.cloud" - - Toronto Single Site Private Endpoint - - "s3.seo01.cloud-object-storage.appdomain.cloud" - - Seoul Single Site Endpoint - - "s3.private.seo01.cloud-object-storage.appdomain.cloud" - - Seoul Single Site Private Endpoint - - "s3.mon01.cloud-object-storage.appdomain.cloud" - - Montreal Single Site Endpoint - - "s3.private.mon01.cloud-object-storage.appdomain.cloud" - - Montreal Single Site Private Endpoint - - "s3.mex01.cloud-object-storage.appdomain.cloud" - - Mexico Single Site Endpoint - - "s3.private.mex01.cloud-object-storage.appdomain.cloud" - - Mexico Single Site Private Endpoint - - "s3.sjc04.cloud-object-storage.appdomain.cloud" - - San Jose Single Site Endpoint - - "s3.private.sjc04.cloud-object-storage.appdomain.cloud" - - San Jose Single Site Private Endpoint - - "s3.mil01.cloud-object-storage.appdomain.cloud" - - Milan Single Site Endpoint - - "s3.private.mil01.cloud-object-storage.appdomain.cloud" - - Milan Single Site Private Endpoint - - "s3.hkg02.cloud-object-storage.appdomain.cloud" - - Hong Kong Single Site Endpoint - - "s3.private.hkg02.cloud-object-storage.appdomain.cloud" - - Hong Kong Single Site Private Endpoint - - "s3.par01.cloud-object-storage.appdomain.cloud" - - Paris Single Site Endpoint - - "s3.private.par01.cloud-object-storage.appdomain.cloud" - - Paris Single Site Private Endpoint - - "s3.sng01.cloud-object-storage.appdomain.cloud" - - Singapore Single Site Endpoint - - "s3.private.sng01.cloud-object-storage.appdomain.cloud" - - Singapore Single Site Private Endpoint +Object Storage Service (OBS) provides stable, secure, efficient, and +easy-to-use cloud storage that lets you store virtually any volume of +unstructured data in any format and access it from anywhere. ---s3-endpoint +OBS provides an S3 interface, you can copy and modify the following +configuration and add it to your rclone configuration file. -Endpoint for IONOS S3 Object Storage. + [obs] + type = s3 + provider = HuaweiOBS + access_key_id = your-access-key-id + secret_access_key = your-secret-access-key + region = af-south-1 + endpoint = obs.af-south-1.myhuaweicloud.com + acl = private -Specify the endpoint from the same region. +Or you can also configure via the interactive command line: -Properties: + No remotes found, make a new one? + n) New remote + s) Set configuration password + q) Quit config + n/s/q> n + name> obs + Option Storage. + Type of storage to configure. + Choose a number from below, or type in your own value. + [snip] + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi + \ (s3) + [snip] + Storage> 5 + Option provider. + Choose your S3 provider. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + [snip] + 9 / Huawei Object Storage Service + \ (HuaweiOBS) + [snip] + provider> 9 + Option env_auth. + Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). + Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) + env_auth> 1 + Option access_key_id. + AWS Access Key ID. + Leave blank for anonymous access or runtime credentials. + Enter a value. Press Enter to leave empty. + access_key_id> your-access-key-id + Option secret_access_key. + AWS Secret Access Key (password). + Leave blank for anonymous access or runtime credentials. + Enter a value. Press Enter to leave empty. + secret_access_key> your-secret-access-key + Option region. + Region to connect to. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + 1 / AF-Johannesburg + \ (af-south-1) + 2 / AP-Bangkok + \ (ap-southeast-2) + [snip] + region> 1 + Option endpoint. + Endpoint for OBS API. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + 1 / AF-Johannesburg + \ (obs.af-south-1.myhuaweicloud.com) + 2 / AP-Bangkok + \ (obs.ap-southeast-2.myhuaweicloud.com) + [snip] + endpoint> 1 + Option acl. + Canned ACL used when creating buckets and storing or copying objects. + This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. + For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl + Note that this ACL is applied when server-side copying objects as S3 + doesn't copy the ACL from the source but rather writes a fresh one. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + [snip] + acl> 1 + Edit advanced config? + y) Yes + n) No (default) + y/n> + -------------------- + [obs] + type = s3 + provider = HuaweiOBS + access_key_id = your-access-key-id + secret_access_key = your-secret-access-key + region = af-south-1 + endpoint = obs.af-south-1.myhuaweicloud.com + acl = private + -------------------- + y) Yes this is OK (default) + e) Edit this remote + d) Delete this remote + y/e/d> y + Current remotes: -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: IONOS -- Type: string -- Required: false -- Examples: - - "s3-eu-central-1.ionoscloud.com" - - Frankfurt, Germany - - "s3-eu-central-2.ionoscloud.com" - - Berlin, Germany - - "s3-eu-south-2.ionoscloud.com" - - Logrono, Spain + Name Type + ==== ==== + obs s3 ---s3-endpoint + e) Edit existing remote + n) New remote + d) Delete remote + r) Rename remote + c) Copy remote + s) Set configuration password + q) Quit config + e/n/d/r/c/s/q> q -Endpoint for Petabox S3 Object Storage. +IBM COS (S3) -Specify the endpoint from the same region. +Information stored with IBM Cloud Object Storage is encrypted and +dispersed across multiple geographic locations, and accessed through an +implementation of the S3 API. This service makes use of the distributed +storage technologies provided by IBM’s Cloud Object Storage System +(formerly Cleversafe). For more information visit: +(http://www.ibm.com/cloud/object-storage) -Properties: +To configure access to IBM COS S3, follow the steps below: -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Petabox -- Type: string -- Required: true -- Examples: - - "s3.petabox.io" - - US East (N. Virginia) - - "s3.us-east-1.petabox.io" - - US East (N. Virginia) - - "s3.eu-central-1.petabox.io" - - Europe (Frankfurt) - - "s3.ap-southeast-1.petabox.io" - - Asia Pacific (Singapore) - - "s3.me-south-1.petabox.io" - - Middle East (Bahrain) - - "s3.sa-east-1.petabox.io" - - South America (São Paulo) +1. Run rclone config and select n for a new remote. ---s3-endpoint + 2018/02/14 14:13:11 NOTICE: Config file "C:\\Users\\a\\.config\\rclone\\rclone.conf" not found - using defaults + No remotes found, make a new one? + n) New remote + s) Set configuration password + q) Quit config + n/s/q> n -Endpoint for Leviia Object Storage API. +2. Enter the name for the configuration -Properties: + name> -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Leviia -- Type: string -- Required: false -- Examples: - - "s3.leviia.com" - - The default endpoint - - Leviia +3. Select "s3" storage. ---s3-endpoint + Choose a number from below, or type in your own value + 1 / Alias for an existing remote + \ "alias" + 2 / Amazon Drive + \ "amazon cloud drive" + 3 / Amazon S3 Complaint Storage Providers (Dreamhost, Ceph, ChinaMobile, Liara, ArvanCloud, Minio, IBM COS) + \ "s3" + 4 / Backblaze B2 + \ "b2" + [snip] + 23 / HTTP + \ "http" + Storage> 3 -Endpoint for Liara Object Storage API. +4. Select IBM COS as the S3 Storage Provider. -Properties: + Choose the S3 provider. + Choose a number from below, or type in your own value + 1 / Choose this option to configure Storage to AWS S3 + \ "AWS" + 2 / Choose this option to configure Storage to Ceph Systems + \ "Ceph" + 3 / Choose this option to configure Storage to Dreamhost + \ "Dreamhost" + 4 / Choose this option to the configure Storage to IBM COS S3 + \ "IBMCOS" + 5 / Choose this option to the configure Storage to Minio + \ "Minio" + Provider>4 -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Liara -- Type: string -- Required: false -- Examples: - - "storage.iran.liara.space" - - The default endpoint - - Iran +5. Enter the Access Key and Secret. ---s3-endpoint + AWS Access Key ID - leave blank for anonymous access or runtime credentials. + access_key_id> <> + AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. + secret_access_key> <> -Endpoint for OSS API. +6. Specify the endpoint for IBM COS. For Public IBM COS, choose from + the option below. For On Premise IBM COS, enter an endpoint address. -Properties: + Endpoint for IBM COS S3 API. + Specify if using an IBM COS On Premise. + Choose a number from below, or type in your own value + 1 / US Cross Region Endpoint + \ "s3-api.us-geo.objectstorage.softlayer.net" + 2 / US Cross Region Dallas Endpoint + \ "s3-api.dal.us-geo.objectstorage.softlayer.net" + 3 / US Cross Region Washington DC Endpoint + \ "s3-api.wdc-us-geo.objectstorage.softlayer.net" + 4 / US Cross Region San Jose Endpoint + \ "s3-api.sjc-us-geo.objectstorage.softlayer.net" + 5 / US Cross Region Private Endpoint + \ "s3-api.us-geo.objectstorage.service.networklayer.com" + 6 / US Cross Region Dallas Private Endpoint + \ "s3-api.dal-us-geo.objectstorage.service.networklayer.com" + 7 / US Cross Region Washington DC Private Endpoint + \ "s3-api.wdc-us-geo.objectstorage.service.networklayer.com" + 8 / US Cross Region San Jose Private Endpoint + \ "s3-api.sjc-us-geo.objectstorage.service.networklayer.com" + 9 / US Region East Endpoint + \ "s3.us-east.objectstorage.softlayer.net" + 10 / US Region East Private Endpoint + \ "s3.us-east.objectstorage.service.networklayer.com" + 11 / US Region South Endpoint + [snip] + 34 / Toronto Single Site Private Endpoint + \ "s3.tor01.objectstorage.service.networklayer.com" + endpoint>1 -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Alibaba -- Type: string -- Required: false -- Examples: - - "oss-accelerate.aliyuncs.com" - - Global Accelerate - - "oss-accelerate-overseas.aliyuncs.com" - - Global Accelerate (outside mainland China) - - "oss-cn-hangzhou.aliyuncs.com" - - East China 1 (Hangzhou) - - "oss-cn-shanghai.aliyuncs.com" - - East China 2 (Shanghai) - - "oss-cn-qingdao.aliyuncs.com" - - North China 1 (Qingdao) - - "oss-cn-beijing.aliyuncs.com" - - North China 2 (Beijing) - - "oss-cn-zhangjiakou.aliyuncs.com" - - North China 3 (Zhangjiakou) - - "oss-cn-huhehaote.aliyuncs.com" - - North China 5 (Hohhot) - - "oss-cn-wulanchabu.aliyuncs.com" - - North China 6 (Ulanqab) - - "oss-cn-shenzhen.aliyuncs.com" - - South China 1 (Shenzhen) - - "oss-cn-heyuan.aliyuncs.com" - - South China 2 (Heyuan) - - "oss-cn-guangzhou.aliyuncs.com" - - South China 3 (Guangzhou) - - "oss-cn-chengdu.aliyuncs.com" - - West China 1 (Chengdu) - - "oss-cn-hongkong.aliyuncs.com" - - Hong Kong (Hong Kong) - - "oss-us-west-1.aliyuncs.com" - - US West 1 (Silicon Valley) - - "oss-us-east-1.aliyuncs.com" - - US East 1 (Virginia) - - "oss-ap-southeast-1.aliyuncs.com" - - Southeast Asia Southeast 1 (Singapore) - - "oss-ap-southeast-2.aliyuncs.com" - - Asia Pacific Southeast 2 (Sydney) - - "oss-ap-southeast-3.aliyuncs.com" - - Southeast Asia Southeast 3 (Kuala Lumpur) - - "oss-ap-southeast-5.aliyuncs.com" - - Asia Pacific Southeast 5 (Jakarta) - - "oss-ap-northeast-1.aliyuncs.com" - - Asia Pacific Northeast 1 (Japan) - - "oss-ap-south-1.aliyuncs.com" - - Asia Pacific South 1 (Mumbai) - - "oss-eu-central-1.aliyuncs.com" - - Central Europe 1 (Frankfurt) - - "oss-eu-west-1.aliyuncs.com" - - West Europe (London) - - "oss-me-east-1.aliyuncs.com" - - Middle East 1 (Dubai) +7. Specify a IBM COS Location Constraint. The location constraint must + match endpoint when using IBM Cloud Public. For on-prem COS, do not + make a selection from this list, hit enter ---s3-endpoint + 1 / US Cross Region Standard + \ "us-standard" + 2 / US Cross Region Vault + \ "us-vault" + 3 / US Cross Region Cold + \ "us-cold" + 4 / US Cross Region Flex + \ "us-flex" + 5 / US East Region Standard + \ "us-east-standard" + 6 / US East Region Vault + \ "us-east-vault" + 7 / US East Region Cold + \ "us-east-cold" + 8 / US East Region Flex + \ "us-east-flex" + 9 / US South Region Standard + \ "us-south-standard" + 10 / US South Region Vault + \ "us-south-vault" + [snip] + 32 / Toronto Flex + \ "tor01-flex" + location_constraint>1 -Endpoint for OBS API. +9. Specify a canned ACL. IBM Cloud (Storage) supports "public-read" and + "private". IBM Cloud(Infra) supports all the canned ACLs. On-Premise + COS supports all the canned ACLs. -Properties: + Canned ACL used when creating buckets and/or storing objects in S3. + For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl + Choose a number from below, or type in your own value + 1 / Owner gets FULL_CONTROL. No one else has access rights (default). This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise COS + \ "private" + 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access. This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise IBM COS + \ "public-read" + 3 / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. This acl is available on IBM Cloud (Infra), On-Premise IBM COS + \ "public-read-write" + 4 / Owner gets FULL_CONTROL. The AuthenticatedUsers group gets READ access. Not supported on Buckets. This acl is available on IBM Cloud (Infra) and On-Premise IBM COS + \ "authenticated-read" + acl> 1 -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: HuaweiOBS -- Type: string -- Required: false -- Examples: - - "obs.af-south-1.myhuaweicloud.com" - - AF-Johannesburg - - "obs.ap-southeast-2.myhuaweicloud.com" - - AP-Bangkok - - "obs.ap-southeast-3.myhuaweicloud.com" - - AP-Singapore - - "obs.cn-east-3.myhuaweicloud.com" - - CN East-Shanghai1 - - "obs.cn-east-2.myhuaweicloud.com" - - CN East-Shanghai2 - - "obs.cn-north-1.myhuaweicloud.com" - - CN North-Beijing1 - - "obs.cn-north-4.myhuaweicloud.com" - - CN North-Beijing4 - - "obs.cn-south-1.myhuaweicloud.com" - - CN South-Guangzhou - - "obs.ap-southeast-1.myhuaweicloud.com" - - CN-Hong Kong - - "obs.sa-argentina-1.myhuaweicloud.com" - - LA-Buenos Aires1 - - "obs.sa-peru-1.myhuaweicloud.com" - - LA-Lima1 - - "obs.na-mexico-1.myhuaweicloud.com" - - LA-Mexico City1 - - "obs.sa-chile-1.myhuaweicloud.com" - - LA-Santiago2 - - "obs.sa-brazil-1.myhuaweicloud.com" - - LA-Sao Paulo1 - - "obs.ru-northwest-2.myhuaweicloud.com" - - RU-Moscow2 +12. Review the displayed configuration and accept to save the "remote" + then quit. The config file should look like this ---s3-endpoint + [xxx] + type = s3 + Provider = IBMCOS + access_key_id = xxx + secret_access_key = yyy + endpoint = s3-api.us-geo.objectstorage.softlayer.net + location_constraint = us-standard + acl = private -Endpoint for Scaleway Object Storage. +13. Execute rclone commands -Properties: + 1) Create a bucket. + rclone mkdir IBM-COS-XREGION:newbucket + 2) List available buckets. + rclone lsd IBM-COS-XREGION: + -1 2017-11-08 21:16:22 -1 test + -1 2018-02-14 20:16:39 -1 newbucket + 3) List contents of a bucket. + rclone ls IBM-COS-XREGION:newbucket + 18685952 test.exe + 4) Copy a file from local to remote. + rclone copy /Users/file.txt IBM-COS-XREGION:newbucket + 5) Copy a file from remote to local. + rclone copy IBM-COS-XREGION:newbucket/file.txt . + 6) Delete a file on remote. + rclone delete IBM-COS-XREGION:newbucket/file.txt -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Scaleway -- Type: string -- Required: false -- Examples: - - "s3.nl-ams.scw.cloud" - - Amsterdam Endpoint - - "s3.fr-par.scw.cloud" - - Paris Endpoint - - "s3.pl-waw.scw.cloud" - - Warsaw Endpoint +IDrive e2 ---s3-endpoint +Here is an example of making an IDrive e2 configuration. First run: -Endpoint for StackPath Object Storage. + rclone config -Properties: +This will guide you through an interactive setup process. -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: StackPath -- Type: string -- Required: false -- Examples: - - "s3.us-east-2.stackpathstorage.com" - - US East Endpoint - - "s3.us-west-1.stackpathstorage.com" - - US West Endpoint - - "s3.eu-central-1.stackpathstorage.com" - - EU Endpoint + No remotes found, make a new one? + n) New remote + s) Set configuration password + q) Quit config + n/s/q> n ---s3-endpoint + Enter name for new remote. + name> e2 -Endpoint for Google Cloud Storage. + Option Storage. + Type of storage to configure. + Choose a number from below, or type in your own value. + [snip] + XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi + \ (s3) + [snip] + Storage> s3 -Properties: + Option provider. + Choose your S3 provider. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + [snip] + XX / IDrive e2 + \ (IDrive) + [snip] + provider> IDrive -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: GCS -- Type: string -- Required: false -- Examples: - - "https://storage.googleapis.com" - - Google Cloud Storage endpoint + Option env_auth. + Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). + Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) + env_auth> ---s3-endpoint + Option access_key_id. + AWS Access Key ID. + Leave blank for anonymous access or runtime credentials. + Enter a value. Press Enter to leave empty. + access_key_id> YOUR_ACCESS_KEY -Endpoint for Storj Gateway. + Option secret_access_key. + AWS Secret Access Key (password). + Leave blank for anonymous access or runtime credentials. + Enter a value. Press Enter to leave empty. + secret_access_key> YOUR_SECRET_KEY -Properties: + Option acl. + Canned ACL used when creating buckets and storing or copying objects. + This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. + For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl + Note that this ACL is applied when server-side copying objects as S3 + doesn't copy the ACL from the source but rather writes a fresh one. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + / Owner gets FULL_CONTROL. + 2 | The AllUsers group gets READ access. + \ (public-read) + / Owner gets FULL_CONTROL. + 3 | The AllUsers group gets READ and WRITE access. + | Granting this on a bucket is generally not recommended. + \ (public-read-write) + / Owner gets FULL_CONTROL. + 4 | The AuthenticatedUsers group gets READ access. + \ (authenticated-read) + / Object owner gets FULL_CONTROL. + 5 | Bucket owner gets READ access. + | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \ (bucket-owner-read) + / Both the object owner and the bucket owner get FULL_CONTROL over the object. + 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \ (bucket-owner-full-control) + acl> -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Storj -- Type: string -- Required: false -- Examples: - - "gateway.storjshare.io" - - Global Hosted Gateway + Edit advanced config? + y) Yes + n) No (default) + y/n> ---s3-endpoint + Configuration complete. + Options: + - type: s3 + - provider: IDrive + - access_key_id: YOUR_ACCESS_KEY + - secret_access_key: YOUR_SECRET_KEY + - endpoint: q9d9.la12.idrivee2-5.com + Keep this "e2" remote? + y) Yes this is OK (default) + e) Edit this remote + d) Delete this remote + y/e/d> y -Endpoint for Synology C2 Object Storage API. +IONOS Cloud -Properties: +IONOS S3 Object Storage is a service offered by IONOS for storing and +accessing unstructured data. To connect to the service, you will need an +access key and a secret key. These can be found in the Data Center +Designer, by selecting Manager resources > Object Storage Key Manager. -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Synology -- Type: string -- Required: false -- Examples: - - "eu-001.s3.synologyc2.net" - - EU Endpoint 1 - - "eu-002.s3.synologyc2.net" - - EU Endpoint 2 - - "us-001.s3.synologyc2.net" - - US Endpoint 1 - - "us-002.s3.synologyc2.net" - - US Endpoint 2 - - "tw-001.s3.synologyc2.net" - - TW Endpoint 1 +Here is an example of a configuration. First, run rclone config. This +will walk you through an interactive setup process. Type n to add the +new remote, and then enter a name: ---s3-endpoint + Enter name for new remote. + name> ionos-fra -Endpoint for Tencent COS API. +Type s3 to choose the connection type: -Properties: + Option Storage. + Type of storage to configure. + Choose a number from below, or type in your own value. + [snip] + XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi + \ (s3) + [snip] + Storage> s3 -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: TencentCOS -- Type: string -- Required: false -- Examples: - - "cos.ap-beijing.myqcloud.com" - - Beijing Region - - "cos.ap-nanjing.myqcloud.com" - - Nanjing Region - - "cos.ap-shanghai.myqcloud.com" - - Shanghai Region - - "cos.ap-guangzhou.myqcloud.com" - - Guangzhou Region - - "cos.ap-nanjing.myqcloud.com" - - Nanjing Region - - "cos.ap-chengdu.myqcloud.com" - - Chengdu Region - - "cos.ap-chongqing.myqcloud.com" - - Chongqing Region - - "cos.ap-hongkong.myqcloud.com" - - Hong Kong (China) Region - - "cos.ap-singapore.myqcloud.com" - - Singapore Region - - "cos.ap-mumbai.myqcloud.com" - - Mumbai Region - - "cos.ap-seoul.myqcloud.com" - - Seoul Region - - "cos.ap-bangkok.myqcloud.com" - - Bangkok Region - - "cos.ap-tokyo.myqcloud.com" - - Tokyo Region - - "cos.na-siliconvalley.myqcloud.com" - - Silicon Valley Region - - "cos.na-ashburn.myqcloud.com" - - Virginia Region - - "cos.na-toronto.myqcloud.com" - - Toronto Region - - "cos.eu-frankfurt.myqcloud.com" - - Frankfurt Region - - "cos.eu-moscow.myqcloud.com" - - Moscow Region - - "cos.accelerate.myqcloud.com" - - Use Tencent COS Accelerate Endpoint +Type IONOS: ---s3-endpoint + Option provider. + Choose your S3 provider. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + [snip] + XX / IONOS Cloud + \ (IONOS) + [snip] + provider> IONOS -Endpoint for RackCorp Object Storage. +Press Enter to choose the default option +Enter AWS credentials in the next step: -Properties: + Option env_auth. + Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). + Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) + env_auth> -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: RackCorp -- Type: string -- Required: false -- Examples: - - "s3.rackcorp.com" - - Global (AnyCast) Endpoint - - "au.s3.rackcorp.com" - - Australia (Anycast) Endpoint - - "au-nsw.s3.rackcorp.com" - - Sydney (Australia) Endpoint - - "au-qld.s3.rackcorp.com" - - Brisbane (Australia) Endpoint - - "au-vic.s3.rackcorp.com" - - Melbourne (Australia) Endpoint - - "au-wa.s3.rackcorp.com" - - Perth (Australia) Endpoint - - "ph.s3.rackcorp.com" - - Manila (Philippines) Endpoint - - "th.s3.rackcorp.com" - - Bangkok (Thailand) Endpoint - - "hk.s3.rackcorp.com" - - HK (Hong Kong) Endpoint - - "mn.s3.rackcorp.com" - - Ulaanbaatar (Mongolia) Endpoint - - "kg.s3.rackcorp.com" - - Bishkek (Kyrgyzstan) Endpoint - - "id.s3.rackcorp.com" - - Jakarta (Indonesia) Endpoint - - "jp.s3.rackcorp.com" - - Tokyo (Japan) Endpoint - - "sg.s3.rackcorp.com" - - SG (Singapore) Endpoint - - "de.s3.rackcorp.com" - - Frankfurt (Germany) Endpoint - - "us.s3.rackcorp.com" - - USA (AnyCast) Endpoint - - "us-east-1.s3.rackcorp.com" - - New York (USA) Endpoint - - "us-west-1.s3.rackcorp.com" - - Freemont (USA) Endpoint - - "nz.s3.rackcorp.com" - - Auckland (New Zealand) Endpoint +Enter your Access Key and Secret key. These can be retrieved in the Data +Center Designer, click on the menu “Manager resources” / "Object Storage +Key Manager". ---s3-endpoint + Option access_key_id. + AWS Access Key ID. + Leave blank for anonymous access or runtime credentials. + Enter a value. Press Enter to leave empty. + access_key_id> YOUR_ACCESS_KEY -Endpoint for Qiniu Object Storage. + Option secret_access_key. + AWS Secret Access Key (password). + Leave blank for anonymous access or runtime credentials. + Enter a value. Press Enter to leave empty. + secret_access_key> YOUR_SECRET_KEY -Properties: +Choose the region where your bucket is located: -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Qiniu -- Type: string -- Required: false -- Examples: - - "s3-cn-east-1.qiniucs.com" - - East China Endpoint 1 - - "s3-cn-east-2.qiniucs.com" - - East China Endpoint 2 - - "s3-cn-north-1.qiniucs.com" - - North China Endpoint 1 - - "s3-cn-south-1.qiniucs.com" - - South China Endpoint 1 - - "s3-us-north-1.qiniucs.com" - - North America Endpoint 1 - - "s3-ap-southeast-1.qiniucs.com" - - Southeast Asia Endpoint 1 - - "s3-ap-northeast-1.qiniucs.com" - - Northeast Asia Endpoint 1 + Option region. + Region where your bucket will be created and your data stored. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + 1 / Frankfurt, Germany + \ (de) + 2 / Berlin, Germany + \ (eu-central-2) + 3 / Logrono, Spain + \ (eu-south-2) + region> 2 ---s3-endpoint +Choose the endpoint from the same region: -Endpoint for S3 API. + Option endpoint. + Endpoint for IONOS S3 Object Storage. + Specify the endpoint from the same region. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + 1 / Frankfurt, Germany + \ (s3-eu-central-1.ionoscloud.com) + 2 / Berlin, Germany + \ (s3-eu-central-2.ionoscloud.com) + 3 / Logrono, Spain + \ (s3-eu-south-2.ionoscloud.com) + endpoint> 1 -Required when using an S3 clone. +Press Enter to choose the default option or choose the desired ACL +setting: -Properties: + Option acl. + Canned ACL used when creating buckets and storing or copying objects. + This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. + For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl + Note that this ACL is applied when server-side copying objects as S3 + doesn't copy the ACL from the source but rather writes a fresh one. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + / Owner gets FULL_CONTROL. + [snip] + acl> -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: - !AWS,ArvanCloud,IBMCOS,IDrive,IONOS,TencentCOS,HuaweiOBS,Alibaba,ChinaMobile,GCS,Liara,Scaleway,StackPath,Storj,Synology,RackCorp,Qiniu,Petabox -- Type: string -- Required: false -- Examples: - - "objects-us-east-1.dream.io" - - Dream Objects endpoint - - "syd1.digitaloceanspaces.com" - - DigitalOcean Spaces Sydney 1 - - "sfo3.digitaloceanspaces.com" - - DigitalOcean Spaces San Francisco 3 - - "fra1.digitaloceanspaces.com" - - DigitalOcean Spaces Frankfurt 1 - - "nyc3.digitaloceanspaces.com" - - DigitalOcean Spaces New York 3 - - "ams3.digitaloceanspaces.com" - - DigitalOcean Spaces Amsterdam 3 - - "sgp1.digitaloceanspaces.com" - - DigitalOcean Spaces Singapore 1 - - "localhost:8333" - - SeaweedFS S3 localhost - - "s3.us-east-1.lyvecloud.seagate.com" - - Seagate Lyve Cloud US East 1 (Virginia) - - "s3.us-west-1.lyvecloud.seagate.com" - - Seagate Lyve Cloud US West 1 (California) - - "s3.ap-southeast-1.lyvecloud.seagate.com" - - Seagate Lyve Cloud AP Southeast 1 (Singapore) - - "s3.wasabisys.com" - - Wasabi US East 1 (N. Virginia) - - "s3.us-east-2.wasabisys.com" - - Wasabi US East 2 (N. Virginia) - - "s3.us-central-1.wasabisys.com" - - Wasabi US Central 1 (Texas) - - "s3.us-west-1.wasabisys.com" - - Wasabi US West 1 (Oregon) - - "s3.ca-central-1.wasabisys.com" - - Wasabi CA Central 1 (Toronto) - - "s3.eu-central-1.wasabisys.com" - - Wasabi EU Central 1 (Amsterdam) - - "s3.eu-central-2.wasabisys.com" - - Wasabi EU Central 2 (Frankfurt) - - "s3.eu-west-1.wasabisys.com" - - Wasabi EU West 1 (London) - - "s3.eu-west-2.wasabisys.com" - - Wasabi EU West 2 (Paris) - - "s3.ap-northeast-1.wasabisys.com" - - Wasabi AP Northeast 1 (Tokyo) endpoint - - "s3.ap-northeast-2.wasabisys.com" - - Wasabi AP Northeast 2 (Osaka) endpoint - - "s3.ap-southeast-1.wasabisys.com" - - Wasabi AP Southeast 1 (Singapore) - - "s3.ap-southeast-2.wasabisys.com" - - Wasabi AP Southeast 2 (Sydney) - - "storage.iran.liara.space" - - Liara Iran endpoint - - "s3.ir-thr-at1.arvanstorage.ir" - - ArvanCloud Tehran Iran (Simin) endpoint - - "s3.ir-tbz-sh1.arvanstorage.ir" - - ArvanCloud Tabriz Iran (Shahriar) endpoint +Press Enter to skip the advanced config: ---s3-location-constraint + Edit advanced config? + y) Yes + n) No (default) + y/n> -Location constraint - must be set to match the Region. +Press Enter to save the configuration, and then q to quit the +configuration process: -Used when creating buckets only. + Configuration complete. + Options: + - type: s3 + - provider: IONOS + - access_key_id: YOUR_ACCESS_KEY + - secret_access_key: YOUR_SECRET_KEY + - endpoint: s3-eu-central-1.ionoscloud.com + Keep this "ionos-fra" remote? + y) Yes this is OK (default) + e) Edit this remote + d) Delete this remote + y/e/d> y -Properties: +Done! Now you can try some commands (for macOS, use ./rclone instead of +rclone). -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: AWS -- Type: string -- Required: false -- Examples: - - "" - - Empty for US Region, Northern Virginia, or Pacific Northwest - - "us-east-2" - - US East (Ohio) Region - - "us-west-1" - - US West (Northern California) Region - - "us-west-2" - - US West (Oregon) Region - - "ca-central-1" - - Canada (Central) Region - - "eu-west-1" - - EU (Ireland) Region - - "eu-west-2" - - EU (London) Region - - "eu-west-3" - - EU (Paris) Region - - "eu-north-1" - - EU (Stockholm) Region - - "eu-south-1" - - EU (Milan) Region - - "EU" - - EU Region - - "ap-southeast-1" - - Asia Pacific (Singapore) Region - - "ap-southeast-2" - - Asia Pacific (Sydney) Region - - "ap-northeast-1" - - Asia Pacific (Tokyo) Region - - "ap-northeast-2" - - Asia Pacific (Seoul) Region - - "ap-northeast-3" - - Asia Pacific (Osaka-Local) Region - - "ap-south-1" - - Asia Pacific (Mumbai) Region - - "ap-east-1" - - Asia Pacific (Hong Kong) Region - - "sa-east-1" - - South America (Sao Paulo) Region - - "me-south-1" - - Middle East (Bahrain) Region - - "af-south-1" - - Africa (Cape Town) Region - - "cn-north-1" - - China (Beijing) Region - - "cn-northwest-1" - - China (Ningxia) Region - - "us-gov-east-1" - - AWS GovCloud (US-East) Region - - "us-gov-west-1" - - AWS GovCloud (US) Region +1) Create a bucket (the name must be unique within the whole IONOS S3) ---s3-location-constraint + rclone mkdir ionos-fra:my-bucket -Location constraint - must match endpoint. +2) List available buckets -Used when creating buckets only. + rclone lsd ionos-fra: -Properties: +4) Copy a file from local to remote -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: ChinaMobile -- Type: string -- Required: false -- Examples: - - "wuxi1" - - East China (Suzhou) - - "jinan1" - - East China (Jinan) - - "ningbo1" - - East China (Hangzhou) - - "shanghai1" - - East China (Shanghai-1) - - "zhengzhou1" - - Central China (Zhengzhou) - - "hunan1" - - Central China (Changsha-1) - - "zhuzhou1" - - Central China (Changsha-2) - - "guangzhou1" - - South China (Guangzhou-2) - - "dongguan1" - - South China (Guangzhou-3) - - "beijing1" - - North China (Beijing-1) - - "beijing2" - - North China (Beijing-2) - - "beijing4" - - North China (Beijing-3) - - "huhehaote1" - - North China (Huhehaote) - - "chengdu1" - - Southwest China (Chengdu) - - "chongqing1" - - Southwest China (Chongqing) - - "guiyang1" - - Southwest China (Guiyang) - - "xian1" - - Nouthwest China (Xian) - - "yunnan" - - Yunnan China (Kunming) - - "yunnan2" - - Yunnan China (Kunming-2) - - "tianjin1" - - Tianjin China (Tianjin) - - "jilin1" - - Jilin China (Changchun) - - "hubei1" - - Hubei China (Xiangyan) - - "jiangxi1" - - Jiangxi China (Nanchang) - - "gansu1" - - Gansu China (Lanzhou) - - "shanxi1" - - Shanxi China (Taiyuan) - - "liaoning1" - - Liaoning China (Shenyang) - - "hebei1" - - Hebei China (Shijiazhuang) - - "fujian1" - - Fujian China (Xiamen) - - "guangxi1" - - Guangxi China (Nanning) - - "anhui1" - - Anhui China (Huainan) + rclone copy /Users/file.txt ionos-fra:my-bucket ---s3-location-constraint +3) List contents of a bucket -Location constraint - must match endpoint. + rclone ls ionos-fra:my-bucket -Used when creating buckets only. +5) Copy a file from remote to local -Properties: + rclone copy ionos-fra:my-bucket/file.txt -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: ArvanCloud -- Type: string -- Required: false -- Examples: - - "ir-thr-at1" - - Tehran Iran (Simin) - - "ir-tbz-sh1" - - Tabriz Iran (Shahriar) +Minio ---s3-location-constraint +Minio is an object storage server built for cloud application developers +and devops. -Location constraint - must match endpoint when using IBM Cloud Public. +It is very easy to install and provides an S3 compatible server which +can be used by rclone. -For on-prem COS, do not make a selection from this list, hit enter. +To use it, install Minio following the instructions here. -Properties: +When it configures itself Minio will print something like this -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: IBMCOS -- Type: string -- Required: false -- Examples: - - "us-standard" - - US Cross Region Standard - - "us-vault" - - US Cross Region Vault - - "us-cold" - - US Cross Region Cold - - "us-flex" - - US Cross Region Flex - - "us-east-standard" - - US East Region Standard - - "us-east-vault" - - US East Region Vault - - "us-east-cold" - - US East Region Cold - - "us-east-flex" - - US East Region Flex - - "us-south-standard" - - US South Region Standard - - "us-south-vault" - - US South Region Vault - - "us-south-cold" - - US South Region Cold - - "us-south-flex" - - US South Region Flex - - "eu-standard" - - EU Cross Region Standard - - "eu-vault" - - EU Cross Region Vault - - "eu-cold" - - EU Cross Region Cold - - "eu-flex" - - EU Cross Region Flex - - "eu-gb-standard" - - Great Britain Standard - - "eu-gb-vault" - - Great Britain Vault - - "eu-gb-cold" - - Great Britain Cold - - "eu-gb-flex" - - Great Britain Flex - - "ap-standard" - - APAC Standard - - "ap-vault" - - APAC Vault - - "ap-cold" - - APAC Cold - - "ap-flex" - - APAC Flex - - "mel01-standard" - - Melbourne Standard - - "mel01-vault" - - Melbourne Vault - - "mel01-cold" - - Melbourne Cold - - "mel01-flex" - - Melbourne Flex - - "tor01-standard" - - Toronto Standard - - "tor01-vault" - - Toronto Vault - - "tor01-cold" - - Toronto Cold - - "tor01-flex" - - Toronto Flex + Endpoint: http://192.168.1.106:9000 http://172.23.0.1:9000 + AccessKey: USWUXHGYZQYFYFFIT3RE + SecretKey: MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 + Region: us-east-1 + SQS ARNs: arn:minio:sqs:us-east-1:1:redis arn:minio:sqs:us-east-1:2:redis ---s3-location-constraint + Browser Access: + http://192.168.1.106:9000 http://172.23.0.1:9000 -Location constraint - the location where your bucket will be located and -your data stored. + Command-line Access: https://docs.minio.io/docs/minio-client-quickstart-guide + $ mc config host add myminio http://192.168.1.106:9000 USWUXHGYZQYFYFFIT3RE MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 -Properties: + Object API (Amazon S3 compatible): + Go: https://docs.minio.io/docs/golang-client-quickstart-guide + Java: https://docs.minio.io/docs/java-client-quickstart-guide + Python: https://docs.minio.io/docs/python-client-quickstart-guide + JavaScript: https://docs.minio.io/docs/javascript-client-quickstart-guide + .NET: https://docs.minio.io/docs/dotnet-client-quickstart-guide -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: RackCorp -- Type: string -- Required: false -- Examples: - - "global" - - Global CDN Region - - "au" - - Australia (All locations) - - "au-nsw" - - NSW (Australia) Region - - "au-qld" - - QLD (Australia) Region - - "au-vic" - - VIC (Australia) Region - - "au-wa" - - Perth (Australia) Region - - "ph" - - Manila (Philippines) Region - - "th" - - Bangkok (Thailand) Region - - "hk" - - HK (Hong Kong) Region - - "mn" - - Ulaanbaatar (Mongolia) Region - - "kg" - - Bishkek (Kyrgyzstan) Region - - "id" - - Jakarta (Indonesia) Region - - "jp" - - Tokyo (Japan) Region - - "sg" - - SG (Singapore) Region - - "de" - - Frankfurt (Germany) Region - - "us" - - USA (AnyCast) Region - - "us-east-1" - - New York (USA) Region - - "us-west-1" - - Freemont (USA) Region - - "nz" - - Auckland (New Zealand) Region + Drive Capacity: 26 GiB Free, 165 GiB Total ---s3-location-constraint +These details need to go into rclone config like this. Note that it is +important to put the region in as stated above. -Location constraint - must be set to match the Region. + env_auth> 1 + access_key_id> USWUXHGYZQYFYFFIT3RE + secret_access_key> MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 + region> us-east-1 + endpoint> http://192.168.1.106:9000 + location_constraint> + server_side_encryption> -Used when creating buckets only. +Which makes the config file look like this -Properties: + [minio] + type = s3 + provider = Minio + env_auth = false + access_key_id = USWUXHGYZQYFYFFIT3RE + secret_access_key = MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 + region = us-east-1 + endpoint = http://192.168.1.106:9000 + location_constraint = + server_side_encryption = -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: Qiniu -- Type: string -- Required: false -- Examples: - - "cn-east-1" - - East China Region 1 - - "cn-east-2" - - East China Region 2 - - "cn-north-1" - - North China Region 1 - - "cn-south-1" - - South China Region 1 - - "us-north-1" - - North America Region 1 - - "ap-southeast-1" - - Southeast Asia Region 1 - - "ap-northeast-1" - - Northeast Asia Region 1 +So once set up, for example, to copy files into a bucket ---s3-location-constraint + rclone copy /path/to/files minio:bucket -Location constraint - must be set to match the Region. +Qiniu Cloud Object Storage (Kodo) + +Qiniu Cloud Object Storage (Kodo), a completely independent-researched +core technology which is proven by repeated customer experience has +occupied absolute leading market leader position. Kodo can be widely +applied to mass data management. -Leave blank if not sure. Used when creating buckets only. +To configure access to Qiniu Kodo, follow the steps below: -Properties: +1. Run rclone config and select n for a new remote. -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: - !AWS,Alibaba,ArvanCloud,HuaweiOBS,ChinaMobile,Cloudflare,IBMCOS,IDrive,IONOS,Leviia,Liara,Qiniu,RackCorp,Scaleway,StackPath,Storj,TencentCOS,Petabox -- Type: string -- Required: false + rclone config + No remotes found, make a new one? + n) New remote + s) Set configuration password + q) Quit config + n/s/q> n ---s3-acl +2. Give the name of the configuration. For example, name it 'qiniu'. -Canned ACL used when creating buckets and storing or copying objects. + name> qiniu -This ACL is used for creating objects and if bucket_acl isn't set, for -creating buckets too. +3. Select s3 storage. -For more info visit -https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl + Choose a number from below, or type in your own value + 1 / 1Fichier + \ (fichier) + 2 / Akamai NetStorage + \ (netstorage) + 3 / Alias for an existing remote + \ (alias) + 4 / Amazon Drive + \ (amazon cloud drive) + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi + \ (s3) + [snip] + Storage> s3 -Note that this ACL is applied when server-side copying objects as S3 -doesn't copy the ACL from the source but rather writes a fresh one. +4. Select Qiniu provider. -If the acl is an empty string then no X-Amz-Acl: header is added and the -default (private) will be used. + Choose a number from below, or type in your own value + 1 / Amazon Web Services (AWS) S3 + \ "AWS" + [snip] + 22 / Qiniu Object Storage (Kodo) + \ (Qiniu) + [snip] + provider> Qiniu -Properties: +5. Enter your SecretId and SecretKey of Qiniu Kodo. -- Config: acl -- Env Var: RCLONE_S3_ACL -- Provider: !Storj,Synology,Cloudflare -- Type: string -- Required: false -- Examples: - - "default" - - Owner gets Full_CONTROL. - - No one else has access rights (default). - - "private" - - Owner gets FULL_CONTROL. - - No one else has access rights (default). - - "public-read" - - Owner gets FULL_CONTROL. - - The AllUsers group gets READ access. - - "public-read-write" - - Owner gets FULL_CONTROL. - - The AllUsers group gets READ and WRITE access. - - Granting this on a bucket is generally not recommended. - - "authenticated-read" - - Owner gets FULL_CONTROL. - - The AuthenticatedUsers group gets READ access. - - "bucket-owner-read" - - Object owner gets FULL_CONTROL. - - Bucket owner gets READ access. - - If you specify this canned ACL when creating a bucket, - Amazon S3 ignores it. - - "bucket-owner-full-control" - - Both the object owner and the bucket owner get FULL_CONTROL - over the object. - - If you specify this canned ACL when creating a bucket, - Amazon S3 ignores it. - - "private" - - Owner gets FULL_CONTROL. - - No one else has access rights (default). - - This acl is available on IBM Cloud (Infra), IBM Cloud - (Storage), On-Premise COS. - - "public-read" - - Owner gets FULL_CONTROL. - - The AllUsers group gets READ access. - - This acl is available on IBM Cloud (Infra), IBM Cloud - (Storage), On-Premise IBM COS. - - "public-read-write" - - Owner gets FULL_CONTROL. - - The AllUsers group gets READ and WRITE access. - - This acl is available on IBM Cloud (Infra), On-Premise IBM - COS. - - "authenticated-read" - - Owner gets FULL_CONTROL. - - The AuthenticatedUsers group gets READ access. - - Not supported on Buckets. - - This acl is available on IBM Cloud (Infra) and On-Premise - IBM COS. + Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). + Only applies if access_key_id and secret_access_key is blank. + Enter a boolean value (true or false). Press Enter for the default ("false"). + 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. + Enter a string value. Press Enter for the default (""). + access_key_id> AKIDxxxxxxxxxx + AWS Secret Access Key (password) + Leave blank for anonymous access or runtime credentials. + Enter a string value. Press Enter for the default (""). + secret_access_key> xxxxxxxxxxx ---s3-server-side-encryption +6. Select endpoint for Qiniu Kodo. This is the standard endpoint for + different region. -The server-side encryption algorithm used when storing this object in -S3. + / The default endpoint - a good choice if you are unsure. + 1 | East China Region 1. + | Needs location constraint cn-east-1. + \ (cn-east-1) + / East China Region 2. + 2 | Needs location constraint cn-east-2. + \ (cn-east-2) + / North China Region 1. + 3 | Needs location constraint cn-north-1. + \ (cn-north-1) + / South China Region 1. + 4 | Needs location constraint cn-south-1. + \ (cn-south-1) + / North America Region. + 5 | Needs location constraint us-north-1. + \ (us-north-1) + / Southeast Asia Region 1. + 6 | Needs location constraint ap-southeast-1. + \ (ap-southeast-1) + / Northeast Asia Region 1. + 7 | Needs location constraint ap-northeast-1. + \ (ap-northeast-1) + [snip] + endpoint> 1 -Properties: + Option endpoint. + Endpoint for Qiniu Object Storage. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + 1 / East China Endpoint 1 + \ (s3-cn-east-1.qiniucs.com) + 2 / East China Endpoint 2 + \ (s3-cn-east-2.qiniucs.com) + 3 / North China Endpoint 1 + \ (s3-cn-north-1.qiniucs.com) + 4 / South China Endpoint 1 + \ (s3-cn-south-1.qiniucs.com) + 5 / North America Endpoint 1 + \ (s3-us-north-1.qiniucs.com) + 6 / Southeast Asia Endpoint 1 + \ (s3-ap-southeast-1.qiniucs.com) + 7 / Northeast Asia Endpoint 1 + \ (s3-ap-northeast-1.qiniucs.com) + endpoint> 1 -- Config: server_side_encryption -- Env Var: RCLONE_S3_SERVER_SIDE_ENCRYPTION -- Provider: AWS,Ceph,ChinaMobile,Minio -- Type: string -- Required: false -- Examples: - - "" - - None - - "AES256" - - AES256 - - "aws:kms" - - aws:kms + Option location_constraint. + 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. + Press Enter to leave empty. + 1 / East China Region 1 + \ (cn-east-1) + 2 / East China Region 2 + \ (cn-east-2) + 3 / North China Region 1 + \ (cn-north-1) + 4 / South China Region 1 + \ (cn-south-1) + 5 / North America Region 1 + \ (us-north-1) + 6 / Southeast Asia Region 1 + \ (ap-southeast-1) + 7 / Northeast Asia Region 1 + \ (ap-northeast-1) + location_constraint> 1 ---s3-sse-kms-key-id +7. Choose acl and storage class. -If using KMS ID you must provide the ARN of Key. + Note that this ACL is applied when server-side copying objects as S3 + doesn't copy the ACL from the source but rather writes a fresh one. + Enter a string value. Press Enter for the default (""). + Choose a number from below, or type in your own value + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + / Owner gets FULL_CONTROL. + 2 | The AllUsers group gets READ access. + \ (public-read) + [snip] + acl> 2 + The storage class to use when storing new objects in Tencent COS. + Enter a string value. Press Enter for the default (""). + Choose a number from below, or type in your own value + 1 / Standard storage class + \ (STANDARD) + 2 / Infrequent access storage mode + \ (LINE) + 3 / Archive storage mode + \ (GLACIER) + 4 / Deep archive storage mode + \ (DEEP_ARCHIVE) + [snip] + storage_class> 1 + Edit advanced config? (y/n) + y) Yes + n) No (default) + y/n> n + Remote config + -------------------- + [qiniu] + - type: s3 + - provider: Qiniu + - access_key_id: xxx + - secret_access_key: xxx + - region: cn-east-1 + - endpoint: s3-cn-east-1.qiniucs.com + - location_constraint: cn-east-1 + - acl: public-read + - storage_class: STANDARD + -------------------- + y) Yes this is OK (default) + e) Edit this remote + d) Delete this remote + y/e/d> y + Current remotes: -Properties: + Name Type + ==== ==== + qiniu s3 -- Config: sse_kms_key_id -- Env Var: RCLONE_S3_SSE_KMS_KEY_ID -- Provider: AWS,Ceph,Minio -- Type: string -- Required: false -- Examples: - - "" - - None - - "arn:aws:kms:us-east-1:*" - - arn:aws:kms:* +RackCorp ---s3-storage-class +RackCorp Object Storage is an S3 compatible object storage platform from +your friendly cloud provider RackCorp. The service is fast, reliable, +well priced and located in many strategic locations unserviced by +others, to ensure you can maintain data sovereignty. -The storage class to use when storing new objects in S3. +Before you can use RackCorp Object Storage, you'll need to "sign up" for +an account on our "portal". Next you can create an access key, a +secret key and buckets, in your location of choice with ease. These +details are required for the next steps of configuration, when +rclone config asks for your access_key_id and secret_access_key. -Properties: +Your config should end up looking a bit like this: -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: AWS -- Type: string -- Required: false -- Examples: - - "" - - Default - - "STANDARD" - - Standard storage class - - "REDUCED_REDUNDANCY" - - Reduced redundancy storage class - - "STANDARD_IA" - - Standard Infrequent Access storage class - - "ONEZONE_IA" - - One Zone Infrequent Access storage class - - "GLACIER" - - Glacier storage class - - "DEEP_ARCHIVE" - - Glacier Deep Archive storage class - - "INTELLIGENT_TIERING" - - Intelligent-Tiering storage class - - "GLACIER_IR" - - Glacier Instant Retrieval storage class + [RCS3-demo-config] + type = s3 + provider = RackCorp + env_auth = true + access_key_id = YOURACCESSKEY + secret_access_key = YOURSECRETACCESSKEY + region = au-nsw + endpoint = s3.rackcorp.com + location_constraint = au-nsw ---s3-storage-class +Rclone Serve S3 -The storage class to use when storing new objects in OSS. +Rclone can serve any remote over the S3 protocol. For details see the +rclone serve s3 documentation. -Properties: +For example, to serve remote:path over s3, run the server like this: -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: Alibaba -- Type: string -- Required: false -- Examples: - - "" - - Default - - "STANDARD" - - Standard storage class - - "GLACIER" - - Archive storage mode - - "STANDARD_IA" - - Infrequent access storage mode + rclone serve s3 --auth-key ACCESS_KEY_ID,SECRET_ACCESS_KEY remote:path ---s3-storage-class +This will be compatible with an rclone remote which is defined like +this: -The storage class to use when storing new objects in ChinaMobile. + [serves3] + type = s3 + provider = Rclone + endpoint = http://127.0.0.1:8080/ + access_key_id = ACCESS_KEY_ID + secret_access_key = SECRET_ACCESS_KEY + use_multipart_uploads = false -Properties: +Note that setting disable_multipart_uploads = true is to work around a +bug which will be fixed in due course. -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: ChinaMobile -- Type: string -- Required: false -- Examples: - - "" - - Default - - "STANDARD" - - Standard storage class - - "GLACIER" - - Archive storage mode - - "STANDARD_IA" - - Infrequent access storage mode +Scaleway ---s3-storage-class +Scaleway The Object Storage platform allows you to store anything from +backups, logs and web assets to documents and photos. Files can be +dropped from the Scaleway console or transferred through our API and CLI +or using any S3-compatible tool. -The storage class to use when storing new objects in Liara +Scaleway provides an S3 interface which can be configured for use with +rclone like this: -Properties: + [scaleway] + type = s3 + provider = Scaleway + env_auth = false + endpoint = s3.nl-ams.scw.cloud + access_key_id = SCWXXXXXXXXXXXXXX + secret_access_key = 1111111-2222-3333-44444-55555555555555 + region = nl-ams + location_constraint = + acl = private + server_side_encryption = + storage_class = -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: Liara -- Type: string -- Required: false -- Examples: - - "STANDARD" - - Standard storage class +C14 Cold Storage is the low-cost S3 Glacier alternative from Scaleway +and it works the same way as on S3 by accepting the "GLACIER" +storage_class. So you can configure your remote with the +storage_class = GLACIER option to upload directly to C14. Don't forget +that in this state you can't read files back after, you will need to +restore them to "STANDARD" storage_class first before being able to read +them (see "restore" section above) ---s3-storage-class +Seagate Lyve Cloud -The storage class to use when storing new objects in ArvanCloud. +Seagate Lyve Cloud is an S3 compatible object storage platform from +Seagate intended for enterprise use. -Properties: +Here is a config run through for a remote called remote - you may choose +a different name of course. Note that to create an access key and secret +key you will need to create a service account first. -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: ArvanCloud -- Type: string -- Required: false -- Examples: - - "STANDARD" - - Standard storage class + $ rclone config + No remotes found, make a new one? + n) New remote + s) Set configuration password + q) Quit config + n/s/q> n + name> remote ---s3-storage-class +Choose s3 backend -The storage class to use when storing new objects in Tencent COS. + Type of storage to configure. + Choose a number from below, or type in your own value. + [snip] + XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS + \ (s3) + [snip] + Storage> s3 -Properties: +Choose LyveCloud as S3 provider -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: TencentCOS -- Type: string -- Required: false -- Examples: - - "" - - Default - - "STANDARD" - - Standard storage class - - "ARCHIVE" - - Archive storage mode - - "STANDARD_IA" - - Infrequent access storage mode + Choose your S3 provider. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + [snip] + XX / Seagate Lyve Cloud + \ (LyveCloud) + [snip] + provider> LyveCloud ---s3-storage-class +Take the default (just press enter) to enter access key and secret in +the config file. -The storage class to use when storing new objects in S3. + Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). + Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) + env_auth> -Properties: + AWS Access Key ID. + Leave blank for anonymous access or runtime credentials. + Enter a value. Press Enter to leave empty. + access_key_id> XXX -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: Scaleway -- Type: string -- Required: false -- Examples: - - "" - - Default. - - "STANDARD" - - The Standard class for any upload. - - Suitable for on-demand content like streaming or CDN. - - Available in all regions. - - "GLACIER" - - Archived storage. - - Prices are lower, but it needs to be restored first to be - accessed. - - Available in FR-PAR and NL-AMS regions. - - "ONEZONE_IA" - - One Zone - Infrequent Access. - - A good choice for storing secondary backup copies or easily - re-creatable data. - - Available in the FR-PAR region only. + AWS Secret Access Key (password). + Leave blank for anonymous access or runtime credentials. + Enter a value. Press Enter to leave empty. + secret_access_key> YYY ---s3-storage-class +Leave region blank -The storage class to use when storing new objects in Qiniu. + Region to connect to. + Leave blank if you are using an S3 clone and you don't have a region. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + / Use this if unsure. + 1 | Will use v4 signatures and an empty region. + \ () + / Use this only if v4 signatures don't work. + 2 | E.g. pre Jewel/v10 CEPH. + \ (other-v2-signature) + region> -Properties: +Choose an endpoint from the list -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: Qiniu -- Type: string -- Required: false -- Examples: - - "STANDARD" - - Standard storage class - - "LINE" - - Infrequent access storage mode - - "GLACIER" - - Archive storage mode - - "DEEP_ARCHIVE" - - Deep archive storage mode + Endpoint for S3 API. + Required when using an S3 clone. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + 1 / Seagate Lyve Cloud US East 1 (Virginia) + \ (s3.us-east-1.lyvecloud.seagate.com) + 2 / Seagate Lyve Cloud US West 1 (California) + \ (s3.us-west-1.lyvecloud.seagate.com) + 3 / Seagate Lyve Cloud AP Southeast 1 (Singapore) + \ (s3.ap-southeast-1.lyvecloud.seagate.com) + endpoint> 1 -Advanced options +Leave location constraint blank -Here are the Advanced options specific to s3 (Amazon S3 Compliant -Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, China -Mobile, Cloudflare, GCS, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, -IDrive e2, IONOS Cloud, Leviia, Liara, Lyve Cloud, Minio, Netease, -Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, -Tencent COS, Qiniu and Wasabi). + Location constraint - must be set to match the Region. + Leave blank if not sure. Used when creating buckets only. + Enter a value. Press Enter to leave empty. + location_constraint> ---s3-bucket-acl +Choose default ACL (private). -Canned ACL used when creating buckets. + Canned ACL used when creating buckets and storing or copying objects. + This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. + For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl + Note that this ACL is applied when server-side copying objects as S3 + doesn't copy the ACL from the source but rather writes a fresh one. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + [snip] + acl> -For more info visit -https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +And the config file should end up looking like this: -Note that this ACL is applied when only when creating buckets. If it -isn't set then "acl" is used instead. + [remote] + type = s3 + provider = LyveCloud + access_key_id = XXX + secret_access_key = YYY + endpoint = s3.us-east-1.lyvecloud.seagate.com -If the "acl" and "bucket_acl" are empty strings then no X-Amz-Acl: -header is added and the default (private) will be used. +SeaweedFS -Properties: +SeaweedFS is a distributed storage system for blobs, objects, files, and +data lake, with O(1) disk seek and a scalable file metadata store. It +has an S3 compatible object storage interface. SeaweedFS can also act as +a gateway to remote S3 compatible object store to cache data and +metadata with asynchronous write back, for fast local speed and minimize +access cost. -- Config: bucket_acl -- Env Var: RCLONE_S3_BUCKET_ACL -- Type: string -- Required: false -- Examples: - - "private" - - Owner gets FULL_CONTROL. - - No one else has access rights (default). - - "public-read" - - Owner gets FULL_CONTROL. - - The AllUsers group gets READ access. - - "public-read-write" - - Owner gets FULL_CONTROL. - - The AllUsers group gets READ and WRITE access. - - Granting this on a bucket is generally not recommended. - - "authenticated-read" - - Owner gets FULL_CONTROL. - - The AuthenticatedUsers group gets READ access. +Assuming the SeaweedFS are configured with weed shell as such: ---s3-requester-pays + > s3.bucket.create -name foo + > s3.configure -access_key=any -secret_key=any -buckets=foo -user=me -actions=Read,Write,List,Tagging,Admin -apply + { + "identities": [ + { + "name": "me", + "credentials": [ + { + "accessKey": "any", + "secretKey": "any" + } + ], + "actions": [ + "Read:foo", + "Write:foo", + "List:foo", + "Tagging:foo", + "Admin:foo" + ] + } + ] + } -Enables requester pays option when interacting with S3 bucket. +To use rclone with SeaweedFS, above configuration should end up with +something like this in your config: -Properties: + [seaweedfs_s3] + type = s3 + provider = SeaweedFS + access_key_id = any + secret_access_key = any + endpoint = localhost:8333 -- Config: requester_pays -- Env Var: RCLONE_S3_REQUESTER_PAYS -- Provider: AWS -- Type: bool -- Default: false +So once set up, for example to copy files into a bucket ---s3-sse-customer-algorithm + rclone copy /path/to/files seaweedfs_s3:foo -If using SSE-C, the server-side encryption algorithm used when storing -this object in S3. +Wasabi -Properties: +Wasabi is a cloud-based object storage service for a broad range of +applications and use cases. Wasabi is designed for individuals and +organizations that require a high-performance, reliable, and secure data +storage infrastructure at minimal cost. -- Config: sse_customer_algorithm -- Env Var: RCLONE_S3_SSE_CUSTOMER_ALGORITHM -- Provider: AWS,Ceph,ChinaMobile,Minio -- Type: string -- Required: false -- Examples: - - "" - - None - - "AES256" - - AES256 +Wasabi provides an S3 interface which can be configured for use with +rclone like this. ---s3-sse-customer-key + No remotes found, make a new one? + n) New remote + s) Set configuration password + n/s> n + name> wasabi + Type of storage to configure. + Choose a number from below, or type in your own value + [snip] + XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Minio, Liara) + \ "s3" + [snip] + Storage> s3 + Get AWS credentials from runtime (environment variables or EC2/ECS 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> YOURACCESSKEY + AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. + secret_access_key> YOURSECRETACCESSKEY + 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" + [snip] + region> us-east-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> s3.wasabisys.com + 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. + \ "" + [snip] + location_constraint> + Canned ACL used when creating buckets and/or storing objects in S3. + For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl + Choose a number from below, or type in your own value + 1 / Owner gets FULL_CONTROL. No one else has access rights (default). + \ "private" + [snip] + acl> + The server-side encryption algorithm used when storing this object in S3. + Choose a number from below, or type in your own value + 1 / None + \ "" + 2 / AES256 + \ "AES256" + server_side_encryption> + The storage class to use when storing objects in S3. + Choose a number from below, or type in your own value + 1 / Default + \ "" + 2 / Standard storage class + \ "STANDARD" + 3 / Reduced redundancy storage class + \ "REDUCED_REDUNDANCY" + 4 / Standard Infrequent Access storage class + \ "STANDARD_IA" + storage_class> + Remote config + -------------------- + [wasabi] + env_auth = false + access_key_id = YOURACCESSKEY + secret_access_key = YOURSECRETACCESSKEY + region = us-east-1 + endpoint = s3.wasabisys.com + location_constraint = + acl = + server_side_encryption = + storage_class = + -------------------- + y) Yes this is OK + e) Edit this remote + d) Delete this remote + y/e/d> y -To use SSE-C you may provide the secret encryption key used to -encrypt/decrypt your data. +This will leave the config file looking like this. -Alternatively you can provide --sse-customer-key-base64. + [wasabi] + type = s3 + provider = Wasabi + env_auth = false + access_key_id = YOURACCESSKEY + secret_access_key = YOURSECRETACCESSKEY + region = + endpoint = s3.wasabisys.com + location_constraint = + acl = + server_side_encryption = + storage_class = -Properties: +Alibaba OSS -- Config: sse_customer_key -- Env Var: RCLONE_S3_SSE_CUSTOMER_KEY -- Provider: AWS,Ceph,ChinaMobile,Minio -- Type: string -- Required: false -- Examples: - - "" - - None +Here is an example of making an Alibaba Cloud (Aliyun) OSS +configuration. First run: ---s3-sse-customer-key-base64 + rclone config -If using SSE-C you must provide the secret encryption key encoded in -base64 format to encrypt/decrypt your data. +This will guide you through an interactive setup process. -Alternatively you can provide --sse-customer-key. + No remotes found, make a new one? + n) New remote + s) Set configuration password + q) Quit config + n/s/q> n + name> oss + Type of storage to configure. + Enter a string value. Press Enter for the default (""). + Choose a number from below, or type in your own value + [snip] + 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Minio, and Tencent COS + \ "s3" + [snip] + Storage> s3 + Choose your S3 provider. + Enter a string value. Press Enter for the default (""). + Choose a number from below, or type in your own value + 1 / Amazon Web Services (AWS) S3 + \ "AWS" + 2 / Alibaba Cloud Object Storage System (OSS) formerly Aliyun + \ "Alibaba" + 3 / Ceph Object Storage + \ "Ceph" + [snip] + provider> Alibaba + Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). + Only applies if access_key_id and secret_access_key is blank. + Enter a boolean value (true or false). Press Enter for the default ("false"). + 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. + Enter a string value. Press Enter for the default (""). + access_key_id> accesskeyid + AWS Secret Access Key (password) + Leave blank for anonymous access or runtime credentials. + Enter a string value. Press Enter for the default (""). + secret_access_key> secretaccesskey + Endpoint for OSS API. + Enter a string value. Press Enter for the default (""). + Choose a number from below, or type in your own value + 1 / East China 1 (Hangzhou) + \ "oss-cn-hangzhou.aliyuncs.com" + 2 / East China 2 (Shanghai) + \ "oss-cn-shanghai.aliyuncs.com" + 3 / North China 1 (Qingdao) + \ "oss-cn-qingdao.aliyuncs.com" + [snip] + endpoint> 1 + Canned ACL used when creating buckets and storing or copying objects. -Properties: + Note that this ACL is applied when server-side copying objects as S3 + doesn't copy the ACL from the source but rather writes a fresh one. + Enter a string value. Press Enter for the default (""). + Choose a number from below, or type in your own value + 1 / Owner gets FULL_CONTROL. No one else has access rights (default). + \ "private" + 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access. + \ "public-read" + / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. + [snip] + acl> 1 + The storage class to use when storing new objects in OSS. + Enter a string value. Press Enter for the default (""). + Choose a number from below, or type in your own value + 1 / Default + \ "" + 2 / Standard storage class + \ "STANDARD" + 3 / Archive storage mode. + \ "GLACIER" + 4 / Infrequent access storage mode. + \ "STANDARD_IA" + storage_class> 1 + Edit advanced config? (y/n) + y) Yes + n) No + y/n> n + Remote config + -------------------- + [oss] + type = s3 + provider = Alibaba + env_auth = false + access_key_id = accesskeyid + secret_access_key = secretaccesskey + endpoint = oss-cn-hangzhou.aliyuncs.com + acl = private + storage_class = Standard + -------------------- + y) Yes this is OK + e) Edit this remote + d) Delete this remote + y/e/d> y -- Config: sse_customer_key_base64 -- Env Var: RCLONE_S3_SSE_CUSTOMER_KEY_BASE64 -- Provider: AWS,Ceph,ChinaMobile,Minio -- Type: string -- Required: false -- Examples: - - "" - - None +China Mobile Ecloud Elastic Object Storage (EOS) ---s3-sse-customer-key-md5 +Here is an example of making an China Mobile Ecloud Elastic Object +Storage (EOS) configuration. First run: -If using SSE-C you may provide the secret encryption key MD5 checksum -(optional). + rclone config -If you leave it blank, this is calculated automatically from the -sse_customer_key provided. +This will guide you through an interactive setup process. -Properties: + No remotes found, make a new one? + n) New remote + s) Set configuration password + q) Quit config + n/s/q> n + name> ChinaMobile + Option Storage. + Type of storage to configure. + Choose a number from below, or type in your own value. + ... + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS + \ (s3) + ... + Storage> s3 + Option provider. + Choose your S3 provider. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + ... + 4 / China Mobile Ecloud Elastic Object Storage (EOS) + \ (ChinaMobile) + ... + provider> ChinaMobile + Option env_auth. + Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). + Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) + env_auth> + Option access_key_id. + AWS Access Key ID. + Leave blank for anonymous access or runtime credentials. + Enter a value. Press Enter to leave empty. + access_key_id> accesskeyid + Option secret_access_key. + AWS Secret Access Key (password). + Leave blank for anonymous access or runtime credentials. + Enter a value. Press Enter to leave empty. + secret_access_key> secretaccesskey + Option endpoint. + Endpoint for China Mobile Ecloud Elastic Object Storage (EOS) API. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + / The default endpoint - a good choice if you are unsure. + 1 | East China (Suzhou) + \ (eos-wuxi-1.cmecloud.cn) + 2 / East China (Jinan) + \ (eos-jinan-1.cmecloud.cn) + 3 / East China (Hangzhou) + \ (eos-ningbo-1.cmecloud.cn) + 4 / East China (Shanghai-1) + \ (eos-shanghai-1.cmecloud.cn) + 5 / Central China (Zhengzhou) + \ (eos-zhengzhou-1.cmecloud.cn) + 6 / Central China (Changsha-1) + \ (eos-hunan-1.cmecloud.cn) + 7 / Central China (Changsha-2) + \ (eos-zhuzhou-1.cmecloud.cn) + 8 / South China (Guangzhou-2) + \ (eos-guangzhou-1.cmecloud.cn) + 9 / South China (Guangzhou-3) + \ (eos-dongguan-1.cmecloud.cn) + 10 / North China (Beijing-1) + \ (eos-beijing-1.cmecloud.cn) + 11 / North China (Beijing-2) + \ (eos-beijing-2.cmecloud.cn) + 12 / North China (Beijing-3) + \ (eos-beijing-4.cmecloud.cn) + 13 / North China (Huhehaote) + \ (eos-huhehaote-1.cmecloud.cn) + 14 / Southwest China (Chengdu) + \ (eos-chengdu-1.cmecloud.cn) + 15 / Southwest China (Chongqing) + \ (eos-chongqing-1.cmecloud.cn) + 16 / Southwest China (Guiyang) + \ (eos-guiyang-1.cmecloud.cn) + 17 / Nouthwest China (Xian) + \ (eos-xian-1.cmecloud.cn) + 18 / Yunnan China (Kunming) + \ (eos-yunnan.cmecloud.cn) + 19 / Yunnan China (Kunming-2) + \ (eos-yunnan-2.cmecloud.cn) + 20 / Tianjin China (Tianjin) + \ (eos-tianjin-1.cmecloud.cn) + 21 / Jilin China (Changchun) + \ (eos-jilin-1.cmecloud.cn) + 22 / Hubei China (Xiangyan) + \ (eos-hubei-1.cmecloud.cn) + 23 / Jiangxi China (Nanchang) + \ (eos-jiangxi-1.cmecloud.cn) + 24 / Gansu China (Lanzhou) + \ (eos-gansu-1.cmecloud.cn) + 25 / Shanxi China (Taiyuan) + \ (eos-shanxi-1.cmecloud.cn) + 26 / Liaoning China (Shenyang) + \ (eos-liaoning-1.cmecloud.cn) + 27 / Hebei China (Shijiazhuang) + \ (eos-hebei-1.cmecloud.cn) + 28 / Fujian China (Xiamen) + \ (eos-fujian-1.cmecloud.cn) + 29 / Guangxi China (Nanning) + \ (eos-guangxi-1.cmecloud.cn) + 30 / Anhui China (Huainan) + \ (eos-anhui-1.cmecloud.cn) + endpoint> 1 + Option location_constraint. + Location constraint - must match endpoint. + Used when creating buckets only. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + 1 / East China (Suzhou) + \ (wuxi1) + 2 / East China (Jinan) + \ (jinan1) + 3 / East China (Hangzhou) + \ (ningbo1) + 4 / East China (Shanghai-1) + \ (shanghai1) + 5 / Central China (Zhengzhou) + \ (zhengzhou1) + 6 / Central China (Changsha-1) + \ (hunan1) + 7 / Central China (Changsha-2) + \ (zhuzhou1) + 8 / South China (Guangzhou-2) + \ (guangzhou1) + 9 / South China (Guangzhou-3) + \ (dongguan1) + 10 / North China (Beijing-1) + \ (beijing1) + 11 / North China (Beijing-2) + \ (beijing2) + 12 / North China (Beijing-3) + \ (beijing4) + 13 / North China (Huhehaote) + \ (huhehaote1) + 14 / Southwest China (Chengdu) + \ (chengdu1) + 15 / Southwest China (Chongqing) + \ (chongqing1) + 16 / Southwest China (Guiyang) + \ (guiyang1) + 17 / Nouthwest China (Xian) + \ (xian1) + 18 / Yunnan China (Kunming) + \ (yunnan) + 19 / Yunnan China (Kunming-2) + \ (yunnan2) + 20 / Tianjin China (Tianjin) + \ (tianjin1) + 21 / Jilin China (Changchun) + \ (jilin1) + 22 / Hubei China (Xiangyan) + \ (hubei1) + 23 / Jiangxi China (Nanchang) + \ (jiangxi1) + 24 / Gansu China (Lanzhou) + \ (gansu1) + 25 / Shanxi China (Taiyuan) + \ (shanxi1) + 26 / Liaoning China (Shenyang) + \ (liaoning1) + 27 / Hebei China (Shijiazhuang) + \ (hebei1) + 28 / Fujian China (Xiamen) + \ (fujian1) + 29 / Guangxi China (Nanning) + \ (guangxi1) + 30 / Anhui China (Huainan) + \ (anhui1) + location_constraint> 1 + Option acl. + Canned ACL used when creating buckets and storing or copying objects. + This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. + For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl + Note that this ACL is applied when server-side copying objects as S3 + doesn't copy the ACL from the source but rather writes a fresh one. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + / Owner gets FULL_CONTROL. + 2 | The AllUsers group gets READ access. + \ (public-read) + / Owner gets FULL_CONTROL. + 3 | The AllUsers group gets READ and WRITE access. + | Granting this on a bucket is generally not recommended. + \ (public-read-write) + / Owner gets FULL_CONTROL. + 4 | The AuthenticatedUsers group gets READ access. + \ (authenticated-read) + / Object owner gets FULL_CONTROL. + acl> private + Option server_side_encryption. + The server-side encryption algorithm used when storing this object in S3. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + 1 / None + \ () + 2 / AES256 + \ (AES256) + server_side_encryption> + Option storage_class. + The storage class to use when storing new objects in ChinaMobile. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + 1 / Default + \ () + 2 / Standard storage class + \ (STANDARD) + 3 / Archive storage mode + \ (GLACIER) + 4 / Infrequent access storage mode + \ (STANDARD_IA) + storage_class> + Edit advanced config? + y) Yes + n) No (default) + y/n> n + -------------------- + [ChinaMobile] + type = s3 + provider = ChinaMobile + access_key_id = accesskeyid + secret_access_key = secretaccesskey + endpoint = eos-wuxi-1.cmecloud.cn + location_constraint = wuxi1 + acl = private + -------------------- + y) Yes this is OK (default) + e) Edit this remote + d) Delete this remote + y/e/d> y -- Config: sse_customer_key_md5 -- Env Var: RCLONE_S3_SSE_CUSTOMER_KEY_MD5 -- Provider: AWS,Ceph,ChinaMobile,Minio -- Type: string -- Required: false -- Examples: - - "" - - None +Leviia Cloud Object Storage ---s3-upload-cutoff +Leviia Object Storage, backup and secure your data in a 100% French +cloud, independent of GAFAM.. -Cutoff for switching to chunked upload. +To configure access to Leviia, follow the steps below: -Any files larger than this will be uploaded in chunks of chunk_size. The -minimum is 0 and the maximum is 5 GiB. +1. Run rclone config and select n for a new remote. -Properties: + rclone config + No remotes found, make a new one? + n) New remote + s) Set configuration password + q) Quit config + n/s/q> n -- Config: upload_cutoff -- Env Var: RCLONE_S3_UPLOAD_CUTOFF -- Type: SizeSuffix -- Default: 200Mi +2. Give the name of the configuration. For example, name it 'leviia'. ---s3-chunk-size + name> leviia -Chunk size to use for uploading. +3. Select s3 storage. -When uploading files larger than upload_cutoff or files with unknown -size (e.g. from "rclone rcat" or uploaded with "rclone mount" or google -photos or google docs) they will be uploaded as multipart uploads using -this chunk size. + Choose a number from below, or type in your own value + 1 / 1Fichier + \ (fichier) + 2 / Akamai NetStorage + \ (netstorage) + 3 / Alias for an existing remote + \ (alias) + 4 / Amazon Drive + \ (amazon cloud drive) + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi + \ (s3) + [snip] + Storage> s3 -Note that "--s3-upload-concurrency" chunks of this size are buffered in -memory per transfer. +4. Select Leviia provider. -If you are transferring large files over high-speed links and you have -enough memory, then increasing this will speed up the transfers. + Choose a number from below, or type in your own value + 1 / Amazon Web Services (AWS) S3 + \ "AWS" + [snip] + 15 / Leviia Object Storage + \ (Leviia) + [snip] + provider> Leviia -Rclone will automatically increase the chunk size when uploading a large -file of known size to stay below the 10,000 chunks limit. +5. Enter your SecretId and SecretKey of Leviia. -Files of unknown size are uploaded with the configured chunk_size. Since -the default chunk size is 5 MiB and there can be at most 10,000 chunks, -this means that by default the maximum size of a file you can stream -upload is 48 GiB. If you wish to stream upload larger files then you -will need to increase chunk_size. + Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). + Only applies if access_key_id and secret_access_key is blank. + Enter a boolean value (true or false). Press Enter for the default ("false"). + 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. + Enter a string value. Press Enter for the default (""). + access_key_id> ZnIx.xxxxxxxxxxxxxxx + AWS Secret Access Key (password) + Leave blank for anonymous access or runtime credentials. + Enter a string value. Press Enter for the default (""). + secret_access_key> xxxxxxxxxxx -Increasing the chunk size decreases the accuracy of the progress -statistics displayed with "-P" flag. Rclone treats chunk as sent when -it's buffered by the AWS SDK, when in fact it may still be uploading. A -bigger chunk size means a bigger AWS SDK buffer and progress reporting -more deviating from the truth. +6. Select endpoint for Leviia. -Properties: + / The default endpoint + 1 | Leviia. + \ (s3.leviia.com) + [snip] + endpoint> 1 -- Config: chunk_size -- Env Var: RCLONE_S3_CHUNK_SIZE -- Type: SizeSuffix -- Default: 5Mi +7. Choose acl. ---s3-max-upload-parts + Note that this ACL is applied when server-side copying objects as S3 + doesn't copy the ACL from the source but rather writes a fresh one. + Enter a string value. Press Enter for the default (""). + Choose a number from below, or type in your own value + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + / Owner gets FULL_CONTROL. + 2 | The AllUsers group gets READ access. + \ (public-read) + [snip] + acl> 1 + Edit advanced config? (y/n) + y) Yes + n) No (default) + y/n> n + Remote config + -------------------- + [leviia] + - type: s3 + - provider: Leviia + - access_key_id: ZnIx.xxxxxxx + - secret_access_key: xxxxxxxx + - endpoint: s3.leviia.com + - acl: private + -------------------- + y) Yes this is OK (default) + e) Edit this remote + d) Delete this remote + y/e/d> y + Current remotes: -Maximum number of parts in a multipart upload. + Name Type + ==== ==== + leviia s3 -This option defines the maximum number of multipart chunks to use when -doing a multipart upload. +Liara -This can be useful if a service does not support the AWS S3 -specification of 10,000 chunks. +Here is an example of making a Liara Object Storage configuration. First +run: -Rclone will automatically increase the chunk size when uploading a large -file of a known size to stay below this number of chunks limit. + rclone config -Properties: +This will guide you through an interactive setup process. -- Config: max_upload_parts -- Env Var: RCLONE_S3_MAX_UPLOAD_PARTS -- Type: int -- Default: 10000 + No remotes found, make a new one? + n) New remote + s) Set configuration password + n/s> n + name> Liara + Type of storage to configure. + Choose a number from below, or type in your own value + [snip] + XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Liara, Minio) + \ "s3" + [snip] + Storage> s3 + Get AWS credentials from runtime (environment variables or EC2/ECS 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> YOURACCESSKEY + AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. + secret_access_key> YOURSECRETACCESSKEY + Region to connect to. + Choose a number from below, or type in your own value + / The default endpoint + 1 | US Region, Northern Virginia, or Pacific Northwest. + | Leave location constraint empty. + \ "us-east-1" + [snip] + region> + Endpoint for S3 API. + Leave blank if using Liara to use the default endpoint for the region. + Specify if using an S3 clone such as Ceph. + endpoint> storage.iran.liara.space + Canned ACL used when creating buckets and/or storing objects in S3. + For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl + Choose a number from below, or type in your own value + 1 / Owner gets FULL_CONTROL. No one else has access rights (default). + \ "private" + [snip] + acl> + The server-side encryption algorithm used when storing this object in S3. + Choose a number from below, or type in your own value + 1 / None + \ "" + 2 / AES256 + \ "AES256" + server_side_encryption> + The storage class to use when storing objects in S3. + Choose a number from below, or type in your own value + 1 / Default + \ "" + 2 / Standard storage class + \ "STANDARD" + storage_class> + Remote config + -------------------- + [Liara] + env_auth = false + access_key_id = YOURACCESSKEY + secret_access_key = YOURSECRETACCESSKEY + endpoint = storage.iran.liara.space + location_constraint = + acl = + server_side_encryption = + storage_class = + -------------------- + y) Yes this is OK + e) Edit this remote + d) Delete this remote + y/e/d> y ---s3-copy-cutoff +This will leave the config file looking like this. -Cutoff for switching to multipart copy. + [Liara] + type = s3 + provider = Liara + env_auth = false + access_key_id = YOURACCESSKEY + secret_access_key = YOURSECRETACCESSKEY + region = + endpoint = storage.iran.liara.space + location_constraint = + acl = + server_side_encryption = + storage_class = -Any files larger than this that need to be server-side copied will be -copied in chunks of this size. +Linode -The minimum is 0 and the maximum is 5 GiB. +Here is an example of making a Linode Object Storage configuration. +First run: -Properties: + rclone config -- Config: copy_cutoff -- Env Var: RCLONE_S3_COPY_CUTOFF -- Type: SizeSuffix -- Default: 4.656Gi +This will guide you through an interactive setup process. ---s3-disable-checksum + No remotes found, make a new one? + n) New remote + s) Set configuration password + q) Quit config + n/s/q> n -Don't store MD5 checksum with object metadata. + Enter name for new remote. + name> linode -Normally rclone will calculate the MD5 checksum of the input before -uploading it so it can add it to metadata on the object. This is great -for data integrity checking but can cause long delays for large files to -start uploading. + Option Storage. + Type of storage to configure. + Choose a number from below, or type in your own value. + [snip] + X / Amazon S3 Compliant Storage Providers including AWS, ...Linode, ...and others + \ (s3) + [snip] + Storage> s3 -Properties: + Option provider. + Choose your S3 provider. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + [snip] + XX / Linode Object Storage + \ (Linode) + [snip] + provider> Linode -- Config: disable_checksum -- Env Var: RCLONE_S3_DISABLE_CHECKSUM -- Type: bool -- Default: false + Option env_auth. + Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). + Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) + env_auth> ---s3-shared-credentials-file + Option access_key_id. + AWS Access Key ID. + Leave blank for anonymous access or runtime credentials. + Enter a value. Press Enter to leave empty. + access_key_id> ACCESS_KEY -Path to the shared credentials file. + Option secret_access_key. + AWS Secret Access Key (password). + Leave blank for anonymous access or runtime credentials. + Enter a value. Press Enter to leave empty. + secret_access_key> SECRET_ACCESS_KEY -If env_auth = true then rclone can use a shared credentials file. + Option endpoint. + Endpoint for Linode Object Storage API. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + 1 / Atlanta, GA (USA), us-southeast-1 + \ (us-southeast-1.linodeobjects.com) + 2 / Chicago, IL (USA), us-ord-1 + \ (us-ord-1.linodeobjects.com) + 3 / Frankfurt (Germany), eu-central-1 + \ (eu-central-1.linodeobjects.com) + 4 / Milan (Italy), it-mil-1 + \ (it-mil-1.linodeobjects.com) + 5 / Newark, NJ (USA), us-east-1 + \ (us-east-1.linodeobjects.com) + 6 / Paris (France), fr-par-1 + \ (fr-par-1.linodeobjects.com) + 7 / Seattle, WA (USA), us-sea-1 + \ (us-sea-1.linodeobjects.com) + 8 / Singapore ap-south-1 + \ (ap-south-1.linodeobjects.com) + 9 / Stockholm (Sweden), se-sto-1 + \ (se-sto-1.linodeobjects.com) + 10 / Washington, DC, (USA), us-iad-1 + \ (us-iad-1.linodeobjects.com) + endpoint> 3 -If this variable is empty rclone will look for the -"AWS_SHARED_CREDENTIALS_FILE" env variable. If the env value is empty it -will default to the current user's home directory. + Option acl. + Canned ACL used when creating buckets and storing or copying objects. + This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. + For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl + Note that this ACL is applied when server-side copying objects as S3 + doesn't copy the ACL from the source but rather writes a fresh one. + If the acl is an empty string then no X-Amz-Acl: header is added and + the default (private) will be used. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + [snip] + acl> - Linux/OSX: "$HOME/.aws/credentials" - Windows: "%USERPROFILE%\.aws\credentials" + Edit advanced config? + y) Yes + n) No (default) + y/n> n -Properties: + Configuration complete. + Options: + - type: s3 + - provider: Linode + - access_key_id: ACCESS_KEY + - secret_access_key: SECRET_ACCESS_KEY + - endpoint: eu-central-1.linodeobjects.com + Keep this "linode" remote? + y) Yes this is OK (default) + e) Edit this remote + d) Delete this remote + y/e/d> y -- Config: shared_credentials_file -- Env Var: RCLONE_S3_SHARED_CREDENTIALS_FILE -- Type: string -- Required: false +This will leave the config file looking like this. ---s3-profile + [linode] + type = s3 + provider = Linode + access_key_id = ACCESS_KEY + secret_access_key = SECRET_ACCESS_KEY + endpoint = eu-central-1.linodeobjects.com -Profile to use in the shared credentials file. +ArvanCloud -If env_auth = true then rclone can use a shared credentials file. This -variable controls which profile is used in that file. +ArvanCloud ArvanCloud Object Storage goes beyond the limited traditional +file storage. It gives you access to backup and archived files and +allows sharing. Files like profile image in the app, images sent by +users or scanned documents can be stored securely and easily in our +Object Storage service. -If empty it will default to the environment variable "AWS_PROFILE" or -"default" if that environment variable is also not set. +ArvanCloud provides an S3 interface which can be configured for use with +rclone like this. -Properties: + No remotes found, make a new one? + n) New remote + s) Set configuration password + n/s> n + name> ArvanCloud + Type of storage to configure. + Choose a number from below, or type in your own value + [snip] + XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Liara, Minio) + \ "s3" + [snip] + Storage> s3 + Get AWS credentials from runtime (environment variables or EC2/ECS 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> YOURACCESSKEY + AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. + secret_access_key> YOURSECRETACCESSKEY + 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" + [snip] + region> + Endpoint for S3 API. + Leave blank if using ArvanCloud to use the default endpoint for the region. + Specify if using an S3 clone such as Ceph. + endpoint> s3.arvanstorage.com + 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 Iran-Tehran Region. + \ "" + [snip] + location_constraint> + Canned ACL used when creating buckets and/or storing objects in S3. + For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl + Choose a number from below, or type in your own value + 1 / Owner gets FULL_CONTROL. No one else has access rights (default). + \ "private" + [snip] + acl> + The server-side encryption algorithm used when storing this object in S3. + Choose a number from below, or type in your own value + 1 / None + \ "" + 2 / AES256 + \ "AES256" + server_side_encryption> + The storage class to use when storing objects in S3. + Choose a number from below, or type in your own value + 1 / Default + \ "" + 2 / Standard storage class + \ "STANDARD" + storage_class> + Remote config + -------------------- + [ArvanCloud] + env_auth = false + access_key_id = YOURACCESSKEY + secret_access_key = YOURSECRETACCESSKEY + region = ir-thr-at1 + endpoint = s3.arvanstorage.com + location_constraint = + acl = + server_side_encryption = + storage_class = + -------------------- + y) Yes this is OK + e) Edit this remote + d) Delete this remote + y/e/d> y -- Config: profile -- Env Var: RCLONE_S3_PROFILE -- Type: string -- Required: false +This will leave the config file looking like this. ---s3-session-token + [ArvanCloud] + type = s3 + provider = ArvanCloud + env_auth = false + access_key_id = YOURACCESSKEY + secret_access_key = YOURSECRETACCESSKEY + region = + endpoint = s3.arvanstorage.com + location_constraint = + acl = + server_side_encryption = + storage_class = -An AWS session token. +Tencent COS -Properties: +Tencent Cloud Object Storage (COS) is a distributed storage service +offered by Tencent Cloud for unstructured data. It is secure, stable, +massive, convenient, low-delay and low-cost. -- Config: session_token -- Env Var: RCLONE_S3_SESSION_TOKEN -- Type: string -- Required: false +To configure access to Tencent COS, follow the steps below: ---s3-upload-concurrency +1. Run rclone config and select n for a new remote. -Concurrency for multipart uploads. + rclone config + No remotes found, make a new one? + n) New remote + s) Set configuration password + q) Quit config + n/s/q> n -This is the number of chunks of the same file that are uploaded -concurrently. +2. Give the name of the configuration. For example, name it 'cos'. -If you are uploading small numbers of large files over high-speed links -and these uploads do not fully utilize your bandwidth, then increasing -this may help to speed up the transfers. + name> cos -Properties: +3. Select s3 storage. -- Config: upload_concurrency -- Env Var: RCLONE_S3_UPLOAD_CONCURRENCY -- Type: int -- Default: 4 + Choose a number from below, or type in your own value + 1 / 1Fichier + \ "fichier" + 2 / Alias for an existing remote + \ "alias" + 3 / Amazon Drive + \ "amazon cloud drive" + 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Minio, and Tencent COS + \ "s3" + [snip] + Storage> s3 ---s3-force-path-style +4. Select TencentCOS provider. -If true use path style access if false use virtual hosted style. + Choose a number from below, or type in your own value + 1 / Amazon Web Services (AWS) S3 + \ "AWS" + [snip] + 11 / Tencent Cloud Object Storage (COS) + \ "TencentCOS" + [snip] + provider> TencentCOS -If this is true (the default) then rclone will use path style access, if -false then rclone will use virtual path style. See the AWS S3 docs for -more info. +5. Enter your SecretId and SecretKey of Tencent Cloud. -Some providers (e.g. AWS, Aliyun OSS, Netease COS, or Tencent COS) -require this set to false - rclone will do this automatically based on -the provider setting. + Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). + Only applies if access_key_id and secret_access_key is blank. + Enter a boolean value (true or false). Press Enter for the default ("false"). + 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. + Enter a string value. Press Enter for the default (""). + access_key_id> AKIDxxxxxxxxxx + AWS Secret Access Key (password) + Leave blank for anonymous access or runtime credentials. + Enter a string value. Press Enter for the default (""). + secret_access_key> xxxxxxxxxxx -Properties: +6. Select endpoint for Tencent COS. This is the standard endpoint for + different region. -- Config: force_path_style -- Env Var: RCLONE_S3_FORCE_PATH_STYLE -- Type: bool -- Default: true + 1 / Beijing Region. + \ "cos.ap-beijing.myqcloud.com" + 2 / Nanjing Region. + \ "cos.ap-nanjing.myqcloud.com" + 3 / Shanghai Region. + \ "cos.ap-shanghai.myqcloud.com" + 4 / Guangzhou Region. + \ "cos.ap-guangzhou.myqcloud.com" + [snip] + endpoint> 4 ---s3-v2-auth +7. Choose acl and storage class. -If true use v2 authentication. + Note that this ACL is applied when server-side copying objects as S3 + doesn't copy the ACL from the source but rather writes a fresh one. + Enter a string value. Press Enter for the default (""). + Choose a number from below, or type in your own value + 1 / Owner gets Full_CONTROL. No one else has access rights (default). + \ "default" + [snip] + acl> 1 + The storage class to use when storing new objects in Tencent COS. + Enter a string value. Press Enter for the default (""). + Choose a number from below, or type in your own value + 1 / Default + \ "" + [snip] + storage_class> 1 + Edit advanced config? (y/n) + y) Yes + n) No (default) + y/n> n + Remote config + -------------------- + [cos] + type = s3 + provider = TencentCOS + env_auth = false + access_key_id = xxx + secret_access_key = xxx + endpoint = cos.ap-guangzhou.myqcloud.com + acl = default + -------------------- + y) Yes this is OK (default) + e) Edit this remote + d) Delete this remote + y/e/d> y + Current remotes: -If this is false (the default) then rclone will use v4 authentication. -If it is set then rclone will use v2 authentication. + Name Type + ==== ==== + cos s3 -Use this only if v4 signatures don't work, e.g. pre Jewel/v10 CEPH. +Netease NOS -Properties: +For Netease NOS configure as per the configurator rclone config setting +the provider Netease. This will automatically set +force_path_style = false which is necessary for it to run properly. -- Config: v2_auth -- Env Var: RCLONE_S3_V2_AUTH -- Type: bool -- Default: false +Petabox ---s3-use-accelerate-endpoint +Here is an example of making a Petabox configuration. First run: -If true use the AWS S3 accelerated endpoint. + rclone config -See: AWS S3 Transfer acceleration +This will guide you through an interactive setup process. -Properties: + No remotes found, make a new one? + n) New remote + s) Set configuration password + n/s> n -- Config: use_accelerate_endpoint -- Env Var: RCLONE_S3_USE_ACCELERATE_ENDPOINT -- Provider: AWS -- Type: bool -- Default: false + Enter name for new remote. + name> My Petabox Storage ---s3-leave-parts-on-error + Option Storage. + Type of storage to configure. + Choose a number from below, or type in your own value. + [snip] + XX / Amazon S3 Compliant Storage Providers including AWS, ... + \ "s3" + [snip] + Storage> s3 -If true avoid calling abort upload on a failure, leaving all -successfully uploaded parts on S3 for manual recovery. + Option provider. + Choose your S3 provider. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + [snip] + XX / Petabox Object Storage + \ (Petabox) + [snip] + provider> Petabox -It should be set to true for resuming uploads across different sessions. + Option env_auth. + Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). + Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) + env_auth> 1 -WARNING: Storing parts of an incomplete multipart upload counts towards -space usage on S3 and will add additional costs if not cleaned up. + Option access_key_id. + AWS Access Key ID. + Leave blank for anonymous access or runtime credentials. + Enter a value. Press Enter to leave empty. + access_key_id> YOUR_ACCESS_KEY_ID -Properties: + Option secret_access_key. + AWS Secret Access Key (password). + Leave blank for anonymous access or runtime credentials. + Enter a value. Press Enter to leave empty. + secret_access_key> YOUR_SECRET_ACCESS_KEY -- Config: leave_parts_on_error -- Env Var: RCLONE_S3_LEAVE_PARTS_ON_ERROR -- Provider: AWS -- Type: bool -- Default: false + Option region. + Region where your bucket will be created and your data stored. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + 1 / US East (N. Virginia) + \ (us-east-1) + 2 / Europe (Frankfurt) + \ (eu-central-1) + 3 / Asia Pacific (Singapore) + \ (ap-southeast-1) + 4 / Middle East (Bahrain) + \ (me-south-1) + 5 / South America (São Paulo) + \ (sa-east-1) + region> 1 ---s3-list-chunk + Option endpoint. + Endpoint for Petabox S3 Object Storage. + Specify the endpoint from the same region. + Choose a number from below, or type in your own value. + 1 / US East (N. Virginia) + \ (s3.petabox.io) + 2 / US East (N. Virginia) + \ (s3.us-east-1.petabox.io) + 3 / Europe (Frankfurt) + \ (s3.eu-central-1.petabox.io) + 4 / Asia Pacific (Singapore) + \ (s3.ap-southeast-1.petabox.io) + 5 / Middle East (Bahrain) + \ (s3.me-south-1.petabox.io) + 6 / South America (São Paulo) + \ (s3.sa-east-1.petabox.io) + endpoint> 1 -Size of listing chunk (response list for each ListObject S3 request). + Option acl. + Canned ACL used when creating buckets and storing or copying objects. + This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. + For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl + Note that this ACL is applied when server-side copying objects as S3 + doesn't copy the ACL from the source but rather writes a fresh one. + If the acl is an empty string then no X-Amz-Acl: header is added and + the default (private) will be used. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \ (private) + / Owner gets FULL_CONTROL. + 2 | The AllUsers group gets READ access. + \ (public-read) + / Owner gets FULL_CONTROL. + 3 | The AllUsers group gets READ and WRITE access. + | Granting this on a bucket is generally not recommended. + \ (public-read-write) + / Owner gets FULL_CONTROL. + 4 | The AuthenticatedUsers group gets READ access. + \ (authenticated-read) + / Object owner gets FULL_CONTROL. + 5 | Bucket owner gets READ access. + | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \ (bucket-owner-read) + / Both the object owner and the bucket owner get FULL_CONTROL over the object. + 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \ (bucket-owner-full-control) + acl> 1 -This option is also known as "MaxKeys", "max-items", or "page-size" from -the AWS S3 specification. Most services truncate the response list to -1000 objects even if requested more than that. In AWS S3 this is a -global maximum and cannot be changed, see AWS S3. In Ceph, this can be -increased with the "rgw list buckets max chunk" option. + Edit advanced config? + y) Yes + n) No (default) + y/n> No -Properties: + Configuration complete. + Options: + - type: s3 + - provider: Petabox + - access_key_id: YOUR_ACCESS_KEY_ID + - secret_access_key: YOUR_SECRET_ACCESS_KEY + - region: us-east-1 + - endpoint: s3.petabox.io + Keep this "My Petabox Storage" remote? + y) Yes this is OK (default) + e) Edit this remote + d) Delete this remote + y/e/d> y -- Config: list_chunk -- Env Var: RCLONE_S3_LIST_CHUNK -- Type: int -- Default: 1000 +This will leave the config file looking like this. ---s3-list-version + [My Petabox Storage] + type = s3 + provider = Petabox + access_key_id = YOUR_ACCESS_KEY_ID + secret_access_key = YOUR_SECRET_ACCESS_KEY + region = us-east-1 + endpoint = s3.petabox.io -Version of ListObjects to use: 1,2 or 0 for auto. +Storj -When S3 originally launched it only provided the ListObjects call to -enumerate objects in a bucket. +Storj is a decentralized cloud storage which can be used through its +native protocol or an S3 compatible gateway. -However in May 2016 the ListObjectsV2 call was introduced. This is much -higher performance and should be used if at all possible. +The S3 compatible gateway is configured using rclone config with a type +of s3 and with a provider name of Storj. Here is an example run of the +configurator. -If set to the default, 0, rclone will guess according to the provider -set which list objects method to call. If it guesses wrong, then it may -be set manually here. + Type of storage to configure. + Storage> s3 + Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). + Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \ (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \ (true) + env_auth> 1 + Option access_key_id. + AWS Access Key ID. + Leave blank for anonymous access or runtime credentials. + Enter a value. Press Enter to leave empty. + access_key_id> XXXX (as shown when creating the access grant) + Option secret_access_key. + AWS Secret Access Key (password). + Leave blank for anonymous access or runtime credentials. + Enter a value. Press Enter to leave empty. + secret_access_key> XXXX (as shown when creating the access grant) + Option endpoint. + Endpoint of the Shared Gateway. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + 1 / EU1 Shared Gateway + \ (gateway.eu1.storjshare.io) + 2 / US1 Shared Gateway + \ (gateway.us1.storjshare.io) + 3 / Asia-Pacific Shared Gateway + \ (gateway.ap1.storjshare.io) + endpoint> 1 (as shown when creating the access grant) + Edit advanced config? + y) Yes + n) No (default) + y/n> n -Properties: +Note that s3 credentials are generated when you create an access grant. -- Config: list_version -- Env Var: RCLONE_S3_LIST_VERSION -- Type: int -- Default: 0 +Backend quirks ---s3-list-url-encode +- --chunk-size is forced to be 64 MiB or greater. This will use more + memory than the default of 5 MiB. +- Server side copy is disabled as it isn't currently supported in the + gateway. +- GetTier and SetTier are not supported. -Whether to url encode listings: true/false/unset +Backend bugs -Some providers support URL encoding listings and where this is available -this is more reliable when using control characters in file names. If -this is set to unset (the default) then rclone will choose according to -the provider setting what to apply, but you can override rclone's choice -here. +Due to issue #39 uploading multipart files via the S3 gateway causes +them to lose their metadata. For rclone's purpose this means that the +modification time is not stored, nor is any MD5SUM (if one is available +from the source). -Properties: +This has the following consequences: -- Config: list_url_encode -- Env Var: RCLONE_S3_LIST_URL_ENCODE -- Type: Tristate -- Default: unset +- Using rclone rcat will fail as the medatada doesn't match after + upload +- Uploading files with rclone mount will fail for the same reason + - This can worked around by using --vfs-cache-mode writes or + --vfs-cache-mode full or setting --s3-upload-cutoff large +- Files uploaded via a multipart upload won't have their modtimes + - This will mean that rclone sync will likely keep trying to + upload files bigger than --s3-upload-cutoff + - This can be worked around with --checksum or --size-only or + setting --s3-upload-cutoff large + - The maximum value for --s3-upload-cutoff is 5GiB though ---s3-no-check-bucket +One general purpose workaround is to set --s3-upload-cutoff 5G. This +means that rclone will upload files smaller than 5GiB as single parts. +Note that this can be set in the config file with upload_cutoff = 5G or +configured in the advanced settings. If you regularly transfer files +larger than 5G then using --checksum or --size-only in rclone sync is +the recommended workaround. -If set, don't attempt to check the bucket exists or create it. +Comparison with the native protocol -This can be useful when trying to minimise the number of transactions -rclone does if you know the bucket exists already. +Use the the native protocol to take advantage of client-side encryption +as well as to achieve the best possible download performance. Uploads +will be erasure-coded locally, thus a 1gb upload will result in 2.68gb +of data being uploaded to storage nodes across the network. -It can also be needed if the user you are using does not have bucket -creation permissions. Before v1.52.0 this would have passed silently due -to a bug. +Use this backend and the S3 compatible Hosted Gateway to increase upload +performance and reduce the load on your systems and network. Uploads +will be encrypted and erasure-coded server-side, thus a 1GB upload will +result in only in 1GB of data being uploaded to storage nodes across the +network. -Properties: +For more detailed comparison please check the documentation of the storj +backend. -- Config: no_check_bucket -- Env Var: RCLONE_S3_NO_CHECK_BUCKET -- Type: bool -- Default: false +Limitations ---s3-no-head +rclone about is not supported by the S3 backend. Backends without this +capability cannot determine free space for an rclone mount or use policy +mfs (most free space) as a member of an rclone union remote. -If set, don't HEAD uploaded objects to check integrity. +See List of backends that do not support rclone about and rclone about -This can be useful when trying to minimise the number of transactions -rclone does. +Synology C2 Object Storage -Setting it means that if rclone receives a 200 OK message after -uploading an object with PUT then it will assume that it got uploaded -properly. +Synology C2 Object Storage provides a secure, S3-compatible, and +cost-effective cloud storage solution without API request, download +fees, and deletion penalty. -In particular it will assume: +The S3 compatible gateway is configured using rclone config with a type +of s3 and with a provider name of Synology. Here is an example run of +the configurator. -- the metadata, including modtime, storage class and content type was - as uploaded -- the size was as uploaded +First run: -It reads the following items from the response for a single part PUT: + rclone config -- the MD5SUM -- The uploaded date +This will guide you through an interactive setup process. -For multipart uploads these items aren't read. + No remotes found, make a new one? + n) New remote + s) Set configuration password + q) Quit config -If an source object of unknown length is uploaded then rclone will do a -HEAD request. + n/s/q> n -Setting this flag increases the chance for undetected upload failures, -in particular an incorrect size, so it isn't recommended for normal -operation. In practice the chance of an undetected upload failure is -very small even with this flag. + Enter name for new remote.1 + name> syno -Properties: + Type of storage to configure. + Enter a string value. Press Enter for the default (""). + Choose a number from below, or type in your own value -- Config: no_head -- Env Var: RCLONE_S3_NO_HEAD -- Type: bool -- Default: false + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, GCS, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi + \ "s3" ---s3-no-head-object + Storage> s3 -If set, do not do HEAD before GET when getting objects. + Choose your S3 provider. + Enter a string value. Press Enter for the default (""). + Choose a number from below, or type in your own value + 24 / Synology C2 Object Storage + \ (Synology) -Properties: + provider> Synology -- Config: no_head_object -- Env Var: RCLONE_S3_NO_HEAD_OBJECT -- Type: bool -- Default: false + Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). + Only applies if access_key_id and secret_access_key is blank. + Enter a boolean value (true or false). Press Enter for the default ("false"). + 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" ---s3-encoding + env_auth> 1 -The encoding for the backend. + AWS Access Key ID. + Leave blank for anonymous access or runtime credentials. + Enter a string value. Press Enter for the default (""). -See the encoding section in the overview for more info. + access_key_id> accesskeyid -Properties: + AWS Secret Access Key (password) + Leave blank for anonymous access or runtime credentials. + Enter a string value. Press Enter for the default (""). -- Config: encoding -- Env Var: RCLONE_S3_ENCODING -- Type: MultiEncoder -- Default: Slash,InvalidUtf8,Dot + secret_access_key> secretaccesskey ---s3-memory-pool-flush-time + Region where your data stored. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + 1 / Europe Region 1 + \ (eu-001) + 2 / Europe Region 2 + \ (eu-002) + 3 / US Region 1 + \ (us-001) + 4 / US Region 2 + \ (us-002) + 5 / Asia (Taiwan) + \ (tw-001) -How often internal memory buffer pools will be flushed. (no longer used) + region > 1 -Properties: + Option endpoint. + Endpoint for Synology C2 Object Storage API. + Choose a number from below, or type in your own value. + Press Enter to leave empty. + 1 / EU Endpoint 1 + \ (eu-001.s3.synologyc2.net) + 2 / US Endpoint 1 + \ (us-001.s3.synologyc2.net) + 3 / TW Endpoint 1 + \ (tw-001.s3.synologyc2.net) -- Config: memory_pool_flush_time -- Env Var: RCLONE_S3_MEMORY_POOL_FLUSH_TIME -- Type: Duration -- Default: 1m0s + endpoint> 1 ---s3-memory-pool-use-mmap + Option location_constraint. + Location constraint - must be set to match the Region. + Leave blank if not sure. Used when creating buckets only. + Enter a value. Press Enter to leave empty. + location_constraint> -Whether to use mmap buffers in internal memory pool. (no longer used) + Edit advanced config? (y/n) + y) Yes + n) No + y/n> y -Properties: + Option no_check_bucket. + If set, don't attempt to check the bucket exists or create it. + This can be useful when trying to minimise the number of transactions + rclone does if you know the bucket exists already. + It can also be needed if the user you are using does not have bucket + creation permissions. Before v1.52.0 this would have passed silently + due to a bug. + Enter a boolean value (true or false). Press Enter for the default (true). -- Config: memory_pool_use_mmap -- Env Var: RCLONE_S3_MEMORY_POOL_USE_MMAP -- Type: bool -- Default: false + no_check_bucket> true ---s3-disable-http2 + Configuration complete. + Options: + - type: s3 + - provider: Synology + - region: eu-001 + - endpoint: eu-001.s3.synologyc2.net + - no_check_bucket: true + Keep this "syno" remote? + y) Yes this is OK (default) + e) Edit this remote + d) Delete this remote -Disable usage of http2 for S3 backends. + y/e/d> y -There is currently an unsolved issue with the s3 (specifically minio) -backend and HTTP/2. HTTP/2 is enabled by default for the s3 backend but -can be disabled here. When the issue is solved this flag will be -removed. + # Backblaze B2 -See: https://github.com/rclone/rclone/issues/4673, -https://github.com/rclone/rclone/issues/3631 + B2 is [Backblaze's cloud storage system](https://www.backblaze.com/b2/). -Properties: + Paths are specified as `remote:bucket` (or `remote:` for the `lsd` + command.) You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`. -- Config: disable_http2 -- Env Var: RCLONE_S3_DISABLE_HTTP2 -- Type: bool -- Default: false + ## Configuration ---s3-download-url + Here is an example of making a b2 configuration. First run -Custom endpoint for downloads. This is usually set to a CloudFront CDN -URL as AWS S3 offers cheaper egress for data downloaded through the -CloudFront network. + rclone config -Properties: + This will guide you through an interactive setup process. To authenticate + you will either need your Account ID (a short hex number) and Master + Application Key (a long hex number) OR an Application Key, which is the + recommended method. See below for further details on generating and using + an Application Key. -- Config: download_url -- Env Var: RCLONE_S3_DOWNLOAD_URL -- Type: string -- Required: false +No remotes found, make a new one? n) New remote q) Quit config n/q> n +name> remote Type of storage to configure. Choose a number from below, +or type in your own value [snip] XX / Backblaze B2  "b2" [snip] Storage> +b2 Account ID or Application Key ID account> 123456789abc Application +Key key> 0123456789abcdef0123456789abcdef0123456789 Endpoint for the +service - leave blank normally. endpoint> Remote config +-------------------- [remote] account = 123456789abc key = +0123456789abcdef0123456789abcdef0123456789 endpoint = +-------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y ---s3-directory-markers -Upload an empty object with a trailing slash when a new directory is -created + This remote is called `remote` and can now be used like this -Empty folders are unsupported for bucket based remotes, this option -creates an empty object ending with "/", to persist the folder. + See all buckets -Properties: + rclone lsd remote: -- Config: directory_markers -- Env Var: RCLONE_S3_DIRECTORY_MARKERS -- Type: bool -- Default: false + Create a new bucket ---s3-use-multipart-etag + rclone mkdir remote:bucket -Whether to use ETag in multipart uploads for verification + List the contents of a bucket -This should be true, false or left unset to use the default for the -provider. + rclone ls remote:bucket -Properties: + Sync `/home/local/directory` to the remote bucket, deleting any + excess files in the bucket. -- Config: use_multipart_etag -- Env Var: RCLONE_S3_USE_MULTIPART_ETAG -- Type: Tristate -- Default: unset + rclone sync --interactive /home/local/directory remote:bucket ---s3-use-presigned-request + ### Application Keys -Whether to use a presigned request or PutObject for single part uploads + B2 supports multiple [Application Keys for different access permission + to B2 Buckets](https://www.backblaze.com/b2/docs/application_keys.html). -If this is false rclone will use PutObject from the AWS SDK to upload an -object. + You can use these with rclone too; you will need to use rclone version 1.43 + or later. -Versions of rclone < 1.59 use presigned requests to upload a single part -object and setting this flag to true will re-enable that functionality. -This shouldn't be necessary except in exceptional circumstances or for -testing. + Follow Backblaze's docs to create an Application Key with the required + permission and add the `applicationKeyId` as the `account` and the + `Application Key` itself as the `key`. -Properties: + Note that you must put the _applicationKeyId_ as the `account` – you + can't use the master Account ID. If you try then B2 will return 401 + errors. -- Config: use_presigned_request -- Env Var: RCLONE_S3_USE_PRESIGNED_REQUEST -- Type: bool -- Default: false + ### --fast-list ---s3-versions + This remote supports `--fast-list` which allows you to use fewer + transactions in exchange for more memory. See the [rclone + docs](https://rclone.org/docs/#fast-list) for more details. -Include old versions in directory listings. + ### Modification times -Properties: + The modification time is stored as metadata on the object as + `X-Bz-Info-src_last_modified_millis` as milliseconds since 1970-01-01 + in the Backblaze standard. Other tools should be able to use this as + a modified time. -- Config: versions -- Env Var: RCLONE_S3_VERSIONS -- Type: bool -- Default: false + Modified times are used in syncing and are fully supported. Note that + if a modification time needs to be updated on an object then it will + create a new version of the object. ---s3-version-at + ### Restricted filename characters -Show file versions as they were at the specified time. + In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) + the following characters are also replaced: -The parameter should be a date, "2006-01-02", datetime "2006-01-02 -15:04:05" or a duration for that long ago, eg "100d" or "1h". + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | \ | 0x5C | \ | -Note that when using this no file write operations are permitted, so you -can't upload files or delete them. + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. -See the time option docs for valid formats. + Note that in 2020-05 Backblaze started allowing \ characters in file + names. Rclone hasn't changed its encoding as this could cause syncs to + re-transfer files. If you want rclone not to replace \ then see the + `--b2-encoding` flag below and remove the `BackSlash` from the + string. This can be set in the config. -Properties: + ### SHA1 checksums -- Config: version_at -- Env Var: RCLONE_S3_VERSION_AT -- Type: Time -- Default: off + The SHA1 checksums of the files are checked on upload and download and + will be used in the syncing process. ---s3-decompress + Large files (bigger than the limit in `--b2-upload-cutoff`) which are + uploaded in chunks will store their SHA1 on the object as + `X-Bz-Info-large_file_sha1` as recommended by Backblaze. -If set this will decompress gzip encoded objects. + For a large file to be uploaded with an SHA1 checksum, the source + needs to support SHA1 checksums. The local disk supports SHA1 + checksums so large file transfers from local disk will have an SHA1. + See [the overview](https://rclone.org/overview/#features) for exactly which remotes + support SHA1. -It is possible to upload objects to S3 with "Content-Encoding: gzip" -set. Normally rclone will download these files as compressed objects. + Sources which don't support SHA1, in particular `crypt` will upload + large files without SHA1 checksums. This may be fixed in the future + (see [#1767](https://github.com/rclone/rclone/issues/1767)). -If this flag is set then rclone will decompress these files with -"Content-Encoding: gzip" as they are received. This means that rclone -can't check the size and hash but the file contents will be -decompressed. + Files sizes below `--b2-upload-cutoff` will always have an SHA1 + regardless of the source. -Properties: + ### Transfers -- Config: decompress -- Env Var: RCLONE_S3_DECOMPRESS -- Type: bool -- Default: false + Backblaze recommends that you do lots of transfers simultaneously for + maximum speed. In tests from my SSD equipped laptop the optimum + setting is about `--transfers 32` though higher numbers may be used + for a slight speed improvement. The optimum number for you may vary + depending on your hardware, how big the files are, how much you want + to load your computer, etc. The default of `--transfers 4` is + definitely too low for Backblaze B2 though. ---s3-might-gzip + Note that uploading big files (bigger than 200 MiB by default) will use + a 96 MiB RAM buffer by default. There can be at most `--transfers` of + these in use at any moment, so this sets the upper limit on the memory + used. -Set this if the backend might gzip objects. + ### Versions -Normally providers will not alter objects when they are downloaded. If -an object was not uploaded with Content-Encoding: gzip then it won't be -set on download. + When rclone uploads a new version of a file it creates a [new version + of it](https://www.backblaze.com/b2/docs/file_versions.html). + Likewise when you delete a file, the old version will be marked hidden + and still be available. Conversely, you may opt in to a "hard delete" + of files with the `--b2-hard-delete` flag which would permanently remove + the file instead of hiding it. -However some providers may gzip objects even if they weren't uploaded -with Content-Encoding: gzip (eg Cloudflare). + Old versions of files, where available, are visible using the + `--b2-versions` flag. -A symptom of this would be receiving errors like + It is also possible to view a bucket as it was at a certain point in time, + using the `--b2-version-at` flag. This will show the file versions as they + were at that time, showing files that have been deleted afterwards, and + hiding files that were created since. - ERROR corrupted on transfer: sizes differ NNN vs MMM + If you wish to remove all the old versions then you can use the + `rclone cleanup remote:bucket` command which will delete all the old + versions of files, leaving the current ones intact. You can also + supply a path and only old versions under that path will be deleted, + e.g. `rclone cleanup remote:bucket/path/to/stuff`. -If you set this flag and rclone downloads an object with -Content-Encoding: gzip set and chunked transfer encoding, then rclone -will decompress the object on the fly. + Note that `cleanup` will remove partially uploaded files from the bucket + if they are more than a day old. -If this is set to unset (the default) then rclone will choose according -to the provider setting what to apply, but you can override rclone's -choice here. + When you `purge` a bucket, the current and the old versions will be + deleted then the bucket will be deleted. -Properties: + However `delete` will cause the current versions of the files to + become hidden old versions. -- Config: might_gzip -- Env Var: RCLONE_S3_MIGHT_GZIP -- Type: Tristate -- Default: unset + Here is a session showing the listing and retrieval of an old + version followed by a `cleanup` of the old versions. ---s3-use-accept-encoding-gzip + Show current version and all the versions with `--b2-versions` flag. -Whether to send Accept-Encoding: gzip header. +$ rclone -q ls b2:cleanup-test 9 one.txt -By default, rclone will append Accept-Encoding: gzip to the request to -download compressed objects whenever possible. +$ rclone -q --b2-versions ls b2:cleanup-test 9 one.txt 8 +one-v2016-07-04-141032-000.txt 16 one-v2016-07-04-141003-000.txt 15 +one-v2016-07-02-155621-000.txt -However some providers such as Google Cloud Storage may alter the HTTP -headers, breaking the signature of the request. -A symptom of this would be receiving errors like + Retrieve an old version - SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. +$ rclone -q --b2-versions copy +b2:cleanup-test/one-v2016-07-04-141003-000.txt /tmp -In this case, you might want to try disabling this option. +$ ls -l /tmp/one-v2016-07-04-141003-000.txt -rw-rw-r-- 1 ncw ncw 16 Jul +2 17:46 /tmp/one-v2016-07-04-141003-000.txt -Properties: -- Config: use_accept_encoding_gzip -- Env Var: RCLONE_S3_USE_ACCEPT_ENCODING_GZIP -- Type: Tristate -- Default: unset + Clean up all the old versions and show that they've gone. ---s3-no-system-metadata +$ rclone -q cleanup b2:cleanup-test -Suppress setting and reading of system metadata +$ rclone -q ls b2:cleanup-test 9 one.txt -Properties: +$ rclone -q --b2-versions ls b2:cleanup-test 9 one.txt -- Config: no_system_metadata -- Env Var: RCLONE_S3_NO_SYSTEM_METADATA -- Type: bool -- Default: false ---s3-sts-endpoint + #### Versions naming caveat -Endpoint for STS. + When using `--b2-versions` flag rclone is relying on the file name + to work out whether the objects are versions or not. Versions' names + are created by inserting timestamp between file name and its extension. -Leave blank if using AWS to use the default endpoint for the region. + 9 file.txt + 8 file-v2023-07-17-161032-000.txt + 16 file-v2023-06-15-141003-000.txt -Properties: + If there are real files present with the same names as versions, then + behaviour of `--b2-versions` can be unpredictable. -- Config: sts_endpoint -- Env Var: RCLONE_S3_STS_ENDPOINT -- Provider: AWS -- Type: string -- Required: false + ### Data usage -Metadata + It is useful to know how many requests are sent to the server in different scenarios. -User metadata is stored as x-amz-meta- keys. S3 metadata keys are case -insensitive and are always returned in lower case. + All copy commands send the following 4 requests: -Here are the possible system metadata items for the s3 backend. +/b2api/v1/b2_authorize_account /b2api/v1/b2_create_bucket +/b2api/v1/b2_list_buckets /b2api/v1/b2_list_file_names - ------------------------------------------------------------------------------------------------------------------ - Name Help Type Example Read Only - --------------------- --------------------- ----------- ------------------------------------- -------------------- - btime Time of file birth RFC 3339 2006-01-02T15:04:05.999999999Z07:00 Y - (creation) read from - Last-Modified header - cache-control Cache-Control header string no-cache N + The `b2_list_file_names` request will be sent once for every 1k files + in the remote path, providing the checksum and modification time of + the listed files. As of version 1.33 issue + [#818](https://github.com/rclone/rclone/issues/818) causes extra requests + to be sent when using B2 with Crypt. When a copy operation does not + require any files to be uploaded, no more requests will be sent. - content-disposition Content-Disposition string inline N - header + Uploading files that do not require chunking, will send 2 requests per + file upload: - content-encoding Content-Encoding string gzip N - header +/b2api/v1/b2_get_upload_url /b2api/v1/b2_upload_file/ - content-language Content-Language string en-US N - header - content-type Content-Type header string text/plain N + Uploading files requiring chunking, will send 2 requests (one each to + start and finish the upload) and another 2 requests for each chunk: - mtime Time of last RFC 3339 2006-01-02T15:04:05.999999999Z07:00 N - modification, read - from rclone metadata +/b2api/v1/b2_start_large_file /b2api/v1/b2_get_upload_part_url +/b2api/v1/b2_upload_part/ /b2api/v1/b2_finish_large_file - tier Tier of the object string GLACIER Y - ------------------------------------------------------------------------------------------------------------------ -See the metadata docs for more info. + #### Versions -Backend commands + Versions can be viewed with the `--b2-versions` flag. When it is set + rclone will show and act on older versions of files. For example -Here are the commands specific to the s3 backend. + Listing without `--b2-versions` -Run them with +$ rclone -q ls b2:cleanup-test 9 one.txt - rclone backend COMMAND remote: -The help below will explain what arguments each command takes. + And with -See the backend command for more info on how to pass options and -arguments. +$ rclone -q --b2-versions ls b2:cleanup-test 9 one.txt 8 +one-v2016-07-04-141032-000.txt 16 one-v2016-07-04-141003-000.txt 15 +one-v2016-07-02-155621-000.txt -These can be run on a running backend using the rc command -backend/command. -restore + Showing that the current version is unchanged but older versions can + be seen. These have the UTC date that they were uploaded to the + server to the nearest millisecond appended to them. -Restore objects from GLACIER to normal storage + Note that when using `--b2-versions` no file write operations are + permitted, so you can't upload files or delete them. - rclone backend restore remote: [options] [+] + ### B2 and rclone link -This command can be used to restore one or more objects from GLACIER to -normal storage. + Rclone supports generating file share links for private B2 buckets. + They can either be for a file for example: -Usage Examples: +./rclone link B2:bucket/path/to/file.txt +https://f002.backblazeb2.com/file/bucket/path/to/file.txt?Authorization=xxxxxxxx - rclone backend restore s3:bucket/path/to/object -o priority=PRIORITY -o lifetime=DAYS - rclone backend restore s3:bucket/path/to/directory -o priority=PRIORITY -o lifetime=DAYS - rclone backend restore s3:bucket -o priority=PRIORITY -o lifetime=DAYS -This flag also obeys the filters. Test first with --interactive/-i or ---dry-run flags + or if run on a directory you will get: - rclone --interactive backend restore --include "*.txt" s3:bucket/path -o priority=Standard -o lifetime=1 +./rclone link B2:bucket/path +https://f002.backblazeb2.com/file/bucket/path?Authorization=xxxxxxxx -All the objects shown will be marked for restore, then - rclone backend restore --include "*.txt" s3:bucket/path -o priority=Standard -o lifetime=1 + you can then use the authorization token (the part of the url from the + `?Authorization=` on) on any file path under that directory. For example: -It returns a list of status dictionaries with Remote and Status keys. -The Status will be OK if it was successful or an error message if not. +https://f002.backblazeb2.com/file/bucket/path/to/file1?Authorization=xxxxxxxx +https://f002.backblazeb2.com/file/bucket/path/file2?Authorization=xxxxxxxx +https://f002.backblazeb2.com/file/bucket/path/folder/file3?Authorization=xxxxxxxx - [ - { - "Status": "OK", - "Remote": "test.txt" - }, - { - "Status": "OK", - "Remote": "test/file4.txt" - } - ] -Options: -- "description": The optional description for the job. -- "lifetime": Lifetime of the active copy in days -- "priority": Priority of restore: Standard|Expedited|Bulk + ### Standard options -restore-status + Here are the Standard options specific to b2 (Backblaze B2). -Show the restore status for objects being restored from GLACIER to -normal storage + #### --b2-account - rclone backend restore-status remote: [options] [+] + Account ID or Application Key ID. -This command can be used to show the status for objects being restored -from GLACIER to normal storage. + Properties: -Usage Examples: + - Config: account + - Env Var: RCLONE_B2_ACCOUNT + - Type: string + - Required: true - rclone backend restore-status s3:bucket/path/to/object - rclone backend restore-status s3:bucket/path/to/directory - rclone backend restore-status -o all s3:bucket/path/to/directory + #### --b2-key -This command does not obey the filters. + Application Key. -It returns a list of status dictionaries. + Properties: - [ - { - "Remote": "file.txt", - "VersionID": null, - "RestoreStatus": { - "IsRestoreInProgress": true, - "RestoreExpiryDate": "2023-09-06T12:29:19+01:00" - }, - "StorageClass": "GLACIER" - }, - { - "Remote": "test.pdf", - "VersionID": null, - "RestoreStatus": { - "IsRestoreInProgress": false, - "RestoreExpiryDate": "2023-09-06T12:29:19+01:00" - }, - "StorageClass": "DEEP_ARCHIVE" - } - ] + - Config: key + - Env Var: RCLONE_B2_KEY + - Type: string + - Required: true -Options: + #### --b2-hard-delete -- "all": if set then show all objects, not just ones with restore - status + Permanently delete files on remote removal, otherwise hide files. -list-multipart-uploads + Properties: -List the unfinished multipart uploads + - Config: hard_delete + - Env Var: RCLONE_B2_HARD_DELETE + - Type: bool + - Default: false - rclone backend list-multipart-uploads remote: [options] [+] + ### Advanced options -This command lists the unfinished multipart uploads in JSON format. + Here are the Advanced options specific to b2 (Backblaze B2). - rclone backend list-multipart s3:bucket/path/to/object + #### --b2-endpoint -It returns a dictionary of buckets with values as lists of unfinished -multipart uploads. + Endpoint for the service. -You can call it with no bucket in which case it lists all bucket, with a -bucket or with a bucket and path. + Leave blank normally. - { - "rclone": [ - { - "Initiated": "2020-06-26T14:20:36Z", - "Initiator": { - "DisplayName": "XXX", - "ID": "arn:aws:iam::XXX:user/XXX" - }, - "Key": "KEY", - "Owner": { - "DisplayName": null, - "ID": "XXX" - }, - "StorageClass": "STANDARD", - "UploadId": "XXX" - } - ], - "rclone-1000files": [], - "rclone-dst": [] - } + Properties: -cleanup + - Config: endpoint + - Env Var: RCLONE_B2_ENDPOINT + - Type: string + - Required: false -Remove unfinished multipart uploads. + #### --b2-test-mode - rclone backend cleanup remote: [options] [+] + A flag string for X-Bz-Test-Mode header for debugging. -This command removes unfinished multipart uploads of age greater than -max-age which defaults to 24 hours. + This is for debugging purposes only. Setting it to one of the strings + below will cause b2 to return specific errors: -Note that you can use --interactive/-i or --dry-run with this command to -see what it would do. + * "fail_some_uploads" + * "expire_some_account_authorization_tokens" + * "force_cap_exceeded" - rclone backend cleanup s3:bucket/path/to/object - rclone backend cleanup -o max-age=7w s3:bucket/path/to/object + These will be set in the "X-Bz-Test-Mode" header which is documented + in the [b2 integrations checklist](https://www.backblaze.com/b2/docs/integration_checklist.html). -Durations are parsed as per the rest of rclone, 2h, 7d, 7w etc. + Properties: -Options: + - Config: test_mode + - Env Var: RCLONE_B2_TEST_MODE + - Type: string + - Required: false -- "max-age": Max age of upload to delete + #### --b2-versions -cleanup-hidden + Include old versions in directory listings. -Remove old versions of files. + Note that when using this no file write operations are permitted, + so you can't upload files or delete them. - rclone backend cleanup-hidden remote: [options] [+] + Properties: -This command removes any old hidden versions of files on a versions -enabled bucket. + - Config: versions + - Env Var: RCLONE_B2_VERSIONS + - Type: bool + - Default: false -Note that you can use --interactive/-i or --dry-run with this command to -see what it would do. + #### --b2-version-at - rclone backend cleanup-hidden s3:bucket/path/to/dir + Show file versions as they were at the specified time. -versioning + Note that when using this no file write operations are permitted, + so you can't upload files or delete them. -Set/get versioning support for a bucket. + Properties: - rclone backend versioning remote: [options] [+] + - Config: version_at + - Env Var: RCLONE_B2_VERSION_AT + - Type: Time + - Default: off -This command sets versioning support if a parameter is passed and then -returns the current versioning status for the bucket supplied. + #### --b2-upload-cutoff - rclone backend versioning s3:bucket # read status only - rclone backend versioning s3:bucket Enabled - rclone backend versioning s3:bucket Suspended + Cutoff for switching to chunked upload. -It may return "Enabled", "Suspended" or "Unversioned". Note that once -versioning has been enabled the status can't be set back to -"Unversioned". + Files above this size will be uploaded in chunks of "--b2-chunk-size". -set + This value should be set no larger than 4.657 GiB (== 5 GB). -Set command for updating the config parameters. + Properties: - rclone backend set remote: [options] [+] + - Config: upload_cutoff + - Env Var: RCLONE_B2_UPLOAD_CUTOFF + - Type: SizeSuffix + - Default: 200Mi -This set command can be used to update the config parameters for a -running s3 backend. + #### --b2-copy-cutoff -Usage Examples: + Cutoff for switching to multipart copy. - rclone backend set s3: [-o opt_name=opt_value] [-o opt_name2=opt_value2] - rclone rc backend/command command=set fs=s3: [-o opt_name=opt_value] [-o opt_name2=opt_value2] - rclone rc backend/command command=set fs=s3: -o session_token=X -o access_key_id=X -o secret_access_key=X + Any files larger than this that need to be server-side copied will be + copied in chunks of this size. -The option keys are named as they are in the config file. + The minimum is 0 and the maximum is 4.6 GiB. -This rebuilds the connection to the s3 backend when it is called with -the new parameters. Only new parameters need be passed as the values -will default to those currently in use. + Properties: -It doesn't return anything. + - Config: copy_cutoff + - Env Var: RCLONE_B2_COPY_CUTOFF + - Type: SizeSuffix + - Default: 4Gi -Anonymous access to public buckets + #### --b2-chunk-size -If you want to use rclone to access a public bucket, configure with a -blank access_key_id and secret_access_key. Your config should end up -looking like this: + Upload chunk size. - [anons3] - type = s3 - provider = AWS - env_auth = false - access_key_id = - secret_access_key = - region = us-east-1 - endpoint = - location_constraint = - acl = private - server_side_encryption = - storage_class = + When uploading large files, chunk the file into this size. -Then use it as normal with the name of the public bucket, e.g. + Must fit in memory. These chunks are buffered in memory and there + might a maximum of "--transfers" chunks in progress at once. - rclone lsd anons3:1000genomes + 5,000,000 Bytes is the minimum size. -You will be able to list and copy data but not upload it. + Properties: -Providers + - Config: chunk_size + - Env Var: RCLONE_B2_CHUNK_SIZE + - Type: SizeSuffix + - Default: 96Mi -AWS S3 + #### --b2-upload-concurrency -This is the provider used as main example and described in the -configuration section above. + Concurrency for multipart uploads. -AWS Snowball Edge + This is the number of chunks of the same file that are uploaded + concurrently. -AWS Snowball is a hardware appliance used for transferring bulk data -back to AWS. Its main software interface is S3 object storage. + Note that chunks are stored in memory and there may be up to + "--transfers" * "--b2-upload-concurrency" chunks stored at once + in memory. -To use rclone with AWS Snowball Edge devices, configure as standard for -an 'S3 Compatible Service'. + Properties: -If using rclone pre v1.59 be sure to set upload_cutoff = 0 otherwise you -will run into authentication header issues as the snowball device does -not support query parameter based authentication. + - Config: upload_concurrency + - Env Var: RCLONE_B2_UPLOAD_CONCURRENCY + - Type: int + - Default: 4 -With rclone v1.59 or later setting upload_cutoff should not be -necessary. + #### --b2-disable-checksum -eg. + Disable checksums for large (> upload cutoff) files. - [snowball] - type = s3 - provider = Other - access_key_id = YOUR_ACCESS_KEY - secret_access_key = YOUR_SECRET_KEY - endpoint = http://[IP of Snowball]:8080 - upload_cutoff = 0 + Normally rclone will calculate the SHA1 checksum of the input before + uploading it so it can add it to metadata on the object. This is great + for data integrity checking but can cause long delays for large files + to start uploading. -Ceph + Properties: -Ceph is an open-source, unified, distributed storage system designed for -excellent performance, reliability and scalability. It has an S3 -compatible object storage interface. + - Config: disable_checksum + - Env Var: RCLONE_B2_DISABLE_CHECKSUM + - Type: bool + - Default: false -To use rclone with Ceph, configure as above but leave the region blank -and set the endpoint. You should end up with something like this in your -config: + #### --b2-download-url - [ceph] - type = s3 - provider = Ceph - env_auth = false - access_key_id = XXX - secret_access_key = YYY - region = - endpoint = https://ceph.endpoint.example.com - location_constraint = - acl = - server_side_encryption = - storage_class = + Custom endpoint for downloads. -If you are using an older version of CEPH (e.g. 10.2.x Jewel) and a -version of rclone before v1.59 then you may need to supply the parameter ---s3-upload-cutoff 0 or put this in the config file as upload_cutoff 0 -to work around a bug which causes uploading of small files to fail. + This is usually set to a Cloudflare CDN URL as Backblaze offers + free egress for data downloaded through the Cloudflare network. + Rclone works with private buckets by sending an "Authorization" header. + If the custom endpoint rewrites the requests for authentication, + e.g., in Cloudflare Workers, this header needs to be handled properly. + Leave blank if you want to use the endpoint provided by Backblaze. -Note also that Ceph sometimes puts / in the passwords it gives users. If -you read the secret access key using the command line tools you will get -a JSON blob with the / escaped as \/. Make sure you only write / in the -secret access key. + The URL provided here SHOULD have the protocol and SHOULD NOT have + a trailing slash or specify the /file/bucket subpath as rclone will + request files with "{download_url}/file/{bucket_name}/{path}". -Eg the dump from Ceph looks something like this (irrelevant keys -removed). + Example: + > https://mysubdomain.mydomain.tld + (No trailing "/", "file" or "bucket") - { - "user_id": "xxx", - "display_name": "xxxx", - "keys": [ - { - "user": "xxx", - "access_key": "xxxxxx", - "secret_key": "xxxxxx\/xxxx" - } - ], - } + Properties: -Because this is a json dump, it is encoding the / as \/, so if you use -the secret key as xxxxxx/xxxx it will work fine. + - Config: download_url + - Env Var: RCLONE_B2_DOWNLOAD_URL + - Type: string + - Required: false -Cloudflare R2 + #### --b2-download-auth-duration -Cloudflare R2 Storage allows developers to store large amounts of -unstructured data without the costly egress bandwidth fees associated -with typical cloud storage services. + Time before the authorization token will expire in s or suffix ms|s|m|h|d. -Here is an example of making a Cloudflare R2 configuration. First run: + The duration before the download authorization token will expire. + The minimum value is 1 second. The maximum value is one week. - rclone config + Properties: -This will guide you through an interactive setup process. + - Config: download_auth_duration + - Env Var: RCLONE_B2_DOWNLOAD_AUTH_DURATION + - Type: Duration + - Default: 1w -Note that all buckets are private, and all are stored in the same "auto" -region. It is necessary to use Cloudflare workers to share the content -of a bucket publicly. + #### --b2-memory-pool-flush-time - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> r2 - Option Storage. - Type of storage to configure. - Choose a number from below, or type in your own value. - ... - XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi - \ (s3) - ... - Storage> s3 - Option provider. - Choose your S3 provider. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - ... - XX / Cloudflare R2 Storage - \ (Cloudflare) - ... - provider> Cloudflare - Option env_auth. - Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). - Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) - env_auth> 1 - Option access_key_id. - AWS Access Key ID. - Leave blank for anonymous access or runtime credentials. - Enter a value. Press Enter to leave empty. - access_key_id> ACCESS_KEY - Option secret_access_key. - AWS Secret Access Key (password). - Leave blank for anonymous access or runtime credentials. - Enter a value. Press Enter to leave empty. - secret_access_key> SECRET_ACCESS_KEY - Option region. - Region to connect to. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - 1 / R2 buckets are automatically distributed across Cloudflare's data centers for low latency. - \ (auto) - region> 1 - Option endpoint. - Endpoint for S3 API. - Required when using an S3 clone. - Enter a value. Press Enter to leave empty. - endpoint> https://ACCOUNT_ID.r2.cloudflarestorage.com - Edit advanced config? - y) Yes - n) No (default) - y/n> n - -------------------- - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y + How often internal memory buffer pools will be flushed. (no longer used) -This will leave your config looking something like: + Properties: - [r2] - type = s3 - provider = Cloudflare - access_key_id = ACCESS_KEY - secret_access_key = SECRET_ACCESS_KEY - region = auto - endpoint = https://ACCOUNT_ID.r2.cloudflarestorage.com - acl = private + - Config: memory_pool_flush_time + - Env Var: RCLONE_B2_MEMORY_POOL_FLUSH_TIME + - Type: Duration + - Default: 1m0s -Now run rclone lsf r2: to see your buckets and rclone lsf r2:bucket to -look within a bucket. + #### --b2-memory-pool-use-mmap -Dreamhost + Whether to use mmap buffers in internal memory pool. (no longer used) -Dreamhost DreamObjects is an object storage system based on CEPH. + Properties: -To use rclone with Dreamhost, configure as above but leave the region -blank and set the endpoint. You should end up with something like this -in your config: + - Config: memory_pool_use_mmap + - Env Var: RCLONE_B2_MEMORY_POOL_USE_MMAP + - Type: bool + - Default: false - [dreamobjects] - type = s3 - provider = DreamHost - env_auth = false - access_key_id = your_access_key - secret_access_key = your_secret_key - region = - endpoint = objects-us-west-1.dream.io - location_constraint = - acl = private - server_side_encryption = - storage_class = + #### --b2-lifecycle -Google Cloud Storage + Set the number of days deleted files should be kept when creating a bucket. -GoogleCloudStorage is an S3-interoperable object storage service from -Google Cloud Platform. + On bucket creation, this parameter is used to create a lifecycle rule + for the entire bucket. -To connect to Google Cloud Storage you will need an access key and -secret key. These can be retrieved by creating an HMAC key. + If lifecycle is 0 (the default) it does not create a lifecycle rule so + the default B2 behaviour applies. This is to create versions of files + on delete and overwrite and to keep them indefinitely. - [gs] - type = s3 - provider = GCS - access_key_id = your_access_key - secret_access_key = your_secret_key - endpoint = https://storage.googleapis.com + If lifecycle is >0 then it creates a single rule setting the number of + days before a file that is deleted or overwritten is deleted + permanently. This is known as daysFromHidingToDeleting in the b2 docs. -DigitalOcean Spaces + The minimum value for this parameter is 1 day. -Spaces is an S3-interoperable object storage service from cloud provider -DigitalOcean. + You can also enable hard_delete in the config also which will mean + deletions won't cause versions but overwrites will still cause + versions to be made. -To connect to DigitalOcean Spaces you will need an access key and secret -key. These can be retrieved on the "Applications & API" page of the -DigitalOcean control panel. They will be needed when prompted by -rclone config for your access_key_id and secret_access_key. + See: [rclone backend lifecycle](#lifecycle) for setting lifecycles after bucket creation. -When prompted for a region or location_constraint, press enter to use -the default value. The region must be included in the endpoint setting -(e.g. nyc3.digitaloceanspaces.com). The default values can be used for -other settings. -Going through the whole process of creating a new remote by running -rclone config, each prompt should be answered as shown below: + Properties: - Storage> s3 - env_auth> 1 - access_key_id> YOUR_ACCESS_KEY - secret_access_key> YOUR_SECRET_KEY - region> - endpoint> nyc3.digitaloceanspaces.com - location_constraint> - acl> - storage_class> + - Config: lifecycle + - Env Var: RCLONE_B2_LIFECYCLE + - Type: int + - Default: 0 -The resulting configuration file should look like: + #### --b2-encoding - [spaces] - type = s3 - provider = DigitalOcean - env_auth = false - access_key_id = YOUR_ACCESS_KEY - secret_access_key = YOUR_SECRET_KEY - region = - endpoint = nyc3.digitaloceanspaces.com - location_constraint = - acl = - server_side_encryption = - storage_class = + The encoding for the backend. -Once configured, you can create a new Space and begin copying files. For -example: + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. - rclone mkdir spaces:my-new-space - rclone copy /path/to/files spaces:my-new-space + Properties: -Huawei OBS + - Config: encoding + - Env Var: RCLONE_B2_ENCODING + - Type: Encoding + - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot -Object Storage Service (OBS) provides stable, secure, efficient, and -easy-to-use cloud storage that lets you store virtually any volume of -unstructured data in any format and access it from anywhere. + ## Backend commands -OBS provides an S3 interface, you can copy and modify the following -configuration and add it to your rclone configuration file. + Here are the commands specific to the b2 backend. - [obs] - type = s3 - provider = HuaweiOBS - access_key_id = your-access-key-id - secret_access_key = your-secret-access-key - region = af-south-1 - endpoint = obs.af-south-1.myhuaweicloud.com - acl = private + Run them with -Or you can also configure via the interactive command line: + rclone backend COMMAND remote: - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> obs - Option Storage. - Type of storage to configure. - Choose a number from below, or type in your own value. - [snip] - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi - \ (s3) - [snip] - Storage> 5 - Option provider. - Choose your S3 provider. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - [snip] - 9 / Huawei Object Storage Service - \ (HuaweiOBS) - [snip] - provider> 9 - Option env_auth. - Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). - Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) - env_auth> 1 - Option access_key_id. - AWS Access Key ID. - Leave blank for anonymous access or runtime credentials. - Enter a value. Press Enter to leave empty. - access_key_id> your-access-key-id - Option secret_access_key. - AWS Secret Access Key (password). - Leave blank for anonymous access or runtime credentials. - Enter a value. Press Enter to leave empty. - secret_access_key> your-secret-access-key - Option region. - Region to connect to. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - 1 / AF-Johannesburg - \ (af-south-1) - 2 / AP-Bangkok - \ (ap-southeast-2) - [snip] - region> 1 - Option endpoint. - Endpoint for OBS API. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - 1 / AF-Johannesburg - \ (obs.af-south-1.myhuaweicloud.com) - 2 / AP-Bangkok - \ (obs.ap-southeast-2.myhuaweicloud.com) - [snip] - endpoint> 1 - Option acl. - Canned ACL used when creating buckets and storing or copying objects. - This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. - For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl - Note that this ACL is applied when server-side copying objects as S3 - doesn't copy the ACL from the source but rather writes a fresh one. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - / Owner gets FULL_CONTROL. - 1 | No one else has access rights (default). - \ (private) - [snip] - acl> 1 - Edit advanced config? - y) Yes - n) No (default) - y/n> - -------------------- - [obs] - type = s3 - provider = HuaweiOBS - access_key_id = your-access-key-id - secret_access_key = your-secret-access-key - region = af-south-1 - endpoint = obs.af-south-1.myhuaweicloud.com - acl = private - -------------------- - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y - Current remotes: + The help below will explain what arguments each command takes. - Name Type - ==== ==== - obs s3 + See the [backend](https://rclone.org/commands/rclone_backend/) command for more + info on how to pass options and arguments. - e) Edit existing remote - n) New remote - d) Delete remote - r) Rename remote - c) Copy remote - s) Set configuration password - q) Quit config - e/n/d/r/c/s/q> q + These can be run on a running backend using the rc command + [backend/command](https://rclone.org/rc/#backend-command). -IBM COS (S3) + ### lifecycle -Information stored with IBM Cloud Object Storage is encrypted and -dispersed across multiple geographic locations, and accessed through an -implementation of the S3 API. This service makes use of the distributed -storage technologies provided by IBM’s Cloud Object Storage System -(formerly Cleversafe). For more information visit: -(http://www.ibm.com/cloud/object-storage) + Read or set the lifecycle for a bucket -To configure access to IBM COS S3, follow the steps below: + rclone backend lifecycle remote: [options] [+] -1. Run rclone config and select n for a new remote. + This command can be used to read or set the lifecycle for a bucket. - 2018/02/14 14:13:11 NOTICE: Config file "C:\\Users\\a\\.config\\rclone\\rclone.conf" not found - using defaults - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n + Usage Examples: -2. Enter the name for the configuration + To show the current lifecycle rules: - name> + rclone backend lifecycle b2:bucket -3. Select "s3" storage. + This will dump something like this showing the lifecycle rules. - Choose a number from below, or type in your own value - 1 / Alias for an existing remote - \ "alias" - 2 / Amazon Drive - \ "amazon cloud drive" - 3 / Amazon S3 Complaint Storage Providers (Dreamhost, Ceph, ChinaMobile, Liara, ArvanCloud, Minio, IBM COS) - \ "s3" - 4 / Backblaze B2 - \ "b2" - [snip] - 23 / HTTP - \ "http" - Storage> 3 + [ + { + "daysFromHidingToDeleting": 1, + "daysFromUploadingToHiding": null, + "fileNamePrefix": "" + } + ] -4. Select IBM COS as the S3 Storage Provider. + If there are no lifecycle rules (the default) then it will just return []. - Choose the S3 provider. - Choose a number from below, or type in your own value - 1 / Choose this option to configure Storage to AWS S3 - \ "AWS" - 2 / Choose this option to configure Storage to Ceph Systems - \ "Ceph" - 3 / Choose this option to configure Storage to Dreamhost - \ "Dreamhost" - 4 / Choose this option to the configure Storage to IBM COS S3 - \ "IBMCOS" - 5 / Choose this option to the configure Storage to Minio - \ "Minio" - Provider>4 + To reset the current lifecycle rules: -5. Enter the Access Key and Secret. + rclone backend lifecycle b2:bucket -o daysFromHidingToDeleting=30 + rclone backend lifecycle b2:bucket -o daysFromUploadingToHiding=5 -o daysFromHidingToDeleting=1 - AWS Access Key ID - leave blank for anonymous access or runtime credentials. - access_key_id> <> - AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. - secret_access_key> <> + This will run and then print the new lifecycle rules as above. -6. Specify the endpoint for IBM COS. For Public IBM COS, choose from - the option below. For On Premise IBM COS, enter an endpoint address. + Rclone only lets you set lifecycles for the whole bucket with the + fileNamePrefix = "". - Endpoint for IBM COS S3 API. - Specify if using an IBM COS On Premise. - Choose a number from below, or type in your own value - 1 / US Cross Region Endpoint - \ "s3-api.us-geo.objectstorage.softlayer.net" - 2 / US Cross Region Dallas Endpoint - \ "s3-api.dal.us-geo.objectstorage.softlayer.net" - 3 / US Cross Region Washington DC Endpoint - \ "s3-api.wdc-us-geo.objectstorage.softlayer.net" - 4 / US Cross Region San Jose Endpoint - \ "s3-api.sjc-us-geo.objectstorage.softlayer.net" - 5 / US Cross Region Private Endpoint - \ "s3-api.us-geo.objectstorage.service.networklayer.com" - 6 / US Cross Region Dallas Private Endpoint - \ "s3-api.dal-us-geo.objectstorage.service.networklayer.com" - 7 / US Cross Region Washington DC Private Endpoint - \ "s3-api.wdc-us-geo.objectstorage.service.networklayer.com" - 8 / US Cross Region San Jose Private Endpoint - \ "s3-api.sjc-us-geo.objectstorage.service.networklayer.com" - 9 / US Region East Endpoint - \ "s3.us-east.objectstorage.softlayer.net" - 10 / US Region East Private Endpoint - \ "s3.us-east.objectstorage.service.networklayer.com" - 11 / US Region South Endpoint - [snip] - 34 / Toronto Single Site Private Endpoint - \ "s3.tor01.objectstorage.service.networklayer.com" - endpoint>1 + You can't disable versioning with B2. The best you can do is to set + the daysFromHidingToDeleting to 1 day. You can enable hard_delete in + the config also which will mean deletions won't cause versions but + overwrites will still cause versions to be made. -7. Specify a IBM COS Location Constraint. The location constraint must - match endpoint when using IBM Cloud Public. For on-prem COS, do not - make a selection from this list, hit enter + rclone backend lifecycle b2:bucket -o daysFromHidingToDeleting=1 - 1 / US Cross Region Standard - \ "us-standard" - 2 / US Cross Region Vault - \ "us-vault" - 3 / US Cross Region Cold - \ "us-cold" - 4 / US Cross Region Flex - \ "us-flex" - 5 / US East Region Standard - \ "us-east-standard" - 6 / US East Region Vault - \ "us-east-vault" - 7 / US East Region Cold - \ "us-east-cold" - 8 / US East Region Flex - \ "us-east-flex" - 9 / US South Region Standard - \ "us-south-standard" - 10 / US South Region Vault - \ "us-south-vault" - [snip] - 32 / Toronto Flex - \ "tor01-flex" - location_constraint>1 + See: https://www.backblaze.com/docs/cloud-storage-lifecycle-rules -9. Specify a canned ACL. IBM Cloud (Storage) supports "public-read" and - "private". IBM Cloud(Infra) supports all the canned ACLs. On-Premise - COS supports all the canned ACLs. - Canned ACL used when creating buckets and/or storing objects in S3. - For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl - Choose a number from below, or type in your own value - 1 / Owner gets FULL_CONTROL. No one else has access rights (default). This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise COS - \ "private" - 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access. This acl is available on IBM Cloud (Infra), IBM Cloud (Storage), On-Premise IBM COS - \ "public-read" - 3 / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. This acl is available on IBM Cloud (Infra), On-Premise IBM COS - \ "public-read-write" - 4 / Owner gets FULL_CONTROL. The AuthenticatedUsers group gets READ access. Not supported on Buckets. This acl is available on IBM Cloud (Infra) and On-Premise IBM COS - \ "authenticated-read" - acl> 1 + Options: -12. Review the displayed configuration and accept to save the "remote" - then quit. The config file should look like this + - "daysFromHidingToDeleting": After a file has been hidden for this many days it is deleted. 0 is off. + - "daysFromUploadingToHiding": This many days after uploading a file is hidden - [xxx] - type = s3 - Provider = IBMCOS - access_key_id = xxx - secret_access_key = yyy - endpoint = s3-api.us-geo.objectstorage.softlayer.net - location_constraint = us-standard - acl = private -13. Execute rclone commands - 1) Create a bucket. - rclone mkdir IBM-COS-XREGION:newbucket - 2) List available buckets. - rclone lsd IBM-COS-XREGION: - -1 2017-11-08 21:16:22 -1 test - -1 2018-02-14 20:16:39 -1 newbucket - 3) List contents of a bucket. - rclone ls IBM-COS-XREGION:newbucket - 18685952 test.exe - 4) Copy a file from local to remote. - rclone copy /Users/file.txt IBM-COS-XREGION:newbucket - 5) Copy a file from remote to local. - rclone copy IBM-COS-XREGION:newbucket/file.txt . - 6) Delete a file on remote. - rclone delete IBM-COS-XREGION:newbucket/file.txt + ## Limitations -IDrive e2 + `rclone about` is not supported by the B2 backend. Backends without + this capability cannot determine free space for an rclone mount or + use policy `mfs` (most free space) as a member of an rclone union + remote. -Here is an example of making an IDrive e2 configuration. First run: + See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) - rclone config + # Box -This will guide you through an interactive setup process. + Paths are specified as `remote:path` - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n + Paths may be as deep as required, e.g. `remote:directory/subdirectory`. - Enter name for new remote. - name> e2 + The initial setup for Box involves getting a token from Box which you + can do either in your browser, or with a config.json downloaded from Box + to use JWT authentication. `rclone config` walks you through it. - Option Storage. - Type of storage to configure. - Choose a number from below, or type in your own value. - [snip] - XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi - \ (s3) - [snip] - Storage> s3 + ## Configuration - Option provider. - Choose your S3 provider. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - [snip] - XX / IDrive e2 - \ (IDrive) - [snip] - provider> IDrive + Here is an example of how to make a remote called `remote`. First run: - Option env_auth. - Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). - Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) - env_auth> + rclone config - Option access_key_id. - AWS Access Key ID. - Leave blank for anonymous access or runtime credentials. - Enter a value. Press Enter to leave empty. - access_key_id> YOUR_ACCESS_KEY + This will guide you through an interactive setup process: - Option secret_access_key. - AWS Secret Access Key (password). - Leave blank for anonymous access or runtime credentials. - Enter a value. Press Enter to leave empty. - secret_access_key> YOUR_SECRET_KEY +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Choose a number from below, or type in your own value [snip] +XX / Box  "box" [snip] Storage> box Box App Client Id - leave blank +normally. client_id> Box App Client Secret - leave blank normally. +client_secret> Box App config.json location Leave blank normally. Enter +a string value. Press Enter for the default (""). box_config_file> Box +App Primary Access Token Leave blank normally. Enter a string value. +Press Enter for the default (""). access_token> - Option acl. - Canned ACL used when creating buckets and storing or copying objects. - This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. - For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl - Note that this ACL is applied when server-side copying objects as S3 - doesn't copy the ACL from the source but rather writes a fresh one. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - / Owner gets FULL_CONTROL. - 1 | No one else has access rights (default). - \ (private) - / Owner gets FULL_CONTROL. - 2 | The AllUsers group gets READ access. - \ (public-read) - / Owner gets FULL_CONTROL. - 3 | The AllUsers group gets READ and WRITE access. - | Granting this on a bucket is generally not recommended. - \ (public-read-write) - / Owner gets FULL_CONTROL. - 4 | The AuthenticatedUsers group gets READ access. - \ (authenticated-read) - / Object owner gets FULL_CONTROL. - 5 | Bucket owner gets READ access. - | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. - \ (bucket-owner-read) - / Both the object owner and the bucket owner get FULL_CONTROL over the object. - 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. - \ (bucket-owner-full-control) - acl> +Enter a string value. Press Enter for the default ("user"). Choose a +number from below, or type in your own value 1 / Rclone should act on +behalf of a user  "user" 2 / Rclone should act on behalf of a service +account  "enterprise" box_sub_type> Remote config Use web browser to +automatically authenticate rclone with remote? * Say Y if the machine +running rclone has a web browser you can use * Say N if running rclone +on a (remote) machine without web browser access If not sure try Y. If Y +failed, try N. 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 = +{"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"XXX"} +-------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y - Edit advanced config? - y) Yes - n) No (default) - y/n> - Configuration complete. - Options: - - type: s3 - - provider: IDrive - - access_key_id: YOUR_ACCESS_KEY - - secret_access_key: YOUR_SECRET_KEY - - endpoint: q9d9.la12.idrivee2-5.com - Keep this "e2" remote? - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y + See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a + machine with no Internet browser available. -IONOS Cloud + Note that rclone runs a webserver on your local machine to collect the + token as returned from Box. This only runs from the moment it opens + your browser to the moment you get back the verification code. This + is on `http://127.0.0.1:53682/` and this it may require you to unblock + it temporarily if you are running a host firewall. -IONOS S3 Object Storage is a service offered by IONOS for storing and -accessing unstructured data. To connect to the service, you will need an -access key and a secret key. These can be found in the Data Center -Designer, by selecting Manager resources > Object Storage Key Manager. + Once configured you can then use `rclone` like this, -Here is an example of a configuration. First, run rclone config. This -will walk you through an interactive setup process. Type n to add the -new remote, and then enter a name: + List directories in top level of your Box - Enter name for new remote. - name> ionos-fra + rclone lsd remote: -Type s3 to choose the connection type: + List all the files in your Box - Option Storage. - Type of storage to configure. - Choose a number from below, or type in your own value. - [snip] - XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi - \ (s3) - [snip] - Storage> s3 + rclone ls remote: -Type IONOS: + To copy a local directory to an Box directory called backup - Option provider. - Choose your S3 provider. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - [snip] - XX / IONOS Cloud - \ (IONOS) - [snip] - provider> IONOS + rclone copy /home/source remote:backup -Press Enter to choose the default option -Enter AWS credentials in the next step: + ### Using rclone with an Enterprise account with SSO - Option env_auth. - Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). - Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) - env_auth> + If you have an "Enterprise" account type with Box with single sign on + (SSO), you need to create a password to use Box with rclone. This can + be done at your Enterprise Box account by going to Settings, "Account" + Tab, and then set the password in the "Authentication" field. -Enter your Access Key and Secret key. These can be retrieved in the Data -Center Designer, click on the menu “Manager resources” / "Object Storage -Key Manager". + Once you have done this, you can setup your Enterprise Box account + using the same procedure detailed above in the, using the password you + have just set. - Option access_key_id. - AWS Access Key ID. - Leave blank for anonymous access or runtime credentials. - Enter a value. Press Enter to leave empty. - access_key_id> YOUR_ACCESS_KEY + ### Invalid refresh token - Option secret_access_key. - AWS Secret Access Key (password). - Leave blank for anonymous access or runtime credentials. - Enter a value. Press Enter to leave empty. - secret_access_key> YOUR_SECRET_KEY + According to the [box docs](https://developer.box.com/v2.0/docs/oauth-20#section-6-using-the-access-and-refresh-tokens): -Choose the region where your bucket is located: + > Each refresh_token is valid for one use in 60 days. - Option region. - Region where your bucket will be created and your data stored. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - 1 / Frankfurt, Germany - \ (de) - 2 / Berlin, Germany - \ (eu-central-2) - 3 / Logrono, Spain - \ (eu-south-2) - region> 2 + This means that if you -Choose the endpoint from the same region: + * Don't use the box remote for 60 days + * Copy the config file with a box refresh token in and use it in two places + * Get an error on a token refresh - Option endpoint. - Endpoint for IONOS S3 Object Storage. - Specify the endpoint from the same region. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - 1 / Frankfurt, Germany - \ (s3-eu-central-1.ionoscloud.com) - 2 / Berlin, Germany - \ (s3-eu-central-2.ionoscloud.com) - 3 / Logrono, Spain - \ (s3-eu-south-2.ionoscloud.com) - endpoint> 1 + then rclone will return an error which includes the text `Invalid + refresh token`. -Press Enter to choose the default option or choose the desired ACL -setting: + To fix this you will need to use oauth2 again to update the refresh + token. You can use the methods in [the remote setup + docs](https://rclone.org/remote_setup/), bearing in mind that if you use the copy the + config file method, you should not use that remote on the computer you + did the authentication on. - Option acl. - Canned ACL used when creating buckets and storing or copying objects. - This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. - For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl - Note that this ACL is applied when server-side copying objects as S3 - doesn't copy the ACL from the source but rather writes a fresh one. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - / Owner gets FULL_CONTROL. - 1 | No one else has access rights (default). - \ (private) - / Owner gets FULL_CONTROL. - [snip] - acl> + Here is how to do it. -Press Enter to skip the advanced config: +$ rclone config Current remotes: - Edit advanced config? - y) Yes - n) No (default) - y/n> +Name Type ==== ==== remote box -Press Enter to save the configuration, and then q to quit the -configuration process: +e) Edit existing remote +f) New remote +g) Delete remote +h) Rename remote +i) Copy remote +j) Set configuration password +k) Quit config e/n/d/r/c/s/q> e Choose a number from below, or type in + an existing value 1 > remote remote> remote -------------------- + [remote] type = box token = + {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2017-07-08T23:40:08.059167677+01:00"} + -------------------- Edit remote Value "client_id" = "" Edit? (y/n)> +l) Yes +m) No y/n> n Value "client_secret" = "" Edit? (y/n)> +n) Yes +o) No y/n> n Remote config Already have a token - refresh? +p) Yes +q) No y/n> y Use web browser to automatically authenticate rclone with + remote? - Configuration complete. - Options: - - type: s3 - - provider: IONOS - - access_key_id: YOUR_ACCESS_KEY - - secret_access_key: YOUR_SECRET_KEY - - endpoint: s3-eu-central-1.ionoscloud.com - Keep this "ionos-fra" remote? - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y +- Say Y if the machine running rclone has a web browser you can use +- Say N if running rclone on a (remote) machine without web browser + access If not sure try Y. If Y failed, try N. -Done! Now you can try some commands (for macOS, use ./rclone instead of -rclone). +y) Yes +z) 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] type = box token = + {"access_token":"YYY","token_type":"bearer","refresh_token":"YYY","expiry":"2017-07-23T12:22:29.259137901+01:00"} + -------------------- +a) Yes this is OK +b) Edit this remote +c) Delete this remote y/e/d> y -1) Create a bucket (the name must be unique within the whole IONOS S3) - rclone mkdir ionos-fra:my-bucket + ### Modification times and hashes -2) List available buckets + Box allows modification times to be set on objects accurate to 1 + second. These will be used to detect whether objects need syncing or + not. - rclone lsd ionos-fra: + Box supports SHA1 type hashes, so you can use the `--checksum` + flag. -4) Copy a file from local to remote + ### Restricted filename characters - rclone copy /Users/file.txt ionos-fra:my-bucket + In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) + the following characters are also replaced: -3) List contents of a bucket + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | \ | 0x5C | \ | - rclone ls ionos-fra:my-bucket + File names can also not end with the following characters. + These only get replaced if they are the last character in the name: -5) Copy a file from remote to local + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | SP | 0x20 | ␠ | - rclone copy ionos-fra:my-bucket/file.txt + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. -Minio + ### Transfers -Minio is an object storage server built for cloud application developers -and devops. + For files above 50 MiB rclone will use a chunked transfer. Rclone will + upload up to `--transfers` chunks at the same time (shared among all + the multipart uploads). Chunks are buffered in memory and are + normally 8 MiB so increasing `--transfers` will increase memory use. -It is very easy to install and provides an S3 compatible server which -can be used by rclone. + ### Deleting files -To use it, install Minio following the instructions here. + Depending on the enterprise settings for your user, the item will + either be actually deleted from Box or moved to the trash. -When it configures itself Minio will print something like this + Emptying the trash is supported via the rclone however cleanup command + however this deletes every trashed file and folder individually so it + may take a very long time. + Emptying the trash via the WebUI does not have this limitation + so it is advised to empty the trash via the WebUI. - Endpoint: http://192.168.1.106:9000 http://172.23.0.1:9000 - AccessKey: USWUXHGYZQYFYFFIT3RE - SecretKey: MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 - Region: us-east-1 - SQS ARNs: arn:minio:sqs:us-east-1:1:redis arn:minio:sqs:us-east-1:2:redis + ### Root folder ID - Browser Access: - http://192.168.1.106:9000 http://172.23.0.1:9000 + You can set the `root_folder_id` for rclone. This is the directory + (identified by its `Folder ID`) that rclone considers to be the root + of your Box drive. - Command-line Access: https://docs.minio.io/docs/minio-client-quickstart-guide - $ mc config host add myminio http://192.168.1.106:9000 USWUXHGYZQYFYFFIT3RE MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 + Normally you will leave this blank and rclone will determine the + correct root to use itself. - Object API (Amazon S3 compatible): - Go: https://docs.minio.io/docs/golang-client-quickstart-guide - Java: https://docs.minio.io/docs/java-client-quickstart-guide - Python: https://docs.minio.io/docs/python-client-quickstart-guide - JavaScript: https://docs.minio.io/docs/javascript-client-quickstart-guide - .NET: https://docs.minio.io/docs/dotnet-client-quickstart-guide + However you can set this to restrict rclone to a specific folder + hierarchy. - Drive Capacity: 26 GiB Free, 165 GiB Total + In order to do this you will have to find the `Folder ID` of the + directory you wish rclone to display. This will be the last segment + of the URL when you open the relevant folder in the Box web + interface. -These details need to go into rclone config like this. Note that it is -important to put the region in as stated above. + So if the folder you want rclone to use has a URL which looks like + `https://app.box.com/folder/11xxxxxxxxx8` + in the browser, then you use `11xxxxxxxxx8` as + the `root_folder_id` in the config. - env_auth> 1 - access_key_id> USWUXHGYZQYFYFFIT3RE - secret_access_key> MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 - region> us-east-1 - endpoint> http://192.168.1.106:9000 - location_constraint> - server_side_encryption> -Which makes the config file look like this + ### Standard options - [minio] - type = s3 - provider = Minio - env_auth = false - access_key_id = USWUXHGYZQYFYFFIT3RE - secret_access_key = MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03 - region = us-east-1 - endpoint = http://192.168.1.106:9000 - location_constraint = - server_side_encryption = + Here are the Standard options specific to box (Box). -So once set up, for example, to copy files into a bucket + #### --box-client-id - rclone copy /path/to/files minio:bucket + OAuth Client Id. -Qiniu Cloud Object Storage (Kodo) + Leave blank normally. -Qiniu Cloud Object Storage (Kodo), a completely independent-researched -core technology which is proven by repeated customer experience has -occupied absolute leading market leader position. Kodo can be widely -applied to mass data management. + Properties: -To configure access to Qiniu Kodo, follow the steps below: + - Config: client_id + - Env Var: RCLONE_BOX_CLIENT_ID + - Type: string + - Required: false -1. Run rclone config and select n for a new remote. + #### --box-client-secret - rclone config - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n + OAuth Client Secret. -2. Give the name of the configuration. For example, name it 'qiniu'. + Leave blank normally. - name> qiniu + Properties: -3. Select s3 storage. + - Config: client_secret + - Env Var: RCLONE_BOX_CLIENT_SECRET + - Type: string + - Required: false - Choose a number from below, or type in your own value - 1 / 1Fichier - \ (fichier) - 2 / Akamai NetStorage - \ (netstorage) - 3 / Alias for an existing remote - \ (alias) - 4 / Amazon Drive - \ (amazon cloud drive) - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi - \ (s3) - [snip] - Storage> s3 + #### --box-box-config-file -4. Select Qiniu provider. + Box App config.json location - Choose a number from below, or type in your own value - 1 / Amazon Web Services (AWS) S3 - \ "AWS" - [snip] - 22 / Qiniu Object Storage (Kodo) - \ (Qiniu) - [snip] - provider> Qiniu + Leave blank normally. -5. Enter your SecretId and SecretKey of Qiniu Kodo. + Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. - Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). - Only applies if access_key_id and secret_access_key is blank. - Enter a boolean value (true or false). Press Enter for the default ("false"). - 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. - Enter a string value. Press Enter for the default (""). - access_key_id> AKIDxxxxxxxxxx - AWS Secret Access Key (password) - Leave blank for anonymous access or runtime credentials. - Enter a string value. Press Enter for the default (""). - secret_access_key> xxxxxxxxxxx + Properties: -6. Select endpoint for Qiniu Kodo. This is the standard endpoint for - different region. + - Config: box_config_file + - Env Var: RCLONE_BOX_BOX_CONFIG_FILE + - Type: string + - Required: false - / The default endpoint - a good choice if you are unsure. - 1 | East China Region 1. - | Needs location constraint cn-east-1. - \ (cn-east-1) - / East China Region 2. - 2 | Needs location constraint cn-east-2. - \ (cn-east-2) - / North China Region 1. - 3 | Needs location constraint cn-north-1. - \ (cn-north-1) - / South China Region 1. - 4 | Needs location constraint cn-south-1. - \ (cn-south-1) - / North America Region. - 5 | Needs location constraint us-north-1. - \ (us-north-1) - / Southeast Asia Region 1. - 6 | Needs location constraint ap-southeast-1. - \ (ap-southeast-1) - / Northeast Asia Region 1. - 7 | Needs location constraint ap-northeast-1. - \ (ap-northeast-1) - [snip] - endpoint> 1 + #### --box-access-token - Option endpoint. - Endpoint for Qiniu Object Storage. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - 1 / East China Endpoint 1 - \ (s3-cn-east-1.qiniucs.com) - 2 / East China Endpoint 2 - \ (s3-cn-east-2.qiniucs.com) - 3 / North China Endpoint 1 - \ (s3-cn-north-1.qiniucs.com) - 4 / South China Endpoint 1 - \ (s3-cn-south-1.qiniucs.com) - 5 / North America Endpoint 1 - \ (s3-us-north-1.qiniucs.com) - 6 / Southeast Asia Endpoint 1 - \ (s3-ap-southeast-1.qiniucs.com) - 7 / Northeast Asia Endpoint 1 - \ (s3-ap-northeast-1.qiniucs.com) - endpoint> 1 + Box App Primary Access Token - Option location_constraint. - 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. - Press Enter to leave empty. - 1 / East China Region 1 - \ (cn-east-1) - 2 / East China Region 2 - \ (cn-east-2) - 3 / North China Region 1 - \ (cn-north-1) - 4 / South China Region 1 - \ (cn-south-1) - 5 / North America Region 1 - \ (us-north-1) - 6 / Southeast Asia Region 1 - \ (ap-southeast-1) - 7 / Northeast Asia Region 1 - \ (ap-northeast-1) - location_constraint> 1 + Leave blank normally. -7. Choose acl and storage class. + Properties: - Note that this ACL is applied when server-side copying objects as S3 - doesn't copy the ACL from the source but rather writes a fresh one. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - / Owner gets FULL_CONTROL. - 1 | No one else has access rights (default). - \ (private) - / Owner gets FULL_CONTROL. - 2 | The AllUsers group gets READ access. - \ (public-read) - [snip] - acl> 2 - The storage class to use when storing new objects in Tencent COS. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - 1 / Standard storage class - \ (STANDARD) - 2 / Infrequent access storage mode - \ (LINE) - 3 / Archive storage mode - \ (GLACIER) - 4 / Deep archive storage mode - \ (DEEP_ARCHIVE) - [snip] - storage_class> 1 - Edit advanced config? (y/n) - y) Yes - n) No (default) - y/n> n - Remote config - -------------------- - [qiniu] - - type: s3 - - provider: Qiniu - - access_key_id: xxx - - secret_access_key: xxx - - region: cn-east-1 - - endpoint: s3-cn-east-1.qiniucs.com - - location_constraint: cn-east-1 - - acl: public-read - - storage_class: STANDARD - -------------------- - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y - Current remotes: + - Config: access_token + - Env Var: RCLONE_BOX_ACCESS_TOKEN + - Type: string + - Required: false - Name Type - ==== ==== - qiniu s3 + #### --box-box-sub-type -RackCorp -RackCorp Object Storage is an S3 compatible object storage platform from -your friendly cloud provider RackCorp. The service is fast, reliable, -well priced and located in many strategic locations unserviced by -others, to ensure you can maintain data sovereignty. -Before you can use RackCorp Object Storage, you'll need to "sign up" for -an account on our "portal". Next you can create an access key, a -secret key and buckets, in your location of choice with ease. These -details are required for the next steps of configuration, when -rclone config asks for your access_key_id and secret_access_key. + Properties: -Your config should end up looking a bit like this: + - Config: box_sub_type + - Env Var: RCLONE_BOX_BOX_SUB_TYPE + - Type: string + - Default: "user" + - Examples: + - "user" + - Rclone should act on behalf of a user. + - "enterprise" + - Rclone should act on behalf of a service account. - [RCS3-demo-config] - type = s3 - provider = RackCorp - env_auth = true - access_key_id = YOURACCESSKEY - secret_access_key = YOURSECRETACCESSKEY - region = au-nsw - endpoint = s3.rackcorp.com - location_constraint = au-nsw + ### Advanced options -Scaleway + Here are the Advanced options specific to box (Box). -Scaleway The Object Storage platform allows you to store anything from -backups, logs and web assets to documents and photos. Files can be -dropped from the Scaleway console or transferred through our API and CLI -or using any S3-compatible tool. + #### --box-token -Scaleway provides an S3 interface which can be configured for use with -rclone like this: + OAuth Access Token as a JSON blob. - [scaleway] - type = s3 - provider = Scaleway - env_auth = false - endpoint = s3.nl-ams.scw.cloud - access_key_id = SCWXXXXXXXXXXXXXX - secret_access_key = 1111111-2222-3333-44444-55555555555555 - region = nl-ams - location_constraint = - acl = private - server_side_encryption = - storage_class = + Properties: -C14 Cold Storage is the low-cost S3 Glacier alternative from Scaleway -and it works the same way as on S3 by accepting the "GLACIER" -storage_class. So you can configure your remote with the -storage_class = GLACIER option to upload directly to C14. Don't forget -that in this state you can't read files back after, you will need to -restore them to "STANDARD" storage_class first before being able to read -them (see "restore" section above) + - Config: token + - Env Var: RCLONE_BOX_TOKEN + - Type: string + - Required: false -Seagate Lyve Cloud + #### --box-auth-url -Seagate Lyve Cloud is an S3 compatible object storage platform from -Seagate intended for enterprise use. + Auth server URL. -Here is a config run through for a remote called remote - you may choose -a different name of course. Note that to create an access key and secret -key you will need to create a service account first. + Leave blank to use the provider defaults. - $ rclone config - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> remote + Properties: -Choose s3 backend + - Config: auth_url + - Env Var: RCLONE_BOX_AUTH_URL + - Type: string + - Required: false - Type of storage to configure. - Choose a number from below, or type in your own value. - [snip] - XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS - \ (s3) - [snip] - Storage> s3 + #### --box-token-url -Choose LyveCloud as S3 provider + Token server url. - Choose your S3 provider. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - [snip] - XX / Seagate Lyve Cloud - \ (LyveCloud) - [snip] - provider> LyveCloud + Leave blank to use the provider defaults. -Take the default (just press enter) to enter access key and secret in -the config file. + Properties: - Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). - Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) - env_auth> + - Config: token_url + - Env Var: RCLONE_BOX_TOKEN_URL + - Type: string + - Required: false - AWS Access Key ID. - Leave blank for anonymous access or runtime credentials. - Enter a value. Press Enter to leave empty. - access_key_id> XXX + #### --box-root-folder-id - AWS Secret Access Key (password). - Leave blank for anonymous access or runtime credentials. - Enter a value. Press Enter to leave empty. - secret_access_key> YYY + Fill in for rclone to use a non root folder as its starting point. -Leave region blank + Properties: - Region to connect to. - Leave blank if you are using an S3 clone and you don't have a region. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - / Use this if unsure. - 1 | Will use v4 signatures and an empty region. - \ () - / Use this only if v4 signatures don't work. - 2 | E.g. pre Jewel/v10 CEPH. - \ (other-v2-signature) - region> + - Config: root_folder_id + - Env Var: RCLONE_BOX_ROOT_FOLDER_ID + - Type: string + - Default: "0" -Choose an endpoint from the list + #### --box-upload-cutoff - Endpoint for S3 API. - Required when using an S3 clone. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - 1 / Seagate Lyve Cloud US East 1 (Virginia) - \ (s3.us-east-1.lyvecloud.seagate.com) - 2 / Seagate Lyve Cloud US West 1 (California) - \ (s3.us-west-1.lyvecloud.seagate.com) - 3 / Seagate Lyve Cloud AP Southeast 1 (Singapore) - \ (s3.ap-southeast-1.lyvecloud.seagate.com) - endpoint> 1 + Cutoff for switching to multipart upload (>= 50 MiB). -Leave location constraint blank + Properties: - Location constraint - must be set to match the Region. - Leave blank if not sure. Used when creating buckets only. - Enter a value. Press Enter to leave empty. - location_constraint> + - Config: upload_cutoff + - Env Var: RCLONE_BOX_UPLOAD_CUTOFF + - Type: SizeSuffix + - Default: 50Mi -Choose default ACL (private). + #### --box-commit-retries - Canned ACL used when creating buckets and storing or copying objects. - This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. - For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl - Note that this ACL is applied when server-side copying objects as S3 - doesn't copy the ACL from the source but rather writes a fresh one. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - / Owner gets FULL_CONTROL. - 1 | No one else has access rights (default). - \ (private) - [snip] - acl> + Max number of times to try committing a multipart file. -And the config file should end up looking like this: + Properties: - [remote] - type = s3 - provider = LyveCloud - access_key_id = XXX - secret_access_key = YYY - endpoint = s3.us-east-1.lyvecloud.seagate.com + - Config: commit_retries + - Env Var: RCLONE_BOX_COMMIT_RETRIES + - Type: int + - Default: 100 -SeaweedFS + #### --box-list-chunk -SeaweedFS is a distributed storage system for blobs, objects, files, and -data lake, with O(1) disk seek and a scalable file metadata store. It -has an S3 compatible object storage interface. SeaweedFS can also act as -a gateway to remote S3 compatible object store to cache data and -metadata with asynchronous write back, for fast local speed and minimize -access cost. + Size of listing chunk 1-1000. -Assuming the SeaweedFS are configured with weed shell as such: + Properties: - > s3.bucket.create -name foo - > s3.configure -access_key=any -secret_key=any -buckets=foo -user=me -actions=Read,Write,List,Tagging,Admin -apply - { - "identities": [ - { - "name": "me", - "credentials": [ - { - "accessKey": "any", - "secretKey": "any" - } - ], - "actions": [ - "Read:foo", - "Write:foo", - "List:foo", - "Tagging:foo", - "Admin:foo" - ] - } - ] - } + - Config: list_chunk + - Env Var: RCLONE_BOX_LIST_CHUNK + - Type: int + - Default: 1000 -To use rclone with SeaweedFS, above configuration should end up with -something like this in your config: + #### --box-owned-by - [seaweedfs_s3] - type = s3 - provider = SeaweedFS - access_key_id = any - secret_access_key = any - endpoint = localhost:8333 + Only show items owned by the login (email address) passed in. -So once set up, for example to copy files into a bucket + Properties: - rclone copy /path/to/files seaweedfs_s3:foo + - Config: owned_by + - Env Var: RCLONE_BOX_OWNED_BY + - Type: string + - Required: false -Wasabi + #### --box-impersonate -Wasabi is a cloud-based object storage service for a broad range of -applications and use cases. Wasabi is designed for individuals and -organizations that require a high-performance, reliable, and secure data -storage infrastructure at minimal cost. + Impersonate this user ID when using a service account. -Wasabi provides an S3 interface which can be configured for use with -rclone like this. + Setting this flag allows rclone, when using a JWT service account, to + act on behalf of another user by setting the as-user header. - No remotes found, make a new one? - n) New remote - s) Set configuration password - n/s> n - name> wasabi - Type of storage to configure. - Choose a number from below, or type in your own value - [snip] - XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Minio, Liara) - \ "s3" - [snip] - Storage> s3 - Get AWS credentials from runtime (environment variables or EC2/ECS 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> YOURACCESSKEY - AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. - secret_access_key> YOURSECRETACCESSKEY - 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" - [snip] - region> us-east-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> s3.wasabisys.com - 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. - \ "" - [snip] - location_constraint> - Canned ACL used when creating buckets and/or storing objects in S3. - For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl - Choose a number from below, or type in your own value - 1 / Owner gets FULL_CONTROL. No one else has access rights (default). - \ "private" - [snip] - acl> - The server-side encryption algorithm used when storing this object in S3. - Choose a number from below, or type in your own value - 1 / None - \ "" - 2 / AES256 - \ "AES256" - server_side_encryption> - The storage class to use when storing objects in S3. - Choose a number from below, or type in your own value - 1 / Default - \ "" - 2 / Standard storage class - \ "STANDARD" - 3 / Reduced redundancy storage class - \ "REDUCED_REDUNDANCY" - 4 / Standard Infrequent Access storage class - \ "STANDARD_IA" - storage_class> - Remote config - -------------------- - [wasabi] - env_auth = false - access_key_id = YOURACCESSKEY - secret_access_key = YOURSECRETACCESSKEY - region = us-east-1 - endpoint = s3.wasabisys.com - location_constraint = - acl = - server_side_encryption = - storage_class = - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + The user ID is the Box identifier for a user. User IDs can found for + any user via the GET /users endpoint, which is only available to + admins, or by calling the GET /users/me endpoint with an authenticated + user session. -This will leave the config file looking like this. + See: https://developer.box.com/guides/authentication/jwt/as-user/ - [wasabi] - type = s3 - provider = Wasabi - env_auth = false - access_key_id = YOURACCESSKEY - secret_access_key = YOURSECRETACCESSKEY - region = - endpoint = s3.wasabisys.com - location_constraint = - acl = - server_side_encryption = - storage_class = -Alibaba OSS + Properties: -Here is an example of making an Alibaba Cloud (Aliyun) OSS -configuration. First run: + - Config: impersonate + - Env Var: RCLONE_BOX_IMPERSONATE + - Type: string + - Required: false - rclone config + #### --box-encoding -This will guide you through an interactive setup process. + The encoding for the backend. - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> oss - Type of storage to configure. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - [snip] - 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Minio, and Tencent COS - \ "s3" - [snip] - Storage> s3 - Choose your S3 provider. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - 1 / Amazon Web Services (AWS) S3 - \ "AWS" - 2 / Alibaba Cloud Object Storage System (OSS) formerly Aliyun - \ "Alibaba" - 3 / Ceph Object Storage - \ "Ceph" - [snip] - provider> Alibaba - Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). - Only applies if access_key_id and secret_access_key is blank. - Enter a boolean value (true or false). Press Enter for the default ("false"). - 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. - Enter a string value. Press Enter for the default (""). - access_key_id> accesskeyid - AWS Secret Access Key (password) - Leave blank for anonymous access or runtime credentials. - Enter a string value. Press Enter for the default (""). - secret_access_key> secretaccesskey - Endpoint for OSS API. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - 1 / East China 1 (Hangzhou) - \ "oss-cn-hangzhou.aliyuncs.com" - 2 / East China 2 (Shanghai) - \ "oss-cn-shanghai.aliyuncs.com" - 3 / North China 1 (Qingdao) - \ "oss-cn-qingdao.aliyuncs.com" - [snip] - endpoint> 1 - Canned ACL used when creating buckets and storing or copying objects. + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. - Note that this ACL is applied when server-side copying objects as S3 - doesn't copy the ACL from the source but rather writes a fresh one. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - 1 / Owner gets FULL_CONTROL. No one else has access rights (default). - \ "private" - 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access. - \ "public-read" - / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. - [snip] - acl> 1 - The storage class to use when storing new objects in OSS. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - 1 / Default - \ "" - 2 / Standard storage class - \ "STANDARD" - 3 / Archive storage mode. - \ "GLACIER" - 4 / Infrequent access storage mode. - \ "STANDARD_IA" - storage_class> 1 - Edit advanced config? (y/n) - y) Yes - n) No - y/n> n - Remote config - -------------------- - [oss] - type = s3 - provider = Alibaba - env_auth = false - access_key_id = accesskeyid - secret_access_key = secretaccesskey - endpoint = oss-cn-hangzhou.aliyuncs.com - acl = private - storage_class = Standard - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + Properties: -China Mobile Ecloud Elastic Object Storage (EOS) + - Config: encoding + - Env Var: RCLONE_BOX_ENCODING + - Type: Encoding + - Default: Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot -Here is an example of making an China Mobile Ecloud Elastic Object -Storage (EOS) configuration. First run: - rclone config -This will guide you through an interactive setup process. + ## Limitations - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n - name> ChinaMobile - Option Storage. - Type of storage to configure. - Choose a number from below, or type in your own value. - ... - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS - \ (s3) - ... - Storage> s3 - Option provider. - Choose your S3 provider. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - ... - 4 / China Mobile Ecloud Elastic Object Storage (EOS) - \ (ChinaMobile) - ... - provider> ChinaMobile - Option env_auth. - Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). - Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) - env_auth> - Option access_key_id. - AWS Access Key ID. - Leave blank for anonymous access or runtime credentials. - Enter a value. Press Enter to leave empty. - access_key_id> accesskeyid - Option secret_access_key. - AWS Secret Access Key (password). - Leave blank for anonymous access or runtime credentials. - Enter a value. Press Enter to leave empty. - secret_access_key> secretaccesskey - Option endpoint. - Endpoint for China Mobile Ecloud Elastic Object Storage (EOS) API. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - / The default endpoint - a good choice if you are unsure. - 1 | East China (Suzhou) - \ (eos-wuxi-1.cmecloud.cn) - 2 / East China (Jinan) - \ (eos-jinan-1.cmecloud.cn) - 3 / East China (Hangzhou) - \ (eos-ningbo-1.cmecloud.cn) - 4 / East China (Shanghai-1) - \ (eos-shanghai-1.cmecloud.cn) - 5 / Central China (Zhengzhou) - \ (eos-zhengzhou-1.cmecloud.cn) - 6 / Central China (Changsha-1) - \ (eos-hunan-1.cmecloud.cn) - 7 / Central China (Changsha-2) - \ (eos-zhuzhou-1.cmecloud.cn) - 8 / South China (Guangzhou-2) - \ (eos-guangzhou-1.cmecloud.cn) - 9 / South China (Guangzhou-3) - \ (eos-dongguan-1.cmecloud.cn) - 10 / North China (Beijing-1) - \ (eos-beijing-1.cmecloud.cn) - 11 / North China (Beijing-2) - \ (eos-beijing-2.cmecloud.cn) - 12 / North China (Beijing-3) - \ (eos-beijing-4.cmecloud.cn) - 13 / North China (Huhehaote) - \ (eos-huhehaote-1.cmecloud.cn) - 14 / Southwest China (Chengdu) - \ (eos-chengdu-1.cmecloud.cn) - 15 / Southwest China (Chongqing) - \ (eos-chongqing-1.cmecloud.cn) - 16 / Southwest China (Guiyang) - \ (eos-guiyang-1.cmecloud.cn) - 17 / Nouthwest China (Xian) - \ (eos-xian-1.cmecloud.cn) - 18 / Yunnan China (Kunming) - \ (eos-yunnan.cmecloud.cn) - 19 / Yunnan China (Kunming-2) - \ (eos-yunnan-2.cmecloud.cn) - 20 / Tianjin China (Tianjin) - \ (eos-tianjin-1.cmecloud.cn) - 21 / Jilin China (Changchun) - \ (eos-jilin-1.cmecloud.cn) - 22 / Hubei China (Xiangyan) - \ (eos-hubei-1.cmecloud.cn) - 23 / Jiangxi China (Nanchang) - \ (eos-jiangxi-1.cmecloud.cn) - 24 / Gansu China (Lanzhou) - \ (eos-gansu-1.cmecloud.cn) - 25 / Shanxi China (Taiyuan) - \ (eos-shanxi-1.cmecloud.cn) - 26 / Liaoning China (Shenyang) - \ (eos-liaoning-1.cmecloud.cn) - 27 / Hebei China (Shijiazhuang) - \ (eos-hebei-1.cmecloud.cn) - 28 / Fujian China (Xiamen) - \ (eos-fujian-1.cmecloud.cn) - 29 / Guangxi China (Nanning) - \ (eos-guangxi-1.cmecloud.cn) - 30 / Anhui China (Huainan) - \ (eos-anhui-1.cmecloud.cn) - endpoint> 1 - Option location_constraint. - Location constraint - must match endpoint. - Used when creating buckets only. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - 1 / East China (Suzhou) - \ (wuxi1) - 2 / East China (Jinan) - \ (jinan1) - 3 / East China (Hangzhou) - \ (ningbo1) - 4 / East China (Shanghai-1) - \ (shanghai1) - 5 / Central China (Zhengzhou) - \ (zhengzhou1) - 6 / Central China (Changsha-1) - \ (hunan1) - 7 / Central China (Changsha-2) - \ (zhuzhou1) - 8 / South China (Guangzhou-2) - \ (guangzhou1) - 9 / South China (Guangzhou-3) - \ (dongguan1) - 10 / North China (Beijing-1) - \ (beijing1) - 11 / North China (Beijing-2) - \ (beijing2) - 12 / North China (Beijing-3) - \ (beijing4) - 13 / North China (Huhehaote) - \ (huhehaote1) - 14 / Southwest China (Chengdu) - \ (chengdu1) - 15 / Southwest China (Chongqing) - \ (chongqing1) - 16 / Southwest China (Guiyang) - \ (guiyang1) - 17 / Nouthwest China (Xian) - \ (xian1) - 18 / Yunnan China (Kunming) - \ (yunnan) - 19 / Yunnan China (Kunming-2) - \ (yunnan2) - 20 / Tianjin China (Tianjin) - \ (tianjin1) - 21 / Jilin China (Changchun) - \ (jilin1) - 22 / Hubei China (Xiangyan) - \ (hubei1) - 23 / Jiangxi China (Nanchang) - \ (jiangxi1) - 24 / Gansu China (Lanzhou) - \ (gansu1) - 25 / Shanxi China (Taiyuan) - \ (shanxi1) - 26 / Liaoning China (Shenyang) - \ (liaoning1) - 27 / Hebei China (Shijiazhuang) - \ (hebei1) - 28 / Fujian China (Xiamen) - \ (fujian1) - 29 / Guangxi China (Nanning) - \ (guangxi1) - 30 / Anhui China (Huainan) - \ (anhui1) - location_constraint> 1 - Option acl. - Canned ACL used when creating buckets and storing or copying objects. - This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. - For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl - Note that this ACL is applied when server-side copying objects as S3 - doesn't copy the ACL from the source but rather writes a fresh one. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - / Owner gets FULL_CONTROL. - 1 | No one else has access rights (default). - \ (private) - / Owner gets FULL_CONTROL. - 2 | The AllUsers group gets READ access. - \ (public-read) - / Owner gets FULL_CONTROL. - 3 | The AllUsers group gets READ and WRITE access. - | Granting this on a bucket is generally not recommended. - \ (public-read-write) - / Owner gets FULL_CONTROL. - 4 | The AuthenticatedUsers group gets READ access. - \ (authenticated-read) - / Object owner gets FULL_CONTROL. - acl> private - Option server_side_encryption. - The server-side encryption algorithm used when storing this object in S3. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - 1 / None - \ () - 2 / AES256 - \ (AES256) - server_side_encryption> - Option storage_class. - The storage class to use when storing new objects in ChinaMobile. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - 1 / Default - \ () - 2 / Standard storage class - \ (STANDARD) - 3 / Archive storage mode - \ (GLACIER) - 4 / Infrequent access storage mode - \ (STANDARD_IA) - storage_class> - Edit advanced config? - y) Yes - n) No (default) - y/n> n - -------------------- - [ChinaMobile] - type = s3 - provider = ChinaMobile - access_key_id = accesskeyid - secret_access_key = secretaccesskey - endpoint = eos-wuxi-1.cmecloud.cn - location_constraint = wuxi1 - acl = private - -------------------- - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y + Note that Box is case insensitive so you can't have a file called + "Hello.doc" and one called "hello.doc". -Leviia Cloud Object Storage + Box file names can't have the `\` character in. rclone maps this to + and from an identical looking unicode equivalent `\` (U+FF3C Fullwidth + Reverse Solidus). -Leviia Object Storage, backup and secure your data in a 100% French -cloud, independent of GAFAM.. + Box only supports filenames up to 255 characters in length. -To configure access to Leviia, follow the steps below: + Box has [API rate limits](https://developer.box.com/guides/api-calls/permissions-and-errors/rate-limits/) that sometimes reduce the speed of rclone. -1. Run rclone config and select n for a new remote. + `rclone about` is not supported by the Box backend. Backends without + this capability cannot determine free space for an rclone mount or + use policy `mfs` (most free space) as a member of an rclone union + remote. - rclone config - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n + See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -2. Give the name of the configuration. For example, name it 'leviia'. + ## Get your own Box App ID - name> leviia + Here is how to create your own Box App ID for rclone: -3. Select s3 storage. + 1. Go to the [Box Developer Console](https://app.box.com/developers/console) + and login, then click `My Apps` on the sidebar. Click `Create New App` + and select `Custom App`. - Choose a number from below, or type in your own value - 1 / 1Fichier - \ (fichier) - 2 / Akamai NetStorage - \ (netstorage) - 3 / Alias for an existing remote - \ (alias) - 4 / Amazon Drive - \ (amazon cloud drive) - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi - \ (s3) - [snip] - Storage> s3 + 2. In the first screen on the box that pops up, you can pretty much enter + whatever you want. The `App Name` can be whatever. For `Purpose` choose + automation to avoid having to fill out anything else. Click `Next`. + + 3. In the second screen of the creation screen, select + `User Authentication (OAuth 2.0)`. Then click `Create App`. -4. Select Leviia provider. + 4. You should now be on the `Configuration` tab of your new app. If not, + click on it at the top of the webpage. Copy down `Client ID` + and `Client Secret`, you'll need those for rclone. - Choose a number from below, or type in your own value - 1 / Amazon Web Services (AWS) S3 - \ "AWS" - [snip] - 15 / Leviia Object Storage - \ (Leviia) - [snip] - provider> Leviia + 5. Under "OAuth 2.0 Redirect URI", add `http://127.0.0.1:53682/` -5. Enter your SecretId and SecretKey of Leviia. + 6. For `Application Scopes`, select `Read all files and folders stored in Box` + and `Write all files and folders stored in box` (assuming you want to do both). + Leave others unchecked. Click `Save Changes` at the top right. - Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). - Only applies if access_key_id and secret_access_key is blank. - Enter a boolean value (true or false). Press Enter for the default ("false"). - 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. - Enter a string value. Press Enter for the default (""). - access_key_id> ZnIx.xxxxxxxxxxxxxxx - AWS Secret Access Key (password) - Leave blank for anonymous access or runtime credentials. - Enter a string value. Press Enter for the default (""). - secret_access_key> xxxxxxxxxxx + # Cache -6. Select endpoint for Leviia. + The `cache` remote wraps another existing remote and stores file structure + and its data for long running tasks like `rclone mount`. - / The default endpoint - 1 | Leviia. - \ (s3.leviia.com) - [snip] - endpoint> 1 + ## Status -7. Choose acl. + The cache backend code is working but it currently doesn't + have a maintainer so there are [outstanding bugs](https://github.com/rclone/rclone/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3A%22Remote%3A+Cache%22) which aren't getting fixed. - Note that this ACL is applied when server-side copying objects as S3 - doesn't copy the ACL from the source but rather writes a fresh one. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - / Owner gets FULL_CONTROL. - 1 | No one else has access rights (default). - \ (private) - / Owner gets FULL_CONTROL. - 2 | The AllUsers group gets READ access. - \ (public-read) - [snip] - acl> 1 - Edit advanced config? (y/n) - y) Yes - n) No (default) - y/n> n - Remote config - -------------------- - [leviia] - - type: s3 - - provider: Leviia - - access_key_id: ZnIx.xxxxxxx - - secret_access_key: xxxxxxxx - - endpoint: s3.leviia.com - - acl: private - -------------------- - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y - Current remotes: + The cache backend is due to be phased out in favour of the VFS caching + layer eventually which is more tightly integrated into rclone. - Name Type - ==== ==== - leviia s3 + Until this happens we recommend only using the cache backend if you + find you can't work without it. There are many docs online describing + the use of the cache backend to minimize API hits and by-and-large + these are out of date and the cache backend isn't needed in those + scenarios any more. -Liara + ## Configuration -Here is an example of making a Liara Object Storage configuration. First -run: + To get started you just need to have an existing remote which can be configured + with `cache`. - rclone config + Here is an example of how to make a remote called `test-cache`. First run: -This will guide you through an interactive setup process. + rclone config - No remotes found, make a new one? - n) New remote - s) Set configuration password - n/s> n - name> Liara - Type of storage to configure. - Choose a number from below, or type in your own value - [snip] - XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Liara, Minio) - \ "s3" - [snip] - Storage> s3 - Get AWS credentials from runtime (environment variables or EC2/ECS 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> YOURACCESSKEY - AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. - secret_access_key> YOURSECRETACCESSKEY - Region to connect to. - Choose a number from below, or type in your own value - / The default endpoint - 1 | US Region, Northern Virginia, or Pacific Northwest. - | Leave location constraint empty. - \ "us-east-1" - [snip] - region> - Endpoint for S3 API. - Leave blank if using Liara to use the default endpoint for the region. - Specify if using an S3 clone such as Ceph. - endpoint> storage.iran.liara.space - Canned ACL used when creating buckets and/or storing objects in S3. - For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl - Choose a number from below, or type in your own value - 1 / Owner gets FULL_CONTROL. No one else has access rights (default). - \ "private" - [snip] - acl> - The server-side encryption algorithm used when storing this object in S3. - Choose a number from below, or type in your own value - 1 / None - \ "" - 2 / AES256 - \ "AES256" - server_side_encryption> - The storage class to use when storing objects in S3. - Choose a number from below, or type in your own value - 1 / Default - \ "" - 2 / Standard storage class - \ "STANDARD" - storage_class> - Remote config - -------------------- - [Liara] - env_auth = false - access_key_id = YOURACCESSKEY - secret_access_key = YOURSECRETACCESSKEY - endpoint = storage.iran.liara.space - location_constraint = - acl = - server_side_encryption = - storage_class = - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + This will guide you through an interactive setup process: -This will leave the config file looking like this. +No remotes found, make a new one? n) New remote r) Rename remote c) Copy +remote s) Set configuration password q) Quit config n/r/c/s/q> n name> +test-cache Type of storage to configure. Choose a number from below, or +type in your own value [snip] XX / Cache a remote  "cache" [snip] +Storage> cache Remote to cache. Normally should contain a ':' and a +path, e.g. "myremote:path/to/dir", "myremote:bucket" or maybe +"myremote:" (not recommended). remote> local:/test Optional: The URL of +the Plex server plex_url> http://127.0.0.1:32400 Optional: The username +of the Plex user plex_username> dummyusername Optional: The password of +the Plex user y) Yes type in my own password g) Generate random password +n) No leave this optional password blank y/g/n> y Enter the password: +password: Confirm the password: password: The size of a chunk. Lower +value good for slow connections but can affect seamless reading. +Default: 5M Choose a number from below, or type in your own value 1 / 1 +MiB  "1M" 2 / 5 MiB  "5M" 3 / 10 MiB  "10M" chunk_size> 2 How much time +should object info (file size, file hashes, etc.) be stored in cache. +Use a very high value if you don't plan on changing the source FS from +outside the cache. Accepted units are: "s", "m", "h". Default: 5m Choose +a number from below, or type in your own value 1 / 1 hour  "1h" 2 / 24 +hours  "24h" 3 / 24 hours  "48h" info_age> 2 The maximum size of stored +chunks. When the storage grows beyond this size, the oldest chunks will +be deleted. Default: 10G Choose a number from below, or type in your own +value 1 / 500 MiB  "500M" 2 / 1 GiB  "1G" 3 / 10 GiB  "10G" +chunk_total_size> 3 Remote config -------------------- [test-cache] +remote = local:/test plex_url = http://127.0.0.1:32400 plex_username = +dummyusername plex_password = *** ENCRYPTED *** chunk_size = 5M info_age += 48h chunk_total_size = 10G - [Liara] - type = s3 - provider = Liara - env_auth = false - access_key_id = YOURACCESSKEY - secret_access_key = YOURSECRETACCESSKEY - region = - endpoint = storage.iran.liara.space - location_constraint = - acl = - server_side_encryption = - storage_class = -ArvanCloud + You can then use it like this, -ArvanCloud ArvanCloud Object Storage goes beyond the limited traditional -file storage. It gives you access to backup and archived files and -allows sharing. Files like profile image in the app, images sent by -users or scanned documents can be stored securely and easily in our -Object Storage service. + List directories in top level of your drive -ArvanCloud provides an S3 interface which can be configured for use with -rclone like this. + rclone lsd test-cache: - No remotes found, make a new one? - n) New remote - s) Set configuration password - n/s> n - name> ArvanCloud - Type of storage to configure. - Choose a number from below, or type in your own value - [snip] - XX / Amazon S3 (also Dreamhost, Ceph, ChinaMobile, ArvanCloud, Liara, Minio) - \ "s3" - [snip] - Storage> s3 - Get AWS credentials from runtime (environment variables or EC2/ECS 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> YOURACCESSKEY - AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. - secret_access_key> YOURSECRETACCESSKEY - 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" - [snip] - region> - Endpoint for S3 API. - Leave blank if using ArvanCloud to use the default endpoint for the region. - Specify if using an S3 clone such as Ceph. - endpoint> s3.arvanstorage.com - 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 Iran-Tehran Region. - \ "" - [snip] - location_constraint> - Canned ACL used when creating buckets and/or storing objects in S3. - For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl - Choose a number from below, or type in your own value - 1 / Owner gets FULL_CONTROL. No one else has access rights (default). - \ "private" - [snip] - acl> - The server-side encryption algorithm used when storing this object in S3. - Choose a number from below, or type in your own value - 1 / None - \ "" - 2 / AES256 - \ "AES256" - server_side_encryption> - The storage class to use when storing objects in S3. - Choose a number from below, or type in your own value - 1 / Default - \ "" - 2 / Standard storage class - \ "STANDARD" - storage_class> - Remote config - -------------------- - [ArvanCloud] - env_auth = false - access_key_id = YOURACCESSKEY - secret_access_key = YOURSECRETACCESSKEY - region = ir-thr-at1 - endpoint = s3.arvanstorage.com - location_constraint = - acl = - server_side_encryption = - storage_class = - -------------------- - y) Yes this is OK - e) Edit this remote - d) Delete this remote - y/e/d> y + List all the files in your drive -This will leave the config file looking like this. + rclone ls test-cache: - [ArvanCloud] - type = s3 - provider = ArvanCloud - env_auth = false - access_key_id = YOURACCESSKEY - secret_access_key = YOURSECRETACCESSKEY - region = - endpoint = s3.arvanstorage.com - location_constraint = - acl = - server_side_encryption = - storage_class = + To start a cached mount -Tencent COS + rclone mount --allow-other test-cache: /var/tmp/test-cache -Tencent Cloud Object Storage (COS) is a distributed storage service -offered by Tencent Cloud for unstructured data. It is secure, stable, -massive, convenient, low-delay and low-cost. + ### Write Features ### -To configure access to Tencent COS, follow the steps below: + ### Offline uploading ### -1. Run rclone config and select n for a new remote. + In an effort to make writing through cache more reliable, the backend + now supports this feature which can be activated by specifying a + `cache-tmp-upload-path`. - rclone config - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config - n/s/q> n + A files goes through these states when using this feature: -2. Give the name of the configuration. For example, name it 'cos'. + 1. An upload is started (usually by copying a file on the cache remote) + 2. When the copy to the temporary location is complete the file is part + of the cached remote and looks and behaves like any other file (reading included) + 3. After `cache-tmp-wait-time` passes and the file is next in line, `rclone move` + is used to move the file to the cloud provider + 4. Reading the file still works during the upload but most modifications on it will be prohibited + 5. Once the move is complete the file is unlocked for modifications as it + becomes as any other regular file + 6. If the file is being read through `cache` when it's actually + deleted from the temporary path then `cache` will simply swap the source + to the cloud provider without interrupting the reading (small blip can happen though) - name> cos + Files are uploaded in sequence and only one file is uploaded at a time. + Uploads will be stored in a queue and be processed based on the order they were added. + The queue and the temporary storage is persistent across restarts but + can be cleared on startup with the `--cache-db-purge` flag. -3. Select s3 storage. + ### Write Support ### - Choose a number from below, or type in your own value - 1 / 1Fichier - \ "fichier" - 2 / Alias for an existing remote - \ "alias" - 3 / Amazon Drive - \ "amazon cloud drive" - 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Minio, and Tencent COS - \ "s3" - [snip] - Storage> s3 + Writes are supported through `cache`. + One caveat is that a mounted cache remote does not add any retry or fallback + mechanism to the upload operation. This will depend on the implementation + of the wrapped remote. Consider using `Offline uploading` for reliable writes. -4. Select TencentCOS provider. + One special case is covered with `cache-writes` which will cache the file + data at the same time as the upload when it is enabled making it available + from the cache store immediately once the upload is finished. - Choose a number from below, or type in your own value - 1 / Amazon Web Services (AWS) S3 - \ "AWS" - [snip] - 11 / Tencent Cloud Object Storage (COS) - \ "TencentCOS" - [snip] - provider> TencentCOS + ### Read Features ### -5. Enter your SecretId and SecretKey of Tencent Cloud. + #### Multiple connections #### - Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). - Only applies if access_key_id and secret_access_key is blank. - Enter a boolean value (true or false). Press Enter for the default ("false"). - 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. - Enter a string value. Press Enter for the default (""). - access_key_id> AKIDxxxxxxxxxx - AWS Secret Access Key (password) - Leave blank for anonymous access or runtime credentials. - Enter a string value. Press Enter for the default (""). - secret_access_key> xxxxxxxxxxx + To counter the high latency between a local PC where rclone is running + and cloud providers, the cache remote can split multiple requests to the + cloud provider for smaller file chunks and combines them together locally + where they can be available almost immediately before the reader usually + needs them. -6. Select endpoint for Tencent COS. This is the standard endpoint for - different region. + This is similar to buffering when media files are played online. Rclone + will stay around the current marker but always try its best to stay ahead + and prepare the data before. - 1 / Beijing Region. - \ "cos.ap-beijing.myqcloud.com" - 2 / Nanjing Region. - \ "cos.ap-nanjing.myqcloud.com" - 3 / Shanghai Region. - \ "cos.ap-shanghai.myqcloud.com" - 4 / Guangzhou Region. - \ "cos.ap-guangzhou.myqcloud.com" - [snip] - endpoint> 4 + #### Plex Integration #### -7. Choose acl and storage class. + There is a direct integration with Plex which allows cache to detect during reading + if the file is in playback or not. This helps cache to adapt how it queries + the cloud provider depending on what is needed for. - Note that this ACL is applied when server-side copying objects as S3 - doesn't copy the ACL from the source but rather writes a fresh one. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - 1 / Owner gets Full_CONTROL. No one else has access rights (default). - \ "default" - [snip] - acl> 1 - The storage class to use when storing new objects in Tencent COS. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - 1 / Default - \ "" - [snip] - storage_class> 1 - Edit advanced config? (y/n) - y) Yes - n) No (default) - y/n> n - Remote config - -------------------- - [cos] - type = s3 - provider = TencentCOS - env_auth = false - access_key_id = xxx - secret_access_key = xxx - endpoint = cos.ap-guangzhou.myqcloud.com - acl = default - -------------------- - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y - Current remotes: + Scans will have a minimum amount of workers (1) while in a confirmed playback cache + will deploy the configured number of workers. - Name Type - ==== ==== - cos s3 + This integration opens the doorway to additional performance improvements + which will be explored in the near future. -Netease NOS + **Note:** If Plex options are not configured, `cache` will function with its + configured options without adapting any of its settings. -For Netease NOS configure as per the configurator rclone config setting -the provider Netease. This will automatically set -force_path_style = false which is necessary for it to run properly. + How to enable? Run `rclone config` and add all the Plex options (endpoint, username + and password) in your remote and it will be automatically enabled. -Petabox + Affected settings: + - `cache-workers`: _Configured value_ during confirmed playback or _1_ all the other times -Here is an example of making a Petabox configuration. First run: + ##### Certificate Validation ##### - rclone config + When the Plex server is configured to only accept secure connections, it is + possible to use `.plex.direct` URLs to ensure certificate validation succeeds. + These URLs are used by Plex internally to connect to the Plex server securely. -This will guide you through an interactive setup process. + The format for these URLs is the following: - No remotes found, make a new one? - n) New remote - s) Set configuration password - n/s> n + `https://ip-with-dots-replaced.server-hash.plex.direct:32400/` - Enter name for new remote. - name> My Petabox Storage + The `ip-with-dots-replaced` part can be any IPv4 address, where the dots + have been replaced with dashes, e.g. `127.0.0.1` becomes `127-0-0-1`. - Option Storage. - Type of storage to configure. - Choose a number from below, or type in your own value. - [snip] - XX / Amazon S3 Compliant Storage Providers including AWS, ... - \ "s3" - [snip] - Storage> s3 + To get the `server-hash` part, the easiest way is to visit + + https://plex.tv/api/resources?includeHttps=1&X-Plex-Token=your-plex-token + + This page will list all the available Plex servers for your account + with at least one `.plex.direct` link for each. Copy one URL and replace + the IP address with the desired address. This can be used as the + `plex_url` value. - Option provider. - Choose your S3 provider. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - [snip] - XX / Petabox Object Storage - \ (Petabox) - [snip] - provider> Petabox + ### Known issues ### - Option env_auth. - Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). - Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) - env_auth> 1 + #### Mount and --dir-cache-time #### - Option access_key_id. - AWS Access Key ID. - Leave blank for anonymous access or runtime credentials. - Enter a value. Press Enter to leave empty. - access_key_id> YOUR_ACCESS_KEY_ID + --dir-cache-time controls the first layer of directory caching which works at the mount layer. + Being an independent caching mechanism from the `cache` backend, it will manage its own entries + based on the configured time. - Option secret_access_key. - AWS Secret Access Key (password). - Leave blank for anonymous access or runtime credentials. - Enter a value. Press Enter to leave empty. - secret_access_key> YOUR_SECRET_ACCESS_KEY + To avoid getting in a scenario where dir cache has obsolete data and cache would have the correct + one, try to set `--dir-cache-time` to a lower time than `--cache-info-age`. Default values are + already configured in this way. - Option region. - Region where your bucket will be created and your data stored. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - 1 / US East (N. Virginia) - \ (us-east-1) - 2 / Europe (Frankfurt) - \ (eu-central-1) - 3 / Asia Pacific (Singapore) - \ (ap-southeast-1) - 4 / Middle East (Bahrain) - \ (me-south-1) - 5 / South America (São Paulo) - \ (sa-east-1) - region> 1 + #### Windows support - Experimental #### - Option endpoint. - Endpoint for Petabox S3 Object Storage. - Specify the endpoint from the same region. - Choose a number from below, or type in your own value. - 1 / US East (N. Virginia) - \ (s3.petabox.io) - 2 / US East (N. Virginia) - \ (s3.us-east-1.petabox.io) - 3 / Europe (Frankfurt) - \ (s3.eu-central-1.petabox.io) - 4 / Asia Pacific (Singapore) - \ (s3.ap-southeast-1.petabox.io) - 5 / Middle East (Bahrain) - \ (s3.me-south-1.petabox.io) - 6 / South America (São Paulo) - \ (s3.sa-east-1.petabox.io) - endpoint> 1 + There are a couple of issues with Windows `mount` functionality that still require some investigations. + It should be considered as experimental thus far as fixes come in for this OS. - Option acl. - Canned ACL used when creating buckets and storing or copying objects. - This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too. - For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl - Note that this ACL is applied when server-side copying objects as S3 - doesn't copy the ACL from the source but rather writes a fresh one. - If the acl is an empty string then no X-Amz-Acl: header is added and - the default (private) will be used. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - / Owner gets FULL_CONTROL. - 1 | No one else has access rights (default). - \ (private) - / Owner gets FULL_CONTROL. - 2 | The AllUsers group gets READ access. - \ (public-read) - / Owner gets FULL_CONTROL. - 3 | The AllUsers group gets READ and WRITE access. - | Granting this on a bucket is generally not recommended. - \ (public-read-write) - / Owner gets FULL_CONTROL. - 4 | The AuthenticatedUsers group gets READ access. - \ (authenticated-read) - / Object owner gets FULL_CONTROL. - 5 | Bucket owner gets READ access. - | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. - \ (bucket-owner-read) - / Both the object owner and the bucket owner get FULL_CONTROL over the object. - 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. - \ (bucket-owner-full-control) - acl> 1 + Most of the issues seem to be related to the difference between filesystems + on Linux flavors and Windows as cache is heavily dependent on them. - Edit advanced config? - y) Yes - n) No (default) - y/n> No + Any reports or feedback on how cache behaves on this OS is greatly appreciated. + + - https://github.com/rclone/rclone/issues/1935 + - https://github.com/rclone/rclone/issues/1907 + - https://github.com/rclone/rclone/issues/1834 - Configuration complete. - Options: - - type: s3 - - provider: Petabox - - access_key_id: YOUR_ACCESS_KEY_ID - - secret_access_key: YOUR_SECRET_ACCESS_KEY - - region: us-east-1 - - endpoint: s3.petabox.io - Keep this "My Petabox Storage" remote? - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote - y/e/d> y + #### Risk of throttling #### -This will leave the config file looking like this. + Future iterations of the cache backend will make use of the pooling functionality + of the cloud provider to synchronize and at the same time make writing through it + more tolerant to failures. - [My Petabox Storage] - type = s3 - provider = Petabox - access_key_id = YOUR_ACCESS_KEY_ID - secret_access_key = YOUR_SECRET_ACCESS_KEY - region = us-east-1 - endpoint = s3.petabox.io + There are a couple of enhancements in track to add these but in the meantime + there is a valid concern that the expiring cache listings can lead to cloud provider + throttles or bans due to repeated queries on it for very large mounts. -Storj + Some recommendations: + - don't use a very small interval for entry information (`--cache-info-age`) + - while writes aren't yet optimised, you can still write through `cache` which gives you the advantage + of adding the file in the cache at the same time if configured to do so. -Storj is a decentralized cloud storage which can be used through its -native protocol or an S3 compatible gateway. + Future enhancements: -The S3 compatible gateway is configured using rclone config with a type -of s3 and with a provider name of Storj. Here is an example run of the -configurator. + - https://github.com/rclone/rclone/issues/1937 + - https://github.com/rclone/rclone/issues/1936 - Type of storage to configure. - Storage> s3 - Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). - Press Enter for the default (false). - 1 / Enter AWS credentials in the next step. - \ (false) - 2 / Get AWS credentials from the environment (env vars or IAM). - \ (true) - env_auth> 1 - Option access_key_id. - AWS Access Key ID. - Leave blank for anonymous access or runtime credentials. - Enter a value. Press Enter to leave empty. - access_key_id> XXXX (as shown when creating the access grant) - Option secret_access_key. - AWS Secret Access Key (password). - Leave blank for anonymous access or runtime credentials. - Enter a value. Press Enter to leave empty. - secret_access_key> XXXX (as shown when creating the access grant) - Option endpoint. - Endpoint of the Shared Gateway. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - 1 / EU1 Shared Gateway - \ (gateway.eu1.storjshare.io) - 2 / US1 Shared Gateway - \ (gateway.us1.storjshare.io) - 3 / Asia-Pacific Shared Gateway - \ (gateway.ap1.storjshare.io) - endpoint> 1 (as shown when creating the access grant) - Edit advanced config? - y) Yes - n) No (default) - y/n> n + #### cache and crypt #### -Note that s3 credentials are generated when you create an access grant. + One common scenario is to keep your data encrypted in the cloud provider + using the `crypt` remote. `crypt` uses a similar technique to wrap around + an existing remote and handles this translation in a seamless way. -Backend quirks + There is an issue with wrapping the remotes in this order: + **cloud remote** -> **crypt** -> **cache** -- --chunk-size is forced to be 64 MiB or greater. This will use more - memory than the default of 5 MiB. -- Server side copy is disabled as it isn't currently supported in the - gateway. -- GetTier and SetTier are not supported. + During testing, I experienced a lot of bans with the remotes in this order. + I suspect it might be related to how crypt opens files on the cloud provider + which makes it think we're downloading the full file instead of small chunks. + Organizing the remotes in this order yields better results: + **cloud remote** -> **cache** -> **crypt** -Backend bugs + #### absolute remote paths #### -Due to issue #39 uploading multipart files via the S3 gateway causes -them to lose their metadata. For rclone's purpose this means that the -modification time is not stored, nor is any MD5SUM (if one is available -from the source). + `cache` can not differentiate between relative and absolute paths for the wrapped remote. + Any path given in the `remote` config setting and on the command line will be passed to + the wrapped remote as is, but for storing the chunks on disk the path will be made + relative by removing any leading `/` character. -This has the following consequences: + This behavior is irrelevant for most backend types, but there are backends where a leading `/` + changes the effective directory, e.g. in the `sftp` backend paths starting with a `/` are + relative to the root of the SSH server and paths without are relative to the user home directory. + As a result `sftp:bin` and `sftp:/bin` will share the same cache folder, even if they represent + a different directory on the SSH server. -- Using rclone rcat will fail as the medatada doesn't match after - upload -- Uploading files with rclone mount will fail for the same reason - - This can worked around by using --vfs-cache-mode writes or - --vfs-cache-mode full or setting --s3-upload-cutoff large -- Files uploaded via a multipart upload won't have their modtimes - - This will mean that rclone sync will likely keep trying to - upload files bigger than --s3-upload-cutoff - - This can be worked around with --checksum or --size-only or - setting --s3-upload-cutoff large - - The maximum value for --s3-upload-cutoff is 5GiB though + ### Cache and Remote Control (--rc) ### + Cache supports the new `--rc` mode in rclone and can be remote controlled through the following end points: + By default, the listener is disabled if you do not add the flag. -One general purpose workaround is to set --s3-upload-cutoff 5G. This -means that rclone will upload files smaller than 5GiB as single parts. -Note that this can be set in the config file with upload_cutoff = 5G or -configured in the advanced settings. If you regularly transfer files -larger than 5G then using --checksum or --size-only in rclone sync is -the recommended workaround. + ### rc cache/expire + Purge a remote from the cache backend. Supports either a directory or a file. + It supports both encrypted and unencrypted file names if cache is wrapped by crypt. -Comparison with the native protocol + Params: + - **remote** = path to remote **(required)** + - **withData** = true/false to delete cached data (chunks) as well _(optional, false by default)_ -Use the the native protocol to take advantage of client-side encryption -as well as to achieve the best possible download performance. Uploads -will be erasure-coded locally, thus a 1gb upload will result in 2.68gb -of data being uploaded to storage nodes across the network. -Use this backend and the S3 compatible Hosted Gateway to increase upload -performance and reduce the load on your systems and network. Uploads -will be encrypted and erasure-coded server-side, thus a 1GB upload will -result in only in 1GB of data being uploaded to storage nodes across the -network. + ### Standard options -For more detailed comparison please check the documentation of the storj -backend. + Here are the Standard options specific to cache (Cache a remote). -Limitations + #### --cache-remote -rclone about is not supported by the S3 backend. Backends without this -capability cannot determine free space for an rclone mount or use policy -mfs (most free space) as a member of an rclone union remote. + Remote to cache. -See List of backends that do not support rclone about and rclone about + Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", + "myremote:bucket" or maybe "myremote:" (not recommended). -Synology C2 Object Storage + Properties: -Synology C2 Object Storage provides a secure, S3-compatible, and -cost-effective cloud storage solution without API request, download -fees, and deletion penalty. + - Config: remote + - Env Var: RCLONE_CACHE_REMOTE + - Type: string + - Required: true -The S3 compatible gateway is configured using rclone config with a type -of s3 and with a provider name of Synology. Here is an example run of -the configurator. + #### --cache-plex-url -First run: + The URL of the Plex server. - rclone config + Properties: -This will guide you through an interactive setup process. + - Config: plex_url + - Env Var: RCLONE_CACHE_PLEX_URL + - Type: string + - Required: false - No remotes found, make a new one? - n) New remote - s) Set configuration password - q) Quit config + #### --cache-plex-username - n/s/q> n + The username of the Plex user. - Enter name for new remote.1 - name> syno + Properties: - Type of storage to configure. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value + - Config: plex_username + - Env Var: RCLONE_CACHE_PLEX_USERNAME + - Type: string + - Required: false - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, GCS, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi - \ "s3" + #### --cache-plex-password - Storage> s3 + The password of the Plex user. - Choose your S3 provider. - Enter a string value. Press Enter for the default (""). - Choose a number from below, or type in your own value - 24 / Synology C2 Object Storage - \ (Synology) + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). - provider> Synology + Properties: - Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). - Only applies if access_key_id and secret_access_key is blank. - Enter a boolean value (true or false). Press Enter for the default ("false"). - 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" + - Config: plex_password + - Env Var: RCLONE_CACHE_PLEX_PASSWORD + - Type: string + - Required: false - env_auth> 1 + #### --cache-chunk-size - AWS Access Key ID. - Leave blank for anonymous access or runtime credentials. - Enter a string value. Press Enter for the default (""). + The size of a chunk (partial file data). - access_key_id> accesskeyid + Use lower numbers for slower connections. If the chunk size is + changed, any downloaded chunks will be invalid and cache-chunk-path + will need to be cleared or unexpected EOF errors will occur. - AWS Secret Access Key (password) - Leave blank for anonymous access or runtime credentials. - Enter a string value. Press Enter for the default (""). + Properties: - secret_access_key> secretaccesskey + - Config: chunk_size + - Env Var: RCLONE_CACHE_CHUNK_SIZE + - Type: SizeSuffix + - Default: 5Mi + - Examples: + - "1M" + - 1 MiB + - "5M" + - 5 MiB + - "10M" + - 10 MiB - Region where your data stored. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - 1 / Europe Region 1 - \ (eu-001) - 2 / Europe Region 2 - \ (eu-002) - 3 / US Region 1 - \ (us-001) - 4 / US Region 2 - \ (us-002) - 5 / Asia (Taiwan) - \ (tw-001) + #### --cache-info-age - region > 1 + How long to cache file structure information (directory listings, file size, times, etc.). + If all write operations are done through the cache then you can safely make + this value very large as the cache store will also be updated in real time. - Option endpoint. - Endpoint for Synology C2 Object Storage API. - Choose a number from below, or type in your own value. - Press Enter to leave empty. - 1 / EU Endpoint 1 - \ (eu-001.s3.synologyc2.net) - 2 / US Endpoint 1 - \ (us-001.s3.synologyc2.net) - 3 / TW Endpoint 1 - \ (tw-001.s3.synologyc2.net) + Properties: - endpoint> 1 + - Config: info_age + - Env Var: RCLONE_CACHE_INFO_AGE + - Type: Duration + - Default: 6h0m0s + - Examples: + - "1h" + - 1 hour + - "24h" + - 24 hours + - "48h" + - 48 hours - Option location_constraint. - Location constraint - must be set to match the Region. - Leave blank if not sure. Used when creating buckets only. - Enter a value. Press Enter to leave empty. - location_constraint> + #### --cache-chunk-total-size - Edit advanced config? (y/n) - y) Yes - n) No - y/n> y + The total size that the chunks can take up on the local disk. - Option no_check_bucket. - If set, don't attempt to check the bucket exists or create it. - This can be useful when trying to minimise the number of transactions - rclone does if you know the bucket exists already. - It can also be needed if the user you are using does not have bucket - creation permissions. Before v1.52.0 this would have passed silently - due to a bug. - Enter a boolean value (true or false). Press Enter for the default (true). + If the cache exceeds this value then it will start to delete the + oldest chunks until it goes under this value. - no_check_bucket> true + Properties: - Configuration complete. - Options: - - type: s3 - - provider: Synology - - region: eu-001 - - endpoint: eu-001.s3.synologyc2.net - - no_check_bucket: true - Keep this "syno" remote? - y) Yes this is OK (default) - e) Edit this remote - d) Delete this remote + - Config: chunk_total_size + - Env Var: RCLONE_CACHE_CHUNK_TOTAL_SIZE + - Type: SizeSuffix + - Default: 10Gi + - Examples: + - "500M" + - 500 MiB + - "1G" + - 1 GiB + - "10G" + - 10 GiB - y/e/d> y + ### Advanced options - # Backblaze B2 + Here are the Advanced options specific to cache (Cache a remote). - B2 is [Backblaze's cloud storage system](https://www.backblaze.com/b2/). + #### --cache-plex-token - Paths are specified as `remote:bucket` (or `remote:` for the `lsd` - command.) You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`. + The plex token for authentication - auto set normally. - ## Configuration + Properties: - Here is an example of making a b2 configuration. First run + - Config: plex_token + - Env Var: RCLONE_CACHE_PLEX_TOKEN + - Type: string + - Required: false - rclone config + #### --cache-plex-insecure - This will guide you through an interactive setup process. To authenticate - you will either need your Account ID (a short hex number) and Master - Application Key (a long hex number) OR an Application Key, which is the - recommended method. See below for further details on generating and using - an Application Key. + Skip all certificate verification when connecting to the Plex server. -No remotes found, make a new one? n) New remote q) Quit config n/q> n -name> remote Type of storage to configure. Choose a number from below, -or type in your own value [snip] XX / Backblaze B2  "b2" [snip] Storage> -b2 Account ID or Application Key ID account> 123456789abc Application -Key key> 0123456789abcdef0123456789abcdef0123456789 Endpoint for the -service - leave blank normally. endpoint> Remote config --------------------- [remote] account = 123456789abc key = -0123456789abcdef0123456789abcdef0123456789 endpoint = --------------------- y) Yes this is OK e) Edit this remote d) Delete -this remote y/e/d> y + Properties: + - Config: plex_insecure + - Env Var: RCLONE_CACHE_PLEX_INSECURE + - Type: string + - Required: false - This remote is called `remote` and can now be used like this + #### --cache-db-path - See all buckets + Directory to store file structure metadata DB. - rclone lsd remote: + The remote name is used as the DB file name. - Create a new bucket + Properties: - rclone mkdir remote:bucket + - Config: db_path + - Env Var: RCLONE_CACHE_DB_PATH + - Type: string + - Default: "$HOME/.cache/rclone/cache-backend" - List the contents of a bucket + #### --cache-chunk-path - rclone ls remote:bucket + Directory to cache chunk files. + + Path to where partial file data (chunks) are stored locally. The remote + name is appended to the final path. + + This config follows the "--cache-db-path". If you specify a custom + location for "--cache-db-path" and don't specify one for "--cache-chunk-path" + then "--cache-chunk-path" will use the same path as "--cache-db-path". - Sync `/home/local/directory` to the remote bucket, deleting any - excess files in the bucket. + Properties: - rclone sync --interactive /home/local/directory remote:bucket + - Config: chunk_path + - Env Var: RCLONE_CACHE_CHUNK_PATH + - Type: string + - Default: "$HOME/.cache/rclone/cache-backend" - ### Application Keys + #### --cache-db-purge - B2 supports multiple [Application Keys for different access permission - to B2 Buckets](https://www.backblaze.com/b2/docs/application_keys.html). + Clear all the cached data for this remote on start. - You can use these with rclone too; you will need to use rclone version 1.43 - or later. + Properties: - Follow Backblaze's docs to create an Application Key with the required - permission and add the `applicationKeyId` as the `account` and the - `Application Key` itself as the `key`. + - Config: db_purge + - Env Var: RCLONE_CACHE_DB_PURGE + - Type: bool + - Default: false - Note that you must put the _applicationKeyId_ as the `account` – you - can't use the master Account ID. If you try then B2 will return 401 - errors. + #### --cache-chunk-clean-interval - ### --fast-list + How often should the cache perform cleanups of the chunk storage. - This remote supports `--fast-list` which allows you to use fewer - transactions in exchange for more memory. See the [rclone - docs](https://rclone.org/docs/#fast-list) for more details. + The default value should be ok for most people. If you find that the + cache goes over "cache-chunk-total-size" too often then try to lower + this value to force it to perform cleanups more often. - ### Modified time + Properties: - The modified time is stored as metadata on the object as - `X-Bz-Info-src_last_modified_millis` as milliseconds since 1970-01-01 - in the Backblaze standard. Other tools should be able to use this as - a modified time. + - Config: chunk_clean_interval + - Env Var: RCLONE_CACHE_CHUNK_CLEAN_INTERVAL + - Type: Duration + - Default: 1m0s - Modified times are used in syncing and are fully supported. Note that - if a modification time needs to be updated on an object then it will - create a new version of the object. + #### --cache-read-retries - ### Restricted filename characters + How many times to retry a read from a cache storage. - In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) - the following characters are also replaced: + Since reading from a cache stream is independent from downloading file + data, readers can get to a point where there's no more data in the + cache. Most of the times this can indicate a connectivity issue if + cache isn't able to provide file data anymore. - | Character | Value | Replacement | - | --------- |:-----:|:-----------:| - | \ | 0x5C | \ | + For really slow connections, increase this to a point where the stream is + able to provide data but your experience will be very stuttering. - Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), - as they can't be used in JSON strings. + Properties: - Note that in 2020-05 Backblaze started allowing \ characters in file - names. Rclone hasn't changed its encoding as this could cause syncs to - re-transfer files. If you want rclone not to replace \ then see the - `--b2-encoding` flag below and remove the `BackSlash` from the - string. This can be set in the config. + - Config: read_retries + - Env Var: RCLONE_CACHE_READ_RETRIES + - Type: int + - Default: 10 - ### SHA1 checksums + #### --cache-workers - The SHA1 checksums of the files are checked on upload and download and - will be used in the syncing process. + How many workers should run in parallel to download chunks. - Large files (bigger than the limit in `--b2-upload-cutoff`) which are - uploaded in chunks will store their SHA1 on the object as - `X-Bz-Info-large_file_sha1` as recommended by Backblaze. + Higher values will mean more parallel processing (better CPU needed) + and more concurrent requests on the cloud provider. This impacts + several aspects like the cloud provider API limits, more stress on the + hardware that rclone runs on but it also means that streams will be + more fluid and data will be available much more faster to readers. - For a large file to be uploaded with an SHA1 checksum, the source - needs to support SHA1 checksums. The local disk supports SHA1 - checksums so large file transfers from local disk will have an SHA1. - See [the overview](https://rclone.org/overview/#features) for exactly which remotes - support SHA1. + **Note**: If the optional Plex integration is enabled then this + setting will adapt to the type of reading performed and the value + specified here will be used as a maximum number of workers to use. - Sources which don't support SHA1, in particular `crypt` will upload - large files without SHA1 checksums. This may be fixed in the future - (see [#1767](https://github.com/rclone/rclone/issues/1767)). + Properties: - Files sizes below `--b2-upload-cutoff` will always have an SHA1 - regardless of the source. + - Config: workers + - Env Var: RCLONE_CACHE_WORKERS + - Type: int + - Default: 4 - ### Transfers + #### --cache-chunk-no-memory - Backblaze recommends that you do lots of transfers simultaneously for - maximum speed. In tests from my SSD equipped laptop the optimum - setting is about `--transfers 32` though higher numbers may be used - for a slight speed improvement. The optimum number for you may vary - depending on your hardware, how big the files are, how much you want - to load your computer, etc. The default of `--transfers 4` is - definitely too low for Backblaze B2 though. + Disable the in-memory cache for storing chunks during streaming. - Note that uploading big files (bigger than 200 MiB by default) will use - a 96 MiB RAM buffer by default. There can be at most `--transfers` of - these in use at any moment, so this sets the upper limit on the memory - used. + By default, cache will keep file data during streaming in RAM as well + to provide it to readers as fast as possible. - ### Versions + This transient data is evicted as soon as it is read and the number of + chunks stored doesn't exceed the number of workers. However, depending + on other settings like "cache-chunk-size" and "cache-workers" this footprint + can increase if there are parallel streams too (multiple files being read + at the same time). - When rclone uploads a new version of a file it creates a [new version - of it](https://www.backblaze.com/b2/docs/file_versions.html). - Likewise when you delete a file, the old version will be marked hidden - and still be available. Conversely, you may opt in to a "hard delete" - of files with the `--b2-hard-delete` flag which would permanently remove - the file instead of hiding it. + If the hardware permits it, use this feature to provide an overall better + performance during streaming but it can also be disabled if RAM is not + available on the local machine. - Old versions of files, where available, are visible using the - `--b2-versions` flag. + Properties: - It is also possible to view a bucket as it was at a certain point in time, - using the `--b2-version-at` flag. This will show the file versions as they - were at that time, showing files that have been deleted afterwards, and - hiding files that were created since. + - Config: chunk_no_memory + - Env Var: RCLONE_CACHE_CHUNK_NO_MEMORY + - Type: bool + - Default: false - If you wish to remove all the old versions then you can use the - `rclone cleanup remote:bucket` command which will delete all the old - versions of files, leaving the current ones intact. You can also - supply a path and only old versions under that path will be deleted, - e.g. `rclone cleanup remote:bucket/path/to/stuff`. + #### --cache-rps - Note that `cleanup` will remove partially uploaded files from the bucket - if they are more than a day old. + Limits the number of requests per second to the source FS (-1 to disable). - When you `purge` a bucket, the current and the old versions will be - deleted then the bucket will be deleted. + This setting places a hard limit on the number of requests per second + that cache will be doing to the cloud provider remote and try to + respect that value by setting waits between reads. - However `delete` will cause the current versions of the files to - become hidden old versions. + If you find that you're getting banned or limited on the cloud + provider through cache and know that a smaller number of requests per + second will allow you to work with it then you can use this setting + for that. - Here is a session showing the listing and retrieval of an old - version followed by a `cleanup` of the old versions. + A good balance of all the other settings should make this setting + useless but it is available to set for more special cases. - Show current version and all the versions with `--b2-versions` flag. + **NOTE**: This will limit the number of requests during streams but + other API calls to the cloud provider like directory listings will + still pass. -$ rclone -q ls b2:cleanup-test 9 one.txt + Properties: -$ rclone -q --b2-versions ls b2:cleanup-test 9 one.txt 8 -one-v2016-07-04-141032-000.txt 16 one-v2016-07-04-141003-000.txt 15 -one-v2016-07-02-155621-000.txt + - Config: rps + - Env Var: RCLONE_CACHE_RPS + - Type: int + - Default: -1 + #### --cache-writes - Retrieve an old version + Cache file data on writes through the FS. -$ rclone -q --b2-versions copy -b2:cleanup-test/one-v2016-07-04-141003-000.txt /tmp + If you need to read files immediately after you upload them through + cache you can enable this flag to have their data stored in the + cache store at the same time during upload. -$ ls -l /tmp/one-v2016-07-04-141003-000.txt -rw-rw-r-- 1 ncw ncw 16 Jul -2 17:46 /tmp/one-v2016-07-04-141003-000.txt + Properties: + - Config: writes + - Env Var: RCLONE_CACHE_WRITES + - Type: bool + - Default: false - Clean up all the old versions and show that they've gone. + #### --cache-tmp-upload-path -$ rclone -q cleanup b2:cleanup-test + Directory to keep temporary files until they are uploaded. -$ rclone -q ls b2:cleanup-test 9 one.txt + This is the path where cache will use as a temporary storage for new + files that need to be uploaded to the cloud provider. -$ rclone -q --b2-versions ls b2:cleanup-test 9 one.txt + Specifying a value will enable this feature. Without it, it is + completely disabled and files will be uploaded directly to the cloud + provider + Properties: - #### Versions naming caveat + - Config: tmp_upload_path + - Env Var: RCLONE_CACHE_TMP_UPLOAD_PATH + - Type: string + - Required: false - When using `--b2-versions` flag rclone is relying on the file name - to work out whether the objects are versions or not. Versions' names - are created by inserting timestamp between file name and its extension. + #### --cache-tmp-wait-time - 9 file.txt - 8 file-v2023-07-17-161032-000.txt - 16 file-v2023-06-15-141003-000.txt + How long should files be stored in local cache before being uploaded. - If there are real files present with the same names as versions, then - behaviour of `--b2-versions` can be unpredictable. + This is the duration that a file must wait in the temporary location + _cache-tmp-upload-path_ before it is selected for upload. - ### Data usage + Note that only one file is uploaded at a time and it can take longer + to start the upload if a queue formed for this purpose. - It is useful to know how many requests are sent to the server in different scenarios. + Properties: - All copy commands send the following 4 requests: + - Config: tmp_wait_time + - Env Var: RCLONE_CACHE_TMP_WAIT_TIME + - Type: Duration + - Default: 15s -/b2api/v1/b2_authorize_account /b2api/v1/b2_create_bucket -/b2api/v1/b2_list_buckets /b2api/v1/b2_list_file_names + #### --cache-db-wait-time + How long to wait for the DB to be available - 0 is unlimited. - The `b2_list_file_names` request will be sent once for every 1k files - in the remote path, providing the checksum and modification time of - the listed files. As of version 1.33 issue - [#818](https://github.com/rclone/rclone/issues/818) causes extra requests - to be sent when using B2 with Crypt. When a copy operation does not - require any files to be uploaded, no more requests will be sent. + Only one process can have the DB open at any one time, so rclone waits + for this duration for the DB to become available before it gives an + error. - Uploading files that do not require chunking, will send 2 requests per - file upload: + If you set it to 0 then it will wait forever. -/b2api/v1/b2_get_upload_url /b2api/v1/b2_upload_file/ + Properties: + - Config: db_wait_time + - Env Var: RCLONE_CACHE_DB_WAIT_TIME + - Type: Duration + - Default: 1s - Uploading files requiring chunking, will send 2 requests (one each to - start and finish the upload) and another 2 requests for each chunk: + ## Backend commands -/b2api/v1/b2_start_large_file /b2api/v1/b2_get_upload_part_url -/b2api/v1/b2_upload_part/ /b2api/v1/b2_finish_large_file + Here are the commands specific to the cache backend. + Run them with - #### Versions + rclone backend COMMAND remote: - Versions can be viewed with the `--b2-versions` flag. When it is set - rclone will show and act on older versions of files. For example + The help below will explain what arguments each command takes. - Listing without `--b2-versions` + See the [backend](https://rclone.org/commands/rclone_backend/) command for more + info on how to pass options and arguments. -$ rclone -q ls b2:cleanup-test 9 one.txt + These can be run on a running backend using the rc command + [backend/command](https://rclone.org/rc/#backend-command). + ### stats - And with + Print stats on the cache backend in JSON format. -$ rclone -q --b2-versions ls b2:cleanup-test 9 one.txt 8 -one-v2016-07-04-141032-000.txt 16 one-v2016-07-04-141003-000.txt 15 -one-v2016-07-02-155621-000.txt + rclone backend stats remote: [options] [+] - Showing that the current version is unchanged but older versions can - be seen. These have the UTC date that they were uploaded to the - server to the nearest millisecond appended to them. - Note that when using `--b2-versions` no file write operations are - permitted, so you can't upload files or delete them. + # Chunker - ### B2 and rclone link + The `chunker` overlay transparently splits large files into smaller chunks + during upload to wrapped remote and transparently assembles them back + when the file is downloaded. This allows to effectively overcome size limits + imposed by storage providers. - Rclone supports generating file share links for private B2 buckets. - They can either be for a file for example: + ## Configuration -./rclone link B2:bucket/path/to/file.txt -https://f002.backblazeb2.com/file/bucket/path/to/file.txt?Authorization=xxxxxxxx + To use it, first set up the underlying remote following the configuration + instructions for that remote. You can also use a local pathname instead of + a remote. + First check your chosen remote is working - we'll call it `remote:path` here. + Note that anything inside `remote:path` will be chunked and anything outside + won't. This means that if you are using a bucket-based remote (e.g. S3, B2, swift) + then you should probably put the bucket in the remote `s3:bucket`. - or if run on a directory you will get: + Now configure `chunker` using `rclone config`. We will call this one `overlay` + to separate it from the `remote` itself. -./rclone link B2:bucket/path -https://f002.backblazeb2.com/file/bucket/path?Authorization=xxxxxxxx +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> overlay Type of storage to +configure. Choose a number from below, or type in your own value [snip] +XX / Transparently chunk/split large files  "chunker" [snip] Storage> +chunker Remote to chunk/unchunk. Normally should contain a ':' and a +path, e.g. "myremote:path/to/dir", "myremote:bucket" or maybe +"myremote:" (not recommended). Enter a string value. Press Enter for the +default (""). remote> remote:path Files larger than chunk size will be +split in chunks. Enter a size with suffix K,M,G,T. Press Enter for the +default ("2G"). chunk_size> 100M Choose how chunker handles hash sums. +All modes but "none" require metadata. Enter a string value. Press Enter +for the default ("md5"). Choose a number from below, or type in your own +value 1 / Pass any hash supported by wrapped remote for non-chunked +files, return nothing otherwise  "none" 2 / MD5 for composite files + "md5" 3 / SHA1 for composite files  "sha1" 4 / MD5 for all files + "md5all" 5 / SHA1 for all files  "sha1all" 6 / Copying a file to +chunker will request MD5 from the source falling back to SHA1 if +unsupported  "md5quick" 7 / Similar to "md5quick" but prefers SHA1 over +MD5  "sha1quick" hash_type> md5 Edit advanced config? (y/n) y) Yes n) No +y/n> n Remote config -------------------- [overlay] type = chunker +remote = remote:bucket chunk_size = 100M hash_type = md5 +-------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y - you can then use the authorization token (the part of the url from the - `?Authorization=` on) on any file path under that directory. For example: + ### Specifying the remote -https://f002.backblazeb2.com/file/bucket/path/to/file1?Authorization=xxxxxxxx -https://f002.backblazeb2.com/file/bucket/path/file2?Authorization=xxxxxxxx -https://f002.backblazeb2.com/file/bucket/path/folder/file3?Authorization=xxxxxxxx + In normal use, make sure the remote has a `:` in. If you specify the remote + without a `:` then rclone will use a local directory of that name. + So if you use a remote of `/path/to/secret/files` then rclone will + chunk stuff in that directory. If you use a remote of `name` then rclone + will put files in a directory called `name` in the current directory. + ### Chunking - ### Standard options + When rclone starts a file upload, chunker checks the file size. If it + doesn't exceed the configured chunk size, chunker will just pass the file + to the wrapped remote (however, see caveat below). If a file is large, chunker will transparently cut + data in pieces with temporary names and stream them one by one, on the fly. + Each data chunk will contain the specified number of bytes, except for the + last one which may have less data. If file size is unknown in advance + (this is called a streaming upload), chunker will internally create + a temporary copy, record its size and repeat the above process. - Here are the Standard options specific to b2 (Backblaze B2). + When upload completes, temporary chunk files are finally renamed. + This scheme guarantees that operations can be run in parallel and look + from outside as atomic. + A similar method with hidden temporary chunks is used for other operations + (copy/move/rename, etc.). If an operation fails, hidden chunks are normally + destroyed, and the target composite file stays intact. - #### --b2-account + When a composite file download is requested, chunker transparently + assembles it by concatenating data chunks in order. As the split is trivial + one could even manually concatenate data chunks together to obtain the + original content. - Account ID or Application Key ID. + When the `list` rclone command scans a directory on wrapped remote, + the potential chunk files are accounted for, grouped and assembled into + composite directory entries. Any temporary chunks are hidden. - Properties: + List and other commands can sometimes come across composite files with + missing or invalid chunks, e.g. shadowed by like-named directory or + another file. This usually means that wrapped file system has been directly + tampered with or damaged. If chunker detects a missing chunk it will + by default print warning, skip the whole incomplete group of chunks but + proceed with current command. + You can set the `--chunker-fail-hard` flag to have commands abort with + error message in such cases. - - Config: account - - Env Var: RCLONE_B2_ACCOUNT - - Type: string - - Required: true + **Caveat**: As it is now, chunker will always create a temporary file in the + backend and then rename it, even if the file is below the chunk threshold. + This will result in unnecessary API calls and can severely restrict throughput + when handling transfers primarily composed of small files on some backends (e.g. Box). + A workaround to this issue is to use chunker only for files above the chunk threshold + via `--min-size` and then perform a separate call without chunker on the remaining + files. - #### --b2-key - Application Key. + #### Chunk names - Properties: + The default chunk name format is `*.rclone_chunk.###`, hence by default + chunk names are `BIG_FILE_NAME.rclone_chunk.001`, + `BIG_FILE_NAME.rclone_chunk.002` etc. You can configure another name format + using the `name_format` configuration file option. The format uses asterisk + `*` as a placeholder for the base file name and one or more consecutive + hash characters `#` as a placeholder for sequential chunk number. + There must be one and only one asterisk. The number of consecutive hash + characters defines the minimum length of a string representing a chunk number. + If decimal chunk number has less digits than the number of hashes, it is + left-padded by zeros. If the decimal string is longer, it is left intact. + By default numbering starts from 1 but there is another option that allows + user to start from 0, e.g. for compatibility with legacy software. - - Config: key - - Env Var: RCLONE_B2_KEY - - Type: string - - Required: true + For example, if name format is `big_*-##.part` and original file name is + `data.txt` and numbering starts from 0, then the first chunk will be named + `big_data.txt-00.part`, the 99th chunk will be `big_data.txt-98.part` + and the 302nd chunk will become `big_data.txt-301.part`. - #### --b2-hard-delete + Note that `list` assembles composite directory entries only when chunk names + match the configured format and treats non-conforming file names as normal + non-chunked files. - Permanently delete files on remote removal, otherwise hide files. + When using `norename` transactions, chunk names will additionally have a unique + file version suffix. For example, `BIG_FILE_NAME.rclone_chunk.001_bp562k`. - Properties: - - Config: hard_delete - - Env Var: RCLONE_B2_HARD_DELETE - - Type: bool - - Default: false + ### Metadata - ### Advanced options + Besides data chunks chunker will by default create metadata object for + a composite file. The object is named after the original file. + Chunker allows user to disable metadata completely (the `none` format). + Note that metadata is normally not created for files smaller than the + configured chunk size. This may change in future rclone releases. - Here are the Advanced options specific to b2 (Backblaze B2). + #### Simple JSON metadata format - #### --b2-endpoint + This is the default format. It supports hash sums and chunk validation + for composite files. Meta objects carry the following fields: - Endpoint for the service. + - `ver` - version of format, currently `1` + - `size` - total size of composite file + - `nchunks` - number of data chunks in file + - `md5` - MD5 hashsum of composite file (if present) + - `sha1` - SHA1 hashsum (if present) + - `txn` - identifies current version of the file - Leave blank normally. + There is no field for composite file name as it's simply equal to the name + of meta object on the wrapped remote. Please refer to respective sections + for details on hashsums and modified time handling. - Properties: + #### No metadata - - Config: endpoint - - Env Var: RCLONE_B2_ENDPOINT - - Type: string - - Required: false + You can disable meta objects by setting the meta format option to `none`. + In this mode chunker will scan directory for all files that follow + configured chunk name format, group them by detecting chunks with the same + base name and show group names as virtual composite files. + This method is more prone to missing chunk errors (especially missing + last chunk) than format with metadata enabled. - #### --b2-test-mode - A flag string for X-Bz-Test-Mode header for debugging. + ### Hashsums - This is for debugging purposes only. Setting it to one of the strings - below will cause b2 to return specific errors: + Chunker supports hashsums only when a compatible metadata is present. + Hence, if you choose metadata format of `none`, chunker will report hashsum + as `UNSUPPORTED`. - * "fail_some_uploads" - * "expire_some_account_authorization_tokens" - * "force_cap_exceeded" + Please note that by default metadata is stored only for composite files. + If a file is smaller than configured chunk size, chunker will transparently + redirect hash requests to wrapped remote, so support depends on that. + You will see the empty string as a hashsum of requested type for small + files if the wrapped remote doesn't support it. - These will be set in the "X-Bz-Test-Mode" header which is documented - in the [b2 integrations checklist](https://www.backblaze.com/b2/docs/integration_checklist.html). + Many storage backends support MD5 and SHA1 hash types, so does chunker. + With chunker you can choose one or another but not both. + MD5 is set by default as the most supported type. + Since chunker keeps hashes for composite files and falls back to the + wrapped remote hash for non-chunked ones, we advise you to choose the same + hash type as supported by wrapped remote so that your file listings + look coherent. - Properties: + If your storage backend does not support MD5 or SHA1 but you need consistent + file hashing, configure chunker with `md5all` or `sha1all`. These two modes + guarantee given hash for all files. If wrapped remote doesn't support it, + chunker will then add metadata to all files, even small. However, this can + double the amount of small files in storage and incur additional service charges. + You can even use chunker to force md5/sha1 support in any other remote + at expense of sidecar meta objects by setting e.g. `hash_type=sha1all` + to force hashsums and `chunk_size=1P` to effectively disable chunking. - - Config: test_mode - - Env Var: RCLONE_B2_TEST_MODE - - Type: string - - Required: false + Normally, when a file is copied to chunker controlled remote, chunker + will ask the file source for compatible file hash and revert to on-the-fly + calculation if none is found. This involves some CPU overhead but provides + a guarantee that given hashsum is available. Also, chunker will reject + a server-side copy or move operation if source and destination hashsum + types are different resulting in the extra network bandwidth, too. + In some rare cases this may be undesired, so chunker provides two optional + choices: `sha1quick` and `md5quick`. If the source does not support primary + hash type and the quick mode is enabled, chunker will try to fall back to + the secondary type. This will save CPU and bandwidth but can result in empty + hashsums at destination. Beware of consequences: the `sync` command will + revert (sometimes silently) to time/size comparison if compatible hashsums + between source and target are not found. - #### --b2-versions - Include old versions in directory listings. + ### Modification times - Note that when using this no file write operations are permitted, - so you can't upload files or delete them. + Chunker stores modification times using the wrapped remote so support + depends on that. For a small non-chunked file the chunker overlay simply + manipulates modification time of the wrapped remote file. + For a composite file with metadata chunker will get and set + modification time of the metadata object on the wrapped remote. + If file is chunked but metadata format is `none` then chunker will + use modification time of the first data chunk. - Properties: - - Config: versions - - Env Var: RCLONE_B2_VERSIONS - - Type: bool - - Default: false + ### Migrations - #### --b2-version-at + The idiomatic way to migrate to a different chunk size, hash type, transaction + style or chunk naming scheme is to: - Show file versions as they were at the specified time. + - Collect all your chunked files under a directory and have your + chunker remote point to it. + - Create another directory (most probably on the same cloud storage) + and configure a new remote with desired metadata format, + hash type, chunk naming etc. + - Now run `rclone sync --interactive oldchunks: newchunks:` and all your data + will be transparently converted in transfer. + This may take some time, yet chunker will try server-side + copy if possible. + - After checking data integrity you may remove configuration section + of the old remote. - Note that when using this no file write operations are permitted, - so you can't upload files or delete them. + If rclone gets killed during a long operation on a big composite file, + hidden temporary chunks may stay in the directory. They will not be + shown by the `list` command but will eat up your account quota. + Please note that the `deletefile` command deletes only active + chunks of a file. As a workaround, you can use remote of the wrapped + file system to see them. + An easy way to get rid of hidden garbage is to copy littered directory + somewhere using the chunker remote and purge the original directory. + The `copy` command will copy only active chunks while the `purge` will + remove everything including garbage. - Properties: - - Config: version_at - - Env Var: RCLONE_B2_VERSION_AT - - Type: Time - - Default: off + ### Caveats and Limitations - #### --b2-upload-cutoff + Chunker requires wrapped remote to support server-side `move` (or `copy` + + `delete`) operations, otherwise it will explicitly refuse to start. + This is because it internally renames temporary chunk files to their final + names when an operation completes successfully. - Cutoff for switching to chunked upload. + Chunker encodes chunk number in file name, so with default `name_format` + setting it adds 17 characters. Also chunker adds 7 characters of temporary + suffix during operations. Many file systems limit base file name without path + by 255 characters. Using rclone's crypt remote as a base file system limits + file name by 143 characters. Thus, maximum name length is 231 for most files + and 119 for chunker-over-crypt. A user in need can change name format to + e.g. `*.rcc##` and save 10 characters (provided at most 99 chunks per file). - Files above this size will be uploaded in chunks of "--b2-chunk-size". + Note that a move implemented using the copy-and-delete method may incur + double charging with some cloud storage providers. - This value should be set no larger than 4.657 GiB (== 5 GB). + Chunker will not automatically rename existing chunks when you run + `rclone config` on a live remote and change the chunk name format. + Beware that in result of this some files which have been treated as chunks + before the change can pop up in directory listings as normal files + and vice versa. The same warning holds for the chunk size. + If you desperately need to change critical chunking settings, you should + run data migration as described above. - Properties: + If wrapped remote is case insensitive, the chunker overlay will inherit + that property (so you can't have a file called "Hello.doc" and "hello.doc" + in the same directory). - - Config: upload_cutoff - - Env Var: RCLONE_B2_UPLOAD_CUTOFF - - Type: SizeSuffix - - Default: 200Mi + Chunker included in rclone releases up to `v1.54` can sometimes fail to + detect metadata produced by recent versions of rclone. We recommend users + to keep rclone up-to-date to avoid data corruption. - #### --b2-copy-cutoff + Changing `transactions` is dangerous and requires explicit migration. - Cutoff for switching to multipart copy. - Any files larger than this that need to be server-side copied will be - copied in chunks of this size. + ### Standard options - The minimum is 0 and the maximum is 4.6 GiB. + Here are the Standard options specific to chunker (Transparently chunk/split large files). - Properties: + #### --chunker-remote - - Config: copy_cutoff - - Env Var: RCLONE_B2_COPY_CUTOFF - - Type: SizeSuffix - - Default: 4Gi + Remote to chunk/unchunk. - #### --b2-chunk-size + Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", + "myremote:bucket" or maybe "myremote:" (not recommended). - Upload chunk size. + Properties: - When uploading large files, chunk the file into this size. + - Config: remote + - Env Var: RCLONE_CHUNKER_REMOTE + - Type: string + - Required: true - Must fit in memory. These chunks are buffered in memory and there - might a maximum of "--transfers" chunks in progress at once. + #### --chunker-chunk-size - 5,000,000 Bytes is the minimum size. + Files larger than chunk size will be split in chunks. Properties: - Config: chunk_size - - Env Var: RCLONE_B2_CHUNK_SIZE + - Env Var: RCLONE_CHUNKER_CHUNK_SIZE - Type: SizeSuffix - - Default: 96Mi - - #### --b2-upload-concurrency - - Concurrency for multipart uploads. - - This is the number of chunks of the same file that are uploaded - concurrently. - - Note that chunks are stored in memory and there may be up to - "--transfers" * "--b2-upload-concurrency" chunks stored at once - in memory. - - Properties: - - - Config: upload_concurrency - - Env Var: RCLONE_B2_UPLOAD_CONCURRENCY - - Type: int - - Default: 16 + - Default: 2Gi - #### --b2-disable-checksum + #### --chunker-hash-type - Disable checksums for large (> upload cutoff) files. + Choose how chunker handles hash sums. - Normally rclone will calculate the SHA1 checksum of the input before - uploading it so it can add it to metadata on the object. This is great - for data integrity checking but can cause long delays for large files - to start uploading. + All modes but "none" require metadata. Properties: - - Config: disable_checksum - - Env Var: RCLONE_B2_DISABLE_CHECKSUM - - Type: bool - - Default: false + - Config: hash_type + - Env Var: RCLONE_CHUNKER_HASH_TYPE + - Type: string + - Default: "md5" + - Examples: + - "none" + - Pass any hash supported by wrapped remote for non-chunked files. + - Return nothing otherwise. + - "md5" + - MD5 for composite files. + - "sha1" + - SHA1 for composite files. + - "md5all" + - MD5 for all files. + - "sha1all" + - SHA1 for all files. + - "md5quick" + - Copying a file to chunker will request MD5 from the source. + - Falling back to SHA1 if unsupported. + - "sha1quick" + - Similar to "md5quick" but prefers SHA1 over MD5. - #### --b2-download-url + ### Advanced options - Custom endpoint for downloads. + Here are the Advanced options specific to chunker (Transparently chunk/split large files). - This is usually set to a Cloudflare CDN URL as Backblaze offers - free egress for data downloaded through the Cloudflare network. - Rclone works with private buckets by sending an "Authorization" header. - If the custom endpoint rewrites the requests for authentication, - e.g., in Cloudflare Workers, this header needs to be handled properly. - Leave blank if you want to use the endpoint provided by Backblaze. + #### --chunker-name-format - The URL provided here SHOULD have the protocol and SHOULD NOT have - a trailing slash or specify the /file/bucket subpath as rclone will - request files with "{download_url}/file/{bucket_name}/{path}". + String format of chunk file names. - Example: - > https://mysubdomain.mydomain.tld - (No trailing "/", "file" or "bucket") + The two placeholders are: base file name (*) and chunk number (#...). + There must be one and only one asterisk and one or more consecutive hash characters. + If chunk number has less digits than the number of hashes, it is left-padded by zeros. + If there are more digits in the number, they are left as is. + Possible chunk files are ignored if their name does not match given format. Properties: - - Config: download_url - - Env Var: RCLONE_B2_DOWNLOAD_URL + - Config: name_format + - Env Var: RCLONE_CHUNKER_NAME_FORMAT - Type: string - - Required: false + - Default: "*.rclone_chunk.###" - #### --b2-download-auth-duration + #### --chunker-start-from - Time before the authorization token will expire in s or suffix ms|s|m|h|d. + Minimum valid chunk number. Usually 0 or 1. - The duration before the download authorization token will expire. - The minimum value is 1 second. The maximum value is one week. + By default chunk numbers start from 1. Properties: - - Config: download_auth_duration - - Env Var: RCLONE_B2_DOWNLOAD_AUTH_DURATION - - Type: Duration - - Default: 1w + - Config: start_from + - Env Var: RCLONE_CHUNKER_START_FROM + - Type: int + - Default: 1 - #### --b2-memory-pool-flush-time + #### --chunker-meta-format - How often internal memory buffer pools will be flushed. (no longer used) + Format of the metadata object or "none". + + By default "simplejson". + Metadata is a small JSON file named after the composite file. Properties: - - Config: memory_pool_flush_time - - Env Var: RCLONE_B2_MEMORY_POOL_FLUSH_TIME - - Type: Duration - - Default: 1m0s + - Config: meta_format + - Env Var: RCLONE_CHUNKER_META_FORMAT + - Type: string + - Default: "simplejson" + - Examples: + - "none" + - Do not use metadata files at all. + - Requires hash type "none". + - "simplejson" + - Simple JSON supports hash sums and chunk validation. + - + - It has the following fields: ver, size, nchunks, md5, sha1. - #### --b2-memory-pool-use-mmap + #### --chunker-fail-hard - Whether to use mmap buffers in internal memory pool. (no longer used) + Choose how chunker should handle files with missing or invalid chunks. Properties: - - Config: memory_pool_use_mmap - - Env Var: RCLONE_B2_MEMORY_POOL_USE_MMAP + - Config: fail_hard + - Env Var: RCLONE_CHUNKER_FAIL_HARD - Type: bool - Default: false + - Examples: + - "true" + - Report errors and abort current command. + - "false" + - Warn user, skip incomplete file and proceed. - #### --b2-encoding - - The encoding for the backend. + #### --chunker-transactions - See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + Choose how chunker should handle temporary files during transactions. Properties: - - Config: encoding - - Env Var: RCLONE_B2_ENCODING - - Type: MultiEncoder - - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot - - - - ## Limitations - - `rclone about` is not supported by the B2 backend. Backends without - this capability cannot determine free space for an rclone mount or - use policy `mfs` (most free space) as a member of an rclone union - remote. - - See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) + - Config: transactions + - Env Var: RCLONE_CHUNKER_TRANSACTIONS + - Type: string + - Default: "rename" + - Examples: + - "rename" + - Rename temporary files after a successful transaction. + - "norename" + - Leave temporary file names and write transaction ID to metadata file. + - Metadata is required for no rename transactions (meta format cannot be "none"). + - If you are using norename transactions you should be careful not to downgrade Rclone + - as older versions of Rclone don't support this transaction style and will misinterpret + - files manipulated by norename transactions. + - This method is EXPERIMENTAL, don't use on production systems. + - "auto" + - Rename or norename will be used depending on capabilities of the backend. + - If meta format is set to "none", rename transactions will always be used. + - This method is EXPERIMENTAL, don't use on production systems. - # Box - Paths are specified as `remote:path` - Paths may be as deep as required, e.g. `remote:directory/subdirectory`. + # Citrix ShareFile - The initial setup for Box involves getting a token from Box which you - can do either in your browser, or with a config.json downloaded from Box - to use JWT authentication. `rclone config` walks you through it. + [Citrix ShareFile](https://sharefile.com) is a secure file sharing and transfer service aimed as business. ## Configuration + The initial setup for Citrix ShareFile involves getting a token from + Citrix ShareFile which you can in your browser. `rclone config` walks you + through it. + Here is an example of how to make a remote called `remote`. First run: rclone config @@ -26296,26 +28157,31 @@ https://f002.backblazeb2.com/file/bucket/path/folder/file3?Authorization=xxxxxxx No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to -configure. Choose a number from below, or type in your own value [snip] -XX / Box  "box" [snip] Storage> box Box App Client Id - leave blank -normally. client_id> Box App Client Secret - leave blank normally. -client_secret> Box App config.json location Leave blank normally. Enter -a string value. Press Enter for the default (""). box_config_file> Box -App Primary Access Token Leave blank normally. Enter a string value. -Press Enter for the default (""). access_token> +configure. Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value XX / Citrix +Sharefile  "sharefile" Storage> sharefile ** See help for sharefile +backend at: https://rclone.org/sharefile/ ** -Enter a string value. Press Enter for the default ("user"). Choose a -number from below, or type in your own value 1 / Rclone should act on -behalf of a user  "user" 2 / Rclone should act on behalf of a service -account  "enterprise" box_sub_type> Remote config Use web browser to +ID of the root folder + +Leave blank to access "Personal Folders". You can use one of the +standard values here or any folder ID (long hex number ID). Enter a +string value. Press Enter for the default (""). Choose a number from +below, or type in your own value 1 / Access the Personal Folders. +(Default)  "" 2 / Access the Favorites folder.  "favorites" 3 / Access +all the shared folders.  "allshared" 4 / Access all the individual +connectors.  "connectors" 5 / Access the home, favorites, and shared +folders as well as the connectors.  "top" root_folder_id> Edit advanced +config? (y/n) y) Yes n) No y/n> n Remote config Use web browser to automatically authenticate rclone with remote? * Say Y if the machine running rclone has a web browser you can use * Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N. 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 = -{"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"XXX"} +automatically go to the following link: +http://127.0.0.1:53682/auth?state=XXX Log in and authorize rclone for +access Waiting for code... Got code -------------------- [remote] type = +sharefile endpoint = https://XXX.sharefile.com token = +{"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2019-09-30T19:41:45.878561877+01:00"} -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y @@ -26324,107 +28190,43 @@ this remote y/e/d> y machine with no Internet browser available. Note that rclone runs a webserver on your local machine to collect the - token as returned from Box. This only runs from the moment it opens + token as returned from Citrix ShareFile. This only runs from the moment it opens your browser to the moment you get back the verification code. This is on `http://127.0.0.1:53682/` and this it may require you to unblock it temporarily if you are running a host firewall. Once configured you can then use `rclone` like this, - List directories in top level of your Box + List directories in top level of your ShareFile rclone lsd remote: - List all the files in your Box + List all the files in your ShareFile rclone ls remote: - To copy a local directory to an Box directory called backup + To copy a local directory to an ShareFile directory called backup rclone copy /home/source remote:backup - ### Using rclone with an Enterprise account with SSO - - If you have an "Enterprise" account type with Box with single sign on - (SSO), you need to create a password to use Box with rclone. This can - be done at your Enterprise Box account by going to Settings, "Account" - Tab, and then set the password in the "Authentication" field. - - Once you have done this, you can setup your Enterprise Box account - using the same procedure detailed above in the, using the password you - have just set. - - ### Invalid refresh token - - According to the [box docs](https://developer.box.com/v2.0/docs/oauth-20#section-6-using-the-access-and-refresh-tokens): - - > Each refresh_token is valid for one use in 60 days. - - This means that if you - - * Don't use the box remote for 60 days - * Copy the config file with a box refresh token in and use it in two places - * Get an error on a token refresh - - then rclone will return an error which includes the text `Invalid - refresh token`. - - To fix this you will need to use oauth2 again to update the refresh - token. You can use the methods in [the remote setup - docs](https://rclone.org/remote_setup/), bearing in mind that if you use the copy the - config file method, you should not use that remote on the computer you - did the authentication on. - - Here is how to do it. - -$ rclone config Current remotes: - -Name Type ==== ==== remote box - -e) Edit existing remote -f) New remote -g) Delete remote -h) Rename remote -i) Copy remote -j) Set configuration password -k) Quit config e/n/d/r/c/s/q> e Choose a number from below, or type in - an existing value 1 > remote remote> remote -------------------- - [remote] type = box token = - {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2017-07-08T23:40:08.059167677+01:00"} - -------------------- Edit remote Value "client_id" = "" Edit? (y/n)> -l) Yes -m) No y/n> n Value "client_secret" = "" Edit? (y/n)> -n) Yes -o) No y/n> n Remote config Already have a token - refresh? -p) Yes -q) No y/n> y Use web browser to automatically authenticate rclone with - remote? - -- Say Y if the machine running rclone has a web browser you can use -- Say N if running rclone on a (remote) machine without web browser - access If not sure try Y. If Y failed, try N. - -y) Yes -z) 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] type = box token = - {"access_token":"YYY","token_type":"bearer","refresh_token":"YYY","expiry":"2017-07-23T12:22:29.259137901+01:00"} - -------------------- -a) Yes this is OK -b) Edit this remote -c) Delete this remote y/e/d> y - + Paths may be as deep as required, e.g. `remote:directory/subdirectory`. - ### Modified time and hashes + ### Modification times and hashes - Box allows modification times to be set on objects accurate to 1 + ShareFile allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or not. - Box supports SHA1 type hashes, so you can use the `--checksum` + ShareFile supports MD5 type hashes, so you can use the `--checksum` flag. + ### Transfers + + For files above 128 MiB rclone will use a chunked transfer. Rclone will + upload up to `--transfers` chunks at the same time (shared among all + the multipart uploads). Chunks are buffered in memory and are + normally 64 MiB so increasing `--transfers` will increase memory use. + ### Restricted filename characters In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) @@ -26432,149 +28234,99 @@ c) Delete this remote y/e/d> y | Character | Value | Replacement | | --------- |:-----:|:-----------:| - | \ | 0x5C | \ | + | \\ | 0x5C | \ | + | * | 0x2A | * | + | < | 0x3C | < | + | > | 0x3E | > | + | ? | 0x3F | ? | + | : | 0x3A | : | + | \| | 0x7C | | | + | " | 0x22 | " | - File names can also not end with the following characters. - These only get replaced if they are the last character in the name: + File names can also not start or end with the following characters. + These only get replaced if they are the first or last character in the + name: | Character | Value | Replacement | | --------- |:-----:|:-----------:| | SP | 0x20 | ␠ | + | . | 0x2E | . | Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), - as they can't be used in JSON strings. - - ### Transfers - - For files above 50 MiB rclone will use a chunked transfer. Rclone will - upload up to `--transfers` chunks at the same time (shared among all - the multipart uploads). Chunks are buffered in memory and are - normally 8 MiB so increasing `--transfers` will increase memory use. - - ### Deleting files - - Depending on the enterprise settings for your user, the item will - either be actually deleted from Box or moved to the trash. - - Emptying the trash is supported via the rclone however cleanup command - however this deletes every trashed file and folder individually so it - may take a very long time. - Emptying the trash via the WebUI does not have this limitation - so it is advised to empty the trash via the WebUI. - - ### Root folder ID - - You can set the `root_folder_id` for rclone. This is the directory - (identified by its `Folder ID`) that rclone considers to be the root - of your Box drive. - - Normally you will leave this blank and rclone will determine the - correct root to use itself. - - However you can set this to restrict rclone to a specific folder - hierarchy. - - In order to do this you will have to find the `Folder ID` of the - directory you wish rclone to display. This will be the last segment - of the URL when you open the relevant folder in the Box web - interface. - - So if the folder you want rclone to use has a URL which looks like - `https://app.box.com/folder/11xxxxxxxxx8` - in the browser, then you use `11xxxxxxxxx8` as - the `root_folder_id` in the config. - - - ### Standard options - - Here are the Standard options specific to box (Box). - - #### --box-client-id - - OAuth Client Id. - - Leave blank normally. - - Properties: - - - Config: client_id - - Env Var: RCLONE_BOX_CLIENT_ID - - Type: string - - Required: false - - #### --box-client-secret - - OAuth Client Secret. + as they can't be used in JSON strings. - Leave blank normally. - Properties: + ### Standard options - - Config: client_secret - - Env Var: RCLONE_BOX_CLIENT_SECRET - - Type: string - - Required: false + Here are the Standard options specific to sharefile (Citrix Sharefile). - #### --box-box-config-file + #### --sharefile-client-id - Box App config.json location + OAuth Client Id. Leave blank normally. - Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. - Properties: - - Config: box_config_file - - Env Var: RCLONE_BOX_BOX_CONFIG_FILE + - Config: client_id + - Env Var: RCLONE_SHAREFILE_CLIENT_ID - Type: string - Required: false - #### --box-access-token + #### --sharefile-client-secret - Box App Primary Access Token + OAuth Client Secret. Leave blank normally. Properties: - - Config: access_token - - Env Var: RCLONE_BOX_ACCESS_TOKEN + - Config: client_secret + - Env Var: RCLONE_SHAREFILE_CLIENT_SECRET - Type: string - Required: false - #### --box-box-sub-type + #### --sharefile-root-folder-id + ID of the root folder. + Leave blank to access "Personal Folders". You can use one of the + standard values here or any folder ID (long hex number ID). Properties: - - Config: box_sub_type - - Env Var: RCLONE_BOX_BOX_SUB_TYPE + - Config: root_folder_id + - Env Var: RCLONE_SHAREFILE_ROOT_FOLDER_ID - Type: string - - Default: "user" + - Required: false - Examples: - - "user" - - Rclone should act on behalf of a user. - - "enterprise" - - Rclone should act on behalf of a service account. + - "" + - Access the Personal Folders (default). + - "favorites" + - Access the Favorites folder. + - "allshared" + - Access all the shared folders. + - "connectors" + - Access all the individual connectors. + - "top" + - Access the home, favorites, and shared folders as well as the connectors. ### Advanced options - Here are the Advanced options specific to box (Box). + Here are the Advanced options specific to sharefile (Citrix Sharefile). - #### --box-token + #### --sharefile-token OAuth Access Token as a JSON blob. Properties: - Config: token - - Env Var: RCLONE_BOX_TOKEN + - Env Var: RCLONE_SHAREFILE_TOKEN - Type: string - Required: false - #### --box-auth-url + #### --sharefile-auth-url Auth server URL. @@ -26583,11 +28335,11 @@ c) Delete this remote y/e/d> y Properties: - Config: auth_url - - Env Var: RCLONE_BOX_AUTH_URL + - Env Var: RCLONE_SHAREFILE_AUTH_URL - Type: string - Required: false - #### --box-token-url + #### --sharefile-token-url Token server url. @@ -26596,88 +28348,55 @@ c) Delete this remote y/e/d> y Properties: - Config: token_url - - Env Var: RCLONE_BOX_TOKEN_URL + - Env Var: RCLONE_SHAREFILE_TOKEN_URL - Type: string - Required: false - #### --box-root-folder-id - - Fill in for rclone to use a non root folder as its starting point. - - Properties: - - - Config: root_folder_id - - Env Var: RCLONE_BOX_ROOT_FOLDER_ID - - Type: string - - Default: "0" - - #### --box-upload-cutoff + #### --sharefile-upload-cutoff - Cutoff for switching to multipart upload (>= 50 MiB). + Cutoff for switching to multipart upload. Properties: - Config: upload_cutoff - - Env Var: RCLONE_BOX_UPLOAD_CUTOFF + - Env Var: RCLONE_SHAREFILE_UPLOAD_CUTOFF - Type: SizeSuffix - - Default: 50Mi - - #### --box-commit-retries - - Max number of times to try committing a multipart file. - - Properties: - - - Config: commit_retries - - Env Var: RCLONE_BOX_COMMIT_RETRIES - - Type: int - - Default: 100 - - #### --box-list-chunk + - Default: 128Mi - Size of listing chunk 1-1000. + #### --sharefile-chunk-size - Properties: + Upload chunk size. - - Config: list_chunk - - Env Var: RCLONE_BOX_LIST_CHUNK - - Type: int - - Default: 1000 + Must a power of 2 >= 256k. - #### --box-owned-by + Making this larger will improve performance, but note that each chunk + is buffered in memory one per transfer. - Only show items owned by the login (email address) passed in. + Reducing this will reduce memory usage but decrease performance. Properties: - - Config: owned_by - - Env Var: RCLONE_BOX_OWNED_BY - - Type: string - - Required: false - - #### --box-impersonate - - Impersonate this user ID when using a service account. + - Config: chunk_size + - Env Var: RCLONE_SHAREFILE_CHUNK_SIZE + - Type: SizeSuffix + - Default: 64Mi - Settng this flag allows rclone, when using a JWT service account, to - act on behalf of another user by setting the as-user header. + #### --sharefile-endpoint - The user ID is the Box identifier for a user. User IDs can found for - any user via the GET /users endpoint, which is only available to - admins, or by calling the GET /users/me endpoint with an authenticated - user session. + Endpoint for API calls. - See: https://developer.box.com/guides/authentication/jwt/as-user/ + This is usually auto discovered as part of the oauth process, but can + be set manually to something like: https://XXX.sharefile.com Properties: - - Config: impersonate - - Env Var: RCLONE_BOX_IMPERSONATE + - Config: endpoint + - Env Var: RCLONE_SHAREFILE_ENDPOINT - Type: string - Required: false - #### --box-encoding + #### --sharefile-encoding The encoding for the backend. @@ -26686,319 +28405,376 @@ c) Delete this remote y/e/d> y Properties: - Config: encoding - - Env Var: RCLONE_BOX_ENCODING - - Type: MultiEncoder - - Default: Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot - + - Env Var: RCLONE_SHAREFILE_ENCODING + - Type: Encoding + - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot ## Limitations - Note that Box is case insensitive so you can't have a file called + Note that ShareFile is case insensitive so you can't have a file called "Hello.doc" and one called "hello.doc". - Box file names can't have the `\` character in. rclone maps this to - and from an identical looking unicode equivalent `\` (U+FF3C Fullwidth - Reverse Solidus). - - Box only supports filenames up to 255 characters in length. - - Box has [API rate limits](https://developer.box.com/guides/api-calls/permissions-and-errors/rate-limits/) that sometimes reduce the speed of rclone. + ShareFile only supports filenames up to 256 characters in length. - `rclone about` is not supported by the Box backend. Backends without + `rclone about` is not supported by the Citrix ShareFile backend. Backends without this capability cannot determine free space for an rclone mount or use policy `mfs` (most free space) as a member of an rclone union remote. See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) - ## Get your own Box App ID - - Here is how to create your own Box App ID for rclone: - - 1. Go to the [Box Developer Console](https://app.box.com/developers/console) - and login, then click `My Apps` on the sidebar. Click `Create New App` - and select `Custom App`. - - 2. In the first screen on the box that pops up, you can pretty much enter - whatever you want. The `App Name` can be whatever. For `Purpose` choose - automation to avoid having to fill out anything else. Click `Next`. - - 3. In the second screen of the creation screen, select - `User Authentication (OAuth 2.0)`. Then click `Create App`. + # Crypt - 4. You should now be on the `Configuration` tab of your new app. If not, - click on it at the top of the webpage. Copy down `Client ID` - and `Client Secret`, you'll need those for rclone. + Rclone `crypt` remotes encrypt and decrypt other remotes. - 5. Under "OAuth 2.0 Redirect URI", add `http://127.0.0.1:53682/` + A remote of type `crypt` does not access a [storage system](https://rclone.org/overview/) + directly, but instead wraps another remote, which in turn accesses + the storage system. This is similar to how [alias](https://rclone.org/alias/), + [union](https://rclone.org/union/), [chunker](https://rclone.org/chunker/) + and a few others work. It makes the usage very flexible, as you can + add a layer, in this case an encryption layer, on top of any other + backend, even in multiple layers. Rclone's functionality + can be used as with any other remote, for example you can + [mount](https://rclone.org/commands/rclone_mount/) a crypt remote. - 6. For `Application Scopes`, select `Read all files and folders stored in Box` - and `Write all files and folders stored in box` (assuming you want to do both). - Leave others unchecked. Click `Save Changes` at the top right. + Accessing a storage system through a crypt remote realizes client-side + encryption, which makes it safe to keep your data in a location you do + not trust will not get compromised. + When working against the `crypt` remote, rclone will automatically + encrypt (before uploading) and decrypt (after downloading) on your local + system as needed on the fly, leaving the data encrypted at rest in the + wrapped remote. If you access the storage system using an application + other than rclone, or access the wrapped remote directly using rclone, + there will not be any encryption/decryption: Downloading existing content + will just give you the encrypted (scrambled) format, and anything you + upload will *not* become encrypted. - # Cache + The encryption is a secret-key encryption (also called symmetric key encryption) + algorithm, where a password (or pass phrase) is used to generate real encryption key. + The password can be supplied by user, or you may chose to let rclone + generate one. It will be stored in the configuration file, in a lightly obscured form. + If you are in an environment where you are not able to keep your configuration + secured, you should add + [configuration encryption](https://rclone.org/docs/#configuration-encryption) + as protection. As long as you have this configuration file, you will be able to + decrypt your data. Without the configuration file, as long as you remember + the password (or keep it in a safe place), you can re-create the configuration + and gain access to the existing data. You may also configure a corresponding + remote in a different installation to access the same data. + See below for guidance to [changing password](#changing-password). - The `cache` remote wraps another existing remote and stores file structure - and its data for long running tasks like `rclone mount`. + Encryption uses [cryptographic salt](https://en.wikipedia.org/wiki/Salt_(cryptography)), + to permute the encryption key so that the same string may be encrypted in + different ways. When configuring the crypt remote it is optional to enter a salt, + or to let rclone generate a unique salt. If omitted, rclone uses a built-in unique string. + Normally in cryptography, the salt is stored together with the encrypted content, + and do not have to be memorized by the user. This is not the case in rclone, + because rclone does not store any additional information on the remotes. Use of + custom salt is effectively a second password that must be memorized. - ## Status + [File content](#file-encryption) encryption is performed using + [NaCl SecretBox](https://godoc.org/golang.org/x/crypto/nacl/secretbox), + based on XSalsa20 cipher and Poly1305 for integrity. + [Names](#name-encryption) (file- and directory names) are also encrypted + by default, but this has some implications and is therefore + possible to be turned off. - The cache backend code is working but it currently doesn't - have a maintainer so there are [outstanding bugs](https://github.com/rclone/rclone/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3A%22Remote%3A+Cache%22) which aren't getting fixed. + ## Configuration - The cache backend is due to be phased out in favour of the VFS caching - layer eventually which is more tightly integrated into rclone. + Here is an example of how to make a remote called `secret`. - Until this happens we recommend only using the cache backend if you - find you can't work without it. There are many docs online describing - the use of the cache backend to minimize API hits and by-and-large - these are out of date and the cache backend isn't needed in those - scenarios any more. + To use `crypt`, first set up the underlying remote. Follow the + `rclone config` instructions for the specific backend. - ## Configuration + Before configuring the crypt remote, check the underlying remote is + working. In this example the underlying remote is called `remote`. + We will configure a path `path` within this remote to contain the + encrypted content. Anything inside `remote:path` will be encrypted + and anything outside will not. - To get started you just need to have an existing remote which can be configured - with `cache`. + Configure `crypt` using `rclone config`. In this example the `crypt` + remote is called `secret`, to differentiate it from the underlying + `remote`. - Here is an example of how to make a remote called `test-cache`. First run: + When you are done you can use the crypt remote named `secret` just + as you would with any other remote, e.g. `rclone copy D:\docs secret:\docs`, + and rclone will encrypt and decrypt as needed on the fly. + If you access the wrapped remote `remote:path` directly you will bypass + the encryption, and anything you read will be in encrypted form, and + anything you write will be unencrypted. To avoid issues it is best to + configure a dedicated path for encrypted content, and access it + exclusively through a crypt remote. - rclone config +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> secret Type of storage to +configure. Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value [snip] XX / +Encrypt/Decrypt a remote  "crypt" [snip] Storage> crypt ** See help for +crypt backend at: https://rclone.org/crypt/ ** - This will guide you through an interactive setup process: +Remote to encrypt/decrypt. Normally should contain a ':' and a path, eg +"myremote:path/to/dir", "myremote:bucket" or maybe "myremote:" (not +recommended). Enter a string value. Press Enter for the default (""). +remote> remote:path How to encrypt the filenames. Enter a string value. +Press Enter for the default ("standard"). Choose a number from below, or +type in your own value. / Encrypt the filenames. 1 | See the docs for +the details.  "standard" 2 / Very simple filename obfuscation. + "obfuscate" / Don't encrypt the file names. 3 | Adds a ".bin" extension +only.  "off" filename_encryption> Option to either encrypt directory +names or leave them intact. -No remotes found, make a new one? n) New remote r) Rename remote c) Copy -remote s) Set configuration password q) Quit config n/r/c/s/q> n name> -test-cache Type of storage to configure. Choose a number from below, or -type in your own value [snip] XX / Cache a remote  "cache" [snip] -Storage> cache Remote to cache. Normally should contain a ':' and a -path, e.g. "myremote:path/to/dir", "myremote:bucket" or maybe -"myremote:" (not recommended). remote> local:/test Optional: The URL of -the Plex server plex_url> http://127.0.0.1:32400 Optional: The username -of the Plex user plex_username> dummyusername Optional: The password of -the Plex user y) Yes type in my own password g) Generate random password -n) No leave this optional password blank y/g/n> y Enter the password: -password: Confirm the password: password: The size of a chunk. Lower -value good for slow connections but can affect seamless reading. -Default: 5M Choose a number from below, or type in your own value 1 / 1 -MiB  "1M" 2 / 5 MiB  "5M" 3 / 10 MiB  "10M" chunk_size> 2 How much time -should object info (file size, file hashes, etc.) be stored in cache. -Use a very high value if you don't plan on changing the source FS from -outside the cache. Accepted units are: "s", "m", "h". Default: 5m Choose -a number from below, or type in your own value 1 / 1 hour  "1h" 2 / 24 -hours  "24h" 3 / 24 hours  "48h" info_age> 2 The maximum size of stored -chunks. When the storage grows beyond this size, the oldest chunks will -be deleted. Default: 10G Choose a number from below, or type in your own -value 1 / 500 MiB  "500M" 2 / 1 GiB  "1G" 3 / 10 GiB  "10G" -chunk_total_size> 3 Remote config -------------------- [test-cache] -remote = local:/test plex_url = http://127.0.0.1:32400 plex_username = -dummyusername plex_password = *** ENCRYPTED *** chunk_size = 5M info_age -= 48h chunk_total_size = 10G +NB If filename_encryption is "off" then this option will do nothing. +Enter a boolean value (true or false). Press Enter for the default +("true"). Choose a number from below, or type in your own value 1 / +Encrypt directory names.  "true" 2 / Don't encrypt directory names, +leave them intact.  "false" directory_name_encryption> Password or pass +phrase for encryption. y) Yes type in my own password g) Generate random +password y/g> y Enter the password: password: Confirm the password: +password: Password or pass phrase for salt. Optional but recommended. +Should be different to the previous password. y) Yes type in my own +password g) Generate random password n) No leave this optional password +blank (default) y/g/n> g Password strength in bits. 64 is just about +memorable 128 is secure 1024 is the maximum Bits> 128 Your password is: +JAsJvRcgR-_veXNfy_sGmQ Use this password? Please note that an obscured +version of this password (and not the password itself) will be stored +under your configuration file, so keep this generated password in a safe +place. y) Yes (default) n) No y/n> Edit advanced config? (y/n) y) Yes n) +No (default) y/n> Remote config -------------------- [secret] type = +crypt remote = remote:path password = *** ENCRYPTED password2 = +ENCRYPTED *** -------------------- y) Yes this is OK (default) e) Edit +this remote d) Delete this remote y/e/d> - You can then use it like this, + **Important** The crypt password stored in `rclone.conf` is lightly + obscured. That only protects it from cursory inspection. It is not + secure unless [configuration encryption](https://rclone.org/docs/#configuration-encryption) of `rclone.conf` is specified. - List directories in top level of your drive + A long passphrase is recommended, or `rclone config` can generate a + random one. - rclone lsd test-cache: + The obscured password is created using AES-CTR with a static key. The + salt is stored verbatim at the beginning of the obscured password. This + static key is shared between all versions of rclone. - List all the files in your drive + If you reconfigure rclone with the same passwords/passphrases + elsewhere it will be compatible, but the obscured version will be different + due to the different salt. - rclone ls test-cache: + Rclone does not encrypt - To start a cached mount + * file length - this can be calculated within 16 bytes + * modification time - used for syncing - rclone mount --allow-other test-cache: /var/tmp/test-cache + ### Specifying the remote - ### Write Features ### + When configuring the remote to encrypt/decrypt, you may specify any + string that rclone accepts as a source/destination of other commands. - ### Offline uploading ### + The primary use case is to specify the path into an already configured + remote (e.g. `remote:path/to/dir` or `remote:bucket`), such that + data in a remote untrusted location can be stored encrypted. - In an effort to make writing through cache more reliable, the backend - now supports this feature which can be activated by specifying a - `cache-tmp-upload-path`. + You may also specify a local filesystem path, such as + `/path/to/dir` on Linux, `C:\path\to\dir` on Windows. By creating + a crypt remote pointing to such a local filesystem path, you can + use rclone as a utility for pure local file encryption, for example + to keep encrypted files on a removable USB drive. - A files goes through these states when using this feature: + **Note**: A string which do not contain a `:` will by rclone be treated + as a relative path in the local filesystem. For example, if you enter + the name `remote` without the trailing `:`, it will be treated as + a subdirectory of the current directory with name "remote". - 1. An upload is started (usually by copying a file on the cache remote) - 2. When the copy to the temporary location is complete the file is part - of the cached remote and looks and behaves like any other file (reading included) - 3. After `cache-tmp-wait-time` passes and the file is next in line, `rclone move` - is used to move the file to the cloud provider - 4. Reading the file still works during the upload but most modifications on it will be prohibited - 5. Once the move is complete the file is unlocked for modifications as it - becomes as any other regular file - 6. If the file is being read through `cache` when it's actually - deleted from the temporary path then `cache` will simply swap the source - to the cloud provider without interrupting the reading (small blip can happen though) + If a path `remote:path/to/dir` is specified, rclone stores encrypted + files in `path/to/dir` on the remote. With file name encryption, files + saved to `secret:subdir/subfile` are stored in the unencrypted path + `path/to/dir` but the `subdir/subpath` element is encrypted. - Files are uploaded in sequence and only one file is uploaded at a time. - Uploads will be stored in a queue and be processed based on the order they were added. - The queue and the temporary storage is persistent across restarts but - can be cleared on startup with the `--cache-db-purge` flag. + The path you specify does not have to exist, rclone will create + it when needed. - ### Write Support ### + If you intend to use the wrapped remote both directly for keeping + unencrypted content, as well as through a crypt remote for encrypted + content, it is recommended to point the crypt remote to a separate + directory within the wrapped remote. If you use a bucket-based storage + system (e.g. Swift, S3, Google Compute Storage, B2) it is generally + advisable to wrap the crypt remote around a specific bucket (`s3:bucket`). + If wrapping around the entire root of the storage (`s3:`), and use the + optional file name encryption, rclone will encrypt the bucket name. - Writes are supported through `cache`. - One caveat is that a mounted cache remote does not add any retry or fallback - mechanism to the upload operation. This will depend on the implementation - of the wrapped remote. Consider using `Offline uploading` for reliable writes. + ### Changing password - One special case is covered with `cache-writes` which will cache the file - data at the same time as the upload when it is enabled making it available - from the cache store immediately once the upload is finished. + Should the password, or the configuration file containing a lightly obscured + form of the password, be compromised, you need to re-encrypt your data with + a new password. Since rclone uses secret-key encryption, where the encryption + key is generated directly from the password kept on the client, it is not + possible to change the password/key of already encrypted content. Just changing + the password configured for an existing crypt remote means you will no longer + able to decrypt any of the previously encrypted content. The only possibility + is to re-upload everything via a crypt remote configured with your new password. - ### Read Features ### + Depending on the size of your data, your bandwidth, storage quota etc, there are + different approaches you can take: + - If you have everything in a different location, for example on your local system, + you could remove all of the prior encrypted files, change the password for your + configured crypt remote (or delete and re-create the crypt configuration), + and then re-upload everything from the alternative location. + - If you have enough space on the storage system you can create a new crypt + remote pointing to a separate directory on the same backend, and then use + rclone to copy everything from the original crypt remote to the new, + effectively decrypting everything on the fly using the old password and + re-encrypting using the new password. When done, delete the original crypt + remote directory and finally the rclone crypt configuration with the old password. + All data will be streamed from the storage system and back, so you will + get half the bandwidth and be charged twice if you have upload and download quota + on the storage system. - #### Multiple connections #### + **Note**: A security problem related to the random password generator + was fixed in rclone version 1.53.3 (released 2020-11-19). Passwords generated + by rclone config in version 1.49.0 (released 2019-08-26) to 1.53.2 + (released 2020-10-26) are not considered secure and should be changed. + If you made up your own password, or used rclone version older than 1.49.0 or + newer than 1.53.2 to generate it, you are *not* affected by this issue. + See [issue #4783](https://github.com/rclone/rclone/issues/4783) for more + details, and a tool you can use to check if you are affected. - To counter the high latency between a local PC where rclone is running - and cloud providers, the cache remote can split multiple requests to the - cloud provider for smaller file chunks and combines them together locally - where they can be available almost immediately before the reader usually - needs them. + ### Example - This is similar to buffering when media files are played online. Rclone - will stay around the current marker but always try its best to stay ahead - and prepare the data before. + Create the following file structure using "standard" file name + encryption. - #### Plex Integration #### +plaintext/ ├── file0.txt ├── file1.txt └── subdir ├── file2.txt ├── +file3.txt └── subsubdir └── file4.txt - There is a direct integration with Plex which allows cache to detect during reading - if the file is in playback or not. This helps cache to adapt how it queries - the cloud provider depending on what is needed for. - Scans will have a minimum amount of workers (1) while in a confirmed playback cache - will deploy the configured number of workers. + Copy these to the remote, and list them - This integration opens the doorway to additional performance improvements - which will be explored in the near future. +$ rclone -q copy plaintext secret: $ rclone -q ls secret: 7 file1.txt 6 +file0.txt 8 subdir/file2.txt 10 subdir/subsubdir/file4.txt 9 +subdir/file3.txt - **Note:** If Plex options are not configured, `cache` will function with its - configured options without adapting any of its settings. - How to enable? Run `rclone config` and add all the Plex options (endpoint, username - and password) in your remote and it will be automatically enabled. + The crypt remote looks like - Affected settings: - - `cache-workers`: _Configured value_ during confirmed playback or _1_ all the other times +$ rclone -q ls remote:path 55 hagjclgavj2mbiqm6u6cnjjqcg 54 +v05749mltvv1tf4onltun46gls 57 +86vhrsv86mpbtd3a0akjuqslj8/dlj7fkq4kdq72emafg7a7s41uo 58 +86vhrsv86mpbtd3a0akjuqslj8/7uu829995du6o42n32otfhjqp4/b9pausrfansjth5ob3jkdqd4lc +56 86vhrsv86mpbtd3a0akjuqslj8/8njh1sk437gttmep3p70g81aps - ##### Certificate Validation ##### - When the Plex server is configured to only accept secure connections, it is - possible to use `.plex.direct` URLs to ensure certificate validation succeeds. - These URLs are used by Plex internally to connect to the Plex server securely. + The directory structure is preserved - The format for these URLs is the following: +$ rclone -q ls secret:subdir 8 file2.txt 9 file3.txt 10 +subsubdir/file4.txt - `https://ip-with-dots-replaced.server-hash.plex.direct:32400/` - The `ip-with-dots-replaced` part can be any IPv4 address, where the dots - have been replaced with dashes, e.g. `127.0.0.1` becomes `127-0-0-1`. + Without file name encryption `.bin` extensions are added to underlying + names. This prevents the cloud provider attempting to interpret file + content. - To get the `server-hash` part, the easiest way is to visit +$ rclone -q ls remote:path 54 file0.txt.bin 57 subdir/file3.txt.bin 56 +subdir/file2.txt.bin 58 subdir/subsubdir/file4.txt.bin 55 file1.txt.bin - https://plex.tv/api/resources?includeHttps=1&X-Plex-Token=your-plex-token - This page will list all the available Plex servers for your account - with at least one `.plex.direct` link for each. Copy one URL and replace - the IP address with the desired address. This can be used as the - `plex_url` value. + ### File name encryption modes - ### Known issues ### + Off - #### Mount and --dir-cache-time #### + * doesn't hide file names or directory structure + * allows for longer file names (~246 characters) + * can use sub paths and copy single files - --dir-cache-time controls the first layer of directory caching which works at the mount layer. - Being an independent caching mechanism from the `cache` backend, it will manage its own entries - based on the configured time. + Standard - To avoid getting in a scenario where dir cache has obsolete data and cache would have the correct - one, try to set `--dir-cache-time` to a lower time than `--cache-info-age`. Default values are - already configured in this way. + * file names encrypted + * file names can't be as long (~143 characters) + * can use sub paths and copy single files + * directory structure visible + * identical files names will have identical uploaded names + * can use shortcuts to shorten the directory recursion - #### Windows support - Experimental #### + Obfuscation - There are a couple of issues with Windows `mount` functionality that still require some investigations. - It should be considered as experimental thus far as fixes come in for this OS. + This is a simple "rotate" of the filename, with each file having a rot + distance based on the filename. Rclone stores the distance at the + beginning of the filename. A file called "hello" may become "53.jgnnq". - Most of the issues seem to be related to the difference between filesystems - on Linux flavors and Windows as cache is heavily dependent on them. + Obfuscation is not a strong encryption of filenames, but hinders + automated scanning tools picking up on filename patterns. It is an + intermediate between "off" and "standard" which allows for longer path + segment names. - Any reports or feedback on how cache behaves on this OS is greatly appreciated. - - - https://github.com/rclone/rclone/issues/1935 - - https://github.com/rclone/rclone/issues/1907 - - https://github.com/rclone/rclone/issues/1834 + There is a possibility with some unicode based filenames that the + obfuscation is weak and may map lower case characters to upper case + equivalents. - #### Risk of throttling #### + Obfuscation cannot be relied upon for strong protection. - Future iterations of the cache backend will make use of the pooling functionality - of the cloud provider to synchronize and at the same time make writing through it - more tolerant to failures. + * file names very lightly obfuscated + * file names can be longer than standard encryption + * can use sub paths and copy single files + * directory structure visible + * identical files names will have identical uploaded names - There are a couple of enhancements in track to add these but in the meantime - there is a valid concern that the expiring cache listings can lead to cloud provider - throttles or bans due to repeated queries on it for very large mounts. + Cloud storage systems have limits on file name length and + total path length which rclone is more likely to breach using + "Standard" file name encryption. Where file names are less than 156 + characters in length issues should not be encountered, irrespective of + cloud storage provider. - Some recommendations: - - don't use a very small interval for entry information (`--cache-info-age`) - - while writes aren't yet optimised, you can still write through `cache` which gives you the advantage - of adding the file in the cache at the same time if configured to do so. + An experimental advanced option `filename_encoding` is now provided to + address this problem to a certain degree. + For cloud storage systems with case sensitive file names (e.g. Google Drive), + `base64` can be used to reduce file name length. + For cloud storage systems using UTF-16 to store file names internally + (e.g. OneDrive, Dropbox, Box), `base32768` can be used to drastically reduce + file name length. - Future enhancements: + An alternative, future rclone file name encryption mode may tolerate + backend provider path length limits. - - https://github.com/rclone/rclone/issues/1937 - - https://github.com/rclone/rclone/issues/1936 + ### Directory name encryption - #### cache and crypt #### + Crypt offers the option of encrypting dir names or leaving them intact. + There are two options: - One common scenario is to keep your data encrypted in the cloud provider - using the `crypt` remote. `crypt` uses a similar technique to wrap around - an existing remote and handles this translation in a seamless way. + True - There is an issue with wrapping the remotes in this order: - **cloud remote** -> **crypt** -> **cache** + Encrypts the whole file path including directory names + Example: + `1/12/123.txt` is encrypted to + `p0e52nreeaj0a5ea7s64m4j72s/l42g6771hnv3an9cgc8cr2n1ng/qgm4avr35m5loi1th53ato71v0` - During testing, I experienced a lot of bans with the remotes in this order. - I suspect it might be related to how crypt opens files on the cloud provider - which makes it think we're downloading the full file instead of small chunks. - Organizing the remotes in this order yields better results: - **cloud remote** -> **cache** -> **crypt** + False - #### absolute remote paths #### + Only encrypts file names, skips directory names + Example: + `1/12/123.txt` is encrypted to + `1/12/qgm4avr35m5loi1th53ato71v0` - `cache` can not differentiate between relative and absolute paths for the wrapped remote. - Any path given in the `remote` config setting and on the command line will be passed to - the wrapped remote as is, but for storing the chunks on disk the path will be made - relative by removing any leading `/` character. - This behavior is irrelevant for most backend types, but there are backends where a leading `/` - changes the effective directory, e.g. in the `sftp` backend paths starting with a `/` are - relative to the root of the SSH server and paths without are relative to the user home directory. - As a result `sftp:bin` and `sftp:/bin` will share the same cache folder, even if they represent - a different directory on the SSH server. + ### Modification times and hashes - ### Cache and Remote Control (--rc) ### - Cache supports the new `--rc` mode in rclone and can be remote controlled through the following end points: - By default, the listener is disabled if you do not add the flag. + Crypt stores modification times using the underlying remote so support + depends on that. - ### rc cache/expire - Purge a remote from the cache backend. Supports either a directory or a file. - It supports both encrypted and unencrypted file names if cache is wrapped by crypt. + Hashes are not stored for crypt. However the data integrity is + protected by an extremely strong crypto authenticator. - Params: - - **remote** = path to remote **(required)** - - **withData** = true/false to delete cached data (chunks) as well _(optional, false by default)_ + Use the `rclone cryptcheck` command to check the + integrity of an encrypted remote instead of `rclone check` which can't + check the checksums properly. ### Standard options - Here are the Standard options specific to cache (Cache a remote). + Here are the Standard options specific to crypt (Encrypt/Decrypt a remote). - #### --cache-remote + #### --crypt-remote - Remote to cache. + Remote to encrypt/decrypt. Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", "myremote:bucket" or maybe "myremote:" (not recommended). @@ -27006,822 +28782,645 @@ dummyusername plex_password = *** ENCRYPTED *** chunk_size = 5M info_age Properties: - Config: remote - - Env Var: RCLONE_CACHE_REMOTE + - Env Var: RCLONE_CRYPT_REMOTE - Type: string - Required: true - #### --cache-plex-url + #### --crypt-filename-encryption - The URL of the Plex server. + How to encrypt the filenames. Properties: - - Config: plex_url - - Env Var: RCLONE_CACHE_PLEX_URL + - Config: filename_encryption + - Env Var: RCLONE_CRYPT_FILENAME_ENCRYPTION - Type: string - - Required: false + - Default: "standard" + - Examples: + - "standard" + - Encrypt the filenames. + - See the docs for the details. + - "obfuscate" + - Very simple filename obfuscation. + - "off" + - Don't encrypt the file names. + - Adds a ".bin", or "suffix" extension only. - #### --cache-plex-username + #### --crypt-directory-name-encryption - The username of the Plex user. + Option to either encrypt directory names or leave them intact. + + NB If filename_encryption is "off" then this option will do nothing. Properties: - - Config: plex_username - - Env Var: RCLONE_CACHE_PLEX_USERNAME - - Type: string - - Required: false + - Config: directory_name_encryption + - Env Var: RCLONE_CRYPT_DIRECTORY_NAME_ENCRYPTION + - Type: bool + - Default: true + - Examples: + - "true" + - Encrypt directory names. + - "false" + - Don't encrypt directory names, leave them intact. - #### --cache-plex-password + #### --crypt-password - The password of the Plex user. + Password or pass phrase for encryption. **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: - - Config: plex_password - - Env Var: RCLONE_CACHE_PLEX_PASSWORD + - Config: password + - Env Var: RCLONE_CRYPT_PASSWORD - Type: string - - Required: false + - Required: true - #### --cache-chunk-size + #### --crypt-password2 - The size of a chunk (partial file data). + Password or pass phrase for salt. - Use lower numbers for slower connections. If the chunk size is - changed, any downloaded chunks will be invalid and cache-chunk-path - will need to be cleared or unexpected EOF errors will occur. + Optional but recommended. + Should be different to the previous password. + + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: - - Config: chunk_size - - Env Var: RCLONE_CACHE_CHUNK_SIZE - - Type: SizeSuffix - - Default: 5Mi - - Examples: - - "1M" - - 1 MiB - - "5M" - - 5 MiB - - "10M" - - 10 MiB + - Config: password2 + - Env Var: RCLONE_CRYPT_PASSWORD2 + - Type: string + - Required: false - #### --cache-info-age + ### Advanced options - How long to cache file structure information (directory listings, file size, times, etc.). - If all write operations are done through the cache then you can safely make - this value very large as the cache store will also be updated in real time. + Here are the Advanced options specific to crypt (Encrypt/Decrypt a remote). - Properties: + #### --crypt-server-side-across-configs - - Config: info_age - - Env Var: RCLONE_CACHE_INFO_AGE - - Type: Duration - - Default: 6h0m0s - - Examples: - - "1h" - - 1 hour - - "24h" - - 24 hours - - "48h" - - 48 hours + Deprecated: use --server-side-across-configs instead. - #### --cache-chunk-total-size + Allow server-side operations (e.g. copy) to work across different crypt configs. - The total size that the chunks can take up on the local disk. + Normally this option is not what you want, but if you have two crypts + pointing to the same backend you can use it. - If the cache exceeds this value then it will start to delete the - oldest chunks until it goes under this value. + This can be used, for example, to change file name encryption type + without re-uploading all the data. Just make two crypt backends + pointing to two different directories with the single changed + parameter and use rclone move to move the files between the crypt + remotes. Properties: - - Config: chunk_total_size - - Env Var: RCLONE_CACHE_CHUNK_TOTAL_SIZE - - Type: SizeSuffix - - Default: 10Gi - - Examples: - - "500M" - - 500 MiB - - "1G" - - 1 GiB - - "10G" - - 10 GiB + - Config: server_side_across_configs + - Env Var: RCLONE_CRYPT_SERVER_SIDE_ACROSS_CONFIGS + - Type: bool + - Default: false - ### Advanced options + #### --crypt-show-mapping - Here are the Advanced options specific to cache (Cache a remote). + For all files listed show how the names encrypt. - #### --cache-plex-token + If this flag is set then for each file that the remote is asked to + list, it will log (at level INFO) a line stating the decrypted file + name and the encrypted file name. - The plex token for authentication - auto set normally. + This is so you can work out which encrypted names are which decrypted + names just in case you need to do something with the encrypted file + names, or for debugging purposes. Properties: - - Config: plex_token - - Env Var: RCLONE_CACHE_PLEX_TOKEN - - Type: string - - Required: false + - Config: show_mapping + - Env Var: RCLONE_CRYPT_SHOW_MAPPING + - Type: bool + - Default: false - #### --cache-plex-insecure + #### --crypt-no-data-encryption - Skip all certificate verification when connecting to the Plex server. + Option to either encrypt file data or leave it unencrypted. Properties: - - Config: plex_insecure - - Env Var: RCLONE_CACHE_PLEX_INSECURE - - Type: string - - Required: false + - Config: no_data_encryption + - Env Var: RCLONE_CRYPT_NO_DATA_ENCRYPTION + - Type: bool + - Default: false + - Examples: + - "true" + - Don't encrypt file data, leave it unencrypted. + - "false" + - Encrypt file data. - #### --cache-db-path + #### --crypt-pass-bad-blocks - Directory to store file structure metadata DB. + If set this will pass bad blocks through as all 0. - The remote name is used as the DB file name. + This should not be set in normal operation, it should only be set if + trying to recover an encrypted file with errors and it is desired to + recover as much of the file as possible. Properties: - - Config: db_path - - Env Var: RCLONE_CACHE_DB_PATH - - Type: string - - Default: "$HOME/.cache/rclone/cache-backend" - - #### --cache-chunk-path + - Config: pass_bad_blocks + - Env Var: RCLONE_CRYPT_PASS_BAD_BLOCKS + - Type: bool + - Default: false - Directory to cache chunk files. + #### --crypt-filename-encoding - Path to where partial file data (chunks) are stored locally. The remote - name is appended to the final path. + How to encode the encrypted filename to text string. - This config follows the "--cache-db-path". If you specify a custom - location for "--cache-db-path" and don't specify one for "--cache-chunk-path" - then "--cache-chunk-path" will use the same path as "--cache-db-path". + This option could help with shortening the encrypted filename. The + suitable option would depend on the way your remote count the filename + length and if it's case sensitive. Properties: - - Config: chunk_path - - Env Var: RCLONE_CACHE_CHUNK_PATH + - Config: filename_encoding + - Env Var: RCLONE_CRYPT_FILENAME_ENCODING - Type: string - - Default: "$HOME/.cache/rclone/cache-backend" - - #### --cache-db-purge + - Default: "base32" + - Examples: + - "base32" + - Encode using base32. Suitable for all remote. + - "base64" + - Encode using base64. Suitable for case sensitive remote. + - "base32768" + - Encode using base32768. Suitable if your remote counts UTF-16 or + - Unicode codepoint instead of UTF-8 byte length. (Eg. Onedrive, Dropbox) - Clear all the cached data for this remote on start. + #### --crypt-suffix - Properties: + If this is set it will override the default suffix of ".bin". - - Config: db_purge - - Env Var: RCLONE_CACHE_DB_PURGE - - Type: bool - - Default: false + Setting suffix to "none" will result in an empty suffix. This may be useful + when the path length is critical. - #### --cache-chunk-clean-interval + Properties: - How often should the cache perform cleanups of the chunk storage. + - Config: suffix + - Env Var: RCLONE_CRYPT_SUFFIX + - Type: string + - Default: ".bin" - The default value should be ok for most people. If you find that the - cache goes over "cache-chunk-total-size" too often then try to lower - this value to force it to perform cleanups more often. + ### Metadata - Properties: + Any metadata supported by the underlying remote is read and written. - - Config: chunk_clean_interval - - Env Var: RCLONE_CACHE_CHUNK_CLEAN_INTERVAL - - Type: Duration - - Default: 1m0s + See the [metadata](https://rclone.org/docs/#metadata) docs for more info. - #### --cache-read-retries + ## Backend commands - How many times to retry a read from a cache storage. + Here are the commands specific to the crypt backend. - Since reading from a cache stream is independent from downloading file - data, readers can get to a point where there's no more data in the - cache. Most of the times this can indicate a connectivity issue if - cache isn't able to provide file data anymore. + Run them with - For really slow connections, increase this to a point where the stream is - able to provide data but your experience will be very stuttering. + rclone backend COMMAND remote: - Properties: + The help below will explain what arguments each command takes. - - Config: read_retries - - Env Var: RCLONE_CACHE_READ_RETRIES - - Type: int - - Default: 10 + See the [backend](https://rclone.org/commands/rclone_backend/) command for more + info on how to pass options and arguments. - #### --cache-workers + These can be run on a running backend using the rc command + [backend/command](https://rclone.org/rc/#backend-command). - How many workers should run in parallel to download chunks. + ### encode - Higher values will mean more parallel processing (better CPU needed) - and more concurrent requests on the cloud provider. This impacts - several aspects like the cloud provider API limits, more stress on the - hardware that rclone runs on but it also means that streams will be - more fluid and data will be available much more faster to readers. + Encode the given filename(s) - **Note**: If the optional Plex integration is enabled then this - setting will adapt to the type of reading performed and the value - specified here will be used as a maximum number of workers to use. + rclone backend encode remote: [options] [+] - Properties: + This encodes the filenames given as arguments returning a list of + strings of the encoded results. - - Config: workers - - Env Var: RCLONE_CACHE_WORKERS - - Type: int - - Default: 4 + Usage Example: - #### --cache-chunk-no-memory + rclone backend encode crypt: file1 [file2...] + rclone rc backend/command command=encode fs=crypt: file1 [file2...] - Disable the in-memory cache for storing chunks during streaming. - By default, cache will keep file data during streaming in RAM as well - to provide it to readers as fast as possible. + ### decode - This transient data is evicted as soon as it is read and the number of - chunks stored doesn't exceed the number of workers. However, depending - on other settings like "cache-chunk-size" and "cache-workers" this footprint - can increase if there are parallel streams too (multiple files being read - at the same time). + Decode the given filename(s) - If the hardware permits it, use this feature to provide an overall better - performance during streaming but it can also be disabled if RAM is not - available on the local machine. + rclone backend decode remote: [options] [+] - Properties: + This decodes the filenames given as arguments returning a list of + strings of the decoded results. It will return an error if any of the + inputs are invalid. - - Config: chunk_no_memory - - Env Var: RCLONE_CACHE_CHUNK_NO_MEMORY - - Type: bool - - Default: false + Usage Example: - #### --cache-rps + rclone backend decode crypt: encryptedfile1 [encryptedfile2...] + rclone rc backend/command command=decode fs=crypt: encryptedfile1 [encryptedfile2...] - Limits the number of requests per second to the source FS (-1 to disable). - This setting places a hard limit on the number of requests per second - that cache will be doing to the cloud provider remote and try to - respect that value by setting waits between reads. - If you find that you're getting banned or limited on the cloud - provider through cache and know that a smaller number of requests per - second will allow you to work with it then you can use this setting - for that. - A good balance of all the other settings should make this setting - useless but it is available to set for more special cases. + ## Backing up an encrypted remote - **NOTE**: This will limit the number of requests during streams but - other API calls to the cloud provider like directory listings will - still pass. + If you wish to backup an encrypted remote, it is recommended that you use + `rclone sync` on the encrypted files, and make sure the passwords are + the same in the new encrypted remote. - Properties: + This will have the following advantages - - Config: rps - - Env Var: RCLONE_CACHE_RPS - - Type: int - - Default: -1 + * `rclone sync` will check the checksums while copying + * you can use `rclone check` between the encrypted remotes + * you don't decrypt and encrypt unnecessarily - #### --cache-writes + For example, let's say you have your original remote at `remote:` with + the encrypted version at `eremote:` with path `remote:crypt`. You + would then set up the new remote `remote2:` and then the encrypted + version `eremote2:` with path `remote2:crypt` using the same passwords + as `eremote:`. - Cache file data on writes through the FS. + To sync the two remotes you would do - If you need to read files immediately after you upload them through - cache you can enable this flag to have their data stored in the - cache store at the same time during upload. + rclone sync --interactive remote:crypt remote2:crypt - Properties: + And to check the integrity you would do - - Config: writes - - Env Var: RCLONE_CACHE_WRITES - - Type: bool - - Default: false + rclone check remote:crypt remote2:crypt - #### --cache-tmp-upload-path + ## File formats - Directory to keep temporary files until they are uploaded. + ### File encryption - This is the path where cache will use as a temporary storage for new - files that need to be uploaded to the cloud provider. + Files are encrypted 1:1 source file to destination object. The file + has a header and is divided into chunks. - Specifying a value will enable this feature. Without it, it is - completely disabled and files will be uploaded directly to the cloud - provider + #### Header - Properties: + * 8 bytes magic string `RCLONE\x00\x00` + * 24 bytes Nonce (IV) - - Config: tmp_upload_path - - Env Var: RCLONE_CACHE_TMP_UPLOAD_PATH - - Type: string - - Required: false + The initial nonce is generated from the operating systems crypto + strong random number generator. The nonce is incremented for each + chunk read making sure each nonce is unique for each block written. + The chance of a nonce being reused is minuscule. If you wrote an + exabyte of data (10¹⁸ bytes) you would have a probability of + approximately 2×10⁻³² of re-using a nonce. - #### --cache-tmp-wait-time + #### Chunk - How long should files be stored in local cache before being uploaded. + Each chunk will contain 64 KiB of data, except for the last one which + may have less data. The data chunk is in standard NaCl SecretBox + format. SecretBox uses XSalsa20 and Poly1305 to encrypt and + authenticate messages. - This is the duration that a file must wait in the temporary location - _cache-tmp-upload-path_ before it is selected for upload. + Each chunk contains: - Note that only one file is uploaded at a time and it can take longer - to start the upload if a queue formed for this purpose. + * 16 Bytes of Poly1305 authenticator + * 1 - 65536 bytes XSalsa20 encrypted data - Properties: + 64k chunk size was chosen as the best performing chunk size (the + authenticator takes too much time below this and the performance drops + off due to cache effects above this). Note that these chunks are + buffered in memory so they can't be too big. - - Config: tmp_wait_time - - Env Var: RCLONE_CACHE_TMP_WAIT_TIME - - Type: Duration - - Default: 15s + This uses a 32 byte (256 bit key) key derived from the user password. - #### --cache-db-wait-time + #### Examples - How long to wait for the DB to be available - 0 is unlimited. + 1 byte file will encrypt to - Only one process can have the DB open at any one time, so rclone waits - for this duration for the DB to become available before it gives an - error. + * 32 bytes header + * 17 bytes data chunk - If you set it to 0 then it will wait forever. + 49 bytes total - Properties: + 1 MiB (1048576 bytes) file will encrypt to - - Config: db_wait_time - - Env Var: RCLONE_CACHE_DB_WAIT_TIME - - Type: Duration - - Default: 1s + * 32 bytes header + * 16 chunks of 65568 bytes - ## Backend commands + 1049120 bytes total (a 0.05% overhead). This is the overhead for big + files. - Here are the commands specific to the cache backend. + ### Name encryption - Run them with + File names are encrypted segment by segment - the path is broken up + into `/` separated strings and these are encrypted individually. - rclone backend COMMAND remote: + File segments are padded using PKCS#7 to a multiple of 16 bytes + before encryption. - The help below will explain what arguments each command takes. + They are then encrypted with EME using AES with 256 bit key. EME + (ECB-Mix-ECB) is a wide-block encryption mode presented in the 2003 + paper "A Parallelizable Enciphering Mode" by Halevi and Rogaway. - See the [backend](https://rclone.org/commands/rclone_backend/) command for more - info on how to pass options and arguments. + This makes for deterministic encryption which is what we want - the + same filename must encrypt to the same thing otherwise we can't find + it on the cloud storage system. - These can be run on a running backend using the rc command - [backend/command](https://rclone.org/rc/#backend-command). + This means that - ### stats + * filenames with the same name will encrypt the same + * filenames which start the same won't have a common prefix - Print stats on the cache backend in JSON format. + This uses a 32 byte key (256 bits) and a 16 byte (128 bits) IV both of + which are derived from the user password. - rclone backend stats remote: [options] [+] + After encryption they are written out using a modified version of + standard `base32` encoding as described in RFC4648. The standard + encoding is modified in two ways: + * it becomes lower case (no-one likes upper case filenames!) + * we strip the padding character `=` + `base32` is used rather than the more efficient `base64` so rclone can be + used on case insensitive remotes (e.g. Windows, Amazon Drive). - # Chunker + ### Key derivation - The `chunker` overlay transparently splits large files into smaller chunks - during upload to wrapped remote and transparently assembles them back - when the file is downloaded. This allows to effectively overcome size limits - imposed by storage providers. + Rclone uses `scrypt` with parameters `N=16384, r=8, p=1` with an + optional user supplied salt (password2) to derive the 32+32+16 = 80 + bytes of key material required. If the user doesn't supply a salt + then rclone uses an internal one. - ## Configuration + `scrypt` makes it impractical to mount a dictionary attack on rclone + encrypted data. For full protection against this you should always use + a salt. - To use it, first set up the underlying remote following the configuration - instructions for that remote. You can also use a local pathname instead of - a remote. + ## SEE ALSO - First check your chosen remote is working - we'll call it `remote:path` here. - Note that anything inside `remote:path` will be chunked and anything outside - won't. This means that if you are using a bucket-based remote (e.g. S3, B2, swift) - then you should probably put the bucket in the remote `s3:bucket`. + * [rclone cryptdecode](https://rclone.org/commands/rclone_cryptdecode/) - Show forward/reverse mapping of encrypted filenames - Now configure `chunker` using `rclone config`. We will call this one `overlay` - to separate it from the `remote` itself. + # Compress -No remotes found, make a new one? n) New remote s) Set configuration -password q) Quit config n/s/q> n name> overlay Type of storage to -configure. Choose a number from below, or type in your own value [snip] -XX / Transparently chunk/split large files  "chunker" [snip] Storage> -chunker Remote to chunk/unchunk. Normally should contain a ':' and a -path, e.g. "myremote:path/to/dir", "myremote:bucket" or maybe -"myremote:" (not recommended). Enter a string value. Press Enter for the -default (""). remote> remote:path Files larger than chunk size will be -split in chunks. Enter a size with suffix K,M,G,T. Press Enter for the -default ("2G"). chunk_size> 100M Choose how chunker handles hash sums. -All modes but "none" require metadata. Enter a string value. Press Enter -for the default ("md5"). Choose a number from below, or type in your own -value 1 / Pass any hash supported by wrapped remote for non-chunked -files, return nothing otherwise  "none" 2 / MD5 for composite files - "md5" 3 / SHA1 for composite files  "sha1" 4 / MD5 for all files - "md5all" 5 / SHA1 for all files  "sha1all" 6 / Copying a file to -chunker will request MD5 from the source falling back to SHA1 if -unsupported  "md5quick" 7 / Similar to "md5quick" but prefers SHA1 over -MD5  "sha1quick" hash_type> md5 Edit advanced config? (y/n) y) Yes n) No -y/n> n Remote config -------------------- [overlay] type = chunker -remote = remote:bucket chunk_size = 100M hash_type = md5 --------------------- y) Yes this is OK e) Edit this remote d) Delete -this remote y/e/d> y + ## Warning + This remote is currently **experimental**. Things may break and data may be lost. Anything you do with this remote is + at your own risk. Please understand the risks associated with using experimental code and don't use this remote in + critical applications. - ### Specifying the remote + The `Compress` remote adds compression to another remote. It is best used with remotes containing + many large compressible files. - In normal use, make sure the remote has a `:` in. If you specify the remote - without a `:` then rclone will use a local directory of that name. - So if you use a remote of `/path/to/secret/files` then rclone will - chunk stuff in that directory. If you use a remote of `name` then rclone - will put files in a directory called `name` in the current directory. + ## Configuration + To use this remote, all you need to do is specify another remote and a compression mode to use: - ### Chunking +Current remotes: - When rclone starts a file upload, chunker checks the file size. If it - doesn't exceed the configured chunk size, chunker will just pass the file - to the wrapped remote (however, see caveat below). If a file is large, chunker will transparently cut - data in pieces with temporary names and stream them one by one, on the fly. - Each data chunk will contain the specified number of bytes, except for the - last one which may have less data. If file size is unknown in advance - (this is called a streaming upload), chunker will internally create - a temporary copy, record its size and repeat the above process. +Name Type ==== ==== remote_to_press sometype - When upload completes, temporary chunk files are finally renamed. - This scheme guarantees that operations can be run in parallel and look - from outside as atomic. - A similar method with hidden temporary chunks is used for other operations - (copy/move/rename, etc.). If an operation fails, hidden chunks are normally - destroyed, and the target composite file stays intact. +e) Edit existing remote $ rclone config +f) New remote +g) Delete remote +h) Rename remote +i) Copy remote +j) Set configuration password +k) Quit config e/n/d/r/c/s/q> n name> compress ... 8 / Compress a + remote  "compress" ... Storage> compress ** See help for compress + backend at: https://rclone.org/compress/ ** - When a composite file download is requested, chunker transparently - assembles it by concatenating data chunks in order. As the split is trivial - one could even manually concatenate data chunks together to obtain the - original content. +Remote to compress. Enter a string value. Press Enter for the default +(""). remote> remote_to_press:subdir Compression mode. Enter a string +value. Press Enter for the default ("gzip"). Choose a number from below, +or type in your own value 1 / Gzip compression balanced for speed and +compression strength.  "gzip" compression_mode> gzip Edit advanced +config? (y/n) y) Yes n) No (default) y/n> n Remote config +-------------------- [compress] type = compress remote = +remote_to_press:subdir compression_mode = gzip -------------------- y) +Yes this is OK (default) e) Edit this remote d) Delete this remote +y/e/d> y - When the `list` rclone command scans a directory on wrapped remote, - the potential chunk files are accounted for, grouped and assembled into - composite directory entries. Any temporary chunks are hidden. - List and other commands can sometimes come across composite files with - missing or invalid chunks, e.g. shadowed by like-named directory or - another file. This usually means that wrapped file system has been directly - tampered with or damaged. If chunker detects a missing chunk it will - by default print warning, skip the whole incomplete group of chunks but - proceed with current command. - You can set the `--chunker-fail-hard` flag to have commands abort with - error message in such cases. + ### Compression Modes - **Caveat**: As it is now, chunker will always create a temporary file in the - backend and then rename it, even if the file is below the chunk threshold. - This will result in unnecessary API calls and can severely restrict throughput - when handling transfers primarily composed of small files on some backends (e.g. Box). - A workaround to this issue is to use chunker only for files above the chunk threshold - via `--min-size` and then perform a separate call without chunker on the remaining - files. + Currently only gzip compression is supported. It provides a decent balance between speed and size and is well + supported by other applications. Compression strength can further be configured via an advanced setting where 0 is no + compression and 9 is strongest compression. + ### File types - #### Chunk names + If you open a remote wrapped by compress, you will see that there are many files with an extension corresponding to + the compression algorithm you chose. These files are standard files that can be opened by various archive programs, + but they have some hidden metadata that allows them to be used by rclone. + While you may download and decompress these files at will, do **not** manually delete or rename files. Files without + correct metadata files will not be recognized by rclone. - The default chunk name format is `*.rclone_chunk.###`, hence by default - chunk names are `BIG_FILE_NAME.rclone_chunk.001`, - `BIG_FILE_NAME.rclone_chunk.002` etc. You can configure another name format - using the `name_format` configuration file option. The format uses asterisk - `*` as a placeholder for the base file name and one or more consecutive - hash characters `#` as a placeholder for sequential chunk number. - There must be one and only one asterisk. The number of consecutive hash - characters defines the minimum length of a string representing a chunk number. - If decimal chunk number has less digits than the number of hashes, it is - left-padded by zeros. If the decimal string is longer, it is left intact. - By default numbering starts from 1 but there is another option that allows - user to start from 0, e.g. for compatibility with legacy software. + ### File names - For example, if name format is `big_*-##.part` and original file name is - `data.txt` and numbering starts from 0, then the first chunk will be named - `big_data.txt-00.part`, the 99th chunk will be `big_data.txt-98.part` - and the 302nd chunk will become `big_data.txt-301.part`. + The compressed files will be named `*.###########.gz` where `*` is the base file and the `#` part is base64 encoded + size of the uncompressed file. The file names should not be changed by anything other than the rclone compression backend. - Note that `list` assembles composite directory entries only when chunk names - match the configured format and treats non-conforming file names as normal - non-chunked files. - When using `norename` transactions, chunk names will additionally have a unique - file version suffix. For example, `BIG_FILE_NAME.rclone_chunk.001_bp562k`. + ### Standard options + Here are the Standard options specific to compress (Compress a remote). - ### Metadata + #### --compress-remote - Besides data chunks chunker will by default create metadata object for - a composite file. The object is named after the original file. - Chunker allows user to disable metadata completely (the `none` format). - Note that metadata is normally not created for files smaller than the - configured chunk size. This may change in future rclone releases. + Remote to compress. - #### Simple JSON metadata format + Properties: - This is the default format. It supports hash sums and chunk validation - for composite files. Meta objects carry the following fields: + - Config: remote + - Env Var: RCLONE_COMPRESS_REMOTE + - Type: string + - Required: true - - `ver` - version of format, currently `1` - - `size` - total size of composite file - - `nchunks` - number of data chunks in file - - `md5` - MD5 hashsum of composite file (if present) - - `sha1` - SHA1 hashsum (if present) - - `txn` - identifies current version of the file + #### --compress-mode - There is no field for composite file name as it's simply equal to the name - of meta object on the wrapped remote. Please refer to respective sections - for details on hashsums and modified time handling. + Compression mode. - #### No metadata + Properties: - You can disable meta objects by setting the meta format option to `none`. - In this mode chunker will scan directory for all files that follow - configured chunk name format, group them by detecting chunks with the same - base name and show group names as virtual composite files. - This method is more prone to missing chunk errors (especially missing - last chunk) than format with metadata enabled. + - Config: mode + - Env Var: RCLONE_COMPRESS_MODE + - Type: string + - Default: "gzip" + - Examples: + - "gzip" + - Standard gzip compression with fastest parameters. + ### Advanced options - ### Hashsums + Here are the Advanced options specific to compress (Compress a remote). - Chunker supports hashsums only when a compatible metadata is present. - Hence, if you choose metadata format of `none`, chunker will report hashsum - as `UNSUPPORTED`. + #### --compress-level - Please note that by default metadata is stored only for composite files. - If a file is smaller than configured chunk size, chunker will transparently - redirect hash requests to wrapped remote, so support depends on that. - You will see the empty string as a hashsum of requested type for small - files if the wrapped remote doesn't support it. + GZIP compression level (-2 to 9). - Many storage backends support MD5 and SHA1 hash types, so does chunker. - With chunker you can choose one or another but not both. - MD5 is set by default as the most supported type. - Since chunker keeps hashes for composite files and falls back to the - wrapped remote hash for non-chunked ones, we advise you to choose the same - hash type as supported by wrapped remote so that your file listings - look coherent. + Generally -1 (default, equivalent to 5) is recommended. + Levels 1 to 9 increase compression at the cost of speed. Going past 6 + generally offers very little return. - If your storage backend does not support MD5 or SHA1 but you need consistent - file hashing, configure chunker with `md5all` or `sha1all`. These two modes - guarantee given hash for all files. If wrapped remote doesn't support it, - chunker will then add metadata to all files, even small. However, this can - double the amount of small files in storage and incur additional service charges. - You can even use chunker to force md5/sha1 support in any other remote - at expense of sidecar meta objects by setting e.g. `hash_type=sha1all` - to force hashsums and `chunk_size=1P` to effectively disable chunking. + Level -2 uses Huffman encoding only. Only use if you know what you + are doing. + Level 0 turns off compression. - Normally, when a file is copied to chunker controlled remote, chunker - will ask the file source for compatible file hash and revert to on-the-fly - calculation if none is found. This involves some CPU overhead but provides - a guarantee that given hashsum is available. Also, chunker will reject - a server-side copy or move operation if source and destination hashsum - types are different resulting in the extra network bandwidth, too. - In some rare cases this may be undesired, so chunker provides two optional - choices: `sha1quick` and `md5quick`. If the source does not support primary - hash type and the quick mode is enabled, chunker will try to fall back to - the secondary type. This will save CPU and bandwidth but can result in empty - hashsums at destination. Beware of consequences: the `sync` command will - revert (sometimes silently) to time/size comparison if compatible hashsums - between source and target are not found. + Properties: + - Config: level + - Env Var: RCLONE_COMPRESS_LEVEL + - Type: int + - Default: -1 - ### Modified time + #### --compress-ram-cache-limit - Chunker stores modification times using the wrapped remote so support - depends on that. For a small non-chunked file the chunker overlay simply - manipulates modification time of the wrapped remote file. - For a composite file with metadata chunker will get and set - modification time of the metadata object on the wrapped remote. - If file is chunked but metadata format is `none` then chunker will - use modification time of the first data chunk. + Some remotes don't allow the upload of files with unknown size. + In this case the compressed file will need to be cached to determine + it's size. + Files smaller than this limit will be cached in RAM, files larger than + this limit will be cached on disk. - ### Migrations + Properties: - The idiomatic way to migrate to a different chunk size, hash type, transaction - style or chunk naming scheme is to: + - Config: ram_cache_limit + - Env Var: RCLONE_COMPRESS_RAM_CACHE_LIMIT + - Type: SizeSuffix + - Default: 20Mi - - Collect all your chunked files under a directory and have your - chunker remote point to it. - - Create another directory (most probably on the same cloud storage) - and configure a new remote with desired metadata format, - hash type, chunk naming etc. - - Now run `rclone sync --interactive oldchunks: newchunks:` and all your data - will be transparently converted in transfer. - This may take some time, yet chunker will try server-side - copy if possible. - - After checking data integrity you may remove configuration section - of the old remote. + ### Metadata - If rclone gets killed during a long operation on a big composite file, - hidden temporary chunks may stay in the directory. They will not be - shown by the `list` command but will eat up your account quota. - Please note that the `deletefile` command deletes only active - chunks of a file. As a workaround, you can use remote of the wrapped - file system to see them. - An easy way to get rid of hidden garbage is to copy littered directory - somewhere using the chunker remote and purge the original directory. - The `copy` command will copy only active chunks while the `purge` will - remove everything including garbage. + Any metadata supported by the underlying remote is read and written. + See the [metadata](https://rclone.org/docs/#metadata) docs for more info. - ### Caveats and Limitations - Chunker requires wrapped remote to support server-side `move` (or `copy` + - `delete`) operations, otherwise it will explicitly refuse to start. - This is because it internally renames temporary chunk files to their final - names when an operation completes successfully. - Chunker encodes chunk number in file name, so with default `name_format` - setting it adds 17 characters. Also chunker adds 7 characters of temporary - suffix during operations. Many file systems limit base file name without path - by 255 characters. Using rclone's crypt remote as a base file system limits - file name by 143 characters. Thus, maximum name length is 231 for most files - and 119 for chunker-over-crypt. A user in need can change name format to - e.g. `*.rcc##` and save 10 characters (provided at most 99 chunks per file). + # Combine - Note that a move implemented using the copy-and-delete method may incur - double charging with some cloud storage providers. + The `combine` backend joins remotes together into a single directory + tree. - Chunker will not automatically rename existing chunks when you run - `rclone config` on a live remote and change the chunk name format. - Beware that in result of this some files which have been treated as chunks - before the change can pop up in directory listings as normal files - and vice versa. The same warning holds for the chunk size. - If you desperately need to change critical chunking settings, you should - run data migration as described above. + For example you might have a remote for images on one provider: - If wrapped remote is case insensitive, the chunker overlay will inherit - that property (so you can't have a file called "Hello.doc" and "hello.doc" - in the same directory). +$ rclone tree s3:imagesbucket / ├── image1.jpg └── image2.jpg - Chunker included in rclone releases up to `v1.54` can sometimes fail to - detect metadata produced by recent versions of rclone. We recommend users - to keep rclone up-to-date to avoid data corruption. - Changing `transactions` is dangerous and requires explicit migration. + And a remote for files on another: +$ rclone tree drive:important/files / ├── file1.txt └── file2.txt - ### Standard options - Here are the Standard options specific to chunker (Transparently chunk/split large files). + The `combine` backend can join these together into a synthetic + directory structure like this: - #### --chunker-remote +$ rclone tree combined: / ├── files │ ├── file1.txt │ └── file2.txt └── +images ├── image1.jpg └── image2.jpg - Remote to chunk/unchunk. - Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", - "myremote:bucket" or maybe "myremote:" (not recommended). + You'd do this by specifying an `upstreams` parameter in the config + like this - Properties: + upstreams = images=s3:imagesbucket files=drive:important/files - - Config: remote - - Env Var: RCLONE_CHUNKER_REMOTE - - Type: string - - Required: true + During the initial setup with `rclone config` you will specify the + upstreams remotes as a space separated list. The upstream remotes can + either be a local paths or other remotes. - #### --chunker-chunk-size + ## Configuration - Files larger than chunk size will be split in chunks. + Here is an example of how to make a combine called `remote` for the + example above. First run: - Properties: + rclone config - - Config: chunk_size - - Env Var: RCLONE_CHUNKER_CHUNK_SIZE - - Type: SizeSuffix - - Default: 2Gi + This will guide you through an interactive setup process: - #### --chunker-hash-type +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Option Storage. Type of +storage to configure. Choose a number from below, or type in your own +value. ... XX / Combine several remotes into one  (combine) ... Storage> +combine Option upstreams. Upstreams for combining These should be in the +form dir=remote:path dir2=remote2:path Where before the = is specified +the root directory and after is the remote to put there. Embedded spaces +can be added using quotes "dir=remote:path with space" +"dir2=remote2:path with space" Enter a fs.SpaceSepList value. upstreams> +images=s3:imagesbucket files=drive:important/files -------------------- +[remote] type = combine upstreams = images=s3:imagesbucket +files=drive:important/files -------------------- y) Yes this is OK +(default) e) Edit this remote d) Delete this remote y/e/d> y - Choose how chunker handles hash sums. - All modes but "none" require metadata. + ### Configuring for Google Drive Shared Drives - Properties: + Rclone has a convenience feature for making a combine backend for all + the shared drives you have access to. - - Config: hash_type - - Env Var: RCLONE_CHUNKER_HASH_TYPE - - Type: string - - Default: "md5" - - Examples: - - "none" - - Pass any hash supported by wrapped remote for non-chunked files. - - Return nothing otherwise. - - "md5" - - MD5 for composite files. - - "sha1" - - SHA1 for composite files. - - "md5all" - - MD5 for all files. - - "sha1all" - - SHA1 for all files. - - "md5quick" - - Copying a file to chunker will request MD5 from the source. - - Falling back to SHA1 if unsupported. - - "sha1quick" - - Similar to "md5quick" but prefers SHA1 over MD5. + Assuming your main (non shared drive) Google drive remote is called + `drive:` you would run - ### Advanced options + rclone backend -o config drives drive: - Here are the Advanced options specific to chunker (Transparently chunk/split large files). + This would produce something like this: - #### --chunker-name-format + [My Drive] + type = alias + remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=: - String format of chunk file names. + [Test Drive] + type = alias + remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=: - The two placeholders are: base file name (*) and chunk number (#...). - There must be one and only one asterisk and one or more consecutive hash characters. - If chunk number has less digits than the number of hashes, it is left-padded by zeros. - If there are more digits in the number, they are left as is. - Possible chunk files are ignored if their name does not match given format. + [AllDrives] + type = combine + upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:" - Properties: + If you then add that config to your config file (find it with `rclone + config file`) then you can access all the shared drives in one place + with the `AllDrives:` remote. - - Config: name_format - - Env Var: RCLONE_CHUNKER_NAME_FORMAT - - Type: string - - Default: "*.rclone_chunk.###" + See [the Google Drive docs](https://rclone.org/drive/#drives) for full info. - #### --chunker-start-from - Minimum valid chunk number. Usually 0 or 1. + ### Standard options - By default chunk numbers start from 1. + Here are the Standard options specific to combine (Combine several remotes into one). - Properties: + #### --combine-upstreams - - Config: start_from - - Env Var: RCLONE_CHUNKER_START_FROM - - Type: int - - Default: 1 + Upstreams for combining - #### --chunker-meta-format + These should be in the form - Format of the metadata object or "none". + dir=remote:path dir2=remote2:path - By default "simplejson". - Metadata is a small JSON file named after the composite file. + Where before the = is specified the root directory and after is the remote to + put there. - Properties: + Embedded spaces can be added using quotes - - Config: meta_format - - Env Var: RCLONE_CHUNKER_META_FORMAT - - Type: string - - Default: "simplejson" - - Examples: - - "none" - - Do not use metadata files at all. - - Requires hash type "none". - - "simplejson" - - Simple JSON supports hash sums and chunk validation. - - - - It has the following fields: ver, size, nchunks, md5, sha1. + "dir=remote:path with space" "dir2=remote2:path with space" - #### --chunker-fail-hard - Choose how chunker should handle files with missing or invalid chunks. Properties: - - Config: fail_hard - - Env Var: RCLONE_CHUNKER_FAIL_HARD - - Type: bool - - Default: false - - Examples: - - "true" - - Report errors and abort current command. - - "false" - - Warn user, skip incomplete file and proceed. + - Config: upstreams + - Env Var: RCLONE_COMBINE_UPSTREAMS + - Type: SpaceSepList + - Default: - #### --chunker-transactions + ### Metadata - Choose how chunker should handle temporary files during transactions. + Any metadata supported by the underlying remote is read and written. - Properties: + See the [metadata](https://rclone.org/docs/#metadata) docs for more info. - - Config: transactions - - Env Var: RCLONE_CHUNKER_TRANSACTIONS - - Type: string - - Default: "rename" - - Examples: - - "rename" - - Rename temporary files after a successful transaction. - - "norename" - - Leave temporary file names and write transaction ID to metadata file. - - Metadata is required for no rename transactions (meta format cannot be "none"). - - If you are using norename transactions you should be careful not to downgrade Rclone - - as older versions of Rclone don't support this transaction style and will misinterpret - - files manipulated by norename transactions. - - This method is EXPERIMENTAL, don't use on production systems. - - "auto" - - Rename or norename will be used depending on capabilities of the backend. - - If meta format is set to "none", rename transactions will always be used. - - This method is EXPERIMENTAL, don't use on production systems. + # Dropbox - # Citrix ShareFile + Paths are specified as `remote:path` - [Citrix ShareFile](https://sharefile.com) is a secure file sharing and transfer service aimed as business. + Dropbox paths may be as deep as required, e.g. + `remote:directory/subdirectory`. ## Configuration - The initial setup for Citrix ShareFile involves getting a token from - Citrix ShareFile which you can in your browser. `rclone config` walks you + The initial setup for dropbox involves getting a token from Dropbox + which you need to do in your browser. `rclone config` walks you through it. Here is an example of how to make a remote called `remote`. First run: @@ -27830,112 +29429,163 @@ this remote y/e/d> y This will guide you through an interactive setup process: -No remotes found, make a new one? n) New remote s) Set configuration -password q) Quit config n/s/q> n name> remote Type of storage to -configure. Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value XX / Citrix -Sharefile  "sharefile" Storage> sharefile ** See help for sharefile -backend at: https://rclone.org/sharefile/ ** - -ID of the root folder - -Leave blank to access "Personal Folders". You can use one of the -standard values here or any folder ID (long hex number ID). Enter a -string value. Press Enter for the default (""). Choose a number from -below, or type in your own value 1 / Access the Personal Folders. -(Default)  "" 2 / Access the Favorites folder.  "favorites" 3 / Access -all the shared folders.  "allshared" 4 / Access all the individual -connectors.  "connectors" 5 / Access the home, favorites, and shared -folders as well as the connectors.  "top" root_folder_id> Edit advanced -config? (y/n) y) Yes n) No y/n> n Remote config Use web browser to -automatically authenticate rclone with remote? * Say Y if the machine -running rclone has a web browser you can use * Say N if running rclone -on a (remote) machine without web browser access If not sure try Y. If Y -failed, try N. 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?state=XXX Log in and authorize rclone for -access Waiting for code... Got code -------------------- [remote] type = -sharefile endpoint = https://XXX.sharefile.com token = -{"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2019-09-30T19:41:45.878561877+01:00"} --------------------- y) Yes this is OK e) Edit this remote d) Delete -this remote y/e/d> y +n) New remote +o) Delete remote +p) 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 [snip] XX / + Dropbox  "dropbox" [snip] Storage> dropbox Dropbox App Key - leave + blank normally. app_key> Dropbox App Secret - leave blank normally. + app_secret> Remote config Please visit: + https://www.dropbox.com/1/oauth2/authorize?client_id=XXXXXXXXXXXXXXX&response_type=code + Enter the code: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXXXXXXXX + -------------------- [remote] app_key = app_secret = token = + XXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXX + -------------------- +q) Yes this is OK +r) Edit this remote +s) Delete this remote y/e/d> y See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a machine with no Internet browser available. Note that rclone runs a webserver on your local machine to collect the - token as returned from Citrix ShareFile. This only runs from the moment it opens - your browser to the moment you get back the verification code. This - is on `http://127.0.0.1:53682/` and this it may require you to unblock - it temporarily if you are running a host firewall. + token as returned from Dropbox. This only + runs from the moment it opens your browser to the moment you get back + the verification code. This is on `http://127.0.0.1:53682/` and it + may require you to unblock it temporarily if you are running a host + firewall, or use manual mode. - Once configured you can then use `rclone` like this, + You can then use it like this, - List directories in top level of your ShareFile + List directories in top level of your dropbox rclone lsd remote: - List all the files in your ShareFile + List all the files in your dropbox rclone ls remote: - To copy a local directory to an ShareFile directory called backup + To copy a local directory to a dropbox directory called backup rclone copy /home/source remote:backup - Paths may be as deep as required, e.g. `remote:directory/subdirectory`. + ### Dropbox for business - ### Modified time and hashes + Rclone supports Dropbox for business and Team Folders. - ShareFile allows modification times to be set on objects accurate to 1 - second. These will be used to detect whether objects need syncing or - not. + When using Dropbox for business `remote:` and `remote:path/to/file` + will refer to your personal folder. - ShareFile supports MD5 type hashes, so you can use the `--checksum` - flag. + If you wish to see Team Folders you must use a leading `/` in the + path, so `rclone lsd remote:/` will refer to the root and show you all + Team Folders and your User Folder. - ### Transfers + You can then use team folders like this `remote:/TeamFolder` and + `remote:/TeamFolder/path/to/file`. - For files above 128 MiB rclone will use a chunked transfer. Rclone will - upload up to `--transfers` chunks at the same time (shared among all - the multipart uploads). Chunks are buffered in memory and are - normally 64 MiB so increasing `--transfers` will increase memory use. + A leading `/` for a Dropbox personal account will do nothing, but it + will take an extra HTTP transaction so it should be avoided. - ### Restricted filename characters + ### Modification times and hashes - In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) - the following characters are also replaced: + Dropbox supports modified times, but the only way to set a + modification time is to re-upload the file. + + This means that if you uploaded your data with an older version of + rclone which didn't support the v2 API and modified times, rclone will + decide to upload all your old data to fix the modification times. If + you don't want this to happen use `--size-only` or `--checksum` flag + to stop it. + + Dropbox supports [its own hash + type](https://www.dropbox.com/developers/reference/content-hash) which + is checked for all transfers. + + ### Restricted filename characters | Character | Value | Replacement | | --------- |:-----:|:-----------:| - | \\ | 0x5C | \ | - | * | 0x2A | * | - | < | 0x3C | < | - | > | 0x3E | > | - | ? | 0x3F | ? | - | : | 0x3A | : | - | \| | 0x7C | | | - | " | 0x22 | " | + | NUL | 0x00 | ␀ | + | / | 0x2F | / | + | DEL | 0x7F | ␡ | + | \ | 0x5C | \ | - File names can also not start or end with the following characters. - These only get replaced if they are the first or last character in the - name: + File names can also not end with the following characters. + These only get replaced if they are the last character in the name: | Character | Value | Replacement | | --------- |:-----:|:-----------:| | SP | 0x20 | ␠ | - | . | 0x2E | . | Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), as they can't be used in JSON strings. + ### Batch mode uploads {#batch-mode} + + Using batch mode uploads is very important for performance when using + the Dropbox API. See [the dropbox performance guide](https://developers.dropbox.com/dbx-performance-guide) + for more info. + + There are 3 modes rclone can use for uploads. + + #### --dropbox-batch-mode off + + In this mode rclone will not use upload batching. This was the default + before rclone v1.55. It has the disadvantage that it is very likely to + encounter `too_many_requests` errors like this + + NOTICE: too_many_requests/.: Too many requests or write operations. Trying again in 15 seconds. + + When rclone receives these it has to wait for 15s or sometimes 300s + before continuing which really slows down transfers. + + This will happen especially if `--transfers` is large, so this mode + isn't recommended except for compatibility or investigating problems. + + #### --dropbox-batch-mode sync + + In this mode rclone will batch up uploads to the size specified by + `--dropbox-batch-size` and commit them together. + + Using this mode means you can use a much higher `--transfers` + parameter (32 or 64 works fine) without receiving `too_many_requests` + errors. + + This mode ensures full data integrity. + + Note that there may be a pause when quitting rclone while rclone + finishes up the last batch using this mode. + + #### --dropbox-batch-mode async + + In this mode rclone will batch up uploads to the size specified by + `--dropbox-batch-size` and commit them together. + + However it will not wait for the status of the batch to be returned to + the caller. This means rclone can use a much bigger batch size (much + bigger than `--transfers`), at the cost of not being able to check the + status of the upload. + + This provides the maximum possible upload speed especially with lots + of small files, however rclone can't check the file got uploaded + properly using this mode. + + If you are using this mode then using "rclone check" after the + transfer completes is recommended. Or you could do an initial transfer + with `--dropbox-batch-mode async` then do a final transfer with + `--dropbox-batch-mode sync` (the default). + + Note that there may be a pause when quitting rclone while rclone + finishes up the last batch using this mode. + + ### Standard options - Here are the Standard options specific to sharefile (Citrix Sharefile). + Here are the Standard options specific to dropbox (Dropbox). - #### --sharefile-client-id + #### --dropbox-client-id OAuth Client Id. @@ -27944,11 +29594,11 @@ this remote y/e/d> y Properties: - Config: client_id - - Env Var: RCLONE_SHAREFILE_CLIENT_ID + - Env Var: RCLONE_DROPBOX_CLIENT_ID - Type: string - Required: false - #### --sharefile-client-secret + #### --dropbox-client-secret OAuth Client Secret. @@ -27957,51 +29607,26 @@ this remote y/e/d> y Properties: - Config: client_secret - - Env Var: RCLONE_SHAREFILE_CLIENT_SECRET - - Type: string - - Required: false - - #### --sharefile-root-folder-id - - ID of the root folder. - - Leave blank to access "Personal Folders". You can use one of the - standard values here or any folder ID (long hex number ID). - - Properties: - - - Config: root_folder_id - - Env Var: RCLONE_SHAREFILE_ROOT_FOLDER_ID + - Env Var: RCLONE_DROPBOX_CLIENT_SECRET - Type: string - Required: false - - Examples: - - "" - - Access the Personal Folders (default). - - "favorites" - - Access the Favorites folder. - - "allshared" - - Access all the shared folders. - - "connectors" - - Access all the individual connectors. - - "top" - - Access the home, favorites, and shared folders as well as the connectors. ### Advanced options - Here are the Advanced options specific to sharefile (Citrix Sharefile). + Here are the Advanced options specific to dropbox (Dropbox). - #### --sharefile-token + #### --dropbox-token OAuth Access Token as a JSON blob. Properties: - Config: token - - Env Var: RCLONE_SHAREFILE_TOKEN + - Env Var: RCLONE_DROPBOX_TOKEN - Type: string - Required: false - #### --sharefile-auth-url + #### --dropbox-auth-url Auth server URL. @@ -28010,11 +29635,11 @@ this remote y/e/d> y Properties: - Config: auth_url - - Env Var: RCLONE_SHAREFILE_AUTH_URL + - Env Var: RCLONE_DROPBOX_AUTH_URL - Type: string - Required: false - #### --sharefile-token-url + #### --dropbox-token-url Token server url. @@ -28023,55 +29648,103 @@ this remote y/e/d> y Properties: - Config: token_url - - Env Var: RCLONE_SHAREFILE_TOKEN_URL + - Env Var: RCLONE_DROPBOX_TOKEN_URL - Type: string - Required: false - #### --sharefile-upload-cutoff + #### --dropbox-chunk-size - Cutoff for switching to multipart upload. + Upload chunk size (< 150Mi). + + Any files larger than this will be uploaded in chunks of this size. + + Note that chunks are buffered in memory (one at a time) so rclone can + deal with retries. Setting this larger will increase the speed + slightly (at most 10% for 128 MiB in tests) at the cost of using more + memory. It can be set smaller if you are tight on memory. Properties: - - Config: upload_cutoff - - Env Var: RCLONE_SHAREFILE_UPLOAD_CUTOFF + - Config: chunk_size + - Env Var: RCLONE_DROPBOX_CHUNK_SIZE - Type: SizeSuffix - - Default: 128Mi + - Default: 48Mi - #### --sharefile-chunk-size + #### --dropbox-impersonate - Upload chunk size. + Impersonate this user when using a business account. - Must a power of 2 >= 256k. + Note that if you want to use impersonate, you should make sure this + flag is set when running "rclone config" as this will cause rclone to + request the "members.read" scope which it won't normally. This is + needed to lookup a members email address into the internal ID that + dropbox uses in the API. - Making this larger will improve performance, but note that each chunk - is buffered in memory one per transfer. + Using the "members.read" scope will require a Dropbox Team Admin + to approve during the OAuth flow. + + You will have to use your own App (setting your own client_id and + client_secret) to use this option as currently rclone's default set of + permissions doesn't include "members.read". This can be added once + v1.55 or later is in use everywhere. - Reducing this will reduce memory usage but decrease performance. Properties: - - Config: chunk_size - - Env Var: RCLONE_SHAREFILE_CHUNK_SIZE - - Type: SizeSuffix - - Default: 64Mi + - Config: impersonate + - Env Var: RCLONE_DROPBOX_IMPERSONATE + - Type: string + - Required: false - #### --sharefile-endpoint + #### --dropbox-shared-files - Endpoint for API calls. + Instructs rclone to work on individual shared files. - This is usually auto discovered as part of the oauth process, but can - be set manually to something like: https://XXX.sharefile.com + In this mode rclone's features are extremely limited - only list (ls, lsl, etc.) + operations and read operations (e.g. downloading) are supported in this mode. + All other operations will be disabled. + Properties: + + - Config: shared_files + - Env Var: RCLONE_DROPBOX_SHARED_FILES + - Type: bool + - Default: false + + #### --dropbox-shared-folders + + Instructs rclone to work on shared folders. + + When this flag is used with no path only the List operation is supported and + all available shared folders will be listed. If you specify a path the first part + will be interpreted as the name of shared folder. Rclone will then try to mount this + shared to the root namespace. On success shared folder rclone proceeds normally. + The shared folder is now pretty much a normal folder and all normal operations + are supported. + + Note that we don't unmount the shared folder afterwards so the + --dropbox-shared-folders can be omitted after the first use of a particular + shared folder. Properties: - - Config: endpoint - - Env Var: RCLONE_SHAREFILE_ENDPOINT - - Type: string - - Required: false + - Config: shared_folders + - Env Var: RCLONE_DROPBOX_SHARED_FOLDERS + - Type: bool + - Default: false - #### --sharefile-encoding + #### --dropbox-pacer-min-sleep + + Minimum time to sleep between API calls. + + Properties: + + - Config: pacer_min_sleep + - Env Var: RCLONE_DROPBOX_PACER_MIN_SLEEP + - Type: Duration + - Default: 10ms + + #### --dropbox-encoding The encoding for the backend. @@ -28080,1228 +29753,1396 @@ this remote y/e/d> y Properties: - Config: encoding - - Env Var: RCLONE_SHAREFILE_ENCODING - - Type: MultiEncoder - - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot + - Env Var: RCLONE_DROPBOX_ENCODING + - Type: Encoding + - Default: Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot + #### --dropbox-batch-mode - ## Limitations + Upload file batching sync|async|off. - Note that ShareFile is case insensitive so you can't have a file called - "Hello.doc" and one called "hello.doc". + This sets the batch mode used by rclone. - ShareFile only supports filenames up to 256 characters in length. + For full info see [the main docs](https://rclone.org/dropbox/#batch-mode) - `rclone about` is not supported by the Citrix ShareFile backend. Backends without - this capability cannot determine free space for an rclone mount or - use policy `mfs` (most free space) as a member of an rclone union - remote. + This has 3 possible values - See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) + - off - no batching + - sync - batch uploads and check completion (default) + - async - batch upload and don't check completion - # Crypt + Rclone will close any outstanding batches when it exits which may make + a delay on quit. - Rclone `crypt` remotes encrypt and decrypt other remotes. - A remote of type `crypt` does not access a [storage system](https://rclone.org/overview/) - directly, but instead wraps another remote, which in turn accesses - the storage system. This is similar to how [alias](https://rclone.org/alias/), - [union](https://rclone.org/union/), [chunker](https://rclone.org/chunker/) - and a few others work. It makes the usage very flexible, as you can - add a layer, in this case an encryption layer, on top of any other - backend, even in multiple layers. Rclone's functionality - can be used as with any other remote, for example you can - [mount](https://rclone.org/commands/rclone_mount/) a crypt remote. + Properties: - Accessing a storage system through a crypt remote realizes client-side - encryption, which makes it safe to keep your data in a location you do - not trust will not get compromised. - When working against the `crypt` remote, rclone will automatically - encrypt (before uploading) and decrypt (after downloading) on your local - system as needed on the fly, leaving the data encrypted at rest in the - wrapped remote. If you access the storage system using an application - other than rclone, or access the wrapped remote directly using rclone, - there will not be any encryption/decryption: Downloading existing content - will just give you the encrypted (scrambled) format, and anything you - upload will *not* become encrypted. + - Config: batch_mode + - Env Var: RCLONE_DROPBOX_BATCH_MODE + - Type: string + - Default: "sync" - The encryption is a secret-key encryption (also called symmetric key encryption) - algorithm, where a password (or pass phrase) is used to generate real encryption key. - The password can be supplied by user, or you may chose to let rclone - generate one. It will be stored in the configuration file, in a lightly obscured form. - If you are in an environment where you are not able to keep your configuration - secured, you should add - [configuration encryption](https://rclone.org/docs/#configuration-encryption) - as protection. As long as you have this configuration file, you will be able to - decrypt your data. Without the configuration file, as long as you remember - the password (or keep it in a safe place), you can re-create the configuration - and gain access to the existing data. You may also configure a corresponding - remote in a different installation to access the same data. - See below for guidance to [changing password](#changing-password). + #### --dropbox-batch-size - Encryption uses [cryptographic salt](https://en.wikipedia.org/wiki/Salt_(cryptography)), - to permute the encryption key so that the same string may be encrypted in - different ways. When configuring the crypt remote it is optional to enter a salt, - or to let rclone generate a unique salt. If omitted, rclone uses a built-in unique string. - Normally in cryptography, the salt is stored together with the encrypted content, - and do not have to be memorized by the user. This is not the case in rclone, - because rclone does not store any additional information on the remotes. Use of - custom salt is effectively a second password that must be memorized. + Max number of files in upload batch. - [File content](#file-encryption) encryption is performed using - [NaCl SecretBox](https://godoc.org/golang.org/x/crypto/nacl/secretbox), - based on XSalsa20 cipher and Poly1305 for integrity. - [Names](#name-encryption) (file- and directory names) are also encrypted - by default, but this has some implications and is therefore - possible to be turned off. + This sets the batch size of files to upload. It has to be less than 1000. + + By default this is 0 which means rclone which calculate the batch size + depending on the setting of batch_mode. + + - batch_mode: async - default batch_size is 100 + - batch_mode: sync - default batch_size is the same as --transfers + - batch_mode: off - not in use + + Rclone will close any outstanding batches when it exits which may make + a delay on quit. + + Setting this is a great idea if you are uploading lots of small files + as it will make them a lot quicker. You can use --transfers 32 to + maximise throughput. + + + Properties: + + - Config: batch_size + - Env Var: RCLONE_DROPBOX_BATCH_SIZE + - Type: int + - Default: 0 + + #### --dropbox-batch-timeout + + Max time to allow an idle upload batch before uploading. + + If an upload batch is idle for more than this long then it will be + uploaded. + + The default for this is 0 which means rclone will choose a sensible + default based on the batch_mode in use. + + - batch_mode: async - default batch_timeout is 10s + - batch_mode: sync - default batch_timeout is 500ms + - batch_mode: off - not in use + + + Properties: - ## Configuration + - Config: batch_timeout + - Env Var: RCLONE_DROPBOX_BATCH_TIMEOUT + - Type: Duration + - Default: 0s - Here is an example of how to make a remote called `secret`. + #### --dropbox-batch-commit-timeout - To use `crypt`, first set up the underlying remote. Follow the - `rclone config` instructions for the specific backend. + Max time to wait for a batch to finish committing - Before configuring the crypt remote, check the underlying remote is - working. In this example the underlying remote is called `remote`. - We will configure a path `path` within this remote to contain the - encrypted content. Anything inside `remote:path` will be encrypted - and anything outside will not. + Properties: - Configure `crypt` using `rclone config`. In this example the `crypt` - remote is called `secret`, to differentiate it from the underlying - `remote`. + - Config: batch_commit_timeout + - Env Var: RCLONE_DROPBOX_BATCH_COMMIT_TIMEOUT + - Type: Duration + - Default: 10m0s - When you are done you can use the crypt remote named `secret` just - as you would with any other remote, e.g. `rclone copy D:\docs secret:\docs`, - and rclone will encrypt and decrypt as needed on the fly. - If you access the wrapped remote `remote:path` directly you will bypass - the encryption, and anything you read will be in encrypted form, and - anything you write will be unencrypted. To avoid issues it is best to - configure a dedicated path for encrypted content, and access it - exclusively through a crypt remote. -No remotes found, make a new one? n) New remote s) Set configuration -password q) Quit config n/s/q> n name> secret Type of storage to -configure. Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value [snip] XX / -Encrypt/Decrypt a remote  "crypt" [snip] Storage> crypt ** See help for -crypt backend at: https://rclone.org/crypt/ ** -Remote to encrypt/decrypt. Normally should contain a ':' and a path, eg -"myremote:path/to/dir", "myremote:bucket" or maybe "myremote:" (not -recommended). Enter a string value. Press Enter for the default (""). -remote> remote:path How to encrypt the filenames. Enter a string value. -Press Enter for the default ("standard"). Choose a number from below, or -type in your own value. / Encrypt the filenames. 1 | See the docs for -the details.  "standard" 2 / Very simple filename obfuscation. - "obfuscate" / Don't encrypt the file names. 3 | Adds a ".bin" extension -only.  "off" filename_encryption> Option to either encrypt directory -names or leave them intact. + ## Limitations -NB If filename_encryption is "off" then this option will do nothing. -Enter a boolean value (true or false). Press Enter for the default -("true"). Choose a number from below, or type in your own value 1 / -Encrypt directory names.  "true" 2 / Don't encrypt directory names, -leave them intact.  "false" directory_name_encryption> Password or pass -phrase for encryption. y) Yes type in my own password g) Generate random -password y/g> y Enter the password: password: Confirm the password: -password: Password or pass phrase for salt. Optional but recommended. -Should be different to the previous password. y) Yes type in my own -password g) Generate random password n) No leave this optional password -blank (default) y/g/n> g Password strength in bits. 64 is just about -memorable 128 is secure 1024 is the maximum Bits> 128 Your password is: -JAsJvRcgR-_veXNfy_sGmQ Use this password? Please note that an obscured -version of this password (and not the password itself) will be stored -under your configuration file, so keep this generated password in a safe -place. y) Yes (default) n) No y/n> Edit advanced config? (y/n) y) Yes n) -No (default) y/n> Remote config -------------------- [secret] type = -crypt remote = remote:path password = *** ENCRYPTED password2 = -ENCRYPTED *** -------------------- y) Yes this is OK (default) e) Edit -this remote d) Delete this remote y/e/d> + Note that Dropbox is case insensitive so you can't have a file called + "Hello.doc" and one called "hello.doc". + There are some file names such as `thumbs.db` which Dropbox can't + store. There is a full list of them in the ["Ignored Files" section + of this document](https://www.dropbox.com/en/help/145). Rclone will + issue an error message `File name disallowed - not uploading` if it + attempts to upload one of those file names, but the sync won't fail. - **Important** The crypt password stored in `rclone.conf` is lightly - obscured. That only protects it from cursory inspection. It is not - secure unless [configuration encryption](https://rclone.org/docs/#configuration-encryption) of `rclone.conf` is specified. + Some errors may occur if you try to sync copyright-protected files + because Dropbox has its own [copyright detector](https://techcrunch.com/2014/03/30/how-dropbox-knows-when-youre-sharing-copyrighted-stuff-without-actually-looking-at-your-stuff/) that + prevents this sort of file being downloaded. This will return the error `ERROR : + /path/to/your/file: Failed to copy: failed to open source object: + path/restricted_content/.` - A long passphrase is recommended, or `rclone config` can generate a - random one. + If you have more than 10,000 files in a directory then `rclone purge + dropbox:dir` will return the error `Failed to purge: There are too + many files involved in this operation`. As a work-around do an + `rclone delete dropbox:dir` followed by an `rclone rmdir dropbox:dir`. - The obscured password is created using AES-CTR with a static key. The - salt is stored verbatim at the beginning of the obscured password. This - static key is shared between all versions of rclone. + When using `rclone link` you'll need to set `--expire` if using a + non-personal account otherwise the visibility may not be correct. + (Note that `--expire` isn't supported on personal accounts). See the + [forum discussion](https://forum.rclone.org/t/rclone-link-dropbox-permissions/23211) and the + [dropbox SDK issue](https://github.com/dropbox/dropbox-sdk-go-unofficial/issues/75). - If you reconfigure rclone with the same passwords/passphrases - elsewhere it will be compatible, but the obscured version will be different - due to the different salt. + ## Get your own Dropbox App ID - Rclone does not encrypt + When you use rclone with Dropbox in its default configuration you are using rclone's App ID. This is shared between all the rclone users. - * file length - this can be calculated within 16 bytes - * modification time - used for syncing + Here is how to create your own Dropbox App ID for rclone: - ### Specifying the remote + 1. Log into the [Dropbox App console](https://www.dropbox.com/developers/apps/create) with your Dropbox Account (It need not + to be the same account as the Dropbox you want to access) - When configuring the remote to encrypt/decrypt, you may specify any - string that rclone accepts as a source/destination of other commands. + 2. Choose an API => Usually this should be `Dropbox API` - The primary use case is to specify the path into an already configured - remote (e.g. `remote:path/to/dir` or `remote:bucket`), such that - data in a remote untrusted location can be stored encrypted. + 3. Choose the type of access you want to use => `Full Dropbox` or `App Folder`. If you want to use Team Folders, `Full Dropbox` is required ([see here](https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-create-team-folder-inside-my-app-s-folder/m-p/601005/highlight/true#M27911)). - You may also specify a local filesystem path, such as - `/path/to/dir` on Linux, `C:\path\to\dir` on Windows. By creating - a crypt remote pointing to such a local filesystem path, you can - use rclone as a utility for pure local file encryption, for example - to keep encrypted files on a removable USB drive. + 4. Name your App. The app name is global, so you can't use `rclone` for example - **Note**: A string which do not contain a `:` will by rclone be treated - as a relative path in the local filesystem. For example, if you enter - the name `remote` without the trailing `:`, it will be treated as - a subdirectory of the current directory with name "remote". + 5. Click the button `Create App` - If a path `remote:path/to/dir` is specified, rclone stores encrypted - files in `path/to/dir` on the remote. With file name encryption, files - saved to `secret:subdir/subfile` are stored in the unencrypted path - `path/to/dir` but the `subdir/subpath` element is encrypted. + 6. Switch to the `Permissions` tab. Enable at least the following permissions: `account_info.read`, `files.metadata.write`, `files.content.write`, `files.content.read`, `sharing.write`. The `files.metadata.read` and `sharing.read` checkboxes will be marked too. Click `Submit` - The path you specify does not have to exist, rclone will create - it when needed. + 7. Switch to the `Settings` tab. Fill `OAuth2 - Redirect URIs` as `http://localhost:53682/` and click on `Add` - If you intend to use the wrapped remote both directly for keeping - unencrypted content, as well as through a crypt remote for encrypted - content, it is recommended to point the crypt remote to a separate - directory within the wrapped remote. If you use a bucket-based storage - system (e.g. Swift, S3, Google Compute Storage, B2) it is generally - advisable to wrap the crypt remote around a specific bucket (`s3:bucket`). - If wrapping around the entire root of the storage (`s3:`), and use the - optional file name encryption, rclone will encrypt the bucket name. + 8. Find the `App key` and `App secret` values on the `Settings` tab. Use these values in rclone config to add a new remote or edit an existing remote. The `App key` setting corresponds to `client_id` in rclone config, the `App secret` corresponds to `client_secret` - ### Changing password + # Enterprise File Fabric - Should the password, or the configuration file containing a lightly obscured - form of the password, be compromised, you need to re-encrypt your data with - a new password. Since rclone uses secret-key encryption, where the encryption - key is generated directly from the password kept on the client, it is not - possible to change the password/key of already encrypted content. Just changing - the password configured for an existing crypt remote means you will no longer - able to decrypt any of the previously encrypted content. The only possibility - is to re-upload everything via a crypt remote configured with your new password. + This backend supports [Storage Made Easy's Enterprise File + Fabric™](https://storagemadeeasy.com/about/) which provides a software + solution to integrate and unify File and Object Storage accessible + through a global file system. - Depending on the size of your data, your bandwidth, storage quota etc, there are - different approaches you can take: - - If you have everything in a different location, for example on your local system, - you could remove all of the prior encrypted files, change the password for your - configured crypt remote (or delete and re-create the crypt configuration), - and then re-upload everything from the alternative location. - - If you have enough space on the storage system you can create a new crypt - remote pointing to a separate directory on the same backend, and then use - rclone to copy everything from the original crypt remote to the new, - effectively decrypting everything on the fly using the old password and - re-encrypting using the new password. When done, delete the original crypt - remote directory and finally the rclone crypt configuration with the old password. - All data will be streamed from the storage system and back, so you will - get half the bandwidth and be charged twice if you have upload and download quota - on the storage system. + ## Configuration - **Note**: A security problem related to the random password generator - was fixed in rclone version 1.53.3 (released 2020-11-19). Passwords generated - by rclone config in version 1.49.0 (released 2019-08-26) to 1.53.2 - (released 2020-10-26) are not considered secure and should be changed. - If you made up your own password, or used rclone version older than 1.49.0 or - newer than 1.53.2 to generate it, you are *not* affected by this issue. - See [issue #4783](https://github.com/rclone/rclone/issues/4783) for more - details, and a tool you can use to check if you are affected. + The initial setup for the Enterprise File Fabric backend involves + getting a token from the Enterprise File Fabric which you need to + do in your browser. `rclone config` walks you through it. - ### Example + Here is an example of how to make a remote called `remote`. First run: - Create the following file structure using "standard" file name - encryption. + rclone config -plaintext/ ├── file0.txt ├── file1.txt └── subdir ├── file2.txt ├── -file3.txt └── subsubdir └── file4.txt + This will guide you through an interactive setup process: +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value [snip] XX / +Enterprise File Fabric  "filefabric" [snip] Storage> filefabric ** See +help for filefabric backend at: https://rclone.org/filefabric/ ** - Copy these to the remote, and list them +URL of the Enterprise File Fabric to connect to Enter a string value. +Press Enter for the default (""). Choose a number from below, or type in +your own value 1 / Storage Made Easy US  "https://storagemadeeasy.com" 2 +/ Storage Made Easy EU  "https://eu.storagemadeeasy.com" 3 / Connect to +your Enterprise File Fabric  "https://yourfabric.smestorage.com" url> +https://yourfabric.smestorage.com/ ID of the root folder Leave blank +normally. -$ rclone -q copy plaintext secret: $ rclone -q ls secret: 7 file1.txt 6 -file0.txt 8 subdir/file2.txt 10 subdir/subsubdir/file4.txt 9 -subdir/file3.txt +Fill in to make rclone start with directory of a given ID. +Enter a string value. Press Enter for the default (""). root_folder_id> +Permanent Authentication Token - The crypt remote looks like +A Permanent Authentication Token can be created in the Enterprise File +Fabric, on the users Dashboard under Security, there is an entry you'll +see called "My Authentication Tokens". Click the Manage button to create +one. -$ rclone -q ls remote:path 55 hagjclgavj2mbiqm6u6cnjjqcg 54 -v05749mltvv1tf4onltun46gls 57 -86vhrsv86mpbtd3a0akjuqslj8/dlj7fkq4kdq72emafg7a7s41uo 58 -86vhrsv86mpbtd3a0akjuqslj8/7uu829995du6o42n32otfhjqp4/b9pausrfansjth5ob3jkdqd4lc -56 86vhrsv86mpbtd3a0akjuqslj8/8njh1sk437gttmep3p70g81aps +These tokens are normally valid for several years. +For more info see: +https://docs.storagemadeeasy.com/organisationcloud/api-tokens - The directory structure is preserved +Enter a string value. Press Enter for the default (""). permanent_token> +xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx Edit advanced config? (y/n) y) Yes n) +No (default) y/n> n Remote config -------------------- [remote] type = +filefabric url = https://yourfabric.smestorage.com/ permanent_token = +xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx -------------------- y) Yes this is OK +(default) e) Edit this remote d) Delete this remote y/e/d> y -$ rclone -q ls secret:subdir 8 file2.txt 9 file3.txt 10 -subsubdir/file4.txt + Once configured you can then use `rclone` like this, - Without file name encryption `.bin` extensions are added to underlying - names. This prevents the cloud provider attempting to interpret file - content. + List directories in top level of your Enterprise File Fabric -$ rclone -q ls remote:path 54 file0.txt.bin 57 subdir/file3.txt.bin 56 -subdir/file2.txt.bin 58 subdir/subsubdir/file4.txt.bin 55 file1.txt.bin + rclone lsd remote: + List all the files in your Enterprise File Fabric - ### File name encryption modes + rclone ls remote: - Off + To copy a local directory to an Enterprise File Fabric directory called backup - * doesn't hide file names or directory structure - * allows for longer file names (~246 characters) - * can use sub paths and copy single files + rclone copy /home/source remote:backup - Standard + ### Modification times and hashes - * file names encrypted - * file names can't be as long (~143 characters) - * can use sub paths and copy single files - * directory structure visible - * identical files names will have identical uploaded names - * can use shortcuts to shorten the directory recursion + The Enterprise File Fabric allows modification times to be set on + files accurate to 1 second. These will be used to detect whether + objects need syncing or not. - Obfuscation + The Enterprise File Fabric does not support any data hashes at this time. - This is a simple "rotate" of the filename, with each file having a rot - distance based on the filename. Rclone stores the distance at the - beginning of the filename. A file called "hello" may become "53.jgnnq". + ### Restricted filename characters - Obfuscation is not a strong encryption of filenames, but hinders - automated scanning tools picking up on filename patterns. It is an - intermediate between "off" and "standard" which allows for longer path - segment names. + The [default restricted characters set](https://rclone.org/overview/#restricted-characters) + will be replaced. - There is a possibility with some unicode based filenames that the - obfuscation is weak and may map lower case characters to upper case - equivalents. + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. - Obfuscation cannot be relied upon for strong protection. + ### Empty files - * file names very lightly obfuscated - * file names can be longer than standard encryption - * can use sub paths and copy single files - * directory structure visible - * identical files names will have identical uploaded names + Empty files aren't supported by the Enterprise File Fabric. Rclone will therefore + upload an empty file as a single space with a mime type of + `application/vnd.rclone.empty.file` and files with that mime type are + treated as empty. - Cloud storage systems have limits on file name length and - total path length which rclone is more likely to breach using - "Standard" file name encryption. Where file names are less than 156 - characters in length issues should not be encountered, irrespective of - cloud storage provider. + ### Root folder ID ### - An experimental advanced option `filename_encoding` is now provided to - address this problem to a certain degree. - For cloud storage systems with case sensitive file names (e.g. Google Drive), - `base64` can be used to reduce file name length. - For cloud storage systems using UTF-16 to store file names internally - (e.g. OneDrive, Dropbox, Box), `base32768` can be used to drastically reduce - file name length. + You can set the `root_folder_id` for rclone. This is the directory + (identified by its `Folder ID`) that rclone considers to be the root + of your Enterprise File Fabric. - An alternative, future rclone file name encryption mode may tolerate - backend provider path length limits. + Normally you will leave this blank and rclone will determine the + correct root to use itself. - ### Directory name encryption + However you can set this to restrict rclone to a specific folder + hierarchy. - Crypt offers the option of encrypting dir names or leaving them intact. - There are two options: + In order to do this you will have to find the `Folder ID` of the + directory you wish rclone to display. These aren't displayed in the + web interface, but you can use `rclone lsf` to find them, for example - True +$ rclone lsf --dirs-only -Fip --csv filefabric: 120673758,Burnt PDFs/ +120673759,My Quick Uploads/ 120673755,My Syncs/ 120673756,My backups/ +120673757,My contacts/ 120673761,S3 Storage/ - Encrypts the whole file path including directory names - Example: - `1/12/123.txt` is encrypted to - `p0e52nreeaj0a5ea7s64m4j72s/l42g6771hnv3an9cgc8cr2n1ng/qgm4avr35m5loi1th53ato71v0` - False + The ID for "S3 Storage" would be `120673761`. - Only encrypts file names, skips directory names - Example: - `1/12/123.txt` is encrypted to - `1/12/qgm4avr35m5loi1th53ato71v0` + ### Standard options - ### Modified time and hashes + Here are the Standard options specific to filefabric (Enterprise File Fabric). - Crypt stores modification times using the underlying remote so support - depends on that. + #### --filefabric-url - Hashes are not stored for crypt. However the data integrity is - protected by an extremely strong crypto authenticator. + URL of the Enterprise File Fabric to connect to. - Use the `rclone cryptcheck` command to check the - integrity of an encrypted remote instead of `rclone check` which can't - check the checksums properly. + Properties: + - Config: url + - Env Var: RCLONE_FILEFABRIC_URL + - Type: string + - Required: true + - Examples: + - "https://storagemadeeasy.com" + - Storage Made Easy US + - "https://eu.storagemadeeasy.com" + - Storage Made Easy EU + - "https://yourfabric.smestorage.com" + - Connect to your Enterprise File Fabric - ### Standard options + #### --filefabric-root-folder-id - Here are the Standard options specific to crypt (Encrypt/Decrypt a remote). + ID of the root folder. - #### --crypt-remote + Leave blank normally. - Remote to encrypt/decrypt. + Fill in to make rclone start with directory of a given ID. - Normally should contain a ':' and a path, e.g. "myremote:path/to/dir", - "myremote:bucket" or maybe "myremote:" (not recommended). Properties: - - Config: remote - - Env Var: RCLONE_CRYPT_REMOTE + - Config: root_folder_id + - Env Var: RCLONE_FILEFABRIC_ROOT_FOLDER_ID - Type: string - - Required: true + - Required: false - #### --crypt-filename-encryption + #### --filefabric-permanent-token + + Permanent Authentication Token. + + A Permanent Authentication Token can be created in the Enterprise File + Fabric, on the users Dashboard under Security, there is an entry + you'll see called "My Authentication Tokens". Click the Manage button + to create one. + + These tokens are normally valid for several years. + + For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens - How to encrypt the filenames. Properties: - - Config: filename_encryption - - Env Var: RCLONE_CRYPT_FILENAME_ENCRYPTION + - Config: permanent_token + - Env Var: RCLONE_FILEFABRIC_PERMANENT_TOKEN - Type: string - - Default: "standard" - - Examples: - - "standard" - - Encrypt the filenames. - - See the docs for the details. - - "obfuscate" - - Very simple filename obfuscation. - - "off" - - Don't encrypt the file names. - - Adds a ".bin", or "suffix" extension only. + - Required: false - #### --crypt-directory-name-encryption + ### Advanced options - Option to either encrypt directory names or leave them intact. + Here are the Advanced options specific to filefabric (Enterprise File Fabric). + + #### --filefabric-token + + Session Token. + + This is a session token which rclone caches in the config file. It is + usually valid for 1 hour. + + Don't set this value - rclone will set it automatically. - NB If filename_encryption is "off" then this option will do nothing. Properties: - - Config: directory_name_encryption - - Env Var: RCLONE_CRYPT_DIRECTORY_NAME_ENCRYPTION - - Type: bool - - Default: true - - Examples: - - "true" - - Encrypt directory names. - - "false" - - Don't encrypt directory names, leave them intact. + - Config: token + - Env Var: RCLONE_FILEFABRIC_TOKEN + - Type: string + - Required: false - #### --crypt-password + #### --filefabric-token-expiry - Password or pass phrase for encryption. + Token expiry time. + + Don't set this value - rclone will set it automatically. - **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: - - Config: password - - Env Var: RCLONE_CRYPT_PASSWORD + - Config: token_expiry + - Env Var: RCLONE_FILEFABRIC_TOKEN_EXPIRY - Type: string - - Required: true + - Required: false - #### --crypt-password2 + #### --filefabric-version - Password or pass phrase for salt. + Version read from the file fabric. - Optional but recommended. - Should be different to the previous password. + Don't set this value - rclone will set it automatically. - **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: - - Config: password2 - - Env Var: RCLONE_CRYPT_PASSWORD2 + - Config: version + - Env Var: RCLONE_FILEFABRIC_VERSION - Type: string - Required: false - ### Advanced options + #### --filefabric-encoding - Here are the Advanced options specific to crypt (Encrypt/Decrypt a remote). + The encoding for the backend. - #### --crypt-server-side-across-configs + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. - Deprecated: use --server-side-across-configs instead. + Properties: - Allow server-side operations (e.g. copy) to work across different crypt configs. + - Config: encoding + - Env Var: RCLONE_FILEFABRIC_ENCODING + - Type: Encoding + - Default: Slash,Del,Ctl,InvalidUtf8,Dot - Normally this option is not what you want, but if you have two crypts - pointing to the same backend you can use it. - This can be used, for example, to change file name encryption type - without re-uploading all the data. Just make two crypt backends - pointing to two different directories with the single changed - parameter and use rclone move to move the files between the crypt - remotes. - Properties: + # FTP + + FTP is the File Transfer Protocol. Rclone FTP support is provided using the + [github.com/jlaffaye/ftp](https://godoc.org/github.com/jlaffaye/ftp) + package. + + [Limitations of Rclone's FTP backend](#limitations) + + Paths are specified as `remote:path`. If the path does not begin with + a `/` it is relative to the home directory of the user. An empty path + `remote:` refers to the user's home directory. + + ## Configuration + + To create an FTP configuration named `remote`, run + + rclone config + + Rclone config guides you through an interactive setup process. A minimal + rclone FTP remote definition only requires host, username and password. + For an anonymous FTP server, see [below](#anonymous-ftp). + +No remotes found, make a new one? n) New remote r) Rename remote c) Copy +remote s) Set configuration password q) Quit config n/r/c/s/q> n name> +remote Type of storage to configure. Enter a string value. Press Enter +for the default (""). Choose a number from below, or type in your own +value [snip] XX / FTP  "ftp" [snip] Storage> ftp ** See help for ftp +backend at: https://rclone.org/ftp/ ** + +FTP host to connect to Enter a string value. Press Enter for the default +(""). Choose a number from below, or type in your own value 1 / Connect +to ftp.example.com  "ftp.example.com" host> ftp.example.com FTP username +Enter a string value. Press Enter for the default ("$USER"). user> FTP +port number Enter a signed integer. Press Enter for the default (21). +port> FTP password y) Yes type in my own password g) Generate random +password y/g> y Enter the password: password: Confirm the password: +password: Use FTP over TLS (Implicit) Enter a boolean value (true or +false). Press Enter for the default ("false"). tls> Use FTP over TLS +(Explicit) Enter a boolean value (true or false). Press Enter for the +default ("false"). explicit_tls> Remote config -------------------- +[remote] type = ftp host = ftp.example.com pass = *** ENCRYPTED *** +-------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y + - - Config: server_side_across_configs - - Env Var: RCLONE_CRYPT_SERVER_SIDE_ACROSS_CONFIGS - - Type: bool - - Default: false + To see all directories in the home directory of `remote` - #### --crypt-show-mapping + rclone lsd remote: - For all files listed show how the names encrypt. + Make a new directory - If this flag is set then for each file that the remote is asked to - list, it will log (at level INFO) a line stating the decrypted file - name and the encrypted file name. + rclone mkdir remote:path/to/directory - This is so you can work out which encrypted names are which decrypted - names just in case you need to do something with the encrypted file - names, or for debugging purposes. + List the contents of a directory - Properties: + rclone ls remote:path/to/directory - - Config: show_mapping - - Env Var: RCLONE_CRYPT_SHOW_MAPPING - - Type: bool - - Default: false + Sync `/home/local/directory` to the remote directory, deleting any + excess files in the directory. - #### --crypt-no-data-encryption + rclone sync --interactive /home/local/directory remote:directory - Option to either encrypt file data or leave it unencrypted. + ### Anonymous FTP - Properties: + When connecting to a FTP server that allows anonymous login, you can use the + special "anonymous" username. Traditionally, this user account accepts any + string as a password, although it is common to use either the password + "anonymous" or "guest". Some servers require the use of a valid e-mail + address as password. - - Config: no_data_encryption - - Env Var: RCLONE_CRYPT_NO_DATA_ENCRYPTION - - Type: bool - - Default: false - - Examples: - - "true" - - Don't encrypt file data, leave it unencrypted. - - "false" - - Encrypt file data. + Using [on-the-fly](#backend-path-to-dir) or + [connection string](https://rclone.org/docs/#connection-strings) remotes makes it easy to access + such servers, without requiring any configuration in advance. The following + are examples of that: - #### --crypt-pass-bad-blocks + rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=$(rclone obscure dummy) + rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=$(rclone obscure dummy): - If set this will pass bad blocks through as all 0. + The above examples work in Linux shells and in PowerShell, but not Windows + Command Prompt. They execute the [rclone obscure](https://rclone.org/commands/rclone_obscure/) + command to create a password string in the format required by the + [pass](#ftp-pass) option. The following examples are exactly the same, except use + an already obscured string representation of the same password "dummy", and + therefore works even in Windows Command Prompt: - This should not be set in normal operation, it should only be set if - trying to recover an encrypted file with errors and it is desired to - recover as much of the file as possible. + rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM + rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM: - Properties: + ### Implicit TLS - - Config: pass_bad_blocks - - Env Var: RCLONE_CRYPT_PASS_BAD_BLOCKS - - Type: bool - - Default: false + Rlone FTP supports implicit FTP over TLS servers (FTPS). This has to + be enabled in the FTP backend config for the remote, or with + [`--ftp-tls`](#ftp-tls). The default FTPS port is `990`, not `21` and + can be set with [`--ftp-port`](#ftp-port). - #### --crypt-filename-encoding + ### Restricted filename characters - How to encode the encrypted filename to text string. + In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) + the following characters are also replaced: - This option could help with shortening the encrypted filename. The - suitable option would depend on the way your remote count the filename - length and if it's case sensitive. + File names cannot end with the following characters. Replacement is + limited to the last character in a file name: - Properties: + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | SP | 0x20 | ␠ | - - Config: filename_encoding - - Env Var: RCLONE_CRYPT_FILENAME_ENCODING - - Type: string - - Default: "base32" - - Examples: - - "base32" - - Encode using base32. Suitable for all remote. - - "base64" - - Encode using base64. Suitable for case sensitive remote. - - "base32768" - - Encode using base32768. Suitable if your remote counts UTF-16 or - - Unicode codepoint instead of UTF-8 byte length. (Eg. Onedrive, Dropbox) + Not all FTP servers can have all characters in file names, for example: - #### --crypt-suffix + | FTP Server| Forbidden characters | + | --------- |:--------------------:| + | proftpd | `*` | + | pureftpd | `\ [ ]` | - If this is set it will override the default suffix of ".bin". + This backend's interactive configuration wizard provides a selection of + sensible encoding settings for major FTP servers: ProFTPd, PureFTPd, VsFTPd. + Just hit a selection number when prompted. - Setting suffix to "none" will result in an empty suffix. This may be useful - when the path length is critical. - Properties: + ### Standard options - - Config: suffix - - Env Var: RCLONE_CRYPT_SUFFIX - - Type: string - - Default: ".bin" + Here are the Standard options specific to ftp (FTP). - ### Metadata + #### --ftp-host - Any metadata supported by the underlying remote is read and written. + FTP host to connect to. - See the [metadata](https://rclone.org/docs/#metadata) docs for more info. + E.g. "ftp.example.com". - ## Backend commands + Properties: - Here are the commands specific to the crypt backend. + - Config: host + - Env Var: RCLONE_FTP_HOST + - Type: string + - Required: true - Run them with + #### --ftp-user - rclone backend COMMAND remote: + FTP username. - The help below will explain what arguments each command takes. + Properties: - See the [backend](https://rclone.org/commands/rclone_backend/) command for more - info on how to pass options and arguments. + - Config: user + - Env Var: RCLONE_FTP_USER + - Type: string + - Default: "$USER" - These can be run on a running backend using the rc command - [backend/command](https://rclone.org/rc/#backend-command). + #### --ftp-port - ### encode + FTP port number. - Encode the given filename(s) + Properties: - rclone backend encode remote: [options] [+] + - Config: port + - Env Var: RCLONE_FTP_PORT + - Type: int + - Default: 21 - This encodes the filenames given as arguments returning a list of - strings of the encoded results. + #### --ftp-pass - Usage Example: + FTP password. - rclone backend encode crypt: file1 [file2...] - rclone rc backend/command command=encode fs=crypt: file1 [file2...] + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + Properties: - ### decode + - Config: pass + - Env Var: RCLONE_FTP_PASS + - Type: string + - Required: false - Decode the given filename(s) + #### --ftp-tls - rclone backend decode remote: [options] [+] + Use Implicit FTPS (FTP over TLS). - This decodes the filenames given as arguments returning a list of - strings of the decoded results. It will return an error if any of the - inputs are invalid. + When using implicit FTP over TLS the client connects using TLS + right from the start which breaks compatibility with + non-TLS-aware servers. This is usually served over port 990 rather + than port 21. Cannot be used in combination with explicit FTPS. - Usage Example: + Properties: - rclone backend decode crypt: encryptedfile1 [encryptedfile2...] - rclone rc backend/command command=decode fs=crypt: encryptedfile1 [encryptedfile2...] + - Config: tls + - Env Var: RCLONE_FTP_TLS + - Type: bool + - Default: false + #### --ftp-explicit-tls + Use Explicit FTPS (FTP over TLS). + When using explicit FTP over TLS the client explicitly requests + security from the server in order to upgrade a plain text connection + to an encrypted one. Cannot be used in combination with implicit FTPS. - ## Backing up an encrypted remote + Properties: - If you wish to backup an encrypted remote, it is recommended that you use - `rclone sync` on the encrypted files, and make sure the passwords are - the same in the new encrypted remote. + - Config: explicit_tls + - Env Var: RCLONE_FTP_EXPLICIT_TLS + - Type: bool + - Default: false - This will have the following advantages + ### Advanced options - * `rclone sync` will check the checksums while copying - * you can use `rclone check` between the encrypted remotes - * you don't decrypt and encrypt unnecessarily + Here are the Advanced options specific to ftp (FTP). - For example, let's say you have your original remote at `remote:` with - the encrypted version at `eremote:` with path `remote:crypt`. You - would then set up the new remote `remote2:` and then the encrypted - version `eremote2:` with path `remote2:crypt` using the same passwords - as `eremote:`. + #### --ftp-concurrency - To sync the two remotes you would do + Maximum number of FTP simultaneous connections, 0 for unlimited. - rclone sync --interactive remote:crypt remote2:crypt + Note that setting this is very likely to cause deadlocks so it should + be used with care. - And to check the integrity you would do + If you are doing a sync or copy then make sure concurrency is one more + than the sum of `--transfers` and `--checkers`. - rclone check remote:crypt remote2:crypt + If you use `--check-first` then it just needs to be one more than the + maximum of `--checkers` and `--transfers`. - ## File formats + So for `concurrency 3` you'd use `--checkers 2 --transfers 2 + --check-first` or `--checkers 1 --transfers 1`. - ### File encryption - Files are encrypted 1:1 source file to destination object. The file - has a header and is divided into chunks. - #### Header + Properties: - * 8 bytes magic string `RCLONE\x00\x00` - * 24 bytes Nonce (IV) + - Config: concurrency + - Env Var: RCLONE_FTP_CONCURRENCY + - Type: int + - Default: 0 - The initial nonce is generated from the operating systems crypto - strong random number generator. The nonce is incremented for each - chunk read making sure each nonce is unique for each block written. - The chance of a nonce being re-used is minuscule. If you wrote an - exabyte of data (10¹⁸ bytes) you would have a probability of - approximately 2×10⁻³² of re-using a nonce. + #### --ftp-no-check-certificate - #### Chunk + Do not verify the TLS certificate of the server. - Each chunk will contain 64 KiB of data, except for the last one which - may have less data. The data chunk is in standard NaCl SecretBox - format. SecretBox uses XSalsa20 and Poly1305 to encrypt and - authenticate messages. + Properties: - Each chunk contains: + - Config: no_check_certificate + - Env Var: RCLONE_FTP_NO_CHECK_CERTIFICATE + - Type: bool + - Default: false - * 16 Bytes of Poly1305 authenticator - * 1 - 65536 bytes XSalsa20 encrypted data + #### --ftp-disable-epsv - 64k chunk size was chosen as the best performing chunk size (the - authenticator takes too much time below this and the performance drops - off due to cache effects above this). Note that these chunks are - buffered in memory so they can't be too big. + Disable using EPSV even if server advertises support. - This uses a 32 byte (256 bit key) key derived from the user password. + Properties: - #### Examples + - Config: disable_epsv + - Env Var: RCLONE_FTP_DISABLE_EPSV + - Type: bool + - Default: false - 1 byte file will encrypt to + #### --ftp-disable-mlsd - * 32 bytes header - * 17 bytes data chunk + Disable using MLSD even if server advertises support. - 49 bytes total + Properties: - 1 MiB (1048576 bytes) file will encrypt to + - Config: disable_mlsd + - Env Var: RCLONE_FTP_DISABLE_MLSD + - Type: bool + - Default: false - * 32 bytes header - * 16 chunks of 65568 bytes + #### --ftp-disable-utf8 - 1049120 bytes total (a 0.05% overhead). This is the overhead for big - files. + Disable using UTF-8 even if server advertises support. - ### Name encryption + Properties: - File names are encrypted segment by segment - the path is broken up - into `/` separated strings and these are encrypted individually. + - Config: disable_utf8 + - Env Var: RCLONE_FTP_DISABLE_UTF8 + - Type: bool + - Default: false - File segments are padded using PKCS#7 to a multiple of 16 bytes - before encryption. + #### --ftp-writing-mdtm - They are then encrypted with EME using AES with 256 bit key. EME - (ECB-Mix-ECB) is a wide-block encryption mode presented in the 2003 - paper "A Parallelizable Enciphering Mode" by Halevi and Rogaway. + Use MDTM to set modification time (VsFtpd quirk) - This makes for deterministic encryption which is what we want - the - same filename must encrypt to the same thing otherwise we can't find - it on the cloud storage system. + Properties: - This means that + - Config: writing_mdtm + - Env Var: RCLONE_FTP_WRITING_MDTM + - Type: bool + - Default: false - * filenames with the same name will encrypt the same - * filenames which start the same won't have a common prefix + #### --ftp-force-list-hidden - This uses a 32 byte key (256 bits) and a 16 byte (128 bits) IV both of - which are derived from the user password. + Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD. - After encryption they are written out using a modified version of - standard `base32` encoding as described in RFC4648. The standard - encoding is modified in two ways: + Properties: - * it becomes lower case (no-one likes upper case filenames!) - * we strip the padding character `=` + - Config: force_list_hidden + - Env Var: RCLONE_FTP_FORCE_LIST_HIDDEN + - Type: bool + - Default: false - `base32` is used rather than the more efficient `base64` so rclone can be - used on case insensitive remotes (e.g. Windows, Amazon Drive). + #### --ftp-idle-timeout - ### Key derivation + Max time before closing idle connections. - Rclone uses `scrypt` with parameters `N=16384, r=8, p=1` with an - optional user supplied salt (password2) to derive the 32+32+16 = 80 - bytes of key material required. If the user doesn't supply a salt - then rclone uses an internal one. + If no connections have been returned to the connection pool in the time + given, rclone will empty the connection pool. - `scrypt` makes it impractical to mount a dictionary attack on rclone - encrypted data. For full protection against this you should always use - a salt. + Set to 0 to keep connections indefinitely. - ## SEE ALSO - * [rclone cryptdecode](https://rclone.org/commands/rclone_cryptdecode/) - Show forward/reverse mapping of encrypted filenames + Properties: - # Compress + - Config: idle_timeout + - Env Var: RCLONE_FTP_IDLE_TIMEOUT + - Type: Duration + - Default: 1m0s - ## Warning + #### --ftp-close-timeout - This remote is currently **experimental**. Things may break and data may be lost. Anything you do with this remote is - at your own risk. Please understand the risks associated with using experimental code and don't use this remote in - critical applications. + Maximum time to wait for a response to close. - The `Compress` remote adds compression to another remote. It is best used with remotes containing - many large compressible files. + Properties: - ## Configuration + - Config: close_timeout + - Env Var: RCLONE_FTP_CLOSE_TIMEOUT + - Type: Duration + - Default: 1m0s - To use this remote, all you need to do is specify another remote and a compression mode to use: + #### --ftp-tls-cache-size -Current remotes: + Size of TLS session cache for all control and data connections. -Name Type ==== ==== remote_to_press sometype + TLS cache allows to resume TLS sessions and reuse PSK between connections. + Increase if default size is not enough resulting in TLS resumption errors. + Enabled by default. Use 0 to disable. -e) Edit existing remote $ rclone config -f) New remote -g) Delete remote -h) Rename remote -i) Copy remote -j) Set configuration password -k) Quit config e/n/d/r/c/s/q> n name> compress ... 8 / Compress a - remote  "compress" ... Storage> compress ** See help for compress - backend at: https://rclone.org/compress/ ** + Properties: -Remote to compress. Enter a string value. Press Enter for the default -(""). remote> remote_to_press:subdir Compression mode. Enter a string -value. Press Enter for the default ("gzip"). Choose a number from below, -or type in your own value 1 / Gzip compression balanced for speed and -compression strength.  "gzip" compression_mode> gzip Edit advanced -config? (y/n) y) Yes n) No (default) y/n> n Remote config --------------------- [compress] type = compress remote = -remote_to_press:subdir compression_mode = gzip -------------------- y) -Yes this is OK (default) e) Edit this remote d) Delete this remote -y/e/d> y + - Config: tls_cache_size + - Env Var: RCLONE_FTP_TLS_CACHE_SIZE + - Type: int + - Default: 32 + #### --ftp-disable-tls13 - ### Compression Modes + Disable TLS 1.3 (workaround for FTP servers with buggy TLS) - Currently only gzip compression is supported. It provides a decent balance between speed and size and is well - supported by other applications. Compression strength can further be configured via an advanced setting where 0 is no - compression and 9 is strongest compression. + Properties: - ### File types + - Config: disable_tls13 + - Env Var: RCLONE_FTP_DISABLE_TLS13 + - Type: bool + - Default: false - If you open a remote wrapped by compress, you will see that there are many files with an extension corresponding to - the compression algorithm you chose. These files are standard files that can be opened by various archive programs, - but they have some hidden metadata that allows them to be used by rclone. - While you may download and decompress these files at will, do **not** manually delete or rename files. Files without - correct metadata files will not be recognized by rclone. + #### --ftp-shut-timeout - ### File names + Maximum time to wait for data connection closing status. - The compressed files will be named `*.###########.gz` where `*` is the base file and the `#` part is base64 encoded - size of the uncompressed file. The file names should not be changed by anything other than the rclone compression backend. + Properties: + - Config: shut_timeout + - Env Var: RCLONE_FTP_SHUT_TIMEOUT + - Type: Duration + - Default: 1m0s - ### Standard options + #### --ftp-ask-password - Here are the Standard options specific to compress (Compress a remote). + Allow asking for FTP password when needed. - #### --compress-remote + If this is set and no password is supplied then rclone will ask for a password - Remote to compress. Properties: - - Config: remote - - Env Var: RCLONE_COMPRESS_REMOTE - - Type: string - - Required: true + - Config: ask_password + - Env Var: RCLONE_FTP_ASK_PASSWORD + - Type: bool + - Default: false - #### --compress-mode + #### --ftp-socks-proxy - Compression mode. + Socks 5 proxy host. + + Supports the format user:pass@host:port, user@host:port, host:port. + + Example: + + myUser:myPass@localhost:9005 + Properties: - - Config: mode - - Env Var: RCLONE_COMPRESS_MODE + - Config: socks_proxy + - Env Var: RCLONE_FTP_SOCKS_PROXY - Type: string - - Default: "gzip" - - Examples: - - "gzip" - - Standard gzip compression with fastest parameters. + - Required: false - ### Advanced options + #### --ftp-encoding - Here are the Advanced options specific to compress (Compress a remote). + The encoding for the backend. - #### --compress-level + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. - GZIP compression level (-2 to 9). + Properties: - Generally -1 (default, equivalent to 5) is recommended. - Levels 1 to 9 increase compression at the cost of speed. Going past 6 - generally offers very little return. + - Config: encoding + - Env Var: RCLONE_FTP_ENCODING + - Type: Encoding + - Default: Slash,Del,Ctl,RightSpace,Dot + - Examples: + - "Asterisk,Ctl,Dot,Slash" + - ProFTPd can't handle '*' in file names + - "BackSlash,Ctl,Del,Dot,RightSpace,Slash,SquareBracket" + - PureFTPd can't handle '[]' or '*' in file names + - "Ctl,LeftPeriod,Slash" + - VsFTPd can't handle file names starting with dot - Level -2 uses Huffman encoding only. Only use if you know what you - are doing. - Level 0 turns off compression. - Properties: - - Config: level - - Env Var: RCLONE_COMPRESS_LEVEL - - Type: int - - Default: -1 + ## Limitations - #### --compress-ram-cache-limit + FTP servers acting as rclone remotes must support `passive` mode. + The mode cannot be configured as `passive` is the only supported one. + Rclone's FTP implementation is not compatible with `active` mode + as [the library it uses doesn't support it](https://github.com/jlaffaye/ftp/issues/29). + This will likely never be supported due to security concerns. - Some remotes don't allow the upload of files with unknown size. - In this case the compressed file will need to be cached to determine - it's size. + Rclone's FTP backend does not support any checksums but can compare + file sizes. + + `rclone about` is not supported by the FTP backend. Backends without + this capability cannot determine free space for an rclone mount or + use policy `mfs` (most free space) as a member of an rclone union + remote. - Files smaller than this limit will be cached in RAM, files larger than - this limit will be cached on disk. + See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) - Properties: + The implementation of : `--dump headers`, + `--dump bodies`, `--dump auth` for debugging isn't the same as + for rclone HTTP based backends - it has less fine grained control. - - Config: ram_cache_limit - - Env Var: RCLONE_COMPRESS_RAM_CACHE_LIMIT - - Type: SizeSuffix - - Default: 20Mi + `--timeout` isn't supported (but `--contimeout` is). - ### Metadata + `--bind` isn't supported. - Any metadata supported by the underlying remote is read and written. + Rclone's FTP backend could support server-side move but does not + at present. - See the [metadata](https://rclone.org/docs/#metadata) docs for more info. + The `ftp_proxy` environment variable is not currently supported. + ### Modification times + File modification time (timestamps) is supported to 1 second resolution + for major FTP servers: ProFTPd, PureFTPd, VsFTPd, and FileZilla FTP server. + The `VsFTPd` server has non-standard implementation of time related protocol + commands and needs a special configuration setting: `writing_mdtm = true`. - # Combine + Support for precise file time with other FTP servers varies depending on what + protocol extensions they advertise. If all the `MLSD`, `MDTM` and `MFTM` + extensions are present, rclone will use them together to provide precise time. + Otherwise the times you see on the FTP server through rclone are those of the + last file upload. - The `combine` backend joins remotes together into a single directory - tree. + You can use the following command to check whether rclone can use precise time + with your FTP server: `rclone backend features your_ftp_remote:` (the trailing + colon is important). Look for the number in the line tagged by `Precision` + designating the remote time precision expressed as nanoseconds. A value of + `1000000000` means that file time precision of 1 second is available. + A value of `3153600000000000000` (or another large number) means "unsupported". - For example you might have a remote for images on one provider: + # Google Cloud Storage -$ rclone tree s3:imagesbucket / ├── image1.jpg └── image2.jpg + Paths are specified as `remote:bucket` (or `remote:` for the `lsd` + command.) You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`. + ## Configuration - And a remote for files on another: + The initial setup for google cloud storage involves getting a token from Google Cloud Storage + which you need to do in your browser. `rclone config` walks you + through it. -$ rclone tree drive:important/files / ├── file1.txt └── file2.txt + Here is an example of how to make a remote called `remote`. First run: + rclone config - The `combine` backend can join these together into a synthetic - directory structure like this: + This will guide you through an interactive setup process: -$ rclone tree combined: / ├── files │ ├── file1.txt │ └── file2.txt └── -images ├── image1.jpg └── image2.jpg +n) New remote +o) Delete remote +p) 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 [snip] XX / + Google Cloud Storage (this is not Google Drive)  "google cloud + storage" [snip] Storage> google cloud storage Google Application + Client Id - leave blank normally. client_id> Google Application + Client Secret - leave blank normally. client_secret> Project number + optional - needed only for list/create/delete buckets - see your + developer console. project_number> 12345678 Service Account + Credentials JSON file path - needed only if you want use SA instead + of interactive login. service_account_file> Access Control List for + new objects. Choose a number from below, or type in your own value 1 + / Object owner gets OWNER access, and all Authenticated Users get + READER access.  "authenticatedRead" 2 / Object owner gets OWNER + access, and project team owners get OWNER access. +  "bucketOwnerFullControl" 3 / Object owner gets OWNER access, and + project team owners get READER access.  "bucketOwnerRead" 4 / Object + owner gets OWNER access [default if left blank].  "private" 5 / + Object owner gets OWNER access, and project team members get access + according to their roles.  "projectPrivate" 6 / Object owner gets + OWNER access, and all Users get READER access.  "publicRead" + object_acl> 4 Access Control List for new buckets. Choose a number + from below, or type in your own value 1 / Project team owners get + OWNER access, and all Authenticated Users get READER access. +  "authenticatedRead" 2 / Project team owners get OWNER access + [default if left blank].  "private" 3 / Project team members get + access according to their roles.  "projectPrivate" 4 / Project team + owners get OWNER access, and all Users get READER access. +  "publicRead" 5 / Project team owners get OWNER access, and all + Users get WRITER access.  "publicReadWrite" bucket_acl> 2 Location + for the newly created buckets. Choose a number from below, or type + in your own value 1 / Empty for default location (US).  "" 2 / + Multi-regional location for Asia.  "asia" 3 / Multi-regional + location for Europe.  "eu" 4 / Multi-regional location for United + States.  "us" 5 / Taiwan.  "asia-east1" 6 / Tokyo. +  "asia-northeast1" 7 / Singapore.  "asia-southeast1" 8 / Sydney. +  "australia-southeast1" 9 / Belgium.  "europe-west1" 10 / London. +  "europe-west2" 11 / Iowa.  "us-central1" 12 / South Carolina. +  "us-east1" 13 / Northern Virginia.  "us-east4" 14 / Oregon. +  "us-west1" location> 12 The storage class to use when storing + objects in Google Cloud Storage. Choose a number from below, or type + in your own value 1 / Default  "" 2 / Multi-regional storage class +  "MULTI_REGIONAL" 3 / Regional storage class  "REGIONAL" 4 / + Nearline storage class  "NEARLINE" 5 / Coldline storage class +  "COLDLINE" 6 / Durable reduced availability storage class +  "DURABLE_REDUCED_AVAILABILITY" storage_class> 5 Remote config Use + web browser to automatically authenticate rclone with remote? +- Say Y if the machine running rclone has a web browser you can use +- Say N if running rclone on a (remote) machine without web browser + access If not sure try Y. If Y failed, try N. - You'd do this by specifying an `upstreams` parameter in the config - like this +y) Yes +z) 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] type = google cloud storage client_id = client_secret = + token = + {"AccessToken":"xxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","RefreshToken":"x/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxx","Expiry":"2014-07-17T20:49:14.929208288+01:00","Extra":null} + project_number = 12345678 object_acl = private bucket_acl = private + -------------------- +a) Yes this is OK +b) Edit this remote +c) Delete this remote y/e/d> y - upstreams = images=s3:imagesbucket files=drive:important/files - During the initial setup with `rclone config` you will specify the - upstreams remotes as a space separated list. The upstream remotes can - either be a local paths or other remotes. + See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a + machine with no Internet browser available. - ## Configuration + Note that rclone runs a webserver on your local machine to collect the + token as returned from Google if using web browser to automatically + authenticate. This only + runs from the moment it opens your browser to the moment you get back + the verification code. This is on `http://127.0.0.1:53682/` and this + it may require you to unblock it temporarily if you are running a host + firewall, or use manual mode. - Here is an example of how to make a combine called `remote` for the - example above. First run: + This remote is called `remote` and can now be used like this - rclone config + See all the buckets in your project - This will guide you through an interactive setup process: + rclone lsd remote: -No remotes found, make a new one? n) New remote s) Set configuration -password q) Quit config n/s/q> n name> remote Option Storage. Type of -storage to configure. Choose a number from below, or type in your own -value. ... XX / Combine several remotes into one  (combine) ... Storage> -combine Option upstreams. Upstreams for combining These should be in the -form dir=remote:path dir2=remote2:path Where before the = is specified -the root directory and after is the remote to put there. Embedded spaces -can be added using quotes "dir=remote:path with space" -"dir2=remote2:path with space" Enter a fs.SpaceSepList value. upstreams> -images=s3:imagesbucket files=drive:important/files -------------------- -[remote] type = combine upstreams = images=s3:imagesbucket -files=drive:important/files -------------------- y) Yes this is OK -(default) e) Edit this remote d) Delete this remote y/e/d> y + Make a new bucket + rclone mkdir remote:bucket - ### Configuring for Google Drive Shared Drives + List the contents of a bucket - Rclone has a convenience feature for making a combine backend for all - the shared drives you have access to. + rclone ls remote:bucket - Assuming your main (non shared drive) Google drive remote is called - `drive:` you would run + Sync `/home/local/directory` to the remote bucket, deleting any excess + files in the bucket. - rclone backend -o config drives drive: + rclone sync --interactive /home/local/directory remote:bucket - This would produce something like this: + ### Service Account support - [My Drive] - type = alias - remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=: + You can set up rclone with Google Cloud Storage in an unattended mode, + i.e. not tied to a specific end-user Google account. This is useful + when you want to synchronise files onto machines that don't have + actively logged-in users, for example build machines. - [Test Drive] - type = alias - remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=: + To get credentials for Google Cloud Platform + [IAM Service Accounts](https://cloud.google.com/iam/docs/service-accounts), + please head to the + [Service Account](https://console.cloud.google.com/permissions/serviceaccounts) + section of the Google Developer Console. Service Accounts behave just + like normal `User` permissions in + [Google Cloud Storage ACLs](https://cloud.google.com/storage/docs/access-control), + so you can limit their access (e.g. make them read only). After + creating an account, a JSON file containing the Service Account's + credentials will be downloaded onto your machines. These credentials + are what rclone will use for authentication. - [AllDrives] - type = combine - upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:" + To use a Service Account instead of OAuth2 token flow, enter the path + to your Service Account credentials at the `service_account_file` + prompt and rclone won't use the browser based authentication + flow. If you'd rather stuff the contents of the credentials file into + the rclone config file, you can set `service_account_credentials` with + the actual contents of the file instead, or set the equivalent + environment variable. - If you then add that config to your config file (find it with `rclone - config file`) then you can access all the shared drives in one place - with the `AllDrives:` remote. + ### Anonymous Access - See [the Google Drive docs](https://rclone.org/drive/#drives) for full info. + For downloads of objects that permit public access you can configure rclone + to use anonymous access by setting `anonymous` to `true`. + With unauthorized access you can't write or create files but only read or list + those buckets and objects that have public read access. + ### Application Default Credentials - ### Standard options + If no other source of credentials is provided, rclone will fall back + to + [Application Default Credentials](https://cloud.google.com/video-intelligence/docs/common/auth#authenticating_with_application_default_credentials) + this is useful both when you already have configured authentication + for your developer account, or in production when running on a google + compute host. Note that if running in docker, you may need to run + additional commands on your google compute machine - + [see this page](https://cloud.google.com/container-registry/docs/advanced-authentication#gcloud_as_a_docker_credential_helper). - Here are the Standard options specific to combine (Combine several remotes into one). + Note that in the case application default credentials are used, there + is no need to explicitly configure a project number. - #### --combine-upstreams + ### --fast-list - Upstreams for combining + This remote supports `--fast-list` which allows you to use fewer + transactions in exchange for more memory. See the [rclone + docs](https://rclone.org/docs/#fast-list) for more details. - These should be in the form + ### Custom upload headers - dir=remote:path dir2=remote2:path + You can set custom upload headers with the `--header-upload` + flag. Google Cloud Storage supports the headers as described in the + [working with metadata documentation](https://cloud.google.com/storage/docs/gsutil/addlhelp/WorkingWithObjectMetadata) - Where before the = is specified the root directory and after is the remote to - put there. + - Cache-Control + - Content-Disposition + - Content-Encoding + - Content-Language + - Content-Type + - X-Goog-Storage-Class + - X-Goog-Meta- - Embedded spaces can be added using quotes + Eg `--header-upload "Content-Type text/potato"` - "dir=remote:path with space" "dir2=remote2:path with space" + Note that the last of these is for setting custom metadata in the form + `--header-upload "x-goog-meta-key: value"` + ### Modification times + Google Cloud Storage stores md5sum natively. + Google's [gsutil](https://cloud.google.com/storage/docs/gsutil) tool stores modification time + with one-second precision as `goog-reserved-file-mtime` in file metadata. - Properties: + To ensure compatibility with gsutil, rclone stores modification time in 2 separate metadata entries. + `mtime` uses RFC3339 format with one-nanosecond precision. + `goog-reserved-file-mtime` uses Unix timestamp format with one-second precision. + To get modification time from object metadata, rclone reads the metadata in the following order: `mtime`, `goog-reserved-file-mtime`, object updated time. - - Config: upstreams - - Env Var: RCLONE_COMBINE_UPSTREAMS - - Type: SpaceSepList - - Default: + Note that rclone's default modify window is 1ns. + Files uploaded by gsutil only contain timestamps with one-second precision. + If you use rclone to sync files previously uploaded by gsutil, + rclone will attempt to update modification time for all these files. + To avoid these possibly unnecessary updates, use `--modify-window 1s`. - ### Metadata + ### Restricted filename characters - Any metadata supported by the underlying remote is read and written. + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | NUL | 0x00 | ␀ | + | LF | 0x0A | ␊ | + | CR | 0x0D | ␍ | + | / | 0x2F | / | - See the [metadata](https://rclone.org/docs/#metadata) docs for more info. + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. + ### Standard options - # Dropbox + Here are the Standard options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)). - Paths are specified as `remote:path` + #### --gcs-client-id - Dropbox paths may be as deep as required, e.g. - `remote:directory/subdirectory`. + OAuth Client Id. - ## Configuration + Leave blank normally. - The initial setup for dropbox involves getting a token from Dropbox - which you need to do in your browser. `rclone config` walks you - through it. + Properties: - Here is an example of how to make a remote called `remote`. First run: + - Config: client_id + - Env Var: RCLONE_GCS_CLIENT_ID + - Type: string + - Required: false - rclone config + #### --gcs-client-secret - This will guide you through an interactive setup process: + OAuth Client Secret. -n) New remote -o) Delete remote -p) 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 [snip] XX / - Dropbox  "dropbox" [snip] Storage> dropbox Dropbox App Key - leave - blank normally. app_key> Dropbox App Secret - leave blank normally. - app_secret> Remote config Please visit: - https://www.dropbox.com/1/oauth2/authorize?client_id=XXXXXXXXXXXXXXX&response_type=code - Enter the code: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXXXXXXXX - -------------------- [remote] app_key = app_secret = token = - XXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXX - -------------------- -q) Yes this is OK -r) Edit this remote -s) Delete this remote y/e/d> y + Leave blank normally. + Properties: - See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a - machine with no Internet browser available. + - Config: client_secret + - Env Var: RCLONE_GCS_CLIENT_SECRET + - Type: string + - Required: false - Note that rclone runs a webserver on your local machine to collect the - token as returned from Dropbox. This only - runs from the moment it opens your browser to the moment you get back - the verification code. This is on `http://127.0.0.1:53682/` and it - may require you to unblock it temporarily if you are running a host - firewall, or use manual mode. + #### --gcs-project-number - You can then use it like this, + Project number. - List directories in top level of your dropbox + Optional - needed only for list/create/delete buckets - see your developer console. - rclone lsd remote: + Properties: - List all the files in your dropbox + - Config: project_number + - Env Var: RCLONE_GCS_PROJECT_NUMBER + - Type: string + - Required: false - rclone ls remote: + #### --gcs-user-project - To copy a local directory to a dropbox directory called backup + User project. - rclone copy /home/source remote:backup + Optional - needed only for requester pays. - ### Dropbox for business + Properties: - Rclone supports Dropbox for business and Team Folders. + - Config: user_project + - Env Var: RCLONE_GCS_USER_PROJECT + - Type: string + - Required: false - When using Dropbox for business `remote:` and `remote:path/to/file` - will refer to your personal folder. + #### --gcs-service-account-file - If you wish to see Team Folders you must use a leading `/` in the - path, so `rclone lsd remote:/` will refer to the root and show you all - Team Folders and your User Folder. + Service Account Credentials JSON file path. - You can then use team folders like this `remote:/TeamFolder` and - `remote:/TeamFolder/path/to/file`. + Leave blank normally. + Needed only if you want use SA instead of interactive login. - A leading `/` for a Dropbox personal account will do nothing, but it - will take an extra HTTP transaction so it should be avoided. + Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. - ### Modified time and Hashes + Properties: - Dropbox supports modified times, but the only way to set a - modification time is to re-upload the file. + - Config: service_account_file + - Env Var: RCLONE_GCS_SERVICE_ACCOUNT_FILE + - Type: string + - Required: false - This means that if you uploaded your data with an older version of - rclone which didn't support the v2 API and modified times, rclone will - decide to upload all your old data to fix the modification times. If - you don't want this to happen use `--size-only` or `--checksum` flag - to stop it. + #### --gcs-service-account-credentials - Dropbox supports [its own hash - type](https://www.dropbox.com/developers/reference/content-hash) which - is checked for all transfers. + Service Account Credentials JSON blob. - ### Restricted filename characters + Leave blank normally. + Needed only if you want use SA instead of interactive login. - | Character | Value | Replacement | - | --------- |:-----:|:-----------:| - | NUL | 0x00 | ␀ | - | / | 0x2F | / | - | DEL | 0x7F | ␡ | - | \ | 0x5C | \ | + Properties: - File names can also not end with the following characters. - These only get replaced if they are the last character in the name: + - Config: service_account_credentials + - Env Var: RCLONE_GCS_SERVICE_ACCOUNT_CREDENTIALS + - Type: string + - Required: false - | Character | Value | Replacement | - | --------- |:-----:|:-----------:| - | SP | 0x20 | ␠ | + #### --gcs-anonymous - Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), - as they can't be used in JSON strings. + Access public buckets and objects without credentials. - ### Batch mode uploads {#batch-mode} + Set to 'true' if you just want to download files and don't configure credentials. - Using batch mode uploads is very important for performance when using - the Dropbox API. See [the dropbox performance guide](https://developers.dropbox.com/dbx-performance-guide) - for more info. + Properties: - There are 3 modes rclone can use for uploads. + - Config: anonymous + - Env Var: RCLONE_GCS_ANONYMOUS + - Type: bool + - Default: false - #### --dropbox-batch-mode off + #### --gcs-object-acl - In this mode rclone will not use upload batching. This was the default - before rclone v1.55. It has the disadvantage that it is very likely to - encounter `too_many_requests` errors like this + Access Control List for new objects. - NOTICE: too_many_requests/.: Too many requests or write operations. Trying again in 15 seconds. + Properties: - When rclone receives these it has to wait for 15s or sometimes 300s - before continuing which really slows down transfers. + - Config: object_acl + - Env Var: RCLONE_GCS_OBJECT_ACL + - Type: string + - Required: false + - Examples: + - "authenticatedRead" + - Object owner gets OWNER access. + - All Authenticated Users get READER access. + - "bucketOwnerFullControl" + - Object owner gets OWNER access. + - Project team owners get OWNER access. + - "bucketOwnerRead" + - Object owner gets OWNER access. + - Project team owners get READER access. + - "private" + - Object owner gets OWNER access. + - Default if left blank. + - "projectPrivate" + - Object owner gets OWNER access. + - Project team members get access according to their roles. + - "publicRead" + - Object owner gets OWNER access. + - All Users get READER access. - This will happen especially if `--transfers` is large, so this mode - isn't recommended except for compatibility or investigating problems. + #### --gcs-bucket-acl - #### --dropbox-batch-mode sync + Access Control List for new buckets. - In this mode rclone will batch up uploads to the size specified by - `--dropbox-batch-size` and commit them together. + Properties: - Using this mode means you can use a much higher `--transfers` - parameter (32 or 64 works fine) without receiving `too_many_requests` - errors. + - Config: bucket_acl + - Env Var: RCLONE_GCS_BUCKET_ACL + - Type: string + - Required: false + - Examples: + - "authenticatedRead" + - Project team owners get OWNER access. + - All Authenticated Users get READER access. + - "private" + - Project team owners get OWNER access. + - Default if left blank. + - "projectPrivate" + - Project team members get access according to their roles. + - "publicRead" + - Project team owners get OWNER access. + - All Users get READER access. + - "publicReadWrite" + - Project team owners get OWNER access. + - All Users get WRITER access. - This mode ensures full data integrity. + #### --gcs-bucket-policy-only - Note that there may be a pause when quitting rclone while rclone - finishes up the last batch using this mode. + Access checks should use bucket-level IAM policies. - #### --dropbox-batch-mode async + If you want to upload objects to a bucket with Bucket Policy Only set + then you will need to set this. - In this mode rclone will batch up uploads to the size specified by - `--dropbox-batch-size` and commit them together. + When it is set, rclone: - However it will not wait for the status of the batch to be returned to - the caller. This means rclone can use a much bigger batch size (much - bigger than `--transfers`), at the cost of not being able to check the - status of the upload. + - ignores ACLs set on buckets + - ignores ACLs set on objects + - creates buckets with Bucket Policy Only set - This provides the maximum possible upload speed especially with lots - of small files, however rclone can't check the file got uploaded - properly using this mode. + Docs: https://cloud.google.com/storage/docs/bucket-policy-only - If you are using this mode then using "rclone check" after the - transfer completes is recommended. Or you could do an initial transfer - with `--dropbox-batch-mode async` then do a final transfer with - `--dropbox-batch-mode sync` (the default). - Note that there may be a pause when quitting rclone while rclone - finishes up the last batch using this mode. + Properties: + - Config: bucket_policy_only + - Env Var: RCLONE_GCS_BUCKET_POLICY_ONLY + - Type: bool + - Default: false + #### --gcs-location - ### Standard options + Location for the newly created buckets. - Here are the Standard options specific to dropbox (Dropbox). + Properties: - #### --dropbox-client-id + - Config: location + - Env Var: RCLONE_GCS_LOCATION + - Type: string + - Required: false + - Examples: + - "" + - Empty for default location (US) + - "asia" + - Multi-regional location for Asia + - "eu" + - Multi-regional location for Europe + - "us" + - Multi-regional location for United States + - "asia-east1" + - Taiwan + - "asia-east2" + - Hong Kong + - "asia-northeast1" + - Tokyo + - "asia-northeast2" + - Osaka + - "asia-northeast3" + - Seoul + - "asia-south1" + - Mumbai + - "asia-south2" + - Delhi + - "asia-southeast1" + - Singapore + - "asia-southeast2" + - Jakarta + - "australia-southeast1" + - Sydney + - "australia-southeast2" + - Melbourne + - "europe-north1" + - Finland + - "europe-west1" + - Belgium + - "europe-west2" + - London + - "europe-west3" + - Frankfurt + - "europe-west4" + - Netherlands + - "europe-west6" + - Zürich + - "europe-central2" + - Warsaw + - "us-central1" + - Iowa + - "us-east1" + - South Carolina + - "us-east4" + - Northern Virginia + - "us-west1" + - Oregon + - "us-west2" + - California + - "us-west3" + - Salt Lake City + - "us-west4" + - Las Vegas + - "northamerica-northeast1" + - Montréal + - "northamerica-northeast2" + - Toronto + - "southamerica-east1" + - São Paulo + - "southamerica-west1" + - Santiago + - "asia1" + - Dual region: asia-northeast1 and asia-northeast2. + - "eur4" + - Dual region: europe-north1 and europe-west4. + - "nam4" + - Dual region: us-central1 and us-east1. - OAuth Client Id. + #### --gcs-storage-class - Leave blank normally. + The storage class to use when storing objects in Google Cloud Storage. Properties: - - Config: client_id - - Env Var: RCLONE_DROPBOX_CLIENT_ID + - Config: storage_class + - Env Var: RCLONE_GCS_STORAGE_CLASS - Type: string - Required: false + - Examples: + - "" + - Default + - "MULTI_REGIONAL" + - Multi-regional storage class + - "REGIONAL" + - Regional storage class + - "NEARLINE" + - Nearline storage class + - "COLDLINE" + - Coldline storage class + - "ARCHIVE" + - Archive storage class + - "DURABLE_REDUCED_AVAILABILITY" + - Durable reduced availability storage class - #### --dropbox-client-secret + #### --gcs-env-auth - OAuth Client Secret. + Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars). - Leave blank normally. + Only applies if service_account_file and service_account_credentials is blank. Properties: - - Config: client_secret - - Env Var: RCLONE_DROPBOX_CLIENT_SECRET - - Type: string - - Required: false + - Config: env_auth + - Env Var: RCLONE_GCS_ENV_AUTH + - Type: bool + - Default: false + - Examples: + - "false" + - Enter credentials in the next step. + - "true" + - Get GCP IAM credentials from the environment (env vars or IAM). ### Advanced options - Here are the Advanced options specific to dropbox (Dropbox). + Here are the Advanced options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)). - #### --dropbox-token + #### --gcs-token OAuth Access Token as a JSON blob. Properties: - Config: token - - Env Var: RCLONE_DROPBOX_TOKEN + - Env Var: RCLONE_GCS_TOKEN - Type: string - Required: false - #### --dropbox-auth-url + #### --gcs-auth-url Auth server URL. @@ -29310,11 +31151,11 @@ s) Delete this remote y/e/d> y Properties: - Config: auth_url - - Env Var: RCLONE_DROPBOX_AUTH_URL + - Env Var: RCLONE_GCS_AUTH_URL - Type: string - Required: false - #### --dropbox-token-url + #### --gcs-token-url Token server url. @@ -29323,189 +31164,73 @@ s) Delete this remote y/e/d> y Properties: - Config: token_url - - Env Var: RCLONE_DROPBOX_TOKEN_URL + - Env Var: RCLONE_GCS_TOKEN_URL - Type: string - Required: false - #### --dropbox-chunk-size - - Upload chunk size (< 150Mi). - - Any files larger than this will be uploaded in chunks of this size. - - Note that chunks are buffered in memory (one at a time) so rclone can - deal with retries. Setting this larger will increase the speed - slightly (at most 10% for 128 MiB in tests) at the cost of using more - memory. It can be set smaller if you are tight on memory. - - Properties: - - - Config: chunk_size - - Env Var: RCLONE_DROPBOX_CHUNK_SIZE - - Type: SizeSuffix - - Default: 48Mi - - #### --dropbox-impersonate - - Impersonate this user when using a business account. - - Note that if you want to use impersonate, you should make sure this - flag is set when running "rclone config" as this will cause rclone to - request the "members.read" scope which it won't normally. This is - needed to lookup a members email address into the internal ID that - dropbox uses in the API. - - Using the "members.read" scope will require a Dropbox Team Admin - to approve during the OAuth flow. - - You will have to use your own App (setting your own client_id and - client_secret) to use this option as currently rclone's default set of - permissions doesn't include "members.read". This can be added once - v1.55 or later is in use everywhere. - - - Properties: - - - Config: impersonate - - Env Var: RCLONE_DROPBOX_IMPERSONATE - - Type: string - - Required: false + #### --gcs-directory-markers - #### --dropbox-shared-files + Upload an empty object with a trailing slash when a new directory is created - Instructs rclone to work on individual shared files. + Empty folders are unsupported for bucket based remotes, this option creates an empty + object ending with "/", to persist the folder. - In this mode rclone's features are extremely limited - only list (ls, lsl, etc.) - operations and read operations (e.g. downloading) are supported in this mode. - All other operations will be disabled. Properties: - - Config: shared_files - - Env Var: RCLONE_DROPBOX_SHARED_FILES + - Config: directory_markers + - Env Var: RCLONE_GCS_DIRECTORY_MARKERS - Type: bool - Default: false - #### --dropbox-shared-folders + #### --gcs-no-check-bucket - Instructs rclone to work on shared folders. - - When this flag is used with no path only the List operation is supported and - all available shared folders will be listed. If you specify a path the first part - will be interpreted as the name of shared folder. Rclone will then try to mount this - shared to the root namespace. On success shared folder rclone proceeds normally. - The shared folder is now pretty much a normal folder and all normal operations - are supported. + If set, don't attempt to check the bucket exists or create it. + + This can be useful when trying to minimise the number of transactions + rclone does if you know the bucket exists already. - Note that we don't unmount the shared folder afterwards so the - --dropbox-shared-folders can be omitted after the first use of a particular - shared folder. Properties: - - Config: shared_folders - - Env Var: RCLONE_DROPBOX_SHARED_FOLDERS + - Config: no_check_bucket + - Env Var: RCLONE_GCS_NO_CHECK_BUCKET - Type: bool - Default: false - #### --dropbox-batch-mode - - Upload file batching sync|async|off. - - This sets the batch mode used by rclone. - - For full info see [the main docs](https://rclone.org/dropbox/#batch-mode) - - This has 3 possible values - - - off - no batching - - sync - batch uploads and check completion (default) - - async - batch upload and don't check completion - - Rclone will close any outstanding batches when it exits which may make - a delay on quit. - - - Properties: - - - Config: batch_mode - - Env Var: RCLONE_DROPBOX_BATCH_MODE - - Type: string - - Default: "sync" - - #### --dropbox-batch-size - - Max number of files in upload batch. - - This sets the batch size of files to upload. It has to be less than 1000. - - By default this is 0 which means rclone which calculate the batch size - depending on the setting of batch_mode. - - - batch_mode: async - default batch_size is 100 - - batch_mode: sync - default batch_size is the same as --transfers - - batch_mode: off - not in use - - Rclone will close any outstanding batches when it exits which may make - a delay on quit. - - Setting this is a great idea if you are uploading lots of small files - as it will make them a lot quicker. You can use --transfers 32 to - maximise throughput. - - - Properties: - - - Config: batch_size - - Env Var: RCLONE_DROPBOX_BATCH_SIZE - - Type: int - - Default: 0 - - #### --dropbox-batch-timeout - - Max time to allow an idle upload batch before uploading. + #### --gcs-decompress - If an upload batch is idle for more than this long then it will be - uploaded. + If set this will decompress gzip encoded objects. - The default for this is 0 which means rclone will choose a sensible - default based on the batch_mode in use. + It is possible to upload objects to GCS with "Content-Encoding: gzip" + set. Normally rclone will download these files as compressed objects. - - batch_mode: async - default batch_timeout is 10s - - batch_mode: sync - default batch_timeout is 500ms - - batch_mode: off - not in use + If this flag is set then rclone will decompress these files with + "Content-Encoding: gzip" as they are received. This means that rclone + can't check the size and hash but the file contents will be decompressed. Properties: - - Config: batch_timeout - - Env Var: RCLONE_DROPBOX_BATCH_TIMEOUT - - Type: Duration - - Default: 0s - - #### --dropbox-batch-commit-timeout - - Max time to wait for a batch to finish committing - - Properties: + - Config: decompress + - Env Var: RCLONE_GCS_DECOMPRESS + - Type: bool + - Default: false - - Config: batch_commit_timeout - - Env Var: RCLONE_DROPBOX_BATCH_COMMIT_TIMEOUT - - Type: Duration - - Default: 10m0s + #### --gcs-endpoint - #### --dropbox-pacer-min-sleep + Endpoint for the service. - Minimum time to sleep between API calls. + Leave blank normally. Properties: - - Config: pacer_min_sleep - - Env Var: RCLONE_DROPBOX_PACER_MIN_SLEEP - - Type: Duration - - Default: 10ms + - Config: endpoint + - Env Var: RCLONE_GCS_ENDPOINT + - Type: string + - Required: false - #### --dropbox-encoding + #### --gcs-encoding The encoding for the backend. @@ -29514,3714 +31239,3593 @@ s) Delete this remote y/e/d> y Properties: - Config: encoding - - Env Var: RCLONE_DROPBOX_ENCODING - - Type: MultiEncoder - - Default: Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot + - Env Var: RCLONE_GCS_ENCODING + - Type: Encoding + - Default: Slash,CrLf,InvalidUtf8,Dot ## Limitations - Note that Dropbox is case insensitive so you can't have a file called - "Hello.doc" and one called "hello.doc". - - There are some file names such as `thumbs.db` which Dropbox can't - store. There is a full list of them in the ["Ignored Files" section - of this document](https://www.dropbox.com/en/help/145). Rclone will - issue an error message `File name disallowed - not uploading` if it - attempts to upload one of those file names, but the sync won't fail. - - Some errors may occur if you try to sync copyright-protected files - because Dropbox has its own [copyright detector](https://techcrunch.com/2014/03/30/how-dropbox-knows-when-youre-sharing-copyrighted-stuff-without-actually-looking-at-your-stuff/) that - prevents this sort of file being downloaded. This will return the error `ERROR : - /path/to/your/file: Failed to copy: failed to open source object: - path/restricted_content/.` - - If you have more than 10,000 files in a directory then `rclone purge - dropbox:dir` will return the error `Failed to purge: There are too - many files involved in this operation`. As a work-around do an - `rclone delete dropbox:dir` followed by an `rclone rmdir dropbox:dir`. - - When using `rclone link` you'll need to set `--expire` if using a - non-personal account otherwise the visibility may not be correct. - (Note that `--expire` isn't supported on personal accounts). See the - [forum discussion](https://forum.rclone.org/t/rclone-link-dropbox-permissions/23211) and the - [dropbox SDK issue](https://github.com/dropbox/dropbox-sdk-go-unofficial/issues/75). - - ## Get your own Dropbox App ID - - When you use rclone with Dropbox in its default configuration you are using rclone's App ID. This is shared between all the rclone users. - - Here is how to create your own Dropbox App ID for rclone: - - 1. Log into the [Dropbox App console](https://www.dropbox.com/developers/apps/create) with your Dropbox Account (It need not - to be the same account as the Dropbox you want to access) + `rclone about` is not supported by the Google Cloud Storage backend. Backends without + this capability cannot determine free space for an rclone mount or + use policy `mfs` (most free space) as a member of an rclone union + remote. - 2. Choose an API => Usually this should be `Dropbox API` + See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) - 3. Choose the type of access you want to use => `Full Dropbox` or `App Folder`. If you want to use Team Folders, `Full Dropbox` is required ([see here](https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-create-team-folder-inside-my-app-s-folder/m-p/601005/highlight/true#M27911)). + # Google Drive - 4. Name your App. The app name is global, so you can't use `rclone` for example + Paths are specified as `drive:path` - 5. Click the button `Create App` + Drive paths may be as deep as required, e.g. `drive:directory/subdirectory`. - 6. Switch to the `Permissions` tab. Enable at least the following permissions: `account_info.read`, `files.metadata.write`, `files.content.write`, `files.content.read`, `sharing.write`. The `files.metadata.read` and `sharing.read` checkboxes will be marked too. Click `Submit` + ## Configuration - 7. Switch to the `Settings` tab. Fill `OAuth2 - Redirect URIs` as `http://localhost:53682/` and click on `Add` + The initial setup for drive involves getting a token from Google drive + which you need to do in your browser. `rclone config` walks you + through it. - 8. Find the `App key` and `App secret` values on the `Settings` tab. Use these values in rclone config to add a new remote or edit an existing remote. The `App key` setting corresponds to `client_id` in rclone config, the `App secret` corresponds to `client_secret` + Here is an example of how to make a remote called `remote`. First run: - # Enterprise File Fabric + rclone config - This backend supports [Storage Made Easy's Enterprise File - Fabric™](https://storagemadeeasy.com/about/) which provides a software - solution to integrate and unify File and Object Storage accessible - through a global file system. + This will guide you through an interactive setup process: - ## Configuration +No remotes found, make a new one? n) New remote r) Rename remote c) Copy +remote s) Set configuration password q) Quit config n/r/c/s/q> n name> +remote Type of storage to configure. Choose a number from below, or type +in your own value [snip] XX / Google Drive  "drive" [snip] Storage> +drive Google Application Client Id - leave blank normally. client_id> +Google Application Client Secret - leave blank normally. client_secret> +Scope that rclone should use when requesting access from drive. Choose a +number from below, or type in your own value 1 / Full access all files, +excluding Application Data Folder.  "drive" 2 / Read-only access to file +metadata and file contents.  "drive.readonly" / Access to files created +by rclone only. 3 | These are visible in the drive website. | File +authorization is revoked when the user deauthorizes the app. + "drive.file" / Allows read and write access to the Application Data +folder. 4 | This is not visible in the drive website.  "drive.appfolder" +/ Allows read-only access to file metadata but 5 | does not allow any +access to read or download file content.  "drive.metadata.readonly" +scope> 1 Service Account Credentials JSON file path - needed only if you +want use SA instead of interactive login. service_account_file> Remote +config Use web browser to automatically authenticate rclone with remote? +* Say Y if the machine running rclone has a web browser you can use * +Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. 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 Configure this as a Shared Drive (Team +Drive)? y) Yes n) No y/n> n -------------------- [remote] client_id = +client_secret = scope = drive root_folder_id = service_account_file = +token = +{"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2014-03-16T13:57:58.955387075Z"} +-------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y - The initial setup for the Enterprise File Fabric backend involves - getting a token from the Enterprise File Fabric which you need to - do in your browser. `rclone config` walks you through it. - Here is an example of how to make a remote called `remote`. First run: + See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a + machine with no Internet browser available. - rclone config + Note that rclone runs a webserver on your local machine to collect the + token as returned from Google if using web browser to automatically + authenticate. This only + runs from the moment it opens your browser to the moment you get back + the verification code. This is on `http://127.0.0.1:53682/` and it + may require you to unblock it temporarily if you are running a host + firewall, or use manual mode. - This will guide you through an interactive setup process: + You can then use it like this, -No remotes found, make a new one? n) New remote s) Set configuration -password q) Quit config n/s/q> n name> remote Type of storage to -configure. Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value [snip] XX / -Enterprise File Fabric  "filefabric" [snip] Storage> filefabric ** See -help for filefabric backend at: https://rclone.org/filefabric/ ** + List directories in top level of your drive -URL of the Enterprise File Fabric to connect to Enter a string value. -Press Enter for the default (""). Choose a number from below, or type in -your own value 1 / Storage Made Easy US  "https://storagemadeeasy.com" 2 -/ Storage Made Easy EU  "https://eu.storagemadeeasy.com" 3 / Connect to -your Enterprise File Fabric  "https://yourfabric.smestorage.com" url> -https://yourfabric.smestorage.com/ ID of the root folder Leave blank -normally. + rclone lsd remote: -Fill in to make rclone start with directory of a given ID. + List all the files in your drive -Enter a string value. Press Enter for the default (""). root_folder_id> -Permanent Authentication Token + rclone ls remote: -A Permanent Authentication Token can be created in the Enterprise File -Fabric, on the users Dashboard under Security, there is an entry you'll -see called "My Authentication Tokens". Click the Manage button to create -one. + To copy a local directory to a drive directory called backup -These tokens are normally valid for several years. + rclone copy /home/source remote:backup -For more info see: -https://docs.storagemadeeasy.com/organisationcloud/api-tokens + ### Scopes -Enter a string value. Press Enter for the default (""). permanent_token> -xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx Edit advanced config? (y/n) y) Yes n) -No (default) y/n> n Remote config -------------------- [remote] type = -filefabric url = https://yourfabric.smestorage.com/ permanent_token = -xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx -------------------- y) Yes this is OK -(default) e) Edit this remote d) Delete this remote y/e/d> y + Rclone allows you to select which scope you would like for rclone to + use. This changes what type of token is granted to rclone. [The + scopes are defined + here](https://developers.google.com/drive/v3/web/about-auth). + A comma-separated list is allowed e.g. `drive.readonly,drive.file`. - Once configured you can then use `rclone` like this, + The scope are - List directories in top level of your Enterprise File Fabric + #### drive - rclone lsd remote: + This is the default scope and allows full access to all files, except + for the Application Data Folder (see below). - List all the files in your Enterprise File Fabric + Choose this one if you aren't sure. - rclone ls remote: + #### drive.readonly - To copy a local directory to an Enterprise File Fabric directory called backup + This allows read only access to all files. Files may be listed and + downloaded but not uploaded, renamed or deleted. - rclone copy /home/source remote:backup + #### drive.file - ### Modified time and hashes + With this scope rclone can read/view/modify only those files and + folders it creates. - The Enterprise File Fabric allows modification times to be set on - files accurate to 1 second. These will be used to detect whether - objects need syncing or not. + So if you uploaded files to drive via the web interface (or any other + means) they will not be visible to rclone. - The Enterprise File Fabric does not support any data hashes at this time. + This can be useful if you are using rclone to backup data and you want + to be sure confidential data on your drive is not visible to rclone. - ### Restricted filename characters + Files created with this scope are visible in the web interface. - The [default restricted characters set](https://rclone.org/overview/#restricted-characters) - will be replaced. + #### drive.appfolder - Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), - as they can't be used in JSON strings. + This gives rclone its own private area to store files. Rclone will + not be able to see any other files on your drive and you won't be able + to see rclone's files from the web interface either. - ### Empty files + #### drive.metadata.readonly - Empty files aren't supported by the Enterprise File Fabric. Rclone will therefore - upload an empty file as a single space with a mime type of - `application/vnd.rclone.empty.file` and files with that mime type are - treated as empty. + This allows read only access to file names only. It does not allow + rclone to download or upload data, or rename or delete files or + directories. - ### Root folder ID ### + ### Root folder ID - You can set the `root_folder_id` for rclone. This is the directory + This option has been moved to the advanced section. You can set the `root_folder_id` for rclone. This is the directory (identified by its `Folder ID`) that rclone considers to be the root - of your Enterprise File Fabric. + of your drive. Normally you will leave this blank and rclone will determine the correct root to use itself. However you can set this to restrict rclone to a specific folder - hierarchy. + hierarchy or to access data within the "Computers" tab on the drive + web interface (where files from Google's Backup and Sync desktop + program go). In order to do this you will have to find the `Folder ID` of the - directory you wish rclone to display. These aren't displayed in the - web interface, but you can use `rclone lsf` to find them, for example + directory you wish rclone to display. This will be the last segment + of the URL when you open the relevant folder in the drive web + interface. -$ rclone lsf --dirs-only -Fip --csv filefabric: 120673758,Burnt PDFs/ -120673759,My Quick Uploads/ 120673755,My Syncs/ 120673756,My backups/ -120673757,My contacts/ 120673761,S3 Storage/ + So if the folder you want rclone to use has a URL which looks like + `https://drive.google.com/drive/folders/1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh` + in the browser, then you use `1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh` as + the `root_folder_id` in the config. + **NB** folders under the "Computers" tab seem to be read only (drive + gives a 500 error) when using rclone. - The ID for "S3 Storage" would be `120673761`. + There doesn't appear to be an API to discover the folder IDs of the + "Computers" tab - please contact us if you know otherwise! + Note also that rclone can't access any data under the "Backups" tab on + the google drive web interface yet. - ### Standard options + ### Service Account support - Here are the Standard options specific to filefabric (Enterprise File Fabric). + You can set up rclone with Google Drive in an unattended mode, + i.e. not tied to a specific end-user Google account. This is useful + when you want to synchronise files onto machines that don't have + actively logged-in users, for example build machines. - #### --filefabric-url + To use a Service Account instead of OAuth2 token flow, enter the path + to your Service Account credentials at the `service_account_file` + prompt during `rclone config` and rclone won't use the browser based + authentication flow. If you'd rather stuff the contents of the + credentials file into the rclone config file, you can set + `service_account_credentials` with the actual contents of the file + instead, or set the equivalent environment variable. - URL of the Enterprise File Fabric to connect to. + #### Use case - Google Apps/G-suite account and individual Drive - Properties: + Let's say that you are the administrator of a Google Apps (old) or + G-suite account. + The goal is to store data on an individual's Drive account, who IS + a member of the domain. + We'll call the domain **example.com**, and the user + **foo@example.com**. - - Config: url - - Env Var: RCLONE_FILEFABRIC_URL - - Type: string - - Required: true - - Examples: - - "https://storagemadeeasy.com" - - Storage Made Easy US - - "https://eu.storagemadeeasy.com" - - Storage Made Easy EU - - "https://yourfabric.smestorage.com" - - Connect to your Enterprise File Fabric + There's a few steps we need to go through to accomplish this: - #### --filefabric-root-folder-id + ##### 1. Create a service account for example.com + - To create a service account and obtain its credentials, go to the + [Google Developer Console](https://console.developers.google.com). + - You must have a project - create one if you don't. + - Then go to "IAM & admin" -> "Service Accounts". + - Use the "Create Service Account" button. Fill in "Service account name" + and "Service account ID" with something that identifies your client. + - Select "Create And Continue". Step 2 and 3 are optional. + - These credentials are what rclone will use for authentication. + If you ever need to remove access, press the "Delete service + account key" button. - ID of the root folder. + ##### 2. Allowing API access to example.com Google Drive + - Go to example.com's admin console + - Go into "Security" (or use the search bar) + - Select "Show more" and then "Advanced settings" + - Select "Manage API client access" in the "Authentication" section + - In the "Client Name" field enter the service account's + "Client ID" - this can be found in the Developer Console under + "IAM & Admin" -> "Service Accounts", then "View Client ID" for + the newly created service account. + It is a ~21 character numerical string. + - In the next field, "One or More API Scopes", enter + `https://www.googleapis.com/auth/drive` + to grant access to Google Drive specifically. - Leave blank normally. + ##### 3. Configure rclone, assuming a new install - Fill in to make rclone start with directory of a given ID. +rclone config +n/s/q> n # New name>gdrive # Gdrive is an example name Storage> # Select +the number shown for Google Drive client_id> # Can be left blank +client_secret> # Can be left blank scope> # Select your scope, 1 for +example root_folder_id> # Can be left blank service_account_file> +/home/foo/myJSONfile.json # This is where the JSON file goes! y/n> # +Auto config, n - Properties: - - Config: root_folder_id - - Env Var: RCLONE_FILEFABRIC_ROOT_FOLDER_ID - - Type: string - - Required: false + ##### 4. Verify that it's working + - `rclone -v --drive-impersonate foo@example.com lsf gdrive:backup` + - The arguments do: + - `-v` - verbose logging + - `--drive-impersonate foo@example.com` - this is what does + the magic, pretending to be user foo. + - `lsf` - list files in a parsing friendly way + - `gdrive:backup` - use the remote called gdrive, work in + the folder named backup. - #### --filefabric-permanent-token + Note: in case you configured a specific root folder on gdrive and rclone is unable to access the contents of that folder when using `--drive-impersonate`, do this instead: + - in the gdrive web interface, share your root folder with the user/email of the new Service Account you created/selected at step #1 + - use rclone without specifying the `--drive-impersonate` option, like this: + `rclone -v lsf gdrive:backup` - Permanent Authentication Token. - A Permanent Authentication Token can be created in the Enterprise File - Fabric, on the users Dashboard under Security, there is an entry - you'll see called "My Authentication Tokens". Click the Manage button - to create one. + ### Shared drives (team drives) - These tokens are normally valid for several years. + If you want to configure the remote to point to a Google Shared Drive + (previously known as Team Drives) then answer `y` to the question + `Configure this as a Shared Drive (Team Drive)?`. - For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens + This will fetch the list of Shared Drives from google and allow you to + configure which one you want to use. You can also type in a Shared + Drive ID if you prefer. + For example: - Properties: +Configure this as a Shared Drive (Team Drive)? y) Yes n) No y/n> y +Fetching Shared Drive list... Choose a number from below, or type in +your own value 1 / Rclone Test  "xxxxxxxxxxxxxxxxxxxx" 2 / Rclone Test 2 + "yyyyyyyyyyyyyyyyyyyy" 3 / Rclone Test 3  "zzzzzzzzzzzzzzzzzzzz" Enter +a Shared Drive ID> 1 -------------------- [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} +team_drive = xxxxxxxxxxxxxxxxxxxx -------------------- y) Yes this is OK +e) Edit this remote d) Delete this remote y/e/d> y - - Config: permanent_token - - Env Var: RCLONE_FILEFABRIC_PERMANENT_TOKEN - - Type: string - - Required: false - ### Advanced options + ### --fast-list - Here are the Advanced options specific to filefabric (Enterprise File Fabric). + This remote supports `--fast-list` which allows you to use fewer + transactions in exchange for more memory. See the [rclone + docs](https://rclone.org/docs/#fast-list) for more details. - #### --filefabric-token + It does this by combining multiple `list` calls into a single API request. - Session Token. + This works by combining many `'%s' in parents` filters into one expression. + To list the contents of directories a, b and c, the following requests will be send by the regular `List` function: - This is a session token which rclone caches in the config file. It is - usually valid for 1 hour. +trashed=false and 'a' in parents trashed=false and 'b' in parents +trashed=false and 'c' in parents - Don't set this value - rclone will set it automatically. + These can now be combined into a single request: +trashed=false and ('a' in parents or 'b' in parents or 'c' in parents) - Properties: - - Config: token - - Env Var: RCLONE_FILEFABRIC_TOKEN - - Type: string - - Required: false + The implementation of `ListR` will put up to 50 `parents` filters into one request. + It will use the `--checkers` value to specify the number of requests to run in parallel. - #### --filefabric-token-expiry + In tests, these batch requests were up to 20x faster than the regular method. + Running the following command against different sized folders gives: - Token expiry time. +rclone lsjson -vv -R --checkers=6 gdrive:folder - Don't set this value - rclone will set it automatically. + small folder (220 directories, 700 files): - Properties: + - without `--fast-list`: 38s + - with `--fast-list`: 10s - - Config: token_expiry - - Env Var: RCLONE_FILEFABRIC_TOKEN_EXPIRY - - Type: string - - Required: false + large folder (10600 directories, 39000 files): - #### --filefabric-version + - without `--fast-list`: 22:05 min + - with `--fast-list`: 58s - Version read from the file fabric. + ### Modification times and hashes - Don't set this value - rclone will set it automatically. + Google drive stores modification times accurate to 1 ms. + Hash algorithms MD5, SHA1 and SHA256 are supported. Note, however, + that a small fraction of files uploaded may not have SHA1 or SHA256 + hashes especially if they were uploaded before 2018. - Properties: + ### Restricted filename characters - - Config: version - - Env Var: RCLONE_FILEFABRIC_VERSION - - Type: string - - Required: false + Only Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. - #### --filefabric-encoding + In contrast to other backends, `/` can also be used in names and `.` + or `..` are valid names. - The encoding for the backend. + ### Revisions - See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + 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. - Properties: + Revisions follow the standard google policy which at time of writing + was - - Config: encoding - - Env Var: RCLONE_FILEFABRIC_ENCODING - - Type: MultiEncoder - - Default: Slash,Del,Ctl,InvalidUtf8,Dot + * They are deleted after 30 days or 100 revisions (whatever comes first). + * They do not count towards a user storage quota. + ### Deleting files + By default rclone will send all files to the trash when deleting + files. If deleting them permanently is required then use the + `--drive-use-trash=false` flag, or set the equivalent environment + variable. - # FTP + ### Shortcuts - FTP is the File Transfer Protocol. Rclone FTP support is provided using the - [github.com/jlaffaye/ftp](https://godoc.org/github.com/jlaffaye/ftp) - package. + In March 2020 Google introduced a new feature in Google Drive called + [drive shortcuts](https://support.google.com/drive/answer/9700156) + ([API](https://developers.google.com/drive/api/v3/shortcuts)). These + will (by September 2020) [replace the ability for files or folders to + be in multiple folders at once](https://cloud.google.com/blog/products/g-suite/simplifying-google-drives-folder-structure-and-sharing-models). - [Limitations of Rclone's FTP backend](#limitations) + Shortcuts are files that link to other files on Google Drive somewhat + like a symlink in unix, except they point to the underlying file data + (e.g. the inode in unix terms) so they don't break if the source is + renamed or moved about. - Paths are specified as `remote:path`. If the path does not begin with - a `/` it is relative to the home directory of the user. An empty path - `remote:` refers to the user's home directory. + By default rclone treats these as follows. - ## Configuration + For shortcuts pointing to files: - To create an FTP configuration named `remote`, run + - When listing a file shortcut appears as the destination file. + - When downloading the contents of the destination file is downloaded. + - When updating shortcut file with a non shortcut file, the shortcut is removed then a new file is uploaded in place of the shortcut. + - When server-side moving (renaming) the shortcut is renamed, not the destination file. + - When server-side copying the shortcut is copied, not the contents of the shortcut. (unless `--drive-copy-shortcut-content` is in use in which case the contents of the shortcut gets copied). + - When deleting the shortcut is deleted not the linked file. + - When setting the modification time, the modification time of the linked file will be set. - rclone config + For shortcuts pointing to folders: - Rclone config guides you through an interactive setup process. A minimal - rclone FTP remote definition only requires host, username and password. - For an anonymous FTP server, see [below](#anonymous-ftp). + - When listing the shortcut appears as a folder and that folder will contain the contents of the linked folder appear (including any sub folders) + - When downloading the contents of the linked folder and sub contents are downloaded + - When uploading to a shortcut folder the file will be placed in the linked folder + - When server-side moving (renaming) the shortcut is renamed, not the destination folder + - When server-side copying the contents of the linked folder is copied, not the shortcut. + - When deleting with `rclone rmdir` or `rclone purge` the shortcut is deleted not the linked folder. + - **NB** When deleting with `rclone remove` or `rclone mount` the contents of the linked folder will be deleted. -No remotes found, make a new one? n) New remote r) Rename remote c) Copy -remote s) Set configuration password q) Quit config n/r/c/s/q> n name> -remote Type of storage to configure. Enter a string value. Press Enter -for the default (""). Choose a number from below, or type in your own -value [snip] XX / FTP  "ftp" [snip] Storage> ftp ** See help for ftp -backend at: https://rclone.org/ftp/ ** + The [rclone backend](https://rclone.org/commands/rclone_backend/) command can be used to create shortcuts. -FTP host to connect to Enter a string value. Press Enter for the default -(""). Choose a number from below, or type in your own value 1 / Connect -to ftp.example.com  "ftp.example.com" host> ftp.example.com FTP username -Enter a string value. Press Enter for the default ("$USER"). user> FTP -port number Enter a signed integer. Press Enter for the default (21). -port> FTP password y) Yes type in my own password g) Generate random -password y/g> y Enter the password: password: Confirm the password: -password: Use FTP over TLS (Implicit) Enter a boolean value (true or -false). Press Enter for the default ("false"). tls> Use FTP over TLS -(Explicit) Enter a boolean value (true or false). Press Enter for the -default ("false"). explicit_tls> Remote config -------------------- -[remote] type = ftp host = ftp.example.com pass = *** ENCRYPTED *** --------------------- y) Yes this is OK e) Edit this remote d) Delete -this remote y/e/d> y + Shortcuts can be completely ignored with the `--drive-skip-shortcuts` flag + or the corresponding `skip_shortcuts` configuration setting. + ### Emptying trash - To see all directories in the home directory of `remote` + If you wish to empty your trash you can use the `rclone cleanup remote:` + command which will permanently delete all your trashed files. This command + does not take any path arguments. - rclone lsd remote: + Note that Google Drive takes some time (minutes to days) to empty the + trash even though the command returns within a few seconds. No output + is echoed, so there will be no confirmation even using -v or -vv. - Make a new directory + ### Quota information - rclone mkdir remote:path/to/directory + To view your current quota you can use the `rclone about remote:` + command which will display your usage limit (quota), the usage in Google + Drive, the size of all files in the Trash and the space used by other + Google services such as Gmail. This command does not take any path + arguments. - List the contents of a directory + #### Import/Export of google documents - rclone ls remote:path/to/directory + Google documents can be exported from and uploaded to Google Drive. - Sync `/home/local/directory` to the remote directory, deleting any - excess files in the directory. + When rclone downloads a Google doc it chooses a format to download + depending upon the `--drive-export-formats` setting. + By default the export formats are `docx,xlsx,pptx,svg` which are a + sensible default for an editable document. - rclone sync --interactive /home/local/directory remote:directory + 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. - ### Anonymous FTP + If you prefer an archive copy then you might use `--drive-export-formats + pdf`, or if you prefer openoffice/libreoffice formats you might use + `--drive-export-formats ods,odt,odp`. - When connecting to a FTP server that allows anonymous login, you can use the - special "anonymous" username. Traditionally, this user account accepts any - string as a password, although it is common to use either the password - "anonymous" or "guest". Some servers require the use of a valid e-mail - address as password. + Note that rclone adds the extension to the google doc, so if it is + called `My Spreadsheet` on google docs, it will be exported as `My + Spreadsheet.xlsx` or `My Spreadsheet.pdf` etc. - Using [on-the-fly](#backend-path-to-dir) or - [connection string](https://rclone.org/docs/#connection-strings) remotes makes it easy to access - such servers, without requiring any configuration in advance. The following - are examples of that: + When importing files into Google Drive, rclone will convert all + files with an extension in `--drive-import-formats` to their + associated document type. + rclone will not convert any files by default, since the conversion + is lossy process. - rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=$(rclone obscure dummy) - rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=$(rclone obscure dummy): + The conversion must result in a file with the same extension when + the `--drive-export-formats` rules are applied to the uploaded document. - The above examples work in Linux shells and in PowerShell, but not Windows - Command Prompt. They execute the [rclone obscure](https://rclone.org/commands/rclone_obscure/) - command to create a password string in the format required by the - [pass](#ftp-pass) option. The following examples are exactly the same, except use - an already obscured string representation of the same password "dummy", and - therefore works even in Windows Command Prompt: + Here are some examples for allowed and prohibited conversions. - rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM - rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM: + | export-formats | import-formats | Upload Ext | Document Ext | Allowed | + | -------------- | -------------- | ---------- | ------------ | ------- | + | odt | odt | odt | odt | Yes | + | odt | docx,odt | odt | odt | Yes | + | | docx | docx | docx | Yes | + | | odt | odt | docx | No | + | odt,docx | docx,odt | docx | odt | No | + | docx,odt | docx,odt | docx | docx | Yes | + | docx,odt | docx,odt | odt | docx | No | - ### Implicit TLS + This limitation can be disabled by specifying `--drive-allow-import-name-change`. + When using this flag, rclone can convert multiple files types resulting + in the same document type at once, e.g. with `--drive-import-formats docx,odt,txt`, + all files having these extension would result in a document represented as a docx file. + This brings the additional risk of overwriting a document, if multiple files + have the same stem. Many rclone operations will not handle this name change + in any way. They assume an equal name when copying files and might copy the + file again or delete them when the name changes. - Rlone FTP supports implicit FTP over TLS servers (FTPS). This has to - be enabled in the FTP backend config for the remote, or with - [`--ftp-tls`](#ftp-tls). The default FTPS port is `990`, not `21` and - can be set with [`--ftp-port`](#ftp-port). + Here are the possible export extensions with their corresponding mime types. + Most of these can also be used for importing, but there more that are not + listed here. Some of these additional ones might only be available when + the operating system provides the correct MIME type entries. - ### Restricted filename characters + This list can be changed by Google Drive at any time and might not + represent the currently available conversions. - In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) - the following characters are also replaced: + | Extension | Mime Type | Description | + | --------- |-----------| ------------| + | bmp | image/bmp | Windows Bitmap format | + | csv | text/csv | Standard CSV format for Spreadsheets | + | doc | application/msword | Classic Word file | + | docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document | Microsoft Office Document | + | epub | application/epub+zip | E-book format | + | html | text/html | An HTML Document | + | jpg | image/jpeg | A JPEG Image File | + | json | application/vnd.google-apps.script+json | JSON Text Format for Google Apps scripts | + | odp | application/vnd.oasis.opendocument.presentation | Openoffice Presentation | + | ods | application/vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet | + | ods | application/x-vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet | + | odt | application/vnd.oasis.opendocument.text | Openoffice Document | + | pdf | application/pdf | Adobe PDF Format | + | pjpeg | image/pjpeg | Progressive JPEG Image | + | png | image/png | PNG Image Format| + | pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation | Microsoft Office Powerpoint | + | rtf | application/rtf | Rich Text Format | + | svg | image/svg+xml | Scalable Vector Graphics Format | + | tsv | text/tab-separated-values | Standard TSV format for spreadsheets | + | txt | text/plain | Plain Text | + | wmf | application/x-msmetafile | Windows Meta File | + | xls | application/vnd.ms-excel | Classic Excel file | + | xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | Microsoft Office Spreadsheet | + | zip | application/zip | A ZIP file of HTML, Images CSS | - File names cannot end with the following characters. Replacement is - limited to the last character in a file name: + Google documents can also be exported as link files. These files will + open a browser window for the Google Docs website of that document + when opened. The link file extension has to be specified as a + `--drive-export-formats` parameter. They will match all available + Google Documents. - | Character | Value | Replacement | - | --------- |:-----:|:-----------:| - | SP | 0x20 | ␠ | + | Extension | Description | OS Support | + | --------- | ----------- | ---------- | + | desktop | freedesktop.org specified desktop entry | Linux | + | link.html | An HTML Document with a redirect | All | + | url | INI style link file | macOS, Windows | + | webloc | macOS specific XML format | macOS | - Not all FTP servers can have all characters in file names, for example: - | FTP Server| Forbidden characters | - | --------- |:--------------------:| - | proftpd | `*` | - | pureftpd | `\ [ ]` | + ### Standard options - This backend's interactive configuration wizard provides a selection of - sensible encoding settings for major FTP servers: ProFTPd, PureFTPd, VsFTPd. - Just hit a selection number when prompted. + Here are the Standard options specific to drive (Google Drive). + #### --drive-client-id - ### Standard options + Google Application Client Id + Setting your own is recommended. + See https://rclone.org/drive/#making-your-own-client-id for how to create your own. + If you leave this blank, it will use an internal key which is low performance. - Here are the Standard options specific to ftp (FTP). + Properties: - #### --ftp-host + - Config: client_id + - Env Var: RCLONE_DRIVE_CLIENT_ID + - Type: string + - Required: false - FTP host to connect to. + #### --drive-client-secret - E.g. "ftp.example.com". + OAuth Client Secret. + + Leave blank normally. Properties: - - Config: host - - Env Var: RCLONE_FTP_HOST + - Config: client_secret + - Env Var: RCLONE_DRIVE_CLIENT_SECRET - Type: string - - Required: true + - Required: false - #### --ftp-user + #### --drive-scope - FTP username. + Comma separated list of scopes that rclone should use when requesting access from drive. Properties: - - Config: user - - Env Var: RCLONE_FTP_USER + - Config: scope + - Env Var: RCLONE_DRIVE_SCOPE - Type: string - - Default: "$USER" + - Required: false + - Examples: + - "drive" + - Full access all files, excluding Application Data Folder. + - "drive.readonly" + - Read-only access to file metadata and file contents. + - "drive.file" + - Access to files created by rclone only. + - These are visible in the drive website. + - File authorization is revoked when the user deauthorizes the app. + - "drive.appfolder" + - Allows read and write access to the Application Data folder. + - This is not visible in the drive website. + - "drive.metadata.readonly" + - Allows read-only access to file metadata but + - does not allow any access to read or download file content. - #### --ftp-port + #### --drive-service-account-file + + Service Account Credentials JSON file path. + + Leave blank normally. + Needed only if you want use SA instead of interactive login. + + Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. + + Properties: + + - Config: service_account_file + - Env Var: RCLONE_DRIVE_SERVICE_ACCOUNT_FILE + - Type: string + - Required: false + + #### --drive-alternate-export - FTP port number. + Deprecated: No longer needed. Properties: - - Config: port - - Env Var: RCLONE_FTP_PORT - - Type: int - - Default: 21 + - Config: alternate_export + - Env Var: RCLONE_DRIVE_ALTERNATE_EXPORT + - Type: bool + - Default: false - #### --ftp-pass + ### Advanced options - FTP password. + Here are the Advanced options specific to drive (Google Drive). - **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + #### --drive-token + + OAuth Access Token as a JSON blob. Properties: - - Config: pass - - Env Var: RCLONE_FTP_PASS + - Config: token + - Env Var: RCLONE_DRIVE_TOKEN - Type: string - Required: false - #### --ftp-tls + #### --drive-auth-url - Use Implicit FTPS (FTP over TLS). + Auth server URL. - When using implicit FTP over TLS the client connects using TLS - right from the start which breaks compatibility with - non-TLS-aware servers. This is usually served over port 990 rather - than port 21. Cannot be used in combination with explicit FTPS. + Leave blank to use the provider defaults. Properties: - - Config: tls - - Env Var: RCLONE_FTP_TLS - - Type: bool - - Default: false + - Config: auth_url + - Env Var: RCLONE_DRIVE_AUTH_URL + - Type: string + - Required: false - #### --ftp-explicit-tls + #### --drive-token-url - Use Explicit FTPS (FTP over TLS). + Token server url. - When using explicit FTP over TLS the client explicitly requests - security from the server in order to upgrade a plain text connection - to an encrypted one. Cannot be used in combination with implicit FTPS. + Leave blank to use the provider defaults. Properties: - - Config: explicit_tls - - Env Var: RCLONE_FTP_EXPLICIT_TLS - - Type: bool - - Default: false - - ### Advanced options + - Config: token_url + - Env Var: RCLONE_DRIVE_TOKEN_URL + - Type: string + - Required: false - Here are the Advanced options specific to ftp (FTP). + #### --drive-root-folder-id - #### --ftp-concurrency + ID of the root folder. + Leave blank normally. - Maximum number of FTP simultaneous connections, 0 for unlimited. + Fill in to access "Computers" folders (see docs), or for rclone to use + a non root folder as its starting point. - Note that setting this is very likely to cause deadlocks so it should - be used with care. - If you are doing a sync or copy then make sure concurrency is one more - than the sum of `--transfers` and `--checkers`. + Properties: - If you use `--check-first` then it just needs to be one more than the - maximum of `--checkers` and `--transfers`. + - Config: root_folder_id + - Env Var: RCLONE_DRIVE_ROOT_FOLDER_ID + - Type: string + - Required: false - So for `concurrency 3` you'd use `--checkers 2 --transfers 2 - --check-first` or `--checkers 1 --transfers 1`. + #### --drive-service-account-credentials + Service Account Credentials JSON blob. + Leave blank normally. + Needed only if you want use SA instead of interactive login. Properties: - - Config: concurrency - - Env Var: RCLONE_FTP_CONCURRENCY - - Type: int - - Default: 0 + - Config: service_account_credentials + - Env Var: RCLONE_DRIVE_SERVICE_ACCOUNT_CREDENTIALS + - Type: string + - Required: false - #### --ftp-no-check-certificate + #### --drive-team-drive - Do not verify the TLS certificate of the server. + ID of the Shared Drive (Team Drive). Properties: - - Config: no_check_certificate - - Env Var: RCLONE_FTP_NO_CHECK_CERTIFICATE - - Type: bool - - Default: false + - Config: team_drive + - Env Var: RCLONE_DRIVE_TEAM_DRIVE + - Type: string + - Required: false - #### --ftp-disable-epsv + #### --drive-auth-owner-only - Disable using EPSV even if server advertises support. + Only consider files owned by the authenticated user. Properties: - - Config: disable_epsv - - Env Var: RCLONE_FTP_DISABLE_EPSV + - Config: auth_owner_only + - Env Var: RCLONE_DRIVE_AUTH_OWNER_ONLY - Type: bool - Default: false - #### --ftp-disable-mlsd + #### --drive-use-trash - Disable using MLSD even if server advertises support. + Send files to the trash instead of deleting permanently. + + Defaults to true, namely sending files to the trash. + Use `--drive-use-trash=false` to delete files permanently instead. Properties: - - Config: disable_mlsd - - Env Var: RCLONE_FTP_DISABLE_MLSD + - Config: use_trash + - Env Var: RCLONE_DRIVE_USE_TRASH - Type: bool - - Default: false + - Default: true - #### --ftp-disable-utf8 + #### --drive-copy-shortcut-content - Disable using UTF-8 even if server advertises support. + Server side copy contents of shortcuts instead of the shortcut. + + When doing server side copies, normally rclone will copy shortcuts as + shortcuts. + + If this flag is used then rclone will copy the contents of shortcuts + rather than shortcuts themselves when doing server side copies. Properties: - - Config: disable_utf8 - - Env Var: RCLONE_FTP_DISABLE_UTF8 + - Config: copy_shortcut_content + - Env Var: RCLONE_DRIVE_COPY_SHORTCUT_CONTENT - Type: bool - Default: false - #### --ftp-writing-mdtm + #### --drive-skip-gdocs - Use MDTM to set modification time (VsFtpd quirk) + Skip google documents in all listings. + + If given, gdocs practically become invisible to rclone. Properties: - - Config: writing_mdtm - - Env Var: RCLONE_FTP_WRITING_MDTM + - Config: skip_gdocs + - Env Var: RCLONE_DRIVE_SKIP_GDOCS - Type: bool - Default: false - #### --ftp-force-list-hidden - - Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD. + #### --drive-show-all-gdocs - Properties: + Show all Google Docs including non-exportable ones in listings. - - Config: force_list_hidden - - Env Var: RCLONE_FTP_FORCE_LIST_HIDDEN - - Type: bool - - Default: false + If you try a server side copy on a Google Form without this flag, you + will get this error: - #### --ftp-idle-timeout + No export formats found for "application/vnd.google-apps.form" - Max time before closing idle connections. + However adding this flag will allow the form to be server side copied. - If no connections have been returned to the connection pool in the time - given, rclone will empty the connection pool. + Note that rclone doesn't add extensions to the Google Docs file names + in this mode. - Set to 0 to keep connections indefinitely. + Do **not** use this flag when trying to download Google Docs - rclone + will fail to download them. Properties: - - Config: idle_timeout - - Env Var: RCLONE_FTP_IDLE_TIMEOUT - - Type: Duration - - Default: 1m0s - - #### --ftp-close-timeout + - Config: show_all_gdocs + - Env Var: RCLONE_DRIVE_SHOW_ALL_GDOCS + - Type: bool + - Default: false - Maximum time to wait for a response to close. + #### --drive-skip-checksum-gphotos - Properties: + Skip checksums on Google photos and videos only. - - Config: close_timeout - - Env Var: RCLONE_FTP_CLOSE_TIMEOUT - - Type: Duration - - Default: 1m0s + Use this if you get checksum errors when transferring Google photos or + videos. - #### --ftp-tls-cache-size + Setting this flag will cause Google photos and videos to return a + blank checksums. - Size of TLS session cache for all control and data connections. + Google photos are identified by being in the "photos" space. - TLS cache allows to resume TLS sessions and reuse PSK between connections. - Increase if default size is not enough resulting in TLS resumption errors. - Enabled by default. Use 0 to disable. + Corrupted checksums are caused by Google modifying the image/video but + not updating the checksum. Properties: - - Config: tls_cache_size - - Env Var: RCLONE_FTP_TLS_CACHE_SIZE - - Type: int - - Default: 32 + - Config: skip_checksum_gphotos + - Env Var: RCLONE_DRIVE_SKIP_CHECKSUM_GPHOTOS + - Type: bool + - Default: false - #### --ftp-disable-tls13 + #### --drive-shared-with-me - Disable TLS 1.3 (workaround for FTP servers with buggy TLS) + Only show files that are shared with me. + + Instructs rclone to operate on your "Shared with me" folder (where + Google Drive lets you access the files and folders others have shared + with you). + + This works both with the "list" (lsd, lsl, etc.) and the "copy" + commands (copy, sync, etc.), and with all other commands too. Properties: - - Config: disable_tls13 - - Env Var: RCLONE_FTP_DISABLE_TLS13 + - Config: shared_with_me + - Env Var: RCLONE_DRIVE_SHARED_WITH_ME - Type: bool - Default: false - #### --ftp-shut-timeout - - Maximum time to wait for data connection closing status. + #### --drive-trashed-only - Properties: + Only show files that are in the trash. - - Config: shut_timeout - - Env Var: RCLONE_FTP_SHUT_TIMEOUT - - Type: Duration - - Default: 1m0s + This will show trashed files in their original directory structure. - #### --ftp-ask-password + Properties: - Allow asking for FTP password when needed. + - Config: trashed_only + - Env Var: RCLONE_DRIVE_TRASHED_ONLY + - Type: bool + - Default: false - If this is set and no password is supplied then rclone will ask for a password + #### --drive-starred-only + Only show files that are starred. Properties: - - Config: ask_password - - Env Var: RCLONE_FTP_ASK_PASSWORD + - Config: starred_only + - Env Var: RCLONE_DRIVE_STARRED_ONLY - Type: bool - Default: false - #### --ftp-socks-proxy + #### --drive-formats - Socks 5 proxy host. - - Supports the format user:pass@host:port, user@host:port, host:port. - - Example: - - myUser:myPass@localhost:9005 - + Deprecated: See export_formats. Properties: - - Config: socks_proxy - - Env Var: RCLONE_FTP_SOCKS_PROXY + - Config: formats + - Env Var: RCLONE_DRIVE_FORMATS - Type: string - Required: false - #### --ftp-encoding - - The encoding for the backend. + #### --drive-export-formats - See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + Comma separated list of preferred formats for downloading Google docs. Properties: - - Config: encoding - - Env Var: RCLONE_FTP_ENCODING - - Type: MultiEncoder - - Default: Slash,Del,Ctl,RightSpace,Dot - - Examples: - - "Asterisk,Ctl,Dot,Slash" - - ProFTPd can't handle '*' in file names - - "BackSlash,Ctl,Del,Dot,RightSpace,Slash,SquareBracket" - - PureFTPd can't handle '[]' or '*' in file names - - "Ctl,LeftPeriod,Slash" - - VsFTPd can't handle file names starting with dot + - Config: export_formats + - Env Var: RCLONE_DRIVE_EXPORT_FORMATS + - Type: string + - Default: "docx,xlsx,pptx,svg" + #### --drive-import-formats + Comma separated list of preferred formats for uploading Google docs. - ## Limitations + Properties: - FTP servers acting as rclone remotes must support `passive` mode. - The mode cannot be configured as `passive` is the only supported one. - Rclone's FTP implementation is not compatible with `active` mode - as [the library it uses doesn't support it](https://github.com/jlaffaye/ftp/issues/29). - This will likely never be supported due to security concerns. + - Config: import_formats + - Env Var: RCLONE_DRIVE_IMPORT_FORMATS + - Type: string + - Required: false - Rclone's FTP backend does not support any checksums but can compare - file sizes. + #### --drive-allow-import-name-change - `rclone about` is not supported by the FTP backend. Backends without - this capability cannot determine free space for an rclone mount or - use policy `mfs` (most free space) as a member of an rclone union - remote. + Allow the filetype to change when uploading Google docs. - See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) + E.g. file.doc to file.docx. This will confuse sync and reupload every time. - The implementation of : `--dump headers`, - `--dump bodies`, `--dump auth` for debugging isn't the same as - for rclone HTTP based backends - it has less fine grained control. + Properties: - `--timeout` isn't supported (but `--contimeout` is). + - Config: allow_import_name_change + - Env Var: RCLONE_DRIVE_ALLOW_IMPORT_NAME_CHANGE + - Type: bool + - Default: false - `--bind` isn't supported. + #### --drive-use-created-date - Rclone's FTP backend could support server-side move but does not - at present. + Use file created date instead of modified date. - The `ftp_proxy` environment variable is not currently supported. + Useful when downloading data and you want the creation date used in + place of the last modified date. - #### Modified time + **WARNING**: This flag may have some unexpected consequences. - File modification time (timestamps) is supported to 1 second resolution - for major FTP servers: ProFTPd, PureFTPd, VsFTPd, and FileZilla FTP server. - The `VsFTPd` server has non-standard implementation of time related protocol - commands and needs a special configuration setting: `writing_mdtm = true`. + When uploading to your drive all files will be overwritten unless they + haven't been modified since their creation. And the inverse will occur + while downloading. This side effect can be avoided by using the + "--checksum" flag. - Support for precise file time with other FTP servers varies depending on what - protocol extensions they advertise. If all the `MLSD`, `MDTM` and `MFTM` - extensions are present, rclone will use them together to provide precise time. - Otherwise the times you see on the FTP server through rclone are those of the - last file upload. + This feature was implemented to retain photos capture date as recorded + by google photos. You will first need to check the "Create a Google + Photos folder" option in your google drive settings. You can then copy + or move the photos locally and use the date the image was taken + (created) set as the modification date. - You can use the following command to check whether rclone can use precise time - with your FTP server: `rclone backend features your_ftp_remote:` (the trailing - colon is important). Look for the number in the line tagged by `Precision` - designating the remote time precision expressed as nanoseconds. A value of - `1000000000` means that file time precision of 1 second is available. - A value of `3153600000000000000` (or another large number) means "unsupported". + Properties: - # Google Cloud Storage + - Config: use_created_date + - Env Var: RCLONE_DRIVE_USE_CREATED_DATE + - Type: bool + - Default: false - Paths are specified as `remote:bucket` (or `remote:` for the `lsd` - command.) You may put subdirectories in too, e.g. `remote:bucket/path/to/dir`. + #### --drive-use-shared-date - ## Configuration + Use date file was shared instead of modified date. - The initial setup for google cloud storage involves getting a token from Google Cloud Storage - which you need to do in your browser. `rclone config` walks you - through it. + Note that, as with "--drive-use-created-date", this flag may have + unexpected consequences when uploading/downloading files. - Here is an example of how to make a remote called `remote`. First run: + If both this flag and "--drive-use-created-date" are set, the created + date is used. - rclone config + Properties: - This will guide you through an interactive setup process: + - Config: use_shared_date + - Env Var: RCLONE_DRIVE_USE_SHARED_DATE + - Type: bool + - Default: false -n) New remote -o) Delete remote -p) 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 [snip] XX / - Google Cloud Storage (this is not Google Drive)  "google cloud - storage" [snip] Storage> google cloud storage Google Application - Client Id - leave blank normally. client_id> Google Application - Client Secret - leave blank normally. client_secret> Project number - optional - needed only for list/create/delete buckets - see your - developer console. project_number> 12345678 Service Account - Credentials JSON file path - needed only if you want use SA instead - of interactive login. service_account_file> Access Control List for - new objects. Choose a number from below, or type in your own value 1 - / Object owner gets OWNER access, and all Authenticated Users get - READER access.  "authenticatedRead" 2 / Object owner gets OWNER - access, and project team owners get OWNER access. -  "bucketOwnerFullControl" 3 / Object owner gets OWNER access, and - project team owners get READER access.  "bucketOwnerRead" 4 / Object - owner gets OWNER access [default if left blank].  "private" 5 / - Object owner gets OWNER access, and project team members get access - according to their roles.  "projectPrivate" 6 / Object owner gets - OWNER access, and all Users get READER access.  "publicRead" - object_acl> 4 Access Control List for new buckets. Choose a number - from below, or type in your own value 1 / Project team owners get - OWNER access, and all Authenticated Users get READER access. -  "authenticatedRead" 2 / Project team owners get OWNER access - [default if left blank].  "private" 3 / Project team members get - access according to their roles.  "projectPrivate" 4 / Project team - owners get OWNER access, and all Users get READER access. -  "publicRead" 5 / Project team owners get OWNER access, and all - Users get WRITER access.  "publicReadWrite" bucket_acl> 2 Location - for the newly created buckets. Choose a number from below, or type - in your own value 1 / Empty for default location (US).  "" 2 / - Multi-regional location for Asia.  "asia" 3 / Multi-regional - location for Europe.  "eu" 4 / Multi-regional location for United - States.  "us" 5 / Taiwan.  "asia-east1" 6 / Tokyo. -  "asia-northeast1" 7 / Singapore.  "asia-southeast1" 8 / Sydney. -  "australia-southeast1" 9 / Belgium.  "europe-west1" 10 / London. -  "europe-west2" 11 / Iowa.  "us-central1" 12 / South Carolina. -  "us-east1" 13 / Northern Virginia.  "us-east4" 14 / Oregon. -  "us-west1" location> 12 The storage class to use when storing - objects in Google Cloud Storage. Choose a number from below, or type - in your own value 1 / Default  "" 2 / Multi-regional storage class -  "MULTI_REGIONAL" 3 / Regional storage class  "REGIONAL" 4 / - Nearline storage class  "NEARLINE" 5 / Coldline storage class -  "COLDLINE" 6 / Durable reduced availability storage class -  "DURABLE_REDUCED_AVAILABILITY" storage_class> 5 Remote config Use - web browser to automatically authenticate rclone with remote? + #### --drive-list-chunk -- Say Y if the machine running rclone has a web browser you can use -- Say N if running rclone on a (remote) machine without web browser - access If not sure try Y. If Y failed, try N. + Size of listing chunk 100-1000, 0 to disable. -y) Yes -z) 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] type = google cloud storage client_id = client_secret = - token = - {"AccessToken":"xxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","RefreshToken":"x/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxx","Expiry":"2014-07-17T20:49:14.929208288+01:00","Extra":null} - project_number = 12345678 object_acl = private bucket_acl = private - -------------------- -a) Yes this is OK -b) Edit this remote -c) Delete this remote y/e/d> y + Properties: + - Config: list_chunk + - Env Var: RCLONE_DRIVE_LIST_CHUNK + - Type: int + - Default: 1000 - See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a - machine with no Internet browser available. + #### --drive-impersonate - Note that rclone runs a webserver on your local machine to collect the - token as returned from Google if using web browser to automatically - authenticate. This only - runs from the moment it opens your browser to the moment you get back - the verification code. This is on `http://127.0.0.1:53682/` and this - it may require you to unblock it temporarily if you are running a host - firewall, or use manual mode. + Impersonate this user when using a service account. - This remote is called `remote` and can now be used like this + Properties: - See all the buckets in your project + - Config: impersonate + - Env Var: RCLONE_DRIVE_IMPERSONATE + - Type: string + - Required: false - rclone lsd remote: + #### --drive-upload-cutoff - Make a new bucket + Cutoff for switching to chunked upload. - rclone mkdir remote:bucket + Properties: - List the contents of a bucket + - Config: upload_cutoff + - Env Var: RCLONE_DRIVE_UPLOAD_CUTOFF + - Type: SizeSuffix + - Default: 8Mi - rclone ls remote:bucket + #### --drive-chunk-size - Sync `/home/local/directory` to the remote bucket, deleting any excess - files in the bucket. + Upload chunk size. - rclone sync --interactive /home/local/directory remote:bucket + Must a power of 2 >= 256k. - ### Service Account support + Making this larger will improve performance, but note that each chunk + is buffered in memory one per transfer. - You can set up rclone with Google Cloud Storage in an unattended mode, - i.e. not tied to a specific end-user Google account. This is useful - when you want to synchronise files onto machines that don't have - actively logged-in users, for example build machines. + Reducing this will reduce memory usage but decrease performance. - To get credentials for Google Cloud Platform - [IAM Service Accounts](https://cloud.google.com/iam/docs/service-accounts), - please head to the - [Service Account](https://console.cloud.google.com/permissions/serviceaccounts) - section of the Google Developer Console. Service Accounts behave just - like normal `User` permissions in - [Google Cloud Storage ACLs](https://cloud.google.com/storage/docs/access-control), - so you can limit their access (e.g. make them read only). After - creating an account, a JSON file containing the Service Account's - credentials will be downloaded onto your machines. These credentials - are what rclone will use for authentication. + Properties: - To use a Service Account instead of OAuth2 token flow, enter the path - to your Service Account credentials at the `service_account_file` - prompt and rclone won't use the browser based authentication - flow. If you'd rather stuff the contents of the credentials file into - the rclone config file, you can set `service_account_credentials` with - the actual contents of the file instead, or set the equivalent - environment variable. + - Config: chunk_size + - Env Var: RCLONE_DRIVE_CHUNK_SIZE + - Type: SizeSuffix + - Default: 8Mi - ### Anonymous Access + #### --drive-acknowledge-abuse + + Set to allow files which return cannotDownloadAbusiveFile to be downloaded. + + If downloading a file returns the error "This file has been identified + as malware or spam and cannot be downloaded" with the error code + "cannotDownloadAbusiveFile" then supply this flag to rclone to + indicate you acknowledge the risks of downloading the file and rclone + will download it anyway. + + Note that if you are using service account it will need Manager + permission (not Content Manager) to for this flag to work. If the SA + does not have the right permission, Google will just ignore the flag. - For downloads of objects that permit public access you can configure rclone - to use anonymous access by setting `anonymous` to `true`. - With unauthorized access you can't write or create files but only read or list - those buckets and objects that have public read access. + Properties: - ### Application Default Credentials + - Config: acknowledge_abuse + - Env Var: RCLONE_DRIVE_ACKNOWLEDGE_ABUSE + - Type: bool + - Default: false - If no other source of credentials is provided, rclone will fall back - to - [Application Default Credentials](https://cloud.google.com/video-intelligence/docs/common/auth#authenticating_with_application_default_credentials) - this is useful both when you already have configured authentication - for your developer account, or in production when running on a google - compute host. Note that if running in docker, you may need to run - additional commands on your google compute machine - - [see this page](https://cloud.google.com/container-registry/docs/advanced-authentication#gcloud_as_a_docker_credential_helper). + #### --drive-keep-revision-forever - Note that in the case application default credentials are used, there - is no need to explicitly configure a project number. + Keep new head revision of each file forever. - ### --fast-list + Properties: - This remote supports `--fast-list` which allows you to use fewer - transactions in exchange for more memory. See the [rclone - docs](https://rclone.org/docs/#fast-list) for more details. + - Config: keep_revision_forever + - Env Var: RCLONE_DRIVE_KEEP_REVISION_FOREVER + - Type: bool + - Default: false - ### Custom upload headers + #### --drive-size-as-quota - You can set custom upload headers with the `--header-upload` - flag. Google Cloud Storage supports the headers as described in the - [working with metadata documentation](https://cloud.google.com/storage/docs/gsutil/addlhelp/WorkingWithObjectMetadata) + Show sizes as storage quota usage, not actual size. - - Cache-Control - - Content-Disposition - - Content-Encoding - - Content-Language - - Content-Type - - X-Goog-Storage-Class - - X-Goog-Meta- + Show the size of a file as the storage quota used. This is the + current version plus any older versions that have been set to keep + forever. - Eg `--header-upload "Content-Type text/potato"` + **WARNING**: This flag may have some unexpected consequences. - Note that the last of these is for setting custom metadata in the form - `--header-upload "x-goog-meta-key: value"` + It is not recommended to set this flag in your config - the + recommended usage is using the flag form --drive-size-as-quota when + doing rclone ls/lsl/lsf/lsjson/etc only. - ### Modification time + If you do use this flag for syncing (not recommended) then you will + need to use --ignore size also. - Google Cloud Storage stores md5sum natively. - Google's [gsutil](https://cloud.google.com/storage/docs/gsutil) tool stores modification time - with one-second precision as `goog-reserved-file-mtime` in file metadata. + Properties: - To ensure compatibility with gsutil, rclone stores modification time in 2 separate metadata entries. - `mtime` uses RFC3339 format with one-nanosecond precision. - `goog-reserved-file-mtime` uses Unix timestamp format with one-second precision. - To get modification time from object metadata, rclone reads the metadata in the following order: `mtime`, `goog-reserved-file-mtime`, object updated time. + - Config: size_as_quota + - Env Var: RCLONE_DRIVE_SIZE_AS_QUOTA + - Type: bool + - Default: false - Note that rclone's default modify window is 1ns. - Files uploaded by gsutil only contain timestamps with one-second precision. - If you use rclone to sync files previously uploaded by gsutil, - rclone will attempt to update modification time for all these files. - To avoid these possibly unnecessary updates, use `--modify-window 1s`. + #### --drive-v2-download-min-size - ### Restricted filename characters + If Object's are greater, use drive v2 API to download. - | Character | Value | Replacement | - | --------- |:-----:|:-----------:| - | NUL | 0x00 | ␀ | - | LF | 0x0A | ␊ | - | CR | 0x0D | ␍ | - | / | 0x2F | / | + Properties: - Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), - as they can't be used in JSON strings. + - Config: v2_download_min_size + - Env Var: RCLONE_DRIVE_V2_DOWNLOAD_MIN_SIZE + - Type: SizeSuffix + - Default: off + #### --drive-pacer-min-sleep - ### Standard options + Minimum time to sleep between API calls. - Here are the Standard options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)). + Properties: - #### --gcs-client-id + - Config: pacer_min_sleep + - Env Var: RCLONE_DRIVE_PACER_MIN_SLEEP + - Type: Duration + - Default: 100ms - OAuth Client Id. + #### --drive-pacer-burst - Leave blank normally. + Number of API calls to allow without sleeping. Properties: - - Config: client_id - - Env Var: RCLONE_GCS_CLIENT_ID - - Type: string - - Required: false + - Config: pacer_burst + - Env Var: RCLONE_DRIVE_PACER_BURST + - Type: int + - Default: 100 - #### --gcs-client-secret + #### --drive-server-side-across-configs - OAuth Client Secret. + Deprecated: use --server-side-across-configs instead. - Leave blank normally. + Allow server-side operations (e.g. copy) to work across different drive configs. + + This can be useful if you wish to do a server-side copy between two + different Google drives. Note that this isn't enabled by default + because it isn't easy to tell if it will work between any two + configurations. Properties: - - Config: client_secret - - Env Var: RCLONE_GCS_CLIENT_SECRET - - Type: string - - Required: false + - Config: server_side_across_configs + - Env Var: RCLONE_DRIVE_SERVER_SIDE_ACROSS_CONFIGS + - Type: bool + - Default: false - #### --gcs-project-number + #### --drive-disable-http2 + + Disable drive using http2. + + There is currently an unsolved issue with the google drive backend and + HTTP/2. HTTP/2 is therefore disabled by default for the drive backend + but can be re-enabled here. When the issue is solved this flag will + be removed. + + See: https://github.com/rclone/rclone/issues/3631 - Project number. - Optional - needed only for list/create/delete buckets - see your developer console. Properties: - - Config: project_number - - Env Var: RCLONE_GCS_PROJECT_NUMBER - - Type: string - - Required: false + - Config: disable_http2 + - Env Var: RCLONE_DRIVE_DISABLE_HTTP2 + - Type: bool + - Default: true - #### --gcs-user-project + #### --drive-stop-on-upload-limit - User project. + Make upload limit errors be fatal. + + At the time of writing it is only possible to upload 750 GiB of data to + Google Drive a day (this is an undocumented limit). When this limit is + reached Google Drive produces a slightly different error message. When + this flag is set it causes these errors to be fatal. These will stop + the in-progress sync. + + Note that this detection is relying on error message strings which + Google don't document so it may break in the future. + + See: https://github.com/rclone/rclone/issues/3857 - Optional - needed only for requester pays. Properties: - - Config: user_project - - Env Var: RCLONE_GCS_USER_PROJECT - - Type: string - - Required: false + - Config: stop_on_upload_limit + - Env Var: RCLONE_DRIVE_STOP_ON_UPLOAD_LIMIT + - Type: bool + - Default: false - #### --gcs-service-account-file + #### --drive-stop-on-download-limit - Service Account Credentials JSON file path. + Make download limit errors be fatal. - Leave blank normally. - Needed only if you want use SA instead of interactive login. + At the time of writing it is only possible to download 10 TiB of data from + Google Drive a day (this is an undocumented limit). When this limit is + reached Google Drive produces a slightly different error message. When + this flag is set it causes these errors to be fatal. These will stop + the in-progress sync. + + Note that this detection is relying on error message strings which + Google don't document so it may break in the future. - Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. Properties: - - Config: service_account_file - - Env Var: RCLONE_GCS_SERVICE_ACCOUNT_FILE - - Type: string - - Required: false + - Config: stop_on_download_limit + - Env Var: RCLONE_DRIVE_STOP_ON_DOWNLOAD_LIMIT + - Type: bool + - Default: false - #### --gcs-service-account-credentials + #### --drive-skip-shortcuts - Service Account Credentials JSON blob. + If set skip shortcut files. + + Normally rclone dereferences shortcut files making them appear as if + they are the original file (see [the shortcuts section](#shortcuts)). + If this flag is set then rclone will ignore shortcut files completely. - Leave blank normally. - Needed only if you want use SA instead of interactive login. Properties: - - Config: service_account_credentials - - Env Var: RCLONE_GCS_SERVICE_ACCOUNT_CREDENTIALS - - Type: string - - Required: false + - Config: skip_shortcuts + - Env Var: RCLONE_DRIVE_SKIP_SHORTCUTS + - Type: bool + - Default: false - #### --gcs-anonymous + #### --drive-skip-dangling-shortcuts - Access public buckets and objects without credentials. + If set skip dangling shortcut files. + + If this is set then rclone will not show any dangling shortcuts in listings. - Set to 'true' if you just want to download files and don't configure credentials. Properties: - - Config: anonymous - - Env Var: RCLONE_GCS_ANONYMOUS + - Config: skip_dangling_shortcuts + - Env Var: RCLONE_DRIVE_SKIP_DANGLING_SHORTCUTS - Type: bool - Default: false - #### --gcs-object-acl + #### --drive-resource-key - Access Control List for new objects. + Resource key for accessing a link-shared file. - Properties: + If you need to access files shared with a link like this - - Config: object_acl - - Env Var: RCLONE_GCS_OBJECT_ACL - - Type: string - - Required: false - - Examples: - - "authenticatedRead" - - Object owner gets OWNER access. - - All Authenticated Users get READER access. - - "bucketOwnerFullControl" - - Object owner gets OWNER access. - - Project team owners get OWNER access. - - "bucketOwnerRead" - - Object owner gets OWNER access. - - Project team owners get READER access. - - "private" - - Object owner gets OWNER access. - - Default if left blank. - - "projectPrivate" - - Object owner gets OWNER access. - - Project team members get access according to their roles. - - "publicRead" - - Object owner gets OWNER access. - - All Users get READER access. + https://drive.google.com/drive/folders/XXX?resourcekey=YYY&usp=sharing - #### --gcs-bucket-acl + Then you will need to use the first part "XXX" as the "root_folder_id" + and the second part "YYY" as the "resource_key" otherwise you will get + 404 not found errors when trying to access the directory. + + See: https://developers.google.com/drive/api/guides/resource-keys + + This resource key requirement only applies to a subset of old files. + + Note also that opening the folder once in the web interface (with the + user you've authenticated rclone with) seems to be enough so that the + resource key is not needed. - Access Control List for new buckets. Properties: - - Config: bucket_acl - - Env Var: RCLONE_GCS_BUCKET_ACL + - Config: resource_key + - Env Var: RCLONE_DRIVE_RESOURCE_KEY - Type: string - Required: false - - Examples: - - "authenticatedRead" - - Project team owners get OWNER access. - - All Authenticated Users get READER access. - - "private" - - Project team owners get OWNER access. - - Default if left blank. - - "projectPrivate" - - Project team members get access according to their roles. - - "publicRead" - - Project team owners get OWNER access. - - All Users get READER access. - - "publicReadWrite" - - Project team owners get OWNER access. - - All Users get WRITER access. - #### --gcs-bucket-policy-only + #### --drive-fast-list-bug-fix - Access checks should use bucket-level IAM policies. + Work around a bug in Google Drive listing. - If you want to upload objects to a bucket with Bucket Policy Only set - then you will need to set this. + Normally rclone will work around a bug in Google Drive when using + --fast-list (ListR) where the search "(A in parents) or (B in + parents)" returns nothing sometimes. See #3114, #4289 and + https://issuetracker.google.com/issues/149522397 - When it is set, rclone: + Rclone detects this by finding no items in more than one directory + when listing and retries them as lists of individual directories. - - ignores ACLs set on buckets - - ignores ACLs set on objects - - creates buckets with Bucket Policy Only set + This means that if you have a lot of empty directories rclone will end + up listing them all individually and this can take many more API + calls. - Docs: https://cloud.google.com/storage/docs/bucket-policy-only + This flag allows the work-around to be disabled. This is **not** + recommended in normal use - only if you have a particular case you are + having trouble with like many empty directories. Properties: - - Config: bucket_policy_only - - Env Var: RCLONE_GCS_BUCKET_POLICY_ONLY + - Config: fast_list_bug_fix + - Env Var: RCLONE_DRIVE_FAST_LIST_BUG_FIX - Type: bool - - Default: false - - #### --gcs-location + - Default: true - Location for the newly created buckets. + #### --drive-metadata-owner - Properties: + Control whether owner should be read or written in metadata. - - Config: location - - Env Var: RCLONE_GCS_LOCATION - - Type: string - - Required: false - - Examples: - - "" - - Empty for default location (US) - - "asia" - - Multi-regional location for Asia - - "eu" - - Multi-regional location for Europe - - "us" - - Multi-regional location for United States - - "asia-east1" - - Taiwan - - "asia-east2" - - Hong Kong - - "asia-northeast1" - - Tokyo - - "asia-northeast2" - - Osaka - - "asia-northeast3" - - Seoul - - "asia-south1" - - Mumbai - - "asia-south2" - - Delhi - - "asia-southeast1" - - Singapore - - "asia-southeast2" - - Jakarta - - "australia-southeast1" - - Sydney - - "australia-southeast2" - - Melbourne - - "europe-north1" - - Finland - - "europe-west1" - - Belgium - - "europe-west2" - - London - - "europe-west3" - - Frankfurt - - "europe-west4" - - Netherlands - - "europe-west6" - - Zürich - - "europe-central2" - - Warsaw - - "us-central1" - - Iowa - - "us-east1" - - South Carolina - - "us-east4" - - Northern Virginia - - "us-west1" - - Oregon - - "us-west2" - - California - - "us-west3" - - Salt Lake City - - "us-west4" - - Las Vegas - - "northamerica-northeast1" - - Montréal - - "northamerica-northeast2" - - Toronto - - "southamerica-east1" - - São Paulo - - "southamerica-west1" - - Santiago - - "asia1" - - Dual region: asia-northeast1 and asia-northeast2. - - "eur4" - - Dual region: europe-north1 and europe-west4. - - "nam4" - - Dual region: us-central1 and us-east1. + Owner is a standard part of the file metadata so is easy to read. But it + isn't always desirable to set the owner from the metadata. - #### --gcs-storage-class + Note that you can't set the owner on Shared Drives, and that setting + ownership will generate an email to the new owner (this can't be + disabled), and you can't transfer ownership to someone outside your + organization. - The storage class to use when storing objects in Google Cloud Storage. Properties: - - Config: storage_class - - Env Var: RCLONE_GCS_STORAGE_CLASS - - Type: string - - Required: false + - Config: metadata_owner + - Env Var: RCLONE_DRIVE_METADATA_OWNER + - Type: Bits + - Default: read - Examples: - - "" - - Default - - "MULTI_REGIONAL" - - Multi-regional storage class - - "REGIONAL" - - Regional storage class - - "NEARLINE" - - Nearline storage class - - "COLDLINE" - - Coldline storage class - - "ARCHIVE" - - Archive storage class - - "DURABLE_REDUCED_AVAILABILITY" - - Durable reduced availability storage class - - #### --gcs-env-auth + - "off" + - Do not read or write the value + - "read" + - Read the value only + - "write" + - Write the value only + - "read,write" + - Read and Write the value. - Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars). + #### --drive-metadata-permissions - Only applies if service_account_file and service_account_credentials is blank. + Control whether permissions should be read or written in metadata. - Properties: + Reading permissions metadata from files can be done quickly, but it + isn't always desirable to set the permissions from the metadata. - - Config: env_auth - - Env Var: RCLONE_GCS_ENV_AUTH - - Type: bool - - Default: false - - Examples: - - "false" - - Enter credentials in the next step. - - "true" - - Get GCP IAM credentials from the environment (env vars or IAM). + Note that rclone drops any inherited permissions on Shared Drives and + any owner permission on My Drives as these are duplicated in the owner + metadata. - ### Advanced options - Here are the Advanced options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)). + Properties: - #### --gcs-token + - Config: metadata_permissions + - Env Var: RCLONE_DRIVE_METADATA_PERMISSIONS + - Type: Bits + - Default: off + - Examples: + - "off" + - Do not read or write the value + - "read" + - Read the value only + - "write" + - Write the value only + - "read,write" + - Read and Write the value. - OAuth Access Token as a JSON blob. + #### --drive-metadata-labels - Properties: + Control whether labels should be read or written in metadata. - - Config: token - - Env Var: RCLONE_GCS_TOKEN - - Type: string - - Required: false + Reading labels metadata from files takes an extra API transaction and + will slow down listings. It isn't always desirable to set the labels + from the metadata. - #### --gcs-auth-url + The format of labels is documented in the drive API documentation at + https://developers.google.com/drive/api/reference/rest/v3/Label - + rclone just provides a JSON dump of this format. - Auth server URL. + When setting labels, the label and fields must already exist - rclone + will not create them. This means that if you are transferring labels + from two different accounts you will have to create the labels in + advance and use the metadata mapper to translate the IDs between the + two accounts. - Leave blank to use the provider defaults. Properties: - - Config: auth_url - - Env Var: RCLONE_GCS_AUTH_URL - - Type: string - - Required: false + - Config: metadata_labels + - Env Var: RCLONE_DRIVE_METADATA_LABELS + - Type: Bits + - Default: off + - Examples: + - "off" + - Do not read or write the value + - "read" + - Read the value only + - "write" + - Write the value only + - "read,write" + - Read and Write the value. - #### --gcs-token-url + #### --drive-encoding - Token server url. + The encoding for the backend. - Leave blank to use the provider defaults. + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. Properties: - - Config: token_url - - Env Var: RCLONE_GCS_TOKEN_URL - - Type: string - - Required: false - - #### --gcs-directory-markers + - Config: encoding + - Env Var: RCLONE_DRIVE_ENCODING + - Type: Encoding + - Default: InvalidUtf8 - Upload an empty object with a trailing slash when a new directory is created + #### --drive-env-auth - Empty folders are unsupported for bucket based remotes, this option creates an empty - object ending with "/", to persist the folder. + Get IAM credentials from runtime (environment variables or instance meta data if no env vars). + Only applies if service_account_file and service_account_credentials is blank. Properties: - - Config: directory_markers - - Env Var: RCLONE_GCS_DIRECTORY_MARKERS + - Config: env_auth + - Env Var: RCLONE_DRIVE_ENV_AUTH - Type: bool - Default: false + - Examples: + - "false" + - Enter credentials in the next step. + - "true" + - Get GCP IAM credentials from the environment (env vars or IAM). - #### --gcs-no-check-bucket - - If set, don't attempt to check the bucket exists or create it. - - This can be useful when trying to minimise the number of transactions - rclone does if you know the bucket exists already. - + ### Metadata - Properties: + User metadata is stored in the properties field of the drive object. - - Config: no_check_bucket - - Env Var: RCLONE_GCS_NO_CHECK_BUCKET - - Type: bool - - Default: false + Here are the possible system metadata items for the drive backend. - #### --gcs-decompress + | Name | Help | Type | Example | Read Only | + |------|------|------|---------|-----------| + | btime | Time of file birth (creation) with mS accuracy. Note that this is only writable on fresh uploads - it can't be written for updates. | RFC 3339 | 2006-01-02T15:04:05.999Z07:00 | N | + | content-type | The MIME type of the file. | string | text/plain | N | + | copy-requires-writer-permission | Whether the options to copy, print, or download this file, should be disabled for readers and commenters. | boolean | true | N | + | description | A short description of the file. | string | Contract for signing | N | + | folder-color-rgb | The color for a folder or a shortcut to a folder as an RGB hex string. | string | 881133 | N | + | labels | Labels attached to this file in a JSON dump of Googled drive format. Enable with --drive-metadata-labels. | JSON | [] | N | + | mtime | Time of last modification with mS accuracy. | RFC 3339 | 2006-01-02T15:04:05.999Z07:00 | N | + | owner | The owner of the file. Usually an email address. Enable with --drive-metadata-owner. | string | user@example.com | N | + | permissions | Permissions in a JSON dump of Google drive format. On shared drives these will only be present if they aren't inherited. Enable with --drive-metadata-permissions. | JSON | {} | N | + | starred | Whether the user has starred the file. | boolean | false | N | + | viewed-by-me | Whether the file has been viewed by this user. | boolean | true | **Y** | + | writers-can-share | Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives. | boolean | false | N | - If set this will decompress gzip encoded objects. + See the [metadata](https://rclone.org/docs/#metadata) docs for more info. - It is possible to upload objects to GCS with "Content-Encoding: gzip" - set. Normally rclone will download these files as compressed objects. + ## Backend commands - If this flag is set then rclone will decompress these files with - "Content-Encoding: gzip" as they are received. This means that rclone - can't check the size and hash but the file contents will be decompressed. + Here are the commands specific to the drive backend. + Run them with - Properties: + rclone backend COMMAND remote: - - Config: decompress - - Env Var: RCLONE_GCS_DECOMPRESS - - Type: bool - - Default: false + The help below will explain what arguments each command takes. - #### --gcs-endpoint + See the [backend](https://rclone.org/commands/rclone_backend/) command for more + info on how to pass options and arguments. - Endpoint for the service. + These can be run on a running backend using the rc command + [backend/command](https://rclone.org/rc/#backend-command). - Leave blank normally. + ### get - Properties: + Get command for fetching the drive config parameters - - Config: endpoint - - Env Var: RCLONE_GCS_ENDPOINT - - Type: string - - Required: false + rclone backend get remote: [options] [+] - #### --gcs-encoding + This is a get command which will be used to fetch the various drive config parameters - The encoding for the backend. + Usage Examples: - See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + rclone backend get drive: [-o service_account_file] [-o chunk_size] + rclone rc backend/command command=get fs=drive: [-o service_account_file] [-o chunk_size] - Properties: - - Config: encoding - - Env Var: RCLONE_GCS_ENCODING - - Type: MultiEncoder - - Default: Slash,CrLf,InvalidUtf8,Dot + Options: + - "chunk_size": show the current upload chunk size + - "service_account_file": show the current service account file + ### set - ## Limitations + Set command for updating the drive config parameters - `rclone about` is not supported by the Google Cloud Storage backend. Backends without - this capability cannot determine free space for an rclone mount or - use policy `mfs` (most free space) as a member of an rclone union - remote. + rclone backend set remote: [options] [+] - See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) + This is a set command which will be used to update the various drive config parameters - # Google Drive + Usage Examples: - Paths are specified as `drive:path` + rclone backend set drive: [-o service_account_file=sa.json] [-o chunk_size=67108864] + rclone rc backend/command command=set fs=drive: [-o service_account_file=sa.json] [-o chunk_size=67108864] - Drive paths may be as deep as required, e.g. `drive:directory/subdirectory`. - ## Configuration + Options: - The initial setup for drive involves getting a token from Google drive - which you need to do in your browser. `rclone config` walks you - through it. + - "chunk_size": update the current upload chunk size + - "service_account_file": update the current service account file - Here is an example of how to make a remote called `remote`. First run: + ### shortcut - rclone config + Create shortcuts from files or directories - This will guide you through an interactive setup process: + rclone backend shortcut remote: [options] [+] -No remotes found, make a new one? n) New remote r) Rename remote c) Copy -remote s) Set configuration password q) Quit config n/r/c/s/q> n name> -remote Type of storage to configure. Choose a number from below, or type -in your own value [snip] XX / Google Drive  "drive" [snip] Storage> -drive Google Application Client Id - leave blank normally. client_id> -Google Application Client Secret - leave blank normally. client_secret> -Scope that rclone should use when requesting access from drive. Choose a -number from below, or type in your own value 1 / Full access all files, -excluding Application Data Folder.  "drive" 2 / Read-only access to file -metadata and file contents.  "drive.readonly" / Access to files created -by rclone only. 3 | These are visible in the drive website. | File -authorization is revoked when the user deauthorizes the app. - "drive.file" / Allows read and write access to the Application Data -folder. 4 | This is not visible in the drive website.  "drive.appfolder" -/ Allows read-only access to file metadata but 5 | does not allow any -access to read or download file content.  "drive.metadata.readonly" -scope> 1 Service Account Credentials JSON file path - needed only if you -want use SA instead of interactive login. service_account_file> Remote -config Use web browser to automatically authenticate rclone with remote? -* Say Y if the machine running rclone has a web browser you can use * -Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. 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 Configure this as a Shared Drive (Team -Drive)? y) Yes n) No y/n> n -------------------- [remote] client_id = -client_secret = scope = drive root_folder_id = service_account_file = -token = -{"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2014-03-16T13:57:58.955387075Z"} --------------------- y) Yes this is OK e) Edit this remote d) Delete -this remote y/e/d> y + This command creates shortcuts from files or directories. + Usage: - See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a - machine with no Internet browser available. + rclone backend shortcut drive: source_item destination_shortcut + rclone backend shortcut drive: source_item -o target=drive2: destination_shortcut - Note that rclone runs a webserver on your local machine to collect the - token as returned from Google if using web browser to automatically - authenticate. This only - runs from the moment it opens your browser to the moment you get back - the verification code. This is on `http://127.0.0.1:53682/` and it - may require you to unblock it temporarily if you are running a host - firewall, or use manual mode. + In the first example this creates a shortcut from the "source_item" + which can be a file or a directory to the "destination_shortcut". The + "source_item" and the "destination_shortcut" should be relative paths + from "drive:" - You can then use it like this, + In the second example this creates a shortcut from the "source_item" + relative to "drive:" to the "destination_shortcut" relative to + "drive2:". This may fail with a permission error if the user + authenticated with "drive2:" can't read files from "drive:". - List directories in top level of your drive - rclone lsd remote: + Options: - List all the files in your drive + - "target": optional target remote for the shortcut destination - rclone ls remote: + ### drives - To copy a local directory to a drive directory called backup + List the Shared Drives available to this account - rclone copy /home/source remote:backup + rclone backend drives remote: [options] [+] - ### Scopes + This command lists the Shared Drives (Team Drives) available to this + account. - Rclone allows you to select which scope you would like for rclone to - use. This changes what type of token is granted to rclone. [The - scopes are defined - here](https://developers.google.com/drive/v3/web/about-auth). + Usage: - The scope are + rclone backend [-o config] drives drive: - #### drive + This will return a JSON list of objects like this - This is the default scope and allows full access to all files, except - for the Application Data Folder (see below). + [ + { + "id": "0ABCDEF-01234567890", + "kind": "drive#teamDrive", + "name": "My Drive" + }, + { + "id": "0ABCDEFabcdefghijkl", + "kind": "drive#teamDrive", + "name": "Test Drive" + } + ] - Choose this one if you aren't sure. + With the -o config parameter it will output the list in a format + suitable for adding to a config file to make aliases for all the + drives found and a combined drive. - #### drive.readonly + [My Drive] + type = alias + remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=: - This allows read only access to all files. Files may be listed and - downloaded but not uploaded, renamed or deleted. + [Test Drive] + type = alias + remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=: - #### drive.file + [AllDrives] + type = combine + upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:" - With this scope rclone can read/view/modify only those files and - folders it creates. + Adding this to the rclone config file will cause those team drives to + be accessible with the aliases shown. Any illegal characters will be + substituted with "_" and duplicate names will have numbers suffixed. + It will also add a remote called AllDrives which shows all the shared + drives combined into one directory tree. - So if you uploaded files to drive via the web interface (or any other - means) they will not be visible to rclone. - This can be useful if you are using rclone to backup data and you want - to be sure confidential data on your drive is not visible to rclone. + ### untrash - Files created with this scope are visible in the web interface. + Untrash files and directories - #### drive.appfolder + rclone backend untrash remote: [options] [+] - This gives rclone its own private area to store files. Rclone will - not be able to see any other files on your drive and you won't be able - to see rclone's files from the web interface either. + This command untrashes all the files and directories in the directory + passed in recursively. - #### drive.metadata.readonly + Usage: - This allows read only access to file names only. It does not allow - rclone to download or upload data, or rename or delete files or - directories. + This takes an optional directory to trash which make this easier to + use via the API. - ### Root folder ID + rclone backend untrash drive:directory + rclone backend --interactive untrash drive:directory subdir - This option has been moved to the advanced section. You can set the `root_folder_id` for rclone. This is the directory - (identified by its `Folder ID`) that rclone considers to be the root - of your drive. + Use the --interactive/-i or --dry-run flag to see what would be restored before restoring it. - Normally you will leave this blank and rclone will determine the - correct root to use itself. + Result: - However you can set this to restrict rclone to a specific folder - hierarchy or to access data within the "Computers" tab on the drive - web interface (where files from Google's Backup and Sync desktop - program go). + { + "Untrashed": 17, + "Errors": 0 + } - In order to do this you will have to find the `Folder ID` of the - directory you wish rclone to display. This will be the last segment - of the URL when you open the relevant folder in the drive web - interface. - So if the folder you want rclone to use has a URL which looks like - `https://drive.google.com/drive/folders/1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh` - in the browser, then you use `1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh` as - the `root_folder_id` in the config. + ### copyid - **NB** folders under the "Computers" tab seem to be read only (drive - gives a 500 error) when using rclone. + Copy files by ID - There doesn't appear to be an API to discover the folder IDs of the - "Computers" tab - please contact us if you know otherwise! + rclone backend copyid remote: [options] [+] - Note also that rclone can't access any data under the "Backups" tab on - the google drive web interface yet. + This command copies files by ID - ### Service Account support + Usage: - You can set up rclone with Google Drive in an unattended mode, - i.e. not tied to a specific end-user Google account. This is useful - when you want to synchronise files onto machines that don't have - actively logged-in users, for example build machines. + rclone backend copyid drive: ID path + rclone backend copyid drive: ID1 path1 ID2 path2 - To use a Service Account instead of OAuth2 token flow, enter the path - to your Service Account credentials at the `service_account_file` - prompt during `rclone config` and rclone won't use the browser based - authentication flow. If you'd rather stuff the contents of the - credentials file into the rclone config file, you can set - `service_account_credentials` with the actual contents of the file - instead, or set the equivalent environment variable. + It copies the drive file with ID given to the path (an rclone path which + will be passed internally to rclone copyto). The ID and path pairs can be + repeated. - #### Use case - Google Apps/G-suite account and individual Drive + The path should end with a / to indicate copy the file as named to + this directory. If it doesn't end with a / then the last path + component will be used as the file name. - Let's say that you are the administrator of a Google Apps (old) or - G-suite account. - The goal is to store data on an individual's Drive account, who IS - a member of the domain. - We'll call the domain **example.com**, and the user - **foo@example.com**. + If the destination is a drive backend then server-side copying will be + attempted if possible. - There's a few steps we need to go through to accomplish this: + Use the --interactive/-i or --dry-run flag to see what would be copied before copying. - ##### 1. Create a service account for example.com - - To create a service account and obtain its credentials, go to the - [Google Developer Console](https://console.developers.google.com). - - You must have a project - create one if you don't. - - Then go to "IAM & admin" -> "Service Accounts". - - Use the "Create Service Account" button. Fill in "Service account name" - and "Service account ID" with something that identifies your client. - - Select "Create And Continue". Step 2 and 3 are optional. - - These credentials are what rclone will use for authentication. - If you ever need to remove access, press the "Delete service - account key" button. - ##### 2. Allowing API access to example.com Google Drive - - Go to example.com's admin console - - Go into "Security" (or use the search bar) - - Select "Show more" and then "Advanced settings" - - Select "Manage API client access" in the "Authentication" section - - In the "Client Name" field enter the service account's - "Client ID" - this can be found in the Developer Console under - "IAM & Admin" -> "Service Accounts", then "View Client ID" for - the newly created service account. - It is a ~21 character numerical string. - - In the next field, "One or More API Scopes", enter - `https://www.googleapis.com/auth/drive` - to grant access to Google Drive specifically. + ### exportformats - ##### 3. Configure rclone, assuming a new install + Dump the export formats for debug purposes -rclone config + rclone backend exportformats remote: [options] [+] -n/s/q> n # New name>gdrive # Gdrive is an example name Storage> # Select -the number shown for Google Drive client_id> # Can be left blank -client_secret> # Can be left blank scope> # Select your scope, 1 for -example root_folder_id> # Can be left blank service_account_file> -/home/foo/myJSONfile.json # This is where the JSON file goes! y/n> # -Auto config, n + ### importformats + Dump the import formats for debug purposes - ##### 4. Verify that it's working - - `rclone -v --drive-impersonate foo@example.com lsf gdrive:backup` - - The arguments do: - - `-v` - verbose logging - - `--drive-impersonate foo@example.com` - this is what does - the magic, pretending to be user foo. - - `lsf` - list files in a parsing friendly way - - `gdrive:backup` - use the remote called gdrive, work in - the folder named backup. + rclone backend importformats remote: [options] [+] - Note: in case you configured a specific root folder on gdrive and rclone is unable to access the contents of that folder when using `--drive-impersonate`, do this instead: - - in the gdrive web interface, share your root folder with the user/email of the new Service Account you created/selected at step #1 - - use rclone without specifying the `--drive-impersonate` option, like this: - `rclone -v lsf gdrive:backup` - ### Shared drives (team drives) + ## Limitations - If you want to configure the remote to point to a Google Shared Drive - (previously known as Team Drives) then answer `y` to the question - `Configure this as a Shared Drive (Team Drive)?`. + 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 MiB/s but lots of + small files can take a long time. - This will fetch the list of Shared Drives from google and allow you to - configure which one you want to use. You can also type in a Shared - Drive ID if you prefer. + Server side copies are also subject to a separate rate limit. If you + see User rate limit exceeded errors, wait at least 24 hours and retry. + You can disable server-side copies with `--disable copy` to download + and upload the files if you prefer. - For example: + ### Limitations of Google Docs -Configure this as a Shared Drive (Team Drive)? y) Yes n) No y/n> y -Fetching Shared Drive list... Choose a number from below, or type in -your own value 1 / Rclone Test  "xxxxxxxxxxxxxxxxxxxx" 2 / Rclone Test 2 - "yyyyyyyyyyyyyyyyyyyy" 3 / Rclone Test 3  "zzzzzzzzzzzzzzzzzzzz" Enter -a Shared Drive ID> 1 -------------------- [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} -team_drive = xxxxxxxxxxxxxxxxxxxx -------------------- y) Yes this is OK -e) Edit this remote d) Delete this remote y/e/d> y + Google docs will appear as size -1 in `rclone ls`, `rclone ncdu` etc, + and as size 0 in anything which uses the VFS layer, e.g. `rclone mount` + and `rclone serve`. When calculating directory totals, e.g. in + `rclone size` and `rclone ncdu`, they will be counted in as empty + files. + This is because rclone can't find out the size of the Google docs + without downloading them. - ### --fast-list + Google docs will transfer correctly with `rclone sync`, `rclone copy` + etc as rclone knows to ignore the size when doing the transfer. - This remote supports `--fast-list` which allows you to use fewer - transactions in exchange for more memory. See the [rclone - docs](https://rclone.org/docs/#fast-list) for more details. + However an unfortunate consequence of this is that you may not be able + to download Google docs using `rclone mount`. If it doesn't work you + will get a 0 sized file. If you try again the doc may gain its + correct size and be downloadable. Whether it will work on not depends + on the application accessing the mount and the OS you are running - + experiment to find out if it does work for you! - It does this by combining multiple `list` calls into a single API request. + ### Duplicated files - This works by combining many `'%s' in parents` filters into one expression. - To list the contents of directories a, b and c, the following requests will be send by the regular `List` function: + Sometimes, for no reason I've been able to track down, drive will + duplicate a file that rclone uploads. Drive unlike all the other + remotes can have duplicated files. -trashed=false and 'a' in parents trashed=false and 'b' in parents -trashed=false and 'c' in parents + Duplicated files cause problems with the syncing and you will see + messages in the log about duplicates. - These can now be combined into a single request: + Use `rclone dedupe` to fix duplicated files. -trashed=false and ('a' in parents or 'b' in parents or 'c' in parents) + Note that this isn't just a problem with rclone, even Google Photos on + Android duplicates files on drive sometimes. + ### Rclone appears to be re-copying files it shouldn't - The implementation of `ListR` will put up to 50 `parents` filters into one request. - It will use the `--checkers` value to specify the number of requests to run in parallel. + The most likely cause of this is the duplicated file issue above - run + `rclone dedupe` and check your logs for duplicate object or directory + messages. - In tests, these batch requests were up to 20x faster than the regular method. - Running the following command against different sized folders gives: + This can also be caused by a delay/caching on google drive's end when + comparing directory listings. Specifically with team drives used in + combination with --fast-list. Files that were uploaded recently may + not appear on the directory list sent to rclone when using --fast-list. -rclone lsjson -vv -R --checkers=6 gdrive:folder + Waiting a moderate period of time between attempts (estimated to be + approximately 1 hour) and/or not using --fast-list both seem to be + effective in preventing the problem. + ### SHA1 or SHA256 hashes may be missing - small folder (220 directories, 700 files): + All files have MD5 hashes, but a small fraction of files uploaded may + not have SHA1 or SHA256 hashes especially if they were uploaded before 2018. - - without `--fast-list`: 38s - - with `--fast-list`: 10s + ## Making your own client_id - large folder (10600 directories, 39000 files): + When you use rclone with Google drive in its default configuration you + are using rclone's client_id. This is shared between all the rclone + users. There is a global rate limit on the number of queries per + second that each client_id can do set by Google. rclone already has a + high quota and I will continue to make sure it is high enough by + contacting Google. - - without `--fast-list`: 22:05 min - - with `--fast-list`: 58s + It is strongly recommended to use your own client ID as the default rclone ID is heavily used. If you have multiple services running, it is recommended to use an API key for each service. The default Google quota is 10 transactions per second so it is recommended to stay under that number as if you use more than that, it will cause rclone to rate limit and make things slower. - ### Modified time + Here is how to create your own Google Drive client ID for rclone: - Google drive stores modification times accurate to 1 ms. + 1. Log into the [Google API + Console](https://console.developers.google.com/) with your Google + account. It doesn't matter what Google account you use. (It need not + be the same account as the Google Drive you want to access) - ### Restricted filename characters + 2. Select a project or create a new project. - Only Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), - as they can't be used in JSON strings. + 3. Under "ENABLE APIS AND SERVICES" search for "Drive", and enable the + "Google Drive API". - In contrast to other backends, `/` can also be used in names and `.` - or `..` are valid names. + 4. Click "Credentials" in the left-side panel (not "Create + credentials", which opens the wizard). - ### Revisions + 5. If you already configured an "Oauth Consent Screen", then skip + to the next step; if not, click on "CONFIGURE CONSENT SCREEN" button + (near the top right corner of the right panel), then select "External" + and click on "CREATE"; on the next screen, enter an "Application name" + ("rclone" is OK); enter "User Support Email" (your own email is OK); + enter "Developer Contact Email" (your own email is OK); then click on + "Save" (all other data is optional). You will also have to add some scopes, + including `.../auth/docs` and `.../auth/drive` in order to be able to edit, + create and delete files with RClone. You may also want to include the + `../auth/drive.metadata.readonly` scope. After adding scopes, click + "Save and continue" to add test users. Be sure to add your own account to + the test users. Once you've added yourself as a test user and saved the + changes, click again on "Credentials" on the left panel to go back to + the "Credentials" screen. - 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. + (PS: if you are a GSuite user, you could also select "Internal" instead + of "External" above, but this will restrict API use to Google Workspace + users in your organisation). - Revisions follow the standard google policy which at time of writing - was + 6. Click on the "+ CREATE CREDENTIALS" button at the top of the screen, + then select "OAuth client ID". - * They are deleted after 30 days or 100 revisions (whatever comes first). - * They do not count towards a user storage quota. + 7. Choose an application type of "Desktop app" and click "Create". (the default name is fine) - ### Deleting files + 8. It will show you a client ID and client secret. Make a note of these. + + (If you selected "External" at Step 5 continue to Step 9. + If you chose "Internal" you don't need to publish and can skip straight to + Step 10 but your destination drive must be part of the same Google Workspace.) - By default rclone will send all files to the trash when deleting - files. If deleting them permanently is required then use the - `--drive-use-trash=false` flag, or set the equivalent environment - variable. + 9. Go to "Oauth consent screen" and then click "PUBLISH APP" button and confirm. + You will also want to add yourself as a test user. - ### Shortcuts + 10. Provide the noted client ID and client secret to rclone. - In March 2020 Google introduced a new feature in Google Drive called - [drive shortcuts](https://support.google.com/drive/answer/9700156) - ([API](https://developers.google.com/drive/api/v3/shortcuts)). These - will (by September 2020) [replace the ability for files or folders to - be in multiple folders at once](https://cloud.google.com/blog/products/g-suite/simplifying-google-drives-folder-structure-and-sharing-models). + Be aware that, due to the "enhanced security" recently introduced by + Google, you are theoretically expected to "submit your app for verification" + and then wait a few weeks(!) for their response; in practice, you can go right + ahead and use the client ID and client secret with rclone, the only issue will + be a very scary confirmation screen shown when you connect via your browser + for rclone to be able to get its token-id (but as this only happens during + the remote configuration, it's not such a big deal). Keeping the application in + "Testing" will work as well, but the limitation is that any grants will expire + after a week, which can be annoying to refresh constantly. If, for whatever + reason, a short grant time is not a problem, then keeping the application in + testing mode would also be sufficient. - Shortcuts are files that link to other files on Google Drive somewhat - like a symlink in unix, except they point to the underlying file data - (e.g. the inode in unix terms) so they don't break if the source is - renamed or moved about. + (Thanks to @balazer on github for these instructions.) - By default rclone treats these as follows. + Sometimes, creation of an OAuth consent in Google API Console fails due to an error message + “The request failed because changes to one of the field of the resource is not supported”. + As a convenient workaround, the necessary Google Drive API key can be created on the + [Python Quickstart](https://developers.google.com/drive/api/v3/quickstart/python) page. + Just push the Enable the Drive API button to receive the Client ID and Secret. + Note that it will automatically create a new project in the API Console. - For shortcuts pointing to files: + # Google Photos - - When listing a file shortcut appears as the destination file. - - When downloading the contents of the destination file is downloaded. - - When updating shortcut file with a non shortcut file, the shortcut is removed then a new file is uploaded in place of the shortcut. - - When server-side moving (renaming) the shortcut is renamed, not the destination file. - - When server-side copying the shortcut is copied, not the contents of the shortcut. (unless `--drive-copy-shortcut-content` is in use in which case the contents of the shortcut gets copied). - - When deleting the shortcut is deleted not the linked file. - - When setting the modification time, the modification time of the linked file will be set. + The rclone backend for [Google Photos](https://www.google.com/photos/about/) is + a specialized backend for transferring photos and videos to and from + Google Photos. - For shortcuts pointing to folders: + **NB** The Google Photos API which rclone uses has quite a few + limitations, so please read the [limitations section](#limitations) + carefully to make sure it is suitable for your use. - - When listing the shortcut appears as a folder and that folder will contain the contents of the linked folder appear (including any sub folders) - - When downloading the contents of the linked folder and sub contents are downloaded - - When uploading to a shortcut folder the file will be placed in the linked folder - - When server-side moving (renaming) the shortcut is renamed, not the destination folder - - When server-side copying the contents of the linked folder is copied, not the shortcut. - - When deleting with `rclone rmdir` or `rclone purge` the shortcut is deleted not the linked folder. - - **NB** When deleting with `rclone remove` or `rclone mount` the contents of the linked folder will be deleted. + ## Configuration - The [rclone backend](https://rclone.org/commands/rclone_backend/) command can be used to create shortcuts. + The initial setup for google cloud storage involves getting a token from Google Photos + which you need to do in your browser. `rclone config` walks you + through it. - Shortcuts can be completely ignored with the `--drive-skip-shortcuts` flag - or the corresponding `skip_shortcuts` configuration setting. + Here is an example of how to make a remote called `remote`. First run: - ### Emptying trash + rclone config - If you wish to empty your trash you can use the `rclone cleanup remote:` - command which will permanently delete all your trashed files. This command - does not take any path arguments. + This will guide you through an interactive setup process: - Note that Google Drive takes some time (minutes to days) to empty the - trash even though the command returns within a few seconds. No output - is echoed, so there will be no confirmation even using -v or -vv. +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value [snip] XX / Google +Photos  "google photos" [snip] Storage> google photos ** See help for +google photos backend at: https://rclone.org/googlephotos/ ** - ### Quota information +Google Application Client Id Leave blank normally. Enter a string value. +Press Enter for the default (""). client_id> Google Application Client +Secret Leave blank normally. Enter a string value. Press Enter for the +default (""). client_secret> Set to make the Google Photos backend read +only. - To view your current quota you can use the `rclone about remote:` - command which will display your usage limit (quota), the usage in Google - Drive, the size of all files in the Trash and the space used by other - Google services such as Gmail. This command does not take any path - arguments. +If you choose read only then rclone will only request read only access +to your photos, otherwise rclone will request full access. Enter a +boolean value (true or false). Press Enter for the default ("false"). +read_only> Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config +Use web browser to automatically authenticate rclone with remote? * Say +Y if the machine running rclone has a web browser you can use * Say N if +running rclone on a (remote) machine without web browser access If not +sure try Y. If Y failed, try N. 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 - #### Import/Export of google documents +*** IMPORTANT: All media items uploaded to Google Photos with rclone *** +are stored in full resolution at original quality. These uploads *** +will count towards storage in your Google Account. - Google documents can be exported from and uploaded to Google Drive. + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + [remote] type = google photos token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2019-06-28T17:38:04.644930156+01:00"} + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y ``` - When rclone downloads a Google doc it chooses a format to download - depending upon the `--drive-export-formats` setting. - By default the export formats are `docx,xlsx,pptx,svg` which are a - sensible default for an editable document. + See the remote setup docs for how to set it up on a machine with no Internet browser available. - 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. + Note that rclone runs a webserver on your local machine to collect the token as returned from Google if using web browser to automatically authenticate. This only runs from the moment it opens your browser to the moment you get back the verification code. This is on http://127.0.0.1:53682/ and this may require you to unblock it temporarily if you are running a host firewall, or use manual mode. - If you prefer an archive copy then you might use `--drive-export-formats - pdf`, or if you prefer openoffice/libreoffice formats you might use - `--drive-export-formats ods,odt,odp`. + This remote is called remote and can now be used like this - Note that rclone adds the extension to the google doc, so if it is - called `My Spreadsheet` on google docs, it will be exported as `My - Spreadsheet.xlsx` or `My Spreadsheet.pdf` etc. + See all the albums in your photos - When importing files into Google Drive, rclone will convert all - files with an extension in `--drive-import-formats` to their - associated document type. - rclone will not convert any files by default, since the conversion - is lossy process. + rclone lsd remote:album - The conversion must result in a file with the same extension when - the `--drive-export-formats` rules are applied to the uploaded document. + Make a new album - Here are some examples for allowed and prohibited conversions. + rclone mkdir remote:album/newAlbum - | export-formats | import-formats | Upload Ext | Document Ext | Allowed | - | -------------- | -------------- | ---------- | ------------ | ------- | - | odt | odt | odt | odt | Yes | - | odt | docx,odt | odt | odt | Yes | - | | docx | docx | docx | Yes | - | | odt | odt | docx | No | - | odt,docx | docx,odt | docx | odt | No | - | docx,odt | docx,odt | docx | docx | Yes | - | docx,odt | docx,odt | odt | docx | No | + List the contents of an album - This limitation can be disabled by specifying `--drive-allow-import-name-change`. - When using this flag, rclone can convert multiple files types resulting - in the same document type at once, e.g. with `--drive-import-formats docx,odt,txt`, - all files having these extension would result in a document represented as a docx file. - This brings the additional risk of overwriting a document, if multiple files - have the same stem. Many rclone operations will not handle this name change - in any way. They assume an equal name when copying files and might copy the - file again or delete them when the name changes. + rclone ls remote:album/newAlbum - Here are the possible export extensions with their corresponding mime types. - Most of these can also be used for importing, but there more that are not - listed here. Some of these additional ones might only be available when - the operating system provides the correct MIME type entries. + Sync /home/local/images to the Google Photos, removing any excess files in the album. - This list can be changed by Google Drive at any time and might not - represent the currently available conversions. + rclone sync --interactive /home/local/image remote:album/newAlbum - | Extension | Mime Type | Description | - | --------- |-----------| ------------| - | bmp | image/bmp | Windows Bitmap format | - | csv | text/csv | Standard CSV format for Spreadsheets | - | doc | application/msword | Classic Word file | - | docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document | Microsoft Office Document | - | epub | application/epub+zip | E-book format | - | html | text/html | An HTML Document | - | jpg | image/jpeg | A JPEG Image File | - | json | application/vnd.google-apps.script+json | JSON Text Format for Google Apps scripts | - | odp | application/vnd.oasis.opendocument.presentation | Openoffice Presentation | - | ods | application/vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet | - | ods | application/x-vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet | - | odt | application/vnd.oasis.opendocument.text | Openoffice Document | - | pdf | application/pdf | Adobe PDF Format | - | pjpeg | image/pjpeg | Progressive JPEG Image | - | png | image/png | PNG Image Format| - | pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation | Microsoft Office Powerpoint | - | rtf | application/rtf | Rich Text Format | - | svg | image/svg+xml | Scalable Vector Graphics Format | - | tsv | text/tab-separated-values | Standard TSV format for spreadsheets | - | txt | text/plain | Plain Text | - | wmf | application/x-msmetafile | Windows Meta File | - | xls | application/vnd.ms-excel | Classic Excel file | - | xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | Microsoft Office Spreadsheet | - | zip | application/zip | A ZIP file of HTML, Images CSS | + ### Layout - Google documents can also be exported as link files. These files will - open a browser window for the Google Docs website of that document - when opened. The link file extension has to be specified as a - `--drive-export-formats` parameter. They will match all available - Google Documents. + As Google Photos is not a general purpose cloud storage system, the backend is laid out to help you navigate it. - | Extension | Description | OS Support | - | --------- | ----------- | ---------- | - | desktop | freedesktop.org specified desktop entry | Linux | - | link.html | An HTML Document with a redirect | All | - | url | INI style link file | macOS, Windows | - | webloc | macOS specific XML format | macOS | + The directories under media show different ways of categorizing the media. Each file will appear multiple times. So if you want to make a backup of your google photos you might choose to backup remote:media/by-month. (NB remote:media/by-day is rather slow at the moment so avoid for syncing.) + Note that all your photos and videos will appear somewhere under media, but they may not appear under album unless you've put them into albums. - ### Standard options + / - upload - file1.jpg - file2.jpg - ... - media - all - file1.jpg - file2.jpg - ... - by-year - 2000 - file1.jpg - ... - 2001 - file2.jpg - ... - ... - by-month - 2000 - 2000-01 - file1.jpg - ... - 2000-02 - file2.jpg - ... - ... - by-day - 2000 - 2000-01-01 - file1.jpg - ... - 2000-01-02 - file2.jpg - ... - ... - album - album name - album name/sub - shared-album - album name - album name/sub - feature - favorites - file1.jpg - file2.jpg - Here are the Standard options specific to drive (Google Drive). + There are two writable parts of the tree, the upload directory and sub directories of the album directory. - #### --drive-client-id + The upload directory is for uploading files you don't want to put into albums. This will be empty to start with and will contain the files you've uploaded for one rclone session only, becoming empty again when you restart rclone. The use case for this would be if you have a load of files you just want to once off dump into Google Photos. For repeated syncing, uploading to album will work better. - Google Application Client Id - Setting your own is recommended. - See https://rclone.org/drive/#making-your-own-client-id for how to create your own. - If you leave this blank, it will use an internal key which is low performance. + Directories within the album directory are also writeable and you may create new directories (albums) under album. If you copy files with a directory hierarchy in there then rclone will create albums with the / character in them. For example if you do - Properties: + rclone copy /path/to/images remote:album/images - - Config: client_id - - Env Var: RCLONE_DRIVE_CLIENT_ID - - Type: string - - Required: false + and the images directory contains - #### --drive-client-secret + images - file1.jpg dir file2.jpg dir2 dir3 file3.jpg - OAuth Client Secret. + Then rclone will create the following albums with the following files in - Leave blank normally. + - images - file1.jpg - images/dir - file2.jpg - images/dir2/dir3 - file3.jpg - Properties: + This means that you can use the album path pretty much like a normal filesystem and it is a good target for repeated syncing. - - Config: client_secret - - Env Var: RCLONE_DRIVE_CLIENT_SECRET - - Type: string - - Required: false + The shared-album directory shows albums shared with you or by you. This is similar to the Sharing tab in the Google Photos web interface. - #### --drive-scope + ### Standard options - Scope that rclone should use when requesting access from drive. + Here are the Standard options specific to google photos (Google Photos). - Properties: + #### --gphotos-client-id - - Config: scope - - Env Var: RCLONE_DRIVE_SCOPE - - Type: string - - Required: false - - Examples: - - "drive" - - Full access all files, excluding Application Data Folder. - - "drive.readonly" - - Read-only access to file metadata and file contents. - - "drive.file" - - Access to files created by rclone only. - - These are visible in the drive website. - - File authorization is revoked when the user deauthorizes the app. - - "drive.appfolder" - - Allows read and write access to the Application Data folder. - - This is not visible in the drive website. - - "drive.metadata.readonly" - - Allows read-only access to file metadata but - - does not allow any access to read or download file content. + OAuth Client Id. - #### --drive-service-account-file + Leave blank normally. - Service Account Credentials JSON file path. + Properties: - Leave blank normally. - Needed only if you want use SA instead of interactive login. + - Config: client_id - Env Var: RCLONE_GPHOTOS_CLIENT_ID - Type: string - Required: false - Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`. + #### --gphotos-client-secret - Properties: + OAuth Client Secret. - - Config: service_account_file - - Env Var: RCLONE_DRIVE_SERVICE_ACCOUNT_FILE - - Type: string - - Required: false + Leave blank normally. - #### --drive-alternate-export + Properties: - Deprecated: No longer needed. + - Config: client_secret - Env Var: RCLONE_GPHOTOS_CLIENT_SECRET - Type: string - Required: false - Properties: + #### --gphotos-read-only - - Config: alternate_export - - Env Var: RCLONE_DRIVE_ALTERNATE_EXPORT - - Type: bool - - Default: false + Set to make the Google Photos backend read only. - ### Advanced options + If you choose read only then rclone will only request read only access to your photos, otherwise rclone will request full access. - Here are the Advanced options specific to drive (Google Drive). + Properties: - #### --drive-token + - Config: read_only - Env Var: RCLONE_GPHOTOS_READ_ONLY - Type: bool - Default: false - OAuth Access Token as a JSON blob. + ### Advanced options - Properties: + Here are the Advanced options specific to google photos (Google Photos). - - Config: token - - Env Var: RCLONE_DRIVE_TOKEN - - Type: string - - Required: false + #### --gphotos-token - #### --drive-auth-url + OAuth Access Token as a JSON blob. - Auth server URL. + Properties: - Leave blank to use the provider defaults. + - Config: token - Env Var: RCLONE_GPHOTOS_TOKEN - Type: string - Required: false - Properties: + #### --gphotos-auth-url - - Config: auth_url - - Env Var: RCLONE_DRIVE_AUTH_URL - - Type: string - - Required: false + Auth server URL. - #### --drive-token-url + Leave blank to use the provider defaults. - Token server url. + Properties: - Leave blank to use the provider defaults. + - Config: auth_url - Env Var: RCLONE_GPHOTOS_AUTH_URL - Type: string - Required: false - Properties: + #### --gphotos-token-url - - Config: token_url - - Env Var: RCLONE_DRIVE_TOKEN_URL - - Type: string - - Required: false + Token server url. - #### --drive-root-folder-id + Leave blank to use the provider defaults. - ID of the root folder. - Leave blank normally. + Properties: - Fill in to access "Computers" folders (see docs), or for rclone to use - a non root folder as its starting point. + - Config: token_url - Env Var: RCLONE_GPHOTOS_TOKEN_URL - Type: string - Required: false + #### --gphotos-read-size - Properties: + Set to read the size of media items. - - Config: root_folder_id - - Env Var: RCLONE_DRIVE_ROOT_FOLDER_ID - - Type: string - - Required: false + Normally rclone does not read the size of media items since this takes another transaction. This isn't necessary for syncing. However rclone mount needs to know the size of files in advance of reading them, so setting this flag when using rclone mount is recommended if you want to read the media. - #### --drive-service-account-credentials + Properties: - Service Account Credentials JSON blob. + - Config: read_size - Env Var: RCLONE_GPHOTOS_READ_SIZE - Type: bool - Default: false - Leave blank normally. - Needed only if you want use SA instead of interactive login. + #### --gphotos-start-year - Properties: + Year limits the photos to be downloaded to those which are uploaded after the given year. - - Config: service_account_credentials - - Env Var: RCLONE_DRIVE_SERVICE_ACCOUNT_CREDENTIALS - - Type: string - - Required: false + Properties: - #### --drive-team-drive + - Config: start_year - Env Var: RCLONE_GPHOTOS_START_YEAR - Type: int - Default: 2000 - ID of the Shared Drive (Team Drive). + #### --gphotos-include-archived - Properties: + Also view and download archived media. - - Config: team_drive - - Env Var: RCLONE_DRIVE_TEAM_DRIVE - - Type: string - - Required: false + By default, rclone does not request archived media. Thus, when syncing, archived media is not visible in directory listings or transferred. - #### --drive-auth-owner-only + Note that media in albums is always visible and synced, no matter their archive status. - Only consider files owned by the authenticated user. + With this flag, archived media are always visible in directory listings and transferred. - Properties: + Without this flag, archived media will not be visible in directory listings and won't be transferred. - - Config: auth_owner_only - - Env Var: RCLONE_DRIVE_AUTH_OWNER_ONLY - - Type: bool - - Default: false + Properties: - #### --drive-use-trash + - Config: include_archived - Env Var: RCLONE_GPHOTOS_INCLUDE_ARCHIVED - Type: bool - Default: false - Send files to the trash instead of deleting permanently. + #### --gphotos-encoding - Defaults to true, namely sending files to the trash. - Use `--drive-use-trash=false` to delete files permanently instead. + The encoding for the backend. - Properties: + See the encoding section in the overview for more info. - - Config: use_trash - - Env Var: RCLONE_DRIVE_USE_TRASH - - Type: bool - - Default: true + Properties: - #### --drive-copy-shortcut-content + - Config: encoding - Env Var: RCLONE_GPHOTOS_ENCODING - Type: Encoding - Default: Slash,CrLf,InvalidUtf8,Dot - Server side copy contents of shortcuts instead of the shortcut. + #### --gphotos-batch-mode - When doing server side copies, normally rclone will copy shortcuts as - shortcuts. + Upload file batching sync|async|off. - If this flag is used then rclone will copy the contents of shortcuts - rather than shortcuts themselves when doing server side copies. + This sets the batch mode used by rclone. - Properties: + This has 3 possible values - - Config: copy_shortcut_content - - Env Var: RCLONE_DRIVE_COPY_SHORTCUT_CONTENT - - Type: bool - - Default: false + - off - no batching - sync - batch uploads and check completion (default) - async - batch upload and don't check completion - #### --drive-skip-gdocs + Rclone will close any outstanding batches when it exits which may make a delay on quit. - Skip google documents in all listings. + Properties: - If given, gdocs practically become invisible to rclone. + - Config: batch_mode - Env Var: RCLONE_GPHOTOS_BATCH_MODE - Type: string - Default: "sync" - Properties: + #### --gphotos-batch-size - - Config: skip_gdocs - - Env Var: RCLONE_DRIVE_SKIP_GDOCS - - Type: bool - - Default: false + Max number of files in upload batch. - #### --drive-skip-checksum-gphotos + This sets the batch size of files to upload. It has to be less than 50. - Skip MD5 checksum on Google photos and videos only. + By default this is 0 which means rclone which calculate the batch size depending on the setting of batch_mode. - Use this if you get checksum errors when transferring Google photos or - videos. + - batch_mode: async - default batch_size is 50 - batch_mode: sync - default batch_size is the same as --transfers - batch_mode: off - not in use - Setting this flag will cause Google photos and videos to return a - blank MD5 checksum. + Rclone will close any outstanding batches when it exits which may make a delay on quit. - Google photos are identified by being in the "photos" space. + Setting this is a great idea if you are uploading lots of small files as it will make them a lot quicker. You can use --transfers 32 to maximise throughput. - Corrupted checksums are caused by Google modifying the image/video but - not updating the checksum. + Properties: - Properties: + - Config: batch_size - Env Var: RCLONE_GPHOTOS_BATCH_SIZE - Type: int - Default: 0 - - Config: skip_checksum_gphotos - - Env Var: RCLONE_DRIVE_SKIP_CHECKSUM_GPHOTOS - - Type: bool - - Default: false + #### --gphotos-batch-timeout - #### --drive-shared-with-me + Max time to allow an idle upload batch before uploading. - Only show files that are shared with me. + If an upload batch is idle for more than this long then it will be uploaded. - Instructs rclone to operate on your "Shared with me" folder (where - Google Drive lets you access the files and folders others have shared - with you). + The default for this is 0 which means rclone will choose a sensible default based on the batch_mode in use. - This works both with the "list" (lsd, lsl, etc.) and the "copy" - commands (copy, sync, etc.), and with all other commands too. + - batch_mode: async - default batch_timeout is 10s - batch_mode: sync - default batch_timeout is 1s - batch_mode: off - not in use - Properties: + Properties: - - Config: shared_with_me - - Env Var: RCLONE_DRIVE_SHARED_WITH_ME - - Type: bool - - Default: false + - Config: batch_timeout - Env Var: RCLONE_GPHOTOS_BATCH_TIMEOUT - Type: Duration - Default: 0s - #### --drive-trashed-only + #### --gphotos-batch-commit-timeout - Only show files that are in the trash. + Max time to wait for a batch to finish committing - This will show trashed files in their original directory structure. + Properties: - Properties: + - Config: batch_commit_timeout - Env Var: RCLONE_GPHOTOS_BATCH_COMMIT_TIMEOUT - Type: Duration - Default: 10m0s - - Config: trashed_only - - Env Var: RCLONE_DRIVE_TRASHED_ONLY - - Type: bool - - Default: false + ## Limitations - #### --drive-starred-only + Only images and videos can be uploaded. If you attempt to upload non videos or images or formats that Google Photos doesn't understand, rclone will upload the file, then Google Photos will give an error when it is put turned into a media item. - Only show files that are starred. + Note that all media items uploaded to Google Photos through the API are stored in full resolution at "original quality" and will count towards your storage quota in your Google Account. The API does not offer a way to upload in "high quality" mode.. - Properties: + rclone about is not supported by the Google Photos backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote. - - Config: starred_only - - Env Var: RCLONE_DRIVE_STARRED_ONLY - - Type: bool - - Default: false + See List of backends that do not support rclone about See rclone about - #### --drive-formats + ### Downloading Images - Deprecated: See export_formats. + When Images are downloaded this strips EXIF location (according to the docs and my tests). This is a limitation of the Google Photos API and is covered by bug #112096115. - Properties: + The current google API does not allow photos to be downloaded at original resolution. This is very important if you are, for example, relying on "Google Photos" as a backup of your photos. You will not be able to use rclone to redownload original images. You could use 'google takeout' to recover the original photos as a last resort - - Config: formats - - Env Var: RCLONE_DRIVE_FORMATS - - Type: string - - Required: false + ### Downloading Videos - #### --drive-export-formats + When videos are downloaded they are downloaded in a really compressed version of the video compared to downloading it via the Google Photos web interface. This is covered by bug #113672044. - Comma separated list of preferred formats for downloading Google docs. + ### Duplicates - Properties: + If a file name is duplicated in a directory then rclone will add the file ID into its name. So two files called file.jpg would then appear as file {123456}.jpg and file {ABCDEF}.jpg (the actual IDs are a lot longer alas!). - - Config: export_formats - - Env Var: RCLONE_DRIVE_EXPORT_FORMATS - - Type: string - - Default: "docx,xlsx,pptx,svg" + If you upload the same image (with the same binary data) twice then Google Photos will deduplicate it. However it will retain the filename from the first upload which may confuse rclone. For example if you uploaded an image to upload then uploaded the same image to album/my_album the filename of the image in album/my_album will be what it was uploaded with initially, not what you uploaded it with to album. In practise this shouldn't cause + too many problems. - #### --drive-import-formats + ### Modification times - Comma separated list of preferred formats for uploading Google docs. + The date shown of media in Google Photos is the creation date as determined by the EXIF information, or the upload date if that is not known. - Properties: + This is not changeable by rclone and is not the modification date of the media on local disk. This means that rclone cannot use the dates from Google Photos for syncing purposes. - - Config: import_formats - - Env Var: RCLONE_DRIVE_IMPORT_FORMATS - - Type: string - - Required: false + ### Size - #### --drive-allow-import-name-change + The Google Photos API does not return the size of media. This means that when syncing to Google Photos, rclone can only do a file existence check. - Allow the filetype to change when uploading Google docs. + It is possible to read the size of the media, but this needs an extra HTTP HEAD request per media item so is very slow and uses up a lot of transactions. This can be enabled with the --gphotos-read-size option or the read_size = true config parameter. - E.g. file.doc to file.docx. This will confuse sync and reupload every time. + If you want to use the backend with rclone mount you may need to enable this flag (depending on your OS and application using the photos) otherwise you may not be able to read media off the mount. You'll need to experiment to see if it works for you without the flag. - Properties: + ### Albums - - Config: allow_import_name_change - - Env Var: RCLONE_DRIVE_ALLOW_IMPORT_NAME_CHANGE - - Type: bool - - Default: false + Rclone can only upload files to albums it created. This is a limitation of the Google Photos API. - #### --drive-use-created-date + Rclone can remove files it uploaded from albums it created only. - Use file created date instead of modified date. + ### Deleting files - Useful when downloading data and you want the creation date used in - place of the last modified date. + Rclone can remove files from albums it created, but note that the Google Photos API does not allow media to be deleted permanently so this media will still remain. See bug #109759781. - **WARNING**: This flag may have some unexpected consequences. + Rclone cannot delete files anywhere except under album. - When uploading to your drive all files will be overwritten unless they - haven't been modified since their creation. And the inverse will occur - while downloading. This side effect can be avoided by using the - "--checksum" flag. + ### Deleting albums - This feature was implemented to retain photos capture date as recorded - by google photos. You will first need to check the "Create a Google - Photos folder" option in your google drive settings. You can then copy - or move the photos locally and use the date the image was taken - (created) set as the modification date. + The Google Photos API does not support deleting albums - see bug #135714733. - Properties: + # Hasher - - Config: use_created_date - - Env Var: RCLONE_DRIVE_USE_CREATED_DATE - - Type: bool - - Default: false + Hasher is a special overlay backend to create remotes which handle checksums for other remotes. It's main functions include: - Emulate hash types unimplemented by backends - Cache checksums to help with slow hashing of large local or (S)FTP files - Warm up checksum cache from external SUM files - #### --drive-use-shared-date + ## Getting started - Use date file was shared instead of modified date. + To use Hasher, first set up the underlying remote following the configuration instructions for that remote. You can also use a local pathname instead of a remote. Check that your base remote is working. - Note that, as with "--drive-use-created-date", this flag may have - unexpected consequences when uploading/downloading files. + Let's call the base remote myRemote:path here. Note that anything inside myRemote:path will be handled by hasher and anything outside won't. This means that if you are using a bucket based remote (S3, B2, Swift) then you should put the bucket in the remote s3:bucket. - If both this flag and "--drive-use-created-date" are set, the created - date is used. + Now proceed to interactive or manual configuration. - Properties: + ### Interactive configuration + + Run rclone config: ``` No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> Hasher1 Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Handle checksums for other remotes  "hasher" [snip] Storage> hasher Remote to cache checksums for, like myremote:mypath. Enter a string value. Press Enter for the default (""). remote> myRemote:path Comma + separated list of supported checksum types. Enter a string value. Press Enter for the default ("md5,sha1"). hashsums> md5 Maximum time to keep checksums in cache. 0 = no cache, off = cache forever. max_age> off Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +[Hasher1] type = hasher remote = myRemote:path hashsums = md5 max_age = +off -------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y - - Config: use_shared_date - - Env Var: RCLONE_DRIVE_USE_SHARED_DATE - - Type: bool - - Default: false - #### --drive-list-chunk + ### Manual configuration - Size of listing chunk 100-1000, 0 to disable. + Run `rclone config path` to see the path of current active config file, + usually `YOURHOME/.config/rclone/rclone.conf`. + Open it in your favorite text editor, find section for the base remote + and create new section for hasher like in the following examples: - Properties: +[Hasher1] type = hasher remote = myRemote:path hashes = md5 max_age = +off - - Config: list_chunk - - Env Var: RCLONE_DRIVE_LIST_CHUNK - - Type: int - - Default: 1000 +[Hasher2] type = hasher remote = /local/path hashes = dropbox,sha1 +max_age = 24h - #### --drive-impersonate - Impersonate this user when using a service account. + Hasher takes basically the following parameters: + - `remote` is required, + - `hashes` is a comma separated list of supported checksums + (by default `md5,sha1`), + - `max_age` - maximum time to keep a checksum value in the cache, + `0` will disable caching completely, + `off` will cache "forever" (that is until the files get changed). - Properties: + Make sure the `remote` has `:` (colon) in. If you specify the remote without + a colon then rclone will use a local directory of that name. So if you use + a remote of `/local/path` then rclone will handle hashes for that directory. + If you use `remote = name` literally then rclone will put files + **in a directory called `name` located under current directory**. - - Config: impersonate - - Env Var: RCLONE_DRIVE_IMPERSONATE - - Type: string - - Required: false + ## Usage - #### --drive-upload-cutoff + ### Basic operations - Cutoff for switching to chunked upload. + Now you can use it as `Hasher2:subdir/file` instead of base remote. + Hasher will transparently update cache with new checksums when a file + is fully read or overwritten, like: - Properties: +rclone copy External:path/file Hasher:dest/path - - Config: upload_cutoff - - Env Var: RCLONE_DRIVE_UPLOAD_CUTOFF - - Type: SizeSuffix - - Default: 8Mi +rclone cat Hasher:path/to/file > /dev/null - #### --drive-chunk-size - Upload chunk size. + The way to refresh **all** cached checksums (even unsupported by the base backend) + for a subtree is to **re-download** all files in the subtree. For example, + use `hashsum --download` using **any** supported hashsum on the command line + (we just care to re-read): - Must a power of 2 >= 256k. +rclone hashsum MD5 --download Hasher:path/to/subtree > /dev/null - Making this larger will improve performance, but note that each chunk - is buffered in memory one per transfer. +rclone backend dump Hasher:path/to/subtree - Reducing this will reduce memory usage but decrease performance. - Properties: + You can print or drop hashsum cache using custom backend commands: - - Config: chunk_size - - Env Var: RCLONE_DRIVE_CHUNK_SIZE - - Type: SizeSuffix - - Default: 8Mi +rclone backend dump Hasher:dir/subdir - #### --drive-acknowledge-abuse +rclone backend drop Hasher: - Set to allow files which return cannotDownloadAbusiveFile to be downloaded. - If downloading a file returns the error "This file has been identified - as malware or spam and cannot be downloaded" with the error code - "cannotDownloadAbusiveFile" then supply this flag to rclone to - indicate you acknowledge the risks of downloading the file and rclone - will download it anyway. + ### Pre-Seed from a SUM File - Note that if you are using service account it will need Manager - permission (not Content Manager) to for this flag to work. If the SA - does not have the right permission, Google will just ignore the flag. + Hasher supports two backend commands: generic SUM file `import` and faster + but less consistent `stickyimport`. - Properties: +rclone backend import Hasher:dir/subdir SHA1 /path/to/SHA1SUM +[--checkers 4] - - Config: acknowledge_abuse - - Env Var: RCLONE_DRIVE_ACKNOWLEDGE_ABUSE - - Type: bool - - Default: false - #### --drive-keep-revision-forever + Instead of SHA1 it can be any hash supported by the remote. The last argument + can point to either a local or an `other-remote:path` text file in SUM format. + The command will parse the SUM file, then walk down the path given by the + first argument, snapshot current fingerprints and fill in the cache entries + correspondingly. + - Paths in the SUM file are treated as relative to `hasher:dir/subdir`. + - The command will **not** check that supplied values are correct. + You **must know** what you are doing. + - This is a one-time action. The SUM file will not get "attached" to the + remote. Cache entries can still be overwritten later, should the object's + fingerprint change. + - The tree walk can take long depending on the tree size. You can increase + `--checkers` to make it faster. Or use `stickyimport` if you don't care + about fingerprints and consistency. - Keep new head revision of each file forever. +rclone backend stickyimport hasher:path/to/data sha1 +remote:/path/to/sum.sha1 - Properties: - - Config: keep_revision_forever - - Env Var: RCLONE_DRIVE_KEEP_REVISION_FOREVER - - Type: bool - - Default: false + `stickyimport` is similar to `import` but works much faster because it + does not need to stat existing files and skips initial tree walk. + Instead of binding cache entries to file fingerprints it creates _sticky_ + entries bound to the file name alone ignoring size, modification time etc. + Such hash entries can be replaced only by `purge`, `delete`, `backend drop` + or by full re-read/re-write of the files. - #### --drive-size-as-quota + ## Configuration reference - Show sizes as storage quota usage, not actual size. - Show the size of a file as the storage quota used. This is the - current version plus any older versions that have been set to keep - forever. + ### Standard options - **WARNING**: This flag may have some unexpected consequences. + Here are the Standard options specific to hasher (Better checksums for other remotes). - It is not recommended to set this flag in your config - the - recommended usage is using the flag form --drive-size-as-quota when - doing rclone ls/lsl/lsf/lsjson/etc only. + #### --hasher-remote - If you do use this flag for syncing (not recommended) then you will - need to use --ignore size also. + Remote to cache checksums for (e.g. myRemote:path). Properties: - - Config: size_as_quota - - Env Var: RCLONE_DRIVE_SIZE_AS_QUOTA - - Type: bool - - Default: false + - Config: remote + - Env Var: RCLONE_HASHER_REMOTE + - Type: string + - Required: true - #### --drive-v2-download-min-size + #### --hasher-hashes - If Object's are greater, use drive v2 API to download. + Comma separated list of supported checksum types. Properties: - - Config: v2_download_min_size - - Env Var: RCLONE_DRIVE_V2_DOWNLOAD_MIN_SIZE - - Type: SizeSuffix - - Default: off + - Config: hashes + - Env Var: RCLONE_HASHER_HASHES + - Type: CommaSepList + - Default: md5,sha1 - #### --drive-pacer-min-sleep + #### --hasher-max-age - Minimum time to sleep between API calls. + Maximum time to keep checksums in cache (0 = no cache, off = cache forever). Properties: - - Config: pacer_min_sleep - - Env Var: RCLONE_DRIVE_PACER_MIN_SLEEP + - Config: max_age + - Env Var: RCLONE_HASHER_MAX_AGE - Type: Duration - - Default: 100ms + - Default: off - #### --drive-pacer-burst + ### Advanced options - Number of API calls to allow without sleeping. + Here are the Advanced options specific to hasher (Better checksums for other remotes). - Properties: + #### --hasher-auto-size - - Config: pacer_burst - - Env Var: RCLONE_DRIVE_PACER_BURST - - Type: int - - Default: 100 + Auto-update checksum for files smaller than this size (disabled by default). - #### --drive-server-side-across-configs + Properties: - Deprecated: use --server-side-across-configs instead. + - Config: auto_size + - Env Var: RCLONE_HASHER_AUTO_SIZE + - Type: SizeSuffix + - Default: 0 - Allow server-side operations (e.g. copy) to work across different drive configs. + ### Metadata - This can be useful if you wish to do a server-side copy between two - different Google drives. Note that this isn't enabled by default - because it isn't easy to tell if it will work between any two - configurations. + Any metadata supported by the underlying remote is read and written. - Properties: + See the [metadata](https://rclone.org/docs/#metadata) docs for more info. - - Config: server_side_across_configs - - Env Var: RCLONE_DRIVE_SERVER_SIDE_ACROSS_CONFIGS - - Type: bool - - Default: false + ## Backend commands - #### --drive-disable-http2 + Here are the commands specific to the hasher backend. - Disable drive using http2. + Run them with - There is currently an unsolved issue with the google drive backend and - HTTP/2. HTTP/2 is therefore disabled by default for the drive backend - but can be re-enabled here. When the issue is solved this flag will - be removed. + rclone backend COMMAND remote: - See: https://github.com/rclone/rclone/issues/3631 + The help below will explain what arguments each command takes. + See the [backend](https://rclone.org/commands/rclone_backend/) command for more + info on how to pass options and arguments. + These can be run on a running backend using the rc command + [backend/command](https://rclone.org/rc/#backend-command). - Properties: + ### drop - - Config: disable_http2 - - Env Var: RCLONE_DRIVE_DISABLE_HTTP2 - - Type: bool - - Default: true + Drop cache - #### --drive-stop-on-upload-limit + rclone backend drop remote: [options] [+] - Make upload limit errors be fatal. + Completely drop checksum cache. + Usage Example: + rclone backend drop hasher: - At the time of writing it is only possible to upload 750 GiB of data to - Google Drive a day (this is an undocumented limit). When this limit is - reached Google Drive produces a slightly different error message. When - this flag is set it causes these errors to be fatal. These will stop - the in-progress sync. - Note that this detection is relying on error message strings which - Google don't document so it may break in the future. + ### dump - See: https://github.com/rclone/rclone/issues/3857 + Dump the database + rclone backend dump remote: [options] [+] - Properties: + Dump cache records covered by the current remote - - Config: stop_on_upload_limit - - Env Var: RCLONE_DRIVE_STOP_ON_UPLOAD_LIMIT - - Type: bool - - Default: false + ### fulldump - #### --drive-stop-on-download-limit + Full dump of the database - Make download limit errors be fatal. + rclone backend fulldump remote: [options] [+] - At the time of writing it is only possible to download 10 TiB of data from - Google Drive a day (this is an undocumented limit). When this limit is - reached Google Drive produces a slightly different error message. When - this flag is set it causes these errors to be fatal. These will stop - the in-progress sync. + Dump all cache records in the database - Note that this detection is relying on error message strings which - Google don't document so it may break in the future. + ### import + Import a SUM file - Properties: + rclone backend import remote: [options] [+] - - Config: stop_on_download_limit - - Env Var: RCLONE_DRIVE_STOP_ON_DOWNLOAD_LIMIT - - Type: bool - - Default: false + Amend hash cache from a SUM file and bind checksums to files by size/time. + Usage Example: + rclone backend import hasher:subdir md5 /path/to/sum.md5 - #### --drive-skip-shortcuts - If set skip shortcut files. + ### stickyimport - Normally rclone dereferences shortcut files making them appear as if - they are the original file (see [the shortcuts section](#shortcuts)). - If this flag is set then rclone will ignore shortcut files completely. + Perform fast import of a SUM file + rclone backend stickyimport remote: [options] [+] - Properties: + Fill hash cache from a SUM file without verifying file fingerprints. + Usage Example: + rclone backend stickyimport hasher:subdir md5 remote:path/to/sum.md5 - - Config: skip_shortcuts - - Env Var: RCLONE_DRIVE_SKIP_SHORTCUTS - - Type: bool - - Default: false - #### --drive-skip-dangling-shortcuts - If set skip dangling shortcut files. - If this is set then rclone will not show any dangling shortcuts in listings. + ## Implementation details (advanced) + This section explains how various rclone operations work on a hasher remote. - Properties: + **Disclaimer. This section describes current implementation which can + change in future rclone versions!.** - - Config: skip_dangling_shortcuts - - Env Var: RCLONE_DRIVE_SKIP_DANGLING_SHORTCUTS - - Type: bool - - Default: false + ### Hashsum command - #### --drive-resource-key + The `rclone hashsum` (or `md5sum` or `sha1sum`) command will: - Resource key for accessing a link-shared file. + 1. if requested hash is supported by lower level, just pass it. + 2. if object size is below `auto_size` then download object and calculate + _requested_ hashes on the fly. + 3. if unsupported and the size is big enough, build object `fingerprint` + (including size, modtime if supported, first-found _other_ hash if any). + 4. if the strict match is found in cache for the requested remote, return + the stored hash. + 5. if remote found but fingerprint mismatched, then purge the entry and + proceed to step 6. + 6. if remote not found or had no requested hash type or after step 5: + download object, calculate all _supported_ hashes on the fly and store + in cache; return requested hash. - If you need to access files shared with a link like this + ### Other operations - https://drive.google.com/drive/folders/XXX?resourcekey=YYY&usp=sharing + - whenever a file is uploaded or downloaded **in full**, capture the stream + to calculate all supported hashes on the fly and update database + - server-side `move` will update keys of existing cache entries + - `deletefile` will remove a single cache entry + - `purge` will remove all cache entries under the purged path - Then you will need to use the first part "XXX" as the "root_folder_id" - and the second part "YYY" as the "resource_key" otherwise you will get - 404 not found errors when trying to access the directory. + Note that setting `max_age = 0` will disable checksum caching completely. - See: https://developers.google.com/drive/api/guides/resource-keys + If you set `max_age = off`, checksums in cache will never age, unless you + fully rewrite or delete the file. - This resource key requirement only applies to a subset of old files. + ### Cache storage - Note also that opening the folder once in the web interface (with the - user you've authenticated rclone with) seems to be enough so that the - resource key is not needed. + Cached checksums are stored as `bolt` database files under rclone cache + directory, usually `~/.cache/rclone/kv/`. Databases are maintained + one per _base_ backend, named like `BaseRemote~hasher.bolt`. + Checksums for multiple `alias`-es into a single base backend + will be stored in the single database. All local paths are treated as + aliases into the `local` backend (unless encrypted or chunked) and stored + in `~/.cache/rclone/kv/local~hasher.bolt`. + Databases can be shared between multiple rclone processes. + # HDFS - Properties: + [HDFS](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html) is a + distributed file-system, part of the [Apache Hadoop](https://hadoop.apache.org/) framework. - - Config: resource_key - - Env Var: RCLONE_DRIVE_RESOURCE_KEY - - Type: string - - Required: false + Paths are specified as `remote:` or `remote:path/to/dir`. - #### --drive-fast-list-bug-fix + ## Configuration - Work around a bug in Google Drive listing. + Here is an example of how to make a remote called `remote`. First run: - Normally rclone will work around a bug in Google Drive when using - --fast-list (ListR) where the search "(A in parents) or (B in - parents)" returns nothing sometimes. See #3114, #4289 and - https://issuetracker.google.com/issues/149522397 + rclone config - Rclone detects this by finding no items in more than one directory - when listing and retries them as lists of individual directories. + This will guide you through an interactive setup process: - This means that if you have a lot of empty directories rclone will end - up listing them all individually and this can take many more API - calls. +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value [skip] XX / Hadoop +distributed file system  "hdfs" [skip] Storage> hdfs ** See help for +hdfs backend at: https://rclone.org/hdfs/ ** - This flag allows the work-around to be disabled. This is **not** - recommended in normal use - only if you have a particular case you are - having trouble with like many empty directories. +hadoop name node and port Enter a string value. Press Enter for the +default (""). Choose a number from below, or type in your own value 1 / +Connect to host namenode at port 8020  "namenode:8020" namenode> +namenode.hadoop:8020 hadoop user name Enter a string value. Press Enter +for the default (""). Choose a number from below, or type in your own +value 1 / Connect to hdfs as root  "root" username> root Edit advanced +config? (y/n) y) Yes n) No (default) y/n> n Remote config +-------------------- [remote] type = hdfs namenode = +namenode.hadoop:8020 username = root -------------------- y) Yes this is +OK (default) e) Edit this remote d) Delete this remote y/e/d> y Current +remotes: +Name Type ==== ==== hadoop hdfs - Properties: +e) Edit existing remote +f) New remote +g) Delete remote +h) Rename remote +i) Copy remote +j) Set configuration password +k) Quit config e/n/d/r/c/s/q> q - - Config: fast_list_bug_fix - - Env Var: RCLONE_DRIVE_FAST_LIST_BUG_FIX - - Type: bool - - Default: true - #### --drive-encoding + This remote is called `remote` and can now be used like this - The encoding for the backend. + See all the top level directories - See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + rclone lsd remote: - Properties: + List the contents of a directory - - Config: encoding - - Env Var: RCLONE_DRIVE_ENCODING - - Type: MultiEncoder - - Default: InvalidUtf8 + rclone ls remote:directory - #### --drive-env-auth + Sync the remote `directory` to `/home/local/directory`, deleting any excess files. - Get IAM credentials from runtime (environment variables or instance meta data if no env vars). + rclone sync --interactive remote:directory /home/local/directory - Only applies if service_account_file and service_account_credentials is blank. + ### Setting up your own HDFS instance for testing - Properties: + You may start with a [manual setup](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/SingleCluster.html) + or use the docker image from the tests: - - Config: env_auth - - Env Var: RCLONE_DRIVE_ENV_AUTH - - Type: bool - - Default: false - - Examples: - - "false" - - Enter credentials in the next step. - - "true" - - Get GCP IAM credentials from the environment (env vars or IAM). + If you want to build the docker image - ## Backend commands +git clone https://github.com/rclone/rclone.git cd +rclone/fstest/testserver/images/test-hdfs docker build --rm -t +rclone/test-hdfs . - Here are the commands specific to the drive backend. - Run them with + Or you can just use the latest one pushed - rclone backend COMMAND remote: +docker run --rm --name "rclone-hdfs" -p 127.0.0.1:9866:9866 -p +127.0.0.1:8020:8020 --hostname "rclone-hdfs" rclone/test-hdfs - The help below will explain what arguments each command takes. - See the [backend](https://rclone.org/commands/rclone_backend/) command for more - info on how to pass options and arguments. + **NB** it need few seconds to startup. - These can be run on a running backend using the rc command - [backend/command](https://rclone.org/rc/#backend-command). + For this docker image the remote needs to be configured like this: - ### get +[remote] type = hdfs namenode = 127.0.0.1:8020 username = root - Get command for fetching the drive config parameters - rclone backend get remote: [options] [+] + You can stop this image with `docker kill rclone-hdfs` (**NB** it does not use volumes, so all data + uploaded will be lost.) - This is a get command which will be used to fetch the various drive config parameters + ### Modification times - Usage Examples: + Time accurate to 1 second is stored. - rclone backend get drive: [-o service_account_file] [-o chunk_size] - rclone rc backend/command command=get fs=drive: [-o service_account_file] [-o chunk_size] + ### Checksum + No checksums are implemented. - Options: + ### Usage information - - "chunk_size": show the current upload chunk size - - "service_account_file": show the current service account file + You can use the `rclone about remote:` command which will display filesystem size and current usage. - ### set + ### Restricted filename characters - Set command for updating the drive config parameters + In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) + the following characters are also replaced: - rclone backend set remote: [options] [+] + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | : | 0x3A | : | - This is a set command which will be used to update the various drive config parameters + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8). - Usage Examples: - rclone backend set drive: [-o service_account_file=sa.json] [-o chunk_size=67108864] - rclone rc backend/command command=set fs=drive: [-o service_account_file=sa.json] [-o chunk_size=67108864] + ### Standard options + + Here are the Standard options specific to hdfs (Hadoop distributed file system). + #### --hdfs-namenode - Options: + Hadoop name nodes and ports. - - "chunk_size": update the current upload chunk size - - "service_account_file": update the current service account file + E.g. "namenode-1:8020,namenode-2:8020,..." to connect to host namenodes at port 8020. - ### shortcut + Properties: - Create shortcuts from files or directories + - Config: namenode + - Env Var: RCLONE_HDFS_NAMENODE + - Type: CommaSepList + - Default: - rclone backend shortcut remote: [options] [+] + #### --hdfs-username - This command creates shortcuts from files or directories. + Hadoop user name. - Usage: + Properties: - rclone backend shortcut drive: source_item destination_shortcut - rclone backend shortcut drive: source_item -o target=drive2: destination_shortcut + - Config: username + - Env Var: RCLONE_HDFS_USERNAME + - Type: string + - Required: false + - Examples: + - "root" + - Connect to hdfs as root. - In the first example this creates a shortcut from the "source_item" - which can be a file or a directory to the "destination_shortcut". The - "source_item" and the "destination_shortcut" should be relative paths - from "drive:" + ### Advanced options - In the second example this creates a shortcut from the "source_item" - relative to "drive:" to the "destination_shortcut" relative to - "drive2:". This may fail with a permission error if the user - authenticated with "drive2:" can't read files from "drive:". + Here are the Advanced options specific to hdfs (Hadoop distributed file system). + #### --hdfs-service-principal-name - Options: + Kerberos service principal name for the namenode. - - "target": optional target remote for the shortcut destination + Enables KERBEROS authentication. Specifies the Service Principal Name + (SERVICE/FQDN) for the namenode. E.g. \"hdfs/namenode.hadoop.docker\" + for namenode running as service 'hdfs' with FQDN 'namenode.hadoop.docker'. - ### drives + Properties: - List the Shared Drives available to this account + - Config: service_principal_name + - Env Var: RCLONE_HDFS_SERVICE_PRINCIPAL_NAME + - Type: string + - Required: false - rclone backend drives remote: [options] [+] + #### --hdfs-data-transfer-protection - This command lists the Shared Drives (Team Drives) available to this - account. + Kerberos data transfer protection: authentication|integrity|privacy. - Usage: + Specifies whether or not authentication, data signature integrity + checks, and wire encryption are required when communicating with + the datanodes. Possible values are 'authentication', 'integrity' + and 'privacy'. Used only with KERBEROS enabled. - rclone backend [-o config] drives drive: + Properties: - This will return a JSON list of objects like this + - Config: data_transfer_protection + - Env Var: RCLONE_HDFS_DATA_TRANSFER_PROTECTION + - Type: string + - Required: false + - Examples: + - "privacy" + - Ensure authentication, integrity and encryption enabled. - [ - { - "id": "0ABCDEF-01234567890", - "kind": "drive#teamDrive", - "name": "My Drive" - }, - { - "id": "0ABCDEFabcdefghijkl", - "kind": "drive#teamDrive", - "name": "Test Drive" - } - ] + #### --hdfs-encoding - With the -o config parameter it will output the list in a format - suitable for adding to a config file to make aliases for all the - drives found and a combined drive. + The encoding for the backend. - [My Drive] - type = alias - remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=: + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. - [Test Drive] - type = alias - remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=: + Properties: - [AllDrives] - type = combine - upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:" + - Config: encoding + - Env Var: RCLONE_HDFS_ENCODING + - Type: Encoding + - Default: Slash,Colon,Del,Ctl,InvalidUtf8,Dot - Adding this to the rclone config file will cause those team drives to - be accessible with the aliases shown. Any illegal characters will be - substituted with "_" and duplicate names will have numbers suffixed. - It will also add a remote called AllDrives which shows all the shared - drives combined into one directory tree. - ### untrash + ## Limitations - Untrash files and directories + - No server-side `Move` or `DirMove`. + - Checksums not implemented. - rclone backend untrash remote: [options] [+] + # HiDrive - This command untrashes all the files and directories in the directory - passed in recursively. + Paths are specified as `remote:path` - Usage: + Paths may be as deep as required, e.g. `remote:directory/subdirectory`. - This takes an optional directory to trash which make this easier to - use via the API. + The initial setup for hidrive involves getting a token from HiDrive + which you need to do in your browser. + `rclone config` walks you through it. - rclone backend untrash drive:directory - rclone backend --interactive untrash drive:directory subdir + ## Configuration - Use the --interactive/-i or --dry-run flag to see what would be restored before restoring it. + Here is an example of how to make a remote called `remote`. First run: - Result: + rclone config - { - "Untrashed": 17, - "Errors": 0 - } + This will guide you through an interactive setup process: +No remotes found - make a new one n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Choose a number from below, or type in your own value [snip] +XX / HiDrive  "hidrive" [snip] Storage> hidrive OAuth Client Id - Leave +blank normally. client_id> OAuth Client Secret - Leave blank normally. +client_secret> Access permissions that rclone should use when requesting +access from HiDrive. Leave blank normally. scope_access> Edit advanced +config? y/n> n Use web browser to automatically authenticate rclone with +remote? * Say Y if the machine running rclone has a web browser you can +use * Say N if running rclone on a (remote) machine without web browser +access If not sure try Y. If Y failed, try N. y/n> y If your browser +doesn't open automatically go to the following link: +http://127.0.0.1:53682/auth?state=xxxxxxxxxxxxxxxxxxxxxx Log in and +authorize rclone for access Waiting for code... Got code +-------------------- [remote] type = hidrive token = +{"access_token":"xxxxxxxxxxxxxxxxxxxx","token_type":"Bearer","refresh_token":"xxxxxxxxxxxxxxxxxxxxxxx","expiry":"xxxxxxxxxxxxxxxxxxxxxxx"} +-------------------- y) Yes this is OK (default) e) Edit this remote d) +Delete this remote y/e/d> y - ### copyid - Copy files by ID + **You should be aware that OAuth-tokens can be used to access your account + and hence should not be shared with other persons.** + See the [below section](#keeping-your-tokens-safe) for more information. - rclone backend copyid remote: [options] [+] + See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a + machine with no Internet browser available. - This command copies files by ID + Note that rclone runs a webserver on your local machine to collect the + token as returned from HiDrive. This only runs from the moment it opens + your browser to the moment you get back the verification code. + The webserver runs on `http://127.0.0.1:53682/`. + If local port `53682` is protected by a firewall you may need to temporarily + unblock the firewall to complete authorization. - Usage: + Once configured you can then use `rclone` like this, - rclone backend copyid drive: ID path - rclone backend copyid drive: ID1 path1 ID2 path2 + List directories in top level of your HiDrive root folder - It copies the drive file with ID given to the path (an rclone path which - will be passed internally to rclone copyto). The ID and path pairs can be - repeated. + rclone lsd remote: - The path should end with a / to indicate copy the file as named to - this directory. If it doesn't end with a / then the last path - component will be used as the file name. + List all the files in your HiDrive filesystem - If the destination is a drive backend then server-side copying will be - attempted if possible. + rclone ls remote: - Use the --interactive/-i or --dry-run flag to see what would be copied before copying. + To copy a local directory to a HiDrive directory called backup + rclone copy /home/source remote:backup - ### exportformats + ### Keeping your tokens safe - Dump the export formats for debug purposes + Any OAuth-tokens will be stored by rclone in the remote's configuration file as unencrypted text. + Anyone can use a valid refresh-token to access your HiDrive filesystem without knowing your password. + Therefore you should make sure no one else can access your configuration. - rclone backend exportformats remote: [options] [+] + It is possible to encrypt rclone's configuration file. + You can find information on securing your configuration file by viewing the [configuration encryption docs](https://rclone.org/docs/#configuration-encryption). - ### importformats + ### Invalid refresh token - Dump the import formats for debug purposes + As can be verified [here](https://developer.hidrive.com/basics-flows/), + each `refresh_token` (for Native Applications) is valid for 60 days. + If used to access HiDrivei, its validity will be automatically extended. - rclone backend importformats remote: [options] [+] + This means that if you + * Don't use the HiDrive remote for 60 days + then rclone will return an error which includes a text + that implies the refresh token is *invalid* or *expired*. - ## Limitations + To fix this you will need to authorize rclone to access your HiDrive account again. - 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 MiB/s but lots of - small files can take a long time. + Using - Server side copies are also subject to a separate rate limit. If you - see User rate limit exceeded errors, wait at least 24 hours and retry. - You can disable server-side copies with `--disable copy` to download - and upload the files if you prefer. + rclone config reconnect remote: - ### Limitations of Google Docs + the process is very similar to the process of initial setup exemplified before. - Google docs will appear as size -1 in `rclone ls`, `rclone ncdu` etc, - and as size 0 in anything which uses the VFS layer, e.g. `rclone mount` - and `rclone serve`. When calculating directory totals, e.g. in - `rclone size` and `rclone ncdu`, they will be counted in as empty - files. + ### Modification times and hashes - This is because rclone can't find out the size of the Google docs - without downloading them. + HiDrive allows modification times to be set on objects accurate to 1 second. - Google docs will transfer correctly with `rclone sync`, `rclone copy` - etc as rclone knows to ignore the size when doing the transfer. + HiDrive supports [its own hash type](https://static.hidrive.com/dev/0001) + which is used to verify the integrity of file contents after successful transfers. - However an unfortunate consequence of this is that you may not be able - to download Google docs using `rclone mount`. If it doesn't work you - will get a 0 sized file. If you try again the doc may gain its - correct size and be downloadable. Whether it will work on not depends - on the application accessing the mount and the OS you are running - - experiment to find out if it does work for you! + ### Restricted filename characters - ### Duplicated files + HiDrive cannot store files or folders that include + `/` (0x2F) or null-bytes (0x00) in their name. + Any other characters can be used in the names of files or folders. + Additionally, files or folders cannot be named either of the following: `.` or `..` - Sometimes, for no reason I've been able to track down, drive will - duplicate a file that rclone uploads. Drive unlike all the other - remotes can have duplicated files. + Therefore rclone will automatically replace these characters, + if files or folders are stored or accessed with such names. - Duplicated files cause problems with the syncing and you will see - messages in the log about duplicates. + You can read about how this filename encoding works in general + [here](overview/#restricted-filenames). - Use `rclone dedupe` to fix duplicated files. + Keep in mind that HiDrive only supports file or folder names + with a length of 255 characters or less. - Note that this isn't just a problem with rclone, even Google Photos on - Android duplicates files on drive sometimes. + ### Transfers - ### Rclone appears to be re-copying files it shouldn't + HiDrive limits file sizes per single request to a maximum of 2 GiB. + To allow storage of larger files and allow for better upload performance, + the hidrive backend will use a chunked transfer for files larger than 96 MiB. + Rclone will upload multiple parts/chunks of the file at the same time. + Chunks in the process of being uploaded are buffered in memory, + so you may want to restrict this behaviour on systems with limited resources. - The most likely cause of this is the duplicated file issue above - run - `rclone dedupe` and check your logs for duplicate object or directory - messages. + You can customize this behaviour using the following options: - This can also be caused by a delay/caching on google drive's end when - comparing directory listings. Specifically with team drives used in - combination with --fast-list. Files that were uploaded recently may - not appear on the directory list sent to rclone when using --fast-list. + * `chunk_size`: size of file parts + * `upload_cutoff`: files larger or equal to this in size will use a chunked transfer + * `upload_concurrency`: number of file-parts to upload at the same time - Waiting a moderate period of time between attempts (estimated to be - approximately 1 hour) and/or not using --fast-list both seem to be - effective in preventing the problem. + See the below section about configuration options for more details. - ## Making your own client_id + ### Root folder - When you use rclone with Google drive in its default configuration you - are using rclone's client_id. This is shared between all the rclone - users. There is a global rate limit on the number of queries per - second that each client_id can do set by Google. rclone already has a - high quota and I will continue to make sure it is high enough by - contacting Google. + You can set the root folder for rclone. + This is the directory that rclone considers to be the root of your HiDrive. - It is strongly recommended to use your own client ID as the default rclone ID is heavily used. If you have multiple services running, it is recommended to use an API key for each service. The default Google quota is 10 transactions per second so it is recommended to stay under that number as if you use more than that, it will cause rclone to rate limit and make things slower. + Usually, you will leave this blank, and rclone will use the root of the account. - Here is how to create your own Google Drive client ID for rclone: + However, you can set this to restrict rclone to a specific folder hierarchy. - 1. Log into the [Google API - Console](https://console.developers.google.com/) with your Google - account. It doesn't matter what Google account you use. (It need not - be the same account as the Google Drive you want to access) + This works by prepending the contents of the `root_prefix` option + to any paths accessed by rclone. + For example, the following two ways to access the home directory are equivalent: - 2. Select a project or create a new project. + rclone lsd --hidrive-root-prefix="/users/test/" remote:path - 3. Under "ENABLE APIS AND SERVICES" search for "Drive", and enable the - "Google Drive API". + rclone lsd remote:/users/test/path - 4. Click "Credentials" in the left-side panel (not "Create - credentials", which opens the wizard). + See the below section about configuration options for more details. - 5. If you already configured an "Oauth Consent Screen", then skip - to the next step; if not, click on "CONFIGURE CONSENT SCREEN" button - (near the top right corner of the right panel), then select "External" - and click on "CREATE"; on the next screen, enter an "Application name" - ("rclone" is OK); enter "User Support Email" (your own email is OK); - enter "Developer Contact Email" (your own email is OK); then click on - "Save" (all other data is optional). You will also have to add some scopes, - including `.../auth/docs` and `.../auth/drive` in order to be able to edit, - create and delete files with RClone. You may also want to include the - `../auth/drive.metadata.readonly` scope. After adding scopes, click - "Save and continue" to add test users. Be sure to add your own account to - the test users. Once you've added yourself as a test user and saved the - changes, click again on "Credentials" on the left panel to go back to - the "Credentials" screen. + ### Directory member count - (PS: if you are a GSuite user, you could also select "Internal" instead - of "External" above, but this will restrict API use to Google Workspace - users in your organisation). + By default, rclone will know the number of directory members contained in a directory. + For example, `rclone lsd` uses this information. - 6. Click on the "+ CREATE CREDENTIALS" button at the top of the screen, - then select "OAuth client ID". + The acquisition of this information will result in additional time costs for HiDrive's API. + When dealing with large directory structures, it may be desirable to circumvent this time cost, + especially when this information is not explicitly needed. + For this, the `disable_fetching_member_count` option can be used. - 7. Choose an application type of "Desktop app" and click "Create". (the default name is fine) + See the below section about configuration options for more details. - 8. It will show you a client ID and client secret. Make a note of these. - - (If you selected "External" at Step 5 continue to Step 9. - If you chose "Internal" you don't need to publish and can skip straight to - Step 10 but your destination drive must be part of the same Google Workspace.) - 9. Go to "Oauth consent screen" and then click "PUBLISH APP" button and confirm. - You will also want to add yourself as a test user. + ### Standard options - 10. Provide the noted client ID and client secret to rclone. + Here are the Standard options specific to hidrive (HiDrive). - Be aware that, due to the "enhanced security" recently introduced by - Google, you are theoretically expected to "submit your app for verification" - and then wait a few weeks(!) for their response; in practice, you can go right - ahead and use the client ID and client secret with rclone, the only issue will - be a very scary confirmation screen shown when you connect via your browser - for rclone to be able to get its token-id (but as this only happens during - the remote configuration, it's not such a big deal). Keeping the application in - "Testing" will work as well, but the limitation is that any grants will expire - after a week, which can be annoying to refresh constantly. If, for whatever - reason, a short grant time is not a problem, then keeping the application in - testing mode would also be sufficient. + #### --hidrive-client-id - (Thanks to @balazer on github for these instructions.) + OAuth Client Id. - Sometimes, creation of an OAuth consent in Google API Console fails due to an error message - “The request failed because changes to one of the field of the resource is not supported”. - As a convenient workaround, the necessary Google Drive API key can be created on the - [Python Quickstart](https://developers.google.com/drive/api/v3/quickstart/python) page. - Just push the Enable the Drive API button to receive the Client ID and Secret. - Note that it will automatically create a new project in the API Console. + Leave blank normally. - # Google Photos + Properties: - The rclone backend for [Google Photos](https://www.google.com/photos/about/) is - a specialized backend for transferring photos and videos to and from - Google Photos. + - Config: client_id + - Env Var: RCLONE_HIDRIVE_CLIENT_ID + - Type: string + - Required: false - **NB** The Google Photos API which rclone uses has quite a few - limitations, so please read the [limitations section](#limitations) - carefully to make sure it is suitable for your use. + #### --hidrive-client-secret - ## Configuration + OAuth Client Secret. - The initial setup for google cloud storage involves getting a token from Google Photos - which you need to do in your browser. `rclone config` walks you - through it. + Leave blank normally. - Here is an example of how to make a remote called `remote`. First run: + Properties: - rclone config + - Config: client_secret + - Env Var: RCLONE_HIDRIVE_CLIENT_SECRET + - Type: string + - Required: false - This will guide you through an interactive setup process: + #### --hidrive-scope-access -No remotes found, make a new one? n) New remote s) Set configuration -password q) Quit config n/s/q> n name> remote Type of storage to -configure. Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value [snip] XX / Google -Photos  "google photos" [snip] Storage> google photos ** See help for -google photos backend at: https://rclone.org/googlephotos/ ** + Access permissions that rclone should use when requesting access from HiDrive. -Google Application Client Id Leave blank normally. Enter a string value. -Press Enter for the default (""). client_id> Google Application Client -Secret Leave blank normally. Enter a string value. Press Enter for the -default (""). client_secret> Set to make the Google Photos backend read -only. + Properties: -If you choose read only then rclone will only request read only access -to your photos, otherwise rclone will request full access. Enter a -boolean value (true or false). Press Enter for the default ("false"). -read_only> Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config -Use web browser to automatically authenticate rclone with remote? * Say -Y if the machine running rclone has a web browser you can use * Say N if -running rclone on a (remote) machine without web browser access If not -sure try Y. If Y failed, try N. 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 + - Config: scope_access + - Env Var: RCLONE_HIDRIVE_SCOPE_ACCESS + - Type: string + - Default: "rw" + - Examples: + - "rw" + - Read and write access to resources. + - "ro" + - Read-only access to resources. -*** IMPORTANT: All media items uploaded to Google Photos with rclone *** -are stored in full resolution at original quality. These uploads *** -will count towards storage in your Google Account. + ### Advanced options - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - [remote] type = google photos token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2019-06-28T17:38:04.644930156+01:00"} - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y ``` + Here are the Advanced options specific to hidrive (HiDrive). - See the remote setup docs for how to set it up on a machine with no Internet browser available. + #### --hidrive-token - Note that rclone runs a webserver on your local machine to collect the token as returned from Google if using web browser to automatically authenticate. This only runs from the moment it opens your browser to the moment you get back the verification code. This is on http://127.0.0.1:53682/ and this may require you to unblock it temporarily if you are running a host firewall, or use manual mode. + OAuth Access Token as a JSON blob. - This remote is called remote and can now be used like this + Properties: - See all the albums in your photos + - Config: token + - Env Var: RCLONE_HIDRIVE_TOKEN + - Type: string + - Required: false - rclone lsd remote:album + #### --hidrive-auth-url - Make a new album + Auth server URL. - rclone mkdir remote:album/newAlbum + Leave blank to use the provider defaults. - List the contents of an album + Properties: - rclone ls remote:album/newAlbum + - Config: auth_url + - Env Var: RCLONE_HIDRIVE_AUTH_URL + - Type: string + - Required: false - Sync /home/local/images to the Google Photos, removing any excess files in the album. + #### --hidrive-token-url - rclone sync --interactive /home/local/image remote:album/newAlbum + Token server url. - ### Layout + Leave blank to use the provider defaults. - As Google Photos is not a general purpose cloud storage system, the backend is laid out to help you navigate it. + Properties: - The directories under media show different ways of categorizing the media. Each file will appear multiple times. So if you want to make a backup of your google photos you might choose to backup remote:media/by-month. (NB remote:media/by-day is rather slow at the moment so avoid for syncing.) + - Config: token_url + - Env Var: RCLONE_HIDRIVE_TOKEN_URL + - Type: string + - Required: false - Note that all your photos and videos will appear somewhere under media, but they may not appear under album unless you've put them into albums. + #### --hidrive-scope-role - / - upload - file1.jpg - file2.jpg - ... - media - all - file1.jpg - file2.jpg - ... - by-year - 2000 - file1.jpg - ... - 2001 - file2.jpg - ... - ... - by-month - 2000 - 2000-01 - file1.jpg - ... - 2000-02 - file2.jpg - ... - ... - by-day - 2000 - 2000-01-01 - file1.jpg - ... - 2000-01-02 - file2.jpg - ... - ... - album - album name - album name/sub - shared-album - album name - album name/sub - feature - favorites - file1.jpg - file2.jpg + User-level that rclone should use when requesting access from HiDrive. - There are two writable parts of the tree, the upload directory and sub directories of the album directory. + Properties: - The upload directory is for uploading files you don't want to put into albums. This will be empty to start with and will contain the files you've uploaded for one rclone session only, becoming empty again when you restart rclone. The use case for this would be if you have a load of files you just want to once off dump into Google Photos. For repeated syncing, uploading to album will work better. + - Config: scope_role + - Env Var: RCLONE_HIDRIVE_SCOPE_ROLE + - Type: string + - Default: "user" + - Examples: + - "user" + - User-level access to management permissions. + - This will be sufficient in most cases. + - "admin" + - Extensive access to management permissions. + - "owner" + - Full access to management permissions. - Directories within the album directory are also writeable and you may create new directories (albums) under album. If you copy files with a directory hierarchy in there then rclone will create albums with the / character in them. For example if you do + #### --hidrive-root-prefix - rclone copy /path/to/images remote:album/images + The root/parent folder for all paths. - and the images directory contains + Fill in to use the specified folder as the parent for all paths given to the remote. + This way rclone can use any folder as its starting point. - images - file1.jpg dir file2.jpg dir2 dir3 file3.jpg + Properties: - Then rclone will create the following albums with the following files in + - Config: root_prefix + - Env Var: RCLONE_HIDRIVE_ROOT_PREFIX + - Type: string + - Default: "/" + - Examples: + - "/" + - The topmost directory accessible by rclone. + - This will be equivalent with "root" if rclone uses a regular HiDrive user account. + - "root" + - The topmost directory of the HiDrive user account + - "" + - This specifies that there is no root-prefix for your paths. + - When using this you will always need to specify paths to this remote with a valid parent e.g. "remote:/path/to/dir" or "remote:root/path/to/dir". - - images - file1.jpg - images/dir - file2.jpg - images/dir2/dir3 - file3.jpg + #### --hidrive-endpoint - This means that you can use the album path pretty much like a normal filesystem and it is a good target for repeated syncing. + Endpoint for the service. - The shared-album directory shows albums shared with you or by you. This is similar to the Sharing tab in the Google Photos web interface. + This is the URL that API-calls will be made to. - ### Standard options + Properties: - Here are the Standard options specific to google photos (Google Photos). + - Config: endpoint + - Env Var: RCLONE_HIDRIVE_ENDPOINT + - Type: string + - Default: "https://api.hidrive.strato.com/2.1" - #### --gphotos-client-id + #### --hidrive-disable-fetching-member-count - OAuth Client Id. + Do not fetch number of objects in directories unless it is absolutely necessary. - Leave blank normally. + Requests may be faster if the number of objects in subdirectories is not fetched. - Properties: + Properties: - - Config: client_id - Env Var: RCLONE_GPHOTOS_CLIENT_ID - Type: string - Required: false + - Config: disable_fetching_member_count + - Env Var: RCLONE_HIDRIVE_DISABLE_FETCHING_MEMBER_COUNT + - Type: bool + - Default: false - #### --gphotos-client-secret + #### --hidrive-chunk-size - OAuth Client Secret. + Chunksize for chunked uploads. - Leave blank normally. + Any files larger than the configured cutoff (or files of unknown size) will be uploaded in chunks of this size. - Properties: + The upper limit for this is 2147483647 bytes (about 2.000Gi). + That is the maximum amount of bytes a single upload-operation will support. + Setting this above the upper limit or to a negative value will cause uploads to fail. - - Config: client_secret - Env Var: RCLONE_GPHOTOS_CLIENT_SECRET - Type: string - Required: false + Setting this to larger values may increase the upload speed at the cost of using more memory. + It can be set to smaller values smaller to save on memory. - #### --gphotos-read-only + Properties: - Set to make the Google Photos backend read only. + - Config: chunk_size + - Env Var: RCLONE_HIDRIVE_CHUNK_SIZE + - Type: SizeSuffix + - Default: 48Mi - If you choose read only then rclone will only request read only access to your photos, otherwise rclone will request full access. + #### --hidrive-upload-cutoff - Properties: + Cutoff/Threshold for chunked uploads. - - Config: read_only - Env Var: RCLONE_GPHOTOS_READ_ONLY - Type: bool - Default: false + Any files larger than this will be uploaded in chunks of the configured chunksize. - ### Advanced options + The upper limit for this is 2147483647 bytes (about 2.000Gi). + That is the maximum amount of bytes a single upload-operation will support. + Setting this above the upper limit will cause uploads to fail. - Here are the Advanced options specific to google photos (Google Photos). + Properties: - #### --gphotos-token + - Config: upload_cutoff + - Env Var: RCLONE_HIDRIVE_UPLOAD_CUTOFF + - Type: SizeSuffix + - Default: 96Mi - OAuth Access Token as a JSON blob. + #### --hidrive-upload-concurrency - Properties: + Concurrency for chunked uploads. - - Config: token - Env Var: RCLONE_GPHOTOS_TOKEN - Type: string - Required: false + This is the upper limit for how many transfers for the same file are running concurrently. + Setting this above to a value smaller than 1 will cause uploads to deadlock. - #### --gphotos-auth-url + If you are uploading small numbers of large files over high-speed links + and these uploads do not fully utilize your bandwidth, then increasing + this may help to speed up the transfers. - Auth server URL. + Properties: - Leave blank to use the provider defaults. + - Config: upload_concurrency + - Env Var: RCLONE_HIDRIVE_UPLOAD_CONCURRENCY + - Type: int + - Default: 4 - Properties: + #### --hidrive-encoding - - Config: auth_url - Env Var: RCLONE_GPHOTOS_AUTH_URL - Type: string - Required: false + The encoding for the backend. - #### --gphotos-token-url + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. - Token server url. + Properties: - Leave blank to use the provider defaults. + - Config: encoding + - Env Var: RCLONE_HIDRIVE_ENCODING + - Type: Encoding + - Default: Slash,Dot - Properties: - - Config: token_url - Env Var: RCLONE_GPHOTOS_TOKEN_URL - Type: string - Required: false - #### --gphotos-read-size + ## Limitations - Set to read the size of media items. + ### Symbolic links - Normally rclone does not read the size of media items since this takes another transaction. This isn't necessary for syncing. However rclone mount needs to know the size of files in advance of reading them, so setting this flag when using rclone mount is recommended if you want to read the media. + HiDrive is able to store symbolic links (*symlinks*) by design, + for example, when unpacked from a zip archive. - Properties: + There exists no direct mechanism to manage native symlinks in remotes. + As such this implementation has chosen to ignore any native symlinks present in the remote. + rclone will not be able to access or show any symlinks stored in the hidrive-remote. + This means symlinks cannot be individually removed, copied, or moved, + except when removing, copying, or moving the parent folder. - - Config: read_size - Env Var: RCLONE_GPHOTOS_READ_SIZE - Type: bool - Default: false + *This does not affect the `.rclonelink`-files + that rclone uses to encode and store symbolic links.* - #### --gphotos-start-year + ### Sparse files - Year limits the photos to be downloaded to those which are uploaded after the given year. + It is possible to store sparse files in HiDrive. - Properties: + Note that copying a sparse file will expand the holes + into null-byte (0x00) regions that will then consume disk space. + Likewise, when downloading a sparse file, + the resulting file will have null-byte regions in the place of file holes. - - Config: start_year - Env Var: RCLONE_GPHOTOS_START_YEAR - Type: int - Default: 2000 + # HTTP - #### --gphotos-include-archived + The HTTP remote is a read only remote for reading files of a + webserver. The webserver should provide file listings which rclone + will read and turn into a remote. This has been tested with common + webservers such as Apache/Nginx/Caddy and will likely work with file + listings from most web servers. (If it doesn't then please file an + issue, or send a pull request!) - Also view and download archived media. + Paths are specified as `remote:` or `remote:path`. - By default, rclone does not request archived media. Thus, when syncing, archived media is not visible in directory listings or transferred. + The `remote:` represents the configured [url](#http-url), and any path following + it will be resolved relative to this url, according to the URL standard. This + means with remote url `https://beta.rclone.org/branch` and path `fix`, the + resolved URL will be `https://beta.rclone.org/branch/fix`, while with path + `/fix` the resolved URL will be `https://beta.rclone.org/fix` as the absolute + path is resolved from the root of the domain. - Note that media in albums is always visible and synced, no matter their archive status. + If the path following the `remote:` ends with `/` it will be assumed to point + to a directory. If the path does not end with `/`, then a HEAD request is sent + and the response used to decide if it it is treated as a file or a directory + (run with `-vv` to see details). When [--http-no-head](#http-no-head) is + specified, a path without ending `/` is always assumed to be a file. If rclone + incorrectly assumes the path is a file, the solution is to specify the path with + ending `/`. When you know the path is a directory, ending it with `/` is always + better as it avoids the initial HEAD request. - With this flag, archived media are always visible in directory listings and transferred. + To just download a single file it is easier to use + [copyurl](https://rclone.org/commands/rclone_copyurl/). - Without this flag, archived media will not be visible in directory listings and won't be transferred. + ## Configuration - Properties: + Here is an example of how to make a remote called `remote`. First + run: - - Config: include_archived - Env Var: RCLONE_GPHOTOS_INCLUDE_ARCHIVED - Type: bool - Default: false + rclone config - #### --gphotos-encoding + This will guide you through an interactive setup process: - The encoding for the backend. +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Choose a number from below, or type in your own value [snip] +XX / HTTP  "http" [snip] Storage> http URL of http host to connect to +Choose a number from below, or type in your own value 1 / Connect to +example.com  "https://example.com" url> https://beta.rclone.org Remote +config -------------------- [remote] url = https://beta.rclone.org +-------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y Current remotes: - See the encoding section in the overview for more info. +Name Type ==== ==== remote http - Properties: +e) Edit existing remote +f) New remote +g) Delete remote +h) Rename remote +i) Copy remote +j) Set configuration password +k) Quit config e/n/d/r/c/s/q> q - - Config: encoding - Env Var: RCLONE_GPHOTOS_ENCODING - Type: MultiEncoder - Default: Slash,CrLf,InvalidUtf8,Dot - ## Limitations + This remote is called `remote` and can now be used like this - Only images and videos can be uploaded. If you attempt to upload non videos or images or formats that Google Photos doesn't understand, rclone will upload the file, then Google Photos will give an error when it is put turned into a media item. + See all the top level directories - Note that all media items uploaded to Google Photos through the API are stored in full resolution at "original quality" and will count towards your storage quota in your Google Account. The API does not offer a way to upload in "high quality" mode.. + rclone lsd remote: - rclone about is not supported by the Google Photos backend. Backends without this capability cannot determine free space for an rclone mount or use policy mfs (most free space) as a member of an rclone union remote. + List the contents of a directory - See List of backends that do not support rclone about See rclone about + rclone ls remote:directory - ### Downloading Images + Sync the remote `directory` to `/home/local/directory`, deleting any excess files. - When Images are downloaded this strips EXIF location (according to the docs and my tests). This is a limitation of the Google Photos API and is covered by bug #112096115. + rclone sync --interactive remote:directory /home/local/directory - The current google API does not allow photos to be downloaded at original resolution. This is very important if you are, for example, relying on "Google Photos" as a backup of your photos. You will not be able to use rclone to redownload original images. You could use 'google takeout' to recover the original photos as a last resort + ### Read only - ### Downloading Videos + This remote is read only - you can't upload files to an HTTP server. - When videos are downloaded they are downloaded in a really compressed version of the video compared to downloading it via the Google Photos web interface. This is covered by bug #113672044. + ### Modification times - ### Duplicates + Most HTTP servers store time accurate to 1 second. - If a file name is duplicated in a directory then rclone will add the file ID into its name. So two files called file.jpg would then appear as file {123456}.jpg and file {ABCDEF}.jpg (the actual IDs are a lot longer alas!). + ### Checksum - If you upload the same image (with the same binary data) twice then Google Photos will deduplicate it. However it will retain the filename from the first upload which may confuse rclone. For example if you uploaded an image to upload then uploaded the same image to album/my_album the filename of the image in album/my_album will be what it was uploaded with initially, not what you uploaded it with to album. In practise this shouldn't cause - too many problems. + No checksums are stored. - ### Modified time + ### Usage without a config file - The date shown of media in Google Photos is the creation date as determined by the EXIF information, or the upload date if that is not known. + Since the http remote only has one config parameter it is easy to use + without a config file: - This is not changeable by rclone and is not the modification date of the media on local disk. This means that rclone cannot use the dates from Google Photos for syncing purposes. + rclone lsd --http-url https://beta.rclone.org :http: - ### Size + or: - The Google Photos API does not return the size of media. This means that when syncing to Google Photos, rclone can only do a file existence check. + rclone lsd :http,url='https://beta.rclone.org': - It is possible to read the size of the media, but this needs an extra HTTP HEAD request per media item so is very slow and uses up a lot of transactions. This can be enabled with the --gphotos-read-size option or the read_size = true config parameter. - If you want to use the backend with rclone mount you may need to enable this flag (depending on your OS and application using the photos) otherwise you may not be able to read media off the mount. You'll need to experiment to see if it works for you without the flag. + ### Standard options - ### Albums + Here are the Standard options specific to http (HTTP). - Rclone can only upload files to albums it created. This is a limitation of the Google Photos API. + #### --http-url - Rclone can remove files it uploaded from albums it created only. + URL of HTTP host to connect to. - ### Deleting files + E.g. "https://example.com", or "https://user:pass@example.com" to use a username and password. - Rclone can remove files from albums it created, but note that the Google Photos API does not allow media to be deleted permanently so this media will still remain. See bug #109759781. + Properties: - Rclone cannot delete files anywhere except under album. + - Config: url + - Env Var: RCLONE_HTTP_URL + - Type: string + - Required: true - ### Deleting albums + ### Advanced options - The Google Photos API does not support deleting albums - see bug #135714733. + Here are the Advanced options specific to http (HTTP). - # Hasher + #### --http-headers - Hasher is a special overlay backend to create remotes which handle checksums for other remotes. It's main functions include: - Emulate hash types unimplemented by backends - Cache checksums to help with slow hashing of large local or (S)FTP files - Warm up checksum cache from external SUM files + Set HTTP headers for all transactions. - ## Getting started + Use this to set additional HTTP headers for all transactions. - To use Hasher, first set up the underlying remote following the configuration instructions for that remote. You can also use a local pathname instead of a remote. Check that your base remote is working. + The input format is comma separated list of key,value pairs. Standard + [CSV encoding](https://godoc.org/encoding/csv) may be used. - Let's call the base remote myRemote:path here. Note that anything inside myRemote:path will be handled by hasher and anything outside won't. This means that if you are using a bucket based remote (S3, B2, Swift) then you should put the bucket in the remote s3:bucket. + For example, to set a Cookie use 'Cookie,name=value', or '"Cookie","name=value"'. - Now proceed to interactive or manual configuration. + You can set multiple headers, e.g. '"Cookie","name=value","Authorization","xxx"'. - ### Interactive configuration + Properties: - Run rclone config: ``` No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> Hasher1 Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / Handle checksums for other remotes  "hasher" [snip] Storage> hasher Remote to cache checksums for, like myremote:mypath. Enter a string value. Press Enter for the default (""). remote> myRemote:path Comma - separated list of supported checksum types. Enter a string value. Press Enter for the default ("md5,sha1"). hashsums> md5 Maximum time to keep checksums in cache. 0 = no cache, off = cache forever. max_age> off Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + - Config: headers + - Env Var: RCLONE_HTTP_HEADERS + - Type: CommaSepList + - Default: -[Hasher1] type = hasher remote = myRemote:path hashsums = md5 max_age = -off -------------------- y) Yes this is OK e) Edit this remote d) Delete -this remote y/e/d> y + #### --http-no-slash + Set this if the site doesn't end directories with /. - ### Manual configuration + Use this if your target website does not use / on the end of + directories. - Run `rclone config path` to see the path of current active config file, - usually `YOURHOME/.config/rclone/rclone.conf`. - Open it in your favorite text editor, find section for the base remote - and create new section for hasher like in the following examples: + A / on the end of a path is how rclone normally tells the difference + between files and directories. If this flag is set, then rclone will + treat all files with Content-Type: text/html as directories and read + URLs from them rather than downloading them. -[Hasher1] type = hasher remote = myRemote:path hashes = md5 max_age = -off + Note that this may cause rclone to confuse genuine HTML files with + directories. -[Hasher2] type = hasher remote = /local/path hashes = dropbox,sha1 -max_age = 24h + Properties: + - Config: no_slash + - Env Var: RCLONE_HTTP_NO_SLASH + - Type: bool + - Default: false - Hasher takes basically the following parameters: - - `remote` is required, - - `hashes` is a comma separated list of supported checksums - (by default `md5,sha1`), - - `max_age` - maximum time to keep a checksum value in the cache, - `0` will disable caching completely, - `off` will cache "forever" (that is until the files get changed). + #### --http-no-head - Make sure the `remote` has `:` (colon) in. If you specify the remote without - a colon then rclone will use a local directory of that name. So if you use - a remote of `/local/path` then rclone will handle hashes for that directory. - If you use `remote = name` literally then rclone will put files - **in a directory called `name` located under current directory**. + Don't use HEAD requests. - ## Usage + HEAD requests are mainly used to find file sizes in dir listing. + If your site is being very slow to load then you can try this option. + Normally rclone does a HEAD request for each potential file in a + directory listing to: - ### Basic operations + - find its size + - check it really exists + - check to see if it is a directory - Now you can use it as `Hasher2:subdir/file` instead of base remote. - Hasher will transparently update cache with new checksums when a file - is fully read or overwritten, like: + If you set this option, rclone will not do the HEAD request. This will mean + that directory listings are much quicker, but rclone won't have the times or + sizes of any files, and some files that don't exist may be in the listing. -rclone copy External:path/file Hasher:dest/path + Properties: -rclone cat Hasher:path/to/file > /dev/null + - Config: no_head + - Env Var: RCLONE_HTTP_NO_HEAD + - Type: bool + - Default: false + ## Backend commands - The way to refresh **all** cached checksums (even unsupported by the base backend) - for a subtree is to **re-download** all files in the subtree. For example, - use `hashsum --download` using **any** supported hashsum on the command line - (we just care to re-read): + Here are the commands specific to the http backend. -rclone hashsum MD5 --download Hasher:path/to/subtree > /dev/null + Run them with -rclone backend dump Hasher:path/to/subtree + rclone backend COMMAND remote: + The help below will explain what arguments each command takes. - You can print or drop hashsum cache using custom backend commands: + See the [backend](https://rclone.org/commands/rclone_backend/) command for more + info on how to pass options and arguments. -rclone backend dump Hasher:dir/subdir + These can be run on a running backend using the rc command + [backend/command](https://rclone.org/rc/#backend-command). -rclone backend drop Hasher: + ### set + Set command for updating the config parameters. - ### Pre-Seed from a SUM File + rclone backend set remote: [options] [+] - Hasher supports two backend commands: generic SUM file `import` and faster - but less consistent `stickyimport`. + This set command can be used to update the config parameters + for a running http backend. -rclone backend import Hasher:dir/subdir SHA1 /path/to/SHA1SUM -[--checkers 4] + Usage Examples: + rclone backend set remote: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=remote: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=remote: -o url=https://example.com - Instead of SHA1 it can be any hash supported by the remote. The last argument - can point to either a local or an `other-remote:path` text file in SUM format. - The command will parse the SUM file, then walk down the path given by the - first argument, snapshot current fingerprints and fill in the cache entries - correspondingly. - - Paths in the SUM file are treated as relative to `hasher:dir/subdir`. - - The command will **not** check that supplied values are correct. - You **must know** what you are doing. - - This is a one-time action. The SUM file will not get "attached" to the - remote. Cache entries can still be overwritten later, should the object's - fingerprint change. - - The tree walk can take long depending on the tree size. You can increase - `--checkers` to make it faster. Or use `stickyimport` if you don't care - about fingerprints and consistency. + The option keys are named as they are in the config file. -rclone backend stickyimport hasher:path/to/data sha1 -remote:/path/to/sum.sha1 + This rebuilds the connection to the http backend when it is called with + the new parameters. Only new parameters need be passed as the values + will default to those currently in use. + It doesn't return anything. - `stickyimport` is similar to `import` but works much faster because it - does not need to stat existing files and skips initial tree walk. - Instead of binding cache entries to file fingerprints it creates _sticky_ - entries bound to the file name alone ignoring size, modification time etc. - Such hash entries can be replaced only by `purge`, `delete`, `backend drop` - or by full re-read/re-write of the files. - ## Configuration reference - ### Standard options + ## Limitations - Here are the Standard options specific to hasher (Better checksums for other remotes). + `rclone about` is not supported by the HTTP backend. Backends without + this capability cannot determine free space for an rclone mount or + use policy `mfs` (most free space) as a member of an rclone union + remote. - #### --hasher-remote + See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) - Remote to cache checksums for (e.g. myRemote:path). + # ImageKit + This is a backend for the [ImageKit.io](https://imagekit.io/) storage service. - Properties: + #### About ImageKit + [ImageKit.io](https://imagekit.io/) provides real-time image and video optimizations, transformations, and CDN delivery. Over 1,000 businesses and 70,000 developers trust ImageKit with their images and videos on the web. - - Config: remote - - Env Var: RCLONE_HASHER_REMOTE - - Type: string - - Required: true - #### --hasher-hashes + #### Accounts & Pricing - Comma separated list of supported checksum types. + To use this backend, you need to [create an account](https://imagekit.io/registration/) on ImageKit. Start with a free plan with generous usage limits. Then, as your requirements grow, upgrade to a plan that best fits your needs. See [the pricing details](https://imagekit.io/plans). - Properties: + ## Configuration - - Config: hashes - - Env Var: RCLONE_HASHER_HASHES - - Type: CommaSepList - - Default: md5,sha1 + Here is an example of making an imagekit configuration. - #### --hasher-max-age + Firstly create a [ImageKit.io](https://imagekit.io/) account and choose a plan. - Maximum time to keep checksums in cache (0 = no cache, off = cache forever). + You will need to log in and get the `publicKey` and `privateKey` for your account from the developer section. - Properties: + Now run - - Config: max_age - - Env Var: RCLONE_HASHER_MAX_AGE - - Type: Duration - - Default: off +rclone config - ### Advanced options - Here are the Advanced options specific to hasher (Better checksums for other remotes). + This will guide you through an interactive setup process: - #### --hasher-auto-size +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n - Auto-update checksum for files smaller than this size (disabled by default). +Enter the name for the new remote. name> imagekit-media-library - Properties: +Option Storage. Type of storage to configure. Choose a number from +below, or type in your own value. [snip] XX / ImageKit.io  (imagekit) +[snip] Storage> imagekit - - Config: auto_size - - Env Var: RCLONE_HASHER_AUTO_SIZE - - Type: SizeSuffix - - Default: 0 +Option endpoint. You can find your ImageKit.io URL endpoint in your +dashboard Enter a value. endpoint> https://ik.imagekit.io/imagekit_id - ### Metadata +Option public_key. You can find your ImageKit.io public key in your +dashboard Enter a value. public_key> public_**************************** - Any metadata supported by the underlying remote is read and written. +Option private_key. You can find your ImageKit.io private key in your +dashboard Enter a value. private_key> +private_**************************** - See the [metadata](https://rclone.org/docs/#metadata) docs for more info. +Edit advanced config? y) Yes n) No (default) y/n> n - ## Backend commands +Configuration complete. Options: - type: imagekit - endpoint: +https://ik.imagekit.io/imagekit_id - public_key: +public_**************************** - private_key: +private_**************************** - Here are the commands specific to the hasher backend. +Keep this "imagekit-media-library" remote? y) Yes this is OK (default) +e) Edit this remote d) Delete this remote y/e/d> y - Run them with + List directories in the top level of your Media Library - rclone backend COMMAND remote: +rclone lsd imagekit-media-library: - The help below will explain what arguments each command takes. + Make a new directory. - See the [backend](https://rclone.org/commands/rclone_backend/) command for more - info on how to pass options and arguments. +rclone mkdir imagekit-media-library:directory - These can be run on a running backend using the rc command - [backend/command](https://rclone.org/rc/#backend-command). + List the contents of a directory. - ### drop +rclone ls imagekit-media-library:directory - Drop cache - rclone backend drop remote: [options] [+] + ### Modified time and hashes - Completely drop checksum cache. - Usage Example: - rclone backend drop hasher: + ImageKit does not support modification times or hashes yet. + ### Checksums - ### dump + No checksums are supported. - Dump the database - rclone backend dump remote: [options] [+] + ### Standard options - Dump cache records covered by the current remote + Here are the Standard options specific to imagekit (ImageKit.io). - ### fulldump + #### --imagekit-endpoint - Full dump of the database + You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) - rclone backend fulldump remote: [options] [+] + Properties: - Dump all cache records in the database + - Config: endpoint + - Env Var: RCLONE_IMAGEKIT_ENDPOINT + - Type: string + - Required: true - ### import + #### --imagekit-public-key - Import a SUM file + You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) - rclone backend import remote: [options] [+] + Properties: - Amend hash cache from a SUM file and bind checksums to files by size/time. - Usage Example: - rclone backend import hasher:subdir md5 /path/to/sum.md5 + - Config: public_key + - Env Var: RCLONE_IMAGEKIT_PUBLIC_KEY + - Type: string + - Required: true + #### --imagekit-private-key - ### stickyimport + You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) - Perform fast import of a SUM file + Properties: - rclone backend stickyimport remote: [options] [+] + - Config: private_key + - Env Var: RCLONE_IMAGEKIT_PRIVATE_KEY + - Type: string + - Required: true - Fill hash cache from a SUM file without verifying file fingerprints. - Usage Example: - rclone backend stickyimport hasher:subdir md5 remote:path/to/sum.md5 + ### Advanced options + Here are the Advanced options specific to imagekit (ImageKit.io). + #### --imagekit-only-signed + If you have configured `Restrict unsigned image URLs` in your dashboard settings, set this to true. - ## Implementation details (advanced) + Properties: - This section explains how various rclone operations work on a hasher remote. + - Config: only_signed + - Env Var: RCLONE_IMAGEKIT_ONLY_SIGNED + - Type: bool + - Default: false - **Disclaimer. This section describes current implementation which can - change in future rclone versions!.** + #### --imagekit-versions - ### Hashsum command + Include old versions in directory listings. - The `rclone hashsum` (or `md5sum` or `sha1sum`) command will: + Properties: - 1. if requested hash is supported by lower level, just pass it. - 2. if object size is below `auto_size` then download object and calculate - _requested_ hashes on the fly. - 3. if unsupported and the size is big enough, build object `fingerprint` - (including size, modtime if supported, first-found _other_ hash if any). - 4. if the strict match is found in cache for the requested remote, return - the stored hash. - 5. if remote found but fingerprint mismatched, then purge the entry and - proceed to step 6. - 6. if remote not found or had no requested hash type or after step 5: - download object, calculate all _supported_ hashes on the fly and store - in cache; return requested hash. + - Config: versions + - Env Var: RCLONE_IMAGEKIT_VERSIONS + - Type: bool + - Default: false - ### Other operations + #### --imagekit-upload-tags - - whenever a file is uploaded or downloaded **in full**, capture the stream - to calculate all supported hashes on the fly and update database - - server-side `move` will update keys of existing cache entries - - `deletefile` will remove a single cache entry - - `purge` will remove all cache entries under the purged path + Tags to add to the uploaded files, e.g. "tag1,tag2". - Note that setting `max_age = 0` will disable checksum caching completely. + Properties: - If you set `max_age = off`, checksums in cache will never age, unless you - fully rewrite or delete the file. + - Config: upload_tags + - Env Var: RCLONE_IMAGEKIT_UPLOAD_TAGS + - Type: string + - Required: false - ### Cache storage + #### --imagekit-encoding - Cached checksums are stored as `bolt` database files under rclone cache - directory, usually `~/.cache/rclone/kv/`. Databases are maintained - one per _base_ backend, named like `BaseRemote~hasher.bolt`. - Checksums for multiple `alias`-es into a single base backend - will be stored in the single database. All local paths are treated as - aliases into the `local` backend (unless encrypted or chunked) and stored - in `~/.cache/rclone/kv/local~hasher.bolt`. - Databases can be shared between multiple rclone processes. + The encoding for the backend. - # HDFS + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. - [HDFS](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html) is a - distributed file-system, part of the [Apache Hadoop](https://hadoop.apache.org/) framework. + Properties: - Paths are specified as `remote:` or `remote:path/to/dir`. + - Config: encoding + - Env Var: RCLONE_IMAGEKIT_ENCODING + - Type: Encoding + - Default: Slash,LtGt,DoubleQuote,Dollar,Question,Hash,Percent,BackSlash,Del,Ctl,InvalidUtf8,Dot,SquareBracket - ## Configuration + ### Metadata - Here is an example of how to make a remote called `remote`. First run: + Any metadata supported by the underlying remote is read and written. - rclone config + Here are the possible system metadata items for the imagekit backend. - This will guide you through an interactive setup process: + | Name | Help | Type | Example | Read Only | + |------|------|------|---------|-----------| + | aws-tags | AI generated tags by AWS Rekognition associated with the image | string | tag1,tag2 | **Y** | + | btime | Time of file birth (creation) read from Last-Modified header | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** | + | custom-coordinates | Custom coordinates of the file | string | 0,0,100,100 | **Y** | + | file-type | Type of the file | string | image | **Y** | + | google-tags | AI generated tags by Google Cloud Vision associated with the image | string | tag1,tag2 | **Y** | + | has-alpha | Whether the image has alpha channel or not | bool | | **Y** | + | height | Height of the image or video in pixels | int | | **Y** | + | is-private-file | Whether the file is private or not | bool | | **Y** | + | size | Size of the object in bytes | int64 | | **Y** | + | tags | Tags associated with the file | string | tag1,tag2 | **Y** | + | width | Width of the image or video in pixels | int | | **Y** | -No remotes found, make a new one? n) New remote s) Set configuration -password q) Quit config n/s/q> n name> remote Type of storage to -configure. Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value [skip] XX / Hadoop -distributed file system  "hdfs" [skip] Storage> hdfs ** See help for -hdfs backend at: https://rclone.org/hdfs/ ** + See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -hadoop name node and port Enter a string value. Press Enter for the -default (""). Choose a number from below, or type in your own value 1 / -Connect to host namenode at port 8020  "namenode:8020" namenode> -namenode.hadoop:8020 hadoop user name Enter a string value. Press Enter -for the default (""). Choose a number from below, or type in your own -value 1 / Connect to hdfs as root  "root" username> root Edit advanced -config? (y/n) y) Yes n) No (default) y/n> n Remote config --------------------- [remote] type = hdfs namenode = -namenode.hadoop:8020 username = root -------------------- y) Yes this is -OK (default) e) Edit this remote d) Delete this remote y/e/d> y Current -remotes: -Name Type ==== ==== hadoop hdfs -e) Edit existing remote -f) New remote -g) Delete remote -h) Rename remote -i) Copy remote -j) Set configuration password -k) Quit config e/n/d/r/c/s/q> q + # Internet Archive + The Internet Archive backend utilizes Items on [archive.org](https://archive.org/) - This remote is called `remote` and can now be used like this + Refer to [IAS3 API documentation](https://archive.org/services/docs/api/ias3.html) for the API this backend uses. - See all the top level directories + Paths are specified as `remote:bucket` (or `remote:` for the `lsd` + command.) You may put subdirectories in too, e.g. `remote:item/path/to/dir`. - rclone lsd remote: + Unlike S3, listing up all items uploaded by you isn't supported. - List the contents of a directory + Once you have made a remote, you can use it like this: - rclone ls remote:directory + Make a new item - Sync the remote `directory` to `/home/local/directory`, deleting any excess files. + rclone mkdir remote:item - rclone sync --interactive remote:directory /home/local/directory + List the contents of a item - ### Setting up your own HDFS instance for testing + rclone ls remote:item - You may start with a [manual setup](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/SingleCluster.html) - or use the docker image from the tests: + Sync `/home/local/directory` to the remote item, deleting any excess + files in the item. - If you want to build the docker image + rclone sync --interactive /home/local/directory remote:item -git clone https://github.com/rclone/rclone.git cd -rclone/fstest/testserver/images/test-hdfs docker build --rm -t -rclone/test-hdfs . + ## Notes + Because of Internet Archive's architecture, it enqueues write operations (and extra post-processings) in a per-item queue. You can check item's queue at https://catalogd.archive.org/history/item-name-here . Because of that, all uploads/deletes will not show up immediately and takes some time to be available. + The per-item queue is enqueued to an another queue, Item Deriver Queue. [You can check the status of Item Deriver Queue here.](https://catalogd.archive.org/catalog.php?whereami=1) This queue has a limit, and it may block you from uploading, or even deleting. You should avoid uploading a lot of small files for better behavior. + You can optionally wait for the server's processing to finish, by setting non-zero value to `wait_archive` key. + By making it wait, rclone can do normal file comparison. + Make sure to set a large enough value (e.g. `30m0s` for smaller files) as it can take a long time depending on server's queue. - Or you can just use the latest one pushed + ## About metadata + This backend supports setting, updating and reading metadata of each file. + The metadata will appear as file metadata on Internet Archive. + However, some fields are reserved by both Internet Archive and rclone. -docker run --rm --name "rclone-hdfs" -p 127.0.0.1:9866:9866 -p -127.0.0.1:8020:8020 --hostname "rclone-hdfs" rclone/test-hdfs + The following are reserved by Internet Archive: + - `name` + - `source` + - `size` + - `md5` + - `crc32` + - `sha1` + - `format` + - `old_version` + - `viruscheck` + - `summation` + Trying to set values to these keys is ignored with a warning. + Only setting `mtime` is an exception. Doing so make it the identical behavior as setting ModTime. - **NB** it need few seconds to startup. + rclone reserves all the keys starting with `rclone-`. Setting value for these keys will give you warnings, but values are set according to request. - For this docker image the remote needs to be configured like this: + If there are multiple values for a key, only the first one is returned. + This is a limitation of rclone, that supports one value per one key. + It can be triggered when you did a server-side copy. -[remote] type = hdfs namenode = 127.0.0.1:8020 username = root + Reading metadata will also provide custom (non-standard nor reserved) ones. + ## Filtering auto generated files - You can stop this image with `docker kill rclone-hdfs` (**NB** it does not use volumes, so all data - uploaded will be lost.) + The Internet Archive automatically creates metadata files after + upload. These can cause problems when doing an `rclone sync` as rclone + will try, and fail, to delete them. These metadata files are not + changeable, as they are created by the Internet Archive automatically. - ### Modified time + These auto-created files can be excluded from the sync using [metadata + filtering](https://rclone.org/filtering/#metadata). - Time accurate to 1 second is stored. + rclone sync ... --metadata-exclude "source=metadata" --metadata-exclude "format=Metadata" - ### Checksum + Which excludes from the sync any files which have the + `source=metadata` or `format=Metadata` flags which are added to + Internet Archive auto-created files. - No checksums are implemented. + ## Configuration - ### Usage information + Here is an example of making an internetarchive configuration. + Most applies to the other providers as well, any differences are described [below](#providers). - You can use the `rclone about remote:` command which will display filesystem size and current usage. + First run - ### Restricted filename characters + rclone config - In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) - the following characters are also replaced: + This will guide you through an interactive setup process. - | Character | Value | Replacement | - | --------- |:-----:|:-----------:| - | : | 0x3A | : | +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Option Storage. Type of +storage to configure. Choose a number from below, or type in your own +value. XX / InternetArchive Items  (internetarchive) Storage> +internetarchive Option access_key_id. IAS3 Access Key. Leave blank for +anonymous access. You can find one here: +https://archive.org/account/s3.php Enter a value. Press Enter to leave +empty. access_key_id> XXXX Option secret_access_key. IAS3 Secret Key +(password). Leave blank for anonymous access. Enter a value. Press Enter +to leave empty. secret_access_key> XXXX Edit advanced config? y) Yes n) +No (default) y/n> y Option endpoint. IAS3 Endpoint. Leave blank for +default value. Enter a string value. Press Enter for the default +(https://s3.us.archive.org). endpoint> Option front_endpoint. Host of +InternetArchive Frontend. Leave blank for default value. Enter a string +value. Press Enter for the default (https://archive.org). +front_endpoint> Option disable_checksum. Don't store MD5 checksum with +object metadata. Normally rclone will calculate the MD5 checksum of the +input before uploading it so it can ask the server to check the object +against checksum. This is great for data integrity checking but can +cause long delays for large files to start uploading. Enter a boolean +value (true or false). Press Enter for the default (true). +disable_checksum> true Option encoding. The encoding for the backend. +See the encoding section in the overview for more info. Enter a +encoder.MultiEncoder value. Press Enter for the default +(Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot). encoding> Edit +advanced config? y) Yes n) No (default) y/n> n -------------------- +[remote] type = internetarchive access_key_id = XXXX secret_access_key = +XXXX -------------------- y) Yes this is OK (default) e) Edit this +remote d) Delete this remote y/e/d> y - Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8). ### Standard options - Here are the Standard options specific to hdfs (Hadoop distributed file system). + Here are the Standard options specific to internetarchive (Internet Archive). - #### --hdfs-namenode + #### --internetarchive-access-key-id - Hadoop name node and port. + IAS3 Access Key. - E.g. "namenode:8020" to connect to host namenode at port 8020. + Leave blank for anonymous access. + You can find one here: https://archive.org/account/s3.php Properties: - - Config: namenode - - Env Var: RCLONE_HDFS_NAMENODE + - Config: access_key_id + - Env Var: RCLONE_INTERNETARCHIVE_ACCESS_KEY_ID - Type: string - - Required: true + - Required: false - #### --hdfs-username + #### --internetarchive-secret-access-key - Hadoop user name. + IAS3 Secret Key (password). + + Leave blank for anonymous access. Properties: - - Config: username - - Env Var: RCLONE_HDFS_USERNAME + - Config: secret_access_key + - Env Var: RCLONE_INTERNETARCHIVE_SECRET_ACCESS_KEY - Type: string - Required: false - - Examples: - - "root" - - Connect to hdfs as root. ### Advanced options - Here are the Advanced options specific to hdfs (Hadoop distributed file system). + Here are the Advanced options specific to internetarchive (Internet Archive). - #### --hdfs-service-principal-name + #### --internetarchive-endpoint - Kerberos service principal name for the namenode. + IAS3 Endpoint. - Enables KERBEROS authentication. Specifies the Service Principal Name - (SERVICE/FQDN) for the namenode. E.g. \"hdfs/namenode.hadoop.docker\" - for namenode running as service 'hdfs' with FQDN 'namenode.hadoop.docker'. + Leave blank for default value. Properties: - - Config: service_principal_name - - Env Var: RCLONE_HDFS_SERVICE_PRINCIPAL_NAME + - Config: endpoint + - Env Var: RCLONE_INTERNETARCHIVE_ENDPOINT - Type: string - - Required: false + - Default: "https://s3.us.archive.org" - #### --hdfs-data-transfer-protection + #### --internetarchive-front-endpoint - Kerberos data transfer protection: authentication|integrity|privacy. + Host of InternetArchive Frontend. - Specifies whether or not authentication, data signature integrity - checks, and wire encryption are required when communicating with - the datanodes. Possible values are 'authentication', 'integrity' - and 'privacy'. Used only with KERBEROS enabled. + Leave blank for default value. Properties: - - Config: data_transfer_protection - - Env Var: RCLONE_HDFS_DATA_TRANSFER_PROTECTION + - Config: front_endpoint + - Env Var: RCLONE_INTERNETARCHIVE_FRONT_ENDPOINT - Type: string - - Required: false - - Examples: - - "privacy" - - Ensure authentication, integrity and encryption enabled. + - Default: "https://archive.org" - #### --hdfs-encoding + #### --internetarchive-disable-checksum + + Don't ask the server to test against MD5 checksum calculated by rclone. + Normally rclone will calculate the MD5 checksum of the input before + uploading it so it can ask the server to check the object against checksum. + This is great for data integrity checking but can cause long delays for + large files to start uploading. + + Properties: + + - Config: disable_checksum + - Env Var: RCLONE_INTERNETARCHIVE_DISABLE_CHECKSUM + - Type: bool + - Default: true + + #### --internetarchive-wait-archive + + Timeout for waiting the server's processing tasks (specifically archive and book_op) to finish. + Only enable if you need to be guaranteed to be reflected after write operations. + 0 to disable waiting. No errors to be thrown in case of timeout. + + Properties: + + - Config: wait_archive + - Env Var: RCLONE_INTERNETARCHIVE_WAIT_ARCHIVE + - Type: Duration + - Default: 0s + + #### --internetarchive-encoding The encoding for the backend. @@ -33230,190 +34834,301 @@ docker run --rm --name "rclone-hdfs" -p 127.0.0.1:9866:9866 -p Properties: - Config: encoding - - Env Var: RCLONE_HDFS_ENCODING - - Type: MultiEncoder - - Default: Slash,Colon,Del,Ctl,InvalidUtf8,Dot + - Env Var: RCLONE_INTERNETARCHIVE_ENCODING + - Type: Encoding + - Default: Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot + ### Metadata + Metadata fields provided by Internet Archive. + If there are multiple values for a key, only the first one is returned. + This is a limitation of Rclone, that supports one value per one key. - ## Limitations + Owner is able to add custom keys. Metadata feature grabs all the keys including them. - - No server-side `Move` or `DirMove`. - - Checksums not implemented. + Here are the possible system metadata items for the internetarchive backend. - # HiDrive + | Name | Help | Type | Example | Read Only | + |------|------|------|---------|-----------| + | crc32 | CRC32 calculated by Internet Archive | string | 01234567 | **Y** | + | format | Name of format identified by Internet Archive | string | Comma-Separated Values | **Y** | + | md5 | MD5 hash calculated by Internet Archive | string | 01234567012345670123456701234567 | **Y** | + | mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | **Y** | + | name | Full file path, without the bucket part | filename | backend/internetarchive/internetarchive.go | **Y** | + | old_version | Whether the file was replaced and moved by keep-old-version flag | boolean | true | **Y** | + | rclone-ia-mtime | Time of last modification, managed by Internet Archive | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N | + | rclone-mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N | + | rclone-update-track | Random value used by Rclone for tracking changes inside Internet Archive | string | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | N | + | sha1 | SHA1 hash calculated by Internet Archive | string | 0123456701234567012345670123456701234567 | **Y** | + | size | File size in bytes | decimal number | 123456 | **Y** | + | source | The source of the file | string | original | **Y** | + | summation | Check https://forum.rclone.org/t/31922 for how it is used | string | md5 | **Y** | + | viruscheck | The last time viruscheck process was run for the file (?) | unixtime | 1654191352 | **Y** | + + See the [metadata](https://rclone.org/docs/#metadata) docs for more info. + + + + # Jottacloud + + Jottacloud is a cloud storage service provider from a Norwegian company, using its own datacenters + in Norway. In addition to the official service at [jottacloud.com](https://www.jottacloud.com/), + it also provides white-label solutions to different companies, such as: + * Telia + * Telia Cloud (cloud.telia.se) + * Telia Sky (sky.telia.no) + * Tele2 + * Tele2 Cloud (mittcloud.tele2.se) + * Onlime + * Onlime Cloud Storage (onlime.dk) + * Elkjøp (with subsidiaries): + * Elkjøp Cloud (cloud.elkjop.no) + * Elgiganten Sweden (cloud.elgiganten.se) + * Elgiganten Denmark (cloud.elgiganten.dk) + * Giganti Cloud (cloud.gigantti.fi) + * ELKO Cloud (cloud.elko.is) + + Most of the white-label versions are supported by this backend, although may require different + authentication setup - described below. Paths are specified as `remote:path` Paths may be as deep as required, e.g. `remote:directory/subdirectory`. - The initial setup for hidrive involves getting a token from HiDrive - which you need to do in your browser. - `rclone config` walks you through it. + ## Authentication types - ## Configuration + Some of the whitelabel versions uses a different authentication method than the official service, + and you have to choose the correct one when setting up the remote. - Here is an example of how to make a remote called `remote`. First run: + ### Standard authentication - rclone config + The standard authentication method used by the official service (jottacloud.com), as well as + some of the whitelabel services, requires you to generate a single-use personal login token + from the account security settings in the service's web interface. Log in to your account, + go to "Settings" and then "Security", or use the direct link presented to you by rclone when + configuring the remote: . Scroll down to the section + "Personal login token", and click the "Generate" button. Note that if you are using a + whitelabel service you probably can't use the direct link, you need to find the same page in + their dedicated web interface, and also it may be in a different location than described above. - This will guide you through an interactive setup process: + To access your account from multiple instances of rclone, you need to configure each of them + with a separate personal login token. E.g. you create a Jottacloud remote with rclone in one + location, and copy the configuration file to a second location where you also want to run + rclone and access the same remote. Then you need to replace the token for one of them, using + the [config reconnect](https://rclone.org/commands/rclone_config_reconnect/) command, which + requires you to generate a new personal login token and supply as input. If you do not + do this, the token may easily end up being invalidated, resulting in both instances failing + with an error message something along the lines of: -No remotes found - make a new one n) New remote s) Set configuration -password q) Quit config n/s/q> n name> remote Type of storage to -configure. Choose a number from below, or type in your own value [snip] -XX / HiDrive  "hidrive" [snip] Storage> hidrive OAuth Client Id - Leave -blank normally. client_id> OAuth Client Secret - Leave blank normally. -client_secret> Access permissions that rclone should use when requesting -access from HiDrive. Leave blank normally. scope_access> Edit advanced -config? y/n> n Use web browser to automatically authenticate rclone with -remote? * Say Y if the machine running rclone has a web browser you can -use * Say N if running rclone on a (remote) machine without web browser -access If not sure try Y. If Y failed, try N. y/n> y If your browser -doesn't open automatically go to the following link: -http://127.0.0.1:53682/auth?state=xxxxxxxxxxxxxxxxxxxxxx Log in and -authorize rclone for access Waiting for code... Got code --------------------- [remote] type = hidrive token = -{"access_token":"xxxxxxxxxxxxxxxxxxxx","token_type":"Bearer","refresh_token":"xxxxxxxxxxxxxxxxxxxxxxx","expiry":"xxxxxxxxxxxxxxxxxxxxxxx"} --------------------- y) Yes this is OK (default) e) Edit this remote d) -Delete this remote y/e/d> y + oauth2: cannot fetch token: 400 Bad Request + Response: {"error":"invalid_grant","error_description":"Stale token"} + When this happens, you need to replace the token as described above to be able to use your + remote again. - **You should be aware that OAuth-tokens can be used to access your account - and hence should not be shared with other persons.** - See the [below section](#keeping-your-tokens-safe) for more information. + All personal login tokens you have taken into use will be listed in the web interface under + "My logged in devices", and from the right side of that list you can click the "X" button to + revoke individual tokens. - See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a - machine with no Internet browser available. + ### Legacy authentication - Note that rclone runs a webserver on your local machine to collect the - token as returned from HiDrive. This only runs from the moment it opens - your browser to the moment you get back the verification code. - The webserver runs on `http://127.0.0.1:53682/`. - If local port `53682` is protected by a firewall you may need to temporarily - unblock the firewall to complete authorization. + If you are using one of the whitelabel versions (e.g. from Elkjøp) you may not have the option + to generate a CLI token. In this case you'll have to use the legacy authentication. To do this select + yes when the setup asks for legacy authentication and enter your username and password. + The rest of the setup is identical to the default setup. - Once configured you can then use `rclone` like this, + ### Telia Cloud authentication - List directories in top level of your HiDrive root folder + Similar to other whitelabel versions Telia Cloud doesn't offer the option of creating a CLI token, and + additionally uses a separate authentication flow where the username is generated internally. To setup + rclone to use Telia Cloud, choose Telia Cloud authentication in the setup. The rest of the setup is + identical to the default setup. - rclone lsd remote: + ### Tele2 Cloud authentication - List all the files in your HiDrive filesystem + As Tele2-Com Hem merger was completed this authentication can be used for former Com Hem Cloud and + Tele2 Cloud customers as no support for creating a CLI token exists, and additionally uses a separate + authentication flow where the username is generated internally. To setup rclone to use Tele2 Cloud, + choose Tele2 Cloud authentication in the setup. The rest of the setup is identical to the default setup. - rclone ls remote: + ### Onlime Cloud Storage authentication - To copy a local directory to a HiDrive directory called backup + Onlime has sold access to Jottacloud proper, while providing localized support to Danish Customers, but + have recently set up their own hosting, transferring their customers from Jottacloud servers to their + own ones. - rclone copy /home/source remote:backup + This, of course, necessitates using their servers for authentication, but otherwise functionality and + architecture seems equivalent to Jottacloud. - ### Keeping your tokens safe + To setup rclone to use Onlime Cloud Storage, choose Onlime Cloud authentication in the setup. The rest + of the setup is identical to the default setup. - Any OAuth-tokens will be stored by rclone in the remote's configuration file as unencrypted text. - Anyone can use a valid refresh-token to access your HiDrive filesystem without knowing your password. - Therefore you should make sure no one else can access your configuration. + ## Configuration - It is possible to encrypt rclone's configuration file. - You can find information on securing your configuration file by viewing the [configuration encryption docs](https://rclone.org/docs/#configuration-encryption). + Here is an example of how to make a remote called `remote` with the default setup. First run: - ### Invalid refresh token + rclone config - As can be verified [here](https://developer.hidrive.com/basics-flows/), - each `refresh_token` (for Native Applications) is valid for 60 days. - If used to access HiDrivei, its validity will be automatically extended. + This will guide you through an interactive setup process: - This means that if you +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Option Storage. Type of +storage to configure. Choose a number from below, or type in your own +value. [snip] XX / Jottacloud  (jottacloud) [snip] Storage> jottacloud +Edit advanced config? y) Yes n) No (default) y/n> n Option config_type. +Select authentication type. Choose a number from below, or type in an +existing string value. Press Enter for the default (standard). / +Standard authentication. 1 | Use this if you're a normal Jottacloud +user.  (standard) / Legacy authentication. 2 | This is only required for +certain whitelabel versions of Jottacloud and not recommended for normal +users.  (legacy) / Telia Cloud authentication. 3 | Use this if you are +using Telia Cloud.  (telia) / Tele2 Cloud authentication. 4 | Use this +if you are using Tele2 Cloud.  (tele2) / Onlime Cloud authentication. 5 +| Use this if you are using Onlime Cloud.  (onlime) config_type> 1 +Personal login token. Generate here: +https://www.jottacloud.com/web/secure Login Token> Use a non-standard +device/mountpoint? Choosing no, the default, will let you access the +storage used for the archive section of the official Jottacloud client. +If you instead want to access the sync or the backup section, for +example, you must choose yes. y) Yes n) No (default) y/n> y Option +config_device. The device to use. In standard setup the built-in Jotta +device is used, which contains predefined mountpoints for archive, sync +etc. All other devices are treated as backup devices by the official +Jottacloud client. You may create a new by entering a unique name. +Choose a number from below, or type in your own string value. Press +Enter for the default (DESKTOP-3H31129). 1 > DESKTOP-3H31129 2 > Jotta +config_device> 2 Option config_mountpoint. The mountpoint to use for the +built-in device Jotta. The standard setup is to use the Archive +mountpoint. Most other mountpoints have very limited support in rclone +and should generally be avoided. Choose a number from below, or type in +an existing string value. Press Enter for the default (Archive). 1 > +Archive 2 > Shared 3 > Sync config_mountpoint> 1 -------------------- +[remote] type = jottacloud configVersion = 1 client_id = jottacli +client_secret = tokenURL = +https://id.jottacloud.com/auth/realms/jottacloud/protocol/openid-connect/token +token = {........} username = 2940e57271a93d987d6f8a21 device = Jotta +mountpoint = Archive -------------------- y) Yes this is OK (default) e) +Edit this remote d) Delete this remote y/e/d> y - * Don't use the HiDrive remote for 60 days - then rclone will return an error which includes a text - that implies the refresh token is *invalid* or *expired*. + Once configured you can then use `rclone` like this, - To fix this you will need to authorize rclone to access your HiDrive account again. + List directories in top level of your Jottacloud - Using + rclone lsd remote: - rclone config reconnect remote: + List all the files in your Jottacloud - the process is very similar to the process of initial setup exemplified before. + rclone ls remote: + + To copy a local directory to an Jottacloud directory called backup - ### Modified time and hashes + rclone copy /home/source remote:backup - HiDrive allows modification times to be set on objects accurate to 1 second. + ### Devices and Mountpoints - HiDrive supports [its own hash type](https://static.hidrive.com/dev/0001) - which is used to verify the integrity of file contents after successful transfers. + The official Jottacloud client registers a device for each computer you install + it on, and shows them in the backup section of the user interface. For each + folder you select for backup it will create a mountpoint within this device. + A built-in device called Jotta is special, and contains mountpoints Archive, + Sync and some others, used for corresponding features in official clients. - ### Restricted filename characters + With rclone you'll want to use the standard Jotta/Archive device/mountpoint in + most cases. However, you may for example want to access files from the sync or + backup functionality provided by the official clients, and rclone therefore + provides the option to select other devices and mountpoints during config. - HiDrive cannot store files or folders that include - `/` (0x2F) or null-bytes (0x00) in their name. - Any other characters can be used in the names of files or folders. - Additionally, files or folders cannot be named either of the following: `.` or `..` + You are allowed to create new devices and mountpoints. All devices except the + built-in Jotta device are treated as backup devices by official Jottacloud + clients, and the mountpoints on them are individual backup sets. - Therefore rclone will automatically replace these characters, - if files or folders are stored or accessed with such names. + With the built-in Jotta device, only existing, built-in, mountpoints can be + selected. In addition to the mentioned Archive and Sync, it may contain + several other mountpoints such as: Latest, Links, Shared and Trash. All of + these are special mountpoints with a different internal representation than + the "regular" mountpoints. Rclone will only to a very limited degree support + them. Generally you should avoid these, unless you know what you are doing. - You can read about how this filename encoding works in general - [here](overview/#restricted-filenames). + ### --fast-list - Keep in mind that HiDrive only supports file or folder names - with a length of 255 characters or less. + This backend supports `--fast-list` which allows you to use fewer + transactions in exchange for more memory. See the [rclone + docs](https://rclone.org/docs/#fast-list) for more details. - ### Transfers + Note that the implementation in Jottacloud always uses only a single + API request to get the entire list, so for large folders this could + lead to long wait time before the first results are shown. - HiDrive limits file sizes per single request to a maximum of 2 GiB. - To allow storage of larger files and allow for better upload performance, - the hidrive backend will use a chunked transfer for files larger than 96 MiB. - Rclone will upload multiple parts/chunks of the file at the same time. - Chunks in the process of being uploaded are buffered in memory, - so you may want to restrict this behaviour on systems with limited resources. + Note also that with rclone version 1.58 and newer, information about + [MIME types](https://rclone.org/overview/#mime-type) and metadata item [utime](#metadata) + are not available when using `--fast-list`. - You can customize this behaviour using the following options: + ### Modification times and hashes - * `chunk_size`: size of file parts - * `upload_cutoff`: files larger or equal to this in size will use a chunked transfer - * `upload_concurrency`: number of file-parts to upload at the same time + Jottacloud allows modification times to be set on objects accurate to 1 + second. These will be used to detect whether objects need syncing or + not. - See the below section about configuration options for more details. + Jottacloud supports MD5 type hashes, so you can use the `--checksum` + flag. - ### Root folder + Note that Jottacloud requires the MD5 hash before upload so if the + source does not have an MD5 checksum then the file will be cached + temporarily on disk (in location given by + [--temp-dir](https://rclone.org/docs/#temp-dir-dir)) before it is uploaded. + Small files will be cached in memory - see the + [--jottacloud-md5-memory-limit](#jottacloud-md5-memory-limit) flag. + When uploading from local disk the source checksum is always available, + so this does not apply. Starting with rclone version 1.52 the same is + true for encrypted remotes (in older versions the crypt backend would not + calculate hashes for uploads from local disk, so the Jottacloud + backend had to do it as described above). - You can set the root folder for rclone. - This is the directory that rclone considers to be the root of your HiDrive. + ### Restricted filename characters - Usually, you will leave this blank, and rclone will use the root of the account. + In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) + the following characters are also replaced: - However, you can set this to restrict rclone to a specific folder hierarchy. + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | " | 0x22 | " | + | * | 0x2A | * | + | : | 0x3A | : | + | < | 0x3C | < | + | > | 0x3E | > | + | ? | 0x3F | ? | + | \| | 0x7C | | | - This works by prepending the contents of the `root_prefix` option - to any paths accessed by rclone. - For example, the following two ways to access the home directory are equivalent: + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in XML strings. - rclone lsd --hidrive-root-prefix="/users/test/" remote:path + ### Deleting files - rclone lsd remote:/users/test/path + By default, rclone will send all files to the trash when deleting files. They will be permanently + deleted automatically after 30 days. You may bypass the trash and permanently delete files immediately + by using the [--jottacloud-hard-delete](#jottacloud-hard-delete) flag, or set the equivalent environment variable. + Emptying the trash is supported by the [cleanup](https://rclone.org/commands/rclone_cleanup/) command. - See the below section about configuration options for more details. + ### Versions - ### Directory member count + Jottacloud supports file versioning. When rclone uploads a new version of a file it creates a new version of it. + Currently rclone only supports retrieving the current version but older versions can be accessed via the Jottacloud Website. - By default, rclone will know the number of directory members contained in a directory. - For example, `rclone lsd` uses this information. + Versioning can be disabled by `--jottacloud-no-versions` option. This is achieved by deleting the remote file prior to uploading + a new version. If the upload the fails no version of the file will be available in the remote. - The acquisition of this information will result in additional time costs for HiDrive's API. - When dealing with large directory structures, it may be desirable to circumvent this time cost, - especially when this information is not explicitly needed. - For this, the `disable_fetching_member_count` option can be used. + ### Quota information - See the below section about configuration options for more details. + To view your current quota you can use the `rclone about remote:` + command which will display your usage limit (unless it is unlimited) + and the current usage. ### Standard options - Here are the Standard options specific to hidrive (HiDrive). + Here are the Standard options specific to jottacloud (Jottacloud). - #### --hidrive-client-id + #### --jottacloud-client-id OAuth Client Id. @@ -33422,11 +35137,11 @@ Delete this remote y/e/d> y Properties: - Config: client_id - - Env Var: RCLONE_HIDRIVE_CLIENT_ID + - Env Var: RCLONE_JOTTACLOUD_CLIENT_ID - Type: string - Required: false - #### --hidrive-client-secret + #### --jottacloud-client-secret OAuth Client Secret. @@ -33435,42 +35150,26 @@ Delete this remote y/e/d> y Properties: - Config: client_secret - - Env Var: RCLONE_HIDRIVE_CLIENT_SECRET + - Env Var: RCLONE_JOTTACLOUD_CLIENT_SECRET - Type: string - Required: false - #### --hidrive-scope-access - - Access permissions that rclone should use when requesting access from HiDrive. - - Properties: - - - Config: scope_access - - Env Var: RCLONE_HIDRIVE_SCOPE_ACCESS - - Type: string - - Default: "rw" - - Examples: - - "rw" - - Read and write access to resources. - - "ro" - - Read-only access to resources. - ### Advanced options - Here are the Advanced options specific to hidrive (HiDrive). + Here are the Advanced options specific to jottacloud (Jottacloud). - #### --hidrive-token + #### --jottacloud-token OAuth Access Token as a JSON blob. Properties: - Config: token - - Env Var: RCLONE_HIDRIVE_TOKEN + - Env Var: RCLONE_JOTTACLOUD_TOKEN - Type: string - Required: false - #### --hidrive-auth-url + #### --jottacloud-auth-url Auth server URL. @@ -33479,11 +35178,11 @@ Delete this remote y/e/d> y Properties: - Config: auth_url - - Env Var: RCLONE_HIDRIVE_AUTH_URL + - Env Var: RCLONE_JOTTACLOUD_AUTH_URL - Type: string - Required: false - #### --hidrive-token-url + #### --jottacloud-token-url Token server url. @@ -33492,134 +35191,68 @@ Delete this remote y/e/d> y Properties: - Config: token_url - - Env Var: RCLONE_HIDRIVE_TOKEN_URL + - Env Var: RCLONE_JOTTACLOUD_TOKEN_URL - Type: string - Required: false - #### --hidrive-scope-role - - User-level that rclone should use when requesting access from HiDrive. - - Properties: - - - Config: scope_role - - Env Var: RCLONE_HIDRIVE_SCOPE_ROLE - - Type: string - - Default: "user" - - Examples: - - "user" - - User-level access to management permissions. - - This will be sufficient in most cases. - - "admin" - - Extensive access to management permissions. - - "owner" - - Full access to management permissions. - - #### --hidrive-root-prefix - - The root/parent folder for all paths. - - Fill in to use the specified folder as the parent for all paths given to the remote. - This way rclone can use any folder as its starting point. - - Properties: - - - Config: root_prefix - - Env Var: RCLONE_HIDRIVE_ROOT_PREFIX - - Type: string - - Default: "/" - - Examples: - - "/" - - The topmost directory accessible by rclone. - - This will be equivalent with "root" if rclone uses a regular HiDrive user account. - - "root" - - The topmost directory of the HiDrive user account - - "" - - This specifies that there is no root-prefix for your paths. - - When using this you will always need to specify paths to this remote with a valid parent e.g. "remote:/path/to/dir" or "remote:root/path/to/dir". - - #### --hidrive-endpoint - - Endpoint for the service. + #### --jottacloud-md5-memory-limit - This is the URL that API-calls will be made to. + Files bigger than this will be cached on disk to calculate the MD5 if required. Properties: - - Config: endpoint - - Env Var: RCLONE_HIDRIVE_ENDPOINT - - Type: string - - Default: "https://api.hidrive.strato.com/2.1" + - Config: md5_memory_limit + - Env Var: RCLONE_JOTTACLOUD_MD5_MEMORY_LIMIT + - Type: SizeSuffix + - Default: 10Mi - #### --hidrive-disable-fetching-member-count + #### --jottacloud-trashed-only - Do not fetch number of objects in directories unless it is absolutely necessary. + Only show files that are in the trash. - Requests may be faster if the number of objects in subdirectories is not fetched. + This will show trashed files in their original directory structure. Properties: - - Config: disable_fetching_member_count - - Env Var: RCLONE_HIDRIVE_DISABLE_FETCHING_MEMBER_COUNT + - Config: trashed_only + - Env Var: RCLONE_JOTTACLOUD_TRASHED_ONLY - Type: bool - Default: false - #### --hidrive-chunk-size - - Chunksize for chunked uploads. - - Any files larger than the configured cutoff (or files of unknown size) will be uploaded in chunks of this size. - - The upper limit for this is 2147483647 bytes (about 2.000Gi). - That is the maximum amount of bytes a single upload-operation will support. - Setting this above the upper limit or to a negative value will cause uploads to fail. + #### --jottacloud-hard-delete - Setting this to larger values may increase the upload speed at the cost of using more memory. - It can be set to smaller values smaller to save on memory. + Delete files permanently rather than putting them into the trash. Properties: - - Config: chunk_size - - Env Var: RCLONE_HIDRIVE_CHUNK_SIZE - - Type: SizeSuffix - - Default: 48Mi - - #### --hidrive-upload-cutoff - - Cutoff/Threshold for chunked uploads. + - Config: hard_delete + - Env Var: RCLONE_JOTTACLOUD_HARD_DELETE + - Type: bool + - Default: false - Any files larger than this will be uploaded in chunks of the configured chunksize. + #### --jottacloud-upload-resume-limit - The upper limit for this is 2147483647 bytes (about 2.000Gi). - That is the maximum amount of bytes a single upload-operation will support. - Setting this above the upper limit will cause uploads to fail. + Files bigger than this can be resumed if the upload fail's. Properties: - - Config: upload_cutoff - - Env Var: RCLONE_HIDRIVE_UPLOAD_CUTOFF + - Config: upload_resume_limit + - Env Var: RCLONE_JOTTACLOUD_UPLOAD_RESUME_LIMIT - Type: SizeSuffix - - Default: 96Mi - - #### --hidrive-upload-concurrency - - Concurrency for chunked uploads. + - Default: 10Mi - This is the upper limit for how many transfers for the same file are running concurrently. - Setting this above to a value smaller than 1 will cause uploads to deadlock. + #### --jottacloud-no-versions - If you are uploading small numbers of large files over high-speed links - and these uploads do not fully utilize your bandwidth, then increasing - this may help to speed up the transfers. + Avoid server side versioning by deleting files and recreating files instead of overwriting them. Properties: - - Config: upload_concurrency - - Env Var: RCLONE_HIDRIVE_UPLOAD_CONCURRENCY - - Type: int - - Default: 4 + - Config: no_versions + - Env Var: RCLONE_JOTTACLOUD_NO_VERSIONS + - Type: bool + - Default: false - #### --hidrive-encoding + #### --jottacloud-encoding The encoding for the backend. @@ -33628,700 +35261,449 @@ Delete this remote y/e/d> y Properties: - Config: encoding - - Env Var: RCLONE_HIDRIVE_ENCODING - - Type: MultiEncoder - - Default: Slash,Dot + - Env Var: RCLONE_JOTTACLOUD_ENCODING + - Type: Encoding + - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot + ### Metadata + Jottacloud has limited support for metadata, currently an extended set of timestamps. - ## Limitations + Here are the possible system metadata items for the jottacloud backend. - ### Symbolic links + | Name | Help | Type | Example | Read Only | + |------|------|------|---------|-----------| + | btime | Time of file birth (creation), read from rclone metadata | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | N | + | content-type | MIME type, also known as media type | string | text/plain | **Y** | + | mtime | Time of last modification, read from rclone metadata | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | N | + | utime | Time of last upload, when current revision was created, generated by backend | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** | - HiDrive is able to store symbolic links (*symlinks*) by design, - for example, when unpacked from a zip archive. + See the [metadata](https://rclone.org/docs/#metadata) docs for more info. - There exists no direct mechanism to manage native symlinks in remotes. - As such this implementation has chosen to ignore any native symlinks present in the remote. - rclone will not be able to access or show any symlinks stored in the hidrive-remote. - This means symlinks cannot be individually removed, copied, or moved, - except when removing, copying, or moving the parent folder. - *This does not affect the `.rclonelink`-files - that rclone uses to encode and store symbolic links.* - ### Sparse files + ## Limitations - It is possible to store sparse files in HiDrive. + Note that Jottacloud is case insensitive so you can't have a file called + "Hello.doc" and one called "hello.doc". - Note that copying a sparse file will expand the holes - into null-byte (0x00) regions that will then consume disk space. - Likewise, when downloading a sparse file, - the resulting file will have null-byte regions in the place of file holes. + There are quite a few characters that can't be in Jottacloud file names. Rclone will map these names to and from an identical + looking unicode equivalent. For example if a file has a ? in it will be mapped to ? instead. - # HTTP + Jottacloud only supports filenames up to 255 characters in length. - The HTTP remote is a read only remote for reading files of a - webserver. The webserver should provide file listings which rclone - will read and turn into a remote. This has been tested with common - webservers such as Apache/Nginx/Caddy and will likely work with file - listings from most web servers. (If it doesn't then please file an - issue, or send a pull request!) + ## Troubleshooting - Paths are specified as `remote:` or `remote:path`. + Jottacloud exhibits some inconsistent behaviours regarding deleted files and folders which may cause Copy, Move and DirMove + operations to previously deleted paths to fail. Emptying the trash should help in such cases. - The `remote:` represents the configured [url](#http-url), and any path following - it will be resolved relative to this url, according to the URL standard. This - means with remote url `https://beta.rclone.org/branch` and path `fix`, the - resolved URL will be `https://beta.rclone.org/branch/fix`, while with path - `/fix` the resolved URL will be `https://beta.rclone.org/fix` as the absolute - path is resolved from the root of the domain. + # Koofr - If the path following the `remote:` ends with `/` it will be assumed to point - to a directory. If the path does not end with `/`, then a HEAD request is sent - and the response used to decide if it it is treated as a file or a directory - (run with `-vv` to see details). When [--http-no-head](#http-no-head) is - specified, a path without ending `/` is always assumed to be a file. If rclone - incorrectly assumes the path is a file, the solution is to specify the path with - ending `/`. When you know the path is a directory, ending it with `/` is always - better as it avoids the initial HEAD request. + Paths are specified as `remote:path` - To just download a single file it is easier to use - [copyurl](https://rclone.org/commands/rclone_copyurl/). + Paths may be as deep as required, e.g. `remote:directory/subdirectory`. ## Configuration - Here is an example of how to make a remote called `remote`. First - run: + The initial setup for Koofr involves creating an application password for + rclone. You can do that by opening the Koofr + [web application](https://app.koofr.net/app/admin/preferences/password), + giving the password a nice name like `rclone` and clicking on generate. + + Here is an example of how to make a remote called `koofr`. First run: rclone config This will guide you through an interactive setup process: No remotes found, make a new one? n) New remote s) Set configuration -password q) Quit config n/s/q> n name> remote Type of storage to -configure. Choose a number from below, or type in your own value [snip] -XX / HTTP  "http" [snip] Storage> http URL of http host to connect to -Choose a number from below, or type in your own value 1 / Connect to -example.com  "https://example.com" url> https://beta.rclone.org Remote -config -------------------- [remote] url = https://beta.rclone.org --------------------- y) Yes this is OK e) Edit this remote d) Delete -this remote y/e/d> y Current remotes: - -Name Type ==== ==== remote http - -e) Edit existing remote -f) New remote -g) Delete remote -h) Rename remote -i) Copy remote -j) Set configuration password -k) Quit config e/n/d/r/c/s/q> q - - - This remote is called `remote` and can now be used like this - - See all the top level directories - - rclone lsd remote: - - List the contents of a directory - - rclone ls remote:directory - - Sync the remote `directory` to `/home/local/directory`, deleting any excess files. - - rclone sync --interactive remote:directory /home/local/directory - - ### Read only - - This remote is read only - you can't upload files to an HTTP server. - - ### Modified time - - Most HTTP servers store time accurate to 1 second. - - ### Checksum - - No checksums are stored. - - ### Usage without a config file - - Since the http remote only has one config parameter it is easy to use - without a config file: - - rclone lsd --http-url https://beta.rclone.org :http: - - or: - - rclone lsd :http,url='https://beta.rclone.org': - - - ### Standard options - - Here are the Standard options specific to http (HTTP). - - #### --http-url - - URL of HTTP host to connect to. - - E.g. "https://example.com", or "https://user:pass@example.com" to use a username and password. - - Properties: - - - Config: url - - Env Var: RCLONE_HTTP_URL - - Type: string - - Required: true - - ### Advanced options - - Here are the Advanced options specific to http (HTTP). - - #### --http-headers - - Set HTTP headers for all transactions. - - Use this to set additional HTTP headers for all transactions. - - The input format is comma separated list of key,value pairs. Standard - [CSV encoding](https://godoc.org/encoding/csv) may be used. - - For example, to set a Cookie use 'Cookie,name=value', or '"Cookie","name=value"'. - - You can set multiple headers, e.g. '"Cookie","name=value","Authorization","xxx"'. - - Properties: - - - Config: headers - - Env Var: RCLONE_HTTP_HEADERS - - Type: CommaSepList - - Default: - - #### --http-no-slash - - Set this if the site doesn't end directories with /. - - Use this if your target website does not use / on the end of - directories. - - A / on the end of a path is how rclone normally tells the difference - between files and directories. If this flag is set, then rclone will - treat all files with Content-Type: text/html as directories and read - URLs from them rather than downloading them. - - Note that this may cause rclone to confuse genuine HTML files with - directories. - - Properties: - - - Config: no_slash - - Env Var: RCLONE_HTTP_NO_SLASH - - Type: bool - - Default: false - - #### --http-no-head - - Don't use HEAD requests. - - HEAD requests are mainly used to find file sizes in dir listing. - If your site is being very slow to load then you can try this option. - Normally rclone does a HEAD request for each potential file in a - directory listing to: - - - find its size - - check it really exists - - check to see if it is a directory - - If you set this option, rclone will not do the HEAD request. This will mean - that directory listings are much quicker, but rclone won't have the times or - sizes of any files, and some files that don't exist may be in the listing. - - Properties: - - - Config: no_head - - Env Var: RCLONE_HTTP_NO_HEAD - - Type: bool - - Default: false - - - - ## Limitations - - `rclone about` is not supported by the HTTP backend. Backends without - this capability cannot determine free space for an rclone mount or - use policy `mfs` (most free space) as a member of an rclone union - remote. - - See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) - - # Internet Archive - - The Internet Archive backend utilizes Items on [archive.org](https://archive.org/) - - Refer to [IAS3 API documentation](https://archive.org/services/docs/api/ias3.html) for the API this backend uses. - - Paths are specified as `remote:bucket` (or `remote:` for the `lsd` - command.) You may put subdirectories in too, e.g. `remote:item/path/to/dir`. - - Unlike S3, listing up all items uploaded by you isn't supported. - - Once you have made a remote, you can use it like this: - - Make a new item - - rclone mkdir remote:item - - List the contents of a item - - rclone ls remote:item - - Sync `/home/local/directory` to the remote item, deleting any excess - files in the item. - - rclone sync --interactive /home/local/directory remote:item - - ## Notes - Because of Internet Archive's architecture, it enqueues write operations (and extra post-processings) in a per-item queue. You can check item's queue at https://catalogd.archive.org/history/item-name-here . Because of that, all uploads/deletes will not show up immediately and takes some time to be available. - The per-item queue is enqueued to an another queue, Item Deriver Queue. [You can check the status of Item Deriver Queue here.](https://catalogd.archive.org/catalog.php?whereami=1) This queue has a limit, and it may block you from uploading, or even deleting. You should avoid uploading a lot of small files for better behavior. - - You can optionally wait for the server's processing to finish, by setting non-zero value to `wait_archive` key. - By making it wait, rclone can do normal file comparison. - Make sure to set a large enough value (e.g. `30m0s` for smaller files) as it can take a long time depending on server's queue. - - ## About metadata - This backend supports setting, updating and reading metadata of each file. - The metadata will appear as file metadata on Internet Archive. - However, some fields are reserved by both Internet Archive and rclone. - - The following are reserved by Internet Archive: - - `name` - - `source` - - `size` - - `md5` - - `crc32` - - `sha1` - - `format` - - `old_version` - - `viruscheck` - - `summation` - - Trying to set values to these keys is ignored with a warning. - Only setting `mtime` is an exception. Doing so make it the identical behavior as setting ModTime. - - rclone reserves all the keys starting with `rclone-`. Setting value for these keys will give you warnings, but values are set according to request. - - If there are multiple values for a key, only the first one is returned. - This is a limitation of rclone, that supports one value per one key. - It can be triggered when you did a server-side copy. +password q) Quit config n/s/q> n name> koofr Option Storage. Type of +storage to configure. Choose a number from below, or type in your own +value. [snip] 22 / Koofr, Digi Storage and other Koofr-compatible +storage providers  (koofr) [snip] Storage> koofr Option provider. Choose +your storage provider. Choose a number from below, or type in your own +value. Press Enter to leave empty. 1 / Koofr, https://app.koofr.net/ + (koofr) 2 / Digi Storage, https://storage.rcs-rds.ro/  (digistorage) 3 +/ Any other Koofr API compatible storage service  (other) provider> 1 +Option user. Your user name. Enter a value. user> USERNAME Option +password. Your password for rclone (generate one at +https://app.koofr.net/app/admin/preferences/password). Choose an +alternative below. y) Yes, type in my own password g) Generate random +password y/g> y Enter the password: password: Confirm the password: +password: Edit advanced config? y) Yes n) No (default) y/n> n Remote +config -------------------- [koofr] type = koofr provider = koofr user = +USERNAME password = *** ENCRYPTED *** -------------------- y) Yes this +is OK (default) e) Edit this remote d) Delete this remote y/e/d> y - Reading metadata will also provide custom (non-standard nor reserved) ones. - ## Filtering auto generated files + You can choose to edit advanced config in order to enter your own service URL + if you use an on-premise or white label Koofr instance, or choose an alternative + mount instead of your primary storage. - The Internet Archive automatically creates metadata files after - upload. These can cause problems when doing an `rclone sync` as rclone - will try, and fail, to delete them. These metadata files are not - changeable, as they are created by the Internet Archive automatically. + Once configured you can then use `rclone` like this, - These auto-created files can be excluded from the sync using [metadata - filtering](https://rclone.org/filtering/#metadata). + List directories in top level of your Koofr - rclone sync ... --metadata-exclude "source=metadata" --metadata-exclude "format=Metadata" + rclone lsd koofr: - Which excludes from the sync any files which have the - `source=metadata` or `format=Metadata` flags which are added to - Internet Archive auto-created files. + List all the files in your Koofr - ## Configuration + rclone ls koofr: - Here is an example of making an internetarchive configuration. - Most applies to the other providers as well, any differences are described [below](#providers). + To copy a local directory to an Koofr directory called backup - First run + rclone copy /home/source koofr:backup - rclone config + ### Restricted filename characters - This will guide you through an interactive setup process. + In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) + the following characters are also replaced: -No remotes found, make a new one? n) New remote s) Set configuration -password q) Quit config n/s/q> n name> remote Option Storage. Type of -storage to configure. Choose a number from below, or type in your own -value. XX / InternetArchive Items  (internetarchive) Storage> -internetarchive Option access_key_id. IAS3 Access Key. Leave blank for -anonymous access. You can find one here: -https://archive.org/account/s3.php Enter a value. Press Enter to leave -empty. access_key_id> XXXX Option secret_access_key. IAS3 Secret Key -(password). Leave blank for anonymous access. Enter a value. Press Enter -to leave empty. secret_access_key> XXXX Edit advanced config? y) Yes n) -No (default) y/n> y Option endpoint. IAS3 Endpoint. Leave blank for -default value. Enter a string value. Press Enter for the default -(https://s3.us.archive.org). endpoint> Option front_endpoint. Host of -InternetArchive Frontend. Leave blank for default value. Enter a string -value. Press Enter for the default (https://archive.org). -front_endpoint> Option disable_checksum. Don't store MD5 checksum with -object metadata. Normally rclone will calculate the MD5 checksum of the -input before uploading it so it can ask the server to check the object -against checksum. This is great for data integrity checking but can -cause long delays for large files to start uploading. Enter a boolean -value (true or false). Press Enter for the default (true). -disable_checksum> true Option encoding. The encoding for the backend. -See the encoding section in the overview for more info. Enter a -encoder.MultiEncoder value. Press Enter for the default -(Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot). encoding> Edit -advanced config? y) Yes n) No (default) y/n> n -------------------- -[remote] type = internetarchive access_key_id = XXXX secret_access_key = -XXXX -------------------- y) Yes this is OK (default) e) Edit this -remote d) Delete this remote y/e/d> y + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | \ | 0x5C | \ | + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in XML strings. ### Standard options - Here are the Standard options specific to internetarchive (Internet Archive). - - #### --internetarchive-access-key-id + Here are the Standard options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers). - IAS3 Access Key. + #### --koofr-provider - Leave blank for anonymous access. - You can find one here: https://archive.org/account/s3.php + Choose your storage provider. Properties: - - Config: access_key_id - - Env Var: RCLONE_INTERNETARCHIVE_ACCESS_KEY_ID + - Config: provider + - Env Var: RCLONE_KOOFR_PROVIDER - Type: string - Required: false + - Examples: + - "koofr" + - Koofr, https://app.koofr.net/ + - "digistorage" + - Digi Storage, https://storage.rcs-rds.ro/ + - "other" + - Any other Koofr API compatible storage service - #### --internetarchive-secret-access-key - - IAS3 Secret Key (password). + #### --koofr-endpoint - Leave blank for anonymous access. + The Koofr API endpoint to use. Properties: - - Config: secret_access_key - - Env Var: RCLONE_INTERNETARCHIVE_SECRET_ACCESS_KEY + - Config: endpoint + - Env Var: RCLONE_KOOFR_ENDPOINT + - Provider: other - Type: string - - Required: false + - Required: true - ### Advanced options + #### --koofr-user - Here are the Advanced options specific to internetarchive (Internet Archive). + Your user name. - #### --internetarchive-endpoint + Properties: - IAS3 Endpoint. + - Config: user + - Env Var: RCLONE_KOOFR_USER + - Type: string + - Required: true - Leave blank for default value. + #### --koofr-password + + Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password). + + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: - - Config: endpoint - - Env Var: RCLONE_INTERNETARCHIVE_ENDPOINT + - Config: password + - Env Var: RCLONE_KOOFR_PASSWORD + - Provider: koofr - Type: string - - Default: "https://s3.us.archive.org" + - Required: true - #### --internetarchive-front-endpoint + ### Advanced options - Host of InternetArchive Frontend. + Here are the Advanced options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers). - Leave blank for default value. + #### --koofr-mountid + + Mount ID of the mount to use. + + If omitted, the primary mount is used. Properties: - - Config: front_endpoint - - Env Var: RCLONE_INTERNETARCHIVE_FRONT_ENDPOINT + - Config: mountid + - Env Var: RCLONE_KOOFR_MOUNTID - Type: string - - Default: "https://archive.org" + - Required: false - #### --internetarchive-disable-checksum + #### --koofr-setmtime - Don't ask the server to test against MD5 checksum calculated by rclone. - Normally rclone will calculate the MD5 checksum of the input before - uploading it so it can ask the server to check the object against checksum. - This is great for data integrity checking but can cause long delays for - large files to start uploading. + Does the backend support setting modification time. + + Set this to false if you use a mount ID that points to a Dropbox or Amazon Drive backend. Properties: - - Config: disable_checksum - - Env Var: RCLONE_INTERNETARCHIVE_DISABLE_CHECKSUM + - Config: setmtime + - Env Var: RCLONE_KOOFR_SETMTIME - Type: bool - Default: true - #### --internetarchive-wait-archive + #### --koofr-encoding - Timeout for waiting the server's processing tasks (specifically archive and book_op) to finish. - Only enable if you need to be guaranteed to be reflected after write operations. - 0 to disable waiting. No errors to be thrown in case of timeout. + The encoding for the backend. + + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. Properties: - - Config: wait_archive - - Env Var: RCLONE_INTERNETARCHIVE_WAIT_ARCHIVE - - Type: Duration - - Default: 0s + - Config: encoding + - Env Var: RCLONE_KOOFR_ENCODING + - Type: Encoding + - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot - #### --internetarchive-encoding - The encoding for the backend. - See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + ## Limitations - Properties: + Note that Koofr is case insensitive so you can't have a file called + "Hello.doc" and one called "hello.doc". - - Config: encoding - - Env Var: RCLONE_INTERNETARCHIVE_ENCODING - - Type: MultiEncoder - - Default: Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot + ## Providers - ### Metadata + ### Koofr - Metadata fields provided by Internet Archive. - If there are multiple values for a key, only the first one is returned. - This is a limitation of Rclone, that supports one value per one key. + This is the original [Koofr](https://koofr.eu) storage provider used as main example and described in the [configuration](#configuration) section above. - Owner is able to add custom keys. Metadata feature grabs all the keys including them. + ### Digi Storage - Here are the possible system metadata items for the internetarchive backend. + [Digi Storage](https://www.digi.ro/servicii/online/digi-storage) is a cloud storage service run by [Digi.ro](https://www.digi.ro/) that + provides a Koofr API. - | Name | Help | Type | Example | Read Only | - |------|------|------|---------|-----------| - | crc32 | CRC32 calculated by Internet Archive | string | 01234567 | **Y** | - | format | Name of format identified by Internet Archive | string | Comma-Separated Values | **Y** | - | md5 | MD5 hash calculated by Internet Archive | string | 01234567012345670123456701234567 | **Y** | - | mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | **Y** | - | name | Full file path, without the bucket part | filename | backend/internetarchive/internetarchive.go | **Y** | - | old_version | Whether the file was replaced and moved by keep-old-version flag | boolean | true | **Y** | - | rclone-ia-mtime | Time of last modification, managed by Internet Archive | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N | - | rclone-mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N | - | rclone-update-track | Random value used by Rclone for tracking changes inside Internet Archive | string | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | N | - | sha1 | SHA1 hash calculated by Internet Archive | string | 0123456701234567012345670123456701234567 | **Y** | - | size | File size in bytes | decimal number | 123456 | **Y** | - | source | The source of the file | string | original | **Y** | - | summation | Check https://forum.rclone.org/t/31922 for how it is used | string | md5 | **Y** | - | viruscheck | The last time viruscheck process was run for the file (?) | unixtime | 1654191352 | **Y** | + Here is an example of how to make a remote called `ds`. First run: - See the [metadata](https://rclone.org/docs/#metadata) docs for more info. + rclone config + This will guide you through an interactive setup process: +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> ds Option Storage. Type of +storage to configure. Choose a number from below, or type in your own +value. [snip] 22 / Koofr, Digi Storage and other Koofr-compatible +storage providers  (koofr) [snip] Storage> koofr Option provider. Choose +your storage provider. Choose a number from below, or type in your own +value. Press Enter to leave empty. 1 / Koofr, https://app.koofr.net/ + (koofr) 2 / Digi Storage, https://storage.rcs-rds.ro/  (digistorage) 3 +/ Any other Koofr API compatible storage service  (other) provider> 2 +Option user. Your user name. Enter a value. user> USERNAME Option +password. Your password for rclone (generate one at +https://storage.rcs-rds.ro/app/admin/preferences/password). Choose an +alternative below. y) Yes, type in my own password g) Generate random +password y/g> y Enter the password: password: Confirm the password: +password: Edit advanced config? y) Yes n) No (default) y/n> n +-------------------- [ds] type = koofr provider = digistorage user = +USERNAME password = *** ENCRYPTED *** -------------------- y) Yes this +is OK (default) e) Edit this remote d) Delete this remote y/e/d> y - # Jottacloud - Jottacloud is a cloud storage service provider from a Norwegian company, using its own datacenters - in Norway. In addition to the official service at [jottacloud.com](https://www.jottacloud.com/), - it also provides white-label solutions to different companies, such as: - * Telia - * Telia Cloud (cloud.telia.se) - * Telia Sky (sky.telia.no) - * Tele2 - * Tele2 Cloud (mittcloud.tele2.se) - * Onlime - * Onlime Cloud Storage (onlime.dk) - * Elkjøp (with subsidiaries): - * Elkjøp Cloud (cloud.elkjop.no) - * Elgiganten Sweden (cloud.elgiganten.se) - * Elgiganten Denmark (cloud.elgiganten.dk) - * Giganti Cloud (cloud.gigantti.fi) - * ELKO Cloud (cloud.elko.is) + ### Other - Most of the white-label versions are supported by this backend, although may require different - authentication setup - described below. + You may also want to use another, public or private storage provider that runs a Koofr API compatible service, by simply providing the base URL to connect to. - Paths are specified as `remote:path` + Here is an example of how to make a remote called `other`. First run: - Paths may be as deep as required, e.g. `remote:directory/subdirectory`. + rclone config - ## Authentication types + This will guide you through an interactive setup process: - Some of the whitelabel versions uses a different authentication method than the official service, - and you have to choose the correct one when setting up the remote. +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> other Option Storage. Type of +storage to configure. Choose a number from below, or type in your own +value. [snip] 22 / Koofr, Digi Storage and other Koofr-compatible +storage providers  (koofr) [snip] Storage> koofr Option provider. Choose +your storage provider. Choose a number from below, or type in your own +value. Press Enter to leave empty. 1 / Koofr, https://app.koofr.net/ + (koofr) 2 / Digi Storage, https://storage.rcs-rds.ro/  (digistorage) 3 +/ Any other Koofr API compatible storage service  (other) provider> 3 +Option endpoint. The Koofr API endpoint to use. Enter a value. endpoint> +https://koofr.other.org Option user. Your user name. Enter a value. +user> USERNAME Option password. Your password for rclone (generate one +at your service's settings page). Choose an alternative below. y) Yes, +type in my own password g) Generate random password y/g> y Enter the +password: password: Confirm the password: password: Edit advanced +config? y) Yes n) No (default) y/n> n -------------------- [other] type += koofr provider = other endpoint = https://koofr.other.org user = +USERNAME password = *** ENCRYPTED *** -------------------- y) Yes this +is OK (default) e) Edit this remote d) Delete this remote y/e/d> y - ### Standard authentication - The standard authentication method used by the official service (jottacloud.com), as well as - some of the whitelabel services, requires you to generate a single-use personal login token - from the account security settings in the service's web interface. Log in to your account, - go to "Settings" and then "Security", or use the direct link presented to you by rclone when - configuring the remote: . Scroll down to the section - "Personal login token", and click the "Generate" button. Note that if you are using a - whitelabel service you probably can't use the direct link, you need to find the same page in - their dedicated web interface, and also it may be in a different location than described above. + # Linkbox - To access your account from multiple instances of rclone, you need to configure each of them - with a separate personal login token. E.g. you create a Jottacloud remote with rclone in one - location, and copy the configuration file to a second location where you also want to run - rclone and access the same remote. Then you need to replace the token for one of them, using - the [config reconnect](https://rclone.org/commands/rclone_config_reconnect/) command, which - requires you to generate a new personal login token and supply as input. If you do not - do this, the token may easily end up being invalidated, resulting in both instances failing - with an error message something along the lines of: + Linkbox is [a private cloud drive](https://linkbox.to/). - oauth2: cannot fetch token: 400 Bad Request - Response: {"error":"invalid_grant","error_description":"Stale token"} + ## Configuration - When this happens, you need to replace the token as described above to be able to use your - remote again. + Here is an example of making a remote for Linkbox. - All personal login tokens you have taken into use will be listed in the web interface under - "My logged in devices", and from the right side of that list you can click the "X" button to - revoke individual tokens. + First run: - ### Legacy authentication + rclone config - If you are using one of the whitelabel versions (e.g. from Elkjøp) you may not have the option - to generate a CLI token. In this case you'll have to use the legacy authentication. To do this select - yes when the setup asks for legacy authentication and enter your username and password. - The rest of the setup is identical to the default setup. + This will guide you through an interactive setup process: - ### Telia Cloud authentication +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n - Similar to other whitelabel versions Telia Cloud doesn't offer the option of creating a CLI token, and - additionally uses a separate authentication flow where the username is generated internally. To setup - rclone to use Telia Cloud, choose Telia Cloud authentication in the setup. The rest of the setup is - identical to the default setup. +Enter name for new remote. name> remote - ### Tele2 Cloud authentication +Option Storage. Type of storage to configure. Choose a number from +below, or type in your own value. XX / Linkbox  (linkbox) Storage> XX - As Tele2-Com Hem merger was completed this authentication can be used for former Com Hem Cloud and - Tele2 Cloud customers as no support for creating a CLI token exists, and additionally uses a separate - authentication flow where the username is generated internally. To setup rclone to use Tele2 Cloud, - choose Tele2 Cloud authentication in the setup. The rest of the setup is identical to the default setup. +Option token. Token from https://www.linkbox.to/admin/account Enter a +value. token> testFromCLToken - ### Onlime Cloud Storage authentication +Configuration complete. Options: - type: linkbox - token: XXXXXXXXXXX +Keep this "linkbox" remote? y) Yes this is OK (default) e) Edit this +remote d) Delete this remote y/e/d> y - Onlime has sold access to Jottacloud proper, while providing localized support to Danish Customers, but - have recently set up their own hosting, transferring their customers from Jottacloud servers to their - own ones. - This, of course, necessitates using their servers for authentication, but otherwise functionality and - architecture seems equivalent to Jottacloud. - To setup rclone to use Onlime Cloud Storage, choose Onlime Cloud authentication in the setup. The rest - of the setup is identical to the default setup. + ### Standard options - ## Configuration + Here are the Standard options specific to linkbox (Linkbox). - Here is an example of how to make a remote called `remote` with the default setup. First run: + #### --linkbox-token - rclone config + Token from https://www.linkbox.to/admin/account - This will guide you through an interactive setup process: + Properties: -No remotes found, make a new one? n) New remote s) Set configuration -password q) Quit config n/s/q> n name> remote Option Storage. Type of -storage to configure. Choose a number from below, or type in your own -value. [snip] XX / Jottacloud  (jottacloud) [snip] Storage> jottacloud -Edit advanced config? y) Yes n) No (default) y/n> n Option config_type. -Select authentication type. Choose a number from below, or type in an -existing string value. Press Enter for the default (standard). / -Standard authentication. 1 | Use this if you're a normal Jottacloud -user.  (standard) / Legacy authentication. 2 | This is only required for -certain whitelabel versions of Jottacloud and not recommended for normal -users.  (legacy) / Telia Cloud authentication. 3 | Use this if you are -using Telia Cloud.  (telia) / Tele2 Cloud authentication. 4 | Use this -if you are using Tele2 Cloud.  (tele2) / Onlime Cloud authentication. 5 -| Use this if you are using Onlime Cloud.  (onlime) config_type> 1 -Personal login token. Generate here: -https://www.jottacloud.com/web/secure Login Token> Use a non-standard -device/mountpoint? Choosing no, the default, will let you access the -storage used for the archive section of the official Jottacloud client. -If you instead want to access the sync or the backup section, for -example, you must choose yes. y) Yes n) No (default) y/n> y Option -config_device. The device to use. In standard setup the built-in Jotta -device is used, which contains predefined mountpoints for archive, sync -etc. All other devices are treated as backup devices by the official -Jottacloud client. You may create a new by entering a unique name. -Choose a number from below, or type in your own string value. Press -Enter for the default (DESKTOP-3H31129). 1 > DESKTOP-3H31129 2 > Jotta -config_device> 2 Option config_mountpoint. The mountpoint to use for the -built-in device Jotta. The standard setup is to use the Archive -mountpoint. Most other mountpoints have very limited support in rclone -and should generally be avoided. Choose a number from below, or type in -an existing string value. Press Enter for the default (Archive). 1 > -Archive 2 > Shared 3 > Sync config_mountpoint> 1 -------------------- -[remote] type = jottacloud configVersion = 1 client_id = jottacli -client_secret = tokenURL = -https://id.jottacloud.com/auth/realms/jottacloud/protocol/openid-connect/token -token = {........} username = 2940e57271a93d987d6f8a21 device = Jotta -mountpoint = Archive -------------------- y) Yes this is OK (default) e) -Edit this remote d) Delete this remote y/e/d> y + - Config: token + - Env Var: RCLONE_LINKBOX_TOKEN + - Type: string + - Required: true - Once configured you can then use `rclone` like this, - List directories in top level of your Jottacloud + ## Limitations - rclone lsd remote: + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. - List all the files in your Jottacloud + # Mail.ru Cloud - rclone ls remote: + [Mail.ru Cloud](https://cloud.mail.ru/) is a cloud storage provided by a Russian internet company [Mail.Ru Group](https://mail.ru). The official desktop client is [Disk-O:](https://disk-o.cloud/en), available on Windows and Mac OS. - To copy a local directory to an Jottacloud directory called backup + ## Features highlights - rclone copy /home/source remote:backup + - Paths may be as deep as required, e.g. `remote:directory/subdirectory` + - Files have a `last modified time` property, directories don't + - Deleted files are by default moved to the trash + - Files and directories can be shared via public links + - Partial uploads or streaming are not supported, file size must be known before upload + - Maximum file size is limited to 2G for a free account, unlimited for paid accounts + - Storage keeps hash for all files and performs transparent deduplication, + the hash algorithm is a modified SHA1 + - If a particular file is already present in storage, one can quickly submit file hash + instead of long file upload (this optimization is supported by rclone) - ### Devices and Mountpoints + ## Configuration - The official Jottacloud client registers a device for each computer you install - it on, and shows them in the backup section of the user interface. For each - folder you select for backup it will create a mountpoint within this device. - A built-in device called Jotta is special, and contains mountpoints Archive, - Sync and some others, used for corresponding features in official clients. + Here is an example of making a mailru configuration. - With rclone you'll want to use the standard Jotta/Archive device/mountpoint in - most cases. However, you may for example want to access files from the sync or - backup functionality provided by the official clients, and rclone therefore - provides the option to select other devices and mountpoints during config. + First create a Mail.ru Cloud account and choose a tariff. - You are allowed to create new devices and mountpoints. All devices except the - built-in Jotta device are treated as backup devices by official Jottacloud - clients, and the mountpoints on them are individual backup sets. + You will need to log in and create an app password for rclone. Rclone + **will not work** with your normal username and password - it will + give an error like `oauth2: server response missing access_token`. - With the built-in Jotta device, only existing, built-in, mountpoints can be - selected. In addition to the mentioned Archive and Sync, it may contain - several other mountpoints such as: Latest, Links, Shared and Trash. All of - these are special mountpoints with a different internal representation than - the "regular" mountpoints. Rclone will only to a very limited degree support - them. Generally you should avoid these, unless you know what you are doing. + - Click on your user icon in the top right + - Go to Security / "Пароль и безопасность" + - Click password for apps / "Пароли для внешних приложений" + - Add the password - give it a name - eg "rclone" + - Copy the password and use this password below - your normal login password won't work. - ### --fast-list + Now run - This remote supports `--fast-list` which allows you to use fewer - transactions in exchange for more memory. See the [rclone - docs](https://rclone.org/docs/#fast-list) for more details. + rclone config - Note that the implementation in Jottacloud always uses only a single - API request to get the entire list, so for large folders this could - lead to long wait time before the first results are shown. + This will guide you through an interactive setup process: + +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Type of storage to configure. Enter a string value. Press +Enter for the default (""). Choose a number from below, or type in your +own value [snip] XX / Mail.ru Cloud  "mailru" [snip] Storage> mailru +User name (usually email) Enter a string value. Press Enter for the +default (""). user> username@mail.ru Password - Note also that with rclone version 1.58 and newer information about - [MIME types](https://rclone.org/overview/#mime-type) are not available when using `--fast-list`. +This must be an app password - rclone will not work with your normal +password. See the Configuration section in the docs for how to make an +app password. y) Yes type in my own password g) Generate random password +y/g> y Enter the password: password: Confirm the password: password: +Skip full upload if there is another file with same data hash. This +feature is called "speedup" or "put by hash". It is especially efficient +in case of generally available files like popular books, video or audio +clips [snip] Enter a boolean value (true or false). Press Enter for the +default ("true"). Choose a number from below, or type in your own value +1 / Enable  "true" 2 / Disable  "false" speedup_enable> 1 Edit advanced +config? (y/n) y) Yes n) No y/n> n Remote config -------------------- +[remote] type = mailru user = username@mail.ru pass = *** ENCRYPTED *** +speedup_enable = true -------------------- y) Yes this is OK e) Edit +this remote d) Delete this remote y/e/d> y - ### Modified time and hashes - Jottacloud allows modification times to be set on objects accurate to 1 - second. These will be used to detect whether objects need syncing or - not. + Configuration of this backend does not require a local web browser. + You can use the configured backend as shown below: - Jottacloud supports MD5 type hashes, so you can use the `--checksum` - flag. + See top level directories - Note that Jottacloud requires the MD5 hash before upload so if the - source does not have an MD5 checksum then the file will be cached - temporarily on disk (in location given by - [--temp-dir](https://rclone.org/docs/#temp-dir-dir)) before it is uploaded. - Small files will be cached in memory - see the - [--jottacloud-md5-memory-limit](#jottacloud-md5-memory-limit) flag. - When uploading from local disk the source checksum is always available, - so this does not apply. Starting with rclone version 1.52 the same is - true for encrypted remotes (in older versions the crypt backend would not - calculate hashes for uploads from local disk, so the Jottacloud - backend had to do it as described above). + rclone lsd remote: + + Make a new directory + + rclone mkdir remote:directory + + List the contents of a directory + + rclone ls remote:directory + + Sync `/home/local/directory` to the remote path, deleting any + excess files in the path. + + rclone sync --interactive /home/local/directory remote:directory + + ### Modification times and hashes + + Files support a modification time attribute with up to 1 second precision. + Directories do not have a modification time, which is shown as "Jan 1 1970". + + File hashes are supported, with a custom Mail.ru algorithm based on SHA1. + If file size is less than or equal to the SHA1 block size (20 bytes), + its hash is simply its data right-padded with zero bytes. + Hashes of a larger file is computed as a SHA1 of the file data + bytes concatenated with a decimal representation of the data length. + + ### Emptying Trash + + Removing a file or directory actually moves it to the trash, which is not + visible to rclone but can be seen in a web browser. The trashed file + still occupies part of total quota. If you wish to empty your trash + and free some quota, you can use the `rclone cleanup remote:` command, + which will permanently delete all your trashed files. + This command does not take any path arguments. + + ### Quota information + + To view your current quota you can use the `rclone about remote:` + command which will display your usage limit (quota) and the current usage. ### Restricted filename characters @@ -34336,38 +35718,18 @@ Edit this remote d) Delete this remote y/e/d> y | < | 0x3C | < | | > | 0x3E | > | | ? | 0x3F | ? | + | \ | 0x5C | \ | | \| | 0x7C | | | Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), - as they can't be used in XML strings. - - ### Deleting files - - By default, rclone will send all files to the trash when deleting files. They will be permanently - deleted automatically after 30 days. You may bypass the trash and permanently delete files immediately - by using the [--jottacloud-hard-delete](#jottacloud-hard-delete) flag, or set the equivalent environment variable. - Emptying the trash is supported by the [cleanup](https://rclone.org/commands/rclone_cleanup/) command. - - ### Versions - - Jottacloud supports file versioning. When rclone uploads a new version of a file it creates a new version of it. - Currently rclone only supports retrieving the current version but older versions can be accessed via the Jottacloud Website. - - Versioning can be disabled by `--jottacloud-no-versions` option. This is achieved by deleting the remote file prior to uploading - a new version. If the upload the fails no version of the file will be available in the remote. - - ### Quota information - - To view your current quota you can use the `rclone about remote:` - command which will display your usage limit (unless it is unlimited) - and the current usage. + as they can't be used in JSON strings. ### Standard options - Here are the Standard options specific to jottacloud (Jottacloud). + Here are the Standard options specific to mailru (Mail.ru Cloud). - #### --jottacloud-client-id + #### --mailru-client-id OAuth Client Id. @@ -34376,11 +35738,11 @@ Edit this remote d) Delete this remote y/e/d> y Properties: - Config: client_id - - Env Var: RCLONE_JOTTACLOUD_CLIENT_ID + - Env Var: RCLONE_MAILRU_CLIENT_ID - Type: string - Required: false - #### --jottacloud-client-secret + #### --mailru-client-secret OAuth Client Secret. @@ -34389,26 +35751,80 @@ Edit this remote d) Delete this remote y/e/d> y Properties: - Config: client_secret - - Env Var: RCLONE_JOTTACLOUD_CLIENT_SECRET + - Env Var: RCLONE_MAILRU_CLIENT_SECRET - Type: string - Required: false + #### --mailru-user + + User name (usually email). + + Properties: + + - Config: user + - Env Var: RCLONE_MAILRU_USER + - Type: string + - Required: true + + #### --mailru-pass + + Password. + + This must be an app password - rclone will not work with your normal + password. See the Configuration section in the docs for how to make an + app password. + + + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + + Properties: + + - Config: pass + - Env Var: RCLONE_MAILRU_PASS + - Type: string + - Required: true + + #### --mailru-speedup-enable + + Skip full upload if there is another file with same data hash. + + This feature is called "speedup" or "put by hash". It is especially efficient + in case of generally available files like popular books, video or audio clips, + because files are searched by hash in all accounts of all mailru users. + It is meaningless and ineffective if source file is unique or encrypted. + Please note that rclone may need local memory and disk space to calculate + content hash in advance and decide whether full upload is required. + Also, if rclone does not know file size in advance (e.g. in case of + streaming or partial uploads), it will not even try this optimization. + + Properties: + + - Config: speedup_enable + - Env Var: RCLONE_MAILRU_SPEEDUP_ENABLE + - Type: bool + - Default: true + - Examples: + - "true" + - Enable + - "false" + - Disable + ### Advanced options - Here are the Advanced options specific to jottacloud (Jottacloud). + Here are the Advanced options specific to mailru (Mail.ru Cloud). - #### --jottacloud-token + #### --mailru-token OAuth Access Token as a JSON blob. Properties: - Config: token - - Env Var: RCLONE_JOTTACLOUD_TOKEN + - Env Var: RCLONE_MAILRU_TOKEN - Type: string - Required: false - #### --jottacloud-auth-url + #### --mailru-auth-url Auth server URL. @@ -34417,11 +35833,11 @@ Edit this remote d) Delete this remote y/e/d> y Properties: - Config: auth_url - - Env Var: RCLONE_JOTTACLOUD_AUTH_URL + - Env Var: RCLONE_MAILRU_AUTH_URL - Type: string - Required: false - #### --jottacloud-token-url + #### --mailru-token-url Token server url. @@ -34430,68 +35846,117 @@ Edit this remote d) Delete this remote y/e/d> y Properties: - Config: token_url - - Env Var: RCLONE_JOTTACLOUD_TOKEN_URL + - Env Var: RCLONE_MAILRU_TOKEN_URL - Type: string - Required: false - #### --jottacloud-md5-memory-limit + #### --mailru-speedup-file-patterns - Files bigger than this will be cached on disk to calculate the MD5 if required. + Comma separated list of file name patterns eligible for speedup (put by hash). + + Patterns are case insensitive and can contain '*' or '?' meta characters. Properties: - - Config: md5_memory_limit - - Env Var: RCLONE_JOTTACLOUD_MD5_MEMORY_LIMIT - - Type: SizeSuffix - - Default: 10Mi + - Config: speedup_file_patterns + - Env Var: RCLONE_MAILRU_SPEEDUP_FILE_PATTERNS + - Type: string + - Default: "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf" + - Examples: + - "" + - Empty list completely disables speedup (put by hash). + - "*" + - All files will be attempted for speedup. + - "*.mkv,*.avi,*.mp4,*.mp3" + - Only common audio/video files will be tried for put by hash. + - "*.zip,*.gz,*.rar,*.pdf" + - Only common archives or PDF books will be tried for speedup. - #### --jottacloud-trashed-only + #### --mailru-speedup-max-disk - Only show files that are in the trash. + This option allows you to disable speedup (put by hash) for large files. - This will show trashed files in their original directory structure. + Reason is that preliminary hashing can exhaust your RAM or disk space. Properties: - - Config: trashed_only - - Env Var: RCLONE_JOTTACLOUD_TRASHED_ONLY - - Type: bool - - Default: false + - Config: speedup_max_disk + - Env Var: RCLONE_MAILRU_SPEEDUP_MAX_DISK + - Type: SizeSuffix + - Default: 3Gi + - Examples: + - "0" + - Completely disable speedup (put by hash). + - "1G" + - Files larger than 1Gb will be uploaded directly. + - "3G" + - Choose this option if you have less than 3Gb free on local disk. - #### --jottacloud-hard-delete + #### --mailru-speedup-max-memory - Delete files permanently rather than putting them into the trash. + Files larger than the size given below will always be hashed on disk. Properties: - - Config: hard_delete - - Env Var: RCLONE_JOTTACLOUD_HARD_DELETE + - Config: speedup_max_memory + - Env Var: RCLONE_MAILRU_SPEEDUP_MAX_MEMORY + - Type: SizeSuffix + - Default: 32Mi + - Examples: + - "0" + - Preliminary hashing will always be done in a temporary disk location. + - "32M" + - Do not dedicate more than 32Mb RAM for preliminary hashing. + - "256M" + - You have at most 256Mb RAM free for hash calculations. + + #### --mailru-check-hash + + What should copy do if file checksum is mismatched or invalid. + + Properties: + + - Config: check_hash + - Env Var: RCLONE_MAILRU_CHECK_HASH - Type: bool - - Default: false + - Default: true + - Examples: + - "true" + - Fail with error. + - "false" + - Ignore and continue. - #### --jottacloud-upload-resume-limit + #### --mailru-user-agent - Files bigger than this can be resumed if the upload fail's. + HTTP user agent used internally by client. + + Defaults to "rclone/VERSION" or "--user-agent" provided on command line. Properties: - - Config: upload_resume_limit - - Env Var: RCLONE_JOTTACLOUD_UPLOAD_RESUME_LIMIT - - Type: SizeSuffix - - Default: 10Mi + - Config: user_agent + - Env Var: RCLONE_MAILRU_USER_AGENT + - Type: string + - Required: false - #### --jottacloud-no-versions + #### --mailru-quirks - Avoid server side versioning by deleting files and recreating files instead of overwriting them. + Comma separated list of internal maintenance flags. + + This option must not be used by an ordinary user. It is intended only to + facilitate remote troubleshooting of backend issues. Strict meaning of + flags is not documented and not guaranteed to persist between releases. + Quirks will be removed when the backend grows stable. + Supported quirks: atomicmkdir binlist unknowndirs Properties: - - Config: no_versions - - Env Var: RCLONE_JOTTACLOUD_NO_VERSIONS - - Type: bool - - Default: false + - Config: quirks + - Env Var: RCLONE_MAILRU_QUIRKS + - Type: string + - Required: false - #### --jottacloud-encoding + #### --mailru-encoding The encoding for the backend. @@ -34500,28 +35965,31 @@ Edit this remote d) Delete this remote y/e/d> y Properties: - Config: encoding - - Env Var: RCLONE_JOTTACLOUD_ENCODING - - Type: MultiEncoder - - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot + - Env Var: RCLONE_MAILRU_ENCODING + - Type: Encoding + - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot ## Limitations - Note that Jottacloud is case insensitive so you can't have a file called - "Hello.doc" and one called "hello.doc". - - There are quite a few characters that can't be in Jottacloud file names. Rclone will map these names to and from an identical - looking unicode equivalent. For example if a file has a ? in it will be mapped to ? instead. + File size limits depend on your account. A single file size is limited by 2G + for a free account and unlimited for paid tariffs. Please refer to the Mail.ru + site for the total uploaded size limits. - Jottacloud only supports filenames up to 255 characters in length. + Note that Mailru is case insensitive so you can't have a file called + "Hello.doc" and one called "hello.doc". - ## Troubleshooting + # Mega - Jottacloud exhibits some inconsistent behaviours regarding deleted files and folders which may cause Copy, Move and DirMove - operations to previously deleted paths to fail. Emptying the trash should help in such cases. + [Mega](https://mega.nz/) is a cloud storage and file hosting service + known for its security feature where all files are encrypted locally + before they are uploaded. This prevents anyone (including employees of + Mega) from accessing the files without knowledge of the key used for + encryption. - # Koofr + This is an rclone backend for Mega which supports the file transfer + features of Mega using the same client side encryption. Paths are specified as `remote:path` @@ -34529,1229 +35997,1407 @@ Edit this remote d) Delete this remote y/e/d> y ## Configuration - The initial setup for Koofr involves creating an application password for - rclone. You can do that by opening the Koofr - [web application](https://app.koofr.net/app/admin/preferences/password), - giving the password a nice name like `rclone` and clicking on generate. - - Here is an example of how to make a remote called `koofr`. First run: + Here is an example of how to make a remote called `remote`. First run: rclone config This will guide you through an interactive setup process: No remotes found, make a new one? n) New remote s) Set configuration -password q) Quit config n/s/q> n name> koofr Option Storage. Type of -storage to configure. Choose a number from below, or type in your own -value. [snip] 22 / Koofr, Digi Storage and other Koofr-compatible -storage providers  (koofr) [snip] Storage> koofr Option provider. Choose -your storage provider. Choose a number from below, or type in your own -value. Press Enter to leave empty. 1 / Koofr, https://app.koofr.net/ - (koofr) 2 / Digi Storage, https://storage.rcs-rds.ro/  (digistorage) 3 -/ Any other Koofr API compatible storage service  (other) provider> 1 -Option user. Your user name. Enter a value. user> USERNAME Option -password. Your password for rclone (generate one at -https://app.koofr.net/app/admin/preferences/password). Choose an -alternative below. y) Yes, type in my own password g) Generate random -password y/g> y Enter the password: password: Confirm the password: -password: Edit advanced config? y) Yes n) No (default) y/n> n Remote -config -------------------- [koofr] type = koofr provider = koofr user = -USERNAME password = *** ENCRYPTED *** -------------------- y) Yes this -is OK (default) e) Edit this remote d) Delete this remote y/e/d> y +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Choose a number from below, or type in your own value [snip] +XX / Mega  "mega" [snip] Storage> mega User name user> you@example.com +Password. y) Yes type in my own password g) Generate random password n) +No leave this optional password blank y/g/n> y Enter the password: +password: Confirm the password: password: Remote config +-------------------- [remote] type = mega user = you@example.com pass = +*** ENCRYPTED *** -------------------- y) Yes this is OK e) Edit this +remote d) Delete this remote y/e/d> y - You can choose to edit advanced config in order to enter your own service URL - if you use an on-premise or white label Koofr instance, or choose an alternative - mount instead of your primary storage. + **NOTE:** The encryption keys need to have been already generated after a regular login + via the browser, otherwise attempting to use the credentials in `rclone` will fail. Once configured you can then use `rclone` like this, - List directories in top level of your Koofr + List directories in top level of your Mega - rclone lsd koofr: + rclone lsd remote: - List all the files in your Koofr + List all the files in your Mega + + rclone ls remote: + + To copy a local directory to an Mega directory called backup + + rclone copy /home/source remote:backup + + ### Modification times and hashes + + Mega does not support modification times or hashes yet. + + ### Restricted filename characters + + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | NUL | 0x00 | ␀ | + | / | 0x2F | / | + + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. + + ### Duplicated files + + Mega can have two files with exactly the same name and path (unlike a + normal file system). + + Duplicated files cause problems with the syncing and you will see + messages in the log about duplicates. + + Use `rclone dedupe` to fix duplicated files. + + ### Failure to log-in + + #### Object not found + + If you are connecting to your Mega remote for the first time, + to test access and synchronization, you may receive an error such as + +Failed to create file system for "my-mega-remote:": couldn't login: +Object (typically, node or user) not found + + + The diagnostic steps often recommended in the [rclone forum](https://forum.rclone.org/search?q=mega) + start with the **MEGAcmd** utility. Note that this refers to + the official C++ command from https://github.com/meganz/MEGAcmd + and not the go language built command from t3rm1n4l/megacmd + that is no longer maintained. + + Follow the instructions for installing MEGAcmd and try accessing + your remote as they recommend. You can establish whether or not + you can log in using MEGAcmd, and obtain diagnostic information + to help you, and search or work with others in the forum. + +MEGA CMD> login me@example.com Password: Fetching nodes ... Loading +transfers from local cache Login complete as me@example.com +me@example.com:/$ + + + Note that some have found issues with passwords containing special + characters. If you can not log on with rclone, but MEGAcmd logs on + just fine, then consider changing your password temporarily to + pure alphanumeric characters, in case that helps. + + + #### Repeated commands blocks access + + Mega remotes seem to get blocked (reject logins) under "heavy use". + We haven't worked out the exact blocking rules but it seems to be + related to fast paced, successive rclone commands. + + For example, executing this command 90 times in a row `rclone link + remote:file` will cause the remote to become "blocked". This is not an + abnormal situation, for example if you wish to get the public links of + a directory with hundred of files... After more or less a week, the + remote will remote accept rclone logins normally again. + + You can mitigate this issue by mounting the remote it with `rclone + mount`. This will log-in when mounting and a log-out when unmounting + only. You can also run `rclone rcd` and then use `rclone rc` to run + the commands over the API to avoid logging in each time. + + Rclone does not currently close mega sessions (you can see them in the + web interface), however closing the sessions does not solve the issue. + + If you space rclone commands by 3 seconds it will avoid blocking the + remote. We haven't identified the exact blocking rules, so perhaps one + could execute the command 80 times without waiting and avoid blocking + by waiting 3 seconds, then continuing... + + Note that this has been observed by trial and error and might not be + set in stone. + + Other tools seem not to produce this blocking effect, as they use a + different working approach (state-based, using sessionIDs instead of + log-in) which isn't compatible with the current stateless rclone + approach. + + Note that once blocked, the use of other tools (such as megacmd) is + not a sure workaround: following megacmd login times have been + observed in succession for blocked remote: 7 minutes, 20 min, 30min, 30 + min, 30min. Web access looks unaffected though. + + Investigation is continuing in relation to workarounds based on + timeouts, pacers, retrials and tpslimits - if you discover something + relevant, please post on the forum. + + So, if rclone was working nicely and suddenly you are unable to log-in + and you are sure the user and the password are correct, likely you + have got the remote blocked for a while. + + + ### Standard options + + Here are the Standard options specific to mega (Mega). + + #### --mega-user + + User name. + + Properties: + + - Config: user + - Env Var: RCLONE_MEGA_USER + - Type: string + - Required: true + + #### --mega-pass + + Password. + + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + + Properties: + + - Config: pass + - Env Var: RCLONE_MEGA_PASS + - Type: string + - Required: true + + ### Advanced options + + Here are the Advanced options specific to mega (Mega). + + #### --mega-debug + + Output more debug from Mega. + + If this flag is set (along with -vv) it will print further debugging + information from the mega backend. + + Properties: + + - Config: debug + - Env Var: RCLONE_MEGA_DEBUG + - Type: bool + - Default: false + + #### --mega-hard-delete + + Delete files permanently rather than putting them into the trash. + + Normally the mega backend will put all deletions into the trash rather + than permanently deleting them. If you specify this then rclone will + permanently delete objects instead. + + Properties: + + - Config: hard_delete + - Env Var: RCLONE_MEGA_HARD_DELETE + - Type: bool + - Default: false + + #### --mega-use-https + + Use HTTPS for transfers. + + MEGA uses plain text HTTP connections by default. + Some ISPs throttle HTTP connections, this causes transfers to become very slow. + Enabling this will force MEGA to use HTTPS for all transfers. + HTTPS is normally not necessary since all data is already encrypted anyway. + Enabling it will increase CPU usage and add network overhead. + + Properties: + + - Config: use_https + - Env Var: RCLONE_MEGA_USE_HTTPS + - Type: bool + - Default: false + + #### --mega-encoding + + The encoding for the backend. + + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + + Properties: + + - Config: encoding + - Env Var: RCLONE_MEGA_ENCODING + - Type: Encoding + - Default: Slash,InvalidUtf8,Dot + + + + ### Process `killed` + + On accounts with large files or something else, memory usage can significantly increase when executing list/sync instructions. When running on cloud providers (like AWS with EC2), check if the instance type has sufficient memory/CPU to execute the commands. Use the resource monitoring tools to inspect after sending the commands. Look [at this issue](https://forum.rclone.org/t/rclone-with-mega-appears-to-work-only-in-some-accounts/40233/4). + + ## Limitations + + This backend uses the [go-mega go library](https://github.com/t3rm1n4l/go-mega) which is an opensource + go library implementing the Mega API. There doesn't appear to be any + documentation for the mega protocol beyond the [mega C++ SDK](https://github.com/meganz/sdk) source code + so there are likely quite a few errors still remaining in this library. + + Mega allows duplicate files which may confuse rclone. + + # Memory + + The memory backend is an in RAM backend. It does not persist its + data - use the local backend for that. - rclone ls koofr: + The memory backend behaves like a bucket-based remote (e.g. like + s3). Because it has no parameters you can just use it with the + `:memory:` remote name. - To copy a local directory to an Koofr directory called backup + ## Configuration - rclone copy /home/source koofr:backup + You can configure it as a remote like this with `rclone config` too if + you want to: - ### Restricted filename characters +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value [snip] XX / Memory + "memory" [snip] Storage> memory ** See help for memory backend at: +https://rclone.org/memory/ ** - In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) - the following characters are also replaced: +Remote config - | Character | Value | Replacement | - | --------- |:-----:|:-----------:| - | \ | 0x5C | \ | + --------------- + [remote] + type = memory + --------------- - Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), - as they can't be used in XML strings. +y) Yes this is OK (default) +z) Edit this remote +a) Delete this remote y/e/d> y - ### Standard options + Because the memory backend isn't persistent it is most useful for + testing or with an rclone server or rclone mount, e.g. - Here are the Standard options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers). + rclone mount :memory: /mnt/tmp + rclone serve webdav :memory: + rclone serve sftp :memory: - #### --koofr-provider + ### Modification times and hashes - Choose your storage provider. + The memory backend supports MD5 hashes and modification times accurate to 1 nS. - Properties: + ### Restricted filename characters - - Config: provider - - Env Var: RCLONE_KOOFR_PROVIDER - - Type: string - - Required: false - - Examples: - - "koofr" - - Koofr, https://app.koofr.net/ - - "digistorage" - - Digi Storage, https://storage.rcs-rds.ro/ - - "other" - - Any other Koofr API compatible storage service + The memory backend replaces the [default restricted characters + set](https://rclone.org/overview/#restricted-characters). - #### --koofr-endpoint - The Koofr API endpoint to use. - Properties: - - Config: endpoint - - Env Var: RCLONE_KOOFR_ENDPOINT - - Provider: other - - Type: string - - Required: true + # Akamai NetStorage - #### --koofr-user + Paths are specified as `remote:` + You may put subdirectories in too, e.g. `remote:/path/to/dir`. + If you have a CP code you can use that as the folder after the domain such as \\/\\/\. - Your user name. + For example, this is commonly configured with or without a CP code: + * **With a CP code**. `[your-domain-prefix]-nsu.akamaihd.net/123456/subdirectory/` + * **Without a CP code**. `[your-domain-prefix]-nsu.akamaihd.net` - Properties: - - Config: user - - Env Var: RCLONE_KOOFR_USER - - Type: string - - Required: true + See all buckets + rclone lsd remote: + The initial setup for Netstorage involves getting an account and secret. Use `rclone config` to walk you through the setup process. - #### --koofr-password + ## Configuration - Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password). + Here's an example of how to make a remote called `ns1`. - **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + 1. To begin the interactive configuration process, enter this command: - Properties: +rclone config - - Config: password - - Env Var: RCLONE_KOOFR_PASSWORD - - Provider: koofr - - Type: string - - Required: true - #### --koofr-password + 2. Type `n` to create a new remote. - Your password for rclone (generate one at https://storage.rcs-rds.ro/app/admin/preferences/password). +n) New remote +o) Delete remote +p) Quit config e/n/d/q> n - **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). - Properties: + 3. For this example, enter `ns1` when you reach the name> prompt. - - Config: password - - Env Var: RCLONE_KOOFR_PASSWORD - - Provider: digistorage - - Type: string - - Required: true +name> ns1 - #### --koofr-password - Your password for rclone (generate one at your service's settings page). + 4. Enter `netstorage` as the type of storage to configure. - **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +Type of storage to configure. Enter a string value. Press Enter for the +default (""). Choose a number from below, or type in your own value XX / +NetStorage  "netstorage" Storage> netstorage - Properties: - - Config: password - - Env Var: RCLONE_KOOFR_PASSWORD - - Provider: other - - Type: string - - Required: true + 5. Select between the HTTP or HTTPS protocol. Most users should choose HTTPS, which is the default. HTTP is provided primarily for debugging purposes. - ### Advanced options +Enter a string value. Press Enter for the default (""). Choose a number +from below, or type in your own value 1 / HTTP protocol  "http" 2 / +HTTPS protocol  "https" protocol> 1 - Here are the Advanced options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers). - #### --koofr-mountid + 6. Specify your NetStorage host, CP code, and any necessary content paths using this format: `///` - Mount ID of the mount to use. +Enter a string value. Press Enter for the default (""). host> +baseball-nsu.akamaihd.net/123456/content/ - If omitted, the primary mount is used. - Properties: + 7. Set the netstorage account name - - Config: mountid - - Env Var: RCLONE_KOOFR_MOUNTID - - Type: string - - Required: false +Enter a string value. Press Enter for the default (""). account> +username - #### --koofr-setmtime - Does the backend support setting modification time. + 8. Set the Netstorage account secret/G2O key which will be used for authentication purposes. Select the `y` option to set your own password then enter your secret. + Note: The secret is stored in the `rclone.conf` file with hex-encoded encryption. - Set this to false if you use a mount ID that points to a Dropbox or Amazon Drive backend. +y) Yes type in my own password +z) Generate random password y/g> y Enter the password: password: + Confirm the password: password: - Properties: - - Config: setmtime - - Env Var: RCLONE_KOOFR_SETMTIME - - Type: bool - - Default: true + 9. View the summary and confirm your remote configuration. - #### --koofr-encoding +[ns1] type = netstorage protocol = http host = +baseball-nsu.akamaihd.net/123456/content/ account = username secret = +*** ENCRYPTED *** -------------------- y) Yes this is OK (default) e) +Edit this remote d) Delete this remote y/e/d> y - The encoding for the backend. - See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + This remote is called `ns1` and can now be used. - Properties: + ## Example operations - - Config: encoding - - Env Var: RCLONE_KOOFR_ENCODING - - Type: MultiEncoder - - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot + Get started with rclone and NetStorage with these examples. For additional rclone commands, visit https://rclone.org/commands/. + ### See contents of a directory in your project + rclone lsd ns1:/974012/testing/ - ## Limitations + ### Sync the contents local with remote - Note that Koofr is case insensitive so you can't have a file called - "Hello.doc" and one called "hello.doc". + rclone sync . ns1:/974012/testing/ - ## Providers + ### Upload local content to remote + rclone copy notes.txt ns1:/974012/testing/ - ### Koofr + ### Delete content on remote + rclone delete ns1:/974012/testing/notes.txt - This is the original [Koofr](https://koofr.eu) storage provider used as main example and described in the [configuration](#configuration) section above. + ### Move or copy content between CP codes. - ### Digi Storage + Your credentials must have access to two CP codes on the same remote. You can't perform operations between different remotes. - [Digi Storage](https://www.digi.ro/servicii/online/digi-storage) is a cloud storage service run by [Digi.ro](https://www.digi.ro/) that - provides a Koofr API. + rclone move ns1:/974012/testing/notes.txt ns1:/974450/testing2/ - Here is an example of how to make a remote called `ds`. First run: + ## Features - rclone config + ### Symlink Support - This will guide you through an interactive setup process: + The Netstorage backend changes the rclone `--links, -l` behavior. When uploading, instead of creating the .rclonelink file, use the "symlink" API in order to create the corresponding symlink on the remote. The .rclonelink file will not be created, the upload will be intercepted and only the symlink file that matches the source file name with no suffix will be created on the remote. -No remotes found, make a new one? n) New remote s) Set configuration -password q) Quit config n/s/q> n name> ds Option Storage. Type of -storage to configure. Choose a number from below, or type in your own -value. [snip] 22 / Koofr, Digi Storage and other Koofr-compatible -storage providers  (koofr) [snip] Storage> koofr Option provider. Choose -your storage provider. Choose a number from below, or type in your own -value. Press Enter to leave empty. 1 / Koofr, https://app.koofr.net/ - (koofr) 2 / Digi Storage, https://storage.rcs-rds.ro/  (digistorage) 3 -/ Any other Koofr API compatible storage service  (other) provider> 2 -Option user. Your user name. Enter a value. user> USERNAME Option -password. Your password for rclone (generate one at -https://storage.rcs-rds.ro/app/admin/preferences/password). Choose an -alternative below. y) Yes, type in my own password g) Generate random -password y/g> y Enter the password: password: Confirm the password: -password: Edit advanced config? y) Yes n) No (default) y/n> n --------------------- [ds] type = koofr provider = digistorage user = -USERNAME password = *** ENCRYPTED *** -------------------- y) Yes this -is OK (default) e) Edit this remote d) Delete this remote y/e/d> y + This will effectively allow commands like copy/copyto, move/moveto and sync to upload from local to remote and download from remote to local directories with symlinks. Due to internal rclone limitations, it is not possible to upload an individual symlink file to any remote backend. You can always use the "backend symlink" command to create a symlink on the NetStorage server, refer to "symlink" section below. + Individual symlink files on the remote can be used with the commands like "cat" to print the destination name, or "delete" to delete symlink, or copy, copy/to and move/moveto to download from the remote to local. Note: individual symlink files on the remote should be specified including the suffix .rclonelink. - ### Other + **Note**: No file with the suffix .rclonelink should ever exist on the server since it is not possible to actually upload/create a file with .rclonelink suffix with rclone, it can only exist if it is manually created through a non-rclone method on the remote. - You may also want to use another, public or private storage provider that runs a Koofr API compatible service, by simply providing the base URL to connect to. + ### Implicit vs. Explicit Directories - Here is an example of how to make a remote called `other`. First run: + With NetStorage, directories can exist in one of two forms: - rclone config + 1. **Explicit Directory**. This is an actual, physical directory that you have created in a storage group. + 2. **Implicit Directory**. This refers to a directory within a path that has not been physically created. For example, during upload of a file, nonexistent subdirectories can be specified in the target path. NetStorage creates these as "implicit." While the directories aren't physically created, they exist implicitly and the noted path is connected with the uploaded file. - This will guide you through an interactive setup process: + Rclone will intercept all file uploads and mkdir commands for the NetStorage remote and will explicitly issue the mkdir command for each directory in the uploading path. This will help with the interoperability with the other Akamai services such as SFTP and the Content Management Shell (CMShell). Rclone will not guarantee correctness of operations with implicit directories which might have been created as a result of using an upload API directly. -No remotes found, make a new one? n) New remote s) Set configuration -password q) Quit config n/s/q> n name> other Option Storage. Type of -storage to configure. Choose a number from below, or type in your own -value. [snip] 22 / Koofr, Digi Storage and other Koofr-compatible -storage providers  (koofr) [snip] Storage> koofr Option provider. Choose -your storage provider. Choose a number from below, or type in your own -value. Press Enter to leave empty. 1 / Koofr, https://app.koofr.net/ - (koofr) 2 / Digi Storage, https://storage.rcs-rds.ro/  (digistorage) 3 -/ Any other Koofr API compatible storage service  (other) provider> 3 -Option endpoint. The Koofr API endpoint to use. Enter a value. endpoint> -https://koofr.other.org Option user. Your user name. Enter a value. -user> USERNAME Option password. Your password for rclone (generate one -at your service's settings page). Choose an alternative below. y) Yes, -type in my own password g) Generate random password y/g> y Enter the -password: password: Confirm the password: password: Edit advanced -config? y) Yes n) No (default) y/n> n -------------------- [other] type -= koofr provider = other endpoint = https://koofr.other.org user = -USERNAME password = *** ENCRYPTED *** -------------------- y) Yes this -is OK (default) e) Edit this remote d) Delete this remote y/e/d> y + ### `--fast-list` / ListR support + NetStorage remote supports the ListR feature by using the "list" NetStorage API action to return a lexicographical list of all objects within the specified CP code, recursing into subdirectories as they're encountered. - # Mail.ru Cloud + * **Rclone will use the ListR method for some commands by default**. Commands such as `lsf -R` will use ListR by default. To disable this, include the `--disable listR` option to use the non-recursive method of listing objects. - [Mail.ru Cloud](https://cloud.mail.ru/) is a cloud storage provided by a Russian internet company [Mail.Ru Group](https://mail.ru). The official desktop client is [Disk-O:](https://disk-o.cloud/en), available on Windows and Mac OS. + * **Rclone will not use the ListR method for some commands**. Commands such as `sync` don't use ListR by default. To force using the ListR method, include the `--fast-list` option. - ## Features highlights + There are pros and cons of using the ListR method, refer to [rclone documentation](https://rclone.org/docs/#fast-list). In general, the sync command over an existing deep tree on the remote will run faster with the "--fast-list" flag but with extra memory usage as a side effect. It might also result in higher CPU utilization but the whole task can be completed faster. - - Paths may be as deep as required, e.g. `remote:directory/subdirectory` - - Files have a `last modified time` property, directories don't - - Deleted files are by default moved to the trash - - Files and directories can be shared via public links - - Partial uploads or streaming are not supported, file size must be known before upload - - Maximum file size is limited to 2G for a free account, unlimited for paid accounts - - Storage keeps hash for all files and performs transparent deduplication, - the hash algorithm is a modified SHA1 - - If a particular file is already present in storage, one can quickly submit file hash - instead of long file upload (this optimization is supported by rclone) + **Note**: There is a known limitation that "lsf -R" will display number of files in the directory and directory size as -1 when ListR method is used. The workaround is to pass "--disable listR" flag if these numbers are important in the output. - ## Configuration + ### Purge - Here is an example of making a mailru configuration. + NetStorage remote supports the purge feature by using the "quick-delete" NetStorage API action. The quick-delete action is disabled by default for security reasons and can be enabled for the account through the Akamai portal. Rclone will first try to use quick-delete action for the purge command and if this functionality is disabled then will fall back to a standard delete method. - First create a Mail.ru Cloud account and choose a tariff. + **Note**: Read the [NetStorage Usage API](https://learn.akamai.com/en-us/webhelp/netstorage/netstorage-http-api-developer-guide/GUID-15836617-9F50-405A-833C-EA2556756A30.html) for considerations when using "quick-delete". In general, using quick-delete method will not delete the tree immediately and objects targeted for quick-delete may still be accessible. - You will need to log in and create an app password for rclone. Rclone - **will not work** with your normal username and password - it will - give an error like `oauth2: server response missing access_token`. - - Click on your user icon in the top right - - Go to Security / "Пароль и безопасность" - - Click password for apps / "Пароли для внешних приложений" - - Add the password - give it a name - eg "rclone" - - Copy the password and use this password below - your normal login password won't work. + ### Standard options - Now run + Here are the Standard options specific to netstorage (Akamai NetStorage). - rclone config + #### --netstorage-host - This will guide you through an interactive setup process: + Domain+path of NetStorage host to connect to. -No remotes found, make a new one? n) New remote s) Set configuration -password q) Quit config n/s/q> n name> remote Type of storage to -configure. Type of storage to configure. Enter a string value. Press -Enter for the default (""). Choose a number from below, or type in your -own value [snip] XX / Mail.ru Cloud  "mailru" [snip] Storage> mailru -User name (usually email) Enter a string value. Press Enter for the -default (""). user> username@mail.ru Password + Format should be `/` -This must be an app password - rclone will not work with your normal -password. See the Configuration section in the docs for how to make an -app password. y) Yes type in my own password g) Generate random password -y/g> y Enter the password: password: Confirm the password: password: -Skip full upload if there is another file with same data hash. This -feature is called "speedup" or "put by hash". It is especially efficient -in case of generally available files like popular books, video or audio -clips [snip] Enter a boolean value (true or false). Press Enter for the -default ("true"). Choose a number from below, or type in your own value -1 / Enable  "true" 2 / Disable  "false" speedup_enable> 1 Edit advanced -config? (y/n) y) Yes n) No y/n> n Remote config -------------------- -[remote] type = mailru user = username@mail.ru pass = *** ENCRYPTED *** -speedup_enable = true -------------------- y) Yes this is OK e) Edit -this remote d) Delete this remote y/e/d> y + Properties: + - Config: host + - Env Var: RCLONE_NETSTORAGE_HOST + - Type: string + - Required: true - Configuration of this backend does not require a local web browser. - You can use the configured backend as shown below: + #### --netstorage-account - See top level directories + Set the NetStorage account name - rclone lsd remote: + Properties: - Make a new directory + - Config: account + - Env Var: RCLONE_NETSTORAGE_ACCOUNT + - Type: string + - Required: true - rclone mkdir remote:directory + #### --netstorage-secret - List the contents of a directory + Set the NetStorage account secret/G2O key for authentication. - rclone ls remote:directory + Please choose the 'y' option to set your own password then enter your secret. - Sync `/home/local/directory` to the remote path, deleting any - excess files in the path. + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). - rclone sync --interactive /home/local/directory remote:directory + Properties: - ### Modified time + - Config: secret + - Env Var: RCLONE_NETSTORAGE_SECRET + - Type: string + - Required: true - Files support a modification time attribute with up to 1 second precision. - Directories do not have a modification time, which is shown as "Jan 1 1970". + ### Advanced options - ### Hash checksums + Here are the Advanced options specific to netstorage (Akamai NetStorage). - Hash sums use a custom Mail.ru algorithm based on SHA1. - If file size is less than or equal to the SHA1 block size (20 bytes), - its hash is simply its data right-padded with zero bytes. - Hash sum of a larger file is computed as a SHA1 sum of the file data - bytes concatenated with a decimal representation of the data length. + #### --netstorage-protocol - ### Emptying Trash + Select between HTTP or HTTPS protocol. - Removing a file or directory actually moves it to the trash, which is not - visible to rclone but can be seen in a web browser. The trashed file - still occupies part of total quota. If you wish to empty your trash - and free some quota, you can use the `rclone cleanup remote:` command, - which will permanently delete all your trashed files. - This command does not take any path arguments. + Most users should choose HTTPS, which is the default. + HTTP is provided primarily for debugging purposes. - ### Quota information + Properties: - To view your current quota you can use the `rclone about remote:` - command which will display your usage limit (quota) and the current usage. + - Config: protocol + - Env Var: RCLONE_NETSTORAGE_PROTOCOL + - Type: string + - Default: "https" + - Examples: + - "http" + - HTTP protocol + - "https" + - HTTPS protocol - ### Restricted filename characters + ## Backend commands - In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) - the following characters are also replaced: + Here are the commands specific to the netstorage backend. - | Character | Value | Replacement | - | --------- |:-----:|:-----------:| - | " | 0x22 | " | - | * | 0x2A | * | - | : | 0x3A | : | - | < | 0x3C | < | - | > | 0x3E | > | - | ? | 0x3F | ? | - | \ | 0x5C | \ | - | \| | 0x7C | | | + Run them with - Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), - as they can't be used in JSON strings. + rclone backend COMMAND remote: + The help below will explain what arguments each command takes. - ### Standard options + See the [backend](https://rclone.org/commands/rclone_backend/) command for more + info on how to pass options and arguments. - Here are the Standard options specific to mailru (Mail.ru Cloud). + These can be run on a running backend using the rc command + [backend/command](https://rclone.org/rc/#backend-command). - #### --mailru-client-id + ### du - OAuth Client Id. + Return disk usage information for a specified directory - Leave blank normally. + rclone backend du remote: [options] [+] - Properties: + The usage information returned, includes the targeted directory as well as all + files stored in any sub-directories that may exist. - - Config: client_id - - Env Var: RCLONE_MAILRU_CLIENT_ID - - Type: string - - Required: false + ### symlink - #### --mailru-client-secret + You can create a symbolic link in ObjectStore with the symlink action. - OAuth Client Secret. + rclone backend symlink remote: [options] [+] - Leave blank normally. + The desired path location (including applicable sub-directories) ending in + the object that will be the target of the symlink (for example, /links/mylink). + Include the file extension for the object, if applicable. + `rclone backend symlink ` - Properties: - - Config: client_secret - - Env Var: RCLONE_MAILRU_CLIENT_SECRET - - Type: string - - Required: false - #### --mailru-user + # Microsoft Azure Blob Storage - User name (usually email). + Paths are specified as `remote:container` (or `remote:` for the `lsd` + command.) You may put subdirectories in too, e.g. + `remote:container/path/to/dir`. - Properties: + ## Configuration - - Config: user - - Env Var: RCLONE_MAILRU_USER - - Type: string - - Required: true + Here is an example of making a Microsoft Azure Blob Storage + configuration. For a remote called `remote`. First run: - #### --mailru-pass + rclone config - Password. + This will guide you through an interactive setup process: - This must be an app password - rclone will not work with your normal - password. See the Configuration section in the docs for how to make an - app password. +No remotes found, make a new one? n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. Choose a number from below, or type in your own value [snip] +XX / Microsoft Azure Blob Storage  "azureblob" [snip] Storage> azureblob +Storage Account Name account> account_name Storage Account Key key> +base64encodedkey== Endpoint for the service - leave blank normally. +endpoint> Remote config -------------------- [remote] account = +account_name key = base64encodedkey== endpoint = -------------------- y) +Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y - **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + See all containers - Properties: + rclone lsd remote: - - Config: pass - - Env Var: RCLONE_MAILRU_PASS - - Type: string - - Required: true + Make a new container - #### --mailru-speedup-enable + rclone mkdir remote:container - Skip full upload if there is another file with same data hash. + List the contents of a container - This feature is called "speedup" or "put by hash". It is especially efficient - in case of generally available files like popular books, video or audio clips, - because files are searched by hash in all accounts of all mailru users. - It is meaningless and ineffective if source file is unique or encrypted. - Please note that rclone may need local memory and disk space to calculate - content hash in advance and decide whether full upload is required. - Also, if rclone does not know file size in advance (e.g. in case of - streaming or partial uploads), it will not even try this optimization. + rclone ls remote:container - Properties: + Sync `/home/local/directory` to the remote container, deleting any excess + files in the container. - - Config: speedup_enable - - Env Var: RCLONE_MAILRU_SPEEDUP_ENABLE - - Type: bool - - Default: true - - Examples: - - "true" - - Enable - - "false" - - Disable + rclone sync --interactive /home/local/directory remote:container - ### Advanced options + ### --fast-list - Here are the Advanced options specific to mailru (Mail.ru Cloud). + This remote supports `--fast-list` which allows you to use fewer + transactions in exchange for more memory. See the [rclone + docs](https://rclone.org/docs/#fast-list) for more details. - #### --mailru-token + ### Modification times and hashes - OAuth Access Token as a JSON blob. + The modification time is stored as metadata on the object with the + `mtime` key. It is stored using RFC3339 Format time with nanosecond + precision. The metadata is supplied during directory listings so + there is no performance overhead to using it. - Properties: + If you wish to use the Azure standard `LastModified` time stored on + the object as the modified time, then use the `--use-server-modtime` + flag. Note that rclone can't set `LastModified`, so using the + `--update` flag when syncing is recommended if using + `--use-server-modtime`. - - Config: token - - Env Var: RCLONE_MAILRU_TOKEN - - Type: string - - Required: false + MD5 hashes are stored with blobs. However blobs that were uploaded in + chunks only have an MD5 if the source remote was capable of MD5 + hashes, e.g. the local disk. - #### --mailru-auth-url + ### Performance - Auth server URL. + When uploading large files, increasing the value of + `--azureblob-upload-concurrency` will increase performance at the cost + of using more memory. The default of 16 is set quite conservatively to + use less memory. It maybe be necessary raise it to 64 or higher to + fully utilize a 1 GBit/s link with a single file transfer. - Leave blank to use the provider defaults. + ### Restricted filename characters - Properties: + In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) + the following characters are also replaced: - - Config: auth_url - - Env Var: RCLONE_MAILRU_AUTH_URL - - Type: string - - Required: false + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | / | 0x2F | / | + | \ | 0x5C | \ | - #### --mailru-token-url + File names can also not end with the following characters. + These only get replaced if they are the last character in the name: - Token server url. + | Character | Value | Replacement | + | --------- |:-----:|:-----------:| + | . | 0x2E | . | - Leave blank to use the provider defaults. + Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), + as they can't be used in JSON strings. - Properties: + ### Authentication {#authentication} - - Config: token_url - - Env Var: RCLONE_MAILRU_TOKEN_URL - - Type: string - - Required: false + There are a number of ways of supplying credentials for Azure Blob + Storage. Rclone tries them in the order of the sections below. - #### --mailru-speedup-file-patterns + #### Env Auth - Comma separated list of file name patterns eligible for speedup (put by hash). + If the `env_auth` config parameter is `true` then rclone will pull + credentials from the environment or runtime. - Patterns are case insensitive and can contain '*' or '?' meta characters. + It tries these authentication methods in this order: - Properties: + 1. Environment Variables + 2. Managed Service Identity Credentials + 3. Azure CLI credentials (as used by the az tool) - - Config: speedup_file_patterns - - Env Var: RCLONE_MAILRU_SPEEDUP_FILE_PATTERNS - - Type: string - - Default: "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf" - - Examples: - - "" - - Empty list completely disables speedup (put by hash). - - "*" - - All files will be attempted for speedup. - - "*.mkv,*.avi,*.mp4,*.mp3" - - Only common audio/video files will be tried for put by hash. - - "*.zip,*.gz,*.rar,*.pdf" - - Only common archives or PDF books will be tried for speedup. + These are described in the following sections - #### --mailru-speedup-max-disk + ##### Env Auth: 1. Environment Variables - This option allows you to disable speedup (put by hash) for large files. + If `env_auth` is set and environment variables are present rclone + authenticates a service principal with a secret or certificate, or a + user with a password, depending on which environment variable are set. + It reads configuration from these variables, in the following order: - Reason is that preliminary hashing can exhaust your RAM or disk space. + 1. Service principal with client secret + - `AZURE_TENANT_ID`: ID of the service principal's tenant. Also called its "directory" ID. + - `AZURE_CLIENT_ID`: the service principal's client ID + - `AZURE_CLIENT_SECRET`: one of the service principal's client secrets + 2. Service principal with certificate + - `AZURE_TENANT_ID`: ID of the service principal's tenant. Also called its "directory" ID. + - `AZURE_CLIENT_ID`: the service principal's client ID + - `AZURE_CLIENT_CERTIFICATE_PATH`: path to a PEM or PKCS12 certificate file including the private key. + - `AZURE_CLIENT_CERTIFICATE_PASSWORD`: (optional) password for the certificate file. + - `AZURE_CLIENT_SEND_CERTIFICATE_CHAIN`: (optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to "true" or "1", authentication requests include the x5c header. + 3. User with username and password + - `AZURE_TENANT_ID`: (optional) tenant to authenticate in. Defaults to "organizations". + - `AZURE_CLIENT_ID`: client ID of the application the user will authenticate to + - `AZURE_USERNAME`: a username (usually an email address) + - `AZURE_PASSWORD`: the user's password + 4. Workload Identity + - `AZURE_TENANT_ID`: Tenant to authenticate in. + - `AZURE_CLIENT_ID`: Client ID of the application the user will authenticate to. + - `AZURE_FEDERATED_TOKEN_FILE`: Path to projected service account token file. + - `AZURE_AUTHORITY_HOST`: Authority of an Azure Active Directory endpoint (default: login.microsoftonline.com). - Properties: - - Config: speedup_max_disk - - Env Var: RCLONE_MAILRU_SPEEDUP_MAX_DISK - - Type: SizeSuffix - - Default: 3Gi - - Examples: - - "0" - - Completely disable speedup (put by hash). - - "1G" - - Files larger than 1Gb will be uploaded directly. - - "3G" - - Choose this option if you have less than 3Gb free on local disk. + ##### Env Auth: 2. Managed Service Identity Credentials - #### --mailru-speedup-max-memory + When using Managed Service Identity if the VM(SS) on which this + program is running has a system-assigned identity, it will be used by + default. If the resource has no system-assigned but exactly one + user-assigned identity, the user-assigned identity will be used by + default. - Files larger than the size given below will always be hashed on disk. + If the resource has multiple user-assigned identities you will need to + unset `env_auth` and set `use_msi` instead. See the [`use_msi` + section](#use_msi). - Properties: + ##### Env Auth: 3. Azure CLI credentials (as used by the az tool) - - Config: speedup_max_memory - - Env Var: RCLONE_MAILRU_SPEEDUP_MAX_MEMORY - - Type: SizeSuffix - - Default: 32Mi - - Examples: - - "0" - - Preliminary hashing will always be done in a temporary disk location. - - "32M" - - Do not dedicate more than 32Mb RAM for preliminary hashing. - - "256M" - - You have at most 256Mb RAM free for hash calculations. + Credentials created with the `az` tool can be picked up using `env_auth`. - #### --mailru-check-hash + For example if you were to login with a service principal like this: - What should copy do if file checksum is mismatched or invalid. + az login --service-principal -u XXX -p XXX --tenant XXX - Properties: + Then you could access rclone resources like this: - - Config: check_hash - - Env Var: RCLONE_MAILRU_CHECK_HASH - - Type: bool - - Default: true - - Examples: - - "true" - - Fail with error. - - "false" - - Ignore and continue. + rclone lsf :azureblob,env_auth,account=ACCOUNT:CONTAINER - #### --mailru-user-agent + Or - HTTP user agent used internally by client. + rclone lsf --azureblob-env-auth --azureblob-account=ACCOUNT :azureblob:CONTAINER - Defaults to "rclone/VERSION" or "--user-agent" provided on command line. + Which is analogous to using the `az` tool: - Properties: + az storage blob list --container-name CONTAINER --account-name ACCOUNT --auth-mode login - - Config: user_agent - - Env Var: RCLONE_MAILRU_USER_AGENT - - Type: string - - Required: false + #### Account and Shared Key - #### --mailru-quirks + This is the most straight forward and least flexible way. Just fill + in the `account` and `key` lines and leave the rest blank. - Comma separated list of internal maintenance flags. + #### SAS URL - This option must not be used by an ordinary user. It is intended only to - facilitate remote troubleshooting of backend issues. Strict meaning of - flags is not documented and not guaranteed to persist between releases. - Quirks will be removed when the backend grows stable. - Supported quirks: atomicmkdir binlist unknowndirs + This can be an account level SAS URL or container level SAS URL. - Properties: + To use it leave `account` and `key` blank and fill in `sas_url`. - - Config: quirks - - Env Var: RCLONE_MAILRU_QUIRKS - - Type: string - - Required: false + An account level SAS URL or container level SAS URL can be obtained + from the Azure portal or the Azure Storage Explorer. To get a + container level SAS URL right click on a container in the Azure Blob + explorer in the Azure portal. - #### --mailru-encoding + If you use a container level SAS URL, rclone operations are permitted + only on a particular container, e.g. - The encoding for the backend. + rclone ls azureblob:container - See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + You can also list the single container from the root. This will only + show the container specified by the SAS URL. - Properties: + $ rclone lsd azureblob: + container/ - - Config: encoding - - Env Var: RCLONE_MAILRU_ENCODING - - Type: MultiEncoder - - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot + Note that you can't see or access any other containers - this will + fail + rclone ls azureblob:othercontainer + Container level SAS URLs are useful for temporarily allowing third + parties access to a single container or putting credentials into an + untrusted environment such as a CI build server. - ## Limitations + #### Service principal with client secret - File size limits depend on your account. A single file size is limited by 2G - for a free account and unlimited for paid tariffs. Please refer to the Mail.ru - site for the total uploaded size limits. + If these variables are set, rclone will authenticate with a service principal with a client secret. - Note that Mailru is case insensitive so you can't have a file called - "Hello.doc" and one called "hello.doc". + - `tenant`: ID of the service principal's tenant. Also called its "directory" ID. + - `client_id`: the service principal's client ID + - `client_secret`: one of the service principal's client secrets - # Mega + The credentials can also be placed in a file using the + `service_principal_file` configuration option. - [Mega](https://mega.nz/) is a cloud storage and file hosting service - known for its security feature where all files are encrypted locally - before they are uploaded. This prevents anyone (including employees of - Mega) from accessing the files without knowledge of the key used for - encryption. + #### Service principal with certificate - This is an rclone backend for Mega which supports the file transfer - features of Mega using the same client side encryption. + If these variables are set, rclone will authenticate with a service principal with certificate. - Paths are specified as `remote:path` + - `tenant`: ID of the service principal's tenant. Also called its "directory" ID. + - `client_id`: the service principal's client ID + - `client_certificate_path`: path to a PEM or PKCS12 certificate file including the private key. + - `client_certificate_password`: (optional) password for the certificate file. + - `client_send_certificate_chain`: (optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to "true" or "1", authentication requests include the x5c header. - Paths may be as deep as required, e.g. `remote:directory/subdirectory`. + **NB** `client_certificate_password` must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). - ## Configuration + #### User with username and password - Here is an example of how to make a remote called `remote`. First run: + If these variables are set, rclone will authenticate with username and password. - rclone config + - `tenant`: (optional) tenant to authenticate in. Defaults to "organizations". + - `client_id`: client ID of the application the user will authenticate to + - `username`: a username (usually an email address) + - `password`: the user's password - This will guide you through an interactive setup process: + Microsoft doesn't recommend this kind of authentication, because it's + less secure than other authentication flows. This method is not + interactive, so it isn't compatible with any form of multi-factor + authentication, and the application must already have user or admin + consent. This credential can only authenticate work and school + accounts; it can't authenticate Microsoft accounts. -No remotes found, make a new one? n) New remote s) Set configuration -password q) Quit config n/s/q> n name> remote Type of storage to -configure. Choose a number from below, or type in your own value [snip] -XX / Mega  "mega" [snip] Storage> mega User name user> you@example.com -Password. y) Yes type in my own password g) Generate random password n) -No leave this optional password blank y/g/n> y Enter the password: -password: Confirm the password: password: Remote config --------------------- [remote] type = mega user = you@example.com pass = -*** ENCRYPTED *** -------------------- y) Yes this is OK e) Edit this -remote d) Delete this remote y/e/d> y + **NB** `password` must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + #### Managed Service Identity Credentials {#use_msi} - **NOTE:** The encryption keys need to have been already generated after a regular login - via the browser, otherwise attempting to use the credentials in `rclone` will fail. + If `use_msi` is set then managed service identity credentials are + used. This authentication only works when running in an Azure service. + `env_auth` needs to be unset to use this. - Once configured you can then use `rclone` like this, + However if you have multiple user identities to choose from these must + be explicitly specified using exactly one of the `msi_object_id`, + `msi_client_id`, or `msi_mi_res_id` parameters. - List directories in top level of your Mega + If none of `msi_object_id`, `msi_client_id`, or `msi_mi_res_id` is + set, this is is equivalent to using `env_auth`. - rclone lsd remote: - List all the files in your Mega + ### Standard options - rclone ls remote: + Here are the Standard options specific to azureblob (Microsoft Azure Blob Storage). - To copy a local directory to an Mega directory called backup + #### --azureblob-account - rclone copy /home/source remote:backup + Azure Storage Account Name. - ### Modified time and hashes + Set this to the Azure Storage Account Name in use. - Mega does not support modification times or hashes yet. + Leave blank to use SAS URL or Emulator, otherwise it needs to be set. - ### Restricted filename characters + If this is blank and if env_auth is set it will be read from the + environment variable `AZURE_STORAGE_ACCOUNT_NAME` if possible. - | Character | Value | Replacement | - | --------- |:-----:|:-----------:| - | NUL | 0x00 | ␀ | - | / | 0x2F | / | - Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), - as they can't be used in JSON strings. + Properties: - ### Duplicated files + - Config: account + - Env Var: RCLONE_AZUREBLOB_ACCOUNT + - Type: string + - Required: false - Mega can have two files with exactly the same name and path (unlike a - normal file system). + #### --azureblob-env-auth - Duplicated files cause problems with the syncing and you will see - messages in the log about duplicates. + Read credentials from runtime (environment variables, CLI or MSI). - Use `rclone dedupe` to fix duplicated files. + See the [authentication docs](/azureblob#authentication) for full info. - ### Failure to log-in + Properties: - #### Object not found + - Config: env_auth + - Env Var: RCLONE_AZUREBLOB_ENV_AUTH + - Type: bool + - Default: false - If you are connecting to your Mega remote for the first time, - to test access and synchronization, you may receive an error such as + #### --azureblob-key -Failed to create file system for "my-mega-remote:": couldn't login: -Object (typically, node or user) not found + Storage Account Shared Key. + Leave blank to use SAS URL or Emulator. - The diagnostic steps often recommended in the [rclone forum](https://forum.rclone.org/search?q=mega) - start with the **MEGAcmd** utility. Note that this refers to - the official C++ command from https://github.com/meganz/MEGAcmd - and not the go language built command from t3rm1n4l/megacmd - that is no longer maintained. + Properties: - Follow the instructions for installing MEGAcmd and try accessing - your remote as they recommend. You can establish whether or not - you can log in using MEGAcmd, and obtain diagnostic information - to help you, and search or work with others in the forum. + - Config: key + - Env Var: RCLONE_AZUREBLOB_KEY + - Type: string + - Required: false -MEGA CMD> login me@example.com Password: Fetching nodes ... Loading -transfers from local cache Login complete as me@example.com -me@example.com:/$ + #### --azureblob-sas-url + SAS URL for container level access only. - Note that some have found issues with passwords containing special - characters. If you can not log on with rclone, but MEGAcmd logs on - just fine, then consider changing your password temporarily to - pure alphanumeric characters, in case that helps. + Leave blank if using account/key or Emulator. + Properties: - #### Repeated commands blocks access + - Config: sas_url + - Env Var: RCLONE_AZUREBLOB_SAS_URL + - Type: string + - Required: false - Mega remotes seem to get blocked (reject logins) under "heavy use". - We haven't worked out the exact blocking rules but it seems to be - related to fast paced, successive rclone commands. + #### --azureblob-tenant - For example, executing this command 90 times in a row `rclone link - remote:file` will cause the remote to become "blocked". This is not an - abnormal situation, for example if you wish to get the public links of - a directory with hundred of files... After more or less a week, the - remote will remote accept rclone logins normally again. + ID of the service principal's tenant. Also called its directory ID. - You can mitigate this issue by mounting the remote it with `rclone - mount`. This will log-in when mounting and a log-out when unmounting - only. You can also run `rclone rcd` and then use `rclone rc` to run - the commands over the API to avoid logging in each time. + Set this if using + - Service principal with client secret + - Service principal with certificate + - User with username and password - Rclone does not currently close mega sessions (you can see them in the - web interface), however closing the sessions does not solve the issue. - If you space rclone commands by 3 seconds it will avoid blocking the - remote. We haven't identified the exact blocking rules, so perhaps one - could execute the command 80 times without waiting and avoid blocking - by waiting 3 seconds, then continuing... + Properties: - Note that this has been observed by trial and error and might not be - set in stone. + - Config: tenant + - Env Var: RCLONE_AZUREBLOB_TENANT + - Type: string + - Required: false - Other tools seem not to produce this blocking effect, as they use a - different working approach (state-based, using sessionIDs instead of - log-in) which isn't compatible with the current stateless rclone - approach. + #### --azureblob-client-id - Note that once blocked, the use of other tools (such as megacmd) is - not a sure workaround: following megacmd login times have been - observed in succession for blocked remote: 7 minutes, 20 min, 30min, 30 - min, 30min. Web access looks unaffected though. + The ID of the client in use. - Investigation is continuing in relation to workarounds based on - timeouts, pacers, retrials and tpslimits - if you discover something - relevant, please post on the forum. + Set this if using + - Service principal with client secret + - Service principal with certificate + - User with username and password - So, if rclone was working nicely and suddenly you are unable to log-in - and you are sure the user and the password are correct, likely you - have got the remote blocked for a while. + Properties: - ### Standard options + - Config: client_id + - Env Var: RCLONE_AZUREBLOB_CLIENT_ID + - Type: string + - Required: false - Here are the Standard options specific to mega (Mega). + #### --azureblob-client-secret - #### --mega-user + One of the service principal's client secrets + + Set this if using + - Service principal with client secret - User name. Properties: - - Config: user - - Env Var: RCLONE_MEGA_USER + - Config: client_secret + - Env Var: RCLONE_AZUREBLOB_CLIENT_SECRET - Type: string - - Required: true + - Required: false - #### --mega-pass + #### --azureblob-client-certificate-path - Password. + Path to a PEM or PKCS12 certificate file including the private key. + + Set this if using + - Service principal with certificate - **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: - - Config: pass - - Env Var: RCLONE_MEGA_PASS + - Config: client_certificate_path + - Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PATH - Type: string - - Required: true + - Required: false - ### Advanced options + #### --azureblob-client-certificate-password - Here are the Advanced options specific to mega (Mega). + Password for the certificate file (optional). - #### --mega-debug + Optionally set this if using + - Service principal with certificate - Output more debug from Mega. + And the certificate has a password. - If this flag is set (along with -vv) it will print further debugging - information from the mega backend. - Properties: + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). - - Config: debug - - Env Var: RCLONE_MEGA_DEBUG - - Type: bool - - Default: false + Properties: - #### --mega-hard-delete + - Config: client_certificate_password + - Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PASSWORD + - Type: string + - Required: false - Delete files permanently rather than putting them into the trash. + ### Advanced options - Normally the mega backend will put all deletions into the trash rather - than permanently deleting them. If you specify this then rclone will - permanently delete objects instead. + Here are the Advanced options specific to azureblob (Microsoft Azure Blob Storage). - Properties: + #### --azureblob-client-send-certificate-chain - - Config: hard_delete - - Env Var: RCLONE_MEGA_HARD_DELETE - - Type: bool - - Default: false + Send the certificate chain when using certificate auth. - #### --mega-use-https + Specifies whether an authentication request will include an x5c header + to support subject name / issuer based authentication. When set to + true, authentication requests include the x5c header. - Use HTTPS for transfers. + Optionally set this if using + - Service principal with certificate - MEGA uses plain text HTTP connections by default. - Some ISPs throttle HTTP connections, this causes transfers to become very slow. - Enabling this will force MEGA to use HTTPS for all transfers. - HTTPS is normally not necessary since all data is already encrypted anyway. - Enabling it will increase CPU usage and add network overhead. Properties: - - Config: use_https - - Env Var: RCLONE_MEGA_USE_HTTPS + - Config: client_send_certificate_chain + - Env Var: RCLONE_AZUREBLOB_CLIENT_SEND_CERTIFICATE_CHAIN - Type: bool - Default: false - #### --mega-encoding + #### --azureblob-username - The encoding for the backend. + User name (usually an email address) + + Set this if using + - User with username and password - See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. Properties: - - Config: encoding - - Env Var: RCLONE_MEGA_ENCODING - - Type: MultiEncoder - - Default: Slash,InvalidUtf8,Dot + - Config: username + - Env Var: RCLONE_AZUREBLOB_USERNAME + - Type: string + - Required: false + #### --azureblob-password + The user's password - ### Process `killed` + Set this if using + - User with username and password - On accounts with large files or something else, memory usage can significantly increase when executing list/sync instructions. When running on cloud providers (like AWS with EC2), check if the instance type has sufficient memory/CPU to execute the commands. Use the resource monitoring tools to inspect after sending the commands. Look [at this issue](https://forum.rclone.org/t/rclone-with-mega-appears-to-work-only-in-some-accounts/40233/4). - ## Limitations + **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + + Properties: + + - Config: password + - Env Var: RCLONE_AZUREBLOB_PASSWORD + - Type: string + - Required: false - This backend uses the [go-mega go library](https://github.com/t3rm1n4l/go-mega) which is an opensource - go library implementing the Mega API. There doesn't appear to be any - documentation for the mega protocol beyond the [mega C++ SDK](https://github.com/meganz/sdk) source code - so there are likely quite a few errors still remaining in this library. + #### --azureblob-service-principal-file - Mega allows duplicate files which may confuse rclone. + Path to file containing credentials for use with a service principal. - # Memory + Leave blank normally. Needed only if you want to use a service principal instead of interactive login. - The memory backend is an in RAM backend. It does not persist its - data - use the local backend for that. + $ az ad sp create-for-rbac --name "" \ + --role "Storage Blob Data Owner" \ + --scopes "/subscriptions//resourceGroups//providers/Microsoft.Storage/storageAccounts//blobServices/default/containers/" \ + > azure-principal.json - The memory backend behaves like a bucket-based remote (e.g. like - s3). Because it has no parameters you can just use it with the - `:memory:` remote name. + See ["Create an Azure service principal"](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) and ["Assign an Azure role for access to blob data"](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli) pages for more details. - ## Configuration + It may be more convenient to put the credentials directly into the + rclone config file under the `client_id`, `tenant` and `client_secret` + keys instead of setting `service_principal_file`. - You can configure it as a remote like this with `rclone config` too if - you want to: -No remotes found, make a new one? n) New remote s) Set configuration -password q) Quit config n/s/q> n name> remote Type of storage to -configure. Enter a string value. Press Enter for the default (""). -Choose a number from below, or type in your own value [snip] XX / Memory - "memory" [snip] Storage> memory ** See help for memory backend at: -https://rclone.org/memory/ ** + Properties: -Remote config + - Config: service_principal_file + - Env Var: RCLONE_AZUREBLOB_SERVICE_PRINCIPAL_FILE + - Type: string + - Required: false - --------------- - [remote] - type = memory - --------------- + #### --azureblob-use-msi -y) Yes this is OK (default) -z) Edit this remote -a) Delete this remote y/e/d> y + Use a managed service identity to authenticate (only works in Azure). + When true, use a [managed service identity](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/) + to authenticate to Azure Storage instead of a SAS token or account key. - Because the memory backend isn't persistent it is most useful for - testing or with an rclone server or rclone mount, e.g. + If the VM(SS) on which this program is running has a system-assigned identity, it will + be used by default. If the resource has no system-assigned but exactly one user-assigned identity, + the user-assigned identity will be used by default. If the resource has multiple user-assigned + identities, the identity to use must be explicitly specified using exactly one of the msi_object_id, + msi_client_id, or msi_mi_res_id parameters. - rclone mount :memory: /mnt/tmp - rclone serve webdav :memory: - rclone serve sftp :memory: + Properties: - ### Modified time and hashes + - Config: use_msi + - Env Var: RCLONE_AZUREBLOB_USE_MSI + - Type: bool + - Default: false - The memory backend supports MD5 hashes and modification times accurate to 1 nS. + #### --azureblob-msi-object-id - ### Restricted filename characters + Object ID of the user-assigned MSI to use, if any. - The memory backend replaces the [default restricted characters - set](https://rclone.org/overview/#restricted-characters). + Leave blank if msi_client_id or msi_mi_res_id specified. + Properties: + - Config: msi_object_id + - Env Var: RCLONE_AZUREBLOB_MSI_OBJECT_ID + - Type: string + - Required: false + #### --azureblob-msi-client-id - # Akamai NetStorage + Object ID of the user-assigned MSI to use, if any. - Paths are specified as `remote:` - You may put subdirectories in too, e.g. `remote:/path/to/dir`. - If you have a CP code you can use that as the folder after the domain such as \\/\\/\. + Leave blank if msi_object_id or msi_mi_res_id specified. - For example, this is commonly configured with or without a CP code: - * **With a CP code**. `[your-domain-prefix]-nsu.akamaihd.net/123456/subdirectory/` - * **Without a CP code**. `[your-domain-prefix]-nsu.akamaihd.net` + Properties: + - Config: msi_client_id + - Env Var: RCLONE_AZUREBLOB_MSI_CLIENT_ID + - Type: string + - Required: false - See all buckets - rclone lsd remote: - The initial setup for Netstorage involves getting an account and secret. Use `rclone config` to walk you through the setup process. + #### --azureblob-msi-mi-res-id - ## Configuration + Azure resource ID of the user-assigned MSI to use, if any. - Here's an example of how to make a remote called `ns1`. + Leave blank if msi_client_id or msi_object_id specified. - 1. To begin the interactive configuration process, enter this command: + Properties: -rclone config + - Config: msi_mi_res_id + - Env Var: RCLONE_AZUREBLOB_MSI_MI_RES_ID + - Type: string + - Required: false + #### --azureblob-use-emulator - 2. Type `n` to create a new remote. + Uses local storage emulator if provided as 'true'. -n) New remote -o) Delete remote -p) Quit config e/n/d/q> n + Leave blank if using real azure storage endpoint. + Properties: - 3. For this example, enter `ns1` when you reach the name> prompt. + - Config: use_emulator + - Env Var: RCLONE_AZUREBLOB_USE_EMULATOR + - Type: bool + - Default: false -name> ns1 + #### --azureblob-endpoint + Endpoint for the service. - 4. Enter `netstorage` as the type of storage to configure. + Leave blank normally. -Type of storage to configure. Enter a string value. Press Enter for the -default (""). Choose a number from below, or type in your own value XX / -NetStorage  "netstorage" Storage> netstorage + Properties: + - Config: endpoint + - Env Var: RCLONE_AZUREBLOB_ENDPOINT + - Type: string + - Required: false - 5. Select between the HTTP or HTTPS protocol. Most users should choose HTTPS, which is the default. HTTP is provided primarily for debugging purposes. + #### --azureblob-upload-cutoff -Enter a string value. Press Enter for the default (""). Choose a number -from below, or type in your own value 1 / HTTP protocol  "http" 2 / -HTTPS protocol  "https" protocol> 1 + Cutoff for switching to chunked upload (<= 256 MiB) (deprecated). + Properties: - 6. Specify your NetStorage host, CP code, and any necessary content paths using this format: `///` + - Config: upload_cutoff + - Env Var: RCLONE_AZUREBLOB_UPLOAD_CUTOFF + - Type: string + - Required: false -Enter a string value. Press Enter for the default (""). host> -baseball-nsu.akamaihd.net/123456/content/ + #### --azureblob-chunk-size + Upload chunk size. - 7. Set the netstorage account name + Note that this is stored in memory and there may be up to + "--transfers" * "--azureblob-upload-concurrency" chunks stored at once + in memory. -Enter a string value. Press Enter for the default (""). account> -username + Properties: + - Config: chunk_size + - Env Var: RCLONE_AZUREBLOB_CHUNK_SIZE + - Type: SizeSuffix + - Default: 4Mi - 8. Set the Netstorage account secret/G2O key which will be used for authentication purposes. Select the `y` option to set your own password then enter your secret. - Note: The secret is stored in the `rclone.conf` file with hex-encoded encryption. + #### --azureblob-upload-concurrency -y) Yes type in my own password -z) Generate random password y/g> y Enter the password: password: - Confirm the password: password: + Concurrency for multipart uploads. + This is the number of chunks of the same file that are uploaded + concurrently. - 9. View the summary and confirm your remote configuration. + If you are uploading small numbers of large files over high-speed + links and these uploads do not fully utilize your bandwidth, then + increasing this may help to speed up the transfers. -[ns1] type = netstorage protocol = http host = -baseball-nsu.akamaihd.net/123456/content/ account = username secret = -*** ENCRYPTED *** -------------------- y) Yes this is OK (default) e) -Edit this remote d) Delete this remote y/e/d> y + In tests, upload speed increases almost linearly with upload + concurrency. For example to fill a gigabit pipe it may be necessary to + raise this to 64. Note that this will use more memory. + Note that chunks are stored in memory and there may be up to + "--transfers" * "--azureblob-upload-concurrency" chunks stored at once + in memory. - This remote is called `ns1` and can now be used. + Properties: - ## Example operations + - Config: upload_concurrency + - Env Var: RCLONE_AZUREBLOB_UPLOAD_CONCURRENCY + - Type: int + - Default: 16 - Get started with rclone and NetStorage with these examples. For additional rclone commands, visit https://rclone.org/commands/. + #### --azureblob-list-chunk - ### See contents of a directory in your project + Size of blob list. - rclone lsd ns1:/974012/testing/ + This sets the number of blobs requested in each listing chunk. Default + is the maximum, 5000. "List blobs" requests are permitted 2 minutes + per megabyte to complete. If an operation is taking longer than 2 + minutes per megabyte on average, it will time out ( + [source](https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-blob-service-operations#exceptions-to-default-timeout-interval) + ). This can be used to limit the number of blobs items to return, to + avoid the time out. - ### Sync the contents local with remote + Properties: - rclone sync . ns1:/974012/testing/ + - Config: list_chunk + - Env Var: RCLONE_AZUREBLOB_LIST_CHUNK + - Type: int + - Default: 5000 - ### Upload local content to remote - rclone copy notes.txt ns1:/974012/testing/ + #### --azureblob-access-tier - ### Delete content on remote - rclone delete ns1:/974012/testing/notes.txt + Access tier of blob: hot, cool, cold or archive. - ### Move or copy content between CP codes. + Archived blobs can be restored by setting access tier to hot, cool or + cold. Leave blank if you intend to use default access tier, which is + set at account level - Your credentials must have access to two CP codes on the same remote. You can't perform operations between different remotes. + If there is no "access tier" specified, rclone doesn't apply any tier. + rclone performs "Set Tier" operation on blobs while uploading, if objects + are not modified, specifying "access tier" to new one will have no effect. + If blobs are in "archive tier" at remote, trying to perform data transfer + operations from remote will not be allowed. User should first restore by + tiering blob to "Hot", "Cool" or "Cold". - rclone move ns1:/974012/testing/notes.txt ns1:/974450/testing2/ + Properties: - ## Features + - Config: access_tier + - Env Var: RCLONE_AZUREBLOB_ACCESS_TIER + - Type: string + - Required: false - ### Symlink Support + #### --azureblob-archive-tier-delete - The Netstorage backend changes the rclone `--links, -l` behavior. When uploading, instead of creating the .rclonelink file, use the "symlink" API in order to create the corresponding symlink on the remote. The .rclonelink file will not be created, the upload will be intercepted and only the symlink file that matches the source file name with no suffix will be created on the remote. + Delete archive tier blobs before overwriting. - This will effectively allow commands like copy/copyto, move/moveto and sync to upload from local to remote and download from remote to local directories with symlinks. Due to internal rclone limitations, it is not possible to upload an individual symlink file to any remote backend. You can always use the "backend symlink" command to create a symlink on the NetStorage server, refer to "symlink" section below. + Archive tier blobs cannot be updated. So without this flag, if you + attempt to update an archive tier blob, then rclone will produce the + error: - Individual symlink files on the remote can be used with the commands like "cat" to print the destination name, or "delete" to delete symlink, or copy, copy/to and move/moveto to download from the remote to local. Note: individual symlink files on the remote should be specified including the suffix .rclonelink. + can't update archive tier blob without --azureblob-archive-tier-delete - **Note**: No file with the suffix .rclonelink should ever exist on the server since it is not possible to actually upload/create a file with .rclonelink suffix with rclone, it can only exist if it is manually created through a non-rclone method on the remote. + With this flag set then before rclone attempts to overwrite an archive + tier blob, it will delete the existing blob before uploading its + replacement. This has the potential for data loss if the upload fails + (unlike updating a normal blob) and also may cost more since deleting + archive tier blobs early may be chargable. - ### Implicit vs. Explicit Directories - With NetStorage, directories can exist in one of two forms: + Properties: - 1. **Explicit Directory**. This is an actual, physical directory that you have created in a storage group. - 2. **Implicit Directory**. This refers to a directory within a path that has not been physically created. For example, during upload of a file, nonexistent subdirectories can be specified in the target path. NetStorage creates these as "implicit." While the directories aren't physically created, they exist implicitly and the noted path is connected with the uploaded file. + - Config: archive_tier_delete + - Env Var: RCLONE_AZUREBLOB_ARCHIVE_TIER_DELETE + - Type: bool + - Default: false - Rclone will intercept all file uploads and mkdir commands for the NetStorage remote and will explicitly issue the mkdir command for each directory in the uploading path. This will help with the interoperability with the other Akamai services such as SFTP and the Content Management Shell (CMShell). Rclone will not guarantee correctness of operations with implicit directories which might have been created as a result of using an upload API directly. + #### --azureblob-disable-checksum - ### `--fast-list` / ListR support + Don't store MD5 checksum with object metadata. - NetStorage remote supports the ListR feature by using the "list" NetStorage API action to return a lexicographical list of all objects within the specified CP code, recursing into subdirectories as they're encountered. + Normally rclone will calculate the MD5 checksum of the input before + uploading it so it can add it to metadata on the object. This is great + for data integrity checking but can cause long delays for large files + to start uploading. - * **Rclone will use the ListR method for some commands by default**. Commands such as `lsf -R` will use ListR by default. To disable this, include the `--disable listR` option to use the non-recursive method of listing objects. + Properties: - * **Rclone will not use the ListR method for some commands**. Commands such as `sync` don't use ListR by default. To force using the ListR method, include the `--fast-list` option. + - Config: disable_checksum + - Env Var: RCLONE_AZUREBLOB_DISABLE_CHECKSUM + - Type: bool + - Default: false - There are pros and cons of using the ListR method, refer to [rclone documentation](https://rclone.org/docs/#fast-list). In general, the sync command over an existing deep tree on the remote will run faster with the "--fast-list" flag but with extra memory usage as a side effect. It might also result in higher CPU utilization but the whole task can be completed faster. + #### --azureblob-memory-pool-flush-time - **Note**: There is a known limitation that "lsf -R" will display number of files in the directory and directory size as -1 when ListR method is used. The workaround is to pass "--disable listR" flag if these numbers are important in the output. + How often internal memory buffer pools will be flushed. (no longer used) - ### Purge + Properties: - NetStorage remote supports the purge feature by using the "quick-delete" NetStorage API action. The quick-delete action is disabled by default for security reasons and can be enabled for the account through the Akamai portal. Rclone will first try to use quick-delete action for the purge command and if this functionality is disabled then will fall back to a standard delete method. + - Config: memory_pool_flush_time + - Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_FLUSH_TIME + - Type: Duration + - Default: 1m0s - **Note**: Read the [NetStorage Usage API](https://learn.akamai.com/en-us/webhelp/netstorage/netstorage-http-api-developer-guide/GUID-15836617-9F50-405A-833C-EA2556756A30.html) for considerations when using "quick-delete". In general, using quick-delete method will not delete the tree immediately and objects targeted for quick-delete may still be accessible. + #### --azureblob-memory-pool-use-mmap + Whether to use mmap buffers in internal memory pool. (no longer used) - ### Standard options + Properties: - Here are the Standard options specific to netstorage (Akamai NetStorage). + - Config: memory_pool_use_mmap + - Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_USE_MMAP + - Type: bool + - Default: false - #### --netstorage-host + #### --azureblob-encoding - Domain+path of NetStorage host to connect to. + The encoding for the backend. - Format should be `/` + See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. Properties: - - Config: host - - Env Var: RCLONE_NETSTORAGE_HOST - - Type: string - - Required: true + - Config: encoding + - Env Var: RCLONE_AZUREBLOB_ENCODING + - Type: Encoding + - Default: Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8 - #### --netstorage-account + #### --azureblob-public-access - Set the NetStorage account name + Public access level of a container: blob or container. Properties: - - Config: account - - Env Var: RCLONE_NETSTORAGE_ACCOUNT + - Config: public_access + - Env Var: RCLONE_AZUREBLOB_PUBLIC_ACCESS - Type: string - - Required: true + - Required: false + - Examples: + - "" + - The container and its blobs can be accessed only with an authorized request. + - It's a default value. + - "blob" + - Blob data within this container can be read via anonymous request. + - "container" + - Allow full public read access for container and blob data. - #### --netstorage-secret + #### --azureblob-directory-markers - Set the NetStorage account secret/G2O key for authentication. + Upload an empty object with a trailing slash when a new directory is created - Please choose the 'y' option to set your own password then enter your secret. + Empty folders are unsupported for bucket based remotes, this option + creates an empty object ending with "/", to persist the folder. - **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + This object also has the metadata "hdi_isfolder = true" to conform to + the Microsoft standard. + Properties: - - Config: secret - - Env Var: RCLONE_NETSTORAGE_SECRET - - Type: string - - Required: true - - ### Advanced options + - Config: directory_markers + - Env Var: RCLONE_AZUREBLOB_DIRECTORY_MARKERS + - Type: bool + - Default: false - Here are the Advanced options specific to netstorage (Akamai NetStorage). + #### --azureblob-no-check-container - #### --netstorage-protocol + If set, don't attempt to check the container exists or create it. - Select between HTTP or HTTPS protocol. + This can be useful when trying to minimise the number of transactions + rclone does if you know the container exists already. - Most users should choose HTTPS, which is the default. - HTTP is provided primarily for debugging purposes. Properties: - - Config: protocol - - Env Var: RCLONE_NETSTORAGE_PROTOCOL - - Type: string - - Default: "https" - - Examples: - - "http" - - HTTP protocol - - "https" - - HTTPS protocol + - Config: no_check_container + - Env Var: RCLONE_AZUREBLOB_NO_CHECK_CONTAINER + - Type: bool + - Default: false - ## Backend commands + #### --azureblob-no-head-object - Here are the commands specific to the netstorage backend. + If set, do not do HEAD before GET when getting objects. - Run them with + Properties: - rclone backend COMMAND remote: + - Config: no_head_object + - Env Var: RCLONE_AZUREBLOB_NO_HEAD_OBJECT + - Type: bool + - Default: false - The help below will explain what arguments each command takes. - See the [backend](https://rclone.org/commands/rclone_backend/) command for more - info on how to pass options and arguments. - These can be run on a running backend using the rc command - [backend/command](https://rclone.org/rc/#backend-command). + ### Custom upload headers - ### du + You can set custom upload headers with the `--header-upload` flag. - Return disk usage information for a specified directory + - Cache-Control + - Content-Disposition + - Content-Encoding + - Content-Language + - Content-Type - rclone backend du remote: [options] [+] + Eg `--header-upload "Content-Type: text/potato"` - The usage information returned, includes the targeted directory as well as all - files stored in any sub-directories that may exist. + ## Limitations - ### symlink + MD5 sums are only uploaded with chunked files if the source has an MD5 + sum. This will always be the case for a local to azure copy. - You can create a symbolic link in ObjectStore with the symlink action. + `rclone about` is not supported by the Microsoft Azure Blob storage backend. Backends without + this capability cannot determine free space for an rclone mount or + use policy `mfs` (most free space) as a member of an rclone union + remote. - rclone backend symlink remote: [options] [+] + See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) - The desired path location (including applicable sub-directories) ending in - the object that will be the target of the symlink (for example, /links/mylink). - Include the file extension for the object, if applicable. - `rclone backend symlink ` + ## Azure Storage Emulator Support + You can run rclone with the storage emulator (usually _azurite_). + + To do this, just set up a new remote with `rclone config` following + the instructions in the introduction and set `use_emulator` in the + advanced settings as `true`. You do not need to provide a default + account name nor an account key. But you can override them in the + `account` and `key` options. (Prior to v1.61 they were hard coded to + _azurite_'s `devstoreaccount1`.) + Also, if you want to access a storage emulator instance running on a + different machine, you can override the `endpoint` parameter in the + advanced settings, setting it to + `http(s)://:/devstoreaccount1` + (e.g. `http://10.254.2.5:10000/devstoreaccount1`). - # Microsoft Azure Blob Storage + # Microsoft Azure Files Storage - Paths are specified as `remote:container` (or `remote:` for the `lsd` - command.) You may put subdirectories in too, e.g. - `remote:container/path/to/dir`. + Paths are specified as `remote:` You may put subdirectories in too, + e.g. `remote:path/to/dir`. ## Configuration - Here is an example of making a Microsoft Azure Blob Storage + Here is an example of making a Microsoft Azure Files Storage configuration. For a remote called `remote`. First run: rclone config @@ -35761,54 +37407,67 @@ Edit this remote d) Delete this remote y/e/d> y No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] -XX / Microsoft Azure Blob Storage  "azureblob" [snip] Storage> azureblob -Storage Account Name account> account_name Storage Account Key key> -base64encodedkey== Endpoint for the service - leave blank normally. -endpoint> Remote config -------------------- [remote] account = -account_name key = base64encodedkey== endpoint = -------------------- y) -Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y +XX / Microsoft Azure Files Storage  "azurefiles" [snip] +Option account. Azure Storage Account Name. Set this to the Azure +Storage Account Name in use. Leave blank to use SAS URL or connection +string, otherwise it needs to be set. If this is blank and if env_auth +is set it will be read from the environment variable +AZURE_STORAGE_ACCOUNT_NAME if possible. Enter a value. Press Enter to +leave empty. account> account_name - See all containers +Option share_name. Azure Files Share Name. This is required and is the +name of the share to access. Enter a value. Press Enter to leave empty. +share_name> share_name - rclone lsd remote: +Option env_auth. Read credentials from runtime (environment variables, +CLI or MSI). See the authentication docs for full info. Enter a boolean +value (true or false). Press Enter for the default (false). env_auth> - Make a new container +Option key. Storage Account Shared Key. Leave blank to use SAS URL or +connection string. Enter a value. Press Enter to leave empty. key> +base64encodedkey== - rclone mkdir remote:container +Option sas_url. SAS URL. Leave blank if using account/key or connection +string. Enter a value. Press Enter to leave empty. sas_url> - List the contents of a container +Option connection_string. Azure Files Connection String. Enter a value. +Press Enter to leave empty. connection_string> [snip] - rclone ls remote:container +Configuration complete. Options: - type: azurefiles - account: +account_name - share_name: share_name - key: base64encodedkey== Keep +this "remote" remote? y) Yes this is OK (default) e) Edit this remote d) +Delete this remote y/e/d> - Sync `/home/local/directory` to the remote container, deleting any excess - files in the container. - rclone sync --interactive /home/local/directory remote:container + Once configured you can use rclone. - ### --fast-list + See all files in the top level: - This remote supports `--fast-list` which allows you to use fewer - transactions in exchange for more memory. See the [rclone - docs](https://rclone.org/docs/#fast-list) for more details. + rclone lsf remote: - ### Modified time + Make a new directory in the root: - The modified time is stored as metadata on the object with the `mtime` - key. It is stored using RFC3339 Format time with nanosecond - precision. The metadata is supplied during directory listings so - there is no performance overhead to using it. + rclone mkdir remote:dir - If you wish to use the Azure standard `LastModified` time stored on - the object as the modified time, then use the `--use-server-modtime` - flag. Note that rclone can't set `LastModified`, so using the - `--update` flag when syncing is recommended if using - `--use-server-modtime`. + Recursively List the contents: + + rclone ls remote: + + Sync `/home/local/directory` to the remote directory, deleting any + excess files in the directory. + + rclone sync --interactive /home/local/directory remote:dir + + ### Modified time + + The modified time is stored as Azure standard `LastModified` time on + files ### Performance When uploading large files, increasing the value of - `--azureblob-upload-concurrency` will increase performance at the cost + `--azurefiles-upload-concurrency` will increase performance at the cost of using more memory. The default of 16 is set quite conservatively to use less memory. It maybe be necessary raise it to 64 or higher to fully utilize a 1 GBit/s link with a single file transfer. @@ -35820,8 +37479,14 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y | Character | Value | Replacement | | --------- |:-----:|:-----------:| - | / | 0x2F | / | - | \ | 0x5C | \ | + | " | 0x22 | " | + | * | 0x2A | * | + | : | 0x3A | : | + | < | 0x3C | < | + | > | 0x3E | > | + | ? | 0x3F | ? | + | \ | 0x5C | \ | + | \| | 0x7C | | | File names can also not end with the following characters. These only get replaced if they are the last character in the name: @@ -35835,13 +37500,12 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y ### Hashes - MD5 hashes are stored with blobs. However blobs that were uploaded in - chunks only have an MD5 if the source remote was capable of MD5 - hashes, e.g. the local disk. + MD5 hashes are stored with files. Not all files will have MD5 hashes + as these have to be uploaded with the file. ### Authentication {#authentication} - There are a number of ways of supplying credentials for Azure Blob + There are a number of ways of supplying credentials for Azure Files Storage. Rclone tries them in the order of the sections below. #### Env Auth @@ -35908,15 +37572,11 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Then you could access rclone resources like this: - rclone lsf :azureblob,env_auth,account=ACCOUNT:CONTAINER + rclone lsf :azurefiles,env_auth,account=ACCOUNT: Or - rclone lsf --azureblob-env-auth --azureblob-account=ACCOUNT :azureblob:CONTAINER - - Which is analogous to using the `az` tool: - - az storage blob list --container-name CONTAINER --account-name ACCOUNT --auth-mode login + rclone lsf --azurefiles-env-auth --azurefiles-account=ACCOUNT :azurefiles: #### Account and Shared Key @@ -35925,34 +37585,11 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y #### SAS URL - This can be an account level SAS URL or container level SAS URL. - - To use it leave `account` and `key` blank and fill in `sas_url`. - - An account level SAS URL or container level SAS URL can be obtained - from the Azure portal or the Azure Storage Explorer. To get a - container level SAS URL right click on a container in the Azure Blob - explorer in the Azure portal. - - If you use a container level SAS URL, rclone operations are permitted - only on a particular container, e.g. - - rclone ls azureblob:container - - You can also list the single container from the root. This will only - show the container specified by the SAS URL. - - $ rclone lsd azureblob: - container/ - - Note that you can't see or access any other containers - this will - fail + To use it leave `account`, `key` and `connection_string` blank and fill in `sas_url`. - rclone ls azureblob:othercontainer + #### Connection String - Container level SAS URLs are useful for temporarily allowing third - parties access to a single container or putting credentials into an - untrusted environment such as a CI build server. + To use it leave `account`, `key` and "sas_url" blank and fill in `connection_string`. #### Service principal with client secret @@ -36011,15 +37648,15 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y ### Standard options - Here are the Standard options specific to azureblob (Microsoft Azure Blob Storage). + Here are the Standard options specific to azurefiles (Microsoft Azure Files). - #### --azureblob-account + #### --azurefiles-account Azure Storage Account Name. Set this to the Azure Storage Account Name in use. - Leave blank to use SAS URL or Emulator, otherwise it needs to be set. + Leave blank to use SAS URL or connection string, otherwise it needs to be set. If this is blank and if env_auth is set it will be read from the environment variable `AZURE_STORAGE_ACCOUNT_NAME` if possible. @@ -36028,50 +37665,75 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Properties: - Config: account - - Env Var: RCLONE_AZUREBLOB_ACCOUNT + - Env Var: RCLONE_AZUREFILES_ACCOUNT - Type: string - Required: false - #### --azureblob-env-auth + #### --azurefiles-share-name + + Azure Files Share Name. + + This is required and is the name of the share to access. + + + Properties: + + - Config: share_name + - Env Var: RCLONE_AZUREFILES_SHARE_NAME + - Type: string + - Required: false + + #### --azurefiles-env-auth Read credentials from runtime (environment variables, CLI or MSI). - See the [authentication docs](/azureblob#authentication) for full info. + See the [authentication docs](/azurefiles#authentication) for full info. Properties: - Config: env_auth - - Env Var: RCLONE_AZUREBLOB_ENV_AUTH + - Env Var: RCLONE_AZUREFILES_ENV_AUTH - Type: bool - Default: false - #### --azureblob-key + #### --azurefiles-key Storage Account Shared Key. - Leave blank to use SAS URL or Emulator. + Leave blank to use SAS URL or connection string. Properties: - Config: key - - Env Var: RCLONE_AZUREBLOB_KEY + - Env Var: RCLONE_AZUREFILES_KEY - Type: string - Required: false - #### --azureblob-sas-url + #### --azurefiles-sas-url - SAS URL for container level access only. + SAS URL. - Leave blank if using account/key or Emulator. + Leave blank if using account/key or connection string. Properties: - Config: sas_url - - Env Var: RCLONE_AZUREBLOB_SAS_URL + - Env Var: RCLONE_AZUREFILES_SAS_URL - Type: string - Required: false - #### --azureblob-tenant + #### --azurefiles-connection-string + + Azure Files Connection String. + + Properties: + + - Config: connection_string + - Env Var: RCLONE_AZUREFILES_CONNECTION_STRING + - Type: string + - Required: false + + #### --azurefiles-tenant ID of the service principal's tenant. Also called its directory ID. @@ -36084,11 +37746,11 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Properties: - Config: tenant - - Env Var: RCLONE_AZUREBLOB_TENANT + - Env Var: RCLONE_AZUREFILES_TENANT - Type: string - Required: false - #### --azureblob-client-id + #### --azurefiles-client-id The ID of the client in use. @@ -36101,11 +37763,11 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Properties: - Config: client_id - - Env Var: RCLONE_AZUREBLOB_CLIENT_ID + - Env Var: RCLONE_AZUREFILES_CLIENT_ID - Type: string - Required: false - #### --azureblob-client-secret + #### --azurefiles-client-secret One of the service principal's client secrets @@ -36116,11 +37778,11 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Properties: - Config: client_secret - - Env Var: RCLONE_AZUREBLOB_CLIENT_SECRET + - Env Var: RCLONE_AZUREFILES_CLIENT_SECRET - Type: string - Required: false - #### --azureblob-client-certificate-path + #### --azurefiles-client-certificate-path Path to a PEM or PKCS12 certificate file including the private key. @@ -36131,11 +37793,11 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Properties: - Config: client_certificate_path - - Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PATH + - Env Var: RCLONE_AZUREFILES_CLIENT_CERTIFICATE_PATH - Type: string - Required: false - #### --azureblob-client-certificate-password + #### --azurefiles-client-certificate-password Password for the certificate file (optional). @@ -36150,15 +37812,15 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Properties: - Config: client_certificate_password - - Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PASSWORD + - Env Var: RCLONE_AZUREFILES_CLIENT_CERTIFICATE_PASSWORD - Type: string - Required: false ### Advanced options - Here are the Advanced options specific to azureblob (Microsoft Azure Blob Storage). + Here are the Advanced options specific to azurefiles (Microsoft Azure Files). - #### --azureblob-client-send-certificate-chain + #### --azurefiles-client-send-certificate-chain Send the certificate chain when using certificate auth. @@ -36173,11 +37835,11 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Properties: - Config: client_send_certificate_chain - - Env Var: RCLONE_AZUREBLOB_CLIENT_SEND_CERTIFICATE_CHAIN + - Env Var: RCLONE_AZUREFILES_CLIENT_SEND_CERTIFICATE_CHAIN - Type: bool - Default: false - #### --azureblob-username + #### --azurefiles-username User name (usually an email address) @@ -36188,11 +37850,11 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Properties: - Config: username - - Env Var: RCLONE_AZUREBLOB_USERNAME + - Env Var: RCLONE_AZUREFILES_USERNAME - Type: string - Required: false - #### --azureblob-password + #### --azurefiles-password The user's password @@ -36205,22 +37867,24 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Properties: - Config: password - - Env Var: RCLONE_AZUREBLOB_PASSWORD + - Env Var: RCLONE_AZUREFILES_PASSWORD - Type: string - Required: false - #### --azureblob-service-principal-file + #### --azurefiles-service-principal-file Path to file containing credentials for use with a service principal. Leave blank normally. Needed only if you want to use a service principal instead of interactive login. $ az ad sp create-for-rbac --name "" \ - --role "Storage Blob Data Owner" \ + --role "Storage Files Data Owner" \ --scopes "/subscriptions//resourceGroups//providers/Microsoft.Storage/storageAccounts//blobServices/default/containers/" \ > azure-principal.json - See ["Create an Azure service principal"](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) and ["Assign an Azure role for access to blob data"](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli) pages for more details. + See ["Create an Azure service principal"](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) and ["Assign an Azure role for access to files data"](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli) pages for more details. + + **NB** this section needs updating for Azure Files - pull requests appreciated! It may be more convenient to put the credentials directly into the rclone config file under the `client_id`, `tenant` and `client_secret` @@ -36230,11 +37894,11 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Properties: - Config: service_principal_file - - Env Var: RCLONE_AZUREBLOB_SERVICE_PRINCIPAL_FILE + - Env Var: RCLONE_AZUREFILES_SERVICE_PRINCIPAL_FILE - Type: string - Required: false - #### --azureblob-use-msi + #### --azurefiles-use-msi Use a managed service identity to authenticate (only works in Azure). @@ -36250,11 +37914,11 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Properties: - Config: use_msi - - Env Var: RCLONE_AZUREBLOB_USE_MSI + - Env Var: RCLONE_AZUREFILES_USE_MSI - Type: bool - Default: false - #### --azureblob-msi-object-id + #### --azurefiles-msi-object-id Object ID of the user-assigned MSI to use, if any. @@ -36263,11 +37927,11 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Properties: - Config: msi_object_id - - Env Var: RCLONE_AZUREBLOB_MSI_OBJECT_ID + - Env Var: RCLONE_AZUREFILES_MSI_OBJECT_ID - Type: string - Required: false - #### --azureblob-msi-client-id + #### --azurefiles-msi-client-id Object ID of the user-assigned MSI to use, if any. @@ -36276,11 +37940,11 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Properties: - Config: msi_client_id - - Env Var: RCLONE_AZUREBLOB_MSI_CLIENT_ID + - Env Var: RCLONE_AZUREFILES_MSI_CLIENT_ID - Type: string - Required: false - #### --azureblob-msi-mi-res-id + #### --azurefiles-msi-mi-res-id Azure resource ID of the user-assigned MSI to use, if any. @@ -36289,24 +37953,11 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Properties: - Config: msi_mi_res_id - - Env Var: RCLONE_AZUREBLOB_MSI_MI_RES_ID + - Env Var: RCLONE_AZUREFILES_MSI_MI_RES_ID - Type: string - Required: false - #### --azureblob-use-emulator - - Uses local storage emulator if provided as 'true'. - - Leave blank if using real azure storage endpoint. - - Properties: - - - Config: use_emulator - - Env Var: RCLONE_AZUREBLOB_USE_EMULATOR - - Type: bool - - Default: false - - #### --azureblob-endpoint + #### --azurefiles-endpoint Endpoint for the service. @@ -36315,37 +37966,26 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Properties: - Config: endpoint - - Env Var: RCLONE_AZUREBLOB_ENDPOINT + - Env Var: RCLONE_AZUREFILES_ENDPOINT - Type: string - Required: false - #### --azureblob-upload-cutoff - - Cutoff for switching to chunked upload (<= 256 MiB) (deprecated). - - Properties: - - - Config: upload_cutoff - - Env Var: RCLONE_AZUREBLOB_UPLOAD_CUTOFF - - Type: string - - Required: false - - #### --azureblob-chunk-size + #### --azurefiles-chunk-size Upload chunk size. Note that this is stored in memory and there may be up to - "--transfers" * "--azureblob-upload-concurrency" chunks stored at once + "--transfers" * "--azurefile-upload-concurrency" chunks stored at once in memory. Properties: - Config: chunk_size - - Env Var: RCLONE_AZUREBLOB_CHUNK_SIZE + - Env Var: RCLONE_AZUREFILES_CHUNK_SIZE - Type: SizeSuffix - Default: 4Mi - #### --azureblob-upload-concurrency + #### --azurefiles-upload-concurrency Concurrency for multipart uploads. @@ -36356,125 +37996,41 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y links and these uploads do not fully utilize your bandwidth, then increasing this may help to speed up the transfers. - In tests, upload speed increases almost linearly with upload - concurrency. For example to fill a gigabit pipe it may be necessary to - raise this to 64. Note that this will use more memory. - Note that chunks are stored in memory and there may be up to - "--transfers" * "--azureblob-upload-concurrency" chunks stored at once + "--transfers" * "--azurefile-upload-concurrency" chunks stored at once in memory. Properties: - Config: upload_concurrency - - Env Var: RCLONE_AZUREBLOB_UPLOAD_CONCURRENCY + - Env Var: RCLONE_AZUREFILES_UPLOAD_CONCURRENCY - Type: int - Default: 16 - #### --azureblob-list-chunk - - Size of blob list. - - This sets the number of blobs requested in each listing chunk. Default - is the maximum, 5000. "List blobs" requests are permitted 2 minutes - per megabyte to complete. If an operation is taking longer than 2 - minutes per megabyte on average, it will time out ( - [source](https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-blob-service-operations#exceptions-to-default-timeout-interval) - ). This can be used to limit the number of blobs items to return, to - avoid the time out. - - Properties: - - - Config: list_chunk - - Env Var: RCLONE_AZUREBLOB_LIST_CHUNK - - Type: int - - Default: 5000 - - #### --azureblob-access-tier - - Access tier of blob: hot, cool or archive. - - Archived blobs can be restored by setting access tier to hot or - cool. Leave blank if you intend to use default access tier, which is - set at account level - - If there is no "access tier" specified, rclone doesn't apply any tier. - rclone performs "Set Tier" operation on blobs while uploading, if objects - are not modified, specifying "access tier" to new one will have no effect. - If blobs are in "archive tier" at remote, trying to perform data transfer - operations from remote will not be allowed. User should first restore by - tiering blob to "Hot" or "Cool". - - Properties: - - - Config: access_tier - - Env Var: RCLONE_AZUREBLOB_ACCESS_TIER - - Type: string - - Required: false + #### --azurefiles-max-stream-size - #### --azureblob-archive-tier-delete + Max size for streamed files. - Delete archive tier blobs before overwriting. + Azure files needs to know in advance how big the file will be. When + rclone doesn't know it uses this value instead. - Archive tier blobs cannot be updated. So without this flag, if you - attempt to update an archive tier blob, then rclone will produce the - error: + This will be used when rclone is streaming data, the most common uses are: - can't update archive tier blob without --azureblob-archive-tier-delete + - Uploading files with `--vfs-cache-mode off` with `rclone mount` + - Using `rclone rcat` + - Copying files with unknown length - With this flag set then before rclone attempts to overwrite an archive - tier blob, it will delete the existing blob before uploading its - replacement. This has the potential for data loss if the upload fails - (unlike updating a normal blob) and also may cost more since deleting - archive tier blobs early may be chargable. + You will need this much free space in the share as the file will be this size temporarily. Properties: - - Config: archive_tier_delete - - Env Var: RCLONE_AZUREBLOB_ARCHIVE_TIER_DELETE - - Type: bool - - Default: false - - #### --azureblob-disable-checksum - - Don't store MD5 checksum with object metadata. - - Normally rclone will calculate the MD5 checksum of the input before - uploading it so it can add it to metadata on the object. This is great - for data integrity checking but can cause long delays for large files - to start uploading. - - Properties: - - - Config: disable_checksum - - Env Var: RCLONE_AZUREBLOB_DISABLE_CHECKSUM - - Type: bool - - Default: false - - #### --azureblob-memory-pool-flush-time - - How often internal memory buffer pools will be flushed. (no longer used) - - Properties: - - - Config: memory_pool_flush_time - - Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_FLUSH_TIME - - Type: Duration - - Default: 1m0s - - #### --azureblob-memory-pool-use-mmap - - Whether to use mmap buffers in internal memory pool. (no longer used) - - Properties: - - - Config: memory_pool_use_mmap - - Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_USE_MMAP - - Type: bool - - Default: false + - Config: max_stream_size + - Env Var: RCLONE_AZUREFILES_MAX_STREAM_SIZE + - Type: SizeSuffix + - Default: 10Gi - #### --azureblob-encoding + #### --azurefiles-encoding The encoding for the backend. @@ -36483,72 +38039,9 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Properties: - Config: encoding - - Env Var: RCLONE_AZUREBLOB_ENCODING - - Type: MultiEncoder - - Default: Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8 - - #### --azureblob-public-access - - Public access level of a container: blob or container. - - Properties: - - - Config: public_access - - Env Var: RCLONE_AZUREBLOB_PUBLIC_ACCESS - - Type: string - - Required: false - - Examples: - - "" - - The container and its blobs can be accessed only with an authorized request. - - It's a default value. - - "blob" - - Blob data within this container can be read via anonymous request. - - "container" - - Allow full public read access for container and blob data. - - #### --azureblob-directory-markers - - Upload an empty object with a trailing slash when a new directory is created - - Empty folders are unsupported for bucket based remotes, this option - creates an empty object ending with "/", to persist the folder. - - This object also has the metadata "hdi_isfolder = true" to conform to - the Microsoft standard. - - - Properties: - - - Config: directory_markers - - Env Var: RCLONE_AZUREBLOB_DIRECTORY_MARKERS - - Type: bool - - Default: false - - #### --azureblob-no-check-container - - If set, don't attempt to check the container exists or create it. - - This can be useful when trying to minimise the number of transactions - rclone does if you know the container exists already. - - - Properties: - - - Config: no_check_container - - Env Var: RCLONE_AZUREBLOB_NO_CHECK_CONTAINER - - Type: bool - - Default: false - - #### --azureblob-no-head-object - - If set, do not do HEAD before GET when getting objects. - - Properties: - - - Config: no_head_object - - Env Var: RCLONE_AZUREBLOB_NO_HEAD_OBJECT - - Type: bool - - Default: false + - Env Var: RCLONE_AZUREFILES_ENCODING + - Type: Encoding + - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8,Dot @@ -36569,30 +38062,6 @@ Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y MD5 sums are only uploaded with chunked files if the source has an MD5 sum. This will always be the case for a local to azure copy. - `rclone about` is not supported by the Microsoft Azure Blob storage backend. Backends without - this capability cannot determine free space for an rclone mount or - use policy `mfs` (most free space) as a member of an rclone union - remote. - - See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) - - ## Azure Storage Emulator Support - - You can run rclone with the storage emulator (usually _azurite_). - - To do this, just set up a new remote with `rclone config` following - the instructions in the introduction and set `use_emulator` in the - advanced settings as `true`. You do not need to provide a default - account name nor an account key. But you can override them in the - `account` and `key` options. (Prior to v1.61 they were hard coded to - _azurite_'s `devstoreaccount1`.) - - Also, if you want to access a storage emulator instance running on a - different machine, you can override the `endpoint` parameter in the - advanced settings, setting it to - `http(s)://:/devstoreaccount1` - (e.g. `http://10.254.2.5:10000/devstoreaccount1`). - # Microsoft OneDrive Paths are specified as `remote:path` @@ -36721,7 +38190,7 @@ e) Delete this remote y/e/d> y Note: If you have a special region, you may need a different host in step 4 and 5. Here are [some hints](https://github.com/rclone/rclone/blob/bc23bf11db1c78c6ebbf8ea538fbebf7058b4176/backend/onedrive/onedrive.go#L86). - ### Modification time and hashes + ### Modification times and hashes OneDrive allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or @@ -36742,6 +38211,32 @@ e) Delete this remote y/e/d> y For all types of OneDrive you can use the `--checksum` flag. + ### --fast-list + + This remote supports `--fast-list` which allows you to use fewer + transactions in exchange for more memory. See the [rclone + docs](https://rclone.org/docs/#fast-list) for more details. + + This must be enabled with the `--onedrive-delta` flag (or `delta = + true` in the config file) as it can cause performance degradation. + + It does this by using the delta listing facilities of OneDrive which + returns all the files in the remote very efficiently. This is much + more efficient than listing directories recursively and is Microsoft's + recommended way of reading all the file information from a drive. + + This can be useful with `rclone mount` and [rclone rc vfs/refresh + recursive=true](https://rclone.org/rc/#vfs-refresh)) to very quickly fill the mount with + information about all the files. + + The API used for the recursive listing (`ListR`) only supports listing + from the root of the drive. This will become increasingly inefficient + the further away you get from the root as rclone will have to discard + files outside of the directory you are using. + + Some commands (like `rclone lsf -R`) will use `ListR` by default - you + can turn this off with `--disable ListR` if you need to. + ### Restricted filename characters In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) @@ -37153,6 +38648,43 @@ e) Delete this remote y/e/d> y - Type: bool - Default: false + #### --onedrive-delta + + If set rclone will use delta listing to implement recursive listings. + + If this flag is set the the onedrive backend will advertise `ListR` + support for recursive listings. + + Setting this flag speeds up these things greatly: + + rclone lsf -R onedrive: + rclone size onedrive: + rclone rc vfs/refresh recursive=true + + **However** the delta listing API **only** works at the root of the + drive. If you use it not at the root then it recurses from the root + and discards all the data that is not under the directory you asked + for. So it will be correct but may not be very efficient. + + This is why this flag is not set as the default. + + As a rule of thumb if nearly all of your data is under rclone's root + directory (the `root/directory` in `onedrive:root/directory`) then + using this flag will be be a big performance win. If your data is + mostly not under the root then using this flag will be a big + performance loss. + + It is recommended if you are mounting your onedrive at the root + (or near the root when using crypt) and using rclone `rc vfs/refresh`. + + + Properties: + + - Config: delta + - Env Var: RCLONE_ONEDRIVE_DELTA + - Type: bool + - Default: false + #### --onedrive-encoding The encoding for the backend. @@ -37163,7 +38695,7 @@ e) Delete this remote y/e/d> y - Config: encoding - Env Var: RCLONE_ONEDRIVE_ENCODING - - Type: MultiEncoder + - Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot @@ -37437,12 +38969,14 @@ u) Delete this remote y/e/d> y rclone copy /home/source remote:backup - ### Modified time and MD5SUMs + ### Modification times and hashes OpenDrive allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or not. + The MD5 hash algorithm is supported. + ### Restricted filename characters | Character | Value | Replacement | @@ -37516,7 +39050,7 @@ u) Delete this remote y/e/d> y - Config: encoding - Env Var: RCLONE_OPENDRIVE_ENCODING - - Type: MultiEncoder + - Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot #### --opendrive-chunk-size @@ -37667,6 +39201,7 @@ y/e/d> y No authentication ### User Principal + Sample rclone config file for Authentication Provider User Principal: [oos] @@ -37687,6 +39222,7 @@ y/e/d> y - If the user is deleted, the config file will no longer work and may cause automation regressions that use the user's credentials. ### Instance Principal + An OCI compute instance can be authorized to use rclone by using it's identity and certificates as an instance principal. With this approach no credentials have to be stored and managed. @@ -37716,6 +39252,7 @@ y/e/d> y - It is applicable for oci compute instances only. It cannot be used on external instance or resources. ### Resource Principal + Resource principal auth is very similar to instance principal auth but used for resources that are not compute instances such as [serverless functions](https://docs.oracle.com/en-us/iaas/Content/Functions/Concepts/functionsoverview.htm). To use resource principal ensure Rclone process is started with these environment variables set in its process. @@ -37735,6 +39272,7 @@ y/e/d> y provider = resource_principal_auth ### No authentication + Public buckets do not require any authentication mechanism to read objects. Sample rclone configuration file for No authentication: @@ -37745,10 +39283,9 @@ y/e/d> y region = us-ashburn-1 provider = no_auth - ## Options - ### Modified time + ### Modification times and hashes - The modified time is stored as metadata on the object as + The modification time is stored as metadata on the object as `opc-meta-mtime` as floating point since the epoch, accurate to 1 ns. If the modification time needs to be updated rclone will attempt to perform a server @@ -37758,6 +39295,8 @@ y/e/d> y Note that reading this from the object takes an additional `HEAD` request as the metadata isn't returned in object listings. + The MD5 hash algorithm is supported. + ### Multipart uploads rclone supports multipart uploads with OOS which means that it can @@ -38060,7 +39599,7 @@ y/e/d> y - Config: encoding - Env Var: RCLONE_OOS_ENCODING - - Type: MultiEncoder + - Type: Encoding - Default: Slash,InvalidUtf8,Dot #### --oos-leave-parts-on-error @@ -38554,7 +40093,7 @@ remote d) Delete this remote y/e/d> y - Config: encoding - Env Var: RCLONE_QINGSTOR_ENCODING - - Type: MultiEncoder + - Type: Encoding - Default: Slash,Ctl,InvalidUtf8 @@ -38686,7 +40225,7 @@ account Enter a string value. Press Enter for the default y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y ``` - ### Modified time and hashes + ### Modification times and hashes Quatrix allows modification times to be set on objects accurate to 1 microsecond. These will be @@ -38776,7 +40315,7 @@ account Enter a string value. Press Enter for the default Properties: - Config: encoding - Env Var: - RCLONE_QUATRIX_ENCODING - Type: MultiEncoder - + RCLONE_QUATRIX_ENCODING - Type: Encoding - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot #### --quatrix-effective-upload-time @@ -39018,7 +40557,7 @@ rclone copy /home/source mySia:backup - Config: encoding - Env Var: RCLONE_SIA_ENCODING - - Type: MultiEncoder + - Type: Encoding - Default: Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot @@ -39193,7 +40732,7 @@ RCLONE_CONFIG_MYREMOTE_ENV_AUTH=true rclone lsd myremote: `--use-server-modtime`, you can avoid the extra API call and simply upload files whose local modtime is newer than the time it was last uploaded. - ### Modified time + ### Modification times and hashes The modified time is stored as metadata on the object as `X-Object-Meta-Mtime` as floating point since the epoch accurate to 1 @@ -39202,6 +40741,8 @@ RCLONE_CONFIG_MYREMOTE_ENV_AUTH=true rclone lsd myremote: This is a de facto standard (used in the official python-swiftclient amongst others) for storing the modification time for an object. + The MD5 hash algorithm is supported. + ### Restricted filename characters | Character | Value | Replacement | @@ -39548,7 +41089,7 @@ RCLONE_CONFIG_MYREMOTE_ENV_AUTH=true rclone lsd myremote: - Config: encoding - Env Var: RCLONE_SWIFT_ENCODING - - Type: MultiEncoder + - Type: Encoding - Default: Slash,InvalidUtf8 @@ -39652,7 +41193,7 @@ this remote y/e/d> y rclone copy /home/source remote:backup - ### Modified time and hashes ### + ### Modification times and hashes pCloud allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or @@ -39791,7 +41332,7 @@ this remote y/e/d> y - Config: encoding - Env Var: RCLONE_PCLOUD_ENCODING - - Type: MultiEncoder + - Type: Encoding - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot #### --pcloud-root-folder-id @@ -39895,6 +41436,13 @@ Keep this "remote" remote? y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y + ### Modification times and hashes + + PikPak keeps modification times on objects, and updates them when uploading objects, + but it does not support changing only the modification time + + The MD5 hash algorithm is supported. + ### Standard options @@ -40054,7 +41602,7 @@ remote d) Delete this remote y/e/d> y - Config: encoding - Env Var: RCLONE_PIKPAK_ENCODING - - Type: MultiEncoder + - Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot ## Backend commands @@ -40118,15 +41666,16 @@ remote d) Delete this remote y/e/d> y - ## Limitations ## + ## Limitations - ### Hashes ### + ### Hashes may be empty PikPak supports MD5 hash, but sometimes given empty especially for user-uploaded files. - ### Deleted files ### + ### Deleted files still visible with trashed-only - Deleted files will still be visible with `--pikpak-trashed-only` even after the trash emptied. This goes away after few days. + Deleted files will still be visible with `--pikpak-trashed-only` even after the + trash emptied. This goes away after few days. # premiumize.me @@ -40188,7 +41737,7 @@ this remote y/e/d> rclone copy /home/source remote:backup - ### Modified time and hashes + ### Modification times and hashes premiumize.me does not support modification times or hashes, therefore syncing will default to `--size-only` checking. Note that using @@ -40303,7 +41852,7 @@ this remote y/e/d> - Config: encoding - Env Var: RCLONE_PREMIUMIZEME_ENCODING - - Type: MultiEncoder + - Type: Encoding - Default: Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot @@ -40381,10 +41930,12 @@ this remote y/e/d> y rclone copy /home/source remote:backup - ### Modified time + ### Modification times and hashes Proton Drive Bridge does not support updating modification times yet. + The SHA1 hash algorithm is supported. + ### Restricted filename characters Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), also left and @@ -40530,7 +42081,7 @@ this remote y/e/d> y - Config: encoding - Env Var: RCLONE_PROTONDRIVE_ENCODING - - Type: MultiEncoder + - Type: Encoding - Default: Slash,LeftSpace,RightSpace,InvalidUtf8,Dot #### --protondrive-original-file-size @@ -40809,7 +42360,7 @@ k) Quit config e/n/d/r/c/s/q> q - Config: encoding - Env Var: RCLONE_PUTIO_ENCODING - - Type: MultiEncoder + - Type: Encoding - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot @@ -40885,10 +42436,12 @@ this remote y/e/d> y rclone copy /home/source remote:backup - ### Modified time + ### Modification times and hashes Proton Drive Bridge does not support updating modification times yet. + The SHA1 hash algorithm is supported. + ### Restricted filename characters Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), also left and @@ -41034,7 +42587,7 @@ this remote y/e/d> y - Config: encoding - Env Var: RCLONE_PROTONDRIVE_ENCODING - - Type: MultiEncoder + - Type: Encoding - Default: Slash,LeftSpace,RightSpace,InvalidUtf8,Dot #### --protondrive-original-file-size @@ -41449,7 +43002,7 @@ rclone link seafile:dir http://my.seafile.server/d/9ea2455f6f55478bbb0d/ - Config: encoding - Env Var: RCLONE_SEAFILE_ENCODING - - Type: MultiEncoder + - Type: Encoding - Default: Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8 @@ -41769,7 +43322,7 @@ disable_hashcheck to true to disable checksumming entirely, or set shell_type to none to disable all functionality based on remote shell command execution. -Modified time +Modification times and hashes Modified times are stored on the server to 1 second precision. @@ -42431,6 +43984,32 @@ Properties: - Type: string - Required: false +--sftp-copy-is-hardlink + +Set to enable server side copies using hardlinks. + +The SFTP protocol does not define a copy command so normally server side +copies are not allowed with the sftp backend. + +However the SFTP protocol does support hardlinking, and if you enable +this flag then the sftp backend will support server side copies. These +will be implemented by doing a hardlink from the source to the +destination. + +Not all sftp servers support this. + +Note that hardlinking two files together will use no additional space as +the source and the destination will be the same file. + +This feature may be useful backups made with --copy-dest. + +Properties: + +- Config: copy_is_hardlink +- Env Var: RCLONE_SFTP_COPY_IS_HARDLINK +- Type: bool +- Default: false + Limitations On some SFTP servers (e.g. Synology) the paths are different for SSH and @@ -42707,7 +44286,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SMB_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot @@ -43232,7 +44811,7 @@ Paths may be as deep as required, e.g. remote:directory/subdirectory. NB you can't create files in the top level folder you have to create a folder, which rclone will create as a "Sync Folder" with SugarSync. -Modified time and hashes +Modification times and hashes SugarSync does not support modification times or hashes, therefore syncing will default to --size-only checking. Note that using --update @@ -43400,7 +44979,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SUGARSYNC_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Ctl,InvalidUtf8,Dot Limitations @@ -43495,7 +45074,7 @@ To copy a local directory to an Uptobox directory called backup rclone copy /home/source remote:backup -Modified time and hashes +Modification times and hashes Uptobox supports neither modified times nor checksums. All timestamps will read as that set by --default-time. @@ -43555,7 +45134,7 @@ Properties: - Config: encoding - Env Var: RCLONE_UPTOBOX_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot @@ -43576,8 +45155,8 @@ During the initial setup with rclone config you will specify the upstream remotes as a space separated list. The upstream remotes can either be a local paths or other remotes. -The attributes :ro, :nc and :nc can be attached to the end of the remote -to tag the remote as read only, no create or writeback, e.g. +The attributes :ro, :nc and :writeback can be attached to the end of the +remote to tag the remote as read only, no create or writeback, e.g. remote:directory/subdirectory:ro or remote:directory/subdirectory:nc. - :ro means files will only be read from here and never written @@ -43979,7 +45558,9 @@ This will guide you through an interactive setup process: \ (sharepoint) 5 / Sharepoint with NTLM authentication, usually self-hosted or on-premises \ (sharepoint-ntlm) - 6 / Other site/service or software + 6 / rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol + \ (rclone) + 7 / Other site/service or software \ (other) vendor> 2 User name @@ -44024,7 +45605,7 @@ To copy a local directory to an WebDAV directory called backup rclone copy /home/source remote:backup -Modified time and hashes +Modification times and hashes Plain WebDAV does not support modified times. However when used with Fastmail Files, Owncloud or Nextcloud rclone will support modified @@ -44075,6 +45656,9 @@ Properties: - "sharepoint-ntlm" - Sharepoint with NTLM authentication, usually self-hosted or on-premises + - "rclone" + - rclone WebDAV server to serve a remote over HTTP via the + WebDAV protocol - "other" - Other site/service or software @@ -44305,6 +45889,13 @@ property to compare your documents: --ignore-size --ignore-checksum --update +Rclone + +Use this option if you are hosting remotes over WebDAV provided by +rclone. Read rclone serve webdav for more details. + +rclone serve supports modified times using the X-OC-Mtime header. + dCache dCache is a storage system that supports many protocols and @@ -44454,14 +46045,12 @@ in the path. Yandex paths may be as deep as required, e.g. remote:directory/subdirectory. -Modified time +Modification times and hashes Modified times are supported and are stored accurate to 1 ns in custom metadata called rclone_modified in RFC3339 with nanoseconds format. -MD5 checksums - -MD5 checksums are natively supported by Yandex Disk. +The MD5 hash algorithm is natively supported by Yandex Disk. Emptying Trash @@ -44573,7 +46162,7 @@ Properties: - Config: encoding - Env Var: RCLONE_YANDEX_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Del,Ctl,InvalidUtf8,Dot Limitations @@ -44695,13 +46284,11 @@ in the path. Zoho paths may be as deep as required, eg remote:directory/subdirectory. -Modified time +Modification times and hashes Modified times are currently not supported for Zoho Workdrive -Checksums - -No checksums are supported. +No hash algorithms are supported. Usage information @@ -44822,7 +46409,7 @@ Properties: - Config: encoding - Env Var: RCLONE_ZOHO_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Del,Ctl,InvalidUtf8 Setting up your own client_id @@ -44856,11 +46443,11 @@ For consistencies sake one can also configure a remote of type local in the config file, and access the local filesystem using rclone remote paths, e.g. remote:path/to/wherever, but it is probably easier not to. -Modified time +Modification times -Rclone reads and writes the modified time using an accuracy determined -by the OS. Typically this is 1ns on Linux, 10 ns on Windows and 1 Second -on OS X. +Rclone reads and writes the modification times using an accuracy +determined by the OS. Typically this is 1ns on Linux, 10 ns on Windows +and 1 Second on OS X. Filenames @@ -45262,6 +46849,12 @@ we: - Only checksum the size that stat gave - Don't update the stat info for the file +NB do not use this flag on a Windows Volume Shadow (VSS). For some +unknown reason, files in a VSS sometimes show different sizes from the +directory listing (where the initial stat value comes from on Windows) +and when stat is called on them directly. Other copy tools always use +the direct stat value and setting this flag will disable that. + Properties: - Config: no_check_updated @@ -45370,7 +46963,7 @@ Properties: - Config: encoding - Env Var: RCLONE_LOCAL_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Dot Metadata @@ -45446,6 +47039,211 @@ Options: Changelog +v1.65.0 - 2023-11-26 + +See commits + +- New backends + - Azure Files (karan, moongdal, Nick Craig-Wood) + - ImageKit (Abhinav Dhiman) + - Linkbox (viktor, Nick Craig-Wood) +- New commands + - serve s3: Let rclone act as an S3 compatible server (Mikubill, + Artur Neumann, Saw-jan, Nick Craig-Wood) + - nfsmount: mount command to provide mount mechanism on macOS + without FUSE (Saleh Dindar) + - serve nfs: to serve a remote for use by nfsmount (Saleh Dindar) +- New Features + - install.sh: Clean up temp files in install script (Jacob Hands) + - build + - Update all dependencies (Nick Craig-Wood) + - Refactor version info and icon resource handling on windows + (albertony) + - doc updates (albertony, alfish2000, asdffdsazqqq, Dimitri + Papadopoulos, Herby Gillot, Joda Stößer, Manoj Ghosh, Nick + Craig-Wood) + - Implement --metadata-mapper to transform metatadata with a user + supplied program (Nick Craig-Wood) + - Add ChunkWriterDoesntSeek feature flag and set it for b2 (Nick + Craig-Wood) + - lib/http: Export basic go string functions for use in --template + (Gabriel Espinoza) + - makefile: Use POSIX compatible install arguments (Mina Galić) + - operations + - Use less memory when doing multithread uploads (Nick + Craig-Wood) + - Implement --partial-suffix to control extension of temporary + file names (Volodymyr) + - rc + - Add operations/check to the rc API (Nick Craig-Wood) + - Always report an error as JSON (Nick Craig-Wood) + - Set Last-Modified header for files served by --rc-serve + (Nikita Shoshin) + - size: Dont show duplicate object count when less than 1k + (albertony) +- Bug Fixes + - fshttp: Fix --contimeout being ignored (你知道未来吗) + - march: Fix excessive parallelism when using --no-traverse (Nick + Craig-Wood) + - ncdu: Fix crash when re-entering changed directory after rescan + (Nick Craig-Wood) + - operations + - Fix overwrite of destination when multi-thread transfer + fails (Nick Craig-Wood) + - Fix invalid UTF-8 when truncating file names when not using + --inplace (Nick Craig-Wood) + - serve dnla: Fix crash on graceful exit (wuxingzhong) +- Mount + - Disable mount for freebsd and alias cmount as mount on that + platform (Nick Craig-Wood) +- VFS + - Add --vfs-refresh flag to read all the directories on start + (Beyond Meat) + - Implement Name() method in WriteFileHandle and ReadFileHandle + (Saleh Dindar) + - Add go-billy dependency and make sure vfs.Handle implements + billy.File (Saleh Dindar) + - Error out early if can't upload 0 length file (Nick Craig-Wood) +- Local + - Fix copying from Windows Volume Shadows (Nick Craig-Wood) +- Azure Blob + - Add support for cold tier (Ivan Yanitra) +- B2 + - Implement "rclone backend lifecycle" to read and set bucket + lifecycles (Nick Craig-Wood) + - Implement --b2-lifecycle to control lifecycle when creating + buckets (Nick Craig-Wood) + - Fix listing all buckets when not needed (Nick Craig-Wood) + - Fix multi-thread upload with copyto going to wrong name (Nick + Craig-Wood) + - Fix server side chunked copy when file size was exactly + --b2-copy-cutoff (Nick Craig-Wood) + - Fix streaming chunked files an exact multiple of chunk size + (Nick Craig-Wood) +- Box + - Filter more EventIDs when polling (David Sze) + - Add more logging for polling (David Sze) + - Fix performance problem reading metadata for single files (Nick + Craig-Wood) +- Drive + - Add read/write metadata support (Nick Craig-Wood) + - Add support for SHA-1 and SHA-256 checksums (rinsuki) + - Add --drive-show-all-gdocs to allow unexportable gdocs to be + server side copied (Nick Craig-Wood) + - Add a note that --drive-scope accepts comma-separated list of + scopes (Keigo Imai) + - Fix error updating created time metadata on existing object + (Nick Craig-Wood) + - Fix integration tests by enabling metadata support from the + context (Nick Craig-Wood) +- Dropbox + - Factor batcher into lib/batcher (Nick Craig-Wood) + - Fix missing encoding for rclone purge (Nick Craig-Wood) +- Google Cloud Storage + - Fix 400 Bad request errors when using multi-thread copy (Nick + Craig-Wood) +- Googlephotos + - Implement batcher for uploads (Nick Craig-Wood) +- Hdfs + - Added support for list of namenodes in hdfs remote config + (Tayo-pasedaRJ) +- HTTP + - Implement set backend command to update running backend (Nick + Craig-Wood) + - Enable methods used with WebDAV (Alen Šiljak) +- Jottacloud + - Add support for reading and writing metadata (albertony) +- Onedrive + - Implement ListR method which gives --fast-list support (Nick + Craig-Wood) + - This must be enabled with the --onedrive-delta flag +- Quatrix + - Add partial upload support (Oksana Zhykina) + - Overwrite files on conflict during server-side move (Oksana + Zhykina) +- S3 + - Add Linode provider (Nick Craig-Wood) + - Add docs on how to add a new provider (Nick Craig-Wood) + - Fix no error being returned when creating a bucket we don't own + (Nick Craig-Wood) + - Emit a debug message if anonymous credentials are in use (Nick + Craig-Wood) + - Add --s3-disable-multipart-uploads flag (Nick Craig-Wood) + - Detect looping when using gcs and versions (Nick Craig-Wood) +- SFTP + - Implement --sftp-copy-is-hardlink to server side copy as + hardlink (Nick Craig-Wood) +- Smb + - Fix incorrect about size by switching to + github.com/cloudsoda/go-smb2 fork (Nick Craig-Wood) + - Fix modtime of multithread uploads by setting PartialUploads + (Nick Craig-Wood) +- WebDAV + - Added an rclone vendor to work with rclone serve webdav (Adithya + Kumar) + +v1.64.2 - 2023-10-19 + +See commits + +- Bug Fixes + - selfupdate: Fix "invalid hashsum signature" error (Nick + Craig-Wood) + - build: Fix docker build running out of space (Nick Craig-Wood) + +v1.64.1 - 2023-10-17 + +See commits + +- Bug Fixes + - cmd: Make --progress output logs in the same format as without + (Nick Craig-Wood) + - docs fixes (Dimitri Papadopoulos Orfanos, Herby Gillot, Manoj + Ghosh, Nick Craig-Wood) + - lsjson: Make sure we set the global metadata flag too (Nick + Craig-Wood) + - operations + - Ensure concurrency is no greater than the number of chunks + (Pat Patterson) + - Fix OpenOptions ignored in copy if operation was a + multiThreadCopy (Vitor Gomes) + - Fix error message on delete to have file name (Nick + Craig-Wood) + - serve sftp: Return not supported error for not supported + commands (Nick Craig-Wood) + - build: Upgrade golang.org/x/net to v0.17.0 to fix HTTP/2 rapid + reset (Nick Craig-Wood) + - pacer: Fix b2 deadlock by defaulting max connections to + unlimited (Nick Craig-Wood) +- Mount + - Fix automount not detecting drive is ready (Nick Craig-Wood) +- VFS + - Fix update dir modification time (Saleh Dindar) +- Azure Blob + - Fix "fatal error: concurrent map writes" (Nick Craig-Wood) +- B2 + - Fix multipart upload: corrupted on transfer: sizes differ XXX vs + 0 (Nick Craig-Wood) + - Fix locking window when getting mutipart upload URL (Nick + Craig-Wood) + - Fix server side copies greater than 4GB (Nick Craig-Wood) + - Fix chunked streaming uploads (Nick Craig-Wood) + - Reduce default --b2-upload-concurrency to 4 to reduce memory + usage (Nick Craig-Wood) +- Onedrive + - Fix the configurator to allow /teams/ID in the config (Nick + Craig-Wood) +- Oracleobjectstorage + - Fix OpenOptions being ignored in uploadMultipart with + chunkWriter (Nick Craig-Wood) +- S3 + - Fix slice bounds out of range error when listing (Nick + Craig-Wood) + - Fix OpenOptions being ignored in uploadMultipart with + chunkWriter (Vitor Gomes) +- Storj + - Update storj.io/uplink to v1.12.0 (Kaloyan Raev) + v1.64.0 - 2023-09-11 See commits @@ -45585,7 +47383,7 @@ See commits - Hdfs - Retry "replication in progress" errors when uploading (Nick Craig-Wood) - - Fix uploading to the wrong object on Update with overriden + - Fix uploading to the wrong object on Update with overridden remote name (Nick Craig-Wood) - HTTP - CORS should not be sent if not set (yuudi) @@ -45594,7 +47392,7 @@ See commits - Fix List on a just deleted and remade directory (Nick Craig-Wood) - Oracleobjectstorage - - Use rclone's rate limiter in mutipart transfers (Manoj Ghosh) + - Use rclone's rate limiter in multipart transfers (Manoj Ghosh) - Implement OpenChunkWriter and multi-thread uploads (Manoj Ghosh) - S3 - Refactor multipart upload to use OpenChunkWriter and ChunkWriter @@ -45840,7 +47638,7 @@ See commits - Fix quickxorhash on 32 bit architectures (Nick Craig-Wood) - Report any list errors during rclone cleanup (albertony) - Putio - - Fix uploading to the wrong object on Update with overriden + - Fix uploading to the wrong object on Update with overridden remote name (Nick Craig-Wood) - Fix modification times not being preserved for server side copy and move (Nick Craig-Wood) @@ -45849,7 +47647,7 @@ See commits - Empty directory markers (Jānis Bebrītis, Nick Craig-Wood) - Update Scaleway storage classes (Brian Starkey) - Fix --s3-versions on individual objects (Nick Craig-Wood) - - Fix hang on aborting multpart upload with iDrive e2 (Nick + - Fix hang on aborting multipart upload with iDrive e2 (Nick Craig-Wood) - Fix missing "tier" metadata (Nick Craig-Wood) - Fix V3sign: add missing subresource delete (cc) @@ -45874,7 +47672,7 @@ See commits - Storj - Fix "uplink: too many requests" errors when uploading to the same file (Nick Craig-Wood) - - Fix uploading to the wrong object on Update with overriden + - Fix uploading to the wrong object on Update with overridden remote name (Nick Craig-Wood) - Swift - Ignore 404 error when deleting an object (Nick Craig-Wood) @@ -50756,7 +52554,7 @@ v1.38 - 2017-09-30 - Revert to copy when moving file across file system boundaries - --skip-links to suppress symlink warnings (thanks Zhiming Wang) - Mount - - Re-use rcat internals to support uploads from all remotes + - Reuse rcat internals to support uploads from all remotes - Dropbox - Fix "entry doesn't belong in directory" error - Stop using deprecated API methods @@ -52528,7 +54326,7 @@ email addresses removed from here need to be added to bin/.ignore-emails to make - HNGamingUK connor@earnshawhome.co.uk - Jonta 359397+Jonta@users.noreply.github.com - YenForYang YenForYang@users.noreply.github.com -- Joda Stößer stoesser@yay-digital.de services+github@simjo.st +- SimJoSt / Joda Stößer git@simjo.st - Logeshwaran waranlogesh@gmail.com - Rajat Goel rajat@dropbox.com - r0kk3rz r0kk3rz@gmail.com @@ -52777,6 +54575,38 @@ email addresses removed from here need to be added to bin/.ignore-emails to make - Volodymyr Kit v.kit@maytech.net - David Pedersen limero@me.com - Drew Stinnett drew@drewlink.com +- Pat Patterson pat@backblaze.com +- Herby Gillot herby.gillot@gmail.com +- Nikita Shoshin shoshin_nikita@fastmail.com +- rinsuki 428rinsuki+git@gmail.com +- Beyond Meat 51850644+beyondmeat@users.noreply.github.com +- Saleh Dindar salh@fb.com +- Volodymyr 142890760+vkit-maytech@users.noreply.github.com +- Gabriel Espinoza 31670639+gspinoza@users.noreply.github.com +- Keigo Imai keigo.imai@gmail.com +- Ivan Yanitra iyanitra@tesla-consulting.com +- alfish2000 alfish2000@gmail.com +- wuxingzhong qq330332812@gmail.com +- Adithya Kumar akumar42@protonmail.com +- Tayo-pasedaRJ 138471223+Tayo-pasedaRJ@users.noreply.github.com +- Peter Kreuser logo@kreuser.name +- Piyush +- fotile96 fotile96@users.noreply.github.com +- Luc Ritchie luc.ritchie@gmail.com +- cynful cynful@users.noreply.github.com +- wjielai wjielai@tencent.com +- Jack Deng jackdeng@gmail.com +- Mikubill 31246794+Mikubill@users.noreply.github.com +- Artur Neumann artur@jankaritech.com +- Saw-jan saw.jan.grg3e@gmail.com +- Oksana Zhykina o.zhykina@maytech.net +- karan karan.gupta92@gmail.com +- viktor viktor@yakovchuk.net +- moongdal moongdal@tutanota.com +- Mina Galić freebsd@igalic.co +- Alen Šiljak dev@alensiljak.eu.org +- 你知道未来吗 rkonfj@gmail.com +- Abhinav Dhiman 8640877+ahnv@users.noreply.github.com Contact the rclone project diff --git a/bin/make_manual.py b/bin/make_manual.py index 9c5866325e587..94d3da215cf7f 100755 --- a/bin/make_manual.py +++ b/bin/make_manual.py @@ -54,7 +54,7 @@ "internetarchive.md", "jottacloud.md", "koofr.md", - "linkbox.md" + "linkbox.md", "mailru.md", "mega.md", "memory.md", diff --git a/docs/content/amazonclouddrive.md b/docs/content/amazonclouddrive.md index d7ddec1910715..cffc75e1f7285 100644 --- a/docs/content/amazonclouddrive.md +++ b/docs/content/amazonclouddrive.md @@ -303,7 +303,7 @@ Properties: - Config: encoding - Env Var: RCLONE_ACD_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/azureblob.md b/docs/content/azureblob.md index 6436c5d23bceb..0e4bfd7f2d7ec 100644 --- a/docs/content/azureblob.md +++ b/docs/content/azureblob.md @@ -765,7 +765,7 @@ Properties: - Config: encoding - Env Var: RCLONE_AZUREBLOB_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8 #### --azureblob-public-access diff --git a/docs/content/b2.md b/docs/content/b2.md index 4c49ac45c134b..7f822b42f109c 100644 --- a/docs/content/b2.md +++ b/docs/content/b2.md @@ -508,7 +508,7 @@ Properties: - Config: upload_concurrency - Env Var: RCLONE_B2_UPLOAD_CONCURRENCY - Type: int -- Default: 16 +- Default: 4 #### --b2-disable-checksum @@ -588,6 +588,37 @@ Properties: - Type: bool - Default: false +#### --b2-lifecycle + +Set the number of days deleted files should be kept when creating a bucket. + +On bucket creation, this parameter is used to create a lifecycle rule +for the entire bucket. + +If lifecycle is 0 (the default) it does not create a lifecycle rule so +the default B2 behaviour applies. This is to create versions of files +on delete and overwrite and to keep them indefinitely. + +If lifecycle is >0 then it creates a single rule setting the number of +days before a file that is deleted or overwritten is deleted +permanently. This is known as daysFromHidingToDeleting in the b2 docs. + +The minimum value for this parameter is 1 day. + +You can also enable hard_delete in the config also which will mean +deletions won't cause versions but overwrites will still cause +versions to be made. + +See: [rclone backend lifecycle](#lifecycle) for setting lifecycles after bucket creation. + + +Properties: + +- Config: lifecycle +- Env Var: RCLONE_B2_LIFECYCLE +- Type: int +- Default: 0 + #### --b2-encoding The encoding for the backend. @@ -598,9 +629,76 @@ Properties: - Config: encoding - Env Var: RCLONE_B2_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot +## Backend commands + +Here are the commands specific to the b2 backend. + +Run them with + + rclone backend COMMAND remote: + +The help below will explain what arguments each command takes. + +See the [backend](/commands/rclone_backend/) command for more +info on how to pass options and arguments. + +These can be run on a running backend using the rc command +[backend/command](/rc/#backend-command). + +### lifecycle + +Read or set the lifecycle for a bucket + + rclone backend lifecycle remote: [options] [+] + +This command can be used to read or set the lifecycle for a bucket. + +Usage Examples: + +To show the current lifecycle rules: + + rclone backend lifecycle b2:bucket + +This will dump something like this showing the lifecycle rules. + + [ + { + "daysFromHidingToDeleting": 1, + "daysFromUploadingToHiding": null, + "fileNamePrefix": "" + } + ] + +If there are no lifecycle rules (the default) then it will just return []. + +To reset the current lifecycle rules: + + rclone backend lifecycle b2:bucket -o daysFromHidingToDeleting=30 + rclone backend lifecycle b2:bucket -o daysFromUploadingToHiding=5 -o daysFromHidingToDeleting=1 + +This will run and then print the new lifecycle rules as above. + +Rclone only lets you set lifecycles for the whole bucket with the +fileNamePrefix = "". + +You can't disable versioning with B2. The best you can do is to set +the daysFromHidingToDeleting to 1 day. You can enable hard_delete in +the config also which will mean deletions won't cause versions but +overwrites will still cause versions to be made. + + rclone backend lifecycle b2:bucket -o daysFromHidingToDeleting=1 + +See: https://www.backblaze.com/docs/cloud-storage-lifecycle-rules + + +Options: + +- "daysFromHidingToDeleting": After a file has been hidden for this many days it is deleted. 0 is off. +- "daysFromUploadingToHiding": This many days after uploading a file is hidden + {{< rem autogenerated options stop >}} ## Limitations diff --git a/docs/content/box.md b/docs/content/box.md index 576db2b035b99..9e35c5c4fb126 100644 --- a/docs/content/box.md +++ b/docs/content/box.md @@ -470,7 +470,7 @@ Properties: - Config: encoding - Env Var: RCLONE_BOX_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/changelog.md b/docs/content/changelog.md index ecc5bc5af5e7c..17387e5b0d1b3 100644 --- a/docs/content/changelog.md +++ b/docs/content/changelog.md @@ -5,6 +5,108 @@ description: "Rclone Changelog" # Changelog +## v1.65.0 - 2023-11-26 + +[See commits](https://github.com/rclone/rclone/compare/v1.64.0...v1.65.0) + +* New backends + * Azure Files (karan, moongdal, Nick Craig-Wood) + * ImageKit (Abhinav Dhiman) + * Linkbox (viktor, Nick Craig-Wood) +* New commands + * `serve s3`: Let rclone act as an S3 compatible server (Mikubill, Artur Neumann, Saw-jan, Nick Craig-Wood) + * `nfsmount`: mount command to provide mount mechanism on macOS without FUSE (Saleh Dindar) + * `serve nfs`: to serve a remote for use by `nfsmount` (Saleh Dindar) +* New Features + * install.sh: Clean up temp files in install script (Jacob Hands) + * build + * Update all dependencies (Nick Craig-Wood) + * Refactor version info and icon resource handling on windows (albertony) + * doc updates (albertony, alfish2000, asdffdsazqqq, Dimitri Papadopoulos, Herby Gillot, Joda Stößer, Manoj Ghosh, Nick Craig-Wood) + * Implement `--metadata-mapper` to transform metatadata with a user supplied program (Nick Craig-Wood) + * Add `ChunkWriterDoesntSeek` feature flag and set it for b2 (Nick Craig-Wood) + * lib/http: Export basic go string functions for use in `--template` (Gabriel Espinoza) + * makefile: Use POSIX compatible install arguments (Mina Galić) + * operations + * Use less memory when doing multithread uploads (Nick Craig-Wood) + * Implement `--partial-suffix` to control extension of temporary file names (Volodymyr) + * rc + * Add `operations/check` to the rc API (Nick Craig-Wood) + * Always report an error as JSON (Nick Craig-Wood) + * Set `Last-Modified` header for files served by `--rc-serve` (Nikita Shoshin) + * size: Dont show duplicate object count when less than 1k (albertony) +* Bug Fixes + * fshttp: Fix `--contimeout` being ignored (你知道未来吗) + * march: Fix excessive parallelism when using `--no-traverse` (Nick Craig-Wood) + * ncdu: Fix crash when re-entering changed directory after rescan (Nick Craig-Wood) + * operations + * Fix overwrite of destination when multi-thread transfer fails (Nick Craig-Wood) + * Fix invalid UTF-8 when truncating file names when not using `--inplace` (Nick Craig-Wood) + * serve dnla: Fix crash on graceful exit (wuxingzhong) +* Mount + * Disable mount for freebsd and alias cmount as mount on that platform (Nick Craig-Wood) +* VFS + * Add `--vfs-refresh` flag to read all the directories on start (Beyond Meat) + * Implement Name() method in WriteFileHandle and ReadFileHandle (Saleh Dindar) + * Add go-billy dependency and make sure vfs.Handle implements billy.File (Saleh Dindar) + * Error out early if can't upload 0 length file (Nick Craig-Wood) +* Local + * Fix copying from Windows Volume Shadows (Nick Craig-Wood) +* Azure Blob + * Add support for cold tier (Ivan Yanitra) +* B2 + * Implement "rclone backend lifecycle" to read and set bucket lifecycles (Nick Craig-Wood) + * Implement `--b2-lifecycle` to control lifecycle when creating buckets (Nick Craig-Wood) + * Fix listing all buckets when not needed (Nick Craig-Wood) + * Fix multi-thread upload with copyto going to wrong name (Nick Craig-Wood) + * Fix server side chunked copy when file size was exactly `--b2-copy-cutoff` (Nick Craig-Wood) + * Fix streaming chunked files an exact multiple of chunk size (Nick Craig-Wood) +* Box + * Filter more EventIDs when polling (David Sze) + * Add more logging for polling (David Sze) + * Fix performance problem reading metadata for single files (Nick Craig-Wood) +* Drive + * Add read/write metadata support (Nick Craig-Wood) + * Add support for SHA-1 and SHA-256 checksums (rinsuki) + * Add `--drive-show-all-gdocs` to allow unexportable gdocs to be server side copied (Nick Craig-Wood) + * Add a note that `--drive-scope` accepts comma-separated list of scopes (Keigo Imai) + * Fix error updating created time metadata on existing object (Nick Craig-Wood) + * Fix integration tests by enabling metadata support from the context (Nick Craig-Wood) +* Dropbox + * Factor batcher into lib/batcher (Nick Craig-Wood) + * Fix missing encoding for rclone purge (Nick Craig-Wood) +* Google Cloud Storage + * Fix 400 Bad request errors when using multi-thread copy (Nick Craig-Wood) +* Googlephotos + * Implement batcher for uploads (Nick Craig-Wood) +* Hdfs + * Added support for list of namenodes in hdfs remote config (Tayo-pasedaRJ) +* HTTP + * Implement set backend command to update running backend (Nick Craig-Wood) + * Enable methods used with WebDAV (Alen Šiljak) +* Jottacloud + * Add support for reading and writing metadata (albertony) +* Onedrive + * Implement ListR method which gives `--fast-list` support (Nick Craig-Wood) + * This must be enabled with the `--onedrive-delta` flag +* Quatrix + * Add partial upload support (Oksana Zhykina) + * Overwrite files on conflict during server-side move (Oksana Zhykina) +* S3 + * Add Linode provider (Nick Craig-Wood) + * Add docs on how to add a new provider (Nick Craig-Wood) + * Fix no error being returned when creating a bucket we don't own (Nick Craig-Wood) + * Emit a debug message if anonymous credentials are in use (Nick Craig-Wood) + * Add `--s3-disable-multipart-uploads` flag (Nick Craig-Wood) + * Detect looping when using gcs and versions (Nick Craig-Wood) +* SFTP + * Implement `--sftp-copy-is-hardlink` to server side copy as hardlink (Nick Craig-Wood) +* Smb + * Fix incorrect `about` size by switching to `github.com/cloudsoda/go-smb2` fork (Nick Craig-Wood) + * Fix modtime of multithread uploads by setting PartialUploads (Nick Craig-Wood) +* WebDAV + * Added an rclone vendor to work with `rclone serve webdav` (Adithya Kumar) + ## v1.64.2 - 2023-10-19 [See commits](https://github.com/rclone/rclone/compare/v1.64.1...v1.64.2) diff --git a/docs/content/commands/rclone.md b/docs/content/commands/rclone.md index b9f0f7be4fc12..e1489389dd01b 100644 --- a/docs/content/commands/rclone.md +++ b/docs/content/commands/rclone.md @@ -30,7 +30,7 @@ rclone [flags] --acd-auth-url string Auth server URL --acd-client-id string OAuth Client Id --acd-client-secret string OAuth Client Secret - --acd-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) + --acd-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) --acd-templink-threshold SizeSuffix Files >= this size will be downloaded via their tempLink (default 9Gi) --acd-token string OAuth Access Token as a JSON blob --acd-token-url string Token server url @@ -38,7 +38,7 @@ rclone [flags] --alias-remote string Remote or path to alias --ask-password Allow prompt for password for encrypted configuration (default true) --auto-confirm If enabled, do not request console confirmation - --azureblob-access-tier string Access tier of blob: hot, cool or archive + --azureblob-access-tier string Access tier of blob: hot, cool, cold or archive --azureblob-account string Azure Storage Account Name --azureblob-archive-tier-delete Delete archive tier blobs before overwriting --azureblob-chunk-size SizeSuffix Upload chunk size (default 4Mi) @@ -49,7 +49,7 @@ rclone [flags] --azureblob-client-send-certificate-chain Send the certificate chain when using certificate auth --azureblob-directory-markers Upload an empty object with a trailing slash when a new directory is created --azureblob-disable-checksum Don't store MD5 checksum with object metadata - --azureblob-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8) + --azureblob-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8) --azureblob-endpoint string Endpoint for the service --azureblob-env-auth Read credentials from runtime (environment variables, CLI or MSI) --azureblob-key string Storage Account Shared Key @@ -69,18 +69,43 @@ rclone [flags] --azureblob-use-emulator Uses local storage emulator if provided as 'true' --azureblob-use-msi Use a managed service identity to authenticate (only works in Azure) --azureblob-username string User name (usually an email address) + --azurefiles-account string Azure Storage Account Name + --azurefiles-chunk-size SizeSuffix Upload chunk size (default 4Mi) + --azurefiles-client-certificate-password string Password for the certificate file (optional) (obscured) + --azurefiles-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key + --azurefiles-client-id string The ID of the client in use + --azurefiles-client-secret string One of the service principal's client secrets + --azurefiles-client-send-certificate-chain Send the certificate chain when using certificate auth + --azurefiles-connection-string string Azure Files Connection String + --azurefiles-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8,Dot) + --azurefiles-endpoint string Endpoint for the service + --azurefiles-env-auth Read credentials from runtime (environment variables, CLI or MSI) + --azurefiles-key string Storage Account Shared Key + --azurefiles-max-stream-size SizeSuffix Max size for streamed files (default 10Gi) + --azurefiles-msi-client-id string Object ID of the user-assigned MSI to use, if any + --azurefiles-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any + --azurefiles-msi-object-id string Object ID of the user-assigned MSI to use, if any + --azurefiles-password string The user's password (obscured) + --azurefiles-sas-url string SAS URL + --azurefiles-service-principal-file string Path to file containing credentials for use with a service principal + --azurefiles-share-name string Azure Files Share Name + --azurefiles-tenant string ID of the service principal's tenant. Also called its directory ID + --azurefiles-upload-concurrency int Concurrency for multipart uploads (default 16) + --azurefiles-use-msi Use a managed service identity to authenticate (only works in Azure) + --azurefiles-username string User name (usually an email address) --b2-account string Account ID or Application Key ID --b2-chunk-size SizeSuffix Upload chunk size (default 96Mi) --b2-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4Gi) --b2-disable-checksum Disable checksums for large (> upload cutoff) files --b2-download-auth-duration Duration Time before the authorization token will expire in s or suffix ms|s|m|h|d (default 1w) --b2-download-url string Custom endpoint for downloads - --b2-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --b2-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) --b2-endpoint string Endpoint for the service --b2-hard-delete Permanently delete files on remote removal, otherwise hide files --b2-key string Application Key + --b2-lifecycle int Set the number of days deleted files should be kept when creating a bucket --b2-test-mode string A flag string for X-Bz-Test-Mode header for debugging - --b2-upload-concurrency int Concurrency for multipart uploads (default 16) + --b2-upload-concurrency int Concurrency for multipart uploads (default 4) --b2-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) --b2-version-at Time Show file versions as they were at the specified time (default off) --b2-versions Include old versions in directory listings @@ -93,7 +118,7 @@ rclone [flags] --box-client-id string OAuth Client Id --box-client-secret string OAuth Client Secret --box-commit-retries int Max number of times to try committing a multipart file (default 100) - --box-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot) + --box-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot) --box-impersonate string Impersonate this user ID when using a service account --box-list-chunk int Size of listing chunk 1-1000 (default 1000) --box-owned-by string Only show items owned by the login (email address) passed in @@ -135,7 +160,7 @@ rclone [flags] --chunker-remote string Remote to chunk/unchunk --client-cert string Client SSL certificate (PEM) for mutual TLS auth --client-key string Client SSL private key (PEM) for mutual TLS auth - --color string When to show colors (and other ANSI codes) AUTO|NEVER|ALWAYS (default "AUTO") + --color AUTO|NEVER|ALWAYS When to show colors (and other ANSI codes) AUTO|NEVER|ALWAYS (default AUTO) --combine-upstreams SpaceSepList Upstreams for combining --compare-dest stringArray Include additional comma separated server-side paths during comparison --compress-level int GZIP compression level (-2 to 9) (default -1) @@ -158,7 +183,7 @@ rclone [flags] --crypt-server-side-across-configs Deprecated: use --server-side-across-configs instead --crypt-show-mapping For all files listed show how the names encrypt --crypt-suffix string If this is set it will override the default suffix of ".bin" (default ".bin") - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) --delete-after When synchronizing, delete files on destination after transferring (default) --delete-before When synchronizing, delete files on destination before transferring @@ -176,7 +201,7 @@ rclone [flags] --drive-client-secret string OAuth Client Secret --drive-copy-shortcut-content Server side copy contents of shortcuts instead of the shortcut --drive-disable-http2 Disable drive using http2 (default true) - --drive-encoding MultiEncoder The encoding for the backend (default InvalidUtf8) + --drive-encoding Encoding The encoding for the backend (default InvalidUtf8) --drive-env-auth Get IAM credentials from runtime (environment variables or instance meta data if no env vars) --drive-export-formats string Comma separated list of preferred formats for downloading Google docs (default "docx,xlsx,pptx,svg") --drive-fast-list-bug-fix Work around a bug in Google Drive listing (default true) @@ -185,17 +210,21 @@ rclone [flags] --drive-import-formats string Comma separated list of preferred formats for uploading Google docs --drive-keep-revision-forever Keep new head revision of each file forever --drive-list-chunk int Size of listing chunk 100-1000, 0 to disable (default 1000) + --drive-metadata-labels Bits Control whether labels should be read or written in metadata (default off) + --drive-metadata-owner Bits Control whether owner should be read or written in metadata (default read) + --drive-metadata-permissions Bits Control whether permissions should be read or written in metadata (default off) --drive-pacer-burst int Number of API calls to allow without sleeping (default 100) --drive-pacer-min-sleep Duration Minimum time to sleep between API calls (default 100ms) --drive-resource-key string Resource key for accessing a link-shared file --drive-root-folder-id string ID of the root folder - --drive-scope string Scope that rclone should use when requesting access from drive + --drive-scope string Comma separated list of scopes that rclone should use when requesting access from drive --drive-server-side-across-configs Deprecated: use --server-side-across-configs instead --drive-service-account-credentials string Service Account Credentials JSON blob --drive-service-account-file string Service Account Credentials JSON file path --drive-shared-with-me Only show files that are shared with me + --drive-show-all-gdocs Show all Google Docs including non-exportable ones in listings --drive-size-as-quota Show sizes as storage quota usage, not actual size - --drive-skip-checksum-gphotos Skip MD5 checksum on Google photos and videos only + --drive-skip-checksum-gphotos Skip checksums on Google photos and videos only --drive-skip-dangling-shortcuts If set skip dangling shortcut files --drive-skip-gdocs Skip google documents in all listings --drive-skip-shortcuts If set skip shortcut files @@ -219,7 +248,7 @@ rclone [flags] --dropbox-chunk-size SizeSuffix Upload chunk size (< 150Mi) (default 48Mi) --dropbox-client-id string OAuth Client Id --dropbox-client-secret string OAuth Client Secret - --dropbox-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot) + --dropbox-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot) --dropbox-impersonate string Impersonate this user when using a business account --dropbox-pacer-min-sleep Duration Minimum time to sleep between API calls (default 10ms) --dropbox-shared-files Instructs rclone to work on individual shared files @@ -228,7 +257,7 @@ rclone [flags] --dropbox-token-url string Token server url -n, --dry-run Do a trial run with no permanent changes --dscp string Set DSCP value to connections, value or name, e.g. CS1, LE, DF, AF21 - --dump DumpFlags List of items to dump from: headers,bodies,requests,responses,auth,filters,goroutines,openfiles + --dump DumpFlags List of items to dump from: headers, bodies, requests, responses, auth, filters, goroutines, openfiles, mapper --dump-bodies Dump HTTP headers and bodies - may contain sensitive info --dump-headers Dump HTTP headers - may contain sensitive info --error-on-no-transfer Sets exit code 9 if no files are transferred, useful in scripts @@ -239,11 +268,11 @@ rclone [flags] --fast-list Use recursive list if available; uses more memory but fewer transactions --fichier-api-key string Your API Key, get it from https://1fichier.com/console/params.pl --fichier-cdn Set if you wish to use CDN download links - --fichier-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot) + --fichier-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot) --fichier-file-password string If you want to download a shared file that is password protected, add this parameter (obscured) --fichier-folder-password string If you want to list the files in a shared folder that is password protected, add this parameter (obscured) --fichier-shared-folder string If you want to download a shared folder, add this parameter - --filefabric-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) + --filefabric-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) --filefabric-permanent-token string Permanent Authentication Token --filefabric-root-folder-id string ID of the root folder --filefabric-token string Session Token @@ -263,7 +292,7 @@ rclone [flags] --ftp-disable-mlsd Disable using MLSD even if server advertises support --ftp-disable-tls13 Disable TLS 1.3 (workaround for FTP servers with buggy TLS) --ftp-disable-utf8 Disable using UTF-8 even if server advertises support - --ftp-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,RightSpace,Dot) + --ftp-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,RightSpace,Dot) --ftp-explicit-tls Use Explicit FTPS (FTP over TLS) --ftp-force-list-hidden Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD --ftp-host string FTP host to connect to @@ -285,7 +314,7 @@ rclone [flags] --gcs-client-secret string OAuth Client Secret --gcs-decompress If set this will decompress gzip encoded objects --gcs-directory-markers Upload an empty object with a trailing slash when a new directory is created - --gcs-encoding MultiEncoder The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) + --gcs-encoding Encoding The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) --gcs-endpoint string Endpoint for the service --gcs-env-auth Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars) --gcs-location string Location for the newly created buckets @@ -298,9 +327,13 @@ rclone [flags] --gcs-token-url string Token server url --gcs-user-project string User project --gphotos-auth-url string Auth server URL + --gphotos-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) + --gphotos-batch-mode string Upload file batching sync|async|off (default "sync") + --gphotos-batch-size int Max number of files in upload batch + --gphotos-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) --gphotos-client-id string OAuth Client Id --gphotos-client-secret string OAuth Client Secret - --gphotos-encoding MultiEncoder The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) + --gphotos-encoding Encoding The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) --gphotos-include-archived Also view and download archived media --gphotos-read-only Set to make the Google Photos backend read only --gphotos-read-size Set to read the size of media items @@ -312,8 +345,8 @@ rclone [flags] --hasher-max-age Duration Maximum time to keep checksums in cache (0 = no cache, off = cache forever) (default off) --hasher-remote string Remote to cache checksums for (e.g. myRemote:path) --hdfs-data-transfer-protection string Kerberos data transfer protection: authentication|integrity|privacy - --hdfs-encoding MultiEncoder The encoding for the backend (default Slash,Colon,Del,Ctl,InvalidUtf8,Dot) - --hdfs-namenode string Hadoop name node and port + --hdfs-encoding Encoding The encoding for the backend (default Slash,Colon,Del,Ctl,InvalidUtf8,Dot) + --hdfs-namenode CommaSepList Hadoop name nodes and ports --hdfs-service-principal-name string Kerberos service principal name for the namenode --hdfs-username string Hadoop user name --header stringArray Set HTTP header for all transactions @@ -325,7 +358,7 @@ rclone [flags] --hidrive-client-id string OAuth Client Id --hidrive-client-secret string OAuth Client Secret --hidrive-disable-fetching-member-count Do not fetch number of objects in directories unless it is absolutely necessary - --hidrive-encoding MultiEncoder The encoding for the backend (default Slash,Dot) + --hidrive-encoding Encoding The encoding for the backend (default Slash,Dot) --hidrive-endpoint string Endpoint for the service (default "https://api.hidrive.strato.com/2.1") --hidrive-root-prefix string The root/parent folder for all paths (default "/") --hidrive-scope-access string Access permissions that rclone should use when requesting access from HiDrive (default "rw") @@ -344,8 +377,15 @@ rclone [flags] --ignore-checksum Skip post copy check of checksums --ignore-errors Delete even if there are I/O errors --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files + --imagekit-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Dollar,Question,Hash,Percent,BackSlash,Del,Ctl,InvalidUtf8,Dot,SquareBracket) + --imagekit-endpoint string You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-only-signed Restrict unsigned image URLs If you have configured Restrict unsigned image URLs in your dashboard settings, set this to true + --imagekit-private-key string You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-public-key string You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-upload-tags string Tags to add to the uploaded files, e.g. "tag1,tag2" + --imagekit-versions Include old versions in directory listings --immutable Do not modify files, fail if existing files have been modified --include stringArray Include files matching pattern --include-from stringArray Read file include patterns from file (use - to read from stdin) @@ -353,7 +393,7 @@ rclone [flags] -i, --interactive Enable interactive mode --internetarchive-access-key-id string IAS3 Access Key --internetarchive-disable-checksum Don't ask the server to test against MD5 checksum calculated by rclone (default true) - --internetarchive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot) + --internetarchive-encoding Encoding The encoding for the backend (default Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot) --internetarchive-endpoint string IAS3 Endpoint (default "https://s3.us.archive.org") --internetarchive-front-endpoint string Host of InternetArchive Frontend (default "https://archive.org") --internetarchive-secret-access-key string IAS3 Secret Key (password) @@ -361,7 +401,7 @@ rclone [flags] --jottacloud-auth-url string Auth server URL --jottacloud-client-id string OAuth Client Id --jottacloud-client-secret string OAuth Client Secret - --jottacloud-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot) + --jottacloud-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot) --jottacloud-hard-delete Delete files permanently rather than putting them into the trash --jottacloud-md5-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate the MD5 if required (default 10Mi) --jottacloud-no-versions Avoid server side versioning by deleting files and recreating files instead of overwriting them @@ -369,7 +409,7 @@ rclone [flags] --jottacloud-token-url string Token server url --jottacloud-trashed-only Only show files that are in the trash --jottacloud-upload-resume-limit SizeSuffix Files bigger than this can be resumed if the upload fail's (default 10Mi) - --koofr-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --koofr-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) --koofr-endpoint string The Koofr API endpoint to use --koofr-mountid string Mount ID of the mount to use --koofr-password string Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password) (obscured) @@ -377,10 +417,11 @@ rclone [flags] --koofr-setmtime Does the backend support setting modification time (default true) --koofr-user string Your user name --kv-lock-time Duration Maximum time to keep key-value database locked by process (default 1s) + --linkbox-token string Token from https://www.linkbox.to/admin/account -l, --links Translate symlinks to/from regular files with a '.rclonelink' extension --local-case-insensitive Force the filesystem to report itself as case insensitive --local-case-sensitive Force the filesystem to report itself as case sensitive - --local-encoding MultiEncoder The encoding for the backend (default Slash,Dot) + --local-encoding Encoding The encoding for the backend (default Slash,Dot) --local-no-check-updated Don't check to see if the files change during upload --local-no-preallocate Disable preallocation of disk space for transferred files --local-no-set-modtime Disable setting modtime @@ -390,14 +431,14 @@ rclone [flags] --local-zero-size-links Assume the Stat size of links is zero (and read them instead) (deprecated) --log-file string Log everything to this file --log-format string Comma separated list of log format options (default "date,time") - --log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "NOTICE") + --log-level LogLevel Log level DEBUG|INFO|NOTICE|ERROR (default NOTICE) --log-systemd Activate systemd integration for the logger --low-level-retries int Number of low level retries to do (default 10) --mailru-auth-url string Auth server URL --mailru-check-hash What should copy do if file checksum is mismatched or invalid (default true) --mailru-client-id string OAuth Client Id --mailru-client-secret string OAuth Client Secret - --mailru-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --mailru-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot) --mailru-pass string Password (obscured) --mailru-speedup-enable Skip full upload if there is another file with same data hash (default true) --mailru-speedup-file-patterns string Comma separated list of file name patterns eligible for speedup (put by hash) (default "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf") @@ -416,7 +457,7 @@ rclone [flags] --max-stats-groups int Maximum number of stats groups to keep in memory, on max oldest is discarded (default 1000) --max-transfer SizeSuffix Maximum size of data to transfer (default off) --mega-debug Output more debug from Mega - --mega-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) + --mega-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) --mega-hard-delete Delete files permanently rather than putting them into the trash --mega-pass string Password (obscured) --mega-use-https Use HTTPS for transfers @@ -429,6 +470,7 @@ rclone [flags] --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) --metadata-include stringArray Include metadatas matching pattern --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --metadata-mapper SpaceSepList Program to run to transforming metadata before upload --metadata-set stringArray Add metadata key=value when uploading --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) @@ -447,7 +489,7 @@ rclone [flags] --no-gzip-encoding Don't set Accept-Encoding: gzip --no-traverse Don't traverse destination file system on copy --no-unicode-normalization Don't normalize unicode characters in filenames - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical -x, --one-file-system Don't cross filesystem boundaries (unix/macOS only) --onedrive-access-scopes SpaceSepList Set scopes to be requested by rclone (default Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All Sites.Read.All offline_access) --onedrive-auth-url string Auth server URL @@ -455,9 +497,10 @@ rclone [flags] --onedrive-chunk-size SizeSuffix Chunk size to upload files with - must be multiple of 320k (327,680 bytes) (default 10Mi) --onedrive-client-id string OAuth Client Id --onedrive-client-secret string OAuth Client Secret + --onedrive-delta If set rclone will use delta listing to implement recursive listings --onedrive-drive-id string The ID of the drive to use --onedrive-drive-type string The type of the drive (personal | business | documentLibrary) - --onedrive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot) + --onedrive-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot) --onedrive-expose-onenote-files Set to make OneNote files show up in directory listings --onedrive-hash-type string Specify the hash in use for the backend (default "auto") --onedrive-link-password string Set the password for links created by the link command @@ -478,7 +521,7 @@ rclone [flags] --oos-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) --oos-copy-timeout Duration Timeout for copy (default 1m0s) --oos-disable-checksum Don't store MD5 checksum with object metadata - --oos-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) + --oos-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) --oos-endpoint string Endpoint for Object storage API --oos-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts for manual recovery --oos-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) @@ -495,15 +538,16 @@ rclone [flags] --oos-upload-concurrency int Concurrency for multipart uploads (default 10) --oos-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) --opendrive-chunk-size SizeSuffix Files will be uploaded in chunks this size (default 10Mi) - --opendrive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot) + --opendrive-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot) --opendrive-password string Password (obscured) --opendrive-username string Username --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --password-command SpaceSepList Command for supplying password for encrypted configuration --pcloud-auth-url string Auth server URL --pcloud-client-id string OAuth Client Id --pcloud-client-secret string OAuth Client Secret - --pcloud-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --pcloud-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) --pcloud-hostname string Hostname to connect to (default "api.pcloud.com") --pcloud-password string Your pcloud password (obscured) --pcloud-root-folder-id string Fill in for rclone to use a non root folder as its starting point (default "d0") @@ -513,7 +557,7 @@ rclone [flags] --pikpak-auth-url string Auth server URL --pikpak-client-id string OAuth Client Id --pikpak-client-secret string OAuth Client Secret - --pikpak-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot) + --pikpak-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot) --pikpak-hash-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate hash if required (default 10Mi) --pikpak-pass string Pikpak password (obscured) --pikpak-root-folder-id string ID of the root folder @@ -525,7 +569,7 @@ rclone [flags] --premiumizeme-auth-url string Auth server URL --premiumizeme-client-id string OAuth Client Id --premiumizeme-client-secret string OAuth Client Secret - --premiumizeme-encoding MultiEncoder The encoding for the backend (default Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --premiumizeme-encoding Encoding The encoding for the backend (default Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot) --premiumizeme-token string OAuth Access Token as a JSON blob --premiumizeme-token-url string Token server url -P, --progress Show progress during transfer @@ -533,7 +577,7 @@ rclone [flags] --protondrive-2fa string The 2FA code --protondrive-app-version string The app version string (default "macos-drive@1.0.0-alpha.1+rclone") --protondrive-enable-caching Caches the files and folders metadata to reduce API calls (default true) - --protondrive-encoding MultiEncoder The encoding for the backend (default Slash,LeftSpace,RightSpace,InvalidUtf8,Dot) + --protondrive-encoding Encoding The encoding for the backend (default Slash,LeftSpace,RightSpace,InvalidUtf8,Dot) --protondrive-mailbox-password string The mailbox password of your two-password proton account (obscured) --protondrive-original-file-size Return the file size before encryption (default true) --protondrive-password string The password of your proton account (obscured) @@ -542,13 +586,13 @@ rclone [flags] --putio-auth-url string Auth server URL --putio-client-id string OAuth Client Id --putio-client-secret string OAuth Client Secret - --putio-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --putio-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) --putio-token string OAuth Access Token as a JSON blob --putio-token-url string Token server url --qingstor-access-key-id string QingStor Access Key ID --qingstor-chunk-size SizeSuffix Chunk size to use for uploading (default 4Mi) --qingstor-connection-retries int Number of connection retries (default 3) - --qingstor-encoding MultiEncoder The encoding for the backend (default Slash,Ctl,InvalidUtf8) + --qingstor-encoding Encoding The encoding for the backend (default Slash,Ctl,InvalidUtf8) --qingstor-endpoint string Enter an endpoint URL to connection QingStor API --qingstor-env-auth Get QingStor credentials from runtime --qingstor-secret-access-key string QingStor Secret Access Key (password) @@ -557,7 +601,7 @@ rclone [flags] --qingstor-zone string Zone to connect to --quatrix-api-key string API key for accessing Quatrix account --quatrix-effective-upload-time string Wanted upload time for one chunk (default "4s") - --quatrix-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --quatrix-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) --quatrix-hard-delete Delete files permanently rather than putting them into the trash --quatrix-host string Host name of Quatrix account --quatrix-maximal-summary-chunk-size SizeSuffix The maximal summary for all chunks. It should not be less than 'transfers'*'minimal_chunk_size' (default 95.367Mi) @@ -604,7 +648,7 @@ rclone [flags] --s3-disable-checksum Don't store MD5 checksum with object metadata --s3-disable-http2 Disable usage of http2 for S3 backends --s3-download-url string Custom endpoint for downloads - --s3-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) + --s3-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) --s3-endpoint string Endpoint for S3 API --s3-env-auth Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars) --s3-force-path-style If true use path style access if false use virtual hosted style (default true) @@ -638,14 +682,16 @@ rclone [flags] --s3-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) --s3-use-accelerate-endpoint If true use the AWS S3 accelerated endpoint --s3-use-accept-encoding-gzip Accept-Encoding: gzip Whether to send Accept-Encoding: gzip header (default unset) + --s3-use-already-exists Tristate Set if rclone should report BucketAlreadyExists errors on bucket creation (default unset) --s3-use-multipart-etag Tristate Whether to use ETag in multipart uploads for verification (default unset) + --s3-use-multipart-uploads Tristate Set if rclone should use multipart uploads (default unset) --s3-use-presigned-request Whether to use a presigned request or PutObject for single part uploads --s3-v2-auth If true use v2 authentication --s3-version-at Time Show file versions as they were at the specified time (default off) --s3-versions Include old versions in directory listings --seafile-2fa Two-factor authentication ('true' if the account has 2FA enabled) --seafile-create-library Should rclone create a library if it doesn't exist - --seafile-encoding MultiEncoder The encoding for the backend (default Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8) + --seafile-encoding Encoding The encoding for the backend (default Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8) --seafile-library string Name of the library --seafile-library-key string Library password (for encrypted libraries only) (obscured) --seafile-pass string Password (obscured) @@ -656,6 +702,7 @@ rclone [flags] --sftp-chunk-size SizeSuffix Upload and download chunk size (default 32Ki) --sftp-ciphers SpaceSepList Space separated list of ciphers to be used for session encryption, ordered by preference --sftp-concurrency int The maximum number of outstanding requests for one file (default 64) + --sftp-copy-is-hardlink Set to enable server side copies using hardlinks --sftp-disable-concurrent-reads If set don't use concurrent reads --sftp-disable-concurrent-writes If set don't use concurrent writes --sftp-disable-hashcheck Disable the execution of SSH commands to determine if remote file hashing is available @@ -690,7 +737,7 @@ rclone [flags] --sharefile-chunk-size SizeSuffix Upload chunk size (default 64Mi) --sharefile-client-id string OAuth Client Id --sharefile-client-secret string OAuth Client Secret - --sharefile-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot) + --sharefile-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot) --sharefile-endpoint string Endpoint for API calls --sharefile-root-folder-id string ID of the root folder --sharefile-token string OAuth Access Token as a JSON blob @@ -698,13 +745,13 @@ rclone [flags] --sharefile-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (default 128Mi) --sia-api-password string Sia Daemon API Password (obscured) --sia-api-url string Sia daemon API URL, like http://sia.daemon.host:9980 (default "http://127.0.0.1:9980") - --sia-encoding MultiEncoder The encoding for the backend (default Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot) + --sia-encoding Encoding The encoding for the backend (default Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot) --sia-user-agent string Siad User Agent (default "Sia-Agent") - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --skip-links Don't warn about skipped symlinks --smb-case-insensitive Whether the server is configured to be case-insensitive (default true) --smb-domain string Domain name for NTLM authentication (default "WORKGROUP") - --smb-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot) + --smb-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot) --smb-hide-special-share Hide special shares (e.g. print$) which users aren't supposed to access (default true) --smb-host string SMB server hostname to connect to --smb-idle-timeout Duration Max time before closing idle connections (default 1m0s) @@ -714,7 +761,7 @@ rclone [flags] --smb-user string SMB username (default "$USER") --stats Duration Interval between printing stats, e.g. 500ms, 60s, 5m (0 to disable) (default 1m0s) --stats-file-name-length int Max file name length in stats (0 for no limit) (default 45) - --stats-log-level string Log level to show --stats output DEBUG|INFO|NOTICE|ERROR (default "INFO") + --stats-log-level LogLevel Log level to show --stats output DEBUG|INFO|NOTICE|ERROR (default INFO) --stats-one-line Make the stats fit on one line --stats-one-line-date Enable --stats-one-line and add current date/time prefix --stats-one-line-date-format string Enable --stats-one-line-date and use custom formatted date: Enclose date string in double quotes ("), see https://golang.org/pkg/time/#Time.Format @@ -732,7 +779,7 @@ rclone [flags] --sugarsync-authorization string Sugarsync authorization --sugarsync-authorization-expiry string Sugarsync authorization expiry --sugarsync-deleted-id string Sugarsync deleted folder id - --sugarsync-encoding MultiEncoder The encoding for the backend (default Slash,Ctl,InvalidUtf8,Dot) + --sugarsync-encoding Encoding The encoding for the backend (default Slash,Ctl,InvalidUtf8,Dot) --sugarsync-hard-delete Permanently delete files if true --sugarsync-private-access-key string Sugarsync Private Access Key --sugarsync-refresh-token string Sugarsync refresh token @@ -746,7 +793,7 @@ rclone [flags] --swift-auth-version int AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION) --swift-chunk-size SizeSuffix Above this size files will be chunked into a _segments container (default 5Gi) --swift-domain string User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME) - --swift-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8) + --swift-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8) --swift-endpoint-type string Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE) (default "public") --swift-env-auth Get swift credentials from environment variables in standard OpenStack form --swift-key string API key or password (OS_PASSWORD) @@ -778,13 +825,13 @@ rclone [flags] --union-upstreams string List of space separated upstreams -u, --update Skip files that are newer on the destination --uptobox-access-token string Your access token - --uptobox-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot) + --uptobox-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot) --uptobox-private Set to make uploaded files private --use-cookies Enable session cookiejar --use-json-log Use json log format --use-mmap Use mmap allocator (see docs) --use-server-modtime Use server modified time instead of object metadata - --user-agent string Set the user-agent to a specified string (default "rclone/v1.64.0") + --user-agent string Set the user-agent to a specified string (default "rclone/v1.65.0") -v, --verbose count Print lots more stuff (repeat for more) -V, --version Print the version number --webdav-bearer-token string Bearer token instead of user/pass (e.g. a Macaroon) @@ -800,14 +847,14 @@ rclone [flags] --yandex-auth-url string Auth server URL --yandex-client-id string OAuth Client Id --yandex-client-secret string OAuth Client Secret - --yandex-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) + --yandex-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) --yandex-hard-delete Delete files permanently rather than putting them into the trash --yandex-token string OAuth Access Token as a JSON blob --yandex-token-url string Token server url --zoho-auth-url string Auth server URL --zoho-client-id string OAuth Client Id --zoho-client-secret string OAuth Client Secret - --zoho-encoding MultiEncoder The encoding for the backend (default Del,Ctl,InvalidUtf8) + --zoho-encoding Encoding The encoding for the backend (default Del,Ctl,InvalidUtf8) --zoho-region string Zoho region to connect to --zoho-token string OAuth Access Token as a JSON blob --zoho-token-url string Token server url @@ -821,7 +868,7 @@ rclone [flags] * [rclone bisync](/commands/rclone_bisync/) - Perform bidirectional synchronization between two paths. * [rclone cat](/commands/rclone_cat/) - Concatenates any files and sends them to stdout. * [rclone check](/commands/rclone_check/) - Checks the files in the source and destination match. -* [rclone checksum](/commands/rclone_checksum/) - Checks the files in the source against a SUM file. +* [rclone checksum](/commands/rclone_checksum/) - Checks the files in the destination against a SUM file. * [rclone cleanup](/commands/rclone_cleanup/) - Clean up the remote if possible. * [rclone completion](/commands/rclone_completion/) - Output completion script for a given shell. * [rclone config](/commands/rclone_config/) - Enter an interactive configuration session. diff --git a/docs/content/commands/rclone_bisync.md b/docs/content/commands/rclone_bisync.md index 7bde4cce55208..057e31848ad62 100644 --- a/docs/content/commands/rclone_bisync.md +++ b/docs/content/commands/rclone_bisync.md @@ -59,11 +59,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -78,11 +78,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination ``` diff --git a/docs/content/commands/rclone_checksum.md b/docs/content/commands/rclone_checksum.md index 6da448b323ed7..1e78aeb65e1fe 100644 --- a/docs/content/commands/rclone_checksum.md +++ b/docs/content/commands/rclone_checksum.md @@ -1,6 +1,6 @@ --- title: "rclone checksum" -description: "Checks the files in the source against a SUM file." +description: "Checks the files in the destination against a SUM file." slug: rclone_checksum url: /commands/rclone_checksum/ groups: Filter,Listing @@ -9,17 +9,20 @@ versionIntroduced: v1.56 --- # rclone checksum -Checks the files in the source against a SUM file. +Checks the files in the destination against a SUM file. ## Synopsis -Checks that hashsums of source files match the SUM file. +Checks that hashsums of destination files match the SUM file. It compares hashes (MD5, SHA1, etc) and logs a report of files which don't match. It doesn't alter the file system. -If you supply the `--download` flag, it will download the data from remote -and calculate the contents hash on the fly. This can be useful for remotes +The sumfile is treated as the source and the dst:path is treated as +the destination for the purposes of the output. + +If you supply the `--download` flag, it will download the data from the remote +and calculate the content hash on the fly. This can be useful for remotes that don't support hashes or if you really want to check all the data. Note that hash values in the SUM file are treated as case insensitive. @@ -50,7 +53,7 @@ option for more information. ``` -rclone checksum sumfile src:path [flags] +rclone checksum sumfile dst:path [flags] ``` ## Options diff --git a/docs/content/commands/rclone_copy.md b/docs/content/commands/rclone_copy.md index 061c2b2f47091..315dc4b8a0bad 100644 --- a/docs/content/commands/rclone_copy.md +++ b/docs/content/commands/rclone_copy.md @@ -91,11 +91,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -110,11 +110,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination ``` diff --git a/docs/content/commands/rclone_copyto.md b/docs/content/commands/rclone_copyto.md index 8aa99aed1d442..30a42e53f4c99 100644 --- a/docs/content/commands/rclone_copyto.md +++ b/docs/content/commands/rclone_copyto.md @@ -63,11 +63,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -82,11 +82,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination ``` diff --git a/docs/content/commands/rclone_hashsum.md b/docs/content/commands/rclone_hashsum.md index b3b39ab84fad9..b3392c01b70eb 100644 --- a/docs/content/commands/rclone_hashsum.md +++ b/docs/content/commands/rclone_hashsum.md @@ -40,10 +40,6 @@ Run without a hash to see the list of all supported hashes, e.g. * whirlpool * crc32 * sha256 - * dropbox - * hidrive - * mailru - * quickxor Then @@ -53,7 +49,7 @@ Note that hash names are case insensitive and values are output in lower case. ``` -rclone hashsum remote:path [flags] +rclone hashsum [ remote:path] [flags] ``` ## Options diff --git a/docs/content/commands/rclone_mount.md b/docs/content/commands/rclone_mount.md index ec85e1f9ce1fb..c22fb2e7ead14 100644 --- a/docs/content/commands/rclone_mount.md +++ b/docs/content/commands/rclone_mount.md @@ -13,7 +13,6 @@ Mount the remote as file system on a mountpoint. ## Synopsis - rclone mount allows Linux, FreeBSD, macOS and Windows to mount any of Rclone's cloud storage systems as a file system with FUSE. @@ -268,11 +267,17 @@ does not suffer from the same limitations. ## Mounting on macOS -Mounting on macOS can be done either via [macFUSE](https://osxfuse.github.io/) +Mounting on macOS can be done either via [built-in NFS server](/commands/rclone_serve_nfs/), [macFUSE](https://osxfuse.github.io/) (also known as osxfuse) or [FUSE-T](https://www.fuse-t.org/). macFUSE is a traditional FUSE driver utilizing a macOS kernel extension (kext). FUSE-T is an alternative FUSE system which "mounts" via an NFSv4 local server. +# NFS mount + +This method spins up an NFS server using [serve nfs](/commands/rclone_serve_nfs/) command and mounts +it to the specified mountpoint. If you run this in background mode using |--daemon|, you will need to +send SIGTERM signal to the rclone process using |kill| command to stop the mount. + ### macFUSE Notes If installing macFUSE using [dmg packages](https://github.com/osxfuse/osxfuse/releases) from @@ -322,6 +327,8 @@ sequentially, it can only seek when reading. This means that many applications won't work with their files on an rclone mount without `--vfs-cache-mode writes` or `--vfs-cache-mode full`. See the [VFS File Caching](#vfs-file-caching) section for more info. +When using NFS mount on macOS, if you don't specify |--vfs-cache-mode| +the mount point will be read-only. The bucket-based remotes (e.g. Swift, S3, Google Compute Storage, B2) do not support the concept of empty directories, so empty @@ -468,7 +475,6 @@ Mount option syntax includes a few extra options treated specially: - `vv...` will be transformed into appropriate `--verbose=N` - standard mount options like `x-systemd.automount`, `_netdev`, `nosuid` and alike are intended only for Automountd and ignored by rclone. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -850,6 +856,7 @@ rclone mount remote:path /path/to/mountpoint [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) diff --git a/docs/content/commands/rclone_move.md b/docs/content/commands/rclone_move.md index 4ce4fd55cc0c1..bc6efdddedd36 100644 --- a/docs/content/commands/rclone_move.md +++ b/docs/content/commands/rclone_move.md @@ -67,11 +67,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -86,11 +86,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination ``` diff --git a/docs/content/commands/rclone_moveto.md b/docs/content/commands/rclone_moveto.md index 074332ea709b5..79f3e3420937a 100644 --- a/docs/content/commands/rclone_moveto.md +++ b/docs/content/commands/rclone_moveto.md @@ -66,11 +66,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -85,11 +85,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination ``` diff --git a/docs/content/commands/rclone_rcd.md b/docs/content/commands/rclone_rcd.md index 749ed959bdbe0..73a40c42bba0a 100644 --- a/docs/content/commands/rclone_rcd.md +++ b/docs/content/commands/rclone_rcd.md @@ -96,6 +96,17 @@ to be used within the template to server pages: |-- .Size | Size in Bytes of the entry. | |-- .ModTime | The UTC timestamp of an entry. | +The server also makes the following functions available so that they can be used within the +template. These functions help extend the options for dynamic rendering of HTML. They can +be used to render HTML based on specific conditions. + +| Function | Description | +| :---------- | :---------- | +| afterEpoch | Returns the time since the epoch for the given time. | +| contains | Checks whether a given substring is present or not in a given string. | +| hasPrefix | Checks whether the given string begins with the specified prefix. | +| hasSuffix | Checks whether the given string end with the specified suffix. | + ### Authentication By default this will serve files without needing a login. diff --git a/docs/content/commands/rclone_selfupdate.md b/docs/content/commands/rclone_selfupdate.md index 2942215c5351b..82994370ec51a 100644 --- a/docs/content/commands/rclone_selfupdate.md +++ b/docs/content/commands/rclone_selfupdate.md @@ -12,7 +12,6 @@ Update the rclone binary. ## Synopsis - This command downloads the latest release of rclone and replaces the currently running binary. The download is verified with a hashsum and cryptographically signed signature; see [the release signing diff --git a/docs/content/commands/rclone_serve.md b/docs/content/commands/rclone_serve.md index 39854a7fcb634..211472b8993c6 100644 --- a/docs/content/commands/rclone_serve.md +++ b/docs/content/commands/rclone_serve.md @@ -40,7 +40,9 @@ See the [global flags page](/flags/) for global options not listed here. * [rclone serve docker](/commands/rclone_serve_docker/) - Serve any remote on docker's volume plugin API. * [rclone serve ftp](/commands/rclone_serve_ftp/) - Serve remote:path over FTP. * [rclone serve http](/commands/rclone_serve_http/) - Serve the remote over HTTP. +* [rclone serve nfs](/commands/rclone_serve_nfs/) - Serve the remote as an NFS mount * [rclone serve restic](/commands/rclone_serve_restic/) - Serve the remote for restic's REST API. +* [rclone serve s3](/commands/rclone_serve_s3/) - Serve remote:path over s3. * [rclone serve sftp](/commands/rclone_serve_sftp/) - Serve the remote over SFTP. * [rclone serve webdav](/commands/rclone_serve_webdav/) - Serve remote:path over WebDAV. diff --git a/docs/content/commands/rclone_serve_dlna.md b/docs/content/commands/rclone_serve_dlna.md index b6f29a55e5e62..abe864473a4cd 100644 --- a/docs/content/commands/rclone_serve_dlna.md +++ b/docs/content/commands/rclone_serve_dlna.md @@ -36,7 +36,6 @@ default "rclone (hostname)". Use `--log-trace` in conjunction with `-vv` to enable additional debug logging of all UPNP traffic. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -405,6 +404,7 @@ rclone serve dlna remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) diff --git a/docs/content/commands/rclone_serve_docker.md b/docs/content/commands/rclone_serve_docker.md index 001fc3bbbbdbc..0366cf6c903a6 100644 --- a/docs/content/commands/rclone_serve_docker.md +++ b/docs/content/commands/rclone_serve_docker.md @@ -13,7 +13,6 @@ Serve any remote on docker's volume plugin API. ## Synopsis - This command implements the Docker volume plugin API allowing docker to use rclone as a data storage mechanism for various cloud providers. rclone provides [docker volume plugin](/docker) based on it. @@ -52,7 +51,6 @@ directory with book-keeping records of created and mounted volumes. All mount and VFS options are submitted by the docker daemon via API, but you can also provide defaults on the command line as well as set path to the config file and cache directory or adjust logging verbosity. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -439,6 +437,7 @@ rclone serve docker [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) diff --git a/docs/content/commands/rclone_serve_ftp.md b/docs/content/commands/rclone_serve_ftp.md index 9d18cb3843a6f..6ba8142e98027 100644 --- a/docs/content/commands/rclone_serve_ftp.md +++ b/docs/content/commands/rclone_serve_ftp.md @@ -33,7 +33,6 @@ then using Authentication is advised - see the next section for info. By default this will serve files without needing a login. You can set a single username and password with the --user and --pass flags. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -486,6 +485,7 @@ rclone serve ftp remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) diff --git a/docs/content/commands/rclone_serve_http.md b/docs/content/commands/rclone_serve_http.md index 4df56e77cb52b..f599e5284cd57 100644 --- a/docs/content/commands/rclone_serve_http.md +++ b/docs/content/commands/rclone_serve_http.md @@ -97,6 +97,17 @@ to be used within the template to server pages: |-- .Size | Size in Bytes of the entry. | |-- .ModTime | The UTC timestamp of an entry. | +The server also makes the following functions available so that they can be used within the +template. These functions help extend the options for dynamic rendering of HTML. They can +be used to render HTML based on specific conditions. + +| Function | Description | +| :---------- | :---------- | +| afterEpoch | Returns the time since the epoch for the given time. | +| contains | Checks whether a given substring is present or not in a given string. | +| hasPrefix | Checks whether the given string begins with the specified prefix. | +| hasSuffix | Checks whether the given string end with the specified suffix. | + ### Authentication By default this will serve files without needing a login. @@ -123,7 +134,6 @@ The password file can be updated while rclone is running. Use `--realm` to set the authentication realm. Use `--salt` to change the password hashing salt from the default. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -585,6 +595,7 @@ rclone serve http remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) diff --git a/docs/content/commands/rclone_serve_nfs.md b/docs/content/commands/rclone_serve_nfs.md new file mode 100644 index 0000000000000..bbd28ccf825ee --- /dev/null +++ b/docs/content/commands/rclone_serve_nfs.md @@ -0,0 +1,450 @@ +--- +title: "rclone serve nfs" +description: "Serve the remote as an NFS mount" +slug: rclone_serve_nfs +url: /commands/rclone_serve_nfs/ +groups: Filter +versionIntroduced: v1.65 +# autogenerated - DO NOT EDIT, instead edit the source code in cmd/serve/nfs/ and as part of making a release run "make commanddocs" +--- +# rclone serve nfs + +Serve the remote as an NFS mount + +## Synopsis + +Create an NFS server that serves the given remote over the network. + +The primary purpose for this command is to enable [mount command](/commands/rclone_mount/) on recent macOS versions where +installing FUSE is very cumbersome. + +Since this is running on NFSv3, no authentication method is available. Any client +will be able to access the data. To limit access, you can use serve NFS on loopback address +and rely on secure tunnels (such as SSH). For this reason, by default, a random TCP port is chosen and loopback interface is used for the listening address; +meaning that it is only available to the local machine. If you want other machines to access the +NFS mount over local network, you need to specify the listening address and port using `--addr` flag. + +Modifying files through NFS protocol requires VFS caching. Usually you will need to specify `--vfs-cache-mode` +in order to be able to write to the mountpoint (full is recommended). If you don't specify VFS cache mode, +the mount will be read-only. + +To serve NFS over the network use following command: + + rclone serve nfs remote: --addr 0.0.0.0:$PORT --vfs-cache-mode=full + +We specify a specific port that we can use in the mount command: + +To mount the server under Linux/macOS, use the following command: + + mount -oport=$PORT,mountport=$PORT $HOSTNAME: path/to/mountpoint + +Where `$PORT` is the same port number we used in the serve nfs command. + +This feature is only available on Unix platforms. + +## VFS - Virtual File System + +This command uses the VFS layer. This adapts the cloud storage objects +that rclone uses into something which looks much more like a disk +filing system. + +Cloud storage objects have lots of properties which aren't like disk +files - you can't extend them or write to the middle of them, so the +VFS layer has to deal with that. Because there is no one right way of +doing this there are various options explained below. + +The VFS layer also implements a directory cache - this caches info +about files and directories (but not the data) in memory. + +## VFS Directory Cache + +Using the `--dir-cache-time` flag, you can control how long a +directory should be considered up to date and not refreshed from the +backend. Changes made through the VFS will appear immediately or +invalidate the cache. + + --dir-cache-time duration Time to cache directory entries for (default 5m0s) + --poll-interval duration Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable (default 1m0s) + +However, changes made directly on the cloud storage by the web +interface or a different copy of rclone will only be picked up once +the directory cache expires if the backend configured does not support +polling for changes. If the backend supports polling, changes will be +picked up within the polling interval. + +You can send a `SIGHUP` signal to rclone for it to flush all +directory caches, regardless of how old they are. Assuming only one +rclone instance is running, you can reset the cache like this: + + kill -SIGHUP $(pidof rclone) + +If you configure rclone with a [remote control](/rc) then you can use +rclone rc to flush the whole directory cache: + + rclone rc vfs/forget + +Or individual files or directories: + + rclone rc vfs/forget file=path/to/file dir=path/to/dir + +## VFS File Buffering + +The `--buffer-size` flag determines the amount of memory, +that will be used to buffer data in advance. + +Each open file will try to keep the specified amount of data in memory +at all times. The buffered data is bound to one open file and won't be +shared. + +This flag is a upper limit for the used memory per open file. The +buffer will only use memory for data that is downloaded but not not +yet read. If the buffer is empty, only a small amount of memory will +be used. + +The maximum memory used by rclone for buffering can be up to +`--buffer-size * open files`. + +## VFS File Caching + +These flags control the VFS file caching options. File caching is +necessary to make the VFS layer appear compatible with a normal file +system. It can be disabled at the cost of some compatibility. + +For example you'll need to enable VFS caching if you want to read and +write simultaneously to a file. See below for more details. + +Note that the VFS cache is separate from the cache backend and you may +find that you need one or the other or both. + + --cache-dir string Directory rclone will use for caching. + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-write-back duration Time to writeback files after last use when using cache (default 5s) + +If run with `-vv` rclone will print the location of the file cache. The +files are stored in the user cache file area which is OS dependent but +can be controlled with `--cache-dir` or setting the appropriate +environment variable. + +The cache has 4 different modes selected by `--vfs-cache-mode`. +The higher the cache mode the more compatible rclone becomes at the +cost of using disk space. + +Note that files are written back to the remote only when they are +closed and if they haven't been accessed for `--vfs-write-back` +seconds. If rclone is quit or dies with files that haven't been +uploaded, these will be uploaded next time rclone is run with the same +flags. + +If using `--vfs-cache-max-size` or `--vfs-cache-min-free-size` note +that the cache may exceed these quotas for two reasons. Firstly +because it is only checked every `--vfs-cache-poll-interval`. Secondly +because open files cannot be evicted from the cache. When +`--vfs-cache-max-size` or `--vfs-cache-min-free-size` is exceeded, +rclone will attempt to evict the least accessed files from the cache +first. rclone will start with files that haven't been accessed for the +longest. This cache flushing strategy is efficient and more relevant +files are likely to remain cached. + +The `--vfs-cache-max-age` will evict files from the cache +after the set time since last access has passed. The default value of +1 hour will start evicting files from cache that haven't been accessed +for 1 hour. When a cached file is accessed the 1 hour timer is reset to 0 +and will wait for 1 more hour before evicting. Specify the time with +standard notation, s, m, h, d, w . + +You **should not** run two copies of rclone using the same VFS cache +with the same or overlapping remotes if using `--vfs-cache-mode > off`. +This can potentially cause data corruption if you do. You can work +around this by giving each rclone its own cache hierarchy with +`--cache-dir`. You don't need to worry about this if the remotes in +use don't overlap. + +### --vfs-cache-mode off + +In this mode (the default) the cache will read directly from the remote and write +directly to the remote without caching anything on disk. + +This will mean some operations are not possible + + * Files can't be opened for both read AND write + * Files opened for write can't be seeked + * Existing files opened for write must have O_TRUNC set + * Files open for read with O_TRUNC will be opened write only + * Files open for write only will behave as if O_TRUNC was supplied + * Open modes O_APPEND, O_TRUNC are ignored + * If an upload fails it can't be retried + +### --vfs-cache-mode minimal + +This is very similar to "off" except that files opened for read AND +write will be buffered to disk. This means that files opened for +write will be a lot more compatible, but uses the minimal disk space. + +These operations are not possible + + * Files opened for write only can't be seeked + * Existing files opened for write must have O_TRUNC set + * Files opened for write only will ignore O_APPEND, O_TRUNC + * If an upload fails it can't be retried + +### --vfs-cache-mode writes + +In this mode files opened for read only are still read directly from +the remote, write only and read/write files are buffered to disk +first. + +This mode should support all normal file system operations. + +If an upload fails it will be retried at exponentially increasing +intervals up to 1 minute. + +### --vfs-cache-mode full + +In this mode all reads and writes are buffered to and from disk. When +data is read from the remote this is buffered to disk as well. + +In this mode the files in the cache will be sparse files and rclone +will keep track of which bits of the files it has downloaded. + +So if an application only reads the starts of each file, then rclone +will only buffer the start of the file. These files will appear to be +their full size in the cache, but they will be sparse files with only +the data that has been downloaded present in them. + +This mode should support all normal file system operations and is +otherwise identical to `--vfs-cache-mode` writes. + +When reading a file rclone will read `--buffer-size` plus +`--vfs-read-ahead` bytes ahead. The `--buffer-size` is buffered in memory +whereas the `--vfs-read-ahead` is buffered on disk. + +When using this mode it is recommended that `--buffer-size` is not set +too large and `--vfs-read-ahead` is set large if required. + +**IMPORTANT** not all file systems support sparse files. In particular +FAT/exFAT do not. Rclone will perform very badly if the cache +directory is on a filesystem which doesn't support sparse files and it +will log an ERROR message if one is detected. + +### Fingerprinting + +Various parts of the VFS use fingerprinting to see if a local file +copy has changed relative to a remote file. Fingerprints are made +from: + +- size +- modification time +- hash + +where available on an object. + +On some backends some of these attributes are slow to read (they take +an extra API call per object, or extra work per object). + +For example `hash` is slow with the `local` and `sftp` backends as +they have to read the entire file and hash it, and `modtime` is slow +with the `s3`, `swift`, `ftp` and `qinqstor` backends because they +need to do an extra API call to fetch it. + +If you use the `--vfs-fast-fingerprint` flag then rclone will not +include the slow operations in the fingerprint. This makes the +fingerprinting less accurate but much faster and will improve the +opening time of cached files. + +If you are running a vfs cache over `local`, `s3` or `swift` backends +then using this flag is recommended. + +Note that if you change the value of this flag, the fingerprints of +the files in the cache may be invalidated and the files will need to +be downloaded again. + +## VFS Chunked Reading + +When rclone reads files from a remote it reads them in chunks. This +means that rather than requesting the whole file rclone reads the +chunk specified. This can reduce the used download quota for some +remotes by requesting only chunks from the remote that are actually +read, at the cost of an increased number of requests. + +These flags control the chunking: + + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128M) + --vfs-read-chunk-size-limit SizeSuffix Max chunk doubling size (default off) + +Rclone will start reading a chunk of size `--vfs-read-chunk-size`, +and then double the size for each read. When `--vfs-read-chunk-size-limit` is +specified, and greater than `--vfs-read-chunk-size`, the chunk size for each +open file will get doubled only until the specified value is reached. If the +value is "off", which is the default, the limit is disabled and the chunk size +will grow indefinitely. + +With `--vfs-read-chunk-size 100M` and `--vfs-read-chunk-size-limit 0` +the following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on. +When `--vfs-read-chunk-size-limit 500M` is specified, the result would be +0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on. + +Setting `--vfs-read-chunk-size` to `0` or "off" disables chunked reading. + +## VFS Performance + +These flags may be used to enable/disable features of the VFS for +performance or other reasons. See also the [chunked reading](#vfs-chunked-reading) +feature. + +In particular S3 and Swift benefit hugely from the `--no-modtime` flag +(or use `--use-server-modtime` for a slightly different effect) as each +read of the modification time takes a transaction. + + --no-checksum Don't compare checksums on up/download. + --no-modtime Don't read/write the modification time (can speed things up). + --no-seek Don't allow seeking in files. + --read-only Only allow read-only access. + +Sometimes rclone is delivered reads or writes out of order. Rather +than seeking rclone will wait a short time for the in sequence read or +write to come in. These flags only come into effect when not using an +on disk cache file. + + --vfs-read-wait duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-write-wait duration Time to wait for in-sequence write before giving error (default 1s) + +When using VFS write caching (`--vfs-cache-mode` with value writes or full), +the global flag `--transfers` can be set to adjust the number of parallel uploads of +modified files from the cache (the related global flag `--checkers` has no effect on the VFS). + + --transfers int Number of file transfers to run in parallel (default 4) + +## VFS Case Sensitivity + +Linux file systems are case-sensitive: two files can differ only +by case, and the exact case must be used when opening a file. + +File systems in modern Windows are case-insensitive but case-preserving: +although existing files can be opened using any case, the exact case used +to create the file is preserved and available for programs to query. +It is not allowed for two files in the same directory to differ only by case. + +Usually file systems on macOS are case-insensitive. It is possible to make macOS +file systems case-sensitive but that is not the default. + +The `--vfs-case-insensitive` VFS flag controls how rclone handles these +two cases. If its value is "false", rclone passes file names to the remote +as-is. If the flag is "true" (or appears without a value on the +command line), rclone may perform a "fixup" as explained below. + +The user may specify a file name to open/delete/rename/etc with a case +different than what is stored on the remote. If an argument refers +to an existing file with exactly the same name, then the case of the existing +file on the disk will be used. However, if a file name with exactly the same +name is not found but a name differing only by case exists, rclone will +transparently fixup the name. This fixup happens only when an existing file +is requested. Case sensitivity of file names created anew by rclone is +controlled by the underlying remote. + +Note that case sensitivity of the operating system running rclone (the target) +may differ from case sensitivity of a file system presented by rclone (the source). +The flag controls whether "fixup" is performed to satisfy the target. + +If the flag is not provided on the command line, then its default value depends +on the operating system where rclone runs: "true" on Windows and macOS, "false" +otherwise. If the flag is provided without a value, then it is "true". + +## VFS Disk Options + +This flag allows you to manually set the statistics about the filing system. +It can be useful when those statistics cannot be read correctly automatically. + + --vfs-disk-space-total-size Manually set the total disk space size (example: 256G, default: -1) + +## Alternate report of used bytes + +Some backends, most notably S3, do not report the amount of bytes used. +If you need this information to be available when running `df` on the +filesystem, then pass the flag `--vfs-used-is-size` to rclone. +With this flag set, instead of relying on the backend to report this +information, rclone will scan the whole remote similar to `rclone size` +and compute the total used space itself. + +_WARNING._ Contrary to `rclone size`, this flag ignores filters so that the +result is accurate. However, this is very inefficient and may cost lots of API +calls resulting in extra charges. Use it as a last resort and only with caching. + + +``` +rclone serve nfs remote:path [flags] +``` + +## Options + +``` + --addr string IPaddress:Port or :Port to bind server to + --dir-cache-time Duration Time to cache directory entries for (default 5m0s) + --dir-perms FileMode Directory permissions (default 0777) + --file-perms FileMode File permissions (default 0666) + --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) + -h, --help help for nfs + --no-checksum Don't compare checksums on up/download + --no-modtime Don't read/write the modification time (can speed things up) + --no-seek Don't allow seeking in files + --poll-interval Duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s) + --read-only Only allow read-only access + --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) + --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-case-insensitive If a file name not found, find a case insensitive match + --vfs-disk-space-total-size SizeSuffix Specify the total space of disk (default off) + --vfs-fast-fingerprint Use fast (less accurate) fingerprints for change detection + --vfs-read-ahead SizeSuffix Extra read ahead over --buffer-size when using cache-mode full + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) + --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) + --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start + --vfs-used-is-size rclone size Use the rclone size algorithm for Used size + --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) + --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) +``` + + +## Filter Options + +Flags for filtering directory listings. + +``` + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +``` + +See the [global flags page](/flags/) for global options not listed here. + +# SEE ALSO + +* [rclone serve](/commands/rclone_serve/) - Serve a remote over a protocol. + diff --git a/docs/content/commands/rclone_serve_s3.md b/docs/content/commands/rclone_serve_s3.md index be36e27502f14..986d311199799 100644 --- a/docs/content/commands/rclone_serve_s3.md +++ b/docs/content/commands/rclone_serve_s3.md @@ -71,8 +71,19 @@ Note that setting `disable_multipart_uploads = true` is to work around ## Bugs When uploading multipart files `serve s3` holds all the parts in -memory. This is a limitaton of the library rclone uses for serving S3 -and will hopefully be fixed at some point. +memory (see [#7453](https://github.com/rclone/rclone/issues/7453)). +This is a limitaton of the library rclone uses for serving S3 and will +hopefully be fixed at some point. + +Multipart server side copies do not work (see +[#7454](https://github.com/rclone/rclone/issues/7454)). These take a +very long time and eventually fail. The default threshold for +multipart server side copies is 5G which is the maximum it can be, so +files above this side will fail to be server side copied. + +For a current list of `serve s3` bugs see the [serve +s3](https://github.com/rclone/rclone/labels/serve%20s3) bug category +on GitHub. ## Limitations diff --git a/docs/content/commands/rclone_serve_sftp.md b/docs/content/commands/rclone_serve_sftp.md index f1e60c360370a..9181e7be424e5 100644 --- a/docs/content/commands/rclone_serve_sftp.md +++ b/docs/content/commands/rclone_serve_sftp.md @@ -65,7 +65,6 @@ used. Omitting "restrict" and using `--sftp-path-override` to enable checksumming is possible but less secure and you could use the SFTP server provided by OpenSSH in this case. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -518,6 +517,7 @@ rclone serve sftp remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) diff --git a/docs/content/commands/rclone_serve_webdav.md b/docs/content/commands/rclone_serve_webdav.md index eb13e6bf46680..a2f6554b17a33 100644 --- a/docs/content/commands/rclone_serve_webdav.md +++ b/docs/content/commands/rclone_serve_webdav.md @@ -126,6 +126,17 @@ to be used within the template to server pages: |-- .Size | Size in Bytes of the entry. | |-- .ModTime | The UTC timestamp of an entry. | +The server also makes the following functions available so that they can be used within the +template. These functions help extend the options for dynamic rendering of HTML. They can +be used to render HTML based on specific conditions. + +| Function | Description | +| :---------- | :---------- | +| afterEpoch | Returns the time since the epoch for the given time. | +| contains | Checks whether a given substring is present or not in a given string. | +| hasPrefix | Checks whether the given string begins with the specified prefix. | +| hasSuffix | Checks whether the given string end with the specified suffix. | + ### Authentication By default this will serve files without needing a login. @@ -152,7 +163,6 @@ The password file can be updated while rclone is running. Use `--realm` to set the authentication realm. Use `--salt` to change the password hashing salt from the default. - ## VFS - Virtual File System This command uses the VFS layer. This adapts the cloud storage objects @@ -616,6 +626,7 @@ rclone serve webdav remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached ('off' is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) diff --git a/docs/content/commands/rclone_sync.md b/docs/content/commands/rclone_sync.md index 25c12a08db3d3..8096e01c3ebec 100644 --- a/docs/content/commands/rclone_sync.md +++ b/docs/content/commands/rclone_sync.md @@ -70,11 +70,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -89,11 +89,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination ``` diff --git a/docs/content/drive.md b/docs/content/drive.md index 246430b989789..854b185eb889c 100644 --- a/docs/content/drive.md +++ b/docs/content/drive.md @@ -776,6 +776,31 @@ Properties: - Type: bool - Default: false +#### --drive-show-all-gdocs + +Show all Google Docs including non-exportable ones in listings. + +If you try a server side copy on a Google Form without this flag, you +will get this error: + + No export formats found for "application/vnd.google-apps.form" + +However adding this flag will allow the form to be server side copied. + +Note that rclone doesn't add extensions to the Google Docs file names +in this mode. + +Do **not** use this flag when trying to download Google Docs - rclone +will fail to download them. + + +Properties: + +- Config: show_all_gdocs +- Env Var: RCLONE_DRIVE_SHOW_ALL_GDOCS +- Type: bool +- Default: false + #### --drive-skip-checksum-gphotos Skip checksums on Google photos and videos only. @@ -1238,6 +1263,98 @@ Properties: - Type: bool - Default: true +#### --drive-metadata-owner + +Control whether owner should be read or written in metadata. + +Owner is a standard part of the file metadata so is easy to read. But it +isn't always desirable to set the owner from the metadata. + +Note that you can't set the owner on Shared Drives, and that setting +ownership will generate an email to the new owner (this can't be +disabled), and you can't transfer ownership to someone outside your +organization. + + +Properties: + +- Config: metadata_owner +- Env Var: RCLONE_DRIVE_METADATA_OWNER +- Type: Bits +- Default: read +- Examples: + - "off" + - Do not read or write the value + - "read" + - Read the value only + - "write" + - Write the value only + - "read,write" + - Read and Write the value. + +#### --drive-metadata-permissions + +Control whether permissions should be read or written in metadata. + +Reading permissions metadata from files can be done quickly, but it +isn't always desirable to set the permissions from the metadata. + +Note that rclone drops any inherited permissions on Shared Drives and +any owner permission on My Drives as these are duplicated in the owner +metadata. + + +Properties: + +- Config: metadata_permissions +- Env Var: RCLONE_DRIVE_METADATA_PERMISSIONS +- Type: Bits +- Default: off +- Examples: + - "off" + - Do not read or write the value + - "read" + - Read the value only + - "write" + - Write the value only + - "read,write" + - Read and Write the value. + +#### --drive-metadata-labels + +Control whether labels should be read or written in metadata. + +Reading labels metadata from files takes an extra API transaction and +will slow down listings. It isn't always desirable to set the labels +from the metadata. + +The format of labels is documented in the drive API documentation at +https://developers.google.com/drive/api/reference/rest/v3/Label - +rclone just provides a JSON dump of this format. + +When setting labels, the label and fields must already exist - rclone +will not create them. This means that if you are transferring labels +from two different accounts you will have to create the labels in +advance and use the metadata mapper to translate the IDs between the +two accounts. + + +Properties: + +- Config: metadata_labels +- Env Var: RCLONE_DRIVE_METADATA_LABELS +- Type: Bits +- Default: off +- Examples: + - "off" + - Do not read or write the value + - "read" + - Read the value only + - "write" + - Write the value only + - "read,write" + - Read and Write the value. + #### --drive-encoding The encoding for the backend. @@ -1248,7 +1365,7 @@ Properties: - Config: encoding - Env Var: RCLONE_DRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: InvalidUtf8 #### --drive-env-auth @@ -1269,6 +1386,29 @@ Properties: - "true" - Get GCP IAM credentials from the environment (env vars or IAM). +### Metadata + +User metadata is stored in the properties field of the drive object. + +Here are the possible system metadata items for the drive backend. + +| Name | Help | Type | Example | Read Only | +|------|------|------|---------|-----------| +| btime | Time of file birth (creation) with mS accuracy. Note that this is only writable on fresh uploads - it can't be written for updates. | RFC 3339 | 2006-01-02T15:04:05.999Z07:00 | N | +| content-type | The MIME type of the file. | string | text/plain | N | +| copy-requires-writer-permission | Whether the options to copy, print, or download this file, should be disabled for readers and commenters. | boolean | true | N | +| description | A short description of the file. | string | Contract for signing | N | +| folder-color-rgb | The color for a folder or a shortcut to a folder as an RGB hex string. | string | 881133 | N | +| labels | Labels attached to this file in a JSON dump of Googled drive format. Enable with --drive-metadata-labels. | JSON | [] | N | +| mtime | Time of last modification with mS accuracy. | RFC 3339 | 2006-01-02T15:04:05.999Z07:00 | N | +| owner | The owner of the file. Usually an email address. Enable with --drive-metadata-owner. | string | user@example.com | N | +| permissions | Permissions in a JSON dump of Google drive format. On shared drives these will only be present if they aren't inherited. Enable with --drive-metadata-permissions. | JSON | {} | N | +| starred | Whether the user has starred the file. | boolean | false | N | +| viewed-by-me | Whether the file has been viewed by this user. | boolean | true | **Y** | +| writers-can-share | Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives. | boolean | false | N | + +See the [metadata](/docs/#metadata) docs for more info. + ## Backend commands Here are the commands specific to the drive backend. diff --git a/docs/content/dropbox.md b/docs/content/dropbox.md index fa20cfe19c01f..91b15688e8b74 100644 --- a/docs/content/dropbox.md +++ b/docs/content/dropbox.md @@ -343,6 +343,30 @@ Properties: - Type: bool - Default: false +#### --dropbox-pacer-min-sleep + +Minimum time to sleep between API calls. + +Properties: + +- Config: pacer_min_sleep +- Env Var: RCLONE_DROPBOX_PACER_MIN_SLEEP +- Type: Duration +- Default: 10ms + +#### --dropbox-encoding + +The encoding for the backend. + +See the [encoding section in the overview](/overview/#encoding) for more info. + +Properties: + +- Config: encoding +- Env Var: RCLONE_DROPBOX_ENCODING +- Type: Encoding +- Default: Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot + #### --dropbox-batch-mode Upload file batching sync|async|off. @@ -429,30 +453,6 @@ Properties: - Type: Duration - Default: 10m0s -#### --dropbox-pacer-min-sleep - -Minimum time to sleep between API calls. - -Properties: - -- Config: pacer_min_sleep -- Env Var: RCLONE_DROPBOX_PACER_MIN_SLEEP -- Type: Duration -- Default: 10ms - -#### --dropbox-encoding - -The encoding for the backend. - -See the [encoding section in the overview](/overview/#encoding) for more info. - -Properties: - -- Config: encoding -- Env Var: RCLONE_DROPBOX_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot - {{< rem autogenerated options stop >}} ## Limitations diff --git a/docs/content/fichier.md b/docs/content/fichier.md index 8576cb9aa8b92..b5a8245055685 100644 --- a/docs/content/fichier.md +++ b/docs/content/fichier.md @@ -192,7 +192,7 @@ Properties: - Config: encoding - Env Var: RCLONE_FICHIER_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/filefabric.md b/docs/content/filefabric.md index 61f2ae815dc2a..1666cd6bc7793 100644 --- a/docs/content/filefabric.md +++ b/docs/content/filefabric.md @@ -271,7 +271,7 @@ Properties: - Config: encoding - Env Var: RCLONE_FILEFABRIC_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Del,Ctl,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/flags.md b/docs/content/flags.md index 8339806331a63..4ce4c079f439a 100644 --- a/docs/content/flags.md +++ b/docs/content/flags.md @@ -18,11 +18,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD") + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don't skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -37,11 +37,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don't check the destination, copy regardless --no-traverse Don't traverse destination file system on copy - --no-update-modtime Don't update destination mod-time if files identical + --no-update-modtime Don't update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. 'size,descending' + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial") --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination ``` @@ -111,7 +112,7 @@ General networking and HTTP stuff. --tpslimit float Limit HTTP transactions per second to this --tpslimit-burst int Max burst of transactions for --tpslimit (default 1) --use-cookies Enable session cookiejar - --user-agent string Set the user-agent to a specified string (default "rclone/v1.64.0") + --user-agent string Set the user-agent to a specified string (default "rclone/v1.65.0") ``` @@ -134,7 +135,7 @@ General configuration of rclone. --ask-password Allow prompt for password for encrypted configuration (default true) --auto-confirm If enabled, do not request console confirmation --cache-dir string Directory rclone will use for caching (default "$HOME/.cache/rclone") - --color string When to show colors (and other ANSI codes) AUTO|NEVER|ALWAYS (default "AUTO") + --color AUTO|NEVER|ALWAYS When to show colors (and other ANSI codes) AUTO|NEVER|ALWAYS (default AUTO) --config string Config file (default "$HOME/.config/rclone/rclone.conf") --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) --disable string Disable a comma separated list of features (use --disable help to see a list) @@ -163,7 +164,7 @@ Flags for developers. ``` --cpuprofile string Write cpu profile to file - --dump DumpFlags List of items to dump from: headers,bodies,requests,responses,auth,filters,goroutines,openfiles + --dump DumpFlags List of items to dump from: headers, bodies, requests, responses, auth, filters, goroutines, openfiles, mapper --dump-bodies Dump HTTP headers and bodies - may contain sensitive info --dump-headers Dump HTTP headers - may contain sensitive info --memprofile string Write memory profile to file @@ -217,7 +218,7 @@ Logging and statistics. ``` --log-file string Log everything to this file --log-format string Comma separated list of log format options (default "date,time") - --log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "NOTICE") + --log-level LogLevel Log level DEBUG|INFO|NOTICE|ERROR (default NOTICE) --log-systemd Activate systemd integration for the logger --max-stats-groups int Maximum number of stats groups to keep in memory, on max oldest is discarded (default 1000) -P, --progress Show progress during transfer @@ -225,7 +226,7 @@ Logging and statistics. -q, --quiet Print as little stuff as possible --stats Duration Interval between printing stats, e.g. 500ms, 60s, 5m (0 to disable) (default 1m0s) --stats-file-name-length int Max file name length in stats (0 for no limit) (default 45) - --stats-log-level string Log level to show --stats output DEBUG|INFO|NOTICE|ERROR (default "INFO") + --stats-log-level LogLevel Log level to show --stats output DEBUG|INFO|NOTICE|ERROR (default INFO) --stats-one-line Make the stats fit on one line --stats-one-line-date Enable --stats-one-line and add current date/time prefix --stats-one-line-date-format string Enable --stats-one-line-date and use custom formatted date: Enclose date string in double quotes ("), see https://golang.org/pkg/time/#Time.Format @@ -249,6 +250,7 @@ Flags to control metadata. --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) --metadata-include stringArray Include metadatas matching pattern --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --metadata-mapper SpaceSepList Program to run to transforming metadata before upload --metadata-set stringArray Add metadata key=value when uploading ``` @@ -297,13 +299,13 @@ Backend only flags. These can be set in the config file also. --acd-auth-url string Auth server URL --acd-client-id string OAuth Client Id --acd-client-secret string OAuth Client Secret - --acd-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) + --acd-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) --acd-templink-threshold SizeSuffix Files >= this size will be downloaded via their tempLink (default 9Gi) --acd-token string OAuth Access Token as a JSON blob --acd-token-url string Token server url --acd-upload-wait-per-gb Duration Additional time per GiB to wait after a failed complete upload to see if it appears (default 3m0s) --alias-remote string Remote or path to alias - --azureblob-access-tier string Access tier of blob: hot, cool or archive + --azureblob-access-tier string Access tier of blob: hot, cool, cold or archive --azureblob-account string Azure Storage Account Name --azureblob-archive-tier-delete Delete archive tier blobs before overwriting --azureblob-chunk-size SizeSuffix Upload chunk size (default 4Mi) @@ -314,7 +316,7 @@ Backend only flags. These can be set in the config file also. --azureblob-client-send-certificate-chain Send the certificate chain when using certificate auth --azureblob-directory-markers Upload an empty object with a trailing slash when a new directory is created --azureblob-disable-checksum Don't store MD5 checksum with object metadata - --azureblob-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8) + --azureblob-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8) --azureblob-endpoint string Endpoint for the service --azureblob-env-auth Read credentials from runtime (environment variables, CLI or MSI) --azureblob-key string Storage Account Shared Key @@ -334,18 +336,43 @@ Backend only flags. These can be set in the config file also. --azureblob-use-emulator Uses local storage emulator if provided as 'true' --azureblob-use-msi Use a managed service identity to authenticate (only works in Azure) --azureblob-username string User name (usually an email address) + --azurefiles-account string Azure Storage Account Name + --azurefiles-chunk-size SizeSuffix Upload chunk size (default 4Mi) + --azurefiles-client-certificate-password string Password for the certificate file (optional) (obscured) + --azurefiles-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key + --azurefiles-client-id string The ID of the client in use + --azurefiles-client-secret string One of the service principal's client secrets + --azurefiles-client-send-certificate-chain Send the certificate chain when using certificate auth + --azurefiles-connection-string string Azure Files Connection String + --azurefiles-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8,Dot) + --azurefiles-endpoint string Endpoint for the service + --azurefiles-env-auth Read credentials from runtime (environment variables, CLI or MSI) + --azurefiles-key string Storage Account Shared Key + --azurefiles-max-stream-size SizeSuffix Max size for streamed files (default 10Gi) + --azurefiles-msi-client-id string Object ID of the user-assigned MSI to use, if any + --azurefiles-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any + --azurefiles-msi-object-id string Object ID of the user-assigned MSI to use, if any + --azurefiles-password string The user's password (obscured) + --azurefiles-sas-url string SAS URL + --azurefiles-service-principal-file string Path to file containing credentials for use with a service principal + --azurefiles-share-name string Azure Files Share Name + --azurefiles-tenant string ID of the service principal's tenant. Also called its directory ID + --azurefiles-upload-concurrency int Concurrency for multipart uploads (default 16) + --azurefiles-use-msi Use a managed service identity to authenticate (only works in Azure) + --azurefiles-username string User name (usually an email address) --b2-account string Account ID or Application Key ID --b2-chunk-size SizeSuffix Upload chunk size (default 96Mi) --b2-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4Gi) --b2-disable-checksum Disable checksums for large (> upload cutoff) files --b2-download-auth-duration Duration Time before the authorization token will expire in s or suffix ms|s|m|h|d (default 1w) --b2-download-url string Custom endpoint for downloads - --b2-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --b2-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) --b2-endpoint string Endpoint for the service --b2-hard-delete Permanently delete files on remote removal, otherwise hide files --b2-key string Application Key + --b2-lifecycle int Set the number of days deleted files should be kept when creating a bucket --b2-test-mode string A flag string for X-Bz-Test-Mode header for debugging - --b2-upload-concurrency int Concurrency for multipart uploads (default 16) + --b2-upload-concurrency int Concurrency for multipart uploads (default 4) --b2-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) --b2-version-at Time Show file versions as they were at the specified time (default off) --b2-versions Include old versions in directory listings @@ -356,7 +383,7 @@ Backend only flags. These can be set in the config file also. --box-client-id string OAuth Client Id --box-client-secret string OAuth Client Secret --box-commit-retries int Max number of times to try committing a multipart file (default 100) - --box-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot) + --box-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot) --box-impersonate string Impersonate this user ID when using a service account --box-list-chunk int Size of listing chunk 1-1000 (default 1000) --box-owned-by string Only show items owned by the login (email address) passed in @@ -414,7 +441,7 @@ Backend only flags. These can be set in the config file also. --drive-client-secret string OAuth Client Secret --drive-copy-shortcut-content Server side copy contents of shortcuts instead of the shortcut --drive-disable-http2 Disable drive using http2 (default true) - --drive-encoding MultiEncoder The encoding for the backend (default InvalidUtf8) + --drive-encoding Encoding The encoding for the backend (default InvalidUtf8) --drive-env-auth Get IAM credentials from runtime (environment variables or instance meta data if no env vars) --drive-export-formats string Comma separated list of preferred formats for downloading Google docs (default "docx,xlsx,pptx,svg") --drive-fast-list-bug-fix Work around a bug in Google Drive listing (default true) @@ -423,17 +450,21 @@ Backend only flags. These can be set in the config file also. --drive-import-formats string Comma separated list of preferred formats for uploading Google docs --drive-keep-revision-forever Keep new head revision of each file forever --drive-list-chunk int Size of listing chunk 100-1000, 0 to disable (default 1000) + --drive-metadata-labels Bits Control whether labels should be read or written in metadata (default off) + --drive-metadata-owner Bits Control whether owner should be read or written in metadata (default read) + --drive-metadata-permissions Bits Control whether permissions should be read or written in metadata (default off) --drive-pacer-burst int Number of API calls to allow without sleeping (default 100) --drive-pacer-min-sleep Duration Minimum time to sleep between API calls (default 100ms) --drive-resource-key string Resource key for accessing a link-shared file --drive-root-folder-id string ID of the root folder - --drive-scope string Scope that rclone should use when requesting access from drive + --drive-scope string Comma separated list of scopes that rclone should use when requesting access from drive --drive-server-side-across-configs Deprecated: use --server-side-across-configs instead --drive-service-account-credentials string Service Account Credentials JSON blob --drive-service-account-file string Service Account Credentials JSON file path --drive-shared-with-me Only show files that are shared with me + --drive-show-all-gdocs Show all Google Docs including non-exportable ones in listings --drive-size-as-quota Show sizes as storage quota usage, not actual size - --drive-skip-checksum-gphotos Skip MD5 checksum on Google photos and videos only + --drive-skip-checksum-gphotos Skip checksums on Google photos and videos only --drive-skip-dangling-shortcuts If set skip dangling shortcut files --drive-skip-gdocs Skip google documents in all listings --drive-skip-shortcuts If set skip shortcut files @@ -457,7 +488,7 @@ Backend only flags. These can be set in the config file also. --dropbox-chunk-size SizeSuffix Upload chunk size (< 150Mi) (default 48Mi) --dropbox-client-id string OAuth Client Id --dropbox-client-secret string OAuth Client Secret - --dropbox-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot) + --dropbox-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot) --dropbox-impersonate string Impersonate this user when using a business account --dropbox-pacer-min-sleep Duration Minimum time to sleep between API calls (default 10ms) --dropbox-shared-files Instructs rclone to work on individual shared files @@ -466,11 +497,11 @@ Backend only flags. These can be set in the config file also. --dropbox-token-url string Token server url --fichier-api-key string Your API Key, get it from https://1fichier.com/console/params.pl --fichier-cdn Set if you wish to use CDN download links - --fichier-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot) + --fichier-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot) --fichier-file-password string If you want to download a shared file that is password protected, add this parameter (obscured) --fichier-folder-password string If you want to list the files in a shared folder that is password protected, add this parameter (obscured) --fichier-shared-folder string If you want to download a shared folder, add this parameter - --filefabric-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) + --filefabric-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) --filefabric-permanent-token string Permanent Authentication Token --filefabric-root-folder-id string ID of the root folder --filefabric-token string Session Token @@ -484,7 +515,7 @@ Backend only flags. These can be set in the config file also. --ftp-disable-mlsd Disable using MLSD even if server advertises support --ftp-disable-tls13 Disable TLS 1.3 (workaround for FTP servers with buggy TLS) --ftp-disable-utf8 Disable using UTF-8 even if server advertises support - --ftp-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,RightSpace,Dot) + --ftp-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,RightSpace,Dot) --ftp-explicit-tls Use Explicit FTPS (FTP over TLS) --ftp-force-list-hidden Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD --ftp-host string FTP host to connect to @@ -506,7 +537,7 @@ Backend only flags. These can be set in the config file also. --gcs-client-secret string OAuth Client Secret --gcs-decompress If set this will decompress gzip encoded objects --gcs-directory-markers Upload an empty object with a trailing slash when a new directory is created - --gcs-encoding MultiEncoder The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) + --gcs-encoding Encoding The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) --gcs-endpoint string Endpoint for the service --gcs-env-auth Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars) --gcs-location string Location for the newly created buckets @@ -519,9 +550,13 @@ Backend only flags. These can be set in the config file also. --gcs-token-url string Token server url --gcs-user-project string User project --gphotos-auth-url string Auth server URL + --gphotos-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) + --gphotos-batch-mode string Upload file batching sync|async|off (default "sync") + --gphotos-batch-size int Max number of files in upload batch + --gphotos-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) --gphotos-client-id string OAuth Client Id --gphotos-client-secret string OAuth Client Secret - --gphotos-encoding MultiEncoder The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) + --gphotos-encoding Encoding The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) --gphotos-include-archived Also view and download archived media --gphotos-read-only Set to make the Google Photos backend read only --gphotos-read-size Set to read the size of media items @@ -533,8 +568,8 @@ Backend only flags. These can be set in the config file also. --hasher-max-age Duration Maximum time to keep checksums in cache (0 = no cache, off = cache forever) (default off) --hasher-remote string Remote to cache checksums for (e.g. myRemote:path) --hdfs-data-transfer-protection string Kerberos data transfer protection: authentication|integrity|privacy - --hdfs-encoding MultiEncoder The encoding for the backend (default Slash,Colon,Del,Ctl,InvalidUtf8,Dot) - --hdfs-namenode string Hadoop name node and port + --hdfs-encoding Encoding The encoding for the backend (default Slash,Colon,Del,Ctl,InvalidUtf8,Dot) + --hdfs-namenode CommaSepList Hadoop name nodes and ports --hdfs-service-principal-name string Kerberos service principal name for the namenode --hdfs-username string Hadoop user name --hidrive-auth-url string Auth server URL @@ -542,7 +577,7 @@ Backend only flags. These can be set in the config file also. --hidrive-client-id string OAuth Client Id --hidrive-client-secret string OAuth Client Secret --hidrive-disable-fetching-member-count Do not fetch number of objects in directories unless it is absolutely necessary - --hidrive-encoding MultiEncoder The encoding for the backend (default Slash,Dot) + --hidrive-encoding Encoding The encoding for the backend (default Slash,Dot) --hidrive-endpoint string Endpoint for the service (default "https://api.hidrive.strato.com/2.1") --hidrive-root-prefix string The root/parent folder for all paths (default "/") --hidrive-scope-access string Access permissions that rclone should use when requesting access from HiDrive (default "rw") @@ -555,9 +590,16 @@ Backend only flags. These can be set in the config file also. --http-no-head Don't use HEAD requests --http-no-slash Set this if the site doesn't end directories with / --http-url string URL of HTTP host to connect to + --imagekit-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Dollar,Question,Hash,Percent,BackSlash,Del,Ctl,InvalidUtf8,Dot,SquareBracket) + --imagekit-endpoint string You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-only-signed Restrict unsigned image URLs If you have configured Restrict unsigned image URLs in your dashboard settings, set this to true + --imagekit-private-key string You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-public-key string You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-upload-tags string Tags to add to the uploaded files, e.g. "tag1,tag2" + --imagekit-versions Include old versions in directory listings --internetarchive-access-key-id string IAS3 Access Key --internetarchive-disable-checksum Don't ask the server to test against MD5 checksum calculated by rclone (default true) - --internetarchive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot) + --internetarchive-encoding Encoding The encoding for the backend (default Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot) --internetarchive-endpoint string IAS3 Endpoint (default "https://s3.us.archive.org") --internetarchive-front-endpoint string Host of InternetArchive Frontend (default "https://archive.org") --internetarchive-secret-access-key string IAS3 Secret Key (password) @@ -565,7 +607,7 @@ Backend only flags. These can be set in the config file also. --jottacloud-auth-url string Auth server URL --jottacloud-client-id string OAuth Client Id --jottacloud-client-secret string OAuth Client Secret - --jottacloud-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot) + --jottacloud-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot) --jottacloud-hard-delete Delete files permanently rather than putting them into the trash --jottacloud-md5-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate the MD5 if required (default 10Mi) --jottacloud-no-versions Avoid server side versioning by deleting files and recreating files instead of overwriting them @@ -573,17 +615,18 @@ Backend only flags. These can be set in the config file also. --jottacloud-token-url string Token server url --jottacloud-trashed-only Only show files that are in the trash --jottacloud-upload-resume-limit SizeSuffix Files bigger than this can be resumed if the upload fail's (default 10Mi) - --koofr-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --koofr-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) --koofr-endpoint string The Koofr API endpoint to use --koofr-mountid string Mount ID of the mount to use --koofr-password string Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password) (obscured) --koofr-provider string Choose your storage provider --koofr-setmtime Does the backend support setting modification time (default true) --koofr-user string Your user name + --linkbox-token string Token from https://www.linkbox.to/admin/account -l, --links Translate symlinks to/from regular files with a '.rclonelink' extension --local-case-insensitive Force the filesystem to report itself as case insensitive --local-case-sensitive Force the filesystem to report itself as case sensitive - --local-encoding MultiEncoder The encoding for the backend (default Slash,Dot) + --local-encoding Encoding The encoding for the backend (default Slash,Dot) --local-no-check-updated Don't check to see if the files change during upload --local-no-preallocate Disable preallocation of disk space for transferred files --local-no-set-modtime Disable setting modtime @@ -595,7 +638,7 @@ Backend only flags. These can be set in the config file also. --mailru-check-hash What should copy do if file checksum is mismatched or invalid (default true) --mailru-client-id string OAuth Client Id --mailru-client-secret string OAuth Client Secret - --mailru-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --mailru-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot) --mailru-pass string Password (obscured) --mailru-speedup-enable Skip full upload if there is another file with same data hash (default true) --mailru-speedup-file-patterns string Comma separated list of file name patterns eligible for speedup (put by hash) (default "*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf") @@ -605,7 +648,7 @@ Backend only flags. These can be set in the config file also. --mailru-token-url string Token server url --mailru-user string User name (usually email) --mega-debug Output more debug from Mega - --mega-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) + --mega-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) --mega-hard-delete Delete files permanently rather than putting them into the trash --mega-pass string Password (obscured) --mega-use-https Use HTTPS for transfers @@ -621,9 +664,10 @@ Backend only flags. These can be set in the config file also. --onedrive-chunk-size SizeSuffix Chunk size to upload files with - must be multiple of 320k (327,680 bytes) (default 10Mi) --onedrive-client-id string OAuth Client Id --onedrive-client-secret string OAuth Client Secret + --onedrive-delta If set rclone will use delta listing to implement recursive listings --onedrive-drive-id string The ID of the drive to use --onedrive-drive-type string The type of the drive (personal | business | documentLibrary) - --onedrive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot) + --onedrive-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot) --onedrive-expose-onenote-files Set to make OneNote files show up in directory listings --onedrive-hash-type string Specify the hash in use for the backend (default "auto") --onedrive-link-password string Set the password for links created by the link command @@ -644,7 +688,7 @@ Backend only flags. These can be set in the config file also. --oos-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) --oos-copy-timeout Duration Timeout for copy (default 1m0s) --oos-disable-checksum Don't store MD5 checksum with object metadata - --oos-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) + --oos-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) --oos-endpoint string Endpoint for Object storage API --oos-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts for manual recovery --oos-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) @@ -661,13 +705,13 @@ Backend only flags. These can be set in the config file also. --oos-upload-concurrency int Concurrency for multipart uploads (default 10) --oos-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) --opendrive-chunk-size SizeSuffix Files will be uploaded in chunks this size (default 10Mi) - --opendrive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot) + --opendrive-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot) --opendrive-password string Password (obscured) --opendrive-username string Username --pcloud-auth-url string Auth server URL --pcloud-client-id string OAuth Client Id --pcloud-client-secret string OAuth Client Secret - --pcloud-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --pcloud-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) --pcloud-hostname string Hostname to connect to (default "api.pcloud.com") --pcloud-password string Your pcloud password (obscured) --pcloud-root-folder-id string Fill in for rclone to use a non root folder as its starting point (default "d0") @@ -677,7 +721,7 @@ Backend only flags. These can be set in the config file also. --pikpak-auth-url string Auth server URL --pikpak-client-id string OAuth Client Id --pikpak-client-secret string OAuth Client Secret - --pikpak-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot) + --pikpak-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot) --pikpak-hash-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate hash if required (default 10Mi) --pikpak-pass string Pikpak password (obscured) --pikpak-root-folder-id string ID of the root folder @@ -689,13 +733,13 @@ Backend only flags. These can be set in the config file also. --premiumizeme-auth-url string Auth server URL --premiumizeme-client-id string OAuth Client Id --premiumizeme-client-secret string OAuth Client Secret - --premiumizeme-encoding MultiEncoder The encoding for the backend (default Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --premiumizeme-encoding Encoding The encoding for the backend (default Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot) --premiumizeme-token string OAuth Access Token as a JSON blob --premiumizeme-token-url string Token server url --protondrive-2fa string The 2FA code --protondrive-app-version string The app version string (default "macos-drive@1.0.0-alpha.1+rclone") --protondrive-enable-caching Caches the files and folders metadata to reduce API calls (default true) - --protondrive-encoding MultiEncoder The encoding for the backend (default Slash,LeftSpace,RightSpace,InvalidUtf8,Dot) + --protondrive-encoding Encoding The encoding for the backend (default Slash,LeftSpace,RightSpace,InvalidUtf8,Dot) --protondrive-mailbox-password string The mailbox password of your two-password proton account (obscured) --protondrive-original-file-size Return the file size before encryption (default true) --protondrive-password string The password of your proton account (obscured) @@ -704,13 +748,13 @@ Backend only flags. These can be set in the config file also. --putio-auth-url string Auth server URL --putio-client-id string OAuth Client Id --putio-client-secret string OAuth Client Secret - --putio-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --putio-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) --putio-token string OAuth Access Token as a JSON blob --putio-token-url string Token server url --qingstor-access-key-id string QingStor Access Key ID --qingstor-chunk-size SizeSuffix Chunk size to use for uploading (default 4Mi) --qingstor-connection-retries int Number of connection retries (default 3) - --qingstor-encoding MultiEncoder The encoding for the backend (default Slash,Ctl,InvalidUtf8) + --qingstor-encoding Encoding The encoding for the backend (default Slash,Ctl,InvalidUtf8) --qingstor-endpoint string Enter an endpoint URL to connection QingStor API --qingstor-env-auth Get QingStor credentials from runtime --qingstor-secret-access-key string QingStor Secret Access Key (password) @@ -719,7 +763,7 @@ Backend only flags. These can be set in the config file also. --qingstor-zone string Zone to connect to --quatrix-api-key string API key for accessing Quatrix account --quatrix-effective-upload-time string Wanted upload time for one chunk (default "4s") - --quatrix-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --quatrix-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) --quatrix-hard-delete Delete files permanently rather than putting them into the trash --quatrix-host string Host name of Quatrix account --quatrix-maximal-summary-chunk-size SizeSuffix The maximal summary for all chunks. It should not be less than 'transfers'*'minimal_chunk_size' (default 95.367Mi) @@ -734,7 +778,7 @@ Backend only flags. These can be set in the config file also. --s3-disable-checksum Don't store MD5 checksum with object metadata --s3-disable-http2 Disable usage of http2 for S3 backends --s3-download-url string Custom endpoint for downloads - --s3-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) + --s3-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) --s3-endpoint string Endpoint for S3 API --s3-env-auth Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars) --s3-force-path-style If true use path style access if false use virtual hosted style (default true) @@ -768,14 +812,16 @@ Backend only flags. These can be set in the config file also. --s3-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) --s3-use-accelerate-endpoint If true use the AWS S3 accelerated endpoint --s3-use-accept-encoding-gzip Accept-Encoding: gzip Whether to send Accept-Encoding: gzip header (default unset) + --s3-use-already-exists Tristate Set if rclone should report BucketAlreadyExists errors on bucket creation (default unset) --s3-use-multipart-etag Tristate Whether to use ETag in multipart uploads for verification (default unset) + --s3-use-multipart-uploads Tristate Set if rclone should use multipart uploads (default unset) --s3-use-presigned-request Whether to use a presigned request or PutObject for single part uploads --s3-v2-auth If true use v2 authentication --s3-version-at Time Show file versions as they were at the specified time (default off) --s3-versions Include old versions in directory listings --seafile-2fa Two-factor authentication ('true' if the account has 2FA enabled) --seafile-create-library Should rclone create a library if it doesn't exist - --seafile-encoding MultiEncoder The encoding for the backend (default Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8) + --seafile-encoding Encoding The encoding for the backend (default Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8) --seafile-library string Name of the library --seafile-library-key string Library password (for encrypted libraries only) (obscured) --seafile-pass string Password (obscured) @@ -785,6 +831,7 @@ Backend only flags. These can be set in the config file also. --sftp-chunk-size SizeSuffix Upload and download chunk size (default 32Ki) --sftp-ciphers SpaceSepList Space separated list of ciphers to be used for session encryption, ordered by preference --sftp-concurrency int The maximum number of outstanding requests for one file (default 64) + --sftp-copy-is-hardlink Set to enable server side copies using hardlinks --sftp-disable-concurrent-reads If set don't use concurrent reads --sftp-disable-concurrent-writes If set don't use concurrent writes --sftp-disable-hashcheck Disable the execution of SSH commands to determine if remote file hashing is available @@ -819,7 +866,7 @@ Backend only flags. These can be set in the config file also. --sharefile-chunk-size SizeSuffix Upload chunk size (default 64Mi) --sharefile-client-id string OAuth Client Id --sharefile-client-secret string OAuth Client Secret - --sharefile-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot) + --sharefile-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot) --sharefile-endpoint string Endpoint for API calls --sharefile-root-folder-id string ID of the root folder --sharefile-token string OAuth Access Token as a JSON blob @@ -827,12 +874,12 @@ Backend only flags. These can be set in the config file also. --sharefile-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (default 128Mi) --sia-api-password string Sia Daemon API Password (obscured) --sia-api-url string Sia daemon API URL, like http://sia.daemon.host:9980 (default "http://127.0.0.1:9980") - --sia-encoding MultiEncoder The encoding for the backend (default Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot) + --sia-encoding Encoding The encoding for the backend (default Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot) --sia-user-agent string Siad User Agent (default "Sia-Agent") --skip-links Don't warn about skipped symlinks --smb-case-insensitive Whether the server is configured to be case-insensitive (default true) --smb-domain string Domain name for NTLM authentication (default "WORKGROUP") - --smb-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot) + --smb-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot) --smb-hide-special-share Hide special shares (e.g. print$) which users aren't supposed to access (default true) --smb-host string SMB server hostname to connect to --smb-idle-timeout Duration Max time before closing idle connections (default 1m0s) @@ -850,7 +897,7 @@ Backend only flags. These can be set in the config file also. --sugarsync-authorization string Sugarsync authorization --sugarsync-authorization-expiry string Sugarsync authorization expiry --sugarsync-deleted-id string Sugarsync deleted folder id - --sugarsync-encoding MultiEncoder The encoding for the backend (default Slash,Ctl,InvalidUtf8,Dot) + --sugarsync-encoding Encoding The encoding for the backend (default Slash,Ctl,InvalidUtf8,Dot) --sugarsync-hard-delete Permanently delete files if true --sugarsync-private-access-key string Sugarsync Private Access Key --sugarsync-refresh-token string Sugarsync refresh token @@ -864,7 +911,7 @@ Backend only flags. These can be set in the config file also. --swift-auth-version int AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION) --swift-chunk-size SizeSuffix Above this size files will be chunked into a _segments container (default 5Gi) --swift-domain string User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME) - --swift-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8) + --swift-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8) --swift-endpoint-type string Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE) (default "public") --swift-env-auth Get swift credentials from environment variables in standard OpenStack form --swift-key string API key or password (OS_PASSWORD) @@ -886,7 +933,7 @@ Backend only flags. These can be set in the config file also. --union-search-policy string Policy to choose upstream on SEARCH category (default "ff") --union-upstreams string List of space separated upstreams --uptobox-access-token string Your access token - --uptobox-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot) + --uptobox-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot) --uptobox-private Set to make uploaded files private --webdav-bearer-token string Bearer token instead of user/pass (e.g. a Macaroon) --webdav-bearer-token-command string Command to run to get a bearer token @@ -901,14 +948,14 @@ Backend only flags. These can be set in the config file also. --yandex-auth-url string Auth server URL --yandex-client-id string OAuth Client Id --yandex-client-secret string OAuth Client Secret - --yandex-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) + --yandex-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) --yandex-hard-delete Delete files permanently rather than putting them into the trash --yandex-token string OAuth Access Token as a JSON blob --yandex-token-url string Token server url --zoho-auth-url string Auth server URL --zoho-client-id string OAuth Client Id --zoho-client-secret string OAuth Client Secret - --zoho-encoding MultiEncoder The encoding for the backend (default Del,Ctl,InvalidUtf8) + --zoho-encoding Encoding The encoding for the backend (default Del,Ctl,InvalidUtf8) --zoho-region string Zoho region to connect to --zoho-token string OAuth Access Token as a JSON blob --zoho-token-url string Token server url diff --git a/docs/content/ftp.md b/docs/content/ftp.md index 7d01d9f8ef494..b00bb8accd939 100644 --- a/docs/content/ftp.md +++ b/docs/content/ftp.md @@ -443,7 +443,7 @@ Properties: - Config: encoding - Env Var: RCLONE_FTP_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Del,Ctl,RightSpace,Dot - Examples: - "Asterisk,Ctl,Dot,Slash" diff --git a/docs/content/googlecloudstorage.md b/docs/content/googlecloudstorage.md index 0c751296472fe..561d536c5ee73 100644 --- a/docs/content/googlecloudstorage.md +++ b/docs/content/googlecloudstorage.md @@ -696,7 +696,7 @@ Properties: - Config: encoding - Env Var: RCLONE_GCS_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,CrLf,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/googlephotos.md b/docs/content/googlephotos.md index bce5a26f7c7fc..76a9af6d6f35b 100644 --- a/docs/content/googlephotos.md +++ b/docs/content/googlephotos.md @@ -374,9 +374,93 @@ Properties: - Config: encoding - Env Var: RCLONE_GPHOTOS_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,CrLf,InvalidUtf8,Dot +#### --gphotos-batch-mode + +Upload file batching sync|async|off. + +This sets the batch mode used by rclone. + +This has 3 possible values + +- off - no batching +- sync - batch uploads and check completion (default) +- async - batch upload and don't check completion + +Rclone will close any outstanding batches when it exits which may make +a delay on quit. + + +Properties: + +- Config: batch_mode +- Env Var: RCLONE_GPHOTOS_BATCH_MODE +- Type: string +- Default: "sync" + +#### --gphotos-batch-size + +Max number of files in upload batch. + +This sets the batch size of files to upload. It has to be less than 50. + +By default this is 0 which means rclone which calculate the batch size +depending on the setting of batch_mode. + +- batch_mode: async - default batch_size is 50 +- batch_mode: sync - default batch_size is the same as --transfers +- batch_mode: off - not in use + +Rclone will close any outstanding batches when it exits which may make +a delay on quit. + +Setting this is a great idea if you are uploading lots of small files +as it will make them a lot quicker. You can use --transfers 32 to +maximise throughput. + + +Properties: + +- Config: batch_size +- Env Var: RCLONE_GPHOTOS_BATCH_SIZE +- Type: int +- Default: 0 + +#### --gphotos-batch-timeout + +Max time to allow an idle upload batch before uploading. + +If an upload batch is idle for more than this long then it will be +uploaded. + +The default for this is 0 which means rclone will choose a sensible +default based on the batch_mode in use. + +- batch_mode: async - default batch_timeout is 10s +- batch_mode: sync - default batch_timeout is 1s +- batch_mode: off - not in use + + +Properties: + +- Config: batch_timeout +- Env Var: RCLONE_GPHOTOS_BATCH_TIMEOUT +- Type: Duration +- Default: 0s + +#### --gphotos-batch-commit-timeout + +Max time to wait for a batch to finish committing + +Properties: + +- Config: batch_commit_timeout +- Env Var: RCLONE_GPHOTOS_BATCH_COMMIT_TIMEOUT +- Type: Duration +- Default: 10m0s + {{< rem autogenerated options stop >}} ## Limitations diff --git a/docs/content/hdfs.md b/docs/content/hdfs.md index 58889c65f13c6..6e85414c33c3c 100644 --- a/docs/content/hdfs.md +++ b/docs/content/hdfs.md @@ -156,16 +156,16 @@ Here are the Standard options specific to hdfs (Hadoop distributed file system). #### --hdfs-namenode -Hadoop name node and port. +Hadoop name nodes and ports. -E.g. "namenode:8020" to connect to host namenode at port 8020. +E.g. "namenode-1:8020,namenode-2:8020,..." to connect to host namenodes at port 8020. Properties: - Config: namenode - Env Var: RCLONE_HDFS_NAMENODE -- Type: string -- Required: true +- Type: CommaSepList +- Default: #### --hdfs-username @@ -229,7 +229,7 @@ Properties: - Config: encoding - Env Var: RCLONE_HDFS_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Colon,Del,Ctl,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/hidrive.md b/docs/content/hidrive.md index 8307781190643..f48dcb8e9d9f0 100644 --- a/docs/content/hidrive.md +++ b/docs/content/hidrive.md @@ -415,7 +415,7 @@ Properties: - Config: encoding - Env Var: RCLONE_HIDRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/http.md b/docs/content/http.md index 19667dda41f0f..0fa8ca0a18919 100644 --- a/docs/content/http.md +++ b/docs/content/http.md @@ -212,6 +212,46 @@ Properties: - Type: bool - Default: false +## Backend commands + +Here are the commands specific to the http backend. + +Run them with + + rclone backend COMMAND remote: + +The help below will explain what arguments each command takes. + +See the [backend](/commands/rclone_backend/) command for more +info on how to pass options and arguments. + +These can be run on a running backend using the rc command +[backend/command](/rc/#backend-command). + +### set + +Set command for updating the config parameters. + + rclone backend set remote: [options] [+] + +This set command can be used to update the config parameters +for a running http backend. + +Usage Examples: + + rclone backend set remote: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=remote: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=remote: -o url=https://example.com + +The option keys are named as they are in the config file. + +This rebuilds the connection to the http backend when it is called with +the new parameters. Only new parameters need be passed as the values +will default to those currently in use. + +It doesn't return anything. + + {{< rem autogenerated options stop >}} ## Limitations diff --git a/docs/content/imagekit.md b/docs/content/imagekit.md index 1f85db5526a64..c0ae147d2ea85 100644 --- a/docs/content/imagekit.md +++ b/docs/content/imagekit.md @@ -167,6 +167,17 @@ Properties: - Type: bool - Default: false +#### --imagekit-upload-tags + +Tags to add to the uploaded files, e.g. "tag1,tag2". + +Properties: + +- Config: upload_tags +- Env Var: RCLONE_IMAGEKIT_UPLOAD_TAGS +- Type: string +- Required: false + #### --imagekit-encoding The encoding for the backend. @@ -188,11 +199,11 @@ Here are the possible system metadata items for the imagekit backend. | Name | Help | Type | Example | Read Only | |------|------|------|---------|-----------| -| aws-tags | AI generated tags by AWS Rekognition associated with the file | string | tag1,tag2 | **Y** | +| aws-tags | AI generated tags by AWS Rekognition associated with the image | string | tag1,tag2 | **Y** | | btime | Time of file birth (creation) read from Last-Modified header | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** | | custom-coordinates | Custom coordinates of the file | string | 0,0,100,100 | **Y** | | file-type | Type of the file | string | image | **Y** | -| google-tags | AI generated tags by Google Cloud Vision associated with the file | string | tag1,tag2 | **Y** | +| google-tags | AI generated tags by Google Cloud Vision associated with the image | string | tag1,tag2 | **Y** | | has-alpha | Whether the image has alpha channel or not | bool | | **Y** | | height | Height of the image or video in pixels | int | | **Y** | | is-private-file | Whether the file is private or not | bool | | **Y** | diff --git a/docs/content/internetarchive.md b/docs/content/internetarchive.md index a2d5a4771d790..980c534a6f10a 100644 --- a/docs/content/internetarchive.md +++ b/docs/content/internetarchive.md @@ -260,7 +260,7 @@ Properties: - Config: encoding - Env Var: RCLONE_INTERNETARCHIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot ### Metadata diff --git a/docs/content/jottacloud.md b/docs/content/jottacloud.md index ef570c3943c96..3ac1fc370b929 100644 --- a/docs/content/jottacloud.md +++ b/docs/content/jottacloud.md @@ -444,9 +444,24 @@ Properties: - Config: encoding - Env Var: RCLONE_JOTTACLOUD_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot +### Metadata + +Jottacloud has limited support for metadata, currently an extended set of timestamps. + +Here are the possible system metadata items for the jottacloud backend. + +| Name | Help | Type | Example | Read Only | +|------|------|------|---------|-----------| +| btime | Time of file birth (creation), read from rclone metadata | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | N | +| content-type | MIME type, also known as media type | string | text/plain | **Y** | +| mtime | Time of last modification, read from rclone metadata | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | N | +| utime | Time of last upload, when current revision was created, generated by backend | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** | + +See the [metadata](/docs/#metadata) docs for more info. + {{< rem autogenerated options stop >}} ## Limitations diff --git a/docs/content/koofr.md b/docs/content/koofr.md index 6fbbbcabfaefd..3d161297f661d 100644 --- a/docs/content/koofr.md +++ b/docs/content/koofr.md @@ -171,34 +171,6 @@ Properties: - Type: string - Required: true -#### --koofr-password - -Your password for rclone (generate one at https://storage.rcs-rds.ro/app/admin/preferences/password). - -**NB** Input to this must be obscured - see [rclone obscure](/commands/rclone_obscure/). - -Properties: - -- Config: password -- Env Var: RCLONE_KOOFR_PASSWORD -- Provider: digistorage -- Type: string -- Required: true - -#### --koofr-password - -Your password for rclone (generate one at your service's settings page). - -**NB** Input to this must be obscured - see [rclone obscure](/commands/rclone_obscure/). - -Properties: - -- Config: password -- Env Var: RCLONE_KOOFR_PASSWORD -- Provider: other -- Type: string -- Required: true - ### Advanced options Here are the Advanced options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers). @@ -239,7 +211,7 @@ Properties: - Config: encoding - Env Var: RCLONE_KOOFR_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/local.md b/docs/content/local.md index d7881eef623fc..fec259cd73392 100644 --- a/docs/content/local.md +++ b/docs/content/local.md @@ -451,6 +451,11 @@ time we: - Only checksum the size that stat gave - Don't update the stat info for the file +**NB** do not use this flag on a Windows Volume Shadow (VSS). For some +unknown reason, files in a VSS sometimes show different sizes from the +directory listing (where the initial stat value comes from on Windows) +and when stat is called on them directly. Other copy tools always use +the direct stat value and setting this flag will disable that. Properties: @@ -561,7 +566,7 @@ Properties: - Config: encoding - Env Var: RCLONE_LOCAL_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Dot ### Metadata diff --git a/docs/content/mailru.md b/docs/content/mailru.md index 9aae4013dad92..01de432f2a0c9 100644 --- a/docs/content/mailru.md +++ b/docs/content/mailru.md @@ -409,7 +409,7 @@ Properties: - Config: encoding - Env Var: RCLONE_MAILRU_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/mega.md b/docs/content/mega.md index 53a275868bbcc..e553842c0c58a 100644 --- a/docs/content/mega.md +++ b/docs/content/mega.md @@ -279,7 +279,7 @@ Properties: - Config: encoding - Env Var: RCLONE_MEGA_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/onedrive.md b/docs/content/onedrive.md index a57db07640a84..e2ec8b0c2ce56 100644 --- a/docs/content/onedrive.md +++ b/docs/content/onedrive.md @@ -620,6 +620,43 @@ Properties: - Type: bool - Default: false +#### --onedrive-delta + +If set rclone will use delta listing to implement recursive listings. + +If this flag is set the the onedrive backend will advertise `ListR` +support for recursive listings. + +Setting this flag speeds up these things greatly: + + rclone lsf -R onedrive: + rclone size onedrive: + rclone rc vfs/refresh recursive=true + +**However** the delta listing API **only** works at the root of the +drive. If you use it not at the root then it recurses from the root +and discards all the data that is not under the directory you asked +for. So it will be correct but may not be very efficient. + +This is why this flag is not set as the default. + +As a rule of thumb if nearly all of your data is under rclone's root +directory (the `root/directory` in `onedrive:root/directory`) then +using this flag will be be a big performance win. If your data is +mostly not under the root then using this flag will be a big +performance loss. + +It is recommended if you are mounting your onedrive at the root +(or near the root when using crypt) and using rclone `rc vfs/refresh`. + + +Properties: + +- Config: delta +- Env Var: RCLONE_ONEDRIVE_DELTA +- Type: bool +- Default: false + #### --onedrive-encoding The encoding for the backend. @@ -630,7 +667,7 @@ Properties: - Config: encoding - Env Var: RCLONE_ONEDRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/opendrive.md b/docs/content/opendrive.md index 90d5f4cf431e6..4cf82d77311db 100644 --- a/docs/content/opendrive.md +++ b/docs/content/opendrive.md @@ -145,7 +145,7 @@ Properties: - Config: encoding - Env Var: RCLONE_OPENDRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot #### --opendrive-chunk-size diff --git a/docs/content/oracleobjectstorage.md b/docs/content/oracleobjectstorage.md index 7ed7a08701eec..a418ad8b30621 100644 --- a/docs/content/oracleobjectstorage.md +++ b/docs/content/oracleobjectstorage.md @@ -552,7 +552,7 @@ Properties: - Config: encoding - Env Var: RCLONE_OOS_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,InvalidUtf8,Dot #### --oos-leave-parts-on-error diff --git a/docs/content/pcloud.md b/docs/content/pcloud.md index 3a28668f5c7a6..cb1b0ba368778 100644 --- a/docs/content/pcloud.md +++ b/docs/content/pcloud.md @@ -225,7 +225,7 @@ Properties: - Config: encoding - Env Var: RCLONE_PCLOUD_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot #### --pcloud-root-folder-id diff --git a/docs/content/pikpak.md b/docs/content/pikpak.md index 502219238016a..472e14fd14c29 100644 --- a/docs/content/pikpak.md +++ b/docs/content/pikpak.md @@ -237,7 +237,7 @@ Properties: - Config: encoding - Env Var: RCLONE_PIKPAK_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot ## Backend commands diff --git a/docs/content/premiumizeme.md b/docs/content/premiumizeme.md index 6b8ccace4476b..2d462c60f963f 100644 --- a/docs/content/premiumizeme.md +++ b/docs/content/premiumizeme.md @@ -199,7 +199,7 @@ Properties: - Config: encoding - Env Var: RCLONE_PREMIUMIZEME_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/protondrive.md b/docs/content/protondrive.md index 5e46803c43402..3b23d39fea588 100644 --- a/docs/content/protondrive.md +++ b/docs/content/protondrive.md @@ -246,7 +246,7 @@ Properties: - Config: encoding - Env Var: RCLONE_PROTONDRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LeftSpace,RightSpace,InvalidUtf8,Dot #### --protondrive-original-file-size diff --git a/docs/content/putio.md b/docs/content/putio.md index e0db468503df7..8c8722b9d3db0 100644 --- a/docs/content/putio.md +++ b/docs/content/putio.md @@ -196,7 +196,7 @@ Properties: - Config: encoding - Env Var: RCLONE_PUTIO_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/qingstor.md b/docs/content/qingstor.md index 219e61a9b213e..69fd51f81d5df 100644 --- a/docs/content/qingstor.md +++ b/docs/content/qingstor.md @@ -307,7 +307,7 @@ Properties: - Config: encoding - Env Var: RCLONE_QINGSTOR_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Ctl,InvalidUtf8 {{< rem autogenerated options stop >}} diff --git a/docs/content/quatrix.md b/docs/content/quatrix.md index 02ea14cea45f6..bc8d715fd8eb4 100644 --- a/docs/content/quatrix.md +++ b/docs/content/quatrix.md @@ -189,7 +189,7 @@ Properties: - Config: encoding - Env Var: RCLONE_QUATRIX_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot #### --quatrix-effective-upload-time diff --git a/docs/content/rc.md b/docs/content/rc.md index 86a2c6074b90d..7e4ed11d00a9b 100644 --- a/docs/content/rc.md +++ b/docs/content/rc.md @@ -1173,6 +1173,56 @@ See the [about](/commands/rclone_about/) command for more information on the abo **Authentication is required for this call.** +### operations/check: check the source and destination are the same {#operations-check} + +Checks the files in the source and destination match. It compares +sizes and hashes and logs a report of files that don't +match. It doesn't alter the source or destination. + +This takes the following parameters: + +- srcFs - a remote name string e.g. "drive:" for the source, "/" for local filesystem +- dstFs - a remote name string e.g. "drive2:" for the destination, "/" for local filesystem +- download - check by downloading rather than with hash +- checkFileHash - treat checkFileFs:checkFileRemote as a SUM file with hashes of given type +- checkFileFs - treat checkFileFs:checkFileRemote as a SUM file with hashes of given type +- checkFileRemote - treat checkFileFs:checkFileRemote as a SUM file with hashes of given type +- oneWay - check one way only, source files must exist on remote +- combined - make a combined report of changes (default false) +- missingOnSrc - report all files missing from the source (default true) +- missingOnDst - report all files missing from the destination (default true) +- match - report all matching files (default false) +- differ - report all non-matching files (default true) +- error - report all files with errors (hashing or reading) (default true) + +If you supply the download flag, it will download the data from +both remotes and check them against each other on the fly. This can +be useful for remotes that don't support hashes or if you really want +to check all the data. + +If you supply the size-only global flag, it will only compare the sizes not +the hashes as well. Use this for a quick check. + +If you supply the checkFileHash option with a valid hash name, the +checkFileFs:checkFileRemote must point to a text file in the SUM +format. This treats the checksum file as the source and dstFs as the +destination. Note that srcFs is not used and should not be supplied in +this case. + +Returns: + +- success - true if no error, false otherwise +- status - textual summary of check, OK or text string +- hashType - hash used in check, may be missing +- combined - array of strings of combined report of changes +- missingOnSrc - array of strings of all files missing from the source +- missingOnDst - array of strings of all files missing from the destination +- match - array of strings of all matching files +- differ - array of strings of all non-matching files +- error - array of strings of all files with errors (hashing or reading) + +**Authentication is required for this call.** + ### operations/cleanup: Remove trashed files in the remote or path {#operations-cleanup} This takes the following parameters: diff --git a/docs/content/s3.md b/docs/content/s3.md index b4bdf10f89d45..aa16509acdd8e 100644 --- a/docs/content/s3.md +++ b/docs/content/s3.md @@ -669,7 +669,7 @@ A simple solution is to set the `--s3-upload-cutoff 0` and force all the files t {{< rem autogenerated options start" - DO NOT EDIT - instead edit fs.RegInfo in backend/s3/s3.go then run make backenddocs" >}} ### Standard options -Here are the Standard options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, China Mobile, Cloudflare, GCS, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Leviia, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi). +Here are the Standard options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Minio, Netease, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others). #### --s3-provider @@ -714,6 +714,8 @@ Properties: - Leviia Object Storage - "Liara" - Liara Object Storage + - "Linode" + - Linode Object Storage - "Minio" - Minio Object Storage - "Netease" @@ -722,6 +724,8 @@ Properties: - Petabox Object Storage - "RackCorp" - RackCorp Object Storage + - "Rclone" + - Rclone S3 Server - "Scaleway" - Scaleway Object Storage - "SeaweedFS" @@ -874,979 +878,19 @@ Properties: - AWS GovCloud (US) Region. - Needs location constraint us-gov-west-1. -#### --s3-region - -region - the location where your bucket will be created and your data stored. - - -Properties: - -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: RackCorp -- Type: string -- Required: false -- Examples: - - "global" - - Global CDN (All locations) Region - - "au" - - Australia (All states) - - "au-nsw" - - NSW (Australia) Region - - "au-qld" - - QLD (Australia) Region - - "au-vic" - - VIC (Australia) Region - - "au-wa" - - Perth (Australia) Region - - "ph" - - Manila (Philippines) Region - - "th" - - Bangkok (Thailand) Region - - "hk" - - HK (Hong Kong) Region - - "mn" - - Ulaanbaatar (Mongolia) Region - - "kg" - - Bishkek (Kyrgyzstan) Region - - "id" - - Jakarta (Indonesia) Region - - "jp" - - Tokyo (Japan) Region - - "sg" - - SG (Singapore) Region - - "de" - - Frankfurt (Germany) Region - - "us" - - USA (AnyCast) Region - - "us-east-1" - - New York (USA) Region - - "us-west-1" - - Freemont (USA) Region - - "nz" - - Auckland (New Zealand) Region - -#### --s3-region - -Region to connect to. - -Properties: - -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: Scaleway -- Type: string -- Required: false -- Examples: - - "nl-ams" - - Amsterdam, The Netherlands - - "fr-par" - - Paris, France - - "pl-waw" - - Warsaw, Poland - -#### --s3-region - -Region to connect to. - the location where your bucket will be created and your data stored. Need bo be same with your endpoint. - - -Properties: - -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: HuaweiOBS -- Type: string -- Required: false -- Examples: - - "af-south-1" - - AF-Johannesburg - - "ap-southeast-2" - - AP-Bangkok - - "ap-southeast-3" - - AP-Singapore - - "cn-east-3" - - CN East-Shanghai1 - - "cn-east-2" - - CN East-Shanghai2 - - "cn-north-1" - - CN North-Beijing1 - - "cn-north-4" - - CN North-Beijing4 - - "cn-south-1" - - CN South-Guangzhou - - "ap-southeast-1" - - CN-Hong Kong - - "sa-argentina-1" - - LA-Buenos Aires1 - - "sa-peru-1" - - LA-Lima1 - - "na-mexico-1" - - LA-Mexico City1 - - "sa-chile-1" - - LA-Santiago2 - - "sa-brazil-1" - - LA-Sao Paulo1 - - "ru-northwest-2" - - RU-Moscow2 - -#### --s3-region - -Region to connect to. - -Properties: - -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: Cloudflare -- Type: string -- Required: false -- Examples: - - "auto" - - R2 buckets are automatically distributed across Cloudflare's data centers for low latency. - -#### --s3-region - -Region to connect to. - -Properties: - -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: Qiniu -- Type: string -- Required: false -- Examples: - - "cn-east-1" - - The default endpoint - a good choice if you are unsure. - - East China Region 1. - - Needs location constraint cn-east-1. - - "cn-east-2" - - East China Region 2. - - Needs location constraint cn-east-2. - - "cn-north-1" - - North China Region 1. - - Needs location constraint cn-north-1. - - "cn-south-1" - - South China Region 1. - - Needs location constraint cn-south-1. - - "us-north-1" - - North America Region. - - Needs location constraint us-north-1. - - "ap-southeast-1" - - Southeast Asia Region 1. - - Needs location constraint ap-southeast-1. - - "ap-northeast-1" - - Northeast Asia Region 1. - - Needs location constraint ap-northeast-1. - -#### --s3-region - -Region where your bucket will be created and your data stored. - - -Properties: - -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: IONOS -- Type: string -- Required: false -- Examples: - - "de" - - Frankfurt, Germany - - "eu-central-2" - - Berlin, Germany - - "eu-south-2" - - Logrono, Spain - -#### --s3-region - -Region where your bucket will be created and your data stored. - - -Properties: - -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: Petabox -- Type: string -- Required: false -- Examples: - - "us-east-1" - - US East (N. Virginia) - - "eu-central-1" - - Europe (Frankfurt) - - "ap-southeast-1" - - Asia Pacific (Singapore) - - "me-south-1" - - Middle East (Bahrain) - - "sa-east-1" - - South America (São Paulo) - -#### --s3-region - -Region where your data stored. - - -Properties: - -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: Synology -- Type: string -- Required: false -- Examples: - - "eu-001" - - Europe Region 1 - - "eu-002" - - Europe Region 2 - - "us-001" - - US Region 1 - - "us-002" - - US Region 2 - - "tw-001" - - Asia (Taiwan) - -#### --s3-region - -Region to connect to. - -Leave blank if you are using an S3 clone and you don't have a region. - -Properties: - -- Config: region -- Env Var: RCLONE_S3_REGION -- Provider: !AWS,Alibaba,ArvanCloud,ChinaMobile,Cloudflare,IONOS,Petabox,Liara,Qiniu,RackCorp,Scaleway,Storj,Synology,TencentCOS,HuaweiOBS,IDrive -- Type: string -- Required: false -- Examples: - - "" - - Use this if unsure. - - Will use v4 signatures and an empty region. - - "other-v2-signature" - - Use this only if v4 signatures don't work. - - E.g. pre Jewel/v10 CEPH. - -#### --s3-endpoint - -Endpoint for S3 API. - -Leave blank if using AWS to use the default endpoint for the region. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: AWS -- Type: string -- Required: false - -#### --s3-endpoint - -Endpoint for China Mobile Ecloud Elastic Object Storage (EOS) API. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: ChinaMobile -- Type: string -- Required: false -- Examples: - - "eos-wuxi-1.cmecloud.cn" - - The default endpoint - a good choice if you are unsure. - - East China (Suzhou) - - "eos-jinan-1.cmecloud.cn" - - East China (Jinan) - - "eos-ningbo-1.cmecloud.cn" - - East China (Hangzhou) - - "eos-shanghai-1.cmecloud.cn" - - East China (Shanghai-1) - - "eos-zhengzhou-1.cmecloud.cn" - - Central China (Zhengzhou) - - "eos-hunan-1.cmecloud.cn" - - Central China (Changsha-1) - - "eos-zhuzhou-1.cmecloud.cn" - - Central China (Changsha-2) - - "eos-guangzhou-1.cmecloud.cn" - - South China (Guangzhou-2) - - "eos-dongguan-1.cmecloud.cn" - - South China (Guangzhou-3) - - "eos-beijing-1.cmecloud.cn" - - North China (Beijing-1) - - "eos-beijing-2.cmecloud.cn" - - North China (Beijing-2) - - "eos-beijing-4.cmecloud.cn" - - North China (Beijing-3) - - "eos-huhehaote-1.cmecloud.cn" - - North China (Huhehaote) - - "eos-chengdu-1.cmecloud.cn" - - Southwest China (Chengdu) - - "eos-chongqing-1.cmecloud.cn" - - Southwest China (Chongqing) - - "eos-guiyang-1.cmecloud.cn" - - Southwest China (Guiyang) - - "eos-xian-1.cmecloud.cn" - - Nouthwest China (Xian) - - "eos-yunnan.cmecloud.cn" - - Yunnan China (Kunming) - - "eos-yunnan-2.cmecloud.cn" - - Yunnan China (Kunming-2) - - "eos-tianjin-1.cmecloud.cn" - - Tianjin China (Tianjin) - - "eos-jilin-1.cmecloud.cn" - - Jilin China (Changchun) - - "eos-hubei-1.cmecloud.cn" - - Hubei China (Xiangyan) - - "eos-jiangxi-1.cmecloud.cn" - - Jiangxi China (Nanchang) - - "eos-gansu-1.cmecloud.cn" - - Gansu China (Lanzhou) - - "eos-shanxi-1.cmecloud.cn" - - Shanxi China (Taiyuan) - - "eos-liaoning-1.cmecloud.cn" - - Liaoning China (Shenyang) - - "eos-hebei-1.cmecloud.cn" - - Hebei China (Shijiazhuang) - - "eos-fujian-1.cmecloud.cn" - - Fujian China (Xiamen) - - "eos-guangxi-1.cmecloud.cn" - - Guangxi China (Nanning) - - "eos-anhui-1.cmecloud.cn" - - Anhui China (Huainan) - -#### --s3-endpoint - -Endpoint for Arvan Cloud Object Storage (AOS) API. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: ArvanCloud -- Type: string -- Required: false -- Examples: - - "s3.ir-thr-at1.arvanstorage.ir" - - The default endpoint - a good choice if you are unsure. - - Tehran Iran (Simin) - - "s3.ir-tbz-sh1.arvanstorage.ir" - - Tabriz Iran (Shahriar) - -#### --s3-endpoint - -Endpoint for IBM COS S3 API. - -Specify if using an IBM COS On Premise. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: IBMCOS -- Type: string -- Required: false -- Examples: - - "s3.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Endpoint - - "s3.dal.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Dallas Endpoint - - "s3.wdc.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Washington DC Endpoint - - "s3.sjc.us.cloud-object-storage.appdomain.cloud" - - US Cross Region San Jose Endpoint - - "s3.private.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Private Endpoint - - "s3.private.dal.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Dallas Private Endpoint - - "s3.private.wdc.us.cloud-object-storage.appdomain.cloud" - - US Cross Region Washington DC Private Endpoint - - "s3.private.sjc.us.cloud-object-storage.appdomain.cloud" - - US Cross Region San Jose Private Endpoint - - "s3.us-east.cloud-object-storage.appdomain.cloud" - - US Region East Endpoint - - "s3.private.us-east.cloud-object-storage.appdomain.cloud" - - US Region East Private Endpoint - - "s3.us-south.cloud-object-storage.appdomain.cloud" - - US Region South Endpoint - - "s3.private.us-south.cloud-object-storage.appdomain.cloud" - - US Region South Private Endpoint - - "s3.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Endpoint - - "s3.fra.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Frankfurt Endpoint - - "s3.mil.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Milan Endpoint - - "s3.ams.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Amsterdam Endpoint - - "s3.private.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Private Endpoint - - "s3.private.fra.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Frankfurt Private Endpoint - - "s3.private.mil.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Milan Private Endpoint - - "s3.private.ams.eu.cloud-object-storage.appdomain.cloud" - - EU Cross Region Amsterdam Private Endpoint - - "s3.eu-gb.cloud-object-storage.appdomain.cloud" - - Great Britain Endpoint - - "s3.private.eu-gb.cloud-object-storage.appdomain.cloud" - - Great Britain Private Endpoint - - "s3.eu-de.cloud-object-storage.appdomain.cloud" - - EU Region DE Endpoint - - "s3.private.eu-de.cloud-object-storage.appdomain.cloud" - - EU Region DE Private Endpoint - - "s3.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Endpoint - - "s3.tok.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Tokyo Endpoint - - "s3.hkg.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional HongKong Endpoint - - "s3.seo.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Seoul Endpoint - - "s3.private.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Private Endpoint - - "s3.private.tok.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Tokyo Private Endpoint - - "s3.private.hkg.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional HongKong Private Endpoint - - "s3.private.seo.ap.cloud-object-storage.appdomain.cloud" - - APAC Cross Regional Seoul Private Endpoint - - "s3.jp-tok.cloud-object-storage.appdomain.cloud" - - APAC Region Japan Endpoint - - "s3.private.jp-tok.cloud-object-storage.appdomain.cloud" - - APAC Region Japan Private Endpoint - - "s3.au-syd.cloud-object-storage.appdomain.cloud" - - APAC Region Australia Endpoint - - "s3.private.au-syd.cloud-object-storage.appdomain.cloud" - - APAC Region Australia Private Endpoint - - "s3.ams03.cloud-object-storage.appdomain.cloud" - - Amsterdam Single Site Endpoint - - "s3.private.ams03.cloud-object-storage.appdomain.cloud" - - Amsterdam Single Site Private Endpoint - - "s3.che01.cloud-object-storage.appdomain.cloud" - - Chennai Single Site Endpoint - - "s3.private.che01.cloud-object-storage.appdomain.cloud" - - Chennai Single Site Private Endpoint - - "s3.mel01.cloud-object-storage.appdomain.cloud" - - Melbourne Single Site Endpoint - - "s3.private.mel01.cloud-object-storage.appdomain.cloud" - - Melbourne Single Site Private Endpoint - - "s3.osl01.cloud-object-storage.appdomain.cloud" - - Oslo Single Site Endpoint - - "s3.private.osl01.cloud-object-storage.appdomain.cloud" - - Oslo Single Site Private Endpoint - - "s3.tor01.cloud-object-storage.appdomain.cloud" - - Toronto Single Site Endpoint - - "s3.private.tor01.cloud-object-storage.appdomain.cloud" - - Toronto Single Site Private Endpoint - - "s3.seo01.cloud-object-storage.appdomain.cloud" - - Seoul Single Site Endpoint - - "s3.private.seo01.cloud-object-storage.appdomain.cloud" - - Seoul Single Site Private Endpoint - - "s3.mon01.cloud-object-storage.appdomain.cloud" - - Montreal Single Site Endpoint - - "s3.private.mon01.cloud-object-storage.appdomain.cloud" - - Montreal Single Site Private Endpoint - - "s3.mex01.cloud-object-storage.appdomain.cloud" - - Mexico Single Site Endpoint - - "s3.private.mex01.cloud-object-storage.appdomain.cloud" - - Mexico Single Site Private Endpoint - - "s3.sjc04.cloud-object-storage.appdomain.cloud" - - San Jose Single Site Endpoint - - "s3.private.sjc04.cloud-object-storage.appdomain.cloud" - - San Jose Single Site Private Endpoint - - "s3.mil01.cloud-object-storage.appdomain.cloud" - - Milan Single Site Endpoint - - "s3.private.mil01.cloud-object-storage.appdomain.cloud" - - Milan Single Site Private Endpoint - - "s3.hkg02.cloud-object-storage.appdomain.cloud" - - Hong Kong Single Site Endpoint - - "s3.private.hkg02.cloud-object-storage.appdomain.cloud" - - Hong Kong Single Site Private Endpoint - - "s3.par01.cloud-object-storage.appdomain.cloud" - - Paris Single Site Endpoint - - "s3.private.par01.cloud-object-storage.appdomain.cloud" - - Paris Single Site Private Endpoint - - "s3.sng01.cloud-object-storage.appdomain.cloud" - - Singapore Single Site Endpoint - - "s3.private.sng01.cloud-object-storage.appdomain.cloud" - - Singapore Single Site Private Endpoint - -#### --s3-endpoint - -Endpoint for IONOS S3 Object Storage. - -Specify the endpoint from the same region. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: IONOS -- Type: string -- Required: false -- Examples: - - "s3-eu-central-1.ionoscloud.com" - - Frankfurt, Germany - - "s3-eu-central-2.ionoscloud.com" - - Berlin, Germany - - "s3-eu-south-2.ionoscloud.com" - - Logrono, Spain - -#### --s3-endpoint - -Endpoint for Petabox S3 Object Storage. - -Specify the endpoint from the same region. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Petabox -- Type: string -- Required: true -- Examples: - - "s3.petabox.io" - - US East (N. Virginia) - - "s3.us-east-1.petabox.io" - - US East (N. Virginia) - - "s3.eu-central-1.petabox.io" - - Europe (Frankfurt) - - "s3.ap-southeast-1.petabox.io" - - Asia Pacific (Singapore) - - "s3.me-south-1.petabox.io" - - Middle East (Bahrain) - - "s3.sa-east-1.petabox.io" - - South America (São Paulo) - -#### --s3-endpoint - -Endpoint for Leviia Object Storage API. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Leviia -- Type: string -- Required: false -- Examples: - - "s3.leviia.com" - - The default endpoint - - Leviia - -#### --s3-endpoint - -Endpoint for Liara Object Storage API. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Liara -- Type: string -- Required: false -- Examples: - - "storage.iran.liara.space" - - The default endpoint - - Iran - -#### --s3-endpoint - -Endpoint for OSS API. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Alibaba -- Type: string -- Required: false -- Examples: - - "oss-accelerate.aliyuncs.com" - - Global Accelerate - - "oss-accelerate-overseas.aliyuncs.com" - - Global Accelerate (outside mainland China) - - "oss-cn-hangzhou.aliyuncs.com" - - East China 1 (Hangzhou) - - "oss-cn-shanghai.aliyuncs.com" - - East China 2 (Shanghai) - - "oss-cn-qingdao.aliyuncs.com" - - North China 1 (Qingdao) - - "oss-cn-beijing.aliyuncs.com" - - North China 2 (Beijing) - - "oss-cn-zhangjiakou.aliyuncs.com" - - North China 3 (Zhangjiakou) - - "oss-cn-huhehaote.aliyuncs.com" - - North China 5 (Hohhot) - - "oss-cn-wulanchabu.aliyuncs.com" - - North China 6 (Ulanqab) - - "oss-cn-shenzhen.aliyuncs.com" - - South China 1 (Shenzhen) - - "oss-cn-heyuan.aliyuncs.com" - - South China 2 (Heyuan) - - "oss-cn-guangzhou.aliyuncs.com" - - South China 3 (Guangzhou) - - "oss-cn-chengdu.aliyuncs.com" - - West China 1 (Chengdu) - - "oss-cn-hongkong.aliyuncs.com" - - Hong Kong (Hong Kong) - - "oss-us-west-1.aliyuncs.com" - - US West 1 (Silicon Valley) - - "oss-us-east-1.aliyuncs.com" - - US East 1 (Virginia) - - "oss-ap-southeast-1.aliyuncs.com" - - Southeast Asia Southeast 1 (Singapore) - - "oss-ap-southeast-2.aliyuncs.com" - - Asia Pacific Southeast 2 (Sydney) - - "oss-ap-southeast-3.aliyuncs.com" - - Southeast Asia Southeast 3 (Kuala Lumpur) - - "oss-ap-southeast-5.aliyuncs.com" - - Asia Pacific Southeast 5 (Jakarta) - - "oss-ap-northeast-1.aliyuncs.com" - - Asia Pacific Northeast 1 (Japan) - - "oss-ap-south-1.aliyuncs.com" - - Asia Pacific South 1 (Mumbai) - - "oss-eu-central-1.aliyuncs.com" - - Central Europe 1 (Frankfurt) - - "oss-eu-west-1.aliyuncs.com" - - West Europe (London) - - "oss-me-east-1.aliyuncs.com" - - Middle East 1 (Dubai) - -#### --s3-endpoint - -Endpoint for OBS API. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: HuaweiOBS -- Type: string -- Required: false -- Examples: - - "obs.af-south-1.myhuaweicloud.com" - - AF-Johannesburg - - "obs.ap-southeast-2.myhuaweicloud.com" - - AP-Bangkok - - "obs.ap-southeast-3.myhuaweicloud.com" - - AP-Singapore - - "obs.cn-east-3.myhuaweicloud.com" - - CN East-Shanghai1 - - "obs.cn-east-2.myhuaweicloud.com" - - CN East-Shanghai2 - - "obs.cn-north-1.myhuaweicloud.com" - - CN North-Beijing1 - - "obs.cn-north-4.myhuaweicloud.com" - - CN North-Beijing4 - - "obs.cn-south-1.myhuaweicloud.com" - - CN South-Guangzhou - - "obs.ap-southeast-1.myhuaweicloud.com" - - CN-Hong Kong - - "obs.sa-argentina-1.myhuaweicloud.com" - - LA-Buenos Aires1 - - "obs.sa-peru-1.myhuaweicloud.com" - - LA-Lima1 - - "obs.na-mexico-1.myhuaweicloud.com" - - LA-Mexico City1 - - "obs.sa-chile-1.myhuaweicloud.com" - - LA-Santiago2 - - "obs.sa-brazil-1.myhuaweicloud.com" - - LA-Sao Paulo1 - - "obs.ru-northwest-2.myhuaweicloud.com" - - RU-Moscow2 - -#### --s3-endpoint - -Endpoint for Scaleway Object Storage. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Scaleway -- Type: string -- Required: false -- Examples: - - "s3.nl-ams.scw.cloud" - - Amsterdam Endpoint - - "s3.fr-par.scw.cloud" - - Paris Endpoint - - "s3.pl-waw.scw.cloud" - - Warsaw Endpoint - -#### --s3-endpoint - -Endpoint for StackPath Object Storage. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: StackPath -- Type: string -- Required: false -- Examples: - - "s3.us-east-2.stackpathstorage.com" - - US East Endpoint - - "s3.us-west-1.stackpathstorage.com" - - US West Endpoint - - "s3.eu-central-1.stackpathstorage.com" - - EU Endpoint - -#### --s3-endpoint - -Endpoint for Google Cloud Storage. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: GCS -- Type: string -- Required: false -- Examples: - - "https://storage.googleapis.com" - - Google Cloud Storage endpoint - -#### --s3-endpoint - -Endpoint for Storj Gateway. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Storj -- Type: string -- Required: false -- Examples: - - "gateway.storjshare.io" - - Global Hosted Gateway - -#### --s3-endpoint - -Endpoint for Synology C2 Object Storage API. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Synology -- Type: string -- Required: false -- Examples: - - "eu-001.s3.synologyc2.net" - - EU Endpoint 1 - - "eu-002.s3.synologyc2.net" - - EU Endpoint 2 - - "us-001.s3.synologyc2.net" - - US Endpoint 1 - - "us-002.s3.synologyc2.net" - - US Endpoint 2 - - "tw-001.s3.synologyc2.net" - - TW Endpoint 1 - -#### --s3-endpoint - -Endpoint for Tencent COS API. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: TencentCOS -- Type: string -- Required: false -- Examples: - - "cos.ap-beijing.myqcloud.com" - - Beijing Region - - "cos.ap-nanjing.myqcloud.com" - - Nanjing Region - - "cos.ap-shanghai.myqcloud.com" - - Shanghai Region - - "cos.ap-guangzhou.myqcloud.com" - - Guangzhou Region - - "cos.ap-nanjing.myqcloud.com" - - Nanjing Region - - "cos.ap-chengdu.myqcloud.com" - - Chengdu Region - - "cos.ap-chongqing.myqcloud.com" - - Chongqing Region - - "cos.ap-hongkong.myqcloud.com" - - Hong Kong (China) Region - - "cos.ap-singapore.myqcloud.com" - - Singapore Region - - "cos.ap-mumbai.myqcloud.com" - - Mumbai Region - - "cos.ap-seoul.myqcloud.com" - - Seoul Region - - "cos.ap-bangkok.myqcloud.com" - - Bangkok Region - - "cos.ap-tokyo.myqcloud.com" - - Tokyo Region - - "cos.na-siliconvalley.myqcloud.com" - - Silicon Valley Region - - "cos.na-ashburn.myqcloud.com" - - Virginia Region - - "cos.na-toronto.myqcloud.com" - - Toronto Region - - "cos.eu-frankfurt.myqcloud.com" - - Frankfurt Region - - "cos.eu-moscow.myqcloud.com" - - Moscow Region - - "cos.accelerate.myqcloud.com" - - Use Tencent COS Accelerate Endpoint - -#### --s3-endpoint - -Endpoint for RackCorp Object Storage. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: RackCorp -- Type: string -- Required: false -- Examples: - - "s3.rackcorp.com" - - Global (AnyCast) Endpoint - - "au.s3.rackcorp.com" - - Australia (Anycast) Endpoint - - "au-nsw.s3.rackcorp.com" - - Sydney (Australia) Endpoint - - "au-qld.s3.rackcorp.com" - - Brisbane (Australia) Endpoint - - "au-vic.s3.rackcorp.com" - - Melbourne (Australia) Endpoint - - "au-wa.s3.rackcorp.com" - - Perth (Australia) Endpoint - - "ph.s3.rackcorp.com" - - Manila (Philippines) Endpoint - - "th.s3.rackcorp.com" - - Bangkok (Thailand) Endpoint - - "hk.s3.rackcorp.com" - - HK (Hong Kong) Endpoint - - "mn.s3.rackcorp.com" - - Ulaanbaatar (Mongolia) Endpoint - - "kg.s3.rackcorp.com" - - Bishkek (Kyrgyzstan) Endpoint - - "id.s3.rackcorp.com" - - Jakarta (Indonesia) Endpoint - - "jp.s3.rackcorp.com" - - Tokyo (Japan) Endpoint - - "sg.s3.rackcorp.com" - - SG (Singapore) Endpoint - - "de.s3.rackcorp.com" - - Frankfurt (Germany) Endpoint - - "us.s3.rackcorp.com" - - USA (AnyCast) Endpoint - - "us-east-1.s3.rackcorp.com" - - New York (USA) Endpoint - - "us-west-1.s3.rackcorp.com" - - Freemont (USA) Endpoint - - "nz.s3.rackcorp.com" - - Auckland (New Zealand) Endpoint - -#### --s3-endpoint - -Endpoint for Qiniu Object Storage. - -Properties: - -- Config: endpoint -- Env Var: RCLONE_S3_ENDPOINT -- Provider: Qiniu -- Type: string -- Required: false -- Examples: - - "s3-cn-east-1.qiniucs.com" - - East China Endpoint 1 - - "s3-cn-east-2.qiniucs.com" - - East China Endpoint 2 - - "s3-cn-north-1.qiniucs.com" - - North China Endpoint 1 - - "s3-cn-south-1.qiniucs.com" - - South China Endpoint 1 - - "s3-us-north-1.qiniucs.com" - - North America Endpoint 1 - - "s3-ap-southeast-1.qiniucs.com" - - Southeast Asia Endpoint 1 - - "s3-ap-northeast-1.qiniucs.com" - - Northeast Asia Endpoint 1 - #### --s3-endpoint Endpoint for S3 API. -Required when using an S3 clone. +Leave blank if using AWS to use the default endpoint for the region. Properties: - Config: endpoint - Env Var: RCLONE_S3_ENDPOINT -- Provider: !AWS,ArvanCloud,IBMCOS,IDrive,IONOS,TencentCOS,HuaweiOBS,Alibaba,ChinaMobile,GCS,Liara,Scaleway,StackPath,Storj,Synology,RackCorp,Qiniu,Petabox +- Provider: AWS - Type: string - Required: false -- Examples: - - "objects-us-east-1.dream.io" - - Dream Objects endpoint - - "syd1.digitaloceanspaces.com" - - DigitalOcean Spaces Sydney 1 - - "sfo3.digitaloceanspaces.com" - - DigitalOcean Spaces San Francisco 3 - - "fra1.digitaloceanspaces.com" - - DigitalOcean Spaces Frankfurt 1 - - "nyc3.digitaloceanspaces.com" - - DigitalOcean Spaces New York 3 - - "ams3.digitaloceanspaces.com" - - DigitalOcean Spaces Amsterdam 3 - - "sgp1.digitaloceanspaces.com" - - DigitalOcean Spaces Singapore 1 - - "localhost:8333" - - SeaweedFS S3 localhost - - "s3.us-east-1.lyvecloud.seagate.com" - - Seagate Lyve Cloud US East 1 (Virginia) - - "s3.us-west-1.lyvecloud.seagate.com" - - Seagate Lyve Cloud US West 1 (California) - - "s3.ap-southeast-1.lyvecloud.seagate.com" - - Seagate Lyve Cloud AP Southeast 1 (Singapore) - - "s3.wasabisys.com" - - Wasabi US East 1 (N. Virginia) - - "s3.us-east-2.wasabisys.com" - - Wasabi US East 2 (N. Virginia) - - "s3.us-central-1.wasabisys.com" - - Wasabi US Central 1 (Texas) - - "s3.us-west-1.wasabisys.com" - - Wasabi US West 1 (Oregon) - - "s3.ca-central-1.wasabisys.com" - - Wasabi CA Central 1 (Toronto) - - "s3.eu-central-1.wasabisys.com" - - Wasabi EU Central 1 (Amsterdam) - - "s3.eu-central-2.wasabisys.com" - - Wasabi EU Central 2 (Frankfurt) - - "s3.eu-west-1.wasabisys.com" - - Wasabi EU West 1 (London) - - "s3.eu-west-2.wasabisys.com" - - Wasabi EU West 2 (Paris) - - "s3.ap-northeast-1.wasabisys.com" - - Wasabi AP Northeast 1 (Tokyo) endpoint - - "s3.ap-northeast-2.wasabisys.com" - - Wasabi AP Northeast 2 (Osaka) endpoint - - "s3.ap-southeast-1.wasabisys.com" - - Wasabi AP Southeast 1 (Singapore) - - "s3.ap-southeast-2.wasabisys.com" - - Wasabi AP Southeast 2 (Sydney) - - "storage.iran.liara.space" - - Liara Iran endpoint - - "s3.ir-thr-at1.arvanstorage.ir" - - ArvanCloud Tehran Iran (Simin) endpoint - - "s3.ir-tbz-sh1.arvanstorage.ir" - - ArvanCloud Tabriz Iran (Shahriar) endpoint #### --s3-location-constraint @@ -1913,274 +957,6 @@ Properties: - "us-gov-west-1" - AWS GovCloud (US) Region -#### --s3-location-constraint - -Location constraint - must match endpoint. - -Used when creating buckets only. - -Properties: - -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: ChinaMobile -- Type: string -- Required: false -- Examples: - - "wuxi1" - - East China (Suzhou) - - "jinan1" - - East China (Jinan) - - "ningbo1" - - East China (Hangzhou) - - "shanghai1" - - East China (Shanghai-1) - - "zhengzhou1" - - Central China (Zhengzhou) - - "hunan1" - - Central China (Changsha-1) - - "zhuzhou1" - - Central China (Changsha-2) - - "guangzhou1" - - South China (Guangzhou-2) - - "dongguan1" - - South China (Guangzhou-3) - - "beijing1" - - North China (Beijing-1) - - "beijing2" - - North China (Beijing-2) - - "beijing4" - - North China (Beijing-3) - - "huhehaote1" - - North China (Huhehaote) - - "chengdu1" - - Southwest China (Chengdu) - - "chongqing1" - - Southwest China (Chongqing) - - "guiyang1" - - Southwest China (Guiyang) - - "xian1" - - Nouthwest China (Xian) - - "yunnan" - - Yunnan China (Kunming) - - "yunnan2" - - Yunnan China (Kunming-2) - - "tianjin1" - - Tianjin China (Tianjin) - - "jilin1" - - Jilin China (Changchun) - - "hubei1" - - Hubei China (Xiangyan) - - "jiangxi1" - - Jiangxi China (Nanchang) - - "gansu1" - - Gansu China (Lanzhou) - - "shanxi1" - - Shanxi China (Taiyuan) - - "liaoning1" - - Liaoning China (Shenyang) - - "hebei1" - - Hebei China (Shijiazhuang) - - "fujian1" - - Fujian China (Xiamen) - - "guangxi1" - - Guangxi China (Nanning) - - "anhui1" - - Anhui China (Huainan) - -#### --s3-location-constraint - -Location constraint - must match endpoint. - -Used when creating buckets only. - -Properties: - -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: ArvanCloud -- Type: string -- Required: false -- Examples: - - "ir-thr-at1" - - Tehran Iran (Simin) - - "ir-tbz-sh1" - - Tabriz Iran (Shahriar) - -#### --s3-location-constraint - -Location constraint - must match endpoint when using IBM Cloud Public. - -For on-prem COS, do not make a selection from this list, hit enter. - -Properties: - -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: IBMCOS -- Type: string -- Required: false -- Examples: - - "us-standard" - - US Cross Region Standard - - "us-vault" - - US Cross Region Vault - - "us-cold" - - US Cross Region Cold - - "us-flex" - - US Cross Region Flex - - "us-east-standard" - - US East Region Standard - - "us-east-vault" - - US East Region Vault - - "us-east-cold" - - US East Region Cold - - "us-east-flex" - - US East Region Flex - - "us-south-standard" - - US South Region Standard - - "us-south-vault" - - US South Region Vault - - "us-south-cold" - - US South Region Cold - - "us-south-flex" - - US South Region Flex - - "eu-standard" - - EU Cross Region Standard - - "eu-vault" - - EU Cross Region Vault - - "eu-cold" - - EU Cross Region Cold - - "eu-flex" - - EU Cross Region Flex - - "eu-gb-standard" - - Great Britain Standard - - "eu-gb-vault" - - Great Britain Vault - - "eu-gb-cold" - - Great Britain Cold - - "eu-gb-flex" - - Great Britain Flex - - "ap-standard" - - APAC Standard - - "ap-vault" - - APAC Vault - - "ap-cold" - - APAC Cold - - "ap-flex" - - APAC Flex - - "mel01-standard" - - Melbourne Standard - - "mel01-vault" - - Melbourne Vault - - "mel01-cold" - - Melbourne Cold - - "mel01-flex" - - Melbourne Flex - - "tor01-standard" - - Toronto Standard - - "tor01-vault" - - Toronto Vault - - "tor01-cold" - - Toronto Cold - - "tor01-flex" - - Toronto Flex - -#### --s3-location-constraint - -Location constraint - the location where your bucket will be located and your data stored. - - -Properties: - -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: RackCorp -- Type: string -- Required: false -- Examples: - - "global" - - Global CDN Region - - "au" - - Australia (All locations) - - "au-nsw" - - NSW (Australia) Region - - "au-qld" - - QLD (Australia) Region - - "au-vic" - - VIC (Australia) Region - - "au-wa" - - Perth (Australia) Region - - "ph" - - Manila (Philippines) Region - - "th" - - Bangkok (Thailand) Region - - "hk" - - HK (Hong Kong) Region - - "mn" - - Ulaanbaatar (Mongolia) Region - - "kg" - - Bishkek (Kyrgyzstan) Region - - "id" - - Jakarta (Indonesia) Region - - "jp" - - Tokyo (Japan) Region - - "sg" - - SG (Singapore) Region - - "de" - - Frankfurt (Germany) Region - - "us" - - USA (AnyCast) Region - - "us-east-1" - - New York (USA) Region - - "us-west-1" - - Freemont (USA) Region - - "nz" - - Auckland (New Zealand) Region - -#### --s3-location-constraint - -Location constraint - must be set to match the Region. - -Used when creating buckets only. - -Properties: - -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: Qiniu -- Type: string -- Required: false -- Examples: - - "cn-east-1" - - East China Region 1 - - "cn-east-2" - - East China Region 2 - - "cn-north-1" - - North China Region 1 - - "cn-south-1" - - South China Region 1 - - "us-north-1" - - North America Region 1 - - "ap-southeast-1" - - Southeast Asia Region 1 - - "ap-northeast-1" - - Northeast Asia Region 1 - -#### --s3-location-constraint - -Location constraint - must be set to match the Region. - -Leave blank if not sure. Used when creating buckets only. - -Properties: - -- Config: location_constraint -- Env Var: RCLONE_S3_LOCATION_CONSTRAINT -- Provider: !AWS,Alibaba,ArvanCloud,HuaweiOBS,ChinaMobile,Cloudflare,IBMCOS,IDrive,IONOS,Leviia,Liara,Qiniu,RackCorp,Scaleway,StackPath,Storj,TencentCOS,Petabox -- Type: string -- Required: false - #### --s3-acl Canned ACL used when creating buckets and storing or copying objects. @@ -2312,150 +1088,9 @@ Properties: - "GLACIER_IR" - Glacier Instant Retrieval storage class -#### --s3-storage-class - -The storage class to use when storing new objects in OSS. - -Properties: - -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: Alibaba -- Type: string -- Required: false -- Examples: - - "" - - Default - - "STANDARD" - - Standard storage class - - "GLACIER" - - Archive storage mode - - "STANDARD_IA" - - Infrequent access storage mode - -#### --s3-storage-class - -The storage class to use when storing new objects in ChinaMobile. - -Properties: - -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: ChinaMobile -- Type: string -- Required: false -- Examples: - - "" - - Default - - "STANDARD" - - Standard storage class - - "GLACIER" - - Archive storage mode - - "STANDARD_IA" - - Infrequent access storage mode - -#### --s3-storage-class - -The storage class to use when storing new objects in Liara - -Properties: - -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: Liara -- Type: string -- Required: false -- Examples: - - "STANDARD" - - Standard storage class - -#### --s3-storage-class - -The storage class to use when storing new objects in ArvanCloud. - -Properties: - -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: ArvanCloud -- Type: string -- Required: false -- Examples: - - "STANDARD" - - Standard storage class - -#### --s3-storage-class - -The storage class to use when storing new objects in Tencent COS. - -Properties: - -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: TencentCOS -- Type: string -- Required: false -- Examples: - - "" - - Default - - "STANDARD" - - Standard storage class - - "ARCHIVE" - - Archive storage mode - - "STANDARD_IA" - - Infrequent access storage mode - -#### --s3-storage-class - -The storage class to use when storing new objects in S3. - -Properties: - -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: Scaleway -- Type: string -- Required: false -- Examples: - - "" - - Default. - - "STANDARD" - - The Standard class for any upload. - - Suitable for on-demand content like streaming or CDN. - - Available in all regions. - - "GLACIER" - - Archived storage. - - Prices are lower, but it needs to be restored first to be accessed. - - Available in FR-PAR and NL-AMS regions. - - "ONEZONE_IA" - - One Zone - Infrequent Access. - - A good choice for storing secondary backup copies or easily re-creatable data. - - Available in the FR-PAR region only. - -#### --s3-storage-class - -The storage class to use when storing new objects in Qiniu. - -Properties: - -- Config: storage_class -- Env Var: RCLONE_S3_STORAGE_CLASS -- Provider: Qiniu -- Type: string -- Required: false -- Examples: - - "STANDARD" - - Standard storage class - - "LINE" - - Infrequent access storage mode - - "GLACIER" - - Archive storage mode - - "DEEP_ARCHIVE" - - Deep archive storage mode - ### Advanced options -Here are the Advanced options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, China Mobile, Cloudflare, GCS, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Leviia, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi). +Here are the Advanced options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Minio, Netease, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others). #### --s3-bucket-acl @@ -2948,7 +1583,7 @@ Properties: - Config: encoding - Env Var: RCLONE_S3_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,InvalidUtf8,Dot #### --s3-memory-pool-flush-time @@ -3184,6 +1819,57 @@ Properties: - Type: string - Required: false +#### --s3-use-already-exists + +Set if rclone should report BucketAlreadyExists errors on bucket creation. + +At some point during the evolution of the s3 protocol, AWS started +returning an `AlreadyOwnedByYou` error when attempting to create a +bucket that the user already owned, rather than a +`BucketAlreadyExists` error. + +Unfortunately exactly what has been implemented by s3 clones is a +little inconsistent, some return `AlreadyOwnedByYou`, some return +`BucketAlreadyExists` and some return no error at all. + +This is important to rclone because it ensures the bucket exists by +creating it on quite a lot of operations (unless +`--s3-no-check-bucket` is used). + +If rclone knows the provider can return `AlreadyOwnedByYou` or returns +no error then it can report `BucketAlreadyExists` errors when the user +attempts to create a bucket not owned by them. Otherwise rclone +ignores the `BucketAlreadyExists` error which can lead to confusion. + +This should be automatically set correctly for all providers rclone +knows about - please make a bug report if not. + + +Properties: + +- Config: use_already_exists +- Env Var: RCLONE_S3_USE_ALREADY_EXISTS +- Type: Tristate +- Default: unset + +#### --s3-use-multipart-uploads + +Set if rclone should use multipart uploads. + +You can change this if you want to disable the use of multipart uploads. +This shouldn't be necessary in normal operation. + +This should be automatically set correctly for all providers rclone +knows about - please make a bug report if not. + + +Properties: + +- Config: use_multipart_uploads +- Env Var: RCLONE_S3_USE_MULTIPART_UPLOADS +- Type: Tristate +- Default: unset + ### Metadata User metadata is stored as x-amz-meta- keys. S3 metadata keys are case insensitive and are always returned in lower case. diff --git a/docs/content/seafile.md b/docs/content/seafile.md index 5afeadbfec9dc..e3e1aa1095b69 100644 --- a/docs/content/seafile.md +++ b/docs/content/seafile.md @@ -386,7 +386,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SEAFILE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8 {{< rem autogenerated options stop >}} diff --git a/docs/content/sftp.md b/docs/content/sftp.md index e2cd91b837c7b..a32564c76418f 100644 --- a/docs/content/sftp.md +++ b/docs/content/sftp.md @@ -1016,6 +1016,32 @@ Properties: - Type: string - Required: false +#### --sftp-copy-is-hardlink + +Set to enable server side copies using hardlinks. + +The SFTP protocol does not define a copy command so normally server +side copies are not allowed with the sftp backend. + +However the SFTP protocol does support hardlinking, and if you enable +this flag then the sftp backend will support server side copies. These +will be implemented by doing a hardlink from the source to the +destination. + +Not all sftp servers support this. + +Note that hardlinking two files together will use no additional space +as the source and the destination will be the same file. + +This feature may be useful backups made with --copy-dest. + +Properties: + +- Config: copy_is_hardlink +- Env Var: RCLONE_SFTP_COPY_IS_HARDLINK +- Type: bool +- Default: false + {{< rem autogenerated options stop >}} ## Limitations diff --git a/docs/content/sharefile.md b/docs/content/sharefile.md index 60d518687612a..3dd1027f97b27 100644 --- a/docs/content/sharefile.md +++ b/docs/content/sharefile.md @@ -300,7 +300,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SHAREFILE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/sia.md b/docs/content/sia.md index ae9f74a2a0693..0ee8cba9424e3 100644 --- a/docs/content/sia.md +++ b/docs/content/sia.md @@ -191,7 +191,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SIA_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/smb.md b/docs/content/smb.md index 3ee6efe10fe8c..10eaec5182377 100644 --- a/docs/content/smb.md +++ b/docs/content/smb.md @@ -245,7 +245,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SMB_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/sugarsync.md b/docs/content/sugarsync.md index 30633051c18c8..0b19927d7da9c 100644 --- a/docs/content/sugarsync.md +++ b/docs/content/sugarsync.md @@ -269,7 +269,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SUGARSYNC_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Ctl,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/swift.md b/docs/content/swift.md index ddcfa45f72543..a627e3684e25f 100644 --- a/docs/content/swift.md +++ b/docs/content/swift.md @@ -584,7 +584,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SWIFT_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,InvalidUtf8 {{< rem autogenerated options stop >}} diff --git a/docs/content/uptobox.md b/docs/content/uptobox.md index 9a08f3f532784..816337330ef69 100644 --- a/docs/content/uptobox.md +++ b/docs/content/uptobox.md @@ -143,7 +143,7 @@ Properties: - Config: encoding - Env Var: RCLONE_UPTOBOX_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/webdav.md b/docs/content/webdav.md index 6f246a0179af5..ea7b2669d23ce 100644 --- a/docs/content/webdav.md +++ b/docs/content/webdav.md @@ -151,8 +151,8 @@ Properties: - Sharepoint Online, authenticated by Microsoft account - "sharepoint-ntlm" - Sharepoint with NTLM authentication, usually self-hosted or on-premises - - "rclone", - - rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol, + - "rclone" + - rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol - "other" - Other site/service or software diff --git a/docs/content/yandex.md b/docs/content/yandex.md index d62b33e2f5fd3..d8be5600615be 100644 --- a/docs/content/yandex.md +++ b/docs/content/yandex.md @@ -206,7 +206,7 @@ Properties: - Config: encoding - Env Var: RCLONE_YANDEX_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Del,Ctl,InvalidUtf8,Dot {{< rem autogenerated options stop >}} diff --git a/docs/content/zoho.md b/docs/content/zoho.md index c185a227154e8..b9ecdd8cdaf94 100644 --- a/docs/content/zoho.md +++ b/docs/content/zoho.md @@ -234,7 +234,7 @@ Properties: - Config: encoding - Env Var: RCLONE_ZOHO_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Del,Ctl,InvalidUtf8 {{< rem autogenerated options stop >}} diff --git a/rclone.1 b/rclone.1 index bdf35b4d74557..347ad18463fa6 100644 --- a/rclone.1 +++ b/rclone.1 @@ -1,7 +1,7 @@ .\"t .\" Automatically generated by Pandoc 2.9.2.1 .\" -.TH "rclone" "1" "Sep 11, 2023" "User Manual" "" +.TH "rclone" "1" "Nov 26, 2023" "User Manual" "" .hy .SH Rclone syncs your files to cloud storage .PP @@ -209,6 +209,10 @@ Leviia Object Storage .IP \[bu] 2 Liara Object Storage .IP \[bu] 2 +Linkbox +.IP \[bu] 2 +Linode Object Storage +.IP \[bu] 2 Mail.ru Cloud .IP \[bu] 2 Memset Memstore @@ -219,6 +223,8 @@ Memory .IP \[bu] 2 Microsoft Azure Blob Storage .IP \[bu] 2 +Microsoft Azure Files Storage +.IP \[bu] 2 Microsoft OneDrive .IP \[bu] 2 Minio @@ -432,6 +438,25 @@ Its current version is as below. .PP [IMAGE: Homebrew package (https://repology.org/badge/version-for-repo/homebrew/rclone.svg)] (https://repology.org/project/rclone/versions) +.SS Installation with MacPorts (#macos-macports) +.PP +On macOS, rclone can also be installed via +MacPorts (https://www.macports.org): +.IP +.nf +\f[C] +sudo port install rclone +\f[R] +.fi +.PP +Note that this is a third party installer not controlled by the rclone +developers so it may be out of date. +Its current version is as below. +.PP +[IMAGE: MacPorts +port (https://repology.org/badge/version-for-repo/macports/rclone.svg)] (https://repology.org/project/rclone/versions) +.PP +More information here (https://ports.macports.org/port/rclone/). .SS Precompiled binary, using curl .PP To avoid problems with macOS gatekeeper enforcing the binary to be @@ -738,7 +763,7 @@ $ sudo snap install rclone \f[R] .fi .PP -Due to the strict confinement of Snap, rclone snap cannot acess real +Due to the strict confinement of Snap, rclone snap cannot access real /home/$USER/.config/rclone directory, default config path is as below. .IP \[bu] 2 Default config directory: @@ -762,7 +787,7 @@ Its current version is as below. .SS Source installation .PP Make sure you have git and Go (https://golang.org/) installed. -Go version 1.17 or newer is required, latest release is recommended. +Go version 1.18 or newer is required, the latest release is recommended. You can get it from your package manager, or download it from golang.org/dl (https://golang.org/dl/). Then you can run the following: @@ -805,19 +830,18 @@ by installing it in a MSYS2 (https://www.msys2.org) distribution (make sure you install it in the classic mingw64 subsystem, the ucrt64 version is not compatible). .PP -Additionally, on Windows, you must install the third party utility -WinFsp (https://winfsp.dev/), with the \[dq]Developer\[dq] feature -selected. +Additionally, to build with mount on Windows, you must install the third +party utility WinFsp (https://winfsp.dev/), with the \[dq]Developer\[dq] +feature selected. If building with cgo, you must also set environment variable CPATH pointing to the fuse include directory within the WinFsp installation (normally \f[C]C:\[rs]Program Files (x86)\[rs]WinFsp\[rs]inc\[rs]fuse\f[R]). .PP -You may also add arguments \f[C]-ldflags -s\f[R] (with or without -\f[C]-tags cmount\f[R]), to omit symbol table and debug information, -making the executable file smaller, and \f[C]-trimpath\f[R] to remove -references to local file system paths. -This is how the official rclone releases are built. +You may add arguments \f[C]-ldflags -s\f[R] to omit symbol table and +debug information, making the executable file smaller, and +\f[C]-trimpath\f[R] to remove references to local file system paths. +The official rclone releases are built with both of these. .IP .nf \f[C] @@ -825,13 +849,57 @@ go build -trimpath -ldflags -s -tags cmount \f[R] .fi .PP +If you want to customize the version string, as reported by the +\f[C]rclone version\f[R] command, you can set one of the variables +\f[C]fs.Version\f[R], \f[C]fs.VersionTag\f[R] (to keep default suffix +but customize the number), or \f[C]fs.VersionSuffix\f[R] (to keep +default number but customize the suffix). +This can be done from the build command, by adding to the +\f[C]-ldflags\f[R] argument value as shown below. +.IP +.nf +\f[C] +go build -trimpath -ldflags \[dq]-s -X github.com/rclone/rclone/fs.Version=v9.9.9-test\[dq] -tags cmount +\f[R] +.fi +.PP +On Windows, the official executables also have the version information, +as well as a file icon, embedded as binary resources. +To get that with your own build you need to run the following command +\f[B]before\f[R] the build command. +It generates a Windows resource system object file, with extension +\&.syso, e.g. +\f[C]resource_windows_amd64.syso\f[R], that will be automatically picked +up by future build commands. +.IP +.nf +\f[C] +go run bin/resource_windows.go +\f[R] +.fi +.PP +The above command will generate a resource file containing version +information based on the fs.Version variable in source at the time you +run the command, which means if the value of this variable changes you +need to re-run the command for it to be reflected in the version +information. +Also, if you override this version variable in the build command as +described above, you need to do that also when generating the resource +file, or else it will still use the value from the source. +.IP +.nf +\f[C] +go run bin/resource_windows.go -version v9.9.9-test +\f[R] +.fi +.PP Instead of executing the \f[C]go build\f[R] command directly, you can run it via the Makefile. -It changes the version number suffix from \[dq]-DEV\[dq] to -\[dq]-beta\[dq] and appends commit details. -It also copies the resulting rclone executable into your GOPATH bin -folder (\f[C]$(go env GOPATH)/bin\f[R], which corresponds to -\f[C]\[ti]/go/bin/rclone\f[R] by default). +The default target changes the version suffix from \[dq]-DEV\[dq] to +\[dq]-beta\[dq] followed by additional commit details, embeds version +information binary resources on Windows, and copies the resulting rclone +executable into your GOPATH bin folder (\f[C]$(go env GOPATH)/bin\f[R], +which corresponds to \f[C]\[ti]/go/bin/rclone\f[R] by default). .IP .nf \f[C] @@ -848,37 +916,25 @@ make GOTAGS=cmount .fi .PP There are other make targets that can be used for more advanced builds, -such as cross-compiling for all supported os/architectures, embedding -icon and version info resources into windows executable, and packaging -results into release artifacts. +such as cross-compiling for all supported os/architectures, and +packaging results into release artifacts. See Makefile (https://github.com/rclone/rclone/blob/master/Makefile) and cross-compile.go (https://github.com/rclone/rclone/blob/master/bin/cross-compile.go) for details. .PP -Another alternative is to download the source, build and install rclone -in one operation, as a regular Go package. +Another alternative method for source installation is to download the +source, build and install rclone - all in one operation, as a regular Go +package. The source will be stored it in the Go module cache, and the resulting executable will be in your GOPATH bin folder (\f[C]$(go env GOPATH)/bin\f[R], which corresponds to \f[C]\[ti]/go/bin/rclone\f[R] by default). -.PP -With Go version 1.17 or newer: .IP .nf \f[C] go install github.com/rclone/rclone\[at]latest \f[R] .fi -.PP -With Go versions older than 1.17 (do \f[B]not\f[R] use the \f[C]-u\f[R] -flag, it causes Go to try to update the dependencies that rclone uses -and sometimes these don\[aq]t work with the current version): -.IP -.nf -\f[C] -go get github.com/rclone/rclone -\f[R] -.fi .SS Ansible installation .PP This can be done with Stefan Weichinger\[aq]s ansible @@ -1078,7 +1134,7 @@ includes necessary runtime (.NET 5). WinSW is a command-line only utility, where you have to manually create an XML file with service configuration. This may be a drawback for some, but it can also be an advantage as it -is easy to back up and re-use the configuration settings, without having +is easy to back up and reuse the configuration settings, without having go through manual steps in a GUI. One thing to note is that by default it does not restart the service on error, one have to explicit enable this in the configuration file (via @@ -1178,6 +1234,8 @@ Jottacloud (https://rclone.org/jottacloud/) .IP \[bu] 2 Koofr (https://rclone.org/koofr/) .IP \[bu] 2 +Linkbox (https://rclone.org/linkbox/) +.IP \[bu] 2 Mail.ru Cloud (https://rclone.org/mailru/) .IP \[bu] 2 Mega (https://rclone.org/mega/) @@ -1186,6 +1244,8 @@ Memory (https://rclone.org/memory/) .IP \[bu] 2 Microsoft Azure Blob Storage (https://rclone.org/azureblob/) .IP \[bu] 2 +Microsoft Azure Files Storage (https://rclone.org/azurefiles/) +.IP \[bu] 2 Microsoft OneDrive (https://rclone.org/onedrive/) .IP \[bu] 2 OpenStack Swift / Rackspace Cloudfiles / Blomp Cloud Storage / Memset @@ -1454,11 +1514,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default \[dq]HARD\[dq]) + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don\[aq]t skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -1473,11 +1533,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don\[aq]t check the destination, copy regardless --no-traverse Don\[aq]t traverse destination file system on copy - --no-update-modtime Don\[aq]t update destination mod-time if files identical + --no-update-modtime Don\[aq]t update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. \[aq]size,descending\[aq] + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default \[dq].partial\[dq]) --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination \f[R] @@ -1615,11 +1676,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default \[dq]HARD\[dq]) + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don\[aq]t skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -1634,11 +1695,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don\[aq]t check the destination, copy regardless --no-traverse Don\[aq]t traverse destination file system on copy - --no-update-modtime Don\[aq]t update destination mod-time if files identical + --no-update-modtime Don\[aq]t update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. \[aq]size,descending\[aq] + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default \[dq].partial\[dq]) --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination \f[R] @@ -1780,11 +1842,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default \[dq]HARD\[dq]) + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don\[aq]t skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -1799,11 +1861,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don\[aq]t check the destination, copy regardless --no-traverse Don\[aq]t traverse destination file system on copy - --no-update-modtime Don\[aq]t update destination mod-time if files identical + --no-update-modtime Don\[aq]t update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. \[aq]size,descending\[aq] + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default \[dq].partial\[dq]) --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination \f[R] @@ -3416,11 +3479,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default \[dq]HARD\[dq]) + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don\[aq]t skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -3435,11 +3498,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don\[aq]t check the destination, copy regardless --no-traverse Don\[aq]t traverse destination file system on copy - --no-update-modtime Don\[aq]t update destination mod-time if files identical + --no-update-modtime Don\[aq]t update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. \[aq]size,descending\[aq] + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default \[dq].partial\[dq]) --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination \f[R] @@ -3621,16 +3685,19 @@ rclone (https://rclone.org/commands/rclone/) - Show help for rclone commands, flags and backends. .SH rclone checksum .PP -Checks the files in the source against a SUM file. +Checks the files in the destination against a SUM file. .SS Synopsis .PP -Checks that hashsums of source files match the SUM file. +Checks that hashsums of destination files match the SUM file. It compares hashes (MD5, SHA1, etc) and logs a report of files which don\[aq]t match. It doesn\[aq]t alter the file system. .PP +The sumfile is treated as the source and the dst:path is treated as the +destination for the purposes of the output. +.PP If you supply the \f[C]--download\f[R] flag, it will download the data -from remote and calculate the contents hash on the fly. +from the remote and calculate the content hash on the fly. This can be useful for remotes that don\[aq]t support hashes or if you really want to check all the data. .PP @@ -3676,7 +3743,7 @@ more information. .IP .nf \f[C] -rclone checksum sumfile src:path [flags] +rclone checksum sumfile dst:path [flags] \f[R] .fi .SS Options @@ -4714,11 +4781,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default \[dq]HARD\[dq]) + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don\[aq]t skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -4733,11 +4800,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don\[aq]t check the destination, copy regardless --no-traverse Don\[aq]t traverse destination file system on copy - --no-update-modtime Don\[aq]t update destination mod-time if files identical + --no-update-modtime Don\[aq]t update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. \[aq]size,descending\[aq] + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default \[dq].partial\[dq]) --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination \f[R] @@ -5342,10 +5410,6 @@ Supported hashes are: * whirlpool * crc32 * sha256 - * dropbox - * hidrive - * mailru - * quickxor \f[R] .fi .PP @@ -5362,7 +5426,7 @@ case. .IP .nf \f[C] -rclone hashsum remote:path [flags] +rclone hashsum [ remote:path] [flags] \f[R] .fi .SS Options @@ -6267,13 +6331,22 @@ Note that mapping to a directory path, instead of a drive letter, does not suffer from the same limitations. .SS Mounting on macOS .PP -Mounting on macOS can be done either via +Mounting on macOS can be done either via built-in NFS +server (https://rclone.org/commands/rclone_serve_nfs/), macFUSE (https://osxfuse.github.io/) (also known as osxfuse) or FUSE-T (https://www.fuse-t.org/). macFUSE is a traditional FUSE driver utilizing a macOS kernel extension (kext). FUSE-T is an alternative FUSE system which \[dq]mounts\[dq] via an NFSv4 local server. +.SH NFS mount +.PP +This method spins up an NFS server using serve +nfs (https://rclone.org/commands/rclone_serve_nfs/) command and mounts +it to the specified mountpoint. +If you run this in background mode using |--daemon|, you will need to +send SIGTERM signal to the rclone process using |kill| command to stop +the mount. .SS macFUSE Notes .PP If installing macFUSE using dmg @@ -6338,6 +6411,8 @@ This means that many applications won\[aq]t work with their files on an rclone mount without \f[C]--vfs-cache-mode writes\f[R] or \f[C]--vfs-cache-mode full\f[R]. See the VFS File Caching section for more info. +When using NFS mount on macOS, if you don\[aq]t specify +|--vfs-cache-mode| the mount point will be read-only. .PP The bucket-based remotes (e.g. Swift, S3, Google Compute Storage, B2) do not support the concept of @@ -6519,7 +6594,7 @@ This allows to hide secrets from such commands as \f[C]ps\f[R] or standard mount options like \f[C]x-systemd.automount\f[R], \f[C]_netdev\f[R], \f[C]nosuid\f[R] and alike are intended only for Automountd and ignored by rclone. -.SS VFS - Virtual File System +## VFS - Virtual File System .PP This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something @@ -6980,6 +7055,7 @@ rclone mount remote:path /path/to/mountpoint [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached (\[aq]off\[aq] is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -7092,11 +7168,11 @@ Flags for anything which can Copy a file. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). --compare-dest stringArray Include additional comma separated server-side paths during comparison --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default \[dq]HARD\[dq]) + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) --ignore-case-sync Ignore case when synchronizing --ignore-checksum Skip post copy check of checksums --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum + --ignore-size Ignore size when skipping use modtime or checksum -I, --ignore-times Don\[aq]t skip files that match size and time - transfer all files --immutable Do not modify files, fail if existing files have been modified --inplace Download directly to destination file instead of atomic download to temp/rename @@ -7111,11 +7187,12 @@ Flags for anything which can Copy a file. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) --no-check-dest Don\[aq]t check the destination, copy regardless --no-traverse Don\[aq]t traverse destination file system on copy - --no-update-modtime Don\[aq]t update destination mod-time if files identical + --no-update-modtime Don\[aq]t update destination modtime if files identical --order-by string Instructions on how to order the transfers, e.g. \[aq]size,descending\[aq] + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default \[dq].partial\[dq]) --refresh-times Refresh the modtime of remote files --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum + --size-only Skip based on size only, not modtime or checksum --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) -u, --update Skip files that are newer on the destination \f[R] @@ -7718,6 +7795,42 @@ T}@T{ The UTC timestamp of an entry. T} .TE +.PP +The server also makes the following functions available so that they can +be used within the template. +These functions help extend the options for dynamic rendering of HTML. +They can be used to render HTML based on specific conditions. +.PP +.TS +tab(@); +lw(35.0n) lw(35.0n). +T{ +Function +T}@T{ +Description +T} +_ +T{ +afterEpoch +T}@T{ +Returns the time since the epoch for the given time. +T} +T{ +contains +T}@T{ +Checks whether a given substring is present or not in a given string. +T} +T{ +hasPrefix +T}@T{ +Checks whether the given string begins with the specified prefix. +T} +T{ +hasSuffix +T}@T{ +Checks whether the given string end with the specified suffix. +T} +.TE .SS Authentication .PP By default this will serve files without needing a login. @@ -8008,9 +8121,15 @@ remote:path over FTP. rclone serve http (https://rclone.org/commands/rclone_serve_http/) - Serve the remote over HTTP. .IP \[bu] 2 +rclone serve nfs (https://rclone.org/commands/rclone_serve_nfs/) - Serve +the remote as an NFS mount +.IP \[bu] 2 rclone serve restic (https://rclone.org/commands/rclone_serve_restic/) - Serve the remote for restic\[aq]s REST API. .IP \[bu] 2 +rclone serve s3 (https://rclone.org/commands/rclone_serve_s3/) - Serve +remote:path over s3. +.IP \[bu] 2 rclone serve sftp (https://rclone.org/commands/rclone_serve_sftp/) - Serve the remote over SFTP. .IP \[bu] 2 @@ -8045,7 +8164,7 @@ default \[dq]rclone (hostname)\[dq]. .PP Use \f[C]--log-trace\f[R] in conjunction with \f[C]-vv\f[R] to enable additional debug logging of all UPNP traffic. -.SS VFS - Virtual File System +## VFS - Virtual File System .PP This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something @@ -8493,6 +8612,7 @@ rclone serve dlna remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached (\[aq]off\[aq] is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -8589,7 +8709,7 @@ volumes. All mount and VFS options are submitted by the docker daemon via API, but you can also provide defaults on the command line as well as set path to the config file and cache directory or adjust logging verbosity. -.SS VFS - Virtual File System +## VFS - Virtual File System .PP This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something @@ -9055,6 +9175,7 @@ rclone serve docker [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached (\[aq]off\[aq] is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -9123,7 +9244,7 @@ By default this will serve files without needing a login. .PP You can set a single username and password with the --user and --pass flags. -.SS VFS - Virtual File System +## VFS - Virtual File System .PP This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something @@ -9667,6 +9788,7 @@ rclone serve ftp remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached (\[aq]off\[aq] is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -9877,6 +9999,42 @@ T}@T{ The UTC timestamp of an entry. T} .TE +.PP +The server also makes the following functions available so that they can +be used within the template. +These functions help extend the options for dynamic rendering of HTML. +They can be used to render HTML based on specific conditions. +.PP +.TS +tab(@); +lw(35.0n) lw(35.0n). +T{ +Function +T}@T{ +Description +T} +_ +T{ +afterEpoch +T}@T{ +Returns the time since the epoch for the given time. +T} +T{ +contains +T}@T{ +Checks whether a given substring is present or not in a given string. +T} +T{ +hasPrefix +T}@T{ +Checks whether the given string begins with the specified prefix. +T} +T{ +hasSuffix +T}@T{ +Checks whether the given string end with the specified suffix. +T} +.TE .SS Authentication .PP By default this will serve files without needing a login. @@ -9911,7 +10069,7 @@ Use \f[C]--realm\f[R] to set the authentication realm. .PP Use \f[C]--salt\f[R] to change the password hashing salt from the default. -.SS VFS - Virtual File System +## VFS - Virtual File System .PP This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something @@ -10464,6 +10622,7 @@ rclone serve http remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached (\[aq]off\[aq] is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -10506,297 +10665,55 @@ not listed here. .IP \[bu] 2 rclone serve (https://rclone.org/commands/rclone_serve/) - Serve a remote over a protocol. -.SH rclone serve restic +.SH rclone serve nfs .PP -Serve the remote for restic\[aq]s REST API. +Serve the remote as an NFS mount .SS Synopsis .PP -Run a basic web server to serve a remote over restic\[aq]s REST backend -API over HTTP. -This allows restic to use rclone as a data storage mechanism for cloud -providers that restic does not support directly. -.PP -Restic (https://restic.net/) is a command-line program for doing -backups. -.PP -The server will log errors. -Use -v to see access logs. -.PP -\f[C]--bwlimit\f[R] will be respected for file transfers. -Use \f[C]--stats\f[R] to control the stats printing. -.SS Setting up rclone for use by restic -.PP -First set up a remote for your chosen cloud -provider (https://rclone.org/docs/#configure). -.PP -Once you have set up the remote, check it is working with, for example -\[dq]rclone lsd remote:\[dq]. -You may have called the remote something other than \[dq]remote:\[dq] - -just substitute whatever you called it in the following instructions. -.PP -Now start the rclone restic server -.IP -.nf -\f[C] -rclone serve restic -v remote:backup -\f[R] -.fi -.PP -Where you can replace \[dq]backup\[dq] in the above by whatever path in -the remote you wish to use. -.PP -By default this will serve on \[dq]localhost:8080\[dq] you can change -this with use of the \f[C]--addr\f[R] flag. -.PP -You might wish to start this server on boot. -.PP -Adding \f[C]--cache-objects=false\f[R] will cause rclone to stop caching -objects returned from the List call. -Caching is normally desirable as it speeds up downloading objects, saves -transactions and uses very little memory. -.SS Setting up restic to use rclone -.PP -Now you can follow the restic -instructions (http://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html#rest-server) -on setting up restic. -.PP -Note that you will need restic 0.8.2 or later to interoperate with -rclone. -.PP -For the example above you will want to use -\[dq]http://localhost:8080/\[dq] as the URL for the REST server. -.PP -For example: -.IP -.nf -\f[C] -$ export RESTIC_REPOSITORY=rest:http://localhost:8080/ -$ export RESTIC_PASSWORD=yourpassword -$ restic init -created restic backend 8b1a4b56ae at rest:http://localhost:8080/ - -Please note that knowledge of your password is required to access -the repository. Losing your password means that your data is -irrecoverably lost. -$ restic backup /path/to/files/to/backup -scan [/path/to/files/to/backup] -scanned 189 directories, 312 files in 0:00 -[0:00] 100.00% 38.128 MiB / 38.128 MiB 501 / 501 items 0 errors ETA 0:00 -duration: 0:00 -snapshot 45c8fdd8 saved -\f[R] -.fi -.SS Multiple repositories -.PP -Note that you can use the endpoint to host multiple repositories. -Do this by adding a directory name or path after the URL. -Note that these \f[B]must\f[R] end with /. -Eg -.IP -.nf -\f[C] -$ export RESTIC_REPOSITORY=rest:http://localhost:8080/user1repo/ -# backup user1 stuff -$ export RESTIC_REPOSITORY=rest:http://localhost:8080/user2repo/ -# backup user2 stuff -\f[R] -.fi -.SS Private repositories -.PP -The\f[C]--private-repos\f[R] flag can be used to limit users to -repositories starting with a path of \f[C]//\f[R]. -.SS Server options +Create an NFS server that serves the given remote over the network. .PP -Use \f[C]--addr\f[R] to specify which IP address and port the server -should listen on, eg \f[C]--addr 1.2.3.4:8000\f[R] or -\f[C]--addr :8080\f[R] to listen to all IPs. -By default it only listens on localhost. -You can use port :0 to let the OS choose an available port. +The primary purpose for this command is to enable mount +command (https://rclone.org/commands/rclone_mount/) on recent macOS +versions where installing FUSE is very cumbersome. .PP -If you set \f[C]--addr\f[R] to listen on a public or LAN accessible IP -address then using Authentication is advised - see the next section for -info. +Since this is running on NFSv3, no authentication method is available. +Any client will be able to access the data. +To limit access, you can use serve NFS on loopback address and rely on +secure tunnels (such as SSH). +For this reason, by default, a random TCP port is chosen and loopback +interface is used for the listening address; meaning that it is only +available to the local machine. +If you want other machines to access the NFS mount over local network, +you need to specify the listening address and port using +\f[C]--addr\f[R] flag. .PP -You can use a unix socket by setting the url to -\f[C]unix:///path/to/socket\f[R] or just by using an absolute path name. -Note that unix sockets bypass the authentication - this is expected to -be done with file system permissions. +Modifying files through NFS protocol requires VFS caching. +Usually you will need to specify \f[C]--vfs-cache-mode\f[R] in order to +be able to write to the mountpoint (full is recommended). +If you don\[aq]t specify VFS cache mode, the mount will be read-only. .PP -\f[C]--addr\f[R] may be repeated to listen on multiple -IPs/ports/sockets. -.PP -\f[C]--server-read-timeout\f[R] and \f[C]--server-write-timeout\f[R] can -be used to control the timeouts on the server. -Note that this is the total time for a transfer. -.PP -\f[C]--max-header-bytes\f[R] controls the maximum number of bytes the -server will accept in the HTTP header. -.PP -\f[C]--baseurl\f[R] controls the URL prefix that rclone serves from. -By default rclone will serve from the root. -If you used \f[C]--baseurl \[dq]/rclone\[dq]\f[R] then rclone would -serve from a URL starting with \[dq]/rclone/\[dq]. -This is useful if you wish to proxy rclone serve. -Rclone automatically inserts leading and trailing \[dq]/\[dq] on -\f[C]--baseurl\f[R], so \f[C]--baseurl \[dq]rclone\[dq]\f[R], -\f[C]--baseurl \[dq]/rclone\[dq]\f[R] and -\f[C]--baseurl \[dq]/rclone/\[dq]\f[R] are all treated identically. -.SS TLS (SSL) -.PP -By default this will serve over http. -If you want you can serve over https. -You will need to supply the \f[C]--cert\f[R] and \f[C]--key\f[R] flags. -If you wish to do client side certificate validation then you will need -to supply \f[C]--client-ca\f[R] also. -.PP -\f[C]--cert\f[R] should be a either a PEM encoded certificate or a -concatenation of that with the CA certificate. -\f[C]--key\f[R] should be the PEM encoded private key and -\f[C]--client-ca\f[R] should be the PEM encoded client certificate -authority certificate. -.PP ---min-tls-version is minimum TLS version that is acceptable. -Valid values are \[dq]tls1.0\[dq], \[dq]tls1.1\[dq], \[dq]tls1.2\[dq] -and \[dq]tls1.3\[dq] (default \[dq]tls1.0\[dq]). -.SS Authentication -.PP -By default this will serve files without needing a login. -.PP -You can either use an htpasswd file which can take lots of users, or set -a single username and password with the \f[C]--user\f[R] and -\f[C]--pass\f[R] flags. -.PP -If no static users are configured by either of the above methods, and -client certificates are required by the \f[C]--client-ca\f[R] flag -passed to the server, the client certificate common name will be -considered as the username. -.PP -Use \f[C]--htpasswd /path/to/htpasswd\f[R] to provide an htpasswd file. -This is in standard apache format and supports MD5, SHA1 and BCrypt for -basic authentication. -Bcrypt is recommended. -.PP -To create an htpasswd file: +To serve NFS over the network use following command: .IP .nf \f[C] -touch htpasswd -htpasswd -B htpasswd user -htpasswd -B htpasswd anotherUser +rclone serve nfs remote: --addr 0.0.0.0:$PORT --vfs-cache-mode=full \f[R] .fi .PP -The password file can be updated while rclone is running. +We specify a specific port that we can use in the mount command: .PP -Use \f[C]--realm\f[R] to set the authentication realm. -.PP -Use \f[C]--salt\f[R] to change the password hashing salt from the -default. +To mount the server under Linux/macOS, use the following command: .IP .nf \f[C] -rclone serve restic remote:path [flags] -\f[R] -.fi -.SS Options -.IP -.nf -\f[C] - --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) - --allow-origin string Origin which cross-domain request (CORS) can be executed from - --append-only Disallow deletion of repository data - --baseurl string Prefix for URLs - leave blank for root - --cache-objects Cache listed objects (default true) - --cert string TLS PEM key (concatenation of certificate and CA certificate) - --client-ca string Client certificate authority to verify clients with - -h, --help help for restic - --htpasswd string A htpasswd file - if not provided no authentication is done - --key string TLS PEM Private key - --max-header-bytes int Maximum size of request header (default 4096) - --min-tls-version string Minimum TLS version that is acceptable (default \[dq]tls1.0\[dq]) - --pass string Password for authentication - --private-repos Users can only access their private repo - --realm string Realm for authentication - --salt string Password hashing salt (default \[dq]dlPL2MqE\[dq]) - --server-read-timeout Duration Timeout for server reading data (default 1h0m0s) - --server-write-timeout Duration Timeout for server writing data (default 1h0m0s) - --stdio Run an HTTP2 server on stdin/stdout - --user string User name for authentication -\f[R] -.fi -.PP -See the global flags page (https://rclone.org/flags/) for global options -not listed here. -.SH SEE ALSO -.IP \[bu] 2 -rclone serve (https://rclone.org/commands/rclone_serve/) - Serve a -remote over a protocol. -.SH rclone serve sftp -.PP -Serve the remote over SFTP. -.SS Synopsis -.PP -Run an SFTP server to serve a remote over SFTP. -This can be used with an SFTP client or you can make a remote of type -sftp to use with it. -.PP -You can use the filter flags (e.g. -\f[C]--include\f[R], \f[C]--exclude\f[R]) to control what is served. -.PP -The server will respond to a small number of shell commands, mainly -md5sum, sha1sum and df, which enable it to provide support for checksums -and the about feature when accessed from an sftp remote. -.PP -Note that this server uses standard 32 KiB packet payload size, which -means you must not configure the client to expect anything else, e.g. -with the chunk_size (https://rclone.org/sftp/#sftp-chunk-size) option on -an sftp remote. -.PP -The server will log errors. -Use \f[C]-v\f[R] to see access logs. -.PP -\f[C]--bwlimit\f[R] will be respected for file transfers. -Use \f[C]--stats\f[R] to control the stats printing. -.PP -You must provide some means of authentication, either with -\f[C]--user\f[R]/\f[C]--pass\f[R], an authorized keys file (specify -location with \f[C]--authorized-keys\f[R] - the default is the same as -ssh), an \f[C]--auth-proxy\f[R], or set the \f[C]--no-auth\f[R] flag for -no authentication when logging in. -.PP -If you don\[aq]t supply a host \f[C]--key\f[R] then rclone will generate -rsa, ecdsa and ed25519 variants, and cache them for later use in -rclone\[aq]s cache directory (see \f[C]rclone help flags cache-dir\f[R]) -in the \[dq]serve-sftp\[dq] directory. -.PP -By default the server binds to localhost:2022 - if you want it to be -reachable externally then supply \f[C]--addr :2022\f[R] for example. -.PP -Note that the default of \f[C]--vfs-cache-mode off\f[R] is fine for the -rclone sftp backend, but it may not be with other SFTP clients. -.PP -If \f[C]--stdio\f[R] is specified, rclone will serve SFTP over stdio, -which can be used with sshd via \[ti]/.ssh/authorized_keys, for example: -.IP -.nf -\f[C] -restrict,command=\[dq]rclone serve sftp --stdio ./photos\[dq] ssh-rsa ... +mount -oport=$PORT,mountport=$PORT $HOSTNAME: path/to/mountpoint \f[R] .fi .PP -On the client you need to set \f[C]--transfers 1\f[R] when using -\f[C]--stdio\f[R]. -Otherwise multiple instances of the rclone server are started by OpenSSH -which can lead to \[dq]corrupted on transfer\[dq] errors. -This is the case because the client chooses indiscriminately which -server to send commands to while the servers all have different views of -the state of the filing system. +Where \f[C]$PORT\f[R] is the same port number we used in the serve nfs +command. .PP -The \[dq]restrict\[dq] in authorized_keys prevents SHA1SUMs and MD5SUMs -from being used. -Omitting \[dq]restrict\[dq] and using \f[C]--sftp-path-override\f[R] to -enable checksumming is possible but less secure and you could use the -SFTP server provided by OpenSSH in this case. +This feature is only available on Unix platforms. .SS VFS - Virtual File System .PP This command uses the VFS layer. @@ -11206,129 +11123,29 @@ filters so that the result is accurate. However, this is very inefficient and may cost lots of API calls resulting in extra charges. Use it as a last resort and only with caching. -.SS Auth Proxy -.PP -If you supply the parameter \f[C]--auth-proxy /path/to/program\f[R] then -rclone will use that program to generate backends on the fly which then -are used to authenticate incoming requests. -This uses a simple JSON based protocol with input on STDIN and output on -STDOUT. -.PP -\f[B]PLEASE NOTE:\f[R] \f[C]--auth-proxy\f[R] and -\f[C]--authorized-keys\f[R] cannot be used together, if -\f[C]--auth-proxy\f[R] is set the authorized keys option will be -ignored. -.PP -There is an example program -bin/test_proxy.py (https://github.com/rclone/rclone/blob/master/test_proxy.py) -in the rclone source code. -.PP -The program\[aq]s job is to take a \f[C]user\f[R] and \f[C]pass\f[R] on -the input and turn those into the config for a backend on STDOUT in JSON -format. -This config will have any default parameters for the backend added, but -it won\[aq]t use configuration from environment variables or command -line options - it is the job of the proxy program to make a complete -config. -.PP -This config generated must have this extra parameter - \f[C]_root\f[R] - -root to use for the backend -.PP -And it may have this parameter - \f[C]_obscure\f[R] - comma separated -strings for parameters to obscure -.PP -If password authentication was used by the client, input to the proxy -process (on STDIN) would look similar to this: -.IP -.nf -\f[C] -{ - \[dq]user\[dq]: \[dq]me\[dq], - \[dq]pass\[dq]: \[dq]mypassword\[dq] -} -\f[R] -.fi -.PP -If public-key authentication was used by the client, input to the proxy -process (on STDIN) would look similar to this: -.IP -.nf -\f[C] -{ - \[dq]user\[dq]: \[dq]me\[dq], - \[dq]public_key\[dq]: \[dq]AAAAB3NzaC1yc2EAAAADAQABAAABAQDuwESFdAe14hVS6omeyX7edc...JQdf\[dq] -} -\f[R] -.fi -.PP -And as an example return this on STDOUT -.IP -.nf -\f[C] -{ - \[dq]type\[dq]: \[dq]sftp\[dq], - \[dq]_root\[dq]: \[dq]\[dq], - \[dq]_obscure\[dq]: \[dq]pass\[dq], - \[dq]user\[dq]: \[dq]me\[dq], - \[dq]pass\[dq]: \[dq]mypassword\[dq], - \[dq]host\[dq]: \[dq]sftp.example.com\[dq] -} -\f[R] -.fi -.PP -This would mean that an SFTP backend would be created on the fly for the -\f[C]user\f[R] and \f[C]pass\f[R]/\f[C]public_key\f[R] returned in the -output to the host given. -Note that since \f[C]_obscure\f[R] is set to \f[C]pass\f[R], rclone will -obscure the \f[C]pass\f[R] parameter before creating the backend (which -is required for sftp backends). -.PP -The program can manipulate the supplied \f[C]user\f[R] in any way, for -example to make proxy to many different sftp backends, you could make -the \f[C]user\f[R] be \f[C]user\[at]example.com\f[R] and then set the -\f[C]host\f[R] to \f[C]example.com\f[R] in the output and the user to -\f[C]user\f[R]. -For security you\[aq]d probably want to restrict the \f[C]host\f[R] to a -limited list. -.PP -Note that an internal cache is keyed on \f[C]user\f[R] so only use that -for configuration, don\[aq]t use \f[C]pass\f[R] or \f[C]public_key\f[R]. -This also means that if a user\[aq]s password or public-key is changed -the cache will need to expire (which takes 5 mins) before it takes -effect. -.PP -This can be used to build general purpose proxies to any kind of backend -that rclone supports. .IP .nf \f[C] -rclone serve sftp remote:path [flags] +rclone serve nfs remote:path [flags] \f[R] .fi .SS Options .IP .nf \f[C] - --addr string IPaddress:Port or :Port to bind server to (default \[dq]localhost:2022\[dq]) - --auth-proxy string A program to use to create the backend from the auth - --authorized-keys string Authorized keys file (default \[dq]\[ti]/.ssh/authorized_keys\[dq]) + --addr string IPaddress:Port or :Port to bind server to --dir-cache-time Duration Time to cache directory entries for (default 5m0s) --dir-perms FileMode Directory permissions (default 0777) --file-perms FileMode File permissions (default 0666) --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) - -h, --help help for sftp - --key stringArray SSH private host key file (Can be multi-valued, leave blank to auto generate) - --no-auth Allow connections with no authentication if set + -h, --help help for nfs --no-checksum Don\[aq]t compare checksums on up/download --no-modtime Don\[aq]t read/write the modification time (can speed things up) --no-seek Don\[aq]t allow seeking in files - --pass string Password for authentication --poll-interval Duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s) --read-only Only allow read-only access - --stdio Run an sftp server on stdin/stdout --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) - --user string User name for authentication --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) @@ -11341,6 +11158,7 @@ rclone serve sftp remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached (\[aq]off\[aq] is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -11383,56 +11201,105 @@ not listed here. .IP \[bu] 2 rclone serve (https://rclone.org/commands/rclone_serve/) - Serve a remote over a protocol. -.SH rclone serve webdav +.SH rclone serve restic .PP -Serve remote:path over WebDAV. +Serve the remote for restic\[aq]s REST API. .SS Synopsis .PP -Run a basic WebDAV server to serve a remote over HTTP via the WebDAV -protocol. -This can be viewed with a WebDAV client, through a web browser, or you -can make a remote of type WebDAV to read and write it. -.SS WebDAV options -.SS --etag-hash +Run a basic web server to serve a remote over restic\[aq]s REST backend +API over HTTP. +This allows restic to use rclone as a data storage mechanism for cloud +providers that restic does not support directly. .PP -This controls the ETag header. -Without this flag the ETag will be based on the ModTime and Size of the -object. +Restic (https://restic.net/) is a command-line program for doing +backups. .PP -If this flag is set to \[dq]auto\[dq] then rclone will choose the first -supported hash on the backend or you can use a named hash such as -\[dq]MD5\[dq] or \[dq]SHA-1\[dq]. -Use the hashsum (https://rclone.org/commands/rclone_hashsum/) command to -see the full list. -.SS Access WebDAV on Windows +The server will log errors. +Use -v to see access logs. .PP -WebDAV shared folder can be mapped as a drive on Windows, however the -default settings prevent it. -Windows will fail to connect to the server using insecure Basic -authentication. -It will not even display any login dialog. -Windows requires SSL / HTTPS connection to be used with Basic. -If you try to connect via Add Network Location Wizard you will get the -following error: \[dq]The folder you entered does not appear to be -valid. -Please choose another\[dq]. -However, you still can connect if you set the following registry key on -a client machine: HKEY_LOCAL_MACHINEto 2. -The BasicAuthLevel can be set to the following values: 0 - Basic -authentication disabled 1 - Basic authentication enabled for SSL -connections only 2 - Basic authentication enabled for SSL connections -and for non-SSL connections If required, increase the -FileSizeLimitInBytes to a higher value. -Navigate to the Services interface, then restart the WebClient service. -.SS Access Office applications on WebDAV +\f[C]--bwlimit\f[R] will be respected for file transfers. +Use \f[C]--stats\f[R] to control the stats printing. +.SS Setting up rclone for use by restic .PP -Navigate to following registry HKEY_CURRENT_USER[14.0/15.0/16.0] Create -a new DWORD BasicAuthLevel with value 2. -0 - Basic authentication disabled 1 - Basic authentication enabled for -SSL connections only 2 - Basic authentication enabled for SSL and for -non-SSL connections +First set up a remote for your chosen cloud +provider (https://rclone.org/docs/#configure). .PP -https://learn.microsoft.com/en-us/office/troubleshoot/powerpoint/office-opens-blank-from-sharepoint +Once you have set up the remote, check it is working with, for example +\[dq]rclone lsd remote:\[dq]. +You may have called the remote something other than \[dq]remote:\[dq] - +just substitute whatever you called it in the following instructions. +.PP +Now start the rclone restic server +.IP +.nf +\f[C] +rclone serve restic -v remote:backup +\f[R] +.fi +.PP +Where you can replace \[dq]backup\[dq] in the above by whatever path in +the remote you wish to use. +.PP +By default this will serve on \[dq]localhost:8080\[dq] you can change +this with use of the \f[C]--addr\f[R] flag. +.PP +You might wish to start this server on boot. +.PP +Adding \f[C]--cache-objects=false\f[R] will cause rclone to stop caching +objects returned from the List call. +Caching is normally desirable as it speeds up downloading objects, saves +transactions and uses very little memory. +.SS Setting up restic to use rclone +.PP +Now you can follow the restic +instructions (http://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html#rest-server) +on setting up restic. +.PP +Note that you will need restic 0.8.2 or later to interoperate with +rclone. +.PP +For the example above you will want to use +\[dq]http://localhost:8080/\[dq] as the URL for the REST server. +.PP +For example: +.IP +.nf +\f[C] +$ export RESTIC_REPOSITORY=rest:http://localhost:8080/ +$ export RESTIC_PASSWORD=yourpassword +$ restic init +created restic backend 8b1a4b56ae at rest:http://localhost:8080/ + +Please note that knowledge of your password is required to access +the repository. Losing your password means that your data is +irrecoverably lost. +$ restic backup /path/to/files/to/backup +scan [/path/to/files/to/backup] +scanned 189 directories, 312 files in 0:00 +[0:00] 100.00% 38.128 MiB / 38.128 MiB 501 / 501 items 0 errors ETA 0:00 +duration: 0:00 +snapshot 45c8fdd8 saved +\f[R] +.fi +.SS Multiple repositories +.PP +Note that you can use the endpoint to host multiple repositories. +Do this by adding a directory name or path after the URL. +Note that these \f[B]must\f[R] end with /. +Eg +.IP +.nf +\f[C] +$ export RESTIC_REPOSITORY=rest:http://localhost:8080/user1repo/ +# backup user1 stuff +$ export RESTIC_REPOSITORY=rest:http://localhost:8080/user2repo/ +# backup user2 stuff +\f[R] +.fi +.SS Private repositories +.PP +The\f[C]--private-repos\f[R] flag can be used to limit users to +repositories starting with a path of \f[C]//\f[R]. .SS Server options .PP Use \f[C]--addr\f[R] to specify which IP address and port the server @@ -11486,104 +11353,6 @@ authority certificate. --min-tls-version is minimum TLS version that is acceptable. Valid values are \[dq]tls1.0\[dq], \[dq]tls1.1\[dq], \[dq]tls1.2\[dq] and \[dq]tls1.3\[dq] (default \[dq]tls1.0\[dq]). -.SS Template -.PP -\f[C]--template\f[R] allows a user to specify a custom markup template -for HTTP and WebDAV serve functions. -The server exports the following markup to be used within the template -to server pages: -.PP -.TS -tab(@); -lw(35.0n) lw(35.0n). -T{ -Parameter -T}@T{ -Description -T} -_ -T{ -\&.Name -T}@T{ -The full path of a file/directory. -T} -T{ -\&.Title -T}@T{ -Directory listing of .Name -T} -T{ -\&.Sort -T}@T{ -The current sort used. -This is changeable via ?sort= parameter -T} -T{ -T}@T{ -Sort Options: namedirfirst,name,size,time (default namedirfirst) -T} -T{ -\&.Order -T}@T{ -The current ordering used. -This is changeable via ?order= parameter -T} -T{ -T}@T{ -Order Options: asc,desc (default asc) -T} -T{ -\&.Query -T}@T{ -Currently unused. -T} -T{ -\&.Breadcrumb -T}@T{ -Allows for creating a relative navigation -T} -T{ --- .Link -T}@T{ -The relative to the root link of the Text. -T} -T{ --- .Text -T}@T{ -The Name of the directory. -T} -T{ -\&.Entries -T}@T{ -Information about a specific file/directory. -T} -T{ --- .URL -T}@T{ -The \[aq]url\[aq] of an entry. -T} -T{ --- .Leaf -T}@T{ -Currently same as \[aq]URL\[aq] but intended to be \[aq]just\[aq] the -name. -T} -T{ --- .IsDir -T}@T{ -Boolean for if an entry is a directory or not. -T} -T{ --- .Size -T}@T{ -Size in Bytes of the entry. -T} -T{ --- .ModTime -T}@T{ -The UTC timestamp of an entry. -T} -.TE .SS Authentication .PP By default this will serve files without needing a login. @@ -11618,7 +11387,247 @@ Use \f[C]--realm\f[R] to set the authentication realm. .PP Use \f[C]--salt\f[R] to change the password hashing salt from the default. -.SS VFS - Virtual File System +.IP +.nf +\f[C] +rclone serve restic remote:path [flags] +\f[R] +.fi +.SS Options +.IP +.nf +\f[C] + --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) + --allow-origin string Origin which cross-domain request (CORS) can be executed from + --append-only Disallow deletion of repository data + --baseurl string Prefix for URLs - leave blank for root + --cache-objects Cache listed objects (default true) + --cert string TLS PEM key (concatenation of certificate and CA certificate) + --client-ca string Client certificate authority to verify clients with + -h, --help help for restic + --htpasswd string A htpasswd file - if not provided no authentication is done + --key string TLS PEM Private key + --max-header-bytes int Maximum size of request header (default 4096) + --min-tls-version string Minimum TLS version that is acceptable (default \[dq]tls1.0\[dq]) + --pass string Password for authentication + --private-repos Users can only access their private repo + --realm string Realm for authentication + --salt string Password hashing salt (default \[dq]dlPL2MqE\[dq]) + --server-read-timeout Duration Timeout for server reading data (default 1h0m0s) + --server-write-timeout Duration Timeout for server writing data (default 1h0m0s) + --stdio Run an HTTP2 server on stdin/stdout + --user string User name for authentication +\f[R] +.fi +.PP +See the global flags page (https://rclone.org/flags/) for global options +not listed here. +.SH SEE ALSO +.IP \[bu] 2 +rclone serve (https://rclone.org/commands/rclone_serve/) - Serve a +remote over a protocol. +.SH rclone serve s3 +.PP +Serve remote:path over s3. +.SS Synopsis +.PP +\f[C]serve s3\f[R] implements a basic s3 server that serves a remote via +s3. +This can be viewed with an s3 client, or you can make an s3 type +remote (https://rclone.org/s3/) to read and write to it with rclone. +.PP +\f[C]serve s3\f[R] is considered \f[B]Experimental\f[R] so use with +care. +.PP +S3 server supports Signature Version 4 authentication. +Just use \f[C]--auth-key accessKey,secretKey\f[R] and set the +\f[C]Authorization\f[R] header correctly in the request. +(See the AWS +docs (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html)). +.PP +\f[C]--auth-key\f[R] can be repeated for multiple auth pairs. +If \f[C]--auth-key\f[R] is not provided then \f[C]serve s3\f[R] will +allow anonymous access. +.PP +Please note that some clients may require HTTPS endpoints. +See the SSL docs for more information. +.PP +This command uses the VFS directory cache. +All the functionality will work with \f[C]--vfs-cache-mode off\f[R]. +Using \f[C]--vfs-cache-mode full\f[R] (or \f[C]writes\f[R]) can be used +to cache objects locally to improve performance. +.PP +Use \f[C]--force-path-style=false\f[R] if you want to use the bucket +name as a part of the hostname (such as mybucket.local) +.PP +Use \f[C]--etag-hash\f[R] if you want to change the hash uses for the +\f[C]ETag\f[R]. +Note that using anything other than \f[C]MD5\f[R] (the default) is +likely to cause problems for S3 clients which rely on the Etag being the +MD5. +.SS Quickstart +.PP +For a simple set up, to serve \f[C]remote:path\f[R] over s3, run the +server like this: +.IP +.nf +\f[C] +rclone serve s3 --auth-key ACCESS_KEY_ID,SECRET_ACCESS_KEY remote:path +\f[R] +.fi +.PP +This will be compatible with an rclone remote which is defined like +this: +.IP +.nf +\f[C] +[serves3] +type = s3 +provider = Rclone +endpoint = http://127.0.0.1:8080/ +access_key_id = ACCESS_KEY_ID +secret_access_key = SECRET_ACCESS_KEY +use_multipart_uploads = false +\f[R] +.fi +.PP +Note that setting \f[C]disable_multipart_uploads = true\f[R] is to work +around a bug which will be fixed in due course. +.SS Bugs +.PP +When uploading multipart files \f[C]serve s3\f[R] holds all the parts in +memory (see #7453 (https://github.com/rclone/rclone/issues/7453)). +This is a limitaton of the library rclone uses for serving S3 and will +hopefully be fixed at some point. +.PP +Multipart server side copies do not work (see +#7454 (https://github.com/rclone/rclone/issues/7454)). +These take a very long time and eventually fail. +The default threshold for multipart server side copies is 5G which is +the maximum it can be, so files above this side will fail to be server +side copied. +.PP +For a current list of \f[C]serve s3\f[R] bugs see the serve +s3 (https://github.com/rclone/rclone/labels/serve%20s3) bug category on +GitHub. +.SS Limitations +.PP +\f[C]serve s3\f[R] will treat all directories in the root as buckets and +ignore all files in the root. +You can use \f[C]CreateBucket\f[R] to create folders under the root, but +you can\[aq]t create empty folders under other folders not in the root. +.PP +When using \f[C]PutObject\f[R] or \f[C]DeleteObject\f[R], rclone will +automatically create or clean up empty folders. +If you don\[aq]t want to clean up empty folders automatically, use +\f[C]--no-cleanup\f[R]. +.PP +When using \f[C]ListObjects\f[R], rclone will use \f[C]/\f[R] when the +delimiter is empty. +This reduces backend requests with no effect on most operations, but if +the delimiter is something other than \f[C]/\f[R] and empty, rclone will +do a full recursive search of the backend, which can take some time. +.PP +Versioning is not currently supported. +.PP +Metadata will only be saved in memory other than the rclone +\f[C]mtime\f[R] metadata which will be set as the modification time of +the file. +.SS Supported operations +.PP +\f[C]serve s3\f[R] currently supports the following operations. +.IP \[bu] 2 +Bucket +.RS 2 +.IP \[bu] 2 +\f[C]ListBuckets\f[R] +.IP \[bu] 2 +\f[C]CreateBucket\f[R] +.IP \[bu] 2 +\f[C]DeleteBucket\f[R] +.RE +.IP \[bu] 2 +Object +.RS 2 +.IP \[bu] 2 +\f[C]HeadObject\f[R] +.IP \[bu] 2 +\f[C]ListObjects\f[R] +.IP \[bu] 2 +\f[C]GetObject\f[R] +.IP \[bu] 2 +\f[C]PutObject\f[R] +.IP \[bu] 2 +\f[C]DeleteObject\f[R] +.IP \[bu] 2 +\f[C]DeleteObjects\f[R] +.IP \[bu] 2 +\f[C]CreateMultipartUpload\f[R] +.IP \[bu] 2 +\f[C]CompleteMultipartUpload\f[R] +.IP \[bu] 2 +\f[C]AbortMultipartUpload\f[R] +.IP \[bu] 2 +\f[C]CopyObject\f[R] +.IP \[bu] 2 +\f[C]UploadPart\f[R] +.RE +.PP +Other operations will return error \f[C]Unimplemented\f[R]. +.SS Server options +.PP +Use \f[C]--addr\f[R] to specify which IP address and port the server +should listen on, eg \f[C]--addr 1.2.3.4:8000\f[R] or +\f[C]--addr :8080\f[R] to listen to all IPs. +By default it only listens on localhost. +You can use port :0 to let the OS choose an available port. +.PP +If you set \f[C]--addr\f[R] to listen on a public or LAN accessible IP +address then using Authentication is advised - see the next section for +info. +.PP +You can use a unix socket by setting the url to +\f[C]unix:///path/to/socket\f[R] or just by using an absolute path name. +Note that unix sockets bypass the authentication - this is expected to +be done with file system permissions. +.PP +\f[C]--addr\f[R] may be repeated to listen on multiple +IPs/ports/sockets. +.PP +\f[C]--server-read-timeout\f[R] and \f[C]--server-write-timeout\f[R] can +be used to control the timeouts on the server. +Note that this is the total time for a transfer. +.PP +\f[C]--max-header-bytes\f[R] controls the maximum number of bytes the +server will accept in the HTTP header. +.PP +\f[C]--baseurl\f[R] controls the URL prefix that rclone serves from. +By default rclone will serve from the root. +If you used \f[C]--baseurl \[dq]/rclone\[dq]\f[R] then rclone would +serve from a URL starting with \[dq]/rclone/\[dq]. +This is useful if you wish to proxy rclone serve. +Rclone automatically inserts leading and trailing \[dq]/\[dq] on +\f[C]--baseurl\f[R], so \f[C]--baseurl \[dq]rclone\[dq]\f[R], +\f[C]--baseurl \[dq]/rclone\[dq]\f[R] and +\f[C]--baseurl \[dq]/rclone/\[dq]\f[R] are all treated identically. +.SS TLS (SSL) +.PP +By default this will serve over http. +If you want you can serve over https. +You will need to supply the \f[C]--cert\f[R] and \f[C]--key\f[R] flags. +If you wish to do client side certificate validation then you will need +to supply \f[C]--client-ca\f[R] also. +.PP +\f[C]--cert\f[R] should be a either a PEM encoded certificate or a +concatenation of that with the CA certificate. +\f[C]--key\f[R] should be the PEM encoded private key and +\f[C]--client-ca\f[R] should be the PEM encoded client certificate +authority certificate. +.PP +--min-tls-version is minimum TLS version that is acceptable. +Valid values are \[dq]tls1.0\[dq], \[dq]tls1.1\[dq], \[dq]tls1.2\[dq] +and \[dq]tls1.3\[dq] (default \[dq]tls1.0\[dq]). +## VFS - Virtual File System .PP This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something @@ -12027,103 +12036,10 @@ filters so that the result is accurate. However, this is very inefficient and may cost lots of API calls resulting in extra charges. Use it as a last resort and only with caching. -.SS Auth Proxy -.PP -If you supply the parameter \f[C]--auth-proxy /path/to/program\f[R] then -rclone will use that program to generate backends on the fly which then -are used to authenticate incoming requests. -This uses a simple JSON based protocol with input on STDIN and output on -STDOUT. -.PP -\f[B]PLEASE NOTE:\f[R] \f[C]--auth-proxy\f[R] and -\f[C]--authorized-keys\f[R] cannot be used together, if -\f[C]--auth-proxy\f[R] is set the authorized keys option will be -ignored. -.PP -There is an example program -bin/test_proxy.py (https://github.com/rclone/rclone/blob/master/test_proxy.py) -in the rclone source code. -.PP -The program\[aq]s job is to take a \f[C]user\f[R] and \f[C]pass\f[R] on -the input and turn those into the config for a backend on STDOUT in JSON -format. -This config will have any default parameters for the backend added, but -it won\[aq]t use configuration from environment variables or command -line options - it is the job of the proxy program to make a complete -config. -.PP -This config generated must have this extra parameter - \f[C]_root\f[R] - -root to use for the backend -.PP -And it may have this parameter - \f[C]_obscure\f[R] - comma separated -strings for parameters to obscure -.PP -If password authentication was used by the client, input to the proxy -process (on STDIN) would look similar to this: -.IP -.nf -\f[C] -{ - \[dq]user\[dq]: \[dq]me\[dq], - \[dq]pass\[dq]: \[dq]mypassword\[dq] -} -\f[R] -.fi -.PP -If public-key authentication was used by the client, input to the proxy -process (on STDIN) would look similar to this: -.IP -.nf -\f[C] -{ - \[dq]user\[dq]: \[dq]me\[dq], - \[dq]public_key\[dq]: \[dq]AAAAB3NzaC1yc2EAAAADAQABAAABAQDuwESFdAe14hVS6omeyX7edc...JQdf\[dq] -} -\f[R] -.fi -.PP -And as an example return this on STDOUT -.IP -.nf -\f[C] -{ - \[dq]type\[dq]: \[dq]sftp\[dq], - \[dq]_root\[dq]: \[dq]\[dq], - \[dq]_obscure\[dq]: \[dq]pass\[dq], - \[dq]user\[dq]: \[dq]me\[dq], - \[dq]pass\[dq]: \[dq]mypassword\[dq], - \[dq]host\[dq]: \[dq]sftp.example.com\[dq] -} -\f[R] -.fi -.PP -This would mean that an SFTP backend would be created on the fly for the -\f[C]user\f[R] and \f[C]pass\f[R]/\f[C]public_key\f[R] returned in the -output to the host given. -Note that since \f[C]_obscure\f[R] is set to \f[C]pass\f[R], rclone will -obscure the \f[C]pass\f[R] parameter before creating the backend (which -is required for sftp backends). -.PP -The program can manipulate the supplied \f[C]user\f[R] in any way, for -example to make proxy to many different sftp backends, you could make -the \f[C]user\f[R] be \f[C]user\[at]example.com\f[R] and then set the -\f[C]host\f[R] to \f[C]example.com\f[R] in the output and the user to -\f[C]user\f[R]. -For security you\[aq]d probably want to restrict the \f[C]host\f[R] to a -limited list. -.PP -Note that an internal cache is keyed on \f[C]user\f[R] so only use that -for configuration, don\[aq]t use \f[C]pass\f[R] or \f[C]public_key\f[R]. -This also means that if a user\[aq]s password or public-key is changed -the cache will need to expire (which takes 5 mins) before it takes -effect. -.PP -This can be used to build general purpose proxies to any kind of backend -that rclone supports. .IP .nf \f[C] -rclone serve webdav remote:path [flags] +rclone serve s3 remote:path [flags] \f[R] .fi .SS Options @@ -12132,35 +12048,30 @@ rclone serve webdav remote:path [flags] \f[C] --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) --allow-origin string Origin which cross-domain request (CORS) can be executed from - --auth-proxy string A program to use to create the backend from the auth + --auth-key stringArray Set key pair for v4 authorization: access_key_id,secret_access_key --baseurl string Prefix for URLs - leave blank for root --cert string TLS PEM key (concatenation of certificate and CA certificate) --client-ca string Client certificate authority to verify clients with --dir-cache-time Duration Time to cache directory entries for (default 5m0s) --dir-perms FileMode Directory permissions (default 0777) - --disable-dir-list Disable HTML directory list on GET request for a directory - --etag-hash string Which hash to use for the ETag, or auto or blank for off + --etag-hash string Which hash to use for the ETag, or auto or blank for off (default \[dq]MD5\[dq]) --file-perms FileMode File permissions (default 0666) + --force-path-style If true use path style access if false use virtual hosted style (default true) (default true) --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) - -h, --help help for webdav - --htpasswd string A htpasswd file - if not provided no authentication is done + -h, --help help for s3 --key string TLS PEM Private key --max-header-bytes int Maximum size of request header (default 4096) --min-tls-version string Minimum TLS version that is acceptable (default \[dq]tls1.0\[dq]) --no-checksum Don\[aq]t compare checksums on up/download + --no-cleanup Not to cleanup empty folder after object is deleted --no-modtime Don\[aq]t read/write the modification time (can speed things up) --no-seek Don\[aq]t allow seeking in files - --pass string Password for authentication --poll-interval Duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s) --read-only Only allow read-only access - --realm string Realm for authentication - --salt string Password hashing salt (default \[dq]dlPL2MqE\[dq]) --server-read-timeout Duration Timeout for server reading data (default 1h0m0s) --server-write-timeout Duration Timeout for server writing data (default 1h0m0s) - --template string User-specified template --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) - --user string User name for authentication --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) @@ -12173,6 +12084,7 @@ rclone serve webdav remote:path [flags] --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached (\[aq]off\[aq] is unlimited) (default off) --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start --vfs-used-is-size rclone size Use the rclone size algorithm for Used size --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) @@ -12215,476 +12127,620 @@ not listed here. .IP \[bu] 2 rclone serve (https://rclone.org/commands/rclone_serve/) - Serve a remote over a protocol. -.SH rclone settier +.SH rclone serve sftp .PP -Changes storage class/tier of objects in remote. +Serve the remote over SFTP. .SS Synopsis .PP -rclone settier changes storage tier or class at remote if supported. -Few cloud storage services provides different storage classes on -objects, for example AWS S3 and Glacier, Azure Blob storage - Hot, Cool -and Archive, Google Cloud Storage, Regional Storage, Nearline, Coldline -etc. +Run an SFTP server to serve a remote over SFTP. +This can be used with an SFTP client or you can make a remote of type +sftp to use with it. .PP -Note that, certain tier changes make objects not available to access -immediately. -For example tiering to archive in azure blob storage makes objects in -frozen state, user can restore by setting tier to Hot/Cool, similarly S3 -to Glacier makes object inaccessible.true +You can use the filter flags (e.g. +\f[C]--include\f[R], \f[C]--exclude\f[R]) to control what is served. .PP -You can use it to tier single object +The server will respond to a small number of shell commands, mainly +md5sum, sha1sum and df, which enable it to provide support for checksums +and the about feature when accessed from an sftp remote. +.PP +Note that this server uses standard 32 KiB packet payload size, which +means you must not configure the client to expect anything else, e.g. +with the chunk_size (https://rclone.org/sftp/#sftp-chunk-size) option on +an sftp remote. +.PP +The server will log errors. +Use \f[C]-v\f[R] to see access logs. +.PP +\f[C]--bwlimit\f[R] will be respected for file transfers. +Use \f[C]--stats\f[R] to control the stats printing. +.PP +You must provide some means of authentication, either with +\f[C]--user\f[R]/\f[C]--pass\f[R], an authorized keys file (specify +location with \f[C]--authorized-keys\f[R] - the default is the same as +ssh), an \f[C]--auth-proxy\f[R], or set the \f[C]--no-auth\f[R] flag for +no authentication when logging in. +.PP +If you don\[aq]t supply a host \f[C]--key\f[R] then rclone will generate +rsa, ecdsa and ed25519 variants, and cache them for later use in +rclone\[aq]s cache directory (see \f[C]rclone help flags cache-dir\f[R]) +in the \[dq]serve-sftp\[dq] directory. +.PP +By default the server binds to localhost:2022 - if you want it to be +reachable externally then supply \f[C]--addr :2022\f[R] for example. +.PP +Note that the default of \f[C]--vfs-cache-mode off\f[R] is fine for the +rclone sftp backend, but it may not be with other SFTP clients. +.PP +If \f[C]--stdio\f[R] is specified, rclone will serve SFTP over stdio, +which can be used with sshd via \[ti]/.ssh/authorized_keys, for example: .IP .nf \f[C] -rclone settier Cool remote:path/file +restrict,command=\[dq]rclone serve sftp --stdio ./photos\[dq] ssh-rsa ... \f[R] .fi .PP -Or use rclone filters to set tier on only specific files +On the client you need to set \f[C]--transfers 1\f[R] when using +\f[C]--stdio\f[R]. +Otherwise multiple instances of the rclone server are started by OpenSSH +which can lead to \[dq]corrupted on transfer\[dq] errors. +This is the case because the client chooses indiscriminately which +server to send commands to while the servers all have different views of +the state of the filing system. +.PP +The \[dq]restrict\[dq] in authorized_keys prevents SHA1SUMs and MD5SUMs +from being used. +Omitting \[dq]restrict\[dq] and using \f[C]--sftp-path-override\f[R] to +enable checksumming is possible but less secure and you could use the +SFTP server provided by OpenSSH in this case. +.SS VFS - Virtual File System +.PP +This command uses the VFS layer. +This adapts the cloud storage objects that rclone uses into something +which looks much more like a disk filing system. +.PP +Cloud storage objects have lots of properties which aren\[aq]t like disk +files - you can\[aq]t extend them or write to the middle of them, so the +VFS layer has to deal with that. +Because there is no one right way of doing this there are various +options explained below. +.PP +The VFS layer also implements a directory cache - this caches info about +files and directories (but not the data) in memory. +.SS VFS Directory Cache +.PP +Using the \f[C]--dir-cache-time\f[R] flag, you can control how long a +directory should be considered up to date and not refreshed from the +backend. +Changes made through the VFS will appear immediately or invalidate the +cache. .IP .nf \f[C] -rclone --include \[dq]*.txt\[dq] settier Hot remote:path/dir +--dir-cache-time duration Time to cache directory entries for (default 5m0s) +--poll-interval duration Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable (default 1m0s) \f[R] .fi .PP -Or just provide remote directory and all files in directory will be -tiered +However, changes made directly on the cloud storage by the web interface +or a different copy of rclone will only be picked up once the directory +cache expires if the backend configured does not support polling for +changes. +If the backend supports polling, changes will be picked up within the +polling interval. +.PP +You can send a \f[C]SIGHUP\f[R] signal to rclone for it to flush all +directory caches, regardless of how old they are. +Assuming only one rclone instance is running, you can reset the cache +like this: .IP .nf \f[C] -rclone settier tier remote:path/dir +kill -SIGHUP $(pidof rclone) \f[R] .fi +.PP +If you configure rclone with a remote control then you can use rclone rc +to flush the whole directory cache: .IP .nf \f[C] -rclone settier tier remote:path [flags] +rclone rc vfs/forget \f[R] .fi -.SS Options +.PP +Or individual files or directories: .IP .nf \f[C] - -h, --help help for settier +rclone rc vfs/forget file=path/to/file dir=path/to/dir \f[R] .fi +.SS VFS File Buffering .PP -See the global flags page (https://rclone.org/flags/) for global options -not listed here. -.SH SEE ALSO -.IP \[bu] 2 -rclone (https://rclone.org/commands/rclone/) - Show help for rclone -commands, flags and backends. -.SH rclone test +The \f[C]--buffer-size\f[R] flag determines the amount of memory, that +will be used to buffer data in advance. .PP -Run a test command -.SS Synopsis +Each open file will try to keep the specified amount of data in memory +at all times. +The buffered data is bound to one open file and won\[aq]t be shared. .PP -Rclone test is used to run test commands. +This flag is a upper limit for the used memory per open file. +The buffer will only use memory for data that is downloaded but not not +yet read. +If the buffer is empty, only a small amount of memory will be used. .PP -Select which test command you want with the subcommand, eg -.IP -.nf -\f[C] -rclone test memory remote: -\f[R] -.fi +The maximum memory used by rclone for buffering can be up to +\f[C]--buffer-size * open files\f[R]. +.SS VFS File Caching .PP -Each subcommand has its own options which you can see in their help. +These flags control the VFS file caching options. +File caching is necessary to make the VFS layer appear compatible with a +normal file system. +It can be disabled at the cost of some compatibility. .PP -\f[B]NB\f[R] Be careful running these commands, they may do strange -things so reading their documentation first is recommended. -.SS Options +For example you\[aq]ll need to enable VFS caching if you want to read +and write simultaneously to a file. +See below for more details. +.PP +Note that the VFS cache is separate from the cache backend and you may +find that you need one or the other or both. .IP .nf \f[C] - -h, --help help for test +--cache-dir string Directory rclone will use for caching. +--vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) +--vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) +--vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) +--vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) +--vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) +--vfs-write-back duration Time to writeback files after last use when using cache (default 5s) \f[R] .fi .PP -See the global flags page (https://rclone.org/flags/) for global options -not listed here. -.SH SEE ALSO +If run with \f[C]-vv\f[R] rclone will print the location of the file +cache. +The files are stored in the user cache file area which is OS dependent +but can be controlled with \f[C]--cache-dir\f[R] or setting the +appropriate environment variable. +.PP +The cache has 4 different modes selected by \f[C]--vfs-cache-mode\f[R]. +The higher the cache mode the more compatible rclone becomes at the cost +of using disk space. +.PP +Note that files are written back to the remote only when they are closed +and if they haven\[aq]t been accessed for \f[C]--vfs-write-back\f[R] +seconds. +If rclone is quit or dies with files that haven\[aq]t been uploaded, +these will be uploaded next time rclone is run with the same flags. +.PP +If using \f[C]--vfs-cache-max-size\f[R] or +\f[C]--vfs-cache-min-free-size\f[R] note that the cache may exceed these +quotas for two reasons. +Firstly because it is only checked every +\f[C]--vfs-cache-poll-interval\f[R]. +Secondly because open files cannot be evicted from the cache. +When \f[C]--vfs-cache-max-size\f[R] or +\f[C]--vfs-cache-min-free-size\f[R] is exceeded, rclone will attempt to +evict the least accessed files from the cache first. +rclone will start with files that haven\[aq]t been accessed for the +longest. +This cache flushing strategy is efficient and more relevant files are +likely to remain cached. +.PP +The \f[C]--vfs-cache-max-age\f[R] will evict files from the cache after +the set time since last access has passed. +The default value of 1 hour will start evicting files from cache that +haven\[aq]t been accessed for 1 hour. +When a cached file is accessed the 1 hour timer is reset to 0 and will +wait for 1 more hour before evicting. +Specify the time with standard notation, s, m, h, d, w . +.PP +You \f[B]should not\f[R] run two copies of rclone using the same VFS +cache with the same or overlapping remotes if using +\f[C]--vfs-cache-mode > off\f[R]. +This can potentially cause data corruption if you do. +You can work around this by giving each rclone its own cache hierarchy +with \f[C]--cache-dir\f[R]. +You don\[aq]t need to worry about this if the remotes in use don\[aq]t +overlap. +.SS --vfs-cache-mode off +.PP +In this mode (the default) the cache will read directly from the remote +and write directly to the remote without caching anything on disk. +.PP +This will mean some operations are not possible .IP \[bu] 2 -rclone (https://rclone.org/commands/rclone/) - Show help for rclone -commands, flags and backends. +Files can\[aq]t be opened for both read AND write .IP \[bu] 2 -rclone test -changenotify (https://rclone.org/commands/rclone_test_changenotify/) - -Log any change notify requests for the remote passed in. +Files opened for write can\[aq]t be seeked .IP \[bu] 2 -rclone test -histogram (https://rclone.org/commands/rclone_test_histogram/) - Makes a -histogram of file name characters. +Existing files opened for write must have O_TRUNC set .IP \[bu] 2 -rclone test info (https://rclone.org/commands/rclone_test_info/) - -Discovers file name or other limitations for paths. +Files open for read with O_TRUNC will be opened write only .IP \[bu] 2 -rclone test makefile (https://rclone.org/commands/rclone_test_makefile/) -- Make files with random contents of the size given +Files open for write only will behave as if O_TRUNC was supplied .IP \[bu] 2 -rclone test -makefiles (https://rclone.org/commands/rclone_test_makefiles/) - Make a -random file hierarchy in a directory +Open modes O_APPEND, O_TRUNC are ignored .IP \[bu] 2 -rclone test memory (https://rclone.org/commands/rclone_test_memory/) - -Load all the objects at remote:path into memory and report memory stats. -.SH rclone test changenotify +If an upload fails it can\[aq]t be retried +.SS --vfs-cache-mode minimal .PP -Log any change notify requests for the remote passed in. +This is very similar to \[dq]off\[dq] except that files opened for read +AND write will be buffered to disk. +This means that files opened for write will be a lot more compatible, +but uses the minimal disk space. +.PP +These operations are not possible +.IP \[bu] 2 +Files opened for write only can\[aq]t be seeked +.IP \[bu] 2 +Existing files opened for write must have O_TRUNC set +.IP \[bu] 2 +Files opened for write only will ignore O_APPEND, O_TRUNC +.IP \[bu] 2 +If an upload fails it can\[aq]t be retried +.SS --vfs-cache-mode writes +.PP +In this mode files opened for read only are still read directly from the +remote, write only and read/write files are buffered to disk first. +.PP +This mode should support all normal file system operations. +.PP +If an upload fails it will be retried at exponentially increasing +intervals up to 1 minute. +.SS --vfs-cache-mode full +.PP +In this mode all reads and writes are buffered to and from disk. +When data is read from the remote this is buffered to disk as well. +.PP +In this mode the files in the cache will be sparse files and rclone will +keep track of which bits of the files it has downloaded. +.PP +So if an application only reads the starts of each file, then rclone +will only buffer the start of the file. +These files will appear to be their full size in the cache, but they +will be sparse files with only the data that has been downloaded present +in them. +.PP +This mode should support all normal file system operations and is +otherwise identical to \f[C]--vfs-cache-mode\f[R] writes. +.PP +When reading a file rclone will read \f[C]--buffer-size\f[R] plus +\f[C]--vfs-read-ahead\f[R] bytes ahead. +The \f[C]--buffer-size\f[R] is buffered in memory whereas the +\f[C]--vfs-read-ahead\f[R] is buffered on disk. +.PP +When using this mode it is recommended that \f[C]--buffer-size\f[R] is +not set too large and \f[C]--vfs-read-ahead\f[R] is set large if +required. +.PP +\f[B]IMPORTANT\f[R] not all file systems support sparse files. +In particular FAT/exFAT do not. +Rclone will perform very badly if the cache directory is on a filesystem +which doesn\[aq]t support sparse files and it will log an ERROR message +if one is detected. +.SS Fingerprinting +.PP +Various parts of the VFS use fingerprinting to see if a local file copy +has changed relative to a remote file. +Fingerprints are made from: +.IP \[bu] 2 +size +.IP \[bu] 2 +modification time +.IP \[bu] 2 +hash +.PP +where available on an object. +.PP +On some backends some of these attributes are slow to read (they take an +extra API call per object, or extra work per object). +.PP +For example \f[C]hash\f[R] is slow with the \f[C]local\f[R] and +\f[C]sftp\f[R] backends as they have to read the entire file and hash +it, and \f[C]modtime\f[R] is slow with the \f[C]s3\f[R], +\f[C]swift\f[R], \f[C]ftp\f[R] and \f[C]qinqstor\f[R] backends because +they need to do an extra API call to fetch it. +.PP +If you use the \f[C]--vfs-fast-fingerprint\f[R] flag then rclone will +not include the slow operations in the fingerprint. +This makes the fingerprinting less accurate but much faster and will +improve the opening time of cached files. +.PP +If you are running a vfs cache over \f[C]local\f[R], \f[C]s3\f[R] or +\f[C]swift\f[R] backends then using this flag is recommended. +.PP +Note that if you change the value of this flag, the fingerprints of the +files in the cache may be invalidated and the files will need to be +downloaded again. +.SS VFS Chunked Reading +.PP +When rclone reads files from a remote it reads them in chunks. +This means that rather than requesting the whole file rclone reads the +chunk specified. +This can reduce the used download quota for some remotes by requesting +only chunks from the remote that are actually read, at the cost of an +increased number of requests. +.PP +These flags control the chunking: .IP .nf \f[C] -rclone test changenotify remote: [flags] +--vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128M) +--vfs-read-chunk-size-limit SizeSuffix Max chunk doubling size (default off) \f[R] .fi -.SS Options +.PP +Rclone will start reading a chunk of size +\f[C]--vfs-read-chunk-size\f[R], and then double the size for each read. +When \f[C]--vfs-read-chunk-size-limit\f[R] is specified, and greater +than \f[C]--vfs-read-chunk-size\f[R], the chunk size for each open file +will get doubled only until the specified value is reached. +If the value is \[dq]off\[dq], which is the default, the limit is +disabled and the chunk size will grow indefinitely. +.PP +With \f[C]--vfs-read-chunk-size 100M\f[R] and +\f[C]--vfs-read-chunk-size-limit 0\f[R] the following parts will be +downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on. +When \f[C]--vfs-read-chunk-size-limit 500M\f[R] is specified, the result +would be 0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so +on. +.PP +Setting \f[C]--vfs-read-chunk-size\f[R] to \f[C]0\f[R] or \[dq]off\[dq] +disables chunked reading. +.SS VFS Performance +.PP +These flags may be used to enable/disable features of the VFS for +performance or other reasons. +See also the chunked reading feature. +.PP +In particular S3 and Swift benefit hugely from the +\f[C]--no-modtime\f[R] flag (or use \f[C]--use-server-modtime\f[R] for a +slightly different effect) as each read of the modification time takes a +transaction. .IP .nf \f[C] - -h, --help help for changenotify - --poll-interval Duration Time to wait between polling for changes (default 10s) +--no-checksum Don\[aq]t compare checksums on up/download. +--no-modtime Don\[aq]t read/write the modification time (can speed things up). +--no-seek Don\[aq]t allow seeking in files. +--read-only Only allow read-only access. \f[R] .fi .PP -See the global flags page (https://rclone.org/flags/) for global options -not listed here. -.SH SEE ALSO -.IP \[bu] 2 -rclone test (https://rclone.org/commands/rclone_test/) - Run a test -command -.SH rclone test histogram -.PP -Makes a histogram of file name characters. -.SS Synopsis -.PP -This command outputs JSON which shows the histogram of characters used -in filenames in the remote:path specified. -.PP -The data doesn\[aq]t contain any identifying information but is useful -for the rclone developers when developing filename compression. +Sometimes rclone is delivered reads or writes out of order. +Rather than seeking rclone will wait a short time for the in sequence +read or write to come in. +These flags only come into effect when not using an on disk cache file. .IP .nf \f[C] -rclone test histogram [remote:path] [flags] +--vfs-read-wait duration Time to wait for in-sequence read before seeking (default 20ms) +--vfs-write-wait duration Time to wait for in-sequence write before giving error (default 1s) \f[R] .fi -.SS Options +.PP +When using VFS write caching (\f[C]--vfs-cache-mode\f[R] with value +writes or full), the global flag \f[C]--transfers\f[R] can be set to +adjust the number of parallel uploads of modified files from the cache +(the related global flag \f[C]--checkers\f[R] has no effect on the VFS). .IP .nf \f[C] - -h, --help help for histogram +--transfers int Number of file transfers to run in parallel (default 4) \f[R] .fi +.SS VFS Case Sensitivity .PP -See the global flags page (https://rclone.org/flags/) for global options -not listed here. -.SH SEE ALSO -.IP \[bu] 2 -rclone test (https://rclone.org/commands/rclone_test/) - Run a test -command -.SH rclone test info +Linux file systems are case-sensitive: two files can differ only by +case, and the exact case must be used when opening a file. .PP -Discovers file name or other limitations for paths. -.SS Synopsis +File systems in modern Windows are case-insensitive but case-preserving: +although existing files can be opened using any case, the exact case +used to create the file is preserved and available for programs to +query. +It is not allowed for two files in the same directory to differ only by +case. .PP -rclone info discovers what filenames and upload methods are possible to -write to the paths passed in and how long they can be. -It can take some time. -It will write test files into the remote:path passed in. -It outputs a bit of go code for each one. +Usually file systems on macOS are case-insensitive. +It is possible to make macOS file systems case-sensitive but that is not +the default. .PP -\f[B]NB\f[R] this can create undeletable files and other hazards - use -with care -.IP -.nf -\f[C] -rclone test info [remote:path]+ [flags] -\f[R] -.fi -.SS Options -.IP -.nf -\f[C] - --all Run all tests - --check-base32768 Check can store all possible base32768 characters - --check-control Check control characters - --check-length Check max filename length - --check-normalization Check UTF-8 Normalization - --check-streaming Check uploads with indeterminate file size - -h, --help help for info - --upload-wait Duration Wait after writing a file (default 0s) - --write-json string Write results to file -\f[R] -.fi +The \f[C]--vfs-case-insensitive\f[R] VFS flag controls how rclone +handles these two cases. +If its value is \[dq]false\[dq], rclone passes file names to the remote +as-is. +If the flag is \[dq]true\[dq] (or appears without a value on the command +line), rclone may perform a \[dq]fixup\[dq] as explained below. .PP -See the global flags page (https://rclone.org/flags/) for global options -not listed here. -.SH SEE ALSO -.IP \[bu] 2 -rclone test (https://rclone.org/commands/rclone_test/) - Run a test -command -.SH rclone test makefile +The user may specify a file name to open/delete/rename/etc with a case +different than what is stored on the remote. +If an argument refers to an existing file with exactly the same name, +then the case of the existing file on the disk will be used. +However, if a file name with exactly the same name is not found but a +name differing only by case exists, rclone will transparently fixup the +name. +This fixup happens only when an existing file is requested. +Case sensitivity of file names created anew by rclone is controlled by +the underlying remote. .PP -Make files with random contents of the size given -.IP -.nf -\f[C] -rclone test makefile []+ [flags] -\f[R] -.fi -.SS Options -.IP -.nf -\f[C] - --ascii Fill files with random ASCII printable bytes only - --chargen Fill files with a ASCII chargen pattern - -h, --help help for makefile - --pattern Fill files with a periodic pattern - --seed int Seed for the random number generator (0 for random) (default 1) - --sparse Make the files sparse (appear to be filled with ASCII 0x00) - --zero Fill files with ASCII 0x00 -\f[R] -.fi +Note that case sensitivity of the operating system running rclone (the +target) may differ from case sensitivity of a file system presented by +rclone (the source). +The flag controls whether \[dq]fixup\[dq] is performed to satisfy the +target. .PP -See the global flags page (https://rclone.org/flags/) for global options -not listed here. -.SH SEE ALSO -.IP \[bu] 2 -rclone test (https://rclone.org/commands/rclone_test/) - Run a test -command -.SH rclone test makefiles +If the flag is not provided on the command line, then its default value +depends on the operating system where rclone runs: \[dq]true\[dq] on +Windows and macOS, \[dq]false\[dq] otherwise. +If the flag is provided without a value, then it is \[dq]true\[dq]. +.SS VFS Disk Options .PP -Make a random file hierarchy in a directory -.IP -.nf -\f[C] -rclone test makefiles [flags] -\f[R] -.fi -.SS Options +This flag allows you to manually set the statistics about the filing +system. +It can be useful when those statistics cannot be read correctly +automatically. .IP .nf \f[C] - --ascii Fill files with random ASCII printable bytes only - --chargen Fill files with a ASCII chargen pattern - --files int Number of files to create (default 1000) - --files-per-directory int Average number of files per directory (default 10) - -h, --help help for makefiles - --max-depth int Maximum depth of directory hierarchy (default 10) - --max-file-size SizeSuffix Maximum size of files to create (default 100) - --max-name-length int Maximum size of file names (default 12) - --min-file-size SizeSuffix Minimum size of file to create - --min-name-length int Minimum size of file names (default 4) - --pattern Fill files with a periodic pattern - --seed int Seed for the random number generator (0 for random) (default 1) - --sparse Make the files sparse (appear to be filled with ASCII 0x00) - --zero Fill files with ASCII 0x00 +--vfs-disk-space-total-size Manually set the total disk space size (example: 256G, default: -1) \f[R] .fi +.SS Alternate report of used bytes .PP -See the global flags page (https://rclone.org/flags/) for global options -not listed here. -.SH SEE ALSO -.IP \[bu] 2 -rclone test (https://rclone.org/commands/rclone_test/) - Run a test -command -.SH rclone test memory -.PP -Load all the objects at remote:path into memory and report memory stats. -.IP -.nf -\f[C] -rclone test memory remote:path [flags] -\f[R] -.fi -.SS Options -.IP -.nf -\f[C] - -h, --help help for memory -\f[R] -.fi +Some backends, most notably S3, do not report the amount of bytes used. +If you need this information to be available when running \f[C]df\f[R] +on the filesystem, then pass the flag \f[C]--vfs-used-is-size\f[R] to +rclone. +With this flag set, instead of relying on the backend to report this +information, rclone will scan the whole remote similar to +\f[C]rclone size\f[R] and compute the total used space itself. .PP -See the global flags page (https://rclone.org/flags/) for global options -not listed here. -.SH SEE ALSO -.IP \[bu] 2 -rclone test (https://rclone.org/commands/rclone_test/) - Run a test -command -.SH rclone touch +\f[I]WARNING.\f[R] Contrary to \f[C]rclone size\f[R], this flag ignores +filters so that the result is accurate. +However, this is very inefficient and may cost lots of API calls +resulting in extra charges. +Use it as a last resort and only with caching. +.SS Auth Proxy .PP -Create new file or change file modification time. -.SS Synopsis +If you supply the parameter \f[C]--auth-proxy /path/to/program\f[R] then +rclone will use that program to generate backends on the fly which then +are used to authenticate incoming requests. +This uses a simple JSON based protocol with input on STDIN and output on +STDOUT. .PP -Set the modification time on file(s) as specified by remote:path to have -the current time. +\f[B]PLEASE NOTE:\f[R] \f[C]--auth-proxy\f[R] and +\f[C]--authorized-keys\f[R] cannot be used together, if +\f[C]--auth-proxy\f[R] is set the authorized keys option will be +ignored. .PP -If remote:path does not exist then a zero sized file will be created, -unless \f[C]--no-create\f[R] or \f[C]--recursive\f[R] is provided. +There is an example program +bin/test_proxy.py (https://github.com/rclone/rclone/blob/master/test_proxy.py) +in the rclone source code. .PP -If \f[C]--recursive\f[R] is used then recursively sets the modification -time on all existing files that is found under the path. -Filters are supported, and you can test with the \f[C]--dry-run\f[R] or -the \f[C]--interactive\f[R]/\f[C]-i\f[R] flag. +The program\[aq]s job is to take a \f[C]user\f[R] and \f[C]pass\f[R] on +the input and turn those into the config for a backend on STDOUT in JSON +format. +This config will have any default parameters for the backend added, but +it won\[aq]t use configuration from environment variables or command +line options - it is the job of the proxy program to make a complete +config. .PP -If \f[C]--timestamp\f[R] is used then sets the modification time to that -time instead of the current time. -Times may be specified as one of: -.IP \[bu] 2 -\[aq]YYMMDD\[aq] - e.g. -17.10.30 -.IP \[bu] 2 -\[aq]YYYY-MM-DDTHH:MM:SS\[aq] - e.g. -2006-01-02T15:04:05 -.IP \[bu] 2 -\[aq]YYYY-MM-DDTHH:MM:SS.SSS\[aq] - e.g. -2006-01-02T15:04:05.123456789 +This config generated must have this extra parameter - \f[C]_root\f[R] - +root to use for the backend .PP -Note that value of \f[C]--timestamp\f[R] is in UTC. -If you want local time then add the \f[C]--localtime\f[R] flag. -.IP -.nf -\f[C] -rclone touch remote:path [flags] -\f[R] -.fi -.SS Options -.IP -.nf -\f[C] - -h, --help help for touch - --localtime Use localtime for timestamp, not UTC - -C, --no-create Do not create the file if it does not exist (implied with --recursive) - -R, --recursive Recursively touch all files - -t, --timestamp string Use specified time instead of the current time of day -\f[R] -.fi -.SS Important Options +And it may have this parameter - \f[C]_obscure\f[R] - comma separated +strings for parameters to obscure .PP -Important flags useful for most commands. +If password authentication was used by the client, input to the proxy +process (on STDIN) would look similar to this: .IP .nf \f[C] - -n, --dry-run Do a trial run with no permanent changes - -i, --interactive Enable interactive mode - -v, --verbose count Print lots more stuff (repeat for more) +{ + \[dq]user\[dq]: \[dq]me\[dq], + \[dq]pass\[dq]: \[dq]mypassword\[dq] +} \f[R] .fi -.SS Filter Options .PP -Flags for filtering directory listings. +If public-key authentication was used by the client, input to the proxy +process (on STDIN) would look similar to this: .IP .nf \f[C] - --delete-excluded Delete files on dest excluded from sync - --exclude stringArray Exclude files matching pattern - --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) - --exclude-if-present stringArray Exclude directories if filename is present - --files-from stringArray Read list of source-file names from file (use - to read from stdin) - --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) - -f, --filter stringArray Add a file filtering rule - --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) - --ignore-case Ignore case in filters (case insensitive) - --include stringArray Include files matching pattern - --include-from stringArray Read file include patterns from file (use - to read from stdin) - --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) - --max-depth int If set limits the recursion depth to this (default -1) - --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) - --metadata-exclude stringArray Exclude metadatas matching pattern - --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) - --metadata-filter stringArray Add a metadata filtering rule - --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) - --metadata-include stringArray Include metadatas matching pattern - --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) - --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) - --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +{ + \[dq]user\[dq]: \[dq]me\[dq], + \[dq]public_key\[dq]: \[dq]AAAAB3NzaC1yc2EAAAADAQABAAABAQDuwESFdAe14hVS6omeyX7edc...JQdf\[dq] +} \f[R] .fi -.SS Listing Options .PP -Flags for listing directories. +And as an example return this on STDOUT .IP .nf \f[C] - --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) - --fast-list Use recursive list if available; uses more memory but fewer transactions +{ + \[dq]type\[dq]: \[dq]sftp\[dq], + \[dq]_root\[dq]: \[dq]\[dq], + \[dq]_obscure\[dq]: \[dq]pass\[dq], + \[dq]user\[dq]: \[dq]me\[dq], + \[dq]pass\[dq]: \[dq]mypassword\[dq], + \[dq]host\[dq]: \[dq]sftp.example.com\[dq] +} \f[R] .fi .PP -See the global flags page (https://rclone.org/flags/) for global options -not listed here. -.SH SEE ALSO -.IP \[bu] 2 -rclone (https://rclone.org/commands/rclone/) - Show help for rclone -commands, flags and backends. -.SH rclone tree -.PP -List the contents of the remote in a tree like fashion. -.SS Synopsis -.PP -rclone tree lists the contents of a remote in a similar way to the unix -tree command. -.PP -For example -.IP -.nf -\f[C] -$ rclone tree remote:path -/ -\[u251C]\[u2500]\[u2500] file1 -\[u251C]\[u2500]\[u2500] file2 -\[u251C]\[u2500]\[u2500] file3 -\[u2514]\[u2500]\[u2500] subdir - \[u251C]\[u2500]\[u2500] file4 - \[u2514]\[u2500]\[u2500] file5 - -1 directories, 5 files -\f[R] -.fi +This would mean that an SFTP backend would be created on the fly for the +\f[C]user\f[R] and \f[C]pass\f[R]/\f[C]public_key\f[R] returned in the +output to the host given. +Note that since \f[C]_obscure\f[R] is set to \f[C]pass\f[R], rclone will +obscure the \f[C]pass\f[R] parameter before creating the backend (which +is required for sftp backends). .PP -You can use any of the filtering options with the tree command (e.g. -\f[C]--include\f[R] and \f[C]--exclude\f[R]. -You can also use \f[C]--fast-list\f[R]. +The program can manipulate the supplied \f[C]user\f[R] in any way, for +example to make proxy to many different sftp backends, you could make +the \f[C]user\f[R] be \f[C]user\[at]example.com\f[R] and then set the +\f[C]host\f[R] to \f[C]example.com\f[R] in the output and the user to +\f[C]user\f[R]. +For security you\[aq]d probably want to restrict the \f[C]host\f[R] to a +limited list. .PP -The tree command has many options for controlling the listing which are -compatible with the tree command, for example you can include file sizes -with \f[C]--size\f[R]. -Note that not all of them have short options as they conflict with -rclone\[aq]s short options. +Note that an internal cache is keyed on \f[C]user\f[R] so only use that +for configuration, don\[aq]t use \f[C]pass\f[R] or \f[C]public_key\f[R]. +This also means that if a user\[aq]s password or public-key is changed +the cache will need to expire (which takes 5 mins) before it takes +effect. .PP -For a more interactive navigation of the remote see the -ncdu (https://rclone.org/commands/rclone_ncdu/) command. +This can be used to build general purpose proxies to any kind of backend +that rclone supports. .IP .nf \f[C] -rclone tree remote:path [flags] +rclone serve sftp remote:path [flags] \f[R] .fi .SS Options .IP .nf \f[C] - -a, --all All files are listed (list . files too) - -d, --dirs-only List directories only - --dirsfirst List directories before files (-U disables) - --full-path Print the full path prefix for each file - -h, --help help for tree - --level int Descend only level directories deep - -D, --modtime Print the date of last modification. - --noindent Don\[aq]t print indentation lines - --noreport Turn off file/directory count at end of tree listing - -o, --output string Output to file instead of stdout - -p, --protections Print the protections for each file. - -Q, --quote Quote filenames with double quotes. - -s, --size Print the size in bytes of each file. - --sort string Select sort: name,version,size,mtime,ctime - --sort-ctime Sort files by last status change time - -t, --sort-modtime Sort files by last modification time - -r, --sort-reverse Reverse the order of the sort - -U, --unsorted Leave files unsorted - --version Sort files alphanumerically by version + --addr string IPaddress:Port or :Port to bind server to (default \[dq]localhost:2022\[dq]) + --auth-proxy string A program to use to create the backend from the auth + --authorized-keys string Authorized keys file (default \[dq]\[ti]/.ssh/authorized_keys\[dq]) + --dir-cache-time Duration Time to cache directory entries for (default 5m0s) + --dir-perms FileMode Directory permissions (default 0777) + --file-perms FileMode File permissions (default 0666) + --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) + -h, --help help for sftp + --key stringArray SSH private host key file (Can be multi-valued, leave blank to auto generate) + --no-auth Allow connections with no authentication if set + --no-checksum Don\[aq]t compare checksums on up/download + --no-modtime Don\[aq]t read/write the modification time (can speed things up) + --no-seek Don\[aq]t allow seeking in files + --pass string Password for authentication + --poll-interval Duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s) + --read-only Only allow read-only access + --stdio Run an sftp server on stdin/stdout + --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) + --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) + --user string User name for authentication + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-case-insensitive If a file name not found, find a case insensitive match + --vfs-disk-space-total-size SizeSuffix Specify the total space of disk (default off) + --vfs-fast-fingerprint Use fast (less accurate) fingerprints for change detection + --vfs-read-ahead SizeSuffix Extra read ahead over --buffer-size when using cache-mode full + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) + --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached (\[aq]off\[aq] is unlimited) (default off) + --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start + --vfs-used-is-size rclone size Use the rclone size algorithm for Used size + --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) + --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) \f[R] .fi .SS Filter Options @@ -12717,18162 +12773,16947 @@ Flags for filtering directory listings. --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) \f[R] .fi -.SS Listing Options -.PP -Flags for listing directories. -.IP -.nf -\f[C] - --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) - --fast-list Use recursive list if available; uses more memory but fewer transactions -\f[R] -.fi .PP See the global flags page (https://rclone.org/flags/) for global options not listed here. .SH SEE ALSO .IP \[bu] 2 -rclone (https://rclone.org/commands/rclone/) - Show help for rclone -commands, flags and backends. -.SS Copying single files +rclone serve (https://rclone.org/commands/rclone_serve/) - Serve a +remote over a protocol. +.SH rclone serve webdav .PP -rclone normally syncs or copies directories. -However, if the source remote points to a file, rclone will just copy -that file. -The destination remote must point to a directory - rclone will give the -error -\f[C]Failed to create file system for \[dq]remote:file\[dq]: is a file not a directory\f[R] -if it isn\[aq]t. +Serve remote:path over WebDAV. +.SS Synopsis .PP -For example, suppose you have a remote with a file in called -\f[C]test.jpg\f[R], then you could copy just that file like this -.IP -.nf -\f[C] -rclone copy remote:test.jpg /tmp/download -\f[R] -.fi +Run a basic WebDAV server to serve a remote over HTTP via the WebDAV +protocol. +This can be viewed with a WebDAV client, through a web browser, or you +can make a remote of type WebDAV to read and write it. +.SS WebDAV options +.SS --etag-hash .PP -The file \f[C]test.jpg\f[R] will be placed inside -\f[C]/tmp/download\f[R]. +This controls the ETag header. +Without this flag the ETag will be based on the ModTime and Size of the +object. .PP -This is equivalent to specifying -.IP -.nf -\f[C] -rclone copy --files-from /tmp/files remote: /tmp/download -\f[R] -.fi +If this flag is set to \[dq]auto\[dq] then rclone will choose the first +supported hash on the backend or you can use a named hash such as +\[dq]MD5\[dq] or \[dq]SHA-1\[dq]. +Use the hashsum (https://rclone.org/commands/rclone_hashsum/) command to +see the full list. +.SS Access WebDAV on Windows .PP -Where \f[C]/tmp/files\f[R] contains the single line -.IP -.nf -\f[C] -test.jpg -\f[R] -.fi +WebDAV shared folder can be mapped as a drive on Windows, however the +default settings prevent it. +Windows will fail to connect to the server using insecure Basic +authentication. +It will not even display any login dialog. +Windows requires SSL / HTTPS connection to be used with Basic. +If you try to connect via Add Network Location Wizard you will get the +following error: \[dq]The folder you entered does not appear to be +valid. +Please choose another\[dq]. +However, you still can connect if you set the following registry key on +a client machine: HKEY_LOCAL_MACHINEto 2. +The BasicAuthLevel can be set to the following values: 0 - Basic +authentication disabled 1 - Basic authentication enabled for SSL +connections only 2 - Basic authentication enabled for SSL connections +and for non-SSL connections If required, increase the +FileSizeLimitInBytes to a higher value. +Navigate to the Services interface, then restart the WebClient service. +.SS Access Office applications on WebDAV .PP -It is recommended to use \f[C]copy\f[R] when copying individual files, -not \f[C]sync\f[R]. -They have pretty much the same effect but \f[C]copy\f[R] will use a lot -less memory. -.SS Syntax of remote paths +Navigate to following registry HKEY_CURRENT_USER[14.0/15.0/16.0] Create +a new DWORD BasicAuthLevel with value 2. +0 - Basic authentication disabled 1 - Basic authentication enabled for +SSL connections only 2 - Basic authentication enabled for SSL and for +non-SSL connections .PP -The syntax of the paths passed to the rclone command are as follows. -.SS /path/to/dir +https://learn.microsoft.com/en-us/office/troubleshoot/powerpoint/office-opens-blank-from-sharepoint +.SS Server options .PP -This refers to the local file system. +Use \f[C]--addr\f[R] to specify which IP address and port the server +should listen on, eg \f[C]--addr 1.2.3.4:8000\f[R] or +\f[C]--addr :8080\f[R] to listen to all IPs. +By default it only listens on localhost. +You can use port :0 to let the OS choose an available port. .PP -On Windows \f[C]\[rs]\f[R] may be used instead of \f[C]/\f[R] in local -paths \f[B]only\f[R], non local paths must use \f[C]/\f[R]. -See local filesystem (https://rclone.org/local/#paths-on-windows) -documentation for more about Windows-specific paths. +If you set \f[C]--addr\f[R] to listen on a public or LAN accessible IP +address then using Authentication is advised - see the next section for +info. .PP -These paths needn\[aq]t start with a leading \f[C]/\f[R] - if they -don\[aq]t then they will be relative to the current directory. -.SS remote:path/to/dir +You can use a unix socket by setting the url to +\f[C]unix:///path/to/socket\f[R] or just by using an absolute path name. +Note that unix sockets bypass the authentication - this is expected to +be done with file system permissions. .PP -This refers to a directory \f[C]path/to/dir\f[R] on \f[C]remote:\f[R] as -defined in the config file (configured with \f[C]rclone config\f[R]). -.SS remote:/path/to/dir +\f[C]--addr\f[R] may be repeated to listen on multiple +IPs/ports/sockets. .PP -On most backends this is refers to the same directory as -\f[C]remote:path/to/dir\f[R] and that format should be preferred. -On a very small number of remotes (FTP, SFTP, Dropbox for business) this -will refer to a different directory. -On these, paths without a leading \f[C]/\f[R] will refer to your -\[dq]home\[dq] directory and paths with a leading \f[C]/\f[R] will refer -to the root. -.SS :backend:path/to/dir +\f[C]--server-read-timeout\f[R] and \f[C]--server-write-timeout\f[R] can +be used to control the timeouts on the server. +Note that this is the total time for a transfer. .PP -This is an advanced form for creating remotes on the fly. -\f[C]backend\f[R] should be the name or prefix of a backend (the -\f[C]type\f[R] in the config file) and all the configuration for the -backend should be provided on the command line (or in environment -variables). +\f[C]--max-header-bytes\f[R] controls the maximum number of bytes the +server will accept in the HTTP header. .PP -Here are some examples: -.IP -.nf -\f[C] -rclone lsd --http-url https://pub.rclone.org :http: -\f[R] -.fi +\f[C]--baseurl\f[R] controls the URL prefix that rclone serves from. +By default rclone will serve from the root. +If you used \f[C]--baseurl \[dq]/rclone\[dq]\f[R] then rclone would +serve from a URL starting with \[dq]/rclone/\[dq]. +This is useful if you wish to proxy rclone serve. +Rclone automatically inserts leading and trailing \[dq]/\[dq] on +\f[C]--baseurl\f[R], so \f[C]--baseurl \[dq]rclone\[dq]\f[R], +\f[C]--baseurl \[dq]/rclone\[dq]\f[R] and +\f[C]--baseurl \[dq]/rclone/\[dq]\f[R] are all treated identically. +.SS TLS (SSL) .PP -To list all the directories in the root of -\f[C]https://pub.rclone.org/\f[R]. -.IP -.nf -\f[C] -rclone lsf --http-url https://example.com :http:path/to/dir -\f[R] -.fi +By default this will serve over http. +If you want you can serve over https. +You will need to supply the \f[C]--cert\f[R] and \f[C]--key\f[R] flags. +If you wish to do client side certificate validation then you will need +to supply \f[C]--client-ca\f[R] also. .PP -To list files and directories in -\f[C]https://example.com/path/to/dir/\f[R] -.IP -.nf -\f[C] -rclone copy --http-url https://example.com :http:path/to/dir /tmp/dir -\f[R] -.fi +\f[C]--cert\f[R] should be a either a PEM encoded certificate or a +concatenation of that with the CA certificate. +\f[C]--key\f[R] should be the PEM encoded private key and +\f[C]--client-ca\f[R] should be the PEM encoded client certificate +authority certificate. .PP -To copy files and directories in -\f[C]https://example.com/path/to/dir\f[R] to \f[C]/tmp/dir\f[R]. -.IP -.nf -\f[C] -rclone copy --sftp-host example.com :sftp:path/to/dir /tmp/dir -\f[R] -.fi +--min-tls-version is minimum TLS version that is acceptable. +Valid values are \[dq]tls1.0\[dq], \[dq]tls1.1\[dq], \[dq]tls1.2\[dq] +and \[dq]tls1.3\[dq] (default \[dq]tls1.0\[dq]). +.SS Template .PP -To copy files and directories from \f[C]example.com\f[R] in the relative -directory \f[C]path/to/dir\f[R] to \f[C]/tmp/dir\f[R] using sftp. -.SS Connection strings +\f[C]--template\f[R] allows a user to specify a custom markup template +for HTTP and WebDAV serve functions. +The server exports the following markup to be used within the template +to server pages: .PP -The above examples can also be written using a connection string syntax, -so instead of providing the arguments as command line parameters -\f[C]--http-url https://pub.rclone.org\f[R] they are provided as part of -the remote specification as a kind of connection string. -.IP -.nf -\f[C] -rclone lsd \[dq]:http,url=\[aq]https://pub.rclone.org\[aq]:\[dq] -rclone lsf \[dq]:http,url=\[aq]https://example.com\[aq]:path/to/dir\[dq] -rclone copy \[dq]:http,url=\[aq]https://example.com\[aq]:path/to/dir\[dq] /tmp/dir -rclone copy :sftp,host=example.com:path/to/dir /tmp/dir -\f[R] -.fi +.TS +tab(@); +lw(35.0n) lw(35.0n). +T{ +Parameter +T}@T{ +Description +T} +_ +T{ +\&.Name +T}@T{ +The full path of a file/directory. +T} +T{ +\&.Title +T}@T{ +Directory listing of .Name +T} +T{ +\&.Sort +T}@T{ +The current sort used. +This is changeable via ?sort= parameter +T} +T{ +T}@T{ +Sort Options: namedirfirst,name,size,time (default namedirfirst) +T} +T{ +\&.Order +T}@T{ +The current ordering used. +This is changeable via ?order= parameter +T} +T{ +T}@T{ +Order Options: asc,desc (default asc) +T} +T{ +\&.Query +T}@T{ +Currently unused. +T} +T{ +\&.Breadcrumb +T}@T{ +Allows for creating a relative navigation +T} +T{ +-- .Link +T}@T{ +The relative to the root link of the Text. +T} +T{ +-- .Text +T}@T{ +The Name of the directory. +T} +T{ +\&.Entries +T}@T{ +Information about a specific file/directory. +T} +T{ +-- .URL +T}@T{ +The \[aq]url\[aq] of an entry. +T} +T{ +-- .Leaf +T}@T{ +Currently same as \[aq]URL\[aq] but intended to be \[aq]just\[aq] the +name. +T} +T{ +-- .IsDir +T}@T{ +Boolean for if an entry is a directory or not. +T} +T{ +-- .Size +T}@T{ +Size in Bytes of the entry. +T} +T{ +-- .ModTime +T}@T{ +The UTC timestamp of an entry. +T} +.TE .PP -These can apply to modify existing remotes as well as create new remotes -with the on the fly syntax. -This example is equivalent to adding the -\f[C]--drive-shared-with-me\f[R] parameter to the remote -\f[C]gdrive:\f[R]. -.IP -.nf -\f[C] -rclone lsf \[dq]gdrive,shared_with_me:path/to/dir\[dq] -\f[R] -.fi +The server also makes the following functions available so that they can +be used within the template. +These functions help extend the options for dynamic rendering of HTML. +They can be used to render HTML based on specific conditions. .PP -The major advantage to using the connection string style syntax is that -it only applies to the remote, not to all the remotes of that type of -the command line. -A common confusion is this attempt to copy a file shared on google drive -to the normal drive which \f[B]does not work\f[R] because the -\f[C]--drive-shared-with-me\f[R] flag applies to both the source and the -destination. -.IP -.nf -\f[C] -rclone copy --drive-shared-with-me gdrive:shared-file.txt gdrive: -\f[R] -.fi +.TS +tab(@); +lw(35.0n) lw(35.0n). +T{ +Function +T}@T{ +Description +T} +_ +T{ +afterEpoch +T}@T{ +Returns the time since the epoch for the given time. +T} +T{ +contains +T}@T{ +Checks whether a given substring is present or not in a given string. +T} +T{ +hasPrefix +T}@T{ +Checks whether the given string begins with the specified prefix. +T} +T{ +hasSuffix +T}@T{ +Checks whether the given string end with the specified suffix. +T} +.TE +.SS Authentication .PP -However using the connection string syntax, this does work. -.IP -.nf -\f[C] -rclone copy \[dq]gdrive,shared_with_me:shared-file.txt\[dq] gdrive: -\f[R] -.fi +By default this will serve files without needing a login. .PP -Note that the connection string only affects the options of the -immediate backend. -If for example gdriveCrypt is a crypt based on gdrive, then the -following command \f[B]will not work\f[R] as intended, because -\f[C]shared_with_me\f[R] is ignored by the crypt backend: -.IP -.nf -\f[C] -rclone copy \[dq]gdriveCrypt,shared_with_me:shared-file.txt\[dq] gdriveCrypt: -\f[R] -.fi +You can either use an htpasswd file which can take lots of users, or set +a single username and password with the \f[C]--user\f[R] and +\f[C]--pass\f[R] flags. .PP -The connection strings have the following syntax -.IP -.nf -\f[C] -remote,parameter=value,parameter2=value2:path/to/dir -:backend,parameter=value,parameter2=value2:path/to/dir -\f[R] -.fi +If no static users are configured by either of the above methods, and +client certificates are required by the \f[C]--client-ca\f[R] flag +passed to the server, the client certificate common name will be +considered as the username. .PP -If the \f[C]parameter\f[R] has a \f[C]:\f[R] or \f[C],\f[R] then it must -be placed in quotes \f[C]\[dq]\f[R] or \f[C]\[aq]\f[R], so -.IP -.nf -\f[C] -remote,parameter=\[dq]colon:value\[dq],parameter2=\[dq]comma,value\[dq]:path/to/dir -:backend,parameter=\[aq]colon:value\[aq],parameter2=\[aq]comma,value\[aq]:path/to/dir -\f[R] -.fi +Use \f[C]--htpasswd /path/to/htpasswd\f[R] to provide an htpasswd file. +This is in standard apache format and supports MD5, SHA1 and BCrypt for +basic authentication. +Bcrypt is recommended. .PP -If a quoted value needs to include that quote, then it should be -doubled, so +To create an htpasswd file: .IP .nf \f[C] -remote,parameter=\[dq]with\[dq]\[dq]quote\[dq],parameter2=\[aq]with\[aq]\[aq]quote\[aq]:path/to/dir +touch htpasswd +htpasswd -B htpasswd user +htpasswd -B htpasswd anotherUser \f[R] .fi .PP -This will make \f[C]parameter\f[R] be \f[C]with\[dq]quote\f[R] and -\f[C]parameter2\f[R] be \f[C]with\[aq]quote\f[R]. +The password file can be updated while rclone is running. .PP -If you leave off the \f[C]=parameter\f[R] then rclone will substitute -\f[C]=true\f[R] which works very well with flags. -For example, to use s3 configured in the environment you could use: -.IP -.nf -\f[C] -rclone lsd :s3,env_auth: -\f[R] -.fi +Use \f[C]--realm\f[R] to set the authentication realm. .PP -Which is equivalent to -.IP -.nf -\f[C] -rclone lsd :s3,env_auth=true: -\f[R] -.fi +Use \f[C]--salt\f[R] to change the password hashing salt from the +default. +## VFS - Virtual File System .PP -Note that on the command line you might need to surround these -connection strings with \f[C]\[dq]\f[R] or \f[C]\[aq]\f[R] to stop the -shell interpreting any special characters within them. +This command uses the VFS layer. +This adapts the cloud storage objects that rclone uses into something +which looks much more like a disk filing system. .PP -If you are a shell master then you\[aq]ll know which strings are OK and -which aren\[aq]t, but if you aren\[aq]t sure then enclose them in -\f[C]\[dq]\f[R] and use \f[C]\[aq]\f[R] as the inside quote. -This syntax works on all OSes. -.IP -.nf -\f[C] -rclone copy \[dq]:http,url=\[aq]https://example.com\[aq]:path/to/dir\[dq] /tmp/dir -\f[R] -.fi +Cloud storage objects have lots of properties which aren\[aq]t like disk +files - you can\[aq]t extend them or write to the middle of them, so the +VFS layer has to deal with that. +Because there is no one right way of doing this there are various +options explained below. .PP -On Linux/macOS some characters are still interpreted inside -\f[C]\[dq]\f[R] strings in the shell (notably \f[C]\[rs]\f[R] and -\f[C]$\f[R] and \f[C]\[dq]\f[R]) so if your strings contain those you -can swap the roles of \f[C]\[dq]\f[R] and \f[C]\[aq]\f[R] thus. -(This syntax does not work on Windows.) -.IP -.nf -\f[C] -rclone copy \[aq]:http,url=\[dq]https://example.com\[dq]:path/to/dir\[aq] /tmp/dir -\f[R] -.fi -.SS Connection strings, config and logging +The VFS layer also implements a directory cache - this caches info about +files and directories (but not the data) in memory. +.SS VFS Directory Cache .PP -If you supply extra configuration to a backend by command line flag, -environment variable or connection string then rclone will add a suffix -based on the hash of the config to the name of the remote, eg +Using the \f[C]--dir-cache-time\f[R] flag, you can control how long a +directory should be considered up to date and not refreshed from the +backend. +Changes made through the VFS will appear immediately or invalidate the +cache. .IP .nf \f[C] -rclone -vv lsf --s3-chunk-size 20M s3: +--dir-cache-time duration Time to cache directory entries for (default 5m0s) +--poll-interval duration Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable (default 1m0s) \f[R] .fi .PP -Has the log message +However, changes made directly on the cloud storage by the web interface +or a different copy of rclone will only be picked up once the directory +cache expires if the backend configured does not support polling for +changes. +If the backend supports polling, changes will be picked up within the +polling interval. +.PP +You can send a \f[C]SIGHUP\f[R] signal to rclone for it to flush all +directory caches, regardless of how old they are. +Assuming only one rclone instance is running, you can reset the cache +like this: .IP .nf \f[C] -DEBUG : s3: detected overridden config - adding \[dq]{Srj1p}\[dq] suffix to name +kill -SIGHUP $(pidof rclone) \f[R] .fi .PP -This is so rclone can tell the modified remote apart from the unmodified -remote when caching the backends. -.PP -This should only be noticeable in the logs. -.PP -This means that on the fly backends such as +If you configure rclone with a remote control then you can use rclone rc +to flush the whole directory cache: .IP .nf \f[C] -rclone -vv lsf :s3,env_auth: +rclone rc vfs/forget \f[R] .fi .PP -Will get their own names +Or individual files or directories: .IP .nf \f[C] -DEBUG : :s3: detected overridden config - adding \[dq]{YTu53}\[dq] suffix to name +rclone rc vfs/forget file=path/to/file dir=path/to/dir \f[R] .fi -.SS Valid remote names +.SS VFS File Buffering .PP -Remote names are case sensitive, and must adhere to the following rules: -- May contain number, letter, \f[C]_\f[R], \f[C]-\f[R], \f[C].\f[R], -\f[C]+\f[R], \f[C]\[at]\f[R] and space. -- May not start with \f[C]-\f[R] or space. -- May not end with space. +The \f[C]--buffer-size\f[R] flag determines the amount of memory, that +will be used to buffer data in advance. .PP -Starting with rclone version 1.61, any Unicode numbers and letters are -allowed, while in older versions it was limited to plain ASCII (0-9, -A-Z, a-z). -If you use the same rclone configuration from different shells, which -may be configured with different character encoding, you must be -cautious to use characters that are possible to write in all of them. -This is mostly a problem on Windows, where the console traditionally -uses a non-Unicode character set - defined by the so-called \[dq]code -page\[dq]. +Each open file will try to keep the specified amount of data in memory +at all times. +The buffered data is bound to one open file and won\[aq]t be shared. .PP -Do not use single character names on Windows as it creates ambiguity -with Windows drives\[aq] names, e.g.: remote called \f[C]C\f[R] is -indistinguishable from \f[C]C\f[R] drive. -Rclone will always assume that single letter name refers to a drive. -.SS Quoting and the shell +This flag is a upper limit for the used memory per open file. +The buffer will only use memory for data that is downloaded but not not +yet read. +If the buffer is empty, only a small amount of memory will be used. .PP -When you are typing commands to your computer you are using something -called the command line shell. -This interprets various characters in an OS specific way. +The maximum memory used by rclone for buffering can be up to +\f[C]--buffer-size * open files\f[R]. +.SS VFS File Caching .PP -Here are some gotchas which may help users unfamiliar with the shell -rules -.SS Linux / OSX +These flags control the VFS file caching options. +File caching is necessary to make the VFS layer appear compatible with a +normal file system. +It can be disabled at the cost of some compatibility. .PP -If your names have spaces or shell metacharacters (e.g. -\f[C]*\f[R], \f[C]?\f[R], \f[C]$\f[R], \f[C]\[aq]\f[R], \f[C]\[dq]\f[R], -etc.) then you must quote them. -Use single quotes \f[C]\[aq]\f[R] by default. -.IP -.nf -\f[C] -rclone copy \[aq]Important files?\[aq] remote:backup -\f[R] -.fi +For example you\[aq]ll need to enable VFS caching if you want to read +and write simultaneously to a file. +See below for more details. .PP -If you want to send a \f[C]\[aq]\f[R] you will need to use -\f[C]\[dq]\f[R], e.g. +Note that the VFS cache is separate from the cache backend and you may +find that you need one or the other or both. .IP .nf \f[C] -rclone copy \[dq]O\[aq]Reilly Reviews\[dq] remote:backup +--cache-dir string Directory rclone will use for caching. +--vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) +--vfs-cache-max-age duration Max time since last access of objects in the cache (default 1h0m0s) +--vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) +--vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) +--vfs-cache-poll-interval duration Interval to poll the cache for stale objects (default 1m0s) +--vfs-write-back duration Time to writeback files after last use when using cache (default 5s) \f[R] .fi .PP -The rules for quoting metacharacters are complicated and if you want the -full details you\[aq]ll have to consult the manual page for your shell. -.SS Windows +If run with \f[C]-vv\f[R] rclone will print the location of the file +cache. +The files are stored in the user cache file area which is OS dependent +but can be controlled with \f[C]--cache-dir\f[R] or setting the +appropriate environment variable. .PP -If your names have spaces in you need to put them in \f[C]\[dq]\f[R], -e.g. -.IP -.nf -\f[C] -rclone copy \[dq]E:\[rs]folder name\[rs]folder name\[rs]folder name\[dq] remote:backup -\f[R] -.fi +The cache has 4 different modes selected by \f[C]--vfs-cache-mode\f[R]. +The higher the cache mode the more compatible rclone becomes at the cost +of using disk space. .PP -If you are using the root directory on its own then don\[aq]t quote it -(see #464 (https://github.com/rclone/rclone/issues/464) for why), e.g. -.IP -.nf -\f[C] -rclone copy E:\[rs] remote:backup -\f[R] -.fi -.SS Copying files or directories with \f[C]:\f[R] in the names +Note that files are written back to the remote only when they are closed +and if they haven\[aq]t been accessed for \f[C]--vfs-write-back\f[R] +seconds. +If rclone is quit or dies with files that haven\[aq]t been uploaded, +these will be uploaded next time rclone is run with the same flags. .PP -rclone uses \f[C]:\f[R] to mark a remote name. -This is, however, a valid filename component in non-Windows OSes. -The remote name parser will only search for a \f[C]:\f[R] up to the -first \f[C]/\f[R] so if you need to act on a file or directory like this -then use the full path starting with a \f[C]/\f[R], or use \f[C]./\f[R] -as a current directory prefix. +If using \f[C]--vfs-cache-max-size\f[R] or +\f[C]--vfs-cache-min-free-size\f[R] note that the cache may exceed these +quotas for two reasons. +Firstly because it is only checked every +\f[C]--vfs-cache-poll-interval\f[R]. +Secondly because open files cannot be evicted from the cache. +When \f[C]--vfs-cache-max-size\f[R] or +\f[C]--vfs-cache-min-free-size\f[R] is exceeded, rclone will attempt to +evict the least accessed files from the cache first. +rclone will start with files that haven\[aq]t been accessed for the +longest. +This cache flushing strategy is efficient and more relevant files are +likely to remain cached. .PP -So to sync a directory called \f[C]sync:me\f[R] to a remote called -\f[C]remote:\f[R] use -.IP -.nf -\f[C] -rclone sync --interactive ./sync:me remote:path -\f[R] -.fi -.PP -or -.IP -.nf -\f[C] -rclone sync --interactive /full/path/to/sync:me remote:path -\f[R] -.fi -.SS Server Side Copy -.PP -Most remotes (but not all - see the -overview (https://rclone.org/overview/#optional-features)) support -server-side copy. -.PP -This means if you want to copy one folder to another then rclone -won\[aq]t download all the files and re-upload them; it will instruct -the server to copy them in place. -.PP -Eg -.IP -.nf -\f[C] -rclone copy s3:oldbucket s3:newbucket -\f[R] -.fi -.PP -Will copy the contents of \f[C]oldbucket\f[R] to \f[C]newbucket\f[R] -without downloading and re-uploading. -.PP -Remotes which don\[aq]t support server-side copy \f[B]will\f[R] download -and re-upload in this case. -.PP -Server side copies are used with \f[C]sync\f[R] and \f[C]copy\f[R] and -will be identified in the log when using the \f[C]-v\f[R] flag. -The \f[C]move\f[R] command may also use them if remote doesn\[aq]t -support server-side move directly. -This is done by issuing a server-side copy then a delete which is much -quicker than a download and re-upload. -.PP -Server side copies will only be attempted if the remote names are the -same. -.PP -This can be used when scripting to make aged backups efficiently, e.g. -.IP -.nf -\f[C] -rclone sync --interactive remote:current-backup remote:previous-backup -rclone sync --interactive /path/to/files remote:current-backup -\f[R] -.fi -.SS Metadata support -.PP -Metadata is data about a file which isn\[aq]t the contents of the file. -Normally rclone only preserves the modification time and the content -(MIME) type where possible. -.PP -Rclone supports preserving all the available metadata on files (not -directories) when using the \f[C]--metadata\f[R] or \f[C]-M\f[R] flag. -.PP -Exactly what metadata is supported and what that support means depends -on the backend. -Backends that support metadata have a metadata section in their docs and -are listed in the features table (https://rclone.org/overview/#features) -(Eg local (https://rclone.org/local/#metadata), s3) -.PP -Rclone only supports a one-time sync of metadata. -This means that metadata will be synced from the source object to the -destination object only when the source object has changed and needs to -be re-uploaded. -If the metadata subsequently changes on the source object without -changing the object itself then it won\[aq]t be synced to the -destination object. -This is in line with the way rclone syncs \f[C]Content-Type\f[R] without -the \f[C]--metadata\f[R] flag. -.PP -Using \f[C]--metadata\f[R] when syncing from local to local will -preserve file attributes such as file mode, owner, extended attributes -(not Windows). -.PP -Note that arbitrary metadata may be added to objects using the -\f[C]--metadata-set key=value\f[R] flag when the object is first -uploaded. -This flag can be repeated as many times as necessary. -.SS Types of metadata -.PP -Metadata is divided into two type. -System metadata and User metadata. -.PP -Metadata which the backend uses itself is called system metadata. -For example on the local backend the system metadata \f[C]uid\f[R] will -store the user ID of the file when used on a unix based platform. -.PP -Arbitrary metadata is called user metadata and this can be set however -is desired. -.PP -When objects are copied from backend to backend, they will attempt to -interpret system metadata if it is supplied. -Metadata may change from being user metadata to system metadata as -objects are copied between different backends. -For example copying an object from s3 sets the \f[C]content-type\f[R] -metadata. -In a backend which understands this (like \f[C]azureblob\f[R]) this will -become the Content-Type of the object. -In a backend which doesn\[aq]t understand this (like the \f[C]local\f[R] -backend) this will become user metadata. -However should the local object be copied back to s3, the Content-Type -will be set correctly. -.SS Metadata framework +The \f[C]--vfs-cache-max-age\f[R] will evict files from the cache after +the set time since last access has passed. +The default value of 1 hour will start evicting files from cache that +haven\[aq]t been accessed for 1 hour. +When a cached file is accessed the 1 hour timer is reset to 0 and will +wait for 1 more hour before evicting. +Specify the time with standard notation, s, m, h, d, w . .PP -Rclone implements a metadata framework which can read metadata from an -object and write it to the object when (and only when) it is being -uploaded. +You \f[B]should not\f[R] run two copies of rclone using the same VFS +cache with the same or overlapping remotes if using +\f[C]--vfs-cache-mode > off\f[R]. +This can potentially cause data corruption if you do. +You can work around this by giving each rclone its own cache hierarchy +with \f[C]--cache-dir\f[R]. +You don\[aq]t need to worry about this if the remotes in use don\[aq]t +overlap. +.SS --vfs-cache-mode off .PP -This metadata is stored as a dictionary with string keys and string -values. +In this mode (the default) the cache will read directly from the remote +and write directly to the remote without caching anything on disk. .PP -There are some limits on the names of the keys (these may be clarified -further in the future). +This will mean some operations are not possible .IP \[bu] 2 -must be lower case +Files can\[aq]t be opened for both read AND write .IP \[bu] 2 -may be \f[C]a-z\f[R] \f[C]0-9\f[R] containing \f[C].\f[R] \f[C]-\f[R] or -\f[C]_\f[R] +Files opened for write can\[aq]t be seeked .IP \[bu] 2 -length is backend dependent -.PP -Each backend can provide system metadata that it understands. -Some backends can also store arbitrary user metadata. +Existing files opened for write must have O_TRUNC set +.IP \[bu] 2 +Files open for read with O_TRUNC will be opened write only +.IP \[bu] 2 +Files open for write only will behave as if O_TRUNC was supplied +.IP \[bu] 2 +Open modes O_APPEND, O_TRUNC are ignored +.IP \[bu] 2 +If an upload fails it can\[aq]t be retried +.SS --vfs-cache-mode minimal .PP -Where possible the key names are standardized, so, for example, it is -possible to copy object metadata from s3 to azureblob for example and -metadata will be translated appropriately. +This is very similar to \[dq]off\[dq] except that files opened for read +AND write will be buffered to disk. +This means that files opened for write will be a lot more compatible, +but uses the minimal disk space. .PP -Some backends have limits on the size of the metadata and rclone will -give errors on upload if they are exceeded. -.SS Metadata preservation +These operations are not possible +.IP \[bu] 2 +Files opened for write only can\[aq]t be seeked +.IP \[bu] 2 +Existing files opened for write must have O_TRUNC set +.IP \[bu] 2 +Files opened for write only will ignore O_APPEND, O_TRUNC +.IP \[bu] 2 +If an upload fails it can\[aq]t be retried +.SS --vfs-cache-mode writes .PP -The goal of the implementation is to -.IP "1." 3 -Preserve metadata if at all possible -.IP "2." 3 -Interpret metadata if at all possible +In this mode files opened for read only are still read directly from the +remote, write only and read/write files are buffered to disk first. .PP -The consequences of 1 is that you can copy an S3 object to a local disk -then back to S3 losslessly. -Likewise you can copy a local file with file attributes and xattrs from -local disk to s3 and back again losslessly. +This mode should support all normal file system operations. .PP -The consequence of 2 is that you can copy an S3 object with metadata to -Azureblob (say) and have the metadata appear on the Azureblob object -also. -.SS Standard system metadata +If an upload fails it will be retried at exponentially increasing +intervals up to 1 minute. +.SS --vfs-cache-mode full .PP -Here is a table of standard system metadata which, if appropriate, a -backend may implement. +In this mode all reads and writes are buffered to and from disk. +When data is read from the remote this is buffered to disk as well. .PP -.TS -tab(@); -lw(34.2n) lw(21.2n) lw(14.7n). -T{ -key -T}@T{ -description -T}@T{ -example -T} -_ -T{ -mode -T}@T{ -File type and mode: octal, unix style -T}@T{ -0100664 -T} -T{ -uid -T}@T{ -User ID of owner: decimal number -T}@T{ -500 -T} -T{ -gid -T}@T{ -Group ID of owner: decimal number -T}@T{ -500 -T} -T{ -rdev -T}@T{ -Device ID (if special file) => hexadecimal -T}@T{ -0 -T} -T{ -atime -T}@T{ -Time of last access: RFC 3339 -T}@T{ -2006-01-02T15:04:05.999999999Z07:00 -T} -T{ -mtime -T}@T{ -Time of last modification: RFC 3339 -T}@T{ -2006-01-02T15:04:05.999999999Z07:00 -T} -T{ -btime -T}@T{ -Time of file creation (birth): RFC 3339 -T}@T{ -2006-01-02T15:04:05.999999999Z07:00 -T} -T{ -cache-control -T}@T{ -Cache-Control header -T}@T{ -no-cache -T} -T{ -content-disposition -T}@T{ -Content-Disposition header -T}@T{ -inline -T} -T{ -content-encoding -T}@T{ -Content-Encoding header -T}@T{ -gzip -T} -T{ -content-language -T}@T{ -Content-Language header -T}@T{ -en-US -T} -T{ -content-type -T}@T{ -Content-Type header -T}@T{ -text/plain -T} -.TE +In this mode the files in the cache will be sparse files and rclone will +keep track of which bits of the files it has downloaded. .PP -The metadata keys \f[C]mtime\f[R] and \f[C]content-type\f[R] will take -precedence if supplied in the metadata over reading the -\f[C]Content-Type\f[R] or modification time of the source object. +So if an application only reads the starts of each file, then rclone +will only buffer the start of the file. +These files will appear to be their full size in the cache, but they +will be sparse files with only the data that has been downloaded present +in them. .PP -Hashes are not included in system metadata as there is a well defined -way of reading those already. -.SS Options +This mode should support all normal file system operations and is +otherwise identical to \f[C]--vfs-cache-mode\f[R] writes. .PP -Rclone has a number of options to control its behaviour. +When reading a file rclone will read \f[C]--buffer-size\f[R] plus +\f[C]--vfs-read-ahead\f[R] bytes ahead. +The \f[C]--buffer-size\f[R] is buffered in memory whereas the +\f[C]--vfs-read-ahead\f[R] is buffered on disk. .PP -Options that take parameters can have the values passed in two ways, -\f[C]--option=value\f[R] or \f[C]--option value\f[R]. -However boolean (true/false) options behave slightly differently to the -other options in that \f[C]--boolean\f[R] sets the option to -\f[C]true\f[R] and the absence of the flag sets it to \f[C]false\f[R]. -It is also possible to specify \f[C]--boolean=false\f[R] or -\f[C]--boolean=true\f[R]. -Note that \f[C]--boolean false\f[R] is not valid - this is parsed as -\f[C]--boolean\f[R] and the \f[C]false\f[R] is parsed as an extra -command line argument for rclone. -.SS Time or duration options +When using this mode it is recommended that \f[C]--buffer-size\f[R] is +not set too large and \f[C]--vfs-read-ahead\f[R] is set large if +required. .PP -TIME or DURATION options can be specified as a duration string or a time -string. +\f[B]IMPORTANT\f[R] not all file systems support sparse files. +In particular FAT/exFAT do not. +Rclone will perform very badly if the cache directory is on a filesystem +which doesn\[aq]t support sparse files and it will log an ERROR message +if one is detected. +.SS Fingerprinting .PP -A duration string is a possibly signed sequence of decimal numbers, each -with optional fraction and a unit suffix, such as \[dq]300ms\[dq], -\[dq]-1.5h\[dq] or \[dq]2h45m\[dq]. -Default units are seconds or the following abbreviations are valid: -.IP \[bu] 2 -\f[C]ms\f[R] - Milliseconds -.IP \[bu] 2 -\f[C]s\f[R] - Seconds -.IP \[bu] 2 -\f[C]m\f[R] - Minutes -.IP \[bu] 2 -\f[C]h\f[R] - Hours -.IP \[bu] 2 -\f[C]d\f[R] - Days +Various parts of the VFS use fingerprinting to see if a local file copy +has changed relative to a remote file. +Fingerprints are made from: .IP \[bu] 2 -\f[C]w\f[R] - Weeks +size .IP \[bu] 2 -\f[C]M\f[R] - Months +modification time .IP \[bu] 2 -\f[C]y\f[R] - Years +hash .PP -These can also be specified as an absolute time in the following -formats: -.IP \[bu] 2 -RFC3339 - e.g. -\f[C]2006-01-02T15:04:05Z\f[R] or \f[C]2006-01-02T15:04:05+07:00\f[R] -.IP \[bu] 2 -ISO8601 Date and time, local timezone - \f[C]2006-01-02T15:04:05\f[R] -.IP \[bu] 2 -ISO8601 Date and time, local timezone - \f[C]2006-01-02 15:04:05\f[R] -.IP \[bu] 2 -ISO8601 Date - \f[C]2006-01-02\f[R] (YYYY-MM-DD) -.SS Size options +where available on an object. .PP -Options which use SIZE use KiB (multiples of 1024 bytes) by default. -However, a suffix of \f[C]B\f[R] for Byte, \f[C]K\f[R] for KiB, -\f[C]M\f[R] for MiB, \f[C]G\f[R] for GiB, \f[C]T\f[R] for TiB and -\f[C]P\f[R] for PiB may be used. -These are the binary units, e.g. -1, 2**10, 2**20, 2**30 respectively. -.SS --backup-dir=DIR +On some backends some of these attributes are slow to read (they take an +extra API call per object, or extra work per object). .PP -When using \f[C]sync\f[R], \f[C]copy\f[R] or \f[C]move\f[R] any files -which would have been overwritten or deleted are moved in their original -hierarchy into this directory. +For example \f[C]hash\f[R] is slow with the \f[C]local\f[R] and +\f[C]sftp\f[R] backends as they have to read the entire file and hash +it, and \f[C]modtime\f[R] is slow with the \f[C]s3\f[R], +\f[C]swift\f[R], \f[C]ftp\f[R] and \f[C]qinqstor\f[R] backends because +they need to do an extra API call to fetch it. .PP -If \f[C]--suffix\f[R] is set, then the moved files will have the suffix -added to them. -If there is a file with the same path (after the suffix has been added) -in DIR, then it will be overwritten. +If you use the \f[C]--vfs-fast-fingerprint\f[R] flag then rclone will +not include the slow operations in the fingerprint. +This makes the fingerprinting less accurate but much faster and will +improve the opening time of cached files. .PP -The remote in use must support server-side move or copy and you must use -the same remote as the destination of the sync. -The backup directory must not overlap the destination directory without -it being excluded by a filter rule. +If you are running a vfs cache over \f[C]local\f[R], \f[C]s3\f[R] or +\f[C]swift\f[R] backends then using this flag is recommended. .PP -For example +Note that if you change the value of this flag, the fingerprints of the +files in the cache may be invalidated and the files will need to be +downloaded again. +.SS VFS Chunked Reading +.PP +When rclone reads files from a remote it reads them in chunks. +This means that rather than requesting the whole file rclone reads the +chunk specified. +This can reduce the used download quota for some remotes by requesting +only chunks from the remote that are actually read, at the cost of an +increased number of requests. +.PP +These flags control the chunking: .IP .nf \f[C] -rclone sync --interactive /path/to/local remote:current --backup-dir remote:old +--vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128M) +--vfs-read-chunk-size-limit SizeSuffix Max chunk doubling size (default off) \f[R] .fi .PP -will sync \f[C]/path/to/local\f[R] to \f[C]remote:current\f[R], but for -any files which would have been updated or deleted will be stored in -\f[C]remote:old\f[R]. -.PP -If running rclone from a script you might want to use today\[aq]s date -as the directory name passed to \f[C]--backup-dir\f[R] to store the old -files, or you might want to pass \f[C]--suffix\f[R] with today\[aq]s -date. +Rclone will start reading a chunk of size +\f[C]--vfs-read-chunk-size\f[R], and then double the size for each read. +When \f[C]--vfs-read-chunk-size-limit\f[R] is specified, and greater +than \f[C]--vfs-read-chunk-size\f[R], the chunk size for each open file +will get doubled only until the specified value is reached. +If the value is \[dq]off\[dq], which is the default, the limit is +disabled and the chunk size will grow indefinitely. .PP -See \f[C]--compare-dest\f[R] and \f[C]--copy-dest\f[R]. -.SS --bind string +With \f[C]--vfs-read-chunk-size 100M\f[R] and +\f[C]--vfs-read-chunk-size-limit 0\f[R] the following parts will be +downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on. +When \f[C]--vfs-read-chunk-size-limit 500M\f[R] is specified, the result +would be 0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so +on. .PP -Local address to bind to for outgoing connections. -This can be an IPv4 address (1.2.3.4), an IPv6 address (1234::789A) or -host name. -If the host name doesn\[aq]t resolve or resolves to more than one IP -address it will give an error. +Setting \f[C]--vfs-read-chunk-size\f[R] to \f[C]0\f[R] or \[dq]off\[dq] +disables chunked reading. +.SS VFS Performance .PP -You can use \f[C]--bind 0.0.0.0\f[R] to force rclone to use IPv4 -addresses and \f[C]--bind ::0\f[R] to force rclone to use IPv6 -addresses. -.SS --bwlimit=BANDWIDTH_SPEC +These flags may be used to enable/disable features of the VFS for +performance or other reasons. +See also the chunked reading feature. .PP -This option controls the bandwidth limit. -For example +In particular S3 and Swift benefit hugely from the +\f[C]--no-modtime\f[R] flag (or use \f[C]--use-server-modtime\f[R] for a +slightly different effect) as each read of the modification time takes a +transaction. .IP .nf \f[C] ---bwlimit 10M +--no-checksum Don\[aq]t compare checksums on up/download. +--no-modtime Don\[aq]t read/write the modification time (can speed things up). +--no-seek Don\[aq]t allow seeking in files. +--read-only Only allow read-only access. \f[R] .fi .PP -would mean limit the upload and download bandwidth to 10 MiB/s. -\f[B]NB\f[R] this is \f[B]bytes\f[R] per second not \f[B]bits\f[R] per -second. -To use a single limit, specify the desired bandwidth in KiB/s, or use a -suffix B|K|M|G|T|P. -The default is \f[C]0\f[R] which means to not limit bandwidth. -.PP -The upload and download bandwidth can be specified separately, as -\f[C]--bwlimit UP:DOWN\f[R], so +Sometimes rclone is delivered reads or writes out of order. +Rather than seeking rclone will wait a short time for the in sequence +read or write to come in. +These flags only come into effect when not using an on disk cache file. .IP .nf \f[C] ---bwlimit 10M:100k +--vfs-read-wait duration Time to wait for in-sequence read before seeking (default 20ms) +--vfs-write-wait duration Time to wait for in-sequence write before giving error (default 1s) \f[R] .fi .PP -would mean limit the upload bandwidth to 10 MiB/s and the download -bandwidth to 100 KiB/s. -Either limit can be \[dq]off\[dq] meaning no limit, so to just limit the -upload bandwidth you would use +When using VFS write caching (\f[C]--vfs-cache-mode\f[R] with value +writes or full), the global flag \f[C]--transfers\f[R] can be set to +adjust the number of parallel uploads of modified files from the cache +(the related global flag \f[C]--checkers\f[R] has no effect on the VFS). .IP .nf \f[C] ---bwlimit 10M:off +--transfers int Number of file transfers to run in parallel (default 4) \f[R] .fi +.SS VFS Case Sensitivity .PP -this would limit the upload bandwidth to 10 MiB/s but the download -bandwidth would be unlimited. -.PP -When specified as above the bandwidth limits last for the duration of -run of the rclone binary. +Linux file systems are case-sensitive: two files can differ only by +case, and the exact case must be used when opening a file. .PP -It is also possible to specify a \[dq]timetable\[dq] of limits, which -will cause certain limits to be applied at certain times. -To specify a timetable, format your entries as -\f[C]WEEKDAY-HH:MM,BANDWIDTH WEEKDAY-HH:MM,BANDWIDTH...\f[R] where: -\f[C]WEEKDAY\f[R] is optional element. -.IP \[bu] 2 -\f[C]BANDWIDTH\f[R] can be a single number, e.g.\f[C]100k\f[R] or a pair -of numbers for upload:download, e.g.\f[C]10M:1M\f[R]. -.IP \[bu] 2 -\f[C]WEEKDAY\f[R] can be written as the whole word or only using the -first 3 characters. -It is optional. -.IP \[bu] 2 -\f[C]HH:MM\f[R] is an hour from 00:00 to 23:59. +File systems in modern Windows are case-insensitive but case-preserving: +although existing files can be opened using any case, the exact case +used to create the file is preserved and available for programs to +query. +It is not allowed for two files in the same directory to differ only by +case. .PP -An example of a typical timetable to avoid link saturation during -daytime working hours could be: +Usually file systems on macOS are case-insensitive. +It is possible to make macOS file systems case-sensitive but that is not +the default. .PP -\f[C]--bwlimit \[dq]08:00,512k 12:00,10M 13:00,512k 18:00,30M 23:00,off\[dq]\f[R] +The \f[C]--vfs-case-insensitive\f[R] VFS flag controls how rclone +handles these two cases. +If its value is \[dq]false\[dq], rclone passes file names to the remote +as-is. +If the flag is \[dq]true\[dq] (or appears without a value on the command +line), rclone may perform a \[dq]fixup\[dq] as explained below. .PP -In this example, the transfer bandwidth will be set to 512 KiB/s at 8am -every day. -At noon, it will rise to 10 MiB/s, and drop back to 512 KiB/sec at 1pm. -At 6pm, the bandwidth limit will be set to 30 MiB/s, and at 11pm it will -be completely disabled (full speed). -Anything between 11pm and 8am will remain unlimited. +The user may specify a file name to open/delete/rename/etc with a case +different than what is stored on the remote. +If an argument refers to an existing file with exactly the same name, +then the case of the existing file on the disk will be used. +However, if a file name with exactly the same name is not found but a +name differing only by case exists, rclone will transparently fixup the +name. +This fixup happens only when an existing file is requested. +Case sensitivity of file names created anew by rclone is controlled by +the underlying remote. .PP -An example of timetable with \f[C]WEEKDAY\f[R] could be: +Note that case sensitivity of the operating system running rclone (the +target) may differ from case sensitivity of a file system presented by +rclone (the source). +The flag controls whether \[dq]fixup\[dq] is performed to satisfy the +target. .PP -\f[C]--bwlimit \[dq]Mon-00:00,512 Fri-23:59,10M Sat-10:00,1M Sun-20:00,off\[dq]\f[R] +If the flag is not provided on the command line, then its default value +depends on the operating system where rclone runs: \[dq]true\[dq] on +Windows and macOS, \[dq]false\[dq] otherwise. +If the flag is provided without a value, then it is \[dq]true\[dq]. +.SS VFS Disk Options .PP -It means that, the transfer bandwidth will be set to 512 KiB/s on -Monday. -It will rise to 10 MiB/s before the end of Friday. -At 10:00 on Saturday it will be set to 1 MiB/s. -From 20:00 on Sunday it will be unlimited. +This flag allows you to manually set the statistics about the filing +system. +It can be useful when those statistics cannot be read correctly +automatically. +.IP +.nf +\f[C] +--vfs-disk-space-total-size Manually set the total disk space size (example: 256G, default: -1) +\f[R] +.fi +.SS Alternate report of used bytes .PP -Timeslots without \f[C]WEEKDAY\f[R] are extended to the whole week. -So this example: +Some backends, most notably S3, do not report the amount of bytes used. +If you need this information to be available when running \f[C]df\f[R] +on the filesystem, then pass the flag \f[C]--vfs-used-is-size\f[R] to +rclone. +With this flag set, instead of relying on the backend to report this +information, rclone will scan the whole remote similar to +\f[C]rclone size\f[R] and compute the total used space itself. .PP -\f[C]--bwlimit \[dq]Mon-00:00,512 12:00,1M Sun-20:00,off\[dq]\f[R] +\f[I]WARNING.\f[R] Contrary to \f[C]rclone size\f[R], this flag ignores +filters so that the result is accurate. +However, this is very inefficient and may cost lots of API calls +resulting in extra charges. +Use it as a last resort and only with caching. +.SS Auth Proxy .PP -Is equivalent to this: +If you supply the parameter \f[C]--auth-proxy /path/to/program\f[R] then +rclone will use that program to generate backends on the fly which then +are used to authenticate incoming requests. +This uses a simple JSON based protocol with input on STDIN and output on +STDOUT. .PP -\f[C]--bwlimit \[dq]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\[dq]\f[R] +\f[B]PLEASE NOTE:\f[R] \f[C]--auth-proxy\f[R] and +\f[C]--authorized-keys\f[R] cannot be used together, if +\f[C]--auth-proxy\f[R] is set the authorized keys option will be +ignored. .PP -Bandwidth limit apply to the data transfer for all backends. -For most backends the directory listing bandwidth is also included -(exceptions being the non HTTP backends, \f[C]ftp\f[R], \f[C]sftp\f[R] -and \f[C]storj\f[R]). +There is an example program +bin/test_proxy.py (https://github.com/rclone/rclone/blob/master/test_proxy.py) +in the rclone source code. .PP -Note that the units are \f[B]Byte/s\f[R], not \f[B]bit/s\f[R]. -Typically connections are measured in bit/s - to convert divide by 8. -For example, let\[aq]s say you have a 10 Mbit/s connection and you wish -rclone to use half of it - 5 Mbit/s. -This is 5/8 = 0.625 MiB/s so you would use a \f[C]--bwlimit 0.625M\f[R] -parameter for rclone. +The program\[aq]s job is to take a \f[C]user\f[R] and \f[C]pass\f[R] on +the input and turn those into the config for a backend on STDOUT in JSON +format. +This config will have any default parameters for the backend added, but +it won\[aq]t use configuration from environment variables or command +line options - it is the job of the proxy program to make a complete +config. .PP -On Unix systems (Linux, macOS, \&...) the bandwidth limiter can be -toggled by sending a \f[C]SIGUSR2\f[R] signal to rclone. -This allows to remove the limitations of a long running rclone transfer -and to restore it back to the value specified with \f[C]--bwlimit\f[R] -quickly when needed. -Assuming there is only one rclone instance running, you can toggle the -limiter like this: +This config generated must have this extra parameter - \f[C]_root\f[R] - +root to use for the backend +.PP +And it may have this parameter - \f[C]_obscure\f[R] - comma separated +strings for parameters to obscure +.PP +If password authentication was used by the client, input to the proxy +process (on STDIN) would look similar to this: .IP .nf \f[C] -kill -SIGUSR2 $(pidof rclone) +{ + \[dq]user\[dq]: \[dq]me\[dq], + \[dq]pass\[dq]: \[dq]mypassword\[dq] +} \f[R] .fi .PP -If you configure rclone with a remote control then you can use change -the bwlimit dynamically: +If public-key authentication was used by the client, input to the proxy +process (on STDIN) would look similar to this: .IP .nf \f[C] -rclone rc core/bwlimit rate=1M +{ + \[dq]user\[dq]: \[dq]me\[dq], + \[dq]public_key\[dq]: \[dq]AAAAB3NzaC1yc2EAAAADAQABAAABAQDuwESFdAe14hVS6omeyX7edc...JQdf\[dq] +} \f[R] .fi -.SS --bwlimit-file=BANDWIDTH_SPEC -.PP -This option controls per file bandwidth limit. -For the options see the \f[C]--bwlimit\f[R] flag. .PP -For example use this to allow no transfers to be faster than 1 MiB/s +And as an example return this on STDOUT .IP .nf \f[C] ---bwlimit-file 1M +{ + \[dq]type\[dq]: \[dq]sftp\[dq], + \[dq]_root\[dq]: \[dq]\[dq], + \[dq]_obscure\[dq]: \[dq]pass\[dq], + \[dq]user\[dq]: \[dq]me\[dq], + \[dq]pass\[dq]: \[dq]mypassword\[dq], + \[dq]host\[dq]: \[dq]sftp.example.com\[dq] +} \f[R] .fi .PP -This can be used in conjunction with \f[C]--bwlimit\f[R]. -.PP -Note that if a schedule is provided the file will use the schedule in -effect at the start of the transfer. -.SS --buffer-size=SIZE -.PP -Use this sized buffer to speed up file transfers. -Each \f[C]--transfer\f[R] will use this much memory for buffering. -.PP -When using \f[C]mount\f[R] or \f[C]cmount\f[R] each open file descriptor -will use this much memory for buffering. -See the mount (https://rclone.org/commands/rclone_mount/#file-buffering) -documentation for more details. -.PP -Set to \f[C]0\f[R] to disable the buffering for the minimum memory -usage. +This would mean that an SFTP backend would be created on the fly for the +\f[C]user\f[R] and \f[C]pass\f[R]/\f[C]public_key\f[R] returned in the +output to the host given. +Note that since \f[C]_obscure\f[R] is set to \f[C]pass\f[R], rclone will +obscure the \f[C]pass\f[R] parameter before creating the backend (which +is required for sftp backends). .PP -Note that the memory allocation of the buffers is influenced by the ---use-mmap flag. -.SS --cache-dir=DIR +The program can manipulate the supplied \f[C]user\f[R] in any way, for +example to make proxy to many different sftp backends, you could make +the \f[C]user\f[R] be \f[C]user\[at]example.com\f[R] and then set the +\f[C]host\f[R] to \f[C]example.com\f[R] in the output and the user to +\f[C]user\f[R]. +For security you\[aq]d probably want to restrict the \f[C]host\f[R] to a +limited list. .PP -Specify the directory rclone will use for caching, to override the -default. +Note that an internal cache is keyed on \f[C]user\f[R] so only use that +for configuration, don\[aq]t use \f[C]pass\f[R] or \f[C]public_key\f[R]. +This also means that if a user\[aq]s password or public-key is changed +the cache will need to expire (which takes 5 mins) before it takes +effect. .PP -Default value is depending on operating system: - Windows -\f[C]%LocalAppData%\[rs]rclone\f[R], if \f[C]LocalAppData\f[R] is -defined. -- macOS \f[C]$HOME/Library/Caches/rclone\f[R] if \f[C]HOME\f[R] is -defined. -- Unix \f[C]$XDG_CACHE_HOME/rclone\f[R] if \f[C]XDG_CACHE_HOME\f[R] is -defined, else \f[C]$HOME/.cache/rclone\f[R] if \f[C]HOME\f[R] is -defined. -- Fallback (on all OS) to \f[C]$TMPDIR/rclone\f[R], where -\f[C]TMPDIR\f[R] is the value from --temp-dir. +This can be used to build general purpose proxies to any kind of backend +that rclone supports. +.IP +.nf +\f[C] +rclone serve webdav remote:path [flags] +\f[R] +.fi +.SS Options +.IP +.nf +\f[C] + --addr stringArray IPaddress:Port or :Port to bind server to (default [127.0.0.1:8080]) + --allow-origin string Origin which cross-domain request (CORS) can be executed from + --auth-proxy string A program to use to create the backend from the auth + --baseurl string Prefix for URLs - leave blank for root + --cert string TLS PEM key (concatenation of certificate and CA certificate) + --client-ca string Client certificate authority to verify clients with + --dir-cache-time Duration Time to cache directory entries for (default 5m0s) + --dir-perms FileMode Directory permissions (default 0777) + --disable-dir-list Disable HTML directory list on GET request for a directory + --etag-hash string Which hash to use for the ETag, or auto or blank for off + --file-perms FileMode File permissions (default 0666) + --gid uint32 Override the gid field set by the filesystem (not supported on Windows) (default 1000) + -h, --help help for webdav + --htpasswd string A htpasswd file - if not provided no authentication is done + --key string TLS PEM Private key + --max-header-bytes int Maximum size of request header (default 4096) + --min-tls-version string Minimum TLS version that is acceptable (default \[dq]tls1.0\[dq]) + --no-checksum Don\[aq]t compare checksums on up/download + --no-modtime Don\[aq]t read/write the modification time (can speed things up) + --no-seek Don\[aq]t allow seeking in files + --pass string Password for authentication + --poll-interval Duration Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable) (default 1m0s) + --read-only Only allow read-only access + --realm string Realm for authentication + --salt string Password hashing salt (default \[dq]dlPL2MqE\[dq]) + --server-read-timeout Duration Timeout for server reading data (default 1h0m0s) + --server-write-timeout Duration Timeout for server writing data (default 1h0m0s) + --template string User-specified template + --uid uint32 Override the uid field set by the filesystem (not supported on Windows) (default 1000) + --umask int Override the permission bits set by the filesystem (not supported on Windows) (default 2) + --user string User name for authentication + --vfs-cache-max-age Duration Max time since last access of objects in the cache (default 1h0m0s) + --vfs-cache-max-size SizeSuffix Max total size of objects in the cache (default off) + --vfs-cache-min-free-space SizeSuffix Target minimum free space on the disk containing the cache (default off) + --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) + --vfs-cache-poll-interval Duration Interval to poll the cache for stale objects (default 1m0s) + --vfs-case-insensitive If a file name not found, find a case insensitive match + --vfs-disk-space-total-size SizeSuffix Specify the total space of disk (default off) + --vfs-fast-fingerprint Use fast (less accurate) fingerprints for change detection + --vfs-read-ahead SizeSuffix Extra read ahead over --buffer-size when using cache-mode full + --vfs-read-chunk-size SizeSuffix Read the source objects in chunks (default 128Mi) + --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached (\[aq]off\[aq] is unlimited) (default off) + --vfs-read-wait Duration Time to wait for in-sequence read before seeking (default 20ms) + --vfs-refresh Refreshes the directory cache recursively on start + --vfs-used-is-size rclone size Use the rclone size algorithm for Used size + --vfs-write-back Duration Time to writeback files after last use when using cache (default 5s) + --vfs-write-wait Duration Time to wait for in-sequence write before giving error (default 1s) +\f[R] +.fi +.SS Filter Options .PP -You can use the config -paths (https://rclone.org/commands/rclone_config_paths/) command to see -the current value. +Flags for filtering directory listings. +.IP +.nf +\f[C] + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +\f[R] +.fi .PP -Cache directory is heavily used by the VFS File -Caching (https://rclone.org/commands/rclone_mount/#vfs-file-caching) -mount feature, but also by -serve (https://rclone.org/commands/rclone_serve/), GUI and other parts -of rclone. -.SS --check-first +See the global flags page (https://rclone.org/flags/) for global options +not listed here. +.SH SEE ALSO +.IP \[bu] 2 +rclone serve (https://rclone.org/commands/rclone_serve/) - Serve a +remote over a protocol. +.SH rclone settier .PP -If this flag is set then in a \f[C]sync\f[R], \f[C]copy\f[R] or -\f[C]move\f[R], rclone will do all the checks to see whether files need -to be transferred before doing any of the transfers. -Normally rclone would start running transfers as soon as possible. +Changes storage class/tier of objects in remote. +.SS Synopsis .PP -This flag can be useful on IO limited systems where transfers interfere -with checking. +rclone settier changes storage tier or class at remote if supported. +Few cloud storage services provides different storage classes on +objects, for example AWS S3 and Glacier, Azure Blob storage - Hot, Cool +and Archive, Google Cloud Storage, Regional Storage, Nearline, Coldline +etc. .PP -It can also be useful to ensure perfect ordering when using -\f[C]--order-by\f[R]. +Note that, certain tier changes make objects not available to access +immediately. +For example tiering to archive in azure blob storage makes objects in +frozen state, user can restore by setting tier to Hot/Cool, similarly S3 +to Glacier makes object inaccessible.true .PP -If both \f[C]--check-first\f[R] and \f[C]--order-by\f[R] are set when -doing \f[C]rclone move\f[R] then rclone will use the transfer thread to -delete source files which don\[aq]t need transferring. -This will enable perfect ordering of the transfers and deletes but will -cause the transfer stats to have more items in than expected. +You can use it to tier single object +.IP +.nf +\f[C] +rclone settier Cool remote:path/file +\f[R] +.fi .PP -Using this flag can use more memory as it effectively sets -\f[C]--max-backlog\f[R] to infinite. -This means that all the info on the objects to transfer is held in -memory before the transfers start. -.SS --checkers=N +Or use rclone filters to set tier on only specific files +.IP +.nf +\f[C] +rclone --include \[dq]*.txt\[dq] settier Hot remote:path/dir +\f[R] +.fi .PP -Originally controlling just the number of file checkers to run in -parallel, e.g. -by \f[C]rclone copy\f[R]. -Now a fairly universal parallelism control used by \f[C]rclone\f[R] in -several places. +Or just provide remote directory and all files in directory will be +tiered +.IP +.nf +\f[C] +rclone settier tier remote:path/dir +\f[R] +.fi +.IP +.nf +\f[C] +rclone settier tier remote:path [flags] +\f[R] +.fi +.SS Options +.IP +.nf +\f[C] + -h, --help help for settier +\f[R] +.fi .PP -Note: checkers do the equality checking of files during a sync. -For some storage systems (e.g. -S3, Swift, Dropbox) this can take a significant amount of time so they -are run in parallel. +See the global flags page (https://rclone.org/flags/) for global options +not listed here. +.SH SEE ALSO +.IP \[bu] 2 +rclone (https://rclone.org/commands/rclone/) - Show help for rclone +commands, flags and backends. +.SH rclone test .PP -The default is to run 8 checkers in parallel. -However, in case of slow-reacting backends you may need to lower (rather -than increase) this default by setting \f[C]--checkers\f[R] to 4 or less -threads. -This is especially advised if you are experiencing backend server -crashes during file checking phase (e.g. -on subsequent or top-up backups where little or no file copying is done -and checking takes up most of the time). -Increase this setting only with utmost care, while monitoring your -server health and file checking throughput. -.SS -c, --checksum +Run a test command +.SS Synopsis .PP -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. +Rclone test is used to run test commands. .PP -This is useful when the remote doesn\[aq]t support setting modified time -and a more accurate sync is desired than just checking the file size. +Select which test command you want with the subcommand, eg +.IP +.nf +\f[C] +rclone test memory remote: +\f[R] +.fi .PP -This is very useful when transferring between remotes which store the -same hash type on the object, e.g. -Drive and Swift. -For details of which remotes support which hash type see the table in -the overview section (https://rclone.org/overview/). +Each subcommand has its own options which you can see in their help. .PP -Eg \f[C]rclone --checksum sync s3:/bucket swift:/bucket\f[R] would run -much quicker than without the \f[C]--checksum\f[R] flag. +\f[B]NB\f[R] Be careful running these commands, they may do strange +things so reading their documentation first is recommended. +.SS Options +.IP +.nf +\f[C] + -h, --help help for test +\f[R] +.fi .PP -When using this flag, rclone won\[aq]t update mtimes of remote files if -they are incorrect as it would normally. -.SS --color WHEN +See the global flags page (https://rclone.org/flags/) for global options +not listed here. +.SH SEE ALSO +.IP \[bu] 2 +rclone (https://rclone.org/commands/rclone/) - Show help for rclone +commands, flags and backends. +.IP \[bu] 2 +rclone test +changenotify (https://rclone.org/commands/rclone_test_changenotify/) - +Log any change notify requests for the remote passed in. +.IP \[bu] 2 +rclone test +histogram (https://rclone.org/commands/rclone_test_histogram/) - Makes a +histogram of file name characters. +.IP \[bu] 2 +rclone test info (https://rclone.org/commands/rclone_test_info/) - +Discovers file name or other limitations for paths. +.IP \[bu] 2 +rclone test makefile (https://rclone.org/commands/rclone_test_makefile/) +- Make files with random contents of the size given +.IP \[bu] 2 +rclone test +makefiles (https://rclone.org/commands/rclone_test_makefiles/) - Make a +random file hierarchy in a directory +.IP \[bu] 2 +rclone test memory (https://rclone.org/commands/rclone_test_memory/) - +Load all the objects at remote:path into memory and report memory stats. +.SH rclone test changenotify .PP -Specify when colors (and other ANSI codes) should be added to the -output. +Log any change notify requests for the remote passed in. +.IP +.nf +\f[C] +rclone test changenotify remote: [flags] +\f[R] +.fi +.SS Options +.IP +.nf +\f[C] + -h, --help help for changenotify + --poll-interval Duration Time to wait between polling for changes (default 10s) +\f[R] +.fi .PP -\f[C]AUTO\f[R] (default) only allows ANSI codes when the output is a -terminal +See the global flags page (https://rclone.org/flags/) for global options +not listed here. +.SH SEE ALSO +.IP \[bu] 2 +rclone test (https://rclone.org/commands/rclone_test/) - Run a test +command +.SH rclone test histogram .PP -\f[C]NEVER\f[R] never allow ANSI codes +Makes a histogram of file name characters. +.SS Synopsis .PP -\f[C]ALWAYS\f[R] always add ANSI codes, regardless of the output format -(terminal or file) -.SS --compare-dest=DIR +This command outputs JSON which shows the histogram of characters used +in filenames in the remote:path specified. .PP -When using \f[C]sync\f[R], \f[C]copy\f[R] or \f[C]move\f[R] DIR is -checked in addition to the destination for files. -If a file identical to the source is found that file is NOT copied from -source. -This is useful to copy just files that have changed since the last -backup. -.PP -You must use the same remote as the destination of the sync. -The compare directory must not overlap the destination directory. -.PP -See \f[C]--copy-dest\f[R] and \f[C]--backup-dir\f[R]. -.SS --config=CONFIG_FILE -.PP -Specify the location of the rclone configuration file, to override the -default. -E.g. -\f[C]rclone config --config=\[dq]rclone.conf\[dq]\f[R]. -.PP -The exact default is a bit complex to describe, due to changes -introduced through different versions of rclone while preserving -backwards compatibility, but in most cases it is as simple as: -.IP \[bu] 2 -\f[C]%APPDATA%/rclone/rclone.conf\f[R] on Windows -.IP \[bu] 2 -\f[C]\[ti]/.config/rclone/rclone.conf\f[R] on other -.PP -The complete logic is as follows: Rclone will look for an existing -configuration file in any of the following locations, in priority order: -.IP "1." 3 -\f[C]rclone.conf\f[R] (in program directory, where rclone executable is) -.IP "2." 3 -\f[C]%APPDATA%/rclone/rclone.conf\f[R] (only on Windows) -.IP "3." 3 -\f[C]$XDG_CONFIG_HOME/rclone/rclone.conf\f[R] (on all systems, including -Windows) -.IP "4." 3 -\f[C]\[ti]/.config/rclone/rclone.conf\f[R] (see below for explanation of -\[ti] symbol) -.IP "5." 3 -\f[C]\[ti]/.rclone.conf\f[R] -.PP -If no existing configuration file is found, then a new one will be -created in the following location: -.IP \[bu] 2 -On Windows: Location 2 listed above, except in the unlikely event that -\f[C]APPDATA\f[R] is not defined, then location 4 is used instead. -.IP \[bu] 2 -On Unix: Location 3 if \f[C]XDG_CONFIG_HOME\f[R] is defined, else -location 4. -.IP \[bu] 2 -Fallback to location 5 (on all OS), when the rclone directory cannot be -created, but if also a home directory was not found then path -\f[C].rclone.conf\f[R] relative to current working directory will be -used as a final resort. +The data doesn\[aq]t contain any identifying information but is useful +for the rclone developers when developing filename compression. +.IP +.nf +\f[C] +rclone test histogram [remote:path] [flags] +\f[R] +.fi +.SS Options +.IP +.nf +\f[C] + -h, --help help for histogram +\f[R] +.fi .PP -The \f[C]\[ti]\f[R] symbol in paths above represent the home directory -of the current user on any OS, and the value is defined as following: -.IP \[bu] 2 -On Windows: \f[C]%HOME%\f[R] if defined, else \f[C]%USERPROFILE%\f[R], -or else \f[C]%HOMEDRIVE%\[rs]%HOMEPATH%\f[R]. +See the global flags page (https://rclone.org/flags/) for global options +not listed here. +.SH SEE ALSO .IP \[bu] 2 -On Unix: \f[C]$HOME\f[R] if defined, else by looking up current user in -OS-specific user database (e.g. -passwd file), or else use the result from shell command -\f[C]cd && pwd\f[R]. -.PP -If you run \f[C]rclone config file\f[R] you will see where the default -location is for you. -.PP -The fact that an existing file \f[C]rclone.conf\f[R] in the same -directory as the rclone executable is always preferred, means that it is -easy to run in \[dq]portable\[dq] mode by downloading rclone executable -to a writable directory and then create an empty file -\f[C]rclone.conf\f[R] in the same directory. +rclone test (https://rclone.org/commands/rclone_test/) - Run a test +command +.SH rclone test info .PP -If the location is set to empty string \f[C]\[dq]\[dq]\f[R] or path to a -file with name \f[C]notfound\f[R], or the os null device represented by -value \f[C]NUL\f[R] on Windows and \f[C]/dev/null\f[R] on Unix systems, -then rclone will keep the config file in memory only. +Discovers file name or other limitations for paths. +.SS Synopsis .PP -The file format is basic -INI (https://en.wikipedia.org/wiki/INI_file#Format): Sections of text, -led by a \f[C][section]\f[R] header and followed by \f[C]key=value\f[R] -entries on separate lines. -In rclone each remote is represented by its own section, where the -section name defines the name of the remote. -Options are specified as the \f[C]key=value\f[R] entries, where the key -is the option name without the \f[C]--backend-\f[R] prefix, in lowercase -and with \f[C]_\f[R] instead of \f[C]-\f[R]. -E.g. -option \f[C]--mega-hard-delete\f[R] corresponds to key -\f[C]hard_delete\f[R]. -Only backend options can be specified. -A special, and required, key \f[C]type\f[R] identifies the storage -system (https://rclone.org/overview/), where the value is the internal -lowercase name as returned by command \f[C]rclone help backends\f[R]. -Comments are indicated by \f[C];\f[R] or \f[C]#\f[R] at the beginning of -a line. +rclone info discovers what filenames and upload methods are possible to +write to the paths passed in and how long they can be. +It can take some time. +It will write test files into the remote:path passed in. +It outputs a bit of go code for each one. .PP -Example: +\f[B]NB\f[R] this can create undeletable files and other hazards - use +with care .IP .nf \f[C] -[megaremote] -type = mega -user = you\[at]example.com -pass = PDPcQVVjVtzFY-GTdDFozqBhTdsPg3qH +rclone test info [remote:path]+ [flags] \f[R] .fi -.PP -Note that passwords are in -obscured (https://rclone.org/commands/rclone_obscure/) form. -Also, many storage systems uses token-based authentication instead of -passwords, and this requires additional steps. -It is easier, and safer, to use the interactive command -\f[C]rclone config\f[R] instead of manually editing the configuration -file. -.PP -The configuration file will typically contain login information, and -should therefore have restricted permissions so that only the current -user can read it. -Rclone tries to ensure this when it writes the file. -You may also choose to encrypt the file. -.PP -When token-based authentication are used, the configuration file must be -writable, because rclone needs to update the tokens inside it. -.PP -To reduce risk of corrupting an existing configuration file, rclone will -not write directly to it when saving changes. -Instead it will first write to a new, temporary, file. -If a configuration file already existed, it will (on Unix systems) try -to mirror its permissions to the new file. -Then it will rename the existing file to a temporary name as backup. -Next, rclone will rename the new file to the correct name, before -finally cleaning up by deleting the backup file. -.PP -If the configuration file path used by rclone is a symbolic link, then -this will be evaluated and rclone will write to the resolved path, -instead of overwriting the symbolic link. -Temporary files used in the process (described above) will be written to -the same parent directory as that of the resolved configuration file, -but if this directory is also a symbolic link it will not be resolved -and the temporary files will be written to the location of the directory -symbolic link. -.SS --contimeout=TIME -.PP -Set the connection timeout. -This should be in go time format which looks like \f[C]5s\f[R] for 5 -seconds, \f[C]10m\f[R] for 10 minutes, or \f[C]3h30m\f[R]. -.PP -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 \f[C]1m\f[R] by default. -.SS --copy-dest=DIR -.PP -When using \f[C]sync\f[R], \f[C]copy\f[R] or \f[C]move\f[R] DIR is -checked in addition to the destination for files. -If a file identical to the source is found that file is server-side -copied from DIR to the destination. -This is useful for incremental backup. -.PP -The remote in use must support server-side copy and you must use the -same remote as the destination of the sync. -The compare directory must not overlap the destination directory. -.PP -See \f[C]--compare-dest\f[R] and \f[C]--backup-dir\f[R]. -.SS --dedupe-mode MODE -.PP -Mode to run dedupe command in. -One of \f[C]interactive\f[R], \f[C]skip\f[R], \f[C]first\f[R], -\f[C]newest\f[R], \f[C]oldest\f[R], \f[C]rename\f[R]. -The default is \f[C]interactive\f[R]. -.PD 0 -.P -.PD -See the dedupe command for more information as to what these options -mean. -.SS --default-time TIME -.PP -If a file or directory does have a modification time rclone can read -then rclone will display this fixed time instead. -.PP -The default is \f[C]2000-01-01 00:00:00 UTC\f[R]. -This can be configured in any of the ways shown in the time or duration -options. -.PP -For example \f[C]--default-time 2020-06-01\f[R] to set the default time -to the 1st of June 2020 or \f[C]--default-time 0s\f[R] to set the -default time to the time rclone started up. -.SS --disable FEATURE,FEATURE,... -.PP -This disables a comma separated list of optional features. -For example to disable server-side move and server-side copy use: +.SS Options .IP .nf \f[C] ---disable move,copy + --all Run all tests + --check-base32768 Check can store all possible base32768 characters + --check-control Check control characters + --check-length Check max filename length + --check-normalization Check UTF-8 Normalization + --check-streaming Check uploads with indeterminate file size + -h, --help help for info + --upload-wait Duration Wait after writing a file (default 0s) + --write-json string Write results to file \f[R] .fi .PP -The features can be put in any case. +See the global flags page (https://rclone.org/flags/) for global options +not listed here. +.SH SEE ALSO +.IP \[bu] 2 +rclone test (https://rclone.org/commands/rclone_test/) - Run a test +command +.SH rclone test makefile .PP -To see a list of which features can be disabled use: +Make files with random contents of the size given .IP .nf \f[C] ---disable help +rclone test makefile []+ [flags] \f[R] .fi -.PP -The features a remote has can be seen in JSON format with: +.SS Options .IP .nf \f[C] -rclone backend features remote: + --ascii Fill files with random ASCII printable bytes only + --chargen Fill files with a ASCII chargen pattern + -h, --help help for makefile + --pattern Fill files with a periodic pattern + --seed int Seed for the random number generator (0 for random) (default 1) + --sparse Make the files sparse (appear to be filled with ASCII 0x00) + --zero Fill files with ASCII 0x00 \f[R] .fi .PP -See the overview features (https://rclone.org/overview/#features) and -optional features (https://rclone.org/overview/#optional-features) to -get an idea of which feature does what. -.PP -Note that some features can be set to \f[C]true\f[R] if they are -\f[C]true\f[R]/\f[C]false\f[R] feature flag features by prefixing them -with \f[C]!\f[R]. -For example the \f[C]CaseInsensitive\f[R] feature can be forced to -\f[C]false\f[R] with \f[C]--disable CaseInsensitive\f[R] and forced to -\f[C]true\f[R] with \f[C]--disable \[aq]!CaseInsensitive\[aq]\f[R]. -In general it isn\[aq]t a good idea doing this but it may be useful in -extremis. -.PP -(Note that \f[C]!\f[R] is a shell command which you will need to escape -with single quotes or a backslash on unix like platforms.) -.PP -This flag can be useful for debugging and in exceptional circumstances -(e.g. -Google Drive limiting the total volume of Server Side Copies to 100 -GiB/day). -.SS --disable-http2 -.PP -This stops rclone from trying to use HTTP/2 if available. -This can sometimes speed up transfers due to a problem in the Go -standard library (https://github.com/golang/go/issues/37373). -.SS --dscp VALUE -.PP -Specify a DSCP value or name to use in connections. -This could help QoS system to identify traffic class. -BE, EF, DF, LE, CSx and AFxx are allowed. -.PP -See the description of differentiated -services (https://en.wikipedia.org/wiki/Differentiated_services) to get -an idea of this field. -Setting this to 1 (LE) to identify the flow to SCAVENGER class can avoid -occupying too much bandwidth in a network with DiffServ support (RFC -8622 (https://tools.ietf.org/html/rfc8622)). +See the global flags page (https://rclone.org/flags/) for global options +not listed here. +.SH SEE ALSO +.IP \[bu] 2 +rclone test (https://rclone.org/commands/rclone_test/) - Run a test +command +.SH rclone test makefiles .PP -For example, if you configured QoS on router to handle LE properly. -Running: +Make a random file hierarchy in a directory .IP .nf \f[C] -rclone copy --dscp LE from:/from to:/to +rclone test makefiles [flags] +\f[R] +.fi +.SS Options +.IP +.nf +\f[C] + --ascii Fill files with random ASCII printable bytes only + --chargen Fill files with a ASCII chargen pattern + --files int Number of files to create (default 1000) + --files-per-directory int Average number of files per directory (default 10) + -h, --help help for makefiles + --max-depth int Maximum depth of directory hierarchy (default 10) + --max-file-size SizeSuffix Maximum size of files to create (default 100) + --max-name-length int Maximum size of file names (default 12) + --min-file-size SizeSuffix Minimum size of file to create + --min-name-length int Minimum size of file names (default 4) + --pattern Fill files with a periodic pattern + --seed int Seed for the random number generator (0 for random) (default 1) + --sparse Make the files sparse (appear to be filled with ASCII 0x00) + --zero Fill files with ASCII 0x00 \f[R] .fi .PP -would make the priority lower than usual internet flows. -.PP -This option has no effect on Windows (see -golang/go#42728 (https://github.com/golang/go/issues/42728)). -.SS -n, --dry-run -.PP -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 \f[C]sync\f[R] command which deletes files in -the destination. -.SS --expect-continue-timeout=TIME -.PP -This specifies the amount of time to wait for a server\[aq]s first -response headers after fully writing the request headers if the request -has an \[dq]Expect: 100-continue\[dq] header. -Not all backends support using this. -.PP -Zero means no timeout and causes the body to be sent immediately, -without waiting for the server to approve. -This time does not include the time to send the request header. -.PP -The default is \f[C]1s\f[R]. -Set to \f[C]0\f[R] to disable. -.SS --error-on-no-transfer -.PP -By default, rclone will exit with return code 0 if there were no errors. -.PP -This option allows rclone to return exit code 9 if no files were -transferred between the source and destination. -This allows using rclone in scripts, and triggering follow-on actions if -data was copied, or skipping if not. +See the global flags page (https://rclone.org/flags/) for global options +not listed here. +.SH SEE ALSO +.IP \[bu] 2 +rclone test (https://rclone.org/commands/rclone_test/) - Run a test +command +.SH rclone test memory .PP -NB: Enabling this option turns a usually non-fatal error into a -potentially fatal one - please check and adjust your scripts -accordingly! -.SS --fs-cache-expire-duration=TIME +Load all the objects at remote:path into memory and report memory stats. +.IP +.nf +\f[C] +rclone test memory remote:path [flags] +\f[R] +.fi +.SS Options +.IP +.nf +\f[C] + -h, --help help for memory +\f[R] +.fi .PP -When using rclone via the API rclone caches created remotes for 5 -minutes by default in the \[dq]fs cache\[dq]. -This means that if you do repeated actions on the same remote then -rclone won\[aq]t have to build it again from scratch, which makes it -more efficient. +See the global flags page (https://rclone.org/flags/) for global options +not listed here. +.SH SEE ALSO +.IP \[bu] 2 +rclone test (https://rclone.org/commands/rclone_test/) - Run a test +command +.SH rclone touch .PP -This flag sets the time that the remotes are cached for. -If you set it to \f[C]0\f[R] (or negative) then rclone won\[aq]t cache -the remotes at all. +Create new file or change file modification time. +.SS Synopsis .PP -Note that if you use some flags, eg \f[C]--backup-dir\f[R] and if this -is set to \f[C]0\f[R] rclone may build two remotes (one for the source -or destination and one for the \f[C]--backup-dir\f[R] where it may have -only built one before. -.SS --fs-cache-expire-interval=TIME +Set the modification time on file(s) as specified by remote:path to have +the current time. .PP -This controls how often rclone checks for cached remotes to expire. -See the \f[C]--fs-cache-expire-duration\f[R] documentation above for -more info. -The default is 60s, set to 0 to disable expiry. -.SS --header +If remote:path does not exist then a zero sized file will be created, +unless \f[C]--no-create\f[R] or \f[C]--recursive\f[R] is provided. .PP -Add an HTTP header for all transactions. -The flag can be repeated to add multiple headers. +If \f[C]--recursive\f[R] is used then recursively sets the modification +time on all existing files that is found under the path. +Filters are supported, and you can test with the \f[C]--dry-run\f[R] or +the \f[C]--interactive\f[R]/\f[C]-i\f[R] flag. .PP -If you want to add headers only for uploads use -\f[C]--header-upload\f[R] and if you want to add headers only for -downloads use \f[C]--header-download\f[R]. +If \f[C]--timestamp\f[R] is used then sets the modification time to that +time instead of the current time. +Times may be specified as one of: +.IP \[bu] 2 +\[aq]YYMMDD\[aq] - e.g. +17.10.30 +.IP \[bu] 2 +\[aq]YYYY-MM-DDTHH:MM:SS\[aq] - e.g. +2006-01-02T15:04:05 +.IP \[bu] 2 +\[aq]YYYY-MM-DDTHH:MM:SS.SSS\[aq] - e.g. +2006-01-02T15:04:05.123456789 .PP -This flag is supported for all HTTP based backends even those not -supported by \f[C]--header-upload\f[R] and \f[C]--header-download\f[R] -so may be used as a workaround for those with care. +Note that value of \f[C]--timestamp\f[R] is in UTC. +If you want local time then add the \f[C]--localtime\f[R] flag. .IP .nf \f[C] -rclone ls remote:test --header \[dq]X-Rclone: Foo\[dq] --header \[dq]X-LetMeIn: Yes\[dq] +rclone touch remote:path [flags] \f[R] .fi -.SS --header-download +.SS Options +.IP +.nf +\f[C] + -h, --help help for touch + --localtime Use localtime for timestamp, not UTC + -C, --no-create Do not create the file if it does not exist (implied with --recursive) + -R, --recursive Recursively touch all files + -t, --timestamp string Use specified time instead of the current time of day +\f[R] +.fi +.SS Important Options .PP -Add an HTTP header for all download transactions. -The flag can be repeated to add multiple headers. +Important flags useful for most commands. .IP .nf \f[C] -rclone sync --interactive s3:test/src \[ti]/dst --header-download \[dq]X-Amz-Meta-Test: Foo\[dq] --header-download \[dq]X-Amz-Meta-Test2: Bar\[dq] + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) \f[R] .fi +.SS Filter Options .PP -See the GitHub issue here (https://github.com/rclone/rclone/issues/59) -for currently supported backends. -.SS --header-upload +Flags for filtering directory listings. +.IP +.nf +\f[C] + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +\f[R] +.fi +.SS Listing Options .PP -Add an HTTP header for all upload transactions. -The flag can be repeated to add multiple headers. +Flags for listing directories. .IP .nf \f[C] -rclone sync --interactive \[ti]/src s3:test/dst --header-upload \[dq]Content-Disposition: attachment; filename=\[aq]cool.html\[aq]\[dq] --header-upload \[dq]X-Amz-Meta-Test: FooBar\[dq] + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions \f[R] .fi .PP -See the GitHub issue here (https://github.com/rclone/rclone/issues/59) -for currently supported backends. -.SS --human-readable +See the global flags page (https://rclone.org/flags/) for global options +not listed here. +.SH SEE ALSO +.IP \[bu] 2 +rclone (https://rclone.org/commands/rclone/) - Show help for rclone +commands, flags and backends. +.SH rclone tree .PP -Rclone commands output values for sizes (e.g. -number of bytes) and counts (e.g. -number of files) either as \f[I]raw\f[R] numbers, or in -\f[I]human-readable\f[R] format. +List the contents of the remote in a tree like fashion. +.SS Synopsis .PP -In human-readable format the values are scaled to larger units, -indicated with a suffix shown after the value, and rounded to three -decimals. -Rclone consistently uses binary units (powers of 2) for sizes and -decimal units (powers of 10) for counts. -The unit prefix for size is according to IEC standard notation, e.g. -\f[C]Ki\f[R] for kibi. -Used with byte unit, \f[C]1 KiB\f[R] means 1024 Byte. -In list type of output, only the unit prefix appended to the value (e.g. -\f[C]9.762Ki\f[R]), while in more textual output the full unit is shown -(e.g. -\f[C]9.762 KiB\f[R]). -For counts the SI standard notation is used, e.g. -prefix \f[C]k\f[R] for kilo. -Used with file counts, \f[C]1k\f[R] means 1000 files. -.PP -The various list (https://rclone.org/commands/rclone_ls/) commands -output raw numbers by default. -Option \f[C]--human-readable\f[R] will make them output values in -human-readable format instead (with the short unit prefix). +rclone tree lists the contents of a remote in a similar way to the unix +tree command. .PP -The about (https://rclone.org/commands/rclone_about/) command outputs -human-readable by default, with a command-specific option -\f[C]--full\f[R] to output the raw numbers instead. +For example +.IP +.nf +\f[C] +$ rclone tree remote:path +/ +\[u251C]\[u2500]\[u2500] file1 +\[u251C]\[u2500]\[u2500] file2 +\[u251C]\[u2500]\[u2500] file3 +\[u2514]\[u2500]\[u2500] subdir + \[u251C]\[u2500]\[u2500] file4 + \[u2514]\[u2500]\[u2500] file5 + +1 directories, 5 files +\f[R] +.fi .PP -Command size (https://rclone.org/commands/rclone_size/) outputs both -human-readable and raw numbers in the same output. +You can use any of the filtering options with the tree command (e.g. +\f[C]--include\f[R] and \f[C]--exclude\f[R]. +You can also use \f[C]--fast-list\f[R]. .PP -The tree (https://rclone.org/commands/rclone_tree/) command also -considers \f[C]--human-readable\f[R], but it will not use the exact same -notation as the other commands: It rounds to one decimal, and uses -single letter suffix, e.g. -\f[C]K\f[R] instead of \f[C]Ki\f[R]. -The reason for this is that it relies on an external library. +The tree command has many options for controlling the listing which are +compatible with the tree command, for example you can include file sizes +with \f[C]--size\f[R]. +Note that not all of them have short options as they conflict with +rclone\[aq]s short options. .PP -The interactive command ncdu (https://rclone.org/commands/rclone_ncdu/) -shows human-readable by default, and responds to key \f[C]u\f[R] for -toggling human-readable format. -.SS --ignore-case-sync +For a more interactive navigation of the remote see the +ncdu (https://rclone.org/commands/rclone_ncdu/) command. +.IP +.nf +\f[C] +rclone tree remote:path [flags] +\f[R] +.fi +.SS Options +.IP +.nf +\f[C] + -a, --all All files are listed (list . files too) + -d, --dirs-only List directories only + --dirsfirst List directories before files (-U disables) + --full-path Print the full path prefix for each file + -h, --help help for tree + --level int Descend only level directories deep + -D, --modtime Print the date of last modification. + --noindent Don\[aq]t print indentation lines + --noreport Turn off file/directory count at end of tree listing + -o, --output string Output to file instead of stdout + -p, --protections Print the protections for each file. + -Q, --quote Quote filenames with double quotes. + -s, --size Print the size in bytes of each file. + --sort string Select sort: name,version,size,mtime,ctime + --sort-ctime Sort files by last status change time + -t, --sort-modtime Sort files by last modification time + -r, --sort-reverse Reverse the order of the sort + -U, --unsorted Leave files unsorted + --version Sort files alphanumerically by version +\f[R] +.fi +.SS Filter Options .PP -Using this option will cause rclone to ignore the case of the files when -synchronizing so files will not be copied/synced when the existing -filenames are the same, even if the casing is different. -.SS --ignore-checksum +Flags for filtering directory listings. +.IP +.nf +\f[C] + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) +\f[R] +.fi +.SS Listing Options .PP -Normally rclone will check that the checksums of transferred files -match, and give an error \[dq]corrupted on transfer\[dq] if they -don\[aq]t. +Flags for listing directories. +.IP +.nf +\f[C] + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions +\f[R] +.fi .PP -You can use this option to skip that check. -You should only use it if you have had the \[dq]corrupted on -transfer\[dq] error message and you are sure you might want to transfer -potentially corrupted data. -.SS --ignore-existing +See the global flags page (https://rclone.org/flags/) for global options +not listed here. +.SH SEE ALSO +.IP \[bu] 2 +rclone (https://rclone.org/commands/rclone/) - Show help for rclone +commands, flags and backends. +.SS Copying single files .PP -Using this option will make rclone unconditionally skip all files that -exist on the destination, no matter the content of these files. +rclone normally syncs or copies directories. +However, if the source remote points to a file, rclone will just copy +that file. +The destination remote must point to a directory - rclone will give the +error +\f[C]Failed to create file system for \[dq]remote:file\[dq]: is a file not a directory\f[R] +if it isn\[aq]t. .PP -While this isn\[aq]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. +For example, suppose you have a remote with a file in called +\f[C]test.jpg\f[R], then you could copy just that file like this +.IP +.nf +\f[C] +rclone copy remote:test.jpg /tmp/download +\f[R] +.fi .PP -When performing a \f[C]move\f[R]/\f[C]moveto\f[R] command, this flag -will leave skipped files in the source location unchanged when a file -with the same name exists on the destination. -.SS --ignore-size +The file \f[C]test.jpg\f[R] will be placed inside +\f[C]/tmp/download\f[R]. .PP -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 modification time. -If \f[C]--checksum\f[R] is set then it only checks the checksum. +This is equivalent to specifying +.IP +.nf +\f[C] +rclone copy --files-from /tmp/files remote: /tmp/download +\f[R] +.fi .PP -It will also cause rclone to skip verifying the sizes are the same after -transfer. +Where \f[C]/tmp/files\f[R] contains the single line +.IP +.nf +\f[C] +test.jpg +\f[R] +.fi .PP -This can be useful for transferring files to and from OneDrive which -occasionally misreports the size of image files (see -#399 (https://github.com/rclone/rclone/issues/399) for more info). -.SS -I, --ignore-times +It is recommended to use \f[C]copy\f[R] when copying individual files, +not \f[C]sync\f[R]. +They have pretty much the same effect but \f[C]copy\f[R] will use a lot +less memory. +.SS Syntax of remote paths .PP -Using this option will cause rclone to unconditionally upload all files -regardless of the state of files on the destination. +The syntax of the paths passed to the rclone command are as follows. +.SS /path/to/dir .PP -Normally rclone would skip any files that have the same modification -time and are the same size (or have the same checksum if using -\f[C]--checksum\f[R]). -.SS --immutable +This refers to the local file system. .PP -Treat source and destination files as immutable and disallow -modification. +On Windows \f[C]\[rs]\f[R] may be used instead of \f[C]/\f[R] in local +paths \f[B]only\f[R], non local paths must use \f[C]/\f[R]. +See local filesystem (https://rclone.org/local/#paths-on-windows) +documentation for more about Windows-specific paths. .PP -With this option set, files will be created and deleted as requested, -but existing files will never be updated. -If an existing file does not match between the source and destination, -rclone will give the error -\f[C]Source and destination exist but do not match: immutable file modified\f[R]. +These paths needn\[aq]t start with a leading \f[C]/\f[R] - if they +don\[aq]t then they will be relative to the current directory. +.SS remote:path/to/dir .PP -Note that only commands which transfer files (e.g. -\f[C]sync\f[R], \f[C]copy\f[R], \f[C]move\f[R]) are affected by this -behavior, and only modification is disallowed. -Files may still be deleted explicitly (e.g. -\f[C]delete\f[R], \f[C]purge\f[R]) or implicitly (e.g. -\f[C]sync\f[R], \f[C]move\f[R]). -Use \f[C]copy --immutable\f[R] if it is desired to avoid deletion as -well as modification. +This refers to a directory \f[C]path/to/dir\f[R] on \f[C]remote:\f[R] as +defined in the config file (configured with \f[C]rclone config\f[R]). +.SS remote:/path/to/dir .PP -This can be useful as an additional layer of protection for immutable or -append-only data sets (notably backup archives), where modification -implies corruption and should not be propagated. -.SS --inplace +On most backends this is refers to the same directory as +\f[C]remote:path/to/dir\f[R] and that format should be preferred. +On a very small number of remotes (FTP, SFTP, Dropbox for business) this +will refer to a different directory. +On these, paths without a leading \f[C]/\f[R] will refer to your +\[dq]home\[dq] directory and paths with a leading \f[C]/\f[R] will refer +to the root. +.SS :backend:path/to/dir .PP -The \f[C]--inplace\f[R] flag changes the behaviour of rclone when -uploading files to some backends (backends with the -\f[C]PartialUploads\f[R] feature flag set) such as: -.IP \[bu] 2 -local -.IP \[bu] 2 -ftp -.IP \[bu] 2 -sftp +This is an advanced form for creating remotes on the fly. +\f[C]backend\f[R] should be the name or prefix of a backend (the +\f[C]type\f[R] in the config file) and all the configuration for the +backend should be provided on the command line (or in environment +variables). .PP -Without \f[C]--inplace\f[R] (the default) rclone will first upload to a -temporary file with an extension like this where \f[C]XXXXXX\f[R] -represents a random string. +Here are some examples: .IP .nf \f[C] -original-file-name.XXXXXX.partial +rclone lsd --http-url https://pub.rclone.org :http: \f[R] .fi .PP -(rclone will make sure the final name is no longer than 100 characters -by truncating the \f[C]original-file-name\f[R] part if necessary). +To list all the directories in the root of +\f[C]https://pub.rclone.org/\f[R]. +.IP +.nf +\f[C] +rclone lsf --http-url https://example.com :http:path/to/dir +\f[R] +.fi .PP -When the upload is complete, rclone will rename the \f[C].partial\f[R] -file to the correct name, overwriting any existing file at that point. -If the upload fails then the \f[C].partial\f[R] file will be deleted. +To list files and directories in +\f[C]https://example.com/path/to/dir/\f[R] +.IP +.nf +\f[C] +rclone copy --http-url https://example.com :http:path/to/dir /tmp/dir +\f[R] +.fi .PP -This prevents other users of the backend from seeing partially uploaded -files in their new names and prevents overwriting the old file until the -new one is completely uploaded. +To copy files and directories in +\f[C]https://example.com/path/to/dir\f[R] to \f[C]/tmp/dir\f[R]. +.IP +.nf +\f[C] +rclone copy --sftp-host example.com :sftp:path/to/dir /tmp/dir +\f[R] +.fi .PP -If the \f[C]--inplace\f[R] flag is supplied, rclone will upload directly -to the final name without creating a \f[C].partial\f[R] file. +To copy files and directories from \f[C]example.com\f[R] in the relative +directory \f[C]path/to/dir\f[R] to \f[C]/tmp/dir\f[R] using sftp. +.SS Connection strings .PP -This means that an incomplete file will be visible in the directory -listings while the upload is in progress and any existing files will be -overwritten as soon as the upload starts. -If the transfer fails then the file will be deleted. -This can cause data loss of the existing file if the transfer fails. +The above examples can also be written using a connection string syntax, +so instead of providing the arguments as command line parameters +\f[C]--http-url https://pub.rclone.org\f[R] they are provided as part of +the remote specification as a kind of connection string. +.IP +.nf +\f[C] +rclone lsd \[dq]:http,url=\[aq]https://pub.rclone.org\[aq]:\[dq] +rclone lsf \[dq]:http,url=\[aq]https://example.com\[aq]:path/to/dir\[dq] +rclone copy \[dq]:http,url=\[aq]https://example.com\[aq]:path/to/dir\[dq] /tmp/dir +rclone copy :sftp,host=example.com:path/to/dir /tmp/dir +\f[R] +.fi .PP -Note that on the local file system if you don\[aq]t use -\f[C]--inplace\f[R] hard links (Unix only) will be broken. -And if you do use \f[C]--inplace\f[R] you won\[aq]t be able to update in -use executables. +These can apply to modify existing remotes as well as create new remotes +with the on the fly syntax. +This example is equivalent to adding the +\f[C]--drive-shared-with-me\f[R] parameter to the remote +\f[C]gdrive:\f[R]. +.IP +.nf +\f[C] +rclone lsf \[dq]gdrive,shared_with_me:path/to/dir\[dq] +\f[R] +.fi .PP -Note also that versions of rclone prior to v1.63.0 behave as if the -\f[C]--inplace\f[R] flag is always supplied. -.SS -i, --interactive +The major advantage to using the connection string style syntax is that +it only applies to the remote, not to all the remotes of that type of +the command line. +A common confusion is this attempt to copy a file shared on google drive +to the normal drive which \f[B]does not work\f[R] because the +\f[C]--drive-shared-with-me\f[R] flag applies to both the source and the +destination. +.IP +.nf +\f[C] +rclone copy --drive-shared-with-me gdrive:shared-file.txt gdrive: +\f[R] +.fi .PP -This flag can be used to tell rclone that you wish a manual confirmation -before destructive operations. +However using the connection string syntax, this does work. +.IP +.nf +\f[C] +rclone copy \[dq]gdrive,shared_with_me:shared-file.txt\[dq] gdrive: +\f[R] +.fi .PP -It is \f[B]recommended\f[R] that you use this flag while learning rclone -especially with \f[C]rclone sync\f[R]. +Note that the connection string only affects the options of the +immediate backend. +If for example gdriveCrypt is a crypt based on gdrive, then the +following command \f[B]will not work\f[R] as intended, because +\f[C]shared_with_me\f[R] is ignored by the crypt backend: +.IP +.nf +\f[C] +rclone copy \[dq]gdriveCrypt,shared_with_me:shared-file.txt\[dq] gdriveCrypt: +\f[R] +.fi .PP -For example +The connection strings have the following syntax .IP .nf \f[C] -$ rclone delete --interactive /tmp/dir -rclone: delete \[dq]important-file.txt\[dq]? -y) Yes, this is OK (default) -n) No, skip this -s) Skip all delete operations with no more questions -!) Do all delete operations with no more questions -q) Exit rclone now. -y/n/s/!/q> n +remote,parameter=value,parameter2=value2:path/to/dir +:backend,parameter=value,parameter2=value2:path/to/dir \f[R] .fi .PP -The options mean -.IP \[bu] 2 -\f[C]y\f[R]: \f[B]Yes\f[R], this operation should go ahead. -You can also press Return for this to happen. -You\[aq]ll be asked every time unless you choose \f[C]s\f[R] or -\f[C]!\f[R]. -.IP \[bu] 2 -\f[C]n\f[R]: \f[B]No\f[R], do not do this operation. -You\[aq]ll be asked every time unless you choose \f[C]s\f[R] or -\f[C]!\f[R]. -.IP \[bu] 2 -\f[C]s\f[R]: \f[B]Skip\f[R] all the following operations of this type -with no more questions. -This takes effect until rclone exits. -If there are any different kind of operations you\[aq]ll be prompted for -them. -.IP \[bu] 2 -\f[C]!\f[R]: \f[B]Do all\f[R] the following operations with no more -questions. -Useful if you\[aq]ve decided that you don\[aq]t mind rclone doing that -kind of operation. -This takes effect until rclone exits . -If there are any different kind of operations you\[aq]ll be prompted for -them. -.IP \[bu] 2 -\f[C]q\f[R]: \f[B]Quit\f[R] rclone now, just in case! -.SS --leave-root +If the \f[C]parameter\f[R] has a \f[C]:\f[R] or \f[C],\f[R] then it must +be placed in quotes \f[C]\[dq]\f[R] or \f[C]\[aq]\f[R], so +.IP +.nf +\f[C] +remote,parameter=\[dq]colon:value\[dq],parameter2=\[dq]comma,value\[dq]:path/to/dir +:backend,parameter=\[aq]colon:value\[aq],parameter2=\[aq]comma,value\[aq]:path/to/dir +\f[R] +.fi .PP -During rmdirs it will not remove root directory, even if it\[aq]s empty. -.SS --log-file=FILE +If a quoted value needs to include that quote, then it should be +doubled, so +.IP +.nf +\f[C] +remote,parameter=\[dq]with\[dq]\[dq]quote\[dq],parameter2=\[aq]with\[aq]\[aq]quote\[aq]:path/to/dir +\f[R] +.fi .PP -Log all of rclone\[aq]s output to FILE. -This is not active by default. -This can be useful for tracking down problems with syncs in combination -with the \f[C]-v\f[R] flag. -See the Logging section for more info. +This will make \f[C]parameter\f[R] be \f[C]with\[dq]quote\f[R] and +\f[C]parameter2\f[R] be \f[C]with\[aq]quote\f[R]. .PP -If FILE exists then rclone will append to it. +If you leave off the \f[C]=parameter\f[R] then rclone will substitute +\f[C]=true\f[R] which works very well with flags. +For example, to use s3 configured in the environment you could use: +.IP +.nf +\f[C] +rclone lsd :s3,env_auth: +\f[R] +.fi .PP -Note that if you are using the \f[C]logrotate\f[R] program to manage -rclone\[aq]s logs, then you should use the \f[C]copytruncate\f[R] option -as rclone doesn\[aq]t have a signal to rotate logs. -.SS --log-format LIST +Which is equivalent to +.IP +.nf +\f[C] +rclone lsd :s3,env_auth=true: +\f[R] +.fi .PP -Comma separated list of log format options. -Accepted options are \f[C]date\f[R], \f[C]time\f[R], -\f[C]microseconds\f[R], \f[C]pid\f[R], \f[C]longfile\f[R], -\f[C]shortfile\f[R], \f[C]UTC\f[R]. -Any other keywords will be silently ignored. -\f[C]pid\f[R] will tag log messages with process identifier which useful -with \f[C]rclone mount --daemon\f[R]. -Other accepted options are explained in the go -documentation (https://pkg.go.dev/log#pkg-constants). -The default log format is \[dq]\f[C]date\f[R],\f[C]time\f[R]\[dq]. -.SS --log-level LEVEL +Note that on the command line you might need to surround these +connection strings with \f[C]\[dq]\f[R] or \f[C]\[aq]\f[R] to stop the +shell interpreting any special characters within them. .PP -This sets the log level for rclone. -The default log level is \f[C]NOTICE\f[R]. +If you are a shell master then you\[aq]ll know which strings are OK and +which aren\[aq]t, but if you aren\[aq]t sure then enclose them in +\f[C]\[dq]\f[R] and use \f[C]\[aq]\f[R] as the inside quote. +This syntax works on all OSes. +.IP +.nf +\f[C] +rclone copy \[dq]:http,url=\[aq]https://example.com\[aq]:path/to/dir\[dq] /tmp/dir +\f[R] +.fi .PP -\f[C]DEBUG\f[R] is equivalent to \f[C]-vv\f[R]. -It outputs lots of debug info - useful for bug reports and really -finding out what rclone is doing. +On Linux/macOS some characters are still interpreted inside +\f[C]\[dq]\f[R] strings in the shell (notably \f[C]\[rs]\f[R] and +\f[C]$\f[R] and \f[C]\[dq]\f[R]) so if your strings contain those you +can swap the roles of \f[C]\[dq]\f[R] and \f[C]\[aq]\f[R] thus. +(This syntax does not work on Windows.) +.IP +.nf +\f[C] +rclone copy \[aq]:http,url=\[dq]https://example.com\[dq]:path/to/dir\[aq] /tmp/dir +\f[R] +.fi +.SS Connection strings, config and logging .PP -\f[C]INFO\f[R] is equivalent to \f[C]-v\f[R]. -It outputs information about each transfer and prints stats once a -minute by default. +If you supply extra configuration to a backend by command line flag, +environment variable or connection string then rclone will add a suffix +based on the hash of the config to the name of the remote, eg +.IP +.nf +\f[C] +rclone -vv lsf --s3-chunk-size 20M s3: +\f[R] +.fi .PP -\f[C]NOTICE\f[R] is the default log level if no logging flags are -supplied. -It outputs very little when things are working normally. -It outputs warnings and significant events. -.PP -\f[C]ERROR\f[R] is equivalent to \f[C]-q\f[R]. -It only outputs error messages. -.SS --use-json-log -.PP -This switches the log format to JSON for rclone. -The fields of json log are level, msg, source, time. -.SS --low-level-retries NUMBER +Has the log message +.IP +.nf +\f[C] +DEBUG : s3: detected overridden config - adding \[dq]{Srj1p}\[dq] suffix to name +\f[R] +.fi .PP -This controls the number of low level retries rclone does. +This is so rclone can tell the modified remote apart from the unmodified +remote when caching the backends. .PP -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 \f[C]-v\f[R] flag. +This should only be noticeable in the logs. .PP -This shouldn\[aq]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 -\f[C]--retries\f[R] flag) quicker. +This means that on the fly backends such as +.IP +.nf +\f[C] +rclone -vv lsf :s3,env_auth: +\f[R] +.fi .PP -Disable low level retries with \f[C]--low-level-retries 1\f[R]. -.SS --max-backlog=N +Will get their own names +.IP +.nf +\f[C] +DEBUG : :s3: detected overridden config - adding \[dq]{YTu53}\[dq] suffix to name +\f[R] +.fi +.SS Valid remote names .PP -This is the maximum allowable backlog of files in a sync/copy/move -queued for being checked or transferred. +Remote names are case sensitive, and must adhere to the following rules: +- May contain number, letter, \f[C]_\f[R], \f[C]-\f[R], \f[C].\f[R], +\f[C]+\f[R], \f[C]\[at]\f[R] and space. +- May not start with \f[C]-\f[R] or space. +- May not end with space. .PP -This can be set arbitrarily large. -It will only use memory when the queue is in use. -Note that it will use in the order of N KiB of memory when the backlog -is in use. +Starting with rclone version 1.61, any Unicode numbers and letters are +allowed, while in older versions it was limited to plain ASCII (0-9, +A-Z, a-z). +If you use the same rclone configuration from different shells, which +may be configured with different character encoding, you must be +cautious to use characters that are possible to write in all of them. +This is mostly a problem on Windows, where the console traditionally +uses a non-Unicode character set - defined by the so-called \[dq]code +page\[dq]. .PP -Setting this large allows rclone to calculate how many files are pending -more accurately, give a more accurate estimated finish time and make -\f[C]--order-by\f[R] work more accurately. +Do not use single character names on Windows as it creates ambiguity +with Windows drives\[aq] names, e.g.: remote called \f[C]C\f[R] is +indistinguishable from \f[C]C\f[R] drive. +Rclone will always assume that single letter name refers to a drive. +.SS Quoting and the shell .PP -Setting this small will make rclone more synchronous to the listings of -the remote which may be desirable. +When you are typing commands to your computer you are using something +called the command line shell. +This interprets various characters in an OS specific way. .PP -Setting this to a negative number will make the backlog as large as -possible. -.SS --max-delete=N +Here are some gotchas which may help users unfamiliar with the shell +rules +.SS Linux / OSX .PP -This tells rclone not to delete more than N files. -If that limit is exceeded then a fatal error will be generated and -rclone will stop the operation in progress. -.SS --max-delete-size=SIZE +If your names have spaces or shell metacharacters (e.g. +\f[C]*\f[R], \f[C]?\f[R], \f[C]$\f[R], \f[C]\[aq]\f[R], \f[C]\[dq]\f[R], +etc.) then you must quote them. +Use single quotes \f[C]\[aq]\f[R] by default. +.IP +.nf +\f[C] +rclone copy \[aq]Important files?\[aq] remote:backup +\f[R] +.fi .PP -Rclone will stop deleting files when the total size of deletions has -reached the size specified. -It defaults to off. +If you want to send a \f[C]\[aq]\f[R] you will need to use +\f[C]\[dq]\f[R], e.g. +.IP +.nf +\f[C] +rclone copy \[dq]O\[aq]Reilly Reviews\[dq] remote:backup +\f[R] +.fi .PP -If that limit is exceeded then a fatal error will be generated and -rclone will stop the operation in progress. -.SS --max-depth=N +The rules for quoting metacharacters are complicated and if you want the +full details you\[aq]ll have to consult the manual page for your shell. +.SS Windows .PP -This modifies the recursion depth for all the commands except purge. +If your names have spaces in you need to put them in \f[C]\[dq]\f[R], +e.g. +.IP +.nf +\f[C] +rclone copy \[dq]E:\[rs]folder name\[rs]folder name\[rs]folder name\[dq] remote:backup +\f[R] +.fi .PP -So if you do \f[C]rclone --max-depth 1 ls remote:path\f[R] you will see -only the files in the top level directory. -Using \f[C]--max-depth 2\f[R] means you will see all the files in first -two directory levels and so on. +If you are using the root directory on its own then don\[aq]t quote it +(see #464 (https://github.com/rclone/rclone/issues/464) for why), e.g. +.IP +.nf +\f[C] +rclone copy E:\[rs] remote:backup +\f[R] +.fi +.SS Copying files or directories with \f[C]:\f[R] in the names .PP -For historical reasons the \f[C]lsd\f[R] command defaults to using a -\f[C]--max-depth\f[R] of 1 - you can override this with the command line -flag. +rclone uses \f[C]:\f[R] to mark a remote name. +This is, however, a valid filename component in non-Windows OSes. +The remote name parser will only search for a \f[C]:\f[R] up to the +first \f[C]/\f[R] so if you need to act on a file or directory like this +then use the full path starting with a \f[C]/\f[R], or use \f[C]./\f[R] +as a current directory prefix. .PP -You can use this command to disable recursion (with -\f[C]--max-depth 1\f[R]). +So to sync a directory called \f[C]sync:me\f[R] to a remote called +\f[C]remote:\f[R] use +.IP +.nf +\f[C] +rclone sync --interactive ./sync:me remote:path +\f[R] +.fi .PP -Note that if you use this with \f[C]sync\f[R] and -\f[C]--delete-excluded\f[R] the files not recursed through are -considered excluded and will be deleted on the destination. -Test first with \f[C]--dry-run\f[R] if you are not sure what will -happen. -.SS --max-duration=TIME +or +.IP +.nf +\f[C] +rclone sync --interactive /full/path/to/sync:me remote:path +\f[R] +.fi +.SS Server Side Copy .PP -Rclone will stop transferring when it has run for the duration -specified. -Defaults to off. +Most remotes (but not all - see the +overview (https://rclone.org/overview/#optional-features)) support +server-side copy. .PP -When the limit is reached all transfers will stop immediately. -Use \f[C]--cutoff-mode\f[R] to modify this behaviour. +This means if you want to copy one folder to another then rclone +won\[aq]t download all the files and re-upload them; it will instruct +the server to copy them in place. .PP -Rclone will exit with exit code 10 if the duration limit is reached. -.SS --max-transfer=SIZE +Eg +.IP +.nf +\f[C] +rclone copy s3:oldbucket s3:newbucket +\f[R] +.fi .PP -Rclone will stop transferring when it has reached the size specified. -Defaults to off. +Will copy the contents of \f[C]oldbucket\f[R] to \f[C]newbucket\f[R] +without downloading and re-uploading. .PP -When the limit is reached all transfers will stop immediately. -Use \f[C]--cutoff-mode\f[R] to modify this behaviour. +Remotes which don\[aq]t support server-side copy \f[B]will\f[R] download +and re-upload in this case. .PP -Rclone will exit with exit code 8 if the transfer limit is reached. -.SS --cutoff-mode=hard|soft|cautious +Server side copies are used with \f[C]sync\f[R] and \f[C]copy\f[R] and +will be identified in the log when using the \f[C]-v\f[R] flag. +The \f[C]move\f[R] command may also use them if remote doesn\[aq]t +support server-side move directly. +This is done by issuing a server-side copy then a delete which is much +quicker than a download and re-upload. .PP -This modifies the behavior of \f[C]--max-transfer\f[R] and -\f[C]--max-duration\f[R] Defaults to \f[C]--cutoff-mode=hard\f[R]. +Server side copies will only be attempted if the remote names are the +same. .PP -Specifying \f[C]--cutoff-mode=hard\f[R] will stop transferring -immediately when Rclone reaches the limit. +This can be used when scripting to make aged backups efficiently, e.g. +.IP +.nf +\f[C] +rclone sync --interactive remote:current-backup remote:previous-backup +rclone sync --interactive /path/to/files remote:current-backup +\f[R] +.fi +.SS Metadata support .PP -Specifying \f[C]--cutoff-mode=soft\f[R] will stop starting new transfers -when Rclone reaches the limit. +Metadata is data about a file which isn\[aq]t the contents of the file. +Normally rclone only preserves the modification time and the content +(MIME) type where possible. .PP -Specifying \f[C]--cutoff-mode=cautious\f[R] will try to prevent Rclone -from reaching the limit. -Only applicable for \f[C]--max-transfer\f[R] -.SS -M, --metadata +Rclone supports preserving all the available metadata on files (not +directories) when using the \f[C]--metadata\f[R] or \f[C]-M\f[R] flag. .PP -Setting this flag enables rclone to copy the metadata from the source to -the destination. -For local backends this is ownership, permissions, xattr etc. -See the #metadata for more info. -.SS --metadata-set key=value +Exactly what metadata is supported and what that support means depends +on the backend. +Backends that support metadata have a metadata section in their docs and +are listed in the features table (https://rclone.org/overview/#features) +(Eg local (https://rclone.org/local/#metadata), s3) .PP -Add metadata \f[C]key\f[R] = \f[C]value\f[R] when uploading. -This can be repeated as many times as required. -See the #metadata for more info. -.SS --modify-window=TIME +Rclone only supports a one-time sync of metadata. +This means that metadata will be synced from the source object to the +destination object only when the source object has changed and needs to +be re-uploaded. +If the metadata subsequently changes on the source object without +changing the object itself then it won\[aq]t be synced to the +destination object. +This is in line with the way rclone syncs \f[C]Content-Type\f[R] without +the \f[C]--metadata\f[R] flag. .PP -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. +Using \f[C]--metadata\f[R] when syncing from local to local will +preserve file attributes such as file mode, owner, extended attributes +(not Windows). .PP -The default is \f[C]1ns\f[R] 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 -\f[C]1s\f[R] by default. +Note that arbitrary metadata may be added to objects using the +\f[C]--metadata-set key=value\f[R] flag when the object is first +uploaded. +This flag can be repeated as many times as necessary. .PP -This command line flag allows you to override that computed default. -.SS --multi-thread-write-buffer-size=SIZE +The --metadata-mapper flag can be used to pass the name of a program in +which can transform metadata when it is being copied from source to +destination. +.SS Types of metadata .PP -When transferring with multiple threads, rclone will buffer SIZE bytes -in memory before writing to disk for each thread. +Metadata is divided into two type. +System metadata and User metadata. .PP -This can improve performance if the underlying filesystem does not deal -well with a lot of small writes in different positions of the file, so -if you see transfers being limited by disk write speed, you might want -to experiment with different values. -Specially for magnetic drives and remote file systems a higher value can -be useful. +Metadata which the backend uses itself is called system metadata. +For example on the local backend the system metadata \f[C]uid\f[R] will +store the user ID of the file when used on a unix based platform. .PP -Nevertheless, the default of \f[C]128k\f[R] should be fine for almost -all use cases, so before changing it ensure that network is not really -your bottleneck. +Arbitrary metadata is called user metadata and this can be set however +is desired. .PP -As a final hint, size is not the only factor: block size (or similar -concept) can have an impact. -In one case, we observed that exact multiples of 16k performed much -better than other values. -.SS --multi-thread-chunk-size=SizeSuffix +When objects are copied from backend to backend, they will attempt to +interpret system metadata if it is supplied. +Metadata may change from being user metadata to system metadata as +objects are copied between different backends. +For example copying an object from s3 sets the \f[C]content-type\f[R] +metadata. +In a backend which understands this (like \f[C]azureblob\f[R]) this will +become the Content-Type of the object. +In a backend which doesn\[aq]t understand this (like the \f[C]local\f[R] +backend) this will become user metadata. +However should the local object be copied back to s3, the Content-Type +will be set correctly. +.SS Metadata framework .PP -Normally the chunk size for multi thread transfers is set by the -backend. -However some backends such as \f[C]local\f[R] and \f[C]smb\f[R] (which -implement \f[C]OpenWriterAt\f[R] but not \f[C]OpenChunkWriter\f[R]) -don\[aq]t have a natural chunk size. +Rclone implements a metadata framework which can read metadata from an +object and write it to the object when (and only when) it is being +uploaded. .PP -In this case the value of this option is used (default 64Mi). -.SS --multi-thread-cutoff=SIZE +This metadata is stored as a dictionary with string keys and string +values. .PP -When transferring files above SIZE to capable backends, rclone will use -multiple threads to transfer the file (default 256M). +There are some limits on the names of the keys (these may be clarified +further in the future). +.IP \[bu] 2 +must be lower case +.IP \[bu] 2 +may be \f[C]a-z\f[R] \f[C]0-9\f[R] containing \f[C].\f[R] \f[C]-\f[R] or +\f[C]_\f[R] +.IP \[bu] 2 +length is backend dependent .PP -Capable backends are marked in the -overview (https://rclone.org/overview/#optional-features) as -\f[C]MultithreadUpload\f[R]. -(They need to implement either the \f[C]OpenWriterAt\f[R] or -\f[C]OpenChunkedWriter\f[R] internal interfaces). -These include include, \f[C]local\f[R], \f[C]s3\f[R], -\f[C]azureblob\f[R], \f[C]b2\f[R], \f[C]oracleobjectstorage\f[R] and -\f[C]smb\f[R] at the time of writing. +Each backend can provide system metadata that it understands. +Some backends can also store arbitrary user metadata. .PP -On the local disk, rclone preallocates the file (using -\f[C]fallocate(FALLOC_FL_KEEP_SIZE)\f[R] on unix or -\f[C]NTSetInformationFile\f[R] on Windows both of which takes no time) -then each thread writes directly into the file at the correct place. -This means that rclone won\[aq]t create fragmented or sparse files and -there won\[aq]t be any assembly time at the end of the transfer. +Where possible the key names are standardized, so, for example, it is +possible to copy object metadata from s3 to azureblob for example and +metadata will be translated appropriately. .PP -The number of threads used to transfer is controlled by -\f[C]--multi-thread-streams\f[R]. +Some backends have limits on the size of the metadata and rclone will +give errors on upload if they are exceeded. +.SS Metadata preservation .PP -Use \f[C]-vv\f[R] if you wish to see info about the threads. +The goal of the implementation is to +.IP "1." 3 +Preserve metadata if at all possible +.IP "2." 3 +Interpret metadata if at all possible .PP -This will work with the \f[C]sync\f[R]/\f[C]copy\f[R]/\f[C]move\f[R] -commands and friends \f[C]copyto\f[R]/\f[C]moveto\f[R]. -Multi thread transfers will be used with \f[C]rclone mount\f[R] and -\f[C]rclone serve\f[R] if \f[C]--vfs-cache-mode\f[R] is set to -\f[C]writes\f[R] or above. +The consequences of 1 is that you can copy an S3 object to a local disk +then back to S3 losslessly. +Likewise you can copy a local file with file attributes and xattrs from +local disk to s3 and back again losslessly. .PP -\f[B]NB\f[R] that this \f[B]only\f[R] works with supported backends as -the destination but will work with any backend as the source. +The consequence of 2 is that you can copy an S3 object with metadata to +Azureblob (say) and have the metadata appear on the Azureblob object +also. +.SS Standard system metadata .PP -\f[B]NB\f[R] that multi-thread copies are disabled for local to local -copies as they are faster without unless -\f[C]--multi-thread-streams\f[R] is set explicitly. +Here is a table of standard system metadata which, if appropriate, a +backend may implement. .PP -\f[B]NB\f[R] on Windows using multi-thread transfers to the local disk -will cause the resulting files to be -sparse (https://en.wikipedia.org/wiki/Sparse_file). -Use \f[C]--local-no-sparse\f[R] to disable sparse files (which may cause -long delays at the start of transfers) or disable multi-thread transfers -with \f[C]--multi-thread-streams 0\f[R] -.SS --multi-thread-streams=N +.TS +tab(@); +lw(34.2n) lw(21.2n) lw(14.7n). +T{ +key +T}@T{ +description +T}@T{ +example +T} +_ +T{ +mode +T}@T{ +File type and mode: octal, unix style +T}@T{ +0100664 +T} +T{ +uid +T}@T{ +User ID of owner: decimal number +T}@T{ +500 +T} +T{ +gid +T}@T{ +Group ID of owner: decimal number +T}@T{ +500 +T} +T{ +rdev +T}@T{ +Device ID (if special file) => hexadecimal +T}@T{ +0 +T} +T{ +atime +T}@T{ +Time of last access: RFC 3339 +T}@T{ +2006-01-02T15:04:05.999999999Z07:00 +T} +T{ +mtime +T}@T{ +Time of last modification: RFC 3339 +T}@T{ +2006-01-02T15:04:05.999999999Z07:00 +T} +T{ +btime +T}@T{ +Time of file creation (birth): RFC 3339 +T}@T{ +2006-01-02T15:04:05.999999999Z07:00 +T} +T{ +utime +T}@T{ +Time of file upload: RFC 3339 +T}@T{ +2006-01-02T15:04:05.999999999Z07:00 +T} +T{ +cache-control +T}@T{ +Cache-Control header +T}@T{ +no-cache +T} +T{ +content-disposition +T}@T{ +Content-Disposition header +T}@T{ +inline +T} +T{ +content-encoding +T}@T{ +Content-Encoding header +T}@T{ +gzip +T} +T{ +content-language +T}@T{ +Content-Language header +T}@T{ +en-US +T} +T{ +content-type +T}@T{ +Content-Type header +T}@T{ +text/plain +T} +.TE .PP -When using multi thread transfers (see above -\f[C]--multi-thread-cutoff\f[R]) this sets the number of streams to use. -Set to \f[C]0\f[R] to disable multi thread transfers (Default 4). +The metadata keys \f[C]mtime\f[R] and \f[C]content-type\f[R] will take +precedence if supplied in the metadata over reading the +\f[C]Content-Type\f[R] or modification time of the source object. .PP -If the backend has a \f[C]--backend-upload-concurrency\f[R] setting (eg -\f[C]--s3-upload-concurrency\f[R]) then this setting will be used as the -number of transfers instead if it is larger than the value of -\f[C]--multi-thread-streams\f[R] or \f[C]--multi-thread-streams\f[R] -isn\[aq]t set. -.SS --no-check-dest +Hashes are not included in system metadata as there is a well defined +way of reading those already. +.SS Options .PP -The \f[C]--no-check-dest\f[R] can be used with \f[C]move\f[R] or -\f[C]copy\f[R] and it causes rclone not to check the destination at all -when copying files. +Rclone has a number of options to control its behaviour. .PP -This means that: -.IP \[bu] 2 -the destination is not listed minimising the API calls -.IP \[bu] 2 -files are always transferred +Options that take parameters can have the values passed in two ways, +\f[C]--option=value\f[R] or \f[C]--option value\f[R]. +However boolean (true/false) options behave slightly differently to the +other options in that \f[C]--boolean\f[R] sets the option to +\f[C]true\f[R] and the absence of the flag sets it to \f[C]false\f[R]. +It is also possible to specify \f[C]--boolean=false\f[R] or +\f[C]--boolean=true\f[R]. +Note that \f[C]--boolean false\f[R] is not valid - this is parsed as +\f[C]--boolean\f[R] and the \f[C]false\f[R] is parsed as an extra +command line argument for rclone. +.SS Time or duration options +.PP +TIME or DURATION options can be specified as a duration string or a time +string. +.PP +A duration string is a possibly signed sequence of decimal numbers, each +with optional fraction and a unit suffix, such as \[dq]300ms\[dq], +\[dq]-1.5h\[dq] or \[dq]2h45m\[dq]. +Default units are seconds or the following abbreviations are valid: .IP \[bu] 2 -this can cause duplicates on remotes which allow it (e.g. -Google Drive) +\f[C]ms\f[R] - Milliseconds .IP \[bu] 2 -\f[C]--retries 1\f[R] is recommended otherwise you\[aq]ll transfer -everything again on a retry +\f[C]s\f[R] - Seconds +.IP \[bu] 2 +\f[C]m\f[R] - Minutes +.IP \[bu] 2 +\f[C]h\f[R] - Hours +.IP \[bu] 2 +\f[C]d\f[R] - Days +.IP \[bu] 2 +\f[C]w\f[R] - Weeks +.IP \[bu] 2 +\f[C]M\f[R] - Months +.IP \[bu] 2 +\f[C]y\f[R] - Years .PP -This flag is useful to minimise the transactions if you know that none -of the files are on the destination. +These can also be specified as an absolute time in the following +formats: +.IP \[bu] 2 +RFC3339 - e.g. +\f[C]2006-01-02T15:04:05Z\f[R] or \f[C]2006-01-02T15:04:05+07:00\f[R] +.IP \[bu] 2 +ISO8601 Date and time, local timezone - \f[C]2006-01-02T15:04:05\f[R] +.IP \[bu] 2 +ISO8601 Date and time, local timezone - \f[C]2006-01-02 15:04:05\f[R] +.IP \[bu] 2 +ISO8601 Date - \f[C]2006-01-02\f[R] (YYYY-MM-DD) +.SS Size options .PP -This is a specialized flag which should be ignored by most users! -.SS --no-gzip-encoding +Options which use SIZE use KiB (multiples of 1024 bytes) by default. +However, a suffix of \f[C]B\f[R] for Byte, \f[C]K\f[R] for KiB, +\f[C]M\f[R] for MiB, \f[C]G\f[R] for GiB, \f[C]T\f[R] for TiB and +\f[C]P\f[R] for PiB may be used. +These are the binary units, e.g. +1, 2**10, 2**20, 2**30 respectively. +.SS --backup-dir=DIR .PP -Don\[aq]t set \f[C]Accept-Encoding: gzip\f[R]. -This means that rclone won\[aq]t ask the server for compressed files -automatically. -Useful if you\[aq]ve set the server to return files with -\f[C]Content-Encoding: gzip\f[R] but you uploaded compressed files. +When using \f[C]sync\f[R], \f[C]copy\f[R] or \f[C]move\f[R] any files +which would have been overwritten or deleted are moved in their original +hierarchy into this directory. .PP -There is no need to set this in normal operation, and doing so will -decrease the network transfer efficiency of rclone. -.SS --no-traverse +If \f[C]--suffix\f[R] is set, then the moved files will have the suffix +added to them. +If there is a file with the same path (after the suffix has been added) +in DIR, then it will be overwritten. .PP -The \f[C]--no-traverse\f[R] flag controls whether the destination file -system is traversed when using the \f[C]copy\f[R] or \f[C]move\f[R] -commands. -\f[C]--no-traverse\f[R] is not compatible with \f[C]sync\f[R] and will -be ignored if you supply it with \f[C]sync\f[R]. +The remote in use must support server-side move or copy and you must use +the same remote as the destination of the sync. +The backup directory must not overlap the destination directory without +it being excluded by a filter rule. .PP -If you are only copying a small number of files (or are filtering most -of the files) and/or have a large number of files on the destination -then \f[C]--no-traverse\f[R] will stop rclone listing the destination -and save time. +For example +.IP +.nf +\f[C] +rclone sync --interactive /path/to/local remote:current --backup-dir remote:old +\f[R] +.fi .PP -However, if you are copying a large number of files, especially if you -are doing a copy where lots of the files under consideration haven\[aq]t -changed and won\[aq]t need copying then you shouldn\[aq]t use -\f[C]--no-traverse\f[R]. +will sync \f[C]/path/to/local\f[R] to \f[C]remote:current\f[R], but for +any files which would have been updated or deleted will be stored in +\f[C]remote:old\f[R]. .PP -See rclone copy (https://rclone.org/commands/rclone_copy/) for an -example of how to use it. -.SS --no-unicode-normalization +If running rclone from a script you might want to use today\[aq]s date +as the directory name passed to \f[C]--backup-dir\f[R] to store the old +files, or you might want to pass \f[C]--suffix\f[R] with today\[aq]s +date. .PP -Don\[aq]t normalize unicode characters in filenames during the sync -routine. +See \f[C]--compare-dest\f[R] and \f[C]--copy-dest\f[R]. +.SS --bind string .PP -Sometimes, an operating system will store filenames containing unicode -parts in their decomposed form (particularly macOS). -Some cloud storage systems will then recompose the unicode, resulting in -duplicate files if the data is ever copied back to a local filesystem. +Local address to bind to for outgoing connections. +This can be an IPv4 address (1.2.3.4), an IPv6 address (1234::789A) or +host name. +If the host name doesn\[aq]t resolve or resolves to more than one IP +address it will give an error. .PP -Using this flag will disable that functionality, treating each unicode -character as unique. -For example, by default e\[u0301] and \['e] will be normalized into the -same character. -With \f[C]--no-unicode-normalization\f[R] they will be treated as unique -characters. -.SS --no-update-modtime +You can use \f[C]--bind 0.0.0.0\f[R] to force rclone to use IPv4 +addresses and \f[C]--bind ::0\f[R] to force rclone to use IPv6 +addresses. +.SS --bwlimit=BANDWIDTH_SPEC .PP -When using this flag, rclone won\[aq]t update modification times of -remote files if they are incorrect as it would normally. +This option controls the bandwidth limit. +For example +.IP +.nf +\f[C] +--bwlimit 10M +\f[R] +.fi .PP -This can be used if the remote is being synced with another tool also -(e.g. -the Google Drive client). -.SS --order-by string +would mean limit the upload and download bandwidth to 10 MiB/s. +\f[B]NB\f[R] this is \f[B]bytes\f[R] per second not \f[B]bits\f[R] per +second. +To use a single limit, specify the desired bandwidth in KiB/s, or use a +suffix B|K|M|G|T|P. +The default is \f[C]0\f[R] which means to not limit bandwidth. .PP -The \f[C]--order-by\f[R] flag controls the order in which files in the -backlog are processed in \f[C]rclone sync\f[R], \f[C]rclone copy\f[R] -and \f[C]rclone move\f[R]. +The upload and download bandwidth can be specified separately, as +\f[C]--bwlimit UP:DOWN\f[R], so +.IP +.nf +\f[C] +--bwlimit 10M:100k +\f[R] +.fi .PP -The order by string is constructed like this. -The first part describes what aspect is being measured: -.IP \[bu] 2 -\f[C]size\f[R] - order by the size of the files -.IP \[bu] 2 -\f[C]name\f[R] - order by the full path of the files -.IP \[bu] 2 -\f[C]modtime\f[R] - order by the modification date of the files +would mean limit the upload bandwidth to 10 MiB/s and the download +bandwidth to 100 KiB/s. +Either limit can be \[dq]off\[dq] meaning no limit, so to just limit the +upload bandwidth you would use +.IP +.nf +\f[C] +--bwlimit 10M:off +\f[R] +.fi .PP -This can have a modifier appended with a comma: +this would limit the upload bandwidth to 10 MiB/s but the download +bandwidth would be unlimited. +.PP +When specified as above the bandwidth limits last for the duration of +run of the rclone binary. +.PP +It is also possible to specify a \[dq]timetable\[dq] of limits, which +will cause certain limits to be applied at certain times. +To specify a timetable, format your entries as +\f[C]WEEKDAY-HH:MM,BANDWIDTH WEEKDAY-HH:MM,BANDWIDTH...\f[R] where: +\f[C]WEEKDAY\f[R] is optional element. .IP \[bu] 2 -\f[C]ascending\f[R] or \f[C]asc\f[R] - order so that the smallest (or -oldest) is processed first +\f[C]BANDWIDTH\f[R] can be a single number, e.g.\f[C]100k\f[R] or a pair +of numbers for upload:download, e.g.\f[C]10M:1M\f[R]. .IP \[bu] 2 -\f[C]descending\f[R] or \f[C]desc\f[R] - order so that the largest (or -newest) is processed first +\f[C]WEEKDAY\f[R] can be written as the whole word or only using the +first 3 characters. +It is optional. .IP \[bu] 2 -\f[C]mixed\f[R] - order so that the smallest is processed first for some -threads and the largest for others +\f[C]HH:MM\f[R] is an hour from 00:00 to 23:59. .PP -If the modifier is \f[C]mixed\f[R] then it can have an optional -percentage (which defaults to \f[C]50\f[R]), e.g. -\f[C]size,mixed,25\f[R] which means that 25% of the threads should be -taking the smallest items and 75% the largest. -The threads which take the smallest first will always take the smallest -first and likewise the largest first threads. -The \f[C]mixed\f[R] mode can be useful to minimise the transfer time -when you are transferring a mixture of large and small files - the large -files are guaranteed upload threads and bandwidth and the small files -will be processed continuously. +An example of a typical timetable to avoid link saturation during +daytime working hours could be: .PP -If no modifier is supplied then the order is \f[C]ascending\f[R]. +\f[C]--bwlimit \[dq]08:00,512k 12:00,10M 13:00,512k 18:00,30M 23:00,off\[dq]\f[R] .PP -For example -.IP \[bu] 2 -\f[C]--order-by size,desc\f[R] - send the largest files first -.IP \[bu] 2 -\f[C]--order-by modtime,ascending\f[R] - send the oldest files first -.IP \[bu] 2 -\f[C]--order-by name\f[R] - send the files with alphabetically by path -first +In this example, the transfer bandwidth will be set to 512 KiB/s at 8am +every day. +At noon, it will rise to 10 MiB/s, and drop back to 512 KiB/sec at 1pm. +At 6pm, the bandwidth limit will be set to 30 MiB/s, and at 11pm it will +be completely disabled (full speed). +Anything between 11pm and 8am will remain unlimited. .PP -If the \f[C]--order-by\f[R] flag is not supplied or it is supplied with -an empty string then the default ordering will be used which is as -scanned. -With \f[C]--checkers 1\f[R] this is mostly alphabetical, however with -the default \f[C]--checkers 8\f[R] it is somewhat random. -.SS Limitations +An example of timetable with \f[C]WEEKDAY\f[R] could be: .PP -The \f[C]--order-by\f[R] flag does not do a separate pass over the data. -This means that it may transfer some files out of the order specified if -.IP \[bu] 2 -there are no files in the backlog or the source has not been fully -scanned yet -.IP \[bu] 2 -there are more than --max-backlog files in the backlog +\f[C]--bwlimit \[dq]Mon-00:00,512 Fri-23:59,10M Sat-10:00,1M Sun-20:00,off\[dq]\f[R] .PP -Rclone will do its best to transfer the best file it has so in practice -this should not cause a problem. -Think of \f[C]--order-by\f[R] as being more of a best efforts flag -rather than a perfect ordering. +It means that, the transfer bandwidth will be set to 512 KiB/s on +Monday. +It will rise to 10 MiB/s before the end of Friday. +At 10:00 on Saturday it will be set to 1 MiB/s. +From 20:00 on Sunday it will be unlimited. .PP -If you want perfect ordering then you will need to specify --check-first -which will find all the files which need transferring first before -transferring any. -.SS --password-command SpaceSepList +Timeslots without \f[C]WEEKDAY\f[R] are extended to the whole week. +So this example: .PP -This flag supplies a program which should supply the config password -when run. -This is an alternative to rclone prompting for the password or setting -the \f[C]RCLONE_CONFIG_PASS\f[R] variable. +\f[C]--bwlimit \[dq]Mon-00:00,512 12:00,1M Sun-20:00,off\[dq]\f[R] .PP -The argument to this should be a command with a space separated list of -arguments. -If one of the arguments has a space in then enclose it in -\f[C]\[dq]\f[R], if you want a literal \f[C]\[dq]\f[R] in an argument -then enclose the argument in \f[C]\[dq]\f[R] and double the -\f[C]\[dq]\f[R]. -See CSV encoding (https://godoc.org/encoding/csv) for more info. +Is equivalent to this: .PP -Eg +\f[C]--bwlimit \[dq]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\[dq]\f[R] +.PP +Bandwidth limit apply to the data transfer for all backends. +For most backends the directory listing bandwidth is also included +(exceptions being the non HTTP backends, \f[C]ftp\f[R], \f[C]sftp\f[R] +and \f[C]storj\f[R]). +.PP +Note that the units are \f[B]Byte/s\f[R], not \f[B]bit/s\f[R]. +Typically connections are measured in bit/s - to convert divide by 8. +For example, let\[aq]s say you have a 10 Mbit/s connection and you wish +rclone to use half of it - 5 Mbit/s. +This is 5/8 = 0.625 MiB/s so you would use a \f[C]--bwlimit 0.625M\f[R] +parameter for rclone. +.PP +On Unix systems (Linux, macOS, \&...) the bandwidth limiter can be +toggled by sending a \f[C]SIGUSR2\f[R] signal to rclone. +This allows to remove the limitations of a long running rclone transfer +and to restore it back to the value specified with \f[C]--bwlimit\f[R] +quickly when needed. +Assuming there is only one rclone instance running, you can toggle the +limiter like this: .IP .nf \f[C] ---password-command echo hello ---password-command echo \[dq]hello with space\[dq] ---password-command echo \[dq]hello with \[dq]\[dq]quotes\[dq]\[dq] and space\[dq] +kill -SIGUSR2 $(pidof rclone) \f[R] .fi .PP -See the Configuration Encryption for more info. -.PP -See a Windows PowerShell example on the -Wiki (https://github.com/rclone/rclone/wiki/Windows-Powershell-use-rclone-password-command-for-Config-file-password). -.SS -P, --progress -.PP -This flag makes rclone update the stats in a static block in the -terminal providing a realtime overview of the transfer. -.PP -Any log messages will scroll above the static block. -Log messages will push the static block down to the bottom of the -terminal where it will stay. -.PP -Normally this is updated every 500mS but this period can be overridden -with the \f[C]--stats\f[R] flag. +If you configure rclone with a remote control then you can use change +the bwlimit dynamically: +.IP +.nf +\f[C] +rclone rc core/bwlimit rate=1M +\f[R] +.fi +.SS --bwlimit-file=BANDWIDTH_SPEC .PP -This can be used with the \f[C]--stats-one-line\f[R] flag for a simpler -display. +This option controls per file bandwidth limit. +For the options see the \f[C]--bwlimit\f[R] flag. .PP -Note: On Windows until this -bug (https://github.com/Azure/go-ansiterm/issues/26) is fixed all -non-ASCII characters will be replaced with \f[C].\f[R] when -\f[C]--progress\f[R] is in use. -.SS --progress-terminal-title +For example use this to allow no transfers to be faster than 1 MiB/s +.IP +.nf +\f[C] +--bwlimit-file 1M +\f[R] +.fi .PP -This flag, when used with \f[C]-P/--progress\f[R], will print the string -\f[C]ETA: %s\f[R] to the terminal title. -.SS -q, --quiet +This can be used in conjunction with \f[C]--bwlimit\f[R]. .PP -This flag will limit rclone\[aq]s output to error messages only. -.SS --refresh-times +Note that if a schedule is provided the file will use the schedule in +effect at the start of the transfer. +.SS --buffer-size=SIZE .PP -The \f[C]--refresh-times\f[R] flag can be used to update modification -times of existing files when they are out of sync on backends which -don\[aq]t support hashes. +Use this sized buffer to speed up file transfers. +Each \f[C]--transfer\f[R] will use this much memory for buffering. .PP -This is useful if you uploaded files with the incorrect timestamps and -you now wish to correct them. +When using \f[C]mount\f[R] or \f[C]cmount\f[R] each open file descriptor +will use this much memory for buffering. +See the mount (https://rclone.org/commands/rclone_mount/#file-buffering) +documentation for more details. .PP -This flag is \f[B]only\f[R] useful for destinations which don\[aq]t -support hashes (e.g. -\f[C]crypt\f[R]). +Set to \f[C]0\f[R] to disable the buffering for the minimum memory +usage. .PP -This can be used any of the sync commands \f[C]sync\f[R], \f[C]copy\f[R] -or \f[C]move\f[R]. +Note that the memory allocation of the buffers is influenced by the +--use-mmap flag. +.SS --cache-dir=DIR .PP -To use this flag you will need to be doing a modification time sync (so -not using \f[C]--size-only\f[R] or \f[C]--checksum\f[R]). -The flag will have no effect when using \f[C]--size-only\f[R] or -\f[C]--checksum\f[R]. +Specify the directory rclone will use for caching, to override the +default. .PP -If this flag is used when rclone comes to upload a file it will check to -see if there is an existing file on the destination. -If this file matches the source with size (and checksum if available) -but has a differing timestamp then instead of re-uploading it, rclone -will update the timestamp on the destination file. -If the checksum does not match rclone will upload the new file. -If the checksum is absent (e.g. -on a \f[C]crypt\f[R] backend) then rclone will update the timestamp. +Default value is depending on operating system: - Windows +\f[C]%LocalAppData%\[rs]rclone\f[R], if \f[C]LocalAppData\f[R] is +defined. +- macOS \f[C]$HOME/Library/Caches/rclone\f[R] if \f[C]HOME\f[R] is +defined. +- Unix \f[C]$XDG_CACHE_HOME/rclone\f[R] if \f[C]XDG_CACHE_HOME\f[R] is +defined, else \f[C]$HOME/.cache/rclone\f[R] if \f[C]HOME\f[R] is +defined. +- Fallback (on all OS) to \f[C]$TMPDIR/rclone\f[R], where +\f[C]TMPDIR\f[R] is the value from --temp-dir. .PP -Note that some remotes can\[aq]t set the modification time without -re-uploading the file so this flag is less useful on them. +You can use the config +paths (https://rclone.org/commands/rclone_config_paths/) command to see +the current value. .PP -Normally if you are doing a modification time sync rclone will update -modification times without \f[C]--refresh-times\f[R] provided that the -remote supports checksums \f[B]and\f[R] the checksums match on the file. -However if the checksums are absent then rclone will upload the file -rather than setting the timestamp as this is the safe behaviour. -.SS --retries int +Cache directory is heavily used by the VFS File +Caching (https://rclone.org/commands/rclone_mount/#vfs-file-caching) +mount feature, but also by +serve (https://rclone.org/commands/rclone_serve/), GUI and other parts +of rclone. +.SS --check-first .PP -Retry the entire sync if it fails this many times it fails (default 3). +If this flag is set then in a \f[C]sync\f[R], \f[C]copy\f[R] or +\f[C]move\f[R], rclone will do all the checks to see whether files need +to be transferred before doing any of the transfers. +Normally rclone would start running transfers as soon as possible. .PP -Some remotes can be unreliable and a few retries help pick up the files -which didn\[aq]t get transferred because of errors. +This flag can be useful on IO limited systems where transfers interfere +with checking. .PP -Disable retries with \f[C]--retries 1\f[R]. -.SS --retries-sleep=TIME +It can also be useful to ensure perfect ordering when using +\f[C]--order-by\f[R]. .PP -This sets the interval between each retry specified by -\f[C]--retries\f[R] +If both \f[C]--check-first\f[R] and \f[C]--order-by\f[R] are set when +doing \f[C]rclone move\f[R] then rclone will use the transfer thread to +delete source files which don\[aq]t need transferring. +This will enable perfect ordering of the transfers and deletes but will +cause the transfer stats to have more items in than expected. .PP -The default is \f[C]0\f[R]. -Use \f[C]0\f[R] to disable. -.SS --server-side-across-configs +Using this flag can use more memory as it effectively sets +\f[C]--max-backlog\f[R] to infinite. +This means that all the info on the objects to transfer is held in +memory before the transfers start. +.SS --checkers=N .PP -Allow server-side operations (e.g. -copy or move) to work across different configurations. +Originally controlling just the number of file checkers to run in +parallel, e.g. +by \f[C]rclone copy\f[R]. +Now a fairly universal parallelism control used by \f[C]rclone\f[R] in +several places. .PP -This can be useful if you wish to do a server-side copy or move between -two remotes which use the same backend but are configured differently. +Note: checkers do the equality checking of files during a sync. +For some storage systems (e.g. +S3, Swift, Dropbox) this can take a significant amount of time so they +are run in parallel. .PP -Note that this isn\[aq]t enabled by default because it isn\[aq]t easy -for rclone to tell if it will work between any two configurations. -.SS --size-only +The default is to run 8 checkers in parallel. +However, in case of slow-reacting backends you may need to lower (rather +than increase) this default by setting \f[C]--checkers\f[R] to 4 or less +threads. +This is especially advised if you are experiencing backend server +crashes during file checking phase (e.g. +on subsequent or top-up backups where little or no file copying is done +and checking takes up most of the time). +Increase this setting only with utmost care, while monitoring your +server health and file checking throughput. +.SS -c, --checksum .PP 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. +If you set this flag then rclone will check the file hash and size to +determine if files are equal. .PP -This can be useful transferring files from Dropbox which have been -modified by the desktop sync client which doesn\[aq]t set checksums of -modification times in the same way as rclone. -.SS --stats=TIME +This is useful when the remote doesn\[aq]t support setting modified time +and a more accurate sync is desired than just checking the file size. .PP -Commands which transfer data (\f[C]sync\f[R], \f[C]copy\f[R], -\f[C]copyto\f[R], \f[C]move\f[R], \f[C]moveto\f[R]) will print data -transfer stats at regular intervals to show their progress. +This is very useful when transferring between remotes which store the +same hash type on the object, e.g. +Drive and Swift. +For details of which remotes support which hash type see the table in +the overview section (https://rclone.org/overview/). .PP -This sets the interval. +Eg \f[C]rclone --checksum sync s3:/bucket swift:/bucket\f[R] would run +much quicker than without the \f[C]--checksum\f[R] flag. .PP -The default is \f[C]1m\f[R]. -Use \f[C]0\f[R] to disable. +When using this flag, rclone won\[aq]t update mtimes of remote files if +they are incorrect as it would normally. +.SS --color WHEN .PP -If you set the stats interval then all commands can show stats. -This can be useful when running other commands, \f[C]check\f[R] or -\f[C]mount\f[R] for example. +Specify when colors (and other ANSI codes) should be added to the +output. .PP -Stats are logged at \f[C]INFO\f[R] level by default which means they -won\[aq]t show at default log level \f[C]NOTICE\f[R]. -Use \f[C]--stats-log-level NOTICE\f[R] or \f[C]-v\f[R] to make them -show. -See the Logging section for more info on log levels. +\f[C]AUTO\f[R] (default) only allows ANSI codes when the output is a +terminal .PP -Note that on macOS you can send a SIGINFO (which is normally ctrl-T in -the terminal) to make the stats print immediately. -.SS --stats-file-name-length integer +\f[C]NEVER\f[R] never allow ANSI codes .PP -By default, the \f[C]--stats\f[R] output will truncate file names and -paths longer than 40 characters. -This is equivalent to providing \f[C]--stats-file-name-length 40\f[R]. -Use \f[C]--stats-file-name-length 0\f[R] to disable any truncation of -file names printed by stats. -.SS --stats-log-level string +\f[C]ALWAYS\f[R] always add ANSI codes, regardless of the output format +(terminal or file) +.SS --compare-dest=DIR .PP -Log level to show \f[C]--stats\f[R] output at. -This can be \f[C]DEBUG\f[R], \f[C]INFO\f[R], \f[C]NOTICE\f[R], or -\f[C]ERROR\f[R]. -The default is \f[C]INFO\f[R]. -This means at the default level of logging which is \f[C]NOTICE\f[R] the -stats won\[aq]t show - if you want them to then use -\f[C]--stats-log-level NOTICE\f[R]. -See the Logging section for more info on log levels. -.SS --stats-one-line +When using \f[C]sync\f[R], \f[C]copy\f[R] or \f[C]move\f[R] DIR is +checked in addition to the destination for files. +If a file identical to the source is found that file is NOT copied from +source. +This is useful to copy just files that have changed since the last +backup. .PP -When this is specified, rclone condenses the stats into a single line -showing the most important stats only. -.SS --stats-one-line-date +You must use the same remote as the destination of the sync. +The compare directory must not overlap the destination directory. .PP -When this is specified, rclone enables the single-line stats and -prepends the display with a date string. -The default is \f[C]2006/01/02 15:04:05 -\f[R] -.SS --stats-one-line-date-format +See \f[C]--copy-dest\f[R] and \f[C]--backup-dir\f[R]. +.SS --config=CONFIG_FILE .PP -When this is specified, rclone enables the single-line stats and -prepends the display with a user-supplied date string. -The date string MUST be enclosed in quotes. -Follow golang specs (https://golang.org/pkg/time/#Time.Format) for date -formatting syntax. -.SS --stats-unit=bits|bytes +Specify the location of the rclone configuration file, to override the +default. +E.g. +\f[C]rclone config --config=\[dq]rclone.conf\[dq]\f[R]. .PP -By default, data transfer rates will be printed in bytes per second. +The exact default is a bit complex to describe, due to changes +introduced through different versions of rclone while preserving +backwards compatibility, but in most cases it is as simple as: +.IP \[bu] 2 +\f[C]%APPDATA%/rclone/rclone.conf\f[R] on Windows +.IP \[bu] 2 +\f[C]\[ti]/.config/rclone/rclone.conf\f[R] on other .PP -This option allows the data rate to be printed in bits per second. +The complete logic is as follows: Rclone will look for an existing +configuration file in any of the following locations, in priority order: +.IP "1." 3 +\f[C]rclone.conf\f[R] (in program directory, where rclone executable is) +.IP "2." 3 +\f[C]%APPDATA%/rclone/rclone.conf\f[R] (only on Windows) +.IP "3." 3 +\f[C]$XDG_CONFIG_HOME/rclone/rclone.conf\f[R] (on all systems, including +Windows) +.IP "4." 3 +\f[C]\[ti]/.config/rclone/rclone.conf\f[R] (see below for explanation of +\[ti] symbol) +.IP "5." 3 +\f[C]\[ti]/.rclone.conf\f[R] .PP -Data transfer volume will still be reported in bytes. +If no existing configuration file is found, then a new one will be +created in the following location: +.IP \[bu] 2 +On Windows: Location 2 listed above, except in the unlikely event that +\f[C]APPDATA\f[R] is not defined, then location 4 is used instead. +.IP \[bu] 2 +On Unix: Location 3 if \f[C]XDG_CONFIG_HOME\f[R] is defined, else +location 4. +.IP \[bu] 2 +Fallback to location 5 (on all OS), when the rclone directory cannot be +created, but if also a home directory was not found then path +\f[C].rclone.conf\f[R] relative to current working directory will be +used as a final resort. .PP -The rate is reported as a binary unit, not SI unit. -So 1 Mbit/s equals 1,048,576 bit/s and not 1,000,000 bit/s. +The \f[C]\[ti]\f[R] symbol in paths above represent the home directory +of the current user on any OS, and the value is defined as following: +.IP \[bu] 2 +On Windows: \f[C]%HOME%\f[R] if defined, else \f[C]%USERPROFILE%\f[R], +or else \f[C]%HOMEDRIVE%\[rs]%HOMEPATH%\f[R]. +.IP \[bu] 2 +On Unix: \f[C]$HOME\f[R] if defined, else by looking up current user in +OS-specific user database (e.g. +passwd file), or else use the result from shell command +\f[C]cd && pwd\f[R]. .PP -The default is \f[C]bytes\f[R]. -.SS --suffix=SUFFIX +If you run \f[C]rclone config file\f[R] you will see where the default +location is for you. .PP -When using \f[C]sync\f[R], \f[C]copy\f[R] or \f[C]move\f[R] any files -which would have been overwritten or deleted will have the suffix added -to them. -If there is a file with the same path (after the suffix has been added), -then it will be overwritten. +The fact that an existing file \f[C]rclone.conf\f[R] in the same +directory as the rclone executable is always preferred, means that it is +easy to run in \[dq]portable\[dq] mode by downloading rclone executable +to a writable directory and then create an empty file +\f[C]rclone.conf\f[R] in the same directory. .PP -The remote in use must support server-side move or copy and you must use -the same remote as the destination of the sync. +If the location is set to empty string \f[C]\[dq]\[dq]\f[R] or path to a +file with name \f[C]notfound\f[R], or the os null device represented by +value \f[C]NUL\f[R] on Windows and \f[C]/dev/null\f[R] on Unix systems, +then rclone will keep the config file in memory only. .PP -This is for use with files to add the suffix in the current directory or -with \f[C]--backup-dir\f[R]. -See \f[C]--backup-dir\f[R] for more info. +The file format is basic +INI (https://en.wikipedia.org/wiki/INI_file#Format): Sections of text, +led by a \f[C][section]\f[R] header and followed by \f[C]key=value\f[R] +entries on separate lines. +In rclone each remote is represented by its own section, where the +section name defines the name of the remote. +Options are specified as the \f[C]key=value\f[R] entries, where the key +is the option name without the \f[C]--backend-\f[R] prefix, in lowercase +and with \f[C]_\f[R] instead of \f[C]-\f[R]. +E.g. +option \f[C]--mega-hard-delete\f[R] corresponds to key +\f[C]hard_delete\f[R]. +Only backend options can be specified. +A special, and required, key \f[C]type\f[R] identifies the storage +system (https://rclone.org/overview/), where the value is the internal +lowercase name as returned by command \f[C]rclone help backends\f[R]. +Comments are indicated by \f[C];\f[R] or \f[C]#\f[R] at the beginning of +a line. .PP -For example +Example: .IP .nf \f[C] -rclone copy --interactive /path/to/local/file remote:current --suffix .bak +[megaremote] +type = mega +user = you\[at]example.com +pass = PDPcQVVjVtzFY-GTdDFozqBhTdsPg3qH \f[R] .fi .PP -will copy \f[C]/path/to/local\f[R] to \f[C]remote:current\f[R], but for -any files which would have been updated or deleted have .bak added. -.PP -If using \f[C]rclone sync\f[R] with \f[C]--suffix\f[R] and without -\f[C]--backup-dir\f[R] then it is recommended to put a filter rule in -excluding the suffix otherwise the \f[C]sync\f[R] will delete the backup -files. -.IP -.nf -\f[C] -rclone sync --interactive /path/to/local/file remote:current --suffix .bak --exclude \[dq]*.bak\[dq] -\f[R] -.fi -.SS --suffix-keep-extension +Note that passwords are in +obscured (https://rclone.org/commands/rclone_obscure/) form. +Also, many storage systems uses token-based authentication instead of +passwords, and this requires additional steps. +It is easier, and safer, to use the interactive command +\f[C]rclone config\f[R] instead of manually editing the configuration +file. .PP -When using \f[C]--suffix\f[R], setting this causes rclone put the SUFFIX -before the extension of the files that it backs up rather than after. +The configuration file will typically contain login information, and +should therefore have restricted permissions so that only the current +user can read it. +Rclone tries to ensure this when it writes the file. +You may also choose to encrypt the file. .PP -So let\[aq]s say we had \f[C]--suffix -2019-01-01\f[R], without the flag -\f[C]file.txt\f[R] would be backed up to \f[C]file.txt-2019-01-01\f[R] -and with the flag it would be backed up to -\f[C]file-2019-01-01.txt\f[R]. -This can be helpful to make sure the suffixed files can still be opened. +When token-based authentication are used, the configuration file must be +writable, because rclone needs to update the tokens inside it. .PP -If a file has two (or more) extensions and the second (or subsequent) -extension is recognised as a valid mime type, then the suffix will go -before that extension. -So \f[C]file.tar.gz\f[R] would be backed up to -\f[C]file-2019-01-01.tar.gz\f[R] whereas \f[C]file.badextension.gz\f[R] -would be backed up to \f[C]file.badextension-2019-01-01.gz\f[R]. -.SS --syslog +To reduce risk of corrupting an existing configuration file, rclone will +not write directly to it when saving changes. +Instead it will first write to a new, temporary, file. +If a configuration file already existed, it will (on Unix systems) try +to mirror its permissions to the new file. +Then it will rename the existing file to a temporary name as backup. +Next, rclone will rename the new file to the correct name, before +finally cleaning up by deleting the backup file. .PP -On capable OSes (not Windows or Plan9) send all log output to syslog. +If the configuration file path used by rclone is a symbolic link, then +this will be evaluated and rclone will write to the resolved path, +instead of overwriting the symbolic link. +Temporary files used in the process (described above) will be written to +the same parent directory as that of the resolved configuration file, +but if this directory is also a symbolic link it will not be resolved +and the temporary files will be written to the location of the directory +symbolic link. +.SS --contimeout=TIME .PP -This can be useful for running rclone in a script or -\f[C]rclone mount\f[R]. -.SS --syslog-facility string +Set the connection timeout. +This should be in go time format which looks like \f[C]5s\f[R] for 5 +seconds, \f[C]10m\f[R] for 10 minutes, or \f[C]3h30m\f[R]. .PP -If using \f[C]--syslog\f[R] this sets the syslog facility (e.g. -\f[C]KERN\f[R], \f[C]USER\f[R]). -See \f[C]man syslog\f[R] for a list of possible facilities. -The default facility is \f[C]DAEMON\f[R]. -.SS --temp-dir=DIR +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 \f[C]1m\f[R] by default. +.SS --copy-dest=DIR .PP -Specify the directory rclone will use for temporary files, to override -the default. -Make sure the directory exists and have accessible permissions. +When using \f[C]sync\f[R], \f[C]copy\f[R] or \f[C]move\f[R] DIR is +checked in addition to the destination for files. +If a file identical to the source is found that file is server-side +copied from DIR to the destination. +This is useful for incremental backup. .PP -By default the operating system\[aq]s temp directory will be used: - On -Unix systems, \f[C]$TMPDIR\f[R] if non-empty, else \f[C]/tmp\f[R]. -- On Windows, the first non-empty value from \f[C]%TMP%\f[R], -\f[C]%TEMP%\f[R], \f[C]%USERPROFILE%\f[R], or the Windows directory. +The remote in use must support server-side copy and you must use the +same remote as the destination of the sync. +The compare directory must not overlap the destination directory. .PP -When overriding the default with this option, the specified path will be -set as value of environment variable \f[C]TMPDIR\f[R] on Unix systems -and \f[C]TMP\f[R] and \f[C]TEMP\f[R] on Windows. +See \f[C]--compare-dest\f[R] and \f[C]--backup-dir\f[R]. +.SS --dedupe-mode MODE .PP -You can use the config -paths (https://rclone.org/commands/rclone_config_paths/) command to see -the current value. -.SS --tpslimit float +Mode to run dedupe command in. +One of \f[C]interactive\f[R], \f[C]skip\f[R], \f[C]first\f[R], +\f[C]newest\f[R], \f[C]oldest\f[R], \f[C]rename\f[R]. +The default is \f[C]interactive\f[R]. +.PD 0 +.P +.PD +See the dedupe command for more information as to what these options +mean. +.SS --default-time TIME .PP -Limit transactions per second to this number. -Default is 0 which is used to mean unlimited transactions per second. +If a file or directory does have a modification time rclone can read +then rclone will display this fixed time instead. .PP -A transaction is roughly defined as an API call; its exact meaning will -depend on the backend. -For HTTP based backends it is an HTTP PUT/GET/POST/etc and its response. -For FTP/SFTP it is a round trip transaction over TCP. +The default is \f[C]2000-01-01 00:00:00 UTC\f[R]. +This can be configured in any of the ways shown in the time or duration +options. .PP -For example, to limit rclone to 10 transactions per second use -\f[C]--tpslimit 10\f[R], or to 1 transaction every 2 seconds use -\f[C]--tpslimit 0.5\f[R]. +For example \f[C]--default-time 2020-06-01\f[R] to set the default time +to the 1st of June 2020 or \f[C]--default-time 0s\f[R] to set the +default time to the time rclone started up. +.SS --disable FEATURE,FEATURE,... .PP -Use this when the number of transactions per second from rclone is -causing a problem with the cloud storage provider (e.g. -getting you banned or rate limited). +This disables a comma separated list of optional features. +For example to disable server-side move and server-side copy use: +.IP +.nf +\f[C] +--disable move,copy +\f[R] +.fi .PP -This can be very useful for \f[C]rclone mount\f[R] to control the -behaviour of applications using it. +The features can be put in any case. .PP -This limit applies to all HTTP based backends and to the FTP and SFTP -backends. -It does not apply to the local backend or the Storj backend. +To see a list of which features can be disabled use: +.IP +.nf +\f[C] +--disable help +\f[R] +.fi .PP -See also \f[C]--tpslimit-burst\f[R]. -.SS --tpslimit-burst int +The features a remote has can be seen in JSON format with: +.IP +.nf +\f[C] +rclone backend features remote: +\f[R] +.fi .PP -Max burst of transactions for \f[C]--tpslimit\f[R] (default -\f[C]1\f[R]). +See the overview features (https://rclone.org/overview/#features) and +optional features (https://rclone.org/overview/#optional-features) to +get an idea of which feature does what. .PP -Normally \f[C]--tpslimit\f[R] will do exactly the number of transaction -per second specified. -However if you supply \f[C]--tps-burst\f[R] then rclone can save up some -transactions from when it was idle giving a burst of up to the parameter -supplied. +Note that some features can be set to \f[C]true\f[R] if they are +\f[C]true\f[R]/\f[C]false\f[R] feature flag features by prefixing them +with \f[C]!\f[R]. +For example the \f[C]CaseInsensitive\f[R] feature can be forced to +\f[C]false\f[R] with \f[C]--disable CaseInsensitive\f[R] and forced to +\f[C]true\f[R] with \f[C]--disable \[aq]!CaseInsensitive\[aq]\f[R]. +In general it isn\[aq]t a good idea doing this but it may be useful in +extremis. .PP -For example if you provide \f[C]--tpslimit-burst 10\f[R] then if rclone -has been idle for more than 10*\f[C]--tpslimit\f[R] then it can do 10 -transactions very quickly before they are limited again. +(Note that \f[C]!\f[R] is a shell command which you will need to escape +with single quotes or a backslash on unix like platforms.) .PP -This may be used to increase performance of \f[C]--tpslimit\f[R] without -changing the long term average number of transactions per second. -.SS --track-renames +This flag can be useful for debugging and in exceptional circumstances +(e.g. +Google Drive limiting the total volume of Server Side Copies to 100 +GiB/day). +.SS --disable-http2 .PP -By default, rclone doesn\[aq]t keep track of renamed files, so if you -rename a file locally then sync it to a remote, rclone will delete the -old file on the remote and upload a new copy. +This stops rclone from trying to use HTTP/2 if available. +This can sometimes speed up transfers due to a problem in the Go +standard library (https://github.com/golang/go/issues/37373). +.SS --dscp VALUE .PP -An rclone sync with \f[C]--track-renames\f[R] runs like a normal sync, -but keeps track of objects which exist in the destination but not in the -source (which would normally be deleted), and which objects exist in the -source but not the destination (which would normally be transferred). -These objects are then candidates for renaming. +Specify a DSCP value or name to use in connections. +This could help QoS system to identify traffic class. +BE, EF, DF, LE, CSx and AFxx are allowed. .PP -After the sync, rclone matches up the source only and destination only -objects using the \f[C]--track-renames-strategy\f[R] specified and -either renames the destination object or transfers the source and -deletes the destination object. -\f[C]--track-renames\f[R] is stateless like all of rclone\[aq]s syncs. +See the description of differentiated +services (https://en.wikipedia.org/wiki/Differentiated_services) to get +an idea of this field. +Setting this to 1 (LE) to identify the flow to SCAVENGER class can avoid +occupying too much bandwidth in a network with DiffServ support (RFC +8622 (https://tools.ietf.org/html/rfc8622)). .PP -To use this flag the destination must support server-side copy or -server-side move, and to use a hash based -\f[C]--track-renames-strategy\f[R] (the default) the source and the -destination must have a compatible hash. +For example, if you configured QoS on router to handle LE properly. +Running: +.IP +.nf +\f[C] +rclone copy --dscp LE from:/from to:/to +\f[R] +.fi .PP -If the destination does not support server-side copy or move, rclone -will fall back to the default behaviour and log an error level message -to the console. +would make the priority lower than usual internet flows. .PP -Encrypted destinations are not currently supported by -\f[C]--track-renames\f[R] if \f[C]--track-renames-strategy\f[R] includes -\f[C]hash\f[R]. +This option has no effect on Windows (see +golang/go#42728 (https://github.com/golang/go/issues/42728)). +.SS -n, --dry-run .PP -Note that \f[C]--track-renames\f[R] is incompatible with -\f[C]--no-traverse\f[R] and that it uses extra memory to keep track of -all the rename candidates. +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 \f[C]sync\f[R] command which deletes files in +the destination. +.SS --expect-continue-timeout=TIME .PP -Note also that \f[C]--track-renames\f[R] is incompatible with -\f[C]--delete-before\f[R] and will select \f[C]--delete-after\f[R] -instead of \f[C]--delete-during\f[R]. -.SS --track-renames-strategy (hash,modtime,leaf,size) +This specifies the amount of time to wait for a server\[aq]s first +response headers after fully writing the request headers if the request +has an \[dq]Expect: 100-continue\[dq] header. +Not all backends support using this. .PP -This option changes the file matching criteria for -\f[C]--track-renames\f[R]. +Zero means no timeout and causes the body to be sent immediately, +without waiting for the server to approve. +This time does not include the time to send the request header. .PP -The matching is controlled by a comma separated selection of these -tokens: -.IP \[bu] 2 -\f[C]modtime\f[R] - the modification time of the file - not supported on -all backends -.IP \[bu] 2 -\f[C]hash\f[R] - the hash of the file contents - not supported on all -backends -.IP \[bu] 2 -\f[C]leaf\f[R] - the name of the file not including its directory name -.IP \[bu] 2 -\f[C]size\f[R] - the size of the file (this is always enabled) +The default is \f[C]1s\f[R]. +Set to \f[C]0\f[R] to disable. +.SS --error-on-no-transfer .PP -The default option is \f[C]hash\f[R]. +By default, rclone will exit with return code 0 if there were no errors. .PP -Using \f[C]--track-renames-strategy modtime,leaf\f[R] would match files -based on modification time, the leaf of the file name and the size only. +This option allows rclone to return exit code 9 if no files were +transferred between the source and destination. +This allows using rclone in scripts, and triggering follow-on actions if +data was copied, or skipping if not. .PP -Using \f[C]--track-renames-strategy modtime\f[R] or \f[C]leaf\f[R] can -enable \f[C]--track-renames\f[R] support for encrypted destinations. +NB: Enabling this option turns a usually non-fatal error into a +potentially fatal one - please check and adjust your scripts +accordingly! +.SS --fs-cache-expire-duration=TIME .PP -Note that the \f[C]hash\f[R] strategy is not supported with encrypted -destinations. -.SS --delete-(before,during,after) +When using rclone via the API rclone caches created remotes for 5 +minutes by default in the \[dq]fs cache\[dq]. +This means that if you do repeated actions on the same remote then +rclone won\[aq]t have to build it again from scratch, which makes it +more efficient. .PP -This option allows you to specify when files on your destination are -deleted when you sync folders. +This flag sets the time that the remotes are cached for. +If you set it to \f[C]0\f[R] (or negative) then rclone won\[aq]t cache +the remotes at all. .PP -Specifying the value \f[C]--delete-before\f[R] will delete all files -present on the destination, but not on the source \f[I]before\f[R] -starting the transfer of any new or updated files. -This uses two passes through the file systems, one for the deletions and -one for the copies. +Note that if you use some flags, eg \f[C]--backup-dir\f[R] and if this +is set to \f[C]0\f[R] rclone may build two remotes (one for the source +or destination and one for the \f[C]--backup-dir\f[R] where it may have +only built one before. +.SS --fs-cache-expire-interval=TIME .PP -Specifying \f[C]--delete-during\f[R] will delete files while checking -and uploading files. -This is the fastest option and uses the least memory. +This controls how often rclone checks for cached remotes to expire. +See the \f[C]--fs-cache-expire-duration\f[R] documentation above for +more info. +The default is 60s, set to 0 to disable expiry. +.SS --header .PP -Specifying \f[C]--delete-after\f[R] (the default value) will delay -deletion of files until all new/updated files have been successfully -transferred. -The files to be deleted are collected in the copy pass then deleted -after the copy pass has completed successfully. -The files to be deleted are held in memory so this mode may use more -memory. -This is the safest mode as it will only delete files if there have been -no errors subsequent to that. -If there have been errors before the deletions start then you will get -the message \f[C]not deleting files as there were IO errors\f[R]. -.SS --fast-list +Add an HTTP header for all transactions. +The flag can be repeated to add multiple headers. .PP -When doing anything which involves a directory listing (e.g. -\f[C]sync\f[R], \f[C]copy\f[R], \f[C]ls\f[R] - in fact nearly every -command), rclone normally lists a directory and processes it before -using more directory lists to process any subdirectories. -This can be parallelised and works very quickly using the least amount -of memory. +If you want to add headers only for uploads use +\f[C]--header-upload\f[R] and if you want to add headers only for +downloads use \f[C]--header-download\f[R]. .PP -However, some remotes have a way of listing all files beneath a -directory in one (or a small number) of transactions. -These tend to be the bucket-based remotes (e.g. -S3, B2, GCS, Swift). +This flag is supported for all HTTP based backends even those not +supported by \f[C]--header-upload\f[R] and \f[C]--header-download\f[R] +so may be used as a workaround for those with care. +.IP +.nf +\f[C] +rclone ls remote:test --header \[dq]X-Rclone: Foo\[dq] --header \[dq]X-LetMeIn: Yes\[dq] +\f[R] +.fi +.SS --header-download .PP -If you use the \f[C]--fast-list\f[R] flag then rclone will use this -method for listing directories. -This will have the following consequences for the listing: -.IP \[bu] 2 -It \f[B]will\f[R] use fewer transactions (important if you pay for them) -.IP \[bu] 2 -It \f[B]will\f[R] use more memory. -Rclone has to load the whole listing into memory. -.IP \[bu] 2 -It \f[I]may\f[R] be faster because it uses fewer transactions -.IP \[bu] 2 -It \f[I]may\f[R] be slower because it can\[aq]t be parallelized +Add an HTTP header for all download transactions. +The flag can be repeated to add multiple headers. +.IP +.nf +\f[C] +rclone sync --interactive s3:test/src \[ti]/dst --header-download \[dq]X-Amz-Meta-Test: Foo\[dq] --header-download \[dq]X-Amz-Meta-Test2: Bar\[dq] +\f[R] +.fi .PP -rclone should always give identical results with and without -\f[C]--fast-list\f[R]. +See the GitHub issue here (https://github.com/rclone/rclone/issues/59) +for currently supported backends. +.SS --header-upload .PP -If you pay for transactions and can fit your entire sync listing into -memory then \f[C]--fast-list\f[R] is recommended. -If you have a very big sync to do then don\[aq]t use -\f[C]--fast-list\f[R] otherwise you will run out of memory. +Add an HTTP header for all upload transactions. +The flag can be repeated to add multiple headers. +.IP +.nf +\f[C] +rclone sync --interactive \[ti]/src s3:test/dst --header-upload \[dq]Content-Disposition: attachment; filename=\[aq]cool.html\[aq]\[dq] --header-upload \[dq]X-Amz-Meta-Test: FooBar\[dq] +\f[R] +.fi .PP -If you use \f[C]--fast-list\f[R] on a remote which doesn\[aq]t support -it, then rclone will just ignore it. -.SS --timeout=TIME -.PP -This sets the IO idle timeout. -If a transfer has started but then becomes idle for this long it is -considered broken and disconnected. -.PP -The default is \f[C]5m\f[R]. -Set to \f[C]0\f[R] to disable. -.SS --transfers=N -.PP -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. -.PP -The default is to run 4 file transfers in parallel. -.PP -Look at --multi-thread-streams if you would like to control single file -transfers. -.SS -u, --update -.PP -This forces rclone to skip any files which exist on the destination and -have a modified time that is newer than the source file. -.PP -This can be useful in avoiding needless transfers when transferring to a -remote which doesn\[aq]t support modification times directly (or when -using \f[C]--use-server-modtime\f[R] to avoid extra API calls) as it is -more accurate than a \f[C]--size-only\f[R] check and faster than using -\f[C]--checksum\f[R]. -On such remotes (or when using \f[C]--use-server-modtime\f[R]) the time -checked will be the uploaded time. -.PP -If an existing destination file has a modification time older than the -source file\[aq]s, it will be updated if the sizes are different. -If the sizes are the same, it will be updated if the checksum is -different or not available. -.PP -If an existing destination file has a modification time equal (within -the computed modify window) to the source file\[aq]s, it will be updated -if the sizes are different. -The checksum will not be checked in this case unless the -\f[C]--checksum\f[R] flag is provided. -.PP -In all other cases the file will not be updated. +See the GitHub issue here (https://github.com/rclone/rclone/issues/59) +for currently supported backends. +.SS --human-readable .PP -Consider using the \f[C]--modify-window\f[R] flag to compensate for time -skews between the source and the backend, for backends that do not -support mod times, and instead use uploaded times. -However, if the backend does not support checksums, note that syncing or -copying within the time skew window may still result in additional -transfers for safety. -.SS --use-mmap +Rclone commands output values for sizes (e.g. +number of bytes) and counts (e.g. +number of files) either as \f[I]raw\f[R] numbers, or in +\f[I]human-readable\f[R] format. .PP -If this flag is set then rclone will use anonymous memory allocated by -mmap on Unix based platforms and VirtualAlloc on Windows for its -transfer buffers (size controlled by \f[C]--buffer-size\f[R]). -Memory allocated like this does not go on the Go heap and can be -returned to the OS immediately when it is finished with. +In human-readable format the values are scaled to larger units, +indicated with a suffix shown after the value, and rounded to three +decimals. +Rclone consistently uses binary units (powers of 2) for sizes and +decimal units (powers of 10) for counts. +The unit prefix for size is according to IEC standard notation, e.g. +\f[C]Ki\f[R] for kibi. +Used with byte unit, \f[C]1 KiB\f[R] means 1024 Byte. +In list type of output, only the unit prefix appended to the value (e.g. +\f[C]9.762Ki\f[R]), while in more textual output the full unit is shown +(e.g. +\f[C]9.762 KiB\f[R]). +For counts the SI standard notation is used, e.g. +prefix \f[C]k\f[R] for kilo. +Used with file counts, \f[C]1k\f[R] means 1000 files. .PP -If this flag is not set then rclone will allocate and free the buffers -using the Go memory allocator which may use more memory as memory pages -are returned less aggressively to the OS. +The various list (https://rclone.org/commands/rclone_ls/) commands +output raw numbers by default. +Option \f[C]--human-readable\f[R] will make them output values in +human-readable format instead (with the short unit prefix). .PP -It is possible this does not work well on all platforms so it is -disabled by default; in the future it may be enabled by default. -.SS --use-server-modtime +The about (https://rclone.org/commands/rclone_about/) command outputs +human-readable by default, with a command-specific option +\f[C]--full\f[R] to output the raw numbers instead. .PP -Some object-store backends (e.g, Swift, S3) do not preserve file -modification times (modtime). -On these backends, rclone stores the original modtime as additional -metadata on the object. -By default it will make an API call to retrieve the metadata when the -modtime is needed by an operation. +Command size (https://rclone.org/commands/rclone_size/) outputs both +human-readable and raw numbers in the same output. .PP -Use this flag to disable the extra API call and rely instead on the -server\[aq]s modified time. -In cases such as a local to remote sync using \f[C]--update\f[R], -knowing the local file is newer than the time it was last uploaded to -the remote is sufficient. -In those cases, this flag can speed up the process and reduce the number -of API calls necessary. +The tree (https://rclone.org/commands/rclone_tree/) command also +considers \f[C]--human-readable\f[R], but it will not use the exact same +notation as the other commands: It rounds to one decimal, and uses +single letter suffix, e.g. +\f[C]K\f[R] instead of \f[C]Ki\f[R]. +The reason for this is that it relies on an external library. .PP -Using this flag on a sync operation without also using -\f[C]--update\f[R] would cause all files modified at any time other than -the last upload time to be uploaded again, which is probably not what -you want. -.SS -v, -vv, --verbose +The interactive command ncdu (https://rclone.org/commands/rclone_ncdu/) +shows human-readable by default, and responds to key \f[C]u\f[R] for +toggling human-readable format. +.SS --ignore-case-sync .PP -With \f[C]-v\f[R] rclone will tell you about each file that is -transferred and a small number of significant events. +Using this option will cause rclone to ignore the case of the files when +synchronizing so files will not be copied/synced when the existing +filenames are the same, even if the casing is different. +.SS --ignore-checksum .PP -With \f[C]-vv\f[R] rclone will become very verbose telling you about -every file it considers and transfers. -Please send bug reports with a log with this setting. +Normally rclone will check that the checksums of transferred files +match, and give an error \[dq]corrupted on transfer\[dq] if they +don\[aq]t. .PP -When setting verbosity as an environment variable, use -\f[C]RCLONE_VERBOSE=1\f[R] or \f[C]RCLONE_VERBOSE=2\f[R] for -\f[C]-v\f[R] and \f[C]-vv\f[R] respectively. -.SS -V, --version +You can use this option to skip that check. +You should only use it if you have had the \[dq]corrupted on +transfer\[dq] error message and you are sure you might want to transfer +potentially corrupted data. +.SS --ignore-existing .PP -Prints the version number -.SS SSL/TLS options +Using this option will make rclone unconditionally skip all files that +exist on the destination, no matter the content of these files. .PP -The outgoing SSL/TLS connections rclone makes can be controlled with -these options. -For example this can be very useful with the HTTP or WebDAV backends. -Rclone HTTP servers have their own set of configuration for SSL/TLS -which you can find in their documentation. -.SS --ca-cert stringArray +While this isn\[aq]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. .PP -This loads the PEM encoded certificate authority certificates and uses -it to verify the certificates of the servers rclone connects to. +When performing a \f[C]move\f[R]/\f[C]moveto\f[R] command, this flag +will leave skipped files in the source location unchanged when a file +with the same name exists on the destination. +.SS --ignore-size .PP -If you have generated certificates signed with a local CA then you will -need this flag to connect to servers using those certificates. -.SS --client-cert string +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 modification time. +If \f[C]--checksum\f[R] is set then it only checks the checksum. .PP -This loads the PEM encoded client side certificate. +It will also cause rclone to skip verifying the sizes are the same after +transfer. .PP -This is used for mutual TLS -authentication (https://en.wikipedia.org/wiki/Mutual_authentication). +This can be useful for transferring files to and from OneDrive which +occasionally misreports the size of image files (see +#399 (https://github.com/rclone/rclone/issues/399) for more info). +.SS -I, --ignore-times .PP -The \f[C]--client-key\f[R] flag is required too when using this. -.SS --client-key string +Using this option will cause rclone to unconditionally upload all files +regardless of the state of files on the destination. .PP -This loads the PEM encoded client side private key used for mutual TLS -authentication. -Used in conjunction with \f[C]--client-cert\f[R]. -.SS --no-check-certificate=true/false +Normally rclone would skip any files that have the same modification +time and are the same size (or have the same checksum if using +\f[C]--checksum\f[R]). +.SS --immutable .PP -\f[C]--no-check-certificate\f[R] controls whether a client verifies the -server\[aq]s certificate chain and host name. -If \f[C]--no-check-certificate\f[R] 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. +Treat source and destination files as immutable and disallow +modification. .PP -This option defaults to \f[C]false\f[R]. +With this option set, files will be created and deleted as requested, +but existing files will never be updated. +If an existing file does not match between the source and destination, +rclone will give the error +\f[C]Source and destination exist but do not match: immutable file modified\f[R]. .PP -\f[B]This should be used only for testing.\f[R] -.SS Configuration Encryption +Note that only commands which transfer files (e.g. +\f[C]sync\f[R], \f[C]copy\f[R], \f[C]move\f[R]) are affected by this +behavior, and only modification is disallowed. +Files may still be deleted explicitly (e.g. +\f[C]delete\f[R], \f[C]purge\f[R]) or implicitly (e.g. +\f[C]sync\f[R], \f[C]move\f[R]). +Use \f[C]copy --immutable\f[R] if it is desired to avoid deletion as +well as modification. .PP -Your configuration file contains information for logging in to your -cloud services. -This means that you should keep your \f[C]rclone.conf\f[R] file in a -secure location. +This can be useful as an additional layer of protection for immutable or +append-only data sets (notably backup archives), where modification +implies corruption and should not be propagated. +.SS --inplace .PP -If you are in an environment where that isn\[aq]t possible, you can add -a password to your configuration. -This means that you will have to supply the password every time you -start rclone. +The \f[C]--inplace\f[R] flag changes the behaviour of rclone when +uploading files to some backends (backends with the +\f[C]PartialUploads\f[R] feature flag set) such as: +.IP \[bu] 2 +local +.IP \[bu] 2 +ftp +.IP \[bu] 2 +sftp .PP -To add a password to your rclone configuration, execute -\f[C]rclone config\f[R]. +Without \f[C]--inplace\f[R] (the default) rclone will first upload to a +temporary file with an extension like this, where \f[C]XXXXXX\f[R] +represents a random string and \f[C].partial\f[R] is --partial-suffix +value (\f[C].partial\f[R] by default). .IP .nf \f[C] ->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> +original-file-name.XXXXXX.partial \f[R] .fi .PP -Go into \f[C]s\f[R], Set configuration password: -.IP -.nf -\f[C] -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> -\f[R] -.fi +(rclone will make sure the final name is no longer than 100 characters +by truncating the \f[C]original-file-name\f[R] part if necessary). .PP -Your configuration is now encrypted, and every time you start rclone you -will have to supply the password. -See below for details. -In the same menu, you can change the password or completely remove -encryption from your configuration. +When the upload is complete, rclone will rename the \f[C].partial\f[R] +file to the correct name, overwriting any existing file at that point. +If the upload fails then the \f[C].partial\f[R] file will be deleted. .PP -There is no way to recover the configuration if you lose your password. +This prevents other users of the backend from seeing partially uploaded +files in their new names and prevents overwriting the old file until the +new one is completely uploaded. .PP -rclone uses nacl -secretbox (https://godoc.org/golang.org/x/crypto/nacl/secretbox) which -in turn 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. +If the \f[C]--inplace\f[R] flag is supplied, rclone will upload directly +to the final name without creating a \f[C].partial\f[R] file. .PP -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. +This means that an incomplete file will be visible in the directory +listings while the upload is in progress and any existing files will be +overwritten as soon as the upload starts. +If the transfer fails then the file will be deleted. +This can cause data loss of the existing file if the transfer fails. .PP -If it is safe in your environment, you can set the -\f[C]RCLONE_CONFIG_PASS\f[R] environment variable to contain your -password, in which case it will be used for decrypting the -configuration. +Note that on the local file system if you don\[aq]t use +\f[C]--inplace\f[R] hard links (Unix only) will be broken. +And if you do use \f[C]--inplace\f[R] you won\[aq]t be able to update in +use executables. .PP -You can set this for a session from a script. -For unix like systems save this to a file called -\f[C]set-rclone-password\f[R]: -.IP -.nf -\f[C] -#!/bin/echo Source this file don\[aq]t run it - -read -s RCLONE_CONFIG_PASS -export RCLONE_CONFIG_PASS -\f[R] -.fi +Note also that versions of rclone prior to v1.63.0 behave as if the +\f[C]--inplace\f[R] flag is always supplied. +.SS -i, --interactive .PP -Then source the file when you want to use it. -From the shell you would do \f[C]source set-rclone-password\f[R]. -It will then ask you for the password and set it in the environment -variable. +This flag can be used to tell rclone that you wish a manual confirmation +before destructive operations. .PP -An alternate means of supplying the password is to provide a script -which will retrieve the password and print on standard output. -This script should have a fully specified path name and not rely on any -environment variables. -The script is supplied either via -\f[C]--password-command=\[dq]...\[dq]\f[R] command line argument or via -the \f[C]RCLONE_PASSWORD_COMMAND\f[R] environment variable. +It is \f[B]recommended\f[R] that you use this flag while learning rclone +especially with \f[C]rclone sync\f[R]. .PP -One useful example of this is using the \f[C]passwordstore\f[R] -application to retrieve the password: +For example .IP .nf \f[C] -export RCLONE_PASSWORD_COMMAND=\[dq]pass rclone/config\[dq] +$ rclone delete --interactive /tmp/dir +rclone: delete \[dq]important-file.txt\[dq]? +y) Yes, this is OK (default) +n) No, skip this +s) Skip all delete operations with no more questions +!) Do all delete operations with no more questions +q) Exit rclone now. +y/n/s/!/q> n \f[R] .fi .PP -If the \f[C]passwordstore\f[R] password manager holds the password for -the rclone configuration, using the script method means the password is -primarily protected by the \f[C]passwordstore\f[R] system, and is never -embedded in the clear in scripts, nor available for examination using -the standard commands available. -It is quite possible with long running rclone sessions for copies of -passwords to be innocently captured in log files or terminal scroll -buffers, etc. -Using the script method of supplying the password enhances the security -of the config password considerably. +The options mean +.IP \[bu] 2 +\f[C]y\f[R]: \f[B]Yes\f[R], this operation should go ahead. +You can also press Return for this to happen. +You\[aq]ll be asked every time unless you choose \f[C]s\f[R] or +\f[C]!\f[R]. +.IP \[bu] 2 +\f[C]n\f[R]: \f[B]No\f[R], do not do this operation. +You\[aq]ll be asked every time unless you choose \f[C]s\f[R] or +\f[C]!\f[R]. +.IP \[bu] 2 +\f[C]s\f[R]: \f[B]Skip\f[R] all the following operations of this type +with no more questions. +This takes effect until rclone exits. +If there are any different kind of operations you\[aq]ll be prompted for +them. +.IP \[bu] 2 +\f[C]!\f[R]: \f[B]Do all\f[R] the following operations with no more +questions. +Useful if you\[aq]ve decided that you don\[aq]t mind rclone doing that +kind of operation. +This takes effect until rclone exits . +If there are any different kind of operations you\[aq]ll be prompted for +them. +.IP \[bu] 2 +\f[C]q\f[R]: \f[B]Quit\f[R] rclone now, just in case! +.SS --leave-root .PP -If you are running rclone inside a script, unless you are using the -\f[C]--password-command\f[R] method, you might want to disable password -prompts. -To do that, pass the parameter \f[C]--ask-password=false\f[R] to rclone. -This will make rclone fail instead of asking for a password if -\f[C]RCLONE_CONFIG_PASS\f[R] doesn\[aq]t contain a valid password, and -\f[C]--password-command\f[R] has not been supplied. +During rmdirs it will not remove root directory, even if it\[aq]s empty. +.SS --log-file=FILE .PP -Whenever running commands that may be affected by options in a -configuration file, rclone will look for an existing file according to -the rules described above, and load any it finds. -If an encrypted file is found, this includes decrypting it, with the -possible consequence of a password prompt. -When executing a command line that you know are not actually using -anything from such a configuration file, you can avoid it being loaded -by overriding the location, e.g. -with one of the documented special values for memory-only configuration. -Since only backend options can be stored in configuration files, this is -normally unnecessary for commands that do not operate on backends, e.g. -\f[C]genautocomplete\f[R]. -However, it will be relevant for commands that do operate on backends in -general, but are used without referencing a stored remote, e.g. -listing local filesystem paths, or connection strings: -\f[C]rclone --config=\[dq]\[dq] ls .\f[R] -.SS Developer options +Log all of rclone\[aq]s output to FILE. +This is not active by default. +This can be useful for tracking down problems with syncs in combination +with the \f[C]-v\f[R] flag. +See the Logging section for more info. .PP -These options are useful when developing or debugging rclone. -There are also some more remote specific options which aren\[aq]t -documented here which are used for testing. -These start with remote name e.g. -\f[C]--drive-test-option\f[R] - see the docs for the remote in question. -.SS --cpuprofile=FILE +If FILE exists then rclone will append to it. .PP -Write CPU profile to file. -This can be analysed with \f[C]go tool pprof\f[R]. -.SS --dump flag,flag,flag +Note that if you are using the \f[C]logrotate\f[R] program to manage +rclone\[aq]s logs, then you should use the \f[C]copytruncate\f[R] option +as rclone doesn\[aq]t have a signal to rotate logs. +.SS --log-format LIST .PP -The \f[C]--dump\f[R] flag takes a comma separated list of flags to dump -info about. +Comma separated list of log format options. +Accepted options are \f[C]date\f[R], \f[C]time\f[R], +\f[C]microseconds\f[R], \f[C]pid\f[R], \f[C]longfile\f[R], +\f[C]shortfile\f[R], \f[C]UTC\f[R]. +Any other keywords will be silently ignored. +\f[C]pid\f[R] will tag log messages with process identifier which useful +with \f[C]rclone mount --daemon\f[R]. +Other accepted options are explained in the go +documentation (https://pkg.go.dev/log#pkg-constants). +The default log format is \[dq]\f[C]date\f[R],\f[C]time\f[R]\[dq]. +.SS --log-level LEVEL .PP -Note that some headers including \f[C]Accept-Encoding\f[R] as shown may -not be correct in the request and the response may not show -\f[C]Content-Encoding\f[R] if the go standard libraries auto gzip -encoding was in effect. -In this case the body of the request will be gunzipped before showing -it. +This sets the log level for rclone. +The default log level is \f[C]NOTICE\f[R]. .PP -The available flags are: -.SS --dump headers +\f[C]DEBUG\f[R] is equivalent to \f[C]-vv\f[R]. +It outputs lots of debug info - useful for bug reports and really +finding out what rclone is doing. .PP -Dump HTTP headers with \f[C]Authorization:\f[R] lines removed. -May still contain sensitive info. -Can be very verbose. -Useful for debugging only. +\f[C]INFO\f[R] is equivalent to \f[C]-v\f[R]. +It outputs information about each transfer and prints stats once a +minute by default. .PP -Use \f[C]--dump auth\f[R] if you do want the \f[C]Authorization:\f[R] -headers. -.SS --dump bodies +\f[C]NOTICE\f[R] is the default log level if no logging flags are +supplied. +It outputs very little when things are working normally. +It outputs warnings and significant events. .PP -Dump HTTP headers and bodies - may contain sensitive info. -Can be very verbose. -Useful for debugging only. +\f[C]ERROR\f[R] is equivalent to \f[C]-q\f[R]. +It only outputs error messages. +.SS --use-json-log .PP -Note that the bodies are buffered in memory so don\[aq]t use this for -enormous files. -.SS --dump requests +This switches the log format to JSON for rclone. +The fields of json log are level, msg, source, time. +.SS --low-level-retries NUMBER .PP -Like \f[C]--dump bodies\f[R] but dumps the request bodies and the -response headers. -Useful for debugging download problems. -.SS --dump responses +This controls the number of low level retries rclone does. .PP -Like \f[C]--dump bodies\f[R] but dumps the response bodies and the -request headers. -Useful for debugging upload problems. -.SS --dump auth +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 \f[C]-v\f[R] flag. .PP -Dump HTTP headers - will contain sensitive info such as -\f[C]Authorization:\f[R] headers - use \f[C]--dump headers\f[R] to dump -without \f[C]Authorization:\f[R] headers. -Can be very verbose. -Useful for debugging only. -.SS --dump filters +This shouldn\[aq]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 +\f[C]--retries\f[R] flag) quicker. .PP -Dump the filters to the output. -Useful to see exactly what include and exclude options are filtering on. -.SS --dump goroutines +Disable low level retries with \f[C]--low-level-retries 1\f[R]. +.SS --max-backlog=N .PP -This dumps a list of the running go-routines at the end of the command -to standard output. -.SS --dump openfiles -.PP -This dumps a list of the open files at the end of the command. -It uses the \f[C]lsof\f[R] command to do that so you\[aq]ll need that -installed to use it. -.SS --memprofile=FILE -.PP -Write memory profile to file. -This can be analysed with \f[C]go tool pprof\f[R]. -.SS Filtering -.PP -For the filtering options -.IP \[bu] 2 -\f[C]--delete-excluded\f[R] -.IP \[bu] 2 -\f[C]--filter\f[R] -.IP \[bu] 2 -\f[C]--filter-from\f[R] -.IP \[bu] 2 -\f[C]--exclude\f[R] -.IP \[bu] 2 -\f[C]--exclude-from\f[R] -.IP \[bu] 2 -\f[C]--exclude-if-present\f[R] -.IP \[bu] 2 -\f[C]--include\f[R] -.IP \[bu] 2 -\f[C]--include-from\f[R] -.IP \[bu] 2 -\f[C]--files-from\f[R] -.IP \[bu] 2 -\f[C]--files-from-raw\f[R] -.IP \[bu] 2 -\f[C]--min-size\f[R] -.IP \[bu] 2 -\f[C]--max-size\f[R] -.IP \[bu] 2 -\f[C]--min-age\f[R] -.IP \[bu] 2 -\f[C]--max-age\f[R] -.IP \[bu] 2 -\f[C]--dump filters\f[R] -.IP \[bu] 2 -\f[C]--metadata-include\f[R] -.IP \[bu] 2 -\f[C]--metadata-include-from\f[R] -.IP \[bu] 2 -\f[C]--metadata-exclude\f[R] -.IP \[bu] 2 -\f[C]--metadata-exclude-from\f[R] -.IP \[bu] 2 -\f[C]--metadata-filter\f[R] -.IP \[bu] 2 -\f[C]--metadata-filter-from\f[R] -.PP -See the filtering section (https://rclone.org/filtering/). -.SS Remote control -.PP -For the remote control options and for instructions on how to remote -control rclone -.IP \[bu] 2 -\f[C]--rc\f[R] -.IP \[bu] 2 -and anything starting with \f[C]--rc-\f[R] -.PP -See the remote control section (https://rclone.org/rc/). -.SS Logging -.PP -rclone has 4 levels of logging, \f[C]ERROR\f[R], \f[C]NOTICE\f[R], -\f[C]INFO\f[R] and \f[C]DEBUG\f[R]. -.PP -By default, rclone logs to standard error. -This means you can redirect standard error and still see the normal -output of rclone commands (e.g. -\f[C]rclone ls\f[R]). -.PP -By default, rclone will produce \f[C]Error\f[R] and \f[C]Notice\f[R] -level messages. +This is the maximum allowable backlog of files in a sync/copy/move +queued for being checked or transferred. .PP -If you use the \f[C]-q\f[R] flag, rclone will only produce -\f[C]Error\f[R] messages. +This can be set arbitrarily large. +It will only use memory when the queue is in use. +Note that it will use in the order of N KiB of memory when the backlog +is in use. .PP -If you use the \f[C]-v\f[R] flag, rclone will produce \f[C]Error\f[R], -\f[C]Notice\f[R] and \f[C]Info\f[R] messages. +Setting this large allows rclone to calculate how many files are pending +more accurately, give a more accurate estimated finish time and make +\f[C]--order-by\f[R] work more accurately. .PP -If you use the \f[C]-vv\f[R] flag, rclone will produce \f[C]Error\f[R], -\f[C]Notice\f[R], \f[C]Info\f[R] and \f[C]Debug\f[R] messages. +Setting this small will make rclone more synchronous to the listings of +the remote which may be desirable. .PP -You can also control the log levels with the \f[C]--log-level\f[R] flag. +Setting this to a negative number will make the backlog as large as +possible. +.SS --max-delete=N .PP -If you use the \f[C]--log-file=FILE\f[R] option, rclone will redirect -\f[C]Error\f[R], \f[C]Info\f[R] and \f[C]Debug\f[R] messages along with -standard error to FILE. +This tells rclone not to delete more than N files. +If that limit is exceeded then a fatal error will be generated and +rclone will stop the operation in progress. +.SS --max-delete-size=SIZE .PP -If you use the \f[C]--syslog\f[R] flag then rclone will log to syslog -and the \f[C]--syslog-facility\f[R] control which facility it uses. +Rclone will stop deleting files when the total size of deletions has +reached the size specified. +It defaults to off. .PP -Rclone prefixes all log messages with their level in capitals, e.g. -INFO which makes it easy to grep the log file for different kinds of -information. -.SS Exit Code +If that limit is exceeded then a fatal error will be generated and +rclone will stop the operation in progress. +.SS --max-depth=N .PP -If any errors occur during the command execution, rclone will exit with -a non-zero exit code. -This allows scripts to detect when rclone operations have failed. +This modifies the recursion depth for all the commands except purge. .PP -During the startup phase, rclone will exit immediately if an error is -detected in the configuration. -There will always be a log message immediately before exiting. +So if you do \f[C]rclone --max-depth 1 ls remote:path\f[R] you will see +only the files in the top level directory. +Using \f[C]--max-depth 2\f[R] means you will see all the files in first +two directory levels and so on. .PP -When rclone is running it will accumulate errors as it goes along, and -only exit with a non-zero exit code if (after retries) there were still -failed transfers. -For every error counted there will be a high priority log message -(visible with \f[C]-q\f[R]) showing the message and which file caused -the problem. -A high priority message is also shown when starting a retry so the user -can see that any previous error messages may not be valid after the -retry. -If rclone has done a retry it will log a high priority message if the -retry was successful. -.SS List of exit codes -.IP \[bu] 2 -\f[C]0\f[R] - success -.IP \[bu] 2 -\f[C]1\f[R] - Syntax or usage error -.IP \[bu] 2 -\f[C]2\f[R] - Error not otherwise categorised -.IP \[bu] 2 -\f[C]3\f[R] - Directory not found -.IP \[bu] 2 -\f[C]4\f[R] - File not found -.IP \[bu] 2 -\f[C]5\f[R] - Temporary error (one that more retries might fix) (Retry -errors) -.IP \[bu] 2 -\f[C]6\f[R] - Less serious errors (like 461 errors from dropbox) -(NoRetry errors) -.IP \[bu] 2 -\f[C]7\f[R] - Fatal error (one that more retries won\[aq]t fix, like -account suspended) (Fatal errors) -.IP \[bu] 2 -\f[C]8\f[R] - Transfer exceeded - limit set by --max-transfer reached -.IP \[bu] 2 -\f[C]9\f[R] - Operation successful, but no files transferred -.IP \[bu] 2 -\f[C]10\f[R] - Duration exceeded - limit set by --max-duration reached -.SS Environment Variables +For historical reasons the \f[C]lsd\f[R] command defaults to using a +\f[C]--max-depth\f[R] of 1 - you can override this with the command line +flag. .PP -Rclone can be configured entirely using environment variables. -These can be used to set defaults for options or config file entries. -.SS Options +You can use this command to disable recursion (with +\f[C]--max-depth 1\f[R]). .PP -Every option in rclone can have its default set by environment variable. +Note that if you use this with \f[C]sync\f[R] and +\f[C]--delete-excluded\f[R] the files not recursed through are +considered excluded and will be deleted on the destination. +Test first with \f[C]--dry-run\f[R] if you are not sure what will +happen. +.SS --max-duration=TIME .PP -To find the name of the environment variable, first, take the long -option name, strip the leading \f[C]--\f[R], change \f[C]-\f[R] to -\f[C]_\f[R], make upper case and prepend \f[C]RCLONE_\f[R]. +Rclone will stop transferring when it has run for the duration +specified. +Defaults to off. .PP -For example, to always set \f[C]--stats 5s\f[R], set the environment -variable \f[C]RCLONE_STATS=5s\f[R]. -If you set stats on the command line this will override the environment -variable setting. +When the limit is reached all transfers will stop immediately. +Use \f[C]--cutoff-mode\f[R] to modify this behaviour. .PP -Or to always use the trash in drive \f[C]--drive-use-trash\f[R], set -\f[C]RCLONE_DRIVE_USE_TRASH=true\f[R]. +Rclone will exit with exit code 10 if the duration limit is reached. +.SS --max-transfer=SIZE .PP -Verbosity is slightly different, the environment variable equivalent of -\f[C]--verbose\f[R] or \f[C]-v\f[R] is \f[C]RCLONE_VERBOSE=1\f[R], or -for \f[C]-vv\f[R], \f[C]RCLONE_VERBOSE=2\f[R]. +Rclone will stop transferring when it has reached the size specified. +Defaults to off. .PP -The same parser is used for the options and the environment variables so -they take exactly the same form. +When the limit is reached all transfers will stop immediately. +Use \f[C]--cutoff-mode\f[R] to modify this behaviour. .PP -The options set by environment variables can be seen with the -\f[C]-vv\f[R] flag, e.g. -\f[C]rclone version -vv\f[R]. -.SS Config file +Rclone will exit with exit code 8 if the transfer limit is reached. +.SS --cutoff-mode=hard|soft|cautious .PP -You can set defaults for values in the config file on an individual -remote basis. -The names of the config items are documented in the page for each -backend. +This modifies the behavior of \f[C]--max-transfer\f[R] and +\f[C]--max-duration\f[R] Defaults to \f[C]--cutoff-mode=hard\f[R]. .PP -To find the name of the environment variable, you need to set, take -\f[C]RCLONE_CONFIG_\f[R] + name of remote + \f[C]_\f[R] + name of config -file option and make it all uppercase. -Note one implication here is the remote\[aq]s name must be convertible -into a valid environment variable name, so it can only contain letters, -digits, or the \f[C]_\f[R] (underscore) character. +Specifying \f[C]--cutoff-mode=hard\f[R] will stop transferring +immediately when Rclone reaches the limit. .PP -For example, to configure an S3 remote named \f[C]mys3:\f[R] without a -config file (using unix ways of setting environment variables): -.IP -.nf -\f[C] -$ export RCLONE_CONFIG_MYS3_TYPE=s3 -$ export RCLONE_CONFIG_MYS3_ACCESS_KEY_ID=XXX -$ export RCLONE_CONFIG_MYS3_SECRET_ACCESS_KEY=XXX -$ rclone lsd mys3: - -1 2016-09-21 12:54:21 -1 my-bucket -$ rclone listremotes | grep mys3 -mys3: -\f[R] -.fi +Specifying \f[C]--cutoff-mode=soft\f[R] will stop starting new transfers +when Rclone reaches the limit. .PP -Note that if you want to create a remote using environment variables you -must create the \f[C]..._TYPE\f[R] variable as above. +Specifying \f[C]--cutoff-mode=cautious\f[R] will try to prevent Rclone +from reaching the limit. +Only applicable for \f[C]--max-transfer\f[R] +.SS -M, --metadata .PP -Note that the name of a remote created using environment variable is -case insensitive, in contrast to regular remotes stored in config file -as documented above. -You must write the name in uppercase in the environment variable, but as -seen from example above it will be listed and can be accessed in -lowercase, while you can also refer to the same remote in uppercase: -.IP -.nf -\f[C] -$ rclone lsd mys3: - -1 2016-09-21 12:54:21 -1 my-bucket -$ rclone lsd MYS3: - -1 2016-09-21 12:54:21 -1 my-bucket -\f[R] -.fi +Setting this flag enables rclone to copy the metadata from the source to +the destination. +For local backends this is ownership, permissions, xattr etc. +See the metadata section for more info. +.SS --metadata-mapper SpaceSepList .PP -Note that you can only set the options of the immediate backend, so -RCLONE_CONFIG_MYS3CRYPT_ACCESS_KEY_ID has no effect, if myS3Crypt is a -crypt remote based on an S3 remote. -However RCLONE_S3_ACCESS_KEY_ID will set the access key of all remotes -using S3, including myS3Crypt. +If you supply the parameter \f[C]--metadata-mapper /path/to/program\f[R] +then rclone will use that program to map metadata from source object to +destination object. .PP -Note also that now rclone has connection strings, it is probably easier -to use those instead which makes the above example +The argument to this flag should be a command with an optional space +separated list of arguments. +If one of the arguments has a space in then enclose it in +\f[C]\[dq]\f[R], if you want a literal \f[C]\[dq]\f[R] in an argument +then enclose the argument in \f[C]\[dq]\f[R] and double the +\f[C]\[dq]\f[R]. +See CSV encoding (https://godoc.org/encoding/csv) for more info. .IP .nf \f[C] -rclone lsd :s3,access_key_id=XXX,secret_access_key=XXX: +--metadata-mapper \[dq]python bin/test_metadata_mapper.py\[dq] +--metadata-mapper \[aq]python bin/test_metadata_mapper.py \[dq]argument with a space\[dq]\[aq] +--metadata-mapper \[aq]python bin/test_metadata_mapper.py \[dq]argument with \[dq]\[dq]two\[dq]\[dq] quotes\[dq]\[aq] \f[R] .fi -.SS Precedence -.PP -The various different methods of backend configuration are read in this -order and the first one with a value is used. -.IP \[bu] 2 -Parameters in connection strings, e.g. -\f[C]myRemote,skip_links:\f[R] -.IP \[bu] 2 -Flag values as supplied on the command line, e.g. -\f[C]--skip-links\f[R] -.IP \[bu] 2 -Remote specific environment vars, e.g. -\f[C]RCLONE_CONFIG_MYREMOTE_SKIP_LINKS\f[R] (see above). -.IP \[bu] 2 -Backend-specific environment vars, e.g. -\f[C]RCLONE_LOCAL_SKIP_LINKS\f[R]. -.IP \[bu] 2 -Backend generic environment vars, e.g. -\f[C]RCLONE_SKIP_LINKS\f[R]. -.IP \[bu] 2 -Config file, e.g. -\f[C]skip_links = true\f[R]. -.IP \[bu] 2 -Default values, e.g. -\f[C]false\f[R] - these can\[aq]t be changed. .PP -So if both \f[C]--skip-links\f[R] is supplied on the command line and an -environment variable \f[C]RCLONE_LOCAL_SKIP_LINKS\f[R] is set, the -command line flag will take preference. +This uses a simple JSON based protocol with input on STDIN and output on +STDOUT. +This will be called for every file and directory copied and may be +called concurrently. .PP -The backend configurations set by environment variables can be seen with -the \f[C]-vv\f[R] flag, e.g. -\f[C]rclone about myRemote: -vv\f[R]. +The program\[aq]s job is to take a metadata blob on the input and turn +it into a metadata blob on the output suitable for the destination +backend. .PP -For non backend configuration the order is as follows: +Input to the program (via STDIN) might look like this. +This provides some context for the \f[C]Metadata\f[R] which may be +important. .IP \[bu] 2 -Flag values as supplied on the command line, e.g. -\f[C]--stats 5s\f[R]. +\f[C]SrcFs\f[R] is the config string for the remote that the object is +currently on. .IP \[bu] 2 -Environment vars, e.g. -\f[C]RCLONE_STATS=5s\f[R]. +\f[C]SrcFsType\f[R] is the name of the source backend. .IP \[bu] 2 -Default values, e.g. -\f[C]1m\f[R] - these can\[aq]t be changed. -.SS Other environment variables +\f[C]DstFs\f[R] is the config string for the remote that the object is +being copied to .IP \[bu] 2 -\f[C]RCLONE_CONFIG_PASS\f[R] set to contain your config file password -(see Configuration Encryption section) +\f[C]DstFsType\f[R] is the name of the destination backend. .IP \[bu] 2 -\f[C]HTTP_PROXY\f[R], \f[C]HTTPS_PROXY\f[R] and \f[C]NO_PROXY\f[R] (or -the lowercase versions thereof). -.RS 2 +\f[C]Remote\f[R] is the path of the file relative to the root. .IP \[bu] 2 -\f[C]HTTPS_PROXY\f[R] takes precedence over \f[C]HTTP_PROXY\f[R] for -https requests. +\f[C]Size\f[R], \f[C]MimeType\f[R], \f[C]ModTime\f[R] are attributes of +the file. .IP \[bu] 2 -The environment values may be either a complete URL or a -\[dq]host[:port]\[dq] for, in which case the \[dq]http\[dq] scheme is -assumed. -.RE +\f[C]IsDir\f[R] is \f[C]true\f[R] if this is a directory (not yet +implemented). .IP \[bu] 2 -\f[C]USER\f[R] and \f[C]LOGNAME\f[R] values are used as fallbacks for -current username. -The primary method for looking up username is OS-specific: Windows API -on Windows, real user ID in /etc/passwd on Unix systems. -In the documentation the current username is simply referred to as -\f[C]$USER\f[R]. +\f[C]ID\f[R] is the source \f[C]ID\f[R] of the file if known. .IP \[bu] 2 -\f[C]RCLONE_CONFIG_DIR\f[R] - rclone \f[B]sets\f[R] this variable for -use in config files and sub processes to point to the directory holding -the config file. -.PP -The options set by environment variables can be seen with the -\f[C]-vv\f[R] and \f[C]--log-level=DEBUG\f[R] flags, e.g. -\f[C]rclone version -vv\f[R]. -.SH Configuring rclone on a remote / headless machine -.PP -Some of the configurations (those involving oauth2) require an Internet -connected web browser. -.PP -If you are trying to set rclone up on a remote or headless box with no -browser available on it (e.g. -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. -.SS Configuring using rclone authorize -.PP -On the headless box run \f[C]rclone\f[R] config but answer \f[C]N\f[R] -to the \f[C]Use web browser to automatically authenticate?\f[R] -question. -.IP -.nf -\f[C] -\&... -Remote config -Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. -y) Yes (default) -n) No -y/n> n -For this to work, you will need rclone available on a machine that has -a web browser available. - -For more help and alternate methods see: https://rclone.org/remote_setup/ - -Execute the following on the machine with the web browser (same rclone -version recommended): - - rclone authorize \[dq]amazon cloud drive\[dq] - -Then paste the result below: -result> -\f[R] -.fi -.PP -Then on your main desktop machine +\f[C]Metadata\f[R] is the backend specific metadata as described in the +backend docs. .IP .nf \f[C] -rclone authorize \[dq]amazon cloud drive\[dq] -If your browser doesn\[aq]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 +{ + \[dq]SrcFs\[dq]: \[dq]gdrive:\[dq], + \[dq]SrcFsType\[dq]: \[dq]drive\[dq], + \[dq]DstFs\[dq]: \[dq]newdrive:user\[dq], + \[dq]DstFsType\[dq]: \[dq]onedrive\[dq], + \[dq]Remote\[dq]: \[dq]test.txt\[dq], + \[dq]Size\[dq]: 6, + \[dq]MimeType\[dq]: \[dq]text/plain; charset=utf-8\[dq], + \[dq]ModTime\[dq]: \[dq]2022-10-11T17:53:10.286745272+01:00\[dq], + \[dq]IsDir\[dq]: false, + \[dq]ID\[dq]: \[dq]xyz\[dq], + \[dq]Metadata\[dq]: { + \[dq]btime\[dq]: \[dq]2022-10-11T16:53:11Z\[dq], + \[dq]content-type\[dq]: \[dq]text/plain; charset=utf-8\[dq], + \[dq]mtime\[dq]: \[dq]2022-10-11T17:53:10.286745272+01:00\[dq], + \[dq]owner\[dq]: \[dq]user1\[at]domain1.com\[dq], + \[dq]permissions\[dq]: \[dq]...\[dq], + \[dq]description\[dq]: \[dq]my nice file\[dq], + \[dq]starred\[dq]: \[dq]false\[dq] + } +} \f[R] .fi .PP -Then back to the headless box, paste in the code +The program should then modify the input as desired and send it to +STDOUT. +The returned \f[C]Metadata\f[R] field will be used in its entirety for +the destination object. +Any other fields will be ignored. +Note in this example we translate user names and permissions and add +something to the description: .IP .nf \f[C] -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> +{ + \[dq]Metadata\[dq]: { + \[dq]btime\[dq]: \[dq]2022-10-11T16:53:11Z\[dq], + \[dq]content-type\[dq]: \[dq]text/plain; charset=utf-8\[dq], + \[dq]mtime\[dq]: \[dq]2022-10-11T17:53:10.286745272+01:00\[dq], + \[dq]owner\[dq]: \[dq]user1\[at]domain2.com\[dq], + \[dq]permissions\[dq]: \[dq]...\[dq], + \[dq]description\[dq]: \[dq]my nice file [migrated from domain1]\[dq], + \[dq]starred\[dq]: \[dq]false\[dq] + } +} \f[R] .fi -.SS Configuring by copying the config file .PP -Rclone stores all of its config in a single configuration file. -This can easily be copied to configure a remote rclone. +Metadata can be removed here too. .PP -So first configure rclone on your desktop machine with +An example python program might look something like this to implement +the above transformations. .IP .nf \f[C] -rclone config +import sys, json + +i = json.load(sys.stdin) +metadata = i[\[dq]Metadata\[dq]] +# Add tag to description +if \[dq]description\[dq] in metadata: + metadata[\[dq]description\[dq]] += \[dq] [migrated from domain1]\[dq] +else: + metadata[\[dq]description\[dq]] = \[dq][migrated from domain1]\[dq] +# Modify owner +if \[dq]owner\[dq] in metadata: + metadata[\[dq]owner\[dq]] = metadata[\[dq]owner\[dq]].replace(\[dq]domain1.com\[dq], \[dq]domain2.com\[dq]) +o = { \[dq]Metadata\[dq]: metadata } +json.dump(o, sys.stdout, indent=\[dq]\[rs]t\[dq]) \f[R] .fi .PP -to set up the config file. -.PP -Find the config file by running \f[C]rclone config file\f[R], for -example -.IP -.nf -\f[C] -$ rclone config file -Configuration file is stored at: -/home/user/.rclone.conf -\f[R] -.fi +You can find this example (slightly expanded) in the rclone source code +at +bin/test_metadata_mapper.py (https://github.com/rclone/rclone/blob/master/test_metadata_mapper.py). .PP -Now transfer it to the remote box (scp, cut paste, ftp, sftp, etc.) and -place it in the correct place (use \f[C]rclone config file\f[R] on the -remote box to find out where). -.SS Configuring using SSH Tunnel +If you want to see the input to the metadata mapper and the output +returned from it in the log you can use \f[C]-vv --dump mapper\f[R]. .PP -Linux and MacOS users can utilize SSH Tunnel to redirect the headless -box port 53682 to local machine by using the following command: -.IP -.nf -\f[C] -ssh -L localhost:53682:localhost:53682 username\[at]remote_server -\f[R] -.fi +See the metadata section for more info. +.SS --metadata-set key=value .PP -Then on the headless box run \f[C]rclone\f[R] config and answer -\f[C]Y\f[R] to the -\f[C]Use web browser to automatically authenticate?\f[R] question. -.IP -.nf -\f[C] -\&... -Remote config -Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. -y) Yes (default) -n) No -y/n> y -\f[R] -.fi +Add metadata \f[C]key\f[R] = \f[C]value\f[R] when uploading. +This can be repeated as many times as required. +See the metadata section for more info. +.SS --modify-window=TIME .PP -Then copy and paste the auth url -\f[C]http://127.0.0.1:53682/auth?state=xxxxxxxxxxxx\f[R] to the browser -on your local machine, complete the auth and it is done. -.SH Filtering, includes and excludes +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. .PP -Filter flags determine which files rclone \f[C]sync\f[R], -\f[C]move\f[R], \f[C]ls\f[R], \f[C]lsl\f[R], \f[C]md5sum\f[R], -\f[C]sha1sum\f[R], \f[C]size\f[R], \f[C]delete\f[R], \f[C]check\f[R] and -similar commands apply to. +The default is \f[C]1ns\f[R] 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 +\f[C]1s\f[R] by default. .PP -They are specified in terms of path/file name patterns; path/file lists; -file age and size, or presence of a file in a directory. -Bucket based remotes without the concept of directory apply filters to -object key, age and size in an analogous way. +This command line flag allows you to override that computed default. +.SS --multi-thread-write-buffer-size=SIZE .PP -Rclone \f[C]purge\f[R] does not obey filters. +When transferring with multiple threads, rclone will buffer SIZE bytes +in memory before writing to disk for each thread. .PP -To test filters without risk of damage to data, apply them to -\f[C]rclone ls\f[R], or with the \f[C]--dry-run\f[R] and \f[C]-vv\f[R] -flags. +This can improve performance if the underlying filesystem does not deal +well with a lot of small writes in different positions of the file, so +if you see transfers being limited by disk write speed, you might want +to experiment with different values. +Specially for magnetic drives and remote file systems a higher value can +be useful. .PP -Rclone filter patterns can only be used in filter command line options, -not in the specification of a remote. +Nevertheless, the default of \f[C]128k\f[R] should be fine for almost +all use cases, so before changing it ensure that network is not really +your bottleneck. .PP -E.g. -\f[C]rclone copy \[dq]remote:dir*.jpg\[dq] /path/to/dir\f[R] does not -have a filter effect. -\f[C]rclone copy remote:dir /path/to/dir --include \[dq]*.jpg\[dq]\f[R] -does. +As a final hint, size is not the only factor: block size (or similar +concept) can have an impact. +In one case, we observed that exact multiples of 16k performed much +better than other values. +.SS --multi-thread-chunk-size=SizeSuffix .PP -\f[B]Important\f[R] Avoid mixing any two of \f[C]--include...\f[R], -\f[C]--exclude...\f[R] or \f[C]--filter...\f[R] flags in an rclone -command. -The results might not be what you expect. -Instead use a \f[C]--filter...\f[R] flag. -.SS Patterns for matching path/file names -.SS Pattern syntax +Normally the chunk size for multi thread transfers is set by the +backend. +However some backends such as \f[C]local\f[R] and \f[C]smb\f[R] (which +implement \f[C]OpenWriterAt\f[R] but not \f[C]OpenChunkWriter\f[R]) +don\[aq]t have a natural chunk size. .PP -Here is a formal definition of the pattern syntax, examples are below. +In this case the value of this option is used (default 64Mi). +.SS --multi-thread-cutoff=SIZE .PP -Rclone matching rules follow a glob style: -.IP -.nf -\f[C] -* matches any sequence of non-separator (/) characters -** matches any sequence of characters including / separators -? matches any single non-separator (/) character -[ [ ! ] { character-range } ] - character class (must be non-empty) -{ pattern-list } - pattern alternatives -{{ regexp }} - regular expression to match -c matches character c (c != *, **, ?, \[rs], [, {, }) -\[rs]c matches reserved character c (c = *, **, ?, \[rs], [, {, }) or character class -\f[R] -.fi +When transferring files above SIZE to capable backends, rclone will use +multiple threads to transfer the file (default 256M). .PP -character-range: -.IP -.nf -\f[C] -c matches character c (c != \[rs], -, ]) -\[rs]c matches reserved character c (c = \[rs], -, ]) -lo - hi matches character c for lo <= c <= hi -\f[R] -.fi +Capable backends are marked in the +overview (https://rclone.org/overview/#optional-features) as +\f[C]MultithreadUpload\f[R]. +(They need to implement either the \f[C]OpenWriterAt\f[R] or +\f[C]OpenChunkedWriter\f[R] internal interfaces). +These include include, \f[C]local\f[R], \f[C]s3\f[R], +\f[C]azureblob\f[R], \f[C]b2\f[R], \f[C]oracleobjectstorage\f[R] and +\f[C]smb\f[R] at the time of writing. .PP -pattern-list: -.IP -.nf -\f[C] -pattern { , pattern } - comma-separated (without spaces) patterns -\f[R] -.fi +On the local disk, rclone preallocates the file (using +\f[C]fallocate(FALLOC_FL_KEEP_SIZE)\f[R] on unix or +\f[C]NTSetInformationFile\f[R] on Windows both of which takes no time) +then each thread writes directly into the file at the correct place. +This means that rclone won\[aq]t create fragmented or sparse files and +there won\[aq]t be any assembly time at the end of the transfer. .PP -character classes (see Go regular expression -reference (https://golang.org/pkg/regexp/syntax/)) include: -.IP -.nf -\f[C] -Named character classes (e.g. [\[rs]d], [\[ha]\[rs]d], [\[rs]D], [\[ha]\[rs]D]) -Perl character classes (e.g. \[rs]s, \[rs]S, \[rs]w, \[rs]W) -ASCII character classes (e.g. [[:alnum:]], [[:alpha:]], [[:punct:]], [[:xdigit:]]) -\f[R] -.fi +The number of threads used to transfer is controlled by +\f[C]--multi-thread-streams\f[R]. .PP -regexp for advanced users to insert a regular expression - see below for -more info: -.IP -.nf -\f[C] -Any re2 regular expression not containing \[ga]}}\[ga] -\f[R] -.fi +Use \f[C]-vv\f[R] if you wish to see info about the threads. .PP -If the filter pattern starts with a \f[C]/\f[R] then it only matches at -the top level of the directory tree, \f[B]relative to the root of the -remote\f[R] (not necessarily the root of the drive). -If it does not start with \f[C]/\f[R] then it is matched starting at the -\f[B]end of the path/file name\f[R] but it only matches a complete path -element - it must match from a \f[C]/\f[R] separator or the beginning of -the path/file. -.IP -.nf -\f[C] -file.jpg - matches \[dq]file.jpg\[dq] - - matches \[dq]directory/file.jpg\[dq] - - doesn\[aq]t match \[dq]afile.jpg\[dq] - - doesn\[aq]t match \[dq]directory/afile.jpg\[dq] -/file.jpg - matches \[dq]file.jpg\[dq] in the root directory of the remote - - doesn\[aq]t match \[dq]afile.jpg\[dq] - - doesn\[aq]t match \[dq]directory/file.jpg\[dq] -\f[R] -.fi +This will work with the \f[C]sync\f[R]/\f[C]copy\f[R]/\f[C]move\f[R] +commands and friends \f[C]copyto\f[R]/\f[C]moveto\f[R]. +Multi thread transfers will be used with \f[C]rclone mount\f[R] and +\f[C]rclone serve\f[R] if \f[C]--vfs-cache-mode\f[R] is set to +\f[C]writes\f[R] or above. .PP -The top level of the remote might not be the top level of the drive. +\f[B]NB\f[R] that this \f[B]only\f[R] works with supported backends as +the destination but will work with any backend as the source. .PP -E.g. -for a Microsoft Windows local directory structure -.IP -.nf -\f[C] -F: -\[u251C]\[u2500]\[u2500] bkp -\[u251C]\[u2500]\[u2500] data -\[br] \[u251C]\[u2500]\[u2500] excl -\[br] \[br] \[u251C]\[u2500]\[u2500] 123.jpg -\[br] \[br] \[u2514]\[u2500]\[u2500] 456.jpg -\[br] \[u251C]\[u2500]\[u2500] incl -\[br] \[br] \[u2514]\[u2500]\[u2500] document.pdf -\f[R] -.fi +\f[B]NB\f[R] that multi-thread copies are disabled for local to local +copies as they are faster without unless +\f[C]--multi-thread-streams\f[R] is set explicitly. .PP -To copy the contents of folder \f[C]data\f[R] into folder \f[C]bkp\f[R] -excluding the contents of subfolder \f[C]excl\f[R]the following command -treats \f[C]F:\[rs]data\f[R] and \f[C]F:\[rs]bkp\f[R] as top level for -filtering. +\f[B]NB\f[R] on Windows using multi-thread transfers to the local disk +will cause the resulting files to be +sparse (https://en.wikipedia.org/wiki/Sparse_file). +Use \f[C]--local-no-sparse\f[R] to disable sparse files (which may cause +long delays at the start of transfers) or disable multi-thread transfers +with \f[C]--multi-thread-streams 0\f[R] +.SS --multi-thread-streams=N .PP -\f[C]rclone copy F:\[rs]data\[rs] F:\[rs]bkp\[rs] --exclude=/excl/**\f[R] +When using multi thread transfers (see above +\f[C]--multi-thread-cutoff\f[R]) this sets the number of streams to use. +Set to \f[C]0\f[R] to disable multi thread transfers (Default 4). .PP -\f[B]Important\f[R] Use \f[C]/\f[R] in path/file name patterns and not -\f[C]\[rs]\f[R] even if running on Microsoft Windows. +If the backend has a \f[C]--backend-upload-concurrency\f[R] setting (eg +\f[C]--s3-upload-concurrency\f[R]) then this setting will be used as the +number of transfers instead if it is larger than the value of +\f[C]--multi-thread-streams\f[R] or \f[C]--multi-thread-streams\f[R] +isn\[aq]t set. +.SS --no-check-dest .PP -Simple patterns are case sensitive unless the \f[C]--ignore-case\f[R] -flag is used. +The \f[C]--no-check-dest\f[R] can be used with \f[C]move\f[R] or +\f[C]copy\f[R] and it causes rclone not to check the destination at all +when copying files. .PP -Without \f[C]--ignore-case\f[R] (default) -.IP -.nf -\f[C] -potato - matches \[dq]potato\[dq] - - doesn\[aq]t match \[dq]POTATO\[dq] -\f[R] -.fi +This means that: +.IP \[bu] 2 +the destination is not listed minimising the API calls +.IP \[bu] 2 +files are always transferred +.IP \[bu] 2 +this can cause duplicates on remotes which allow it (e.g. +Google Drive) +.IP \[bu] 2 +\f[C]--retries 1\f[R] is recommended otherwise you\[aq]ll transfer +everything again on a retry .PP -With \f[C]--ignore-case\f[R] -.IP -.nf -\f[C] -potato - matches \[dq]potato\[dq] - - matches \[dq]POTATO\[dq] -\f[R] -.fi -.SS Using regular expressions in filter patterns +This flag is useful to minimise the transactions if you know that none +of the files are on the destination. .PP -The syntax of filter patterns is glob style matching (like -\f[C]bash\f[R] uses) to make things easy for users. -However this does not provide absolute control over the matching, so for -advanced users rclone also provides a regular expression syntax. +This is a specialized flag which should be ignored by most users! +.SS --no-gzip-encoding .PP -The regular expressions used are as defined in the Go regular expression -reference (https://golang.org/pkg/regexp/syntax/). -Regular expressions should be enclosed in \f[C]{{\f[R] \f[C]}}\f[R]. -They will match only the last path segment if the glob doesn\[aq]t start -with \f[C]/\f[R] or the whole path name if it does. -Note that rclone does not attempt to parse the supplied regular -expression, meaning that using any regular expression filter will -prevent rclone from using directory filter rules, as it will instead -check every path against the supplied regular expression(s). +Don\[aq]t set \f[C]Accept-Encoding: gzip\f[R]. +This means that rclone won\[aq]t ask the server for compressed files +automatically. +Useful if you\[aq]ve set the server to return files with +\f[C]Content-Encoding: gzip\f[R] but you uploaded compressed files. .PP -Here is how the \f[C]{{regexp}}\f[R] is transformed into an full regular -expression to match the entire path: -.IP -.nf -\f[C] -{{regexp}} becomes (\[ha]|/)(regexp)$ -/{{regexp}} becomes \[ha](regexp)$ -\f[R] -.fi +There is no need to set this in normal operation, and doing so will +decrease the network transfer efficiency of rclone. +.SS --no-traverse .PP -Regexp syntax can be mixed with glob syntax, for example -.IP -.nf -\f[C] -*.{{jpe?g}} to match file.jpg, file.jpeg but not file.png -\f[R] -.fi +The \f[C]--no-traverse\f[R] flag controls whether the destination file +system is traversed when using the \f[C]copy\f[R] or \f[C]move\f[R] +commands. +\f[C]--no-traverse\f[R] is not compatible with \f[C]sync\f[R] and will +be ignored if you supply it with \f[C]sync\f[R]. .PP -You can also use regexp flags - to set case insensitive, for example -.IP -.nf -\f[C] -*.{{(?i)jpg}} to match file.jpg, file.JPG but not file.png -\f[R] -.fi +If you are only copying a small number of files (or are filtering most +of the files) and/or have a large number of files on the destination +then \f[C]--no-traverse\f[R] will stop rclone listing the destination +and save time. .PP -Be careful with wildcards in regular expressions - you don\[aq]t want -them to match path separators normally. -To match any file name starting with \f[C]start\f[R] and ending with -\f[C]end\f[R] write -.IP -.nf -\f[C] -{{start[\[ha]/]*end\[rs].jpg}} -\f[R] -.fi +However, if you are copying a large number of files, especially if you +are doing a copy where lots of the files under consideration haven\[aq]t +changed and won\[aq]t need copying then you shouldn\[aq]t use +\f[C]--no-traverse\f[R]. .PP -Not -.IP -.nf -\f[C] -{{start.*end\[rs].jpg}} -\f[R] -.fi +See rclone copy (https://rclone.org/commands/rclone_copy/) for an +example of how to use it. +.SS --no-unicode-normalization .PP -Which will match a directory called \f[C]start\f[R] with a file called -\f[C]end.jpg\f[R] in it as the \f[C].*\f[R] will match \f[C]/\f[R] +Don\[aq]t normalize unicode characters in filenames during the sync +routine. +.PP +Sometimes, an operating system will store filenames containing unicode +parts in their decomposed form (particularly macOS). +Some cloud storage systems will then recompose the unicode, resulting in +duplicate files if the data is ever copied back to a local filesystem. +.PP +Using this flag will disable that functionality, treating each unicode +character as unique. +For example, by default e\[u0301] and \['e] will be normalized into the +same character. +With \f[C]--no-unicode-normalization\f[R] they will be treated as unique characters. +.SS --no-update-modtime .PP -Note that you can use \f[C]-vv --dump filters\f[R] to show the filter -patterns in regexp format - rclone implements the glob patterns by -transforming them into regular expressions. -.SS Filter pattern examples +When using this flag, rclone won\[aq]t update modification times of +remote files if they are incorrect as it would normally. .PP -.TS -tab(@); -l l l l. -T{ -Description -T}@T{ -Pattern -T}@T{ -Matches -T}@T{ -Does not match -T} -_ -T{ -Wildcard -T}@T{ -\f[C]*.jpg\f[R] -T}@T{ -\f[C]/file.jpg\f[R] -T}@T{ -\f[C]/file.png\f[R] -T} -T{ -T}@T{ -T}@T{ -\f[C]/dir/file.jpg\f[R] -T}@T{ -\f[C]/dir/file.png\f[R] -T} -T{ -Rooted -T}@T{ -\f[C]/*.jpg\f[R] -T}@T{ -\f[C]/file.jpg\f[R] -T}@T{ -\f[C]/file.png\f[R] -T} -T{ -T}@T{ -T}@T{ -\f[C]/file2.jpg\f[R] -T}@T{ -\f[C]/dir/file.jpg\f[R] -T} -T{ -Alternates -T}@T{ -\f[C]*.{jpg,png}\f[R] -T}@T{ -\f[C]/file.jpg\f[R] -T}@T{ -\f[C]/file.gif\f[R] -T} -T{ -T}@T{ -T}@T{ -\f[C]/dir/file.png\f[R] -T}@T{ -\f[C]/dir/file.gif\f[R] -T} -T{ -Path Wildcard -T}@T{ -\f[C]dir/**\f[R] -T}@T{ -\f[C]/dir/anyfile\f[R] -T}@T{ -\f[C]file.png\f[R] -T} -T{ -T}@T{ -T}@T{ -\f[C]/subdir/dir/subsubdir/anyfile\f[R] -T}@T{ -\f[C]/subdir/file.png\f[R] -T} -T{ -Any Char -T}@T{ -\f[C]*.t?t\f[R] -T}@T{ -\f[C]/file.txt\f[R] -T}@T{ -\f[C]/file.qxt\f[R] -T} -T{ -T}@T{ -T}@T{ -\f[C]/dir/file.tzt\f[R] -T}@T{ -\f[C]/dir/file.png\f[R] -T} -T{ -Range -T}@T{ -\f[C]*.[a-z]\f[R] -T}@T{ -\f[C]/file.a\f[R] -T}@T{ -\f[C]/file.0\f[R] -T} -T{ -T}@T{ -T}@T{ -\f[C]/dir/file.b\f[R] -T}@T{ -\f[C]/dir/file.1\f[R] -T} -T{ -Escape -T}@T{ -\f[C]*.\[rs]?\[rs]?\[rs]?\f[R] -T}@T{ -\f[C]/file.???\f[R] -T}@T{ -\f[C]/file.abc\f[R] -T} -T{ -T}@T{ -T}@T{ -\f[C]/dir/file.???\f[R] -T}@T{ -\f[C]/dir/file.def\f[R] -T} -T{ -Class -T}@T{ -\f[C]*.\[rs]d\[rs]d\[rs]d\f[R] -T}@T{ -\f[C]/file.012\f[R] -T}@T{ -\f[C]/file.abc\f[R] -T} -T{ -T}@T{ -T}@T{ -\f[C]/dir/file.345\f[R] -T}@T{ -\f[C]/dir/file.def\f[R] -T} -T{ -Regexp -T}@T{ -\f[C]*.{{jpe?g}}\f[R] -T}@T{ -\f[C]/file.jpeg\f[R] -T}@T{ -\f[C]/file.png\f[R] -T} -T{ -T}@T{ -T}@T{ -\f[C]/dir/file.jpg\f[R] -T}@T{ -\f[C]/dir/file.jpeeg\f[R] -T} -T{ -Rooted Regexp -T}@T{ -\f[C]/{{.*\[rs].jpe?g}}\f[R] -T}@T{ -\f[C]/file.jpeg\f[R] -T}@T{ -\f[C]/file.png\f[R] -T} -T{ -T}@T{ -T}@T{ -\f[C]/file.jpg\f[R] -T}@T{ -\f[C]/dir/file.jpg\f[R] -T} -.TE -.SS How filter rules are applied to files +This can be used if the remote is being synced with another tool also +(e.g. +the Google Drive client). +.SS --order-by string .PP -Rclone path/file name filters are made up of one or more of the -following flags: +The \f[C]--order-by\f[R] flag controls the order in which files in the +backlog are processed in \f[C]rclone sync\f[R], \f[C]rclone copy\f[R] +and \f[C]rclone move\f[R]. +.PP +The order by string is constructed like this. +The first part describes what aspect is being measured: .IP \[bu] 2 -\f[C]--include\f[R] +\f[C]size\f[R] - order by the size of the files .IP \[bu] 2 -\f[C]--include-from\f[R] +\f[C]name\f[R] - order by the full path of the files .IP \[bu] 2 -\f[C]--exclude\f[R] +\f[C]modtime\f[R] - order by the modification date of the files +.PP +This can have a modifier appended with a comma: .IP \[bu] 2 -\f[C]--exclude-from\f[R] +\f[C]ascending\f[R] or \f[C]asc\f[R] - order so that the smallest (or +oldest) is processed first .IP \[bu] 2 -\f[C]--filter\f[R] +\f[C]descending\f[R] or \f[C]desc\f[R] - order so that the largest (or +newest) is processed first .IP \[bu] 2 -\f[C]--filter-from\f[R] +\f[C]mixed\f[R] - order so that the smallest is processed first for some +threads and the largest for others .PP -There can be more than one instance of individual flags. +If the modifier is \f[C]mixed\f[R] then it can have an optional +percentage (which defaults to \f[C]50\f[R]), e.g. +\f[C]size,mixed,25\f[R] which means that 25% of the threads should be +taking the smallest items and 75% the largest. +The threads which take the smallest first will always take the smallest +first and likewise the largest first threads. +The \f[C]mixed\f[R] mode can be useful to minimise the transfer time +when you are transferring a mixture of large and small files - the large +files are guaranteed upload threads and bandwidth and the small files +will be processed continuously. .PP -Rclone internally uses a combined list of all the include and exclude -rules. -The order in which rules are processed can influence the result of the -filter. +If no modifier is supplied then the order is \f[C]ascending\f[R]. .PP -All flags of the same type are processed together in the order above, -regardless of what order the different types of flags are included on -the command line. +For example +.IP \[bu] 2 +\f[C]--order-by size,desc\f[R] - send the largest files first +.IP \[bu] 2 +\f[C]--order-by modtime,ascending\f[R] - send the oldest files first +.IP \[bu] 2 +\f[C]--order-by name\f[R] - send the files with alphabetically by path +first .PP -Multiple instances of the same flag are processed from left to right -according to their position in the command line. +If the \f[C]--order-by\f[R] flag is not supplied or it is supplied with +an empty string then the default ordering will be used which is as +scanned. +With \f[C]--checkers 1\f[R] this is mostly alphabetical, however with +the default \f[C]--checkers 8\f[R] it is somewhat random. +.SS Limitations .PP -To mix up the order of processing includes and excludes use -\f[C]--filter...\f[R] flags. +The \f[C]--order-by\f[R] flag does not do a separate pass over the data. +This means that it may transfer some files out of the order specified if +.IP \[bu] 2 +there are no files in the backlog or the source has not been fully +scanned yet +.IP \[bu] 2 +there are more than --max-backlog files in the backlog .PP -Within \f[C]--include-from\f[R], \f[C]--exclude-from\f[R] and -\f[C]--filter-from\f[R] flags rules are processed from top to bottom of -the referenced file. +Rclone will do its best to transfer the best file it has so in practice +this should not cause a problem. +Think of \f[C]--order-by\f[R] as being more of a best efforts flag +rather than a perfect ordering. .PP -If there is an \f[C]--include\f[R] or \f[C]--include-from\f[R] flag -specified, rclone implies a \f[C]- **\f[R] rule which it adds to the -bottom of the internal rule list. -Specifying a \f[C]+\f[R] rule with a \f[C]--filter...\f[R] flag does not -imply that rule. +If you want perfect ordering then you will need to specify --check-first +which will find all the files which need transferring first before +transferring any. +.SS --partial-suffix .PP -Each path/file name passed through rclone is matched against the -combined filter list. -At first match to a rule the path/file name is included or excluded and -no further filter rules are processed for that path/file. +When --inplace is not used, it causes rclone to use the +\f[C]--partial-suffix\f[R] as suffix for temporary files. .PP -If rclone does not find a match, after testing against all rules -(including the implied rule if appropriate), the path/file name is -included. +Suffix length limit is 16 characters. .PP -Any path/file included at that stage is processed by the rclone command. +The default is \f[C].partial\f[R]. +.SS --password-command SpaceSepList .PP -\f[C]--files-from\f[R] and \f[C]--files-from-raw\f[R] flags over-ride -and cannot be combined with other filter options. +This flag supplies a program which should supply the config password +when run. +This is an alternative to rclone prompting for the password or setting +the \f[C]RCLONE_CONFIG_PASS\f[R] variable. .PP -To see the internal combined rule list, in regular expression form, for -a command add the \f[C]--dump filters\f[R] flag. -Running an rclone command with \f[C]--dump filters\f[R] and -\f[C]-vv\f[R] flags lists the internal filter elements and shows how -they are applied to each source path/file. -There is not currently a means provided to pass regular expression -filter options into rclone directly though character class filter rules -contain character classes. -Go regular expression reference (https://golang.org/pkg/regexp/syntax/) -.SS How filter rules are applied to directories +The argument to this should be a command with a space separated list of +arguments. +If one of the arguments has a space in then enclose it in +\f[C]\[dq]\f[R], if you want a literal \f[C]\[dq]\f[R] in an argument +then enclose the argument in \f[C]\[dq]\f[R] and double the +\f[C]\[dq]\f[R]. +See CSV encoding (https://godoc.org/encoding/csv) for more info. .PP -Rclone commands are applied to path/file names not directories. -The entire contents of a directory can be matched to a filter by the -pattern \f[C]directory/*\f[R] or recursively by \f[C]directory/**\f[R]. +Eg +.IP +.nf +\f[C] +--password-command \[dq]echo hello\[dq] +--password-command \[aq]echo \[dq]hello with space\[dq]\[aq] +--password-command \[aq]echo \[dq]hello with \[dq]\[dq]quotes\[dq]\[dq] and space\[dq]\[aq] +\f[R] +.fi .PP -Directory filter rules are defined with a closing \f[C]/\f[R] separator. +See the Configuration Encryption for more info. .PP -E.g. -\f[C]/directory/subdirectory/\f[R] is an rclone directory filter rule. +See a Windows PowerShell example on the +Wiki (https://github.com/rclone/rclone/wiki/Windows-Powershell-use-rclone-password-command-for-Config-file-password). +.SS -P, --progress .PP -Rclone commands can use directory filter rules to determine whether they -recurse into subdirectories. -This potentially optimises access to a remote by avoiding listing -unnecessary directories. -Whether optimisation is desirable depends on the specific filter rules -and source remote content. +This flag makes rclone update the stats in a static block in the +terminal providing a realtime overview of the transfer. .PP -If any regular expression filters are in use, then no directory -recursion optimisation is possible, as rclone must check every path -against the supplied regular expression(s). +Any log messages will scroll above the static block. +Log messages will push the static block down to the bottom of the +terminal where it will stay. .PP -Directory recursion optimisation occurs if either: -.IP \[bu] 2 -A source remote does not support the rclone \f[C]ListR\f[R] primitive. -local, sftp, Microsoft OneDrive and WebDAV do not support -\f[C]ListR\f[R]. -Google Drive and most bucket type storage do. -Full list (https://rclone.org/overview/#optional-features) -.IP \[bu] 2 -On other remotes (those that support \f[C]ListR\f[R]), if the rclone -command is not naturally recursive, and provided it is not run with the -\f[C]--fast-list\f[R] flag. -\f[C]ls\f[R], \f[C]lsf -R\f[R] and \f[C]size\f[R] are naturally -recursive but \f[C]sync\f[R], \f[C]copy\f[R] and \f[C]move\f[R] are not. -.IP \[bu] 2 -Whenever the \f[C]--disable ListR\f[R] flag is applied to an rclone -command. +Normally this is updated every 500mS but this period can be overridden +with the \f[C]--stats\f[R] flag. .PP -Rclone commands imply directory filter rules from path/file filter -rules. -To view the directory filter rules rclone has implied for a command -specify the \f[C]--dump filters\f[R] flag. +This can be used with the \f[C]--stats-one-line\f[R] flag for a simpler +display. .PP -E.g. -for an include rule -.IP -.nf -\f[C] -/a/*.jpg -\f[R] -.fi +Note: On Windows until this +bug (https://github.com/Azure/go-ansiterm/issues/26) is fixed all +non-ASCII characters will be replaced with \f[C].\f[R] when +\f[C]--progress\f[R] is in use. +.SS --progress-terminal-title .PP -Rclone implies the directory include rule -.IP -.nf -\f[C] -/a/ -\f[R] -.fi +This flag, when used with \f[C]-P/--progress\f[R], will print the string +\f[C]ETA: %s\f[R] to the terminal title. +.SS -q, --quiet .PP -Directory filter rules specified in an rclone command can limit the -scope of an rclone command but path/file filters still have to be -specified. +This flag will limit rclone\[aq]s output to error messages only. +.SS --refresh-times .PP -E.g. -\f[C]rclone ls remote: --include /directory/\f[R] will not match any -files. -Because it is an \f[C]--include\f[R] option the \f[C]--exclude **\f[R] -rule is implied, and the \f[C]/directory/\f[R] pattern serves only to -optimise access to the remote by ignoring everything outside of that -directory. +The \f[C]--refresh-times\f[R] flag can be used to update modification +times of existing files when they are out of sync on backends which +don\[aq]t support hashes. .PP -E.g. -\f[C]rclone ls remote: --filter-from filter-list.txt\f[R] with a file -\f[C]filter-list.txt\f[R]: -.IP -.nf -\f[C] -- /dir1/ -- /dir2/ -+ *.pdf -- ** -\f[R] -.fi +This is useful if you uploaded files with the incorrect timestamps and +you now wish to correct them. .PP -All files in directories \f[C]dir1\f[R] or \f[C]dir2\f[R] or their -subdirectories are completely excluded from the listing. -Only files of suffix \f[C]pdf\f[R] in the root of \f[C]remote:\f[R] or -its subdirectories are listed. -The \f[C]- **\f[R] rule prevents listing of any path/files not -previously matched by the rules above. +This flag is \f[B]only\f[R] useful for destinations which don\[aq]t +support hashes (e.g. +\f[C]crypt\f[R]). .PP -Option \f[C]exclude-if-present\f[R] creates a directory exclude rule -based on the presence of a file in a directory and takes precedence over -other rclone directory filter rules. +This can be used any of the sync commands \f[C]sync\f[R], \f[C]copy\f[R] +or \f[C]move\f[R]. .PP -When using pattern list syntax, if a pattern item contains either -\f[C]/\f[R] or \f[C]**\f[R], then rclone will not able to imply a -directory filter rule from this pattern list. +To use this flag you will need to be doing a modification time sync (so +not using \f[C]--size-only\f[R] or \f[C]--checksum\f[R]). +The flag will have no effect when using \f[C]--size-only\f[R] or +\f[C]--checksum\f[R]. .PP -E.g. -for an include rule -.IP -.nf -\f[C] -{dir1/**,dir2/**} -\f[R] -.fi +If this flag is used when rclone comes to upload a file it will check to +see if there is an existing file on the destination. +If this file matches the source with size (and checksum if available) +but has a differing timestamp then instead of re-uploading it, rclone +will update the timestamp on the destination file. +If the checksum does not match rclone will upload the new file. +If the checksum is absent (e.g. +on a \f[C]crypt\f[R] backend) then rclone will update the timestamp. .PP -Rclone will match files below directories \f[C]dir1\f[R] or -\f[C]dir2\f[R] only, but will not be able to use this filter to exclude -a directory \f[C]dir3\f[R] from being traversed. +Note that some remotes can\[aq]t set the modification time without +re-uploading the file so this flag is less useful on them. .PP -Directory recursion optimisation may affect performance, but normally -not the result. -One exception to this is sync operations with option -\f[C]--create-empty-src-dirs\f[R], where any traversed empty directories -will be created. -With the pattern list example \f[C]{dir1/**,dir2/**}\f[R] above, this -would create an empty directory \f[C]dir3\f[R] on destination (when it -exists on source). -Changing the filter to \f[C]{dir1,dir2}/**\f[R], or splitting it into -two include rules \f[C]--include dir1/** --include dir2/**\f[R], will -match the same files while also filtering directories, with the result -that an empty directory \f[C]dir3\f[R] will no longer be created. -.SS \f[C]--exclude\f[R] - Exclude files matching pattern +Normally if you are doing a modification time sync rclone will update +modification times without \f[C]--refresh-times\f[R] provided that the +remote supports checksums \f[B]and\f[R] the checksums match on the file. +However if the checksums are absent then rclone will upload the file +rather than setting the timestamp as this is the safe behaviour. +.SS --retries int .PP -Excludes path/file names from an rclone command based on a single -exclude rule. +Retry the entire sync if it fails this many times it fails (default 3). .PP -This flag can be repeated. -See above for the order filter flags are processed in. +Some remotes can be unreliable and a few retries help pick up the files +which didn\[aq]t get transferred because of errors. .PP -\f[C]--exclude\f[R] should not be used with \f[C]--include\f[R], -\f[C]--include-from\f[R], \f[C]--filter\f[R] or \f[C]--filter-from\f[R] -flags. +Disable retries with \f[C]--retries 1\f[R]. +.SS --retries-sleep=TIME .PP -\f[C]--exclude\f[R] has no effect when combined with -\f[C]--files-from\f[R] or \f[C]--files-from-raw\f[R] flags. +This sets the interval between each retry specified by +\f[C]--retries\f[R] .PP -E.g. -\f[C]rclone ls remote: --exclude *.bak\f[R] excludes all .bak files from -listing. +The default is \f[C]0\f[R]. +Use \f[C]0\f[R] to disable. +.SS --server-side-across-configs .PP -E.g. -\f[C]rclone size remote: \[dq]--exclude /dir/**\[dq]\f[R] returns the -total size of all files on \f[C]remote:\f[R] excluding those in root -directory \f[C]dir\f[R] and sub directories. +Allow server-side operations (e.g. +copy or move) to work across different configurations. .PP -E.g. -on Microsoft Windows -\f[C]rclone ls remote: --exclude \[dq]*\[rs][{JP,KR,HK}\[rs]]*\[dq]\f[R] -lists the files in \f[C]remote:\f[R] without \f[C][JP]\f[R] or -\f[C][KR]\f[R] or \f[C][HK]\f[R] in their name. -Quotes prevent the shell from interpreting the \f[C]\[rs]\f[R] -characters.\f[C]\[rs]\f[R] characters escape the \f[C][\f[R] and -\f[C]]\f[R] so an rclone filter treats them literally rather than as a -character-range. -The \f[C]{\f[R] and \f[C]}\f[R] define an rclone pattern list. -For other operating systems single quotes are required ie -\f[C]rclone ls remote: --exclude \[aq]*\[rs][{JP,KR,HK}\[rs]]*\[aq]\f[R] -.SS \f[C]--exclude-from\f[R] - Read exclude patterns from file +This can be useful if you wish to do a server-side copy or move between +two remotes which use the same backend but are configured differently. .PP -Excludes path/file names from an rclone command based on rules in a -named file. -The file contains a list of remarks and pattern rules. +Note that this isn\[aq]t enabled by default because it isn\[aq]t easy +for rclone to tell if it will work between any two configurations. +.SS --size-only .PP -For an example \f[C]exclude-file.txt\f[R]: -.IP -.nf -\f[C] -# a sample exclude rule file -*.bak -file2.jpg -\f[R] -.fi +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. .PP -\f[C]rclone ls remote: --exclude-from exclude-file.txt\f[R] lists the -files on \f[C]remote:\f[R] except those named \f[C]file2.jpg\f[R] or -with a suffix \f[C].bak\f[R]. -That is equivalent to -\f[C]rclone ls remote: --exclude file2.jpg --exclude \[dq]*.bak\[dq]\f[R]. +This can be useful transferring files from Dropbox which have been +modified by the desktop sync client which doesn\[aq]t set checksums of +modification times in the same way as rclone. +.SS --stats=TIME .PP -This flag can be repeated. -See above for the order filter flags are processed in. +Commands which transfer data (\f[C]sync\f[R], \f[C]copy\f[R], +\f[C]copyto\f[R], \f[C]move\f[R], \f[C]moveto\f[R]) will print data +transfer stats at regular intervals to show their progress. .PP -The \f[C]--exclude-from\f[R] flag is useful where multiple exclude -filter rules are applied to an rclone command. +This sets the interval. .PP -\f[C]--exclude-from\f[R] should not be used with \f[C]--include\f[R], -\f[C]--include-from\f[R], \f[C]--filter\f[R] or \f[C]--filter-from\f[R] -flags. +The default is \f[C]1m\f[R]. +Use \f[C]0\f[R] to disable. .PP -\f[C]--exclude-from\f[R] has no effect when combined with -\f[C]--files-from\f[R] or \f[C]--files-from-raw\f[R] flags. +If you set the stats interval then all commands can show stats. +This can be useful when running other commands, \f[C]check\f[R] or +\f[C]mount\f[R] for example. .PP -\f[C]--exclude-from\f[R] followed by \f[C]-\f[R] reads filter rules from -standard input. -.SS \f[C]--include\f[R] - Include files matching pattern +Stats are logged at \f[C]INFO\f[R] level by default which means they +won\[aq]t show at default log level \f[C]NOTICE\f[R]. +Use \f[C]--stats-log-level NOTICE\f[R] or \f[C]-v\f[R] to make them +show. +See the Logging section for more info on log levels. .PP -Adds a single include rule based on path/file names to an rclone -command. +Note that on macOS you can send a SIGINFO (which is normally ctrl-T in +the terminal) to make the stats print immediately. +.SS --stats-file-name-length integer .PP -This flag can be repeated. -See above for the order filter flags are processed in. +By default, the \f[C]--stats\f[R] output will truncate file names and +paths longer than 40 characters. +This is equivalent to providing \f[C]--stats-file-name-length 40\f[R]. +Use \f[C]--stats-file-name-length 0\f[R] to disable any truncation of +file names printed by stats. +.SS --stats-log-level string .PP -\f[C]--include\f[R] has no effect when combined with -\f[C]--files-from\f[R] or \f[C]--files-from-raw\f[R] flags. +Log level to show \f[C]--stats\f[R] output at. +This can be \f[C]DEBUG\f[R], \f[C]INFO\f[R], \f[C]NOTICE\f[R], or +\f[C]ERROR\f[R]. +The default is \f[C]INFO\f[R]. +This means at the default level of logging which is \f[C]NOTICE\f[R] the +stats won\[aq]t show - if you want them to then use +\f[C]--stats-log-level NOTICE\f[R]. +See the Logging section for more info on log levels. +.SS --stats-one-line .PP -\f[C]--include\f[R] implies \f[C]--exclude **\f[R] at the end of an -rclone internal filter list. -Therefore if you mix \f[C]--include\f[R] and \f[C]--include-from\f[R] -flags with \f[C]--exclude\f[R], \f[C]--exclude-from\f[R], -\f[C]--filter\f[R] or \f[C]--filter-from\f[R], you must use include -rules for all the files you want in the include statement. -For more flexibility use the \f[C]--filter-from\f[R] flag. +When this is specified, rclone condenses the stats into a single line +showing the most important stats only. +.SS --stats-one-line-date .PP -E.g. -\f[C]rclone ls remote: --include \[dq]*.{png,jpg}\[dq]\f[R] lists the -files on \f[C]remote:\f[R] with suffix \f[C].png\f[R] and -\f[C].jpg\f[R]. -All other files are excluded. +When this is specified, rclone enables the single-line stats and +prepends the display with a date string. +The default is \f[C]2006/01/02 15:04:05 -\f[R] +.SS --stats-one-line-date-format .PP -E.g. -multiple rclone copy commands can be combined with \f[C]--include\f[R] -and a pattern-list. -.IP -.nf -\f[C] -rclone copy /vol1/A remote:A -rclone copy /vol1/B remote:B -\f[R] -.fi +When this is specified, rclone enables the single-line stats and +prepends the display with a user-supplied date string. +The date string MUST be enclosed in quotes. +Follow golang specs (https://golang.org/pkg/time/#Time.Format) for date +formatting syntax. +.SS --stats-unit=bits|bytes .PP -is equivalent to: +By default, data transfer rates will be printed in bytes per second. +.PP +This option allows the data rate to be printed in bits per second. +.PP +Data transfer volume will still be reported in bytes. +.PP +The rate is reported as a binary unit, not SI unit. +So 1 Mbit/s equals 1,048,576 bit/s and not 1,000,000 bit/s. +.PP +The default is \f[C]bytes\f[R]. +.SS --suffix=SUFFIX +.PP +When using \f[C]sync\f[R], \f[C]copy\f[R] or \f[C]move\f[R] any files +which would have been overwritten or deleted will have the suffix added +to them. +If there is a file with the same path (after the suffix has been added), +then it will be overwritten. +.PP +The remote in use must support server-side move or copy and you must use +the same remote as the destination of the sync. +.PP +This is for use with files to add the suffix in the current directory or +with \f[C]--backup-dir\f[R]. +See \f[C]--backup-dir\f[R] for more info. +.PP +For example .IP .nf \f[C] -rclone copy /vol1 remote: --include \[dq]{A,B}/**\[dq] +rclone copy --interactive /path/to/local/file remote:current --suffix .bak \f[R] .fi .PP -E.g. -\f[C]rclone ls remote:/wheat --include \[dq]??[\[ha][:punct:]]*\[dq]\f[R] -lists the files \f[C]remote:\f[R] directory \f[C]wheat\f[R] (and -subdirectories) whose third character is not punctuation. -This example uses an ASCII character -class (https://golang.org/pkg/regexp/syntax/). -.SS \f[C]--include-from\f[R] - Read include patterns from file -.PP -Adds path/file names to an rclone command based on rules in a named -file. -The file contains a list of remarks and pattern rules. +will copy \f[C]/path/to/local\f[R] to \f[C]remote:current\f[R], but for +any files which would have been updated or deleted have .bak added. .PP -For an example \f[C]include-file.txt\f[R]: +If using \f[C]rclone sync\f[R] with \f[C]--suffix\f[R] and without +\f[C]--backup-dir\f[R] then it is recommended to put a filter rule in +excluding the suffix otherwise the \f[C]sync\f[R] will delete the backup +files. .IP .nf \f[C] -# a sample include rule file -*.jpg -file2.avi +rclone sync --interactive /path/to/local/file remote:current --suffix .bak --exclude \[dq]*.bak\[dq] \f[R] .fi +.SS --suffix-keep-extension .PP -\f[C]rclone ls remote: --include-from include-file.txt\f[R] lists the -files on \f[C]remote:\f[R] with name \f[C]file2.avi\f[R] or suffix -\f[C].jpg\f[R]. -That is equivalent to -\f[C]rclone ls remote: --include file2.avi --include \[dq]*.jpg\[dq]\f[R]. +When using \f[C]--suffix\f[R], setting this causes rclone put the SUFFIX +before the extension of the files that it backs up rather than after. .PP -This flag can be repeated. -See above for the order filter flags are processed in. +So let\[aq]s say we had \f[C]--suffix -2019-01-01\f[R], without the flag +\f[C]file.txt\f[R] would be backed up to \f[C]file.txt-2019-01-01\f[R] +and with the flag it would be backed up to +\f[C]file-2019-01-01.txt\f[R]. +This can be helpful to make sure the suffixed files can still be opened. .PP -The \f[C]--include-from\f[R] flag is useful where multiple include -filter rules are applied to an rclone command. +If a file has two (or more) extensions and the second (or subsequent) +extension is recognised as a valid mime type, then the suffix will go +before that extension. +So \f[C]file.tar.gz\f[R] would be backed up to +\f[C]file-2019-01-01.tar.gz\f[R] whereas \f[C]file.badextension.gz\f[R] +would be backed up to \f[C]file.badextension-2019-01-01.gz\f[R]. +.SS --syslog .PP -\f[C]--include-from\f[R] implies \f[C]--exclude **\f[R] at the end of an -rclone internal filter list. -Therefore if you mix \f[C]--include\f[R] and \f[C]--include-from\f[R] -flags with \f[C]--exclude\f[R], \f[C]--exclude-from\f[R], -\f[C]--filter\f[R] or \f[C]--filter-from\f[R], you must use include -rules for all the files you want in the include statement. -For more flexibility use the \f[C]--filter-from\f[R] flag. +On capable OSes (not Windows or Plan9) send all log output to syslog. .PP -\f[C]--exclude-from\f[R] has no effect when combined with -\f[C]--files-from\f[R] or \f[C]--files-from-raw\f[R] flags. +This can be useful for running rclone in a script or +\f[C]rclone mount\f[R]. +.SS --syslog-facility string .PP -\f[C]--exclude-from\f[R] followed by \f[C]-\f[R] reads filter rules from -standard input. -.SS \f[C]--filter\f[R] - Add a file-filtering rule +If using \f[C]--syslog\f[R] this sets the syslog facility (e.g. +\f[C]KERN\f[R], \f[C]USER\f[R]). +See \f[C]man syslog\f[R] for a list of possible facilities. +The default facility is \f[C]DAEMON\f[R]. +.SS --temp-dir=DIR .PP -Specifies path/file names to an rclone command, based on a single -include or exclude rule, in \f[C]+\f[R] or \f[C]-\f[R] format. +Specify the directory rclone will use for temporary files, to override +the default. +Make sure the directory exists and have accessible permissions. .PP -This flag can be repeated. -See above for the order filter flags are processed in. +By default the operating system\[aq]s temp directory will be used: - On +Unix systems, \f[C]$TMPDIR\f[R] if non-empty, else \f[C]/tmp\f[R]. +- On Windows, the first non-empty value from \f[C]%TMP%\f[R], +\f[C]%TEMP%\f[R], \f[C]%USERPROFILE%\f[R], or the Windows directory. .PP -\f[C]--filter +\f[R] differs from \f[C]--include\f[R]. -In the case of \f[C]--include\f[R] rclone implies an -\f[C]--exclude *\f[R] rule which it adds to the bottom of the internal -rule list. -\f[C]--filter...+\f[R] does not imply that rule. +When overriding the default with this option, the specified path will be +set as value of environment variable \f[C]TMPDIR\f[R] on Unix systems +and \f[C]TMP\f[R] and \f[C]TEMP\f[R] on Windows. .PP -\f[C]--filter\f[R] has no effect when combined with -\f[C]--files-from\f[R] or \f[C]--files-from-raw\f[R] flags. +You can use the config +paths (https://rclone.org/commands/rclone_config_paths/) command to see +the current value. +.SS --tpslimit float .PP -\f[C]--filter\f[R] should not be used with \f[C]--include\f[R], -\f[C]--include-from\f[R], \f[C]--exclude\f[R] or -\f[C]--exclude-from\f[R] flags. +Limit transactions per second to this number. +Default is 0 which is used to mean unlimited transactions per second. .PP -E.g. -\f[C]rclone ls remote: --filter \[dq]- *.bak\[dq]\f[R] excludes all -\f[C].bak\f[R] files from a list of \f[C]remote:\f[R]. -.SS \f[C]--filter-from\f[R] - Read filtering patterns from a file +A transaction is roughly defined as an API call; its exact meaning will +depend on the backend. +For HTTP based backends it is an HTTP PUT/GET/POST/etc and its response. +For FTP/SFTP it is a round trip transaction over TCP. .PP -Adds path/file names to an rclone command based on rules in a named -file. -The file contains a list of remarks and pattern rules. -Include rules start with \f[C]+\f[R] and exclude rules with \f[C]-\f[R]. -\f[C]!\f[R] clears existing rules. -Rules are processed in the order they are defined. +For example, to limit rclone to 10 transactions per second use +\f[C]--tpslimit 10\f[R], or to 1 transaction every 2 seconds use +\f[C]--tpslimit 0.5\f[R]. .PP -This flag can be repeated. -See above for the order filter flags are processed in. +Use this when the number of transactions per second from rclone is +causing a problem with the cloud storage provider (e.g. +getting you banned or rate limited). .PP -Arrange the order of filter rules with the most restrictive first and -work down. +This can be very useful for \f[C]rclone mount\f[R] to control the +behaviour of applications using it. .PP -E.g. -for \f[C]filter-file.txt\f[R]: -.IP -.nf -\f[C] -# a sample filter rule file -- secret*.jpg -+ *.jpg -+ *.png -+ file2.avi -- /dir/Trash/** -+ /dir/** -# exclude everything else -- * -\f[R] -.fi +This limit applies to all HTTP based backends and to the FTP and SFTP +backends. +It does not apply to the local backend or the Storj backend. .PP -\f[C]rclone ls remote: --filter-from filter-file.txt\f[R] lists the -path/files on \f[C]remote:\f[R] including all \f[C]jpg\f[R] and -\f[C]png\f[R] files, excluding any matching \f[C]secret*.jpg\f[R] and -including \f[C]file2.avi\f[R]. -It also includes everything in the directory \f[C]dir\f[R] at the root -of \f[C]remote\f[R], except \f[C]remote:dir/Trash\f[R] which it -excludes. -Everything else is excluded. +See also \f[C]--tpslimit-burst\f[R]. +.SS --tpslimit-burst int .PP -E.g. -for an alternative \f[C]filter-file.txt\f[R]: -.IP -.nf -\f[C] -- secret*.jpg -+ *.jpg -+ *.png -+ file2.avi -- * -\f[R] -.fi +Max burst of transactions for \f[C]--tpslimit\f[R] (default +\f[C]1\f[R]). .PP -Files \f[C]file1.jpg\f[R], \f[C]file3.png\f[R] and \f[C]file2.avi\f[R] -are listed whilst \f[C]secret17.jpg\f[R] and files without the suffix -\&.jpg\f[C]or\f[R].png\[ga] are excluded. +Normally \f[C]--tpslimit\f[R] will do exactly the number of transaction +per second specified. +However if you supply \f[C]--tps-burst\f[R] then rclone can save up some +transactions from when it was idle giving a burst of up to the parameter +supplied. .PP -E.g. -for an alternative \f[C]filter-file.txt\f[R]: -.IP -.nf -\f[C] -+ *.jpg -+ *.gif -! -+ 42.doc -- * -\f[R] -.fi +For example if you provide \f[C]--tpslimit-burst 10\f[R] then if rclone +has been idle for more than 10*\f[C]--tpslimit\f[R] then it can do 10 +transactions very quickly before they are limited again. .PP -Only file 42.doc is listed. -Prior rules are cleared by the \f[C]!\f[R]. -.SS \f[C]--files-from\f[R] - Read list of source-file names +This may be used to increase performance of \f[C]--tpslimit\f[R] without +changing the long term average number of transactions per second. +.SS --track-renames .PP -Adds path/files to an rclone command from a list in a named file. -Rclone processes the path/file names in the order of the list, and no -others. +By default, rclone doesn\[aq]t keep track of renamed files, so if you +rename a file locally then sync it to a remote, rclone will delete the +old file on the remote and upload a new copy. .PP -Other filter flags (\f[C]--include\f[R], \f[C]--include-from\f[R], -\f[C]--exclude\f[R], \f[C]--exclude-from\f[R], \f[C]--filter\f[R] and -\f[C]--filter-from\f[R]) are ignored when \f[C]--files-from\f[R] is -used. +An rclone sync with \f[C]--track-renames\f[R] runs like a normal sync, +but keeps track of objects which exist in the destination but not in the +source (which would normally be deleted), and which objects exist in the +source but not the destination (which would normally be transferred). +These objects are then candidates for renaming. .PP -\f[C]--files-from\f[R] expects a list of files as its input. -Leading or trailing whitespace is stripped from the input lines. -Lines starting with \f[C]#\f[R] or \f[C];\f[R] are ignored. +After the sync, rclone matches up the source only and destination only +objects using the \f[C]--track-renames-strategy\f[R] specified and +either renames the destination object or transfers the source and +deletes the destination object. +\f[C]--track-renames\f[R] is stateless like all of rclone\[aq]s syncs. .PP -Rclone commands with a \f[C]--files-from\f[R] flag traverse the remote, -treating the names in \f[C]--files-from\f[R] as a set of filters. +To use this flag the destination must support server-side copy or +server-side move, and to use a hash based +\f[C]--track-renames-strategy\f[R] (the default) the source and the +destination must have a compatible hash. .PP -If the \f[C]--no-traverse\f[R] and \f[C]--files-from\f[R] flags are used -together an rclone command does not traverse the remote. -Instead it addresses each path/file named in the file individually. -For each path/file name, that requires typically 1 API call. -This can be efficient for a short \f[C]--files-from\f[R] list and a -remote containing many files. +If the destination does not support server-side copy or move, rclone +will fall back to the default behaviour and log an error level message +to the console. .PP -Rclone commands do not error if any names in the \f[C]--files-from\f[R] -file are missing from the source remote. +Encrypted destinations are not currently supported by +\f[C]--track-renames\f[R] if \f[C]--track-renames-strategy\f[R] includes +\f[C]hash\f[R]. .PP -The \f[C]--files-from\f[R] flag can be repeated in a single rclone -command to read path/file names from more than one file. -The files are read from left to right along the command line. +Note that \f[C]--track-renames\f[R] is incompatible with +\f[C]--no-traverse\f[R] and that it uses extra memory to keep track of +all the rename candidates. .PP -Paths within the \f[C]--files-from\f[R] file are interpreted as starting -with the root specified in the rclone command. -Leading \f[C]/\f[R] separators are ignored. -See --files-from-raw if you need the input to be processed in a raw -manner. +Note also that \f[C]--track-renames\f[R] is incompatible with +\f[C]--delete-before\f[R] and will select \f[C]--delete-after\f[R] +instead of \f[C]--delete-during\f[R]. +.SS --track-renames-strategy (hash,modtime,leaf,size) .PP -E.g. -for a file \f[C]files-from.txt\f[R]: -.IP -.nf -\f[C] -# comment -file1.jpg -subdir/file2.jpg -\f[R] -.fi +This option changes the file matching criteria for +\f[C]--track-renames\f[R]. .PP -\f[C]rclone copy --files-from files-from.txt /home/me/pics remote:pics\f[R] -copies the following, if they exist, and only those files. -.IP -.nf -\f[C] -/home/me/pics/file1.jpg \[->] remote:pics/file1.jpg -/home/me/pics/subdir/file2.jpg \[->] remote:pics/subdir/file2.jpg -\f[R] -.fi +The matching is controlled by a comma separated selection of these +tokens: +.IP \[bu] 2 +\f[C]modtime\f[R] - the modification time of the file - not supported on +all backends +.IP \[bu] 2 +\f[C]hash\f[R] - the hash of the file contents - not supported on all +backends +.IP \[bu] 2 +\f[C]leaf\f[R] - the name of the file not including its directory name +.IP \[bu] 2 +\f[C]size\f[R] - the size of the file (this is always enabled) .PP -E.g. -to copy the following files referenced by their absolute paths: -.IP -.nf -\f[C] -/home/user1/42 -/home/user1/dir/ford -/home/user2/prefect -\f[R] -.fi +The default option is \f[C]hash\f[R]. .PP -First find a common subdirectory - in this case \f[C]/home\f[R] and put -the remaining files in \f[C]files-from.txt\f[R] with or without leading -\f[C]/\f[R], e.g. -.IP -.nf -\f[C] -user1/42 -user1/dir/ford -user2/prefect -\f[R] -.fi +Using \f[C]--track-renames-strategy modtime,leaf\f[R] would match files +based on modification time, the leaf of the file name and the size only. .PP -Then copy these to a remote: -.IP -.nf -\f[C] -rclone copy --files-from files-from.txt /home remote:backup -\f[R] -.fi +Using \f[C]--track-renames-strategy modtime\f[R] or \f[C]leaf\f[R] can +enable \f[C]--track-renames\f[R] support for encrypted destinations. .PP -The three files are transferred as follows: -.IP -.nf -\f[C] -/home/user1/42 \[->] remote:backup/user1/important -/home/user1/dir/ford \[->] remote:backup/user1/dir/file -/home/user2/prefect \[->] remote:backup/user2/stuff -\f[R] -.fi +Note that the \f[C]hash\f[R] strategy is not supported with encrypted +destinations. +.SS --delete-(before,during,after) .PP -Alternatively if \f[C]/\f[R] is chosen as root \f[C]files-from.txt\f[R] -will be: -.IP -.nf -\f[C] -/home/user1/42 -/home/user1/dir/ford -/home/user2/prefect -\f[R] -.fi +This option allows you to specify when files on your destination are +deleted when you sync folders. .PP -The copy command will be: -.IP -.nf -\f[C] -rclone copy --files-from files-from.txt / remote:backup -\f[R] -.fi +Specifying the value \f[C]--delete-before\f[R] will delete all files +present on the destination, but not on the source \f[I]before\f[R] +starting the transfer of any new or updated files. +This uses two passes through the file systems, one for the deletions and +one for the copies. .PP -Then there will be an extra \f[C]home\f[R] directory on the remote: -.IP -.nf -\f[C] -/home/user1/42 \[->] remote:backup/home/user1/42 -/home/user1/dir/ford \[->] remote:backup/home/user1/dir/ford -/home/user2/prefect \[->] remote:backup/home/user2/prefect -\f[R] -.fi -.SS \f[C]--files-from-raw\f[R] - Read list of source-file names without any processing +Specifying \f[C]--delete-during\f[R] will delete files while checking +and uploading files. +This is the fastest option and uses the least memory. .PP -This flag is the same as \f[C]--files-from\f[R] except that input is -read in a raw manner. -Lines with leading / trailing whitespace, and lines starting with -\f[C];\f[R] or \f[C]#\f[R] are read without any processing. -rclone lsf (https://rclone.org/commands/rclone_lsf/) has a compatible -format that can be used to export file lists from remotes for input to -\f[C]--files-from-raw\f[R]. -.SS \f[C]--ignore-case\f[R] - make searches case insensitive +Specifying \f[C]--delete-after\f[R] (the default value) will delay +deletion of files until all new/updated files have been successfully +transferred. +The files to be deleted are collected in the copy pass then deleted +after the copy pass has completed successfully. +The files to be deleted are held in memory so this mode may use more +memory. +This is the safest mode as it will only delete files if there have been +no errors subsequent to that. +If there have been errors before the deletions start then you will get +the message \f[C]not deleting files as there were IO errors\f[R]. +.SS --fast-list .PP -By default, rclone filter patterns are case sensitive. -The \f[C]--ignore-case\f[R] flag makes all of the filters patterns on -the command line case insensitive. +When doing anything which involves a directory listing (e.g. +\f[C]sync\f[R], \f[C]copy\f[R], \f[C]ls\f[R] - in fact nearly every +command), rclone has different strategies to choose from. .PP -E.g. -\f[C]--include \[dq]zaphod.txt\[dq]\f[R] does not match a file -\f[C]Zaphod.txt\f[R]. -With \f[C]--ignore-case\f[R] a match is made. -.SS Quoting shell metacharacters +The basic strategy is to list one directory and processes it before +using more directory lists to process any subdirectories. +This is a mandatory backend feature, called \f[C]List\f[R], which means +it is supported by all backends. +This strategy uses small amount of memory, and because it can be +parallelised it is fast for operations involving processing of the list +results. +.PP +Some backends provide the support for an alternative strategy, where all +files beneath a directory can be listed in one (or a small number) of +transactions. +Rclone supports this alternative strategy through an optional backend +feature called \f[C]ListR\f[R] (https://rclone.org/overview/#listr). +You can see in the storage system overview documentation\[aq]s optional +features (https://rclone.org/overview/#optional-features) section which +backends it is enabled for (these tend to be the bucket-based ones, e.g. +S3, B2, GCS, Swift). +This strategy requires fewer transactions for highly recursive +operations, which is important on backends where this is charged or +heavily rate limited. +It may be faster (due to fewer transactions) or slower (because it +can\[aq]t be parallelized) depending on different parameters, and may +require more memory if rclone has to keep the whole listing in memory. +.PP +Which listing strategy rclone picks for a given operation is +complicated, but in general it tries to choose the best possible. +It will prefer \f[C]ListR\f[R] in situations where it doesn\[aq]t need +to store the listed files in memory, e.g. +for unlimited recursive \f[C]ls\f[R] command variants. +In other situations it will prefer \f[C]List\f[R], e.g. +for \f[C]sync\f[R] and \f[C]copy\f[R], where it needs to keep the listed +files in memory, and is performing operations on them where +parallelization may be a huge advantage. +.PP +Rclone is not able to take all relevant parameters into account for +deciding the best strategy, and therefore allows you to influence the +choice in two ways: You can stop rclone from using \f[C]ListR\f[R] by +disabling the feature, using the --disable option +(\f[C]--disable ListR\f[R]), or you can allow rclone to use +\f[C]ListR\f[R] where it would normally choose not to do so due to +higher memory usage, using the \f[C]--fast-list\f[R] option. +Rclone should always produce identical results either way. +Using \f[C]--disable ListR\f[R] or \f[C]--fast-list\f[R] on a remote +which doesn\[aq]t support \f[C]ListR\f[R] does nothing, rclone will just +ignore it. +.PP +A rule of thumb is that if you pay for transactions and can fit your +entire sync listing into memory, then \f[C]--fast-list\f[R] is +recommended. +If you have a very big sync to do, then don\[aq]t use +\f[C]--fast-list\f[R], otherwise you will run out of memory. +Run some tests and compare before you decide, and if in doubt then just +leave the default, let rclone decide, i.e. +not use \f[C]--fast-list\f[R]. +.SS --timeout=TIME .PP -Rclone commands with filter patterns containing shell metacharacters may -not as work as expected in your shell and may require quoting. +This sets the IO idle timeout. +If a transfer has started but then becomes idle for this long it is +considered broken and disconnected. .PP -E.g. -linux, OSX (\f[C]*\f[R] metacharacter) -.IP \[bu] 2 -\f[C]--include \[rs]*.jpg\f[R] -.IP \[bu] 2 -\f[C]--include \[aq]*.jpg\[aq]\f[R] -.IP \[bu] 2 -\f[C]--include=\[aq]*.jpg\[aq]\f[R] +The default is \f[C]5m\f[R]. +Set to \f[C]0\f[R] to disable. +.SS --transfers=N .PP -Microsoft Windows expansion is done by the command, not shell, so -\f[C]--include *.jpg\f[R] does not require quoting. +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. .PP -If the rclone error -\f[C]Command .... needs .... arguments maximum: you provided .... non flag arguments:\f[R] -is encountered, the cause is commonly spaces within the name of a remote -or flag value. -The fix then is to quote values containing spaces. -.SS Other filters -.SS \f[C]--min-size\f[R] - Don\[aq]t transfer any file smaller than this +The default is to run 4 file transfers in parallel. .PP -Controls the minimum size file within the scope of an rclone command. -Default units are \f[C]KiB\f[R] but abbreviations \f[C]K\f[R], -\f[C]M\f[R], \f[C]G\f[R], \f[C]T\f[R] or \f[C]P\f[R] are valid. +Look at --multi-thread-streams if you would like to control single file +transfers. +.SS -u, --update .PP -E.g. -\f[C]rclone ls remote: --min-size 50k\f[R] lists files on -\f[C]remote:\f[R] of 50 KiB size or larger. +This forces rclone to skip any files which exist on the destination and +have a modified time that is newer than the source file. .PP -See the size option docs (https://rclone.org/docs/#size-option) for more -info. -.SS \f[C]--max-size\f[R] - Don\[aq]t transfer any file larger than this +This can be useful in avoiding needless transfers when transferring to a +remote which doesn\[aq]t support modification times directly (or when +using \f[C]--use-server-modtime\f[R] to avoid extra API calls) as it is +more accurate than a \f[C]--size-only\f[R] check and faster than using +\f[C]--checksum\f[R]. +On such remotes (or when using \f[C]--use-server-modtime\f[R]) the time +checked will be the uploaded time. .PP -Controls the maximum size file within the scope of an rclone command. -Default units are \f[C]KiB\f[R] but abbreviations \f[C]K\f[R], -\f[C]M\f[R], \f[C]G\f[R], \f[C]T\f[R] or \f[C]P\f[R] are valid. +If an existing destination file has a modification time older than the +source file\[aq]s, it will be updated if the sizes are different. +If the sizes are the same, it will be updated if the checksum is +different or not available. .PP -E.g. -\f[C]rclone ls remote: --max-size 1G\f[R] lists files on -\f[C]remote:\f[R] of 1 GiB size or smaller. +If an existing destination file has a modification time equal (within +the computed modify window) to the source file\[aq]s, it will be updated +if the sizes are different. +The checksum will not be checked in this case unless the +\f[C]--checksum\f[R] flag is provided. .PP -See the size option docs (https://rclone.org/docs/#size-option) for more -info. -.SS \f[C]--max-age\f[R] - Don\[aq]t transfer any file older than this +In all other cases the file will not be updated. .PP -Controls the maximum age of files within the scope of an rclone command. +Consider using the \f[C]--modify-window\f[R] flag to compensate for time +skews between the source and the backend, for backends that do not +support mod times, and instead use uploaded times. +However, if the backend does not support checksums, note that syncing or +copying within the time skew window may still result in additional +transfers for safety. +.SS --use-mmap .PP -\f[C]--max-age\f[R] applies only to files and not to directories. +If this flag is set then rclone will use anonymous memory allocated by +mmap on Unix based platforms and VirtualAlloc on Windows for its +transfer buffers (size controlled by \f[C]--buffer-size\f[R]). +Memory allocated like this does not go on the Go heap and can be +returned to the OS immediately when it is finished with. .PP -E.g. -\f[C]rclone ls remote: --max-age 2d\f[R] lists files on -\f[C]remote:\f[R] of 2 days old or less. +If this flag is not set then rclone will allocate and free the buffers +using the Go memory allocator which may use more memory as memory pages +are returned less aggressively to the OS. .PP -See the time option docs (https://rclone.org/docs/#time-option) for -valid formats. -.SS \f[C]--min-age\f[R] - Don\[aq]t transfer any file younger than this +It is possible this does not work well on all platforms so it is +disabled by default; in the future it may be enabled by default. +.SS --use-server-modtime .PP -Controls the minimum age of files within the scope of an rclone command. -(see \f[C]--max-age\f[R] for valid formats) +Some object-store backends (e.g, Swift, S3) do not preserve file +modification times (modtime). +On these backends, rclone stores the original modtime as additional +metadata on the object. +By default it will make an API call to retrieve the metadata when the +modtime is needed by an operation. .PP -\f[C]--min-age\f[R] applies only to files and not to directories. +Use this flag to disable the extra API call and rely instead on the +server\[aq]s modified time. +In cases such as a local to remote sync using \f[C]--update\f[R], +knowing the local file is newer than the time it was last uploaded to +the remote is sufficient. +In those cases, this flag can speed up the process and reduce the number +of API calls necessary. .PP -E.g. -\f[C]rclone ls remote: --min-age 2d\f[R] lists files on -\f[C]remote:\f[R] of 2 days old or more. +Using this flag on a sync operation without also using +\f[C]--update\f[R] would cause all files modified at any time other than +the last upload time to be uploaded again, which is probably not what +you want. +.SS -v, -vv, --verbose .PP -See the time option docs (https://rclone.org/docs/#time-option) for -valid formats. -.SS Other flags -.SS \f[C]--delete-excluded\f[R] - Delete files on dest excluded from sync +With \f[C]-v\f[R] rclone will tell you about each file that is +transferred and a small number of significant events. .PP -\f[B]Important\f[R] this flag is dangerous to your data - use with -\f[C]--dry-run\f[R] and \f[C]-v\f[R] first. +With \f[C]-vv\f[R] rclone will become very verbose telling you about +every file it considers and transfers. +Please send bug reports with a log with this setting. .PP -In conjunction with \f[C]rclone sync\f[R], \f[C]--delete-excluded\f[R] -deletes any files on the destination which are excluded from the -command. +When setting verbosity as an environment variable, use +\f[C]RCLONE_VERBOSE=1\f[R] or \f[C]RCLONE_VERBOSE=2\f[R] for +\f[C]-v\f[R] and \f[C]-vv\f[R] respectively. +.SS -V, --version .PP -E.g. -the scope of \f[C]rclone sync --interactive A: B:\f[R] can be -restricted: -.IP -.nf -\f[C] -rclone --min-size 50k --delete-excluded sync A: B: -\f[R] -.fi +Prints the version number +.SS SSL/TLS options .PP -All files on \f[C]B:\f[R] which are less than 50 KiB are deleted because -they are excluded from the rclone sync command. -.SS \f[C]--dump filters\f[R] - dump the filters to the output +The outgoing SSL/TLS connections rclone makes can be controlled with +these options. +For example this can be very useful with the HTTP or WebDAV backends. +Rclone HTTP servers have their own set of configuration for SSL/TLS +which you can find in their documentation. +.SS --ca-cert stringArray .PP -Dumps the defined filters to standard output in regular expression -format. +This loads the PEM encoded certificate authority certificates and uses +it to verify the certificates of the servers rclone connects to. .PP -Useful for debugging. -.SS Exclude directory based on a file +If you have generated certificates signed with a local CA then you will +need this flag to connect to servers using those certificates. +.SS --client-cert string .PP -The \f[C]--exclude-if-present\f[R] flag controls whether a directory is -within the scope of an rclone command based on the presence of a named -file within it. -The flag can be repeated to check for multiple file names, presence of -any of them will exclude the directory. +This loads the PEM encoded client side certificate. .PP -This flag has a priority over other filter flags. +This is used for mutual TLS +authentication (https://en.wikipedia.org/wiki/Mutual_authentication). .PP -E.g. -for the following directory structure: -.IP -.nf -\f[C] -dir1/file1 -dir1/dir2/file2 -dir1/dir2/dir3/file3 -dir1/dir2/dir3/.ignore -\f[R] -.fi +The \f[C]--client-key\f[R] flag is required too when using this. +.SS --client-key string .PP -The command \f[C]rclone ls --exclude-if-present .ignore dir1\f[R] does -not list \f[C]dir3\f[R], \f[C]file3\f[R] or \f[C].ignore\f[R]. -.SS Metadata filters +This loads the PEM encoded client side private key used for mutual TLS +authentication. +Used in conjunction with \f[C]--client-cert\f[R]. +.SS --no-check-certificate=true/false .PP -The metadata filters work in a very similar way to the normal file name -filters, except they match metadata (https://rclone.org/docs/#metadata) -on the object. +\f[C]--no-check-certificate\f[R] controls whether a client verifies the +server\[aq]s certificate chain and host name. +If \f[C]--no-check-certificate\f[R] 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. .PP -The metadata should be specified as \f[C]key=value\f[R] patterns. -This may be wildcarded using the normal filter patterns or regular -expressions. +This option defaults to \f[C]false\f[R]. .PP -For example if you wished to list only local files with a mode of -\f[C]100664\f[R] you could do that with: +\f[B]This should be used only for testing.\f[R] +.SS Configuration Encryption +.PP +Your configuration file contains information for logging in to your +cloud services. +This means that you should keep your \f[C]rclone.conf\f[R] file in a +secure location. +.PP +If you are in an environment where that isn\[aq]t possible, you can add +a password to your configuration. +This means that you will have to supply the password every time you +start rclone. +.PP +To add a password to your rclone configuration, execute +\f[C]rclone config\f[R]. .IP .nf \f[C] -rclone lsf -M --files-only --metadata-include \[dq]mode=100664\[dq] . +>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> \f[R] .fi .PP -Or if you wished to show files with an \f[C]atime\f[R], \f[C]mtime\f[R] -or \f[C]btime\f[R] at a given date: +Go into \f[C]s\f[R], Set configuration password: .IP .nf \f[C] -rclone lsf -M --files-only --metadata-include \[dq][abm]time=2022-12-16*\[dq] . +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> \f[R] .fi .PP -Like file filtering, metadata filtering only applies to files not to -directories. +Your configuration is now encrypted, and every time you start rclone you +will have to supply the password. +See below for details. +In the same menu, you can change the password or completely remove +encryption from your configuration. .PP -The filters can be applied using these flags. -.IP \[bu] 2 -\f[C]--metadata-include\f[R] - Include metadatas matching pattern -.IP \[bu] 2 -\f[C]--metadata-include-from\f[R] - Read metadata include patterns from -file (use - to read from stdin) -.IP \[bu] 2 -\f[C]--metadata-exclude\f[R] - Exclude metadatas matching pattern -.IP \[bu] 2 -\f[C]--metadata-exclude-from\f[R] - Read metadata exclude patterns from -file (use - to read from stdin) -.IP \[bu] 2 -\f[C]--metadata-filter\f[R] - Add a metadata filtering rule -.IP \[bu] 2 -\f[C]--metadata-filter-from\f[R] - Read metadata filtering patterns from -a file (use - to read from stdin) +There is no way to recover the configuration if you lose your password. .PP -Each flag can be repeated. -See the section on how filter rules are applied for more details - these -flags work in an identical way to the file name filtering flags, but -instead of file name patterns have metadata patterns. -.SS Common pitfalls +rclone uses nacl +secretbox (https://godoc.org/golang.org/x/crypto/nacl/secretbox) which +in turn 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. .PP -The most frequent filter support issues on the rclone -forum (https://forum.rclone.org/) are: -.IP \[bu] 2 -Not using paths relative to the root of the remote -.IP \[bu] 2 -Not using \f[C]/\f[R] to match from the root of a remote -.IP \[bu] 2 -Not using \f[C]**\f[R] to match the contents of a directory -.SH GUI (Experimental) +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. .PP -Rclone can serve a web based GUI (graphical user interface). -This is somewhat experimental at the moment so things may be subject to -change. +If it is safe in your environment, you can set the +\f[C]RCLONE_CONFIG_PASS\f[R] environment variable to contain your +password, in which case it will be used for decrypting the +configuration. .PP -Run this command in a terminal and rclone will download and then display -the GUI in a web browser. +You can set this for a session from a script. +For unix like systems save this to a file called +\f[C]set-rclone-password\f[R]: .IP .nf \f[C] -rclone rcd --rc-web-gui +#!/bin/echo Source this file don\[aq]t run it + +read -s RCLONE_CONFIG_PASS +export RCLONE_CONFIG_PASS \f[R] .fi .PP -This will produce logs like this and rclone needs to continue to run to -serve the GUI: +Then source the file when you want to use it. +From the shell you would do \f[C]source set-rclone-password\f[R]. +It will then ask you for the password and set it in the environment +variable. +.PP +An alternate means of supplying the password is to provide a script +which will retrieve the password and print on standard output. +This script should have a fully specified path name and not rely on any +environment variables. +The script is supplied either via +\f[C]--password-command=\[dq]...\[dq]\f[R] command line argument or via +the \f[C]RCLONE_PASSWORD_COMMAND\f[R] environment variable. +.PP +One useful example of this is using the \f[C]passwordstore\f[R] +application to retrieve the password: .IP .nf \f[C] -2019/08/25 11:40:14 NOTICE: A new release for gui is present at https://github.com/rclone/rclone-webui-react/releases/download/v0.0.6/currentbuild.zip -2019/08/25 11:40:14 NOTICE: Downloading webgui binary. Please wait. [Size: 3813937, Path : /home/USER/.cache/rclone/webgui/v0.0.6.zip] -2019/08/25 11:40:16 NOTICE: Unzipping -2019/08/25 11:40:16 NOTICE: Serving remote control on http://127.0.0.1:5572/ +export RCLONE_PASSWORD_COMMAND=\[dq]pass rclone/config\[dq] \f[R] .fi .PP -This assumes you are running rclone locally on your machine. -It is possible to separate the rclone and the GUI - see below for -details. +If the \f[C]passwordstore\f[R] password manager holds the password for +the rclone configuration, using the script method means the password is +primarily protected by the \f[C]passwordstore\f[R] system, and is never +embedded in the clear in scripts, nor available for examination using +the standard commands available. +It is quite possible with long running rclone sessions for copies of +passwords to be innocently captured in log files or terminal scroll +buffers, etc. +Using the script method of supplying the password enhances the security +of the config password considerably. .PP -If you wish to check for updates then you can add -\f[C]--rc-web-gui-update\f[R] to the command line. +If you are running rclone inside a script, unless you are using the +\f[C]--password-command\f[R] method, you might want to disable password +prompts. +To do that, pass the parameter \f[C]--ask-password=false\f[R] to rclone. +This will make rclone fail instead of asking for a password if +\f[C]RCLONE_CONFIG_PASS\f[R] doesn\[aq]t contain a valid password, and +\f[C]--password-command\f[R] has not been supplied. .PP -If you find your GUI broken, you may force it to update by add -\f[C]--rc-web-gui-force-update\f[R]. +Whenever running commands that may be affected by options in a +configuration file, rclone will look for an existing file according to +the rules described above, and load any it finds. +If an encrypted file is found, this includes decrypting it, with the +possible consequence of a password prompt. +When executing a command line that you know are not actually using +anything from such a configuration file, you can avoid it being loaded +by overriding the location, e.g. +with one of the documented special values for memory-only configuration. +Since only backend options can be stored in configuration files, this is +normally unnecessary for commands that do not operate on backends, e.g. +\f[C]genautocomplete\f[R]. +However, it will be relevant for commands that do operate on backends in +general, but are used without referencing a stored remote, e.g. +listing local filesystem paths, or connection strings: +\f[C]rclone --config=\[dq]\[dq] ls .\f[R] +.SS Developer options .PP -By default, rclone will open your browser. -Add \f[C]--rc-web-gui-no-open-browser\f[R] to disable this feature. -.SS Using the GUI +These options are useful when developing or debugging rclone. +There are also some more remote specific options which aren\[aq]t +documented here which are used for testing. +These start with remote name e.g. +\f[C]--drive-test-option\f[R] - see the docs for the remote in question. +.SS --cpuprofile=FILE .PP -Once the GUI opens, you will be looking at the dashboard which has an -overall overview. +Write CPU profile to file. +This can be analysed with \f[C]go tool pprof\f[R]. +.SS --dump flag,flag,flag .PP -On the left hand side you will see a series of view buttons you can -click on: -.IP \[bu] 2 -Dashboard - main overview -.IP \[bu] 2 -Configs - examine and create new configurations +The \f[C]--dump\f[R] flag takes a comma separated list of flags to dump +info about. +.PP +Note that some headers including \f[C]Accept-Encoding\f[R] as shown may +not be correct in the request and the response may not show +\f[C]Content-Encoding\f[R] if the go standard libraries auto gzip +encoding was in effect. +In this case the body of the request will be gunzipped before showing +it. +.PP +The available flags are: +.SS --dump headers +.PP +Dump HTTP headers with \f[C]Authorization:\f[R] lines removed. +May still contain sensitive info. +Can be very verbose. +Useful for debugging only. +.PP +Use \f[C]--dump auth\f[R] if you do want the \f[C]Authorization:\f[R] +headers. +.SS --dump bodies +.PP +Dump HTTP headers and bodies - may contain sensitive info. +Can be very verbose. +Useful for debugging only. +.PP +Note that the bodies are buffered in memory so don\[aq]t use this for +enormous files. +.SS --dump requests +.PP +Like \f[C]--dump bodies\f[R] but dumps the request bodies and the +response headers. +Useful for debugging download problems. +.SS --dump responses +.PP +Like \f[C]--dump bodies\f[R] but dumps the response bodies and the +request headers. +Useful for debugging upload problems. +.SS --dump auth +.PP +Dump HTTP headers - will contain sensitive info such as +\f[C]Authorization:\f[R] headers - use \f[C]--dump headers\f[R] to dump +without \f[C]Authorization:\f[R] headers. +Can be very verbose. +Useful for debugging only. +.SS --dump filters +.PP +Dump the filters to the output. +Useful to see exactly what include and exclude options are filtering on. +.SS --dump goroutines +.PP +This dumps a list of the running go-routines at the end of the command +to standard output. +.SS --dump openfiles +.PP +This dumps a list of the open files at the end of the command. +It uses the \f[C]lsof\f[R] command to do that so you\[aq]ll need that +installed to use it. +.SS --dump mapper +.PP +This shows the JSON blobs being sent to the program supplied with +\f[C]--metadata-mapper\f[R] and received from it. +It can be useful for debugging the metadata mapper interface. +.SS --memprofile=FILE +.PP +Write memory profile to file. +This can be analysed with \f[C]go tool pprof\f[R]. +.SS Filtering +.PP +For the filtering options .IP \[bu] 2 -Explorer - view, download and upload files to the cloud storage systems +\f[C]--delete-excluded\f[R] .IP \[bu] 2 -Backend - view or alter the backend config +\f[C]--filter\f[R] .IP \[bu] 2 -Log out -.PP -(More docs and walkthrough video to come!) -.SS How it works -.PP -When you run the \f[C]rclone rcd --rc-web-gui\f[R] this is what happens +\f[C]--filter-from\f[R] .IP \[bu] 2 -Rclone starts but only runs the remote control API (\[dq]rc\[dq]). +\f[C]--exclude\f[R] .IP \[bu] 2 -The API is bound to localhost with an auto-generated username and -password. +\f[C]--exclude-from\f[R] .IP \[bu] 2 -If the API bundle is missing then rclone will download it. +\f[C]--exclude-if-present\f[R] .IP \[bu] 2 -rclone will start serving the files from the API bundle over the same -port as the API +\f[C]--include\f[R] .IP \[bu] 2 -rclone will open the browser with a \f[C]login_token\f[R] so it can log -straight in. -.SS Advanced use -.PP -The \f[C]rclone rcd\f[R] may use any of the flags documented on the rc -page (https://rclone.org/rc/#supported-parameters). -.PP -The flag \f[C]--rc-web-gui\f[R] is shorthand for +\f[C]--include-from\f[R] .IP \[bu] 2 -Download the web GUI if necessary +\f[C]--files-from\f[R] .IP \[bu] 2 -Check we are using some authentication +\f[C]--files-from-raw\f[R] .IP \[bu] 2 -\f[C]--rc-user gui\f[R] +\f[C]--min-size\f[R] .IP \[bu] 2 -\f[C]--rc-pass \f[R] +\f[C]--max-size\f[R] .IP \[bu] 2 -\f[C]--rc-serve\f[R] -.PP -These flags can be overridden as desired. -.PP -See also the rclone rcd -documentation (https://rclone.org/commands/rclone_rcd/). -.SS Example: Running a public GUI -.PP -For example the GUI could be served on a public port over SSL using an -htpasswd file using the following flags: +\f[C]--min-age\f[R] .IP \[bu] 2 -\f[C]--rc-web-gui\f[R] +\f[C]--max-age\f[R] .IP \[bu] 2 -\f[C]--rc-addr :443\f[R] +\f[C]--dump filters\f[R] .IP \[bu] 2 -\f[C]--rc-htpasswd /path/to/htpasswd\f[R] +\f[C]--metadata-include\f[R] .IP \[bu] 2 -\f[C]--rc-cert /path/to/ssl.crt\f[R] +\f[C]--metadata-include-from\f[R] .IP \[bu] 2 -\f[C]--rc-key /path/to/ssl.key\f[R] -.SS Example: Running a GUI behind a proxy -.PP -If you want to run the GUI behind a proxy at \f[C]/rclone\f[R] you could -use these flags: +\f[C]--metadata-exclude\f[R] .IP \[bu] 2 -\f[C]--rc-web-gui\f[R] +\f[C]--metadata-exclude-from\f[R] .IP \[bu] 2 -\f[C]--rc-baseurl rclone\f[R] +\f[C]--metadata-filter\f[R] .IP \[bu] 2 -\f[C]--rc-htpasswd /path/to/htpasswd\f[R] +\f[C]--metadata-filter-from\f[R] .PP -Or instead of htpasswd if you just want a single user and password: +See the filtering section (https://rclone.org/filtering/). +.SS Remote control +.PP +For the remote control options and for instructions on how to remote +control rclone .IP \[bu] 2 -\f[C]--rc-user me\f[R] +\f[C]--rc\f[R] .IP \[bu] 2 -\f[C]--rc-pass mypassword\f[R] -.SS Project -.PP -The GUI is being developed in the: rclone/rclone-webui-react -repository (https://github.com/rclone/rclone-webui-react). +and anything starting with \f[C]--rc-\f[R] .PP -Bug reports and contributions are very welcome :-) +See the remote control section (https://rclone.org/rc/). +.SS Logging .PP -If you have questions then please ask them on the rclone -forum (https://forum.rclone.org/). -.SH Remote controlling rclone with its API +rclone has 4 levels of logging, \f[C]ERROR\f[R], \f[C]NOTICE\f[R], +\f[C]INFO\f[R] and \f[C]DEBUG\f[R]. .PP -If rclone is run with the \f[C]--rc\f[R] flag then it starts an HTTP -server which can be used to remote control rclone using its API. +By default, rclone logs to standard error. +This means you can redirect standard error and still see the normal +output of rclone commands (e.g. +\f[C]rclone ls\f[R]). .PP -You can either use the rc command to access the API or use HTTP -directly. +By default, rclone will produce \f[C]Error\f[R] and \f[C]Notice\f[R] +level messages. .PP -If you just want to run a remote control then see the -rcd (https://rclone.org/commands/rclone_rcd/) command. -.SS Supported parameters -.SS --rc +If you use the \f[C]-q\f[R] flag, rclone will only produce +\f[C]Error\f[R] messages. .PP -Flag to start the http server listen on remote requests -.SS --rc-addr=IP +If you use the \f[C]-v\f[R] flag, rclone will produce \f[C]Error\f[R], +\f[C]Notice\f[R] and \f[C]Info\f[R] messages. .PP -IPaddress:Port or :Port to bind server to. -(default \[dq]localhost:5572\[dq]) -.SS --rc-cert=KEY +If you use the \f[C]-vv\f[R] flag, rclone will produce \f[C]Error\f[R], +\f[C]Notice\f[R], \f[C]Info\f[R] and \f[C]Debug\f[R] messages. .PP -SSL PEM key (concatenation of certificate and CA certificate) -.SS --rc-client-ca=PATH +You can also control the log levels with the \f[C]--log-level\f[R] flag. .PP -Client certificate authority to verify clients with -.SS --rc-htpasswd=PATH +If you use the \f[C]--log-file=FILE\f[R] option, rclone will redirect +\f[C]Error\f[R], \f[C]Info\f[R] and \f[C]Debug\f[R] messages along with +standard error to FILE. .PP -htpasswd file - if not provided no authentication is done -.SS --rc-key=PATH +If you use the \f[C]--syslog\f[R] flag then rclone will log to syslog +and the \f[C]--syslog-facility\f[R] control which facility it uses. .PP -SSL PEM Private key -.SS --rc-max-header-bytes=VALUE +Rclone prefixes all log messages with their level in capitals, e.g. +INFO which makes it easy to grep the log file for different kinds of +information. +.SS Exit Code .PP -Maximum size of request header (default 4096) -.SS --rc-min-tls-version=VALUE +If any errors occur during the command execution, rclone will exit with +a non-zero exit code. +This allows scripts to detect when rclone operations have failed. .PP -The minimum TLS version that is acceptable. -Valid values are \[dq]tls1.0\[dq], \[dq]tls1.1\[dq], \[dq]tls1.2\[dq] -and \[dq]tls1.3\[dq] (default \[dq]tls1.0\[dq]). -.SS --rc-user=VALUE +During the startup phase, rclone will exit immediately if an error is +detected in the configuration. +There will always be a log message immediately before exiting. .PP -User name for authentication. -.SS --rc-pass=VALUE +When rclone is running it will accumulate errors as it goes along, and +only exit with a non-zero exit code if (after retries) there were still +failed transfers. +For every error counted there will be a high priority log message +(visible with \f[C]-q\f[R]) showing the message and which file caused +the problem. +A high priority message is also shown when starting a retry so the user +can see that any previous error messages may not be valid after the +retry. +If rclone has done a retry it will log a high priority message if the +retry was successful. +.SS List of exit codes +.IP \[bu] 2 +\f[C]0\f[R] - success +.IP \[bu] 2 +\f[C]1\f[R] - Syntax or usage error +.IP \[bu] 2 +\f[C]2\f[R] - Error not otherwise categorised +.IP \[bu] 2 +\f[C]3\f[R] - Directory not found +.IP \[bu] 2 +\f[C]4\f[R] - File not found +.IP \[bu] 2 +\f[C]5\f[R] - Temporary error (one that more retries might fix) (Retry +errors) +.IP \[bu] 2 +\f[C]6\f[R] - Less serious errors (like 461 errors from dropbox) +(NoRetry errors) +.IP \[bu] 2 +\f[C]7\f[R] - Fatal error (one that more retries won\[aq]t fix, like +account suspended) (Fatal errors) +.IP \[bu] 2 +\f[C]8\f[R] - Transfer exceeded - limit set by --max-transfer reached +.IP \[bu] 2 +\f[C]9\f[R] - Operation successful, but no files transferred +.IP \[bu] 2 +\f[C]10\f[R] - Duration exceeded - limit set by --max-duration reached +.SS Environment Variables .PP -Password for authentication. -.SS --rc-realm=VALUE +Rclone can be configured entirely using environment variables. +These can be used to set defaults for options or config file entries. +.SS Options .PP -Realm for authentication (default \[dq]rclone\[dq]) -.SS --rc-server-read-timeout=DURATION +Every option in rclone can have its default set by environment variable. .PP -Timeout for server reading data (default 1h0m0s) -.SS --rc-server-write-timeout=DURATION +To find the name of the environment variable, first, take the long +option name, strip the leading \f[C]--\f[R], change \f[C]-\f[R] to +\f[C]_\f[R], make upper case and prepend \f[C]RCLONE_\f[R]. .PP -Timeout for server writing data (default 1h0m0s) -.SS --rc-serve +For example, to always set \f[C]--stats 5s\f[R], set the environment +variable \f[C]RCLONE_STATS=5s\f[R]. +If you set stats on the command line this will override the environment +variable setting. .PP -Enable the serving of remote objects via the HTTP interface. -This means objects will be accessible at http://127.0.0.1:5572/ by -default, so you can browse to http://127.0.0.1:5572/ or -http://127.0.0.1:5572/* to see a listing of the remotes. -Objects may be requested from remotes using this syntax -http://127.0.0.1:5572/[remote:path]/path/to/object +Or to always use the trash in drive \f[C]--drive-use-trash\f[R], set +\f[C]RCLONE_DRIVE_USE_TRASH=true\f[R]. .PP -Default Off. -.SS --rc-files /path/to/directory +Verbosity is slightly different, the environment variable equivalent of +\f[C]--verbose\f[R] or \f[C]-v\f[R] is \f[C]RCLONE_VERBOSE=1\f[R], or +for \f[C]-vv\f[R], \f[C]RCLONE_VERBOSE=2\f[R]. .PP -Path to local files to serve on the HTTP server. +The same parser is used for the options and the environment variables so +they take exactly the same form. .PP -If this is set then rclone will serve the files in that directory. -It will also open the root in the web browser if specified. -This is for implementing browser based GUIs for rclone functions. +The options set by environment variables can be seen with the +\f[C]-vv\f[R] flag, e.g. +\f[C]rclone version -vv\f[R]. +.SS Config file .PP -If \f[C]--rc-user\f[R] or \f[C]--rc-pass\f[R] is set then the URL that -is opened will have the authorization in the URL in the -\f[C]http://user:pass\[at]localhost/\f[R] style. +You can set defaults for values in the config file on an individual +remote basis. +The names of the config items are documented in the page for each +backend. .PP -Default Off. -.SS --rc-enable-metrics -.PP -Enable OpenMetrics/Prometheus compatible endpoint at \f[C]/metrics\f[R]. -.PP -Default Off. -.SS --rc-web-gui -.PP -Set this flag to serve the default web gui on the same port as rclone. -.PP -Default Off. -.SS --rc-allow-origin -.PP -Set the allowed Access-Control-Allow-Origin for rc requests. -.PP -Can be used with --rc-web-gui if the rclone is running on different IP -than the web-gui. -.PP -Default is IP address on which rc is running. -.SS --rc-web-fetch-url -.PP -Set the URL to fetch the rclone-web-gui files from. -.PP -Default -https://api.github.com/repos/rclone/rclone-webui-react/releases/latest. -.SS --rc-web-gui-update -.PP -Set this flag to check and update rclone-webui-react from the -rc-web-fetch-url. -.PP -Default Off. -.SS --rc-web-gui-force-update -.PP -Set this flag to force update rclone-webui-react from the -rc-web-fetch-url. +To find the name of the environment variable, you need to set, take +\f[C]RCLONE_CONFIG_\f[R] + name of remote + \f[C]_\f[R] + name of config +file option and make it all uppercase. +Note one implication here is the remote\[aq]s name must be convertible +into a valid environment variable name, so it can only contain letters, +digits, or the \f[C]_\f[R] (underscore) character. .PP -Default Off. -.SS --rc-web-gui-no-open-browser +For example, to configure an S3 remote named \f[C]mys3:\f[R] without a +config file (using unix ways of setting environment variables): +.IP +.nf +\f[C] +$ export RCLONE_CONFIG_MYS3_TYPE=s3 +$ export RCLONE_CONFIG_MYS3_ACCESS_KEY_ID=XXX +$ export RCLONE_CONFIG_MYS3_SECRET_ACCESS_KEY=XXX +$ rclone lsd mys3: + -1 2016-09-21 12:54:21 -1 my-bucket +$ rclone listremotes | grep mys3 +mys3: +\f[R] +.fi .PP -Set this flag to disable opening browser automatically when using -web-gui. +Note that if you want to create a remote using environment variables you +must create the \f[C]..._TYPE\f[R] variable as above. .PP -Default Off. -.SS --rc-job-expire-duration=DURATION +Note that the name of a remote created using environment variable is +case insensitive, in contrast to regular remotes stored in config file +as documented above. +You must write the name in uppercase in the environment variable, but as +seen from example above it will be listed and can be accessed in +lowercase, while you can also refer to the same remote in uppercase: +.IP +.nf +\f[C] +$ rclone lsd mys3: + -1 2016-09-21 12:54:21 -1 my-bucket +$ rclone lsd MYS3: + -1 2016-09-21 12:54:21 -1 my-bucket +\f[R] +.fi .PP -Expire finished async jobs older than DURATION (default 60s). -.SS --rc-job-expire-interval=DURATION +Note that you can only set the options of the immediate backend, so +RCLONE_CONFIG_MYS3CRYPT_ACCESS_KEY_ID has no effect, if myS3Crypt is a +crypt remote based on an S3 remote. +However RCLONE_S3_ACCESS_KEY_ID will set the access key of all remotes +using S3, including myS3Crypt. .PP -Interval duration to check for expired async jobs (default 10s). -.SS --rc-no-auth +Note also that now rclone has connection strings, it is probably easier +to use those instead which makes the above example +.IP +.nf +\f[C] +rclone lsd :s3,access_key_id=XXX,secret_access_key=XXX: +\f[R] +.fi +.SS Precedence .PP -By default rclone will require authorisation to have been set up on the -rc interface in order to use any methods which access any rclone -remotes. -Eg \f[C]operations/list\f[R] is denied as it involved creating a remote -as is \f[C]sync/copy\f[R]. +The various different methods of backend configuration are read in this +order and the first one with a value is used. +.IP \[bu] 2 +Parameters in connection strings, e.g. +\f[C]myRemote,skip_links:\f[R] +.IP \[bu] 2 +Flag values as supplied on the command line, e.g. +\f[C]--skip-links\f[R] +.IP \[bu] 2 +Remote specific environment vars, e.g. +\f[C]RCLONE_CONFIG_MYREMOTE_SKIP_LINKS\f[R] (see above). +.IP \[bu] 2 +Backend-specific environment vars, e.g. +\f[C]RCLONE_LOCAL_SKIP_LINKS\f[R]. +.IP \[bu] 2 +Backend generic environment vars, e.g. +\f[C]RCLONE_SKIP_LINKS\f[R]. +.IP \[bu] 2 +Config file, e.g. +\f[C]skip_links = true\f[R]. +.IP \[bu] 2 +Default values, e.g. +\f[C]false\f[R] - these can\[aq]t be changed. .PP -If this is set then no authorisation will be required on the server to -use these methods. -The alternative is to use \f[C]--rc-user\f[R] and \f[C]--rc-pass\f[R] -and use these credentials in the request. +So if both \f[C]--skip-links\f[R] is supplied on the command line and an +environment variable \f[C]RCLONE_LOCAL_SKIP_LINKS\f[R] is set, the +command line flag will take preference. .PP -Default Off. -.SS --rc-baseurl +The backend configurations set by environment variables can be seen with +the \f[C]-vv\f[R] flag, e.g. +\f[C]rclone about myRemote: -vv\f[R]. .PP -Prefix for URLs. +For non backend configuration the order is as follows: +.IP \[bu] 2 +Flag values as supplied on the command line, e.g. +\f[C]--stats 5s\f[R]. +.IP \[bu] 2 +Environment vars, e.g. +\f[C]RCLONE_STATS=5s\f[R]. +.IP \[bu] 2 +Default values, e.g. +\f[C]1m\f[R] - these can\[aq]t be changed. +.SS Other environment variables +.IP \[bu] 2 +\f[C]RCLONE_CONFIG_PASS\f[R] set to contain your config file password +(see Configuration Encryption section) +.IP \[bu] 2 +\f[C]HTTP_PROXY\f[R], \f[C]HTTPS_PROXY\f[R] and \f[C]NO_PROXY\f[R] (or +the lowercase versions thereof). +.RS 2 +.IP \[bu] 2 +\f[C]HTTPS_PROXY\f[R] takes precedence over \f[C]HTTP_PROXY\f[R] for +https requests. +.IP \[bu] 2 +The environment values may be either a complete URL or a +\[dq]host[:port]\[dq] for, in which case the \[dq]http\[dq] scheme is +assumed. +.RE +.IP \[bu] 2 +\f[C]USER\f[R] and \f[C]LOGNAME\f[R] values are used as fallbacks for +current username. +The primary method for looking up username is OS-specific: Windows API +on Windows, real user ID in /etc/passwd on Unix systems. +In the documentation the current username is simply referred to as +\f[C]$USER\f[R]. +.IP \[bu] 2 +\f[C]RCLONE_CONFIG_DIR\f[R] - rclone \f[B]sets\f[R] this variable for +use in config files and sub processes to point to the directory holding +the config file. .PP -Default is root -.SS --rc-template +The options set by environment variables can be seen with the +\f[C]-vv\f[R] and \f[C]--log-level=DEBUG\f[R] flags, e.g. +\f[C]rclone version -vv\f[R]. +.SH Configuring rclone on a remote / headless machine .PP -User-specified template. -.SS Accessing the remote control via the rclone rc command +Some of the configurations (those involving oauth2) require an Internet +connected web browser. .PP -Rclone itself implements the remote control protocol in its -\f[C]rclone rc\f[R] command. +If you are trying to set rclone up on a remote or headless box with no +browser available on it (e.g. +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. +.SS Configuring using rclone authorize .PP -You can use it like this +On the headless box run \f[C]rclone\f[R] config but answer \f[C]N\f[R] +to the \f[C]Use web browser to automatically authenticate?\f[R] +question. .IP .nf \f[C] -$ rclone rc rc/noop param1=one param2=two -{ - \[dq]param1\[dq]: \[dq]one\[dq], - \[dq]param2\[dq]: \[dq]two\[dq] -} +\&... +Remote config +Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. +y) Yes (default) +n) No +y/n> n +For this to work, you will need rclone available on a machine that has +a web browser available. + +For more help and alternate methods see: https://rclone.org/remote_setup/ + +Execute the following on the machine with the web browser (same rclone +version recommended): + + rclone authorize \[dq]amazon cloud drive\[dq] + +Then paste the result below: +result> \f[R] .fi .PP -Run \f[C]rclone rc\f[R] on its own to see the help for the installed -remote control commands. -.SS JSON input -.PP -\f[C]rclone rc\f[R] also supports a \f[C]--json\f[R] flag which can be -used to send more complicated input parameters. +Then on your main desktop machine .IP .nf \f[C] -$ rclone rc --json \[aq]{ \[dq]p1\[dq]: [1,\[dq]2\[dq],null,4], \[dq]p2\[dq]: { \[dq]a\[dq]:1, \[dq]b\[dq]:2 } }\[aq] rc/noop -{ - \[dq]p1\[dq]: [ - 1, - \[dq]2\[dq], - null, - 4 - ], - \[dq]p2\[dq]: { - \[dq]a\[dq]: 1, - \[dq]b\[dq]: 2 - } -} +rclone authorize \[dq]amazon cloud drive\[dq] +If your browser doesn\[aq]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 \f[R] .fi .PP -If the parameter being passed is an object then it can be passed as a -JSON string rather than using the \f[C]--json\f[R] flag which simplifies -the command line. +Then back to the headless box, paste in the code .IP .nf \f[C] -rclone rc operations/list fs=/tmp remote=test opt=\[aq]{\[dq]showHash\[dq]: true}\[aq] +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> \f[R] .fi +.SS Configuring by copying the config file .PP -Rather than +Rclone stores all of its config in a single configuration file. +This can easily be copied to configure a remote rclone. +.PP +So first configure rclone on your desktop machine with .IP .nf \f[C] -rclone rc operations/list --json \[aq]{\[dq]fs\[dq]: \[dq]/tmp\[dq], \[dq]remote\[dq]: \[dq]test\[dq], \[dq]opt\[dq]: {\[dq]showHash\[dq]: true}}\[aq] +rclone config \f[R] .fi -.SS Special parameters -.PP -The rc interface supports some special parameters which apply to -\f[B]all\f[R] commands. -These start with \f[C]_\f[R] to show they are different. -.SS Running asynchronous jobs with _async = true -.PP -Each rc call is classified as a job and it is assigned its own id. -By default jobs are executed immediately as they are created or -synchronously. -.PP -If \f[C]_async\f[R] has a true value when supplied to an rc call then it -will return immediately with a job id and the task will be run in the -background. -The \f[C]job/status\f[R] call can be used to get information of the -background job. -The job can be queried for up to 1 minute after it has finished. .PP -It is recommended that potentially long running jobs, e.g. -\f[C]sync/sync\f[R], \f[C]sync/copy\f[R], \f[C]sync/move\f[R], -\f[C]operations/purge\f[R] are run with the \f[C]_async\f[R] flag to -avoid any potential problems with the HTTP request and response timing -out. +to set up the config file. .PP -Starting a job with the \f[C]_async\f[R] flag: +Find the config file by running \f[C]rclone config file\f[R], for +example .IP .nf \f[C] -$ rclone rc --json \[aq]{ \[dq]p1\[dq]: [1,\[dq]2\[dq],null,4], \[dq]p2\[dq]: { \[dq]a\[dq]:1, \[dq]b\[dq]:2 }, \[dq]_async\[dq]: true }\[aq] rc/noop -{ - \[dq]jobid\[dq]: 2 -} +$ rclone config file +Configuration file is stored at: +/home/user/.rclone.conf \f[R] .fi .PP -Query the status to see if the job has finished. -For more information on the meaning of these return parameters see the -\f[C]job/status\f[R] call. +Now transfer it to the remote box (scp, cut paste, ftp, sftp, etc.) and +place it in the correct place (use \f[C]rclone config file\f[R] on the +remote box to find out where). +.SS Configuring using SSH Tunnel +.PP +Linux and MacOS users can utilize SSH Tunnel to redirect the headless +box port 53682 to local machine by using the following command: .IP .nf \f[C] -$ rclone rc --json \[aq]{ \[dq]jobid\[dq]:2 }\[aq] job/status -{ - \[dq]duration\[dq]: 0.000124163, - \[dq]endTime\[dq]: \[dq]2018-10-27T11:38:07.911245881+01:00\[dq], - \[dq]error\[dq]: \[dq]\[dq], - \[dq]finished\[dq]: true, - \[dq]id\[dq]: 2, - \[dq]output\[dq]: { - \[dq]_async\[dq]: true, - \[dq]p1\[dq]: [ - 1, - \[dq]2\[dq], - null, - 4 - ], - \[dq]p2\[dq]: { - \[dq]a\[dq]: 1, - \[dq]b\[dq]: 2 - } - }, - \[dq]startTime\[dq]: \[dq]2018-10-27T11:38:07.911121728+01:00\[dq], - \[dq]success\[dq]: true -} +ssh -L localhost:53682:localhost:53682 username\[at]remote_server \f[R] .fi .PP -\f[C]job/list\f[R] can be used to show the running or recently completed -jobs +Then on the headless box run \f[C]rclone\f[R] config and answer +\f[C]Y\f[R] to the +\f[C]Use web browser to automatically authenticate?\f[R] question. .IP .nf \f[C] -$ rclone rc job/list -{ - \[dq]jobids\[dq]: [ - 2 - ] -} +\&... +Remote config +Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. +y) Yes (default) +n) No +y/n> y \f[R] .fi -.SS Setting config flags with _config .PP -If you wish to set config (the equivalent of the global flags) for the -duration of an rc call only then pass in the \f[C]_config\f[R] -parameter. +Then copy and paste the auth url +\f[C]http://127.0.0.1:53682/auth?state=xxxxxxxxxxxx\f[R] to the browser +on your local machine, complete the auth and it is done. +.SH Filtering, includes and excludes .PP -This should be in the same format as the \f[C]config\f[R] key returned -by options/get. +Filter flags determine which files rclone \f[C]sync\f[R], +\f[C]move\f[R], \f[C]ls\f[R], \f[C]lsl\f[R], \f[C]md5sum\f[R], +\f[C]sha1sum\f[R], \f[C]size\f[R], \f[C]delete\f[R], \f[C]check\f[R] and +similar commands apply to. .PP -For example, if you wished to run a sync with the \f[C]--checksum\f[R] -parameter, you would pass this parameter in your JSON blob. +They are specified in terms of path/file name patterns; path/file lists; +file age and size, or presence of a file in a directory. +Bucket based remotes without the concept of directory apply filters to +object key, age and size in an analogous way. +.PP +Rclone \f[C]purge\f[R] does not obey filters. +.PP +To test filters without risk of damage to data, apply them to +\f[C]rclone ls\f[R], or with the \f[C]--dry-run\f[R] and \f[C]-vv\f[R] +flags. +.PP +Rclone filter patterns can only be used in filter command line options, +not in the specification of a remote. +.PP +E.g. +\f[C]rclone copy \[dq]remote:dir*.jpg\[dq] /path/to/dir\f[R] does not +have a filter effect. +\f[C]rclone copy remote:dir /path/to/dir --include \[dq]*.jpg\[dq]\f[R] +does. +.PP +\f[B]Important\f[R] Avoid mixing any two of \f[C]--include...\f[R], +\f[C]--exclude...\f[R] or \f[C]--filter...\f[R] flags in an rclone +command. +The results might not be what you expect. +Instead use a \f[C]--filter...\f[R] flag. +.SS Patterns for matching path/file names +.SS Pattern syntax +.PP +Here is a formal definition of the pattern syntax, examples are below. +.PP +Rclone matching rules follow a glob style: .IP .nf \f[C] -\[dq]_config\[dq]:{\[dq]CheckSum\[dq]: true} +* matches any sequence of non-separator (/) characters +** matches any sequence of characters including / separators +? matches any single non-separator (/) character +[ [ ! ] { character-range } ] + character class (must be non-empty) +{ pattern-list } + pattern alternatives +{{ regexp }} + regular expression to match +c matches character c (c != *, **, ?, \[rs], [, {, }) +\[rs]c matches reserved character c (c = *, **, ?, \[rs], [, {, }) or character class \f[R] .fi .PP -If using \f[C]rclone rc\f[R] this could be passed as +character-range: .IP .nf \f[C] -rclone rc sync/sync ... _config=\[aq]{\[dq]CheckSum\[dq]: true}\[aq] +c matches character c (c != \[rs], -, ]) +\[rs]c matches reserved character c (c = \[rs], -, ]) +lo - hi matches character c for lo <= c <= hi \f[R] .fi .PP -Any config parameters you don\[aq]t set will inherit the global defaults -which were set with command line flags or environment variables. -.PP -Note that it is possible to set some values as strings or integers - see -data types for more info. -Here is an example setting the equivalent of \f[C]--buffer-size\f[R] in -string or integer format. +pattern-list: .IP .nf \f[C] -\[dq]_config\[dq]:{\[dq]BufferSize\[dq]: \[dq]42M\[dq]} -\[dq]_config\[dq]:{\[dq]BufferSize\[dq]: 44040192} +pattern { , pattern } + comma-separated (without spaces) patterns \f[R] .fi .PP -If you wish to check the \f[C]_config\f[R] assignment has worked -properly then calling \f[C]options/local\f[R] will show what the value -got set to. -.SS Setting filter flags with _filter -.PP -If you wish to set filters for the duration of an rc call only then pass -in the \f[C]_filter\f[R] parameter. -.PP -This should be in the same format as the \f[C]filter\f[R] key returned -by options/get. -.PP -For example, if you wished to run a sync with these flags +character classes (see Go regular expression +reference (https://golang.org/pkg/regexp/syntax/)) include: .IP .nf \f[C] ---max-size 1M --max-age 42s --include \[dq]a\[dq] --include \[dq]b\[dq] +Named character classes (e.g. [\[rs]d], [\[ha]\[rs]d], [\[rs]D], [\[ha]\[rs]D]) +Perl character classes (e.g. \[rs]s, \[rs]S, \[rs]w, \[rs]W) +ASCII character classes (e.g. [[:alnum:]], [[:alpha:]], [[:punct:]], [[:xdigit:]]) \f[R] .fi .PP -you would pass this parameter in your JSON blob. +regexp for advanced users to insert a regular expression - see below for +more info: .IP .nf \f[C] -\[dq]_filter\[dq]:{\[dq]MaxSize\[dq]:\[dq]1M\[dq], \[dq]IncludeRule\[dq]:[\[dq]a\[dq],\[dq]b\[dq]], \[dq]MaxAge\[dq]:\[dq]42s\[dq]} +Any re2 regular expression not containing \[ga]}}\[ga] \f[R] .fi .PP -If using \f[C]rclone rc\f[R] this could be passed as +If the filter pattern starts with a \f[C]/\f[R] then it only matches at +the top level of the directory tree, \f[B]relative to the root of the +remote\f[R] (not necessarily the root of the drive). +If it does not start with \f[C]/\f[R] then it is matched starting at the +\f[B]end of the path/file name\f[R] but it only matches a complete path +element - it must match from a \f[C]/\f[R] separator or the beginning of +the path/file. .IP .nf \f[C] -rclone rc ... _filter=\[aq]{\[dq]MaxSize\[dq]:\[dq]1M\[dq], \[dq]IncludeRule\[dq]:[\[dq]a\[dq],\[dq]b\[dq]], \[dq]MaxAge\[dq]:\[dq]42s\[dq]}\[aq] +file.jpg - matches \[dq]file.jpg\[dq] + - matches \[dq]directory/file.jpg\[dq] + - doesn\[aq]t match \[dq]afile.jpg\[dq] + - doesn\[aq]t match \[dq]directory/afile.jpg\[dq] +/file.jpg - matches \[dq]file.jpg\[dq] in the root directory of the remote + - doesn\[aq]t match \[dq]afile.jpg\[dq] + - doesn\[aq]t match \[dq]directory/file.jpg\[dq] \f[R] .fi .PP -Any filter parameters you don\[aq]t set will inherit the global defaults -which were set with command line flags or environment variables. +The top level of the remote might not be the top level of the drive. .PP -Note that it is possible to set some values as strings or integers - see -data types for more info. -Here is an example setting the equivalent of \f[C]--buffer-size\f[R] in -string or integer format. +E.g. +for a Microsoft Windows local directory structure .IP .nf \f[C] -\[dq]_filter\[dq]:{\[dq]MinSize\[dq]: \[dq]42M\[dq]} -\[dq]_filter\[dq]:{\[dq]MinSize\[dq]: 44040192} +F: +\[u251C]\[u2500]\[u2500] bkp +\[u251C]\[u2500]\[u2500] data +\[br] \[u251C]\[u2500]\[u2500] excl +\[br] \[br] \[u251C]\[u2500]\[u2500] 123.jpg +\[br] \[br] \[u2514]\[u2500]\[u2500] 456.jpg +\[br] \[u251C]\[u2500]\[u2500] incl +\[br] \[br] \[u2514]\[u2500]\[u2500] document.pdf \f[R] .fi .PP -If you wish to check the \f[C]_filter\f[R] assignment has worked -properly then calling \f[C]options/local\f[R] will show what the value -got set to. -.SS Assigning operations to groups with _group = value +To copy the contents of folder \f[C]data\f[R] into folder \f[C]bkp\f[R] +excluding the contents of subfolder \f[C]excl\f[R]the following command +treats \f[C]F:\[rs]data\f[R] and \f[C]F:\[rs]bkp\f[R] as top level for +filtering. .PP -Each rc call has its own stats group for tracking its metrics. -By default grouping is done by the composite group name from prefix -\f[C]job/\f[R] and id of the job like so \f[C]job/1\f[R]. +\f[C]rclone copy F:\[rs]data\[rs] F:\[rs]bkp\[rs] --exclude=/excl/**\f[R] .PP -If \f[C]_group\f[R] has a value then stats for that request will be -grouped under that value. -This allows caller to group stats under their own name. +\f[B]Important\f[R] Use \f[C]/\f[R] in path/file name patterns and not +\f[C]\[rs]\f[R] even if running on Microsoft Windows. .PP -Stats for specific group can be accessed by passing \f[C]group\f[R] to -\f[C]core/stats\f[R]: -.IP -.nf -\f[C] -$ rclone rc --json \[aq]{ \[dq]group\[dq]: \[dq]job/1\[dq] }\[aq] core/stats -{ - \[dq]speed\[dq]: 12345 - ... -} -\f[R] -.fi -.SS Data types -.PP -When the API returns types, these will mostly be straight forward -integer, string or boolean types. -.PP -However some of the types returned by the options/get call and taken by -the options/set calls as well as the \f[C]vfsOpt\f[R], -\f[C]mountOpt\f[R] and the \f[C]_config\f[R] parameters. -.IP \[bu] 2 -\f[C]Duration\f[R] - these are returned as an integer duration in -nanoseconds. -They may be set as an integer, or they may be set with time string, eg -\[dq]5s\[dq]. -See the options section (https://rclone.org/docs/#options) for more -info. -.IP \[bu] 2 -\f[C]Size\f[R] - these are returned as an integer number of bytes. -They may be set as an integer or they may be set with a size suffix -string, eg \[dq]10M\[dq]. -See the options section (https://rclone.org/docs/#options) for more -info. -.IP \[bu] 2 -Enumerated type (such as \f[C]CutoffMode\f[R], \f[C]DumpFlags\f[R], -\f[C]LogLevel\f[R], \f[C]VfsCacheMode\f[R] - these will be returned as -an integer and may be set as an integer but more conveniently they can -be set as a string, eg \[dq]HARD\[dq] for \f[C]CutoffMode\f[R] or -\f[C]DEBUG\f[R] for \f[C]LogLevel\f[R]. -.IP \[bu] 2 -\f[C]BandwidthSpec\f[R] - this will be set and returned as a string, eg -\[dq]1M\[dq]. -.SS Specifying remotes to work on -.PP -Remotes are specified with the \f[C]fs=\f[R], \f[C]srcFs=\f[R], -\f[C]dstFs=\f[R] parameters depending on the command being used. -.PP -The parameters can be a string as per the rest of rclone, eg -\f[C]s3:bucket/path\f[R] or \f[C]:sftp:/my/dir\f[R]. -They can also be specified as JSON blobs. -.PP -If specifying a JSON blob it should be a object mapping strings to -strings. -These values will be used to configure the remote. -There are 3 special values which may be set: -.IP \[bu] 2 -\f[C]type\f[R] - set to \f[C]type\f[R] to specify a remote called -\f[C]:type:\f[R] -.IP \[bu] 2 -\f[C]_name\f[R] - set to \f[C]name\f[R] to specify a remote called -\f[C]name:\f[R] -.IP \[bu] 2 -\f[C]_root\f[R] - sets the root of the remote - may be empty -.PP -One of \f[C]_name\f[R] or \f[C]type\f[R] should normally be set. -If the \f[C]local\f[R] backend is desired then \f[C]type\f[R] should be -set to \f[C]local\f[R]. -If \f[C]_root\f[R] isn\[aq]t specified then it defaults to the root of -the remote. -.PP -For example this JSON is equivalent to \f[C]remote:/tmp\f[R] -.IP -.nf -\f[C] -{ - \[dq]_name\[dq]: \[dq]remote\[dq], - \[dq]_path\[dq]: \[dq]/tmp\[dq] -} -\f[R] -.fi +Simple patterns are case sensitive unless the \f[C]--ignore-case\f[R] +flag is used. .PP -And this is equivalent to -\f[C]:sftp,host=\[aq]example.com\[aq]:/tmp\f[R] +Without \f[C]--ignore-case\f[R] (default) .IP .nf \f[C] -{ - \[dq]type\[dq]: \[dq]sftp\[dq], - \[dq]host\[dq]: \[dq]example.com\[dq], - \[dq]_path\[dq]: \[dq]/tmp\[dq] -} +potato - matches \[dq]potato\[dq] + - doesn\[aq]t match \[dq]POTATO\[dq] \f[R] .fi .PP -And this is equivalent to \f[C]/tmp/dir\f[R] +With \f[C]--ignore-case\f[R] .IP .nf \f[C] -{ - type = \[dq]local\[dq], - _ path = \[dq]/tmp/dir\[dq] -} +potato - matches \[dq]potato\[dq] + - matches \[dq]POTATO\[dq] \f[R] .fi -.SS Supported commands -.SS backend/command: Runs a backend command. +.SS Using regular expressions in filter patterns .PP -This takes the following parameters: -.IP \[bu] 2 -command - a string with the command name -.IP \[bu] 2 -fs - a remote name string e.g. -\[dq]drive:\[dq] -.IP \[bu] 2 -arg - a list of arguments for the backend command -.IP \[bu] 2 -opt - a map of string to string of options +The syntax of filter patterns is glob style matching (like +\f[C]bash\f[R] uses) to make things easy for users. +However this does not provide absolute control over the matching, so for +advanced users rclone also provides a regular expression syntax. .PP -Returns: -.IP \[bu] 2 -result - result from the backend command +The regular expressions used are as defined in the Go regular expression +reference (https://golang.org/pkg/regexp/syntax/). +Regular expressions should be enclosed in \f[C]{{\f[R] \f[C]}}\f[R]. +They will match only the last path segment if the glob doesn\[aq]t start +with \f[C]/\f[R] or the whole path name if it does. +Note that rclone does not attempt to parse the supplied regular +expression, meaning that using any regular expression filter will +prevent rclone from using directory filter rules, as it will instead +check every path against the supplied regular expression(s). .PP -Example: +Here is how the \f[C]{{regexp}}\f[R] is transformed into an full regular +expression to match the entire path: .IP .nf \f[C] -rclone rc backend/command command=noop fs=. -o echo=yes -o blue -a path1 -a path2 +{{regexp}} becomes (\[ha]|/)(regexp)$ +/{{regexp}} becomes \[ha](regexp)$ \f[R] .fi .PP -Returns +Regexp syntax can be mixed with glob syntax, for example .IP .nf \f[C] -{ - \[dq]result\[dq]: { - \[dq]arg\[dq]: [ - \[dq]path1\[dq], - \[dq]path2\[dq] - ], - \[dq]name\[dq]: \[dq]noop\[dq], - \[dq]opt\[dq]: { - \[dq]blue\[dq]: \[dq]\[dq], - \[dq]echo\[dq]: \[dq]yes\[dq] - } - } -} +*.{{jpe?g}} to match file.jpg, file.jpeg but not file.png \f[R] .fi .PP -Note that this is the direct equivalent of using this \[dq]backend\[dq] -command: +You can also use regexp flags - to set case insensitive, for example .IP .nf \f[C] -rclone backend noop . -o echo=yes -o blue path1 path2 +*.{{(?i)jpg}} to match file.jpg, file.JPG but not file.png \f[R] .fi .PP -Note that arguments must be preceded by the \[dq]-a\[dq] flag -.PP -See the backend (https://rclone.org/commands/rclone_backend/) command -for more information. -.PP -\f[B]Authentication is required for this call.\f[R] -.SS cache/expire: Purge a remote from cache -.PP -Purge a remote from the cache backend. -Supports either a directory or a file. -Params: - remote = path to remote (required) - withData = true/false to -delete cached data (chunks) as well (optional) -.PP -Eg +Be careful with wildcards in regular expressions - you don\[aq]t want +them to match path separators normally. +To match any file name starting with \f[C]start\f[R] and ending with +\f[C]end\f[R] write .IP .nf \f[C] -rclone rc cache/expire remote=path/to/sub/folder/ -rclone rc cache/expire remote=/ withData=true +{{start[\[ha]/]*end\[rs].jpg}} \f[R] .fi -.SS cache/fetch: Fetch file chunks -.PP -Ensure the specified file chunks are cached on disk. -.PP -The chunks= parameter specifies the file chunks to check. -It takes a comma separated list of array slice indices. -The slice indices are similar to Python slices: start[:end] -.PP -start is the 0 based chunk number from the beginning of the file to -fetch inclusive. -end is 0 based chunk number from the beginning of the file to fetch -exclusive. -Both values can be negative, in which case they count from the back of -the file. -The value \[dq]-5:\[dq] represents the last 5 chunks of a file. .PP -Some valid examples are: \[dq]:5,-5:\[dq] -> the first and last five -chunks \[dq]0,-2\[dq] -> the first and the second last chunk -\[dq]0:10\[dq] -> the first ten chunks -.PP -Any parameter with a key that starts with \[dq]file\[dq] can be used to -specify files to fetch, e.g. +Not .IP .nf \f[C] -rclone rc cache/fetch chunks=0 file=hello file2=home/goodbye +{{start.*end\[rs].jpg}} \f[R] .fi .PP -File names will automatically be encrypted when the a crypt remote is -used on top of the cache. -.SS cache/stats: Get cache stats +Which will match a directory called \f[C]start\f[R] with a file called +\f[C]end.jpg\f[R] in it as the \f[C].*\f[R] will match \f[C]/\f[R] +characters. .PP -Show statistics for the cache remote. -.SS config/create: create the config for a remote. +Note that you can use \f[C]-vv --dump filters\f[R] to show the filter +patterns in regexp format - rclone implements the glob patterns by +transforming them into regular expressions. +.SS Filter pattern examples .PP -This takes the following parameters: -.IP \[bu] 2 -name - name of remote -.IP \[bu] 2 -parameters - a map of { \[dq]key\[dq]: \[dq]value\[dq] } pairs -.IP \[bu] 2 -type - type of the new remote -.IP \[bu] 2 -opt - a dictionary of options to control the configuration -.RS 2 -.IP \[bu] 2 -obscure - declare passwords are plain and need obscuring +.TS +tab(@); +l l l l. +T{ +Description +T}@T{ +Pattern +T}@T{ +Matches +T}@T{ +Does not match +T} +_ +T{ +Wildcard +T}@T{ +\f[C]*.jpg\f[R] +T}@T{ +\f[C]/file.jpg\f[R] +T}@T{ +\f[C]/file.png\f[R] +T} +T{ +T}@T{ +T}@T{ +\f[C]/dir/file.jpg\f[R] +T}@T{ +\f[C]/dir/file.png\f[R] +T} +T{ +Rooted +T}@T{ +\f[C]/*.jpg\f[R] +T}@T{ +\f[C]/file.jpg\f[R] +T}@T{ +\f[C]/file.png\f[R] +T} +T{ +T}@T{ +T}@T{ +\f[C]/file2.jpg\f[R] +T}@T{ +\f[C]/dir/file.jpg\f[R] +T} +T{ +Alternates +T}@T{ +\f[C]*.{jpg,png}\f[R] +T}@T{ +\f[C]/file.jpg\f[R] +T}@T{ +\f[C]/file.gif\f[R] +T} +T{ +T}@T{ +T}@T{ +\f[C]/dir/file.png\f[R] +T}@T{ +\f[C]/dir/file.gif\f[R] +T} +T{ +Path Wildcard +T}@T{ +\f[C]dir/**\f[R] +T}@T{ +\f[C]/dir/anyfile\f[R] +T}@T{ +\f[C]file.png\f[R] +T} +T{ +T}@T{ +T}@T{ +\f[C]/subdir/dir/subsubdir/anyfile\f[R] +T}@T{ +\f[C]/subdir/file.png\f[R] +T} +T{ +Any Char +T}@T{ +\f[C]*.t?t\f[R] +T}@T{ +\f[C]/file.txt\f[R] +T}@T{ +\f[C]/file.qxt\f[R] +T} +T{ +T}@T{ +T}@T{ +\f[C]/dir/file.tzt\f[R] +T}@T{ +\f[C]/dir/file.png\f[R] +T} +T{ +Range +T}@T{ +\f[C]*.[a-z]\f[R] +T}@T{ +\f[C]/file.a\f[R] +T}@T{ +\f[C]/file.0\f[R] +T} +T{ +T}@T{ +T}@T{ +\f[C]/dir/file.b\f[R] +T}@T{ +\f[C]/dir/file.1\f[R] +T} +T{ +Escape +T}@T{ +\f[C]*.\[rs]?\[rs]?\[rs]?\f[R] +T}@T{ +\f[C]/file.???\f[R] +T}@T{ +\f[C]/file.abc\f[R] +T} +T{ +T}@T{ +T}@T{ +\f[C]/dir/file.???\f[R] +T}@T{ +\f[C]/dir/file.def\f[R] +T} +T{ +Class +T}@T{ +\f[C]*.\[rs]d\[rs]d\[rs]d\f[R] +T}@T{ +\f[C]/file.012\f[R] +T}@T{ +\f[C]/file.abc\f[R] +T} +T{ +T}@T{ +T}@T{ +\f[C]/dir/file.345\f[R] +T}@T{ +\f[C]/dir/file.def\f[R] +T} +T{ +Regexp +T}@T{ +\f[C]*.{{jpe?g}}\f[R] +T}@T{ +\f[C]/file.jpeg\f[R] +T}@T{ +\f[C]/file.png\f[R] +T} +T{ +T}@T{ +T}@T{ +\f[C]/dir/file.jpg\f[R] +T}@T{ +\f[C]/dir/file.jpeeg\f[R] +T} +T{ +Rooted Regexp +T}@T{ +\f[C]/{{.*\[rs].jpe?g}}\f[R] +T}@T{ +\f[C]/file.jpeg\f[R] +T}@T{ +\f[C]/file.png\f[R] +T} +T{ +T}@T{ +T}@T{ +\f[C]/file.jpg\f[R] +T}@T{ +\f[C]/dir/file.jpg\f[R] +T} +.TE +.SS How filter rules are applied to files +.PP +Rclone path/file name filters are made up of one or more of the +following flags: .IP \[bu] 2 -noObscure - declare passwords are already obscured and don\[aq]t need -obscuring +\f[C]--include\f[R] .IP \[bu] 2 -nonInteractive - don\[aq]t interact with a user, return questions +\f[C]--include-from\f[R] .IP \[bu] 2 -continue - continue the config process with an answer +\f[C]--exclude\f[R] .IP \[bu] 2 -all - ask all the config questions not just the post config ones +\f[C]--exclude-from\f[R] .IP \[bu] 2 -state - state to restart with - used with continue +\f[C]--filter\f[R] .IP \[bu] 2 -result - result to restart with - used with continue -.RE +\f[C]--filter-from\f[R] .PP -See the config -create (https://rclone.org/commands/rclone_config_create/) command for -more information on the above. +There can be more than one instance of individual flags. .PP -\f[B]Authentication is required for this call.\f[R] -.SS config/delete: Delete a remote in the config file. +Rclone internally uses a combined list of all the include and exclude +rules. +The order in which rules are processed can influence the result of the +filter. .PP -Parameters: -.IP \[bu] 2 -name - name of remote to delete +All flags of the same type are processed together in the order above, +regardless of what order the different types of flags are included on +the command line. .PP -See the config -delete (https://rclone.org/commands/rclone_config_delete/) command for -more information on the above. +Multiple instances of the same flag are processed from left to right +according to their position in the command line. .PP -\f[B]Authentication is required for this call.\f[R] -.SS config/dump: Dumps the config file. +To mix up the order of processing includes and excludes use +\f[C]--filter...\f[R] flags. .PP -Returns a JSON object: - key: value +Within \f[C]--include-from\f[R], \f[C]--exclude-from\f[R] and +\f[C]--filter-from\f[R] flags rules are processed from top to bottom of +the referenced file. .PP -Where keys are remote names and values are the config parameters. +If there is an \f[C]--include\f[R] or \f[C]--include-from\f[R] flag +specified, rclone implies a \f[C]- **\f[R] rule which it adds to the +bottom of the internal rule list. +Specifying a \f[C]+\f[R] rule with a \f[C]--filter...\f[R] flag does not +imply that rule. .PP -See the config dump (https://rclone.org/commands/rclone_config_dump/) -command for more information on the above. +Each path/file name passed through rclone is matched against the +combined filter list. +At first match to a rule the path/file name is included or excluded and +no further filter rules are processed for that path/file. .PP -\f[B]Authentication is required for this call.\f[R] -.SS config/get: Get a remote in the config file. +If rclone does not find a match, after testing against all rules +(including the implied rule if appropriate), the path/file name is +included. .PP -Parameters: -.IP \[bu] 2 -name - name of remote to get +Any path/file included at that stage is processed by the rclone command. .PP -See the config dump (https://rclone.org/commands/rclone_config_dump/) -command for more information on the above. +\f[C]--files-from\f[R] and \f[C]--files-from-raw\f[R] flags over-ride +and cannot be combined with other filter options. .PP -\f[B]Authentication is required for this call.\f[R] -.SS config/listremotes: Lists the remotes in the config file and defined in environment variables. +To see the internal combined rule list, in regular expression form, for +a command add the \f[C]--dump filters\f[R] flag. +Running an rclone command with \f[C]--dump filters\f[R] and +\f[C]-vv\f[R] flags lists the internal filter elements and shows how +they are applied to each source path/file. +There is not currently a means provided to pass regular expression +filter options into rclone directly though character class filter rules +contain character classes. +Go regular expression reference (https://golang.org/pkg/regexp/syntax/) +.SS How filter rules are applied to directories .PP -Returns - remotes - array of remote names +Rclone commands are applied to path/file names not directories. +The entire contents of a directory can be matched to a filter by the +pattern \f[C]directory/*\f[R] or recursively by \f[C]directory/**\f[R]. .PP -See the listremotes (https://rclone.org/commands/rclone_listremotes/) -command for more information on the above. +Directory filter rules are defined with a closing \f[C]/\f[R] separator. .PP -\f[B]Authentication is required for this call.\f[R] -.SS config/password: password the config for a remote. +E.g. +\f[C]/directory/subdirectory/\f[R] is an rclone directory filter rule. .PP -This takes the following parameters: -.IP \[bu] 2 -name - name of remote -.IP \[bu] 2 -parameters - a map of { \[dq]key\[dq]: \[dq]value\[dq] } pairs +Rclone commands can use directory filter rules to determine whether they +recurse into subdirectories. +This potentially optimises access to a remote by avoiding listing +unnecessary directories. +Whether optimisation is desirable depends on the specific filter rules +and source remote content. .PP -See the config -password (https://rclone.org/commands/rclone_config_password/) command -for more information on the above. +If any regular expression filters are in use, then no directory +recursion optimisation is possible, as rclone must check every path +against the supplied regular expression(s). .PP -\f[B]Authentication is required for this call.\f[R] -.SS config/providers: Shows how providers are configured in the config file. -.PP -Returns a JSON object: - providers - array of objects -.PP -See the config -providers (https://rclone.org/commands/rclone_config_providers/) command -for more information on the above. -.PP -\f[B]Authentication is required for this call.\f[R] -.SS config/setpath: Set the path of the config file -.PP -Parameters: -.IP \[bu] 2 -path - path to the config file to use -.PP -\f[B]Authentication is required for this call.\f[R] -.SS config/update: update the config for a remote. -.PP -This takes the following parameters: -.IP \[bu] 2 -name - name of remote -.IP \[bu] 2 -parameters - a map of { \[dq]key\[dq]: \[dq]value\[dq] } pairs -.IP \[bu] 2 -opt - a dictionary of options to control the configuration -.RS 2 -.IP \[bu] 2 -obscure - declare passwords are plain and need obscuring -.IP \[bu] 2 -noObscure - declare passwords are already obscured and don\[aq]t need -obscuring -.IP \[bu] 2 -nonInteractive - don\[aq]t interact with a user, return questions -.IP \[bu] 2 -continue - continue the config process with an answer +Directory recursion optimisation occurs if either: .IP \[bu] 2 -all - ask all the config questions not just the post config ones +A source remote does not support the rclone \f[C]ListR\f[R] primitive. +local, sftp, Microsoft OneDrive and WebDAV do not support +\f[C]ListR\f[R]. +Google Drive and most bucket type storage do. +Full list (https://rclone.org/overview/#optional-features) .IP \[bu] 2 -state - state to restart with - used with continue +On other remotes (those that support \f[C]ListR\f[R]), if the rclone +command is not naturally recursive, and provided it is not run with the +\f[C]--fast-list\f[R] flag. +\f[C]ls\f[R], \f[C]lsf -R\f[R] and \f[C]size\f[R] are naturally +recursive but \f[C]sync\f[R], \f[C]copy\f[R] and \f[C]move\f[R] are not. .IP \[bu] 2 -result - result to restart with - used with continue -.RE -.PP -See the config -update (https://rclone.org/commands/rclone_config_update/) command for -more information on the above. -.PP -\f[B]Authentication is required for this call.\f[R] -.SS core/bwlimit: Set the bandwidth limit. +Whenever the \f[C]--disable ListR\f[R] flag is applied to an rclone +command. .PP -This sets the bandwidth limit to the string passed in. -This should be a single bandwidth limit entry or a pair of -upload:download bandwidth. +Rclone commands imply directory filter rules from path/file filter +rules. +To view the directory filter rules rclone has implied for a command +specify the \f[C]--dump filters\f[R] flag. .PP -Eg +E.g. +for an include rule .IP .nf \f[C] -rclone rc core/bwlimit rate=off -{ - \[dq]bytesPerSecond\[dq]: -1, - \[dq]bytesPerSecondTx\[dq]: -1, - \[dq]bytesPerSecondRx\[dq]: -1, - \[dq]rate\[dq]: \[dq]off\[dq] -} -rclone rc core/bwlimit rate=1M -{ - \[dq]bytesPerSecond\[dq]: 1048576, - \[dq]bytesPerSecondTx\[dq]: 1048576, - \[dq]bytesPerSecondRx\[dq]: 1048576, - \[dq]rate\[dq]: \[dq]1M\[dq] -} -rclone rc core/bwlimit rate=1M:100k -{ - \[dq]bytesPerSecond\[dq]: 1048576, - \[dq]bytesPerSecondTx\[dq]: 1048576, - \[dq]bytesPerSecondRx\[dq]: 131072, - \[dq]rate\[dq]: \[dq]1M\[dq] -} +/a/*.jpg \f[R] .fi .PP -If the rate parameter is not supplied then the bandwidth is queried +Rclone implies the directory include rule .IP .nf \f[C] -rclone rc core/bwlimit -{ - \[dq]bytesPerSecond\[dq]: 1048576, - \[dq]bytesPerSecondTx\[dq]: 1048576, - \[dq]bytesPerSecondRx\[dq]: 1048576, - \[dq]rate\[dq]: \[dq]1M\[dq] -} +/a/ \f[R] .fi .PP -The format of the parameter is exactly the same as passed to --bwlimit -except only one bandwidth may be specified. -.PP -In either case \[dq]rate\[dq] is returned as a human-readable string, -and \[dq]bytesPerSecond\[dq] is returned as a number. -.SS core/command: Run a rclone terminal command over rc. -.PP -This takes the following parameters: -.IP \[bu] 2 -command - a string with the command name. -.IP \[bu] 2 -arg - a list of arguments for the backend command. -.IP \[bu] 2 -opt - a map of string to string of options. -.IP \[bu] 2 -returnType - one of (\[dq]COMBINED_OUTPUT\[dq], \[dq]STREAM\[dq], -\[dq]STREAM_ONLY_STDOUT\[dq], \[dq]STREAM_ONLY_STDERR\[dq]). -.RS 2 -.IP \[bu] 2 -Defaults to \[dq]COMBINED_OUTPUT\[dq] if not set. -.IP \[bu] 2 -The STREAM returnTypes will write the output to the body of the HTTP -message. -.IP \[bu] 2 -The COMBINED_OUTPUT will write the output to the \[dq]result\[dq] -parameter. -.RE -.PP -Returns: -.IP \[bu] 2 -result - result from the backend command. -.RS 2 -.IP \[bu] 2 -Only set when using returnType \[dq]COMBINED_OUTPUT\[dq]. -.RE -.IP \[bu] 2 -error - set if rclone exits with an error code. -.IP \[bu] 2 -returnType - one of (\[dq]COMBINED_OUTPUT\[dq], \[dq]STREAM\[dq], -\[dq]STREAM_ONLY_STDOUT\[dq], \[dq]STREAM_ONLY_STDERR\[dq]). +Directory filter rules specified in an rclone command can limit the +scope of an rclone command but path/file filters still have to be +specified. .PP -Example: -.IP -.nf -\f[C] -rclone rc core/command command=ls -a mydrive:/ -o max-depth=1 -rclone rc core/command -a ls -a mydrive:/ -o max-depth=1 -\f[R] -.fi +E.g. +\f[C]rclone ls remote: --include /directory/\f[R] will not match any +files. +Because it is an \f[C]--include\f[R] option the \f[C]--exclude **\f[R] +rule is implied, and the \f[C]/directory/\f[R] pattern serves only to +optimise access to the remote by ignoring everything outside of that +directory. .PP -Returns: +E.g. +\f[C]rclone ls remote: --filter-from filter-list.txt\f[R] with a file +\f[C]filter-list.txt\f[R]: .IP .nf \f[C] -{ - \[dq]error\[dq]: false, - \[dq]result\[dq]: \[dq]\[dq] -} - -OR -{ - \[dq]error\[dq]: true, - \[dq]result\[dq]: \[dq]\[dq] -} +- /dir1/ +- /dir2/ ++ *.pdf +- ** \f[R] .fi .PP -\f[B]Authentication is required for this call.\f[R] -.SS core/du: Returns disk usage of a locally attached disk. +All files in directories \f[C]dir1\f[R] or \f[C]dir2\f[R] or their +subdirectories are completely excluded from the listing. +Only files of suffix \f[C]pdf\f[R] in the root of \f[C]remote:\f[R] or +its subdirectories are listed. +The \f[C]- **\f[R] rule prevents listing of any path/files not +previously matched by the rules above. .PP -This returns the disk usage for the local directory passed in as dir. +Option \f[C]exclude-if-present\f[R] creates a directory exclude rule +based on the presence of a file in a directory and takes precedence over +other rclone directory filter rules. .PP -If the directory is not passed in, it defaults to the directory pointed -to by --cache-dir. -.IP \[bu] 2 -dir - string (optional) +When using pattern list syntax, if a pattern item contains either +\f[C]/\f[R] or \f[C]**\f[R], then rclone will not able to imply a +directory filter rule from this pattern list. .PP -Returns: +E.g. +for an include rule .IP .nf \f[C] -{ - \[dq]dir\[dq]: \[dq]/\[dq], - \[dq]info\[dq]: { - \[dq]Available\[dq]: 361769115648, - \[dq]Free\[dq]: 361785892864, - \[dq]Total\[dq]: 982141468672 - } -} +{dir1/**,dir2/**} \f[R] .fi -.SS core/gc: Runs a garbage collection. .PP -This tells the go runtime to do a garbage collection run. -It isn\[aq]t necessary to call this normally, but it can be useful for -debugging memory problems. -.SS core/group-list: Returns list of stats. +Rclone will match files below directories \f[C]dir1\f[R] or +\f[C]dir2\f[R] only, but will not be able to use this filter to exclude +a directory \f[C]dir3\f[R] from being traversed. .PP -This returns list of stats groups currently in memory. +Directory recursion optimisation may affect performance, but normally +not the result. +One exception to this is sync operations with option +\f[C]--create-empty-src-dirs\f[R], where any traversed empty directories +will be created. +With the pattern list example \f[C]{dir1/**,dir2/**}\f[R] above, this +would create an empty directory \f[C]dir3\f[R] on destination (when it +exists on source). +Changing the filter to \f[C]{dir1,dir2}/**\f[R], or splitting it into +two include rules \f[C]--include dir1/** --include dir2/**\f[R], will +match the same files while also filtering directories, with the result +that an empty directory \f[C]dir3\f[R] will no longer be created. +.SS \f[C]--exclude\f[R] - Exclude files matching pattern .PP -Returns the following values: -.IP -.nf -\f[C] -{ - \[dq]groups\[dq]: an array of group names: - [ - \[dq]group1\[dq], - \[dq]group2\[dq], - ... - ] -} -\f[R] -.fi -.SS core/memstats: Returns the memory statistics +Excludes path/file names from an rclone command based on a single +exclude rule. .PP -This returns the memory statistics of the running program. -What the values mean are explained in the go docs: -https://golang.org/pkg/runtime/#MemStats +This flag can be repeated. +See above for the order filter flags are processed in. .PP -The most interesting values for most people are: -.IP \[bu] 2 -HeapAlloc - this is the amount of memory rclone is actually using -.IP \[bu] 2 -HeapSys - this is the amount of memory rclone has obtained from the OS -.IP \[bu] 2 -Sys - this is the total amount of memory requested from the OS -.RS 2 -.IP \[bu] 2 -It is virtual memory so may include unused memory -.RE -.SS core/obscure: Obscures a string passed in. +\f[C]--exclude\f[R] should not be used with \f[C]--include\f[R], +\f[C]--include-from\f[R], \f[C]--filter\f[R] or \f[C]--filter-from\f[R] +flags. .PP -Pass a clear string and rclone will obscure it for the config file: - -clear - string +\f[C]--exclude\f[R] has no effect when combined with +\f[C]--files-from\f[R] or \f[C]--files-from-raw\f[R] flags. .PP -Returns: - obscured - string -.SS core/pid: Return PID of current process +E.g. +\f[C]rclone ls remote: --exclude *.bak\f[R] excludes all .bak files from +listing. .PP -This returns PID of current process. -Useful for stopping rclone process. -.SS core/quit: Terminates the app. +E.g. +\f[C]rclone size remote: \[dq]--exclude /dir/**\[dq]\f[R] returns the +total size of all files on \f[C]remote:\f[R] excluding those in root +directory \f[C]dir\f[R] and sub directories. .PP -(Optional) Pass an exit code to be used for terminating the app: - -exitCode - int -.SS core/stats: Returns stats about current transfers. +E.g. +on Microsoft Windows +\f[C]rclone ls remote: --exclude \[dq]*\[rs][{JP,KR,HK}\[rs]]*\[dq]\f[R] +lists the files in \f[C]remote:\f[R] without \f[C][JP]\f[R] or +\f[C][KR]\f[R] or \f[C][HK]\f[R] in their name. +Quotes prevent the shell from interpreting the \f[C]\[rs]\f[R] +characters.\f[C]\[rs]\f[R] characters escape the \f[C][\f[R] and +\f[C]]\f[R] so an rclone filter treats them literally rather than as a +character-range. +The \f[C]{\f[R] and \f[C]}\f[R] define an rclone pattern list. +For other operating systems single quotes are required ie +\f[C]rclone ls remote: --exclude \[aq]*\[rs][{JP,KR,HK}\[rs]]*\[aq]\f[R] +.SS \f[C]--exclude-from\f[R] - Read exclude patterns from file .PP -This returns all available stats: +Excludes path/file names from an rclone command based on rules in a +named file. +The file contains a list of remarks and pattern rules. +.PP +For an example \f[C]exclude-file.txt\f[R]: .IP .nf \f[C] -rclone rc core/stats +# a sample exclude rule file +*.bak +file2.jpg \f[R] .fi .PP -If group is not provided then summed up stats for all groups will be -returned. +\f[C]rclone ls remote: --exclude-from exclude-file.txt\f[R] lists the +files on \f[C]remote:\f[R] except those named \f[C]file2.jpg\f[R] or +with a suffix \f[C].bak\f[R]. +That is equivalent to +\f[C]rclone ls remote: --exclude file2.jpg --exclude \[dq]*.bak\[dq]\f[R]. .PP -Parameters -.IP \[bu] 2 -group - name of the stats group (string) +This flag can be repeated. +See above for the order filter flags are processed in. .PP -Returns the following values: -.IP -.nf -\f[C] -{ - \[dq]bytes\[dq]: total transferred bytes since the start of the group, - \[dq]checks\[dq]: number of files checked, - \[dq]deletes\[dq] : number of files deleted, - \[dq]elapsedTime\[dq]: time in floating point seconds since rclone was started, - \[dq]errors\[dq]: number of errors, - \[dq]eta\[dq]: estimated time in seconds until the group completes, - \[dq]fatalError\[dq]: boolean whether there has been at least one fatal error, - \[dq]lastError\[dq]: last error string, - \[dq]renames\[dq] : number of files renamed, - \[dq]retryError\[dq]: boolean showing whether there has been at least one non-NoRetryError, - \[dq]serverSideCopies\[dq]: number of server side copies done, - \[dq]serverSideCopyBytes\[dq]: number bytes server side copied, - \[dq]serverSideMoves\[dq]: number of server side moves done, - \[dq]serverSideMoveBytes\[dq]: number bytes server side moved, - \[dq]speed\[dq]: average speed in bytes per second since start of the group, - \[dq]totalBytes\[dq]: total number of bytes in the group, - \[dq]totalChecks\[dq]: total number of checks in the group, - \[dq]totalTransfers\[dq]: total number of transfers in the group, - \[dq]transferTime\[dq] : total time spent on running jobs, - \[dq]transfers\[dq]: number of transferred files, - \[dq]transferring\[dq]: an array of currently active file transfers: - [ - { - \[dq]bytes\[dq]: total transferred bytes for this file, - \[dq]eta\[dq]: estimated time in seconds until file transfer completion - \[dq]name\[dq]: name of the file, - \[dq]percentage\[dq]: progress of the file transfer in percent, - \[dq]speed\[dq]: average speed over the whole transfer in bytes per second, - \[dq]speedAvg\[dq]: current speed in bytes per second as an exponentially weighted moving average, - \[dq]size\[dq]: size of the file in bytes - } - ], - \[dq]checking\[dq]: an array of names of currently active file checks - [] -} -\f[R] -.fi +The \f[C]--exclude-from\f[R] flag is useful where multiple exclude +filter rules are applied to an rclone command. .PP -Values for \[dq]transferring\[dq], \[dq]checking\[dq] and -\[dq]lastError\[dq] are only assigned if data is available. -The value for \[dq]eta\[dq] is null if an eta cannot be determined. -.SS core/stats-delete: Delete stats group. +\f[C]--exclude-from\f[R] should not be used with \f[C]--include\f[R], +\f[C]--include-from\f[R], \f[C]--filter\f[R] or \f[C]--filter-from\f[R] +flags. .PP -This deletes entire stats group. +\f[C]--exclude-from\f[R] has no effect when combined with +\f[C]--files-from\f[R] or \f[C]--files-from-raw\f[R] flags. .PP -Parameters -.IP \[bu] 2 -group - name of the stats group (string) -.SS core/stats-reset: Reset stats. +\f[C]--exclude-from\f[R] followed by \f[C]-\f[R] reads filter rules from +standard input. +.SS \f[C]--include\f[R] - Include files matching pattern .PP -This clears counters, errors and finished transfers for all stats or -specific stats group if group is provided. +Adds a single include rule based on path/file names to an rclone +command. .PP -Parameters -.IP \[bu] 2 -group - name of the stats group (string) -.SS core/transferred: Returns stats about completed transfers. +This flag can be repeated. +See above for the order filter flags are processed in. .PP -This returns stats about completed transfers: +\f[C]--include\f[R] has no effect when combined with +\f[C]--files-from\f[R] or \f[C]--files-from-raw\f[R] flags. +.PP +\f[C]--include\f[R] implies \f[C]--exclude **\f[R] at the end of an +rclone internal filter list. +Therefore if you mix \f[C]--include\f[R] and \f[C]--include-from\f[R] +flags with \f[C]--exclude\f[R], \f[C]--exclude-from\f[R], +\f[C]--filter\f[R] or \f[C]--filter-from\f[R], you must use include +rules for all the files you want in the include statement. +For more flexibility use the \f[C]--filter-from\f[R] flag. +.PP +E.g. +\f[C]rclone ls remote: --include \[dq]*.{png,jpg}\[dq]\f[R] lists the +files on \f[C]remote:\f[R] with suffix \f[C].png\f[R] and +\f[C].jpg\f[R]. +All other files are excluded. +.PP +E.g. +multiple rclone copy commands can be combined with \f[C]--include\f[R] +and a pattern-list. .IP .nf \f[C] -rclone rc core/transferred +rclone copy /vol1/A remote:A +rclone copy /vol1/B remote:B \f[R] .fi .PP -If group is not provided then completed transfers for all groups will be -returned. -.PP -Note only the last 100 completed transfers are returned. -.PP -Parameters -.IP \[bu] 2 -group - name of the stats group (string) -.PP -Returns the following values: +is equivalent to: .IP .nf \f[C] -{ - \[dq]transferred\[dq]: an array of completed transfers (including failed ones): - [ - { - \[dq]name\[dq]: name of the file, - \[dq]size\[dq]: size of the file in bytes, - \[dq]bytes\[dq]: total transferred bytes for this file, - \[dq]checked\[dq]: if the transfer is only checked (skipped, deleted), - \[dq]timestamp\[dq]: integer representing millisecond unix epoch, - \[dq]error\[dq]: string description of the error (empty if successful), - \[dq]jobid\[dq]: id of the job that this transfer belongs to - } - ] -} +rclone copy /vol1 remote: --include \[dq]{A,B}/**\[dq] \f[R] .fi -.SS core/version: Shows the current version of rclone and the go runtime. -.PP -This shows the current version of go and the go runtime: -.IP \[bu] 2 -version - rclone version, e.g. -\[dq]v1.53.0\[dq] -.IP \[bu] 2 -decomposed - version number as [major, minor, patch] -.IP \[bu] 2 -isGit - boolean - true if this was compiled from the git version -.IP \[bu] 2 -isBeta - boolean - true if this is a beta version -.IP \[bu] 2 -os - OS in use as according to Go -.IP \[bu] 2 -arch - cpu architecture in use according to Go -.IP \[bu] 2 -goVersion - version of Go runtime in use -.IP \[bu] 2 -linking - type of rclone executable (static or dynamic) -.IP \[bu] 2 -goTags - space separated build tags or \[dq]none\[dq] -.SS debug/set-block-profile-rate: Set runtime.SetBlockProfileRate for blocking profiling. .PP -SetBlockProfileRate controls the fraction of goroutine blocking events -that are reported in the blocking profile. -The profiler aims to sample an average of one blocking event per rate -nanoseconds spent blocked. +E.g. +\f[C]rclone ls remote:/wheat --include \[dq]??[\[ha][:punct:]]*\[dq]\f[R] +lists the files \f[C]remote:\f[R] directory \f[C]wheat\f[R] (and +subdirectories) whose third character is not punctuation. +This example uses an ASCII character +class (https://golang.org/pkg/regexp/syntax/). +.SS \f[C]--include-from\f[R] - Read include patterns from file .PP -To include every blocking event in the profile, pass rate = 1. -To turn off profiling entirely, pass rate <= 0. +Adds path/file names to an rclone command based on rules in a named +file. +The file contains a list of remarks and pattern rules. .PP -After calling this you can use this to see the blocking profile: +For an example \f[C]include-file.txt\f[R]: .IP .nf \f[C] -go tool pprof http://localhost:5572/debug/pprof/block +# a sample include rule file +*.jpg +file2.avi \f[R] .fi .PP -Parameters: -.IP \[bu] 2 -rate - int -.SS debug/set-gc-percent: Call runtime/debug.SetGCPercent for setting the garbage collection target percentage. -.PP -SetGCPercent sets the garbage collection target percentage: a collection -is triggered when the ratio of freshly allocated data to live data -remaining after the previous collection reaches this percentage. -SetGCPercent returns the previous setting. -The initial setting is the value of the GOGC environment variable at -startup, or 100 if the variable is not set. +\f[C]rclone ls remote: --include-from include-file.txt\f[R] lists the +files on \f[C]remote:\f[R] with name \f[C]file2.avi\f[R] or suffix +\f[C].jpg\f[R]. +That is equivalent to +\f[C]rclone ls remote: --include file2.avi --include \[dq]*.jpg\[dq]\f[R]. .PP -This setting may be effectively reduced in order to maintain a memory -limit. -A negative percentage effectively disables garbage collection, unless -the memory limit is reached. +This flag can be repeated. +See above for the order filter flags are processed in. .PP -See https://pkg.go.dev/runtime/debug#SetMemoryLimit for more details. +The \f[C]--include-from\f[R] flag is useful where multiple include +filter rules are applied to an rclone command. .PP -Parameters: -.IP \[bu] 2 -gc-percent - int -.SS debug/set-mutex-profile-fraction: Set runtime.SetMutexProfileFraction for mutex profiling. -.PP -SetMutexProfileFraction controls the fraction of mutex contention events -that are reported in the mutex profile. -On average 1/rate events are reported. -The previous rate is returned. -.PP -To turn off profiling entirely, pass rate 0. -To just read the current rate, pass rate < 0. -(For n>1 the details of sampling may change.) +\f[C]--include-from\f[R] implies \f[C]--exclude **\f[R] at the end of an +rclone internal filter list. +Therefore if you mix \f[C]--include\f[R] and \f[C]--include-from\f[R] +flags with \f[C]--exclude\f[R], \f[C]--exclude-from\f[R], +\f[C]--filter\f[R] or \f[C]--filter-from\f[R], you must use include +rules for all the files you want in the include statement. +For more flexibility use the \f[C]--filter-from\f[R] flag. .PP -Once this is set you can look use this to profile the mutex contention: -.IP -.nf -\f[C] -go tool pprof http://localhost:5572/debug/pprof/mutex -\f[R] -.fi +\f[C]--exclude-from\f[R] has no effect when combined with +\f[C]--files-from\f[R] or \f[C]--files-from-raw\f[R] flags. .PP -Parameters: -.IP \[bu] 2 -rate - int +\f[C]--exclude-from\f[R] followed by \f[C]-\f[R] reads filter rules from +standard input. +.SS \f[C]--filter\f[R] - Add a file-filtering rule .PP -Results: -.IP \[bu] 2 -previousRate - int -.SS debug/set-soft-memory-limit: Call runtime/debug.SetMemoryLimit for setting a soft memory limit for the runtime. +Specifies path/file names to an rclone command, based on a single +include or exclude rule, in \f[C]+\f[R] or \f[C]-\f[R] format. .PP -SetMemoryLimit provides the runtime with a soft memory limit. +This flag can be repeated. +See above for the order filter flags are processed in. .PP -The runtime undertakes several processes to try to respect this memory -limit, including adjustments to the frequency of garbage collections and -returning memory to the underlying system more aggressively. -This limit will be respected even if GOGC=off (or, if SetGCPercent(-1) -is executed). +\f[C]--filter +\f[R] differs from \f[C]--include\f[R]. +In the case of \f[C]--include\f[R] rclone implies an +\f[C]--exclude *\f[R] rule which it adds to the bottom of the internal +rule list. +\f[C]--filter...+\f[R] does not imply that rule. .PP -The input limit is provided as bytes, and includes all memory mapped, -managed, and not released by the Go runtime. -Notably, it does not account for space used by the Go binary and memory -external to Go, such as memory managed by the underlying system on -behalf of the process, or memory managed by non-Go code inside the same -process. -Examples of excluded memory sources include: OS kernel memory held on -behalf of the process, memory allocated by C code, and memory mapped by -syscall.Mmap (because it is not managed by the Go runtime). +\f[C]--filter\f[R] has no effect when combined with +\f[C]--files-from\f[R] or \f[C]--files-from-raw\f[R] flags. .PP -A zero limit or a limit that\[aq]s lower than the amount of memory used -by the Go runtime may cause the garbage collector to run nearly -continuously. -However, the application may still make progress. +\f[C]--filter\f[R] should not be used with \f[C]--include\f[R], +\f[C]--include-from\f[R], \f[C]--exclude\f[R] or +\f[C]--exclude-from\f[R] flags. .PP -The memory limit is always respected by the Go runtime, so to -effectively disable this behavior, set the limit very high. -math.MaxInt64 is the canonical value for disabling the limit, but values -much greater than the available memory on the underlying system work -just as well. +E.g. +\f[C]rclone ls remote: --filter \[dq]- *.bak\[dq]\f[R] excludes all +\f[C].bak\f[R] files from a list of \f[C]remote:\f[R]. +.SS \f[C]--filter-from\f[R] - Read filtering patterns from a file .PP -See https://go.dev/doc/gc-guide for a detailed guide explaining the soft -memory limit in more detail, as well as a variety of common use-cases -and scenarios. +Adds path/file names to an rclone command based on rules in a named +file. +The file contains a list of remarks and pattern rules. +Include rules start with \f[C]+\f[R] and exclude rules with \f[C]-\f[R]. +\f[C]!\f[R] clears existing rules. +Rules are processed in the order they are defined. .PP -SetMemoryLimit returns the previously set memory limit. -A negative input does not adjust the limit, and allows for retrieval of -the currently set memory limit. +This flag can be repeated. +See above for the order filter flags are processed in. .PP -Parameters: -.IP \[bu] 2 -mem-limit - int -.SS fscache/clear: Clear the Fs cache. +Arrange the order of filter rules with the most restrictive first and +work down. .PP -This clears the fs cache. -This is where remotes created from backends are cached for a short while -to make repeated rc calls more efficient. +E.g. +for \f[C]filter-file.txt\f[R]: +.IP +.nf +\f[C] +# a sample filter rule file +- secret*.jpg ++ *.jpg ++ *.png ++ file2.avi +- /dir/Trash/** ++ /dir/** +# exclude everything else +- * +\f[R] +.fi .PP -If you change the parameters of a backend then you may want to call this -to clear an existing remote out of the cache before re-creating it. +\f[C]rclone ls remote: --filter-from filter-file.txt\f[R] lists the +path/files on \f[C]remote:\f[R] including all \f[C]jpg\f[R] and +\f[C]png\f[R] files, excluding any matching \f[C]secret*.jpg\f[R] and +including \f[C]file2.avi\f[R]. +It also includes everything in the directory \f[C]dir\f[R] at the root +of \f[C]remote\f[R], except \f[C]remote:dir/Trash\f[R] which it +excludes. +Everything else is excluded. .PP -\f[B]Authentication is required for this call.\f[R] -.SS fscache/entries: Returns the number of entries in the fs cache. +E.g. +for an alternative \f[C]filter-file.txt\f[R]: +.IP +.nf +\f[C] +- secret*.jpg ++ *.jpg ++ *.png ++ file2.avi +- * +\f[R] +.fi .PP -This returns the number of entries in the fs cache. +Files \f[C]file1.jpg\f[R], \f[C]file3.png\f[R] and \f[C]file2.avi\f[R] +are listed whilst \f[C]secret17.jpg\f[R] and files without the suffix +\&.jpg\f[C]or\f[R].png\[ga] are excluded. .PP -Returns - entries - number of items in the cache +E.g. +for an alternative \f[C]filter-file.txt\f[R]: +.IP +.nf +\f[C] ++ *.jpg ++ *.gif +! ++ 42.doc +- * +\f[R] +.fi .PP -\f[B]Authentication is required for this call.\f[R] -.SS job/list: Lists the IDs of the running jobs +Only file 42.doc is listed. +Prior rules are cleared by the \f[C]!\f[R]. +.SS \f[C]--files-from\f[R] - Read list of source-file names .PP -Parameters: None. +Adds path/files to an rclone command from a list in a named file. +Rclone processes the path/file names in the order of the list, and no +others. .PP -Results: -.IP \[bu] 2 -executeId - string id of rclone executing (change after restart) -.IP \[bu] 2 -jobids - array of integer job ids (starting at 1 on each restart) -.SS job/status: Reads the status of the job ID +Other filter flags (\f[C]--include\f[R], \f[C]--include-from\f[R], +\f[C]--exclude\f[R], \f[C]--exclude-from\f[R], \f[C]--filter\f[R] and +\f[C]--filter-from\f[R]) are ignored when \f[C]--files-from\f[R] is +used. .PP -Parameters: -.IP \[bu] 2 -jobid - id of the job (integer). +\f[C]--files-from\f[R] expects a list of files as its input. +Leading or trailing whitespace is stripped from the input lines. +Lines starting with \f[C]#\f[R] or \f[C];\f[R] are ignored. .PP -Results: -.IP \[bu] 2 -finished - boolean -.IP \[bu] 2 -duration - time in seconds that the job ran for -.IP \[bu] 2 -endTime - time the job finished (e.g. -\[dq]2018-10-26T18:50:20.528746884+01:00\[dq]) -.IP \[bu] 2 -error - error from the job or empty string for no error -.IP \[bu] 2 -finished - boolean whether the job has finished or not -.IP \[bu] 2 -id - as passed in above -.IP \[bu] 2 -startTime - time the job started (e.g. -\[dq]2018-10-26T18:50:20.528336039+01:00\[dq]) -.IP \[bu] 2 -success - boolean - true for success false otherwise -.IP \[bu] 2 -output - output of the job as would have been returned if called -synchronously -.IP \[bu] 2 -progress - output of the progress related to the underlying job -.SS job/stop: Stop the running job +Rclone commands with a \f[C]--files-from\f[R] flag traverse the remote, +treating the names in \f[C]--files-from\f[R] as a set of filters. .PP -Parameters: -.IP \[bu] 2 -jobid - id of the job (integer). -.SS job/stopgroup: Stop all running jobs in a group +If the \f[C]--no-traverse\f[R] and \f[C]--files-from\f[R] flags are used +together an rclone command does not traverse the remote. +Instead it addresses each path/file named in the file individually. +For each path/file name, that requires typically 1 API call. +This can be efficient for a short \f[C]--files-from\f[R] list and a +remote containing many files. .PP -Parameters: -.IP \[bu] 2 -group - name of the group (string). -.SS mount/listmounts: Show current mount points +Rclone commands do not error if any names in the \f[C]--files-from\f[R] +file are missing from the source remote. .PP -This shows currently mounted points, which can be used for performing an -unmount. +The \f[C]--files-from\f[R] flag can be repeated in a single rclone +command to read path/file names from more than one file. +The files are read from left to right along the command line. .PP -This takes no parameters and returns -.IP \[bu] 2 -mountPoints: list of current mount points +Paths within the \f[C]--files-from\f[R] file are interpreted as starting +with the root specified in the rclone command. +Leading \f[C]/\f[R] separators are ignored. +See --files-from-raw if you need the input to be processed in a raw +manner. .PP -Eg +E.g. +for a file \f[C]files-from.txt\f[R]: .IP .nf \f[C] -rclone rc mount/listmounts +# comment +file1.jpg +subdir/file2.jpg \f[R] .fi .PP -\f[B]Authentication is required for this call.\f[R] -.SS mount/mount: Create a new mount point -.PP -rclone allows Linux, FreeBSD, macOS and Windows to mount any of -Rclone\[aq]s cloud storage systems as a file system with FUSE. -.PP -If no mountType is provided, the priority is given as follows: 1. -mount 2.cmount 3.mount2 -.PP -This takes the following parameters: -.IP \[bu] 2 -fs - a remote path to be mounted (required) -.IP \[bu] 2 -mountPoint: valid path on the local machine (required) -.IP \[bu] 2 -mountType: one of the values (mount, cmount, mount2) specifies the mount -implementation to use -.IP \[bu] 2 -mountOpt: a JSON object with Mount options in. -.IP \[bu] 2 -vfsOpt: a JSON object with VFS options in. -.PP -Example: +\f[C]rclone copy --files-from files-from.txt /home/me/pics remote:pics\f[R] +copies the following, if they exist, and only those files. .IP .nf \f[C] -rclone rc mount/mount fs=mydrive: mountPoint=/home//mountPoint -rclone rc mount/mount fs=mydrive: mountPoint=/home//mountPoint mountType=mount -rclone rc mount/mount fs=TestDrive: mountPoint=/mnt/tmp vfsOpt=\[aq]{\[dq]CacheMode\[dq]: 2}\[aq] mountOpt=\[aq]{\[dq]AllowOther\[dq]: true}\[aq] +/home/me/pics/file1.jpg \[->] remote:pics/file1.jpg +/home/me/pics/subdir/file2.jpg \[->] remote:pics/subdir/file2.jpg \f[R] .fi .PP -The vfsOpt are as described in options/get and can be seen in the the -\[dq]vfs\[dq] section when running and the mountOpt can be seen in the -\[dq]mount\[dq] section: +E.g. +to copy the following files referenced by their absolute paths: .IP .nf \f[C] -rclone rc options/get +/home/user1/42 +/home/user1/dir/ford +/home/user2/prefect \f[R] .fi .PP -\f[B]Authentication is required for this call.\f[R] -.SS mount/types: Show all possible mount types -.PP -This shows all possible mount types and returns them as a list. -.PP -This takes no parameters and returns -.IP \[bu] 2 -mountTypes: list of mount types -.PP -The mount types are strings like \[dq]mount\[dq], \[dq]mount2\[dq], -\[dq]cmount\[dq] and can be passed to mount/mount as the mountType -parameter. -.PP -Eg +First find a common subdirectory - in this case \f[C]/home\f[R] and put +the remaining files in \f[C]files-from.txt\f[R] with or without leading +\f[C]/\f[R], e.g. .IP .nf \f[C] -rclone rc mount/types +user1/42 +user1/dir/ford +user2/prefect \f[R] .fi .PP -\f[B]Authentication is required for this call.\f[R] -.SS mount/unmount: Unmount selected active mount -.PP -rclone allows Linux, FreeBSD, macOS and Windows to mount any of -Rclone\[aq]s cloud storage systems as a file system with FUSE. -.PP -This takes the following parameters: -.IP \[bu] 2 -mountPoint: valid path on the local machine where the mount was created -(required) -.PP -Example: +Then copy these to a remote: .IP .nf \f[C] -rclone rc mount/unmount mountPoint=/home//mountPoint +rclone copy --files-from files-from.txt /home remote:backup \f[R] .fi .PP -\f[B]Authentication is required for this call.\f[R] -.SS mount/unmountall: Unmount all active mounts +The three files are transferred as follows: +.IP +.nf +\f[C] +/home/user1/42 \[->] remote:backup/user1/important +/home/user1/dir/ford \[->] remote:backup/user1/dir/file +/home/user2/prefect \[->] remote:backup/user2/stuff +\f[R] +.fi .PP -rclone allows Linux, FreeBSD, macOS and Windows to mount any of -Rclone\[aq]s cloud storage systems as a file system with FUSE. +Alternatively if \f[C]/\f[R] is chosen as root \f[C]files-from.txt\f[R] +will be: +.IP +.nf +\f[C] +/home/user1/42 +/home/user1/dir/ford +/home/user2/prefect +\f[R] +.fi .PP -This takes no parameters and returns error if unmount does not succeed. +The copy command will be: +.IP +.nf +\f[C] +rclone copy --files-from files-from.txt / remote:backup +\f[R] +.fi .PP -Eg +Then there will be an extra \f[C]home\f[R] directory on the remote: .IP .nf \f[C] -rclone rc mount/unmountall +/home/user1/42 \[->] remote:backup/home/user1/42 +/home/user1/dir/ford \[->] remote:backup/home/user1/dir/ford +/home/user2/prefect \[->] remote:backup/home/user2/prefect \f[R] .fi +.SS \f[C]--files-from-raw\f[R] - Read list of source-file names without any processing .PP -\f[B]Authentication is required for this call.\f[R] -.SS operations/about: Return the space used on the remote +This flag is the same as \f[C]--files-from\f[R] except that input is +read in a raw manner. +Lines with leading / trailing whitespace, and lines starting with +\f[C];\f[R] or \f[C]#\f[R] are read without any processing. +rclone lsf (https://rclone.org/commands/rclone_lsf/) has a compatible +format that can be used to export file lists from remotes for input to +\f[C]--files-from-raw\f[R]. +.SS \f[C]--ignore-case\f[R] - make searches case insensitive .PP -This takes the following parameters: +By default, rclone filter patterns are case sensitive. +The \f[C]--ignore-case\f[R] flag makes all of the filters patterns on +the command line case insensitive. +.PP +E.g. +\f[C]--include \[dq]zaphod.txt\[dq]\f[R] does not match a file +\f[C]Zaphod.txt\f[R]. +With \f[C]--ignore-case\f[R] a match is made. +.SS Quoting shell metacharacters +.PP +Rclone commands with filter patterns containing shell metacharacters may +not as work as expected in your shell and may require quoting. +.PP +E.g. +linux, OSX (\f[C]*\f[R] metacharacter) .IP \[bu] 2 -fs - a remote name string e.g. -\[dq]drive:\[dq] +\f[C]--include \[rs]*.jpg\f[R] +.IP \[bu] 2 +\f[C]--include \[aq]*.jpg\[aq]\f[R] +.IP \[bu] 2 +\f[C]--include=\[aq]*.jpg\[aq]\f[R] .PP -The result is as returned from rclone about --json +Microsoft Windows expansion is done by the command, not shell, so +\f[C]--include *.jpg\f[R] does not require quoting. .PP -See the about (https://rclone.org/commands/rclone_about/) command for -more information on the above. +If the rclone error +\f[C]Command .... needs .... arguments maximum: you provided .... non flag arguments:\f[R] +is encountered, the cause is commonly spaces within the name of a remote +or flag value. +The fix then is to quote values containing spaces. +.SS Other filters +.SS \f[C]--min-size\f[R] - Don\[aq]t transfer any file smaller than this .PP -\f[B]Authentication is required for this call.\f[R] -.SS operations/cleanup: Remove trashed files in the remote or path +Controls the minimum size file within the scope of an rclone command. +Default units are \f[C]KiB\f[R] but abbreviations \f[C]K\f[R], +\f[C]M\f[R], \f[C]G\f[R], \f[C]T\f[R] or \f[C]P\f[R] are valid. .PP -This takes the following parameters: -.IP \[bu] 2 -fs - a remote name string e.g. -\[dq]drive:\[dq] +E.g. +\f[C]rclone ls remote: --min-size 50k\f[R] lists files on +\f[C]remote:\f[R] of 50 KiB size or larger. .PP -See the cleanup (https://rclone.org/commands/rclone_cleanup/) command -for more information on the above. +See the size option docs (https://rclone.org/docs/#size-option) for more +info. +.SS \f[C]--max-size\f[R] - Don\[aq]t transfer any file larger than this .PP -\f[B]Authentication is required for this call.\f[R] -.SS operations/copyfile: Copy a file from source remote to destination remote +Controls the maximum size file within the scope of an rclone command. +Default units are \f[C]KiB\f[R] but abbreviations \f[C]K\f[R], +\f[C]M\f[R], \f[C]G\f[R], \f[C]T\f[R] or \f[C]P\f[R] are valid. .PP -This takes the following parameters: -.IP \[bu] 2 -srcFs - a remote name string e.g. -\[dq]drive:\[dq] for the source, \[dq]/\[dq] for local filesystem -.IP \[bu] 2 -srcRemote - a path within that remote e.g. -\[dq]file.txt\[dq] for the source -.IP \[bu] 2 -dstFs - a remote name string e.g. -\[dq]drive2:\[dq] for the destination, \[dq]/\[dq] for local filesystem -.IP \[bu] 2 -dstRemote - a path within that remote e.g. -\[dq]file2.txt\[dq] for the destination +E.g. +\f[C]rclone ls remote: --max-size 1G\f[R] lists files on +\f[C]remote:\f[R] of 1 GiB size or smaller. .PP -\f[B]Authentication is required for this call.\f[R] -.SS operations/copyurl: Copy the URL to the object +See the size option docs (https://rclone.org/docs/#size-option) for more +info. +.SS \f[C]--max-age\f[R] - Don\[aq]t transfer any file older than this .PP -This takes the following parameters: -.IP \[bu] 2 -fs - a remote name string e.g. -\[dq]drive:\[dq] -.IP \[bu] 2 -remote - a path within that remote e.g. -\[dq]dir\[dq] -.IP \[bu] 2 -url - string, URL to read from -.IP \[bu] 2 -autoFilename - boolean, set to true to retrieve destination file name -from url +Controls the maximum age of files within the scope of an rclone command. .PP -See the copyurl (https://rclone.org/commands/rclone_copyurl/) command -for more information on the above. +\f[C]--max-age\f[R] applies only to files and not to directories. .PP -\f[B]Authentication is required for this call.\f[R] -.SS operations/delete: Remove files in the path +E.g. +\f[C]rclone ls remote: --max-age 2d\f[R] lists files on +\f[C]remote:\f[R] of 2 days old or less. .PP -This takes the following parameters: -.IP \[bu] 2 -fs - a remote name string e.g. -\[dq]drive:\[dq] +See the time option docs (https://rclone.org/docs/#time-option) for +valid formats. +.SS \f[C]--min-age\f[R] - Don\[aq]t transfer any file younger than this .PP -See the delete (https://rclone.org/commands/rclone_delete/) command for -more information on the above. +Controls the minimum age of files within the scope of an rclone command. +(see \f[C]--max-age\f[R] for valid formats) .PP -\f[B]Authentication is required for this call.\f[R] -.SS operations/deletefile: Remove the single file pointed to +\f[C]--min-age\f[R] applies only to files and not to directories. .PP -This takes the following parameters: -.IP \[bu] 2 -fs - a remote name string e.g. -\[dq]drive:\[dq] -.IP \[bu] 2 -remote - a path within that remote e.g. -\[dq]dir\[dq] +E.g. +\f[C]rclone ls remote: --min-age 2d\f[R] lists files on +\f[C]remote:\f[R] of 2 days old or more. .PP -See the deletefile (https://rclone.org/commands/rclone_deletefile/) -command for more information on the above. +See the time option docs (https://rclone.org/docs/#time-option) for +valid formats. +.SS Other flags +.SS \f[C]--delete-excluded\f[R] - Delete files on dest excluded from sync .PP -\f[B]Authentication is required for this call.\f[R] -.SS operations/fsinfo: Return information about the remote +\f[B]Important\f[R] this flag is dangerous to your data - use with +\f[C]--dry-run\f[R] and \f[C]-v\f[R] first. .PP -This takes the following parameters: -.IP \[bu] 2 -fs - a remote name string e.g. -\[dq]drive:\[dq] +In conjunction with \f[C]rclone sync\f[R], \f[C]--delete-excluded\f[R] +deletes any files on the destination which are excluded from the +command. .PP -This returns info about the remote passed in; +E.g. +the scope of \f[C]rclone sync --interactive A: B:\f[R] can be +restricted: .IP .nf \f[C] -{ - // optional features and whether they are available or not - \[dq]Features\[dq]: { - \[dq]About\[dq]: true, - \[dq]BucketBased\[dq]: false, - \[dq]BucketBasedRootOK\[dq]: false, - \[dq]CanHaveEmptyDirectories\[dq]: true, - \[dq]CaseInsensitive\[dq]: false, - \[dq]ChangeNotify\[dq]: false, - \[dq]CleanUp\[dq]: false, - \[dq]Command\[dq]: true, - \[dq]Copy\[dq]: false, - \[dq]DirCacheFlush\[dq]: false, - \[dq]DirMove\[dq]: true, - \[dq]Disconnect\[dq]: false, - \[dq]DuplicateFiles\[dq]: false, - \[dq]GetTier\[dq]: false, - \[dq]IsLocal\[dq]: true, - \[dq]ListR\[dq]: false, - \[dq]MergeDirs\[dq]: false, - \[dq]MetadataInfo\[dq]: true, - \[dq]Move\[dq]: true, - \[dq]OpenWriterAt\[dq]: true, - \[dq]PublicLink\[dq]: false, - \[dq]Purge\[dq]: true, - \[dq]PutStream\[dq]: true, - \[dq]PutUnchecked\[dq]: false, - \[dq]ReadMetadata\[dq]: true, - \[dq]ReadMimeType\[dq]: false, - \[dq]ServerSideAcrossConfigs\[dq]: false, - \[dq]SetTier\[dq]: false, - \[dq]SetWrapper\[dq]: false, - \[dq]Shutdown\[dq]: false, - \[dq]SlowHash\[dq]: true, - \[dq]SlowModTime\[dq]: false, - \[dq]UnWrap\[dq]: false, - \[dq]UserInfo\[dq]: false, - \[dq]UserMetadata\[dq]: true, - \[dq]WrapFs\[dq]: false, - \[dq]WriteMetadata\[dq]: true, - \[dq]WriteMimeType\[dq]: false - }, - // Names of hashes available - \[dq]Hashes\[dq]: [ - \[dq]md5\[dq], - \[dq]sha1\[dq], - \[dq]whirlpool\[dq], - \[dq]crc32\[dq], - \[dq]sha256\[dq], - \[dq]dropbox\[dq], - \[dq]mailru\[dq], - \[dq]quickxor\[dq] - ], - \[dq]Name\[dq]: \[dq]local\[dq], // Name as created - \[dq]Precision\[dq]: 1, // Precision of timestamps in ns - \[dq]Root\[dq]: \[dq]/\[dq], // Path as created - \[dq]String\[dq]: \[dq]Local file system at /\[dq], // how the remote will appear in logs - // Information about the system metadata for this backend - \[dq]MetadataInfo\[dq]: { - \[dq]System\[dq]: { - \[dq]atime\[dq]: { - \[dq]Help\[dq]: \[dq]Time of last access\[dq], - \[dq]Type\[dq]: \[dq]RFC 3339\[dq], - \[dq]Example\[dq]: \[dq]2006-01-02T15:04:05.999999999Z07:00\[dq] - }, - \[dq]btime\[dq]: { - \[dq]Help\[dq]: \[dq]Time of file birth (creation)\[dq], - \[dq]Type\[dq]: \[dq]RFC 3339\[dq], - \[dq]Example\[dq]: \[dq]2006-01-02T15:04:05.999999999Z07:00\[dq] - }, - \[dq]gid\[dq]: { - \[dq]Help\[dq]: \[dq]Group ID of owner\[dq], - \[dq]Type\[dq]: \[dq]decimal number\[dq], - \[dq]Example\[dq]: \[dq]500\[dq] - }, - \[dq]mode\[dq]: { - \[dq]Help\[dq]: \[dq]File type and mode\[dq], - \[dq]Type\[dq]: \[dq]octal, unix style\[dq], - \[dq]Example\[dq]: \[dq]0100664\[dq] - }, - \[dq]mtime\[dq]: { - \[dq]Help\[dq]: \[dq]Time of last modification\[dq], - \[dq]Type\[dq]: \[dq]RFC 3339\[dq], - \[dq]Example\[dq]: \[dq]2006-01-02T15:04:05.999999999Z07:00\[dq] - }, - \[dq]rdev\[dq]: { - \[dq]Help\[dq]: \[dq]Device ID (if special file)\[dq], - \[dq]Type\[dq]: \[dq]hexadecimal\[dq], - \[dq]Example\[dq]: \[dq]1abc\[dq] - }, - \[dq]uid\[dq]: { - \[dq]Help\[dq]: \[dq]User ID of owner\[dq], - \[dq]Type\[dq]: \[dq]decimal number\[dq], - \[dq]Example\[dq]: \[dq]500\[dq] - } - }, - \[dq]Help\[dq]: \[dq]Textual help string\[rs]n\[dq] - } -} +rclone --min-size 50k --delete-excluded sync A: B: \f[R] .fi .PP -This command does not have a command line equivalent so use this -instead: +All files on \f[C]B:\f[R] which are less than 50 KiB are deleted because +they are excluded from the rclone sync command. +.SS \f[C]--dump filters\f[R] - dump the filters to the output +.PP +Dumps the defined filters to standard output in regular expression +format. +.PP +Useful for debugging. +.SS Exclude directory based on a file +.PP +The \f[C]--exclude-if-present\f[R] flag controls whether a directory is +within the scope of an rclone command based on the presence of a named +file within it. +The flag can be repeated to check for multiple file names, presence of +any of them will exclude the directory. +.PP +This flag has a priority over other filter flags. +.PP +E.g. +for the following directory structure: .IP .nf \f[C] -rclone rc --loopback operations/fsinfo fs=remote: +dir1/file1 +dir1/dir2/file2 +dir1/dir2/dir3/file3 +dir1/dir2/dir3/.ignore \f[R] .fi -.SS operations/list: List the given remote and path in JSON format .PP -This takes the following parameters: -.IP \[bu] 2 -fs - a remote name string e.g. -\[dq]drive:\[dq] -.IP \[bu] 2 -remote - a path within that remote e.g. -\[dq]dir\[dq] -.IP \[bu] 2 -opt - a dictionary of options to control the listing (optional) -.RS 2 -.IP \[bu] 2 -recurse - If set recurse directories +The command \f[C]rclone ls --exclude-if-present .ignore dir1\f[R] does +not list \f[C]dir3\f[R], \f[C]file3\f[R] or \f[C].ignore\f[R]. +.SS Metadata filters +.PP +The metadata filters work in a very similar way to the normal file name +filters, except they match metadata (https://rclone.org/docs/#metadata) +on the object. +.PP +The metadata should be specified as \f[C]key=value\f[R] patterns. +This may be wildcarded using the normal filter patterns or regular +expressions. +.PP +For example if you wished to list only local files with a mode of +\f[C]100664\f[R] you could do that with: +.IP +.nf +\f[C] +rclone lsf -M --files-only --metadata-include \[dq]mode=100664\[dq] . +\f[R] +.fi +.PP +Or if you wished to show files with an \f[C]atime\f[R], \f[C]mtime\f[R] +or \f[C]btime\f[R] at a given date: +.IP +.nf +\f[C] +rclone lsf -M --files-only --metadata-include \[dq][abm]time=2022-12-16*\[dq] . +\f[R] +.fi +.PP +Like file filtering, metadata filtering only applies to files not to +directories. +.PP +The filters can be applied using these flags. .IP \[bu] 2 -noModTime - If set return modification time +\f[C]--metadata-include\f[R] - Include metadatas matching pattern .IP \[bu] 2 -showEncrypted - If set show decrypted names +\f[C]--metadata-include-from\f[R] - Read metadata include patterns from +file (use - to read from stdin) .IP \[bu] 2 -showOrigIDs - If set show the IDs for each item if known +\f[C]--metadata-exclude\f[R] - Exclude metadatas matching pattern .IP \[bu] 2 -showHash - If set return a dictionary of hashes +\f[C]--metadata-exclude-from\f[R] - Read metadata exclude patterns from +file (use - to read from stdin) .IP \[bu] 2 -noMimeType - If set don\[aq]t show mime types +\f[C]--metadata-filter\f[R] - Add a metadata filtering rule .IP \[bu] 2 -dirsOnly - If set only show directories +\f[C]--metadata-filter-from\f[R] - Read metadata filtering patterns from +a file (use - to read from stdin) +.PP +Each flag can be repeated. +See the section on how filter rules are applied for more details - these +flags work in an identical way to the file name filtering flags, but +instead of file name patterns have metadata patterns. +.SS Common pitfalls +.PP +The most frequent filter support issues on the rclone +forum (https://forum.rclone.org/) are: .IP \[bu] 2 -filesOnly - If set only show files +Not using paths relative to the root of the remote .IP \[bu] 2 -metadata - If set return metadata of objects also +Not using \f[C]/\f[R] to match from the root of a remote .IP \[bu] 2 -hashTypes - array of strings of hash types to show if showHash set -.RE +Not using \f[C]**\f[R] to match the contents of a directory +.SH GUI (Experimental) .PP -Returns: -.IP \[bu] 2 -list -.RS 2 -.IP \[bu] 2 -This is an array of objects as described in the lsjson command -.RE +Rclone can serve a web based GUI (graphical user interface). +This is somewhat experimental at the moment so things may be subject to +change. .PP -See the lsjson (https://rclone.org/commands/rclone_lsjson/) command for -more information on the above and examples. +Run this command in a terminal and rclone will download and then display +the GUI in a web browser. +.IP +.nf +\f[C] +rclone rcd --rc-web-gui +\f[R] +.fi .PP -\f[B]Authentication is required for this call.\f[R] -.SS operations/mkdir: Make a destination directory or container +This will produce logs like this and rclone needs to continue to run to +serve the GUI: +.IP +.nf +\f[C] +2019/08/25 11:40:14 NOTICE: A new release for gui is present at https://github.com/rclone/rclone-webui-react/releases/download/v0.0.6/currentbuild.zip +2019/08/25 11:40:14 NOTICE: Downloading webgui binary. Please wait. [Size: 3813937, Path : /home/USER/.cache/rclone/webgui/v0.0.6.zip] +2019/08/25 11:40:16 NOTICE: Unzipping +2019/08/25 11:40:16 NOTICE: Serving remote control on http://127.0.0.1:5572/ +\f[R] +.fi .PP -This takes the following parameters: -.IP \[bu] 2 -fs - a remote name string e.g. -\[dq]drive:\[dq] -.IP \[bu] 2 -remote - a path within that remote e.g. -\[dq]dir\[dq] +This assumes you are running rclone locally on your machine. +It is possible to separate the rclone and the GUI - see below for +details. .PP -See the mkdir (https://rclone.org/commands/rclone_mkdir/) command for -more information on the above. +If you wish to check for updates then you can add +\f[C]--rc-web-gui-update\f[R] to the command line. .PP -\f[B]Authentication is required for this call.\f[R] -.SS operations/movefile: Move a file from source remote to destination remote +If you find your GUI broken, you may force it to update by add +\f[C]--rc-web-gui-force-update\f[R]. .PP -This takes the following parameters: +By default, rclone will open your browser. +Add \f[C]--rc-web-gui-no-open-browser\f[R] to disable this feature. +.SS Using the GUI +.PP +Once the GUI opens, you will be looking at the dashboard which has an +overall overview. +.PP +On the left hand side you will see a series of view buttons you can +click on: .IP \[bu] 2 -srcFs - a remote name string e.g. -\[dq]drive:\[dq] for the source, \[dq]/\[dq] for local filesystem +Dashboard - main overview .IP \[bu] 2 -srcRemote - a path within that remote e.g. -\[dq]file.txt\[dq] for the source +Configs - examine and create new configurations .IP \[bu] 2 -dstFs - a remote name string e.g. -\[dq]drive2:\[dq] for the destination, \[dq]/\[dq] for local filesystem +Explorer - view, download and upload files to the cloud storage systems .IP \[bu] 2 -dstRemote - a path within that remote e.g. -\[dq]file2.txt\[dq] for the destination +Backend - view or alter the backend config +.IP \[bu] 2 +Log out .PP -\f[B]Authentication is required for this call.\f[R] -.SS operations/publiclink: Create or retrieve a public link to the given file or folder. +(More docs and walkthrough video to come!) +.SS How it works .PP -This takes the following parameters: +When you run the \f[C]rclone rcd --rc-web-gui\f[R] this is what happens .IP \[bu] 2 -fs - a remote name string e.g. -\[dq]drive:\[dq] +Rclone starts but only runs the remote control API (\[dq]rc\[dq]). .IP \[bu] 2 -remote - a path within that remote e.g. -\[dq]dir\[dq] +The API is bound to localhost with an auto-generated username and +password. .IP \[bu] 2 -unlink - boolean - if set removes the link rather than adding it -(optional) +If the API bundle is missing then rclone will download it. .IP \[bu] 2 -expire - string - the expiry time of the link e.g. -\[dq]1d\[dq] (optional) -.PP -Returns: +rclone will start serving the files from the API bundle over the same +port as the API .IP \[bu] 2 -url - URL of the resource -.PP -See the link (https://rclone.org/commands/rclone_link/) command for more -information on the above. +rclone will open the browser with a \f[C]login_token\f[R] so it can log +straight in. +.SS Advanced use .PP -\f[B]Authentication is required for this call.\f[R] -.SS operations/purge: Remove a directory or container and all of its contents +The \f[C]rclone rcd\f[R] may use any of the flags documented on the rc +page (https://rclone.org/rc/#supported-parameters). .PP -This takes the following parameters: +The flag \f[C]--rc-web-gui\f[R] is shorthand for .IP \[bu] 2 -fs - a remote name string e.g. -\[dq]drive:\[dq] +Download the web GUI if necessary .IP \[bu] 2 -remote - a path within that remote e.g. -\[dq]dir\[dq] -.PP -See the purge (https://rclone.org/commands/rclone_purge/) command for -more information on the above. -.PP -\f[B]Authentication is required for this call.\f[R] -.SS operations/rmdir: Remove an empty directory or container -.PP -This takes the following parameters: +Check we are using some authentication .IP \[bu] 2 -fs - a remote name string e.g. -\[dq]drive:\[dq] +\f[C]--rc-user gui\f[R] .IP \[bu] 2 -remote - a path within that remote e.g. -\[dq]dir\[dq] +\f[C]--rc-pass \f[R] +.IP \[bu] 2 +\f[C]--rc-serve\f[R] .PP -See the rmdir (https://rclone.org/commands/rclone_rmdir/) command for -more information on the above. +These flags can be overridden as desired. .PP -\f[B]Authentication is required for this call.\f[R] -.SS operations/rmdirs: Remove all the empty directories in the path +See also the rclone rcd +documentation (https://rclone.org/commands/rclone_rcd/). +.SS Example: Running a public GUI .PP -This takes the following parameters: +For example the GUI could be served on a public port over SSL using an +htpasswd file using the following flags: .IP \[bu] 2 -fs - a remote name string e.g. -\[dq]drive:\[dq] +\f[C]--rc-web-gui\f[R] .IP \[bu] 2 -remote - a path within that remote e.g. -\[dq]dir\[dq] +\f[C]--rc-addr :443\f[R] .IP \[bu] 2 -leaveRoot - boolean, set to true not to delete the root -.PP -See the rmdirs (https://rclone.org/commands/rclone_rmdirs/) command for -more information on the above. -.PP -\f[B]Authentication is required for this call.\f[R] -.SS operations/settier: Changes storage tier or class on all files in the path -.PP -This takes the following parameters: +\f[C]--rc-htpasswd /path/to/htpasswd\f[R] .IP \[bu] 2 -fs - a remote name string e.g. -\[dq]drive:\[dq] -.PP -See the settier (https://rclone.org/commands/rclone_settier/) command -for more information on the above. -.PP -\f[B]Authentication is required for this call.\f[R] -.SS operations/settierfile: Changes storage tier or class on the single file pointed to +\f[C]--rc-cert /path/to/ssl.crt\f[R] +.IP \[bu] 2 +\f[C]--rc-key /path/to/ssl.key\f[R] +.SS Example: Running a GUI behind a proxy .PP -This takes the following parameters: +If you want to run the GUI behind a proxy at \f[C]/rclone\f[R] you could +use these flags: .IP \[bu] 2 -fs - a remote name string e.g. -\[dq]drive:\[dq] +\f[C]--rc-web-gui\f[R] .IP \[bu] 2 -remote - a path within that remote e.g. -\[dq]dir\[dq] -.PP -See the settierfile (https://rclone.org/commands/rclone_settierfile/) -command for more information on the above. -.PP -\f[B]Authentication is required for this call.\f[R] -.SS operations/size: Count the number of bytes and files in remote -.PP -This takes the following parameters: +\f[C]--rc-baseurl rclone\f[R] .IP \[bu] 2 -fs - a remote name string e.g. -\[dq]drive:path/to/dir\[dq] +\f[C]--rc-htpasswd /path/to/htpasswd\f[R] .PP -Returns: +Or instead of htpasswd if you just want a single user and password: .IP \[bu] 2 -count - number of files +\f[C]--rc-user me\f[R] .IP \[bu] 2 -bytes - number of bytes in those files +\f[C]--rc-pass mypassword\f[R] +.SS Project .PP -See the size (https://rclone.org/commands/rclone_size/) command for more -information on the above. +The GUI is being developed in the: rclone/rclone-webui-react +repository (https://github.com/rclone/rclone-webui-react). .PP -\f[B]Authentication is required for this call.\f[R] -.SS operations/stat: Give information about the supplied file or directory +Bug reports and contributions are very welcome :-) .PP -This takes the following parameters -.IP \[bu] 2 -fs - a remote name string eg \[dq]drive:\[dq] -.IP \[bu] 2 -remote - a path within that remote eg \[dq]dir\[dq] -.IP \[bu] 2 -opt - a dictionary of options to control the listing (optional) -.RS 2 -.IP \[bu] 2 -see operations/list for the options -.RE +If you have questions then please ask them on the rclone +forum (https://forum.rclone.org/). +.SH Remote controlling rclone with its API .PP -The result is -.IP \[bu] 2 -item - an object as described in the lsjson command. -Will be null if not found. +If rclone is run with the \f[C]--rc\f[R] flag then it starts an HTTP +server which can be used to remote control rclone using its API. .PP -Note that if you are only interested in files then it is much more -efficient to set the filesOnly flag in the options. +You can either use the rc command to access the API or use HTTP +directly. .PP -See the lsjson (https://rclone.org/commands/rclone_lsjson/) command for -more information on the above and examples. +If you just want to run a remote control then see the +rcd (https://rclone.org/commands/rclone_rcd/) command. +.SS Supported parameters +.SS --rc .PP -\f[B]Authentication is required for this call.\f[R] -.SS operations/uploadfile: Upload file using multiform/form-data +Flag to start the http server listen on remote requests +.SS --rc-addr=IP .PP -This takes the following parameters: -.IP \[bu] 2 -fs - a remote name string e.g. -\[dq]drive:\[dq] -.IP \[bu] 2 -remote - a path within that remote e.g. -\[dq]dir\[dq] -.IP \[bu] 2 -each part in body represents a file to be uploaded +IPaddress:Port or :Port to bind server to. +(default \[dq]localhost:5572\[dq]) +.SS --rc-cert=KEY .PP -See the uploadfile (https://rclone.org/commands/rclone_uploadfile/) -command for more information on the above. +SSL PEM key (concatenation of certificate and CA certificate) +.SS --rc-client-ca=PATH .PP -\f[B]Authentication is required for this call.\f[R] -.SS options/blocks: List all the option blocks +Client certificate authority to verify clients with +.SS --rc-htpasswd=PATH .PP -Returns: - options - a list of the options block names -.SS options/get: Get all the global options +htpasswd file - if not provided no authentication is done +.SS --rc-key=PATH .PP -Returns an object where keys are option block names and values are an -object with the current option values in. +SSL PEM Private key +.SS --rc-max-header-bytes=VALUE .PP -Note that these are the global options which are unaffected by use of -the _config and _filter parameters. -If you wish to read the parameters set in _config then use -options/config and for _filter use options/filter. +Maximum size of request header (default 4096) +.SS --rc-min-tls-version=VALUE .PP -This shows the internal names of the option within rclone which should -map to the external options very easily with a few exceptions. -.SS options/local: Get the currently active config for this call +The minimum TLS version that is acceptable. +Valid values are \[dq]tls1.0\[dq], \[dq]tls1.1\[dq], \[dq]tls1.2\[dq] +and \[dq]tls1.3\[dq] (default \[dq]tls1.0\[dq]). +.SS --rc-user=VALUE .PP -Returns an object with the keys \[dq]config\[dq] and \[dq]filter\[dq]. -The \[dq]config\[dq] key contains the local config and the -\[dq]filter\[dq] key contains the local filters. +User name for authentication. +.SS --rc-pass=VALUE .PP -Note that these are the local options specific to this rc call. -If _config was not supplied then they will be the global options. -Likewise with \[dq]_filter\[dq]. +Password for authentication. +.SS --rc-realm=VALUE .PP -This call is mostly useful for seeing if _config and _filter passing is -working. +Realm for authentication (default \[dq]rclone\[dq]) +.SS --rc-server-read-timeout=DURATION .PP -This shows the internal names of the option within rclone which should -map to the external options very easily with a few exceptions. -.SS options/set: Set an option +Timeout for server reading data (default 1h0m0s) +.SS --rc-server-write-timeout=DURATION .PP -Parameters: -.IP \[bu] 2 -option block name containing an object with -.RS 2 -.IP \[bu] 2 -key: value -.RE -.PP -Repeated as often as required. -.PP -Only supply the options you wish to change. -If an option is unknown it will be silently ignored. -Not all options will have an effect when changed like this. -.PP -For example: +Timeout for server writing data (default 1h0m0s) +.SS --rc-serve .PP -This sets DEBUG level logs (-vv) (these can be set by number or string) -.IP -.nf -\f[C] -rclone rc options/set --json \[aq]{\[dq]main\[dq]: {\[dq]LogLevel\[dq]: \[dq]DEBUG\[dq]}}\[aq] -rclone rc options/set --json \[aq]{\[dq]main\[dq]: {\[dq]LogLevel\[dq]: 8}}\[aq] -\f[R] -.fi +Enable the serving of remote objects via the HTTP interface. +This means objects will be accessible at http://127.0.0.1:5572/ by +default, so you can browse to http://127.0.0.1:5572/ or +http://127.0.0.1:5572/* to see a listing of the remotes. +Objects may be requested from remotes using this syntax +http://127.0.0.1:5572/[remote:path]/path/to/object .PP -And this sets INFO level logs (-v) -.IP -.nf -\f[C] -rclone rc options/set --json \[aq]{\[dq]main\[dq]: {\[dq]LogLevel\[dq]: \[dq]INFO\[dq]}}\[aq] -\f[R] -.fi +Default Off. +.SS --rc-files /path/to/directory .PP -And this sets NOTICE level logs (normal without -v) -.IP -.nf -\f[C] -rclone rc options/set --json \[aq]{\[dq]main\[dq]: {\[dq]LogLevel\[dq]: \[dq]NOTICE\[dq]}}\[aq] -\f[R] -.fi -.SS pluginsctl/addPlugin: Add a plugin using url +Path to local files to serve on the HTTP server. .PP -Used for adding a plugin to the webgui. +If this is set then rclone will serve the files in that directory. +It will also open the root in the web browser if specified. +This is for implementing browser based GUIs for rclone functions. .PP -This takes the following parameters: -.IP \[bu] 2 -url - http url of the github repo where the plugin is hosted -(http://github.com/rclone/rclone-webui-react). +If \f[C]--rc-user\f[R] or \f[C]--rc-pass\f[R] is set then the URL that +is opened will have the authorization in the URL in the +\f[C]http://user:pass\[at]localhost/\f[R] style. .PP -Example: +Default Off. +.SS --rc-enable-metrics .PP -rclone rc pluginsctl/addPlugin +Enable OpenMetrics/Prometheus compatible endpoint at \f[C]/metrics\f[R]. .PP -\f[B]Authentication is required for this call.\f[R] -.SS pluginsctl/getPluginsForType: Get plugins with type criteria +Default Off. +.SS --rc-web-gui .PP -This shows all possible plugins by a mime type. +Set this flag to serve the default web gui on the same port as rclone. .PP -This takes the following parameters: -.IP \[bu] 2 -type - supported mime type by a loaded plugin e.g. -(video/mp4, audio/mp3). -.IP \[bu] 2 -pluginType - filter plugins based on their type e.g. -(DASHBOARD, FILE_HANDLER, TERMINAL). +Default Off. +.SS --rc-allow-origin .PP -Returns: -.IP \[bu] 2 -loadedPlugins - list of current production plugins. -.IP \[bu] 2 -testPlugins - list of temporarily loaded development plugins, usually -running on a different server. +Set the allowed Access-Control-Allow-Origin for rc requests. .PP -Example: +Can be used with --rc-web-gui if the rclone is running on different IP +than the web-gui. .PP -rclone rc pluginsctl/getPluginsForType type=video/mp4 +Default is IP address on which rc is running. +.SS --rc-web-fetch-url .PP -\f[B]Authentication is required for this call.\f[R] -.SS pluginsctl/listPlugins: Get the list of currently loaded plugins +Set the URL to fetch the rclone-web-gui files from. .PP -This allows you to get the currently enabled plugins and their details. +Default +https://api.github.com/repos/rclone/rclone-webui-react/releases/latest. +.SS --rc-web-gui-update .PP -This takes no parameters and returns: -.IP \[bu] 2 -loadedPlugins - list of current production plugins. -.IP \[bu] 2 -testPlugins - list of temporarily loaded development plugins, usually -running on a different server. +Set this flag to check and update rclone-webui-react from the +rc-web-fetch-url. .PP -E.g. +Default Off. +.SS --rc-web-gui-force-update .PP -rclone rc pluginsctl/listPlugins +Set this flag to force update rclone-webui-react from the +rc-web-fetch-url. .PP -\f[B]Authentication is required for this call.\f[R] -.SS pluginsctl/listTestPlugins: Show currently loaded test plugins +Default Off. +.SS --rc-web-gui-no-open-browser .PP -Allows listing of test plugins with the rclone.test set to true in -package.json of the plugin. +Set this flag to disable opening browser automatically when using +web-gui. .PP -This takes no parameters and returns: -.IP \[bu] 2 -loadedTestPlugins - list of currently available test plugins. +Default Off. +.SS --rc-job-expire-duration=DURATION .PP -E.g. -.IP -.nf -\f[C] -rclone rc pluginsctl/listTestPlugins -\f[R] -.fi +Expire finished async jobs older than DURATION (default 60s). +.SS --rc-job-expire-interval=DURATION .PP -\f[B]Authentication is required for this call.\f[R] -.SS pluginsctl/removePlugin: Remove a loaded plugin +Interval duration to check for expired async jobs (default 10s). +.SS --rc-no-auth .PP -This allows you to remove a plugin using it\[aq]s name. +By default rclone will require authorisation to have been set up on the +rc interface in order to use any methods which access any rclone +remotes. +Eg \f[C]operations/list\f[R] is denied as it involved creating a remote +as is \f[C]sync/copy\f[R]. .PP -This takes parameters: -.IP \[bu] 2 -name - name of the plugin in the format -\f[C]author\f[R]/\f[C]plugin_name\f[R]. +If this is set then no authorisation will be required on the server to +use these methods. +The alternative is to use \f[C]--rc-user\f[R] and \f[C]--rc-pass\f[R] +and use these credentials in the request. .PP -E.g. +Default Off. +.SS --rc-baseurl .PP -rclone rc pluginsctl/removePlugin name=rclone/video-plugin +Prefix for URLs. .PP -\f[B]Authentication is required for this call.\f[R] -.SS pluginsctl/removeTestPlugin: Remove a test plugin +Default is root +.SS --rc-template .PP -This allows you to remove a plugin using it\[aq]s name. +User-specified template. +.SS Accessing the remote control via the rclone rc command .PP -This takes the following parameters: -.IP \[bu] 2 -name - name of the plugin in the format -\f[C]author\f[R]/\f[C]plugin_name\f[R]. +Rclone itself implements the remote control protocol in its +\f[C]rclone rc\f[R] command. .PP -Example: +You can use it like this .IP .nf \f[C] -rclone rc pluginsctl/removeTestPlugin name=rclone/rclone-webui-react +$ rclone rc rc/noop param1=one param2=two +{ + \[dq]param1\[dq]: \[dq]one\[dq], + \[dq]param2\[dq]: \[dq]two\[dq] +} \f[R] .fi .PP -\f[B]Authentication is required for this call.\f[R] -.SS rc/error: This returns an error -.PP -This returns an error with the input as part of its error string. -Useful for testing error handling. -.SS rc/list: List all the registered remote control commands -.PP -This lists all the registered remote control commands as a JSON map in -the commands response. -.SS rc/noop: Echo the input to the output parameters -.PP -This echoes the input parameters to the output parameters for testing -purposes. -It can be used to check that rclone is still alive and to check that -parameter passing is working properly. -.SS rc/noopauth: Echo the input to the output parameters requiring auth -.PP -This echoes the input parameters to the output parameters for testing -purposes. -It can be used to check that rclone is still alive and to check that -parameter passing is working properly. -.PP -\f[B]Authentication is required for this call.\f[R] -.SS sync/bisync: Perform bidirectional synchronization between two paths. -.PP -This takes the following parameters -.IP \[bu] 2 -path1 - a remote directory string e.g. -\f[C]drive:path1\f[R] -.IP \[bu] 2 -path2 - a remote directory string e.g. -\f[C]drive:path2\f[R] -.IP \[bu] 2 -dryRun - dry-run mode -.IP \[bu] 2 -resync - performs the resync run -.IP \[bu] 2 -checkAccess - abort if RCLONE_TEST files are not found on both -filesystems -.IP \[bu] 2 -checkFilename - file name for checkAccess (default: RCLONE_TEST) -.IP \[bu] 2 -maxDelete - abort sync if percentage of deleted files is above this -threshold (default: 50) -.IP \[bu] 2 -force - Bypass maxDelete safety check and run the sync -.IP \[bu] 2 -checkSync - \f[C]true\f[R] by default, \f[C]false\f[R] disables -comparison of final listings, \f[C]only\f[R] will skip sync, only -compare listings from the last run -.IP \[bu] 2 -createEmptySrcDirs - Sync creation and deletion of empty directories. -(Not compatible with --remove-empty-dirs) -.IP \[bu] 2 -removeEmptyDirs - remove empty directories at the final cleanup step -.IP \[bu] 2 -filtersFile - read filtering patterns from a file -.IP \[bu] 2 -ignoreListingChecksum - Do not use checksums for listings -.IP \[bu] 2 -resilient - Allow future runs to retry after certain less-serious -errors, instead of requiring resync. -Use at your own risk! -.IP \[bu] 2 -workdir - server directory for history files (default: -/home/ncw/.cache/rclone/bisync) -.IP \[bu] 2 -noCleanup - retain working files -.PP -See bisync command help (https://rclone.org/commands/rclone_bisync/) and -full bisync description (https://rclone.org/bisync/) for more -information. -.PP -\f[B]Authentication is required for this call.\f[R] -.SS sync/copy: copy a directory from source remote to destination remote -.PP -This takes the following parameters: -.IP \[bu] 2 -srcFs - a remote name string e.g. -\[dq]drive:src\[dq] for the source -.IP \[bu] 2 -dstFs - a remote name string e.g. -\[dq]drive:dst\[dq] for the destination -.IP \[bu] 2 -createEmptySrcDirs - create empty src directories on destination if set -.PP -See the copy (https://rclone.org/commands/rclone_copy/) command for more -information on the above. -.PP -\f[B]Authentication is required for this call.\f[R] -.SS sync/move: move a directory from source remote to destination remote +Run \f[C]rclone rc\f[R] on its own to see the help for the installed +remote control commands. +.SS JSON input .PP -This takes the following parameters: -.IP \[bu] 2 -srcFs - a remote name string e.g. -\[dq]drive:src\[dq] for the source -.IP \[bu] 2 -dstFs - a remote name string e.g. -\[dq]drive:dst\[dq] for the destination -.IP \[bu] 2 -createEmptySrcDirs - create empty src directories on destination if set -.IP \[bu] 2 -deleteEmptySrcDirs - delete empty src directories if set +\f[C]rclone rc\f[R] also supports a \f[C]--json\f[R] flag which can be +used to send more complicated input parameters. +.IP +.nf +\f[C] +$ rclone rc --json \[aq]{ \[dq]p1\[dq]: [1,\[dq]2\[dq],null,4], \[dq]p2\[dq]: { \[dq]a\[dq]:1, \[dq]b\[dq]:2 } }\[aq] rc/noop +{ + \[dq]p1\[dq]: [ + 1, + \[dq]2\[dq], + null, + 4 + ], + \[dq]p2\[dq]: { + \[dq]a\[dq]: 1, + \[dq]b\[dq]: 2 + } +} +\f[R] +.fi .PP -See the move (https://rclone.org/commands/rclone_move/) command for more -information on the above. +If the parameter being passed is an object then it can be passed as a +JSON string rather than using the \f[C]--json\f[R] flag which simplifies +the command line. +.IP +.nf +\f[C] +rclone rc operations/list fs=/tmp remote=test opt=\[aq]{\[dq]showHash\[dq]: true}\[aq] +\f[R] +.fi .PP -\f[B]Authentication is required for this call.\f[R] -.SS sync/sync: sync a directory from source remote to destination remote +Rather than +.IP +.nf +\f[C] +rclone rc operations/list --json \[aq]{\[dq]fs\[dq]: \[dq]/tmp\[dq], \[dq]remote\[dq]: \[dq]test\[dq], \[dq]opt\[dq]: {\[dq]showHash\[dq]: true}}\[aq] +\f[R] +.fi +.SS Special parameters .PP -This takes the following parameters: -.IP \[bu] 2 -srcFs - a remote name string e.g. -\[dq]drive:src\[dq] for the source -.IP \[bu] 2 -dstFs - a remote name string e.g. -\[dq]drive:dst\[dq] for the destination -.IP \[bu] 2 -createEmptySrcDirs - create empty src directories on destination if set +The rc interface supports some special parameters which apply to +\f[B]all\f[R] commands. +These start with \f[C]_\f[R] to show they are different. +.SS Running asynchronous jobs with _async = true .PP -See the sync (https://rclone.org/commands/rclone_sync/) command for more -information on the above. +Each rc call is classified as a job and it is assigned its own id. +By default jobs are executed immediately as they are created or +synchronously. .PP -\f[B]Authentication is required for this call.\f[R] -.SS vfs/forget: Forget files or directories in the directory cache. +If \f[C]_async\f[R] has a true value when supplied to an rc call then it +will return immediately with a job id and the task will be run in the +background. +The \f[C]job/status\f[R] call can be used to get information of the +background job. +The job can be queried for up to 1 minute after it has finished. .PP -This forgets the paths in the directory cache causing them to be re-read -from the remote when needed. +It is recommended that potentially long running jobs, e.g. +\f[C]sync/sync\f[R], \f[C]sync/copy\f[R], \f[C]sync/move\f[R], +\f[C]operations/purge\f[R] are run with the \f[C]_async\f[R] flag to +avoid any potential problems with the HTTP request and response timing +out. .PP -If no paths are passed in then it will forget all the paths in the -directory cache. +Starting a job with the \f[C]_async\f[R] flag: .IP .nf \f[C] -rclone rc vfs/forget +$ rclone rc --json \[aq]{ \[dq]p1\[dq]: [1,\[dq]2\[dq],null,4], \[dq]p2\[dq]: { \[dq]a\[dq]:1, \[dq]b\[dq]:2 }, \[dq]_async\[dq]: true }\[aq] rc/noop +{ + \[dq]jobid\[dq]: 2 +} \f[R] .fi .PP -Otherwise pass files or dirs in as file=path or dir=path. -Any parameter key starting with file will forget that file and any -starting with dir will forget that dir, e.g. +Query the status to see if the job has finished. +For more information on the meaning of these return parameters see the +\f[C]job/status\f[R] call. .IP .nf \f[C] -rclone rc vfs/forget file=hello file2=goodbye dir=home/junk +$ rclone rc --json \[aq]{ \[dq]jobid\[dq]:2 }\[aq] job/status +{ + \[dq]duration\[dq]: 0.000124163, + \[dq]endTime\[dq]: \[dq]2018-10-27T11:38:07.911245881+01:00\[dq], + \[dq]error\[dq]: \[dq]\[dq], + \[dq]finished\[dq]: true, + \[dq]id\[dq]: 2, + \[dq]output\[dq]: { + \[dq]_async\[dq]: true, + \[dq]p1\[dq]: [ + 1, + \[dq]2\[dq], + null, + 4 + ], + \[dq]p2\[dq]: { + \[dq]a\[dq]: 1, + \[dq]b\[dq]: 2 + } + }, + \[dq]startTime\[dq]: \[dq]2018-10-27T11:38:07.911121728+01:00\[dq], + \[dq]success\[dq]: true +} \f[R] .fi .PP -This command takes an \[dq]fs\[dq] parameter. -If this parameter is not supplied and if there is only one VFS in use -then that VFS will be used. -If there is more than one VFS in use then the \[dq]fs\[dq] parameter -must be supplied. -.SS vfs/list: List active VFSes. +\f[C]job/list\f[R] can be used to show the running or recently completed +jobs +.IP +.nf +\f[C] +$ rclone rc job/list +{ + \[dq]jobids\[dq]: [ + 2 + ] +} +\f[R] +.fi +.SS Setting config flags with _config .PP -This lists the active VFSes. +If you wish to set config (the equivalent of the global flags) for the +duration of an rc call only then pass in the \f[C]_config\f[R] +parameter. .PP -It returns a list under the key \[dq]vfses\[dq] where the values are the -VFS names that could be passed to the other VFS commands in the -\[dq]fs\[dq] parameter. -.SS vfs/poll-interval: Get the status or update the value of the poll-interval option. +This should be in the same format as the \f[C]config\f[R] key returned +by options/get. .PP -Without any parameter given this returns the current status of the -poll-interval setting. +For example, if you wished to run a sync with the \f[C]--checksum\f[R] +parameter, you would pass this parameter in your JSON blob. +.IP +.nf +\f[C] +\[dq]_config\[dq]:{\[dq]CheckSum\[dq]: true} +\f[R] +.fi .PP -When the interval=duration parameter is set, the poll-interval value is -updated and the polling function is notified. -Setting interval=0 disables poll-interval. +If using \f[C]rclone rc\f[R] this could be passed as .IP .nf \f[C] -rclone rc vfs/poll-interval interval=5m +rclone rc sync/sync ... _config=\[aq]{\[dq]CheckSum\[dq]: true}\[aq] \f[R] .fi .PP -The timeout=duration parameter can be used to specify a time to wait for -the current poll function to apply the new value. -If timeout is less or equal 0, which is the default, wait indefinitely. +Any config parameters you don\[aq]t set will inherit the global defaults +which were set with command line flags or environment variables. .PP -The new poll-interval value will only be active when the timeout is not -reached. +Note that it is possible to set some values as strings or integers - see +data types for more info. +Here is an example setting the equivalent of \f[C]--buffer-size\f[R] in +string or integer format. +.IP +.nf +\f[C] +\[dq]_config\[dq]:{\[dq]BufferSize\[dq]: \[dq]42M\[dq]} +\[dq]_config\[dq]:{\[dq]BufferSize\[dq]: 44040192} +\f[R] +.fi .PP -If poll-interval is updated or disabled temporarily, some changes might -not get picked up by the polling function, depending on the used remote. +If you wish to check the \f[C]_config\f[R] assignment has worked +properly then calling \f[C]options/local\f[R] will show what the value +got set to. +.SS Setting filter flags with _filter .PP -This command takes an \[dq]fs\[dq] parameter. -If this parameter is not supplied and if there is only one VFS in use -then that VFS will be used. -If there is more than one VFS in use then the \[dq]fs\[dq] parameter -must be supplied. -.SS vfs/refresh: Refresh the directory cache. +If you wish to set filters for the duration of an rc call only then pass +in the \f[C]_filter\f[R] parameter. .PP -This reads the directories for the specified paths and freshens the -directory cache. +This should be in the same format as the \f[C]filter\f[R] key returned +by options/get. .PP -If no paths are passed in then it will refresh the root directory. +For example, if you wished to run a sync with these flags .IP .nf \f[C] -rclone rc vfs/refresh +--max-size 1M --max-age 42s --include \[dq]a\[dq] --include \[dq]b\[dq] \f[R] .fi .PP -Otherwise pass directories in as dir=path. -Any parameter key starting with dir will refresh that directory, e.g. +you would pass this parameter in your JSON blob. .IP .nf \f[C] -rclone rc vfs/refresh dir=home/junk dir2=data/misc +\[dq]_filter\[dq]:{\[dq]MaxSize\[dq]:\[dq]1M\[dq], \[dq]IncludeRule\[dq]:[\[dq]a\[dq],\[dq]b\[dq]], \[dq]MaxAge\[dq]:\[dq]42s\[dq]} \f[R] .fi .PP -If the parameter recursive=true is given the whole directory tree will -get refreshed. -This refresh will use --fast-list if enabled. +If using \f[C]rclone rc\f[R] this could be passed as +.IP +.nf +\f[C] +rclone rc ... _filter=\[aq]{\[dq]MaxSize\[dq]:\[dq]1M\[dq], \[dq]IncludeRule\[dq]:[\[dq]a\[dq],\[dq]b\[dq]], \[dq]MaxAge\[dq]:\[dq]42s\[dq]}\[aq] +\f[R] +.fi .PP -This command takes an \[dq]fs\[dq] parameter. -If this parameter is not supplied and if there is only one VFS in use -then that VFS will be used. -If there is more than one VFS in use then the \[dq]fs\[dq] parameter -must be supplied. -.SS vfs/stats: Stats for a VFS. +Any filter parameters you don\[aq]t set will inherit the global defaults +which were set with command line flags or environment variables. .PP -This returns stats for the selected VFS. +Note that it is possible to set some values as strings or integers - see +data types for more info. +Here is an example setting the equivalent of \f[C]--buffer-size\f[R] in +string or integer format. .IP .nf \f[C] -{ - // Status of the disk cache - only present if --vfs-cache-mode > off - \[dq]diskCache\[dq]: { - \[dq]bytesUsed\[dq]: 0, - \[dq]erroredFiles\[dq]: 0, - \[dq]files\[dq]: 0, - \[dq]hashType\[dq]: 1, - \[dq]outOfSpace\[dq]: false, - \[dq]path\[dq]: \[dq]/home/user/.cache/rclone/vfs/local/mnt/a\[dq], - \[dq]pathMeta\[dq]: \[dq]/home/user/.cache/rclone/vfsMeta/local/mnt/a\[dq], - \[dq]uploadsInProgress\[dq]: 0, - \[dq]uploadsQueued\[dq]: 0 - }, - \[dq]fs\[dq]: \[dq]/mnt/a\[dq], - \[dq]inUse\[dq]: 1, - // Status of the in memory metadata cache - \[dq]metadataCache\[dq]: { - \[dq]dirs\[dq]: 1, - \[dq]files\[dq]: 0 - }, - // Options as returned by options/get - \[dq]opt\[dq]: { - \[dq]CacheMaxAge\[dq]: 3600000000000, - // ... - \[dq]WriteWait\[dq]: 1000000000 - } -} +\[dq]_filter\[dq]:{\[dq]MinSize\[dq]: \[dq]42M\[dq]} +\[dq]_filter\[dq]:{\[dq]MinSize\[dq]: 44040192} \f[R] .fi .PP -This command takes an \[dq]fs\[dq] parameter. -If this parameter is not supplied and if there is only one VFS in use -then that VFS will be used. -If there is more than one VFS in use then the \[dq]fs\[dq] parameter -must be supplied. -.SS Accessing the remote control via HTTP -.PP -Rclone implements a simple HTTP based protocol. -.PP -Each endpoint takes an JSON object and returns a JSON object or an -error. -The JSON objects are essentially a map of string names to values. -.PP -All calls must made using POST. +If you wish to check the \f[C]_filter\f[R] assignment has worked +properly then calling \f[C]options/local\f[R] will show what the value +got set to. +.SS Assigning operations to groups with _group = value .PP -The input objects can be supplied using URL parameters, POST parameters -or by supplying \[dq]Content-Type: application/json\[dq] and a JSON blob -in the body. -There are examples of these below using \f[C]curl\f[R]. +Each rc call has its own stats group for tracking its metrics. +By default grouping is done by the composite group name from prefix +\f[C]job/\f[R] and id of the job like so \f[C]job/1\f[R]. .PP -The response will be a JSON blob in the body of the response. -This is formatted to be reasonably human-readable. -.SS Error returns +If \f[C]_group\f[R] has a value then stats for that request will be +grouped under that value. +This allows caller to group stats under their own name. .PP -If an error occurs then there will be an HTTP error status (e.g. -500) and the body of the response will contain a JSON encoded error -object, e.g. +Stats for specific group can be accessed by passing \f[C]group\f[R] to +\f[C]core/stats\f[R]: .IP .nf \f[C] +$ rclone rc --json \[aq]{ \[dq]group\[dq]: \[dq]job/1\[dq] }\[aq] core/stats { - \[dq]error\[dq]: \[dq]Expecting string value for key \[rs]\[dq]remote\[rs]\[dq] (was float64)\[dq], - \[dq]input\[dq]: { - \[dq]fs\[dq]: \[dq]/tmp\[dq], - \[dq]remote\[dq]: 3 - }, - \[dq]status\[dq]: 400 - \[dq]path\[dq]: \[dq]operations/rmdir\[dq], + \[dq]speed\[dq]: 12345 + ... } \f[R] .fi +.SS Data types .PP -The keys in the error response are - error - error string - input - the -input parameters to the call - status - the HTTP status code - path - -the path of the call -.SS CORS +When the API returns types, these will mostly be straight forward +integer, string or boolean types. .PP -The sever implements basic CORS support and allows all origins for that. -The response to a preflight OPTIONS request will echo the requested -\[dq]Access-Control-Request-Headers\[dq] back. -.SS Using POST with URL parameters only -.IP -.nf -\f[C] -curl -X POST \[aq]http://localhost:5572/rc/noop?potato=1&sausage=2\[aq] -\f[R] -.fi +However some of the types returned by the options/get call and taken by +the options/set calls as well as the \f[C]vfsOpt\f[R], +\f[C]mountOpt\f[R] and the \f[C]_config\f[R] parameters. +.IP \[bu] 2 +\f[C]Duration\f[R] - these are returned as an integer duration in +nanoseconds. +They may be set as an integer, or they may be set with time string, eg +\[dq]5s\[dq]. +See the options section (https://rclone.org/docs/#options) for more +info. +.IP \[bu] 2 +\f[C]Size\f[R] - these are returned as an integer number of bytes. +They may be set as an integer or they may be set with a size suffix +string, eg \[dq]10M\[dq]. +See the options section (https://rclone.org/docs/#options) for more +info. +.IP \[bu] 2 +Enumerated type (such as \f[C]CutoffMode\f[R], \f[C]DumpFlags\f[R], +\f[C]LogLevel\f[R], \f[C]VfsCacheMode\f[R] - these will be returned as +an integer and may be set as an integer but more conveniently they can +be set as a string, eg \[dq]HARD\[dq] for \f[C]CutoffMode\f[R] or +\f[C]DEBUG\f[R] for \f[C]LogLevel\f[R]. +.IP \[bu] 2 +\f[C]BandwidthSpec\f[R] - this will be set and returned as a string, eg +\[dq]1M\[dq]. +.SS Specifying remotes to work on .PP -Response +Remotes are specified with the \f[C]fs=\f[R], \f[C]srcFs=\f[R], +\f[C]dstFs=\f[R] parameters depending on the command being used. +.PP +The parameters can be a string as per the rest of rclone, eg +\f[C]s3:bucket/path\f[R] or \f[C]:sftp:/my/dir\f[R]. +They can also be specified as JSON blobs. +.PP +If specifying a JSON blob it should be a object mapping strings to +strings. +These values will be used to configure the remote. +There are 3 special values which may be set: +.IP \[bu] 2 +\f[C]type\f[R] - set to \f[C]type\f[R] to specify a remote called +\f[C]:type:\f[R] +.IP \[bu] 2 +\f[C]_name\f[R] - set to \f[C]name\f[R] to specify a remote called +\f[C]name:\f[R] +.IP \[bu] 2 +\f[C]_root\f[R] - sets the root of the remote - may be empty +.PP +One of \f[C]_name\f[R] or \f[C]type\f[R] should normally be set. +If the \f[C]local\f[R] backend is desired then \f[C]type\f[R] should be +set to \f[C]local\f[R]. +If \f[C]_root\f[R] isn\[aq]t specified then it defaults to the root of +the remote. +.PP +For example this JSON is equivalent to \f[C]remote:/tmp\f[R] .IP .nf \f[C] { - \[dq]potato\[dq]: \[dq]1\[dq], - \[dq]sausage\[dq]: \[dq]2\[dq] + \[dq]_name\[dq]: \[dq]remote\[dq], + \[dq]_path\[dq]: \[dq]/tmp\[dq] } \f[R] .fi .PP -Here is what an error response looks like: -.IP -.nf -\f[C] -curl -X POST \[aq]http://localhost:5572/rc/error?potato=1&sausage=2\[aq] -\f[R] -.fi +And this is equivalent to +\f[C]:sftp,host=\[aq]example.com\[aq]:/tmp\f[R] .IP .nf \f[C] { - \[dq]error\[dq]: \[dq]arbitrary error on input map[potato:1 sausage:2]\[dq], - \[dq]input\[dq]: { - \[dq]potato\[dq]: \[dq]1\[dq], - \[dq]sausage\[dq]: \[dq]2\[dq] - } + \[dq]type\[dq]: \[dq]sftp\[dq], + \[dq]host\[dq]: \[dq]example.com\[dq], + \[dq]_path\[dq]: \[dq]/tmp\[dq] } \f[R] .fi .PP -Note that curl doesn\[aq]t return errors to the shell unless you use the -\f[C]-f\f[R] option -.IP -.nf -\f[C] -$ curl -f -X POST \[aq]http://localhost:5572/rc/error?potato=1&sausage=2\[aq] -curl: (22) The requested URL returned error: 400 Bad Request -$ echo $? -22 -\f[R] -.fi -.SS Using POST with a form -.IP -.nf -\f[C] -curl --data \[dq]potato=1\[dq] --data \[dq]sausage=2\[dq] http://localhost:5572/rc/noop -\f[R] -.fi -.PP -Response +And this is equivalent to \f[C]/tmp/dir\f[R] .IP .nf \f[C] { - \[dq]potato\[dq]: \[dq]1\[dq], - \[dq]sausage\[dq]: \[dq]2\[dq] + type = \[dq]local\[dq], + _ path = \[dq]/tmp/dir\[dq] } \f[R] .fi +.SS Supported commands +.SS backend/command: Runs a backend command. .PP -Note that you can combine these with URL parameters too with the POST -parameters taking precedence. -.IP -.nf -\f[C] -curl --data \[dq]potato=1\[dq] --data \[dq]sausage=2\[dq] \[dq]http://localhost:5572/rc/noop?rutabaga=3&sausage=4\[dq] -\f[R] -.fi +This takes the following parameters: +.IP \[bu] 2 +command - a string with the command name +.IP \[bu] 2 +fs - a remote name string e.g. +\[dq]drive:\[dq] +.IP \[bu] 2 +arg - a list of arguments for the backend command +.IP \[bu] 2 +opt - a map of string to string of options .PP -Response -.IP -.nf -\f[C] -{ - \[dq]potato\[dq]: \[dq]1\[dq], - \[dq]rutabaga\[dq]: \[dq]3\[dq], - \[dq]sausage\[dq]: \[dq]4\[dq] -} -\f[R] -.fi -.SS Using POST with a JSON blob +Returns: +.IP \[bu] 2 +result - result from the backend command +.PP +Example: .IP .nf \f[C] -curl -H \[dq]Content-Type: application/json\[dq] -X POST -d \[aq]{\[dq]potato\[dq]:2,\[dq]sausage\[dq]:1}\[aq] http://localhost:5572/rc/noop +rclone rc backend/command command=noop fs=. -o echo=yes -o blue -a path1 -a path2 \f[R] .fi .PP -response +Returns .IP .nf \f[C] { - \[dq]password\[dq]: \[dq]xyz\[dq], - \[dq]username\[dq]: \[dq]xyz\[dq] + \[dq]result\[dq]: { + \[dq]arg\[dq]: [ + \[dq]path1\[dq], + \[dq]path2\[dq] + ], + \[dq]name\[dq]: \[dq]noop\[dq], + \[dq]opt\[dq]: { + \[dq]blue\[dq]: \[dq]\[dq], + \[dq]echo\[dq]: \[dq]yes\[dq] + } + } } \f[R] .fi .PP -This can be combined with URL parameters too if required. -The JSON blob takes precedence. -.IP -.nf -\f[C] -curl -H \[dq]Content-Type: application/json\[dq] -X POST -d \[aq]{\[dq]potato\[dq]:2,\[dq]sausage\[dq]:1}\[aq] \[aq]http://localhost:5572/rc/noop?rutabaga=3&potato=4\[aq] -\f[R] -.fi +Note that this is the direct equivalent of using this \[dq]backend\[dq] +command: .IP .nf \f[C] -{ - \[dq]potato\[dq]: 2, - \[dq]rutabaga\[dq]: \[dq]3\[dq], - \[dq]sausage\[dq]: 1 -} +rclone backend noop . -o echo=yes -o blue path1 path2 \f[R] .fi -.SS Debugging rclone with pprof .PP -If you use the \f[C]--rc\f[R] flag this will also enable the use of the -go profiling tools on the same port. +Note that arguments must be preceded by the \[dq]-a\[dq] flag .PP -To use these, first install go (https://golang.org/doc/install). -.SS Debugging memory use +See the backend (https://rclone.org/commands/rclone_backend/) command +for more information. .PP -To profile rclone\[aq]s memory use you can run: -.IP -.nf -\f[C] -go tool pprof -web http://localhost:5572/debug/pprof/heap -\f[R] -.fi +\f[B]Authentication is required for this call.\f[R] +.SS cache/expire: Purge a remote from cache .PP -This should open a page in your browser showing what is using what -memory. +Purge a remote from the cache backend. +Supports either a directory or a file. +Params: - remote = path to remote (required) - withData = true/false to +delete cached data (chunks) as well (optional) .PP -You can also use the \f[C]-text\f[R] flag to produce a textual summary +Eg .IP .nf \f[C] -$ go tool pprof -text http://localhost:5572/debug/pprof/heap -Showing nodes accounting for 1537.03kB, 100% of 1537.03kB total - flat flat% sum% cum cum% - 1024.03kB 66.62% 66.62% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.addDecoderNode - 513kB 33.38% 100% 513kB 33.38% net/http.newBufioWriterSize - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/all.init - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/serve.init - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/serve/restic.init - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2.init - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.init - 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.init.0 - 0 0% 100% 1024.03kB 66.62% main.init - 0 0% 100% 513kB 33.38% net/http.(*conn).readRequest - 0 0% 100% 513kB 33.38% net/http.(*conn).serve - 0 0% 100% 1024.03kB 66.62% runtime.main +rclone rc cache/expire remote=path/to/sub/folder/ +rclone rc cache/expire remote=/ withData=true \f[R] .fi -.SS Debugging go routine leaks +.SS cache/fetch: Fetch file chunks .PP -Memory leaks are most often caused by go routine leaks keeping memory -alive which should have been garbage collected. +Ensure the specified file chunks are cached on disk. .PP -See all active go routines using +The chunks= parameter specifies the file chunks to check. +It takes a comma separated list of array slice indices. +The slice indices are similar to Python slices: start[:end] +.PP +start is the 0 based chunk number from the beginning of the file to +fetch inclusive. +end is 0 based chunk number from the beginning of the file to fetch +exclusive. +Both values can be negative, in which case they count from the back of +the file. +The value \[dq]-5:\[dq] represents the last 5 chunks of a file. +.PP +Some valid examples are: \[dq]:5,-5:\[dq] -> the first and last five +chunks \[dq]0,-2\[dq] -> the first and the second last chunk +\[dq]0:10\[dq] -> the first ten chunks +.PP +Any parameter with a key that starts with \[dq]file\[dq] can be used to +specify files to fetch, e.g. .IP .nf \f[C] -curl http://localhost:5572/debug/pprof/goroutine?debug=1 +rclone rc cache/fetch chunks=0 file=hello file2=home/goodbye \f[R] .fi .PP -Or go to http://localhost:5572/debug/pprof/goroutine?debug=1 in your -browser. -.SS Other profiles to look at +File names will automatically be encrypted when the a crypt remote is +used on top of the cache. +.SS cache/stats: Get cache stats .PP -You can see a summary of profiles available at -http://localhost:5572/debug/pprof/ +Show statistics for the cache remote. +.SS config/create: create the config for a remote. .PP -Here is how to use some of them: -.IP \[bu] 2 -Memory: \f[C]go tool pprof http://localhost:5572/debug/pprof/heap\f[R] +This takes the following parameters: .IP \[bu] 2 -Go routines: -\f[C]curl http://localhost:5572/debug/pprof/goroutine?debug=1\f[R] +name - name of remote .IP \[bu] 2 -30-second CPU profile: -\f[C]go tool pprof http://localhost:5572/debug/pprof/profile\f[R] +parameters - a map of { \[dq]key\[dq]: \[dq]value\[dq] } pairs .IP \[bu] 2 -5-second execution trace: -\f[C]wget http://localhost:5572/debug/pprof/trace?seconds=5\f[R] +type - type of the new remote .IP \[bu] 2 -Goroutine blocking profile +opt - a dictionary of options to control the configuration .RS 2 .IP \[bu] 2 -Enable first with: -\f[C]rclone rc debug/set-block-profile-rate rate=1\f[R] (docs) +obscure - declare passwords are plain and need obscuring .IP \[bu] 2 -\f[C]go tool pprof http://localhost:5572/debug/pprof/block\f[R] +noObscure - declare passwords are already obscured and don\[aq]t need +obscuring +.IP \[bu] 2 +nonInteractive - don\[aq]t interact with a user, return questions +.IP \[bu] 2 +continue - continue the config process with an answer +.IP \[bu] 2 +all - ask all the config questions not just the post config ones +.IP \[bu] 2 +state - state to restart with - used with continue +.IP \[bu] 2 +result - result to restart with - used with continue .RE +.PP +See the config +create (https://rclone.org/commands/rclone_config_create/) command for +more information on the above. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS config/delete: Delete a remote in the config file. +.PP +Parameters: .IP \[bu] 2 -Contended mutexes: +name - name of remote to delete +.PP +See the config +delete (https://rclone.org/commands/rclone_config_delete/) command for +more information on the above. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS config/dump: Dumps the config file. +.PP +Returns a JSON object: - key: value +.PP +Where keys are remote names and values are the config parameters. +.PP +See the config dump (https://rclone.org/commands/rclone_config_dump/) +command for more information on the above. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS config/get: Get a remote in the config file. +.PP +Parameters: +.IP \[bu] 2 +name - name of remote to get +.PP +See the config dump (https://rclone.org/commands/rclone_config_dump/) +command for more information on the above. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS config/listremotes: Lists the remotes in the config file and defined in environment variables. +.PP +Returns - remotes - array of remote names +.PP +See the listremotes (https://rclone.org/commands/rclone_listremotes/) +command for more information on the above. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS config/password: password the config for a remote. +.PP +This takes the following parameters: +.IP \[bu] 2 +name - name of remote +.IP \[bu] 2 +parameters - a map of { \[dq]key\[dq]: \[dq]value\[dq] } pairs +.PP +See the config +password (https://rclone.org/commands/rclone_config_password/) command +for more information on the above. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS config/providers: Shows how providers are configured in the config file. +.PP +Returns a JSON object: - providers - array of objects +.PP +See the config +providers (https://rclone.org/commands/rclone_config_providers/) command +for more information on the above. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS config/setpath: Set the path of the config file +.PP +Parameters: +.IP \[bu] 2 +path - path to the config file to use +.PP +\f[B]Authentication is required for this call.\f[R] +.SS config/update: update the config for a remote. +.PP +This takes the following parameters: +.IP \[bu] 2 +name - name of remote +.IP \[bu] 2 +parameters - a map of { \[dq]key\[dq]: \[dq]value\[dq] } pairs +.IP \[bu] 2 +opt - a dictionary of options to control the configuration .RS 2 .IP \[bu] 2 -Enable first with: -\f[C]rclone rc debug/set-mutex-profile-fraction rate=1\f[R] (docs) +obscure - declare passwords are plain and need obscuring .IP \[bu] 2 -\f[C]go tool pprof http://localhost:5572/debug/pprof/mutex\f[R] +noObscure - declare passwords are already obscured and don\[aq]t need +obscuring +.IP \[bu] 2 +nonInteractive - don\[aq]t interact with a user, return questions +.IP \[bu] 2 +continue - continue the config process with an answer +.IP \[bu] 2 +all - ask all the config questions not just the post config ones +.IP \[bu] 2 +state - state to restart with - used with continue +.IP \[bu] 2 +result - result to restart with - used with continue .RE .PP -See the net/http/pprof docs (https://golang.org/pkg/net/http/pprof/) for -more info on how to use the profiling and for a general overview see the -Go team\[aq]s blog post on profiling go -programs (https://blog.golang.org/profiling-go-programs). -.PP -The profiling hook is zero overhead unless it is -used (https://stackoverflow.com/q/26545159/164234). -.SH Overview of cloud storage systems +See the config +update (https://rclone.org/commands/rclone_config_update/) command for +more information on the above. .PP -Each cloud storage system is slightly different. -Rclone attempts to provide a unified interface to them, but some -underlying differences show through. -.SS Features +\f[B]Authentication is required for this call.\f[R] +.SS core/bwlimit: Set the bandwidth limit. .PP -Here is an overview of the major features of each cloud storage system. +This sets the bandwidth limit to the string passed in. +This should be a single bandwidth limit entry or a pair of +upload:download bandwidth. .PP -.TS -tab(@); -l c c c c c c. -T{ -Name -T}@T{ -Hash -T}@T{ -ModTime -T}@T{ -Case Insensitive -T}@T{ -Duplicate Files -T}@T{ -MIME Type -T}@T{ -Metadata -T} -_ -T{ -1Fichier -T}@T{ -Whirlpool -T}@T{ -- -T}@T{ -No -T}@T{ -Yes -T}@T{ -R -T}@T{ -- -T} -T{ -Akamai Netstorage -T}@T{ -MD5, SHA256 -T}@T{ -R/W -T}@T{ -No -T}@T{ -No -T}@T{ -R -T}@T{ -- -T} -T{ -Amazon Drive -T}@T{ -MD5 -T}@T{ -- -T}@T{ -Yes -T}@T{ -No -T}@T{ -R -T}@T{ -- -T} -T{ -Amazon S3 (or S3 compatible) -T}@T{ -MD5 -T}@T{ -R/W -T}@T{ -No -T}@T{ -No -T}@T{ -R/W -T}@T{ -RWU -T} -T{ -Backblaze B2 -T}@T{ -SHA1 -T}@T{ -R/W -T}@T{ -No -T}@T{ -No -T}@T{ -R/W -T}@T{ -- -T} -T{ -Box -T}@T{ -SHA1 -T}@T{ -R/W -T}@T{ -Yes -T}@T{ -No -T}@T{ -- -T}@T{ -- -T} -T{ -Citrix ShareFile -T}@T{ -MD5 -T}@T{ -R/W -T}@T{ -Yes -T}@T{ -No -T}@T{ -- -T}@T{ -- -T} -T{ -Dropbox -T}@T{ -DBHASH \[S1] -T}@T{ -R -T}@T{ -Yes -T}@T{ -No -T}@T{ -- -T}@T{ -- -T} -T{ -Enterprise File Fabric -T}@T{ -- -T}@T{ -R/W -T}@T{ -Yes -T}@T{ -No -T}@T{ -R/W -T}@T{ -- -T} -T{ -FTP -T}@T{ -- -T}@T{ -R/W \[S1]\[u2070] -T}@T{ -No -T}@T{ -No -T}@T{ -- -T}@T{ -- -T} -T{ -Google Cloud Storage -T}@T{ -MD5 -T}@T{ -R/W -T}@T{ -No -T}@T{ -No -T}@T{ -R/W -T}@T{ -- -T} -T{ -Google Drive -T}@T{ -MD5 -T}@T{ -R/W -T}@T{ -No -T}@T{ -Yes -T}@T{ -R/W -T}@T{ -- -T} -T{ -Google Photos -T}@T{ -- -T}@T{ -- -T}@T{ -No -T}@T{ -Yes -T}@T{ -R -T}@T{ -- -T} -T{ -HDFS -T}@T{ -- -T}@T{ -R/W -T}@T{ -No -T}@T{ -No -T}@T{ -- -T}@T{ -- -T} -T{ -HiDrive -T}@T{ -HiDrive \[S1]\[S2] -T}@T{ -R/W -T}@T{ -No -T}@T{ -No -T}@T{ -- -T}@T{ -- -T} -T{ -HTTP -T}@T{ -- -T}@T{ -R -T}@T{ -No -T}@T{ -No -T}@T{ -R -T}@T{ -- -T} -T{ -Internet Archive -T}@T{ -MD5, SHA1, CRC32 -T}@T{ -R/W \[S1]\[S1] -T}@T{ -No -T}@T{ -No -T}@T{ -- -T}@T{ -RWU -T} -T{ -Jottacloud -T}@T{ -MD5 -T}@T{ -R/W -T}@T{ -Yes -T}@T{ -No -T}@T{ -R -T}@T{ -- -T} -T{ -Koofr -T}@T{ -MD5 -T}@T{ -- -T}@T{ -Yes -T}@T{ -No -T}@T{ -- -T}@T{ -- -T} -T{ -Mail.ru Cloud -T}@T{ -Mailru \[u2076] -T}@T{ -R/W -T}@T{ -Yes -T}@T{ -No -T}@T{ -- -T}@T{ -- -T} -T{ -Mega -T}@T{ -- -T}@T{ -- -T}@T{ -No -T}@T{ -Yes -T}@T{ -- -T}@T{ -- -T} -T{ -Memory -T}@T{ -MD5 -T}@T{ -R/W -T}@T{ -No -T}@T{ -No -T}@T{ -- -T}@T{ -- -T} -T{ -Microsoft Azure Blob Storage -T}@T{ -MD5 -T}@T{ -R/W -T}@T{ -No -T}@T{ -No -T}@T{ -R/W -T}@T{ -- -T} -T{ -Microsoft OneDrive -T}@T{ -QuickXorHash \[u2075] -T}@T{ -R/W -T}@T{ -Yes -T}@T{ -No -T}@T{ -R -T}@T{ -- -T} -T{ -OpenDrive -T}@T{ -MD5 -T}@T{ -R/W -T}@T{ -Yes -T}@T{ -Partial \[u2078] -T}@T{ -- -T}@T{ -- -T} -T{ -OpenStack Swift -T}@T{ -MD5 -T}@T{ -R/W -T}@T{ -No -T}@T{ -No -T}@T{ -R/W -T}@T{ -- -T} -T{ -Oracle Object Storage -T}@T{ -MD5 -T}@T{ -R/W -T}@T{ -No -T}@T{ -No -T}@T{ -R/W -T}@T{ -- -T} -T{ -pCloud -T}@T{ -MD5, SHA1 \[u2077] -T}@T{ -R -T}@T{ -No -T}@T{ -No -T}@T{ -W -T}@T{ -- -T} -T{ -PikPak -T}@T{ -MD5 -T}@T{ -R -T}@T{ -No -T}@T{ -No -T}@T{ -R -T}@T{ -- -T} -T{ -premiumize.me -T}@T{ -- -T}@T{ -- -T}@T{ -Yes -T}@T{ -No -T}@T{ -R -T}@T{ -- -T} -T{ -put.io -T}@T{ -CRC-32 -T}@T{ -R/W -T}@T{ -No -T}@T{ -Yes -T}@T{ -R -T}@T{ -- -T} -T{ -Proton Drive -T}@T{ -SHA1 -T}@T{ -R/W -T}@T{ -No -T}@T{ -No -T}@T{ -R -T}@T{ -- -T} -T{ -QingStor -T}@T{ -MD5 -T}@T{ -- \[u2079] -T}@T{ -No -T}@T{ -No -T}@T{ -R/W -T}@T{ -- -T} -T{ -Quatrix by Maytech -T}@T{ -- -T}@T{ -R/W -T}@T{ -No -T}@T{ -No -T}@T{ -- -T}@T{ -- -T} -T{ -Seafile -T}@T{ -- -T}@T{ -- -T}@T{ -No -T}@T{ -No -T}@T{ -- -T}@T{ -- -T} -T{ -SFTP -T}@T{ -MD5, SHA1 \[S2] -T}@T{ -R/W -T}@T{ -Depends -T}@T{ -No -T}@T{ -- -T}@T{ -- -T} -T{ -Sia -T}@T{ -- -T}@T{ -- -T}@T{ -No -T}@T{ -No -T}@T{ -- -T}@T{ -- -T} -T{ -SMB -T}@T{ -- -T}@T{ -- -T}@T{ -Yes -T}@T{ -No -T}@T{ -- -T}@T{ -- -T} -T{ -SugarSync -T}@T{ -- -T}@T{ -- -T}@T{ -No -T}@T{ -No -T}@T{ -- -T}@T{ -- -T} -T{ -Storj -T}@T{ -- -T}@T{ -R -T}@T{ -No -T}@T{ -No -T}@T{ -- -T}@T{ -- -T} -T{ -Uptobox -T}@T{ -- -T}@T{ -- -T}@T{ -No -T}@T{ -Yes -T}@T{ -- -T}@T{ -- -T} -T{ -WebDAV -T}@T{ -MD5, SHA1 \[S3] -T}@T{ -R \[u2074] -T}@T{ -Depends -T}@T{ -No -T}@T{ -- -T}@T{ -- -T} -T{ -Yandex Disk -T}@T{ -MD5 -T}@T{ -R/W -T}@T{ -No -T}@T{ -No -T}@T{ -R -T}@T{ -- -T} -T{ -Zoho WorkDrive -T}@T{ -- -T}@T{ -- -T}@T{ -No -T}@T{ -No -T}@T{ -- -T}@T{ -- -T} -T{ -The local filesystem -T}@T{ -All -T}@T{ -R/W -T}@T{ -Depends -T}@T{ -No -T}@T{ -- -T}@T{ -RWU -T} -.TE -.SS Notes -.PP -\[S1] Dropbox supports its own custom -hash (https://www.dropbox.com/developers/reference/content-hash). -This is an SHA256 sum of all the 4 MiB block SHA256s. -.PP -\[S2] SFTP supports checksums if the same login has shell access and -\f[C]md5sum\f[R] or \f[C]sha1sum\f[R] as well as \f[C]echo\f[R] are in -the remote\[aq]s PATH. -.PP -\[S3] WebDAV supports hashes when used with Fastmail Files, Owncloud and -Nextcloud only. -.PP -\[u2074] WebDAV supports modtimes when used with Fastmail Files, -Owncloud and Nextcloud only. -.PP -\[u2075] -QuickXorHash (https://docs.microsoft.com/en-us/onedrive/developer/code-snippets/quickxorhash) -is Microsoft\[aq]s own hash. -.PP -\[u2076] Mail.ru uses its own modified SHA1 hash -.PP -\[u2077] pCloud only supports SHA1 (not MD5) in its EU region -.PP -\[u2078] Opendrive does not support creation of duplicate files using -their web client interface or other stock clients, but the underlying -storage platform has been determined to allow duplicate files, and it is -possible to create them with \f[C]rclone\f[R]. -It may be that this is a mistake or an unsupported feature. -.PP -\[u2079] QingStor does not support SetModTime for objects bigger than 5 -GiB. -.PP -\[S1]\[u2070] FTP supports modtimes for the major FTP servers, and also -others if they advertised required protocol extensions. -See this (https://rclone.org/ftp/#modified-time) for more details. -.PP -\[S1]\[S1] Internet Archive requires option \f[C]wait_archive\f[R] to be -set to a non-zero value for full modtime support. -.PP -\[S1]\[S2] HiDrive supports its own custom -hash (https://static.hidrive.com/dev/0001). -It combines SHA1 sums for each 4 KiB block hierarchically to a single -top-level sum. -.SS Hash -.PP -The cloud storage system supports various hash types of the objects. -The hashes are used when transferring data as an integrity check and can -be specifically used with the \f[C]--checksum\f[R] flag in syncs and in -the \f[C]check\f[R] command. -.PP -To use the verify checksums when transferring between cloud storage -systems they must support a common hash type. -.SS ModTime -.PP -Almost all cloud storage systems store some sort of timestamp on -objects, but several of them not something that is appropriate to use -for syncing. -E.g. -some backends will only write a timestamp that represent the time of the -upload. -To be relevant for syncing it should be able to store the modification -time of the source object. -If this is not the case, rclone will only check the file size by -default, though can be configured to check the file hash (with the -\f[C]--checksum\f[R] flag). -Ideally it should also be possible to change the timestamp of an -existing file without having to re-upload it. -.PP -Storage systems with a \f[C]-\f[R] in the ModTime column, means the -modification read on objects is not the modification time of the file -when uploaded. -It is most likely the time the file was uploaded, or possibly something -else (like the time the picture was taken in Google Photos). -.PP -Storage systems with a \f[C]R\f[R] (for read-only) in the ModTime -column, means the it keeps modification times on objects, and updates -them when uploading objects, but it does not support changing only the -modification time (\f[C]SetModTime\f[R] operation) without re-uploading, -possibly not even without deleting existing first. -Some operations in rclone, such as \f[C]copy\f[R] and \f[C]sync\f[R] -commands, will automatically check for \f[C]SetModTime\f[R] support and -re-upload if necessary to keep the modification times in sync. -Other commands will not work without \f[C]SetModTime\f[R] support, e.g. -\f[C]touch\f[R] command on an existing file will fail, and changes to -modification time only on a files in a \f[C]mount\f[R] will be silently -ignored. -.PP -Storage systems with \f[C]R/W\f[R] (for read/write) in the ModTime -column, means they do also support modtime-only operations. -.SS Case Insensitive -.PP -If a cloud storage systems is case sensitive then it is possible to have -two files which differ only in case, e.g. -\f[C]file.txt\f[R] and \f[C]FILE.txt\f[R]. -If a cloud storage system is case insensitive then that isn\[aq]t -possible. -.PP -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. -.PP -The local filesystem and SFTP may or may not be case sensitive depending -on OS. -.IP \[bu] 2 -Windows - usually case insensitive, though case is preserved -.IP \[bu] 2 -OSX - usually case insensitive, though it is possible to format case -sensitive -.IP \[bu] 2 -Linux - usually case sensitive, but there are case insensitive file -systems (e.g. -FAT formatted USB keys) -.PP -Most of the time this doesn\[aq]t cause any problems as people tend to -avoid files whose name differs only by case even on case sensitive -systems. -.SS Duplicate files -.PP -If a cloud storage system allows duplicate files then it can have two -objects with the same name. -.PP -This confuses rclone greatly when syncing - use the -\f[C]rclone dedupe\f[R] command to rename or remove duplicates. -.SS Restricted filenames -.PP -Some cloud storage systems might have restrictions on the characters -that are usable in file or directory names. -When \f[C]rclone\f[R] detects such a name during a file upload, it will -transparently replace the restricted characters with similar looking -Unicode characters. -To handle the different sets of restricted characters for different -backends, rclone uses something it calls encoding. -.PP -This process is designed to avoid ambiguous file names as much as -possible and allow to move files between many cloud storage systems -transparently. -.PP -The name shown by \f[C]rclone\f[R] to the user or during log output will -only contain a minimal set of replaced characters to ensure correct -formatting and not necessarily the actual name used on the cloud -storage. -.PP -This transformation is reversed when downloading a file or parsing -\f[C]rclone\f[R] arguments. -For example, when uploading a file named \f[C]my file?.txt\f[R] to -Onedrive, it will be displayed as \f[C]my file?.txt\f[R] on the console, -but stored as \f[C]my file\[uFF1F].txt\f[R] to Onedrive (the \f[C]?\f[R] -gets replaced by the similar looking \f[C]\[uFF1F]\f[R] character, the -so-called \[dq]fullwidth question mark\[dq]). -The reverse transformation allows to read a file -\f[C]unusual/name.txt\f[R] from Google Drive, by passing the name -\f[C]unusual\[uFF0F]name.txt\f[R] on the command line (the \f[C]/\f[R] -needs to be replaced by the similar looking \f[C]\[uFF0F]\f[R] -character). -.SS Caveats -.PP -The filename encoding system works well in most cases, at least where -file names are written in English or similar languages. -You might not even notice it: It just works. -In some cases it may lead to issues, though. -E.g. -when file names are written in Chinese, or Japanese, where it is always -the Unicode fullwidth variants of the punctuation marks that are used. -.PP -On Windows, the characters \f[C]:\f[R], \f[C]*\f[R] and \f[C]?\f[R] are -examples of restricted characters. -If these are used in filenames on a remote that supports it, Rclone will -transparently convert them to their fullwidth Unicode variants -\f[C]\[uFF0A]\f[R], \f[C]\[uFF1F]\f[R] and \f[C]\[uFF1A]\f[R] when -downloading to Windows, and back again when uploading. -This way files with names that are not allowed on Windows can still be -stored. -.PP -However, if you have files on your Windows system originally with these -same Unicode characters in their names, they will be included in the -same conversion process. -E.g. -if you create a file in your Windows filesystem with name -\f[C]Test\[uFF1A]1.jpg\f[R], where \f[C]\[uFF1A]\f[R] is the Unicode -fullwidth colon symbol, and use rclone to upload it to Google Drive, -which supports regular \f[C]:\f[R] (halfwidth question mark), rclone -will replace the fullwidth \f[C]:\f[R] with the halfwidth \f[C]:\f[R] -and store the file as \f[C]Test:1.jpg\f[R] in Google Drive. -Since both Windows and Google Drive allows the name -\f[C]Test\[uFF1A]1.jpg\f[R], it would probably be better if rclone just -kept the name as is in this case. -.PP -With the opposite situation; if you have a file named -\f[C]Test:1.jpg\f[R], in your Google Drive, e.g. -uploaded from a Linux system where \f[C]:\f[R] is valid in file names. -Then later use rclone to copy this file to your Windows computer you -will notice that on your local disk it gets renamed to -\f[C]Test\[uFF1A]1.jpg\f[R]. -The original filename is not legal on Windows, due to the \f[C]:\f[R], -and rclone therefore renames it to make the copy possible. -That is all good. -However, this can also lead to an issue: If you already had a -\f[I]different\f[R] file named \f[C]Test\[uFF1A]1.jpg\f[R] on Windows, -and then use rclone to copy either way. -Rclone will then treat the file originally named \f[C]Test:1.jpg\f[R] on -Google Drive and the file originally named \f[C]Test\[uFF1A]1.jpg\f[R] -on Windows as the same file, and replace the contents from one with the -other. -.PP -Its virtually impossible to handle all cases like these correctly in all -situations, but by customizing the encoding option, changing the set of -characters that rclone should convert, you should be able to create a -configuration that works well for your specific situation. -See also the -example (https://rclone.org/overview/#encoding-example-windows) below. -.PP -(Windows was used as an example of a file system with many restricted -characters, and Google drive a storage system with few.) -.SS Default restricted characters -.PP -The table below shows the characters that are replaced by default. -.PP -When a replacement character is found in a filename, this character will -be escaped with the \f[C]\[u201B]\f[R] character to avoid ambiguous file -names. -(e.g. -a file named \f[C]\[u2400].txt\f[R] would shown as -\f[C]\[u201B]\[u2400].txt\f[R]) -.PP -Each cloud storage backend can use a different set of characters, which -will be specified in the documentation for each backend. -.PP -.TS -tab(@); -l c c. -T{ -Character -T}@T{ -Value -T}@T{ -Replacement -T} -_ -T{ -NUL -T}@T{ -0x00 -T}@T{ -\[u2400] -T} -T{ -SOH -T}@T{ -0x01 -T}@T{ -\[u2401] -T} -T{ -STX -T}@T{ -0x02 -T}@T{ -\[u2402] -T} -T{ -ETX -T}@T{ -0x03 -T}@T{ -\[u2403] -T} -T{ -EOT -T}@T{ -0x04 -T}@T{ -\[u2404] -T} -T{ -ENQ -T}@T{ -0x05 -T}@T{ -\[u2405] -T} -T{ -ACK -T}@T{ -0x06 -T}@T{ -\[u2406] -T} -T{ -BEL -T}@T{ -0x07 -T}@T{ -\[u2407] -T} -T{ -BS -T}@T{ -0x08 -T}@T{ -\[u2408] -T} -T{ -HT -T}@T{ -0x09 -T}@T{ -\[u2409] -T} -T{ -LF -T}@T{ -0x0A -T}@T{ -\[u240A] -T} -T{ -VT -T}@T{ -0x0B -T}@T{ -\[u240B] -T} -T{ -FF -T}@T{ -0x0C -T}@T{ -\[u240C] -T} -T{ -CR -T}@T{ -0x0D -T}@T{ -\[u240D] -T} -T{ -SO -T}@T{ -0x0E -T}@T{ -\[u240E] -T} -T{ -SI -T}@T{ -0x0F -T}@T{ -\[u240F] -T} -T{ -DLE -T}@T{ -0x10 -T}@T{ -\[u2410] -T} -T{ -DC1 -T}@T{ -0x11 -T}@T{ -\[u2411] -T} -T{ -DC2 -T}@T{ -0x12 -T}@T{ -\[u2412] -T} -T{ -DC3 -T}@T{ -0x13 -T}@T{ -\[u2413] -T} -T{ -DC4 -T}@T{ -0x14 -T}@T{ -\[u2414] -T} -T{ -NAK -T}@T{ -0x15 -T}@T{ -\[u2415] -T} -T{ -SYN -T}@T{ -0x16 -T}@T{ -\[u2416] -T} -T{ -ETB -T}@T{ -0x17 -T}@T{ -\[u2417] -T} -T{ -CAN -T}@T{ -0x18 -T}@T{ -\[u2418] -T} -T{ -EM -T}@T{ -0x19 -T}@T{ -\[u2419] -T} -T{ -SUB -T}@T{ -0x1A -T}@T{ -\[u241A] -T} -T{ -ESC -T}@T{ -0x1B -T}@T{ -\[u241B] -T} -T{ -FS -T}@T{ -0x1C -T}@T{ -\[u241C] -T} -T{ -GS -T}@T{ -0x1D -T}@T{ -\[u241D] -T} -T{ -RS -T}@T{ -0x1E -T}@T{ -\[u241E] -T} -T{ -US -T}@T{ -0x1F -T}@T{ -\[u241F] -T} -T{ -/ -T}@T{ -0x2F -T}@T{ -\[uFF0F] -T} -T{ -DEL -T}@T{ -0x7F -T}@T{ -\[u2421] -T} -.TE -.PP -The default encoding will also encode these file names as they are -problematic with many cloud storage systems. -.PP -.TS -tab(@); -l c. -T{ -File name -T}@T{ -Replacement -T} -_ -T{ -\&. -T}@T{ -\[uFF0E] -T} -T{ -\&.. -T}@T{ -\[uFF0E]\[uFF0E] -T} -.TE -.SS Invalid UTF-8 bytes -.PP -Some backends only support a sequence of well formed UTF-8 bytes as file -or directory names. -.PP -In this case all invalid UTF-8 bytes will be replaced with a quoted -representation of the byte value to allow uploading a file to such a -backend. -For example, the invalid byte \f[C]0xFE\f[R] will be encoded as -\f[C]\[u201B]FE\f[R]. -.PP -A common source of invalid UTF-8 bytes are local filesystems, that store -names in a different encoding than UTF-8 or UTF-16, like latin1. -See the local filenames (https://rclone.org/local/#filenames) section -for details. -.SS Encoding option -.PP -Most backends have an encoding option, specified as a flag -\f[C]--backend-encoding\f[R] where \f[C]backend\f[R] is the name of the -backend, or as a config parameter \f[C]encoding\f[R] (you\[aq]ll need to -select the Advanced config in \f[C]rclone config\f[R] to see it). -.PP -This will have default value which encodes and decodes characters in -such a way as to preserve the maximum number of characters (see above). -.PP -However this can be incorrect in some scenarios, for example if you have -a Windows file system with Unicode fullwidth characters -\f[C]\[uFF0A]\f[R], \f[C]\[uFF1F]\f[R] or \f[C]\[uFF1A]\f[R], that you -want to remain as those characters on the remote rather than being -translated to regular (halfwidth) \f[C]*\f[R], \f[C]?\f[R] and -\f[C]:\f[R]. -.PP -The \f[C]--backend-encoding\f[R] flags allow you to change that. -You can disable the encoding completely with -\f[C]--backend-encoding None\f[R] or set \f[C]encoding = None\f[R] in -the config file. -.PP -Encoding takes a comma separated list of encodings. -You can see the list of all possible values by passing an invalid value -to this flag, e.g. -\f[C]--local-encoding \[dq]help\[dq]\f[R]. -The command \f[C]rclone help flags encoding\f[R] will show you the -defaults for the backends. -.PP -.TS -tab(@); -lw(21.7n) lw(24.1n) lw(24.1n). -T{ -Encoding -T}@T{ -Characters -T}@T{ -Encoded as -T} -_ -T{ -Asterisk -T}@T{ -\f[C]*\f[R] -T}@T{ -\f[C]\[uFF0A]\f[R] -T} -T{ -BackQuote -T}@T{ -\f[C]\[ga]\f[R] -T}@T{ -\f[C]\[uFF40]\f[R] -T} -T{ -BackSlash -T}@T{ -\f[C]\[rs]\f[R] -T}@T{ -\f[C]\[uFF3C]\f[R] -T} -T{ -Colon -T}@T{ -\f[C]:\f[R] -T}@T{ -\f[C]\[uFF1A]\f[R] -T} -T{ -CrLf -T}@T{ -CR 0x0D, LF 0x0A -T}@T{ -\f[C]\[u240D]\f[R], \f[C]\[u240A]\f[R] -T} -T{ -Ctl -T}@T{ -All control characters 0x00-0x1F -T}@T{ -\f[C]\[u2400]\[u2401]\[u2402]\[u2403]\[u2404]\[u2405]\[u2406]\[u2407]\[u2408]\[u2409]\[u240A]\[u240B]\[u240C]\[u240D]\[u240E]\[u240F]\[u2410]\[u2411]\[u2412]\[u2413]\[u2414]\[u2415]\[u2416]\[u2417]\[u2418]\[u2419]\[u241A]\[u241B]\[u241C]\[u241D]\[u241E]\[u241F]\f[R] -T} -T{ -Del -T}@T{ -DEL 0x7F -T}@T{ -\f[C]\[u2421]\f[R] -T} -T{ -Dollar -T}@T{ -\f[C]$\f[R] -T}@T{ -\f[C]\[uFF04]\f[R] -T} -T{ -Dot -T}@T{ -\f[C].\f[R] or \f[C]..\f[R] as entire string -T}@T{ -\f[C]\[uFF0E]\f[R], \f[C]\[uFF0E]\[uFF0E]\f[R] -T} -T{ -DoubleQuote -T}@T{ -\f[C]\[dq]\f[R] -T}@T{ -\f[C]\[uFF02]\f[R] -T} -T{ -Hash -T}@T{ -\f[C]#\f[R] -T}@T{ -\f[C]\[uFF03]\f[R] -T} -T{ -InvalidUtf8 -T}@T{ -An invalid UTF-8 character (e.g. -latin1) -T}@T{ -\f[C]\[uFFFD]\f[R] -T} -T{ -LeftCrLfHtVt -T}@T{ -CR 0x0D, LF 0x0A, HT 0x09, VT 0x0B on the left of a string -T}@T{ -\f[C]\[u240D]\f[R], \f[C]\[u240A]\f[R], \f[C]\[u2409]\f[R], -\f[C]\[u240B]\f[R] -T} -T{ -LeftPeriod -T}@T{ -\f[C].\f[R] on the left of a string -T}@T{ -\f[C].\f[R] -T} -T{ -LeftSpace -T}@T{ -SPACE on the left of a string -T}@T{ -\f[C]\[u2420]\f[R] -T} -T{ -LeftTilde -T}@T{ -\f[C]\[ti]\f[R] on the left of a string -T}@T{ -\f[C]\[uFF5E]\f[R] -T} -T{ -LtGt -T}@T{ -\f[C]<\f[R], \f[C]>\f[R] -T}@T{ -\f[C]\[uFF1C]\f[R], \f[C]\[uFF1E]\f[R] -T} -T{ -None -T}@T{ -No characters are encoded -T}@T{ -T} -T{ -Percent -T}@T{ -\f[C]%\f[R] -T}@T{ -\f[C]\[uFF05]\f[R] -T} -T{ -Pipe -T}@T{ -| -T}@T{ -\f[C]\[uFF5C]\f[R] -T} -T{ -Question -T}@T{ -\f[C]?\f[R] -T}@T{ -\f[C]\[uFF1F]\f[R] -T} -T{ -RightCrLfHtVt -T}@T{ -CR 0x0D, LF 0x0A, HT 0x09, VT 0x0B on the right of a string -T}@T{ -\f[C]\[u240D]\f[R], \f[C]\[u240A]\f[R], \f[C]\[u2409]\f[R], -\f[C]\[u240B]\f[R] -T} -T{ -RightPeriod -T}@T{ -\f[C].\f[R] on the right of a string -T}@T{ -\f[C].\f[R] -T} -T{ -RightSpace -T}@T{ -SPACE on the right of a string -T}@T{ -\f[C]\[u2420]\f[R] -T} -T{ -Semicolon -T}@T{ -\f[C];\f[R] -T}@T{ -\f[C]\[uFF1B]\f[R] -T} -T{ -SingleQuote -T}@T{ -\f[C]\[aq]\f[R] -T}@T{ -\f[C]\[uFF07]\f[R] -T} -T{ -Slash -T}@T{ -\f[C]/\f[R] -T}@T{ -\f[C]\[uFF0F]\f[R] -T} -T{ -SquareBracket -T}@T{ -\f[C][\f[R], \f[C]]\f[R] -T}@T{ -\f[C]\[uFF3B]\f[R], \f[C]\[uFF3D]\f[R] -T} -.TE -.SS Encoding example: FTP -.PP -To take a specific example, the FTP backend\[aq]s default encoding is -.IP -.nf -\f[C] ---ftp-encoding \[dq]Slash,Del,Ctl,RightSpace,Dot\[dq] -\f[R] -.fi -.PP -However, let\[aq]s say the FTP server is running on Windows and -can\[aq]t have any of the invalid Windows characters in file names. -You are backing up Linux servers to this FTP server which do have those -characters in file names. -So you would add the Windows set which are -.IP -.nf -\f[C] -Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot -\f[R] -.fi -.PP -to the existing ones, giving: -.IP -.nf -\f[C] -Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot,Del,RightSpace -\f[R] -.fi -.PP -This can be specified using the \f[C]--ftp-encoding\f[R] flag or using -an \f[C]encoding\f[R] parameter in the config file. -.SS Encoding example: Windows -.PP -As a nother example, take a Windows system where there is a file with -name \f[C]Test\[uFF1A]1.jpg\f[R], where \f[C]\[uFF1A]\f[R] is the -Unicode fullwidth colon symbol. -When using rclone to copy this to a remote which supports \f[C]:\f[R], -the regular (halfwidth) colon (such as Google Drive), you will notice -that the file gets renamed to \f[C]Test:1.jpg\f[R]. -.PP -To avoid this you can change the set of characters rclone should convert -for the local filesystem, using command-line argument -\f[C]--local-encoding\f[R]. -Rclone\[aq]s default behavior on Windows corresponds to -.IP -.nf -\f[C] ---local-encoding \[dq]Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot\[dq] -\f[R] -.fi -.PP -If you want to use fullwidth characters \f[C]\[uFF1A]\f[R], -\f[C]\[uFF0A]\f[R] and \f[C]\[uFF1F]\f[R] in your filenames without -rclone changing them when uploading to a remote, then set the same as -the default value but without \f[C]Colon,Question,Asterisk\f[R]: -.IP -.nf -\f[C] ---local-encoding \[dq]Slash,LtGt,DoubleQuote,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot\[dq] -\f[R] -.fi -.PP -Alternatively, you can disable the conversion of any characters with -\f[C]--local-encoding None\f[R]. -.PP -Instead of using command-line argument \f[C]--local-encoding\f[R], you -may also set it as environment -variable (https://rclone.org/docs/#environment-variables) -\f[C]RCLONE_LOCAL_ENCODING\f[R], or -configure (https://rclone.org/docs/#configure) a remote of type -\f[C]local\f[R] in your config, and set the \f[C]encoding\f[R] option -there. -.PP -The risk by doing this is that if you have a filename with the regular -(halfwidth) \f[C]:\f[R], \f[C]*\f[R] and \f[C]?\f[R] in your cloud -storage, and you try to download it to your Windows filesystem, this -will fail. -These characters are not valid in filenames on Windows, and you have -told rclone not to work around this by converting them to valid -fullwidth variants. -.SS MIME Type -.PP -MIME types (also known as media types) classify types of documents using -a simple text classification, e.g. -\f[C]text/html\f[R] or \f[C]application/pdf\f[R]. -.PP -Some cloud storage systems support reading (\f[C]R\f[R]) the MIME type -of objects and some support writing (\f[C]W\f[R]) the MIME type of -objects. -.PP -The MIME type can be important if you are serving files directly to HTTP -from the storage system. -.PP -If you are copying from a remote which supports reading (\f[C]R\f[R]) to -a remote which supports writing (\f[C]W\f[R]) then rclone will preserve -the MIME types. -Otherwise they will be guessed from the extension, or the remote itself -may assign the MIME type. -.SS Metadata -.PP -Backends may or may support reading or writing metadata. -They may support reading and writing system metadata (metadata intrinsic -to that backend) and/or user metadata (general purpose metadata). -.PP -The levels of metadata support are -.PP -.TS -tab(@); -l l. -T{ -Key -T}@T{ -Explanation -T} -_ -T{ -\f[C]R\f[R] -T}@T{ -Read only System Metadata -T} -T{ -\f[C]RW\f[R] -T}@T{ -Read and write System Metadata -T} -T{ -\f[C]RWU\f[R] -T}@T{ -Read and write System Metadata and read and write User Metadata -T} -.TE -.PP -See the metadata docs (https://rclone.org/docs/#metadata) for more info. -.SS Optional Features -.PP -All rclone remotes support a base command set. -Other features depend upon backend-specific capabilities. -.PP -.TS -tab(@); -lw(14.4n) cw(3.6n) cw(3.1n) cw(3.1n) cw(4.6n) cw(4.6n) cw(3.6n) cw(7.2n) lw(9.8n) cw(7.2n) cw(3.6n) cw(5.1n). -T{ -Name -T}@T{ -Purge -T}@T{ -Copy -T}@T{ -Move -T}@T{ -DirMove -T}@T{ -CleanUp -T}@T{ -ListR -T}@T{ -StreamUpload -T}@T{ -MultithreadUpload -T}@T{ -LinkSharing -T}@T{ -About -T}@T{ -EmptyDir -T} -_ -T{ -1Fichier -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -No -T}@T{ -Yes -T} -T{ -Akamai Netstorage -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T} -T{ -Amazon Drive -T}@T{ -Yes -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T} -T{ -Amazon S3 (or S3 compatible) -T}@T{ -No -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T} -T{ -Backblaze B2 -T}@T{ -No -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T} -T{ -Box -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes \[dd]\[dd] -T}@T{ -No -T}@T{ -Yes -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T} -T{ -Citrix ShareFile -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T} -T{ -Dropbox -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T} -T{ -Enterprise File Fabric -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T} -T{ -FTP -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T} -T{ -Google Cloud Storage -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T} -T{ -Google Drive -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T} -T{ -Google Photos -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T} -T{ -HDFS -T}@T{ -Yes -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T} -T{ -HiDrive -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T} -T{ -HTTP -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T} -T{ -Internet Archive -T}@T{ -No -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T} -T{ -Jottacloud -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T} -T{ -Koofr -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T} -T{ -Mail.ru Cloud -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T} -T{ -Mega -T}@T{ -Yes -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T} -T{ -Memory -T}@T{ -No -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T} -T{ -Microsoft Azure Blob Storage -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T} -T{ -Microsoft OneDrive -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T} -T{ -OpenDrive -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T} -T{ -OpenStack Swift -T}@T{ -Yes \[dg] -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -No -T} -T{ -Oracle Object Storage -T}@T{ -No -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T} -T{ -pCloud -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T} -T{ -PikPak -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T} -T{ -premiumize.me -T}@T{ -Yes -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T} -T{ -put.io -T}@T{ -Yes -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T} -T{ -Proton Drive -T}@T{ -Yes -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T} -T{ -QingStor -T}@T{ -No -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T} -T{ -Quatrix by Maytech -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T} -T{ -Seafile -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T} -T{ -SFTP -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T} -T{ -Sia -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T} -T{ -SMB -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T} -T{ -SugarSync -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -No -T}@T{ -Yes -T}@T{ -No -T}@T{ -Yes -T} -T{ -Storj -T}@T{ -Yes \[u2628] -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T} -T{ -Uptobox -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T} -T{ -WebDAV -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes \[dd] -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T} -T{ -Yandex Disk -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -Yes -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T} -T{ -Zoho WorkDrive -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T} -T{ -The local filesystem -T}@T{ -Yes -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T}@T{ -No -T}@T{ -Yes -T}@T{ -Yes -T} -.TE -.SS Purge -.PP -This deletes a directory quicker than just deleting all the files in the -directory. -.PP -\[dg] Note Swift implements this in order to delete directory markers -but they don\[aq]t actually have a quicker way of deleting files other -than deleting them individually. -.PP -\[u2628] Storj implements this efficiently only for entire buckets. -If purging a directory inside a bucket, files are deleted individually. -.PP -\[dd] StreamUpload is not supported with Nextcloud -.SS Copy -.PP -Used when copying an object to and from the same remote. -This known as a server-side copy so you can copy a file without -downloading it and uploading it again. -It is used if you use \f[C]rclone copy\f[R] or \f[C]rclone move\f[R] if -the remote doesn\[aq]t support \f[C]Move\f[R] directly. -.PP -If the server doesn\[aq]t support \f[C]Copy\f[R] directly then for copy -operations the file is downloaded then re-uploaded. -.SS Move -.PP -Used when moving/renaming an object on the same remote. -This is known as a server-side move of a file. -This is used in \f[C]rclone move\f[R] if the server doesn\[aq]t support -\f[C]DirMove\f[R]. -.PP -If the server isn\[aq]t capable of \f[C]Move\f[R] then rclone simulates -it with \f[C]Copy\f[R] then delete. -If the server doesn\[aq]t support \f[C]Copy\f[R] then rclone will -download the file and re-upload it. -.SS DirMove -.PP -This is used to implement \f[C]rclone move\f[R] to move a directory if -possible. -If it isn\[aq]t then it will use \f[C]Move\f[R] on each file (which -falls back to \f[C]Copy\f[R] then download and upload - see -\f[C]Move\f[R] section). -.SS CleanUp -.PP -This is used for emptying the trash for a remote by -\f[C]rclone cleanup\f[R]. -.PP -If the server can\[aq]t do \f[C]CleanUp\f[R] then -\f[C]rclone cleanup\f[R] will return an error. -.PP -\[dd]\[dd] Note that while Box implements this it has to delete every -file individually so it will be slower than emptying the trash via the -WebUI -.SS ListR -.PP -The remote supports a recursive list to list all the contents beneath a -directory quickly. -This enables the \f[C]--fast-list\f[R] flag to work. -See the rclone docs (https://rclone.org/docs/#fast-list) for more -details. -.SS StreamUpload -.PP -Some remotes allow files to be uploaded without knowing the file size in -advance. -This allows certain operations to work without spooling the file to -local disk first, e.g. -\f[C]rclone rcat\f[R]. -.SS MultithreadUpload -.PP -Some remotes allow transfers to the remote to be sent as chunks in -parallel. -If this is supported then rclone will use multi-thread copying to -transfer files much faster. -.SS LinkSharing -.PP -Sets the necessary permissions on a file or folder and prints a link -that allows others to access them, even if they don\[aq]t have an -account on the particular cloud provider. -.SS About -.PP -Rclone \f[C]about\f[R] prints quota information for a remote. -Typical output includes bytes used, free, quota and in trash. -.PP -If a remote lacks about capability \f[C]rclone about remote:\f[R]returns -an error. -.PP -Backends without about capability cannot determine free space for an -rclone mount, or use policy \f[C]mfs\f[R] (most free space) as a member -of an rclone union remote. -.PP -See rclone about command (https://rclone.org/commands/rclone_about/) -.SS EmptyDir -.PP -The remote supports empty directories. -See Limitations (https://rclone.org/bugs/#limitations) for details. -Most Object/Bucket-based remotes do not support this. -.SH Global Flags -.PP -This describes the global flags available to every rclone command split -into groups. -.SS Copy -.PP -Flags for anything which can Copy a file. -.IP -.nf -\f[C] - --check-first Do all the checks before starting transfers - -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). - --compare-dest stringArray Include additional comma separated server-side paths during comparison - --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination - --cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default \[dq]HARD\[dq]) - --ignore-case-sync Ignore case when synchronizing - --ignore-checksum Skip post copy check of checksums - --ignore-existing Skip all files that exist on destination - --ignore-size Ignore size when skipping use mod-time or checksum - -I, --ignore-times Don\[aq]t skip files that match size and time - transfer all files - --immutable Do not modify files, fail if existing files have been modified - --inplace Download directly to destination file instead of atomic download to temp/rename - --max-backlog int Maximum number of objects in sync or check backlog (default 10000) - --max-duration Duration Maximum duration rclone will transfer data for (default 0s) - --max-transfer SizeSuffix Maximum size of data to transfer (default off) - -M, --metadata If set, preserve metadata when copying objects - --modify-window Duration Max time diff to be considered the same (default 1ns) - --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) - --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) - --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) - --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) - --no-check-dest Don\[aq]t check the destination, copy regardless - --no-traverse Don\[aq]t traverse destination file system on copy - --no-update-modtime Don\[aq]t update destination mod-time if files identical - --order-by string Instructions on how to order the transfers, e.g. \[aq]size,descending\[aq] - --refresh-times Refresh the modtime of remote files - --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs - --size-only Skip based on size only, not mod-time or checksum - --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) - -u, --update Skip files that are newer on the destination -\f[R] -.fi -.SS Sync -.PP -Flags just used for \f[C]rclone sync\f[R]. -.IP -.nf -\f[C] - --backup-dir string Make backups into hierarchy based in DIR - --delete-after When synchronizing, delete files on destination after transferring (default) - --delete-before When synchronizing, delete files on destination before transferring - --delete-during When synchronizing, delete files during transfer - --ignore-errors Delete even if there are I/O errors - --max-delete int When synchronizing, limit the number of deletes (default -1) - --max-delete-size SizeSuffix When synchronizing, limit the total size of deletes (default off) - --suffix string Suffix to add to changed files - --suffix-keep-extension Preserve the extension when using --suffix - --track-renames When synchronizing, track file renames and do a server-side move if possible - --track-renames-strategy string Strategies to use when synchronizing using track-renames hash|modtime|leaf (default \[dq]hash\[dq]) -\f[R] -.fi -.SS Important -.PP -Important flags useful for most commands. -.IP -.nf -\f[C] - -n, --dry-run Do a trial run with no permanent changes - -i, --interactive Enable interactive mode - -v, --verbose count Print lots more stuff (repeat for more) -\f[R] -.fi -.SS Check -.PP -Flags used for \f[C]rclone check\f[R]. -.IP -.nf -\f[C] - --max-backlog int Maximum number of objects in sync or check backlog (default 10000) -\f[R] -.fi -.SS Networking -.PP -General networking and HTTP stuff. -.IP -.nf -\f[C] - --bind string Local address to bind to for outgoing connections, IPv4, IPv6 or name - --bwlimit BwTimetable Bandwidth limit in KiB/s, or use suffix B|K|M|G|T|P or a full timetable - --bwlimit-file BwTimetable Bandwidth limit per file in KiB/s, or use suffix B|K|M|G|T|P or a full timetable - --ca-cert stringArray CA certificate used to verify servers - --client-cert string Client SSL certificate (PEM) for mutual TLS auth - --client-key string Client SSL private key (PEM) for mutual TLS auth - --contimeout Duration Connect timeout (default 1m0s) - --disable-http-keep-alives Disable HTTP keep-alives and use each connection once. - --disable-http2 Disable HTTP/2 in the global transport - --dscp string Set DSCP value to connections, value or name, e.g. CS1, LE, DF, AF21 - --expect-continue-timeout Duration Timeout when using expect / 100-continue in HTTP (default 1s) - --header stringArray Set HTTP header for all transactions - --header-download stringArray Set HTTP header for download transactions - --header-upload stringArray Set HTTP header for upload transactions - --no-check-certificate Do not verify the server SSL certificate (insecure) - --no-gzip-encoding Don\[aq]t set Accept-Encoding: gzip - --timeout Duration IO idle timeout (default 5m0s) - --tpslimit float Limit HTTP transactions per second to this - --tpslimit-burst int Max burst of transactions for --tpslimit (default 1) - --use-cookies Enable session cookiejar - --user-agent string Set the user-agent to a specified string (default \[dq]rclone/v1.64.0\[dq]) -\f[R] -.fi -.SS Performance -.PP -Flags helpful for increasing performance. -.IP -.nf -\f[C] - --buffer-size SizeSuffix In memory buffer size when reading files for each --transfer (default 16Mi) - --checkers int Number of checkers to run in parallel (default 8) - --transfers int Number of file transfers to run in parallel (default 4) -\f[R] -.fi -.SS Config -.PP -General configuration of rclone. -.IP -.nf -\f[C] - --ask-password Allow prompt for password for encrypted configuration (default true) - --auto-confirm If enabled, do not request console confirmation - --cache-dir string Directory rclone will use for caching (default \[dq]$HOME/.cache/rclone\[dq]) - --color string When to show colors (and other ANSI codes) AUTO|NEVER|ALWAYS (default \[dq]AUTO\[dq]) - --config string Config file (default \[dq]$HOME/.config/rclone/rclone.conf\[dq]) - --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) - --disable string Disable a comma separated list of features (use --disable help to see a list) - -n, --dry-run Do a trial run with no permanent changes - --error-on-no-transfer Sets exit code 9 if no files are transferred, useful in scripts - --fs-cache-expire-duration Duration Cache remotes for this long (0 to disable caching) (default 5m0s) - --fs-cache-expire-interval Duration Interval to check for expired remotes (default 1m0s) - --human-readable Print numbers in a human-readable format, sizes with suffix Ki|Mi|Gi|Ti|Pi - -i, --interactive Enable interactive mode - --kv-lock-time Duration Maximum time to keep key-value database locked by process (default 1s) - --low-level-retries int Number of low level retries to do (default 10) - --no-console Hide console window (supported on Windows only) - --no-unicode-normalization Don\[aq]t normalize unicode characters in filenames - --password-command SpaceSepList Command for supplying password for encrypted configuration - --retries int Retry operations this many times if they fail (default 3) - --retries-sleep Duration Interval between retrying operations if they fail, e.g. 500ms, 60s, 5m (0 to disable) (default 0s) - --temp-dir string Directory rclone will use for temporary files (default \[dq]/tmp\[dq]) - --use-mmap Use mmap allocator (see docs) - --use-server-modtime Use server modified time instead of object metadata -\f[R] -.fi -.SS Debugging -.PP -Flags for developers. -.IP -.nf -\f[C] - --cpuprofile string Write cpu profile to file - --dump DumpFlags List of items to dump from: headers,bodies,requests,responses,auth,filters,goroutines,openfiles - --dump-bodies Dump HTTP headers and bodies - may contain sensitive info - --dump-headers Dump HTTP headers - may contain sensitive info - --memprofile string Write memory profile to file -\f[R] -.fi -.SS Filter -.PP -Flags for filtering directory listings. -.IP -.nf -\f[C] - --delete-excluded Delete files on dest excluded from sync - --exclude stringArray Exclude files matching pattern - --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) - --exclude-if-present stringArray Exclude directories if filename is present - --files-from stringArray Read list of source-file names from file (use - to read from stdin) - --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) - -f, --filter stringArray Add a file filtering rule - --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) - --ignore-case Ignore case in filters (case insensitive) - --include stringArray Include files matching pattern - --include-from stringArray Read file include patterns from file (use - to read from stdin) - --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) - --max-depth int If set limits the recursion depth to this (default -1) - --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) - --metadata-exclude stringArray Exclude metadatas matching pattern - --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) - --metadata-filter stringArray Add a metadata filtering rule - --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) - --metadata-include stringArray Include metadatas matching pattern - --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) - --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) - --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) -\f[R] -.fi -.SS Listing -.PP -Flags for listing directories. -.IP -.nf -\f[C] - --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) - --fast-list Use recursive list if available; uses more memory but fewer transactions -\f[R] -.fi -.SS Logging -.PP -Logging and statistics. -.IP -.nf -\f[C] - --log-file string Log everything to this file - --log-format string Comma separated list of log format options (default \[dq]date,time\[dq]) - --log-level string Log level DEBUG|INFO|NOTICE|ERROR (default \[dq]NOTICE\[dq]) - --log-systemd Activate systemd integration for the logger - --max-stats-groups int Maximum number of stats groups to keep in memory, on max oldest is discarded (default 1000) - -P, --progress Show progress during transfer - --progress-terminal-title Show progress on the terminal title (requires -P/--progress) - -q, --quiet Print as little stuff as possible - --stats Duration Interval between printing stats, e.g. 500ms, 60s, 5m (0 to disable) (default 1m0s) - --stats-file-name-length int Max file name length in stats (0 for no limit) (default 45) - --stats-log-level string Log level to show --stats output DEBUG|INFO|NOTICE|ERROR (default \[dq]INFO\[dq]) - --stats-one-line Make the stats fit on one line - --stats-one-line-date Enable --stats-one-line and add current date/time prefix - --stats-one-line-date-format string Enable --stats-one-line-date and use custom formatted date: Enclose date string in double quotes (\[dq]), see https://golang.org/pkg/time/#Time.Format - --stats-unit string Show data rate in stats as either \[aq]bits\[aq] or \[aq]bytes\[aq] per second (default \[dq]bytes\[dq]) - --syslog Use Syslog for logging - --syslog-facility string Facility for syslog, e.g. KERN,USER,... (default \[dq]DAEMON\[dq]) - --use-json-log Use json log format - -v, --verbose count Print lots more stuff (repeat for more) -\f[R] -.fi -.SS Metadata -.PP -Flags to control metadata. -.IP -.nf -\f[C] - -M, --metadata If set, preserve metadata when copying objects - --metadata-exclude stringArray Exclude metadatas matching pattern - --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) - --metadata-filter stringArray Add a metadata filtering rule - --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) - --metadata-include stringArray Include metadatas matching pattern - --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) - --metadata-set stringArray Add metadata key=value when uploading -\f[R] -.fi -.SS RC -.PP -Flags to control the Remote Control API. -.IP -.nf -\f[C] - --rc Enable the remote control server - --rc-addr stringArray IPaddress:Port or :Port to bind server to (default [localhost:5572]) - --rc-allow-origin string Origin which cross-domain request (CORS) can be executed from - --rc-baseurl string Prefix for URLs - leave blank for root - --rc-cert string TLS PEM key (concatenation of certificate and CA certificate) - --rc-client-ca string Client certificate authority to verify clients with - --rc-enable-metrics Enable prometheus metrics on /metrics - --rc-files string Path to local files to serve on the HTTP server - --rc-htpasswd string A htpasswd file - if not provided no authentication is done - --rc-job-expire-duration Duration Expire finished async jobs older than this value (default 1m0s) - --rc-job-expire-interval Duration Interval to check for expired async jobs (default 10s) - --rc-key string TLS PEM Private key - --rc-max-header-bytes int Maximum size of request header (default 4096) - --rc-min-tls-version string Minimum TLS version that is acceptable (default \[dq]tls1.0\[dq]) - --rc-no-auth Don\[aq]t require auth for certain methods - --rc-pass string Password for authentication - --rc-realm string Realm for authentication - --rc-salt string Password hashing salt (default \[dq]dlPL2MqE\[dq]) - --rc-serve Enable the serving of remote objects - --rc-server-read-timeout Duration Timeout for server reading data (default 1h0m0s) - --rc-server-write-timeout Duration Timeout for server writing data (default 1h0m0s) - --rc-template string User-specified template - --rc-user string User name for authentication - --rc-web-fetch-url string URL to fetch the releases for webgui (default \[dq]https://api.github.com/repos/rclone/rclone-webui-react/releases/latest\[dq]) - --rc-web-gui Launch WebGUI on localhost - --rc-web-gui-force-update Force update to latest version of web gui - --rc-web-gui-no-open-browser Don\[aq]t open the browser automatically - --rc-web-gui-update Check and update to latest version of web gui -\f[R] -.fi -.SS Backend -.PP -Backend only flags. -These can be set in the config file also. -.IP -.nf -\f[C] - --acd-auth-url string Auth server URL - --acd-client-id string OAuth Client Id - --acd-client-secret string OAuth Client Secret - --acd-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) - --acd-templink-threshold SizeSuffix Files >= this size will be downloaded via their tempLink (default 9Gi) - --acd-token string OAuth Access Token as a JSON blob - --acd-token-url string Token server url - --acd-upload-wait-per-gb Duration Additional time per GiB to wait after a failed complete upload to see if it appears (default 3m0s) - --alias-remote string Remote or path to alias - --azureblob-access-tier string Access tier of blob: hot, cool or archive - --azureblob-account string Azure Storage Account Name - --azureblob-archive-tier-delete Delete archive tier blobs before overwriting - --azureblob-chunk-size SizeSuffix Upload chunk size (default 4Mi) - --azureblob-client-certificate-password string Password for the certificate file (optional) (obscured) - --azureblob-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key - --azureblob-client-id string The ID of the client in use - --azureblob-client-secret string One of the service principal\[aq]s client secrets - --azureblob-client-send-certificate-chain Send the certificate chain when using certificate auth - --azureblob-directory-markers Upload an empty object with a trailing slash when a new directory is created - --azureblob-disable-checksum Don\[aq]t store MD5 checksum with object metadata - --azureblob-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8) - --azureblob-endpoint string Endpoint for the service - --azureblob-env-auth Read credentials from runtime (environment variables, CLI or MSI) - --azureblob-key string Storage Account Shared Key - --azureblob-list-chunk int Size of blob list (default 5000) - --azureblob-msi-client-id string Object ID of the user-assigned MSI to use, if any - --azureblob-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any - --azureblob-msi-object-id string Object ID of the user-assigned MSI to use, if any - --azureblob-no-check-container If set, don\[aq]t attempt to check the container exists or create it - --azureblob-no-head-object If set, do not do HEAD before GET when getting objects - --azureblob-password string The user\[aq]s password (obscured) - --azureblob-public-access string Public access level of a container: blob or container - --azureblob-sas-url string SAS URL for container level access only - --azureblob-service-principal-file string Path to file containing credentials for use with a service principal - --azureblob-tenant string ID of the service principal\[aq]s tenant. Also called its directory ID - --azureblob-upload-concurrency int Concurrency for multipart uploads (default 16) - --azureblob-upload-cutoff string Cutoff for switching to chunked upload (<= 256 MiB) (deprecated) - --azureblob-use-emulator Uses local storage emulator if provided as \[aq]true\[aq] - --azureblob-use-msi Use a managed service identity to authenticate (only works in Azure) - --azureblob-username string User name (usually an email address) - --b2-account string Account ID or Application Key ID - --b2-chunk-size SizeSuffix Upload chunk size (default 96Mi) - --b2-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4Gi) - --b2-disable-checksum Disable checksums for large (> upload cutoff) files - --b2-download-auth-duration Duration Time before the authorization token will expire in s or suffix ms|s|m|h|d (default 1w) - --b2-download-url string Custom endpoint for downloads - --b2-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --b2-endpoint string Endpoint for the service - --b2-hard-delete Permanently delete files on remote removal, otherwise hide files - --b2-key string Application Key - --b2-test-mode string A flag string for X-Bz-Test-Mode header for debugging - --b2-upload-concurrency int Concurrency for multipart uploads (default 16) - --b2-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) - --b2-version-at Time Show file versions as they were at the specified time (default off) - --b2-versions Include old versions in directory listings - --box-access-token string Box App Primary Access Token - --box-auth-url string Auth server URL - --box-box-config-file string Box App config.json location - --box-box-sub-type string (default \[dq]user\[dq]) - --box-client-id string OAuth Client Id - --box-client-secret string OAuth Client Secret - --box-commit-retries int Max number of times to try committing a multipart file (default 100) - --box-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot) - --box-impersonate string Impersonate this user ID when using a service account - --box-list-chunk int Size of listing chunk 1-1000 (default 1000) - --box-owned-by string Only show items owned by the login (email address) passed in - --box-root-folder-id string Fill in for rclone to use a non root folder as its starting point - --box-token string OAuth Access Token as a JSON blob - --box-token-url string Token server url - --box-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (>= 50 MiB) (default 50Mi) - --cache-chunk-clean-interval Duration How often should the cache perform cleanups of the chunk storage (default 1m0s) - --cache-chunk-no-memory Disable the in-memory cache for storing chunks during streaming - --cache-chunk-path string Directory to cache chunk files (default \[dq]$HOME/.cache/rclone/cache-backend\[dq]) - --cache-chunk-size SizeSuffix The size of a chunk (partial file data) (default 5Mi) - --cache-chunk-total-size SizeSuffix The total size that the chunks can take up on the local disk (default 10Gi) - --cache-db-path string Directory to store file structure metadata DB (default \[dq]$HOME/.cache/rclone/cache-backend\[dq]) - --cache-db-purge Clear all the cached data for this remote on start - --cache-db-wait-time Duration How long to wait for the DB to be available - 0 is unlimited (default 1s) - --cache-info-age Duration How long to cache file structure information (directory listings, file size, times, etc.) (default 6h0m0s) - --cache-plex-insecure string Skip all certificate verification when connecting to the Plex server - --cache-plex-password string The password of the Plex user (obscured) - --cache-plex-url string The URL of the Plex server - --cache-plex-username string The username of the Plex user - --cache-read-retries int How many times to retry a read from a cache storage (default 10) - --cache-remote string Remote to cache - --cache-rps int Limits the number of requests per second to the source FS (-1 to disable) (default -1) - --cache-tmp-upload-path string Directory to keep temporary files until they are uploaded - --cache-tmp-wait-time Duration How long should files be stored in local cache before being uploaded (default 15s) - --cache-workers int How many workers should run in parallel to download chunks (default 4) - --cache-writes Cache file data on writes through the FS - --chunker-chunk-size SizeSuffix Files larger than chunk size will be split in chunks (default 2Gi) - --chunker-fail-hard Choose how chunker should handle files with missing or invalid chunks - --chunker-hash-type string Choose how chunker handles hash sums (default \[dq]md5\[dq]) - --chunker-remote string Remote to chunk/unchunk - --combine-upstreams SpaceSepList Upstreams for combining - --compress-level int GZIP compression level (-2 to 9) (default -1) - --compress-mode string Compression mode (default \[dq]gzip\[dq]) - --compress-ram-cache-limit SizeSuffix Some remotes don\[aq]t allow the upload of files with unknown size (default 20Mi) - --compress-remote string Remote to compress - -L, --copy-links Follow symlinks and copy the pointed to item - --crypt-directory-name-encryption Option to either encrypt directory names or leave them intact (default true) - --crypt-filename-encoding string How to encode the encrypted filename to text string (default \[dq]base32\[dq]) - --crypt-filename-encryption string How to encrypt the filenames (default \[dq]standard\[dq]) - --crypt-no-data-encryption Option to either encrypt file data or leave it unencrypted - --crypt-pass-bad-blocks If set this will pass bad blocks through as all 0 - --crypt-password string Password or pass phrase for encryption (obscured) - --crypt-password2 string Password or pass phrase for salt (obscured) - --crypt-remote string Remote to encrypt/decrypt - --crypt-server-side-across-configs Deprecated: use --server-side-across-configs instead - --crypt-show-mapping For all files listed show how the names encrypt - --crypt-suffix string If this is set it will override the default suffix of \[dq].bin\[dq] (default \[dq].bin\[dq]) - --drive-acknowledge-abuse Set to allow files which return cannotDownloadAbusiveFile to be downloaded - --drive-allow-import-name-change Allow the filetype to change when uploading Google docs - --drive-auth-owner-only Only consider files owned by the authenticated user - --drive-auth-url string Auth server URL - --drive-chunk-size SizeSuffix Upload chunk size (default 8Mi) - --drive-client-id string Google Application Client Id - --drive-client-secret string OAuth Client Secret - --drive-copy-shortcut-content Server side copy contents of shortcuts instead of the shortcut - --drive-disable-http2 Disable drive using http2 (default true) - --drive-encoding MultiEncoder The encoding for the backend (default InvalidUtf8) - --drive-env-auth Get IAM credentials from runtime (environment variables or instance meta data if no env vars) - --drive-export-formats string Comma separated list of preferred formats for downloading Google docs (default \[dq]docx,xlsx,pptx,svg\[dq]) - --drive-fast-list-bug-fix Work around a bug in Google Drive listing (default true) - --drive-formats string Deprecated: See export_formats - --drive-impersonate string Impersonate this user when using a service account - --drive-import-formats string Comma separated list of preferred formats for uploading Google docs - --drive-keep-revision-forever Keep new head revision of each file forever - --drive-list-chunk int Size of listing chunk 100-1000, 0 to disable (default 1000) - --drive-pacer-burst int Number of API calls to allow without sleeping (default 100) - --drive-pacer-min-sleep Duration Minimum time to sleep between API calls (default 100ms) - --drive-resource-key string Resource key for accessing a link-shared file - --drive-root-folder-id string ID of the root folder - --drive-scope string Scope that rclone should use when requesting access from drive - --drive-server-side-across-configs Deprecated: use --server-side-across-configs instead - --drive-service-account-credentials string Service Account Credentials JSON blob - --drive-service-account-file string Service Account Credentials JSON file path - --drive-shared-with-me Only show files that are shared with me - --drive-size-as-quota Show sizes as storage quota usage, not actual size - --drive-skip-checksum-gphotos Skip MD5 checksum on Google photos and videos only - --drive-skip-dangling-shortcuts If set skip dangling shortcut files - --drive-skip-gdocs Skip google documents in all listings - --drive-skip-shortcuts If set skip shortcut files - --drive-starred-only Only show files that are starred - --drive-stop-on-download-limit Make download limit errors be fatal - --drive-stop-on-upload-limit Make upload limit errors be fatal - --drive-team-drive string ID of the Shared Drive (Team Drive) - --drive-token string OAuth Access Token as a JSON blob - --drive-token-url string Token server url - --drive-trashed-only Only show files that are in the trash - --drive-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 8Mi) - --drive-use-created-date Use file created date instead of modified date - --drive-use-shared-date Use date file was shared instead of modified date - --drive-use-trash Send files to the trash instead of deleting permanently (default true) - --drive-v2-download-min-size SizeSuffix If Object\[aq]s are greater, use drive v2 API to download (default off) - --dropbox-auth-url string Auth server URL - --dropbox-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) - --dropbox-batch-mode string Upload file batching sync|async|off (default \[dq]sync\[dq]) - --dropbox-batch-size int Max number of files in upload batch - --dropbox-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) - --dropbox-chunk-size SizeSuffix Upload chunk size (< 150Mi) (default 48Mi) - --dropbox-client-id string OAuth Client Id - --dropbox-client-secret string OAuth Client Secret - --dropbox-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot) - --dropbox-impersonate string Impersonate this user when using a business account - --dropbox-pacer-min-sleep Duration Minimum time to sleep between API calls (default 10ms) - --dropbox-shared-files Instructs rclone to work on individual shared files - --dropbox-shared-folders Instructs rclone to work on shared folders - --dropbox-token string OAuth Access Token as a JSON blob - --dropbox-token-url string Token server url - --fichier-api-key string Your API Key, get it from https://1fichier.com/console/params.pl - --fichier-cdn Set if you wish to use CDN download links - --fichier-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot) - --fichier-file-password string If you want to download a shared file that is password protected, add this parameter (obscured) - --fichier-folder-password string If you want to list the files in a shared folder that is password protected, add this parameter (obscured) - --fichier-shared-folder string If you want to download a shared folder, add this parameter - --filefabric-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) - --filefabric-permanent-token string Permanent Authentication Token - --filefabric-root-folder-id string ID of the root folder - --filefabric-token string Session Token - --filefabric-token-expiry string Token expiry time - --filefabric-url string URL of the Enterprise File Fabric to connect to - --filefabric-version string Version read from the file fabric - --ftp-ask-password Allow asking for FTP password when needed - --ftp-close-timeout Duration Maximum time to wait for a response to close (default 1m0s) - --ftp-concurrency int Maximum number of FTP simultaneous connections, 0 for unlimited - --ftp-disable-epsv Disable using EPSV even if server advertises support - --ftp-disable-mlsd Disable using MLSD even if server advertises support - --ftp-disable-tls13 Disable TLS 1.3 (workaround for FTP servers with buggy TLS) - --ftp-disable-utf8 Disable using UTF-8 even if server advertises support - --ftp-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,RightSpace,Dot) - --ftp-explicit-tls Use Explicit FTPS (FTP over TLS) - --ftp-force-list-hidden Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD - --ftp-host string FTP host to connect to - --ftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) - --ftp-no-check-certificate Do not verify the TLS certificate of the server - --ftp-pass string FTP password (obscured) - --ftp-port int FTP port number (default 21) - --ftp-shut-timeout Duration Maximum time to wait for data connection closing status (default 1m0s) - --ftp-socks-proxy string Socks 5 proxy host - --ftp-tls Use Implicit FTPS (FTP over TLS) - --ftp-tls-cache-size int Size of TLS session cache for all control and data connections (default 32) - --ftp-user string FTP username (default \[dq]$USER\[dq]) - --ftp-writing-mdtm Use MDTM to set modification time (VsFtpd quirk) - --gcs-anonymous Access public buckets and objects without credentials - --gcs-auth-url string Auth server URL - --gcs-bucket-acl string Access Control List for new buckets - --gcs-bucket-policy-only Access checks should use bucket-level IAM policies - --gcs-client-id string OAuth Client Id - --gcs-client-secret string OAuth Client Secret - --gcs-decompress If set this will decompress gzip encoded objects - --gcs-directory-markers Upload an empty object with a trailing slash when a new directory is created - --gcs-encoding MultiEncoder The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) - --gcs-endpoint string Endpoint for the service - --gcs-env-auth Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars) - --gcs-location string Location for the newly created buckets - --gcs-no-check-bucket If set, don\[aq]t attempt to check the bucket exists or create it - --gcs-object-acl string Access Control List for new objects - --gcs-project-number string Project number - --gcs-service-account-file string Service Account Credentials JSON file path - --gcs-storage-class string The storage class to use when storing objects in Google Cloud Storage - --gcs-token string OAuth Access Token as a JSON blob - --gcs-token-url string Token server url - --gcs-user-project string User project - --gphotos-auth-url string Auth server URL - --gphotos-client-id string OAuth Client Id - --gphotos-client-secret string OAuth Client Secret - --gphotos-encoding MultiEncoder The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) - --gphotos-include-archived Also view and download archived media - --gphotos-read-only Set to make the Google Photos backend read only - --gphotos-read-size Set to read the size of media items - --gphotos-start-year int Year limits the photos to be downloaded to those which are uploaded after the given year (default 2000) - --gphotos-token string OAuth Access Token as a JSON blob - --gphotos-token-url string Token server url - --hasher-auto-size SizeSuffix Auto-update checksum for files smaller than this size (disabled by default) - --hasher-hashes CommaSepList Comma separated list of supported checksum types (default md5,sha1) - --hasher-max-age Duration Maximum time to keep checksums in cache (0 = no cache, off = cache forever) (default off) - --hasher-remote string Remote to cache checksums for (e.g. myRemote:path) - --hdfs-data-transfer-protection string Kerberos data transfer protection: authentication|integrity|privacy - --hdfs-encoding MultiEncoder The encoding for the backend (default Slash,Colon,Del,Ctl,InvalidUtf8,Dot) - --hdfs-namenode string Hadoop name node and port - --hdfs-service-principal-name string Kerberos service principal name for the namenode - --hdfs-username string Hadoop user name - --hidrive-auth-url string Auth server URL - --hidrive-chunk-size SizeSuffix Chunksize for chunked uploads (default 48Mi) - --hidrive-client-id string OAuth Client Id - --hidrive-client-secret string OAuth Client Secret - --hidrive-disable-fetching-member-count Do not fetch number of objects in directories unless it is absolutely necessary - --hidrive-encoding MultiEncoder The encoding for the backend (default Slash,Dot) - --hidrive-endpoint string Endpoint for the service (default \[dq]https://api.hidrive.strato.com/2.1\[dq]) - --hidrive-root-prefix string The root/parent folder for all paths (default \[dq]/\[dq]) - --hidrive-scope-access string Access permissions that rclone should use when requesting access from HiDrive (default \[dq]rw\[dq]) - --hidrive-scope-role string User-level that rclone should use when requesting access from HiDrive (default \[dq]user\[dq]) - --hidrive-token string OAuth Access Token as a JSON blob - --hidrive-token-url string Token server url - --hidrive-upload-concurrency int Concurrency for chunked uploads (default 4) - --hidrive-upload-cutoff SizeSuffix Cutoff/Threshold for chunked uploads (default 96Mi) - --http-headers CommaSepList Set HTTP headers for all transactions - --http-no-head Don\[aq]t use HEAD requests - --http-no-slash Set this if the site doesn\[aq]t end directories with / - --http-url string URL of HTTP host to connect to - --internetarchive-access-key-id string IAS3 Access Key - --internetarchive-disable-checksum Don\[aq]t ask the server to test against MD5 checksum calculated by rclone (default true) - --internetarchive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot) - --internetarchive-endpoint string IAS3 Endpoint (default \[dq]https://s3.us.archive.org\[dq]) - --internetarchive-front-endpoint string Host of InternetArchive Frontend (default \[dq]https://archive.org\[dq]) - --internetarchive-secret-access-key string IAS3 Secret Key (password) - --internetarchive-wait-archive Duration Timeout for waiting the server\[aq]s processing tasks (specifically archive and book_op) to finish (default 0s) - --jottacloud-auth-url string Auth server URL - --jottacloud-client-id string OAuth Client Id - --jottacloud-client-secret string OAuth Client Secret - --jottacloud-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot) - --jottacloud-hard-delete Delete files permanently rather than putting them into the trash - --jottacloud-md5-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate the MD5 if required (default 10Mi) - --jottacloud-no-versions Avoid server side versioning by deleting files and recreating files instead of overwriting them - --jottacloud-token string OAuth Access Token as a JSON blob - --jottacloud-token-url string Token server url - --jottacloud-trashed-only Only show files that are in the trash - --jottacloud-upload-resume-limit SizeSuffix Files bigger than this can be resumed if the upload fail\[aq]s (default 10Mi) - --koofr-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --koofr-endpoint string The Koofr API endpoint to use - --koofr-mountid string Mount ID of the mount to use - --koofr-password string Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password) (obscured) - --koofr-provider string Choose your storage provider - --koofr-setmtime Does the backend support setting modification time (default true) - --koofr-user string Your user name - -l, --links Translate symlinks to/from regular files with a \[aq].rclonelink\[aq] extension - --local-case-insensitive Force the filesystem to report itself as case insensitive - --local-case-sensitive Force the filesystem to report itself as case sensitive - --local-encoding MultiEncoder The encoding for the backend (default Slash,Dot) - --local-no-check-updated Don\[aq]t check to see if the files change during upload - --local-no-preallocate Disable preallocation of disk space for transferred files - --local-no-set-modtime Disable setting modtime - --local-no-sparse Disable sparse files for multi-thread downloads - --local-nounc Disable UNC (long path names) conversion on Windows - --local-unicode-normalization Apply unicode NFC normalization to paths and filenames - --local-zero-size-links Assume the Stat size of links is zero (and read them instead) (deprecated) - --mailru-auth-url string Auth server URL - --mailru-check-hash What should copy do if file checksum is mismatched or invalid (default true) - --mailru-client-id string OAuth Client Id - --mailru-client-secret string OAuth Client Secret - --mailru-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --mailru-pass string Password (obscured) - --mailru-speedup-enable Skip full upload if there is another file with same data hash (default true) - --mailru-speedup-file-patterns string Comma separated list of file name patterns eligible for speedup (put by hash) (default \[dq]*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf\[dq]) - --mailru-speedup-max-disk SizeSuffix This option allows you to disable speedup (put by hash) for large files (default 3Gi) - --mailru-speedup-max-memory SizeSuffix Files larger than the size given below will always be hashed on disk (default 32Mi) - --mailru-token string OAuth Access Token as a JSON blob - --mailru-token-url string Token server url - --mailru-user string User name (usually email) - --mega-debug Output more debug from Mega - --mega-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) - --mega-hard-delete Delete files permanently rather than putting them into the trash - --mega-pass string Password (obscured) - --mega-use-https Use HTTPS for transfers - --mega-user string User name - --netstorage-account string Set the NetStorage account name - --netstorage-host string Domain+path of NetStorage host to connect to - --netstorage-protocol string Select between HTTP or HTTPS protocol (default \[dq]https\[dq]) - --netstorage-secret string Set the NetStorage account secret/G2O key for authentication (obscured) - -x, --one-file-system Don\[aq]t cross filesystem boundaries (unix/macOS only) - --onedrive-access-scopes SpaceSepList Set scopes to be requested by rclone (default Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All Sites.Read.All offline_access) - --onedrive-auth-url string Auth server URL - --onedrive-av-override Allows download of files the server thinks has a virus - --onedrive-chunk-size SizeSuffix Chunk size to upload files with - must be multiple of 320k (327,680 bytes) (default 10Mi) - --onedrive-client-id string OAuth Client Id - --onedrive-client-secret string OAuth Client Secret - --onedrive-drive-id string The ID of the drive to use - --onedrive-drive-type string The type of the drive (personal | business | documentLibrary) - --onedrive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot) - --onedrive-expose-onenote-files Set to make OneNote files show up in directory listings - --onedrive-hash-type string Specify the hash in use for the backend (default \[dq]auto\[dq]) - --onedrive-link-password string Set the password for links created by the link command - --onedrive-link-scope string Set the scope of the links created by the link command (default \[dq]anonymous\[dq]) - --onedrive-link-type string Set the type of the links created by the link command (default \[dq]view\[dq]) - --onedrive-list-chunk int Size of listing chunk (default 1000) - --onedrive-no-versions Remove all versions on modifying operations - --onedrive-region string Choose national cloud region for OneDrive (default \[dq]global\[dq]) - --onedrive-root-folder-id string ID of the root folder - --onedrive-server-side-across-configs Deprecated: use --server-side-across-configs instead - --onedrive-token string OAuth Access Token as a JSON blob - --onedrive-token-url string Token server url - --oos-attempt-resume-upload If true attempt to resume previously started multipart upload for the object - --oos-chunk-size SizeSuffix Chunk size to use for uploading (default 5Mi) - --oos-compartment string Object storage compartment OCID - --oos-config-file string Path to OCI config file (default \[dq]\[ti]/.oci/config\[dq]) - --oos-config-profile string Profile name inside the oci config file (default \[dq]Default\[dq]) - --oos-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) - --oos-copy-timeout Duration Timeout for copy (default 1m0s) - --oos-disable-checksum Don\[aq]t store MD5 checksum with object metadata - --oos-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) - --oos-endpoint string Endpoint for Object storage API - --oos-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts for manual recovery - --oos-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) - --oos-namespace string Object storage namespace - --oos-no-check-bucket If set, don\[aq]t attempt to check the bucket exists or create it - --oos-provider string Choose your Auth Provider (default \[dq]env_auth\[dq]) - --oos-region string Object storage Region - --oos-sse-customer-algorithm string If using SSE-C, the optional header that specifies \[dq]AES256\[dq] as the encryption algorithm - --oos-sse-customer-key string To use SSE-C, the optional header that specifies the base64-encoded 256-bit encryption key to use to - --oos-sse-customer-key-file string To use SSE-C, a file containing the base64-encoded string of the AES-256 encryption key associated - --oos-sse-customer-key-sha256 string If using SSE-C, The optional header that specifies the base64-encoded SHA256 hash of the encryption - --oos-sse-kms-key-id string if using your own master key in vault, this header specifies the - --oos-storage-tier string The storage class to use when storing new objects in storage. https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/understandingstoragetiers.htm (default \[dq]Standard\[dq]) - --oos-upload-concurrency int Concurrency for multipart uploads (default 10) - --oos-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) - --opendrive-chunk-size SizeSuffix Files will be uploaded in chunks this size (default 10Mi) - --opendrive-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot) - --opendrive-password string Password (obscured) - --opendrive-username string Username - --pcloud-auth-url string Auth server URL - --pcloud-client-id string OAuth Client Id - --pcloud-client-secret string OAuth Client Secret - --pcloud-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --pcloud-hostname string Hostname to connect to (default \[dq]api.pcloud.com\[dq]) - --pcloud-password string Your pcloud password (obscured) - --pcloud-root-folder-id string Fill in for rclone to use a non root folder as its starting point (default \[dq]d0\[dq]) - --pcloud-token string OAuth Access Token as a JSON blob - --pcloud-token-url string Token server url - --pcloud-username string Your pcloud username - --pikpak-auth-url string Auth server URL - --pikpak-client-id string OAuth Client Id - --pikpak-client-secret string OAuth Client Secret - --pikpak-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot) - --pikpak-hash-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate hash if required (default 10Mi) - --pikpak-pass string Pikpak password (obscured) - --pikpak-root-folder-id string ID of the root folder - --pikpak-token string OAuth Access Token as a JSON blob - --pikpak-token-url string Token server url - --pikpak-trashed-only Only show files that are in the trash - --pikpak-use-trash Send files to the trash instead of deleting permanently (default true) - --pikpak-user string Pikpak username - --premiumizeme-auth-url string Auth server URL - --premiumizeme-client-id string OAuth Client Id - --premiumizeme-client-secret string OAuth Client Secret - --premiumizeme-encoding MultiEncoder The encoding for the backend (default Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --premiumizeme-token string OAuth Access Token as a JSON blob - --premiumizeme-token-url string Token server url - --protondrive-2fa string The 2FA code - --protondrive-app-version string The app version string (default \[dq]macos-drive\[at]1.0.0-alpha.1+rclone\[dq]) - --protondrive-enable-caching Caches the files and folders metadata to reduce API calls (default true) - --protondrive-encoding MultiEncoder The encoding for the backend (default Slash,LeftSpace,RightSpace,InvalidUtf8,Dot) - --protondrive-mailbox-password string The mailbox password of your two-password proton account (obscured) - --protondrive-original-file-size Return the file size before encryption (default true) - --protondrive-password string The password of your proton account (obscured) - --protondrive-replace-existing-draft Create a new revision when filename conflict is detected - --protondrive-username string The username of your proton account - --putio-auth-url string Auth server URL - --putio-client-id string OAuth Client Id - --putio-client-secret string OAuth Client Secret - --putio-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --putio-token string OAuth Access Token as a JSON blob - --putio-token-url string Token server url - --qingstor-access-key-id string QingStor Access Key ID - --qingstor-chunk-size SizeSuffix Chunk size to use for uploading (default 4Mi) - --qingstor-connection-retries int Number of connection retries (default 3) - --qingstor-encoding MultiEncoder The encoding for the backend (default Slash,Ctl,InvalidUtf8) - --qingstor-endpoint string Enter an endpoint URL to connection QingStor API - --qingstor-env-auth Get QingStor credentials from runtime - --qingstor-secret-access-key string QingStor Secret Access Key (password) - --qingstor-upload-concurrency int Concurrency for multipart uploads (default 1) - --qingstor-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) - --qingstor-zone string Zone to connect to - --quatrix-api-key string API key for accessing Quatrix account - --quatrix-effective-upload-time string Wanted upload time for one chunk (default \[dq]4s\[dq]) - --quatrix-encoding MultiEncoder The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) - --quatrix-hard-delete Delete files permanently rather than putting them into the trash - --quatrix-host string Host name of Quatrix account - --quatrix-maximal-summary-chunk-size SizeSuffix The maximal summary for all chunks. It should not be less than \[aq]transfers\[aq]*\[aq]minimal_chunk_size\[aq] (default 95.367Mi) - --quatrix-minimal-chunk-size SizeSuffix The minimal size for one chunk (default 9.537Mi) - --s3-access-key-id string AWS Access Key ID - --s3-acl string Canned ACL used when creating buckets and storing or copying objects - --s3-bucket-acl string Canned ACL used when creating buckets - --s3-chunk-size SizeSuffix Chunk size to use for uploading (default 5Mi) - --s3-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) - --s3-decompress If set this will decompress gzip encoded objects - --s3-directory-markers Upload an empty object with a trailing slash when a new directory is created - --s3-disable-checksum Don\[aq]t store MD5 checksum with object metadata - --s3-disable-http2 Disable usage of http2 for S3 backends - --s3-download-url string Custom endpoint for downloads - --s3-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8,Dot) - --s3-endpoint string Endpoint for S3 API - --s3-env-auth Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars) - --s3-force-path-style If true use path style access if false use virtual hosted style (default true) - --s3-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery - --s3-list-chunk int Size of listing chunk (response list for each ListObject S3 request) (default 1000) - --s3-list-url-encode Tristate Whether to url encode listings: true/false/unset (default unset) - --s3-list-version int Version of ListObjects to use: 1,2 or 0 for auto - --s3-location-constraint string Location constraint - must be set to match the Region - --s3-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) - --s3-might-gzip Tristate Set this if the backend might gzip objects (default unset) - --s3-no-check-bucket If set, don\[aq]t attempt to check the bucket exists or create it - --s3-no-head If set, don\[aq]t HEAD uploaded objects to check integrity - --s3-no-head-object If set, do not do HEAD before GET when getting objects - --s3-no-system-metadata Suppress setting and reading of system metadata - --s3-profile string Profile to use in the shared credentials file - --s3-provider string Choose your S3 provider - --s3-region string Region to connect to - --s3-requester-pays Enables requester pays option when interacting with S3 bucket - --s3-secret-access-key string AWS Secret Access Key (password) - --s3-server-side-encryption string The server-side encryption algorithm used when storing this object in S3 - --s3-session-token string An AWS session token - --s3-shared-credentials-file string Path to the shared credentials file - --s3-sse-customer-algorithm string If using SSE-C, the server-side encryption algorithm used when storing this object in S3 - --s3-sse-customer-key string To use SSE-C you may provide the secret encryption key used to encrypt/decrypt your data - --s3-sse-customer-key-base64 string If using SSE-C you must provide the secret encryption key encoded in base64 format to encrypt/decrypt your data - --s3-sse-customer-key-md5 string If using SSE-C you may provide the secret encryption key MD5 checksum (optional) - --s3-sse-kms-key-id string If using KMS ID you must provide the ARN of Key - --s3-storage-class string The storage class to use when storing new objects in S3 - --s3-sts-endpoint string Endpoint for STS - --s3-upload-concurrency int Concurrency for multipart uploads (default 4) - --s3-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) - --s3-use-accelerate-endpoint If true use the AWS S3 accelerated endpoint - --s3-use-accept-encoding-gzip Accept-Encoding: gzip Whether to send Accept-Encoding: gzip header (default unset) - --s3-use-multipart-etag Tristate Whether to use ETag in multipart uploads for verification (default unset) - --s3-use-presigned-request Whether to use a presigned request or PutObject for single part uploads - --s3-v2-auth If true use v2 authentication - --s3-version-at Time Show file versions as they were at the specified time (default off) - --s3-versions Include old versions in directory listings - --seafile-2fa Two-factor authentication (\[aq]true\[aq] if the account has 2FA enabled) - --seafile-create-library Should rclone create a library if it doesn\[aq]t exist - --seafile-encoding MultiEncoder The encoding for the backend (default Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8) - --seafile-library string Name of the library - --seafile-library-key string Library password (for encrypted libraries only) (obscured) - --seafile-pass string Password (obscured) - --seafile-url string URL of seafile host to connect to - --seafile-user string User name (usually email address) - --sftp-ask-password Allow asking for SFTP password when needed - --sftp-chunk-size SizeSuffix Upload and download chunk size (default 32Ki) - --sftp-ciphers SpaceSepList Space separated list of ciphers to be used for session encryption, ordered by preference - --sftp-concurrency int The maximum number of outstanding requests for one file (default 64) - --sftp-disable-concurrent-reads If set don\[aq]t use concurrent reads - --sftp-disable-concurrent-writes If set don\[aq]t use concurrent writes - --sftp-disable-hashcheck Disable the execution of SSH commands to determine if remote file hashing is available - --sftp-host string SSH host to connect to - --sftp-host-key-algorithms SpaceSepList Space separated list of host key algorithms, ordered by preference - --sftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) - --sftp-key-exchange SpaceSepList Space separated list of key exchange algorithms, ordered by preference - --sftp-key-file string Path to PEM-encoded private key file - --sftp-key-file-pass string The passphrase to decrypt the PEM-encoded private key file (obscured) - --sftp-key-pem string Raw PEM-encoded private key - --sftp-key-use-agent When set forces the usage of the ssh-agent - --sftp-known-hosts-file string Optional path to known_hosts file - --sftp-macs SpaceSepList Space separated list of MACs (message authentication code) algorithms, ordered by preference - --sftp-md5sum-command string The command used to read md5 hashes - --sftp-pass string SSH password, leave blank to use ssh-agent (obscured) - --sftp-path-override string Override path used by SSH shell commands - --sftp-port int SSH port number (default 22) - --sftp-pubkey-file string Optional path to public key file - --sftp-server-command string Specifies the path or command to run a sftp server on the remote host - --sftp-set-env SpaceSepList Environment variables to pass to sftp and commands - --sftp-set-modtime Set the modified time on the remote if set (default true) - --sftp-sha1sum-command string The command used to read sha1 hashes - --sftp-shell-type string The type of SSH shell on remote server, if any - --sftp-skip-links Set to skip any symlinks and any other non regular files - --sftp-socks-proxy string Socks 5 proxy host - --sftp-ssh SpaceSepList Path and arguments to external ssh binary - --sftp-subsystem string Specifies the SSH2 subsystem on the remote host (default \[dq]sftp\[dq]) - --sftp-use-fstat If set use fstat instead of stat - --sftp-use-insecure-cipher Enable the use of insecure ciphers and key exchange methods - --sftp-user string SSH username (default \[dq]$USER\[dq]) - --sharefile-auth-url string Auth server URL - --sharefile-chunk-size SizeSuffix Upload chunk size (default 64Mi) - --sharefile-client-id string OAuth Client Id - --sharefile-client-secret string OAuth Client Secret - --sharefile-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot) - --sharefile-endpoint string Endpoint for API calls - --sharefile-root-folder-id string ID of the root folder - --sharefile-token string OAuth Access Token as a JSON blob - --sharefile-token-url string Token server url - --sharefile-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (default 128Mi) - --sia-api-password string Sia Daemon API Password (obscured) - --sia-api-url string Sia daemon API URL, like http://sia.daemon.host:9980 (default \[dq]http://127.0.0.1:9980\[dq]) - --sia-encoding MultiEncoder The encoding for the backend (default Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot) - --sia-user-agent string Siad User Agent (default \[dq]Sia-Agent\[dq]) - --skip-links Don\[aq]t warn about skipped symlinks - --smb-case-insensitive Whether the server is configured to be case-insensitive (default true) - --smb-domain string Domain name for NTLM authentication (default \[dq]WORKGROUP\[dq]) - --smb-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot) - --smb-hide-special-share Hide special shares (e.g. print$) which users aren\[aq]t supposed to access (default true) - --smb-host string SMB server hostname to connect to - --smb-idle-timeout Duration Max time before closing idle connections (default 1m0s) - --smb-pass string SMB password (obscured) - --smb-port int SMB port number (default 445) - --smb-spn string Service principal name - --smb-user string SMB username (default \[dq]$USER\[dq]) - --storj-access-grant string Access grant - --storj-api-key string API key - --storj-passphrase string Encryption passphrase - --storj-provider string Choose an authentication method (default \[dq]existing\[dq]) - --storj-satellite-address string Satellite address (default \[dq]us1.storj.io\[dq]) - --sugarsync-access-key-id string Sugarsync Access Key ID - --sugarsync-app-id string Sugarsync App ID - --sugarsync-authorization string Sugarsync authorization - --sugarsync-authorization-expiry string Sugarsync authorization expiry - --sugarsync-deleted-id string Sugarsync deleted folder id - --sugarsync-encoding MultiEncoder The encoding for the backend (default Slash,Ctl,InvalidUtf8,Dot) - --sugarsync-hard-delete Permanently delete files if true - --sugarsync-private-access-key string Sugarsync Private Access Key - --sugarsync-refresh-token string Sugarsync refresh token - --sugarsync-root-id string Sugarsync root id - --sugarsync-user string Sugarsync user - --swift-application-credential-id string Application Credential ID (OS_APPLICATION_CREDENTIAL_ID) - --swift-application-credential-name string Application Credential Name (OS_APPLICATION_CREDENTIAL_NAME) - --swift-application-credential-secret string Application Credential Secret (OS_APPLICATION_CREDENTIAL_SECRET) - --swift-auth string Authentication URL for server (OS_AUTH_URL) - --swift-auth-token string Auth Token from alternate authentication - optional (OS_AUTH_TOKEN) - --swift-auth-version int AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION) - --swift-chunk-size SizeSuffix Above this size files will be chunked into a _segments container (default 5Gi) - --swift-domain string User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME) - --swift-encoding MultiEncoder The encoding for the backend (default Slash,InvalidUtf8) - --swift-endpoint-type string Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE) (default \[dq]public\[dq]) - --swift-env-auth Get swift credentials from environment variables in standard OpenStack form - --swift-key string API key or password (OS_PASSWORD) - --swift-leave-parts-on-error If true avoid calling abort upload on a failure - --swift-no-chunk Don\[aq]t chunk files during streaming upload - --swift-no-large-objects Disable support for static and dynamic large objects - --swift-region string Region name - optional (OS_REGION_NAME) - --swift-storage-policy string The storage policy to use when creating a new container - --swift-storage-url string Storage URL - optional (OS_STORAGE_URL) - --swift-tenant string Tenant name - optional for v1 auth, this or tenant_id required otherwise (OS_TENANT_NAME or OS_PROJECT_NAME) - --swift-tenant-domain string Tenant domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME) - --swift-tenant-id string Tenant ID - optional for v1 auth, this or tenant required otherwise (OS_TENANT_ID) - --swift-user string User name to log in (OS_USERNAME) - --swift-user-id string User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) (OS_USER_ID) - --union-action-policy string Policy to choose upstream on ACTION category (default \[dq]epall\[dq]) - --union-cache-time int Cache time of usage and free space (in seconds) (default 120) - --union-create-policy string Policy to choose upstream on CREATE category (default \[dq]epmfs\[dq]) - --union-min-free-space SizeSuffix Minimum viable free space for lfs/eplfs policies (default 1Gi) - --union-search-policy string Policy to choose upstream on SEARCH category (default \[dq]ff\[dq]) - --union-upstreams string List of space separated upstreams - --uptobox-access-token string Your access token - --uptobox-encoding MultiEncoder The encoding for the backend (default Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot) - --uptobox-private Set to make uploaded files private - --webdav-bearer-token string Bearer token instead of user/pass (e.g. a Macaroon) - --webdav-bearer-token-command string Command to run to get a bearer token - --webdav-encoding string The encoding for the backend - --webdav-headers CommaSepList Set HTTP headers for all transactions - --webdav-nextcloud-chunk-size SizeSuffix Nextcloud upload chunk size (default 10Mi) - --webdav-pacer-min-sleep Duration Minimum time to sleep between API calls (default 10ms) - --webdav-pass string Password (obscured) - --webdav-url string URL of http host to connect to - --webdav-user string User name - --webdav-vendor string Name of the WebDAV site/service/software you are using - --yandex-auth-url string Auth server URL - --yandex-client-id string OAuth Client Id - --yandex-client-secret string OAuth Client Secret - --yandex-encoding MultiEncoder The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) - --yandex-hard-delete Delete files permanently rather than putting them into the trash - --yandex-token string OAuth Access Token as a JSON blob - --yandex-token-url string Token server url - --zoho-auth-url string Auth server URL - --zoho-client-id string OAuth Client Id - --zoho-client-secret string OAuth Client Secret - --zoho-encoding MultiEncoder The encoding for the backend (default Del,Ctl,InvalidUtf8) - --zoho-region string Zoho region to connect to - --zoho-token string OAuth Access Token as a JSON blob - --zoho-token-url string Token server url +Eg +.IP +.nf +\f[C] +rclone rc core/bwlimit rate=off +{ + \[dq]bytesPerSecond\[dq]: -1, + \[dq]bytesPerSecondTx\[dq]: -1, + \[dq]bytesPerSecondRx\[dq]: -1, + \[dq]rate\[dq]: \[dq]off\[dq] +} +rclone rc core/bwlimit rate=1M +{ + \[dq]bytesPerSecond\[dq]: 1048576, + \[dq]bytesPerSecondTx\[dq]: 1048576, + \[dq]bytesPerSecondRx\[dq]: 1048576, + \[dq]rate\[dq]: \[dq]1M\[dq] +} +rclone rc core/bwlimit rate=1M:100k +{ + \[dq]bytesPerSecond\[dq]: 1048576, + \[dq]bytesPerSecondTx\[dq]: 1048576, + \[dq]bytesPerSecondRx\[dq]: 131072, + \[dq]rate\[dq]: \[dq]1M\[dq] +} +\f[R] +.fi +.PP +If the rate parameter is not supplied then the bandwidth is queried +.IP +.nf +\f[C] +rclone rc core/bwlimit +{ + \[dq]bytesPerSecond\[dq]: 1048576, + \[dq]bytesPerSecondTx\[dq]: 1048576, + \[dq]bytesPerSecondRx\[dq]: 1048576, + \[dq]rate\[dq]: \[dq]1M\[dq] +} +\f[R] +.fi +.PP +The format of the parameter is exactly the same as passed to --bwlimit +except only one bandwidth may be specified. +.PP +In either case \[dq]rate\[dq] is returned as a human-readable string, +and \[dq]bytesPerSecond\[dq] is returned as a number. +.SS core/command: Run a rclone terminal command over rc. +.PP +This takes the following parameters: +.IP \[bu] 2 +command - a string with the command name. +.IP \[bu] 2 +arg - a list of arguments for the backend command. +.IP \[bu] 2 +opt - a map of string to string of options. +.IP \[bu] 2 +returnType - one of (\[dq]COMBINED_OUTPUT\[dq], \[dq]STREAM\[dq], +\[dq]STREAM_ONLY_STDOUT\[dq], \[dq]STREAM_ONLY_STDERR\[dq]). +.RS 2 +.IP \[bu] 2 +Defaults to \[dq]COMBINED_OUTPUT\[dq] if not set. +.IP \[bu] 2 +The STREAM returnTypes will write the output to the body of the HTTP +message. +.IP \[bu] 2 +The COMBINED_OUTPUT will write the output to the \[dq]result\[dq] +parameter. +.RE +.PP +Returns: +.IP \[bu] 2 +result - result from the backend command. +.RS 2 +.IP \[bu] 2 +Only set when using returnType \[dq]COMBINED_OUTPUT\[dq]. +.RE +.IP \[bu] 2 +error - set if rclone exits with an error code. +.IP \[bu] 2 +returnType - one of (\[dq]COMBINED_OUTPUT\[dq], \[dq]STREAM\[dq], +\[dq]STREAM_ONLY_STDOUT\[dq], \[dq]STREAM_ONLY_STDERR\[dq]). +.PP +Example: +.IP +.nf +\f[C] +rclone rc core/command command=ls -a mydrive:/ -o max-depth=1 +rclone rc core/command -a ls -a mydrive:/ -o max-depth=1 +\f[R] +.fi +.PP +Returns: +.IP +.nf +\f[C] +{ + \[dq]error\[dq]: false, + \[dq]result\[dq]: \[dq]\[dq] +} + +OR +{ + \[dq]error\[dq]: true, + \[dq]result\[dq]: \[dq]\[dq] +} +\f[R] +.fi +.PP +\f[B]Authentication is required for this call.\f[R] +.SS core/du: Returns disk usage of a locally attached disk. +.PP +This returns the disk usage for the local directory passed in as dir. +.PP +If the directory is not passed in, it defaults to the directory pointed +to by --cache-dir. +.IP \[bu] 2 +dir - string (optional) +.PP +Returns: +.IP +.nf +\f[C] +{ + \[dq]dir\[dq]: \[dq]/\[dq], + \[dq]info\[dq]: { + \[dq]Available\[dq]: 361769115648, + \[dq]Free\[dq]: 361785892864, + \[dq]Total\[dq]: 982141468672 + } +} +\f[R] +.fi +.SS core/gc: Runs a garbage collection. +.PP +This tells the go runtime to do a garbage collection run. +It isn\[aq]t necessary to call this normally, but it can be useful for +debugging memory problems. +.SS core/group-list: Returns list of stats. +.PP +This returns list of stats groups currently in memory. +.PP +Returns the following values: +.IP +.nf +\f[C] +{ + \[dq]groups\[dq]: an array of group names: + [ + \[dq]group1\[dq], + \[dq]group2\[dq], + ... + ] +} \f[R] .fi -.SH Docker Volume Plugin -.SS Introduction +.SS core/memstats: Returns the memory statistics +.PP +This returns the memory statistics of the running program. +What the values mean are explained in the go docs: +https://golang.org/pkg/runtime/#MemStats +.PP +The most interesting values for most people are: +.IP \[bu] 2 +HeapAlloc - this is the amount of memory rclone is actually using +.IP \[bu] 2 +HeapSys - this is the amount of memory rclone has obtained from the OS +.IP \[bu] 2 +Sys - this is the total amount of memory requested from the OS +.RS 2 +.IP \[bu] 2 +It is virtual memory so may include unused memory +.RE +.SS core/obscure: Obscures a string passed in. +.PP +Pass a clear string and rclone will obscure it for the config file: - +clear - string +.PP +Returns: - obscured - string +.SS core/pid: Return PID of current process +.PP +This returns PID of current process. +Useful for stopping rclone process. +.SS core/quit: Terminates the app. +.PP +(Optional) Pass an exit code to be used for terminating the app: - +exitCode - int +.SS core/stats: Returns stats about current transfers. +.PP +This returns all available stats: +.IP +.nf +\f[C] +rclone rc core/stats +\f[R] +.fi +.PP +If group is not provided then summed up stats for all groups will be +returned. +.PP +Parameters +.IP \[bu] 2 +group - name of the stats group (string) +.PP +Returns the following values: +.IP +.nf +\f[C] +{ + \[dq]bytes\[dq]: total transferred bytes since the start of the group, + \[dq]checks\[dq]: number of files checked, + \[dq]deletes\[dq] : number of files deleted, + \[dq]elapsedTime\[dq]: time in floating point seconds since rclone was started, + \[dq]errors\[dq]: number of errors, + \[dq]eta\[dq]: estimated time in seconds until the group completes, + \[dq]fatalError\[dq]: boolean whether there has been at least one fatal error, + \[dq]lastError\[dq]: last error string, + \[dq]renames\[dq] : number of files renamed, + \[dq]retryError\[dq]: boolean showing whether there has been at least one non-NoRetryError, + \[dq]serverSideCopies\[dq]: number of server side copies done, + \[dq]serverSideCopyBytes\[dq]: number bytes server side copied, + \[dq]serverSideMoves\[dq]: number of server side moves done, + \[dq]serverSideMoveBytes\[dq]: number bytes server side moved, + \[dq]speed\[dq]: average speed in bytes per second since start of the group, + \[dq]totalBytes\[dq]: total number of bytes in the group, + \[dq]totalChecks\[dq]: total number of checks in the group, + \[dq]totalTransfers\[dq]: total number of transfers in the group, + \[dq]transferTime\[dq] : total time spent on running jobs, + \[dq]transfers\[dq]: number of transferred files, + \[dq]transferring\[dq]: an array of currently active file transfers: + [ + { + \[dq]bytes\[dq]: total transferred bytes for this file, + \[dq]eta\[dq]: estimated time in seconds until file transfer completion + \[dq]name\[dq]: name of the file, + \[dq]percentage\[dq]: progress of the file transfer in percent, + \[dq]speed\[dq]: average speed over the whole transfer in bytes per second, + \[dq]speedAvg\[dq]: current speed in bytes per second as an exponentially weighted moving average, + \[dq]size\[dq]: size of the file in bytes + } + ], + \[dq]checking\[dq]: an array of names of currently active file checks + [] +} +\f[R] +.fi +.PP +Values for \[dq]transferring\[dq], \[dq]checking\[dq] and +\[dq]lastError\[dq] are only assigned if data is available. +The value for \[dq]eta\[dq] is null if an eta cannot be determined. +.SS core/stats-delete: Delete stats group. +.PP +This deletes entire stats group. +.PP +Parameters +.IP \[bu] 2 +group - name of the stats group (string) +.SS core/stats-reset: Reset stats. +.PP +This clears counters, errors and finished transfers for all stats or +specific stats group if group is provided. +.PP +Parameters +.IP \[bu] 2 +group - name of the stats group (string) +.SS core/transferred: Returns stats about completed transfers. +.PP +This returns stats about completed transfers: +.IP +.nf +\f[C] +rclone rc core/transferred +\f[R] +.fi +.PP +If group is not provided then completed transfers for all groups will be +returned. +.PP +Note only the last 100 completed transfers are returned. +.PP +Parameters +.IP \[bu] 2 +group - name of the stats group (string) +.PP +Returns the following values: +.IP +.nf +\f[C] +{ + \[dq]transferred\[dq]: an array of completed transfers (including failed ones): + [ + { + \[dq]name\[dq]: name of the file, + \[dq]size\[dq]: size of the file in bytes, + \[dq]bytes\[dq]: total transferred bytes for this file, + \[dq]checked\[dq]: if the transfer is only checked (skipped, deleted), + \[dq]timestamp\[dq]: integer representing millisecond unix epoch, + \[dq]error\[dq]: string description of the error (empty if successful), + \[dq]jobid\[dq]: id of the job that this transfer belongs to + } + ] +} +\f[R] +.fi +.SS core/version: Shows the current version of rclone and the go runtime. +.PP +This shows the current version of go and the go runtime: +.IP \[bu] 2 +version - rclone version, e.g. +\[dq]v1.53.0\[dq] +.IP \[bu] 2 +decomposed - version number as [major, minor, patch] +.IP \[bu] 2 +isGit - boolean - true if this was compiled from the git version +.IP \[bu] 2 +isBeta - boolean - true if this is a beta version +.IP \[bu] 2 +os - OS in use as according to Go +.IP \[bu] 2 +arch - cpu architecture in use according to Go +.IP \[bu] 2 +goVersion - version of Go runtime in use +.IP \[bu] 2 +linking - type of rclone executable (static or dynamic) +.IP \[bu] 2 +goTags - space separated build tags or \[dq]none\[dq] +.SS debug/set-block-profile-rate: Set runtime.SetBlockProfileRate for blocking profiling. +.PP +SetBlockProfileRate controls the fraction of goroutine blocking events +that are reported in the blocking profile. +The profiler aims to sample an average of one blocking event per rate +nanoseconds spent blocked. +.PP +To include every blocking event in the profile, pass rate = 1. +To turn off profiling entirely, pass rate <= 0. +.PP +After calling this you can use this to see the blocking profile: +.IP +.nf +\f[C] +go tool pprof http://localhost:5572/debug/pprof/block +\f[R] +.fi +.PP +Parameters: +.IP \[bu] 2 +rate - int +.SS debug/set-gc-percent: Call runtime/debug.SetGCPercent for setting the garbage collection target percentage. +.PP +SetGCPercent sets the garbage collection target percentage: a collection +is triggered when the ratio of freshly allocated data to live data +remaining after the previous collection reaches this percentage. +SetGCPercent returns the previous setting. +The initial setting is the value of the GOGC environment variable at +startup, or 100 if the variable is not set. +.PP +This setting may be effectively reduced in order to maintain a memory +limit. +A negative percentage effectively disables garbage collection, unless +the memory limit is reached. +.PP +See https://pkg.go.dev/runtime/debug#SetMemoryLimit for more details. +.PP +Parameters: +.IP \[bu] 2 +gc-percent - int +.SS debug/set-mutex-profile-fraction: Set runtime.SetMutexProfileFraction for mutex profiling. +.PP +SetMutexProfileFraction controls the fraction of mutex contention events +that are reported in the mutex profile. +On average 1/rate events are reported. +The previous rate is returned. +.PP +To turn off profiling entirely, pass rate 0. +To just read the current rate, pass rate < 0. +(For n>1 the details of sampling may change.) +.PP +Once this is set you can look use this to profile the mutex contention: +.IP +.nf +\f[C] +go tool pprof http://localhost:5572/debug/pprof/mutex +\f[R] +.fi +.PP +Parameters: +.IP \[bu] 2 +rate - int +.PP +Results: +.IP \[bu] 2 +previousRate - int +.SS debug/set-soft-memory-limit: Call runtime/debug.SetMemoryLimit for setting a soft memory limit for the runtime. +.PP +SetMemoryLimit provides the runtime with a soft memory limit. +.PP +The runtime undertakes several processes to try to respect this memory +limit, including adjustments to the frequency of garbage collections and +returning memory to the underlying system more aggressively. +This limit will be respected even if GOGC=off (or, if SetGCPercent(-1) +is executed). +.PP +The input limit is provided as bytes, and includes all memory mapped, +managed, and not released by the Go runtime. +Notably, it does not account for space used by the Go binary and memory +external to Go, such as memory managed by the underlying system on +behalf of the process, or memory managed by non-Go code inside the same +process. +Examples of excluded memory sources include: OS kernel memory held on +behalf of the process, memory allocated by C code, and memory mapped by +syscall.Mmap (because it is not managed by the Go runtime). +.PP +A zero limit or a limit that\[aq]s lower than the amount of memory used +by the Go runtime may cause the garbage collector to run nearly +continuously. +However, the application may still make progress. +.PP +The memory limit is always respected by the Go runtime, so to +effectively disable this behavior, set the limit very high. +math.MaxInt64 is the canonical value for disabling the limit, but values +much greater than the available memory on the underlying system work +just as well. +.PP +See https://go.dev/doc/gc-guide for a detailed guide explaining the soft +memory limit in more detail, as well as a variety of common use-cases +and scenarios. +.PP +SetMemoryLimit returns the previously set memory limit. +A negative input does not adjust the limit, and allows for retrieval of +the currently set memory limit. +.PP +Parameters: +.IP \[bu] 2 +mem-limit - int +.SS fscache/clear: Clear the Fs cache. +.PP +This clears the fs cache. +This is where remotes created from backends are cached for a short while +to make repeated rc calls more efficient. +.PP +If you change the parameters of a backend then you may want to call this +to clear an existing remote out of the cache before re-creating it. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS fscache/entries: Returns the number of entries in the fs cache. +.PP +This returns the number of entries in the fs cache. +.PP +Returns - entries - number of items in the cache +.PP +\f[B]Authentication is required for this call.\f[R] +.SS job/list: Lists the IDs of the running jobs +.PP +Parameters: None. +.PP +Results: +.IP \[bu] 2 +executeId - string id of rclone executing (change after restart) +.IP \[bu] 2 +jobids - array of integer job ids (starting at 1 on each restart) +.SS job/status: Reads the status of the job ID +.PP +Parameters: +.IP \[bu] 2 +jobid - id of the job (integer). +.PP +Results: +.IP \[bu] 2 +finished - boolean +.IP \[bu] 2 +duration - time in seconds that the job ran for +.IP \[bu] 2 +endTime - time the job finished (e.g. +\[dq]2018-10-26T18:50:20.528746884+01:00\[dq]) +.IP \[bu] 2 +error - error from the job or empty string for no error +.IP \[bu] 2 +finished - boolean whether the job has finished or not +.IP \[bu] 2 +id - as passed in above +.IP \[bu] 2 +startTime - time the job started (e.g. +\[dq]2018-10-26T18:50:20.528336039+01:00\[dq]) +.IP \[bu] 2 +success - boolean - true for success false otherwise +.IP \[bu] 2 +output - output of the job as would have been returned if called +synchronously +.IP \[bu] 2 +progress - output of the progress related to the underlying job +.SS job/stop: Stop the running job +.PP +Parameters: +.IP \[bu] 2 +jobid - id of the job (integer). +.SS job/stopgroup: Stop all running jobs in a group +.PP +Parameters: +.IP \[bu] 2 +group - name of the group (string). +.SS mount/listmounts: Show current mount points +.PP +This shows currently mounted points, which can be used for performing an +unmount. +.PP +This takes no parameters and returns +.IP \[bu] 2 +mountPoints: list of current mount points +.PP +Eg +.IP +.nf +\f[C] +rclone rc mount/listmounts +\f[R] +.fi +.PP +\f[B]Authentication is required for this call.\f[R] +.SS mount/mount: Create a new mount point +.PP +rclone allows Linux, FreeBSD, macOS and Windows to mount any of +Rclone\[aq]s cloud storage systems as a file system with FUSE. +.PP +If no mountType is provided, the priority is given as follows: 1. +mount 2.cmount 3.mount2 +.PP +This takes the following parameters: +.IP \[bu] 2 +fs - a remote path to be mounted (required) +.IP \[bu] 2 +mountPoint: valid path on the local machine (required) +.IP \[bu] 2 +mountType: one of the values (mount, cmount, mount2) specifies the mount +implementation to use +.IP \[bu] 2 +mountOpt: a JSON object with Mount options in. +.IP \[bu] 2 +vfsOpt: a JSON object with VFS options in. +.PP +Example: +.IP +.nf +\f[C] +rclone rc mount/mount fs=mydrive: mountPoint=/home//mountPoint +rclone rc mount/mount fs=mydrive: mountPoint=/home//mountPoint mountType=mount +rclone rc mount/mount fs=TestDrive: mountPoint=/mnt/tmp vfsOpt=\[aq]{\[dq]CacheMode\[dq]: 2}\[aq] mountOpt=\[aq]{\[dq]AllowOther\[dq]: true}\[aq] +\f[R] +.fi +.PP +The vfsOpt are as described in options/get and can be seen in the the +\[dq]vfs\[dq] section when running and the mountOpt can be seen in the +\[dq]mount\[dq] section: +.IP +.nf +\f[C] +rclone rc options/get +\f[R] +.fi +.PP +\f[B]Authentication is required for this call.\f[R] +.SS mount/types: Show all possible mount types +.PP +This shows all possible mount types and returns them as a list. +.PP +This takes no parameters and returns +.IP \[bu] 2 +mountTypes: list of mount types +.PP +The mount types are strings like \[dq]mount\[dq], \[dq]mount2\[dq], +\[dq]cmount\[dq] and can be passed to mount/mount as the mountType +parameter. +.PP +Eg +.IP +.nf +\f[C] +rclone rc mount/types +\f[R] +.fi +.PP +\f[B]Authentication is required for this call.\f[R] +.SS mount/unmount: Unmount selected active mount +.PP +rclone allows Linux, FreeBSD, macOS and Windows to mount any of +Rclone\[aq]s cloud storage systems as a file system with FUSE. +.PP +This takes the following parameters: +.IP \[bu] 2 +mountPoint: valid path on the local machine where the mount was created +(required) +.PP +Example: +.IP +.nf +\f[C] +rclone rc mount/unmount mountPoint=/home//mountPoint +\f[R] +.fi +.PP +\f[B]Authentication is required for this call.\f[R] +.SS mount/unmountall: Unmount all active mounts +.PP +rclone allows Linux, FreeBSD, macOS and Windows to mount any of +Rclone\[aq]s cloud storage systems as a file system with FUSE. +.PP +This takes no parameters and returns error if unmount does not succeed. +.PP +Eg +.IP +.nf +\f[C] +rclone rc mount/unmountall +\f[R] +.fi +.PP +\f[B]Authentication is required for this call.\f[R] +.SS operations/about: Return the space used on the remote +.PP +This takes the following parameters: +.IP \[bu] 2 +fs - a remote name string e.g. +\[dq]drive:\[dq] +.PP +The result is as returned from rclone about --json +.PP +See the about (https://rclone.org/commands/rclone_about/) command for +more information on the above. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS operations/check: check the source and destination are the same +.PP +Checks the files in the source and destination match. +It compares sizes and hashes and logs a report of files that don\[aq]t +match. +It doesn\[aq]t alter the source or destination. +.PP +This takes the following parameters: +.IP \[bu] 2 +srcFs - a remote name string e.g. +\[dq]drive:\[dq] for the source, \[dq]/\[dq] for local filesystem +.IP \[bu] 2 +dstFs - a remote name string e.g. +\[dq]drive2:\[dq] for the destination, \[dq]/\[dq] for local filesystem +.IP \[bu] 2 +download - check by downloading rather than with hash +.IP \[bu] 2 +checkFileHash - treat checkFileFs:checkFileRemote as a SUM file with +hashes of given type +.IP \[bu] 2 +checkFileFs - treat checkFileFs:checkFileRemote as a SUM file with +hashes of given type +.IP \[bu] 2 +checkFileRemote - treat checkFileFs:checkFileRemote as a SUM file with +hashes of given type +.IP \[bu] 2 +oneWay - check one way only, source files must exist on remote +.IP \[bu] 2 +combined - make a combined report of changes (default false) +.IP \[bu] 2 +missingOnSrc - report all files missing from the source (default true) +.IP \[bu] 2 +missingOnDst - report all files missing from the destination (default +true) +.IP \[bu] 2 +match - report all matching files (default false) +.IP \[bu] 2 +differ - report all non-matching files (default true) +.IP \[bu] 2 +error - report all files with errors (hashing or reading) (default true) +.PP +If you supply the download flag, it will download the data from both +remotes and check them against each other on the fly. +This can be useful for remotes that don\[aq]t support hashes or if you +really want to check all the data. .PP -Docker 1.9 has added support for creating named -volumes (https://docs.docker.com/storage/volumes/) via command-line -interface (https://docs.docker.com/engine/reference/commandline/volume_create/) -and mounting them in containers as a way to share data between them. -Since Docker 1.10 you can create named volumes with Docker -Compose (https://docs.docker.com/compose/) by descriptions in -docker-compose.yml (https://docs.docker.com/compose/compose-file/compose-file-v2/#volume-configuration-reference) -files for use by container groups on a single host. -As of Docker 1.12 volumes are supported by Docker -Swarm (https://docs.docker.com/engine/swarm/key-concepts/) included with -Docker Engine and created from descriptions in swarm compose -v3 (https://docs.docker.com/compose/compose-file/compose-file-v3/#volume-configuration-reference) -files for use with \f[I]swarm stacks\f[R] across multiple cluster nodes. +If you supply the size-only global flag, it will only compare the sizes +not the hashes as well. +Use this for a quick check. .PP -Docker Volume -Plugins (https://docs.docker.com/engine/extend/plugins_volume/) augment -the default \f[C]local\f[R] volume driver included in Docker with -stateful volumes shared across containers and hosts. -Unlike local volumes, your data will \f[I]not\f[R] be deleted when such -volume is removed. -Plugins can run managed by the docker daemon, as a native system service -(under systemd, \f[I]sysv\f[R] or \f[I]upstart\f[R]) or as a standalone -executable. -Rclone can run as docker volume plugin in all these modes. -It interacts with the local docker daemon via plugin -API (https://docs.docker.com/engine/extend/plugin_api/) and handles -mounting of remote file systems into docker containers so it must run on -the same host as the docker daemon or on every Swarm node. -.SS Getting started +If you supply the checkFileHash option with a valid hash name, the +checkFileFs:checkFileRemote must point to a text file in the SUM format. +This treats the checksum file as the source and dstFs as the +destination. +Note that srcFs is not used and should not be supplied in this case. .PP -In the first example we will use the SFTP (https://rclone.org/sftp/) -rclone volume with Docker engine on a standalone Ubuntu machine. +Returns: +.IP \[bu] 2 +success - true if no error, false otherwise +.IP \[bu] 2 +status - textual summary of check, OK or text string +.IP \[bu] 2 +hashType - hash used in check, may be missing +.IP \[bu] 2 +combined - array of strings of combined report of changes +.IP \[bu] 2 +missingOnSrc - array of strings of all files missing from the source +.IP \[bu] 2 +missingOnDst - array of strings of all files missing from the +destination +.IP \[bu] 2 +match - array of strings of all matching files +.IP \[bu] 2 +differ - array of strings of all non-matching files +.IP \[bu] 2 +error - array of strings of all files with errors (hashing or reading) .PP -Start from installing Docker (https://docs.docker.com/engine/install/) -on the host. +\f[B]Authentication is required for this call.\f[R] +.SS operations/cleanup: Remove trashed files in the remote or path .PP -The \f[I]FUSE\f[R] driver is a prerequisite for rclone mounting and -should be installed on host: +This takes the following parameters: +.IP \[bu] 2 +fs - a remote name string e.g. +\[dq]drive:\[dq] +.PP +See the cleanup (https://rclone.org/commands/rclone_cleanup/) command +for more information on the above. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS operations/copyfile: Copy a file from source remote to destination remote +.PP +This takes the following parameters: +.IP \[bu] 2 +srcFs - a remote name string e.g. +\[dq]drive:\[dq] for the source, \[dq]/\[dq] for local filesystem +.IP \[bu] 2 +srcRemote - a path within that remote e.g. +\[dq]file.txt\[dq] for the source +.IP \[bu] 2 +dstFs - a remote name string e.g. +\[dq]drive2:\[dq] for the destination, \[dq]/\[dq] for local filesystem +.IP \[bu] 2 +dstRemote - a path within that remote e.g. +\[dq]file2.txt\[dq] for the destination +.PP +\f[B]Authentication is required for this call.\f[R] +.SS operations/copyurl: Copy the URL to the object +.PP +This takes the following parameters: +.IP \[bu] 2 +fs - a remote name string e.g. +\[dq]drive:\[dq] +.IP \[bu] 2 +remote - a path within that remote e.g. +\[dq]dir\[dq] +.IP \[bu] 2 +url - string, URL to read from +.IP \[bu] 2 +autoFilename - boolean, set to true to retrieve destination file name +from url +.PP +See the copyurl (https://rclone.org/commands/rclone_copyurl/) command +for more information on the above. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS operations/delete: Remove files in the path +.PP +This takes the following parameters: +.IP \[bu] 2 +fs - a remote name string e.g. +\[dq]drive:\[dq] +.PP +See the delete (https://rclone.org/commands/rclone_delete/) command for +more information on the above. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS operations/deletefile: Remove the single file pointed to +.PP +This takes the following parameters: +.IP \[bu] 2 +fs - a remote name string e.g. +\[dq]drive:\[dq] +.IP \[bu] 2 +remote - a path within that remote e.g. +\[dq]dir\[dq] +.PP +See the deletefile (https://rclone.org/commands/rclone_deletefile/) +command for more information on the above. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS operations/fsinfo: Return information about the remote +.PP +This takes the following parameters: +.IP \[bu] 2 +fs - a remote name string e.g. +\[dq]drive:\[dq] +.PP +This returns info about the remote passed in; .IP .nf \f[C] -sudo apt-get -y install fuse +{ + // optional features and whether they are available or not + \[dq]Features\[dq]: { + \[dq]About\[dq]: true, + \[dq]BucketBased\[dq]: false, + \[dq]BucketBasedRootOK\[dq]: false, + \[dq]CanHaveEmptyDirectories\[dq]: true, + \[dq]CaseInsensitive\[dq]: false, + \[dq]ChangeNotify\[dq]: false, + \[dq]CleanUp\[dq]: false, + \[dq]Command\[dq]: true, + \[dq]Copy\[dq]: false, + \[dq]DirCacheFlush\[dq]: false, + \[dq]DirMove\[dq]: true, + \[dq]Disconnect\[dq]: false, + \[dq]DuplicateFiles\[dq]: false, + \[dq]GetTier\[dq]: false, + \[dq]IsLocal\[dq]: true, + \[dq]ListR\[dq]: false, + \[dq]MergeDirs\[dq]: false, + \[dq]MetadataInfo\[dq]: true, + \[dq]Move\[dq]: true, + \[dq]OpenWriterAt\[dq]: true, + \[dq]PublicLink\[dq]: false, + \[dq]Purge\[dq]: true, + \[dq]PutStream\[dq]: true, + \[dq]PutUnchecked\[dq]: false, + \[dq]ReadMetadata\[dq]: true, + \[dq]ReadMimeType\[dq]: false, + \[dq]ServerSideAcrossConfigs\[dq]: false, + \[dq]SetTier\[dq]: false, + \[dq]SetWrapper\[dq]: false, + \[dq]Shutdown\[dq]: false, + \[dq]SlowHash\[dq]: true, + \[dq]SlowModTime\[dq]: false, + \[dq]UnWrap\[dq]: false, + \[dq]UserInfo\[dq]: false, + \[dq]UserMetadata\[dq]: true, + \[dq]WrapFs\[dq]: false, + \[dq]WriteMetadata\[dq]: true, + \[dq]WriteMimeType\[dq]: false + }, + // Names of hashes available + \[dq]Hashes\[dq]: [ + \[dq]md5\[dq], + \[dq]sha1\[dq], + \[dq]whirlpool\[dq], + \[dq]crc32\[dq], + \[dq]sha256\[dq], + \[dq]dropbox\[dq], + \[dq]mailru\[dq], + \[dq]quickxor\[dq] + ], + \[dq]Name\[dq]: \[dq]local\[dq], // Name as created + \[dq]Precision\[dq]: 1, // Precision of timestamps in ns + \[dq]Root\[dq]: \[dq]/\[dq], // Path as created + \[dq]String\[dq]: \[dq]Local file system at /\[dq], // how the remote will appear in logs + // Information about the system metadata for this backend + \[dq]MetadataInfo\[dq]: { + \[dq]System\[dq]: { + \[dq]atime\[dq]: { + \[dq]Help\[dq]: \[dq]Time of last access\[dq], + \[dq]Type\[dq]: \[dq]RFC 3339\[dq], + \[dq]Example\[dq]: \[dq]2006-01-02T15:04:05.999999999Z07:00\[dq] + }, + \[dq]btime\[dq]: { + \[dq]Help\[dq]: \[dq]Time of file birth (creation)\[dq], + \[dq]Type\[dq]: \[dq]RFC 3339\[dq], + \[dq]Example\[dq]: \[dq]2006-01-02T15:04:05.999999999Z07:00\[dq] + }, + \[dq]gid\[dq]: { + \[dq]Help\[dq]: \[dq]Group ID of owner\[dq], + \[dq]Type\[dq]: \[dq]decimal number\[dq], + \[dq]Example\[dq]: \[dq]500\[dq] + }, + \[dq]mode\[dq]: { + \[dq]Help\[dq]: \[dq]File type and mode\[dq], + \[dq]Type\[dq]: \[dq]octal, unix style\[dq], + \[dq]Example\[dq]: \[dq]0100664\[dq] + }, + \[dq]mtime\[dq]: { + \[dq]Help\[dq]: \[dq]Time of last modification\[dq], + \[dq]Type\[dq]: \[dq]RFC 3339\[dq], + \[dq]Example\[dq]: \[dq]2006-01-02T15:04:05.999999999Z07:00\[dq] + }, + \[dq]rdev\[dq]: { + \[dq]Help\[dq]: \[dq]Device ID (if special file)\[dq], + \[dq]Type\[dq]: \[dq]hexadecimal\[dq], + \[dq]Example\[dq]: \[dq]1abc\[dq] + }, + \[dq]uid\[dq]: { + \[dq]Help\[dq]: \[dq]User ID of owner\[dq], + \[dq]Type\[dq]: \[dq]decimal number\[dq], + \[dq]Example\[dq]: \[dq]500\[dq] + } + }, + \[dq]Help\[dq]: \[dq]Textual help string\[rs]n\[dq] + } +} +\f[R] +.fi +.PP +This command does not have a command line equivalent so use this +instead: +.IP +.nf +\f[C] +rclone rc --loopback operations/fsinfo fs=remote: \f[R] .fi +.SS operations/list: List the given remote and path in JSON format +.PP +This takes the following parameters: +.IP \[bu] 2 +fs - a remote name string e.g. +\[dq]drive:\[dq] +.IP \[bu] 2 +remote - a path within that remote e.g. +\[dq]dir\[dq] +.IP \[bu] 2 +opt - a dictionary of options to control the listing (optional) +.RS 2 +.IP \[bu] 2 +recurse - If set recurse directories +.IP \[bu] 2 +noModTime - If set return modification time +.IP \[bu] 2 +showEncrypted - If set show decrypted names +.IP \[bu] 2 +showOrigIDs - If set show the IDs for each item if known +.IP \[bu] 2 +showHash - If set return a dictionary of hashes +.IP \[bu] 2 +noMimeType - If set don\[aq]t show mime types +.IP \[bu] 2 +dirsOnly - If set only show directories +.IP \[bu] 2 +filesOnly - If set only show files +.IP \[bu] 2 +metadata - If set return metadata of objects also +.IP \[bu] 2 +hashTypes - array of strings of hash types to show if showHash set +.RE +.PP +Returns: +.IP \[bu] 2 +list +.RS 2 +.IP \[bu] 2 +This is an array of objects as described in the lsjson command +.RE +.PP +See the lsjson (https://rclone.org/commands/rclone_lsjson/) command for +more information on the above and examples. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS operations/mkdir: Make a destination directory or container +.PP +This takes the following parameters: +.IP \[bu] 2 +fs - a remote name string e.g. +\[dq]drive:\[dq] +.IP \[bu] 2 +remote - a path within that remote e.g. +\[dq]dir\[dq] +.PP +See the mkdir (https://rclone.org/commands/rclone_mkdir/) command for +more information on the above. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS operations/movefile: Move a file from source remote to destination remote +.PP +This takes the following parameters: +.IP \[bu] 2 +srcFs - a remote name string e.g. +\[dq]drive:\[dq] for the source, \[dq]/\[dq] for local filesystem +.IP \[bu] 2 +srcRemote - a path within that remote e.g. +\[dq]file.txt\[dq] for the source +.IP \[bu] 2 +dstFs - a remote name string e.g. +\[dq]drive2:\[dq] for the destination, \[dq]/\[dq] for local filesystem +.IP \[bu] 2 +dstRemote - a path within that remote e.g. +\[dq]file2.txt\[dq] for the destination +.PP +\f[B]Authentication is required for this call.\f[R] +.SS operations/publiclink: Create or retrieve a public link to the given file or folder. +.PP +This takes the following parameters: +.IP \[bu] 2 +fs - a remote name string e.g. +\[dq]drive:\[dq] +.IP \[bu] 2 +remote - a path within that remote e.g. +\[dq]dir\[dq] +.IP \[bu] 2 +unlink - boolean - if set removes the link rather than adding it +(optional) +.IP \[bu] 2 +expire - string - the expiry time of the link e.g. +\[dq]1d\[dq] (optional) +.PP +Returns: +.IP \[bu] 2 +url - URL of the resource +.PP +See the link (https://rclone.org/commands/rclone_link/) command for more +information on the above. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS operations/purge: Remove a directory or container and all of its contents +.PP +This takes the following parameters: +.IP \[bu] 2 +fs - a remote name string e.g. +\[dq]drive:\[dq] +.IP \[bu] 2 +remote - a path within that remote e.g. +\[dq]dir\[dq] +.PP +See the purge (https://rclone.org/commands/rclone_purge/) command for +more information on the above. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS operations/rmdir: Remove an empty directory or container +.PP +This takes the following parameters: +.IP \[bu] 2 +fs - a remote name string e.g. +\[dq]drive:\[dq] +.IP \[bu] 2 +remote - a path within that remote e.g. +\[dq]dir\[dq] +.PP +See the rmdir (https://rclone.org/commands/rclone_rmdir/) command for +more information on the above. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS operations/rmdirs: Remove all the empty directories in the path +.PP +This takes the following parameters: +.IP \[bu] 2 +fs - a remote name string e.g. +\[dq]drive:\[dq] +.IP \[bu] 2 +remote - a path within that remote e.g. +\[dq]dir\[dq] +.IP \[bu] 2 +leaveRoot - boolean, set to true not to delete the root +.PP +See the rmdirs (https://rclone.org/commands/rclone_rmdirs/) command for +more information on the above. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS operations/settier: Changes storage tier or class on all files in the path +.PP +This takes the following parameters: +.IP \[bu] 2 +fs - a remote name string e.g. +\[dq]drive:\[dq] +.PP +See the settier (https://rclone.org/commands/rclone_settier/) command +for more information on the above. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS operations/settierfile: Changes storage tier or class on the single file pointed to +.PP +This takes the following parameters: +.IP \[bu] 2 +fs - a remote name string e.g. +\[dq]drive:\[dq] +.IP \[bu] 2 +remote - a path within that remote e.g. +\[dq]dir\[dq] +.PP +See the settierfile (https://rclone.org/commands/rclone_settierfile/) +command for more information on the above. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS operations/size: Count the number of bytes and files in remote +.PP +This takes the following parameters: +.IP \[bu] 2 +fs - a remote name string e.g. +\[dq]drive:path/to/dir\[dq] +.PP +Returns: +.IP \[bu] 2 +count - number of files +.IP \[bu] 2 +bytes - number of bytes in those files +.PP +See the size (https://rclone.org/commands/rclone_size/) command for more +information on the above. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS operations/stat: Give information about the supplied file or directory +.PP +This takes the following parameters +.IP \[bu] 2 +fs - a remote name string eg \[dq]drive:\[dq] +.IP \[bu] 2 +remote - a path within that remote eg \[dq]dir\[dq] +.IP \[bu] 2 +opt - a dictionary of options to control the listing (optional) +.RS 2 +.IP \[bu] 2 +see operations/list for the options +.RE +.PP +The result is +.IP \[bu] 2 +item - an object as described in the lsjson command. +Will be null if not found. +.PP +Note that if you are only interested in files then it is much more +efficient to set the filesOnly flag in the options. +.PP +See the lsjson (https://rclone.org/commands/rclone_lsjson/) command for +more information on the above and examples. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS operations/uploadfile: Upload file using multiform/form-data +.PP +This takes the following parameters: +.IP \[bu] 2 +fs - a remote name string e.g. +\[dq]drive:\[dq] +.IP \[bu] 2 +remote - a path within that remote e.g. +\[dq]dir\[dq] +.IP \[bu] 2 +each part in body represents a file to be uploaded +.PP +See the uploadfile (https://rclone.org/commands/rclone_uploadfile/) +command for more information on the above. +.PP +\f[B]Authentication is required for this call.\f[R] +.SS options/blocks: List all the option blocks +.PP +Returns: - options - a list of the options block names +.SS options/get: Get all the global options +.PP +Returns an object where keys are option block names and values are an +object with the current option values in. +.PP +Note that these are the global options which are unaffected by use of +the _config and _filter parameters. +If you wish to read the parameters set in _config then use +options/config and for _filter use options/filter. +.PP +This shows the internal names of the option within rclone which should +map to the external options very easily with a few exceptions. +.SS options/local: Get the currently active config for this call +.PP +Returns an object with the keys \[dq]config\[dq] and \[dq]filter\[dq]. +The \[dq]config\[dq] key contains the local config and the +\[dq]filter\[dq] key contains the local filters. +.PP +Note that these are the local options specific to this rc call. +If _config was not supplied then they will be the global options. +Likewise with \[dq]_filter\[dq]. +.PP +This call is mostly useful for seeing if _config and _filter passing is +working. +.PP +This shows the internal names of the option within rclone which should +map to the external options very easily with a few exceptions. +.SS options/set: Set an option +.PP +Parameters: +.IP \[bu] 2 +option block name containing an object with +.RS 2 +.IP \[bu] 2 +key: value +.RE +.PP +Repeated as often as required. +.PP +Only supply the options you wish to change. +If an option is unknown it will be silently ignored. +Not all options will have an effect when changed like this. +.PP +For example: .PP -Create two directories required by rclone docker plugin: +This sets DEBUG level logs (-vv) (these can be set by number or string) .IP .nf \f[C] -sudo mkdir -p /var/lib/docker-plugins/rclone/config -sudo mkdir -p /var/lib/docker-plugins/rclone/cache +rclone rc options/set --json \[aq]{\[dq]main\[dq]: {\[dq]LogLevel\[dq]: \[dq]DEBUG\[dq]}}\[aq] +rclone rc options/set --json \[aq]{\[dq]main\[dq]: {\[dq]LogLevel\[dq]: 8}}\[aq] \f[R] .fi .PP -Install the managed rclone docker plugin for your architecture (here -\f[C]amd64\f[R]): +And this sets INFO level logs (-v) .IP .nf \f[C] -docker plugin install rclone/docker-volume-rclone:amd64 args=\[dq]-v\[dq] --alias rclone --grant-all-permissions -docker plugin list +rclone rc options/set --json \[aq]{\[dq]main\[dq]: {\[dq]LogLevel\[dq]: \[dq]INFO\[dq]}}\[aq] \f[R] .fi .PP -Create your SFTP volume (https://rclone.org/sftp/#standard-options): +And this sets NOTICE level logs (normal without -v) .IP .nf \f[C] -docker volume create firstvolume -d rclone -o type=sftp -o sftp-host=_hostname_ -o sftp-user=_username_ -o sftp-pass=_password_ -o allow-other=true +rclone rc options/set --json \[aq]{\[dq]main\[dq]: {\[dq]LogLevel\[dq]: \[dq]NOTICE\[dq]}}\[aq] \f[R] .fi +.SS pluginsctl/addPlugin: Add a plugin using url .PP -Note that since all options are static, you don\[aq]t even have to run -\f[C]rclone config\f[R] or create the \f[C]rclone.conf\f[R] file (but -the \f[C]config\f[R] directory should still be present). -In the simplest case you can use \f[C]localhost\f[R] as -\f[I]hostname\f[R] and your SSH credentials as \f[I]username\f[R] and -\f[I]password\f[R]. -You can also change the remote path to your home directory on the host, -for example \f[C]-o path=/home/username\f[R]. +Used for adding a plugin to the webgui. .PP -Time to create a test container and mount the volume into it: -.IP -.nf -\f[C] -docker run --rm -it -v firstvolume:/mnt --workdir /mnt ubuntu:latest bash -\f[R] -.fi +This takes the following parameters: +.IP \[bu] 2 +url - http url of the github repo where the plugin is hosted +(http://github.com/rclone/rclone-webui-react). .PP -If all goes well, you will enter the new container and change right to -the mounted SFTP remote. -You can type \f[C]ls\f[R] to list the mounted directory or otherwise -play with it. -Type \f[C]exit\f[R] when you are done. -The container will stop but the volume will stay, ready to be reused. -When it\[aq]s not needed anymore, remove it: -.IP -.nf -\f[C] -docker volume list -docker volume remove firstvolume -\f[R] -.fi +Example: .PP -Now let us try \f[B]something more elaborate\f[R]: Google -Drive (https://rclone.org/drive/) volume on multi-node Docker Swarm. +rclone rc pluginsctl/addPlugin .PP -You should start from installing Docker and FUSE, creating plugin -directories and installing rclone plugin on \f[I]every\f[R] swarm node. -Then setup the Swarm (https://docs.docker.com/engine/swarm/swarm-mode/). +\f[B]Authentication is required for this call.\f[R] +.SS pluginsctl/getPluginsForType: Get plugins with type criteria .PP -Google Drive volumes need an access token which can be setup via web -browser and will be periodically renewed by rclone. -The managed plugin cannot run a browser so we will use a technique -similar to the rclone setup on a headless -box (https://rclone.org/remote_setup/). +This shows all possible plugins by a mime type. .PP -Run rclone config (https://rclone.org/commands/rclone_config_create/) on -\f[I]another\f[R] machine equipped with \f[I]web browser\f[R] and -graphical user interface. -Create the Google Drive -remote (https://rclone.org/drive/#standard-options). -When done, transfer the resulting \f[C]rclone.conf\f[R] to the Swarm -cluster and save as -\f[C]/var/lib/docker-plugins/rclone/config/rclone.conf\f[R] on -\f[I]every\f[R] node. -By default this location is accessible only to the root user so you will -need appropriate privileges. -The resulting config will look like this: -.IP -.nf -\f[C] -[gdrive] -type = drive -scope = drive -drive_id = 1234567... -root_folder_id = 0Abcd... -token = {\[dq]access_token\[dq]:...} -\f[R] -.fi +This takes the following parameters: +.IP \[bu] 2 +type - supported mime type by a loaded plugin e.g. +(video/mp4, audio/mp3). +.IP \[bu] 2 +pluginType - filter plugins based on their type e.g. +(DASHBOARD, FILE_HANDLER, TERMINAL). .PP -Now create the file named \f[C]example.yml\f[R] with a swarm stack -description like this: -.IP -.nf -\f[C] -version: \[aq]3\[aq] -services: - heimdall: - image: linuxserver/heimdall:latest - ports: [8080:80] - volumes: [configdata:/config] -volumes: - configdata: - driver: rclone - driver_opts: - remote: \[aq]gdrive:heimdall\[aq] - allow_other: \[aq]true\[aq] - vfs_cache_mode: full - poll_interval: 0 -\f[R] -.fi +Returns: +.IP \[bu] 2 +loadedPlugins - list of current production plugins. +.IP \[bu] 2 +testPlugins - list of temporarily loaded development plugins, usually +running on a different server. .PP -and run the stack: -.IP -.nf -\f[C] -docker stack deploy example -c ./example.yml -\f[R] -.fi +Example: .PP -After a few seconds docker will spread the parsed stack description over -cluster, create the \f[C]example_heimdall\f[R] service on port -\f[I]8080\f[R], run service containers on one or more cluster nodes and -request the \f[C]example_configdata\f[R] volume from rclone plugins on -the node hosts. -You can use the following commands to confirm results: -.IP -.nf -\f[C] -docker service ls -docker service ps example_heimdall -docker volume ls -\f[R] -.fi +rclone rc pluginsctl/getPluginsForType type=video/mp4 .PP -Point your browser to \f[C]http://cluster.host.address:8080\f[R] and -play with the service. -Stop it with \f[C]docker stack remove example\f[R] when you are done. -Note that the \f[C]example_configdata\f[R] volume(s) created on demand -at the cluster nodes will not be automatically removed together with the -stack but stay for future reuse. -You can remove them manually by invoking the -\f[C]docker volume remove example_configdata\f[R] command on every node. -.SS Creating Volumes via CLI +\f[B]Authentication is required for this call.\f[R] +.SS pluginsctl/listPlugins: Get the list of currently loaded plugins .PP -Volumes can be created with docker volume -create (https://docs.docker.com/engine/reference/commandline/volume_create/). -Here are a few examples: -.IP -.nf -\f[C] -docker volume create vol1 -d rclone -o remote=storj: -o vfs-cache-mode=full -docker volume create vol2 -d rclone -o remote=:storj,access_grant=xxx:heimdall -docker volume create vol3 -d rclone -o type=storj -o path=heimdall -o storj-access-grant=xxx -o poll-interval=0 -\f[R] -.fi +This allows you to get the currently enabled plugins and their details. .PP -Note the \f[C]-d rclone\f[R] flag that tells docker to request volume -from the rclone driver. -This works even if you installed managed driver by its full name -\f[C]rclone/docker-volume-rclone\f[R] because you provided the -\f[C]--alias rclone\f[R] option. +This takes no parameters and returns: +.IP \[bu] 2 +loadedPlugins - list of current production plugins. +.IP \[bu] 2 +testPlugins - list of temporarily loaded development plugins, usually +running on a different server. .PP -Volumes can be inspected as follows: -.IP -.nf -\f[C] -docker volume list -docker volume inspect vol1 -\f[R] -.fi -.SS Volume Configuration +E.g. .PP -Rclone flags and volume options are set via the \f[C]-o\f[R] flag to the -\f[C]docker volume create\f[R] command. -They include backend-specific parameters as well as mount and -\f[I]VFS\f[R] options. -Also there are a few special \f[C]-o\f[R] options: \f[C]remote\f[R], -\f[C]fs\f[R], \f[C]type\f[R], \f[C]path\f[R], \f[C]mount-type\f[R] and -\f[C]persist\f[R]. +rclone rc pluginsctl/listPlugins .PP -\f[C]remote\f[R] determines an existing remote name from the config -file, with trailing colon and optionally with a remote path. -See the full syntax in the rclone -documentation (https://rclone.org/docs/#syntax-of-remote-paths). -This option can be aliased as \f[C]fs\f[R] to prevent confusion with the -\f[I]remote\f[R] parameter of such backends as \f[I]crypt\f[R] or -\f[I]alias\f[R]. +\f[B]Authentication is required for this call.\f[R] +.SS pluginsctl/listTestPlugins: Show currently loaded test plugins .PP -The \f[C]remote=:backend:dir/subdir\f[R] syntax can be used to create -on-the-fly (config-less) -remotes (https://rclone.org/docs/#backend-path-to-dir), while the -\f[C]type\f[R] and \f[C]path\f[R] options provide a simpler alternative -for this. -Using two split options -.IP -.nf -\f[C] --o type=backend -o path=dir/subdir -\f[R] -.fi +Allows listing of test plugins with the rclone.test set to true in +package.json of the plugin. .PP -is equivalent to the combined syntax +This takes no parameters and returns: +.IP \[bu] 2 +loadedTestPlugins - list of currently available test plugins. +.PP +E.g. .IP .nf \f[C] --o remote=:backend:dir/subdir +rclone rc pluginsctl/listTestPlugins \f[R] .fi .PP -but is arguably easier to parameterize in scripts. -The \f[C]path\f[R] part is optional. -.PP -Mount and VFS -options (https://rclone.org/commands/rclone_serve_docker/#options) as -well as backend parameters (https://rclone.org/flags/#backend-flags) are -named like their twin command-line flags without the \f[C]--\f[R] CLI -prefix. -Optionally you can use underscores instead of dashes in option names. -For example, \f[C]--vfs-cache-mode full\f[R] becomes -\f[C]-o vfs-cache-mode=full\f[R] or \f[C]-o vfs_cache_mode=full\f[R]. -Boolean CLI flags without value will gain the \f[C]true\f[R] value, e.g. -\f[C]--allow-other\f[R] becomes \f[C]-o allow-other=true\f[R] or -\f[C]-o allow_other=true\f[R]. +\f[B]Authentication is required for this call.\f[R] +.SS pluginsctl/removePlugin: Remove a loaded plugin .PP -Please note that you can provide parameters only for the backend -immediately referenced by the backend type of mounted \f[C]remote\f[R]. -If this is a wrapping backend like \f[I]alias, chunker or crypt\f[R], -you cannot provide options for the referred to remote or backend. -This limitation is imposed by the rclone connection string parser. -The only workaround is to feed plugin with \f[C]rclone.conf\f[R] or -configure plugin arguments (see below). -.SS Special Volume Options +This allows you to remove a plugin using it\[aq]s name. .PP -\f[C]mount-type\f[R] determines the mount method and in general can be -one of: \f[C]mount\f[R], \f[C]cmount\f[R], or \f[C]mount2\f[R]. -This can be aliased as \f[C]mount_type\f[R]. -It should be noted that the managed rclone docker plugin currently does -not support the \f[C]cmount\f[R] method and \f[C]mount2\f[R] is rarely -needed. -This option defaults to the first found method, which is usually -\f[C]mount\f[R] so you generally won\[aq]t need it. +This takes parameters: +.IP \[bu] 2 +name - name of the plugin in the format +\f[C]author\f[R]/\f[C]plugin_name\f[R]. .PP -\f[C]persist\f[R] is a reserved boolean (true/false) option. -In future it will allow to persist on-the-fly remotes in the plugin -\f[C]rclone.conf\f[R] file. -.SS Connection Strings +E.g. .PP -The \f[C]remote\f[R] value can be extended with connection -strings (https://rclone.org/docs/#connection-strings) as an alternative -way to supply backend parameters. -This is equivalent to the \f[C]-o\f[R] backend options with one -\f[I]syntactic difference\f[R]. -Inside connection string the backend prefix must be dropped from -parameter names but in the \f[C]-o param=value\f[R] array it must be -present. -For instance, compare the following option array -.IP -.nf -\f[C] --o remote=:sftp:/home -o sftp-host=localhost -\f[R] -.fi +rclone rc pluginsctl/removePlugin name=rclone/video-plugin .PP -with equivalent connection string: -.IP -.nf -\f[C] --o remote=:sftp,host=localhost:/home -\f[R] -.fi +\f[B]Authentication is required for this call.\f[R] +.SS pluginsctl/removeTestPlugin: Remove a test plugin .PP -This difference exists because flag options \f[C]-o key=val\f[R] include -not only backend parameters but also mount/VFS flags and possibly other -settings. -Also it allows to discriminate the \f[C]remote\f[R] option from the -\f[C]crypt-remote\f[R] (or similarly named backend parameters) and -arguably simplifies scripting due to clearer value substitution. -.SS Using with Swarm or Compose +This allows you to remove a plugin using it\[aq]s name. .PP -Both \f[I]Docker Swarm\f[R] and \f[I]Docker Compose\f[R] use -YAML (http://yaml.org/spec/1.2/spec.html)-formatted text files to -describe groups (stacks) of containers, their properties, networks and -volumes. -\f[I]Compose\f[R] uses the compose -v2 (https://docs.docker.com/compose/compose-file/compose-file-v2/#volume-configuration-reference) -format, \f[I]Swarm\f[R] uses the compose -v3 (https://docs.docker.com/compose/compose-file/compose-file-v3/#volume-configuration-reference) -format. -They are mostly similar, differences are explained in the docker -documentation (https://docs.docker.com/compose/compose-file/compose-versioning/#upgrading). +This takes the following parameters: +.IP \[bu] 2 +name - name of the plugin in the format +\f[C]author\f[R]/\f[C]plugin_name\f[R]. .PP -Volumes are described by the children of the top-level -\f[C]volumes:\f[R] node. -Each of them should be named after its volume and have at least two -elements, the self-explanatory \f[C]driver: rclone\f[R] value and the -\f[C]driver_opts:\f[R] structure playing the same role as -\f[C]-o key=val\f[R] CLI flags: +Example: .IP .nf \f[C] -volumes: - volume_name_1: - driver: rclone - driver_opts: - remote: \[aq]gdrive:\[aq] - allow_other: \[aq]true\[aq] - vfs_cache_mode: full - token: \[aq]{\[dq]type\[dq]: \[dq]borrower\[dq], \[dq]expires\[dq]: \[dq]2021-12-31\[dq]}\[aq] - poll_interval: 0 +rclone rc pluginsctl/removeTestPlugin name=rclone/rclone-webui-react \f[R] .fi .PP -Notice a few important details: - YAML prefers \f[C]_\f[R] in option -names instead of \f[C]-\f[R]. -- YAML treats single and double quotes interchangeably. -Simple strings and integers can be left unquoted. -- Boolean values must be quoted like \f[C]\[aq]true\[aq]\f[R] or -\f[C]\[dq]false\[dq]\f[R] because these two words are reserved by YAML. -- The filesystem string is keyed with \f[C]remote\f[R] (or with -\f[C]fs\f[R]). -Normally you can omit quotes here, but if the string ends with colon, -you \f[B]must\f[R] quote it like -\f[C]remote: \[dq]storage_box:\[dq]\f[R]. -- YAML is picky about surrounding braces in values as this is in fact -another syntax for key/value -mappings (http://yaml.org/spec/1.2/spec.html#id2790832). -For example, JSON access tokens usually contain double quotes and -surrounding braces, so you must put them in single quotes. -.SS Installing as Managed Plugin +\f[B]Authentication is required for this call.\f[R] +.SS rc/error: This returns an error .PP -Docker daemon can install plugins from an image registry and run them -managed. -We maintain the -docker-volume-rclone (https://hub.docker.com/p/rclone/docker-volume-rclone/) -plugin image on Docker Hub (https://hub.docker.com). +This returns an error with the input as part of its error string. +Useful for testing error handling. +.SS rc/list: List all the registered remote control commands .PP -Rclone volume plugin requires \f[B]Docker Engine >= 19.03.15\f[R] +This lists all the registered remote control commands as a JSON map in +the commands response. +.SS rc/noop: Echo the input to the output parameters .PP -The plugin requires presence of two directories on the host before it -can be installed. -Note that plugin will \f[B]not\f[R] create them automatically. -By default they must exist on host at the following locations (though -you can tweak the paths): - -\f[C]/var/lib/docker-plugins/rclone/config\f[R] is reserved for the -\f[C]rclone.conf\f[R] config file and \f[B]must\f[R] exist even if -it\[aq]s empty and the config file is not present. -- \f[C]/var/lib/docker-plugins/rclone/cache\f[R] holds the plugin state -file as well as optional VFS caches. +This echoes the input parameters to the output parameters for testing +purposes. +It can be used to check that rclone is still alive and to check that +parameter passing is working properly. +.SS rc/noopauth: Echo the input to the output parameters requiring auth .PP -You can install managed -plugin (https://docs.docker.com/engine/reference/commandline/plugin_install/) -with default settings as follows: -.IP -.nf -\f[C] -docker plugin install rclone/docker-volume-rclone:amd64 --grant-all-permissions --alias rclone -\f[R] -.fi +This echoes the input parameters to the output parameters for testing +purposes. +It can be used to check that rclone is still alive and to check that +parameter passing is working properly. .PP -The \f[C]:amd64\f[R] part of the image specification after colon is -called a \f[I]tag\f[R]. -Usually you will want to install the latest plugin for your -architecture. -In this case the tag will just name it, like \f[C]amd64\f[R] above. -The following plugin architectures are currently available: - -\f[C]amd64\f[R] - \f[C]arm64\f[R] - \f[C]arm-v7\f[R] +\f[B]Authentication is required for this call.\f[R] +.SS sync/bisync: Perform bidirectional synchronization between two paths. .PP -Sometimes you might want a concrete plugin version, not the latest one. -Then you should use image tag in the form -\f[C]:ARCHITECTURE-VERSION\f[R]. -For example, to install plugin version \f[C]v1.56.2\f[R] on architecture -\f[C]arm64\f[R] you will use tag \f[C]arm64-1.56.2\f[R] (note the -removed \f[C]v\f[R]) so the full image specification becomes -\f[C]rclone/docker-volume-rclone:arm64-1.56.2\f[R]. +This takes the following parameters +.IP \[bu] 2 +path1 - a remote directory string e.g. +\f[C]drive:path1\f[R] +.IP \[bu] 2 +path2 - a remote directory string e.g. +\f[C]drive:path2\f[R] +.IP \[bu] 2 +dryRun - dry-run mode +.IP \[bu] 2 +resync - performs the resync run +.IP \[bu] 2 +checkAccess - abort if RCLONE_TEST files are not found on both +filesystems +.IP \[bu] 2 +checkFilename - file name for checkAccess (default: RCLONE_TEST) +.IP \[bu] 2 +maxDelete - abort sync if percentage of deleted files is above this +threshold (default: 50) +.IP \[bu] 2 +force - Bypass maxDelete safety check and run the sync +.IP \[bu] 2 +checkSync - \f[C]true\f[R] by default, \f[C]false\f[R] disables +comparison of final listings, \f[C]only\f[R] will skip sync, only +compare listings from the last run +.IP \[bu] 2 +createEmptySrcDirs - Sync creation and deletion of empty directories. +(Not compatible with --remove-empty-dirs) +.IP \[bu] 2 +removeEmptyDirs - remove empty directories at the final cleanup step +.IP \[bu] 2 +filtersFile - read filtering patterns from a file +.IP \[bu] 2 +ignoreListingChecksum - Do not use checksums for listings +.IP \[bu] 2 +resilient - Allow future runs to retry after certain less-serious +errors, instead of requiring resync. +Use at your own risk! +.IP \[bu] 2 +workdir - server directory for history files (default: +/home/ncw/.cache/rclone/bisync) +.IP \[bu] 2 +noCleanup - retain working files .PP -We also provide the \f[C]latest\f[R] plugin tag, but since docker does -not support multi-architecture plugins as of the time of this writing, -this tag is currently an \f[B]alias for \f[CB]amd64\f[B]\f[R]. -By convention the \f[C]latest\f[R] tag is the default one and can be -omitted, thus both \f[C]rclone/docker-volume-rclone:latest\f[R] and just -\f[C]rclone/docker-volume-rclone\f[R] will refer to the latest plugin -release for the \f[C]amd64\f[R] platform. +See bisync command help (https://rclone.org/commands/rclone_bisync/) and +full bisync description (https://rclone.org/bisync/) for more +information. .PP -Also the \f[C]amd64\f[R] part can be omitted from the versioned rclone -plugin tags. -For example, rclone image reference -\f[C]rclone/docker-volume-rclone:amd64-1.56.2\f[R] can be abbreviated as -\f[C]rclone/docker-volume-rclone:1.56.2\f[R] for convenience. -However, for non-intel architectures you still have to use the full tag -as \f[C]amd64\f[R] or \f[C]latest\f[R] will fail to start. +\f[B]Authentication is required for this call.\f[R] +.SS sync/copy: copy a directory from source remote to destination remote .PP -Managed plugin is in fact a special container running in a namespace -separate from normal docker containers. -Inside it runs the \f[C]rclone serve docker\f[R] command. -The config and cache directories are bind-mounted into the container at -start. -The docker daemon connects to a unix socket created by the command -inside the container. -The command creates on-demand remote mounts right inside, then docker -machinery propagates them through kernel mount namespaces and -bind-mounts into requesting user containers. +This takes the following parameters: +.IP \[bu] 2 +srcFs - a remote name string e.g. +\[dq]drive:src\[dq] for the source +.IP \[bu] 2 +dstFs - a remote name string e.g. +\[dq]drive:dst\[dq] for the destination +.IP \[bu] 2 +createEmptySrcDirs - create empty src directories on destination if set .PP -You can tweak a few plugin settings after installation when it\[aq]s -disabled (not in use), for instance: -.IP -.nf -\f[C] -docker plugin disable rclone -docker plugin set rclone RCLONE_VERBOSE=2 config=/etc/rclone args=\[dq]--vfs-cache-mode=writes --allow-other\[dq] -docker plugin enable rclone -docker plugin inspect rclone -\f[R] -.fi +See the copy (https://rclone.org/commands/rclone_copy/) command for more +information on the above. .PP -Note that if docker refuses to disable the plugin, you should find and -remove all active volumes connected with it as well as containers and -swarm services that use them. -This is rather tedious so please carefully plan in advance. +\f[B]Authentication is required for this call.\f[R] +.SS sync/move: move a directory from source remote to destination remote +.PP +This takes the following parameters: +.IP \[bu] 2 +srcFs - a remote name string e.g. +\[dq]drive:src\[dq] for the source +.IP \[bu] 2 +dstFs - a remote name string e.g. +\[dq]drive:dst\[dq] for the destination +.IP \[bu] 2 +createEmptySrcDirs - create empty src directories on destination if set +.IP \[bu] 2 +deleteEmptySrcDirs - delete empty src directories if set .PP -You can tweak the following settings: \f[C]args\f[R], \f[C]config\f[R], -\f[C]cache\f[R], \f[C]HTTP_PROXY\f[R], \f[C]HTTPS_PROXY\f[R], -\f[C]NO_PROXY\f[R] and \f[C]RCLONE_VERBOSE\f[R]. -It\[aq]s \f[I]your\f[R] task to keep plugin settings in sync across -swarm cluster nodes. +See the move (https://rclone.org/commands/rclone_move/) command for more +information on the above. .PP -\f[C]args\f[R] sets command-line arguments for the -\f[C]rclone serve docker\f[R] command (\f[I]none\f[R] by default). -Arguments should be separated by space so you will normally want to put -them in quotes on the docker plugin -set (https://docs.docker.com/engine/reference/commandline/plugin_set/) -command line. -Both serve docker -flags (https://rclone.org/commands/rclone_serve_docker/#options) and -generic rclone flags (https://rclone.org/flags/) are supported, -including backend parameters that will be used as defaults for volume -creation. -Note that plugin will fail (due to this docker -bug (https://github.com/moby/moby/blob/v20.10.7/plugin/v2/plugin.go#L195)) -if the \f[C]args\f[R] value is empty. -Use e.g. -\f[C]args=\[dq]-v\[dq]\f[R] as a workaround. +\f[B]Authentication is required for this call.\f[R] +.SS sync/sync: sync a directory from source remote to destination remote .PP -\f[C]config=/host/dir\f[R] sets alternative host location for the config -directory. -Plugin will look for \f[C]rclone.conf\f[R] here. -It\[aq]s not an error if the config file is not present but the -directory must exist. -Please note that plugin can periodically rewrite the config file, for -example when it renews storage access tokens. -Keep this in mind and try to avoid races between the plugin and other -instances of rclone on the host that might try to change the config -simultaneously resulting in corrupted \f[C]rclone.conf\f[R]. -You can also put stuff like private key files for SFTP remotes in this -directory. -Just note that it\[aq]s bind-mounted inside the plugin container at the -predefined path \f[C]/data/config\f[R]. -For example, if your key file is named \f[C]sftp-box1.key\f[R] on the -host, the corresponding volume config option should read -\f[C]-o sftp-key-file=/data/config/sftp-box1.key\f[R]. +This takes the following parameters: +.IP \[bu] 2 +srcFs - a remote name string e.g. +\[dq]drive:src\[dq] for the source +.IP \[bu] 2 +dstFs - a remote name string e.g. +\[dq]drive:dst\[dq] for the destination +.IP \[bu] 2 +createEmptySrcDirs - create empty src directories on destination if set .PP -\f[C]cache=/host/dir\f[R] sets alternative host location for the -\f[I]cache\f[R] directory. -The plugin will keep VFS caches here. -Also it will create and maintain the \f[C]docker-plugin.state\f[R] file -in this directory. -When the plugin is restarted or reinstalled, it will look in this file -to recreate any volumes that existed previously. -However, they will not be re-mounted into consuming containers after -restart. -Usually this is not a problem as the docker daemon normally will restart -affected user containers after failures, daemon restarts or host -reboots. +See the sync (https://rclone.org/commands/rclone_sync/) command for more +information on the above. .PP -\f[C]RCLONE_VERBOSE\f[R] sets plugin verbosity from \f[C]0\f[R] (errors -only, by default) to \f[C]2\f[R] (debugging). -Verbosity can be also tweaked via \f[C]args=\[dq]-v [-v] ...\[dq]\f[R]. -Since arguments are more generic, you will rarely need this setting. -The plugin output by default feeds the docker daemon log on local host. -Log entries are reflected as \f[I]errors\f[R] in the docker log but -retain their actual level assigned by rclone in the encapsulated message -string. +\f[B]Authentication is required for this call.\f[R] +.SS vfs/forget: Forget files or directories in the directory cache. .PP -\f[C]HTTP_PROXY\f[R], \f[C]HTTPS_PROXY\f[R], \f[C]NO_PROXY\f[R] -customize the plugin proxy settings. +This forgets the paths in the directory cache causing them to be re-read +from the remote when needed. .PP -You can set custom plugin options right when you install it, \f[I]in one -go\f[R]: +If no paths are passed in then it will forget all the paths in the +directory cache. .IP .nf \f[C] -docker plugin remove rclone -docker plugin install rclone/docker-volume-rclone:amd64 \[rs] - --alias rclone --grant-all-permissions \[rs] - args=\[dq]-v --allow-other\[dq] config=/etc/rclone -docker plugin inspect rclone +rclone rc vfs/forget \f[R] .fi -.SS Healthchecks .PP -The docker plugin volume protocol doesn\[aq]t provide a way for plugins -to inform the docker daemon that a volume is (un-)available. -As a workaround you can setup a healthcheck to verify that the mount is -responding, for example: +Otherwise pass files or dirs in as file=path or dir=path. +Any parameter key starting with file will forget that file and any +starting with dir will forget that dir, e.g. .IP .nf \f[C] -services: - my_service: - image: my_image - healthcheck: - test: ls /path/to/rclone/mount || exit 1 - interval: 1m - timeout: 15s - retries: 3 - start_period: 15s +rclone rc vfs/forget file=hello file2=goodbye dir=home/junk \f[R] .fi -.SS Running Plugin under Systemd .PP -In most cases you should prefer managed mode. -Moreover, MacOS and Windows do not support native Docker plugins. -Please use managed mode on these systems. -Proceed further only if you are on Linux. +This command takes an \[dq]fs\[dq] parameter. +If this parameter is not supplied and if there is only one VFS in use +then that VFS will be used. +If there is more than one VFS in use then the \[dq]fs\[dq] parameter +must be supplied. +.SS vfs/list: List active VFSes. .PP -First, install rclone (https://rclone.org/install/). -You can just run it (type \f[C]rclone serve docker\f[R] and hit enter) -for the test. +This lists the active VFSes. .PP -Install \f[I]FUSE\f[R]: +It returns a list under the key \[dq]vfses\[dq] where the values are the +VFS names that could be passed to the other VFS commands in the +\[dq]fs\[dq] parameter. +.SS vfs/poll-interval: Get the status or update the value of the poll-interval option. +.PP +Without any parameter given this returns the current status of the +poll-interval setting. +.PP +When the interval=duration parameter is set, the poll-interval value is +updated and the polling function is notified. +Setting interval=0 disables poll-interval. .IP .nf \f[C] -sudo apt-get -y install fuse +rclone rc vfs/poll-interval interval=5m \f[R] .fi .PP -Download two systemd configuration files: -docker-volume-rclone.service (https://raw.githubusercontent.com/rclone/rclone/master/contrib/docker-plugin/systemd/docker-volume-rclone.service) -and -docker-volume-rclone.socket (https://raw.githubusercontent.com/rclone/rclone/master/contrib/docker-plugin/systemd/docker-volume-rclone.socket). +The timeout=duration parameter can be used to specify a time to wait for +the current poll function to apply the new value. +If timeout is less or equal 0, which is the default, wait indefinitely. .PP -Put them to the \f[C]/etc/systemd/system/\f[R] directory: +The new poll-interval value will only be active when the timeout is not +reached. +.PP +If poll-interval is updated or disabled temporarily, some changes might +not get picked up by the polling function, depending on the used remote. +.PP +This command takes an \[dq]fs\[dq] parameter. +If this parameter is not supplied and if there is only one VFS in use +then that VFS will be used. +If there is more than one VFS in use then the \[dq]fs\[dq] parameter +must be supplied. +.SS vfs/refresh: Refresh the directory cache. +.PP +This reads the directories for the specified paths and freshens the +directory cache. +.PP +If no paths are passed in then it will refresh the root directory. .IP .nf \f[C] -cp docker-volume-plugin.service /etc/systemd/system/ -cp docker-volume-plugin.socket /etc/systemd/system/ +rclone rc vfs/refresh \f[R] .fi .PP -Please note that all commands in this section must be run as -\f[I]root\f[R] but we omit \f[C]sudo\f[R] prefix for brevity. -Now create directories required by the service: +Otherwise pass directories in as dir=path. +Any parameter key starting with dir will refresh that directory, e.g. .IP .nf \f[C] -mkdir -p /var/lib/docker-volumes/rclone -mkdir -p /var/lib/docker-plugins/rclone/config -mkdir -p /var/lib/docker-plugins/rclone/cache +rclone rc vfs/refresh dir=home/junk dir2=data/misc \f[R] .fi .PP -Run the docker plugin service in the socket activated mode: +If the parameter recursive=true is given the whole directory tree will +get refreshed. +This refresh will use --fast-list if enabled. +.PP +This command takes an \[dq]fs\[dq] parameter. +If this parameter is not supplied and if there is only one VFS in use +then that VFS will be used. +If there is more than one VFS in use then the \[dq]fs\[dq] parameter +must be supplied. +.SS vfs/stats: Stats for a VFS. +.PP +This returns stats for the selected VFS. .IP .nf \f[C] -systemctl daemon-reload -systemctl start docker-volume-rclone.service -systemctl enable docker-volume-rclone.socket -systemctl start docker-volume-rclone.socket -systemctl restart docker +{ + // Status of the disk cache - only present if --vfs-cache-mode > off + \[dq]diskCache\[dq]: { + \[dq]bytesUsed\[dq]: 0, + \[dq]erroredFiles\[dq]: 0, + \[dq]files\[dq]: 0, + \[dq]hashType\[dq]: 1, + \[dq]outOfSpace\[dq]: false, + \[dq]path\[dq]: \[dq]/home/user/.cache/rclone/vfs/local/mnt/a\[dq], + \[dq]pathMeta\[dq]: \[dq]/home/user/.cache/rclone/vfsMeta/local/mnt/a\[dq], + \[dq]uploadsInProgress\[dq]: 0, + \[dq]uploadsQueued\[dq]: 0 + }, + \[dq]fs\[dq]: \[dq]/mnt/a\[dq], + \[dq]inUse\[dq]: 1, + // Status of the in memory metadata cache + \[dq]metadataCache\[dq]: { + \[dq]dirs\[dq]: 1, + \[dq]files\[dq]: 0 + }, + // Options as returned by options/get + \[dq]opt\[dq]: { + \[dq]CacheMaxAge\[dq]: 3600000000000, + // ... + \[dq]WriteWait\[dq]: 1000000000 + } +} \f[R] .fi .PP -Or run the service directly: - run \f[C]systemctl daemon-reload\f[R] to -let systemd pick up new config - run -\f[C]systemctl enable docker-volume-rclone.service\f[R] to make the new -service start automatically when you power on your machine. -- run \f[C]systemctl start docker-volume-rclone.service\f[R] to start -the service now. -- run \f[C]systemctl restart docker\f[R] to restart docker daemon and -let it detect the new plugin socket. -Note that this step is not needed in managed mode where docker knows -about plugin state changes. +This command takes an \[dq]fs\[dq] parameter. +If this parameter is not supplied and if there is only one VFS in use +then that VFS will be used. +If there is more than one VFS in use then the \[dq]fs\[dq] parameter +must be supplied. +.SS Accessing the remote control via HTTP .PP -The two methods are equivalent from the user perspective, but I -personally prefer socket activation. -.SS Troubleshooting +Rclone implements a simple HTTP based protocol. .PP -You can see managed plugin -settings (https://docs.docker.com/engine/extend/#debugging-plugins) with +Each endpoint takes an JSON object and returns a JSON object or an +error. +The JSON objects are essentially a map of string names to values. +.PP +All calls must made using POST. +.PP +The input objects can be supplied using URL parameters, POST parameters +or by supplying \[dq]Content-Type: application/json\[dq] and a JSON blob +in the body. +There are examples of these below using \f[C]curl\f[R]. +.PP +The response will be a JSON blob in the body of the response. +This is formatted to be reasonably human-readable. +.SS Error returns +.PP +If an error occurs then there will be an HTTP error status (e.g. +500) and the body of the response will contain a JSON encoded error +object, e.g. .IP .nf \f[C] -docker plugin list -docker plugin inspect rclone +{ + \[dq]error\[dq]: \[dq]Expecting string value for key \[rs]\[dq]remote\[rs]\[dq] (was float64)\[dq], + \[dq]input\[dq]: { + \[dq]fs\[dq]: \[dq]/tmp\[dq], + \[dq]remote\[dq]: 3 + }, + \[dq]status\[dq]: 400 + \[dq]path\[dq]: \[dq]operations/rmdir\[dq], +} \f[R] .fi .PP -Note that docker (including latest 20.10.7) will not show actual values -of \f[C]args\f[R], just the defaults. -.PP -Use \f[C]journalctl --unit docker\f[R] to see managed plugin output as -part of the docker daemon log. -Note that docker reflects plugin lines as \f[I]errors\f[R] but their -actual level can be seen from encapsulated message string. +The keys in the error response are - error - error string - input - the +input parameters to the call - status - the HTTP status code - path - +the path of the call +.SS CORS .PP -You will usually install the latest version of managed plugin for your -platform. -Use the following commands to print the actual installed version: +The sever implements basic CORS support and allows all origins for that. +The response to a preflight OPTIONS request will echo the requested +\[dq]Access-Control-Request-Headers\[dq] back. +.SS Using POST with URL parameters only .IP .nf \f[C] -PLUGID=$(docker plugin list --no-trunc | awk \[aq]/rclone/{print$1}\[aq]) -sudo runc --root /run/docker/runtime-runc/plugins.moby exec $PLUGID rclone version +curl -X POST \[aq]http://localhost:5572/rc/noop?potato=1&sausage=2\[aq] \f[R] .fi .PP -You can even use \f[C]runc\f[R] to run shell inside the plugin -container: +Response .IP .nf \f[C] -sudo runc --root /run/docker/runtime-runc/plugins.moby exec --tty $PLUGID bash +{ + \[dq]potato\[dq]: \[dq]1\[dq], + \[dq]sausage\[dq]: \[dq]2\[dq] +} \f[R] .fi .PP -Also you can use curl to check the plugin socket connectivity: +Here is what an error response looks like: .IP .nf \f[C] -docker plugin list --no-trunc -PLUGID=123abc... -sudo curl -H Content-Type:application/json -XPOST -d {} --unix-socket /run/docker/plugins/$PLUGID/rclone.sock http://localhost/Plugin.Activate +curl -X POST \[aq]http://localhost:5572/rc/error?potato=1&sausage=2\[aq] \f[R] .fi -.PP -though this is rarely needed. -.SS Caveats -.PP -Finally I\[aq]d like to mention a \f[I]caveat with updating volume -settings\f[R]. -Docker CLI does not have a dedicated command like -\f[C]docker volume update\f[R]. -It may be tempting to invoke \f[C]docker volume create\f[R] with updated -options on existing volume, but there is a gotcha. -The command will do nothing, it won\[aq]t even return an error. -I hope that docker maintainers will fix this some day. -In the meantime be aware that you must remove your volume before -recreating it with new settings: .IP .nf \f[C] -docker volume remove my_vol -docker volume create my_vol -d rclone -o opt1=new_val1 ... +{ + \[dq]error\[dq]: \[dq]arbitrary error on input map[potato:1 sausage:2]\[dq], + \[dq]input\[dq]: { + \[dq]potato\[dq]: \[dq]1\[dq], + \[dq]sausage\[dq]: \[dq]2\[dq] + } +} \f[R] .fi .PP -and verify that settings did update: +Note that curl doesn\[aq]t return errors to the shell unless you use the +\f[C]-f\f[R] option .IP .nf \f[C] -docker volume list -docker volume inspect my_vol +$ curl -f -X POST \[aq]http://localhost:5572/rc/error?potato=1&sausage=2\[aq] +curl: (22) The requested URL returned error: 400 Bad Request +$ echo $? +22 \f[R] .fi -.PP -If docker refuses to remove the volume, you should find containers or -swarm services that use it and stop them first. -.SS Getting started -.IP \[bu] 2 -Install rclone (https://rclone.org/install/) and setup your remotes. -.IP \[bu] 2 -Bisync will create its working directory at -\f[C]\[ti]/.cache/rclone/bisync\f[R] on Linux or -\f[C]C:\[rs]Users\[rs]MyLogin\[rs]AppData\[rs]Local\[rs]rclone\[rs]bisync\f[R] -on Windows. -Make sure that this location is writable. -.IP \[bu] 2 -Run bisync with the \f[C]--resync\f[R] flag, specifying the paths to the -local and remote sync directory roots. -.IP \[bu] 2 -For successive sync runs, leave off the \f[C]--resync\f[R] flag. -.IP \[bu] 2 -Consider using a filters file for excluding unnecessary files and -directories from the sync. -.IP \[bu] 2 -Consider setting up the --check-access feature for safety. -.IP \[bu] 2 -On Linux, consider setting up a crontab entry. -bisync can safely run in concurrent cron jobs thanks to lock files it -maintains. -.PP -Here is a typical run log (with timestamps removed for clarity): +.SS Using POST with a form .IP .nf \f[C] -rclone bisync /testdir/path1/ /testdir/path2/ --verbose -INFO : Synching Path1 \[dq]/testdir/path1/\[dq] with Path2 \[dq]/testdir/path2/\[dq] -INFO : Path1 checking for diffs -INFO : - Path1 File is new - file11.txt -INFO : - Path1 File is newer - file2.txt -INFO : - Path1 File is newer - file5.txt -INFO : - Path1 File is newer - file7.txt -INFO : - Path1 File was deleted - file4.txt -INFO : - Path1 File was deleted - file6.txt -INFO : - Path1 File was deleted - file8.txt -INFO : Path1: 7 changes: 1 new, 3 newer, 0 older, 3 deleted -INFO : Path2 checking for diffs -INFO : - Path2 File is new - file10.txt -INFO : - Path2 File is newer - file1.txt -INFO : - Path2 File is newer - file5.txt -INFO : - Path2 File is newer - file6.txt -INFO : - Path2 File was deleted - file3.txt -INFO : - Path2 File was deleted - file7.txt -INFO : - Path2 File was deleted - file8.txt -INFO : Path2: 7 changes: 1 new, 3 newer, 0 older, 3 deleted -INFO : Applying changes -INFO : - Path1 Queue copy to Path2 - /testdir/path2/file11.txt -INFO : - Path1 Queue copy to Path2 - /testdir/path2/file2.txt -INFO : - Path2 Queue delete - /testdir/path2/file4.txt -NOTICE: - WARNING New or changed in both paths - file5.txt -NOTICE: - Path1 Renaming Path1 copy - /testdir/path1/file5.txt..path1 -NOTICE: - Path1 Queue copy to Path2 - /testdir/path2/file5.txt..path1 -NOTICE: - Path2 Renaming Path2 copy - /testdir/path2/file5.txt..path2 -NOTICE: - Path2 Queue copy to Path1 - /testdir/path1/file5.txt..path2 -INFO : - Path2 Queue copy to Path1 - /testdir/path1/file6.txt -INFO : - Path1 Queue copy to Path2 - /testdir/path2/file7.txt -INFO : - Path2 Queue copy to Path1 - /testdir/path1/file1.txt -INFO : - Path2 Queue copy to Path1 - /testdir/path1/file10.txt -INFO : - Path1 Queue delete - /testdir/path1/file3.txt -INFO : - Path2 Do queued copies to - Path1 -INFO : - Path1 Do queued copies to - Path2 -INFO : - Do queued deletes on - Path1 -INFO : - Do queued deletes on - Path2 -INFO : Updating listings -INFO : Validating listings for Path1 \[dq]/testdir/path1/\[dq] vs Path2 \[dq]/testdir/path2/\[dq] -INFO : Bisync successful +curl --data \[dq]potato=1\[dq] --data \[dq]sausage=2\[dq] http://localhost:5572/rc/noop \f[R] .fi -.SS Command line syntax +.PP +Response .IP .nf \f[C] -$ rclone bisync --help -Usage: - rclone bisync remote1:path1 remote2:path2 [flags] - -Positional arguments: - Path1, Path2 Local path, or remote storage with \[aq]:\[aq] plus optional path. - Type \[aq]rclone listremotes\[aq] for list of configured remotes. - -Optional Flags: - --check-access Ensure expected \[ga]RCLONE_TEST\[ga] files are found on - both Path1 and Path2 filesystems, else abort. - --check-filename FILENAME Filename for \[ga]--check-access\[ga] (default: \[ga]RCLONE_TEST\[ga]) - --check-sync CHOICE Controls comparison of final listings: - \[ga]true | false | only\[ga] (default: true) - If set to \[ga]only\[ga], bisync will only compare listings - from the last run but skip actual sync. - --filters-file PATH Read filtering patterns from a file - --max-delete PERCENT Safety check on maximum percentage of deleted files allowed. - If exceeded, the bisync run will abort. (default: 50%) - --force Bypass \[ga]--max-delete\[ga] safety check and run the sync. - Consider using with \[ga]--verbose\[ga] - --create-empty-src-dirs Sync creation and deletion of empty directories. - (Not compatible with --remove-empty-dirs) - --remove-empty-dirs Remove empty directories at the final cleanup step. - -1, --resync Performs the resync run. - Warning: Path1 files may overwrite Path2 versions. - Consider using \[ga]--verbose\[ga] or \[ga]--dry-run\[ga] first. - --ignore-listing-checksum Do not use checksums for listings - (add --ignore-checksum to additionally skip post-copy checksum checks) - --resilient Allow future runs to retry after certain less-serious errors, - instead of requiring --resync. Use at your own risk! - --localtime Use local time in listings (default: UTC) - --no-cleanup Retain working files (useful for troubleshooting and testing). - --workdir PATH Use custom working directory (useful for testing). - (default: \[ga]\[ti]/.cache/rclone/bisync\[ga]) - -n, --dry-run Go through the motions - No files are copied/deleted. - -v, --verbose Increases logging verbosity. - May be specified more than once for more details. - -h, --help help for bisync +{ + \[dq]potato\[dq]: \[dq]1\[dq], + \[dq]sausage\[dq]: \[dq]2\[dq] +} \f[R] .fi .PP -Arbitrary rclone flags may be specified on the bisync command -line (https://rclone.org/commands/rclone_bisync/), for example -\f[C]rclone bisync ./testdir/path1/ gdrive:testdir/path2/ --drive-skip-gdocs -v -v --timeout 10s\f[R] -Note that interactions of various rclone flags with bisync process flow -has not been fully tested yet. -.SS Paths -.PP -Path1 and Path2 arguments may be references to any mix of local -directory paths (absolute or relative), UNC paths -(\f[C]//server/share/path\f[R]), Windows drive paths (with a drive -letter and \f[C]:\f[R]) or configured -remotes (https://rclone.org/docs/#syntax-of-remote-paths) with optional -subdirectory paths. -Cloud references are distinguished by having a \f[C]:\f[R] in the -argument (see Windows support below). -.PP -Path1 and Path2 are treated equally, in that neither has priority for -file changes (except during \f[C]--resync\f[R]), and access efficiency -does not change whether a remote is on Path1 or Path2. -.PP -The listings in bisync working directory (default: -\f[C]\[ti]/.cache/rclone/bisync\f[R]) are named based on the Path1 and -Path2 arguments so that separate syncs to individual directories within -the tree may be set up, e.g.: -\f[C]path_to_local_tree..dropbox_subdir.lst\f[R]. -.PP -Any empty directories after the sync on both the Path1 and Path2 -filesystems are not deleted by default, unless -\f[C]--create-empty-src-dirs\f[R] is specified. -If the \f[C]--remove-empty-dirs\f[R] flag is specified, then both paths -will have ALL empty directories purged as the last step in the process. -.SS Command-line flags -.SS --resync -.PP -This will effectively make both Path1 and Path2 filesystems contain a -matching superset of all files. -Path2 files that do not exist in Path1 will be copied to Path1, and the -process will then copy the Path1 tree to Path2. +Note that you can combine these with URL parameters too with the POST +parameters taking precedence. +.IP +.nf +\f[C] +curl --data \[dq]potato=1\[dq] --data \[dq]sausage=2\[dq] \[dq]http://localhost:5572/rc/noop?rutabaga=3&sausage=4\[dq] +\f[R] +.fi .PP -The \f[C]--resync\f[R] sequence is roughly equivalent to: +Response .IP .nf \f[C] -rclone copy Path2 Path1 --ignore-existing -rclone copy Path1 Path2 +{ + \[dq]potato\[dq]: \[dq]1\[dq], + \[dq]rutabaga\[dq]: \[dq]3\[dq], + \[dq]sausage\[dq]: \[dq]4\[dq] +} \f[R] .fi -.PP -Or, if using \f[C]--create-empty-src-dirs\f[R]: +.SS Using POST with a JSON blob .IP .nf \f[C] -rclone copy Path2 Path1 --ignore-existing -rclone copy Path1 Path2 --create-empty-src-dirs -rclone copy Path2 Path1 --create-empty-src-dirs +curl -H \[dq]Content-Type: application/json\[dq] -X POST -d \[aq]{\[dq]potato\[dq]:2,\[dq]sausage\[dq]:1}\[aq] http://localhost:5572/rc/noop \f[R] .fi .PP -The base directories on both Path1 and Path2 filesystems must exist or -bisync will fail. -This is required for safety - that bisync can verify that both paths are -valid. -.PP -When using \f[C]--resync\f[R], a newer version of a file on the Path2 -filesystem will be overwritten by the Path1 filesystem version. -(Note that this is NOT entirely -symmetrical (https://github.com/rclone/rclone/issues/5681#issuecomment-938761815).) -Carefully evaluate deltas using ---dry-run (https://rclone.org/flags/#non-backend-flags). -.PP -For a resync run, one of the paths may be empty (no files in the path -tree). -The resync run should result in files on both paths, else a normal -non-resync run will fail. -.PP -For a non-resync run, either path being empty (no files in the tree) -fails with -\f[C]Empty current PathN listing. Cannot sync to an empty directory: X.pathN.lst\f[R] -This is a safety check that an unexpected empty path does not result in -deleting \f[B]everything\f[R] in the other path. -.SS --check-access -.PP -Access check files are an additional safety measure against data loss. -bisync will ensure it can find matching \f[C]RCLONE_TEST\f[R] files in -the same places in the Path1 and Path2 filesystems. -\f[C]RCLONE_TEST\f[R] files are not generated automatically. -For \f[C]--check-access\f[R] to succeed, you must first either: -\f[B]A)\f[R] Place one or more \f[C]RCLONE_TEST\f[R] files in both -systems, or \f[B]B)\f[R] Set \f[C]--check-filename\f[R] to a filename -already in use in various locations throughout your sync\[aq]d fileset. -Recommended methods for \f[B]A)\f[R] include: * -\f[C]rclone touch Path1/RCLONE_TEST\f[R] (create a new file) * -\f[C]rclone copyto Path1/RCLONE_TEST Path2/RCLONE_TEST\f[R] (copy an -existing file) * -\f[C]rclone copy Path1/RCLONE_TEST Path2/RCLONE_TEST --include \[dq]RCLONE_TEST\[dq]\f[R] -(copy multiple files at once, recursively) * create the files manually -(outside of rclone) * run \f[C]bisync\f[R] once \f[I]without\f[R] -\f[C]--check-access\f[R] to set matching files on both filesystems will -also work, but is not preferred, due to potential for user error (you -are temporarily disabling the safety feature). -.PP -Note that \f[C]--check-access\f[R] is still enforced on -\f[C]--resync\f[R], so \f[C]bisync --resync --check-access\f[R] will not -work as a method of initially setting the files (this is to ensure that -bisync can\[aq]t inadvertently circumvent its own safety -switch (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=3.%20%2D%2Dcheck%2Daccess%20doesn%27t%20always%20fail%20when%20it%20should).) -.PP -Time stamps and file contents for \f[C]RCLONE_TEST\f[R] files are not -important, just the names and locations. -If you have symbolic links in your sync tree it is recommended to place -\f[C]RCLONE_TEST\f[R] files in the linked-to directory tree to protect -against bisync assuming a bunch of deleted files if the linked-to tree -should not be accessible. -See also the --check-filename flag. -.SS --check-filename +response +.IP +.nf +\f[C] +{ + \[dq]password\[dq]: \[dq]xyz\[dq], + \[dq]username\[dq]: \[dq]xyz\[dq] +} +\f[R] +.fi .PP -Name of the file(s) used in access health validation. -The default \f[C]--check-filename\f[R] is \f[C]RCLONE_TEST\f[R]. -One or more files having this filename must exist, synchronized between -your source and destination filesets, in order for -\f[C]--check-access\f[R] to succeed. -See --check-access for additional details. -.SS --max-delete +This can be combined with URL parameters too if required. +The JSON blob takes precedence. +.IP +.nf +\f[C] +curl -H \[dq]Content-Type: application/json\[dq] -X POST -d \[aq]{\[dq]potato\[dq]:2,\[dq]sausage\[dq]:1}\[aq] \[aq]http://localhost:5572/rc/noop?rutabaga=3&potato=4\[aq] +\f[R] +.fi +.IP +.nf +\f[C] +{ + \[dq]potato\[dq]: 2, + \[dq]rutabaga\[dq]: \[dq]3\[dq], + \[dq]sausage\[dq]: 1 +} +\f[R] +.fi +.SS Debugging rclone with pprof .PP -As a safety check, if greater than the \f[C]--max-delete\f[R] percent of -files were deleted on either the Path1 or Path2 filesystem, then bisync -will abort with a warning message, without making any changes. -The default \f[C]--max-delete\f[R] is \f[C]50%\f[R]. -One way to trigger this limit is to rename a directory that contains -more than half of your files. -This will appear to bisync as a bunch of deleted files and a bunch of -new files. -This safety check is intended to block bisync from deleting all of the -files on both filesystems due to a temporary network access issue, or if -the user had inadvertently deleted the files on one side or the other. -To force the sync, either set a different delete percentage limit, e.g. -\f[C]--max-delete 75\f[R] (allows up to 75% deletion), or use -\f[C]--force\f[R] to bypass the check. +If you use the \f[C]--rc\f[R] flag this will also enable the use of the +go profiling tools on the same port. .PP -Also see the all files changed check. -.SS --filters-file +To use these, first install go (https://golang.org/doc/install). +.SS Debugging memory use .PP -By using rclone filter features you can exclude file types or directory -sub-trees from the sync. -See the bisync filters section and generic ---filter-from (https://rclone.org/filtering/#filter-from-read-filtering-patterns-from-a-file) -documentation. -An example filters file contains filters for non-allowed files for -synching with Dropbox. +To profile rclone\[aq]s memory use you can run: +.IP +.nf +\f[C] +go tool pprof -web http://localhost:5572/debug/pprof/heap +\f[R] +.fi .PP -If you make changes to your filters file then bisync requires a run with -\f[C]--resync\f[R]. -This is a safety feature, which prevents existing files on the Path1 -and/or Path2 side from seeming to disappear from view (since they are -excluded in the new listings), which would fool bisync into seeing them -as deleted (as compared to the prior run listings), and then bisync -would proceed to delete them for real. +This should open a page in your browser showing what is using what +memory. .PP -To block this from happening, bisync calculates an MD5 hash of the -filters file and stores the hash in a \f[C].md5\f[R] file in the same -place as your filters file. -On the next run with \f[C]--filters-file\f[R] set, bisync re-calculates -the MD5 hash of the current filters file and compares it to the hash -stored in the \f[C].md5\f[R] file. -If they don\[aq]t match, the run aborts with a critical error and thus -forces you to do a \f[C]--resync\f[R], likely avoiding a disaster. -.SS --check-sync +You can also use the \f[C]-text\f[R] flag to produce a textual summary +.IP +.nf +\f[C] +$ go tool pprof -text http://localhost:5572/debug/pprof/heap +Showing nodes accounting for 1537.03kB, 100% of 1537.03kB total + flat flat% sum% cum cum% + 1024.03kB 66.62% 66.62% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.addDecoderNode + 513kB 33.38% 100% 513kB 33.38% net/http.newBufioWriterSize + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/all.init + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/serve.init + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/cmd/serve/restic.init + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2.init + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.init + 0 0% 100% 1024.03kB 66.62% github.com/rclone/rclone/vendor/golang.org/x/net/http2/hpack.init.0 + 0 0% 100% 1024.03kB 66.62% main.init + 0 0% 100% 513kB 33.38% net/http.(*conn).readRequest + 0 0% 100% 513kB 33.38% net/http.(*conn).serve + 0 0% 100% 1024.03kB 66.62% runtime.main +\f[R] +.fi +.SS Debugging go routine leaks .PP -Enabled by default, the check-sync function checks that all of the same -files exist in both the Path1 and Path2 history listings. -This \f[I]check-sync\f[R] integrity check is performed at the end of the -sync run by default. -Any untrapped failing copy/deletes between the two paths might result in -differences between the two listings and in the untracked file content -differences between the two paths. -A resync run would correct the error. +Memory leaks are most often caused by go routine leaks keeping memory +alive which should have been garbage collected. .PP -Note that the default-enabled integrity check locally executes a load of -both the final Path1 and Path2 listings, and thus adds to the run time -of a sync. -Using \f[C]--check-sync=false\f[R] will disable it and may significantly -reduce the sync run times for very large numbers of files. +See all active go routines using +.IP +.nf +\f[C] +curl http://localhost:5572/debug/pprof/goroutine?debug=1 +\f[R] +.fi .PP -The check may be run manually with \f[C]--check-sync=only\f[R]. -It runs only the integrity check and terminates without actually -synching. +Or go to http://localhost:5572/debug/pprof/goroutine?debug=1 in your +browser. +.SS Other profiles to look at .PP -See also: Concurrent modifications -.SS --ignore-listing-checksum +You can see a summary of profiles available at +http://localhost:5572/debug/pprof/ .PP -By default, bisync will retrieve (or generate) checksums (for backends -that support them) when creating the listings for both paths, and store -the checksums in the listing files. -\f[C]--ignore-listing-checksum\f[R] will disable this behavior, which -may speed things up considerably, especially on backends (such as -local (https://rclone.org/local/)) where hashes must be computed on the -fly instead of retrieved. -Please note the following: -.IP \[bu] 2 -While checksums are (by default) generated and stored in the listing -files, they are NOT currently used for determining diffs (deltas). -It is anticipated that full checksum support will be added in a future -version. +Here is how to use some of them: .IP \[bu] 2 -\f[C]--ignore-listing-checksum\f[R] is NOT the same as -\f[C]--ignore-checksum\f[R] (https://rclone.org/docs/#ignore-checksum), -and you may wish to use one or the other, or both. -In a nutshell: \f[C]--ignore-listing-checksum\f[R] controls whether -checksums are considered when scanning for diffs, while -\f[C]--ignore-checksum\f[R] controls whether checksums are considered -during the copy/sync operations that follow, if there ARE diffs. +Memory: \f[C]go tool pprof http://localhost:5572/debug/pprof/heap\f[R] .IP \[bu] 2 -Unless \f[C]--ignore-listing-checksum\f[R] is passed, bisync currently -computes hashes for one path \f[I]even when there\[aq]s no common hash -with the other path\f[R] (for example, a -crypt (https://rclone.org/crypt/#modified-time-and-hashes) remote.) +Go routines: +\f[C]curl http://localhost:5572/debug/pprof/goroutine?debug=1\f[R] .IP \[bu] 2 -If both paths support checksums and have a common hash, AND -\f[C]--ignore-listing-checksum\f[R] was not specified when creating the -listings, \f[C]--check-sync=only\f[R] can be used to compare Path1 vs. -Path2 checksums (as of the time the previous listings were created.) -However, \f[C]--check-sync=only\f[R] will NOT include checksums if the -previous listings were generated on a run using -\f[C]--ignore-listing-checksum\f[R]. -For a more robust integrity check of the current state, consider using -\f[C]check\f[R] (or -\f[C]cryptcheck\f[R] (https://rclone.org/commands/rclone_cryptcheck/), -if at least one path is a \f[C]crypt\f[R] remote.) -.SS --resilient -.PP -\f[B]\f[BI]Caution: this is an experimental feature. Use at your own -risk!\f[B]\f[R] -.PP -By default, most errors or interruptions will cause bisync to abort and -require \f[C]--resync\f[R] to recover. -This is a safety feature, to prevent bisync from running again until a -user checks things out. -However, in some cases, bisync can go too far and enforce a lockout when -one isn\[aq]t actually necessary, like for certain less-serious errors -that might resolve themselves on the next run. -When \f[C]--resilient\f[R] is specified, bisync tries its best to -recover and self-correct, and only requires \f[C]--resync\f[R] as a last -resort when a human\[aq]s involvement is absolutely necessary. -The intended use case is for running bisync as a background process -(such as via scheduled cron). -.PP -When using \f[C]--resilient\f[R] mode, bisync will still report the -error and abort, however it will not lock out future runs -- allowing -the possibility of retrying at the next normally scheduled time, without -requiring a \f[C]--resync\f[R] first. -Examples of such retryable errors include access test failures, missing -listing files, and filter change detections. -These safety features will still prevent the \f[I]current\f[R] run from -proceeding -- the difference is that if conditions have improved by the -time of the \f[I]next\f[R] run, that next run will be allowed to -proceed. -Certain more serious errors will still enforce a \f[C]--resync\f[R] -lockout, even in \f[C]--resilient\f[R] mode, to prevent data loss. -.PP -Behavior of \f[C]--resilient\f[R] may change in a future version. -.SS Operation -.SS Runtime flow details -.PP -bisync retains the listings of the \f[C]Path1\f[R] and \f[C]Path2\f[R] -filesystems from the prior run. -On each successive run it will: +30-second CPU profile: +\f[C]go tool pprof http://localhost:5572/debug/pprof/profile\f[R] .IP \[bu] 2 -list files on \f[C]path1\f[R] and \f[C]path2\f[R], and check for changes -on each side. -Changes include \f[C]New\f[R], \f[C]Newer\f[R], \f[C]Older\f[R], and -\f[C]Deleted\f[R] files. +5-second execution trace: +\f[C]wget http://localhost:5572/debug/pprof/trace?seconds=5\f[R] .IP \[bu] 2 -Propagate changes on \f[C]path1\f[R] to \f[C]path2\f[R], and vice-versa. -.SS Safety measures +Goroutine blocking profile +.RS 2 .IP \[bu] 2 -Lock file prevents multiple simultaneous runs when taking a while. -This can be particularly useful if bisync is run by cron scheduler. +Enable first with: +\f[C]rclone rc debug/set-block-profile-rate rate=1\f[R] (docs) .IP \[bu] 2 -Handle change conflicts non-destructively by creating \f[C]..path1\f[R] -and \f[C]..path2\f[R] file versions. +\f[C]go tool pprof http://localhost:5572/debug/pprof/block\f[R] +.RE .IP \[bu] 2 -File system access health check using \f[C]RCLONE_TEST\f[R] files (see -the \f[C]--check-access\f[R] flag). +Contended mutexes: +.RS 2 .IP \[bu] 2 -Abort on excessive deletes - protects against a failed listing being -interpreted as all the files were deleted. -See the \f[C]--max-delete\f[R] and \f[C]--force\f[R] flags. +Enable first with: +\f[C]rclone rc debug/set-mutex-profile-fraction rate=1\f[R] (docs) .IP \[bu] 2 -If something evil happens, bisync goes into a safe state to block damage -by later runs. -(See Error Handling) -.SS Normal sync checks +\f[C]go tool pprof http://localhost:5572/debug/pprof/mutex\f[R] +.RE +.PP +See the net/http/pprof docs (https://golang.org/pkg/net/http/pprof/) for +more info on how to use the profiling and for a general overview see the +Go team\[aq]s blog post on profiling go +programs (https://blog.golang.org/profiling-go-programs). +.PP +The profiling hook is zero overhead unless it is +used (https://stackoverflow.com/q/26545159/164234). +.SH Overview of cloud storage systems +.PP +Each cloud storage system is slightly different. +Rclone attempts to provide a unified interface to them, but some +underlying differences show through. +.SS Features +.PP +Here is an overview of the major features of each cloud storage system. .PP .TS tab(@); -lw(8.4n) lw(28.4n) lw(15.7n) lw(17.5n). +l c c c c c c. +T{ +Name +T}@T{ +Hash +T}@T{ +ModTime +T}@T{ +Case Insensitive +T}@T{ +Duplicate Files +T}@T{ +MIME Type +T}@T{ +Metadata +T} +_ +T{ +1Fichier +T}@T{ +Whirlpool +T}@T{ +- +T}@T{ +No +T}@T{ +Yes +T}@T{ +R +T}@T{ +- +T} +T{ +Akamai Netstorage +T}@T{ +MD5, SHA256 +T}@T{ +R/W +T}@T{ +No +T}@T{ +No +T}@T{ +R +T}@T{ +- +T} +T{ +Amazon Drive +T}@T{ +MD5 +T}@T{ +- +T}@T{ +Yes +T}@T{ +No +T}@T{ +R +T}@T{ +- +T} +T{ +Amazon S3 (or S3 compatible) +T}@T{ +MD5 +T}@T{ +R/W +T}@T{ +No +T}@T{ +No +T}@T{ +R/W +T}@T{ +RWU +T} +T{ +Backblaze B2 +T}@T{ +SHA1 +T}@T{ +R/W +T}@T{ +No +T}@T{ +No +T}@T{ +R/W +T}@T{ +- +T} +T{ +Box +T}@T{ +SHA1 +T}@T{ +R/W +T}@T{ +Yes +T}@T{ +No +T}@T{ +- +T}@T{ +- +T} +T{ +Citrix ShareFile +T}@T{ +MD5 +T}@T{ +R/W +T}@T{ +Yes +T}@T{ +No +T}@T{ +- +T}@T{ +- +T} +T{ +Dropbox +T}@T{ +DBHASH \[S1] +T}@T{ +R +T}@T{ +Yes +T}@T{ +No +T}@T{ +- +T}@T{ +- +T} +T{ +Enterprise File Fabric +T}@T{ +- +T}@T{ +R/W +T}@T{ +Yes +T}@T{ +No +T}@T{ +R/W +T}@T{ +- +T} +T{ +FTP +T}@T{ +- +T}@T{ +R/W \[S1]\[u2070] +T}@T{ +No +T}@T{ +No +T}@T{ +- +T}@T{ +- +T} +T{ +Google Cloud Storage +T}@T{ +MD5 +T}@T{ +R/W +T}@T{ +No +T}@T{ +No +T}@T{ +R/W +T}@T{ +- +T} T{ -Type +Google Drive T}@T{ -Description +MD5, SHA1, SHA256 T}@T{ -Result +R/W T}@T{ -Implementation +No +T}@T{ +Yes +T}@T{ +R/W +T}@T{ +- T} -_ T{ -Path2 new +Google Photos T}@T{ -File is new on Path2, does not exist on Path1 +- T}@T{ -Path2 version survives +- T}@T{ -\f[C]rclone copy\f[R] Path2 to Path1 +No +T}@T{ +Yes +T}@T{ +R +T}@T{ +- T} T{ -Path2 newer +HDFS T}@T{ -File is newer on Path2, unchanged on Path1 +- T}@T{ -Path2 version survives +R/W T}@T{ -\f[C]rclone copy\f[R] Path2 to Path1 +No +T}@T{ +No +T}@T{ +- +T}@T{ +- T} T{ -Path2 deleted +HiDrive T}@T{ -File is deleted on Path2, unchanged on Path1 +HiDrive \[S1]\[S2] T}@T{ -File is deleted +R/W T}@T{ -\f[C]rclone delete\f[R] Path1 +No +T}@T{ +No +T}@T{ +- +T}@T{ +- T} T{ -Path1 new +HTTP T}@T{ -File is new on Path1, does not exist on Path2 +- T}@T{ -Path1 version survives +R T}@T{ -\f[C]rclone copy\f[R] Path1 to Path2 +No +T}@T{ +No +T}@T{ +R +T}@T{ +- T} T{ -Path1 newer +Internet Archive T}@T{ -File is newer on Path1, unchanged on Path2 +MD5, SHA1, CRC32 T}@T{ -Path1 version survives +R/W \[S1]\[S1] T}@T{ -\f[C]rclone copy\f[R] Path1 to Path2 +No +T}@T{ +No +T}@T{ +- +T}@T{ +RWU T} T{ -Path1 older +Jottacloud T}@T{ -File is older on Path1, unchanged on Path2 +MD5 T}@T{ -\f[I]Path1 version survives\f[R] +R/W T}@T{ -\f[C]rclone copy\f[R] Path1 to Path2 +Yes +T}@T{ +No +T}@T{ +R +T}@T{ +RW T} T{ -Path2 older +Koofr T}@T{ -File is older on Path2, unchanged on Path1 +MD5 T}@T{ -\f[I]Path2 version survives\f[R] +- T}@T{ -\f[C]rclone copy\f[R] Path2 to Path1 +Yes +T}@T{ +No +T}@T{ +- +T}@T{ +- T} T{ -Path1 deleted +Linkbox T}@T{ -File no longer exists on Path1 +- T}@T{ -File is deleted +R T}@T{ -\f[C]rclone delete\f[R] Path2 +No +T}@T{ +No +T}@T{ +- +T}@T{ +- T} -.TE -.SS Unusual sync checks -.PP -.TS -tab(@); -lw(17.2n) lw(21.0n) lw(19.4n) lw(12.4n). T{ -Type +Mail.ru Cloud T}@T{ -Description +Mailru \[u2076] T}@T{ -Result +R/W T}@T{ -Implementation +Yes +T}@T{ +No +T}@T{ +- +T}@T{ +- T} -_ T{ -Path1 new/changed AND Path2 new/changed AND Path1 == Path2 +Mega T}@T{ -File is new/changed on Path1 AND new/changed on Path2 AND Path1 version -is currently identical to Path2 +- T}@T{ -No change +- T}@T{ -None +No +T}@T{ +Yes +T}@T{ +- +T}@T{ +- T} T{ -Path1 new AND Path2 new +Memory T}@T{ -File is new on Path1 AND new on Path2 (and Path1 version is NOT -identical to Path2) +MD5 T}@T{ -Files renamed to _Path1 and _Path2 +R/W +T}@T{ +No +T}@T{ +No +T}@T{ +- +T}@T{ +- +T} +T{ +Microsoft Azure Blob Storage +T}@T{ +MD5 +T}@T{ +R/W +T}@T{ +No +T}@T{ +No +T}@T{ +R/W +T}@T{ +- +T} +T{ +Microsoft Azure Files Storage +T}@T{ +MD5 +T}@T{ +R/W +T}@T{ +Yes +T}@T{ +No +T}@T{ +R/W +T}@T{ +- +T} +T{ +Microsoft OneDrive +T}@T{ +QuickXorHash \[u2075] +T}@T{ +R/W +T}@T{ +Yes +T}@T{ +No +T}@T{ +R +T}@T{ +- +T} +T{ +OpenDrive +T}@T{ +MD5 +T}@T{ +R/W +T}@T{ +Yes +T}@T{ +Partial \[u2078] +T}@T{ +- +T}@T{ +- +T} +T{ +OpenStack Swift +T}@T{ +MD5 +T}@T{ +R/W +T}@T{ +No +T}@T{ +No +T}@T{ +R/W +T}@T{ +- +T} +T{ +Oracle Object Storage +T}@T{ +MD5 +T}@T{ +R/W +T}@T{ +No +T}@T{ +No +T}@T{ +R/W +T}@T{ +- +T} +T{ +pCloud +T}@T{ +MD5, SHA1 \[u2077] +T}@T{ +R +T}@T{ +No +T}@T{ +No +T}@T{ +W +T}@T{ +- +T} +T{ +PikPak +T}@T{ +MD5 +T}@T{ +R +T}@T{ +No +T}@T{ +No +T}@T{ +R +T}@T{ +- +T} +T{ +premiumize.me +T}@T{ +- +T}@T{ +- +T}@T{ +Yes +T}@T{ +No +T}@T{ +R +T}@T{ +- +T} +T{ +put.io +T}@T{ +CRC-32 +T}@T{ +R/W +T}@T{ +No +T}@T{ +Yes +T}@T{ +R +T}@T{ +- +T} +T{ +Proton Drive +T}@T{ +SHA1 +T}@T{ +R/W +T}@T{ +No +T}@T{ +No +T}@T{ +R +T}@T{ +- +T} +T{ +QingStor +T}@T{ +MD5 +T}@T{ +- \[u2079] +T}@T{ +No +T}@T{ +No +T}@T{ +R/W +T}@T{ +- +T} +T{ +Quatrix by Maytech +T}@T{ +- +T}@T{ +R/W +T}@T{ +No +T}@T{ +No +T}@T{ +- +T}@T{ +- +T} +T{ +Seafile +T}@T{ +- +T}@T{ +- +T}@T{ +No +T}@T{ +No +T}@T{ +- +T}@T{ +- +T} +T{ +SFTP +T}@T{ +MD5, SHA1 \[S2] +T}@T{ +R/W +T}@T{ +Depends +T}@T{ +No +T}@T{ +- +T}@T{ +- +T} +T{ +Sia +T}@T{ +- +T}@T{ +- +T}@T{ +No +T}@T{ +No +T}@T{ +- +T}@T{ +- +T} +T{ +SMB +T}@T{ +- +T}@T{ +R/W +T}@T{ +Yes +T}@T{ +No +T}@T{ +- +T}@T{ +- +T} +T{ +SugarSync +T}@T{ +- +T}@T{ +- +T}@T{ +No +T}@T{ +No +T}@T{ +- +T}@T{ +- +T} +T{ +Storj +T}@T{ +- +T}@T{ +R +T}@T{ +No +T}@T{ +No +T}@T{ +- +T}@T{ +- +T} +T{ +Uptobox +T}@T{ +- +T}@T{ +- +T}@T{ +No +T}@T{ +Yes +T}@T{ +- +T}@T{ +- +T} +T{ +WebDAV +T}@T{ +MD5, SHA1 \[S3] +T}@T{ +R \[u2074] +T}@T{ +Depends +T}@T{ +No +T}@T{ +- +T}@T{ +- +T} +T{ +Yandex Disk +T}@T{ +MD5 +T}@T{ +R/W +T}@T{ +No +T}@T{ +No +T}@T{ +R T}@T{ -\f[C]rclone copy\f[R] _Path2 file to Path1, \f[C]rclone copy\f[R] _Path1 -file to Path2 +- T} T{ -Path2 newer AND Path1 changed +Zoho WorkDrive T}@T{ -File is newer on Path2 AND also changed (newer/older/size) on Path1 (and -Path1 version is NOT identical to Path2) +- T}@T{ -Files renamed to _Path1 and _Path2 +- T}@T{ -\f[C]rclone copy\f[R] _Path2 file to Path1, \f[C]rclone copy\f[R] _Path1 -file to Path2 -T} -T{ -Path2 newer AND Path1 deleted +No T}@T{ -File is newer on Path2 AND also deleted on Path1 +No T}@T{ -Path2 version survives +- T}@T{ -\f[C]rclone copy\f[R] Path2 to Path1 +- T} T{ -Path2 deleted AND Path1 changed +The local filesystem T}@T{ -File is deleted on Path2 AND changed (newer/older/size) on Path1 +All T}@T{ -Path1 version survives +R/W T}@T{ -\f[C]rclone copy\f[R] Path1 to Path2 -T} -T{ -Path1 deleted AND Path2 changed +Depends T}@T{ -File is deleted on Path1 AND changed (newer/older/size) on Path2 +No T}@T{ -Path2 version survives +- T}@T{ -\f[C]rclone copy\f[R] Path2 to Path1 +RWU T} .TE .PP -As of \f[C]rclone v1.64\f[R], bisync is now better at detecting -\f[I]false positive\f[R] sync conflicts, which would previously have -resulted in unnecessary renames and duplicates. -Now, when bisync comes to a file that it wants to rename (because it is -new/changed on both sides), it first checks whether the Path1 and Path2 -versions are currently \f[I]identical\f[R] (using the same underlying -function as \f[C]check\f[R].) If bisync concludes that the files are -identical, it will skip them and move on. -Otherwise, it will create renamed \f[C]..Path1\f[R] and -\f[C]..Path2\f[R] duplicates, as before. -This behavior also improves the experience of renaming -directories (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=Renamed%20directories), -as a \f[C]--resync\f[R] is no longer required, so long as the same -change has been made on both sides. -.SS All files changed check -.PP -If \f[I]all\f[R] prior existing files on either of the filesystems have -changed (e.g. -timestamps have changed due to changing the system\[aq]s timezone) then -bisync will abort without making any changes. -Any new files are not considered for this check. -You could use \f[C]--force\f[R] to force the sync (whichever side has -the changed timestamp files wins). -Alternately, a \f[C]--resync\f[R] may be used (Path1 versions will be -pushed to Path2). -Consider the situation carefully and perhaps use \f[C]--dry-run\f[R] -before you commit to the changes. -.SS Modification time -.PP -Bisync relies on file timestamps to identify changed files and will -\f[I]refuse\f[R] to operate if backend lacks the modification time -support. -.PP -If you or your application should change the content of a file without -changing the modification time then bisync will \f[I]not\f[R] notice the -change, and thus will not copy it to the other side. -.PP -Note that on some cloud storage systems it is not possible to have file -timestamps that match \f[I]precisely\f[R] between the local and other -filesystems. -.PP -Bisync\[aq]s approach to this problem is by tracking the changes on each -side \f[I]separately\f[R] over time with a local database of files in -that side then applying the resulting changes on the other side. -.SS Error handling -.PP -Certain bisync critical errors, such as file copy/move failing, will -result in a bisync lockout of following runs. -The lockout is asserted because the sync status and history of the Path1 -and Path2 filesystems cannot be trusted, so it is safer to block any -further changes until someone checks things out. -The recovery is to do a \f[C]--resync\f[R] again. -.PP -It is recommended to use \f[C]--resync --dry-run --verbose\f[R] -initially and \f[I]carefully\f[R] review what changes will be made -before running the \f[C]--resync\f[R] without \f[C]--dry-run\f[R]. -.PP -Most of these events come up due to an error status from an internal -call. -On such a critical error the \f[C]{...}.path1.lst\f[R] and -\f[C]{...}.path2.lst\f[R] listing files are renamed to extension -\f[C].lst-err\f[R], which blocks any future bisync runs (since the -normal \f[C].lst\f[R] files are not found). -Bisync keeps them under \f[C]bisync\f[R] subdirectory of the rclone -cache directory, typically at \f[C]${HOME}/.cache/rclone/bisync/\f[R] on -Linux. -.PP -Some errors are considered temporary and re-running the bisync is not -blocked. -The \f[I]critical return\f[R] blocks further bisync runs. -.PP -See also: \f[C]--resilient\f[R] -.SS Lock file -.PP -When bisync is running, a lock file is created in the bisync working -directory, typically at -\f[C]\[ti]/.cache/rclone/bisync/PATH1..PATH2.lck\f[R] on Linux. -If bisync should crash or hang, the lock file will remain in place and -block any further runs of bisync \f[I]for the same paths\f[R]. -Delete the lock file as part of debugging the situation. -The lock file effectively blocks follow-on (e.g., scheduled by -\f[I]cron\f[R]) runs when the prior invocation is taking a long time. -The lock file contains \f[I]PID\f[R] of the blocking process, which may -help in debug. -.PP -\f[B]Note\f[R] that while concurrent bisync runs are allowed, \f[I]be -very cautious\f[R] that there is no overlap in the trees being synched -between concurrent runs, lest there be replicated files, deleted files -and general mayhem. -.SS Return codes -.PP -\f[C]rclone bisync\f[R] returns the following codes to calling program: -- \f[C]0\f[R] on a successful run, - \f[C]1\f[R] for a non-critical -failing run (a rerun may be successful), - \f[C]2\f[R] for a critically -aborted run (requires a \f[C]--resync\f[R] to recover). -.SS Limitations -.SS Supported backends -.PP -Bisync is considered \f[I]BETA\f[R] and has been tested with the -following backends: - Local filesystem - Google Drive - Dropbox - -OneDrive - S3 - SFTP - Yandex Disk -.PP -It has not been fully tested with other services yet. -If it works, or sorta works, please let us know and we\[aq]ll update the -list. -Run the test suite to check for proper operation as described below. -.PP -First release of \f[C]rclone bisync\f[R] requires that underlying -backend supports the modification time feature and will refuse to run -otherwise. -This limitation will be lifted in a future \f[C]rclone bisync\f[R] -release. -.SS Concurrent modifications -.PP -When using \f[B]Local, FTP or SFTP\f[R] remotes rclone does not create -\f[I]temporary\f[R] files at the destination when copying, and thus if -the connection is lost the created file may be corrupt, which will -likely propagate back to the original path on the next sync, resulting -in data loss. -This will be solved in a future release, there is no workaround at the -moment. -.PP -Files that \f[B]change during\f[R] a bisync run may result in data loss. -This has been seen in a highly dynamic environment, where the filesystem -is getting hammered by running processes during the sync. -The currently recommended solution is to sync at quiet times or filter -out unnecessary directories and files. -.PP -As an alternative -approach (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=scans%2C%20to%20avoid-,errors%20if%20files%20changed%20during%20sync,-Given%20the%20number), -consider using \f[C]--check-sync=false\f[R] (and possibly -\f[C]--resilient\f[R]) to make bisync more forgiving of filesystems that -change during the sync. -Be advised that this may cause bisync to miss events that occur during a -bisync run, so it is a good idea to supplement this with a periodic -independent integrity check, and corrective sync if diffs are found. -For example, a possible sequence could look like this: -.IP "1." 3 -Normally scheduled bisync run: -.IP -.nf -\f[C] -rclone bisync Path1 Path2 -MPc --check-access --max-delete 10 --filters-file /path/to/filters.txt -v --check-sync=false --no-cleanup --ignore-listing-checksum --disable ListR --checkers=16 --drive-pacer-min-sleep=10ms --create-empty-src-dirs --resilient -\f[R] -.fi -.IP "2." 3 -Periodic independent integrity check (perhaps scheduled nightly or -weekly): -.IP -.nf -\f[C] -rclone check -MvPc Path1 Path2 --filter-from /path/to/filters.txt -\f[R] -.fi -.IP "3." 3 -If diffs are found, you have some choices to correct them. -If one side is more up-to-date and you want to make the other side match -it, you could run: -.IP -.nf -\f[C] -rclone sync Path1 Path2 --filter-from /path/to/filters.txt --create-empty-src-dirs -MPc -v -\f[R] -.fi -.PP -(or switch Path1 and Path2 to make Path2 the source-of-truth) -.PP -Or, if neither side is totally up-to-date, you could run a -\f[C]--resync\f[R] to bring them back into agreement (but remember that -this could cause deleted files to re-appear.) -.PP -*Note also that \f[C]rclone check\f[R] does not currently include empty -directories, so if you want to know if any empty directories are out of -sync, consider alternatively running the above \f[C]rclone sync\f[R] -command with \f[C]--dry-run\f[R] added. -.SS Empty directories -.PP -By default, new/deleted empty directories on one path are \f[I]not\f[R] -propagated to the other side. -This is because bisync (and rclone) natively works on files, not -directories. -However, this can be changed with the \f[C]--create-empty-src-dirs\f[R] -flag, which works in much the same way as in -\f[C]sync\f[R] (https://rclone.org/commands/rclone_sync/) and -\f[C]copy\f[R] (https://rclone.org/commands/rclone_copy/). -When used, empty directories created or deleted on one side will also be -created or deleted on the other side. -The following should be noted: * \f[C]--create-empty-src-dirs\f[R] is -not compatible with \f[C]--remove-empty-dirs\f[R]. -Use only one or the other (or neither). -* It is not recommended to switch back and forth between -\f[C]--create-empty-src-dirs\f[R] and the default (no -\f[C]--create-empty-src-dirs\f[R]) without running \f[C]--resync\f[R]. -This is because it may appear as though all directories (not just the -empty ones) were created/deleted, when actually you\[aq]ve just toggled -between making them visible/invisible to bisync. -It looks scarier than it is, but it\[aq]s still probably best to stick -to one or the other, and use \f[C]--resync\f[R] when you need to switch. -.SS Renamed directories -.PP -Renaming a folder on the Path1 side results in deleting all files on the -Path2 side and then copying all files again from Path1 to Path2. -Bisync sees this as all files in the old directory name as deleted and -all files in the new directory name as new. -Currently, the most effective and efficient method of renaming a -directory is to rename it to the same name on both sides. -(As of \f[C]rclone v1.64\f[R], a \f[C]--resync\f[R] is no longer -required after doing so, as bisync will automatically detect that Path1 -and Path2 are in agreement.) -.SS \f[C]--fast-list\f[R] used by default +\[S1] Dropbox supports its own custom +hash (https://www.dropbox.com/developers/reference/content-hash). +This is an SHA256 sum of all the 4 MiB block SHA256s. .PP -Unlike most other rclone commands, bisync uses -\f[C]--fast-list\f[R] (https://rclone.org/docs/#fast-list) by default, -for backends that support it. -In many cases this is desirable, however, there are some scenarios in -which bisync could be faster \f[I]without\f[R] \f[C]--fast-list\f[R], -and there is also a known issue concerning Google Drive users with many -empty -directories (https://github.com/rclone/rclone/commit/cbf3d4356135814921382dd3285d859d15d0aa77). -For now, the recommended way to avoid using \f[C]--fast-list\f[R] is to -add \f[C]--disable ListR\f[R] to all bisync commands. -The default behavior may change in a future version. -.SS Overridden Configs +\[S2] SFTP supports checksums if the same login has shell access and +\f[C]md5sum\f[R] or \f[C]sha1sum\f[R] as well as \f[C]echo\f[R] are in +the remote\[aq]s PATH. .PP -When rclone detects an overridden config, it adds a suffix like -\f[C]{ABCDE}\f[R] on the fly to the internal name of the remote. -Bisync follows suit by including this suffix in its listing filenames. -However, this suffix does not necessarily persist from run to run, -especially if different flags are provided. -So if next time the suffix assigned is \f[C]{FGHIJ}\f[R], bisync will -get confused, because it\[aq]s looking for a listing file with -\f[C]{FGHIJ}\f[R], when the file it wants has \f[C]{ABCDE}\f[R]. -As a result, it throws -\f[C]Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run\f[R] -and refuses to run again until the user runs a \f[C]--resync\f[R] -(unless using \f[C]--resilient\f[R]). -The best workaround at the moment is to set any backend-specific flags -in the config file (https://rclone.org/commands/rclone_config/) instead -of specifying them with command flags. -(You can still override them as needed for other rclone commands.) -.SS Case sensitivity +\[S3] WebDAV supports hashes when used with Fastmail Files, Owncloud and +Nextcloud only. .PP -Synching with \f[B]case-insensitive\f[R] filesystems, such as Windows or -\f[C]Box\f[R], can result in file name conflicts. -This will be fixed in a future release. -The near-term workaround is to make sure that files on both sides -don\[aq]t have spelling case differences (\f[C]Smile.jpg\f[R] vs. -\f[C]smile.jpg\f[R]). -.SS Windows support +\[u2074] WebDAV supports modtimes when used with Fastmail Files, +Owncloud and Nextcloud only. .PP -Bisync has been tested on Windows 8.1, Windows 10 Pro 64-bit and on -Windows GitHub runners. +\[u2075] +QuickXorHash (https://docs.microsoft.com/en-us/onedrive/developer/code-snippets/quickxorhash) +is Microsoft\[aq]s own hash. .PP -Drive letters are allowed, including drive letters mapped to network -drives (\f[C]rclone bisync J:\[rs]localsync GDrive:\f[R]). -If a drive letter is omitted, the shell current drive is the default. -Drive letters are a single character follows by \f[C]:\f[R], so cloud -names must be more than one character long. +\[u2076] Mail.ru uses its own modified SHA1 hash .PP -Absolute paths (with or without a drive letter), and relative paths -(with or without a drive letter) are supported. +\[u2077] pCloud only supports SHA1 (not MD5) in its EU region .PP -Working directory is created at -\f[C]C:\[rs]Users\[rs]MyLogin\[rs]AppData\[rs]Local\[rs]rclone\[rs]bisync\f[R]. +\[u2078] Opendrive does not support creation of duplicate files using +their web client interface or other stock clients, but the underlying +storage platform has been determined to allow duplicate files, and it is +possible to create them with \f[C]rclone\f[R]. +It may be that this is a mistake or an unsupported feature. .PP -Note that bisync output may show a mix of forward \f[C]/\f[R] and back -\f[C]\[rs]\f[R] slashes. +\[u2079] QingStor does not support SetModTime for objects bigger than 5 +GiB. .PP -Be careful of case independent directory and file naming on Windows vs. -case dependent Linux -.SS Filtering +\[S1]\[u2070] FTP supports modtimes for the major FTP servers, and also +others if they advertised required protocol extensions. +See this (https://rclone.org/ftp/#modification-times) for more details. .PP -See filtering documentation (https://rclone.org/filtering/) for how -filter rules are written and interpreted. +\[S1]\[S1] Internet Archive requires option \f[C]wait_archive\f[R] to be +set to a non-zero value for full modtime support. .PP -Bisync\[aq]s \f[C]--filters-file\f[R] flag slightly extends the -rclone\[aq]s ---filter-from (https://rclone.org/filtering/#filter-from-read-filtering-patterns-from-a-file) -filtering mechanism. -For a given bisync run you may provide \f[I]only one\f[R] -\f[C]--filters-file\f[R]. -The \f[C]--include*\f[R], \f[C]--exclude*\f[R], and \f[C]--filter\f[R] -flags are also supported. -.SS How to filter directories +\[S1]\[S2] HiDrive supports its own custom +hash (https://static.hidrive.com/dev/0001). +It combines SHA1 sums for each 4 KiB block hierarchically to a single +top-level sum. +.SS Hash .PP -Filtering portions of the directory tree is a critical feature for -synching. +The cloud storage system supports various hash types of the objects. +The hashes are used when transferring data as an integrity check and can +be specifically used with the \f[C]--checksum\f[R] flag in syncs and in +the \f[C]check\f[R] command. .PP -Examples of directory trees (always beneath the Path1/Path2 root level) -you may want to exclude from your sync: - Directory trees containing -only software build intermediate files. -- Directory trees containing application temporary files and data such -as the Windows \f[C]C:\[rs]Users\[rs]MyLogin\[rs]AppData\[rs]\f[R] tree. -- Directory trees containing files that are large, less important, or -are getting thrashed continuously by ongoing processes. +To use the verify checksums when transferring between cloud storage +systems they must support a common hash type. +.SS ModTime .PP -On the other hand, there may be only select directories that you -actually want to sync, and exclude all others. -See the Example include-style filters for Windows user directories -below. -.SS Filters file writing guidelines -.IP "1." 3 -Begin with excluding directory trees: -.RS 4 -.IP \[bu] 2 -e.g. -\[ga]- /AppData/\[ga] -.IP \[bu] 2 -\f[C]**\f[R] on the end is not necessary. -Once a given directory level is excluded then everything beneath it -won\[aq]t be looked at by rclone. -.IP \[bu] 2 -Exclude such directories that are unneeded, are big, dynamically -thrashed, or where there may be access permission issues. -.IP \[bu] 2 -Excluding such dirs first will make rclone operations (much) faster. -.IP \[bu] 2 -Specific files may also be excluded, as with the Dropbox exclusions -example below. -.RE -.IP "2." 3 -Decide if it\[aq]s easier (or cleaner) to: -.RS 4 -.IP \[bu] 2 -Include select directories and therefore \f[I]exclude everything -else\f[R] -- or -- -.IP \[bu] 2 -Exclude select directories and therefore \f[I]include everything -else\f[R] -.RE -.IP "3." 3 -Include select directories: -.RS 4 -.IP \[bu] 2 -Add lines like: \[ga]+ /Documents/PersonalFiles/**\[ga] to select which -directories to include in the sync. -.IP \[bu] 2 -\f[C]**\f[R] on the end specifies to include the full depth of the -specified tree. -.IP \[bu] 2 -With Include-style filters, files at the Path1/Path2 root are not -included. -They may be included with \[ga]+ /*\[ga]. -.IP \[bu] 2 -Place RCLONE_TEST files within these included directory trees. -They will only be looked for in these directory trees. -.IP \[bu] 2 -Finish by excluding everything else by adding \[ga]- **\[ga] at the end -of the filters file. -.IP \[bu] 2 -Disregard step 4. -.RE -.IP "4." 3 -Exclude select directories: -.RS 4 -.IP \[bu] 2 -Add more lines like in step 1. -For example: \f[C]-/Desktop/tempfiles/\f[R], or \[ga]- -/testdir/\f[C]. Again, a\f[R]**\[ga] on the end is not necessary. -.IP \[bu] 2 -Do \f[I]not\f[R] add a \[ga]- **\[ga] in the file. -Without this line, everything will be included that has not been -explicitly excluded. -.IP \[bu] 2 -Disregard step 3. -.RE +Almost all cloud storage systems store some sort of timestamp on +objects, but several of them not something that is appropriate to use +for syncing. +E.g. +some backends will only write a timestamp that represent the time of the +upload. +To be relevant for syncing it should be able to store the modification +time of the source object. +If this is not the case, rclone will only check the file size by +default, though can be configured to check the file hash (with the +\f[C]--checksum\f[R] flag). +Ideally it should also be possible to change the timestamp of an +existing file without having to re-upload it. .PP -A few rules for the syntax of a filter file expanding on filtering -documentation (https://rclone.org/filtering/): -.IP \[bu] 2 -Lines may start with spaces and tabs - rclone strips leading whitespace. -.IP \[bu] 2 -If the first non-whitespace character is a \f[C]#\f[R] then the line is -a comment and will be ignored. -.IP \[bu] 2 -Blank lines are ignored. -.IP \[bu] 2 -The first non-whitespace character on a filter line must be a -\f[C]+\f[R] or \f[C]-\f[R]. -.IP \[bu] 2 -Exactly 1 space is allowed between the \f[C]+/-\f[R] and the path term. -.IP \[bu] 2 -Only forward slashes (\f[C]/\f[R]) are used in path terms, even on -Windows. -.IP \[bu] 2 -The rest of the line is taken as the path term. -Trailing whitespace is taken literally, and probably is an error. -.SS Example include-style filters for Windows user directories +Storage systems with a \f[C]-\f[R] in the ModTime column, means the +modification read on objects is not the modification time of the file +when uploaded. +It is most likely the time the file was uploaded, or possibly something +else (like the time the picture was taken in Google Photos). .PP -This Windows \f[I]include-style\f[R] example is based on the sync root -(Path1) set to \f[C]C:\[rs]Users\[rs]MyLogin\f[R]. -The strategy is to select specific directories to be synched with a -network drive (Path2). -.IP \[bu] 2 -\[ga]- /AppData/\[ga] excludes an entire tree of Windows stored stuff -that need not be synched. -In my case, AppData has >11 GB of stuff I don\[aq]t care about, and -there are some subdirectories beneath AppData that are not accessible to -my user login, resulting in bisync critical aborts. -.IP \[bu] 2 -Windows creates cache files starting with both upper and lowercase -\f[C]NTUSER\f[R] at \f[C]C:\[rs]Users\[rs]MyLogin\f[R]. -These files may be dynamic, locked, and are generally \f[I]don\[aq]t -care\f[R]. -.IP \[bu] 2 -There are just a few directories with \f[I]my\f[R] data that I do want -synched, in the form of \[ga]+ -/\f[C]. By selecting only the directory trees I want to avoid the dozen plus directories that various apps make at\f[R]C:\[ga]. -.IP \[bu] 2 -Include files in the root of the sync point, -\f[C]C:\[rs]Users\[rs]MyLogin\f[R], by adding the \[ga]+ /*\[ga] line. -.IP \[bu] 2 -This is an Include-style filters file, therefore it ends with \[ga]- -**\[ga] which excludes everything not explicitly included. -.IP -.nf -\f[C] -- /AppData/ -- NTUSER* -- ntuser* -+ /Documents/Family/** -+ /Documents/Sketchup/** -+ /Documents/Microcapture_Photo/** -+ /Documents/Microcapture_Video/** -+ /Desktop/** -+ /Pictures/** -+ /* -- ** -\f[R] -.fi +Storage systems with a \f[C]R\f[R] (for read-only) in the ModTime +column, means the it keeps modification times on objects, and updates +them when uploading objects, but it does not support changing only the +modification time (\f[C]SetModTime\f[R] operation) without re-uploading, +possibly not even without deleting existing first. +Some operations in rclone, such as \f[C]copy\f[R] and \f[C]sync\f[R] +commands, will automatically check for \f[C]SetModTime\f[R] support and +re-upload if necessary to keep the modification times in sync. +Other commands will not work without \f[C]SetModTime\f[R] support, e.g. +\f[C]touch\f[R] command on an existing file will fail, and changes to +modification time only on a files in a \f[C]mount\f[R] will be silently +ignored. .PP -Note also that Windows implements several \[dq]library\[dq] links such -as \f[C]C:\[rs]Users\[rs]MyLogin\[rs]My Documents\[rs]My Music\f[R] -pointing to \f[C]C:\[rs]Users\[rs]MyLogin\[rs]Music\f[R]. -rclone sees these as links, so you must add \f[C]--links\f[R] to the -bisync command line if you which to follow these links. -I find that I get permission errors in trying to follow the links, so I -don\[aq]t include the rclone \f[C]--links\f[R] flag, but then you get -lots of \f[C]Can\[aq]t follow symlink\&...\f[R] noise from rclone about -not following the links. -This noise can be quashed by adding \f[C]--quiet\f[R] to the bisync -command line. -.SS Example exclude-style filters files for use with Dropbox -.IP \[bu] 2 -Dropbox disallows synching the listed temporary and configuration/data -files. -The \[ga]- \[ga] filters exclude these files where ever they may occur -in the sync tree. -Consider adding similar exclusions for file types you don\[aq]t need to -sync, such as core dump and software build files. +Storage systems with \f[C]R/W\f[R] (for read/write) in the ModTime +column, means they do also support modtime-only operations. +.SS Case Insensitive +.PP +If a cloud storage systems is case sensitive then it is possible to have +two files which differ only in case, e.g. +\f[C]file.txt\f[R] and \f[C]FILE.txt\f[R]. +If a cloud storage system is case insensitive then that isn\[aq]t +possible. +.PP +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. +.PP +The local filesystem and SFTP may or may not be case sensitive depending +on OS. .IP \[bu] 2 -bisync testing creates \f[C]/testdir/\f[R] at the top level of the sync -tree, and usually deletes the tree after the test. -If a normal sync should run while the \f[C]/testdir/\f[R] tree exists -the \f[C]--check-access\f[R] phase may fail due to unbalanced -RCLONE_TEST files. -The \[ga]- /testdir/\[ga] filter blocks this tree from being synched. -You don\[aq]t need this exclusion if you are not doing bisync -development testing. +Windows - usually case insensitive, though case is preserved .IP \[bu] 2 -Everything else beneath the Path1/Path2 root will be synched. +OSX - usually case insensitive, though it is possible to format case +sensitive .IP \[bu] 2 -RCLONE_TEST files may be placed anywhere within the tree, including the -root. -.SS Example filters file for Dropbox -.IP -.nf -\f[C] -# Filter file for use with bisync -# See https://rclone.org/filtering/ for filtering rules -# NOTICE: If you make changes to this file you MUST do a --resync run. -# Run with --dry-run to see what changes will be made. - -# Dropbox won\[aq]t sync some files so filter them away here. -# See https://help.dropbox.com/installs-integrations/sync-uploads/files-not-syncing -- .dropbox.attr -- \[ti]*.tmp -- \[ti]$* -- .\[ti]* -- desktop.ini -- .dropbox - -# Used for bisync testing, so excluded from normal runs -- /testdir/ - -# Other example filters -#- /TiBU/ -#- /Photos/ -\f[R] -.fi -.SS How --check-access handles filters +Linux - usually case sensitive, but there are case insensitive file +systems (e.g. +FAT formatted USB keys) .PP -At the start of a bisync run, listings are gathered for Path1 and Path2 -while using the user\[aq]s \f[C]--filters-file\f[R]. -During the check access phase, bisync scans these listings for -\f[C]RCLONE_TEST\f[R] files. -Any \f[C]RCLONE_TEST\f[R] files hidden by the \f[C]--filters-file\f[R] -are \f[I]not\f[R] in the listings and thus not checked during the check -access phase. -.SS Troubleshooting -.SS Reading bisync logs +Most of the time this doesn\[aq]t cause any problems as people tend to +avoid files whose name differs only by case even on case sensitive +systems. +.SS Duplicate files .PP -Here are two normal runs. -The first one has a newer file on the remote. -The second has no deltas between local and remote. -.IP -.nf -\f[C] -2021/05/16 00:24:38 INFO : Synching Path1 \[dq]/path/to/local/tree/\[dq] with Path2 \[dq]dropbox:/\[dq] -2021/05/16 00:24:38 INFO : Path1 checking for diffs -2021/05/16 00:24:38 INFO : - Path1 File is new - file.txt -2021/05/16 00:24:38 INFO : Path1: 1 changes: 1 new, 0 newer, 0 older, 0 deleted -2021/05/16 00:24:38 INFO : Path2 checking for diffs -2021/05/16 00:24:38 INFO : Applying changes -2021/05/16 00:24:38 INFO : - Path1 Queue copy to Path2 - dropbox:/file.txt -2021/05/16 00:24:38 INFO : - Path1 Do queued copies to - Path2 -2021/05/16 00:24:38 INFO : Updating listings -2021/05/16 00:24:38 INFO : Validating listings for Path1 \[dq]/path/to/local/tree/\[dq] vs Path2 \[dq]dropbox:/\[dq] -2021/05/16 00:24:38 INFO : Bisync successful - -2021/05/16 00:36:52 INFO : Synching Path1 \[dq]/path/to/local/tree/\[dq] with Path2 \[dq]dropbox:/\[dq] -2021/05/16 00:36:52 INFO : Path1 checking for diffs -2021/05/16 00:36:52 INFO : Path2 checking for diffs -2021/05/16 00:36:52 INFO : No changes found -2021/05/16 00:36:52 INFO : Updating listings -2021/05/16 00:36:52 INFO : Validating listings for Path1 \[dq]/path/to/local/tree/\[dq] vs Path2 \[dq]dropbox:/\[dq] -2021/05/16 00:36:52 INFO : Bisync successful -\f[R] -.fi -.SS Dry run oddity +If a cloud storage system allows duplicate files then it can have two +objects with the same name. +.PP +This confuses rclone greatly when syncing - use the +\f[C]rclone dedupe\f[R] command to rename or remove duplicates. +.SS Restricted filenames +.PP +Some cloud storage systems might have restrictions on the characters +that are usable in file or directory names. +When \f[C]rclone\f[R] detects such a name during a file upload, it will +transparently replace the restricted characters with similar looking +Unicode characters. +To handle the different sets of restricted characters for different +backends, rclone uses something it calls encoding. +.PP +This process is designed to avoid ambiguous file names as much as +possible and allow to move files between many cloud storage systems +transparently. +.PP +The name shown by \f[C]rclone\f[R] to the user or during log output will +only contain a minimal set of replaced characters to ensure correct +formatting and not necessarily the actual name used on the cloud +storage. +.PP +This transformation is reversed when downloading a file or parsing +\f[C]rclone\f[R] arguments. +For example, when uploading a file named \f[C]my file?.txt\f[R] to +Onedrive, it will be displayed as \f[C]my file?.txt\f[R] on the console, +but stored as \f[C]my file\[uFF1F].txt\f[R] to Onedrive (the \f[C]?\f[R] +gets replaced by the similar looking \f[C]\[uFF1F]\f[R] character, the +so-called \[dq]fullwidth question mark\[dq]). +The reverse transformation allows to read a file +\f[C]unusual/name.txt\f[R] from Google Drive, by passing the name +\f[C]unusual\[uFF0F]name.txt\f[R] on the command line (the \f[C]/\f[R] +needs to be replaced by the similar looking \f[C]\[uFF0F]\f[R] +character). +.SS Caveats +.PP +The filename encoding system works well in most cases, at least where +file names are written in English or similar languages. +You might not even notice it: It just works. +In some cases it may lead to issues, though. +E.g. +when file names are written in Chinese, or Japanese, where it is always +the Unicode fullwidth variants of the punctuation marks that are used. +.PP +On Windows, the characters \f[C]:\f[R], \f[C]*\f[R] and \f[C]?\f[R] are +examples of restricted characters. +If these are used in filenames on a remote that supports it, Rclone will +transparently convert them to their fullwidth Unicode variants +\f[C]\[uFF0A]\f[R], \f[C]\[uFF1F]\f[R] and \f[C]\[uFF1A]\f[R] when +downloading to Windows, and back again when uploading. +This way files with names that are not allowed on Windows can still be +stored. +.PP +However, if you have files on your Windows system originally with these +same Unicode characters in their names, they will be included in the +same conversion process. +E.g. +if you create a file in your Windows filesystem with name +\f[C]Test\[uFF1A]1.jpg\f[R], where \f[C]\[uFF1A]\f[R] is the Unicode +fullwidth colon symbol, and use rclone to upload it to Google Drive, +which supports regular \f[C]:\f[R] (halfwidth question mark), rclone +will replace the fullwidth \f[C]:\f[R] with the halfwidth \f[C]:\f[R] +and store the file as \f[C]Test:1.jpg\f[R] in Google Drive. +Since both Windows and Google Drive allows the name +\f[C]Test\[uFF1A]1.jpg\f[R], it would probably be better if rclone just +kept the name as is in this case. +.PP +With the opposite situation; if you have a file named +\f[C]Test:1.jpg\f[R], in your Google Drive, e.g. +uploaded from a Linux system where \f[C]:\f[R] is valid in file names. +Then later use rclone to copy this file to your Windows computer you +will notice that on your local disk it gets renamed to +\f[C]Test\[uFF1A]1.jpg\f[R]. +The original filename is not legal on Windows, due to the \f[C]:\f[R], +and rclone therefore renames it to make the copy possible. +That is all good. +However, this can also lead to an issue: If you already had a +\f[I]different\f[R] file named \f[C]Test\[uFF1A]1.jpg\f[R] on Windows, +and then use rclone to copy either way. +Rclone will then treat the file originally named \f[C]Test:1.jpg\f[R] on +Google Drive and the file originally named \f[C]Test\[uFF1A]1.jpg\f[R] +on Windows as the same file, and replace the contents from one with the +other. +.PP +Its virtually impossible to handle all cases like these correctly in all +situations, but by customizing the encoding option, changing the set of +characters that rclone should convert, you should be able to create a +configuration that works well for your specific situation. +See also the +example (https://rclone.org/overview/#encoding-example-windows) below. +.PP +(Windows was used as an example of a file system with many restricted +characters, and Google drive a storage system with few.) +.SS Default restricted characters +.PP +The table below shows the characters that are replaced by default. +.PP +When a replacement character is found in a filename, this character will +be escaped with the \f[C]\[u201B]\f[R] character to avoid ambiguous file +names. +(e.g. +a file named \f[C]\[u2400].txt\f[R] would shown as +\f[C]\[u201B]\[u2400].txt\f[R]) +.PP +Each cloud storage backend can use a different set of characters, which +will be specified in the documentation for each backend. +.PP +.TS +tab(@); +l c c. +T{ +Character +T}@T{ +Value +T}@T{ +Replacement +T} +_ +T{ +NUL +T}@T{ +0x00 +T}@T{ +\[u2400] +T} +T{ +SOH +T}@T{ +0x01 +T}@T{ +\[u2401] +T} +T{ +STX +T}@T{ +0x02 +T}@T{ +\[u2402] +T} +T{ +ETX +T}@T{ +0x03 +T}@T{ +\[u2403] +T} +T{ +EOT +T}@T{ +0x04 +T}@T{ +\[u2404] +T} +T{ +ENQ +T}@T{ +0x05 +T}@T{ +\[u2405] +T} +T{ +ACK +T}@T{ +0x06 +T}@T{ +\[u2406] +T} +T{ +BEL +T}@T{ +0x07 +T}@T{ +\[u2407] +T} +T{ +BS +T}@T{ +0x08 +T}@T{ +\[u2408] +T} +T{ +HT +T}@T{ +0x09 +T}@T{ +\[u2409] +T} +T{ +LF +T}@T{ +0x0A +T}@T{ +\[u240A] +T} +T{ +VT +T}@T{ +0x0B +T}@T{ +\[u240B] +T} +T{ +FF +T}@T{ +0x0C +T}@T{ +\[u240C] +T} +T{ +CR +T}@T{ +0x0D +T}@T{ +\[u240D] +T} +T{ +SO +T}@T{ +0x0E +T}@T{ +\[u240E] +T} +T{ +SI +T}@T{ +0x0F +T}@T{ +\[u240F] +T} +T{ +DLE +T}@T{ +0x10 +T}@T{ +\[u2410] +T} +T{ +DC1 +T}@T{ +0x11 +T}@T{ +\[u2411] +T} +T{ +DC2 +T}@T{ +0x12 +T}@T{ +\[u2412] +T} +T{ +DC3 +T}@T{ +0x13 +T}@T{ +\[u2413] +T} +T{ +DC4 +T}@T{ +0x14 +T}@T{ +\[u2414] +T} +T{ +NAK +T}@T{ +0x15 +T}@T{ +\[u2415] +T} +T{ +SYN +T}@T{ +0x16 +T}@T{ +\[u2416] +T} +T{ +ETB +T}@T{ +0x17 +T}@T{ +\[u2417] +T} +T{ +CAN +T}@T{ +0x18 +T}@T{ +\[u2418] +T} +T{ +EM +T}@T{ +0x19 +T}@T{ +\[u2419] +T} +T{ +SUB +T}@T{ +0x1A +T}@T{ +\[u241A] +T} +T{ +ESC +T}@T{ +0x1B +T}@T{ +\[u241B] +T} +T{ +FS +T}@T{ +0x1C +T}@T{ +\[u241C] +T} +T{ +GS +T}@T{ +0x1D +T}@T{ +\[u241D] +T} +T{ +RS +T}@T{ +0x1E +T}@T{ +\[u241E] +T} +T{ +US +T}@T{ +0x1F +T}@T{ +\[u241F] +T} +T{ +/ +T}@T{ +0x2F +T}@T{ +\[uFF0F] +T} +T{ +DEL +T}@T{ +0x7F +T}@T{ +\[u2421] +T} +.TE +.PP +The default encoding will also encode these file names as they are +problematic with many cloud storage systems. +.PP +.TS +tab(@); +l c. +T{ +File name +T}@T{ +Replacement +T} +_ +T{ +\&. +T}@T{ +\[uFF0E] +T} +T{ +\&.. +T}@T{ +\[uFF0E]\[uFF0E] +T} +.TE +.SS Invalid UTF-8 bytes .PP -The \f[C]--dry-run\f[R] messages may indicate that it would try to -delete some files. -For example, if a file is new on Path2 and does not exist on Path1 then -it would normally be copied to Path1, but with \f[C]--dry-run\f[R] -enabled those copies don\[aq]t happen, which leads to the attempted -delete on Path2, blocked again by --dry-run: -\f[C]... Not deleting as --dry-run\f[R]. +Some backends only support a sequence of well formed UTF-8 bytes as file +or directory names. .PP -This whole confusing situation is an artifact of the \f[C]--dry-run\f[R] -flag. -Scrutinize the proposed deletes carefully, and if the files would have -been copied to Path1 then the threatened deletes on Path2 may be -disregarded. -.SS Retries +In this case all invalid UTF-8 bytes will be replaced with a quoted +representation of the byte value to allow uploading a file to such a +backend. +For example, the invalid byte \f[C]0xFE\f[R] will be encoded as +\f[C]\[u201B]FE\f[R]. .PP -Rclone has built-in retries. -If you run with \f[C]--verbose\f[R] you\[aq]ll see error and retry -messages such as shown below. -This is usually not a bug. -If at the end of the run, you see \f[C]Bisync successful\f[R] and not -\f[C]Bisync critical error\f[R] or \f[C]Bisync aborted\f[R] then the run -was successful, and you can ignore the error messages. +A common source of invalid UTF-8 bytes are local filesystems, that store +names in a different encoding than UTF-8 or UTF-16, like latin1. +See the local filenames (https://rclone.org/local/#filenames) section +for details. +.SS Encoding option .PP -The following run shows an intermittent fail. -Lines \f[I]5\f[R] and _6- are low-level messages. -Line \f[I]6\f[R] is a bubbled-up \f[I]warning\f[R] message, conveying -the error. -Rclone normally retries failing commands, so there may be numerous such -messages in the log. +Most backends have an encoding option, specified as a flag +\f[C]--backend-encoding\f[R] where \f[C]backend\f[R] is the name of the +backend, or as a config parameter \f[C]encoding\f[R] (you\[aq]ll need to +select the Advanced config in \f[C]rclone config\f[R] to see it). .PP -Since there are no final error/warning messages on line \f[I]7\f[R], -rclone has recovered from failure after a retry, and the overall sync -was successful. -.IP -.nf -\f[C] -1: 2021/05/14 00:44:12 INFO : Synching Path1 \[dq]/path/to/local/tree\[dq] with Path2 \[dq]dropbox:\[dq] -2: 2021/05/14 00:44:12 INFO : Path1 checking for diffs -3: 2021/05/14 00:44:12 INFO : Path2 checking for diffs -4: 2021/05/14 00:44:12 INFO : Path2: 113 changes: 22 new, 0 newer, 0 older, 91 deleted -5: 2021/05/14 00:44:12 ERROR : /path/to/local/tree/objects/af: error listing: unexpected end of JSON input -6: 2021/05/14 00:44:12 NOTICE: WARNING listing try 1 failed. - dropbox: -7: 2021/05/14 00:44:12 INFO : Bisync successful -\f[R] -.fi +This will have default value which encodes and decodes characters in +such a way as to preserve the maximum number of characters (see above). .PP -This log shows a \f[I]Critical failure\f[R] which requires a -\f[C]--resync\f[R] to recover from. -See the Runtime Error Handling section. -.IP -.nf -\f[C] -2021/05/12 00:49:40 INFO : Google drive root \[aq]\[aq]: Waiting for checks to finish -2021/05/12 00:49:40 INFO : Google drive root \[aq]\[aq]: Waiting for transfers to finish -2021/05/12 00:49:40 INFO : Google drive root \[aq]\[aq]: not deleting files as there were IO errors -2021/05/12 00:49:40 ERROR : Attempt 3/3 failed with 3 errors and: not deleting files as there were IO errors -2021/05/12 00:49:40 ERROR : Failed to sync: not deleting files as there were IO errors -2021/05/12 00:49:40 NOTICE: WARNING rclone sync try 3 failed. - /path/to/local/tree/ -2021/05/12 00:49:40 ERROR : Bisync aborted. Must run --resync to recover. -\f[R] -.fi -.SS Denied downloads of \[dq]infected\[dq] or \[dq]abusive\[dq] files +However this can be incorrect in some scenarios, for example if you have +a Windows file system with Unicode fullwidth characters +\f[C]\[uFF0A]\f[R], \f[C]\[uFF1F]\f[R] or \f[C]\[uFF1A]\f[R], that you +want to remain as those characters on the remote rather than being +translated to regular (halfwidth) \f[C]*\f[R], \f[C]?\f[R] and +\f[C]:\f[R]. .PP -Google Drive has a filter for certain file types (\f[C].exe\f[R], -\f[C].apk\f[R], et cetera) that by default cannot be copied from Google -Drive to the local filesystem. -If you are having problems, run with \f[C]--verbose\f[R] to see -specifically which files are generating complaints. -If the error is -\f[C]This file has been identified as malware or spam and cannot be downloaded\f[R], -consider using the flag ---drive-acknowledge-abuse (https://rclone.org/drive/#drive-acknowledge-abuse). -.SS Google Doc files +The \f[C]--backend-encoding\f[R] flags allow you to change that. +You can disable the encoding completely with +\f[C]--backend-encoding None\f[R] or set \f[C]encoding = None\f[R] in +the config file. .PP -Google docs exist as virtual files on Google Drive and cannot be -transferred to other filesystems natively. -While it is possible to export a Google doc to a normal file (with -\f[C].xlsx\f[R] extension, for example), it is not possible to import a -normal file back into a Google document. +Encoding takes a comma separated list of encodings. +You can see the list of all possible values by passing an invalid value +to this flag, e.g. +\f[C]--local-encoding \[dq]help\[dq]\f[R]. +The command \f[C]rclone help flags encoding\f[R] will show you the +defaults for the backends. .PP -Bisync\[aq]s handling of Google Doc files is to flag them in the run log -output for user\[aq]s attention and ignore them for any file transfers, -deletes, or syncs. -They will show up with a length of \f[C]-1\f[R] in the listings. -This bisync run is otherwise successful: +.TS +tab(@); +lw(21.7n) lw(24.1n) lw(24.1n). +T{ +Encoding +T}@T{ +Characters +T}@T{ +Encoded as +T} +_ +T{ +Asterisk +T}@T{ +\f[C]*\f[R] +T}@T{ +\f[C]\[uFF0A]\f[R] +T} +T{ +BackQuote +T}@T{ +\f[C]\[ga]\f[R] +T}@T{ +\f[C]\[uFF40]\f[R] +T} +T{ +BackSlash +T}@T{ +\f[C]\[rs]\f[R] +T}@T{ +\f[C]\[uFF3C]\f[R] +T} +T{ +Colon +T}@T{ +\f[C]:\f[R] +T}@T{ +\f[C]\[uFF1A]\f[R] +T} +T{ +CrLf +T}@T{ +CR 0x0D, LF 0x0A +T}@T{ +\f[C]\[u240D]\f[R], \f[C]\[u240A]\f[R] +T} +T{ +Ctl +T}@T{ +All control characters 0x00-0x1F +T}@T{ +\f[C]\[u2400]\[u2401]\[u2402]\[u2403]\[u2404]\[u2405]\[u2406]\[u2407]\[u2408]\[u2409]\[u240A]\[u240B]\[u240C]\[u240D]\[u240E]\[u240F]\[u2410]\[u2411]\[u2412]\[u2413]\[u2414]\[u2415]\[u2416]\[u2417]\[u2418]\[u2419]\[u241A]\[u241B]\[u241C]\[u241D]\[u241E]\[u241F]\f[R] +T} +T{ +Del +T}@T{ +DEL 0x7F +T}@T{ +\f[C]\[u2421]\f[R] +T} +T{ +Dollar +T}@T{ +\f[C]$\f[R] +T}@T{ +\f[C]\[uFF04]\f[R] +T} +T{ +Dot +T}@T{ +\f[C].\f[R] or \f[C]..\f[R] as entire string +T}@T{ +\f[C]\[uFF0E]\f[R], \f[C]\[uFF0E]\[uFF0E]\f[R] +T} +T{ +DoubleQuote +T}@T{ +\f[C]\[dq]\f[R] +T}@T{ +\f[C]\[uFF02]\f[R] +T} +T{ +Hash +T}@T{ +\f[C]#\f[R] +T}@T{ +\f[C]\[uFF03]\f[R] +T} +T{ +InvalidUtf8 +T}@T{ +An invalid UTF-8 character (e.g. +latin1) +T}@T{ +\f[C]\[uFFFD]\f[R] +T} +T{ +LeftCrLfHtVt +T}@T{ +CR 0x0D, LF 0x0A, HT 0x09, VT 0x0B on the left of a string +T}@T{ +\f[C]\[u240D]\f[R], \f[C]\[u240A]\f[R], \f[C]\[u2409]\f[R], +\f[C]\[u240B]\f[R] +T} +T{ +LeftPeriod +T}@T{ +\f[C].\f[R] on the left of a string +T}@T{ +\f[C].\f[R] +T} +T{ +LeftSpace +T}@T{ +SPACE on the left of a string +T}@T{ +\f[C]\[u2420]\f[R] +T} +T{ +LeftTilde +T}@T{ +\f[C]\[ti]\f[R] on the left of a string +T}@T{ +\f[C]\[uFF5E]\f[R] +T} +T{ +LtGt +T}@T{ +\f[C]<\f[R], \f[C]>\f[R] +T}@T{ +\f[C]\[uFF1C]\f[R], \f[C]\[uFF1E]\f[R] +T} +T{ +None +T}@T{ +No characters are encoded +T}@T{ +T} +T{ +Percent +T}@T{ +\f[C]%\f[R] +T}@T{ +\f[C]\[uFF05]\f[R] +T} +T{ +Pipe +T}@T{ +| +T}@T{ +\f[C]\[uFF5C]\f[R] +T} +T{ +Question +T}@T{ +\f[C]?\f[R] +T}@T{ +\f[C]\[uFF1F]\f[R] +T} +T{ +RightCrLfHtVt +T}@T{ +CR 0x0D, LF 0x0A, HT 0x09, VT 0x0B on the right of a string +T}@T{ +\f[C]\[u240D]\f[R], \f[C]\[u240A]\f[R], \f[C]\[u2409]\f[R], +\f[C]\[u240B]\f[R] +T} +T{ +RightPeriod +T}@T{ +\f[C].\f[R] on the right of a string +T}@T{ +\f[C].\f[R] +T} +T{ +RightSpace +T}@T{ +SPACE on the right of a string +T}@T{ +\f[C]\[u2420]\f[R] +T} +T{ +Semicolon +T}@T{ +\f[C];\f[R] +T}@T{ +\f[C]\[uFF1B]\f[R] +T} +T{ +SingleQuote +T}@T{ +\f[C]\[aq]\f[R] +T}@T{ +\f[C]\[uFF07]\f[R] +T} +T{ +Slash +T}@T{ +\f[C]/\f[R] +T}@T{ +\f[C]\[uFF0F]\f[R] +T} +T{ +SquareBracket +T}@T{ +\f[C][\f[R], \f[C]]\f[R] +T}@T{ +\f[C]\[uFF3B]\f[R], \f[C]\[uFF3D]\f[R] +T} +.TE +.SS Encoding example: FTP +.PP +To take a specific example, the FTP backend\[aq]s default encoding is .IP .nf \f[C] -2021/05/11 08:23:15 INFO : Synching Path1 \[dq]/path/to/local/tree/base/\[dq] with Path2 \[dq]GDrive:\[dq] -2021/05/11 08:23:15 INFO : ...path2.lst-new: Ignoring incorrect line: \[dq]- -1 - - 2018-07-29T08:49:30.136000000+0000 GoogleDoc.docx\[dq] -2021/05/11 08:23:15 INFO : Bisync successful +--ftp-encoding \[dq]Slash,Del,Ctl,RightSpace,Dot\[dq] \f[R] .fi -.SS Usage examples -.SS Cron -.PP -Rclone does not yet have a built-in capability to monitor the local file -system for changes and must be blindly run periodically. -On Windows this can be done using a \f[I]Task Scheduler\f[R], on Linux -you can use \f[I]Cron\f[R] which is described below. .PP -The 1st example runs a sync every 5 minutes between a local directory -and an OwnCloud server, with output logged to a runlog file: +However, let\[aq]s say the FTP server is running on Windows and +can\[aq]t have any of the invalid Windows characters in file names. +You are backing up Linux servers to this FTP server which do have those +characters in file names. +So you would add the Windows set which are .IP .nf \f[C] -# Minute (0-59) -# Hour (0-23) -# Day of Month (1-31) -# Month (1-12 or Jan-Dec) -# Day of Week (0-6 or Sun-Sat) -# Command - */5 * * * * /path/to/rclone bisync /local/files MyCloud: --check-access --filters-file /path/to/bysync-filters.txt --log-file /path/to//bisync.log +Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot \f[R] .fi .PP -See crontab -syntax (https://www.man7.org/linux/man-pages/man1/crontab.1p.html#INPUT_FILES) -for the details of crontab time interval expressions. -.PP -If you run \f[C]rclone bisync\f[R] as a cron job, redirect stdout/stderr -to a file. -The 2nd example runs a sync to Dropbox every hour and logs all stdout -(via the \f[C]>>\f[R]) and stderr (via \f[C]2>&1\f[R]) to a log file. +to the existing ones, giving: .IP .nf \f[C] -0 * * * * /path/to/rclone bisync /path/to/local/dropbox Dropbox: --check-access --filters-file /home/user/filters.txt >> /path/to/logs/dropbox-run.log 2>&1 +Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot,Del,RightSpace \f[R] .fi -.SS Sharing an encrypted folder tree between hosts .PP -bisync can keep a local folder in sync with a cloud service, but what if -you have some highly sensitive files to be synched? +This can be specified using the \f[C]--ftp-encoding\f[R] flag or using +an \f[C]encoding\f[R] parameter in the config file. +.SS Encoding example: Windows .PP -Usage of a cloud service is for exchanging both routine and sensitive -personal files between one\[aq]s home network, one\[aq]s personal -notebook when on the road, and with one\[aq]s work computer. -The routine data is not sensitive. -For the sensitive data, configure an rclone crypt -remote (https://rclone.org/crypt/) to point to a subdirectory within the -local disk tree that is bisync\[aq]d to Dropbox, and then set up an -bisync for this local crypt directory to a directory outside of the main -sync tree. -.SS Linux server setup -.IP \[bu] 2 -\f[C]/path/to/DBoxroot\f[R] is the root of my local sync tree. -There are numerous subdirectories. -.IP \[bu] 2 -\f[C]/path/to/DBoxroot/crypt\f[R] is the root subdirectory for files -that are encrypted. -This local directory target is setup as an rclone crypt remote named -\f[C]Dropcrypt:\f[R]. -See rclone.conf snippet below. -.IP \[bu] 2 -\f[C]/path/to/my/unencrypted/files\f[R] is the root of my sensitive -files - not encrypted, not within the tree synched to Dropbox. -.IP \[bu] 2 -To sync my local unencrypted files with the encrypted Dropbox versions I -manually run \f[C]bisync /path/to/my/unencrypted/files DropCrypt:\f[R]. -This step could be bundled into a script to run before and after the -full Dropbox tree sync in the last step, thus actively keeping the -sensitive files in sync. -.IP \[bu] 2 -\f[C]bisync /path/to/DBoxroot Dropbox:\f[R] runs periodically via cron, -keeping my full local sync tree in sync with Dropbox. -.SS Windows notebook setup -.IP \[bu] 2 -The Dropbox client runs keeping the local tree -\f[C]C:\[rs]Users\[rs]MyLogin\[rs]Dropbox\f[R] always in sync with -Dropbox. -I could have used \f[C]rclone bisync\f[R] instead. -.IP \[bu] 2 -A separate directory tree at -\f[C]C:\[rs]Users\[rs]MyLogin\[rs]Documents\[rs]DropLocal\f[R] hosts the -tree of unencrypted files/folders. -.IP \[bu] 2 -To sync my local unencrypted files with the encrypted Dropbox versions I -manually run the following command: -\f[C]rclone bisync C:\[rs]Users\[rs]MyLogin\[rs]Documents\[rs]DropLocal Dropcrypt:\f[R]. -.IP \[bu] 2 -The Dropbox client then syncs the changes with Dropbox. -.SS rclone.conf snippet +As a nother example, take a Windows system where there is a file with +name \f[C]Test\[uFF1A]1.jpg\f[R], where \f[C]\[uFF1A]\f[R] is the +Unicode fullwidth colon symbol. +When using rclone to copy this to a remote which supports \f[C]:\f[R], +the regular (halfwidth) colon (such as Google Drive), you will notice +that the file gets renamed to \f[C]Test:1.jpg\f[R]. +.PP +To avoid this you can change the set of characters rclone should convert +for the local filesystem, using command-line argument +\f[C]--local-encoding\f[R]. +Rclone\[aq]s default behavior on Windows corresponds to .IP .nf \f[C] -[Dropbox] -type = dropbox -\&... - -[Dropcrypt] -type = crypt -remote = /path/to/DBoxroot/crypt # on the Linux server -remote = C:\[rs]Users\[rs]MyLogin\[rs]Dropbox\[rs]crypt # on the Windows notebook -filename_encryption = standard -directory_name_encryption = true -password = ... -\&... +--local-encoding \[dq]Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot\[dq] \f[R] .fi -.SS Testing -.PP -You should read this section only if you are developing for rclone. -You need to have rclone source code locally to work with bisync tests. -.PP -Bisync has a dedicated test framework implemented in the -\f[C]bisync_test.go\f[R] file located in the rclone source tree. -The test suite is based on the \f[C]go test\f[R] command. -Series of tests are stored in subdirectories below the -\f[C]cmd/bisync/testdata\f[R] directory. -Individual tests can be invoked by their directory name, e.g. -\f[C]go test . -case basic -remote local -remote2 gdrive: -v\f[R] .PP -Tests will make a temporary folder on remote and purge it afterwards. -If during test run there are intermittent errors and rclone retries, -these errors will be captured and flagged as invalid MISCOMPAREs. -Rerunning the test will let it pass. -Consider such failures as noise. -.SS Test command syntax +If you want to use fullwidth characters \f[C]\[uFF1A]\f[R], +\f[C]\[uFF0A]\f[R] and \f[C]\[uFF1F]\f[R] in your filenames without +rclone changing them when uploading to a remote, then set the same as +the default value but without \f[C]Colon,Question,Asterisk\f[R]: .IP .nf \f[C] -usage: go test ./cmd/bisync [options...] - -Options: - -case NAME Name(s) of the test case(s) to run. Multiple names should - be separated by commas. You can remove the \[ga]test_\[ga] prefix - and replace \[ga]_\[ga] by \[ga]-\[ga] in test name for convenience. - If not \[ga]all\[ga], the name(s) should map to a directory under - \[ga]./cmd/bisync/testdata\[ga]. - Use \[ga]all\[ga] to run all tests (default: all) - -remote PATH1 \[ga]local\[ga] or name of cloud service with \[ga]:\[ga] (default: local) - -remote2 PATH2 \[ga]local\[ga] or name of cloud service with \[ga]:\[ga] (default: local) - -no-compare Disable comparing test results with the golden directory - (default: compare) - -no-cleanup Disable cleanup of Path1 and Path2 testdirs. - Useful for troubleshooting. (default: cleanup) - -golden Store results in the golden directory (default: false) - This flag can be used with multiple tests. - -debug Print debug messages - -stop-at NUM Stop test after given step number. (default: run to the end) - Implies \[ga]-no-compare\[ga] and \[ga]-no-cleanup\[ga], if the test really - ends prematurely. Only meaningful for a single test case. - -refresh-times Force refreshing the target modtime, useful for Dropbox - (default: false) - -verbose Run tests verbosely +--local-encoding \[dq]Slash,LtGt,DoubleQuote,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot\[dq] \f[R] .fi .PP -Note: unlike rclone flags which must be prefixed by double dash -(\f[C]--\f[R]), the test command flags can be equally prefixed by a -single \f[C]-\f[R] or double dash. -.SS Running tests -.IP \[bu] 2 -\f[C]go test . -case basic -remote local -remote2 local\f[R] runs the -\f[C]test_basic\f[R] test case using only the local filesystem, synching -one local directory with another local directory. -Test script output is to the console, while commands within scenario.txt -have their output sent to the \f[C].../workdir/test.log\f[R] file, which -is finally compared to the golden copy. -.IP \[bu] 2 -The first argument after \f[C]go test\f[R] should be a relative name of -the directory containing bisync source code. -If you run tests right from there, the argument will be \f[C].\f[R] -(current directory) as in most examples below. -If you run bisync tests from the rclone source directory, the command -should be \f[C]go test ./cmd/bisync ...\f[R]. -.IP \[bu] 2 -The test engine will mangle rclone output to ensure comparability with -golden listings and logs. -.IP \[bu] 2 -Test scenarios are located in \f[C]./cmd/bisync/testdata\f[R]. -The test \f[C]-case\f[R] argument should match the full name of a -subdirectory under that directory. -Every test subdirectory name on disk must start with \f[C]test_\f[R], -this prefix can be omitted on command line for brevity. -Also, underscores in the name can be replaced by dashes for convenience. -.IP \[bu] 2 -\f[C]go test . -remote local -remote2 local -case all\f[R] runs all -tests. -.IP \[bu] 2 -Path1 and Path2 may either be the keyword \f[C]local\f[R] or may be -names of configured cloud services. -\f[C]go test . -remote gdrive: -remote2 dropbox: -case basic\f[R] will -run the test between these two services, without transferring any files -to the local filesystem. -.IP \[bu] 2 -Test run stdout and stderr console output may be directed to a file, -e.g. -\f[C]go test . -remote gdrive: -remote2 local -case all > runlog.txt 2>&1\f[R] -.SS Test execution flow -.IP "1." 3 -The base setup in the \f[C]initial\f[R] directory of the testcase is -applied on the Path1 and Path2 filesystems (via rclone copy the initial -directory to Path1, then rclone sync Path1 to Path2). -.IP "2." 3 -The commands in the scenario.txt file are applied, with output directed -to the \f[C]test.log\f[R] file in the test working directory. -Typically, the first actual command in the \f[C]scenario.txt\f[R] file -is to do a \f[C]--resync\f[R], which establishes the baseline -\f[C]{...}.path1.lst\f[R] and \f[C]{...}.path2.lst\f[R] files in the -test working directory (\f[C].../workdir/\f[R] relative to the temporary -test directory). -Various commands and listing snapshots are done within the test. -.IP "3." 3 -Finally, the contents of the test working directory are compared to the -contents of the testcase\[aq]s golden directory. -.SS Notes about testing -.IP \[bu] 2 -Test cases are in individual directories beneath -\f[C]./cmd/bisync/testdata\f[R]. -A command line reference to a test is understood to reference a -directory beneath \f[C]testdata\f[R]. -For example, -\f[C]go test ./cmd/bisync -case dry-run -remote gdrive: -remote2 local\f[R] -refers to the test case in \f[C]./cmd/bisync/testdata/test_dry_run\f[R]. -.IP \[bu] 2 -The test working directory is located at \f[C].../workdir\f[R] relative -to a temporary test directory, usually under \f[C]/tmp\f[R] on Linux. -.IP \[bu] 2 -The local test sync tree is created at a temporary directory named like -\f[C]bisync.XXX\f[R] under system temporary directory. -.IP \[bu] 2 -The remote test sync tree is located at a temporary directory under -\f[C]/bisync.XXX/\f[R]. -.IP \[bu] 2 -\f[C]path1\f[R] and/or \f[C]path2\f[R] subdirectories are created in a -temporary directory under the respective local or cloud test remote. -.IP \[bu] 2 -By default, the Path1 and Path2 test dirs and workdir will be deleted -after each test run. -The \f[C]-no-cleanup\f[R] flag disables purging these directories when -validating and debugging a given test. -These directories will be flushed before running another test, -independent of the \f[C]-no-cleanup\f[R] usage. -.IP \[bu] 2 -You will likely want to add \[ga]- -/testdir/\f[C]to your normal bisync\f[R]--filters-file\f[C]so that normal syncs do not attempt to sync the test temporary directories, which may have\f[R]RCLONE_TEST\f[C]miscompares in some testcases which would otherwise trip the\f[R]--check-access\f[C]system. The\f[R]--check-access\f[C]mechanism is hard-coded to ignore\f[R]RCLONE_TEST\f[C]files beneath\f[R]bisync/testdata\[ga], -so the test cases may reside on the synched tree even if there are check -file mismatches in the test tree. -.IP \[bu] 2 -Some Dropbox tests can fail, notably printing the following message: -\f[C]src and dst identical but can\[aq]t set mod time without deleting and re-uploading\f[R] -This is expected and happens due to the way Dropbox handles modification -times. -You should use the \f[C]-refresh-times\f[R] test flag to make up for -this. -.IP \[bu] 2 -If Dropbox tests hit request limit for you and print error message -\f[C]too_many_requests/...: Too many requests or write operations.\f[R] -then follow the Dropbox App ID -instructions (https://rclone.org/dropbox/#get-your-own-dropbox-app-id). -.SS Updating golden results +Alternatively, you can disable the conversion of any characters with +\f[C]--local-encoding None\f[R]. +.PP +Instead of using command-line argument \f[C]--local-encoding\f[R], you +may also set it as environment +variable (https://rclone.org/docs/#environment-variables) +\f[C]RCLONE_LOCAL_ENCODING\f[R], or +configure (https://rclone.org/docs/#configure) a remote of type +\f[C]local\f[R] in your config, and set the \f[C]encoding\f[R] option +there. +.PP +The risk by doing this is that if you have a filename with the regular +(halfwidth) \f[C]:\f[R], \f[C]*\f[R] and \f[C]?\f[R] in your cloud +storage, and you try to download it to your Windows filesystem, this +will fail. +These characters are not valid in filenames on Windows, and you have +told rclone not to work around this by converting them to valid +fullwidth variants. +.SS MIME Type +.PP +MIME types (also known as media types) classify types of documents using +a simple text classification, e.g. +\f[C]text/html\f[R] or \f[C]application/pdf\f[R]. +.PP +Some cloud storage systems support reading (\f[C]R\f[R]) the MIME type +of objects and some support writing (\f[C]W\f[R]) the MIME type of +objects. .PP -Sometimes even a slight change in the bisync source can cause little -changes spread around many log files. -Updating them manually would be a nightmare. +The MIME type can be important if you are serving files directly to HTTP +from the storage system. .PP -The \f[C]-golden\f[R] flag will store the \f[C]test.log\f[R] and -\f[C]*.lst\f[R] listings from each test case into respective golden -directories. -Golden results will automatically contain generic strings instead of -local or cloud paths which means that they should match when run with a -different cloud service. +If you are copying from a remote which supports reading (\f[C]R\f[R]) to +a remote which supports writing (\f[C]W\f[R]) then rclone will preserve +the MIME types. +Otherwise they will be guessed from the extension, or the remote itself +may assign the MIME type. +.SS Metadata .PP -Your normal workflow might be as follows: 1. -Git-clone the rclone sources locally 2. -Modify bisync source and check that it builds 3. -Run the whole test suite \f[C]go test ./cmd/bisync -remote local\f[R] 4. -If some tests show log difference, recheck them individually, e.g.: -\f[C]go test ./cmd/bisync -remote local -case basic\f[R] 5. -If you are convinced with the difference, goldenize all tests at once: -\f[C]go test ./cmd/bisync -remote local -golden\f[R] 6. -Use word diff: \f[C]git diff --word-diff ./cmd/bisync/testdata/\f[R]. -Please note that normal line-level diff is generally useless here. -7. -Check the difference \f[I]carefully\f[R]! 8. -Commit the change (\f[C]git commit\f[R]) \f[I]only\f[R] if you are sure. -If unsure, save your code changes then wipe the log diffs from git: -\f[C]git reset [--hard]\f[R]. -.SS Structure of test scenarios -.IP \[bu] 2 -\f[C]/initial/\f[R] contains a tree of files that will be set -as the initial condition on both Path1 and Path2 testdirs. -.IP \[bu] 2 -\f[C]/modfiles/\f[R] contains files that will be used to -modify the Path1 and/or Path2 filesystems. -.IP \[bu] 2 -\f[C]/golden/\f[R] contains the expected content of the test -working directory (\f[C]workdir\f[R]) at the completion of the testcase. -.IP \[bu] 2 -\f[C]/scenario.txt\f[R] contains the body of the test, in the -form of various commands to modify files, run bisync, and snapshot -listings. -Output from these commands is captured to \f[C].../workdir/test.log\f[R] -for comparison to the golden files. -.SS Supported test commands -.IP \[bu] 2 -\f[C]test \f[R] Print the line to the console and to the -\f[C]test.log\f[R]: -\f[C]test sync is working correctly with options x, y, z\f[R] -.IP \[bu] 2 -\f[C]copy-listings \f[R] Save a copy of all \f[C].lst\f[R] -listings in the test working directory with the specified prefix: -\f[C]save-listings exclude-pass-run\f[R] -.IP \[bu] 2 -\f[C]move-listings \f[R] Similar to \f[C]copy-listings\f[R] but -removes the source -.IP \[bu] 2 -\f[C]purge-children \f[R] This will delete all child files and -purge all child subdirs under given directory but keep the parent -intact. -This behavior is important for tests with Google Drive because removing -and re-creating the parent would change its ID. -.IP \[bu] 2 -\f[C]delete-file \f[R] Delete a single file. -.IP \[bu] 2 -\f[C]delete-glob \f[R] Delete a group of files located -one level deep in the given directory with names matching a given glob -pattern. -.IP \[bu] 2 -\f[C]touch-glob YYYY-MM-DD \f[R] Change modification time -on a group of files. -.IP \[bu] 2 -\f[C]touch-copy YYYY-MM-DD \f[R] Change file -modification time then copy it to destination. -.IP \[bu] 2 -\f[C]copy-file \f[R] Copy a single file to given -directory. -.IP \[bu] 2 -\f[C]copy-as \f[R] Similar to above but -destination must include both directory and the new file name at -destination. -.IP \[bu] 2 -\f[C]copy-dir \f[R] and \f[C]sync-dir \f[R] -Copy/sync a directory. -Equivalent of \f[C]rclone copy\f[R] and \f[C]rclone sync\f[R]. -.IP \[bu] 2 -\f[C]list-dirs \f[R] Equivalent to -\f[C]rclone lsf -R --dirs-only \f[R] -.IP \[bu] 2 -\f[C]bisync [options]\f[R] Runs bisync against \f[C]-remote\f[R] and -\f[C]-remote2\f[R]. -.SS Supported substitution terms -.IP \[bu] 2 -\f[C]{testdir/}\f[R] - the root dir of the testcase -.IP \[bu] 2 -\f[C]{datadir/}\f[R] - the \f[C]modfiles\f[R] dir under the testcase -root -.IP \[bu] 2 -\f[C]{workdir/}\f[R] - the temporary test working directory -.IP \[bu] 2 -\f[C]{path1/}\f[R] - the root of the Path1 test directory tree -.IP \[bu] 2 -\f[C]{path2/}\f[R] - the root of the Path2 test directory tree -.IP \[bu] 2 -\f[C]{session}\f[R] - base name of the test listings -.IP \[bu] 2 -\f[C]{/}\f[R] - OS-specific path separator -.IP \[bu] 2 -\f[C]{spc}\f[R], \f[C]{tab}\f[R], \f[C]{eol}\f[R] - whitespace -.IP \[bu] 2 -\f[C]{chr:HH}\f[R] - raw byte with given hexadecimal code +Backends may or may support reading or writing metadata. +They may support reading and writing system metadata (metadata intrinsic +to that backend) and/or user metadata (general purpose metadata). .PP -Substitution results of the terms named like \f[C]{dir/}\f[R] will end -with \f[C]/\f[R] (or backslash on Windows), so it is not necessary to -include slash in the usage, for example -\f[C]delete-file {path1/}file1.txt\f[R]. -.SS Benchmarks +The levels of metadata support are .PP -\f[I]This section is work in progress.\f[R] +.TS +tab(@); +l l. +T{ +Key +T}@T{ +Explanation +T} +_ +T{ +\f[C]R\f[R] +T}@T{ +Read only System Metadata +T} +T{ +\f[C]RW\f[R] +T}@T{ +Read and write System Metadata +T} +T{ +\f[C]RWU\f[R] +T}@T{ +Read and write System Metadata and read and write User Metadata +T} +.TE .PP -Here are a few data points for scale, execution times, and memory usage. +See the metadata docs (https://rclone.org/docs/#metadata) for more info. +.SS Optional Features .PP -The first set of data was taken between a local disk to Dropbox. -The speedtest.net (https://speedtest.net) download speed was \[ti]170 -Mbps, and upload speed was \[ti]10 Mbps. -500 files (\[ti]9.5 MB each) had been already synched. -50 files were added in a new directory, each \[ti]9.5 MB, \[ti]475 MB -total. +All rclone remotes support a base command set. +Other features depend upon backend-specific capabilities. .PP .TS tab(@); -lw(23.8n) lw(35.0n) lw(11.2n). +lw(14.4n) cw(3.6n) cw(3.1n) cw(3.1n) cw(4.6n) cw(4.6n) cw(3.6n) cw(7.2n) lw(9.8n) cw(7.2n) cw(3.6n) cw(5.1n). +T{ +Name +T}@T{ +Purge +T}@T{ +Copy +T}@T{ +Move +T}@T{ +DirMove +T}@T{ +CleanUp +T}@T{ +ListR +T}@T{ +StreamUpload +T}@T{ +MultithreadUpload +T}@T{ +LinkSharing +T}@T{ +About +T}@T{ +EmptyDir +T} +_ +T{ +1Fichier +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +No +T}@T{ +Yes +T} +T{ +Akamai Netstorage +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T} +T{ +Amazon Drive +T}@T{ +Yes +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T} +T{ +Amazon S3 (or S3 compatible) +T}@T{ +No +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T} +T{ +Backblaze B2 +T}@T{ +No +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T} +T{ +Box +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +Yes +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T} +T{ +Citrix ShareFile +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T} +T{ +Dropbox +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T} +T{ +Enterprise File Fabric +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T} T{ -Change +FTP +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T} +T{ +Google Cloud Storage +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T} +T{ +Google Drive +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T} +T{ +Google Photos +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T} +T{ +HDFS +T}@T{ +Yes +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T} +T{ +HiDrive +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T} +T{ +HTTP +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T} +T{ +Internet Archive +T}@T{ +No +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T} +T{ +Jottacloud +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T} +T{ +Koofr +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T} +T{ +Mail.ru Cloud +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T} +T{ +Mega +T}@T{ +Yes +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T} +T{ +Memory +T}@T{ +No +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T} +T{ +Microsoft Azure Blob Storage +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T} +T{ +Microsoft Azure Files Storage +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T} +T{ +Microsoft OneDrive +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes \[u2075] +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T} +T{ +OpenDrive +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T} +T{ +OpenStack Swift +T}@T{ +Yes \[S1] +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +No +T} +T{ +Oracle Object Storage +T}@T{ +No +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T} +T{ +pCloud +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T} +T{ +PikPak +T}@T{ +Yes +T}@T{ +Yes T}@T{ -Operations and times +Yes T}@T{ -Overall run time -T} -_ -T{ -500 files synched (nothing to move) +Yes T}@T{ -1x listings for Path1 & Path2 +Yes T}@T{ -1.5 sec -T} -T{ -500 files synched with --check-access +No T}@T{ -1x listings for Path1 & Path2 +No T}@T{ -1.5 sec +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes T} T{ -50 new files on remote +premiumize.me T}@T{ -Queued 50 copies down: 27 sec +Yes T}@T{ -29 sec +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes T} T{ -Moved local dir +put.io T}@T{ -Queued 50 copies up: 410 sec, 50 deletes up: 9 sec +Yes T}@T{ -421 sec +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes T} T{ -Moved remote dir +Proton Drive T}@T{ -Queued 50 copies down: 31 sec, 50 deletes down: <1 sec +Yes T}@T{ -33 sec +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes T} T{ -Delete local dir +QingStor T}@T{ -Queued 50 deletes up: 9 sec +No T}@T{ -13 sec +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No T} -.TE -.PP -This next data is from a user\[aq]s application. -They had \[ti]400GB of data over 1.96 million files being sync\[aq]ed -between a Windows local disk and some remote cloud. -The file full path length was on average 35 characters (which factors -into load time and RAM required). -.IP \[bu] 2 -Loading the prior listing into memory (1.96 million files, listing file -size 140 MB) took \[ti]30 sec and occupied about 1 GB of RAM. -.IP \[bu] 2 -Getting a fresh listing of the local file system (producing the 140 MB -output file) took about XXX sec. -.IP \[bu] 2 -Getting a fresh listing of the remote file system (producing the 140 MB -output file) took about XXX sec. -The network download speed was measured at XXX Mb/s. -.IP \[bu] 2 -Once the prior and current Path1 and Path2 listings were loaded (a total -of four to be loaded, two at a time), determining the deltas was pretty -quick (a few seconds for this test case), and the transfer time for any -files to be copied was dominated by the network bandwidth. -.SS References -.PP -rclone\[aq]s bisync implementation was derived from the -rclonesync-V2 (https://github.com/cjnaz/rclonesync-V2) project, -including documentation and test mechanisms, with -[\[at]cjnaz](https://github.com/cjnaz)\[aq]s full support and -encouragement. -.PP -\f[C]rclone bisync\f[R] is similar in nature to a range of other -projects: -.IP \[bu] 2 -unison (https://github.com/bcpierce00/unison) -.IP \[bu] 2 -syncthing (https://github.com/syncthing/syncthing) -.IP \[bu] 2 -cjnaz/rclonesync (https://github.com/cjnaz/rclonesync-V2) -.IP \[bu] 2 -ConorWilliams/rsinc (https://github.com/ConorWilliams/rsinc) -.IP \[bu] 2 -jwink3101/syncrclone (https://github.com/Jwink3101/syncrclone) -.IP \[bu] 2 -DavideRossi/upback (https://github.com/DavideRossi/upback) -.PP -Bisync adopts the differential synchronization technique, which is based -on keeping history of changes performed by both synchronizing sides. -See the \f[I]Dual Shadow Method\f[R] section in Neil Fraser\[aq]s -article (https://neil.fraser.name/writing/sync/). -.PP -Also note a number of academic publications by Benjamin -Pierce (http://www.cis.upenn.edu/%7Ebcpierce/papers/index.shtml#File%20Synchronization) -about \f[I]Unison\f[R] and synchronization in general. -.SS Changelog -.SS \f[C]v1.64\f[R] -.IP \[bu] 2 -Fixed an -issue (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Dry%20runs%20are%20not%20completely%20dry) -causing dry runs to inadvertently commit filter changes -.IP \[bu] 2 -Fixed an -issue (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=2.%20%2D%2Dresync%20deletes%20data%2C%20contrary%20to%20docs) -causing \f[C]--resync\f[R] to erroneously delete empty folders and -duplicate files unique to Path2 -.IP \[bu] 2 -\f[C]--check-access\f[R] is now enforced during \f[C]--resync\f[R], -preventing data loss in certain user error -scenarios (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=%2D%2Dcheck%2Daccess%20doesn%27t%20always%20fail%20when%20it%20should) -.IP \[bu] 2 -Fixed an -issue (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=5.%20Bisync%20reads%20files%20in%20excluded%20directories%20during%20delete%20operations) -causing bisync to consider more files than necessary due to overbroad -filters during delete operations -.IP \[bu] 2 -Improved detection of false positive change -conflicts (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Identical%20files%20should%20be%20left%20alone%2C%20even%20if%20new/newer/changed%20on%20both%20sides) -(identical files are now left alone instead of renamed) -.IP \[bu] 2 -Added support for -\f[C]--create-empty-src-dirs\f[R] (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=3.%20Bisync%20should%20create/delete%20empty%20directories%20as%20sync%20does%2C%20when%20%2D%2Dcreate%2Dempty%2Dsrc%2Ddirs%20is%20passed) -.IP \[bu] 2 -Added experimental \f[C]--resilient\f[R] mode to allow recovery from -self-correctable -errors (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=2.%20Bisync%20should%20be%20more%20resilient%20to%20self%2Dcorrectable%20errors) -.IP \[bu] 2 -Added new \f[C]--ignore-listing-checksum\f[R] -flag (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=6.%20%2D%2Dignore%2Dchecksum%20should%20be%20split%20into%20two%20flags%20for%20separate%20purposes) -to distinguish from \f[C]--ignore-checksum\f[R] -.IP \[bu] 2 -Performance -improvements (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=6.%20Deletes%20take%20several%20times%20longer%20than%20copies) -for large remotes -.IP \[bu] 2 -Documentation and testing improvements -.SH Release signing -.PP -The hashes of the binary artefacts of the rclone release are signed with -a public PGP/GPG key. -This can be verified manually as described below. -.PP -The same mechanism is also used by rclone -selfupdate (https://rclone.org/commands/rclone_selfupdate/) to verify -that the release has not been tampered with before the new update is -installed. -This checks the SHA256 hash and the signature with a public key compiled -into the rclone binary. -.SS Release signing key -.PP -You may obtain the release signing key from: -.IP \[bu] 2 -From KEYS on this website - this file contains all past signing keys -also. -.IP \[bu] 2 -The git repository hosted on GitHub - -https://github.com/rclone/rclone/blob/master/docs/content/KEYS -.IP \[bu] 2 -\f[C]gpg --keyserver hkps://keys.openpgp.org --search nick\[at]craig-wood.com\f[R] -.IP \[bu] 2 -\f[C]gpg --keyserver hkps://keyserver.ubuntu.com --search nick\[at]craig-wood.com\f[R] -.IP \[bu] 2 -https://www.craig-wood.com/nick/pub/pgp-key.txt -.PP -After importing the key, verify that the fingerprint of one of the keys -matches: \f[C]FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA\f[R] as this key -is used for signing. -.PP -We recommend that you cross-check the fingerprint shown above through -the domains listed below. -By cross-checking the integrity of the fingerprint across multiple -domains you can be confident that you obtained the correct key. -.IP \[bu] 2 -The source for this page on -GitHub (https://github.com/rclone/rclone/blob/master/docs/content/release_signing.md). -.IP \[bu] 2 -Through DNS \f[C]dig key.rclone.org txt\f[R] -.PP -If you find anything that doesn\[aq]t not match, please contact the -developers at once. -.SS How to verify the release -.PP -In the release directory you will see the release files and some files -called \f[C]MD5SUMS\f[R], \f[C]SHA1SUMS\f[R] and \f[C]SHA256SUMS\f[R]. -.IP -.nf -\f[C] -$ rclone lsf --http-url https://downloads.rclone.org/v1.63.1 :http: -MD5SUMS -SHA1SUMS -SHA256SUMS -rclone-v1.63.1-freebsd-386.zip -rclone-v1.63.1-freebsd-amd64.zip -\&... -rclone-v1.63.1-windows-arm64.zip -rclone-v1.63.1.tar.gz -version.txt -\f[R] -.fi -.PP -The \f[C]MD5SUMS\f[R], \f[C]SHA1SUMS\f[R] and \f[C]SHA256SUMS\f[R] -contain hashes of the binary files in the release directory along with a -signature. -.PP -For example: -.IP -.nf -\f[C] -$ rclone cat --http-url https://downloads.rclone.org/v1.63.1 :http:SHA256SUMS ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - -f6d1b2d7477475ce681bdce8cb56f7870f174cb6b2a9ac5d7b3764296ea4a113 rclone-v1.63.1-freebsd-386.zip -7266febec1f01a25d6575de51c44ddf749071a4950a6384e4164954dff7ac37e rclone-v1.63.1-freebsd-amd64.zip -\&... -66ca083757fb22198309b73879831ed2b42309892394bf193ff95c75dff69c73 rclone-v1.63.1-windows-amd64.zip -bbb47c16882b6c5f2e8c1b04229378e28f68734c613321ef0ea2263760f74cd0 rclone-v1.63.1-windows-arm64.zip ------BEGIN PGP SIGNATURE----- - -iF0EARECAB0WIQT79zfs6firGGBL0qyTk14C/ztU+gUCZLVKJQAKCRCTk14C/ztU -+pZuAJ0XJ+QWLP/3jCtkmgcgc4KAwd/rrwCcCRZQ7E+oye1FPY46HOVzCFU3L7g= -=8qrL ------END PGP SIGNATURE----- -\f[R] -.fi -.SS Download the files -.PP -The first step is to download the binary and SUMs file and verify that -the SUMs you have downloaded match. -Here we download \f[C]rclone-v1.63.1-windows-amd64.zip\f[R] - choose the -binary (or binaries) appropriate to your architecture. -We\[aq]ve also chosen the \f[C]SHA256SUMS\f[R] as these are the most -secure. -You could verify the other types of hash also for extra security. -\f[C]rclone selfupdate\f[R] verifies just the \f[C]SHA256SUMS\f[R]. -.IP -.nf -\f[C] -$ mkdir /tmp/check -$ cd /tmp/check -$ rclone copy --http-url https://downloads.rclone.org/v1.63.1 :http:SHA256SUMS . -$ rclone copy --http-url https://downloads.rclone.org/v1.63.1 :http:rclone-v1.63.1-windows-amd64.zip . -\f[R] -.fi -.SS Verify the signatures -.PP -First verify the signatures on the SHA256 file. -.PP -Import the key. -See above for ways to verify this key is correct. -.IP -.nf -\f[C] -$ gpg --keyserver keyserver.ubuntu.com --receive-keys FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA -gpg: key 93935E02FF3B54FA: public key \[dq]Nick Craig-Wood \[dq] imported -gpg: Total number processed: 1 -gpg: imported: 1 -\f[R] -.fi -.PP -Then check the signature: -.IP -.nf -\f[C] -$ gpg --verify SHA256SUMS -gpg: Signature made Mon 17 Jul 2023 15:03:17 BST -gpg: using DSA key FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA -gpg: Good signature from \[dq]Nick Craig-Wood \[dq] [ultimate] -\f[R] -.fi -.PP -Verify the signature was good and is using the fingerprint shown above. -.PP -Repeat for \f[C]MD5SUMS\f[R] and \f[C]SHA1SUMS\f[R] if desired. -.SS Verify the hashes -.PP -Now that we know the signatures on the hashes are OK we can verify the -binaries match the hashes, completing the verification. -.IP -.nf -\f[C] -$ sha256sum -c SHA256SUMS 2>&1 | grep OK -rclone-v1.63.1-windows-amd64.zip: OK -\f[R] -.fi -.PP -Or do the check with rclone -.IP -.nf -\f[C] -$ rclone hashsum sha256 -C SHA256SUMS rclone-v1.63.1-windows-amd64.zip -2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 0 -2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 1 -2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 49 -2023/09/11 10:53:58 NOTICE: SHA256SUMS: 4 warning(s) suppressed... -= rclone-v1.63.1-windows-amd64.zip -2023/09/11 10:53:58 NOTICE: Local file system at /tmp/check: 0 differences found -2023/09/11 10:53:58 NOTICE: Local file system at /tmp/check: 1 matching files -\f[R] -.fi -.SS Verify signatures and hashes together -.PP -You can verify the signatures and hashes in one command line like this: -.IP -.nf -\f[C] -$ gpg --decrypt SHA256SUMS | sha256sum -c --ignore-missing -gpg: Signature made Mon 17 Jul 2023 15:03:17 BST -gpg: using DSA key FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA -gpg: Good signature from \[dq]Nick Craig-Wood \[dq] [ultimate] -gpg: aka \[dq]Nick Craig-Wood \[dq] [unknown] -rclone-v1.63.1-windows-amd64.zip: OK -\f[R] -.fi -.SH 1Fichier -.PP -This is a backend for the 1fichier (https://1fichier.com) cloud storage -service. -Note that a Premium subscription is required to use the API. -.PP -Paths are specified as \f[C]remote:path\f[R] -.PP -Paths may be as deep as required, e.g. -\f[C]remote:directory/subdirectory\f[R]. -.SS Configuration -.PP -The initial setup for 1Fichier involves getting the API key from the -website which you need to do in your browser. -.PP -Here is an example of how to make a remote called \f[C]remote\f[R]. -First run: -.IP -.nf -\f[C] - rclone config -\f[R] -.fi -.PP -This will guide you through an interactive setup process: -.IP -.nf -\f[C] -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> remote -Type of storage to configure. -Enter a string value. Press Enter for the default (\[dq]\[dq]). -Choose a number from below, or type in your own value -[snip] -XX / 1Fichier - \[rs] \[dq]fichier\[dq] -[snip] -Storage> fichier -** See help for fichier backend at: https://rclone.org/fichier/ ** - -Your API Key, get it from https://1fichier.com/console/params.pl -Enter a string value. Press Enter for the default (\[dq]\[dq]). -api_key> example_key - -Edit advanced config? (y/n) -y) Yes -n) No -y/n> -Remote config --------------------- -[remote] -type = fichier -api_key = example_key --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -\f[R] -.fi -.PP -Once configured you can then use \f[C]rclone\f[R] like this, -.PP -List directories in top level of your 1Fichier account -.IP -.nf -\f[C] -rclone lsd remote: -\f[R] -.fi -.PP -List all the files in your 1Fichier account -.IP -.nf -\f[C] -rclone ls remote: -\f[R] -.fi -.PP -To copy a local directory to a 1Fichier directory called backup -.IP -.nf -\f[C] -rclone copy /home/source remote:backup -\f[R] -.fi -.SS Modified time and hashes -.PP -1Fichier does not support modification times. -It supports the Whirlpool hash algorithm. -.SS Duplicated files -.PP -1Fichier can have two files with exactly the same name and path (unlike -a normal file system). -.PP -Duplicated files cause problems with the syncing and you will see -messages in the log about duplicates. -.SS Restricted filename characters -.PP -In addition to the default restricted characters -set (https://rclone.org/overview/#restricted-characters) the following -characters are also replaced: -.PP -.TS -tab(@); -l c c. T{ -Character +Quatrix by Maytech +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes T}@T{ -Value +No T}@T{ -Replacement -T} -_ -T{ -\[rs] +No T}@T{ -0x5C +No T}@T{ -\[uFF3C] -T} -T{ -< +No T}@T{ -0x3C +No T}@T{ -\[uFF1C] +Yes +T}@T{ +Yes T} T{ -> +Seafile T}@T{ -0x3E +Yes T}@T{ -\[uFF1E] -T} -T{ -\[dq] +Yes T}@T{ -0x22 +Yes T}@T{ -\[uFF02] -T} -T{ -$ +Yes T}@T{ -0x24 +Yes T}@T{ -\[uFF04] -T} -T{ -\[ga] +Yes T}@T{ -0x60 +Yes T}@T{ -\[uFF40] -T} -T{ -\[aq] +No T}@T{ -0x27 +Yes T}@T{ -\[uFF07] +Yes +T}@T{ +Yes T} -.TE -.PP -File names can also not start or end with the following characters. -These only get replaced if they are the first or last character in the -name: -.PP -.TS -tab(@); -l c c. T{ -Character +SFTP T}@T{ -Value +No T}@T{ -Replacement +Yes \[u2074] +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes T} -_ T{ -SP +Sia T}@T{ -0x20 +No T}@T{ -\[u2420] +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +Yes T} -.TE -.PP -Invalid UTF-8 bytes will also be -replaced (https://rclone.org/overview/#invalid-utf8), as they can\[aq]t -be used in JSON strings. -.SS Standard options -.PP -Here are the Standard options specific to fichier (1Fichier). -.SS --fichier-api-key -.PP -Your API Key, get it from https://1fichier.com/console/params.pl. -.PP -Properties: -.IP \[bu] 2 -Config: api_key -.IP \[bu] 2 -Env Var: RCLONE_FICHIER_API_KEY -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.SS Advanced options -.PP -Here are the Advanced options specific to fichier (1Fichier). -.SS --fichier-shared-folder -.PP -If you want to download a shared folder, add this parameter. -.PP -Properties: -.IP \[bu] 2 -Config: shared_folder -.IP \[bu] 2 -Env Var: RCLONE_FICHIER_SHARED_FOLDER -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.SS --fichier-file-password -.PP -If you want to download a shared file that is password protected, add -this parameter. -.PP -\f[B]NB\f[R] Input to this must be obscured - see rclone -obscure (https://rclone.org/commands/rclone_obscure/). -.PP -Properties: -.IP \[bu] 2 -Config: file_password -.IP \[bu] 2 -Env Var: RCLONE_FICHIER_FILE_PASSWORD -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.SS --fichier-folder-password -.PP -If you want to list the files in a shared folder that is password -protected, add this parameter. -.PP -\f[B]NB\f[R] Input to this must be obscured - see rclone -obscure (https://rclone.org/commands/rclone_obscure/). -.PP -Properties: -.IP \[bu] 2 -Config: folder_password -.IP \[bu] 2 -Env Var: RCLONE_FICHIER_FOLDER_PASSWORD -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.SS --fichier-cdn -.PP -Set if you wish to use CDN download links. -.PP -Properties: -.IP \[bu] 2 -Config: cdn -.IP \[bu] 2 -Env Var: RCLONE_FICHIER_CDN -.IP \[bu] 2 -Type: bool -.IP \[bu] 2 -Default: false -.SS --fichier-encoding -.PP -The encoding for the backend. -.PP -See the encoding section in the -overview (https://rclone.org/overview/#encoding) for more info. -.PP -Properties: -.IP \[bu] 2 -Config: encoding -.IP \[bu] 2 -Env Var: RCLONE_FICHIER_ENCODING -.IP \[bu] 2 -Type: MultiEncoder -.IP \[bu] 2 -Default: -Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot -.SS Limitations -.PP -\f[C]rclone about\f[R] is not supported by the 1Fichier backend. -Backends without this capability cannot determine free space for an -rclone mount or use policy \f[C]mfs\f[R] (most free space) as a member -of an rclone union remote. -.PP -See List of backends that do not support rclone -about (https://rclone.org/overview/#optional-features) and rclone -about (https://rclone.org/commands/rclone_about/) -.SH Alias -.PP -The \f[C]alias\f[R] remote provides a new name for another remote. -.PP -Paths may be as deep as required or a local path, e.g. -\f[C]remote:directory/subdirectory\f[R] or -\f[C]/directory/subdirectory\f[R]. -.PP -During the initial setup with \f[C]rclone config\f[R] you will specify -the target remote. -The target remote can either be a local path or another remote. -.PP -Subfolders can be used in target remote. -Assume an alias remote named \f[C]backup\f[R] with the target -\f[C]mydrive:private/backup\f[R]. -Invoking \f[C]rclone mkdir backup:desktop\f[R] is exactly the same as -invoking \f[C]rclone mkdir mydrive:private/backup/desktop\f[R]. -.PP -There will be no special handling of paths containing \f[C]..\f[R] -segments. -Invoking \f[C]rclone mkdir backup:../desktop\f[R] is exactly the same as -invoking \f[C]rclone mkdir mydrive:private/backup/../desktop\f[R]. -The empty path is not allowed as a remote. -To alias the current directory use \f[C].\f[R] instead. -.PP -The target remote can also be a connection -string (https://rclone.org/docs/#connection-strings). -This can be used to modify the config of a remote for different uses, -e.g. -the alias \f[C]myDriveTrash\f[R] with the target remote -\f[C]myDrive,trashed_only:\f[R] can be used to only show the trashed -files in \f[C]myDrive\f[R]. -.SS Configuration -.PP -Here is an example of how to make an alias called \f[C]remote\f[R] for -local folder. -First run: -.IP -.nf -\f[C] - rclone config -\f[R] -.fi -.PP -This will guide you through an interactive setup process: -.IP -.nf -\f[C] -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> remote -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Alias for an existing remote - \[rs] \[dq]alias\[dq] -[snip] -Storage> alias -Remote or path to alias. -Can be \[dq]myremote:path/to/dir\[dq], \[dq]myremote:bucket\[dq], \[dq]myremote:\[dq] or \[dq]/local/path\[dq]. -remote> /mnt/storage/backup -Remote config --------------------- -[remote] -remote = /mnt/storage/backup --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -Current remotes: - -Name Type -==== ==== -remote alias - -e) Edit existing remote -n) New remote -d) Delete remote -r) Rename remote -c) Copy remote -s) Set configuration password -q) Quit config -e/n/d/r/c/s/q> q -\f[R] -.fi -.PP -Once configured you can then use \f[C]rclone\f[R] like this, -.PP -List directories in top level in \f[C]/mnt/storage/backup\f[R] -.IP -.nf -\f[C] -rclone lsd remote: -\f[R] -.fi -.PP -List all the files in \f[C]/mnt/storage/backup\f[R] -.IP -.nf -\f[C] -rclone ls remote: -\f[R] -.fi -.PP -Copy another local directory to the alias directory called source -.IP -.nf -\f[C] -rclone copy /home/source remote:source -\f[R] -.fi -.SS Standard options -.PP -Here are the Standard options specific to alias (Alias for an existing -remote). -.SS --alias-remote -.PP -Remote or path to alias. -.PP -Can be \[dq]myremote:path/to/dir\[dq], \[dq]myremote:bucket\[dq], -\[dq]myremote:\[dq] or \[dq]/local/path\[dq]. -.PP -Properties: -.IP \[bu] 2 -Config: remote -.IP \[bu] 2 -Env Var: RCLONE_ALIAS_REMOTE -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: true -.SH Amazon Drive -.PP -Amazon Drive, formerly known as Amazon Cloud Drive, is a cloud storage -service run by Amazon for consumers. -.SS Status -.PP -\f[B]Important:\f[R] rclone supports Amazon Drive only if you have your -own set of API keys. -Unfortunately the Amazon Drive developer -program (https://developer.amazon.com/amazon-drive) is now closed to new -entries so if you don\[aq]t already have your own set of keys you will -not be able to use rclone with Amazon Drive. -.PP -For the history on why rclone no longer has a set of Amazon Drive API -keys see the -forum (https://forum.rclone.org/t/rclone-has-been-banned-from-amazon-drive/2314). -.PP -If you happen to know anyone who works at Amazon then please ask them to -re-instate rclone into the Amazon Drive developer program - thanks! -.SS Configuration -.PP -The initial setup for Amazon Drive involves getting a token from Amazon -which you need to do in your browser. -\f[C]rclone config\f[R] walks you through it. -.PP -The configuration process for Amazon Drive may involve using an oauth -proxy (https://github.com/ncw/oauthproxy). -This is used to keep the Amazon credentials out of the source code. -The proxy runs in Google\[aq]s very secure App Engine environment and -doesn\[aq]t store any credentials which pass through it. -.PP -Since rclone doesn\[aq]t currently have its own Amazon Drive credentials -so you will either need to have your own \f[C]client_id\f[R] and -\f[C]client_secret\f[R] with Amazon Drive, or use a third-party oauth -proxy in which case you will need to enter \f[C]client_id\f[R], -\f[C]client_secret\f[R], \f[C]auth_url\f[R] and \f[C]token_url\f[R]. -.PP -Note also if you are not using Amazon\[aq]s \f[C]auth_url\f[R] and -\f[C]token_url\f[R], (ie you filled in something for those) then if -setting up on a remote machine you can only use the copying the config -method of -configuration (https://rclone.org/remote_setup/#configuring-by-copying-the-config-file) -- \f[C]rclone authorize\f[R] will not work. -.PP -Here is an example of how to make a remote called \f[C]remote\f[R]. -First run: -.IP -.nf -\f[C] - rclone config -\f[R] -.fi -.PP -This will guide you through an interactive setup process: -.IP -.nf -\f[C] -No remotes found, make a new one? -n) New remote -r) Rename remote -c) Copy remote -s) Set configuration password -q) Quit config -n/r/c/s/q> n -name> remote -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Amazon Drive - \[rs] \[dq]amazon cloud drive\[dq] -[snip] -Storage> amazon cloud drive -Amazon Application Client Id - required. -client_id> your client ID goes here -Amazon Application Client Secret - required. -client_secret> your client secret goes here -Auth server URL - leave blank to use Amazon\[aq]s. -auth_url> Optional auth URL -Token server url - leave blank to use Amazon\[aq]s. -token_url> Optional token URL -Remote config -Make sure your Redirect URL is set to \[dq]http://127.0.0.1:53682/\[dq] in your custom config. -Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. -y) Yes -n) No -y/n> y -If your browser doesn\[aq]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 = your client ID goes here -client_secret = your client secret goes here -auth_url = Optional auth URL -token_url = Optional token URL -token = {\[dq]access_token\[dq]:\[dq]xxxxxxxxxxxxxxxxxxxxxxx\[dq],\[dq]token_type\[dq]:\[dq]bearer\[dq],\[dq]refresh_token\[dq]:\[dq]xxxxxxxxxxxxxxxxxx\[dq],\[dq]expiry\[dq]:\[dq]2015-09-06T16:07:39.658438471+01:00\[dq]} --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -\f[R] -.fi -.PP -See the remote setup docs (https://rclone.org/remote_setup/) for how to -set it up on a machine with no Internet browser available. -.PP -Note that rclone runs a webserver on your local machine to collect the -token as returned from Amazon. -This only runs from the moment it opens your browser to the moment you -get back the verification code. -This is on \f[C]http://127.0.0.1:53682/\f[R] and this it may require you -to unblock it temporarily if you are running a host firewall. -.PP -Once configured you can then use \f[C]rclone\f[R] like this, -.PP -List directories in top level of your Amazon Drive -.IP -.nf -\f[C] -rclone lsd remote: -\f[R] -.fi -.PP -List all the files in your Amazon Drive -.IP -.nf -\f[C] -rclone ls remote: -\f[R] -.fi -.PP -To copy a local directory to an Amazon Drive directory called backup -.IP -.nf -\f[C] -rclone copy /home/source remote:backup -\f[R] -.fi -.SS Modified time and MD5SUMs -.PP -Amazon Drive doesn\[aq]t allow modification times to be changed via the -API so these won\[aq]t be accurate or used for syncing. -.PP -It does store MD5SUMs so for a more accurate sync, you can use the -\f[C]--checksum\f[R] flag. -.SS Restricted filename characters -.PP -.TS -tab(@); -l c c. T{ -Character +SMB T}@T{ -Value +No T}@T{ -Replacement +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes T} -_ T{ -NUL +SugarSync T}@T{ -0x00 +Yes T}@T{ -\[u2400] +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +No +T}@T{ +Yes +T}@T{ +No +T}@T{ +Yes T} T{ -/ +Storj T}@T{ -0x2F +Yes \[S2] T}@T{ -\[uFF0F] +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T} +T{ +Uptobox +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T} +T{ +WebDAV +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes \[S3] +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T} +T{ +Yandex Disk +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +Yes +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T} +T{ +Zoho WorkDrive +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T} +T{ +The local filesystem +T}@T{ +Yes +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes +T}@T{ +No +T}@T{ +Yes +T}@T{ +Yes T} .TE .PP -Invalid UTF-8 bytes will also be -replaced (https://rclone.org/overview/#invalid-utf8), as they can\[aq]t -be used in JSON strings. -.SS Deleting files -.PP -Any files you delete with rclone will end up in the trash. -Amazon don\[aq]t provide an API to permanently delete files, nor to -empty the trash, so you will have to do that with one of Amazon\[aq]s -apps or via the Amazon Drive website. -As of November 17, 2016, files are automatically deleted by Amazon from -the trash after 30 days. -.SS Using with non \f[C].com\f[R] Amazon accounts -.PP -Let\[aq]s say you usually use \f[C]amazon.co.uk\f[R]. -When you authenticate with rclone it will take you to an -\f[C]amazon.com\f[R] page to log in. -Your \f[C]amazon.co.uk\f[R] email and password should work here just -fine. -.SS Standard options -.PP -Here are the Standard options specific to amazon cloud drive (Amazon -Drive). -.SS --acd-client-id -.PP -OAuth Client Id. -.PP -Leave blank normally. -.PP -Properties: -.IP \[bu] 2 -Config: client_id -.IP \[bu] 2 -Env Var: RCLONE_ACD_CLIENT_ID -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.SS --acd-client-secret -.PP -OAuth Client Secret. -.PP -Leave blank normally. -.PP -Properties: -.IP \[bu] 2 -Config: client_secret -.IP \[bu] 2 -Env Var: RCLONE_ACD_CLIENT_SECRET -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.SS Advanced options -.PP -Here are the Advanced options specific to amazon cloud drive (Amazon -Drive). -.SS --acd-token -.PP -OAuth Access Token as a JSON blob. -.PP -Properties: -.IP \[bu] 2 -Config: token -.IP \[bu] 2 -Env Var: RCLONE_ACD_TOKEN -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.SS --acd-auth-url -.PP -Auth server URL. -.PP -Leave blank to use the provider defaults. +\[S1] Note Swift implements this in order to delete directory markers +but it doesn\[aq]t actually have a quicker way of deleting files other +than deleting them individually. .PP -Properties: -.IP \[bu] 2 -Config: auth_url -.IP \[bu] 2 -Env Var: RCLONE_ACD_AUTH_URL -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.SS --acd-token-url +\[S2] Storj implements this efficiently only for entire buckets. +If purging a directory inside a bucket, files are deleted individually. .PP -Token server url. +\[S3] StreamUpload is not supported with Nextcloud .PP -Leave blank to use the provider defaults. +\[u2074] Use the \f[C]--sftp-copy-is-hardlink\f[R] flag to enable. .PP -Properties: -.IP \[bu] 2 -Config: token_url -.IP \[bu] 2 -Env Var: RCLONE_ACD_TOKEN_URL -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.SS --acd-checkpoint +\[u2075] Use the \f[C]--onedrive-delta\f[R] flag to enable. +.SS Purge .PP -Checkpoint for internal polling (debug). +This deletes a directory quicker than just deleting all the files in the +directory. +.SS Copy .PP -Properties: -.IP \[bu] 2 -Config: checkpoint -.IP \[bu] 2 -Env Var: RCLONE_ACD_CHECKPOINT -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.SS --acd-upload-wait-per-gb +Used when copying an object to and from the same remote. +This known as a server-side copy so you can copy a file without +downloading it and uploading it again. +It is used if you use \f[C]rclone copy\f[R] or \f[C]rclone move\f[R] if +the remote doesn\[aq]t support \f[C]Move\f[R] directly. .PP -Additional time per GiB to wait after a failed complete upload to see if -it appears. +If the server doesn\[aq]t support \f[C]Copy\f[R] directly then for copy +operations the file is downloaded then re-uploaded. +.SS Move .PP -Sometimes Amazon Drive gives an error when a file has been fully -uploaded but the file appears anyway after a little while. -This happens sometimes for files over 1 GiB in size and nearly every -time for files bigger than 10 GiB. -This parameter controls the time rclone waits for the file to appear. +Used when moving/renaming an object on the same remote. +This is known as a server-side move of a file. +This is used in \f[C]rclone move\f[R] if the server doesn\[aq]t support +\f[C]DirMove\f[R]. .PP -The default value for this parameter is 3 minutes per GiB, so by default -it will wait 3 minutes for every GiB uploaded to see if the file -appears. +If the server isn\[aq]t capable of \f[C]Move\f[R] then rclone simulates +it with \f[C]Copy\f[R] then delete. +If the server doesn\[aq]t support \f[C]Copy\f[R] then rclone will +download the file and re-upload it. +.SS DirMove .PP -You can disable this feature by setting it to 0. -This may cause conflict errors as rclone retries the failed upload but -the file will most likely appear correctly eventually. +This is used to implement \f[C]rclone move\f[R] to move a directory if +possible. +If it isn\[aq]t then it will use \f[C]Move\f[R] on each file (which +falls back to \f[C]Copy\f[R] then download and upload - see +\f[C]Move\f[R] section). +.SS CleanUp .PP -These values were determined empirically by observing lots of uploads of -big files for a range of file sizes. +This is used for emptying the trash for a remote by +\f[C]rclone cleanup\f[R]. .PP -Upload with the \[dq]-v\[dq] flag to see more info about what rclone is -doing in this situation. +If the server can\[aq]t do \f[C]CleanUp\f[R] then +\f[C]rclone cleanup\f[R] will return an error. .PP -Properties: -.IP \[bu] 2 -Config: upload_wait_per_gb -.IP \[bu] 2 -Env Var: RCLONE_ACD_UPLOAD_WAIT_PER_GB -.IP \[bu] 2 -Type: Duration -.IP \[bu] 2 -Default: 3m0s -.SS --acd-templink-threshold +\[dd]\[dd] Note that while Box implements this it has to delete every +file individually so it will be slower than emptying the trash via the +WebUI +.SS ListR .PP -Files >= this size will be downloaded via their tempLink. +The remote supports a recursive list to list all the contents beneath a +directory quickly. +This enables the \f[C]--fast-list\f[R] flag to work. +See the rclone docs (https://rclone.org/docs/#fast-list) for more +details. +.SS StreamUpload .PP -Files this size or more will be downloaded via their \[dq]tempLink\[dq]. -This is to work around a problem with Amazon Drive which blocks -downloads of files bigger than about 10 GiB. -The default for this is 9 GiB which shouldn\[aq]t need to be changed. +Some remotes allow files to be uploaded without knowing the file size in +advance. +This allows certain operations to work without spooling the file to +local disk first, e.g. +\f[C]rclone rcat\f[R]. +.SS MultithreadUpload .PP -To download files above this threshold, rclone requests a -\[dq]tempLink\[dq] which downloads the file through a temporary URL -directly from the underlying S3 storage. +Some remotes allow transfers to the remote to be sent as chunks in +parallel. +If this is supported then rclone will use multi-thread copying to +transfer files much faster. +.SS LinkSharing .PP -Properties: -.IP \[bu] 2 -Config: templink_threshold -.IP \[bu] 2 -Env Var: RCLONE_ACD_TEMPLINK_THRESHOLD -.IP \[bu] 2 -Type: SizeSuffix -.IP \[bu] 2 -Default: 9Gi -.SS --acd-encoding +Sets the necessary permissions on a file or folder and prints a link +that allows others to access them, even if they don\[aq]t have an +account on the particular cloud provider. +.SS About .PP -The encoding for the backend. +Rclone \f[C]about\f[R] prints quota information for a remote. +Typical output includes bytes used, free, quota and in trash. .PP -See the encoding section in the -overview (https://rclone.org/overview/#encoding) for more info. +If a remote lacks about capability \f[C]rclone about remote:\f[R]returns +an error. .PP -Properties: -.IP \[bu] 2 -Config: encoding -.IP \[bu] 2 -Env Var: RCLONE_ACD_ENCODING -.IP \[bu] 2 -Type: MultiEncoder -.IP \[bu] 2 -Default: Slash,InvalidUtf8,Dot -.SS Limitations +Backends without about capability cannot determine free space for an +rclone mount, or use policy \f[C]mfs\f[R] (most free space) as a member +of an rclone union remote. .PP -Note that Amazon Drive is case insensitive so you can\[aq]t have a file -called \[dq]Hello.doc\[dq] and one called \[dq]hello.doc\[dq]. +See rclone about command (https://rclone.org/commands/rclone_about/) +.SS EmptyDir .PP -Amazon Drive has rate limiting so you may notice errors in the sync (429 -errors). -rclone will automatically retry the sync up to 3 times by default (see -\f[C]--retries\f[R] flag) which should hopefully work around this -problem. +The remote supports empty directories. +See Limitations (https://rclone.org/bugs/#limitations) for details. +Most Object/Bucket-based remotes do not support this. +.SH Global Flags .PP -Amazon Drive has an internal limit of file sizes that can be uploaded to -the service. -This limit is not officially published, but all files larger than this -will fail. +This describes the global flags available to every rclone command split +into groups. +.SS Copy .PP -At the time of writing (Jan 2016) is in the area of 50 GiB per file. -This means that larger files are likely to fail. +Flags for anything which can Copy a file. +.IP +.nf +\f[C] + --check-first Do all the checks before starting transfers + -c, --checksum Check for changes with size & checksum (if available, or fallback to size only). + --compare-dest stringArray Include additional comma separated server-side paths during comparison + --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination + --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD) + --ignore-case-sync Ignore case when synchronizing + --ignore-checksum Skip post copy check of checksums + --ignore-existing Skip all files that exist on destination + --ignore-size Ignore size when skipping use modtime or checksum + -I, --ignore-times Don\[aq]t skip files that match size and time - transfer all files + --immutable Do not modify files, fail if existing files have been modified + --inplace Download directly to destination file instead of atomic download to temp/rename + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) + --max-duration Duration Maximum duration rclone will transfer data for (default 0s) + --max-transfer SizeSuffix Maximum size of data to transfer (default off) + -M, --metadata If set, preserve metadata when copying objects + --modify-window Duration Max time diff to be considered the same (default 1ns) + --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi) + --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi) + --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4) + --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki) + --no-check-dest Don\[aq]t check the destination, copy regardless + --no-traverse Don\[aq]t traverse destination file system on copy + --no-update-modtime Don\[aq]t update destination modtime if files identical + --order-by string Instructions on how to order the transfers, e.g. \[aq]size,descending\[aq] + --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default \[dq].partial\[dq]) + --refresh-times Refresh the modtime of remote files + --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs + --size-only Skip based on size only, not modtime or checksum + --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki) + -u, --update Skip files that are newer on the destination +\f[R] +.fi +.SS Sync .PP -Unfortunately there is no way for rclone to see that this failure is -because of file size, so it will retry the operation, as any other -failure. -To avoid this problem, use \f[C]--max-size 50000M\f[R] option to limit -the maximum size of uploaded files. -Note that \f[C]--max-size\f[R] does not split files into segments, it -only ignores files over this size. +Flags just used for \f[C]rclone sync\f[R]. +.IP +.nf +\f[C] + --backup-dir string Make backups into hierarchy based in DIR + --delete-after When synchronizing, delete files on destination after transferring (default) + --delete-before When synchronizing, delete files on destination before transferring + --delete-during When synchronizing, delete files during transfer + --ignore-errors Delete even if there are I/O errors + --max-delete int When synchronizing, limit the number of deletes (default -1) + --max-delete-size SizeSuffix When synchronizing, limit the total size of deletes (default off) + --suffix string Suffix to add to changed files + --suffix-keep-extension Preserve the extension when using --suffix + --track-renames When synchronizing, track file renames and do a server-side move if possible + --track-renames-strategy string Strategies to use when synchronizing using track-renames hash|modtime|leaf (default \[dq]hash\[dq]) +\f[R] +.fi +.SS Important .PP -\f[C]rclone about\f[R] is not supported by the Amazon Drive backend. -Backends without this capability cannot determine free space for an -rclone mount or use policy \f[C]mfs\f[R] (most free space) as a member -of an rclone union remote. +Important flags useful for most commands. +.IP +.nf +\f[C] + -n, --dry-run Do a trial run with no permanent changes + -i, --interactive Enable interactive mode + -v, --verbose count Print lots more stuff (repeat for more) +\f[R] +.fi +.SS Check .PP -See List of backends that do not support rclone -about (https://rclone.org/overview/#optional-features) and rclone -about (https://rclone.org/commands/rclone_about/) -.SH Amazon S3 Storage Providers +Flags used for \f[C]rclone check\f[R]. +.IP +.nf +\f[C] + --max-backlog int Maximum number of objects in sync or check backlog (default 10000) +\f[R] +.fi +.SS Networking .PP -The S3 backend can be used with a number of different providers: -.IP \[bu] 2 -AWS S3 -.IP \[bu] 2 -Alibaba Cloud (Aliyun) Object Storage System (OSS) -.IP \[bu] 2 -Ceph -.IP \[bu] 2 -China Mobile Ecloud Elastic Object Storage (EOS) -.IP \[bu] 2 -Cloudflare R2 -.IP \[bu] 2 -Arvan Cloud Object Storage (AOS) -.IP \[bu] 2 -DigitalOcean Spaces -.IP \[bu] 2 -Dreamhost -.IP \[bu] 2 -GCS -.IP \[bu] 2 -Huawei OBS -.IP \[bu] 2 -IBM COS S3 -.IP \[bu] 2 -IDrive e2 -.IP \[bu] 2 -IONOS Cloud -.IP \[bu] 2 -Leviia Object Storage -.IP \[bu] 2 -Liara Object Storage -.IP \[bu] 2 -Minio -.IP \[bu] 2 -Petabox -.IP \[bu] 2 -Qiniu Cloud Object Storage (Kodo) -.IP \[bu] 2 -RackCorp Object Storage -.IP \[bu] 2 -Scaleway -.IP \[bu] 2 -Seagate Lyve Cloud -.IP \[bu] 2 -SeaweedFS -.IP \[bu] 2 -StackPath -.IP \[bu] 2 -Storj -.IP \[bu] 2 -Synology C2 Object Storage -.IP \[bu] 2 -Tencent Cloud Object Storage (COS) -.IP \[bu] 2 -Wasabi +General networking and HTTP stuff. +.IP +.nf +\f[C] + --bind string Local address to bind to for outgoing connections, IPv4, IPv6 or name + --bwlimit BwTimetable Bandwidth limit in KiB/s, or use suffix B|K|M|G|T|P or a full timetable + --bwlimit-file BwTimetable Bandwidth limit per file in KiB/s, or use suffix B|K|M|G|T|P or a full timetable + --ca-cert stringArray CA certificate used to verify servers + --client-cert string Client SSL certificate (PEM) for mutual TLS auth + --client-key string Client SSL private key (PEM) for mutual TLS auth + --contimeout Duration Connect timeout (default 1m0s) + --disable-http-keep-alives Disable HTTP keep-alives and use each connection once. + --disable-http2 Disable HTTP/2 in the global transport + --dscp string Set DSCP value to connections, value or name, e.g. CS1, LE, DF, AF21 + --expect-continue-timeout Duration Timeout when using expect / 100-continue in HTTP (default 1s) + --header stringArray Set HTTP header for all transactions + --header-download stringArray Set HTTP header for download transactions + --header-upload stringArray Set HTTP header for upload transactions + --no-check-certificate Do not verify the server SSL certificate (insecure) + --no-gzip-encoding Don\[aq]t set Accept-Encoding: gzip + --timeout Duration IO idle timeout (default 5m0s) + --tpslimit float Limit HTTP transactions per second to this + --tpslimit-burst int Max burst of transactions for --tpslimit (default 1) + --use-cookies Enable session cookiejar + --user-agent string Set the user-agent to a specified string (default \[dq]rclone/v1.65.0\[dq]) +\f[R] +.fi +.SS Performance .PP -Paths are specified as \f[C]remote:bucket\f[R] (or \f[C]remote:\f[R] for -the \f[C]lsd\f[R] command.) You may put subdirectories in too, e.g. -\f[C]remote:bucket/path/to/dir\f[R]. +Flags helpful for increasing performance. +.IP +.nf +\f[C] + --buffer-size SizeSuffix In memory buffer size when reading files for each --transfer (default 16Mi) + --checkers int Number of checkers to run in parallel (default 8) + --transfers int Number of file transfers to run in parallel (default 4) +\f[R] +.fi +.SS Config .PP -Once you have made a remote (see the provider specific section above) -you can use it like this: +General configuration of rclone. +.IP +.nf +\f[C] + --ask-password Allow prompt for password for encrypted configuration (default true) + --auto-confirm If enabled, do not request console confirmation + --cache-dir string Directory rclone will use for caching (default \[dq]$HOME/.cache/rclone\[dq]) + --color AUTO|NEVER|ALWAYS When to show colors (and other ANSI codes) AUTO|NEVER|ALWAYS (default AUTO) + --config string Config file (default \[dq]$HOME/.config/rclone/rclone.conf\[dq]) + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --disable string Disable a comma separated list of features (use --disable help to see a list) + -n, --dry-run Do a trial run with no permanent changes + --error-on-no-transfer Sets exit code 9 if no files are transferred, useful in scripts + --fs-cache-expire-duration Duration Cache remotes for this long (0 to disable caching) (default 5m0s) + --fs-cache-expire-interval Duration Interval to check for expired remotes (default 1m0s) + --human-readable Print numbers in a human-readable format, sizes with suffix Ki|Mi|Gi|Ti|Pi + -i, --interactive Enable interactive mode + --kv-lock-time Duration Maximum time to keep key-value database locked by process (default 1s) + --low-level-retries int Number of low level retries to do (default 10) + --no-console Hide console window (supported on Windows only) + --no-unicode-normalization Don\[aq]t normalize unicode characters in filenames + --password-command SpaceSepList Command for supplying password for encrypted configuration + --retries int Retry operations this many times if they fail (default 3) + --retries-sleep Duration Interval between retrying operations if they fail, e.g. 500ms, 60s, 5m (0 to disable) (default 0s) + --temp-dir string Directory rclone will use for temporary files (default \[dq]/tmp\[dq]) + --use-mmap Use mmap allocator (see docs) + --use-server-modtime Use server modified time instead of object metadata +\f[R] +.fi +.SS Debugging .PP -See all buckets +Flags for developers. .IP .nf \f[C] -rclone lsd remote: + --cpuprofile string Write cpu profile to file + --dump DumpFlags List of items to dump from: headers, bodies, requests, responses, auth, filters, goroutines, openfiles, mapper + --dump-bodies Dump HTTP headers and bodies - may contain sensitive info + --dump-headers Dump HTTP headers - may contain sensitive info + --memprofile string Write memory profile to file \f[R] .fi +.SS Filter .PP -Make a new bucket +Flags for filtering directory listings. .IP .nf \f[C] -rclone mkdir remote:bucket + --delete-excluded Delete files on dest excluded from sync + --exclude stringArray Exclude files matching pattern + --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin) + --exclude-if-present stringArray Exclude directories if filename is present + --files-from stringArray Read list of source-file names from file (use - to read from stdin) + --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin) + -f, --filter stringArray Add a file filtering rule + --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin) + --ignore-case Ignore case in filters (case insensitive) + --include stringArray Include files matching pattern + --include-from stringArray Read file include patterns from file (use - to read from stdin) + --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --max-depth int If set limits the recursion depth to this (default -1) + --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off) + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off) + --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off) \f[R] .fi +.SS Listing .PP -List the contents of a bucket +Flags for listing directories. .IP .nf \f[C] -rclone ls remote:bucket + --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z) + --fast-list Use recursive list if available; uses more memory but fewer transactions \f[R] .fi +.SS Logging .PP -Sync \f[C]/home/local/directory\f[R] to the remote bucket, deleting any -excess files in the bucket. +Logging and statistics. .IP .nf \f[C] -rclone sync --interactive /home/local/directory remote:bucket + --log-file string Log everything to this file + --log-format string Comma separated list of log format options (default \[dq]date,time\[dq]) + --log-level LogLevel Log level DEBUG|INFO|NOTICE|ERROR (default NOTICE) + --log-systemd Activate systemd integration for the logger + --max-stats-groups int Maximum number of stats groups to keep in memory, on max oldest is discarded (default 1000) + -P, --progress Show progress during transfer + --progress-terminal-title Show progress on the terminal title (requires -P/--progress) + -q, --quiet Print as little stuff as possible + --stats Duration Interval between printing stats, e.g. 500ms, 60s, 5m (0 to disable) (default 1m0s) + --stats-file-name-length int Max file name length in stats (0 for no limit) (default 45) + --stats-log-level LogLevel Log level to show --stats output DEBUG|INFO|NOTICE|ERROR (default INFO) + --stats-one-line Make the stats fit on one line + --stats-one-line-date Enable --stats-one-line and add current date/time prefix + --stats-one-line-date-format string Enable --stats-one-line-date and use custom formatted date: Enclose date string in double quotes (\[dq]), see https://golang.org/pkg/time/#Time.Format + --stats-unit string Show data rate in stats as either \[aq]bits\[aq] or \[aq]bytes\[aq] per second (default \[dq]bytes\[dq]) + --syslog Use Syslog for logging + --syslog-facility string Facility for syslog, e.g. KERN,USER,... (default \[dq]DAEMON\[dq]) + --use-json-log Use json log format + -v, --verbose count Print lots more stuff (repeat for more) \f[R] .fi -.SS Configuration +.SS Metadata .PP -Here is an example of making an s3 configuration for the AWS S3 -provider. -Most applies to the other providers as well, any differences are -described below. +Flags to control metadata. +.IP +.nf +\f[C] + -M, --metadata If set, preserve metadata when copying objects + --metadata-exclude stringArray Exclude metadatas matching pattern + --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin) + --metadata-filter stringArray Add a metadata filtering rule + --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin) + --metadata-include stringArray Include metadatas matching pattern + --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin) + --metadata-mapper SpaceSepList Program to run to transforming metadata before upload + --metadata-set stringArray Add metadata key=value when uploading +\f[R] +.fi +.SS RC .PP -First run +Flags to control the Remote Control API. .IP .nf \f[C] -rclone config + --rc Enable the remote control server + --rc-addr stringArray IPaddress:Port or :Port to bind server to (default [localhost:5572]) + --rc-allow-origin string Origin which cross-domain request (CORS) can be executed from + --rc-baseurl string Prefix for URLs - leave blank for root + --rc-cert string TLS PEM key (concatenation of certificate and CA certificate) + --rc-client-ca string Client certificate authority to verify clients with + --rc-enable-metrics Enable prometheus metrics on /metrics + --rc-files string Path to local files to serve on the HTTP server + --rc-htpasswd string A htpasswd file - if not provided no authentication is done + --rc-job-expire-duration Duration Expire finished async jobs older than this value (default 1m0s) + --rc-job-expire-interval Duration Interval to check for expired async jobs (default 10s) + --rc-key string TLS PEM Private key + --rc-max-header-bytes int Maximum size of request header (default 4096) + --rc-min-tls-version string Minimum TLS version that is acceptable (default \[dq]tls1.0\[dq]) + --rc-no-auth Don\[aq]t require auth for certain methods + --rc-pass string Password for authentication + --rc-realm string Realm for authentication + --rc-salt string Password hashing salt (default \[dq]dlPL2MqE\[dq]) + --rc-serve Enable the serving of remote objects + --rc-server-read-timeout Duration Timeout for server reading data (default 1h0m0s) + --rc-server-write-timeout Duration Timeout for server writing data (default 1h0m0s) + --rc-template string User-specified template + --rc-user string User name for authentication + --rc-web-fetch-url string URL to fetch the releases for webgui (default \[dq]https://api.github.com/repos/rclone/rclone-webui-react/releases/latest\[dq]) + --rc-web-gui Launch WebGUI on localhost + --rc-web-gui-force-update Force update to latest version of web gui + --rc-web-gui-no-open-browser Don\[aq]t open the browser automatically + --rc-web-gui-update Check and update to latest version of web gui \f[R] .fi +.SS Backend .PP -This will guide you through an interactive setup process. +Backend only flags. +These can be set in the config file also. .IP .nf \f[C] -No remotes found, make a new one? -n) New remote -s) Set configuration password -q) Quit config -n/s/q> n -name> remote -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Amazon S3 Compliant Storage Providers including AWS, Ceph, ChinaMobile, ArvanCloud, Dreamhost, IBM COS, Liara, Minio, and Tencent COS - \[rs] \[dq]s3\[dq] -[snip] -Storage> s3 -Choose your S3 provider. -Choose a number from below, or type in your own value - 1 / Amazon Web Services (AWS) S3 - \[rs] \[dq]AWS\[dq] - 2 / Ceph Object Storage - \[rs] \[dq]Ceph\[dq] - 3 / DigitalOcean Spaces - \[rs] \[dq]DigitalOcean\[dq] - 4 / Dreamhost DreamObjects - \[rs] \[dq]Dreamhost\[dq] - 5 / IBM COS S3 - \[rs] \[dq]IBMCOS\[dq] - 6 / Minio Object Storage - \[rs] \[dq]Minio\[dq] - 7 / Wasabi Object Storage - \[rs] \[dq]Wasabi\[dq] - 8 / Any other S3 compatible provider - \[rs] \[dq]Other\[dq] -provider> 1 -Get AWS credentials from runtime (environment variables or EC2/ECS 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 - \[rs] \[dq]false\[dq] - 2 / Get AWS credentials from the environment (env vars or IAM) - \[rs] \[dq]true\[dq] -env_auth> 1 -AWS Access Key ID - leave blank for anonymous access or runtime credentials. -access_key_id> XXX -AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. -secret_access_key> YYY -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. - \[rs] \[dq]us-east-1\[dq] - / US East (Ohio) Region - 2 | Needs location constraint us-east-2. - \[rs] \[dq]us-east-2\[dq] - / US West (Oregon) Region - 3 | Needs location constraint us-west-2. - \[rs] \[dq]us-west-2\[dq] - / US West (Northern California) Region - 4 | Needs location constraint us-west-1. - \[rs] \[dq]us-west-1\[dq] - / Canada (Central) Region - 5 | Needs location constraint ca-central-1. - \[rs] \[dq]ca-central-1\[dq] - / EU (Ireland) Region - 6 | Needs location constraint EU or eu-west-1. - \[rs] \[dq]eu-west-1\[dq] - / EU (London) Region - 7 | Needs location constraint eu-west-2. - \[rs] \[dq]eu-west-2\[dq] - / EU (Frankfurt) Region - 8 | Needs location constraint eu-central-1. - \[rs] \[dq]eu-central-1\[dq] - / Asia Pacific (Singapore) Region - 9 | Needs location constraint ap-southeast-1. - \[rs] \[dq]ap-southeast-1\[dq] - / Asia Pacific (Sydney) Region -10 | Needs location constraint ap-southeast-2. - \[rs] \[dq]ap-southeast-2\[dq] - / Asia Pacific (Tokyo) Region -11 | Needs location constraint ap-northeast-1. - \[rs] \[dq]ap-northeast-1\[dq] - / Asia Pacific (Seoul) -12 | Needs location constraint ap-northeast-2. - \[rs] \[dq]ap-northeast-2\[dq] - / Asia Pacific (Mumbai) -13 | Needs location constraint ap-south-1. - \[rs] \[dq]ap-south-1\[dq] - / Asia Pacific (Hong Kong) Region -14 | Needs location constraint ap-east-1. - \[rs] \[dq]ap-east-1\[dq] - / South America (Sao Paulo) Region -15 | Needs location constraint sa-east-1. - \[rs] \[dq]sa-east-1\[dq] -region> 1 -Endpoint for S3 API. -Leave blank if using AWS to use the default endpoint for the region. -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. - \[rs] \[dq]\[dq] - 2 / US East (Ohio) Region. - \[rs] \[dq]us-east-2\[dq] - 3 / US West (Oregon) Region. - \[rs] \[dq]us-west-2\[dq] - 4 / US West (Northern California) Region. - \[rs] \[dq]us-west-1\[dq] - 5 / Canada (Central) Region. - \[rs] \[dq]ca-central-1\[dq] - 6 / EU (Ireland) Region. - \[rs] \[dq]eu-west-1\[dq] - 7 / EU (London) Region. - \[rs] \[dq]eu-west-2\[dq] - 8 / EU Region. - \[rs] \[dq]EU\[dq] - 9 / Asia Pacific (Singapore) Region. - \[rs] \[dq]ap-southeast-1\[dq] -10 / Asia Pacific (Sydney) Region. - \[rs] \[dq]ap-southeast-2\[dq] -11 / Asia Pacific (Tokyo) Region. - \[rs] \[dq]ap-northeast-1\[dq] -12 / Asia Pacific (Seoul) - \[rs] \[dq]ap-northeast-2\[dq] -13 / Asia Pacific (Mumbai) - \[rs] \[dq]ap-south-1\[dq] -14 / Asia Pacific (Hong Kong) - \[rs] \[dq]ap-east-1\[dq] -15 / South America (Sao Paulo) Region. - \[rs] \[dq]sa-east-1\[dq] -location_constraint> 1 -Canned ACL used when creating buckets and/or storing objects in S3. -For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl -Choose a number from below, or type in your own value - 1 / Owner gets FULL_CONTROL. No one else has access rights (default). - \[rs] \[dq]private\[dq] - 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access. - \[rs] \[dq]public-read\[dq] - / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. - 3 | Granting this on a bucket is generally not recommended. - \[rs] \[dq]public-read-write\[dq] - 4 / Owner gets FULL_CONTROL. The AuthenticatedUsers group gets READ access. - \[rs] \[dq]authenticated-read\[dq] - / Object owner gets FULL_CONTROL. Bucket owner gets READ access. - 5 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. - \[rs] \[dq]bucket-owner-read\[dq] - / Both the object owner and the bucket owner get FULL_CONTROL over the object. - 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. - \[rs] \[dq]bucket-owner-full-control\[dq] -acl> 1 -The server-side encryption algorithm used when storing this object in S3. -Choose a number from below, or type in your own value - 1 / None - \[rs] \[dq]\[dq] - 2 / AES256 - \[rs] \[dq]AES256\[dq] -server_side_encryption> 1 -The storage class to use when storing objects in S3. -Choose a number from below, or type in your own value - 1 / Default - \[rs] \[dq]\[dq] - 2 / Standard storage class - \[rs] \[dq]STANDARD\[dq] - 3 / Reduced redundancy storage class - \[rs] \[dq]REDUCED_REDUNDANCY\[dq] - 4 / Standard Infrequent Access storage class - \[rs] \[dq]STANDARD_IA\[dq] - 5 / One Zone Infrequent Access storage class - \[rs] \[dq]ONEZONE_IA\[dq] - 6 / Glacier storage class - \[rs] \[dq]GLACIER\[dq] - 7 / Glacier Deep Archive storage class - \[rs] \[dq]DEEP_ARCHIVE\[dq] - 8 / Intelligent-Tiering storage class - \[rs] \[dq]INTELLIGENT_TIERING\[dq] - 9 / Glacier Instant Retrieval storage class - \[rs] \[dq]GLACIER_IR\[dq] -storage_class> 1 -Remote config --------------------- -[remote] -type = s3 -provider = AWS -env_auth = false -access_key_id = XXX -secret_access_key = YYY -region = us-east-1 -endpoint = -location_constraint = -acl = private -server_side_encryption = -storage_class = --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> + --acd-auth-url string Auth server URL + --acd-client-id string OAuth Client Id + --acd-client-secret string OAuth Client Secret + --acd-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --acd-templink-threshold SizeSuffix Files >= this size will be downloaded via their tempLink (default 9Gi) + --acd-token string OAuth Access Token as a JSON blob + --acd-token-url string Token server url + --acd-upload-wait-per-gb Duration Additional time per GiB to wait after a failed complete upload to see if it appears (default 3m0s) + --alias-remote string Remote or path to alias + --azureblob-access-tier string Access tier of blob: hot, cool, cold or archive + --azureblob-account string Azure Storage Account Name + --azureblob-archive-tier-delete Delete archive tier blobs before overwriting + --azureblob-chunk-size SizeSuffix Upload chunk size (default 4Mi) + --azureblob-client-certificate-password string Password for the certificate file (optional) (obscured) + --azureblob-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key + --azureblob-client-id string The ID of the client in use + --azureblob-client-secret string One of the service principal\[aq]s client secrets + --azureblob-client-send-certificate-chain Send the certificate chain when using certificate auth + --azureblob-directory-markers Upload an empty object with a trailing slash when a new directory is created + --azureblob-disable-checksum Don\[aq]t store MD5 checksum with object metadata + --azureblob-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8) + --azureblob-endpoint string Endpoint for the service + --azureblob-env-auth Read credentials from runtime (environment variables, CLI or MSI) + --azureblob-key string Storage Account Shared Key + --azureblob-list-chunk int Size of blob list (default 5000) + --azureblob-msi-client-id string Object ID of the user-assigned MSI to use, if any + --azureblob-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any + --azureblob-msi-object-id string Object ID of the user-assigned MSI to use, if any + --azureblob-no-check-container If set, don\[aq]t attempt to check the container exists or create it + --azureblob-no-head-object If set, do not do HEAD before GET when getting objects + --azureblob-password string The user\[aq]s password (obscured) + --azureblob-public-access string Public access level of a container: blob or container + --azureblob-sas-url string SAS URL for container level access only + --azureblob-service-principal-file string Path to file containing credentials for use with a service principal + --azureblob-tenant string ID of the service principal\[aq]s tenant. Also called its directory ID + --azureblob-upload-concurrency int Concurrency for multipart uploads (default 16) + --azureblob-upload-cutoff string Cutoff for switching to chunked upload (<= 256 MiB) (deprecated) + --azureblob-use-emulator Uses local storage emulator if provided as \[aq]true\[aq] + --azureblob-use-msi Use a managed service identity to authenticate (only works in Azure) + --azureblob-username string User name (usually an email address) + --azurefiles-account string Azure Storage Account Name + --azurefiles-chunk-size SizeSuffix Upload chunk size (default 4Mi) + --azurefiles-client-certificate-password string Password for the certificate file (optional) (obscured) + --azurefiles-client-certificate-path string Path to a PEM or PKCS12 certificate file including the private key + --azurefiles-client-id string The ID of the client in use + --azurefiles-client-secret string One of the service principal\[aq]s client secrets + --azurefiles-client-send-certificate-chain Send the certificate chain when using certificate auth + --azurefiles-connection-string string Azure Files Connection String + --azurefiles-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8,Dot) + --azurefiles-endpoint string Endpoint for the service + --azurefiles-env-auth Read credentials from runtime (environment variables, CLI or MSI) + --azurefiles-key string Storage Account Shared Key + --azurefiles-max-stream-size SizeSuffix Max size for streamed files (default 10Gi) + --azurefiles-msi-client-id string Object ID of the user-assigned MSI to use, if any + --azurefiles-msi-mi-res-id string Azure resource ID of the user-assigned MSI to use, if any + --azurefiles-msi-object-id string Object ID of the user-assigned MSI to use, if any + --azurefiles-password string The user\[aq]s password (obscured) + --azurefiles-sas-url string SAS URL + --azurefiles-service-principal-file string Path to file containing credentials for use with a service principal + --azurefiles-share-name string Azure Files Share Name + --azurefiles-tenant string ID of the service principal\[aq]s tenant. Also called its directory ID + --azurefiles-upload-concurrency int Concurrency for multipart uploads (default 16) + --azurefiles-use-msi Use a managed service identity to authenticate (only works in Azure) + --azurefiles-username string User name (usually an email address) + --b2-account string Account ID or Application Key ID + --b2-chunk-size SizeSuffix Upload chunk size (default 96Mi) + --b2-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4Gi) + --b2-disable-checksum Disable checksums for large (> upload cutoff) files + --b2-download-auth-duration Duration Time before the authorization token will expire in s or suffix ms|s|m|h|d (default 1w) + --b2-download-url string Custom endpoint for downloads + --b2-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --b2-endpoint string Endpoint for the service + --b2-hard-delete Permanently delete files on remote removal, otherwise hide files + --b2-key string Application Key + --b2-lifecycle int Set the number of days deleted files should be kept when creating a bucket + --b2-test-mode string A flag string for X-Bz-Test-Mode header for debugging + --b2-upload-concurrency int Concurrency for multipart uploads (default 4) + --b2-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --b2-version-at Time Show file versions as they were at the specified time (default off) + --b2-versions Include old versions in directory listings + --box-access-token string Box App Primary Access Token + --box-auth-url string Auth server URL + --box-box-config-file string Box App config.json location + --box-box-sub-type string (default \[dq]user\[dq]) + --box-client-id string OAuth Client Id + --box-client-secret string OAuth Client Secret + --box-commit-retries int Max number of times to try committing a multipart file (default 100) + --box-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot) + --box-impersonate string Impersonate this user ID when using a service account + --box-list-chunk int Size of listing chunk 1-1000 (default 1000) + --box-owned-by string Only show items owned by the login (email address) passed in + --box-root-folder-id string Fill in for rclone to use a non root folder as its starting point + --box-token string OAuth Access Token as a JSON blob + --box-token-url string Token server url + --box-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (>= 50 MiB) (default 50Mi) + --cache-chunk-clean-interval Duration How often should the cache perform cleanups of the chunk storage (default 1m0s) + --cache-chunk-no-memory Disable the in-memory cache for storing chunks during streaming + --cache-chunk-path string Directory to cache chunk files (default \[dq]$HOME/.cache/rclone/cache-backend\[dq]) + --cache-chunk-size SizeSuffix The size of a chunk (partial file data) (default 5Mi) + --cache-chunk-total-size SizeSuffix The total size that the chunks can take up on the local disk (default 10Gi) + --cache-db-path string Directory to store file structure metadata DB (default \[dq]$HOME/.cache/rclone/cache-backend\[dq]) + --cache-db-purge Clear all the cached data for this remote on start + --cache-db-wait-time Duration How long to wait for the DB to be available - 0 is unlimited (default 1s) + --cache-info-age Duration How long to cache file structure information (directory listings, file size, times, etc.) (default 6h0m0s) + --cache-plex-insecure string Skip all certificate verification when connecting to the Plex server + --cache-plex-password string The password of the Plex user (obscured) + --cache-plex-url string The URL of the Plex server + --cache-plex-username string The username of the Plex user + --cache-read-retries int How many times to retry a read from a cache storage (default 10) + --cache-remote string Remote to cache + --cache-rps int Limits the number of requests per second to the source FS (-1 to disable) (default -1) + --cache-tmp-upload-path string Directory to keep temporary files until they are uploaded + --cache-tmp-wait-time Duration How long should files be stored in local cache before being uploaded (default 15s) + --cache-workers int How many workers should run in parallel to download chunks (default 4) + --cache-writes Cache file data on writes through the FS + --chunker-chunk-size SizeSuffix Files larger than chunk size will be split in chunks (default 2Gi) + --chunker-fail-hard Choose how chunker should handle files with missing or invalid chunks + --chunker-hash-type string Choose how chunker handles hash sums (default \[dq]md5\[dq]) + --chunker-remote string Remote to chunk/unchunk + --combine-upstreams SpaceSepList Upstreams for combining + --compress-level int GZIP compression level (-2 to 9) (default -1) + --compress-mode string Compression mode (default \[dq]gzip\[dq]) + --compress-ram-cache-limit SizeSuffix Some remotes don\[aq]t allow the upload of files with unknown size (default 20Mi) + --compress-remote string Remote to compress + -L, --copy-links Follow symlinks and copy the pointed to item + --crypt-directory-name-encryption Option to either encrypt directory names or leave them intact (default true) + --crypt-filename-encoding string How to encode the encrypted filename to text string (default \[dq]base32\[dq]) + --crypt-filename-encryption string How to encrypt the filenames (default \[dq]standard\[dq]) + --crypt-no-data-encryption Option to either encrypt file data or leave it unencrypted + --crypt-pass-bad-blocks If set this will pass bad blocks through as all 0 + --crypt-password string Password or pass phrase for encryption (obscured) + --crypt-password2 string Password or pass phrase for salt (obscured) + --crypt-remote string Remote to encrypt/decrypt + --crypt-server-side-across-configs Deprecated: use --server-side-across-configs instead + --crypt-show-mapping For all files listed show how the names encrypt + --crypt-suffix string If this is set it will override the default suffix of \[dq].bin\[dq] (default \[dq].bin\[dq]) + --drive-acknowledge-abuse Set to allow files which return cannotDownloadAbusiveFile to be downloaded + --drive-allow-import-name-change Allow the filetype to change when uploading Google docs + --drive-auth-owner-only Only consider files owned by the authenticated user + --drive-auth-url string Auth server URL + --drive-chunk-size SizeSuffix Upload chunk size (default 8Mi) + --drive-client-id string Google Application Client Id + --drive-client-secret string OAuth Client Secret + --drive-copy-shortcut-content Server side copy contents of shortcuts instead of the shortcut + --drive-disable-http2 Disable drive using http2 (default true) + --drive-encoding Encoding The encoding for the backend (default InvalidUtf8) + --drive-env-auth Get IAM credentials from runtime (environment variables or instance meta data if no env vars) + --drive-export-formats string Comma separated list of preferred formats for downloading Google docs (default \[dq]docx,xlsx,pptx,svg\[dq]) + --drive-fast-list-bug-fix Work around a bug in Google Drive listing (default true) + --drive-formats string Deprecated: See export_formats + --drive-impersonate string Impersonate this user when using a service account + --drive-import-formats string Comma separated list of preferred formats for uploading Google docs + --drive-keep-revision-forever Keep new head revision of each file forever + --drive-list-chunk int Size of listing chunk 100-1000, 0 to disable (default 1000) + --drive-metadata-labels Bits Control whether labels should be read or written in metadata (default off) + --drive-metadata-owner Bits Control whether owner should be read or written in metadata (default read) + --drive-metadata-permissions Bits Control whether permissions should be read or written in metadata (default off) + --drive-pacer-burst int Number of API calls to allow without sleeping (default 100) + --drive-pacer-min-sleep Duration Minimum time to sleep between API calls (default 100ms) + --drive-resource-key string Resource key for accessing a link-shared file + --drive-root-folder-id string ID of the root folder + --drive-scope string Comma separated list of scopes that rclone should use when requesting access from drive + --drive-server-side-across-configs Deprecated: use --server-side-across-configs instead + --drive-service-account-credentials string Service Account Credentials JSON blob + --drive-service-account-file string Service Account Credentials JSON file path + --drive-shared-with-me Only show files that are shared with me + --drive-show-all-gdocs Show all Google Docs including non-exportable ones in listings + --drive-size-as-quota Show sizes as storage quota usage, not actual size + --drive-skip-checksum-gphotos Skip checksums on Google photos and videos only + --drive-skip-dangling-shortcuts If set skip dangling shortcut files + --drive-skip-gdocs Skip google documents in all listings + --drive-skip-shortcuts If set skip shortcut files + --drive-starred-only Only show files that are starred + --drive-stop-on-download-limit Make download limit errors be fatal + --drive-stop-on-upload-limit Make upload limit errors be fatal + --drive-team-drive string ID of the Shared Drive (Team Drive) + --drive-token string OAuth Access Token as a JSON blob + --drive-token-url string Token server url + --drive-trashed-only Only show files that are in the trash + --drive-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 8Mi) + --drive-use-created-date Use file created date instead of modified date + --drive-use-shared-date Use date file was shared instead of modified date + --drive-use-trash Send files to the trash instead of deleting permanently (default true) + --drive-v2-download-min-size SizeSuffix If Object\[aq]s are greater, use drive v2 API to download (default off) + --dropbox-auth-url string Auth server URL + --dropbox-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) + --dropbox-batch-mode string Upload file batching sync|async|off (default \[dq]sync\[dq]) + --dropbox-batch-size int Max number of files in upload batch + --dropbox-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) + --dropbox-chunk-size SizeSuffix Upload chunk size (< 150Mi) (default 48Mi) + --dropbox-client-id string OAuth Client Id + --dropbox-client-secret string OAuth Client Secret + --dropbox-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot) + --dropbox-impersonate string Impersonate this user when using a business account + --dropbox-pacer-min-sleep Duration Minimum time to sleep between API calls (default 10ms) + --dropbox-shared-files Instructs rclone to work on individual shared files + --dropbox-shared-folders Instructs rclone to work on shared folders + --dropbox-token string OAuth Access Token as a JSON blob + --dropbox-token-url string Token server url + --fichier-api-key string Your API Key, get it from https://1fichier.com/console/params.pl + --fichier-cdn Set if you wish to use CDN download links + --fichier-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot) + --fichier-file-password string If you want to download a shared file that is password protected, add this parameter (obscured) + --fichier-folder-password string If you want to list the files in a shared folder that is password protected, add this parameter (obscured) + --fichier-shared-folder string If you want to download a shared folder, add this parameter + --filefabric-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) + --filefabric-permanent-token string Permanent Authentication Token + --filefabric-root-folder-id string ID of the root folder + --filefabric-token string Session Token + --filefabric-token-expiry string Token expiry time + --filefabric-url string URL of the Enterprise File Fabric to connect to + --filefabric-version string Version read from the file fabric + --ftp-ask-password Allow asking for FTP password when needed + --ftp-close-timeout Duration Maximum time to wait for a response to close (default 1m0s) + --ftp-concurrency int Maximum number of FTP simultaneous connections, 0 for unlimited + --ftp-disable-epsv Disable using EPSV even if server advertises support + --ftp-disable-mlsd Disable using MLSD even if server advertises support + --ftp-disable-tls13 Disable TLS 1.3 (workaround for FTP servers with buggy TLS) + --ftp-disable-utf8 Disable using UTF-8 even if server advertises support + --ftp-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,RightSpace,Dot) + --ftp-explicit-tls Use Explicit FTPS (FTP over TLS) + --ftp-force-list-hidden Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD + --ftp-host string FTP host to connect to + --ftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) + --ftp-no-check-certificate Do not verify the TLS certificate of the server + --ftp-pass string FTP password (obscured) + --ftp-port int FTP port number (default 21) + --ftp-shut-timeout Duration Maximum time to wait for data connection closing status (default 1m0s) + --ftp-socks-proxy string Socks 5 proxy host + --ftp-tls Use Implicit FTPS (FTP over TLS) + --ftp-tls-cache-size int Size of TLS session cache for all control and data connections (default 32) + --ftp-user string FTP username (default \[dq]$USER\[dq]) + --ftp-writing-mdtm Use MDTM to set modification time (VsFtpd quirk) + --gcs-anonymous Access public buckets and objects without credentials + --gcs-auth-url string Auth server URL + --gcs-bucket-acl string Access Control List for new buckets + --gcs-bucket-policy-only Access checks should use bucket-level IAM policies + --gcs-client-id string OAuth Client Id + --gcs-client-secret string OAuth Client Secret + --gcs-decompress If set this will decompress gzip encoded objects + --gcs-directory-markers Upload an empty object with a trailing slash when a new directory is created + --gcs-encoding Encoding The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) + --gcs-endpoint string Endpoint for the service + --gcs-env-auth Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars) + --gcs-location string Location for the newly created buckets + --gcs-no-check-bucket If set, don\[aq]t attempt to check the bucket exists or create it + --gcs-object-acl string Access Control List for new objects + --gcs-project-number string Project number + --gcs-service-account-file string Service Account Credentials JSON file path + --gcs-storage-class string The storage class to use when storing objects in Google Cloud Storage + --gcs-token string OAuth Access Token as a JSON blob + --gcs-token-url string Token server url + --gcs-user-project string User project + --gphotos-auth-url string Auth server URL + --gphotos-batch-commit-timeout Duration Max time to wait for a batch to finish committing (default 10m0s) + --gphotos-batch-mode string Upload file batching sync|async|off (default \[dq]sync\[dq]) + --gphotos-batch-size int Max number of files in upload batch + --gphotos-batch-timeout Duration Max time to allow an idle upload batch before uploading (default 0s) + --gphotos-client-id string OAuth Client Id + --gphotos-client-secret string OAuth Client Secret + --gphotos-encoding Encoding The encoding for the backend (default Slash,CrLf,InvalidUtf8,Dot) + --gphotos-include-archived Also view and download archived media + --gphotos-read-only Set to make the Google Photos backend read only + --gphotos-read-size Set to read the size of media items + --gphotos-start-year int Year limits the photos to be downloaded to those which are uploaded after the given year (default 2000) + --gphotos-token string OAuth Access Token as a JSON blob + --gphotos-token-url string Token server url + --hasher-auto-size SizeSuffix Auto-update checksum for files smaller than this size (disabled by default) + --hasher-hashes CommaSepList Comma separated list of supported checksum types (default md5,sha1) + --hasher-max-age Duration Maximum time to keep checksums in cache (0 = no cache, off = cache forever) (default off) + --hasher-remote string Remote to cache checksums for (e.g. myRemote:path) + --hdfs-data-transfer-protection string Kerberos data transfer protection: authentication|integrity|privacy + --hdfs-encoding Encoding The encoding for the backend (default Slash,Colon,Del,Ctl,InvalidUtf8,Dot) + --hdfs-namenode CommaSepList Hadoop name nodes and ports + --hdfs-service-principal-name string Kerberos service principal name for the namenode + --hdfs-username string Hadoop user name + --hidrive-auth-url string Auth server URL + --hidrive-chunk-size SizeSuffix Chunksize for chunked uploads (default 48Mi) + --hidrive-client-id string OAuth Client Id + --hidrive-client-secret string OAuth Client Secret + --hidrive-disable-fetching-member-count Do not fetch number of objects in directories unless it is absolutely necessary + --hidrive-encoding Encoding The encoding for the backend (default Slash,Dot) + --hidrive-endpoint string Endpoint for the service (default \[dq]https://api.hidrive.strato.com/2.1\[dq]) + --hidrive-root-prefix string The root/parent folder for all paths (default \[dq]/\[dq]) + --hidrive-scope-access string Access permissions that rclone should use when requesting access from HiDrive (default \[dq]rw\[dq]) + --hidrive-scope-role string User-level that rclone should use when requesting access from HiDrive (default \[dq]user\[dq]) + --hidrive-token string OAuth Access Token as a JSON blob + --hidrive-token-url string Token server url + --hidrive-upload-concurrency int Concurrency for chunked uploads (default 4) + --hidrive-upload-cutoff SizeSuffix Cutoff/Threshold for chunked uploads (default 96Mi) + --http-headers CommaSepList Set HTTP headers for all transactions + --http-no-head Don\[aq]t use HEAD requests + --http-no-slash Set this if the site doesn\[aq]t end directories with / + --http-url string URL of HTTP host to connect to + --imagekit-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Dollar,Question,Hash,Percent,BackSlash,Del,Ctl,InvalidUtf8,Dot,SquareBracket) + --imagekit-endpoint string You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-only-signed Restrict unsigned image URLs If you have configured Restrict unsigned image URLs in your dashboard settings, set this to true + --imagekit-private-key string You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-public-key string You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) + --imagekit-upload-tags string Tags to add to the uploaded files, e.g. \[dq]tag1,tag2\[dq] + --imagekit-versions Include old versions in directory listings + --internetarchive-access-key-id string IAS3 Access Key + --internetarchive-disable-checksum Don\[aq]t ask the server to test against MD5 checksum calculated by rclone (default true) + --internetarchive-encoding Encoding The encoding for the backend (default Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot) + --internetarchive-endpoint string IAS3 Endpoint (default \[dq]https://s3.us.archive.org\[dq]) + --internetarchive-front-endpoint string Host of InternetArchive Frontend (default \[dq]https://archive.org\[dq]) + --internetarchive-secret-access-key string IAS3 Secret Key (password) + --internetarchive-wait-archive Duration Timeout for waiting the server\[aq]s processing tasks (specifically archive and book_op) to finish (default 0s) + --jottacloud-auth-url string Auth server URL + --jottacloud-client-id string OAuth Client Id + --jottacloud-client-secret string OAuth Client Secret + --jottacloud-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot) + --jottacloud-hard-delete Delete files permanently rather than putting them into the trash + --jottacloud-md5-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate the MD5 if required (default 10Mi) + --jottacloud-no-versions Avoid server side versioning by deleting files and recreating files instead of overwriting them + --jottacloud-token string OAuth Access Token as a JSON blob + --jottacloud-token-url string Token server url + --jottacloud-trashed-only Only show files that are in the trash + --jottacloud-upload-resume-limit SizeSuffix Files bigger than this can be resumed if the upload fail\[aq]s (default 10Mi) + --koofr-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --koofr-endpoint string The Koofr API endpoint to use + --koofr-mountid string Mount ID of the mount to use + --koofr-password string Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password) (obscured) + --koofr-provider string Choose your storage provider + --koofr-setmtime Does the backend support setting modification time (default true) + --koofr-user string Your user name + --linkbox-token string Token from https://www.linkbox.to/admin/account + -l, --links Translate symlinks to/from regular files with a \[aq].rclonelink\[aq] extension + --local-case-insensitive Force the filesystem to report itself as case insensitive + --local-case-sensitive Force the filesystem to report itself as case sensitive + --local-encoding Encoding The encoding for the backend (default Slash,Dot) + --local-no-check-updated Don\[aq]t check to see if the files change during upload + --local-no-preallocate Disable preallocation of disk space for transferred files + --local-no-set-modtime Disable setting modtime + --local-no-sparse Disable sparse files for multi-thread downloads + --local-nounc Disable UNC (long path names) conversion on Windows + --local-unicode-normalization Apply unicode NFC normalization to paths and filenames + --local-zero-size-links Assume the Stat size of links is zero (and read them instead) (deprecated) + --mailru-auth-url string Auth server URL + --mailru-check-hash What should copy do if file checksum is mismatched or invalid (default true) + --mailru-client-id string OAuth Client Id + --mailru-client-secret string OAuth Client Secret + --mailru-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --mailru-pass string Password (obscured) + --mailru-speedup-enable Skip full upload if there is another file with same data hash (default true) + --mailru-speedup-file-patterns string Comma separated list of file name patterns eligible for speedup (put by hash) (default \[dq]*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf\[dq]) + --mailru-speedup-max-disk SizeSuffix This option allows you to disable speedup (put by hash) for large files (default 3Gi) + --mailru-speedup-max-memory SizeSuffix Files larger than the size given below will always be hashed on disk (default 32Mi) + --mailru-token string OAuth Access Token as a JSON blob + --mailru-token-url string Token server url + --mailru-user string User name (usually email) + --mega-debug Output more debug from Mega + --mega-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --mega-hard-delete Delete files permanently rather than putting them into the trash + --mega-pass string Password (obscured) + --mega-use-https Use HTTPS for transfers + --mega-user string User name + --netstorage-account string Set the NetStorage account name + --netstorage-host string Domain+path of NetStorage host to connect to + --netstorage-protocol string Select between HTTP or HTTPS protocol (default \[dq]https\[dq]) + --netstorage-secret string Set the NetStorage account secret/G2O key for authentication (obscured) + -x, --one-file-system Don\[aq]t cross filesystem boundaries (unix/macOS only) + --onedrive-access-scopes SpaceSepList Set scopes to be requested by rclone (default Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All Sites.Read.All offline_access) + --onedrive-auth-url string Auth server URL + --onedrive-av-override Allows download of files the server thinks has a virus + --onedrive-chunk-size SizeSuffix Chunk size to upload files with - must be multiple of 320k (327,680 bytes) (default 10Mi) + --onedrive-client-id string OAuth Client Id + --onedrive-client-secret string OAuth Client Secret + --onedrive-delta If set rclone will use delta listing to implement recursive listings + --onedrive-drive-id string The ID of the drive to use + --onedrive-drive-type string The type of the drive (personal | business | documentLibrary) + --onedrive-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot) + --onedrive-expose-onenote-files Set to make OneNote files show up in directory listings + --onedrive-hash-type string Specify the hash in use for the backend (default \[dq]auto\[dq]) + --onedrive-link-password string Set the password for links created by the link command + --onedrive-link-scope string Set the scope of the links created by the link command (default \[dq]anonymous\[dq]) + --onedrive-link-type string Set the type of the links created by the link command (default \[dq]view\[dq]) + --onedrive-list-chunk int Size of listing chunk (default 1000) + --onedrive-no-versions Remove all versions on modifying operations + --onedrive-region string Choose national cloud region for OneDrive (default \[dq]global\[dq]) + --onedrive-root-folder-id string ID of the root folder + --onedrive-server-side-across-configs Deprecated: use --server-side-across-configs instead + --onedrive-token string OAuth Access Token as a JSON blob + --onedrive-token-url string Token server url + --oos-attempt-resume-upload If true attempt to resume previously started multipart upload for the object + --oos-chunk-size SizeSuffix Chunk size to use for uploading (default 5Mi) + --oos-compartment string Object storage compartment OCID + --oos-config-file string Path to OCI config file (default \[dq]\[ti]/.oci/config\[dq]) + --oos-config-profile string Profile name inside the oci config file (default \[dq]Default\[dq]) + --oos-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) + --oos-copy-timeout Duration Timeout for copy (default 1m0s) + --oos-disable-checksum Don\[aq]t store MD5 checksum with object metadata + --oos-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --oos-endpoint string Endpoint for Object storage API + --oos-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts for manual recovery + --oos-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) + --oos-namespace string Object storage namespace + --oos-no-check-bucket If set, don\[aq]t attempt to check the bucket exists or create it + --oos-provider string Choose your Auth Provider (default \[dq]env_auth\[dq]) + --oos-region string Object storage Region + --oos-sse-customer-algorithm string If using SSE-C, the optional header that specifies \[dq]AES256\[dq] as the encryption algorithm + --oos-sse-customer-key string To use SSE-C, the optional header that specifies the base64-encoded 256-bit encryption key to use to + --oos-sse-customer-key-file string To use SSE-C, a file containing the base64-encoded string of the AES-256 encryption key associated + --oos-sse-customer-key-sha256 string If using SSE-C, The optional header that specifies the base64-encoded SHA256 hash of the encryption + --oos-sse-kms-key-id string if using your own master key in vault, this header specifies the + --oos-storage-tier string The storage class to use when storing new objects in storage. https://docs.oracle.com/en-us/iaas/Content/Object/Concepts/understandingstoragetiers.htm (default \[dq]Standard\[dq]) + --oos-upload-concurrency int Concurrency for multipart uploads (default 10) + --oos-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --opendrive-chunk-size SizeSuffix Files will be uploaded in chunks this size (default 10Mi) + --opendrive-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot) + --opendrive-password string Password (obscured) + --opendrive-username string Username + --pcloud-auth-url string Auth server URL + --pcloud-client-id string OAuth Client Id + --pcloud-client-secret string OAuth Client Secret + --pcloud-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --pcloud-hostname string Hostname to connect to (default \[dq]api.pcloud.com\[dq]) + --pcloud-password string Your pcloud password (obscured) + --pcloud-root-folder-id string Fill in for rclone to use a non root folder as its starting point (default \[dq]d0\[dq]) + --pcloud-token string OAuth Access Token as a JSON blob + --pcloud-token-url string Token server url + --pcloud-username string Your pcloud username + --pikpak-auth-url string Auth server URL + --pikpak-client-id string OAuth Client Id + --pikpak-client-secret string OAuth Client Secret + --pikpak-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot) + --pikpak-hash-memory-limit SizeSuffix Files bigger than this will be cached on disk to calculate hash if required (default 10Mi) + --pikpak-pass string Pikpak password (obscured) + --pikpak-root-folder-id string ID of the root folder + --pikpak-token string OAuth Access Token as a JSON blob + --pikpak-token-url string Token server url + --pikpak-trashed-only Only show files that are in the trash + --pikpak-use-trash Send files to the trash instead of deleting permanently (default true) + --pikpak-user string Pikpak username + --premiumizeme-auth-url string Auth server URL + --premiumizeme-client-id string OAuth Client Id + --premiumizeme-client-secret string OAuth Client Secret + --premiumizeme-encoding Encoding The encoding for the backend (default Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --premiumizeme-token string OAuth Access Token as a JSON blob + --premiumizeme-token-url string Token server url + --protondrive-2fa string The 2FA code + --protondrive-app-version string The app version string (default \[dq]macos-drive\[at]1.0.0-alpha.1+rclone\[dq]) + --protondrive-enable-caching Caches the files and folders metadata to reduce API calls (default true) + --protondrive-encoding Encoding The encoding for the backend (default Slash,LeftSpace,RightSpace,InvalidUtf8,Dot) + --protondrive-mailbox-password string The mailbox password of your two-password proton account (obscured) + --protondrive-original-file-size Return the file size before encryption (default true) + --protondrive-password string The password of your proton account (obscured) + --protondrive-replace-existing-draft Create a new revision when filename conflict is detected + --protondrive-username string The username of your proton account + --putio-auth-url string Auth server URL + --putio-client-id string OAuth Client Id + --putio-client-secret string OAuth Client Secret + --putio-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --putio-token string OAuth Access Token as a JSON blob + --putio-token-url string Token server url + --qingstor-access-key-id string QingStor Access Key ID + --qingstor-chunk-size SizeSuffix Chunk size to use for uploading (default 4Mi) + --qingstor-connection-retries int Number of connection retries (default 3) + --qingstor-encoding Encoding The encoding for the backend (default Slash,Ctl,InvalidUtf8) + --qingstor-endpoint string Enter an endpoint URL to connection QingStor API + --qingstor-env-auth Get QingStor credentials from runtime + --qingstor-secret-access-key string QingStor Secret Access Key (password) + --qingstor-upload-concurrency int Concurrency for multipart uploads (default 1) + --qingstor-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --qingstor-zone string Zone to connect to + --quatrix-api-key string API key for accessing Quatrix account + --quatrix-effective-upload-time string Wanted upload time for one chunk (default \[dq]4s\[dq]) + --quatrix-encoding Encoding The encoding for the backend (default Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot) + --quatrix-hard-delete Delete files permanently rather than putting them into the trash + --quatrix-host string Host name of Quatrix account + --quatrix-maximal-summary-chunk-size SizeSuffix The maximal summary for all chunks. It should not be less than \[aq]transfers\[aq]*\[aq]minimal_chunk_size\[aq] (default 95.367Mi) + --quatrix-minimal-chunk-size SizeSuffix The minimal size for one chunk (default 9.537Mi) + --s3-access-key-id string AWS Access Key ID + --s3-acl string Canned ACL used when creating buckets and storing or copying objects + --s3-bucket-acl string Canned ACL used when creating buckets + --s3-chunk-size SizeSuffix Chunk size to use for uploading (default 5Mi) + --s3-copy-cutoff SizeSuffix Cutoff for switching to multipart copy (default 4.656Gi) + --s3-decompress If set this will decompress gzip encoded objects + --s3-directory-markers Upload an empty object with a trailing slash when a new directory is created + --s3-disable-checksum Don\[aq]t store MD5 checksum with object metadata + --s3-disable-http2 Disable usage of http2 for S3 backends + --s3-download-url string Custom endpoint for downloads + --s3-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8,Dot) + --s3-endpoint string Endpoint for S3 API + --s3-env-auth Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars) + --s3-force-path-style If true use path style access if false use virtual hosted style (default true) + --s3-leave-parts-on-error If true avoid calling abort upload on a failure, leaving all successfully uploaded parts on S3 for manual recovery + --s3-list-chunk int Size of listing chunk (response list for each ListObject S3 request) (default 1000) + --s3-list-url-encode Tristate Whether to url encode listings: true/false/unset (default unset) + --s3-list-version int Version of ListObjects to use: 1,2 or 0 for auto + --s3-location-constraint string Location constraint - must be set to match the Region + --s3-max-upload-parts int Maximum number of parts in a multipart upload (default 10000) + --s3-might-gzip Tristate Set this if the backend might gzip objects (default unset) + --s3-no-check-bucket If set, don\[aq]t attempt to check the bucket exists or create it + --s3-no-head If set, don\[aq]t HEAD uploaded objects to check integrity + --s3-no-head-object If set, do not do HEAD before GET when getting objects + --s3-no-system-metadata Suppress setting and reading of system metadata + --s3-profile string Profile to use in the shared credentials file + --s3-provider string Choose your S3 provider + --s3-region string Region to connect to + --s3-requester-pays Enables requester pays option when interacting with S3 bucket + --s3-secret-access-key string AWS Secret Access Key (password) + --s3-server-side-encryption string The server-side encryption algorithm used when storing this object in S3 + --s3-session-token string An AWS session token + --s3-shared-credentials-file string Path to the shared credentials file + --s3-sse-customer-algorithm string If using SSE-C, the server-side encryption algorithm used when storing this object in S3 + --s3-sse-customer-key string To use SSE-C you may provide the secret encryption key used to encrypt/decrypt your data + --s3-sse-customer-key-base64 string If using SSE-C you must provide the secret encryption key encoded in base64 format to encrypt/decrypt your data + --s3-sse-customer-key-md5 string If using SSE-C you may provide the secret encryption key MD5 checksum (optional) + --s3-sse-kms-key-id string If using KMS ID you must provide the ARN of Key + --s3-storage-class string The storage class to use when storing new objects in S3 + --s3-sts-endpoint string Endpoint for STS + --s3-upload-concurrency int Concurrency for multipart uploads (default 4) + --s3-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi) + --s3-use-accelerate-endpoint If true use the AWS S3 accelerated endpoint + --s3-use-accept-encoding-gzip Accept-Encoding: gzip Whether to send Accept-Encoding: gzip header (default unset) + --s3-use-already-exists Tristate Set if rclone should report BucketAlreadyExists errors on bucket creation (default unset) + --s3-use-multipart-etag Tristate Whether to use ETag in multipart uploads for verification (default unset) + --s3-use-multipart-uploads Tristate Set if rclone should use multipart uploads (default unset) + --s3-use-presigned-request Whether to use a presigned request or PutObject for single part uploads + --s3-v2-auth If true use v2 authentication + --s3-version-at Time Show file versions as they were at the specified time (default off) + --s3-versions Include old versions in directory listings + --seafile-2fa Two-factor authentication (\[aq]true\[aq] if the account has 2FA enabled) + --seafile-create-library Should rclone create a library if it doesn\[aq]t exist + --seafile-encoding Encoding The encoding for the backend (default Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8) + --seafile-library string Name of the library + --seafile-library-key string Library password (for encrypted libraries only) (obscured) + --seafile-pass string Password (obscured) + --seafile-url string URL of seafile host to connect to + --seafile-user string User name (usually email address) + --sftp-ask-password Allow asking for SFTP password when needed + --sftp-chunk-size SizeSuffix Upload and download chunk size (default 32Ki) + --sftp-ciphers SpaceSepList Space separated list of ciphers to be used for session encryption, ordered by preference + --sftp-concurrency int The maximum number of outstanding requests for one file (default 64) + --sftp-copy-is-hardlink Set to enable server side copies using hardlinks + --sftp-disable-concurrent-reads If set don\[aq]t use concurrent reads + --sftp-disable-concurrent-writes If set don\[aq]t use concurrent writes + --sftp-disable-hashcheck Disable the execution of SSH commands to determine if remote file hashing is available + --sftp-host string SSH host to connect to + --sftp-host-key-algorithms SpaceSepList Space separated list of host key algorithms, ordered by preference + --sftp-idle-timeout Duration Max time before closing idle connections (default 1m0s) + --sftp-key-exchange SpaceSepList Space separated list of key exchange algorithms, ordered by preference + --sftp-key-file string Path to PEM-encoded private key file + --sftp-key-file-pass string The passphrase to decrypt the PEM-encoded private key file (obscured) + --sftp-key-pem string Raw PEM-encoded private key + --sftp-key-use-agent When set forces the usage of the ssh-agent + --sftp-known-hosts-file string Optional path to known_hosts file + --sftp-macs SpaceSepList Space separated list of MACs (message authentication code) algorithms, ordered by preference + --sftp-md5sum-command string The command used to read md5 hashes + --sftp-pass string SSH password, leave blank to use ssh-agent (obscured) + --sftp-path-override string Override path used by SSH shell commands + --sftp-port int SSH port number (default 22) + --sftp-pubkey-file string Optional path to public key file + --sftp-server-command string Specifies the path or command to run a sftp server on the remote host + --sftp-set-env SpaceSepList Environment variables to pass to sftp and commands + --sftp-set-modtime Set the modified time on the remote if set (default true) + --sftp-sha1sum-command string The command used to read sha1 hashes + --sftp-shell-type string The type of SSH shell on remote server, if any + --sftp-skip-links Set to skip any symlinks and any other non regular files + --sftp-socks-proxy string Socks 5 proxy host + --sftp-ssh SpaceSepList Path and arguments to external ssh binary + --sftp-subsystem string Specifies the SSH2 subsystem on the remote host (default \[dq]sftp\[dq]) + --sftp-use-fstat If set use fstat instead of stat + --sftp-use-insecure-cipher Enable the use of insecure ciphers and key exchange methods + --sftp-user string SSH username (default \[dq]$USER\[dq]) + --sharefile-auth-url string Auth server URL + --sharefile-chunk-size SizeSuffix Upload chunk size (default 64Mi) + --sharefile-client-id string OAuth Client Id + --sharefile-client-secret string OAuth Client Secret + --sharefile-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot) + --sharefile-endpoint string Endpoint for API calls + --sharefile-root-folder-id string ID of the root folder + --sharefile-token string OAuth Access Token as a JSON blob + --sharefile-token-url string Token server url + --sharefile-upload-cutoff SizeSuffix Cutoff for switching to multipart upload (default 128Mi) + --sia-api-password string Sia Daemon API Password (obscured) + --sia-api-url string Sia daemon API URL, like http://sia.daemon.host:9980 (default \[dq]http://127.0.0.1:9980\[dq]) + --sia-encoding Encoding The encoding for the backend (default Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot) + --sia-user-agent string Siad User Agent (default \[dq]Sia-Agent\[dq]) + --skip-links Don\[aq]t warn about skipped symlinks + --smb-case-insensitive Whether the server is configured to be case-insensitive (default true) + --smb-domain string Domain name for NTLM authentication (default \[dq]WORKGROUP\[dq]) + --smb-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot) + --smb-hide-special-share Hide special shares (e.g. print$) which users aren\[aq]t supposed to access (default true) + --smb-host string SMB server hostname to connect to + --smb-idle-timeout Duration Max time before closing idle connections (default 1m0s) + --smb-pass string SMB password (obscured) + --smb-port int SMB port number (default 445) + --smb-spn string Service principal name + --smb-user string SMB username (default \[dq]$USER\[dq]) + --storj-access-grant string Access grant + --storj-api-key string API key + --storj-passphrase string Encryption passphrase + --storj-provider string Choose an authentication method (default \[dq]existing\[dq]) + --storj-satellite-address string Satellite address (default \[dq]us1.storj.io\[dq]) + --sugarsync-access-key-id string Sugarsync Access Key ID + --sugarsync-app-id string Sugarsync App ID + --sugarsync-authorization string Sugarsync authorization + --sugarsync-authorization-expiry string Sugarsync authorization expiry + --sugarsync-deleted-id string Sugarsync deleted folder id + --sugarsync-encoding Encoding The encoding for the backend (default Slash,Ctl,InvalidUtf8,Dot) + --sugarsync-hard-delete Permanently delete files if true + --sugarsync-private-access-key string Sugarsync Private Access Key + --sugarsync-refresh-token string Sugarsync refresh token + --sugarsync-root-id string Sugarsync root id + --sugarsync-user string Sugarsync user + --swift-application-credential-id string Application Credential ID (OS_APPLICATION_CREDENTIAL_ID) + --swift-application-credential-name string Application Credential Name (OS_APPLICATION_CREDENTIAL_NAME) + --swift-application-credential-secret string Application Credential Secret (OS_APPLICATION_CREDENTIAL_SECRET) + --swift-auth string Authentication URL for server (OS_AUTH_URL) + --swift-auth-token string Auth Token from alternate authentication - optional (OS_AUTH_TOKEN) + --swift-auth-version int AuthVersion - optional - set to (1,2,3) if your auth URL has no version (ST_AUTH_VERSION) + --swift-chunk-size SizeSuffix Above this size files will be chunked into a _segments container (default 5Gi) + --swift-domain string User domain - optional (v3 auth) (OS_USER_DOMAIN_NAME) + --swift-encoding Encoding The encoding for the backend (default Slash,InvalidUtf8) + --swift-endpoint-type string Endpoint type to choose from the service catalogue (OS_ENDPOINT_TYPE) (default \[dq]public\[dq]) + --swift-env-auth Get swift credentials from environment variables in standard OpenStack form + --swift-key string API key or password (OS_PASSWORD) + --swift-leave-parts-on-error If true avoid calling abort upload on a failure + --swift-no-chunk Don\[aq]t chunk files during streaming upload + --swift-no-large-objects Disable support for static and dynamic large objects + --swift-region string Region name - optional (OS_REGION_NAME) + --swift-storage-policy string The storage policy to use when creating a new container + --swift-storage-url string Storage URL - optional (OS_STORAGE_URL) + --swift-tenant string Tenant name - optional for v1 auth, this or tenant_id required otherwise (OS_TENANT_NAME or OS_PROJECT_NAME) + --swift-tenant-domain string Tenant domain - optional (v3 auth) (OS_PROJECT_DOMAIN_NAME) + --swift-tenant-id string Tenant ID - optional for v1 auth, this or tenant required otherwise (OS_TENANT_ID) + --swift-user string User name to log in (OS_USERNAME) + --swift-user-id string User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) (OS_USER_ID) + --union-action-policy string Policy to choose upstream on ACTION category (default \[dq]epall\[dq]) + --union-cache-time int Cache time of usage and free space (in seconds) (default 120) + --union-create-policy string Policy to choose upstream on CREATE category (default \[dq]epmfs\[dq]) + --union-min-free-space SizeSuffix Minimum viable free space for lfs/eplfs policies (default 1Gi) + --union-search-policy string Policy to choose upstream on SEARCH category (default \[dq]ff\[dq]) + --union-upstreams string List of space separated upstreams + --uptobox-access-token string Your access token + --uptobox-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot) + --uptobox-private Set to make uploaded files private + --webdav-bearer-token string Bearer token instead of user/pass (e.g. a Macaroon) + --webdav-bearer-token-command string Command to run to get a bearer token + --webdav-encoding string The encoding for the backend + --webdav-headers CommaSepList Set HTTP headers for all transactions + --webdav-nextcloud-chunk-size SizeSuffix Nextcloud upload chunk size (default 10Mi) + --webdav-pacer-min-sleep Duration Minimum time to sleep between API calls (default 10ms) + --webdav-pass string Password (obscured) + --webdav-url string URL of http host to connect to + --webdav-user string User name + --webdav-vendor string Name of the WebDAV site/service/software you are using + --yandex-auth-url string Auth server URL + --yandex-client-id string OAuth Client Id + --yandex-client-secret string OAuth Client Secret + --yandex-encoding Encoding The encoding for the backend (default Slash,Del,Ctl,InvalidUtf8,Dot) + --yandex-hard-delete Delete files permanently rather than putting them into the trash + --yandex-token string OAuth Access Token as a JSON blob + --yandex-token-url string Token server url + --zoho-auth-url string Auth server URL + --zoho-client-id string OAuth Client Id + --zoho-client-secret string OAuth Client Secret + --zoho-encoding Encoding The encoding for the backend (default Del,Ctl,InvalidUtf8) + --zoho-region string Zoho region to connect to + --zoho-token string OAuth Access Token as a JSON blob + --zoho-token-url string Token server url \f[R] .fi -.SS Modified time -.PP -The modified time is stored as metadata on the object as -\f[C]X-Amz-Meta-Mtime\f[R] as floating point since the epoch, accurate -to 1 ns. -.PP -If the modification time needs to be updated rclone will attempt to -perform a server side copy to update the modification if the object can -be copied in a single part. -In the case the object is larger than 5Gb or is in Glacier or Glacier -Deep Archive storage the object will be uploaded rather than copied. -.PP -Note that reading this from the object takes an additional -\f[C]HEAD\f[R] request as the metadata isn\[aq]t returned in object -listings. -.SS Reducing costs -.SS Avoiding HEAD requests to read the modification time -.PP -By default, rclone will use the modification time of objects stored in -S3 for syncing. -This is stored in object metadata which unfortunately takes an extra -HEAD request to read which can be expensive (in time and money). +.SH Docker Volume Plugin +.SS Introduction .PP -The modification time is used by default for all operations that require -checking the time a file was last updated. -It allows rclone to treat the remote more like a true filesystem, but it -is inefficient on S3 because it requires an extra API call to retrieve -the metadata. +Docker 1.9 has added support for creating named +volumes (https://docs.docker.com/storage/volumes/) via command-line +interface (https://docs.docker.com/engine/reference/commandline/volume_create/) +and mounting them in containers as a way to share data between them. +Since Docker 1.10 you can create named volumes with Docker +Compose (https://docs.docker.com/compose/) by descriptions in +docker-compose.yml (https://docs.docker.com/compose/compose-file/compose-file-v2/#volume-configuration-reference) +files for use by container groups on a single host. +As of Docker 1.12 volumes are supported by Docker +Swarm (https://docs.docker.com/engine/swarm/key-concepts/) included with +Docker Engine and created from descriptions in swarm compose +v3 (https://docs.docker.com/compose/compose-file/compose-file-v3/#volume-configuration-reference) +files for use with \f[I]swarm stacks\f[R] across multiple cluster nodes. .PP -The extra API calls can be avoided when syncing (using -\f[C]rclone sync\f[R] or \f[C]rclone copy\f[R]) in a few different ways, -each with its own tradeoffs. -.IP \[bu] 2 -\f[C]--size-only\f[R] -.RS 2 -.IP \[bu] 2 -Only checks the size of files. -.IP \[bu] 2 -Uses no extra transactions. -.IP \[bu] 2 -If the file doesn\[aq]t change size then rclone won\[aq]t detect it has -changed. -.IP \[bu] 2 -\f[C]rclone sync --size-only /path/to/source s3:bucket\f[R] -.RE -.IP \[bu] 2 -\f[C]--checksum\f[R] -.RS 2 -.IP \[bu] 2 -Checks the size and MD5 checksum of files. -.IP \[bu] 2 -Uses no extra transactions. -.IP \[bu] 2 -The most accurate detection of changes possible. -.IP \[bu] 2 -Will cause the source to read an MD5 checksum which, if it is a local -disk, will cause lots of disk activity. -.IP \[bu] 2 -If the source and destination are both S3 this is the -\f[B]recommended\f[R] flag to use for maximum efficiency. -.IP \[bu] 2 -\f[C]rclone sync --checksum /path/to/source s3:bucket\f[R] -.RE -.IP \[bu] 2 -\f[C]--update --use-server-modtime\f[R] -.RS 2 -.IP \[bu] 2 -Uses no extra transactions. -.IP \[bu] 2 -Modification time becomes the time the object was uploaded. -.IP \[bu] 2 -For many operations this is sufficient to determine if it needs -uploading. -.IP \[bu] 2 -Using \f[C]--update\f[R] along with \f[C]--use-server-modtime\f[R], -avoids the extra API call and uploads files whose local modification -time is newer than the time it was last uploaded. -.IP \[bu] 2 -Files created with timestamps in the past will be missed by the sync. -.IP \[bu] 2 -\f[C]rclone sync --update --use-server-modtime /path/to/source s3:bucket\f[R] -.RE +Docker Volume +Plugins (https://docs.docker.com/engine/extend/plugins_volume/) augment +the default \f[C]local\f[R] volume driver included in Docker with +stateful volumes shared across containers and hosts. +Unlike local volumes, your data will \f[I]not\f[R] be deleted when such +volume is removed. +Plugins can run managed by the docker daemon, as a native system service +(under systemd, \f[I]sysv\f[R] or \f[I]upstart\f[R]) or as a standalone +executable. +Rclone can run as docker volume plugin in all these modes. +It interacts with the local docker daemon via plugin +API (https://docs.docker.com/engine/extend/plugin_api/) and handles +mounting of remote file systems into docker containers so it must run on +the same host as the docker daemon or on every Swarm node. +.SS Getting started .PP -These flags can and should be used in combination with -\f[C]--fast-list\f[R] - see below. +In the first example we will use the SFTP (https://rclone.org/sftp/) +rclone volume with Docker engine on a standalone Ubuntu machine. .PP -If using \f[C]rclone mount\f[R] or any command using the VFS (eg -\f[C]rclone serve\f[R]) commands then you might want to consider using -the VFS flag \f[C]--no-modtime\f[R] which will stop rclone reading the -modification time for every object. -You could also use \f[C]--use-server-modtime\f[R] if you are happy with -the modification times of the objects being the time of upload. -.SS Avoiding GET requests to read directory listings +Start from installing Docker (https://docs.docker.com/engine/install/) +on the host. .PP -Rclone\[aq]s default directory traversal is to process each directory -individually. -This takes one API call per directory. -Using the \f[C]--fast-list\f[R] flag will read all info about the -objects into memory first using a smaller number of API calls (one per -1000 objects). -See the rclone docs (https://rclone.org/docs/#fast-list) for more -details. +The \f[I]FUSE\f[R] driver is a prerequisite for rclone mounting and +should be installed on host: .IP .nf \f[C] -rclone sync --fast-list --checksum /path/to/source s3:bucket +sudo apt-get -y install fuse \f[R] .fi .PP -\f[C]--fast-list\f[R] trades off API transactions for memory use. -As a rough guide rclone uses 1k of memory per object stored, so using -\f[C]--fast-list\f[R] on a sync of a million objects will use roughly 1 -GiB of RAM. -.PP -If you are only copying a small number of files into a big repository -then using \f[C]--no-traverse\f[R] is a good idea. -This finds objects directly instead of through directory listings. -You can do a \[dq]top-up\[dq] sync very cheaply by using -\f[C]--max-age\f[R] and \f[C]--no-traverse\f[R] to copy only recent -files, eg +Create two directories required by rclone docker plugin: .IP .nf \f[C] -rclone copy --max-age 24h --no-traverse /path/to/source s3:bucket +sudo mkdir -p /var/lib/docker-plugins/rclone/config +sudo mkdir -p /var/lib/docker-plugins/rclone/cache \f[R] .fi .PP -You\[aq]d then do a full \f[C]rclone sync\f[R] less often. -.PP -Note that \f[C]--fast-list\f[R] isn\[aq]t required in the top-up sync. -.SS Avoiding HEAD requests after PUT -.PP -By default, rclone will HEAD every object it uploads. -It does this to check the object got uploaded correctly. -.PP -You can disable this with the --s3-no-head option - see there for more -details. -.PP -Setting this flag increases the chance for undetected upload failures. -.SS Hashes -.PP -For small objects which weren\[aq]t uploaded as multipart uploads -(objects sized below \f[C]--s3-upload-cutoff\f[R] if uploaded with -rclone) rclone uses the \f[C]ETag:\f[R] header as an MD5 checksum. -.PP -However for objects which were uploaded as multipart uploads or with -server side encryption (SSE-AWS or SSE-C) the \f[C]ETag\f[R] header is -no longer the MD5 sum of the data, so rclone adds an additional piece of -metadata \f[C]X-Amz-Meta-Md5chksum\f[R] which is a base64 encoded MD5 -hash (in the same format as is required for \f[C]Content-MD5\f[R]). -You can use base64 -d and hexdump to check this value manually: +Install the managed rclone docker plugin for your architecture (here +\f[C]amd64\f[R]): .IP .nf \f[C] -echo \[aq]VWTGdNx3LyXQDfA0e2Edxw==\[aq] | base64 -d | hexdump +docker plugin install rclone/docker-volume-rclone:amd64 args=\[dq]-v\[dq] --alias rclone --grant-all-permissions +docker plugin list \f[R] .fi .PP -or you can use \f[C]rclone check\f[R] to verify the hashes are OK. -.PP -For large objects, calculating this hash can take some time so the -addition of this hash can be disabled with -\f[C]--s3-disable-checksum\f[R]. -This will mean that these objects do not have an MD5 checksum. -.PP -Note that reading this from the object takes an additional -\f[C]HEAD\f[R] request as the metadata isn\[aq]t returned in object -listings. -.SS Versions -.PP -When bucket versioning is enabled (this can be done with rclone with the -\f[C]rclone backend versioning\f[R] command) when rclone uploads a new -version of a file it creates a new version of -it (https://docs.aws.amazon.com/AmazonS3/latest/userguide/Versioning.html) -Likewise when you delete a file, the old version will be marked hidden -and still be available. +Create your SFTP volume (https://rclone.org/sftp/#standard-options): +.IP +.nf +\f[C] +docker volume create firstvolume -d rclone -o type=sftp -o sftp-host=_hostname_ -o sftp-user=_username_ -o sftp-pass=_password_ -o allow-other=true +\f[R] +.fi .PP -Old versions of files, where available, are visible using the -\f[C]--s3-versions\f[R] flag. +Note that since all options are static, you don\[aq]t even have to run +\f[C]rclone config\f[R] or create the \f[C]rclone.conf\f[R] file (but +the \f[C]config\f[R] directory should still be present). +In the simplest case you can use \f[C]localhost\f[R] as +\f[I]hostname\f[R] and your SSH credentials as \f[I]username\f[R] and +\f[I]password\f[R]. +You can also change the remote path to your home directory on the host, +for example \f[C]-o path=/home/username\f[R]. .PP -It is also possible to view a bucket as it was at a certain point in -time, using the \f[C]--s3-version-at\f[R] flag. -This will show the file versions as they were at that time, showing -files that have been deleted afterwards, and hiding files that were -created since. +Time to create a test container and mount the volume into it: +.IP +.nf +\f[C] +docker run --rm -it -v firstvolume:/mnt --workdir /mnt ubuntu:latest bash +\f[R] +.fi .PP -If you wish to remove all the old versions then you can use the -\f[C]rclone backend cleanup-hidden remote:bucket\f[R] command which will -delete all the old hidden versions of files, leaving the current ones -intact. -You can also supply a path and only old versions under that path will be -deleted, e.g. -\f[C]rclone backend cleanup-hidden remote:bucket/path/to/stuff\f[R]. +If all goes well, you will enter the new container and change right to +the mounted SFTP remote. +You can type \f[C]ls\f[R] to list the mounted directory or otherwise +play with it. +Type \f[C]exit\f[R] when you are done. +The container will stop but the volume will stay, ready to be reused. +When it\[aq]s not needed anymore, remove it: +.IP +.nf +\f[C] +docker volume list +docker volume remove firstvolume +\f[R] +.fi .PP -When you \f[C]purge\f[R] a bucket, the current and the old versions will -be deleted then the bucket will be deleted. +Now let us try \f[B]something more elaborate\f[R]: Google +Drive (https://rclone.org/drive/) volume on multi-node Docker Swarm. .PP -However \f[C]delete\f[R] will cause the current versions of the files to -become hidden old versions. +You should start from installing Docker and FUSE, creating plugin +directories and installing rclone plugin on \f[I]every\f[R] swarm node. +Then setup the Swarm (https://docs.docker.com/engine/swarm/swarm-mode/). .PP -Here is a session showing the listing and retrieval of an old version -followed by a \f[C]cleanup\f[R] of the old versions. +Google Drive volumes need an access token which can be setup via web +browser and will be periodically renewed by rclone. +The managed plugin cannot run a browser so we will use a technique +similar to the rclone setup on a headless +box (https://rclone.org/remote_setup/). .PP -Show current version and all the versions with \f[C]--s3-versions\f[R] -flag. +Run rclone config (https://rclone.org/commands/rclone_config_create/) on +\f[I]another\f[R] machine equipped with \f[I]web browser\f[R] and +graphical user interface. +Create the Google Drive +remote (https://rclone.org/drive/#standard-options). +When done, transfer the resulting \f[C]rclone.conf\f[R] to the Swarm +cluster and save as +\f[C]/var/lib/docker-plugins/rclone/config/rclone.conf\f[R] on +\f[I]every\f[R] node. +By default this location is accessible only to the root user so you will +need appropriate privileges. +The resulting config will look like this: .IP .nf \f[C] -$ rclone -q ls s3:cleanup-test - 9 one.txt - -$ rclone -q --s3-versions ls s3:cleanup-test - 9 one.txt - 8 one-v2016-07-04-141032-000.txt - 16 one-v2016-07-04-141003-000.txt - 15 one-v2016-07-02-155621-000.txt +[gdrive] +type = drive +scope = drive +drive_id = 1234567... +root_folder_id = 0Abcd... +token = {\[dq]access_token\[dq]:...} \f[R] .fi .PP -Retrieve an old version +Now create the file named \f[C]example.yml\f[R] with a swarm stack +description like this: .IP .nf \f[C] -$ rclone -q --s3-versions copy s3:cleanup-test/one-v2016-07-04-141003-000.txt /tmp - -$ ls -l /tmp/one-v2016-07-04-141003-000.txt --rw-rw-r-- 1 ncw ncw 16 Jul 2 17:46 /tmp/one-v2016-07-04-141003-000.txt +version: \[aq]3\[aq] +services: + heimdall: + image: linuxserver/heimdall:latest + ports: [8080:80] + volumes: [configdata:/config] +volumes: + configdata: + driver: rclone + driver_opts: + remote: \[aq]gdrive:heimdall\[aq] + allow_other: \[aq]true\[aq] + vfs_cache_mode: full + poll_interval: 0 \f[R] .fi .PP -Clean up all the old versions and show that they\[aq]ve gone. +and run the stack: .IP .nf \f[C] -$ rclone -q backend cleanup-hidden s3:cleanup-test - -$ rclone -q ls s3:cleanup-test - 9 one.txt - -$ rclone -q --s3-versions ls s3:cleanup-test - 9 one.txt +docker stack deploy example -c ./example.yml \f[R] .fi -.SS Versions naming caveat .PP -When using \f[C]--s3-versions\f[R] flag rclone is relying on the file -name to work out whether the objects are versions or not. -Versions\[aq] names are created by inserting timestamp between file name -and its extension. +After a few seconds docker will spread the parsed stack description over +cluster, create the \f[C]example_heimdall\f[R] service on port +\f[I]8080\f[R], run service containers on one or more cluster nodes and +request the \f[C]example_configdata\f[R] volume from rclone plugins on +the node hosts. +You can use the following commands to confirm results: .IP .nf \f[C] - 9 file.txt - 8 file-v2023-07-17-161032-000.txt - 16 file-v2023-06-15-141003-000.txt +docker service ls +docker service ps example_heimdall +docker volume ls \f[R] .fi .PP -If there are real files present with the same names as versions, then -behaviour of \f[C]--s3-versions\f[R] can be unpredictable. -.SS Cleanup -.PP -If you run \f[C]rclone cleanup s3:bucket\f[R] then it will remove all -pending multipart uploads older than 24 hours. -You can use the \f[C]--interactive\f[R]/\f[C]i\f[R] or -\f[C]--dry-run\f[R] flag to see exactly what it will do. -If you want more control over the expiry date then run -\f[C]rclone backend cleanup s3:bucket -o max-age=1h\f[R] to expire all -uploads older than one hour. -You can use \f[C]rclone backend list-multipart-uploads s3:bucket\f[R] to -see the pending multipart uploads. -.SS Restricted filename characters -.PP -S3 allows any valid UTF-8 string as a key. -.PP -Invalid UTF-8 bytes will be -replaced (https://rclone.org/overview/#invalid-utf8), as they can\[aq]t -be used in XML. -.PP -The following characters are replaced since these are problematic when -dealing with the REST API: +Point your browser to \f[C]http://cluster.host.address:8080\f[R] and +play with the service. +Stop it with \f[C]docker stack remove example\f[R] when you are done. +Note that the \f[C]example_configdata\f[R] volume(s) created on demand +at the cluster nodes will not be automatically removed together with the +stack but stay for future reuse. +You can remove them manually by invoking the +\f[C]docker volume remove example_configdata\f[R] command on every node. +.SS Creating Volumes via CLI .PP -.TS -tab(@); -l c c. -T{ -Character -T}@T{ -Value -T}@T{ -Replacement -T} -_ -T{ -NUL -T}@T{ -0x00 -T}@T{ -\[u2400] -T} -T{ -/ -T}@T{ -0x2F -T}@T{ -\[uFF0F] -T} -.TE +Volumes can be created with docker volume +create (https://docs.docker.com/engine/reference/commandline/volume_create/). +Here are a few examples: +.IP +.nf +\f[C] +docker volume create vol1 -d rclone -o remote=storj: -o vfs-cache-mode=full +docker volume create vol2 -d rclone -o remote=:storj,access_grant=xxx:heimdall +docker volume create vol3 -d rclone -o type=storj -o path=heimdall -o storj-access-grant=xxx -o poll-interval=0 +\f[R] +.fi .PP -The encoding will also encode these file names as they don\[aq]t seem to -work with the SDK properly: +Note the \f[C]-d rclone\f[R] flag that tells docker to request volume +from the rclone driver. +This works even if you installed managed driver by its full name +\f[C]rclone/docker-volume-rclone\f[R] because you provided the +\f[C]--alias rclone\f[R] option. .PP -.TS -tab(@); -l c. -T{ -File name -T}@T{ -Replacement -T} -_ -T{ -\&. -T}@T{ -\[uFF0E] -T} -T{ -\&.. -T}@T{ -\[uFF0E]\[uFF0E] -T} -.TE -.SS Multipart uploads +Volumes can be inspected as follows: +.IP +.nf +\f[C] +docker volume list +docker volume inspect vol1 +\f[R] +.fi +.SS Volume Configuration .PP -rclone supports multipart uploads with S3 which means that it can upload -files bigger than 5 GiB. +Rclone flags and volume options are set via the \f[C]-o\f[R] flag to the +\f[C]docker volume create\f[R] command. +They include backend-specific parameters as well as mount and +\f[I]VFS\f[R] options. +Also there are a few special \f[C]-o\f[R] options: \f[C]remote\f[R], +\f[C]fs\f[R], \f[C]type\f[R], \f[C]path\f[R], \f[C]mount-type\f[R] and +\f[C]persist\f[R]. .PP -Note that files uploaded \f[I]both\f[R] with multipart upload -\f[I]and\f[R] through crypt remotes do not have MD5 sums. +\f[C]remote\f[R] determines an existing remote name from the config +file, with trailing colon and optionally with a remote path. +See the full syntax in the rclone +documentation (https://rclone.org/docs/#syntax-of-remote-paths). +This option can be aliased as \f[C]fs\f[R] to prevent confusion with the +\f[I]remote\f[R] parameter of such backends as \f[I]crypt\f[R] or +\f[I]alias\f[R]. .PP -rclone switches from single part uploads to multipart uploads at the -point specified by \f[C]--s3-upload-cutoff\f[R]. -This can be a maximum of 5 GiB and a minimum of 0 (ie always upload -multipart files). +The \f[C]remote=:backend:dir/subdir\f[R] syntax can be used to create +on-the-fly (config-less) +remotes (https://rclone.org/docs/#backend-path-to-dir), while the +\f[C]type\f[R] and \f[C]path\f[R] options provide a simpler alternative +for this. +Using two split options +.IP +.nf +\f[C] +-o type=backend -o path=dir/subdir +\f[R] +.fi .PP -The chunk sizes used in the multipart upload are specified by -\f[C]--s3-chunk-size\f[R] and the number of chunks uploaded concurrently -is specified by \f[C]--s3-upload-concurrency\f[R]. +is equivalent to the combined syntax +.IP +.nf +\f[C] +-o remote=:backend:dir/subdir +\f[R] +.fi .PP -Multipart uploads will use \f[C]--transfers\f[R] * -\f[C]--s3-upload-concurrency\f[R] * \f[C]--s3-chunk-size\f[R] extra -memory. -Single part uploads to not use extra memory. +but is arguably easier to parameterize in scripts. +The \f[C]path\f[R] part is optional. .PP -Single part transfers can be faster than multipart transfers or slower -depending on your latency from S3 - the more latency, the more likely -single part transfers will be faster. +Mount and VFS +options (https://rclone.org/commands/rclone_serve_docker/#options) as +well as backend parameters (https://rclone.org/flags/#backend-flags) are +named like their twin command-line flags without the \f[C]--\f[R] CLI +prefix. +Optionally you can use underscores instead of dashes in option names. +For example, \f[C]--vfs-cache-mode full\f[R] becomes +\f[C]-o vfs-cache-mode=full\f[R] or \f[C]-o vfs_cache_mode=full\f[R]. +Boolean CLI flags without value will gain the \f[C]true\f[R] value, e.g. +\f[C]--allow-other\f[R] becomes \f[C]-o allow-other=true\f[R] or +\f[C]-o allow_other=true\f[R]. .PP -Increasing \f[C]--s3-upload-concurrency\f[R] will increase throughput (8 -would be a sensible value) and increasing \f[C]--s3-chunk-size\f[R] also -increases throughput (16M would be sensible). -Increasing either of these will use more memory. -The default values are high enough to gain most of the possible -performance without using too much memory. -.SS Buckets and Regions +Please note that you can provide parameters only for the backend +immediately referenced by the backend type of mounted \f[C]remote\f[R]. +If this is a wrapping backend like \f[I]alias, chunker or crypt\f[R], +you cannot provide options for the referred to remote or backend. +This limitation is imposed by the rclone connection string parser. +The only workaround is to feed plugin with \f[C]rclone.conf\f[R] or +configure plugin arguments (see below). +.SS Special Volume Options .PP -With Amazon S3 you can list buckets (\f[C]rclone lsd\f[R]) using any -region, but you can only access the content of a bucket from the region -it was created in. -If you attempt to access a bucket from the wrong region, you will get an -error, -\f[C]incorrect region, the bucket is not in \[aq]XXX\[aq] region\f[R]. -.SS Authentication +\f[C]mount-type\f[R] determines the mount method and in general can be +one of: \f[C]mount\f[R], \f[C]cmount\f[R], or \f[C]mount2\f[R]. +This can be aliased as \f[C]mount_type\f[R]. +It should be noted that the managed rclone docker plugin currently does +not support the \f[C]cmount\f[R] method and \f[C]mount2\f[R] is rarely +needed. +This option defaults to the first found method, which is usually +\f[C]mount\f[R] so you generally won\[aq]t need it. .PP -There are a number of ways to supply \f[C]rclone\f[R] with a set of AWS -credentials, with and without using the environment. +\f[C]persist\f[R] is a reserved boolean (true/false) option. +In future it will allow to persist on-the-fly remotes in the plugin +\f[C]rclone.conf\f[R] file. +.SS Connection Strings .PP -The different authentication methods are tried in this order: -.IP \[bu] 2 -Directly in the rclone configuration file (\f[C]env_auth = false\f[R] in -the config file): -.RS 2 -.IP \[bu] 2 -\f[C]access_key_id\f[R] and \f[C]secret_access_key\f[R] are required. -.IP \[bu] 2 -\f[C]session_token\f[R] can be optionally set when using AWS STS. -.RE -.IP \[bu] 2 -Runtime configuration (\f[C]env_auth = true\f[R] in the config file): -.RS 2 -.IP \[bu] 2 -Export the following environment variables before running -\f[C]rclone\f[R]: -.RS 2 -.IP \[bu] 2 -Access Key ID: \f[C]AWS_ACCESS_KEY_ID\f[R] or \f[C]AWS_ACCESS_KEY\f[R] -.IP \[bu] 2 -Secret Access Key: \f[C]AWS_SECRET_ACCESS_KEY\f[R] or -\f[C]AWS_SECRET_KEY\f[R] -.IP \[bu] 2 -Session Token: \f[C]AWS_SESSION_TOKEN\f[R] (optional) -.RE -.IP \[bu] 2 -Or, use a named -profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html): -.RS 2 -.IP \[bu] 2 -Profile files are standard files used by AWS CLI tools -.IP \[bu] 2 -By default it will use the profile in your home directory (e.g. -\f[C]\[ti]/.aws/credentials\f[R] on unix based systems) file and the -\[dq]default\[dq] profile, to change set these environment variables: -.RS 2 -.IP \[bu] 2 -\f[C]AWS_SHARED_CREDENTIALS_FILE\f[R] to control which file. -.IP \[bu] 2 -\f[C]AWS_PROFILE\f[R] to control which profile to use. -.RE -.RE -.IP \[bu] 2 -Or, run \f[C]rclone\f[R] in an ECS task with an IAM role (AWS only). -.IP \[bu] 2 -Or, run \f[C]rclone\f[R] on an EC2 instance with an IAM role (AWS only). -.IP \[bu] 2 -Or, run \f[C]rclone\f[R] in an EKS pod with an IAM role that is -associated with a service account (AWS only). -.RE +The \f[C]remote\f[R] value can be extended with connection +strings (https://rclone.org/docs/#connection-strings) as an alternative +way to supply backend parameters. +This is equivalent to the \f[C]-o\f[R] backend options with one +\f[I]syntactic difference\f[R]. +Inside connection string the backend prefix must be dropped from +parameter names but in the \f[C]-o param=value\f[R] array it must be +present. +For instance, compare the following option array +.IP +.nf +\f[C] +-o remote=:sftp:/home -o sftp-host=localhost +\f[R] +.fi .PP -If none of these option actually end up providing \f[C]rclone\f[R] with -AWS credentials then S3 interaction will be non-authenticated (see -below). -.SS S3 Permissions +with equivalent connection string: +.IP +.nf +\f[C] +-o remote=:sftp,host=localhost:/home +\f[R] +.fi .PP -When using the \f[C]sync\f[R] subcommand of \f[C]rclone\f[R] the -following minimum permissions are required to be available on the bucket -being written to: -.IP \[bu] 2 -\f[C]ListBucket\f[R] -.IP \[bu] 2 -\f[C]DeleteObject\f[R] -.IP \[bu] 2 -\f[C]GetObject\f[R] -.IP \[bu] 2 -\f[C]PutObject\f[R] -.IP \[bu] 2 -\f[C]PutObjectACL\f[R] +This difference exists because flag options \f[C]-o key=val\f[R] include +not only backend parameters but also mount/VFS flags and possibly other +settings. +Also it allows to discriminate the \f[C]remote\f[R] option from the +\f[C]crypt-remote\f[R] (or similarly named backend parameters) and +arguably simplifies scripting due to clearer value substitution. +.SS Using with Swarm or Compose .PP -When using the \f[C]lsd\f[R] subcommand, the \f[C]ListAllMyBuckets\f[R] -permission is required. +Both \f[I]Docker Swarm\f[R] and \f[I]Docker Compose\f[R] use +YAML (http://yaml.org/spec/1.2/spec.html)-formatted text files to +describe groups (stacks) of containers, their properties, networks and +volumes. +\f[I]Compose\f[R] uses the compose +v2 (https://docs.docker.com/compose/compose-file/compose-file-v2/#volume-configuration-reference) +format, \f[I]Swarm\f[R] uses the compose +v3 (https://docs.docker.com/compose/compose-file/compose-file-v3/#volume-configuration-reference) +format. +They are mostly similar, differences are explained in the docker +documentation (https://docs.docker.com/compose/compose-file/compose-versioning/#upgrading). .PP -Example policy: +Volumes are described by the children of the top-level +\f[C]volumes:\f[R] node. +Each of them should be named after its volume and have at least two +elements, the self-explanatory \f[C]driver: rclone\f[R] value and the +\f[C]driver_opts:\f[R] structure playing the same role as +\f[C]-o key=val\f[R] CLI flags: .IP .nf \f[C] -{ - \[dq]Version\[dq]: \[dq]2012-10-17\[dq], - \[dq]Statement\[dq]: [ - { - \[dq]Effect\[dq]: \[dq]Allow\[dq], - \[dq]Principal\[dq]: { - \[dq]AWS\[dq]: \[dq]arn:aws:iam::USER_SID:user/USER_NAME\[dq] - }, - \[dq]Action\[dq]: [ - \[dq]s3:ListBucket\[dq], - \[dq]s3:DeleteObject\[dq], - \[dq]s3:GetObject\[dq], - \[dq]s3:PutObject\[dq], - \[dq]s3:PutObjectAcl\[dq] - ], - \[dq]Resource\[dq]: [ - \[dq]arn:aws:s3:::BUCKET_NAME/*\[dq], - \[dq]arn:aws:s3:::BUCKET_NAME\[dq] - ] - }, - { - \[dq]Effect\[dq]: \[dq]Allow\[dq], - \[dq]Action\[dq]: \[dq]s3:ListAllMyBuckets\[dq], - \[dq]Resource\[dq]: \[dq]arn:aws:s3:::*\[dq] - } - ] -} +volumes: + volume_name_1: + driver: rclone + driver_opts: + remote: \[aq]gdrive:\[aq] + allow_other: \[aq]true\[aq] + vfs_cache_mode: full + token: \[aq]{\[dq]type\[dq]: \[dq]borrower\[dq], \[dq]expires\[dq]: \[dq]2021-12-31\[dq]}\[aq] + poll_interval: 0 \f[R] .fi .PP -Notes on above: -.IP "1." 3 -This is a policy that can be used when creating bucket. -It assumes that \f[C]USER_NAME\f[R] has been created. -.IP "2." 3 -The Resource entry must include both resource ARNs, as one implies the -bucket and the other implies the bucket\[aq]s objects. +Notice a few important details: - YAML prefers \f[C]_\f[R] in option +names instead of \f[C]-\f[R]. +- YAML treats single and double quotes interchangeably. +Simple strings and integers can be left unquoted. +- Boolean values must be quoted like \f[C]\[aq]true\[aq]\f[R] or +\f[C]\[dq]false\[dq]\f[R] because these two words are reserved by YAML. +- The filesystem string is keyed with \f[C]remote\f[R] (or with +\f[C]fs\f[R]). +Normally you can omit quotes here, but if the string ends with colon, +you \f[B]must\f[R] quote it like +\f[C]remote: \[dq]storage_box:\[dq]\f[R]. +- YAML is picky about surrounding braces in values as this is in fact +another syntax for key/value +mappings (http://yaml.org/spec/1.2/spec.html#id2790832). +For example, JSON access tokens usually contain double quotes and +surrounding braces, so you must put them in single quotes. +.SS Installing as Managed Plugin .PP -For reference, here\[aq]s an Ansible -script (https://gist.github.com/ebridges/ebfc9042dd7c756cd101cfa807b7ae2b) -that will generate one or more buckets that will work with -\f[C]rclone sync\f[R]. -.SS Key Management System (KMS) +Docker daemon can install plugins from an image registry and run them +managed. +We maintain the +docker-volume-rclone (https://hub.docker.com/p/rclone/docker-volume-rclone/) +plugin image on Docker Hub (https://hub.docker.com). .PP -If you are using server-side encryption with KMS then you must make sure -rclone is configured with \f[C]server_side_encryption = aws:kms\f[R] -otherwise you will find you can\[aq]t transfer small objects - these -will create checksum errors. -.SS Glacier and Glacier Deep Archive +Rclone volume plugin requires \f[B]Docker Engine >= 19.03.15\f[R] .PP -You can upload objects using the glacier storage class or transition -them to glacier using a lifecycle -policy (http://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-lifecycle.html). -The bucket can still be synced or copied into normally, but if rclone -tries to access data from the glacier storage class you will see an -error like below. +The plugin requires presence of two directories on the host before it +can be installed. +Note that plugin will \f[B]not\f[R] create them automatically. +By default they must exist on host at the following locations (though +you can tweak the paths): - +\f[C]/var/lib/docker-plugins/rclone/config\f[R] is reserved for the +\f[C]rclone.conf\f[R] config file and \f[B]must\f[R] exist even if +it\[aq]s empty and the config file is not present. +- \f[C]/var/lib/docker-plugins/rclone/cache\f[R] holds the plugin state +file as well as optional VFS caches. +.PP +You can install managed +plugin (https://docs.docker.com/engine/reference/commandline/plugin_install/) +with default settings as follows: .IP .nf \f[C] -2017/09/11 19:07:43 Failed to sync: failed to open source object: Object in GLACIER, restore first: path/to/file +docker plugin install rclone/docker-volume-rclone:amd64 --grant-all-permissions --alias rclone \f[R] .fi .PP -In this case you need to -restore (http://docs.aws.amazon.com/AmazonS3/latest/user-guide/restore-archived-objects.html) -the object(s) in question before using rclone. -.PP -Note that rclone only speaks the S3 API it does not speak the Glacier -Vault API, so rclone cannot directly access Glacier Vaults. -.SS Object-lock enabled S3 bucket +The \f[C]:amd64\f[R] part of the image specification after colon is +called a \f[I]tag\f[R]. +Usually you will want to install the latest plugin for your +architecture. +In this case the tag will just name it, like \f[C]amd64\f[R] above. +The following plugin architectures are currently available: - +\f[C]amd64\f[R] - \f[C]arm64\f[R] - \f[C]arm-v7\f[R] .PP -According to AWS\[aq]s documentation on S3 Object -Lock (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-overview.html#object-lock-permission): -.RS +Sometimes you might want a concrete plugin version, not the latest one. +Then you should use image tag in the form +\f[C]:ARCHITECTURE-VERSION\f[R]. +For example, to install plugin version \f[C]v1.56.2\f[R] on architecture +\f[C]arm64\f[R] you will use tag \f[C]arm64-1.56.2\f[R] (note the +removed \f[C]v\f[R]) so the full image specification becomes +\f[C]rclone/docker-volume-rclone:arm64-1.56.2\f[R]. .PP -If you configure a default retention period on a bucket, requests to -upload objects in such a bucket must include the Content-MD5 header. -.RE +We also provide the \f[C]latest\f[R] plugin tag, but since docker does +not support multi-architecture plugins as of the time of this writing, +this tag is currently an \f[B]alias for \f[CB]amd64\f[B]\f[R]. +By convention the \f[C]latest\f[R] tag is the default one and can be +omitted, thus both \f[C]rclone/docker-volume-rclone:latest\f[R] and just +\f[C]rclone/docker-volume-rclone\f[R] will refer to the latest plugin +release for the \f[C]amd64\f[R] platform. .PP -As mentioned in the Hashes section, small files that are not uploaded as -multipart, use a different tag, causing the upload to fail. -A simple solution is to set the \f[C]--s3-upload-cutoff 0\f[R] and force -all the files to be uploaded as multipart. -.SS Standard options +Also the \f[C]amd64\f[R] part can be omitted from the versioned rclone +plugin tags. +For example, rclone image reference +\f[C]rclone/docker-volume-rclone:amd64-1.56.2\f[R] can be abbreviated as +\f[C]rclone/docker-volume-rclone:1.56.2\f[R] for convenience. +However, for non-intel architectures you still have to use the full tag +as \f[C]amd64\f[R] or \f[C]latest\f[R] will fail to start. .PP -Here are the Standard options specific to s3 (Amazon S3 Compliant -Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, China -Mobile, Cloudflare, GCS, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, -IDrive e2, IONOS Cloud, Leviia, Liara, Lyve Cloud, Minio, Netease, -Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, -Tencent COS, Qiniu and Wasabi). -.SS --s3-provider +Managed plugin is in fact a special container running in a namespace +separate from normal docker containers. +Inside it runs the \f[C]rclone serve docker\f[R] command. +The config and cache directories are bind-mounted into the container at +start. +The docker daemon connects to a unix socket created by the command +inside the container. +The command creates on-demand remote mounts right inside, then docker +machinery propagates them through kernel mount namespaces and +bind-mounts into requesting user containers. .PP -Choose your S3 provider. +You can tweak a few plugin settings after installation when it\[aq]s +disabled (not in use), for instance: +.IP +.nf +\f[C] +docker plugin disable rclone +docker plugin set rclone RCLONE_VERBOSE=2 config=/etc/rclone args=\[dq]--vfs-cache-mode=writes --allow-other\[dq] +docker plugin enable rclone +docker plugin inspect rclone +\f[R] +.fi .PP -Properties: -.IP \[bu] 2 -Config: provider -.IP \[bu] 2 -Env Var: RCLONE_S3_PROVIDER -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]AWS\[dq] -.RS 2 -.IP \[bu] 2 -Amazon Web Services (AWS) S3 -.RE -.IP \[bu] 2 -\[dq]Alibaba\[dq] -.RS 2 -.IP \[bu] 2 -Alibaba Cloud Object Storage System (OSS) formerly Aliyun -.RE -.IP \[bu] 2 -\[dq]ArvanCloud\[dq] -.RS 2 -.IP \[bu] 2 -Arvan Cloud Object Storage (AOS) -.RE -.IP \[bu] 2 -\[dq]Ceph\[dq] -.RS 2 -.IP \[bu] 2 -Ceph Object Storage -.RE -.IP \[bu] 2 -\[dq]ChinaMobile\[dq] -.RS 2 -.IP \[bu] 2 -China Mobile Ecloud Elastic Object Storage (EOS) -.RE -.IP \[bu] 2 -\[dq]Cloudflare\[dq] -.RS 2 -.IP \[bu] 2 -Cloudflare R2 Storage -.RE -.IP \[bu] 2 -\[dq]DigitalOcean\[dq] -.RS 2 -.IP \[bu] 2 -DigitalOcean Spaces -.RE -.IP \[bu] 2 -\[dq]Dreamhost\[dq] -.RS 2 -.IP \[bu] 2 -Dreamhost DreamObjects -.RE -.IP \[bu] 2 -\[dq]GCS\[dq] -.RS 2 -.IP \[bu] 2 -Google Cloud Storage -.RE -.IP \[bu] 2 -\[dq]HuaweiOBS\[dq] -.RS 2 -.IP \[bu] 2 -Huawei Object Storage Service -.RE -.IP \[bu] 2 -\[dq]IBMCOS\[dq] -.RS 2 -.IP \[bu] 2 -IBM COS S3 -.RE -.IP \[bu] 2 -\[dq]IDrive\[dq] -.RS 2 -.IP \[bu] 2 -IDrive e2 -.RE -.IP \[bu] 2 -\[dq]IONOS\[dq] -.RS 2 -.IP \[bu] 2 -IONOS Cloud -.RE -.IP \[bu] 2 -\[dq]LyveCloud\[dq] -.RS 2 -.IP \[bu] 2 -Seagate Lyve Cloud -.RE -.IP \[bu] 2 -\[dq]Leviia\[dq] -.RS 2 -.IP \[bu] 2 -Leviia Object Storage -.RE -.IP \[bu] 2 -\[dq]Liara\[dq] -.RS 2 -.IP \[bu] 2 -Liara Object Storage -.RE -.IP \[bu] 2 -\[dq]Minio\[dq] -.RS 2 -.IP \[bu] 2 -Minio Object Storage -.RE -.IP \[bu] 2 -\[dq]Netease\[dq] -.RS 2 -.IP \[bu] 2 -Netease Object Storage (NOS) -.RE -.IP \[bu] 2 -\[dq]Petabox\[dq] -.RS 2 -.IP \[bu] 2 -Petabox Object Storage -.RE -.IP \[bu] 2 -\[dq]RackCorp\[dq] -.RS 2 -.IP \[bu] 2 -RackCorp Object Storage -.RE -.IP \[bu] 2 -\[dq]Scaleway\[dq] -.RS 2 -.IP \[bu] 2 -Scaleway Object Storage -.RE -.IP \[bu] 2 -\[dq]SeaweedFS\[dq] -.RS 2 -.IP \[bu] 2 -SeaweedFS S3 -.RE -.IP \[bu] 2 -\[dq]StackPath\[dq] -.RS 2 -.IP \[bu] 2 -StackPath Object Storage -.RE -.IP \[bu] 2 -\[dq]Storj\[dq] -.RS 2 -.IP \[bu] 2 -Storj (S3 Compatible Gateway) -.RE -.IP \[bu] 2 -\[dq]Synology\[dq] -.RS 2 -.IP \[bu] 2 -Synology C2 Object Storage -.RE -.IP \[bu] 2 -\[dq]TencentCOS\[dq] -.RS 2 -.IP \[bu] 2 -Tencent Cloud Object Storage (COS) -.RE -.IP \[bu] 2 -\[dq]Wasabi\[dq] -.RS 2 -.IP \[bu] 2 -Wasabi Object Storage -.RE -.IP \[bu] 2 -\[dq]Qiniu\[dq] -.RS 2 -.IP \[bu] 2 -Qiniu Object Storage (Kodo) -.RE -.IP \[bu] 2 -\[dq]Other\[dq] -.RS 2 -.IP \[bu] 2 -Any other S3 compatible provider -.RE -.RE -.SS --s3-env-auth +Note that if docker refuses to disable the plugin, you should find and +remove all active volumes connected with it as well as containers and +swarm services that use them. +This is rather tedious so please carefully plan in advance. .PP -Get AWS credentials from runtime (environment variables or EC2/ECS meta -data if no env vars). +You can tweak the following settings: \f[C]args\f[R], \f[C]config\f[R], +\f[C]cache\f[R], \f[C]HTTP_PROXY\f[R], \f[C]HTTPS_PROXY\f[R], +\f[C]NO_PROXY\f[R] and \f[C]RCLONE_VERBOSE\f[R]. +It\[aq]s \f[I]your\f[R] task to keep plugin settings in sync across +swarm cluster nodes. .PP -Only applies if access_key_id and secret_access_key is blank. +\f[C]args\f[R] sets command-line arguments for the +\f[C]rclone serve docker\f[R] command (\f[I]none\f[R] by default). +Arguments should be separated by space so you will normally want to put +them in quotes on the docker plugin +set (https://docs.docker.com/engine/reference/commandline/plugin_set/) +command line. +Both serve docker +flags (https://rclone.org/commands/rclone_serve_docker/#options) and +generic rclone flags (https://rclone.org/flags/) are supported, +including backend parameters that will be used as defaults for volume +creation. +Note that plugin will fail (due to this docker +bug (https://github.com/moby/moby/blob/v20.10.7/plugin/v2/plugin.go#L195)) +if the \f[C]args\f[R] value is empty. +Use e.g. +\f[C]args=\[dq]-v\[dq]\f[R] as a workaround. .PP -Properties: -.IP \[bu] 2 -Config: env_auth -.IP \[bu] 2 -Env Var: RCLONE_S3_ENV_AUTH -.IP \[bu] 2 -Type: bool -.IP \[bu] 2 -Default: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]false\[dq] -.RS 2 -.IP \[bu] 2 -Enter AWS credentials in the next step. -.RE -.IP \[bu] 2 -\[dq]true\[dq] -.RS 2 -.IP \[bu] 2 -Get AWS credentials from the environment (env vars or IAM). -.RE -.RE -.SS --s3-access-key-id +\f[C]config=/host/dir\f[R] sets alternative host location for the config +directory. +Plugin will look for \f[C]rclone.conf\f[R] here. +It\[aq]s not an error if the config file is not present but the +directory must exist. +Please note that plugin can periodically rewrite the config file, for +example when it renews storage access tokens. +Keep this in mind and try to avoid races between the plugin and other +instances of rclone on the host that might try to change the config +simultaneously resulting in corrupted \f[C]rclone.conf\f[R]. +You can also put stuff like private key files for SFTP remotes in this +directory. +Just note that it\[aq]s bind-mounted inside the plugin container at the +predefined path \f[C]/data/config\f[R]. +For example, if your key file is named \f[C]sftp-box1.key\f[R] on the +host, the corresponding volume config option should read +\f[C]-o sftp-key-file=/data/config/sftp-box1.key\f[R]. .PP -AWS Access Key ID. +\f[C]cache=/host/dir\f[R] sets alternative host location for the +\f[I]cache\f[R] directory. +The plugin will keep VFS caches here. +Also it will create and maintain the \f[C]docker-plugin.state\f[R] file +in this directory. +When the plugin is restarted or reinstalled, it will look in this file +to recreate any volumes that existed previously. +However, they will not be re-mounted into consuming containers after +restart. +Usually this is not a problem as the docker daemon normally will restart +affected user containers after failures, daemon restarts or host +reboots. .PP -Leave blank for anonymous access or runtime credentials. +\f[C]RCLONE_VERBOSE\f[R] sets plugin verbosity from \f[C]0\f[R] (errors +only, by default) to \f[C]2\f[R] (debugging). +Verbosity can be also tweaked via \f[C]args=\[dq]-v [-v] ...\[dq]\f[R]. +Since arguments are more generic, you will rarely need this setting. +The plugin output by default feeds the docker daemon log on local host. +Log entries are reflected as \f[I]errors\f[R] in the docker log but +retain their actual level assigned by rclone in the encapsulated message +string. .PP -Properties: -.IP \[bu] 2 -Config: access_key_id -.IP \[bu] 2 -Env Var: RCLONE_S3_ACCESS_KEY_ID -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.SS --s3-secret-access-key +\f[C]HTTP_PROXY\f[R], \f[C]HTTPS_PROXY\f[R], \f[C]NO_PROXY\f[R] +customize the plugin proxy settings. .PP -AWS Secret Access Key (password). +You can set custom plugin options right when you install it, \f[I]in one +go\f[R]: +.IP +.nf +\f[C] +docker plugin remove rclone +docker plugin install rclone/docker-volume-rclone:amd64 \[rs] + --alias rclone --grant-all-permissions \[rs] + args=\[dq]-v --allow-other\[dq] config=/etc/rclone +docker plugin inspect rclone +\f[R] +.fi +.SS Healthchecks .PP -Leave blank for anonymous access or runtime credentials. +The docker plugin volume protocol doesn\[aq]t provide a way for plugins +to inform the docker daemon that a volume is (un-)available. +As a workaround you can setup a healthcheck to verify that the mount is +responding, for example: +.IP +.nf +\f[C] +services: + my_service: + image: my_image + healthcheck: + test: ls /path/to/rclone/mount || exit 1 + interval: 1m + timeout: 15s + retries: 3 + start_period: 15s +\f[R] +.fi +.SS Running Plugin under Systemd .PP -Properties: -.IP \[bu] 2 -Config: secret_access_key -.IP \[bu] 2 -Env Var: RCLONE_S3_SECRET_ACCESS_KEY -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.SS --s3-region +In most cases you should prefer managed mode. +Moreover, MacOS and Windows do not support native Docker plugins. +Please use managed mode on these systems. +Proceed further only if you are on Linux. .PP -Region to connect to. +First, install rclone (https://rclone.org/install/). +You can just run it (type \f[C]rclone serve docker\f[R] and hit enter) +for the test. .PP -Properties: -.IP \[bu] 2 -Config: region -.IP \[bu] 2 -Env Var: RCLONE_S3_REGION -.IP \[bu] 2 -Provider: AWS -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]us-east-1\[dq] -.RS 2 -.IP \[bu] 2 -The default endpoint - a good choice if you are unsure. -.IP \[bu] 2 -US Region, Northern Virginia, or Pacific Northwest. -.IP \[bu] 2 -Leave location constraint empty. -.RE -.IP \[bu] 2 -\[dq]us-east-2\[dq] -.RS 2 -.IP \[bu] 2 -US East (Ohio) Region. -.IP \[bu] 2 -Needs location constraint us-east-2. -.RE -.IP \[bu] 2 -\[dq]us-west-1\[dq] -.RS 2 -.IP \[bu] 2 -US West (Northern California) Region. -.IP \[bu] 2 -Needs location constraint us-west-1. -.RE -.IP \[bu] 2 -\[dq]us-west-2\[dq] -.RS 2 -.IP \[bu] 2 -US West (Oregon) Region. -.IP \[bu] 2 -Needs location constraint us-west-2. -.RE -.IP \[bu] 2 -\[dq]ca-central-1\[dq] -.RS 2 -.IP \[bu] 2 -Canada (Central) Region. -.IP \[bu] 2 -Needs location constraint ca-central-1. -.RE -.IP \[bu] 2 -\[dq]eu-west-1\[dq] -.RS 2 -.IP \[bu] 2 -EU (Ireland) Region. -.IP \[bu] 2 -Needs location constraint EU or eu-west-1. -.RE -.IP \[bu] 2 -\[dq]eu-west-2\[dq] -.RS 2 -.IP \[bu] 2 -EU (London) Region. -.IP \[bu] 2 -Needs location constraint eu-west-2. -.RE -.IP \[bu] 2 -\[dq]eu-west-3\[dq] -.RS 2 -.IP \[bu] 2 -EU (Paris) Region. -.IP \[bu] 2 -Needs location constraint eu-west-3. -.RE -.IP \[bu] 2 -\[dq]eu-north-1\[dq] -.RS 2 -.IP \[bu] 2 -EU (Stockholm) Region. -.IP \[bu] 2 -Needs location constraint eu-north-1. -.RE -.IP \[bu] 2 -\[dq]eu-south-1\[dq] -.RS 2 -.IP \[bu] 2 -EU (Milan) Region. -.IP \[bu] 2 -Needs location constraint eu-south-1. -.RE -.IP \[bu] 2 -\[dq]eu-central-1\[dq] -.RS 2 -.IP \[bu] 2 -EU (Frankfurt) Region. -.IP \[bu] 2 -Needs location constraint eu-central-1. -.RE -.IP \[bu] 2 -\[dq]ap-southeast-1\[dq] -.RS 2 -.IP \[bu] 2 -Asia Pacific (Singapore) Region. -.IP \[bu] 2 -Needs location constraint ap-southeast-1. -.RE -.IP \[bu] 2 -\[dq]ap-southeast-2\[dq] -.RS 2 -.IP \[bu] 2 -Asia Pacific (Sydney) Region. -.IP \[bu] 2 -Needs location constraint ap-southeast-2. -.RE -.IP \[bu] 2 -\[dq]ap-northeast-1\[dq] -.RS 2 -.IP \[bu] 2 -Asia Pacific (Tokyo) Region. -.IP \[bu] 2 -Needs location constraint ap-northeast-1. -.RE -.IP \[bu] 2 -\[dq]ap-northeast-2\[dq] -.RS 2 -.IP \[bu] 2 -Asia Pacific (Seoul). -.IP \[bu] 2 -Needs location constraint ap-northeast-2. -.RE -.IP \[bu] 2 -\[dq]ap-northeast-3\[dq] -.RS 2 -.IP \[bu] 2 -Asia Pacific (Osaka-Local). -.IP \[bu] 2 -Needs location constraint ap-northeast-3. -.RE -.IP \[bu] 2 -\[dq]ap-south-1\[dq] -.RS 2 -.IP \[bu] 2 -Asia Pacific (Mumbai). -.IP \[bu] 2 -Needs location constraint ap-south-1. -.RE -.IP \[bu] 2 -\[dq]ap-east-1\[dq] -.RS 2 -.IP \[bu] 2 -Asia Pacific (Hong Kong) Region. -.IP \[bu] 2 -Needs location constraint ap-east-1. -.RE -.IP \[bu] 2 -\[dq]sa-east-1\[dq] -.RS 2 -.IP \[bu] 2 -South America (Sao Paulo) Region. -.IP \[bu] 2 -Needs location constraint sa-east-1. -.RE -.IP \[bu] 2 -\[dq]me-south-1\[dq] -.RS 2 -.IP \[bu] 2 -Middle East (Bahrain) Region. -.IP \[bu] 2 -Needs location constraint me-south-1. -.RE -.IP \[bu] 2 -\[dq]af-south-1\[dq] -.RS 2 -.IP \[bu] 2 -Africa (Cape Town) Region. -.IP \[bu] 2 -Needs location constraint af-south-1. -.RE -.IP \[bu] 2 -\[dq]cn-north-1\[dq] -.RS 2 -.IP \[bu] 2 -China (Beijing) Region. -.IP \[bu] 2 -Needs location constraint cn-north-1. -.RE -.IP \[bu] 2 -\[dq]cn-northwest-1\[dq] -.RS 2 -.IP \[bu] 2 -China (Ningxia) Region. -.IP \[bu] 2 -Needs location constraint cn-northwest-1. -.RE -.IP \[bu] 2 -\[dq]us-gov-east-1\[dq] -.RS 2 -.IP \[bu] 2 -AWS GovCloud (US-East) Region. -.IP \[bu] 2 -Needs location constraint us-gov-east-1. -.RE -.IP \[bu] 2 -\[dq]us-gov-west-1\[dq] -.RS 2 -.IP \[bu] 2 -AWS GovCloud (US) Region. -.IP \[bu] 2 -Needs location constraint us-gov-west-1. -.RE -.RE -.SS --s3-region +Install \f[I]FUSE\f[R]: +.IP +.nf +\f[C] +sudo apt-get -y install fuse +\f[R] +.fi .PP -region - the location where your bucket will be created and your data -stored. +Download two systemd configuration files: +docker-volume-rclone.service (https://raw.githubusercontent.com/rclone/rclone/master/contrib/docker-plugin/systemd/docker-volume-rclone.service) +and +docker-volume-rclone.socket (https://raw.githubusercontent.com/rclone/rclone/master/contrib/docker-plugin/systemd/docker-volume-rclone.socket). .PP -Properties: -.IP \[bu] 2 -Config: region -.IP \[bu] 2 -Env Var: RCLONE_S3_REGION -.IP \[bu] 2 -Provider: RackCorp -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]global\[dq] -.RS 2 -.IP \[bu] 2 -Global CDN (All locations) Region -.RE -.IP \[bu] 2 -\[dq]au\[dq] -.RS 2 -.IP \[bu] 2 -Australia (All states) -.RE -.IP \[bu] 2 -\[dq]au-nsw\[dq] -.RS 2 -.IP \[bu] 2 -NSW (Australia) Region -.RE -.IP \[bu] 2 -\[dq]au-qld\[dq] -.RS 2 -.IP \[bu] 2 -QLD (Australia) Region -.RE -.IP \[bu] 2 -\[dq]au-vic\[dq] -.RS 2 -.IP \[bu] 2 -VIC (Australia) Region -.RE -.IP \[bu] 2 -\[dq]au-wa\[dq] -.RS 2 -.IP \[bu] 2 -Perth (Australia) Region -.RE -.IP \[bu] 2 -\[dq]ph\[dq] -.RS 2 -.IP \[bu] 2 -Manila (Philippines) Region -.RE -.IP \[bu] 2 -\[dq]th\[dq] -.RS 2 -.IP \[bu] 2 -Bangkok (Thailand) Region -.RE -.IP \[bu] 2 -\[dq]hk\[dq] -.RS 2 -.IP \[bu] 2 -HK (Hong Kong) Region -.RE -.IP \[bu] 2 -\[dq]mn\[dq] -.RS 2 -.IP \[bu] 2 -Ulaanbaatar (Mongolia) Region -.RE -.IP \[bu] 2 -\[dq]kg\[dq] -.RS 2 -.IP \[bu] 2 -Bishkek (Kyrgyzstan) Region -.RE -.IP \[bu] 2 -\[dq]id\[dq] -.RS 2 -.IP \[bu] 2 -Jakarta (Indonesia) Region -.RE -.IP \[bu] 2 -\[dq]jp\[dq] -.RS 2 -.IP \[bu] 2 -Tokyo (Japan) Region -.RE -.IP \[bu] 2 -\[dq]sg\[dq] -.RS 2 -.IP \[bu] 2 -SG (Singapore) Region -.RE -.IP \[bu] 2 -\[dq]de\[dq] -.RS 2 -.IP \[bu] 2 -Frankfurt (Germany) Region -.RE -.IP \[bu] 2 -\[dq]us\[dq] -.RS 2 -.IP \[bu] 2 -USA (AnyCast) Region -.RE -.IP \[bu] 2 -\[dq]us-east-1\[dq] -.RS 2 -.IP \[bu] 2 -New York (USA) Region -.RE -.IP \[bu] 2 -\[dq]us-west-1\[dq] -.RS 2 -.IP \[bu] 2 -Freemont (USA) Region -.RE -.IP \[bu] 2 -\[dq]nz\[dq] -.RS 2 -.IP \[bu] 2 -Auckland (New Zealand) Region -.RE -.RE -.SS --s3-region +Put them to the \f[C]/etc/systemd/system/\f[R] directory: +.IP +.nf +\f[C] +cp docker-volume-plugin.service /etc/systemd/system/ +cp docker-volume-plugin.socket /etc/systemd/system/ +\f[R] +.fi +.PP +Please note that all commands in this section must be run as +\f[I]root\f[R] but we omit \f[C]sudo\f[R] prefix for brevity. +Now create directories required by the service: +.IP +.nf +\f[C] +mkdir -p /var/lib/docker-volumes/rclone +mkdir -p /var/lib/docker-plugins/rclone/config +mkdir -p /var/lib/docker-plugins/rclone/cache +\f[R] +.fi +.PP +Run the docker plugin service in the socket activated mode: +.IP +.nf +\f[C] +systemctl daemon-reload +systemctl start docker-volume-rclone.service +systemctl enable docker-volume-rclone.socket +systemctl start docker-volume-rclone.socket +systemctl restart docker +\f[R] +.fi +.PP +Or run the service directly: - run \f[C]systemctl daemon-reload\f[R] to +let systemd pick up new config - run +\f[C]systemctl enable docker-volume-rclone.service\f[R] to make the new +service start automatically when you power on your machine. +- run \f[C]systemctl start docker-volume-rclone.service\f[R] to start +the service now. +- run \f[C]systemctl restart docker\f[R] to restart docker daemon and +let it detect the new plugin socket. +Note that this step is not needed in managed mode where docker knows +about plugin state changes. .PP -Region to connect to. +The two methods are equivalent from the user perspective, but I +personally prefer socket activation. +.SS Troubleshooting .PP -Properties: -.IP \[bu] 2 -Config: region -.IP \[bu] 2 -Env Var: RCLONE_S3_REGION -.IP \[bu] 2 -Provider: Scaleway -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]nl-ams\[dq] -.RS 2 -.IP \[bu] 2 -Amsterdam, The Netherlands -.RE -.IP \[bu] 2 -\[dq]fr-par\[dq] -.RS 2 -.IP \[bu] 2 -Paris, France -.RE -.IP \[bu] 2 -\[dq]pl-waw\[dq] -.RS 2 -.IP \[bu] 2 -Warsaw, Poland -.RE -.RE -.SS --s3-region +You can see managed plugin +settings (https://docs.docker.com/engine/extend/#debugging-plugins) with +.IP +.nf +\f[C] +docker plugin list +docker plugin inspect rclone +\f[R] +.fi .PP -Region to connect to. -- the location where your bucket will be created and your data stored. -Need bo be same with your endpoint. +Note that docker (including latest 20.10.7) will not show actual values +of \f[C]args\f[R], just the defaults. .PP -Properties: -.IP \[bu] 2 -Config: region -.IP \[bu] 2 -Env Var: RCLONE_S3_REGION -.IP \[bu] 2 -Provider: HuaweiOBS -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]af-south-1\[dq] -.RS 2 -.IP \[bu] 2 -AF-Johannesburg -.RE -.IP \[bu] 2 -\[dq]ap-southeast-2\[dq] -.RS 2 -.IP \[bu] 2 -AP-Bangkok -.RE -.IP \[bu] 2 -\[dq]ap-southeast-3\[dq] -.RS 2 -.IP \[bu] 2 -AP-Singapore -.RE -.IP \[bu] 2 -\[dq]cn-east-3\[dq] -.RS 2 -.IP \[bu] 2 -CN East-Shanghai1 -.RE -.IP \[bu] 2 -\[dq]cn-east-2\[dq] -.RS 2 -.IP \[bu] 2 -CN East-Shanghai2 -.RE -.IP \[bu] 2 -\[dq]cn-north-1\[dq] -.RS 2 -.IP \[bu] 2 -CN North-Beijing1 -.RE -.IP \[bu] 2 -\[dq]cn-north-4\[dq] -.RS 2 -.IP \[bu] 2 -CN North-Beijing4 -.RE -.IP \[bu] 2 -\[dq]cn-south-1\[dq] -.RS 2 -.IP \[bu] 2 -CN South-Guangzhou -.RE -.IP \[bu] 2 -\[dq]ap-southeast-1\[dq] -.RS 2 -.IP \[bu] 2 -CN-Hong Kong -.RE -.IP \[bu] 2 -\[dq]sa-argentina-1\[dq] -.RS 2 -.IP \[bu] 2 -LA-Buenos Aires1 -.RE -.IP \[bu] 2 -\[dq]sa-peru-1\[dq] -.RS 2 -.IP \[bu] 2 -LA-Lima1 -.RE -.IP \[bu] 2 -\[dq]na-mexico-1\[dq] -.RS 2 -.IP \[bu] 2 -LA-Mexico City1 -.RE -.IP \[bu] 2 -\[dq]sa-chile-1\[dq] -.RS 2 -.IP \[bu] 2 -LA-Santiago2 -.RE -.IP \[bu] 2 -\[dq]sa-brazil-1\[dq] -.RS 2 -.IP \[bu] 2 -LA-Sao Paulo1 -.RE -.IP \[bu] 2 -\[dq]ru-northwest-2\[dq] -.RS 2 -.IP \[bu] 2 -RU-Moscow2 -.RE -.RE -.SS --s3-region +Use \f[C]journalctl --unit docker\f[R] to see managed plugin output as +part of the docker daemon log. +Note that docker reflects plugin lines as \f[I]errors\f[R] but their +actual level can be seen from encapsulated message string. .PP -Region to connect to. +You will usually install the latest version of managed plugin for your +platform. +Use the following commands to print the actual installed version: +.IP +.nf +\f[C] +PLUGID=$(docker plugin list --no-trunc | awk \[aq]/rclone/{print$1}\[aq]) +sudo runc --root /run/docker/runtime-runc/plugins.moby exec $PLUGID rclone version +\f[R] +.fi .PP -Properties: -.IP \[bu] 2 -Config: region -.IP \[bu] 2 -Env Var: RCLONE_S3_REGION -.IP \[bu] 2 -Provider: Cloudflare -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]auto\[dq] -.RS 2 -.IP \[bu] 2 -R2 buckets are automatically distributed across Cloudflare\[aq]s data -centers for low latency. -.RE -.RE -.SS --s3-region +You can even use \f[C]runc\f[R] to run shell inside the plugin +container: +.IP +.nf +\f[C] +sudo runc --root /run/docker/runtime-runc/plugins.moby exec --tty $PLUGID bash +\f[R] +.fi .PP -Region to connect to. +Also you can use curl to check the plugin socket connectivity: +.IP +.nf +\f[C] +docker plugin list --no-trunc +PLUGID=123abc... +sudo curl -H Content-Type:application/json -XPOST -d {} --unix-socket /run/docker/plugins/$PLUGID/rclone.sock http://localhost/Plugin.Activate +\f[R] +.fi .PP -Properties: -.IP \[bu] 2 -Config: region -.IP \[bu] 2 -Env Var: RCLONE_S3_REGION -.IP \[bu] 2 -Provider: Qiniu -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]cn-east-1\[dq] -.RS 2 -.IP \[bu] 2 -The default endpoint - a good choice if you are unsure. -.IP \[bu] 2 -East China Region 1. -.IP \[bu] 2 -Needs location constraint cn-east-1. -.RE -.IP \[bu] 2 -\[dq]cn-east-2\[dq] -.RS 2 -.IP \[bu] 2 -East China Region 2. -.IP \[bu] 2 -Needs location constraint cn-east-2. -.RE -.IP \[bu] 2 -\[dq]cn-north-1\[dq] -.RS 2 -.IP \[bu] 2 -North China Region 1. -.IP \[bu] 2 -Needs location constraint cn-north-1. -.RE -.IP \[bu] 2 -\[dq]cn-south-1\[dq] -.RS 2 -.IP \[bu] 2 -South China Region 1. -.IP \[bu] 2 -Needs location constraint cn-south-1. -.RE -.IP \[bu] 2 -\[dq]us-north-1\[dq] -.RS 2 -.IP \[bu] 2 -North America Region. -.IP \[bu] 2 -Needs location constraint us-north-1. -.RE -.IP \[bu] 2 -\[dq]ap-southeast-1\[dq] -.RS 2 -.IP \[bu] 2 -Southeast Asia Region 1. -.IP \[bu] 2 -Needs location constraint ap-southeast-1. -.RE -.IP \[bu] 2 -\[dq]ap-northeast-1\[dq] -.RS 2 -.IP \[bu] 2 -Northeast Asia Region 1. -.IP \[bu] 2 -Needs location constraint ap-northeast-1. -.RE -.RE -.SS --s3-region +though this is rarely needed. +.SS Caveats .PP -Region where your bucket will be created and your data stored. +Finally I\[aq]d like to mention a \f[I]caveat with updating volume +settings\f[R]. +Docker CLI does not have a dedicated command like +\f[C]docker volume update\f[R]. +It may be tempting to invoke \f[C]docker volume create\f[R] with updated +options on existing volume, but there is a gotcha. +The command will do nothing, it won\[aq]t even return an error. +I hope that docker maintainers will fix this some day. +In the meantime be aware that you must remove your volume before +recreating it with new settings: +.IP +.nf +\f[C] +docker volume remove my_vol +docker volume create my_vol -d rclone -o opt1=new_val1 ... +\f[R] +.fi .PP -Properties: -.IP \[bu] 2 -Config: region -.IP \[bu] 2 -Env Var: RCLONE_S3_REGION -.IP \[bu] 2 -Provider: IONOS -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false +and verify that settings did update: +.IP +.nf +\f[C] +docker volume list +docker volume inspect my_vol +\f[R] +.fi +.PP +If docker refuses to remove the volume, you should find containers or +swarm services that use it and stop them first. +.SS Getting started .IP \[bu] 2 -Examples: -.RS 2 +Install rclone (https://rclone.org/install/) and setup your remotes. .IP \[bu] 2 -\[dq]de\[dq] -.RS 2 +Bisync will create its working directory at +\f[C]\[ti]/.cache/rclone/bisync\f[R] on Linux or +\f[C]C:\[rs]Users\[rs]MyLogin\[rs]AppData\[rs]Local\[rs]rclone\[rs]bisync\f[R] +on Windows. +Make sure that this location is writable. .IP \[bu] 2 -Frankfurt, Germany -.RE +Run bisync with the \f[C]--resync\f[R] flag, specifying the paths to the +local and remote sync directory roots. .IP \[bu] 2 -\[dq]eu-central-2\[dq] -.RS 2 +For successive sync runs, leave off the \f[C]--resync\f[R] flag. .IP \[bu] 2 -Berlin, Germany -.RE +Consider using a filters file for excluding unnecessary files and +directories from the sync. .IP \[bu] 2 -\[dq]eu-south-2\[dq] -.RS 2 +Consider setting up the --check-access feature for safety. .IP \[bu] 2 -Logrono, Spain -.RE -.RE -.SS --s3-region +On Linux, consider setting up a crontab entry. +bisync can safely run in concurrent cron jobs thanks to lock files it +maintains. .PP -Region where your bucket will be created and your data stored. +Here is a typical run log (with timestamps removed for clarity): +.IP +.nf +\f[C] +rclone bisync /testdir/path1/ /testdir/path2/ --verbose +INFO : Synching Path1 \[dq]/testdir/path1/\[dq] with Path2 \[dq]/testdir/path2/\[dq] +INFO : Path1 checking for diffs +INFO : - Path1 File is new - file11.txt +INFO : - Path1 File is newer - file2.txt +INFO : - Path1 File is newer - file5.txt +INFO : - Path1 File is newer - file7.txt +INFO : - Path1 File was deleted - file4.txt +INFO : - Path1 File was deleted - file6.txt +INFO : - Path1 File was deleted - file8.txt +INFO : Path1: 7 changes: 1 new, 3 newer, 0 older, 3 deleted +INFO : Path2 checking for diffs +INFO : - Path2 File is new - file10.txt +INFO : - Path2 File is newer - file1.txt +INFO : - Path2 File is newer - file5.txt +INFO : - Path2 File is newer - file6.txt +INFO : - Path2 File was deleted - file3.txt +INFO : - Path2 File was deleted - file7.txt +INFO : - Path2 File was deleted - file8.txt +INFO : Path2: 7 changes: 1 new, 3 newer, 0 older, 3 deleted +INFO : Applying changes +INFO : - Path1 Queue copy to Path2 - /testdir/path2/file11.txt +INFO : - Path1 Queue copy to Path2 - /testdir/path2/file2.txt +INFO : - Path2 Queue delete - /testdir/path2/file4.txt +NOTICE: - WARNING New or changed in both paths - file5.txt +NOTICE: - Path1 Renaming Path1 copy - /testdir/path1/file5.txt..path1 +NOTICE: - Path1 Queue copy to Path2 - /testdir/path2/file5.txt..path1 +NOTICE: - Path2 Renaming Path2 copy - /testdir/path2/file5.txt..path2 +NOTICE: - Path2 Queue copy to Path1 - /testdir/path1/file5.txt..path2 +INFO : - Path2 Queue copy to Path1 - /testdir/path1/file6.txt +INFO : - Path1 Queue copy to Path2 - /testdir/path2/file7.txt +INFO : - Path2 Queue copy to Path1 - /testdir/path1/file1.txt +INFO : - Path2 Queue copy to Path1 - /testdir/path1/file10.txt +INFO : - Path1 Queue delete - /testdir/path1/file3.txt +INFO : - Path2 Do queued copies to - Path1 +INFO : - Path1 Do queued copies to - Path2 +INFO : - Do queued deletes on - Path1 +INFO : - Do queued deletes on - Path2 +INFO : Updating listings +INFO : Validating listings for Path1 \[dq]/testdir/path1/\[dq] vs Path2 \[dq]/testdir/path2/\[dq] +INFO : Bisync successful +\f[R] +.fi +.SS Command line syntax +.IP +.nf +\f[C] +$ rclone bisync --help +Usage: + rclone bisync remote1:path1 remote2:path2 [flags] + +Positional arguments: + Path1, Path2 Local path, or remote storage with \[aq]:\[aq] plus optional path. + Type \[aq]rclone listremotes\[aq] for list of configured remotes. + +Optional Flags: + --check-access Ensure expected \[ga]RCLONE_TEST\[ga] files are found on + both Path1 and Path2 filesystems, else abort. + --check-filename FILENAME Filename for \[ga]--check-access\[ga] (default: \[ga]RCLONE_TEST\[ga]) + --check-sync CHOICE Controls comparison of final listings: + \[ga]true | false | only\[ga] (default: true) + If set to \[ga]only\[ga], bisync will only compare listings + from the last run but skip actual sync. + --filters-file PATH Read filtering patterns from a file + --max-delete PERCENT Safety check on maximum percentage of deleted files allowed. + If exceeded, the bisync run will abort. (default: 50%) + --force Bypass \[ga]--max-delete\[ga] safety check and run the sync. + Consider using with \[ga]--verbose\[ga] + --create-empty-src-dirs Sync creation and deletion of empty directories. + (Not compatible with --remove-empty-dirs) + --remove-empty-dirs Remove empty directories at the final cleanup step. + -1, --resync Performs the resync run. + Warning: Path1 files may overwrite Path2 versions. + Consider using \[ga]--verbose\[ga] or \[ga]--dry-run\[ga] first. + --ignore-listing-checksum Do not use checksums for listings + (add --ignore-checksum to additionally skip post-copy checksum checks) + --resilient Allow future runs to retry after certain less-serious errors, + instead of requiring --resync. Use at your own risk! + --localtime Use local time in listings (default: UTC) + --no-cleanup Retain working files (useful for troubleshooting and testing). + --workdir PATH Use custom working directory (useful for testing). + (default: \[ga]\[ti]/.cache/rclone/bisync\[ga]) + -n, --dry-run Go through the motions - No files are copied/deleted. + -v, --verbose Increases logging verbosity. + May be specified more than once for more details. + -h, --help help for bisync +\f[R] +.fi .PP -Properties: -.IP \[bu] 2 -Config: region -.IP \[bu] 2 -Env Var: RCLONE_S3_REGION -.IP \[bu] 2 -Provider: Petabox -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]us-east-1\[dq] -.RS 2 -.IP \[bu] 2 -US East (N. -Virginia) -.RE -.IP \[bu] 2 -\[dq]eu-central-1\[dq] -.RS 2 -.IP \[bu] 2 -Europe (Frankfurt) -.RE -.IP \[bu] 2 -\[dq]ap-southeast-1\[dq] -.RS 2 -.IP \[bu] 2 -Asia Pacific (Singapore) -.RE -.IP \[bu] 2 -\[dq]me-south-1\[dq] -.RS 2 -.IP \[bu] 2 -Middle East (Bahrain) -.RE -.IP \[bu] 2 -\[dq]sa-east-1\[dq] -.RS 2 -.IP \[bu] 2 -South America (S\[~a]o Paulo) -.RE -.RE -.SS --s3-region +Arbitrary rclone flags may be specified on the bisync command +line (https://rclone.org/commands/rclone_bisync/), for example +\f[C]rclone bisync ./testdir/path1/ gdrive:testdir/path2/ --drive-skip-gdocs -v -v --timeout 10s\f[R] +Note that interactions of various rclone flags with bisync process flow +has not been fully tested yet. +.SS Paths .PP -Region where your data stored. +Path1 and Path2 arguments may be references to any mix of local +directory paths (absolute or relative), UNC paths +(\f[C]//server/share/path\f[R]), Windows drive paths (with a drive +letter and \f[C]:\f[R]) or configured +remotes (https://rclone.org/docs/#syntax-of-remote-paths) with optional +subdirectory paths. +Cloud references are distinguished by having a \f[C]:\f[R] in the +argument (see Windows support below). .PP -Properties: -.IP \[bu] 2 -Config: region -.IP \[bu] 2 -Env Var: RCLONE_S3_REGION -.IP \[bu] 2 -Provider: Synology -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]eu-001\[dq] -.RS 2 -.IP \[bu] 2 -Europe Region 1 -.RE -.IP \[bu] 2 -\[dq]eu-002\[dq] -.RS 2 -.IP \[bu] 2 -Europe Region 2 -.RE -.IP \[bu] 2 -\[dq]us-001\[dq] -.RS 2 -.IP \[bu] 2 -US Region 1 -.RE -.IP \[bu] 2 -\[dq]us-002\[dq] -.RS 2 -.IP \[bu] 2 -US Region 2 -.RE -.IP \[bu] 2 -\[dq]tw-001\[dq] -.RS 2 -.IP \[bu] 2 -Asia (Taiwan) -.RE -.RE -.SS --s3-region +Path1 and Path2 are treated equally, in that neither has priority for +file changes (except during \f[C]--resync\f[R]), and access efficiency +does not change whether a remote is on Path1 or Path2. +.PP +The listings in bisync working directory (default: +\f[C]\[ti]/.cache/rclone/bisync\f[R]) are named based on the Path1 and +Path2 arguments so that separate syncs to individual directories within +the tree may be set up, e.g.: +\f[C]path_to_local_tree..dropbox_subdir.lst\f[R]. +.PP +Any empty directories after the sync on both the Path1 and Path2 +filesystems are not deleted by default, unless +\f[C]--create-empty-src-dirs\f[R] is specified. +If the \f[C]--remove-empty-dirs\f[R] flag is specified, then both paths +will have ALL empty directories purged as the last step in the process. +.SS Command-line flags +.SS --resync +.PP +This will effectively make both Path1 and Path2 filesystems contain a +matching superset of all files. +Path2 files that do not exist in Path1 will be copied to Path1, and the +process will then copy the Path1 tree to Path2. .PP -Region to connect to. +The \f[C]--resync\f[R] sequence is roughly equivalent to: +.IP +.nf +\f[C] +rclone copy Path2 Path1 --ignore-existing +rclone copy Path1 Path2 +\f[R] +.fi .PP -Leave blank if you are using an S3 clone and you don\[aq]t have a -region. +Or, if using \f[C]--create-empty-src-dirs\f[R]: +.IP +.nf +\f[C] +rclone copy Path2 Path1 --ignore-existing +rclone copy Path1 Path2 --create-empty-src-dirs +rclone copy Path2 Path1 --create-empty-src-dirs +\f[R] +.fi .PP -Properties: -.IP \[bu] 2 -Config: region -.IP \[bu] 2 -Env Var: RCLONE_S3_REGION -.IP \[bu] 2 -Provider: -!AWS,Alibaba,ArvanCloud,ChinaMobile,Cloudflare,IONOS,Petabox,Liara,Qiniu,RackCorp,Scaleway,Storj,Synology,TencentCOS,HuaweiOBS,IDrive -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]\[dq] -.RS 2 -.IP \[bu] 2 -Use this if unsure. -.IP \[bu] 2 -Will use v4 signatures and an empty region. -.RE -.IP \[bu] 2 -\[dq]other-v2-signature\[dq] -.RS 2 -.IP \[bu] 2 -Use this only if v4 signatures don\[aq]t work. -.IP \[bu] 2 -E.g. -pre Jewel/v10 CEPH. -.RE -.RE -.SS --s3-endpoint +The base directories on both Path1 and Path2 filesystems must exist or +bisync will fail. +This is required for safety - that bisync can verify that both paths are +valid. .PP -Endpoint for S3 API. +When using \f[C]--resync\f[R], a newer version of a file on the Path2 +filesystem will be overwritten by the Path1 filesystem version. +(Note that this is NOT entirely +symmetrical (https://github.com/rclone/rclone/issues/5681#issuecomment-938761815).) +Carefully evaluate deltas using +--dry-run (https://rclone.org/flags/#non-backend-flags). .PP -Leave blank if using AWS to use the default endpoint for the region. +For a resync run, one of the paths may be empty (no files in the path +tree). +The resync run should result in files on both paths, else a normal +non-resync run will fail. .PP -Properties: -.IP \[bu] 2 -Config: endpoint -.IP \[bu] 2 -Env Var: RCLONE_S3_ENDPOINT -.IP \[bu] 2 -Provider: AWS -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.SS --s3-endpoint +For a non-resync run, either path being empty (no files in the tree) +fails with +\f[C]Empty current PathN listing. Cannot sync to an empty directory: X.pathN.lst\f[R] +This is a safety check that an unexpected empty path does not result in +deleting \f[B]everything\f[R] in the other path. +.SS --check-access .PP -Endpoint for China Mobile Ecloud Elastic Object Storage (EOS) API. +Access check files are an additional safety measure against data loss. +bisync will ensure it can find matching \f[C]RCLONE_TEST\f[R] files in +the same places in the Path1 and Path2 filesystems. +\f[C]RCLONE_TEST\f[R] files are not generated automatically. +For \f[C]--check-access\f[R] to succeed, you must first either: +\f[B]A)\f[R] Place one or more \f[C]RCLONE_TEST\f[R] files in both +systems, or \f[B]B)\f[R] Set \f[C]--check-filename\f[R] to a filename +already in use in various locations throughout your sync\[aq]d fileset. +Recommended methods for \f[B]A)\f[R] include: * +\f[C]rclone touch Path1/RCLONE_TEST\f[R] (create a new file) * +\f[C]rclone copyto Path1/RCLONE_TEST Path2/RCLONE_TEST\f[R] (copy an +existing file) * +\f[C]rclone copy Path1/RCLONE_TEST Path2/RCLONE_TEST --include \[dq]RCLONE_TEST\[dq]\f[R] +(copy multiple files at once, recursively) * create the files manually +(outside of rclone) * run \f[C]bisync\f[R] once \f[I]without\f[R] +\f[C]--check-access\f[R] to set matching files on both filesystems will +also work, but is not preferred, due to potential for user error (you +are temporarily disabling the safety feature). .PP -Properties: -.IP \[bu] 2 -Config: endpoint -.IP \[bu] 2 -Env Var: RCLONE_S3_ENDPOINT -.IP \[bu] 2 -Provider: ChinaMobile -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]eos-wuxi-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -The default endpoint - a good choice if you are unsure. -.IP \[bu] 2 -East China (Suzhou) -.RE -.IP \[bu] 2 -\[dq]eos-jinan-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -East China (Jinan) -.RE -.IP \[bu] 2 -\[dq]eos-ningbo-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -East China (Hangzhou) -.RE -.IP \[bu] 2 -\[dq]eos-shanghai-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -East China (Shanghai-1) -.RE -.IP \[bu] 2 -\[dq]eos-zhengzhou-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -Central China (Zhengzhou) -.RE -.IP \[bu] 2 -\[dq]eos-hunan-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -Central China (Changsha-1) -.RE -.IP \[bu] 2 -\[dq]eos-zhuzhou-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -Central China (Changsha-2) -.RE -.IP \[bu] 2 -\[dq]eos-guangzhou-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -South China (Guangzhou-2) -.RE -.IP \[bu] 2 -\[dq]eos-dongguan-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -South China (Guangzhou-3) -.RE -.IP \[bu] 2 -\[dq]eos-beijing-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -North China (Beijing-1) -.RE -.IP \[bu] 2 -\[dq]eos-beijing-2.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -North China (Beijing-2) -.RE -.IP \[bu] 2 -\[dq]eos-beijing-4.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -North China (Beijing-3) -.RE -.IP \[bu] 2 -\[dq]eos-huhehaote-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -North China (Huhehaote) -.RE -.IP \[bu] 2 -\[dq]eos-chengdu-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -Southwest China (Chengdu) -.RE -.IP \[bu] 2 -\[dq]eos-chongqing-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -Southwest China (Chongqing) -.RE -.IP \[bu] 2 -\[dq]eos-guiyang-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -Southwest China (Guiyang) -.RE -.IP \[bu] 2 -\[dq]eos-xian-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -Nouthwest China (Xian) -.RE -.IP \[bu] 2 -\[dq]eos-yunnan.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -Yunnan China (Kunming) -.RE -.IP \[bu] 2 -\[dq]eos-yunnan-2.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -Yunnan China (Kunming-2) -.RE -.IP \[bu] 2 -\[dq]eos-tianjin-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -Tianjin China (Tianjin) -.RE -.IP \[bu] 2 -\[dq]eos-jilin-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -Jilin China (Changchun) -.RE -.IP \[bu] 2 -\[dq]eos-hubei-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -Hubei China (Xiangyan) -.RE -.IP \[bu] 2 -\[dq]eos-jiangxi-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -Jiangxi China (Nanchang) -.RE -.IP \[bu] 2 -\[dq]eos-gansu-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -Gansu China (Lanzhou) -.RE -.IP \[bu] 2 -\[dq]eos-shanxi-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -Shanxi China (Taiyuan) -.RE -.IP \[bu] 2 -\[dq]eos-liaoning-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -Liaoning China (Shenyang) -.RE -.IP \[bu] 2 -\[dq]eos-hebei-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -Hebei China (Shijiazhuang) -.RE -.IP \[bu] 2 -\[dq]eos-fujian-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -Fujian China (Xiamen) -.RE -.IP \[bu] 2 -\[dq]eos-guangxi-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -Guangxi China (Nanning) -.RE -.IP \[bu] 2 -\[dq]eos-anhui-1.cmecloud.cn\[dq] -.RS 2 -.IP \[bu] 2 -Anhui China (Huainan) -.RE -.RE -.SS --s3-endpoint +Note that \f[C]--check-access\f[R] is still enforced on +\f[C]--resync\f[R], so \f[C]bisync --resync --check-access\f[R] will not +work as a method of initially setting the files (this is to ensure that +bisync can\[aq]t inadvertently circumvent its own safety +switch (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=3.%20%2D%2Dcheck%2Daccess%20doesn%27t%20always%20fail%20when%20it%20should).) .PP -Endpoint for Arvan Cloud Object Storage (AOS) API. +Time stamps and file contents for \f[C]RCLONE_TEST\f[R] files are not +important, just the names and locations. +If you have symbolic links in your sync tree it is recommended to place +\f[C]RCLONE_TEST\f[R] files in the linked-to directory tree to protect +against bisync assuming a bunch of deleted files if the linked-to tree +should not be accessible. +See also the --check-filename flag. +.SS --check-filename .PP -Properties: -.IP \[bu] 2 -Config: endpoint -.IP \[bu] 2 -Env Var: RCLONE_S3_ENDPOINT -.IP \[bu] 2 -Provider: ArvanCloud -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]s3.ir-thr-at1.arvanstorage.ir\[dq] -.RS 2 -.IP \[bu] 2 -The default endpoint - a good choice if you are unsure. -.IP \[bu] 2 -Tehran Iran (Simin) -.RE -.IP \[bu] 2 -\[dq]s3.ir-tbz-sh1.arvanstorage.ir\[dq] -.RS 2 -.IP \[bu] 2 -Tabriz Iran (Shahriar) -.RE -.RE -.SS --s3-endpoint +Name of the file(s) used in access health validation. +The default \f[C]--check-filename\f[R] is \f[C]RCLONE_TEST\f[R]. +One or more files having this filename must exist, synchronized between +your source and destination filesets, in order for +\f[C]--check-access\f[R] to succeed. +See --check-access for additional details. +.SS --max-delete .PP -Endpoint for IBM COS S3 API. +As a safety check, if greater than the \f[C]--max-delete\f[R] percent of +files were deleted on either the Path1 or Path2 filesystem, then bisync +will abort with a warning message, without making any changes. +The default \f[C]--max-delete\f[R] is \f[C]50%\f[R]. +One way to trigger this limit is to rename a directory that contains +more than half of your files. +This will appear to bisync as a bunch of deleted files and a bunch of +new files. +This safety check is intended to block bisync from deleting all of the +files on both filesystems due to a temporary network access issue, or if +the user had inadvertently deleted the files on one side or the other. +To force the sync, either set a different delete percentage limit, e.g. +\f[C]--max-delete 75\f[R] (allows up to 75% deletion), or use +\f[C]--force\f[R] to bypass the check. .PP -Specify if using an IBM COS On Premise. +Also see the all files changed check. +.SS --filters-file .PP -Properties: -.IP \[bu] 2 -Config: endpoint -.IP \[bu] 2 -Env Var: RCLONE_S3_ENDPOINT -.IP \[bu] 2 -Provider: IBMCOS -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]s3.us.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -US Cross Region Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.dal.us.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -US Cross Region Dallas Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.wdc.us.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -US Cross Region Washington DC Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.sjc.us.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -US Cross Region San Jose Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.private.us.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -US Cross Region Private Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.private.dal.us.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -US Cross Region Dallas Private Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.private.wdc.us.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -US Cross Region Washington DC Private Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.private.sjc.us.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -US Cross Region San Jose Private Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.us-east.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -US Region East Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.private.us-east.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -US Region East Private Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.us-south.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -US Region South Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.private.us-south.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -US Region South Private Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.eu.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -EU Cross Region Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.fra.eu.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -EU Cross Region Frankfurt Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.mil.eu.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -EU Cross Region Milan Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.ams.eu.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -EU Cross Region Amsterdam Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.private.eu.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -EU Cross Region Private Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.private.fra.eu.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -EU Cross Region Frankfurt Private Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.private.mil.eu.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -EU Cross Region Milan Private Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.private.ams.eu.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -EU Cross Region Amsterdam Private Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.eu-gb.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -Great Britain Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.private.eu-gb.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -Great Britain Private Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.eu-de.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -EU Region DE Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.private.eu-de.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -EU Region DE Private Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.ap.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -APAC Cross Regional Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.tok.ap.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -APAC Cross Regional Tokyo Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.hkg.ap.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -APAC Cross Regional HongKong Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.seo.ap.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -APAC Cross Regional Seoul Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.private.ap.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -APAC Cross Regional Private Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.private.tok.ap.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -APAC Cross Regional Tokyo Private Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.private.hkg.ap.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -APAC Cross Regional HongKong Private Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.private.seo.ap.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -APAC Cross Regional Seoul Private Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.jp-tok.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -APAC Region Japan Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.private.jp-tok.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -APAC Region Japan Private Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.au-syd.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -APAC Region Australia Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.private.au-syd.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -APAC Region Australia Private Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.ams03.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -Amsterdam Single Site Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.private.ams03.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -Amsterdam Single Site Private Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.che01.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -Chennai Single Site Endpoint -.RE -.IP \[bu] 2 -\[dq]s3.private.che01.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -Chennai Single Site Private Endpoint -.RE +By using rclone filter features you can exclude file types or directory +sub-trees from the sync. +See the bisync filters section and generic +--filter-from (https://rclone.org/filtering/#filter-from-read-filtering-patterns-from-a-file) +documentation. +An example filters file contains filters for non-allowed files for +synching with Dropbox. +.PP +If you make changes to your filters file then bisync requires a run with +\f[C]--resync\f[R]. +This is a safety feature, which prevents existing files on the Path1 +and/or Path2 side from seeming to disappear from view (since they are +excluded in the new listings), which would fool bisync into seeing them +as deleted (as compared to the prior run listings), and then bisync +would proceed to delete them for real. +.PP +To block this from happening, bisync calculates an MD5 hash of the +filters file and stores the hash in a \f[C].md5\f[R] file in the same +place as your filters file. +On the next run with \f[C]--filters-file\f[R] set, bisync re-calculates +the MD5 hash of the current filters file and compares it to the hash +stored in the \f[C].md5\f[R] file. +If they don\[aq]t match, the run aborts with a critical error and thus +forces you to do a \f[C]--resync\f[R], likely avoiding a disaster. +.SS --check-sync +.PP +Enabled by default, the check-sync function checks that all of the same +files exist in both the Path1 and Path2 history listings. +This \f[I]check-sync\f[R] integrity check is performed at the end of the +sync run by default. +Any untrapped failing copy/deletes between the two paths might result in +differences between the two listings and in the untracked file content +differences between the two paths. +A resync run would correct the error. +.PP +Note that the default-enabled integrity check locally executes a load of +both the final Path1 and Path2 listings, and thus adds to the run time +of a sync. +Using \f[C]--check-sync=false\f[R] will disable it and may significantly +reduce the sync run times for very large numbers of files. +.PP +The check may be run manually with \f[C]--check-sync=only\f[R]. +It runs only the integrity check and terminates without actually +synching. +.PP +See also: Concurrent modifications +.SS --ignore-listing-checksum +.PP +By default, bisync will retrieve (or generate) checksums (for backends +that support them) when creating the listings for both paths, and store +the checksums in the listing files. +\f[C]--ignore-listing-checksum\f[R] will disable this behavior, which +may speed things up considerably, especially on backends (such as +local (https://rclone.org/local/)) where hashes must be computed on the +fly instead of retrieved. +Please note the following: .IP \[bu] 2 -\[dq]s3.mel01.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 +While checksums are (by default) generated and stored in the listing +files, they are NOT currently used for determining diffs (deltas). +It is anticipated that full checksum support will be added in a future +version. .IP \[bu] 2 -Melbourne Single Site Endpoint -.RE +\f[C]--ignore-listing-checksum\f[R] is NOT the same as +\f[C]--ignore-checksum\f[R] (https://rclone.org/docs/#ignore-checksum), +and you may wish to use one or the other, or both. +In a nutshell: \f[C]--ignore-listing-checksum\f[R] controls whether +checksums are considered when scanning for diffs, while +\f[C]--ignore-checksum\f[R] controls whether checksums are considered +during the copy/sync operations that follow, if there ARE diffs. .IP \[bu] 2 -\[dq]s3.private.mel01.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 +Unless \f[C]--ignore-listing-checksum\f[R] is passed, bisync currently +computes hashes for one path \f[I]even when there\[aq]s no common hash +with the other path\f[R] (for example, a +crypt (https://rclone.org/crypt/#modification-times-and-hashes) remote.) .IP \[bu] 2 -Melbourne Single Site Private Endpoint -.RE +If both paths support checksums and have a common hash, AND +\f[C]--ignore-listing-checksum\f[R] was not specified when creating the +listings, \f[C]--check-sync=only\f[R] can be used to compare Path1 vs. +Path2 checksums (as of the time the previous listings were created.) +However, \f[C]--check-sync=only\f[R] will NOT include checksums if the +previous listings were generated on a run using +\f[C]--ignore-listing-checksum\f[R]. +For a more robust integrity check of the current state, consider using +\f[C]check\f[R] (or +\f[C]cryptcheck\f[R] (https://rclone.org/commands/rclone_cryptcheck/), +if at least one path is a \f[C]crypt\f[R] remote.) +.SS --resilient +.PP +\f[B]\f[BI]Caution: this is an experimental feature. Use at your own +risk!\f[B]\f[R] +.PP +By default, most errors or interruptions will cause bisync to abort and +require \f[C]--resync\f[R] to recover. +This is a safety feature, to prevent bisync from running again until a +user checks things out. +However, in some cases, bisync can go too far and enforce a lockout when +one isn\[aq]t actually necessary, like for certain less-serious errors +that might resolve themselves on the next run. +When \f[C]--resilient\f[R] is specified, bisync tries its best to +recover and self-correct, and only requires \f[C]--resync\f[R] as a last +resort when a human\[aq]s involvement is absolutely necessary. +The intended use case is for running bisync as a background process +(such as via scheduled cron). +.PP +When using \f[C]--resilient\f[R] mode, bisync will still report the +error and abort, however it will not lock out future runs -- allowing +the possibility of retrying at the next normally scheduled time, without +requiring a \f[C]--resync\f[R] first. +Examples of such retryable errors include access test failures, missing +listing files, and filter change detections. +These safety features will still prevent the \f[I]current\f[R] run from +proceeding -- the difference is that if conditions have improved by the +time of the \f[I]next\f[R] run, that next run will be allowed to +proceed. +Certain more serious errors will still enforce a \f[C]--resync\f[R] +lockout, even in \f[C]--resilient\f[R] mode, to prevent data loss. +.PP +Behavior of \f[C]--resilient\f[R] may change in a future version. +.SS Operation +.SS Runtime flow details +.PP +bisync retains the listings of the \f[C]Path1\f[R] and \f[C]Path2\f[R] +filesystems from the prior run. +On each successive run it will: .IP \[bu] 2 -\[dq]s3.osl01.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 +list files on \f[C]path1\f[R] and \f[C]path2\f[R], and check for changes +on each side. +Changes include \f[C]New\f[R], \f[C]Newer\f[R], \f[C]Older\f[R], and +\f[C]Deleted\f[R] files. .IP \[bu] 2 -Oslo Single Site Endpoint -.RE +Propagate changes on \f[C]path1\f[R] to \f[C]path2\f[R], and vice-versa. +.SS Safety measures .IP \[bu] 2 -\[dq]s3.private.osl01.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 +Lock file prevents multiple simultaneous runs when taking a while. +This can be particularly useful if bisync is run by cron scheduler. .IP \[bu] 2 -Oslo Single Site Private Endpoint -.RE +Handle change conflicts non-destructively by creating \f[C]..path1\f[R] +and \f[C]..path2\f[R] file versions. .IP \[bu] 2 -\[dq]s3.tor01.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 +File system access health check using \f[C]RCLONE_TEST\f[R] files (see +the \f[C]--check-access\f[R] flag). .IP \[bu] 2 -Toronto Single Site Endpoint -.RE +Abort on excessive deletes - protects against a failed listing being +interpreted as all the files were deleted. +See the \f[C]--max-delete\f[R] and \f[C]--force\f[R] flags. .IP \[bu] 2 -\[dq]s3.private.tor01.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 +If something evil happens, bisync goes into a safe state to block damage +by later runs. +(See Error Handling) +.SS Normal sync checks +.PP +.TS +tab(@); +lw(8.4n) lw(28.4n) lw(15.7n) lw(17.5n). +T{ +Type +T}@T{ +Description +T}@T{ +Result +T}@T{ +Implementation +T} +_ +T{ +Path2 new +T}@T{ +File is new on Path2, does not exist on Path1 +T}@T{ +Path2 version survives +T}@T{ +\f[C]rclone copy\f[R] Path2 to Path1 +T} +T{ +Path2 newer +T}@T{ +File is newer on Path2, unchanged on Path1 +T}@T{ +Path2 version survives +T}@T{ +\f[C]rclone copy\f[R] Path2 to Path1 +T} +T{ +Path2 deleted +T}@T{ +File is deleted on Path2, unchanged on Path1 +T}@T{ +File is deleted +T}@T{ +\f[C]rclone delete\f[R] Path1 +T} +T{ +Path1 new +T}@T{ +File is new on Path1, does not exist on Path2 +T}@T{ +Path1 version survives +T}@T{ +\f[C]rclone copy\f[R] Path1 to Path2 +T} +T{ +Path1 newer +T}@T{ +File is newer on Path1, unchanged on Path2 +T}@T{ +Path1 version survives +T}@T{ +\f[C]rclone copy\f[R] Path1 to Path2 +T} +T{ +Path1 older +T}@T{ +File is older on Path1, unchanged on Path2 +T}@T{ +\f[I]Path1 version survives\f[R] +T}@T{ +\f[C]rclone copy\f[R] Path1 to Path2 +T} +T{ +Path2 older +T}@T{ +File is older on Path2, unchanged on Path1 +T}@T{ +\f[I]Path2 version survives\f[R] +T}@T{ +\f[C]rclone copy\f[R] Path2 to Path1 +T} +T{ +Path1 deleted +T}@T{ +File no longer exists on Path1 +T}@T{ +File is deleted +T}@T{ +\f[C]rclone delete\f[R] Path2 +T} +.TE +.SS Unusual sync checks +.PP +.TS +tab(@); +lw(17.2n) lw(21.0n) lw(19.4n) lw(12.4n). +T{ +Type +T}@T{ +Description +T}@T{ +Result +T}@T{ +Implementation +T} +_ +T{ +Path1 new/changed AND Path2 new/changed AND Path1 == Path2 +T}@T{ +File is new/changed on Path1 AND new/changed on Path2 AND Path1 version +is currently identical to Path2 +T}@T{ +No change +T}@T{ +None +T} +T{ +Path1 new AND Path2 new +T}@T{ +File is new on Path1 AND new on Path2 (and Path1 version is NOT +identical to Path2) +T}@T{ +Files renamed to _Path1 and _Path2 +T}@T{ +\f[C]rclone copy\f[R] _Path2 file to Path1, \f[C]rclone copy\f[R] _Path1 +file to Path2 +T} +T{ +Path2 newer AND Path1 changed +T}@T{ +File is newer on Path2 AND also changed (newer/older/size) on Path1 (and +Path1 version is NOT identical to Path2) +T}@T{ +Files renamed to _Path1 and _Path2 +T}@T{ +\f[C]rclone copy\f[R] _Path2 file to Path1, \f[C]rclone copy\f[R] _Path1 +file to Path2 +T} +T{ +Path2 newer AND Path1 deleted +T}@T{ +File is newer on Path2 AND also deleted on Path1 +T}@T{ +Path2 version survives +T}@T{ +\f[C]rclone copy\f[R] Path2 to Path1 +T} +T{ +Path2 deleted AND Path1 changed +T}@T{ +File is deleted on Path2 AND changed (newer/older/size) on Path1 +T}@T{ +Path1 version survives +T}@T{ +\f[C]rclone copy\f[R] Path1 to Path2 +T} +T{ +Path1 deleted AND Path2 changed +T}@T{ +File is deleted on Path1 AND changed (newer/older/size) on Path2 +T}@T{ +Path2 version survives +T}@T{ +\f[C]rclone copy\f[R] Path2 to Path1 +T} +.TE +.PP +As of \f[C]rclone v1.64\f[R], bisync is now better at detecting +\f[I]false positive\f[R] sync conflicts, which would previously have +resulted in unnecessary renames and duplicates. +Now, when bisync comes to a file that it wants to rename (because it is +new/changed on both sides), it first checks whether the Path1 and Path2 +versions are currently \f[I]identical\f[R] (using the same underlying +function as \f[C]check\f[R].) If bisync concludes that the files are +identical, it will skip them and move on. +Otherwise, it will create renamed \f[C]..Path1\f[R] and +\f[C]..Path2\f[R] duplicates, as before. +This behavior also improves the experience of renaming +directories (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=Renamed%20directories), +as a \f[C]--resync\f[R] is no longer required, so long as the same +change has been made on both sides. +.SS All files changed check +.PP +If \f[I]all\f[R] prior existing files on either of the filesystems have +changed (e.g. +timestamps have changed due to changing the system\[aq]s timezone) then +bisync will abort without making any changes. +Any new files are not considered for this check. +You could use \f[C]--force\f[R] to force the sync (whichever side has +the changed timestamp files wins). +Alternately, a \f[C]--resync\f[R] may be used (Path1 versions will be +pushed to Path2). +Consider the situation carefully and perhaps use \f[C]--dry-run\f[R] +before you commit to the changes. +.SS Modification times +.PP +Bisync relies on file timestamps to identify changed files and will +\f[I]refuse\f[R] to operate if backend lacks the modification time +support. +.PP +If you or your application should change the content of a file without +changing the modification time then bisync will \f[I]not\f[R] notice the +change, and thus will not copy it to the other side. +.PP +Note that on some cloud storage systems it is not possible to have file +timestamps that match \f[I]precisely\f[R] between the local and other +filesystems. +.PP +Bisync\[aq]s approach to this problem is by tracking the changes on each +side \f[I]separately\f[R] over time with a local database of files in +that side then applying the resulting changes on the other side. +.SS Error handling +.PP +Certain bisync critical errors, such as file copy/move failing, will +result in a bisync lockout of following runs. +The lockout is asserted because the sync status and history of the Path1 +and Path2 filesystems cannot be trusted, so it is safer to block any +further changes until someone checks things out. +The recovery is to do a \f[C]--resync\f[R] again. +.PP +It is recommended to use \f[C]--resync --dry-run --verbose\f[R] +initially and \f[I]carefully\f[R] review what changes will be made +before running the \f[C]--resync\f[R] without \f[C]--dry-run\f[R]. +.PP +Most of these events come up due to an error status from an internal +call. +On such a critical error the \f[C]{...}.path1.lst\f[R] and +\f[C]{...}.path2.lst\f[R] listing files are renamed to extension +\f[C].lst-err\f[R], which blocks any future bisync runs (since the +normal \f[C].lst\f[R] files are not found). +Bisync keeps them under \f[C]bisync\f[R] subdirectory of the rclone +cache directory, typically at \f[C]${HOME}/.cache/rclone/bisync/\f[R] on +Linux. +.PP +Some errors are considered temporary and re-running the bisync is not +blocked. +The \f[I]critical return\f[R] blocks further bisync runs. +.PP +See also: \f[C]--resilient\f[R] +.SS Lock file +.PP +When bisync is running, a lock file is created in the bisync working +directory, typically at +\f[C]\[ti]/.cache/rclone/bisync/PATH1..PATH2.lck\f[R] on Linux. +If bisync should crash or hang, the lock file will remain in place and +block any further runs of bisync \f[I]for the same paths\f[R]. +Delete the lock file as part of debugging the situation. +The lock file effectively blocks follow-on (e.g., scheduled by +\f[I]cron\f[R]) runs when the prior invocation is taking a long time. +The lock file contains \f[I]PID\f[R] of the blocking process, which may +help in debug. +.PP +\f[B]Note\f[R] that while concurrent bisync runs are allowed, \f[I]be +very cautious\f[R] that there is no overlap in the trees being synched +between concurrent runs, lest there be replicated files, deleted files +and general mayhem. +.SS Return codes +.PP +\f[C]rclone bisync\f[R] returns the following codes to calling program: +- \f[C]0\f[R] on a successful run, - \f[C]1\f[R] for a non-critical +failing run (a rerun may be successful), - \f[C]2\f[R] for a critically +aborted run (requires a \f[C]--resync\f[R] to recover). +.SS Limitations +.SS Supported backends +.PP +Bisync is considered \f[I]BETA\f[R] and has been tested with the +following backends: - Local filesystem - Google Drive - Dropbox - +OneDrive - S3 - SFTP - Yandex Disk +.PP +It has not been fully tested with other services yet. +If it works, or sorta works, please let us know and we\[aq]ll update the +list. +Run the test suite to check for proper operation as described below. +.PP +First release of \f[C]rclone bisync\f[R] requires that underlying +backend supports the modification time feature and will refuse to run +otherwise. +This limitation will be lifted in a future \f[C]rclone bisync\f[R] +release. +.SS Concurrent modifications +.PP +When using \f[B]Local, FTP or SFTP\f[R] remotes rclone does not create +\f[I]temporary\f[R] files at the destination when copying, and thus if +the connection is lost the created file may be corrupt, which will +likely propagate back to the original path on the next sync, resulting +in data loss. +This will be solved in a future release, there is no workaround at the +moment. +.PP +Files that \f[B]change during\f[R] a bisync run may result in data loss. +This has been seen in a highly dynamic environment, where the filesystem +is getting hammered by running processes during the sync. +The currently recommended solution is to sync at quiet times or filter +out unnecessary directories and files. +.PP +As an alternative +approach (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=scans%2C%20to%20avoid-,errors%20if%20files%20changed%20during%20sync,-Given%20the%20number), +consider using \f[C]--check-sync=false\f[R] (and possibly +\f[C]--resilient\f[R]) to make bisync more forgiving of filesystems that +change during the sync. +Be advised that this may cause bisync to miss events that occur during a +bisync run, so it is a good idea to supplement this with a periodic +independent integrity check, and corrective sync if diffs are found. +For example, a possible sequence could look like this: +.IP "1." 3 +Normally scheduled bisync run: +.IP +.nf +\f[C] +rclone bisync Path1 Path2 -MPc --check-access --max-delete 10 --filters-file /path/to/filters.txt -v --check-sync=false --no-cleanup --ignore-listing-checksum --disable ListR --checkers=16 --drive-pacer-min-sleep=10ms --create-empty-src-dirs --resilient +\f[R] +.fi +.IP "2." 3 +Periodic independent integrity check (perhaps scheduled nightly or +weekly): +.IP +.nf +\f[C] +rclone check -MvPc Path1 Path2 --filter-from /path/to/filters.txt +\f[R] +.fi +.IP "3." 3 +If diffs are found, you have some choices to correct them. +If one side is more up-to-date and you want to make the other side match +it, you could run: +.IP +.nf +\f[C] +rclone sync Path1 Path2 --filter-from /path/to/filters.txt --create-empty-src-dirs -MPc -v +\f[R] +.fi +.PP +(or switch Path1 and Path2 to make Path2 the source-of-truth) +.PP +Or, if neither side is totally up-to-date, you could run a +\f[C]--resync\f[R] to bring them back into agreement (but remember that +this could cause deleted files to re-appear.) +.PP +*Note also that \f[C]rclone check\f[R] does not currently include empty +directories, so if you want to know if any empty directories are out of +sync, consider alternatively running the above \f[C]rclone sync\f[R] +command with \f[C]--dry-run\f[R] added. +.SS Empty directories +.PP +By default, new/deleted empty directories on one path are \f[I]not\f[R] +propagated to the other side. +This is because bisync (and rclone) natively works on files, not +directories. +However, this can be changed with the \f[C]--create-empty-src-dirs\f[R] +flag, which works in much the same way as in +\f[C]sync\f[R] (https://rclone.org/commands/rclone_sync/) and +\f[C]copy\f[R] (https://rclone.org/commands/rclone_copy/). +When used, empty directories created or deleted on one side will also be +created or deleted on the other side. +The following should be noted: * \f[C]--create-empty-src-dirs\f[R] is +not compatible with \f[C]--remove-empty-dirs\f[R]. +Use only one or the other (or neither). +* It is not recommended to switch back and forth between +\f[C]--create-empty-src-dirs\f[R] and the default (no +\f[C]--create-empty-src-dirs\f[R]) without running \f[C]--resync\f[R]. +This is because it may appear as though all directories (not just the +empty ones) were created/deleted, when actually you\[aq]ve just toggled +between making them visible/invisible to bisync. +It looks scarier than it is, but it\[aq]s still probably best to stick +to one or the other, and use \f[C]--resync\f[R] when you need to switch. +.SS Renamed directories +.PP +Renaming a folder on the Path1 side results in deleting all files on the +Path2 side and then copying all files again from Path1 to Path2. +Bisync sees this as all files in the old directory name as deleted and +all files in the new directory name as new. +Currently, the most effective and efficient method of renaming a +directory is to rename it to the same name on both sides. +(As of \f[C]rclone v1.64\f[R], a \f[C]--resync\f[R] is no longer +required after doing so, as bisync will automatically detect that Path1 +and Path2 are in agreement.) +.SS \f[C]--fast-list\f[R] used by default +.PP +Unlike most other rclone commands, bisync uses +\f[C]--fast-list\f[R] (https://rclone.org/docs/#fast-list) by default, +for backends that support it. +In many cases this is desirable, however, there are some scenarios in +which bisync could be faster \f[I]without\f[R] \f[C]--fast-list\f[R], +and there is also a known issue concerning Google Drive users with many +empty +directories (https://github.com/rclone/rclone/commit/cbf3d4356135814921382dd3285d859d15d0aa77). +For now, the recommended way to avoid using \f[C]--fast-list\f[R] is to +add \f[C]--disable ListR\f[R] to all bisync commands. +The default behavior may change in a future version. +.SS Overridden Configs +.PP +When rclone detects an overridden config, it adds a suffix like +\f[C]{ABCDE}\f[R] on the fly to the internal name of the remote. +Bisync follows suit by including this suffix in its listing filenames. +However, this suffix does not necessarily persist from run to run, +especially if different flags are provided. +So if next time the suffix assigned is \f[C]{FGHIJ}\f[R], bisync will +get confused, because it\[aq]s looking for a listing file with +\f[C]{FGHIJ}\f[R], when the file it wants has \f[C]{ABCDE}\f[R]. +As a result, it throws +\f[C]Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run\f[R] +and refuses to run again until the user runs a \f[C]--resync\f[R] +(unless using \f[C]--resilient\f[R]). +The best workaround at the moment is to set any backend-specific flags +in the config file (https://rclone.org/commands/rclone_config/) instead +of specifying them with command flags. +(You can still override them as needed for other rclone commands.) +.SS Case sensitivity +.PP +Synching with \f[B]case-insensitive\f[R] filesystems, such as Windows or +\f[C]Box\f[R], can result in file name conflicts. +This will be fixed in a future release. +The near-term workaround is to make sure that files on both sides +don\[aq]t have spelling case differences (\f[C]Smile.jpg\f[R] vs. +\f[C]smile.jpg\f[R]). +.SS Windows support +.PP +Bisync has been tested on Windows 8.1, Windows 10 Pro 64-bit and on +Windows GitHub runners. +.PP +Drive letters are allowed, including drive letters mapped to network +drives (\f[C]rclone bisync J:\[rs]localsync GDrive:\f[R]). +If a drive letter is omitted, the shell current drive is the default. +Drive letters are a single character follows by \f[C]:\f[R], so cloud +names must be more than one character long. +.PP +Absolute paths (with or without a drive letter), and relative paths +(with or without a drive letter) are supported. +.PP +Working directory is created at +\f[C]C:\[rs]Users\[rs]MyLogin\[rs]AppData\[rs]Local\[rs]rclone\[rs]bisync\f[R]. +.PP +Note that bisync output may show a mix of forward \f[C]/\f[R] and back +\f[C]\[rs]\f[R] slashes. +.PP +Be careful of case independent directory and file naming on Windows vs. +case dependent Linux +.SS Filtering +.PP +See filtering documentation (https://rclone.org/filtering/) for how +filter rules are written and interpreted. +.PP +Bisync\[aq]s \f[C]--filters-file\f[R] flag slightly extends the +rclone\[aq]s +--filter-from (https://rclone.org/filtering/#filter-from-read-filtering-patterns-from-a-file) +filtering mechanism. +For a given bisync run you may provide \f[I]only one\f[R] +\f[C]--filters-file\f[R]. +The \f[C]--include*\f[R], \f[C]--exclude*\f[R], and \f[C]--filter\f[R] +flags are also supported. +.SS How to filter directories +.PP +Filtering portions of the directory tree is a critical feature for +synching. +.PP +Examples of directory trees (always beneath the Path1/Path2 root level) +you may want to exclude from your sync: - Directory trees containing +only software build intermediate files. +- Directory trees containing application temporary files and data such +as the Windows \f[C]C:\[rs]Users\[rs]MyLogin\[rs]AppData\[rs]\f[R] tree. +- Directory trees containing files that are large, less important, or +are getting thrashed continuously by ongoing processes. +.PP +On the other hand, there may be only select directories that you +actually want to sync, and exclude all others. +See the Example include-style filters for Windows user directories +below. +.SS Filters file writing guidelines +.IP "1." 3 +Begin with excluding directory trees: +.RS 4 .IP \[bu] 2 -Toronto Single Site Private Endpoint -.RE +e.g. +\[ga]- /AppData/\[ga] .IP \[bu] 2 -\[dq]s3.seo01.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 +\f[C]**\f[R] on the end is not necessary. +Once a given directory level is excluded then everything beneath it +won\[aq]t be looked at by rclone. .IP \[bu] 2 -Seoul Single Site Endpoint -.RE +Exclude such directories that are unneeded, are big, dynamically +thrashed, or where there may be access permission issues. .IP \[bu] 2 -\[dq]s3.private.seo01.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 +Excluding such dirs first will make rclone operations (much) faster. .IP \[bu] 2 -Seoul Single Site Private Endpoint +Specific files may also be excluded, as with the Dropbox exclusions +example below. .RE +.IP "2." 3 +Decide if it\[aq]s easier (or cleaner) to: +.RS 4 .IP \[bu] 2 -\[dq]s3.mon01.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 +Include select directories and therefore \f[I]exclude everything +else\f[R] -- or -- .IP \[bu] 2 -Montreal Single Site Endpoint +Exclude select directories and therefore \f[I]include everything +else\f[R] .RE +.IP "3." 3 +Include select directories: +.RS 4 .IP \[bu] 2 -\[dq]s3.private.mon01.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 +Add lines like: \[ga]+ /Documents/PersonalFiles/**\[ga] to select which +directories to include in the sync. .IP \[bu] 2 -Montreal Single Site Private Endpoint -.RE +\f[C]**\f[R] on the end specifies to include the full depth of the +specified tree. .IP \[bu] 2 -\[dq]s3.mex01.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 +With Include-style filters, files at the Path1/Path2 root are not +included. +They may be included with \[ga]+ /*\[ga]. .IP \[bu] 2 -Mexico Single Site Endpoint -.RE +Place RCLONE_TEST files within these included directory trees. +They will only be looked for in these directory trees. .IP \[bu] 2 -\[dq]s3.private.mex01.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 +Finish by excluding everything else by adding \[ga]- **\[ga] at the end +of the filters file. .IP \[bu] 2 -Mexico Single Site Private Endpoint +Disregard step 4. .RE +.IP "4." 3 +Exclude select directories: +.RS 4 .IP \[bu] 2 -\[dq]s3.sjc04.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 -.IP \[bu] 2 -San Jose Single Site Endpoint -.RE +Add more lines like in step 1. +For example: \f[C]-/Desktop/tempfiles/\f[R], or \[ga]- +/testdir/\f[C]. Again, a\f[R]**\[ga] on the end is not necessary. .IP \[bu] 2 -\[dq]s3.private.sjc04.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 +Do \f[I]not\f[R] add a \[ga]- **\[ga] in the file. +Without this line, everything will be included that has not been +explicitly excluded. .IP \[bu] 2 -San Jose Single Site Private Endpoint +Disregard step 3. .RE +.PP +A few rules for the syntax of a filter file expanding on filtering +documentation (https://rclone.org/filtering/): .IP \[bu] 2 -\[dq]s3.mil01.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 +Lines may start with spaces and tabs - rclone strips leading whitespace. .IP \[bu] 2 -Milan Single Site Endpoint -.RE +If the first non-whitespace character is a \f[C]#\f[R] then the line is +a comment and will be ignored. .IP \[bu] 2 -\[dq]s3.private.mil01.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 +Blank lines are ignored. .IP \[bu] 2 -Milan Single Site Private Endpoint -.RE +The first non-whitespace character on a filter line must be a +\f[C]+\f[R] or \f[C]-\f[R]. .IP \[bu] 2 -\[dq]s3.hkg02.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 +Exactly 1 space is allowed between the \f[C]+/-\f[R] and the path term. .IP \[bu] 2 -Hong Kong Single Site Endpoint -.RE +Only forward slashes (\f[C]/\f[R]) are used in path terms, even on +Windows. .IP \[bu] 2 -\[dq]s3.private.hkg02.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 +The rest of the line is taken as the path term. +Trailing whitespace is taken literally, and probably is an error. +.SS Example include-style filters for Windows user directories +.PP +This Windows \f[I]include-style\f[R] example is based on the sync root +(Path1) set to \f[C]C:\[rs]Users\[rs]MyLogin\f[R]. +The strategy is to select specific directories to be synched with a +network drive (Path2). .IP \[bu] 2 -Hong Kong Single Site Private Endpoint -.RE +\[ga]- /AppData/\[ga] excludes an entire tree of Windows stored stuff +that need not be synched. +In my case, AppData has >11 GB of stuff I don\[aq]t care about, and +there are some subdirectories beneath AppData that are not accessible to +my user login, resulting in bisync critical aborts. .IP \[bu] 2 -\[dq]s3.par01.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 +Windows creates cache files starting with both upper and lowercase +\f[C]NTUSER\f[R] at \f[C]C:\[rs]Users\[rs]MyLogin\f[R]. +These files may be dynamic, locked, and are generally \f[I]don\[aq]t +care\f[R]. .IP \[bu] 2 -Paris Single Site Endpoint -.RE +There are just a few directories with \f[I]my\f[R] data that I do want +synched, in the form of \[ga]+ +/\f[C]. By selecting only the directory trees I want to avoid the dozen plus directories that various apps make at\f[R]C:\[ga]. .IP \[bu] 2 -\[dq]s3.private.par01.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 +Include files in the root of the sync point, +\f[C]C:\[rs]Users\[rs]MyLogin\f[R], by adding the \[ga]+ /*\[ga] line. .IP \[bu] 2 -Paris Single Site Private Endpoint -.RE +This is an Include-style filters file, therefore it ends with \[ga]- +**\[ga] which excludes everything not explicitly included. +.IP +.nf +\f[C] +- /AppData/ +- NTUSER* +- ntuser* ++ /Documents/Family/** ++ /Documents/Sketchup/** ++ /Documents/Microcapture_Photo/** ++ /Documents/Microcapture_Video/** ++ /Desktop/** ++ /Pictures/** ++ /* +- ** +\f[R] +.fi +.PP +Note also that Windows implements several \[dq]library\[dq] links such +as \f[C]C:\[rs]Users\[rs]MyLogin\[rs]My Documents\[rs]My Music\f[R] +pointing to \f[C]C:\[rs]Users\[rs]MyLogin\[rs]Music\f[R]. +rclone sees these as links, so you must add \f[C]--links\f[R] to the +bisync command line if you which to follow these links. +I find that I get permission errors in trying to follow the links, so I +don\[aq]t include the rclone \f[C]--links\f[R] flag, but then you get +lots of \f[C]Can\[aq]t follow symlink\&...\f[R] noise from rclone about +not following the links. +This noise can be quashed by adding \f[C]--quiet\f[R] to the bisync +command line. +.SS Example exclude-style filters files for use with Dropbox .IP \[bu] 2 -\[dq]s3.sng01.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 +Dropbox disallows synching the listed temporary and configuration/data +files. +The \[ga]- \[ga] filters exclude these files where ever they may occur +in the sync tree. +Consider adding similar exclusions for file types you don\[aq]t need to +sync, such as core dump and software build files. .IP \[bu] 2 -Singapore Single Site Endpoint -.RE +bisync testing creates \f[C]/testdir/\f[R] at the top level of the sync +tree, and usually deletes the tree after the test. +If a normal sync should run while the \f[C]/testdir/\f[R] tree exists +the \f[C]--check-access\f[R] phase may fail due to unbalanced +RCLONE_TEST files. +The \[ga]- /testdir/\[ga] filter blocks this tree from being synched. +You don\[aq]t need this exclusion if you are not doing bisync +development testing. .IP \[bu] 2 -\[dq]s3.private.sng01.cloud-object-storage.appdomain.cloud\[dq] -.RS 2 +Everything else beneath the Path1/Path2 root will be synched. .IP \[bu] 2 -Singapore Single Site Private Endpoint -.RE -.RE -.SS --s3-endpoint +RCLONE_TEST files may be placed anywhere within the tree, including the +root. +.SS Example filters file for Dropbox +.IP +.nf +\f[C] +# Filter file for use with bisync +# See https://rclone.org/filtering/ for filtering rules +# NOTICE: If you make changes to this file you MUST do a --resync run. +# Run with --dry-run to see what changes will be made. + +# Dropbox won\[aq]t sync some files so filter them away here. +# See https://help.dropbox.com/installs-integrations/sync-uploads/files-not-syncing +- .dropbox.attr +- \[ti]*.tmp +- \[ti]$* +- .\[ti]* +- desktop.ini +- .dropbox + +# Used for bisync testing, so excluded from normal runs +- /testdir/ + +# Other example filters +#- /TiBU/ +#- /Photos/ +\f[R] +.fi +.SS How --check-access handles filters .PP -Endpoint for IONOS S3 Object Storage. +At the start of a bisync run, listings are gathered for Path1 and Path2 +while using the user\[aq]s \f[C]--filters-file\f[R]. +During the check access phase, bisync scans these listings for +\f[C]RCLONE_TEST\f[R] files. +Any \f[C]RCLONE_TEST\f[R] files hidden by the \f[C]--filters-file\f[R] +are \f[I]not\f[R] in the listings and thus not checked during the check +access phase. +.SS Troubleshooting +.SS Reading bisync logs .PP -Specify the endpoint from the same region. +Here are two normal runs. +The first one has a newer file on the remote. +The second has no deltas between local and remote. +.IP +.nf +\f[C] +2021/05/16 00:24:38 INFO : Synching Path1 \[dq]/path/to/local/tree/\[dq] with Path2 \[dq]dropbox:/\[dq] +2021/05/16 00:24:38 INFO : Path1 checking for diffs +2021/05/16 00:24:38 INFO : - Path1 File is new - file.txt +2021/05/16 00:24:38 INFO : Path1: 1 changes: 1 new, 0 newer, 0 older, 0 deleted +2021/05/16 00:24:38 INFO : Path2 checking for diffs +2021/05/16 00:24:38 INFO : Applying changes +2021/05/16 00:24:38 INFO : - Path1 Queue copy to Path2 - dropbox:/file.txt +2021/05/16 00:24:38 INFO : - Path1 Do queued copies to - Path2 +2021/05/16 00:24:38 INFO : Updating listings +2021/05/16 00:24:38 INFO : Validating listings for Path1 \[dq]/path/to/local/tree/\[dq] vs Path2 \[dq]dropbox:/\[dq] +2021/05/16 00:24:38 INFO : Bisync successful + +2021/05/16 00:36:52 INFO : Synching Path1 \[dq]/path/to/local/tree/\[dq] with Path2 \[dq]dropbox:/\[dq] +2021/05/16 00:36:52 INFO : Path1 checking for diffs +2021/05/16 00:36:52 INFO : Path2 checking for diffs +2021/05/16 00:36:52 INFO : No changes found +2021/05/16 00:36:52 INFO : Updating listings +2021/05/16 00:36:52 INFO : Validating listings for Path1 \[dq]/path/to/local/tree/\[dq] vs Path2 \[dq]dropbox:/\[dq] +2021/05/16 00:36:52 INFO : Bisync successful +\f[R] +.fi +.SS Dry run oddity .PP -Properties: -.IP \[bu] 2 -Config: endpoint -.IP \[bu] 2 -Env Var: RCLONE_S3_ENDPOINT -.IP \[bu] 2 -Provider: IONOS -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]s3-eu-central-1.ionoscloud.com\[dq] -.RS 2 -.IP \[bu] 2 -Frankfurt, Germany -.RE -.IP \[bu] 2 -\[dq]s3-eu-central-2.ionoscloud.com\[dq] -.RS 2 -.IP \[bu] 2 -Berlin, Germany -.RE -.IP \[bu] 2 -\[dq]s3-eu-south-2.ionoscloud.com\[dq] -.RS 2 -.IP \[bu] 2 -Logrono, Spain -.RE -.RE -.SS --s3-endpoint +The \f[C]--dry-run\f[R] messages may indicate that it would try to +delete some files. +For example, if a file is new on Path2 and does not exist on Path1 then +it would normally be copied to Path1, but with \f[C]--dry-run\f[R] +enabled those copies don\[aq]t happen, which leads to the attempted +delete on Path2, blocked again by --dry-run: +\f[C]... Not deleting as --dry-run\f[R]. .PP -Endpoint for Petabox S3 Object Storage. +This whole confusing situation is an artifact of the \f[C]--dry-run\f[R] +flag. +Scrutinize the proposed deletes carefully, and if the files would have +been copied to Path1 then the threatened deletes on Path2 may be +disregarded. +.SS Retries .PP -Specify the endpoint from the same region. +Rclone has built-in retries. +If you run with \f[C]--verbose\f[R] you\[aq]ll see error and retry +messages such as shown below. +This is usually not a bug. +If at the end of the run, you see \f[C]Bisync successful\f[R] and not +\f[C]Bisync critical error\f[R] or \f[C]Bisync aborted\f[R] then the run +was successful, and you can ignore the error messages. .PP -Properties: -.IP \[bu] 2 -Config: endpoint -.IP \[bu] 2 -Env Var: RCLONE_S3_ENDPOINT -.IP \[bu] 2 -Provider: Petabox -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: true -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]s3.petabox.io\[dq] -.RS 2 -.IP \[bu] 2 -US East (N. -Virginia) -.RE -.IP \[bu] 2 -\[dq]s3.us-east-1.petabox.io\[dq] -.RS 2 -.IP \[bu] 2 -US East (N. -Virginia) -.RE -.IP \[bu] 2 -\[dq]s3.eu-central-1.petabox.io\[dq] -.RS 2 -.IP \[bu] 2 -Europe (Frankfurt) -.RE -.IP \[bu] 2 -\[dq]s3.ap-southeast-1.petabox.io\[dq] -.RS 2 -.IP \[bu] 2 -Asia Pacific (Singapore) -.RE -.IP \[bu] 2 -\[dq]s3.me-south-1.petabox.io\[dq] -.RS 2 -.IP \[bu] 2 -Middle East (Bahrain) -.RE -.IP \[bu] 2 -\[dq]s3.sa-east-1.petabox.io\[dq] -.RS 2 -.IP \[bu] 2 -South America (S\[~a]o Paulo) -.RE -.RE -.SS --s3-endpoint +The following run shows an intermittent fail. +Lines \f[I]5\f[R] and _6- are low-level messages. +Line \f[I]6\f[R] is a bubbled-up \f[I]warning\f[R] message, conveying +the error. +Rclone normally retries failing commands, so there may be numerous such +messages in the log. +.PP +Since there are no final error/warning messages on line \f[I]7\f[R], +rclone has recovered from failure after a retry, and the overall sync +was successful. +.IP +.nf +\f[C] +1: 2021/05/14 00:44:12 INFO : Synching Path1 \[dq]/path/to/local/tree\[dq] with Path2 \[dq]dropbox:\[dq] +2: 2021/05/14 00:44:12 INFO : Path1 checking for diffs +3: 2021/05/14 00:44:12 INFO : Path2 checking for diffs +4: 2021/05/14 00:44:12 INFO : Path2: 113 changes: 22 new, 0 newer, 0 older, 91 deleted +5: 2021/05/14 00:44:12 ERROR : /path/to/local/tree/objects/af: error listing: unexpected end of JSON input +6: 2021/05/14 00:44:12 NOTICE: WARNING listing try 1 failed. - dropbox: +7: 2021/05/14 00:44:12 INFO : Bisync successful +\f[R] +.fi .PP -Endpoint for Leviia Object Storage API. +This log shows a \f[I]Critical failure\f[R] which requires a +\f[C]--resync\f[R] to recover from. +See the Runtime Error Handling section. +.IP +.nf +\f[C] +2021/05/12 00:49:40 INFO : Google drive root \[aq]\[aq]: Waiting for checks to finish +2021/05/12 00:49:40 INFO : Google drive root \[aq]\[aq]: Waiting for transfers to finish +2021/05/12 00:49:40 INFO : Google drive root \[aq]\[aq]: not deleting files as there were IO errors +2021/05/12 00:49:40 ERROR : Attempt 3/3 failed with 3 errors and: not deleting files as there were IO errors +2021/05/12 00:49:40 ERROR : Failed to sync: not deleting files as there were IO errors +2021/05/12 00:49:40 NOTICE: WARNING rclone sync try 3 failed. - /path/to/local/tree/ +2021/05/12 00:49:40 ERROR : Bisync aborted. Must run --resync to recover. +\f[R] +.fi +.SS Denied downloads of \[dq]infected\[dq] or \[dq]abusive\[dq] files .PP -Properties: -.IP \[bu] 2 -Config: endpoint -.IP \[bu] 2 -Env Var: RCLONE_S3_ENDPOINT -.IP \[bu] 2 -Provider: Leviia -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]s3.leviia.com\[dq] -.RS 2 -.IP \[bu] 2 -The default endpoint -.IP \[bu] 2 -Leviia -.RE -.RE -.SS --s3-endpoint +Google Drive has a filter for certain file types (\f[C].exe\f[R], +\f[C].apk\f[R], et cetera) that by default cannot be copied from Google +Drive to the local filesystem. +If you are having problems, run with \f[C]--verbose\f[R] to see +specifically which files are generating complaints. +If the error is +\f[C]This file has been identified as malware or spam and cannot be downloaded\f[R], +consider using the flag +--drive-acknowledge-abuse (https://rclone.org/drive/#drive-acknowledge-abuse). +.SS Google Doc files .PP -Endpoint for Liara Object Storage API. +Google docs exist as virtual files on Google Drive and cannot be +transferred to other filesystems natively. +While it is possible to export a Google doc to a normal file (with +\f[C].xlsx\f[R] extension, for example), it is not possible to import a +normal file back into a Google document. .PP -Properties: -.IP \[bu] 2 -Config: endpoint -.IP \[bu] 2 -Env Var: RCLONE_S3_ENDPOINT -.IP \[bu] 2 -Provider: Liara -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]storage.iran.liara.space\[dq] -.RS 2 -.IP \[bu] 2 -The default endpoint -.IP \[bu] 2 -Iran -.RE -.RE -.SS --s3-endpoint +Bisync\[aq]s handling of Google Doc files is to flag them in the run log +output for user\[aq]s attention and ignore them for any file transfers, +deletes, or syncs. +They will show up with a length of \f[C]-1\f[R] in the listings. +This bisync run is otherwise successful: +.IP +.nf +\f[C] +2021/05/11 08:23:15 INFO : Synching Path1 \[dq]/path/to/local/tree/base/\[dq] with Path2 \[dq]GDrive:\[dq] +2021/05/11 08:23:15 INFO : ...path2.lst-new: Ignoring incorrect line: \[dq]- -1 - - 2018-07-29T08:49:30.136000000+0000 GoogleDoc.docx\[dq] +2021/05/11 08:23:15 INFO : Bisync successful +\f[R] +.fi +.SS Usage examples +.SS Cron +.PP +Rclone does not yet have a built-in capability to monitor the local file +system for changes and must be blindly run periodically. +On Windows this can be done using a \f[I]Task Scheduler\f[R], on Linux +you can use \f[I]Cron\f[R] which is described below. +.PP +The 1st example runs a sync every 5 minutes between a local directory +and an OwnCloud server, with output logged to a runlog file: +.IP +.nf +\f[C] +# Minute (0-59) +# Hour (0-23) +# Day of Month (1-31) +# Month (1-12 or Jan-Dec) +# Day of Week (0-6 or Sun-Sat) +# Command + */5 * * * * /path/to/rclone bisync /local/files MyCloud: --check-access --filters-file /path/to/bysync-filters.txt --log-file /path/to//bisync.log +\f[R] +.fi +.PP +See crontab +syntax (https://www.man7.org/linux/man-pages/man1/crontab.1p.html#INPUT_FILES) +for the details of crontab time interval expressions. +.PP +If you run \f[C]rclone bisync\f[R] as a cron job, redirect stdout/stderr +to a file. +The 2nd example runs a sync to Dropbox every hour and logs all stdout +(via the \f[C]>>\f[R]) and stderr (via \f[C]2>&1\f[R]) to a log file. +.IP +.nf +\f[C] +0 * * * * /path/to/rclone bisync /path/to/local/dropbox Dropbox: --check-access --filters-file /home/user/filters.txt >> /path/to/logs/dropbox-run.log 2>&1 +\f[R] +.fi +.SS Sharing an encrypted folder tree between hosts .PP -Endpoint for OSS API. +bisync can keep a local folder in sync with a cloud service, but what if +you have some highly sensitive files to be synched? .PP -Properties: -.IP \[bu] 2 -Config: endpoint -.IP \[bu] 2 -Env Var: RCLONE_S3_ENDPOINT -.IP \[bu] 2 -Provider: Alibaba -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]oss-accelerate.aliyuncs.com\[dq] -.RS 2 -.IP \[bu] 2 -Global Accelerate -.RE -.IP \[bu] 2 -\[dq]oss-accelerate-overseas.aliyuncs.com\[dq] -.RS 2 -.IP \[bu] 2 -Global Accelerate (outside mainland China) -.RE -.IP \[bu] 2 -\[dq]oss-cn-hangzhou.aliyuncs.com\[dq] -.RS 2 -.IP \[bu] 2 -East China 1 (Hangzhou) -.RE -.IP \[bu] 2 -\[dq]oss-cn-shanghai.aliyuncs.com\[dq] -.RS 2 -.IP \[bu] 2 -East China 2 (Shanghai) -.RE -.IP \[bu] 2 -\[dq]oss-cn-qingdao.aliyuncs.com\[dq] -.RS 2 -.IP \[bu] 2 -North China 1 (Qingdao) -.RE -.IP \[bu] 2 -\[dq]oss-cn-beijing.aliyuncs.com\[dq] -.RS 2 -.IP \[bu] 2 -North China 2 (Beijing) -.RE -.IP \[bu] 2 -\[dq]oss-cn-zhangjiakou.aliyuncs.com\[dq] -.RS 2 -.IP \[bu] 2 -North China 3 (Zhangjiakou) -.RE -.IP \[bu] 2 -\[dq]oss-cn-huhehaote.aliyuncs.com\[dq] -.RS 2 -.IP \[bu] 2 -North China 5 (Hohhot) -.RE -.IP \[bu] 2 -\[dq]oss-cn-wulanchabu.aliyuncs.com\[dq] -.RS 2 -.IP \[bu] 2 -North China 6 (Ulanqab) -.RE -.IP \[bu] 2 -\[dq]oss-cn-shenzhen.aliyuncs.com\[dq] -.RS 2 -.IP \[bu] 2 -South China 1 (Shenzhen) -.RE -.IP \[bu] 2 -\[dq]oss-cn-heyuan.aliyuncs.com\[dq] -.RS 2 -.IP \[bu] 2 -South China 2 (Heyuan) -.RE -.IP \[bu] 2 -\[dq]oss-cn-guangzhou.aliyuncs.com\[dq] -.RS 2 -.IP \[bu] 2 -South China 3 (Guangzhou) -.RE -.IP \[bu] 2 -\[dq]oss-cn-chengdu.aliyuncs.com\[dq] -.RS 2 +Usage of a cloud service is for exchanging both routine and sensitive +personal files between one\[aq]s home network, one\[aq]s personal +notebook when on the road, and with one\[aq]s work computer. +The routine data is not sensitive. +For the sensitive data, configure an rclone crypt +remote (https://rclone.org/crypt/) to point to a subdirectory within the +local disk tree that is bisync\[aq]d to Dropbox, and then set up an +bisync for this local crypt directory to a directory outside of the main +sync tree. +.SS Linux server setup .IP \[bu] 2 -West China 1 (Chengdu) -.RE +\f[C]/path/to/DBoxroot\f[R] is the root of my local sync tree. +There are numerous subdirectories. .IP \[bu] 2 -\[dq]oss-cn-hongkong.aliyuncs.com\[dq] -.RS 2 +\f[C]/path/to/DBoxroot/crypt\f[R] is the root subdirectory for files +that are encrypted. +This local directory target is setup as an rclone crypt remote named +\f[C]Dropcrypt:\f[R]. +See rclone.conf snippet below. .IP \[bu] 2 -Hong Kong (Hong Kong) -.RE +\f[C]/path/to/my/unencrypted/files\f[R] is the root of my sensitive +files - not encrypted, not within the tree synched to Dropbox. .IP \[bu] 2 -\[dq]oss-us-west-1.aliyuncs.com\[dq] -.RS 2 +To sync my local unencrypted files with the encrypted Dropbox versions I +manually run \f[C]bisync /path/to/my/unencrypted/files DropCrypt:\f[R]. +This step could be bundled into a script to run before and after the +full Dropbox tree sync in the last step, thus actively keeping the +sensitive files in sync. .IP \[bu] 2 -US West 1 (Silicon Valley) -.RE +\f[C]bisync /path/to/DBoxroot Dropbox:\f[R] runs periodically via cron, +keeping my full local sync tree in sync with Dropbox. +.SS Windows notebook setup .IP \[bu] 2 -\[dq]oss-us-east-1.aliyuncs.com\[dq] -.RS 2 +The Dropbox client runs keeping the local tree +\f[C]C:\[rs]Users\[rs]MyLogin\[rs]Dropbox\f[R] always in sync with +Dropbox. +I could have used \f[C]rclone bisync\f[R] instead. .IP \[bu] 2 -US East 1 (Virginia) -.RE +A separate directory tree at +\f[C]C:\[rs]Users\[rs]MyLogin\[rs]Documents\[rs]DropLocal\f[R] hosts the +tree of unencrypted files/folders. .IP \[bu] 2 -\[dq]oss-ap-southeast-1.aliyuncs.com\[dq] -.RS 2 +To sync my local unencrypted files with the encrypted Dropbox versions I +manually run the following command: +\f[C]rclone bisync C:\[rs]Users\[rs]MyLogin\[rs]Documents\[rs]DropLocal Dropcrypt:\f[R]. .IP \[bu] 2 -Southeast Asia Southeast 1 (Singapore) -.RE +The Dropbox client then syncs the changes with Dropbox. +.SS rclone.conf snippet +.IP +.nf +\f[C] +[Dropbox] +type = dropbox +\&... + +[Dropcrypt] +type = crypt +remote = /path/to/DBoxroot/crypt # on the Linux server +remote = C:\[rs]Users\[rs]MyLogin\[rs]Dropbox\[rs]crypt # on the Windows notebook +filename_encryption = standard +directory_name_encryption = true +password = ... +\&... +\f[R] +.fi +.SS Testing +.PP +You should read this section only if you are developing for rclone. +You need to have rclone source code locally to work with bisync tests. +.PP +Bisync has a dedicated test framework implemented in the +\f[C]bisync_test.go\f[R] file located in the rclone source tree. +The test suite is based on the \f[C]go test\f[R] command. +Series of tests are stored in subdirectories below the +\f[C]cmd/bisync/testdata\f[R] directory. +Individual tests can be invoked by their directory name, e.g. +\f[C]go test . -case basic -remote local -remote2 gdrive: -v\f[R] +.PP +Tests will make a temporary folder on remote and purge it afterwards. +If during test run there are intermittent errors and rclone retries, +these errors will be captured and flagged as invalid MISCOMPAREs. +Rerunning the test will let it pass. +Consider such failures as noise. +.SS Test command syntax +.IP +.nf +\f[C] +usage: go test ./cmd/bisync [options...] + +Options: + -case NAME Name(s) of the test case(s) to run. Multiple names should + be separated by commas. You can remove the \[ga]test_\[ga] prefix + and replace \[ga]_\[ga] by \[ga]-\[ga] in test name for convenience. + If not \[ga]all\[ga], the name(s) should map to a directory under + \[ga]./cmd/bisync/testdata\[ga]. + Use \[ga]all\[ga] to run all tests (default: all) + -remote PATH1 \[ga]local\[ga] or name of cloud service with \[ga]:\[ga] (default: local) + -remote2 PATH2 \[ga]local\[ga] or name of cloud service with \[ga]:\[ga] (default: local) + -no-compare Disable comparing test results with the golden directory + (default: compare) + -no-cleanup Disable cleanup of Path1 and Path2 testdirs. + Useful for troubleshooting. (default: cleanup) + -golden Store results in the golden directory (default: false) + This flag can be used with multiple tests. + -debug Print debug messages + -stop-at NUM Stop test after given step number. (default: run to the end) + Implies \[ga]-no-compare\[ga] and \[ga]-no-cleanup\[ga], if the test really + ends prematurely. Only meaningful for a single test case. + -refresh-times Force refreshing the target modtime, useful for Dropbox + (default: false) + -verbose Run tests verbosely +\f[R] +.fi +.PP +Note: unlike rclone flags which must be prefixed by double dash +(\f[C]--\f[R]), the test command flags can be equally prefixed by a +single \f[C]-\f[R] or double dash. +.SS Running tests .IP \[bu] 2 -\[dq]oss-ap-southeast-2.aliyuncs.com\[dq] -.RS 2 +\f[C]go test . -case basic -remote local -remote2 local\f[R] runs the +\f[C]test_basic\f[R] test case using only the local filesystem, synching +one local directory with another local directory. +Test script output is to the console, while commands within scenario.txt +have their output sent to the \f[C].../workdir/test.log\f[R] file, which +is finally compared to the golden copy. .IP \[bu] 2 -Asia Pacific Southeast 2 (Sydney) -.RE +The first argument after \f[C]go test\f[R] should be a relative name of +the directory containing bisync source code. +If you run tests right from there, the argument will be \f[C].\f[R] +(current directory) as in most examples below. +If you run bisync tests from the rclone source directory, the command +should be \f[C]go test ./cmd/bisync ...\f[R]. .IP \[bu] 2 -\[dq]oss-ap-southeast-3.aliyuncs.com\[dq] -.RS 2 +The test engine will mangle rclone output to ensure comparability with +golden listings and logs. .IP \[bu] 2 -Southeast Asia Southeast 3 (Kuala Lumpur) -.RE +Test scenarios are located in \f[C]./cmd/bisync/testdata\f[R]. +The test \f[C]-case\f[R] argument should match the full name of a +subdirectory under that directory. +Every test subdirectory name on disk must start with \f[C]test_\f[R], +this prefix can be omitted on command line for brevity. +Also, underscores in the name can be replaced by dashes for convenience. .IP \[bu] 2 -\[dq]oss-ap-southeast-5.aliyuncs.com\[dq] -.RS 2 +\f[C]go test . -remote local -remote2 local -case all\f[R] runs all +tests. .IP \[bu] 2 -Asia Pacific Southeast 5 (Jakarta) -.RE +Path1 and Path2 may either be the keyword \f[C]local\f[R] or may be +names of configured cloud services. +\f[C]go test . -remote gdrive: -remote2 dropbox: -case basic\f[R] will +run the test between these two services, without transferring any files +to the local filesystem. .IP \[bu] 2 -\[dq]oss-ap-northeast-1.aliyuncs.com\[dq] -.RS 2 +Test run stdout and stderr console output may be directed to a file, +e.g. +\f[C]go test . -remote gdrive: -remote2 local -case all > runlog.txt 2>&1\f[R] +.SS Test execution flow +.IP "1." 3 +The base setup in the \f[C]initial\f[R] directory of the testcase is +applied on the Path1 and Path2 filesystems (via rclone copy the initial +directory to Path1, then rclone sync Path1 to Path2). +.IP "2." 3 +The commands in the scenario.txt file are applied, with output directed +to the \f[C]test.log\f[R] file in the test working directory. +Typically, the first actual command in the \f[C]scenario.txt\f[R] file +is to do a \f[C]--resync\f[R], which establishes the baseline +\f[C]{...}.path1.lst\f[R] and \f[C]{...}.path2.lst\f[R] files in the +test working directory (\f[C].../workdir/\f[R] relative to the temporary +test directory). +Various commands and listing snapshots are done within the test. +.IP "3." 3 +Finally, the contents of the test working directory are compared to the +contents of the testcase\[aq]s golden directory. +.SS Notes about testing .IP \[bu] 2 -Asia Pacific Northeast 1 (Japan) -.RE +Test cases are in individual directories beneath +\f[C]./cmd/bisync/testdata\f[R]. +A command line reference to a test is understood to reference a +directory beneath \f[C]testdata\f[R]. +For example, +\f[C]go test ./cmd/bisync -case dry-run -remote gdrive: -remote2 local\f[R] +refers to the test case in \f[C]./cmd/bisync/testdata/test_dry_run\f[R]. .IP \[bu] 2 -\[dq]oss-ap-south-1.aliyuncs.com\[dq] -.RS 2 +The test working directory is located at \f[C].../workdir\f[R] relative +to a temporary test directory, usually under \f[C]/tmp\f[R] on Linux. .IP \[bu] 2 -Asia Pacific South 1 (Mumbai) -.RE +The local test sync tree is created at a temporary directory named like +\f[C]bisync.XXX\f[R] under system temporary directory. .IP \[bu] 2 -\[dq]oss-eu-central-1.aliyuncs.com\[dq] -.RS 2 +The remote test sync tree is located at a temporary directory under +\f[C]/bisync.XXX/\f[R]. .IP \[bu] 2 -Central Europe 1 (Frankfurt) -.RE +\f[C]path1\f[R] and/or \f[C]path2\f[R] subdirectories are created in a +temporary directory under the respective local or cloud test remote. .IP \[bu] 2 -\[dq]oss-eu-west-1.aliyuncs.com\[dq] -.RS 2 +By default, the Path1 and Path2 test dirs and workdir will be deleted +after each test run. +The \f[C]-no-cleanup\f[R] flag disables purging these directories when +validating and debugging a given test. +These directories will be flushed before running another test, +independent of the \f[C]-no-cleanup\f[R] usage. .IP \[bu] 2 -West Europe (London) -.RE +You will likely want to add \[ga]- +/testdir/\f[C]to your normal bisync\f[R]--filters-file\f[C]so that normal syncs do not attempt to sync the test temporary directories, which may have\f[R]RCLONE_TEST\f[C]miscompares in some testcases which would otherwise trip the\f[R]--check-access\f[C]system. The\f[R]--check-access\f[C]mechanism is hard-coded to ignore\f[R]RCLONE_TEST\f[C]files beneath\f[R]bisync/testdata\[ga], +so the test cases may reside on the synched tree even if there are check +file mismatches in the test tree. .IP \[bu] 2 -\[dq]oss-me-east-1.aliyuncs.com\[dq] -.RS 2 +Some Dropbox tests can fail, notably printing the following message: +\f[C]src and dst identical but can\[aq]t set mod time without deleting and re-uploading\f[R] +This is expected and happens due to the way Dropbox handles modification +times. +You should use the \f[C]-refresh-times\f[R] test flag to make up for +this. .IP \[bu] 2 -Middle East 1 (Dubai) -.RE -.RE -.SS --s3-endpoint +If Dropbox tests hit request limit for you and print error message +\f[C]too_many_requests/...: Too many requests or write operations.\f[R] +then follow the Dropbox App ID +instructions (https://rclone.org/dropbox/#get-your-own-dropbox-app-id). +.SS Updating golden results .PP -Endpoint for OBS API. +Sometimes even a slight change in the bisync source can cause little +changes spread around many log files. +Updating them manually would be a nightmare. .PP -Properties: -.IP \[bu] 2 -Config: endpoint -.IP \[bu] 2 -Env Var: RCLONE_S3_ENDPOINT -.IP \[bu] 2 -Provider: HuaweiOBS -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]obs.af-south-1.myhuaweicloud.com\[dq] -.RS 2 -.IP \[bu] 2 -AF-Johannesburg -.RE -.IP \[bu] 2 -\[dq]obs.ap-southeast-2.myhuaweicloud.com\[dq] -.RS 2 -.IP \[bu] 2 -AP-Bangkok -.RE +The \f[C]-golden\f[R] flag will store the \f[C]test.log\f[R] and +\f[C]*.lst\f[R] listings from each test case into respective golden +directories. +Golden results will automatically contain generic strings instead of +local or cloud paths which means that they should match when run with a +different cloud service. +.PP +Your normal workflow might be as follows: 1. +Git-clone the rclone sources locally 2. +Modify bisync source and check that it builds 3. +Run the whole test suite \f[C]go test ./cmd/bisync -remote local\f[R] 4. +If some tests show log difference, recheck them individually, e.g.: +\f[C]go test ./cmd/bisync -remote local -case basic\f[R] 5. +If you are convinced with the difference, goldenize all tests at once: +\f[C]go test ./cmd/bisync -remote local -golden\f[R] 6. +Use word diff: \f[C]git diff --word-diff ./cmd/bisync/testdata/\f[R]. +Please note that normal line-level diff is generally useless here. +7. +Check the difference \f[I]carefully\f[R]! 8. +Commit the change (\f[C]git commit\f[R]) \f[I]only\f[R] if you are sure. +If unsure, save your code changes then wipe the log diffs from git: +\f[C]git reset [--hard]\f[R]. +.SS Structure of test scenarios .IP \[bu] 2 -\[dq]obs.ap-southeast-3.myhuaweicloud.com\[dq] -.RS 2 +\f[C]/initial/\f[R] contains a tree of files that will be set +as the initial condition on both Path1 and Path2 testdirs. .IP \[bu] 2 -AP-Singapore -.RE +\f[C]/modfiles/\f[R] contains files that will be used to +modify the Path1 and/or Path2 filesystems. .IP \[bu] 2 -\[dq]obs.cn-east-3.myhuaweicloud.com\[dq] -.RS 2 +\f[C]/golden/\f[R] contains the expected content of the test +working directory (\f[C]workdir\f[R]) at the completion of the testcase. .IP \[bu] 2 -CN East-Shanghai1 -.RE +\f[C]/scenario.txt\f[R] contains the body of the test, in the +form of various commands to modify files, run bisync, and snapshot +listings. +Output from these commands is captured to \f[C].../workdir/test.log\f[R] +for comparison to the golden files. +.SS Supported test commands .IP \[bu] 2 -\[dq]obs.cn-east-2.myhuaweicloud.com\[dq] -.RS 2 +\f[C]test \f[R] Print the line to the console and to the +\f[C]test.log\f[R]: +\f[C]test sync is working correctly with options x, y, z\f[R] .IP \[bu] 2 -CN East-Shanghai2 -.RE +\f[C]copy-listings \f[R] Save a copy of all \f[C].lst\f[R] +listings in the test working directory with the specified prefix: +\f[C]save-listings exclude-pass-run\f[R] .IP \[bu] 2 -\[dq]obs.cn-north-1.myhuaweicloud.com\[dq] -.RS 2 +\f[C]move-listings \f[R] Similar to \f[C]copy-listings\f[R] but +removes the source .IP \[bu] 2 -CN North-Beijing1 -.RE +\f[C]purge-children \f[R] This will delete all child files and +purge all child subdirs under given directory but keep the parent +intact. +This behavior is important for tests with Google Drive because removing +and re-creating the parent would change its ID. .IP \[bu] 2 -\[dq]obs.cn-north-4.myhuaweicloud.com\[dq] -.RS 2 +\f[C]delete-file \f[R] Delete a single file. .IP \[bu] 2 -CN North-Beijing4 -.RE +\f[C]delete-glob \f[R] Delete a group of files located +one level deep in the given directory with names matching a given glob +pattern. .IP \[bu] 2 -\[dq]obs.cn-south-1.myhuaweicloud.com\[dq] -.RS 2 +\f[C]touch-glob YYYY-MM-DD \f[R] Change modification time +on a group of files. .IP \[bu] 2 -CN South-Guangzhou -.RE +\f[C]touch-copy YYYY-MM-DD \f[R] Change file +modification time then copy it to destination. .IP \[bu] 2 -\[dq]obs.ap-southeast-1.myhuaweicloud.com\[dq] -.RS 2 +\f[C]copy-file \f[R] Copy a single file to given +directory. .IP \[bu] 2 -CN-Hong Kong -.RE +\f[C]copy-as \f[R] Similar to above but +destination must include both directory and the new file name at +destination. .IP \[bu] 2 -\[dq]obs.sa-argentina-1.myhuaweicloud.com\[dq] -.RS 2 +\f[C]copy-dir \f[R] and \f[C]sync-dir \f[R] +Copy/sync a directory. +Equivalent of \f[C]rclone copy\f[R] and \f[C]rclone sync\f[R]. .IP \[bu] 2 -LA-Buenos Aires1 -.RE +\f[C]list-dirs \f[R] Equivalent to +\f[C]rclone lsf -R --dirs-only \f[R] .IP \[bu] 2 -\[dq]obs.sa-peru-1.myhuaweicloud.com\[dq] -.RS 2 +\f[C]bisync [options]\f[R] Runs bisync against \f[C]-remote\f[R] and +\f[C]-remote2\f[R]. +.SS Supported substitution terms .IP \[bu] 2 -LA-Lima1 -.RE +\f[C]{testdir/}\f[R] - the root dir of the testcase .IP \[bu] 2 -\[dq]obs.na-mexico-1.myhuaweicloud.com\[dq] -.RS 2 +\f[C]{datadir/}\f[R] - the \f[C]modfiles\f[R] dir under the testcase +root .IP \[bu] 2 -LA-Mexico City1 -.RE +\f[C]{workdir/}\f[R] - the temporary test working directory .IP \[bu] 2 -\[dq]obs.sa-chile-1.myhuaweicloud.com\[dq] -.RS 2 +\f[C]{path1/}\f[R] - the root of the Path1 test directory tree .IP \[bu] 2 -LA-Santiago2 -.RE +\f[C]{path2/}\f[R] - the root of the Path2 test directory tree .IP \[bu] 2 -\[dq]obs.sa-brazil-1.myhuaweicloud.com\[dq] -.RS 2 +\f[C]{session}\f[R] - base name of the test listings .IP \[bu] 2 -LA-Sao Paulo1 -.RE +\f[C]{/}\f[R] - OS-specific path separator .IP \[bu] 2 -\[dq]obs.ru-northwest-2.myhuaweicloud.com\[dq] -.RS 2 +\f[C]{spc}\f[R], \f[C]{tab}\f[R], \f[C]{eol}\f[R] - whitespace .IP \[bu] 2 -RU-Moscow2 -.RE -.RE -.SS --s3-endpoint +\f[C]{chr:HH}\f[R] - raw byte with given hexadecimal code .PP -Endpoint for Scaleway Object Storage. +Substitution results of the terms named like \f[C]{dir/}\f[R] will end +with \f[C]/\f[R] (or backslash on Windows), so it is not necessary to +include slash in the usage, for example +\f[C]delete-file {path1/}file1.txt\f[R]. +.SS Benchmarks .PP -Properties: -.IP \[bu] 2 -Config: endpoint -.IP \[bu] 2 -Env Var: RCLONE_S3_ENDPOINT -.IP \[bu] 2 -Provider: Scaleway -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]s3.nl-ams.scw.cloud\[dq] -.RS 2 -.IP \[bu] 2 -Amsterdam Endpoint -.RE +\f[I]This section is work in progress.\f[R] +.PP +Here are a few data points for scale, execution times, and memory usage. +.PP +The first set of data was taken between a local disk to Dropbox. +The speedtest.net (https://speedtest.net) download speed was \[ti]170 +Mbps, and upload speed was \[ti]10 Mbps. +500 files (\[ti]9.5 MB each) had been already synched. +50 files were added in a new directory, each \[ti]9.5 MB, \[ti]475 MB +total. +.PP +.TS +tab(@); +lw(23.8n) lw(35.0n) lw(11.2n). +T{ +Change +T}@T{ +Operations and times +T}@T{ +Overall run time +T} +_ +T{ +500 files synched (nothing to move) +T}@T{ +1x listings for Path1 & Path2 +T}@T{ +1.5 sec +T} +T{ +500 files synched with --check-access +T}@T{ +1x listings for Path1 & Path2 +T}@T{ +1.5 sec +T} +T{ +50 new files on remote +T}@T{ +Queued 50 copies down: 27 sec +T}@T{ +29 sec +T} +T{ +Moved local dir +T}@T{ +Queued 50 copies up: 410 sec, 50 deletes up: 9 sec +T}@T{ +421 sec +T} +T{ +Moved remote dir +T}@T{ +Queued 50 copies down: 31 sec, 50 deletes down: <1 sec +T}@T{ +33 sec +T} +T{ +Delete local dir +T}@T{ +Queued 50 deletes up: 9 sec +T}@T{ +13 sec +T} +.TE +.PP +This next data is from a user\[aq]s application. +They had \[ti]400GB of data over 1.96 million files being sync\[aq]ed +between a Windows local disk and some remote cloud. +The file full path length was on average 35 characters (which factors +into load time and RAM required). .IP \[bu] 2 -\[dq]s3.fr-par.scw.cloud\[dq] -.RS 2 +Loading the prior listing into memory (1.96 million files, listing file +size 140 MB) took \[ti]30 sec and occupied about 1 GB of RAM. .IP \[bu] 2 -Paris Endpoint -.RE +Getting a fresh listing of the local file system (producing the 140 MB +output file) took about XXX sec. .IP \[bu] 2 -\[dq]s3.pl-waw.scw.cloud\[dq] -.RS 2 +Getting a fresh listing of the remote file system (producing the 140 MB +output file) took about XXX sec. +The network download speed was measured at XXX Mb/s. .IP \[bu] 2 -Warsaw Endpoint -.RE -.RE -.SS --s3-endpoint +Once the prior and current Path1 and Path2 listings were loaded (a total +of four to be loaded, two at a time), determining the deltas was pretty +quick (a few seconds for this test case), and the transfer time for any +files to be copied was dominated by the network bandwidth. +.SS References .PP -Endpoint for StackPath Object Storage. +rclone\[aq]s bisync implementation was derived from the +rclonesync-V2 (https://github.com/cjnaz/rclonesync-V2) project, +including documentation and test mechanisms, with +[\[at]cjnaz](https://github.com/cjnaz)\[aq]s full support and +encouragement. .PP -Properties: -.IP \[bu] 2 -Config: endpoint -.IP \[bu] 2 -Env Var: RCLONE_S3_ENDPOINT -.IP \[bu] 2 -Provider: StackPath -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 +\f[C]rclone bisync\f[R] is similar in nature to a range of other +projects: .IP \[bu] 2 -\[dq]s3.us-east-2.stackpathstorage.com\[dq] -.RS 2 +unison (https://github.com/bcpierce00/unison) .IP \[bu] 2 -US East Endpoint -.RE +syncthing (https://github.com/syncthing/syncthing) .IP \[bu] 2 -\[dq]s3.us-west-1.stackpathstorage.com\[dq] -.RS 2 +cjnaz/rclonesync (https://github.com/cjnaz/rclonesync-V2) .IP \[bu] 2 -US West Endpoint -.RE +ConorWilliams/rsinc (https://github.com/ConorWilliams/rsinc) .IP \[bu] 2 -\[dq]s3.eu-central-1.stackpathstorage.com\[dq] -.RS 2 +jwink3101/syncrclone (https://github.com/Jwink3101/syncrclone) .IP \[bu] 2 -EU Endpoint -.RE -.RE -.SS --s3-endpoint +DavideRossi/upback (https://github.com/DavideRossi/upback) .PP -Endpoint for Google Cloud Storage. +Bisync adopts the differential synchronization technique, which is based +on keeping history of changes performed by both synchronizing sides. +See the \f[I]Dual Shadow Method\f[R] section in Neil Fraser\[aq]s +article (https://neil.fraser.name/writing/sync/). .PP -Properties: -.IP \[bu] 2 -Config: endpoint -.IP \[bu] 2 -Env Var: RCLONE_S3_ENDPOINT -.IP \[bu] 2 -Provider: GCS -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 +Also note a number of academic publications by Benjamin +Pierce (http://www.cis.upenn.edu/%7Ebcpierce/papers/index.shtml#File%20Synchronization) +about \f[I]Unison\f[R] and synchronization in general. +.SS Changelog +.SS \f[C]v1.64\f[R] .IP \[bu] 2 -\[dq]https://storage.googleapis.com\[dq] -.RS 2 +Fixed an +issue (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Dry%20runs%20are%20not%20completely%20dry) +causing dry runs to inadvertently commit filter changes .IP \[bu] 2 -Google Cloud Storage endpoint -.RE -.RE -.SS --s3-endpoint -.PP -Endpoint for Storj Gateway. -.PP -Properties: +Fixed an +issue (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=2.%20%2D%2Dresync%20deletes%20data%2C%20contrary%20to%20docs) +causing \f[C]--resync\f[R] to erroneously delete empty folders and +duplicate files unique to Path2 .IP \[bu] 2 -Config: endpoint +\f[C]--check-access\f[R] is now enforced during \f[C]--resync\f[R], +preventing data loss in certain user error +scenarios (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=%2D%2Dcheck%2Daccess%20doesn%27t%20always%20fail%20when%20it%20should) .IP \[bu] 2 -Env Var: RCLONE_S3_ENDPOINT +Fixed an +issue (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=5.%20Bisync%20reads%20files%20in%20excluded%20directories%20during%20delete%20operations) +causing bisync to consider more files than necessary due to overbroad +filters during delete operations .IP \[bu] 2 -Provider: Storj +Improved detection of false positive change +conflicts (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Identical%20files%20should%20be%20left%20alone%2C%20even%20if%20new/newer/changed%20on%20both%20sides) +(identical files are now left alone instead of renamed) .IP \[bu] 2 -Type: string +Added support for +\f[C]--create-empty-src-dirs\f[R] (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=3.%20Bisync%20should%20create/delete%20empty%20directories%20as%20sync%20does%2C%20when%20%2D%2Dcreate%2Dempty%2Dsrc%2Ddirs%20is%20passed) .IP \[bu] 2 -Required: false +Added experimental \f[C]--resilient\f[R] mode to allow recovery from +self-correctable +errors (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=2.%20Bisync%20should%20be%20more%20resilient%20to%20self%2Dcorrectable%20errors) .IP \[bu] 2 -Examples: -.RS 2 +Added new \f[C]--ignore-listing-checksum\f[R] +flag (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=6.%20%2D%2Dignore%2Dchecksum%20should%20be%20split%20into%20two%20flags%20for%20separate%20purposes) +to distinguish from \f[C]--ignore-checksum\f[R] .IP \[bu] 2 -\[dq]gateway.storjshare.io\[dq] -.RS 2 +Performance +improvements (https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=6.%20Deletes%20take%20several%20times%20longer%20than%20copies) +for large remotes .IP \[bu] 2 -Global Hosted Gateway -.RE -.RE -.SS --s3-endpoint +Documentation and testing improvements +.SH Release signing .PP -Endpoint for Synology C2 Object Storage API. +The hashes of the binary artefacts of the rclone release are signed with +a public PGP/GPG key. +This can be verified manually as described below. .PP -Properties: -.IP \[bu] 2 -Config: endpoint -.IP \[bu] 2 -Env Var: RCLONE_S3_ENDPOINT -.IP \[bu] 2 -Provider: Synology -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]eu-001.s3.synologyc2.net\[dq] -.RS 2 -.IP \[bu] 2 -EU Endpoint 1 -.RE -.IP \[bu] 2 -\[dq]eu-002.s3.synologyc2.net\[dq] -.RS 2 +The same mechanism is also used by rclone +selfupdate (https://rclone.org/commands/rclone_selfupdate/) to verify +that the release has not been tampered with before the new update is +installed. +This checks the SHA256 hash and the signature with a public key compiled +into the rclone binary. +.SS Release signing key +.PP +You may obtain the release signing key from: .IP \[bu] 2 -EU Endpoint 2 -.RE +From KEYS on this website - this file contains all past signing keys +also. .IP \[bu] 2 -\[dq]us-001.s3.synologyc2.net\[dq] -.RS 2 +The git repository hosted on GitHub - +https://github.com/rclone/rclone/blob/master/docs/content/KEYS .IP \[bu] 2 -US Endpoint 1 -.RE +\f[C]gpg --keyserver hkps://keys.openpgp.org --search nick\[at]craig-wood.com\f[R] .IP \[bu] 2 -\[dq]us-002.s3.synologyc2.net\[dq] -.RS 2 +\f[C]gpg --keyserver hkps://keyserver.ubuntu.com --search nick\[at]craig-wood.com\f[R] .IP \[bu] 2 -US Endpoint 2 -.RE +https://www.craig-wood.com/nick/pub/pgp-key.txt +.PP +After importing the key, verify that the fingerprint of one of the keys +matches: \f[C]FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA\f[R] as this key +is used for signing. +.PP +We recommend that you cross-check the fingerprint shown above through +the domains listed below. +By cross-checking the integrity of the fingerprint across multiple +domains you can be confident that you obtained the correct key. .IP \[bu] 2 -\[dq]tw-001.s3.synologyc2.net\[dq] -.RS 2 +The source for this page on +GitHub (https://github.com/rclone/rclone/blob/master/docs/content/release_signing.md). .IP \[bu] 2 -TW Endpoint 1 -.RE -.RE -.SS --s3-endpoint +Through DNS \f[C]dig key.rclone.org txt\f[R] +.PP +If you find anything that doesn\[aq]t not match, please contact the +developers at once. +.SS How to verify the release +.PP +In the release directory you will see the release files and some files +called \f[C]MD5SUMS\f[R], \f[C]SHA1SUMS\f[R] and \f[C]SHA256SUMS\f[R]. +.IP +.nf +\f[C] +$ rclone lsf --http-url https://downloads.rclone.org/v1.63.1 :http: +MD5SUMS +SHA1SUMS +SHA256SUMS +rclone-v1.63.1-freebsd-386.zip +rclone-v1.63.1-freebsd-amd64.zip +\&... +rclone-v1.63.1-windows-arm64.zip +rclone-v1.63.1.tar.gz +version.txt +\f[R] +.fi +.PP +The \f[C]MD5SUMS\f[R], \f[C]SHA1SUMS\f[R] and \f[C]SHA256SUMS\f[R] +contain hashes of the binary files in the release directory along with a +signature. +.PP +For example: +.IP +.nf +\f[C] +$ rclone cat --http-url https://downloads.rclone.org/v1.63.1 :http:SHA256SUMS +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +f6d1b2d7477475ce681bdce8cb56f7870f174cb6b2a9ac5d7b3764296ea4a113 rclone-v1.63.1-freebsd-386.zip +7266febec1f01a25d6575de51c44ddf749071a4950a6384e4164954dff7ac37e rclone-v1.63.1-freebsd-amd64.zip +\&... +66ca083757fb22198309b73879831ed2b42309892394bf193ff95c75dff69c73 rclone-v1.63.1-windows-amd64.zip +bbb47c16882b6c5f2e8c1b04229378e28f68734c613321ef0ea2263760f74cd0 rclone-v1.63.1-windows-arm64.zip +-----BEGIN PGP SIGNATURE----- + +iF0EARECAB0WIQT79zfs6firGGBL0qyTk14C/ztU+gUCZLVKJQAKCRCTk14C/ztU ++pZuAJ0XJ+QWLP/3jCtkmgcgc4KAwd/rrwCcCRZQ7E+oye1FPY46HOVzCFU3L7g= +=8qrL +-----END PGP SIGNATURE----- +\f[R] +.fi +.SS Download the files +.PP +The first step is to download the binary and SUMs file and verify that +the SUMs you have downloaded match. +Here we download \f[C]rclone-v1.63.1-windows-amd64.zip\f[R] - choose the +binary (or binaries) appropriate to your architecture. +We\[aq]ve also chosen the \f[C]SHA256SUMS\f[R] as these are the most +secure. +You could verify the other types of hash also for extra security. +\f[C]rclone selfupdate\f[R] verifies just the \f[C]SHA256SUMS\f[R]. +.IP +.nf +\f[C] +$ mkdir /tmp/check +$ cd /tmp/check +$ rclone copy --http-url https://downloads.rclone.org/v1.63.1 :http:SHA256SUMS . +$ rclone copy --http-url https://downloads.rclone.org/v1.63.1 :http:rclone-v1.63.1-windows-amd64.zip . +\f[R] +.fi +.SS Verify the signatures +.PP +First verify the signatures on the SHA256 file. +.PP +Import the key. +See above for ways to verify this key is correct. +.IP +.nf +\f[C] +$ gpg --keyserver keyserver.ubuntu.com --receive-keys FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA +gpg: key 93935E02FF3B54FA: public key \[dq]Nick Craig-Wood \[dq] imported +gpg: Total number processed: 1 +gpg: imported: 1 +\f[R] +.fi +.PP +Then check the signature: +.IP +.nf +\f[C] +$ gpg --verify SHA256SUMS +gpg: Signature made Mon 17 Jul 2023 15:03:17 BST +gpg: using DSA key FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA +gpg: Good signature from \[dq]Nick Craig-Wood \[dq] [ultimate] +\f[R] +.fi +.PP +Verify the signature was good and is using the fingerprint shown above. +.PP +Repeat for \f[C]MD5SUMS\f[R] and \f[C]SHA1SUMS\f[R] if desired. +.SS Verify the hashes +.PP +Now that we know the signatures on the hashes are OK we can verify the +binaries match the hashes, completing the verification. +.IP +.nf +\f[C] +$ sha256sum -c SHA256SUMS 2>&1 | grep OK +rclone-v1.63.1-windows-amd64.zip: OK +\f[R] +.fi +.PP +Or do the check with rclone +.IP +.nf +\f[C] +$ rclone hashsum sha256 -C SHA256SUMS rclone-v1.63.1-windows-amd64.zip +2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 0 +2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 1 +2023/09/11 10:53:58 NOTICE: SHA256SUMS: improperly formatted checksum line 49 +2023/09/11 10:53:58 NOTICE: SHA256SUMS: 4 warning(s) suppressed... += rclone-v1.63.1-windows-amd64.zip +2023/09/11 10:53:58 NOTICE: Local file system at /tmp/check: 0 differences found +2023/09/11 10:53:58 NOTICE: Local file system at /tmp/check: 1 matching files +\f[R] +.fi +.SS Verify signatures and hashes together +.PP +You can verify the signatures and hashes in one command line like this: +.IP +.nf +\f[C] +$ gpg --decrypt SHA256SUMS | sha256sum -c --ignore-missing +gpg: Signature made Mon 17 Jul 2023 15:03:17 BST +gpg: using DSA key FBF737ECE9F8AB18604BD2AC93935E02FF3B54FA +gpg: Good signature from \[dq]Nick Craig-Wood \[dq] [ultimate] +gpg: aka \[dq]Nick Craig-Wood \[dq] [unknown] +rclone-v1.63.1-windows-amd64.zip: OK +\f[R] +.fi +.SH 1Fichier +.PP +This is a backend for the 1fichier (https://1fichier.com) cloud storage +service. +Note that a Premium subscription is required to use the API. +.PP +Paths are specified as \f[C]remote:path\f[R] +.PP +Paths may be as deep as required, e.g. +\f[C]remote:directory/subdirectory\f[R]. +.SS Configuration +.PP +The initial setup for 1Fichier involves getting the API key from the +website which you need to do in your browser. +.PP +Here is an example of how to make a remote called \f[C]remote\f[R]. +First run: +.IP +.nf +\f[C] + rclone config +\f[R] +.fi +.PP +This will guide you through an interactive setup process: +.IP +.nf +\f[C] +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Enter a string value. Press Enter for the default (\[dq]\[dq]). +Choose a number from below, or type in your own value +[snip] +XX / 1Fichier + \[rs] \[dq]fichier\[dq] +[snip] +Storage> fichier +** See help for fichier backend at: https://rclone.org/fichier/ ** + +Your API Key, get it from https://1fichier.com/console/params.pl +Enter a string value. Press Enter for the default (\[dq]\[dq]). +api_key> example_key + +Edit advanced config? (y/n) +y) Yes +n) No +y/n> +Remote config +-------------------- +[remote] +type = fichier +api_key = example_key +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +\f[R] +.fi +.PP +Once configured you can then use \f[C]rclone\f[R] like this, +.PP +List directories in top level of your 1Fichier account +.IP +.nf +\f[C] +rclone lsd remote: +\f[R] +.fi +.PP +List all the files in your 1Fichier account +.IP +.nf +\f[C] +rclone ls remote: +\f[R] +.fi +.PP +To copy a local directory to a 1Fichier directory called backup +.IP +.nf +\f[C] +rclone copy /home/source remote:backup +\f[R] +.fi +.SS Modification times and hashes +.PP +1Fichier does not support modification times. +It supports the Whirlpool hash algorithm. +.SS Duplicated files +.PP +1Fichier can have two files with exactly the same name and path (unlike +a normal file system). +.PP +Duplicated files cause problems with the syncing and you will see +messages in the log about duplicates. +.SS Restricted filename characters +.PP +In addition to the default restricted characters +set (https://rclone.org/overview/#restricted-characters) the following +characters are also replaced: +.PP +.TS +tab(@); +l c c. +T{ +Character +T}@T{ +Value +T}@T{ +Replacement +T} +_ +T{ +\[rs] +T}@T{ +0x5C +T}@T{ +\[uFF3C] +T} +T{ +< +T}@T{ +0x3C +T}@T{ +\[uFF1C] +T} +T{ +> +T}@T{ +0x3E +T}@T{ +\[uFF1E] +T} +T{ +\[dq] +T}@T{ +0x22 +T}@T{ +\[uFF02] +T} +T{ +$ +T}@T{ +0x24 +T}@T{ +\[uFF04] +T} +T{ +\[ga] +T}@T{ +0x60 +T}@T{ +\[uFF40] +T} +T{ +\[aq] +T}@T{ +0x27 +T}@T{ +\[uFF07] +T} +.TE +.PP +File names can also not start or end with the following characters. +These only get replaced if they are the first or last character in the +name: +.PP +.TS +tab(@); +l c c. +T{ +Character +T}@T{ +Value +T}@T{ +Replacement +T} +_ +T{ +SP +T}@T{ +0x20 +T}@T{ +\[u2420] +T} +.TE +.PP +Invalid UTF-8 bytes will also be +replaced (https://rclone.org/overview/#invalid-utf8), as they can\[aq]t +be used in JSON strings. +.SS Standard options .PP -Endpoint for Tencent COS API. +Here are the Standard options specific to fichier (1Fichier). +.SS --fichier-api-key +.PP +Your API Key, get it from https://1fichier.com/console/params.pl. .PP Properties: .IP \[bu] 2 -Config: endpoint -.IP \[bu] 2 -Env Var: RCLONE_S3_ENDPOINT +Config: api_key .IP \[bu] 2 -Provider: TencentCOS +Env Var: RCLONE_FICHIER_API_KEY .IP \[bu] 2 Type: string .IP \[bu] 2 Required: false +.SS Advanced options +.PP +Here are the Advanced options specific to fichier (1Fichier). +.SS --fichier-shared-folder +.PP +If you want to download a shared folder, add this parameter. +.PP +Properties: .IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]cos.ap-beijing.myqcloud.com\[dq] -.RS 2 -.IP \[bu] 2 -Beijing Region -.RE -.IP \[bu] 2 -\[dq]cos.ap-nanjing.myqcloud.com\[dq] -.RS 2 -.IP \[bu] 2 -Nanjing Region -.RE -.IP \[bu] 2 -\[dq]cos.ap-shanghai.myqcloud.com\[dq] -.RS 2 -.IP \[bu] 2 -Shanghai Region -.RE -.IP \[bu] 2 -\[dq]cos.ap-guangzhou.myqcloud.com\[dq] -.RS 2 -.IP \[bu] 2 -Guangzhou Region -.RE -.IP \[bu] 2 -\[dq]cos.ap-nanjing.myqcloud.com\[dq] -.RS 2 -.IP \[bu] 2 -Nanjing Region -.RE -.IP \[bu] 2 -\[dq]cos.ap-chengdu.myqcloud.com\[dq] -.RS 2 +Config: shared_folder .IP \[bu] 2 -Chengdu Region -.RE +Env Var: RCLONE_FICHIER_SHARED_FOLDER .IP \[bu] 2 -\[dq]cos.ap-chongqing.myqcloud.com\[dq] -.RS 2 +Type: string .IP \[bu] 2 -Chongqing Region -.RE +Required: false +.SS --fichier-file-password +.PP +If you want to download a shared file that is password protected, add +this parameter. +.PP +\f[B]NB\f[R] Input to this must be obscured - see rclone +obscure (https://rclone.org/commands/rclone_obscure/). +.PP +Properties: .IP \[bu] 2 -\[dq]cos.ap-hongkong.myqcloud.com\[dq] -.RS 2 +Config: file_password .IP \[bu] 2 -Hong Kong (China) Region -.RE +Env Var: RCLONE_FICHIER_FILE_PASSWORD .IP \[bu] 2 -\[dq]cos.ap-singapore.myqcloud.com\[dq] -.RS 2 +Type: string .IP \[bu] 2 -Singapore Region -.RE +Required: false +.SS --fichier-folder-password +.PP +If you want to list the files in a shared folder that is password +protected, add this parameter. +.PP +\f[B]NB\f[R] Input to this must be obscured - see rclone +obscure (https://rclone.org/commands/rclone_obscure/). +.PP +Properties: .IP \[bu] 2 -\[dq]cos.ap-mumbai.myqcloud.com\[dq] -.RS 2 +Config: folder_password .IP \[bu] 2 -Mumbai Region -.RE +Env Var: RCLONE_FICHIER_FOLDER_PASSWORD .IP \[bu] 2 -\[dq]cos.ap-seoul.myqcloud.com\[dq] -.RS 2 +Type: string .IP \[bu] 2 -Seoul Region -.RE +Required: false +.SS --fichier-cdn +.PP +Set if you wish to use CDN download links. +.PP +Properties: .IP \[bu] 2 -\[dq]cos.ap-bangkok.myqcloud.com\[dq] -.RS 2 +Config: cdn .IP \[bu] 2 -Bangkok Region -.RE +Env Var: RCLONE_FICHIER_CDN .IP \[bu] 2 -\[dq]cos.ap-tokyo.myqcloud.com\[dq] -.RS 2 +Type: bool .IP \[bu] 2 -Tokyo Region -.RE +Default: false +.SS --fichier-encoding +.PP +The encoding for the backend. +.PP +See the encoding section in the +overview (https://rclone.org/overview/#encoding) for more info. +.PP +Properties: .IP \[bu] 2 -\[dq]cos.na-siliconvalley.myqcloud.com\[dq] -.RS 2 +Config: encoding .IP \[bu] 2 -Silicon Valley Region -.RE +Env Var: RCLONE_FICHIER_ENCODING .IP \[bu] 2 -\[dq]cos.na-ashburn.myqcloud.com\[dq] -.RS 2 +Type: Encoding .IP \[bu] 2 -Virginia Region -.RE +Default: +Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,BackSlash,Del,Ctl,LeftSpace,RightSpace,InvalidUtf8,Dot +.SS Limitations +.PP +\f[C]rclone about\f[R] is not supported by the 1Fichier backend. +Backends without this capability cannot determine free space for an +rclone mount or use policy \f[C]mfs\f[R] (most free space) as a member +of an rclone union remote. +.PP +See List of backends that do not support rclone +about (https://rclone.org/overview/#optional-features) and rclone +about (https://rclone.org/commands/rclone_about/) +.SH Alias +.PP +The \f[C]alias\f[R] remote provides a new name for another remote. +.PP +Paths may be as deep as required or a local path, e.g. +\f[C]remote:directory/subdirectory\f[R] or +\f[C]/directory/subdirectory\f[R]. +.PP +During the initial setup with \f[C]rclone config\f[R] you will specify +the target remote. +The target remote can either be a local path or another remote. +.PP +Subfolders can be used in target remote. +Assume an alias remote named \f[C]backup\f[R] with the target +\f[C]mydrive:private/backup\f[R]. +Invoking \f[C]rclone mkdir backup:desktop\f[R] is exactly the same as +invoking \f[C]rclone mkdir mydrive:private/backup/desktop\f[R]. +.PP +There will be no special handling of paths containing \f[C]..\f[R] +segments. +Invoking \f[C]rclone mkdir backup:../desktop\f[R] is exactly the same as +invoking \f[C]rclone mkdir mydrive:private/backup/../desktop\f[R]. +The empty path is not allowed as a remote. +To alias the current directory use \f[C].\f[R] instead. +.PP +The target remote can also be a connection +string (https://rclone.org/docs/#connection-strings). +This can be used to modify the config of a remote for different uses, +e.g. +the alias \f[C]myDriveTrash\f[R] with the target remote +\f[C]myDrive,trashed_only:\f[R] can be used to only show the trashed +files in \f[C]myDrive\f[R]. +.SS Configuration +.PP +Here is an example of how to make an alias called \f[C]remote\f[R] for +local folder. +First run: +.IP +.nf +\f[C] + rclone config +\f[R] +.fi +.PP +This will guide you through an interactive setup process: +.IP +.nf +\f[C] +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Alias for an existing remote + \[rs] \[dq]alias\[dq] +[snip] +Storage> alias +Remote or path to alias. +Can be \[dq]myremote:path/to/dir\[dq], \[dq]myremote:bucket\[dq], \[dq]myremote:\[dq] or \[dq]/local/path\[dq]. +remote> /mnt/storage/backup +Remote config +-------------------- +[remote] +remote = /mnt/storage/backup +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +Current remotes: + +Name Type +==== ==== +remote alias + +e) Edit existing remote +n) New remote +d) Delete remote +r) Rename remote +c) Copy remote +s) Set configuration password +q) Quit config +e/n/d/r/c/s/q> q +\f[R] +.fi +.PP +Once configured you can then use \f[C]rclone\f[R] like this, +.PP +List directories in top level in \f[C]/mnt/storage/backup\f[R] +.IP +.nf +\f[C] +rclone lsd remote: +\f[R] +.fi +.PP +List all the files in \f[C]/mnt/storage/backup\f[R] +.IP +.nf +\f[C] +rclone ls remote: +\f[R] +.fi +.PP +Copy another local directory to the alias directory called source +.IP +.nf +\f[C] +rclone copy /home/source remote:source +\f[R] +.fi +.SS Standard options +.PP +Here are the Standard options specific to alias (Alias for an existing +remote). +.SS --alias-remote +.PP +Remote or path to alias. +.PP +Can be \[dq]myremote:path/to/dir\[dq], \[dq]myremote:bucket\[dq], +\[dq]myremote:\[dq] or \[dq]/local/path\[dq]. +.PP +Properties: .IP \[bu] 2 -\[dq]cos.na-toronto.myqcloud.com\[dq] -.RS 2 +Config: remote .IP \[bu] 2 -Toronto Region -.RE +Env Var: RCLONE_ALIAS_REMOTE .IP \[bu] 2 -\[dq]cos.eu-frankfurt.myqcloud.com\[dq] -.RS 2 +Type: string .IP \[bu] 2 -Frankfurt Region -.RE +Required: true +.SH Amazon Drive +.PP +Amazon Drive, formerly known as Amazon Cloud Drive, is a cloud storage +service run by Amazon for consumers. +.SS Status +.PP +\f[B]Important:\f[R] rclone supports Amazon Drive only if you have your +own set of API keys. +Unfortunately the Amazon Drive developer +program (https://developer.amazon.com/amazon-drive) is now closed to new +entries so if you don\[aq]t already have your own set of keys you will +not be able to use rclone with Amazon Drive. +.PP +For the history on why rclone no longer has a set of Amazon Drive API +keys see the +forum (https://forum.rclone.org/t/rclone-has-been-banned-from-amazon-drive/2314). +.PP +If you happen to know anyone who works at Amazon then please ask them to +re-instate rclone into the Amazon Drive developer program - thanks! +.SS Configuration +.PP +The initial setup for Amazon Drive involves getting a token from Amazon +which you need to do in your browser. +\f[C]rclone config\f[R] walks you through it. +.PP +The configuration process for Amazon Drive may involve using an oauth +proxy (https://github.com/ncw/oauthproxy). +This is used to keep the Amazon credentials out of the source code. +The proxy runs in Google\[aq]s very secure App Engine environment and +doesn\[aq]t store any credentials which pass through it. +.PP +Since rclone doesn\[aq]t currently have its own Amazon Drive credentials +so you will either need to have your own \f[C]client_id\f[R] and +\f[C]client_secret\f[R] with Amazon Drive, or use a third-party oauth +proxy in which case you will need to enter \f[C]client_id\f[R], +\f[C]client_secret\f[R], \f[C]auth_url\f[R] and \f[C]token_url\f[R]. +.PP +Note also if you are not using Amazon\[aq]s \f[C]auth_url\f[R] and +\f[C]token_url\f[R], (ie you filled in something for those) then if +setting up on a remote machine you can only use the copying the config +method of +configuration (https://rclone.org/remote_setup/#configuring-by-copying-the-config-file) +- \f[C]rclone authorize\f[R] will not work. +.PP +Here is an example of how to make a remote called \f[C]remote\f[R]. +First run: +.IP +.nf +\f[C] + rclone config +\f[R] +.fi +.PP +This will guide you through an interactive setup process: +.IP +.nf +\f[C] +No remotes found, make a new one? +n) New remote +r) Rename remote +c) Copy remote +s) Set configuration password +q) Quit config +n/r/c/s/q> n +name> remote +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Amazon Drive + \[rs] \[dq]amazon cloud drive\[dq] +[snip] +Storage> amazon cloud drive +Amazon Application Client Id - required. +client_id> your client ID goes here +Amazon Application Client Secret - required. +client_secret> your client secret goes here +Auth server URL - leave blank to use Amazon\[aq]s. +auth_url> Optional auth URL +Token server url - leave blank to use Amazon\[aq]s. +token_url> Optional token URL +Remote config +Make sure your Redirect URL is set to \[dq]http://127.0.0.1:53682/\[dq] in your custom config. +Use web browser to automatically authenticate rclone with remote? + * Say Y if the machine running rclone has a web browser you can use + * Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. If Y failed, try N. +y) Yes +n) No +y/n> y +If your browser doesn\[aq]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 = your client ID goes here +client_secret = your client secret goes here +auth_url = Optional auth URL +token_url = Optional token URL +token = {\[dq]access_token\[dq]:\[dq]xxxxxxxxxxxxxxxxxxxxxxx\[dq],\[dq]token_type\[dq]:\[dq]bearer\[dq],\[dq]refresh_token\[dq]:\[dq]xxxxxxxxxxxxxxxxxx\[dq],\[dq]expiry\[dq]:\[dq]2015-09-06T16:07:39.658438471+01:00\[dq]} +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> y +\f[R] +.fi +.PP +See the remote setup docs (https://rclone.org/remote_setup/) for how to +set it up on a machine with no Internet browser available. +.PP +Note that rclone runs a webserver on your local machine to collect the +token as returned from Amazon. +This only runs from the moment it opens your browser to the moment you +get back the verification code. +This is on \f[C]http://127.0.0.1:53682/\f[R] and this it may require you +to unblock it temporarily if you are running a host firewall. +.PP +Once configured you can then use \f[C]rclone\f[R] like this, +.PP +List directories in top level of your Amazon Drive +.IP +.nf +\f[C] +rclone lsd remote: +\f[R] +.fi +.PP +List all the files in your Amazon Drive +.IP +.nf +\f[C] +rclone ls remote: +\f[R] +.fi +.PP +To copy a local directory to an Amazon Drive directory called backup +.IP +.nf +\f[C] +rclone copy /home/source remote:backup +\f[R] +.fi +.SS Modification times and hashes +.PP +Amazon Drive doesn\[aq]t allow modification times to be changed via the +API so these won\[aq]t be accurate or used for syncing. +.PP +It does support the MD5 hash algorithm, so for a more accurate sync, you +can use the \f[C]--checksum\f[R] flag. +.SS Restricted filename characters +.PP +.TS +tab(@); +l c c. +T{ +Character +T}@T{ +Value +T}@T{ +Replacement +T} +_ +T{ +NUL +T}@T{ +0x00 +T}@T{ +\[u2400] +T} +T{ +/ +T}@T{ +0x2F +T}@T{ +\[uFF0F] +T} +.TE +.PP +Invalid UTF-8 bytes will also be +replaced (https://rclone.org/overview/#invalid-utf8), as they can\[aq]t +be used in JSON strings. +.SS Deleting files +.PP +Any files you delete with rclone will end up in the trash. +Amazon don\[aq]t provide an API to permanently delete files, nor to +empty the trash, so you will have to do that with one of Amazon\[aq]s +apps or via the Amazon Drive website. +As of November 17, 2016, files are automatically deleted by Amazon from +the trash after 30 days. +.SS Using with non \f[C].com\f[R] Amazon accounts +.PP +Let\[aq]s say you usually use \f[C]amazon.co.uk\f[R]. +When you authenticate with rclone it will take you to an +\f[C]amazon.com\f[R] page to log in. +Your \f[C]amazon.co.uk\f[R] email and password should work here just +fine. +.SS Standard options +.PP +Here are the Standard options specific to amazon cloud drive (Amazon +Drive). +.SS --acd-client-id +.PP +OAuth Client Id. +.PP +Leave blank normally. +.PP +Properties: .IP \[bu] 2 -\[dq]cos.eu-moscow.myqcloud.com\[dq] -.RS 2 +Config: client_id .IP \[bu] 2 -Moscow Region -.RE +Env Var: RCLONE_ACD_CLIENT_ID .IP \[bu] 2 -\[dq]cos.accelerate.myqcloud.com\[dq] -.RS 2 +Type: string .IP \[bu] 2 -Use Tencent COS Accelerate Endpoint -.RE -.RE -.SS --s3-endpoint +Required: false +.SS --acd-client-secret .PP -Endpoint for RackCorp Object Storage. +OAuth Client Secret. +.PP +Leave blank normally. .PP Properties: .IP \[bu] 2 -Config: endpoint -.IP \[bu] 2 -Env Var: RCLONE_S3_ENDPOINT +Config: client_secret .IP \[bu] 2 -Provider: RackCorp +Env Var: RCLONE_ACD_CLIENT_SECRET .IP \[bu] 2 Type: string .IP \[bu] 2 Required: false +.SS Advanced options +.PP +Here are the Advanced options specific to amazon cloud drive (Amazon +Drive). +.SS --acd-token +.PP +OAuth Access Token as a JSON blob. +.PP +Properties: .IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]s3.rackcorp.com\[dq] -.RS 2 -.IP \[bu] 2 -Global (AnyCast) Endpoint -.RE +Config: token .IP \[bu] 2 -\[dq]au.s3.rackcorp.com\[dq] -.RS 2 +Env Var: RCLONE_ACD_TOKEN .IP \[bu] 2 -Australia (Anycast) Endpoint -.RE +Type: string .IP \[bu] 2 -\[dq]au-nsw.s3.rackcorp.com\[dq] -.RS 2 +Required: false +.SS --acd-auth-url +.PP +Auth server URL. +.PP +Leave blank to use the provider defaults. +.PP +Properties: .IP \[bu] 2 -Sydney (Australia) Endpoint -.RE +Config: auth_url .IP \[bu] 2 -\[dq]au-qld.s3.rackcorp.com\[dq] -.RS 2 +Env Var: RCLONE_ACD_AUTH_URL .IP \[bu] 2 -Brisbane (Australia) Endpoint -.RE +Type: string .IP \[bu] 2 -\[dq]au-vic.s3.rackcorp.com\[dq] -.RS 2 +Required: false +.SS --acd-token-url +.PP +Token server url. +.PP +Leave blank to use the provider defaults. +.PP +Properties: .IP \[bu] 2 -Melbourne (Australia) Endpoint -.RE +Config: token_url .IP \[bu] 2 -\[dq]au-wa.s3.rackcorp.com\[dq] -.RS 2 +Env Var: RCLONE_ACD_TOKEN_URL .IP \[bu] 2 -Perth (Australia) Endpoint -.RE +Type: string .IP \[bu] 2 -\[dq]ph.s3.rackcorp.com\[dq] -.RS 2 +Required: false +.SS --acd-checkpoint +.PP +Checkpoint for internal polling (debug). +.PP +Properties: .IP \[bu] 2 -Manila (Philippines) Endpoint -.RE +Config: checkpoint .IP \[bu] 2 -\[dq]th.s3.rackcorp.com\[dq] -.RS 2 +Env Var: RCLONE_ACD_CHECKPOINT .IP \[bu] 2 -Bangkok (Thailand) Endpoint -.RE +Type: string .IP \[bu] 2 -\[dq]hk.s3.rackcorp.com\[dq] -.RS 2 +Required: false +.SS --acd-upload-wait-per-gb +.PP +Additional time per GiB to wait after a failed complete upload to see if +it appears. +.PP +Sometimes Amazon Drive gives an error when a file has been fully +uploaded but the file appears anyway after a little while. +This happens sometimes for files over 1 GiB in size and nearly every +time for files bigger than 10 GiB. +This parameter controls the time rclone waits for the file to appear. +.PP +The default value for this parameter is 3 minutes per GiB, so by default +it will wait 3 minutes for every GiB uploaded to see if the file +appears. +.PP +You can disable this feature by setting it to 0. +This may cause conflict errors as rclone retries the failed upload but +the file will most likely appear correctly eventually. +.PP +These values were determined empirically by observing lots of uploads of +big files for a range of file sizes. +.PP +Upload with the \[dq]-v\[dq] flag to see more info about what rclone is +doing in this situation. +.PP +Properties: .IP \[bu] 2 -HK (Hong Kong) Endpoint -.RE +Config: upload_wait_per_gb .IP \[bu] 2 -\[dq]mn.s3.rackcorp.com\[dq] -.RS 2 +Env Var: RCLONE_ACD_UPLOAD_WAIT_PER_GB .IP \[bu] 2 -Ulaanbaatar (Mongolia) Endpoint -.RE +Type: Duration .IP \[bu] 2 -\[dq]kg.s3.rackcorp.com\[dq] -.RS 2 +Default: 3m0s +.SS --acd-templink-threshold +.PP +Files >= this size will be downloaded via their tempLink. +.PP +Files this size or more will be downloaded via their \[dq]tempLink\[dq]. +This is to work around a problem with Amazon Drive which blocks +downloads of files bigger than about 10 GiB. +The default for this is 9 GiB which shouldn\[aq]t need to be changed. +.PP +To download files above this threshold, rclone requests a +\[dq]tempLink\[dq] which downloads the file through a temporary URL +directly from the underlying S3 storage. +.PP +Properties: .IP \[bu] 2 -Bishkek (Kyrgyzstan) Endpoint -.RE +Config: templink_threshold .IP \[bu] 2 -\[dq]id.s3.rackcorp.com\[dq] -.RS 2 +Env Var: RCLONE_ACD_TEMPLINK_THRESHOLD .IP \[bu] 2 -Jakarta (Indonesia) Endpoint -.RE +Type: SizeSuffix .IP \[bu] 2 -\[dq]jp.s3.rackcorp.com\[dq] -.RS 2 +Default: 9Gi +.SS --acd-encoding +.PP +The encoding for the backend. +.PP +See the encoding section in the +overview (https://rclone.org/overview/#encoding) for more info. +.PP +Properties: .IP \[bu] 2 -Tokyo (Japan) Endpoint -.RE +Config: encoding .IP \[bu] 2 -\[dq]sg.s3.rackcorp.com\[dq] -.RS 2 +Env Var: RCLONE_ACD_ENCODING .IP \[bu] 2 -SG (Singapore) Endpoint -.RE +Type: Encoding .IP \[bu] 2 -\[dq]de.s3.rackcorp.com\[dq] -.RS 2 +Default: Slash,InvalidUtf8,Dot +.SS Limitations +.PP +Note that Amazon Drive is case insensitive so you can\[aq]t have a file +called \[dq]Hello.doc\[dq] and one called \[dq]hello.doc\[dq]. +.PP +Amazon Drive has rate limiting so you may notice errors in the sync (429 +errors). +rclone will automatically retry the sync up to 3 times by default (see +\f[C]--retries\f[R] flag) which should hopefully work around this +problem. +.PP +Amazon Drive has an internal limit of file sizes that can be uploaded to +the service. +This limit is not officially published, but all files larger than this +will fail. +.PP +At the time of writing (Jan 2016) is in the area of 50 GiB per file. +This means that larger files are likely to fail. +.PP +Unfortunately there is no way for rclone to see that this failure is +because of file size, so it will retry the operation, as any other +failure. +To avoid this problem, use \f[C]--max-size 50000M\f[R] option to limit +the maximum size of uploaded files. +Note that \f[C]--max-size\f[R] does not split files into segments, it +only ignores files over this size. +.PP +\f[C]rclone about\f[R] is not supported by the Amazon Drive backend. +Backends without this capability cannot determine free space for an +rclone mount or use policy \f[C]mfs\f[R] (most free space) as a member +of an rclone union remote. +.PP +See List of backends that do not support rclone +about (https://rclone.org/overview/#optional-features) and rclone +about (https://rclone.org/commands/rclone_about/) +.SH Amazon S3 Storage Providers +.PP +The S3 backend can be used with a number of different providers: .IP \[bu] 2 -Frankfurt (Germany) Endpoint -.RE +AWS S3 .IP \[bu] 2 -\[dq]us.s3.rackcorp.com\[dq] -.RS 2 +Alibaba Cloud (Aliyun) Object Storage System (OSS) .IP \[bu] 2 -USA (AnyCast) Endpoint -.RE +Ceph .IP \[bu] 2 -\[dq]us-east-1.s3.rackcorp.com\[dq] -.RS 2 +China Mobile Ecloud Elastic Object Storage (EOS) .IP \[bu] 2 -New York (USA) Endpoint -.RE +Cloudflare R2 .IP \[bu] 2 -\[dq]us-west-1.s3.rackcorp.com\[dq] -.RS 2 +Arvan Cloud Object Storage (AOS) .IP \[bu] 2 -Freemont (USA) Endpoint -.RE +DigitalOcean Spaces .IP \[bu] 2 -\[dq]nz.s3.rackcorp.com\[dq] -.RS 2 +Dreamhost .IP \[bu] 2 -Auckland (New Zealand) Endpoint -.RE -.RE -.SS --s3-endpoint -.PP -Endpoint for Qiniu Object Storage. -.PP -Properties: +GCS .IP \[bu] 2 -Config: endpoint +Huawei OBS .IP \[bu] 2 -Env Var: RCLONE_S3_ENDPOINT +IBM COS S3 .IP \[bu] 2 -Provider: Qiniu +IDrive e2 .IP \[bu] 2 -Type: string +IONOS Cloud .IP \[bu] 2 -Required: false +Leviia Object Storage .IP \[bu] 2 -Examples: -.RS 2 +Liara Object Storage .IP \[bu] 2 -\[dq]s3-cn-east-1.qiniucs.com\[dq] -.RS 2 +Linode Object Storage .IP \[bu] 2 -East China Endpoint 1 -.RE +Minio .IP \[bu] 2 -\[dq]s3-cn-east-2.qiniucs.com\[dq] -.RS 2 +Petabox .IP \[bu] 2 -East China Endpoint 2 -.RE +Qiniu Cloud Object Storage (Kodo) .IP \[bu] 2 -\[dq]s3-cn-north-1.qiniucs.com\[dq] -.RS 2 +RackCorp Object Storage .IP \[bu] 2 -North China Endpoint 1 -.RE +Rclone Serve S3 .IP \[bu] 2 -\[dq]s3-cn-south-1.qiniucs.com\[dq] -.RS 2 +Scaleway .IP \[bu] 2 -South China Endpoint 1 -.RE +Seagate Lyve Cloud .IP \[bu] 2 -\[dq]s3-us-north-1.qiniucs.com\[dq] -.RS 2 +SeaweedFS .IP \[bu] 2 -North America Endpoint 1 -.RE +StackPath .IP \[bu] 2 -\[dq]s3-ap-southeast-1.qiniucs.com\[dq] -.RS 2 +Storj .IP \[bu] 2 -Southeast Asia Endpoint 1 -.RE +Synology C2 Object Storage .IP \[bu] 2 -\[dq]s3-ap-northeast-1.qiniucs.com\[dq] -.RS 2 +Tencent Cloud Object Storage (COS) .IP \[bu] 2 -Northeast Asia Endpoint 1 -.RE -.RE -.SS --s3-endpoint +Wasabi +.PP +Paths are specified as \f[C]remote:bucket\f[R] (or \f[C]remote:\f[R] for +the \f[C]lsd\f[R] command.) You may put subdirectories in too, e.g. +\f[C]remote:bucket/path/to/dir\f[R]. +.PP +Once you have made a remote (see the provider specific section above) +you can use it like this: +.PP +See all buckets +.IP +.nf +\f[C] +rclone lsd remote: +\f[R] +.fi +.PP +Make a new bucket +.IP +.nf +\f[C] +rclone mkdir remote:bucket +\f[R] +.fi +.PP +List the contents of a bucket +.IP +.nf +\f[C] +rclone ls remote:bucket +\f[R] +.fi +.PP +Sync \f[C]/home/local/directory\f[R] to the remote bucket, deleting any +excess files in the bucket. +.IP +.nf +\f[C] +rclone sync --interactive /home/local/directory remote:bucket +\f[R] +.fi +.SS Configuration +.PP +Here is an example of making an s3 configuration for the AWS S3 +provider. +Most applies to the other providers as well, any differences are +described below. .PP +First run +.IP +.nf +\f[C] +rclone config +\f[R] +.fi +.PP +This will guide you through an interactive setup process. +.IP +.nf +\f[C] +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n +name> remote +Type of storage to configure. +Choose a number from below, or type in your own value +[snip] +XX / Amazon S3 Compliant Storage Providers including AWS, Ceph, ChinaMobile, ArvanCloud, Dreamhost, IBM COS, Liara, Minio, and Tencent COS + \[rs] \[dq]s3\[dq] +[snip] +Storage> s3 +Choose your S3 provider. +Choose a number from below, or type in your own value + 1 / Amazon Web Services (AWS) S3 + \[rs] \[dq]AWS\[dq] + 2 / Ceph Object Storage + \[rs] \[dq]Ceph\[dq] + 3 / DigitalOcean Spaces + \[rs] \[dq]DigitalOcean\[dq] + 4 / Dreamhost DreamObjects + \[rs] \[dq]Dreamhost\[dq] + 5 / IBM COS S3 + \[rs] \[dq]IBMCOS\[dq] + 6 / Minio Object Storage + \[rs] \[dq]Minio\[dq] + 7 / Wasabi Object Storage + \[rs] \[dq]Wasabi\[dq] + 8 / Any other S3 compatible provider + \[rs] \[dq]Other\[dq] +provider> 1 +Get AWS credentials from runtime (environment variables or EC2/ECS 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 + \[rs] \[dq]false\[dq] + 2 / Get AWS credentials from the environment (env vars or IAM) + \[rs] \[dq]true\[dq] +env_auth> 1 +AWS Access Key ID - leave blank for anonymous access or runtime credentials. +access_key_id> XXX +AWS Secret Access Key (password) - leave blank for anonymous access or runtime credentials. +secret_access_key> YYY +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. + \[rs] \[dq]us-east-1\[dq] + / US East (Ohio) Region + 2 | Needs location constraint us-east-2. + \[rs] \[dq]us-east-2\[dq] + / US West (Oregon) Region + 3 | Needs location constraint us-west-2. + \[rs] \[dq]us-west-2\[dq] + / US West (Northern California) Region + 4 | Needs location constraint us-west-1. + \[rs] \[dq]us-west-1\[dq] + / Canada (Central) Region + 5 | Needs location constraint ca-central-1. + \[rs] \[dq]ca-central-1\[dq] + / EU (Ireland) Region + 6 | Needs location constraint EU or eu-west-1. + \[rs] \[dq]eu-west-1\[dq] + / EU (London) Region + 7 | Needs location constraint eu-west-2. + \[rs] \[dq]eu-west-2\[dq] + / EU (Frankfurt) Region + 8 | Needs location constraint eu-central-1. + \[rs] \[dq]eu-central-1\[dq] + / Asia Pacific (Singapore) Region + 9 | Needs location constraint ap-southeast-1. + \[rs] \[dq]ap-southeast-1\[dq] + / Asia Pacific (Sydney) Region +10 | Needs location constraint ap-southeast-2. + \[rs] \[dq]ap-southeast-2\[dq] + / Asia Pacific (Tokyo) Region +11 | Needs location constraint ap-northeast-1. + \[rs] \[dq]ap-northeast-1\[dq] + / Asia Pacific (Seoul) +12 | Needs location constraint ap-northeast-2. + \[rs] \[dq]ap-northeast-2\[dq] + / Asia Pacific (Mumbai) +13 | Needs location constraint ap-south-1. + \[rs] \[dq]ap-south-1\[dq] + / Asia Pacific (Hong Kong) Region +14 | Needs location constraint ap-east-1. + \[rs] \[dq]ap-east-1\[dq] + / South America (Sao Paulo) Region +15 | Needs location constraint sa-east-1. + \[rs] \[dq]sa-east-1\[dq] +region> 1 Endpoint for S3 API. +Leave blank if using AWS to use the default endpoint for the region. +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. + \[rs] \[dq]\[dq] + 2 / US East (Ohio) Region. + \[rs] \[dq]us-east-2\[dq] + 3 / US West (Oregon) Region. + \[rs] \[dq]us-west-2\[dq] + 4 / US West (Northern California) Region. + \[rs] \[dq]us-west-1\[dq] + 5 / Canada (Central) Region. + \[rs] \[dq]ca-central-1\[dq] + 6 / EU (Ireland) Region. + \[rs] \[dq]eu-west-1\[dq] + 7 / EU (London) Region. + \[rs] \[dq]eu-west-2\[dq] + 8 / EU Region. + \[rs] \[dq]EU\[dq] + 9 / Asia Pacific (Singapore) Region. + \[rs] \[dq]ap-southeast-1\[dq] +10 / Asia Pacific (Sydney) Region. + \[rs] \[dq]ap-southeast-2\[dq] +11 / Asia Pacific (Tokyo) Region. + \[rs] \[dq]ap-northeast-1\[dq] +12 / Asia Pacific (Seoul) + \[rs] \[dq]ap-northeast-2\[dq] +13 / Asia Pacific (Mumbai) + \[rs] \[dq]ap-south-1\[dq] +14 / Asia Pacific (Hong Kong) + \[rs] \[dq]ap-east-1\[dq] +15 / South America (Sao Paulo) Region. + \[rs] \[dq]sa-east-1\[dq] +location_constraint> 1 +Canned ACL used when creating buckets and/or storing objects in S3. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Choose a number from below, or type in your own value + 1 / Owner gets FULL_CONTROL. No one else has access rights (default). + \[rs] \[dq]private\[dq] + 2 / Owner gets FULL_CONTROL. The AllUsers group gets READ access. + \[rs] \[dq]public-read\[dq] + / Owner gets FULL_CONTROL. The AllUsers group gets READ and WRITE access. + 3 | Granting this on a bucket is generally not recommended. + \[rs] \[dq]public-read-write\[dq] + 4 / Owner gets FULL_CONTROL. The AuthenticatedUsers group gets READ access. + \[rs] \[dq]authenticated-read\[dq] + / Object owner gets FULL_CONTROL. Bucket owner gets READ access. + 5 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \[rs] \[dq]bucket-owner-read\[dq] + / Both the object owner and the bucket owner get FULL_CONTROL over the object. + 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it. + \[rs] \[dq]bucket-owner-full-control\[dq] +acl> 1 +The server-side encryption algorithm used when storing this object in S3. +Choose a number from below, or type in your own value + 1 / None + \[rs] \[dq]\[dq] + 2 / AES256 + \[rs] \[dq]AES256\[dq] +server_side_encryption> 1 +The storage class to use when storing objects in S3. +Choose a number from below, or type in your own value + 1 / Default + \[rs] \[dq]\[dq] + 2 / Standard storage class + \[rs] \[dq]STANDARD\[dq] + 3 / Reduced redundancy storage class + \[rs] \[dq]REDUCED_REDUNDANCY\[dq] + 4 / Standard Infrequent Access storage class + \[rs] \[dq]STANDARD_IA\[dq] + 5 / One Zone Infrequent Access storage class + \[rs] \[dq]ONEZONE_IA\[dq] + 6 / Glacier storage class + \[rs] \[dq]GLACIER\[dq] + 7 / Glacier Deep Archive storage class + \[rs] \[dq]DEEP_ARCHIVE\[dq] + 8 / Intelligent-Tiering storage class + \[rs] \[dq]INTELLIGENT_TIERING\[dq] + 9 / Glacier Instant Retrieval storage class + \[rs] \[dq]GLACIER_IR\[dq] +storage_class> 1 +Remote config +-------------------- +[remote] +type = s3 +provider = AWS +env_auth = false +access_key_id = XXX +secret_access_key = YYY +region = us-east-1 +endpoint = +location_constraint = +acl = private +server_side_encryption = +storage_class = +-------------------- +y) Yes this is OK +e) Edit this remote +d) Delete this remote +y/e/d> +\f[R] +.fi +.SS Modification times and hashes +.SS Modification times +.PP +The modified time is stored as metadata on the object as +\f[C]X-Amz-Meta-Mtime\f[R] as floating point since the epoch, accurate +to 1 ns. +.PP +If the modification time needs to be updated rclone will attempt to +perform a server side copy to update the modification if the object can +be copied in a single part. +In the case the object is larger than 5Gb or is in Glacier or Glacier +Deep Archive storage the object will be uploaded rather than copied. +.PP +Note that reading this from the object takes an additional +\f[C]HEAD\f[R] request as the metadata isn\[aq]t returned in object +listings. +.SS Hashes +.PP +For small objects which weren\[aq]t uploaded as multipart uploads +(objects sized below \f[C]--s3-upload-cutoff\f[R] if uploaded with +rclone) rclone uses the \f[C]ETag:\f[R] header as an MD5 checksum. +.PP +However for objects which were uploaded as multipart uploads or with +server side encryption (SSE-AWS or SSE-C) the \f[C]ETag\f[R] header is +no longer the MD5 sum of the data, so rclone adds an additional piece of +metadata \f[C]X-Amz-Meta-Md5chksum\f[R] which is a base64 encoded MD5 +hash (in the same format as is required for \f[C]Content-MD5\f[R]). +You can use base64 -d and hexdump to check this value manually: +.IP +.nf +\f[C] +echo \[aq]VWTGdNx3LyXQDfA0e2Edxw==\[aq] | base64 -d | hexdump +\f[R] +.fi +.PP +or you can use \f[C]rclone check\f[R] to verify the hashes are OK. +.PP +For large objects, calculating this hash can take some time so the +addition of this hash can be disabled with +\f[C]--s3-disable-checksum\f[R]. +This will mean that these objects do not have an MD5 checksum. +.PP +Note that reading this from the object takes an additional +\f[C]HEAD\f[R] request as the metadata isn\[aq]t returned in object +listings. +.SS Reducing costs +.SS Avoiding HEAD requests to read the modification time +.PP +By default, rclone will use the modification time of objects stored in +S3 for syncing. +This is stored in object metadata which unfortunately takes an extra +HEAD request to read which can be expensive (in time and money). .PP -Required when using an S3 clone. +The modification time is used by default for all operations that require +checking the time a file was last updated. +It allows rclone to treat the remote more like a true filesystem, but it +is inefficient on S3 because it requires an extra API call to retrieve +the metadata. .PP -Properties: -.IP \[bu] 2 -Config: endpoint -.IP \[bu] 2 -Env Var: RCLONE_S3_ENDPOINT -.IP \[bu] 2 -Provider: -!AWS,ArvanCloud,IBMCOS,IDrive,IONOS,TencentCOS,HuaweiOBS,Alibaba,ChinaMobile,GCS,Liara,Scaleway,StackPath,Storj,Synology,RackCorp,Qiniu,Petabox -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]objects-us-east-1.dream.io\[dq] -.RS 2 -.IP \[bu] 2 -Dream Objects endpoint -.RE -.IP \[bu] 2 -\[dq]syd1.digitaloceanspaces.com\[dq] -.RS 2 -.IP \[bu] 2 -DigitalOcean Spaces Sydney 1 -.RE -.IP \[bu] 2 -\[dq]sfo3.digitaloceanspaces.com\[dq] -.RS 2 -.IP \[bu] 2 -DigitalOcean Spaces San Francisco 3 -.RE -.IP \[bu] 2 -\[dq]fra1.digitaloceanspaces.com\[dq] -.RS 2 -.IP \[bu] 2 -DigitalOcean Spaces Frankfurt 1 -.RE -.IP \[bu] 2 -\[dq]nyc3.digitaloceanspaces.com\[dq] -.RS 2 -.IP \[bu] 2 -DigitalOcean Spaces New York 3 -.RE -.IP \[bu] 2 -\[dq]ams3.digitaloceanspaces.com\[dq] -.RS 2 -.IP \[bu] 2 -DigitalOcean Spaces Amsterdam 3 -.RE -.IP \[bu] 2 -\[dq]sgp1.digitaloceanspaces.com\[dq] -.RS 2 -.IP \[bu] 2 -DigitalOcean Spaces Singapore 1 -.RE -.IP \[bu] 2 -\[dq]localhost:8333\[dq] -.RS 2 -.IP \[bu] 2 -SeaweedFS S3 localhost -.RE -.IP \[bu] 2 -\[dq]s3.us-east-1.lyvecloud.seagate.com\[dq] -.RS 2 -.IP \[bu] 2 -Seagate Lyve Cloud US East 1 (Virginia) -.RE -.IP \[bu] 2 -\[dq]s3.us-west-1.lyvecloud.seagate.com\[dq] -.RS 2 -.IP \[bu] 2 -Seagate Lyve Cloud US West 1 (California) -.RE -.IP \[bu] 2 -\[dq]s3.ap-southeast-1.lyvecloud.seagate.com\[dq] -.RS 2 -.IP \[bu] 2 -Seagate Lyve Cloud AP Southeast 1 (Singapore) -.RE -.IP \[bu] 2 -\[dq]s3.wasabisys.com\[dq] -.RS 2 -.IP \[bu] 2 -Wasabi US East 1 (N. -Virginia) -.RE -.IP \[bu] 2 -\[dq]s3.us-east-2.wasabisys.com\[dq] -.RS 2 -.IP \[bu] 2 -Wasabi US East 2 (N. -Virginia) -.RE -.IP \[bu] 2 -\[dq]s3.us-central-1.wasabisys.com\[dq] -.RS 2 -.IP \[bu] 2 -Wasabi US Central 1 (Texas) -.RE -.IP \[bu] 2 -\[dq]s3.us-west-1.wasabisys.com\[dq] -.RS 2 -.IP \[bu] 2 -Wasabi US West 1 (Oregon) -.RE -.IP \[bu] 2 -\[dq]s3.ca-central-1.wasabisys.com\[dq] -.RS 2 -.IP \[bu] 2 -Wasabi CA Central 1 (Toronto) -.RE +The extra API calls can be avoided when syncing (using +\f[C]rclone sync\f[R] or \f[C]rclone copy\f[R]) in a few different ways, +each with its own tradeoffs. .IP \[bu] 2 -\[dq]s3.eu-central-1.wasabisys.com\[dq] +\f[C]--size-only\f[R] .RS 2 .IP \[bu] 2 -Wasabi EU Central 1 (Amsterdam) -.RE -.IP \[bu] 2 -\[dq]s3.eu-central-2.wasabisys.com\[dq] -.RS 2 +Only checks the size of files. .IP \[bu] 2 -Wasabi EU Central 2 (Frankfurt) -.RE +Uses no extra transactions. .IP \[bu] 2 -\[dq]s3.eu-west-1.wasabisys.com\[dq] -.RS 2 +If the file doesn\[aq]t change size then rclone won\[aq]t detect it has +changed. .IP \[bu] 2 -Wasabi EU West 1 (London) +\f[C]rclone sync --size-only /path/to/source s3:bucket\f[R] .RE .IP \[bu] 2 -\[dq]s3.eu-west-2.wasabisys.com\[dq] +\f[C]--checksum\f[R] .RS 2 .IP \[bu] 2 -Wasabi EU West 2 (Paris) -.RE -.IP \[bu] 2 -\[dq]s3.ap-northeast-1.wasabisys.com\[dq] -.RS 2 +Checks the size and MD5 checksum of files. .IP \[bu] 2 -Wasabi AP Northeast 1 (Tokyo) endpoint -.RE +Uses no extra transactions. .IP \[bu] 2 -\[dq]s3.ap-northeast-2.wasabisys.com\[dq] -.RS 2 +The most accurate detection of changes possible. .IP \[bu] 2 -Wasabi AP Northeast 2 (Osaka) endpoint -.RE +Will cause the source to read an MD5 checksum which, if it is a local +disk, will cause lots of disk activity. .IP \[bu] 2 -\[dq]s3.ap-southeast-1.wasabisys.com\[dq] -.RS 2 +If the source and destination are both S3 this is the +\f[B]recommended\f[R] flag to use for maximum efficiency. .IP \[bu] 2 -Wasabi AP Southeast 1 (Singapore) +\f[C]rclone sync --checksum /path/to/source s3:bucket\f[R] .RE .IP \[bu] 2 -\[dq]s3.ap-southeast-2.wasabisys.com\[dq] +\f[C]--update --use-server-modtime\f[R] .RS 2 .IP \[bu] 2 -Wasabi AP Southeast 2 (Sydney) -.RE -.IP \[bu] 2 -\[dq]storage.iran.liara.space\[dq] -.RS 2 +Uses no extra transactions. .IP \[bu] 2 -Liara Iran endpoint -.RE +Modification time becomes the time the object was uploaded. .IP \[bu] 2 -\[dq]s3.ir-thr-at1.arvanstorage.ir\[dq] -.RS 2 +For many operations this is sufficient to determine if it needs +uploading. .IP \[bu] 2 -ArvanCloud Tehran Iran (Simin) endpoint -.RE +Using \f[C]--update\f[R] along with \f[C]--use-server-modtime\f[R], +avoids the extra API call and uploads files whose local modification +time is newer than the time it was last uploaded. .IP \[bu] 2 -\[dq]s3.ir-tbz-sh1.arvanstorage.ir\[dq] -.RS 2 +Files created with timestamps in the past will be missed by the sync. .IP \[bu] 2 -ArvanCloud Tabriz Iran (Shahriar) endpoint -.RE +\f[C]rclone sync --update --use-server-modtime /path/to/source s3:bucket\f[R] .RE -.SS --s3-location-constraint .PP -Location constraint - must be set to match the Region. +These flags can and should be used in combination with +\f[C]--fast-list\f[R] - see below. .PP -Used when creating buckets only. +If using \f[C]rclone mount\f[R] or any command using the VFS (eg +\f[C]rclone serve\f[R]) commands then you might want to consider using +the VFS flag \f[C]--no-modtime\f[R] which will stop rclone reading the +modification time for every object. +You could also use \f[C]--use-server-modtime\f[R] if you are happy with +the modification times of the objects being the time of upload. +.SS Avoiding GET requests to read directory listings .PP -Properties: -.IP \[bu] 2 -Config: location_constraint -.IP \[bu] 2 -Env Var: RCLONE_S3_LOCATION_CONSTRAINT -.IP \[bu] 2 -Provider: AWS -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]\[dq] -.RS 2 -.IP \[bu] 2 -Empty for US Region, Northern Virginia, or Pacific Northwest -.RE -.IP \[bu] 2 -\[dq]us-east-2\[dq] -.RS 2 -.IP \[bu] 2 -US East (Ohio) Region -.RE -.IP \[bu] 2 -\[dq]us-west-1\[dq] -.RS 2 -.IP \[bu] 2 -US West (Northern California) Region -.RE -.IP \[bu] 2 -\[dq]us-west-2\[dq] -.RS 2 -.IP \[bu] 2 -US West (Oregon) Region -.RE -.IP \[bu] 2 -\[dq]ca-central-1\[dq] -.RS 2 -.IP \[bu] 2 -Canada (Central) Region -.RE -.IP \[bu] 2 -\[dq]eu-west-1\[dq] -.RS 2 -.IP \[bu] 2 -EU (Ireland) Region -.RE -.IP \[bu] 2 -\[dq]eu-west-2\[dq] -.RS 2 -.IP \[bu] 2 -EU (London) Region -.RE -.IP \[bu] 2 -\[dq]eu-west-3\[dq] -.RS 2 -.IP \[bu] 2 -EU (Paris) Region -.RE -.IP \[bu] 2 -\[dq]eu-north-1\[dq] -.RS 2 -.IP \[bu] 2 -EU (Stockholm) Region -.RE -.IP \[bu] 2 -\[dq]eu-south-1\[dq] -.RS 2 -.IP \[bu] 2 -EU (Milan) Region -.RE -.IP \[bu] 2 -\[dq]EU\[dq] -.RS 2 -.IP \[bu] 2 -EU Region -.RE -.IP \[bu] 2 -\[dq]ap-southeast-1\[dq] -.RS 2 -.IP \[bu] 2 -Asia Pacific (Singapore) Region -.RE -.IP \[bu] 2 -\[dq]ap-southeast-2\[dq] -.RS 2 -.IP \[bu] 2 -Asia Pacific (Sydney) Region -.RE -.IP \[bu] 2 -\[dq]ap-northeast-1\[dq] -.RS 2 -.IP \[bu] 2 -Asia Pacific (Tokyo) Region -.RE -.IP \[bu] 2 -\[dq]ap-northeast-2\[dq] -.RS 2 -.IP \[bu] 2 -Asia Pacific (Seoul) Region -.RE -.IP \[bu] 2 -\[dq]ap-northeast-3\[dq] -.RS 2 -.IP \[bu] 2 -Asia Pacific (Osaka-Local) Region -.RE +Rclone\[aq]s default directory traversal is to process each directory +individually. +This takes one API call per directory. +Using the \f[C]--fast-list\f[R] flag will read all info about the +objects into memory first using a smaller number of API calls (one per +1000 objects). +See the rclone docs (https://rclone.org/docs/#fast-list) for more +details. +.IP +.nf +\f[C] +rclone sync --fast-list --checksum /path/to/source s3:bucket +\f[R] +.fi +.PP +\f[C]--fast-list\f[R] trades off API transactions for memory use. +As a rough guide rclone uses 1k of memory per object stored, so using +\f[C]--fast-list\f[R] on a sync of a million objects will use roughly 1 +GiB of RAM. +.PP +If you are only copying a small number of files into a big repository +then using \f[C]--no-traverse\f[R] is a good idea. +This finds objects directly instead of through directory listings. +You can do a \[dq]top-up\[dq] sync very cheaply by using +\f[C]--max-age\f[R] and \f[C]--no-traverse\f[R] to copy only recent +files, eg +.IP +.nf +\f[C] +rclone copy --max-age 24h --no-traverse /path/to/source s3:bucket +\f[R] +.fi +.PP +You\[aq]d then do a full \f[C]rclone sync\f[R] less often. +.PP +Note that \f[C]--fast-list\f[R] isn\[aq]t required in the top-up sync. +.SS Avoiding HEAD requests after PUT +.PP +By default, rclone will HEAD every object it uploads. +It does this to check the object got uploaded correctly. +.PP +You can disable this with the --s3-no-head option - see there for more +details. +.PP +Setting this flag increases the chance for undetected upload failures. +.SS Versions +.PP +When bucket versioning is enabled (this can be done with rclone with the +\f[C]rclone backend versioning\f[R] command) when rclone uploads a new +version of a file it creates a new version of +it (https://docs.aws.amazon.com/AmazonS3/latest/userguide/Versioning.html) +Likewise when you delete a file, the old version will be marked hidden +and still be available. +.PP +Old versions of files, where available, are visible using the +\f[C]--s3-versions\f[R] flag. +.PP +It is also possible to view a bucket as it was at a certain point in +time, using the \f[C]--s3-version-at\f[R] flag. +This will show the file versions as they were at that time, showing +files that have been deleted afterwards, and hiding files that were +created since. +.PP +If you wish to remove all the old versions then you can use the +\f[C]rclone backend cleanup-hidden remote:bucket\f[R] command which will +delete all the old hidden versions of files, leaving the current ones +intact. +You can also supply a path and only old versions under that path will be +deleted, e.g. +\f[C]rclone backend cleanup-hidden remote:bucket/path/to/stuff\f[R]. +.PP +When you \f[C]purge\f[R] a bucket, the current and the old versions will +be deleted then the bucket will be deleted. +.PP +However \f[C]delete\f[R] will cause the current versions of the files to +become hidden old versions. +.PP +Here is a session showing the listing and retrieval of an old version +followed by a \f[C]cleanup\f[R] of the old versions. +.PP +Show current version and all the versions with \f[C]--s3-versions\f[R] +flag. +.IP +.nf +\f[C] +$ rclone -q ls s3:cleanup-test + 9 one.txt + +$ rclone -q --s3-versions ls s3:cleanup-test + 9 one.txt + 8 one-v2016-07-04-141032-000.txt + 16 one-v2016-07-04-141003-000.txt + 15 one-v2016-07-02-155621-000.txt +\f[R] +.fi +.PP +Retrieve an old version +.IP +.nf +\f[C] +$ rclone -q --s3-versions copy s3:cleanup-test/one-v2016-07-04-141003-000.txt /tmp + +$ ls -l /tmp/one-v2016-07-04-141003-000.txt +-rw-rw-r-- 1 ncw ncw 16 Jul 2 17:46 /tmp/one-v2016-07-04-141003-000.txt +\f[R] +.fi +.PP +Clean up all the old versions and show that they\[aq]ve gone. +.IP +.nf +\f[C] +$ rclone -q backend cleanup-hidden s3:cleanup-test + +$ rclone -q ls s3:cleanup-test + 9 one.txt + +$ rclone -q --s3-versions ls s3:cleanup-test + 9 one.txt +\f[R] +.fi +.SS Versions naming caveat +.PP +When using \f[C]--s3-versions\f[R] flag rclone is relying on the file +name to work out whether the objects are versions or not. +Versions\[aq] names are created by inserting timestamp between file name +and its extension. +.IP +.nf +\f[C] + 9 file.txt + 8 file-v2023-07-17-161032-000.txt + 16 file-v2023-06-15-141003-000.txt +\f[R] +.fi +.PP +If there are real files present with the same names as versions, then +behaviour of \f[C]--s3-versions\f[R] can be unpredictable. +.SS Cleanup +.PP +If you run \f[C]rclone cleanup s3:bucket\f[R] then it will remove all +pending multipart uploads older than 24 hours. +You can use the \f[C]--interactive\f[R]/\f[C]i\f[R] or +\f[C]--dry-run\f[R] flag to see exactly what it will do. +If you want more control over the expiry date then run +\f[C]rclone backend cleanup s3:bucket -o max-age=1h\f[R] to expire all +uploads older than one hour. +You can use \f[C]rclone backend list-multipart-uploads s3:bucket\f[R] to +see the pending multipart uploads. +.SS Restricted filename characters +.PP +S3 allows any valid UTF-8 string as a key. +.PP +Invalid UTF-8 bytes will be +replaced (https://rclone.org/overview/#invalid-utf8), as they can\[aq]t +be used in XML. +.PP +The following characters are replaced since these are problematic when +dealing with the REST API: +.PP +.TS +tab(@); +l c c. +T{ +Character +T}@T{ +Value +T}@T{ +Replacement +T} +_ +T{ +NUL +T}@T{ +0x00 +T}@T{ +\[u2400] +T} +T{ +/ +T}@T{ +0x2F +T}@T{ +\[uFF0F] +T} +.TE +.PP +The encoding will also encode these file names as they don\[aq]t seem to +work with the SDK properly: +.PP +.TS +tab(@); +l c. +T{ +File name +T}@T{ +Replacement +T} +_ +T{ +\&. +T}@T{ +\[uFF0E] +T} +T{ +\&.. +T}@T{ +\[uFF0E]\[uFF0E] +T} +.TE +.SS Multipart uploads +.PP +rclone supports multipart uploads with S3 which means that it can upload +files bigger than 5 GiB. +.PP +Note that files uploaded \f[I]both\f[R] with multipart upload +\f[I]and\f[R] through crypt remotes do not have MD5 sums. +.PP +rclone switches from single part uploads to multipart uploads at the +point specified by \f[C]--s3-upload-cutoff\f[R]. +This can be a maximum of 5 GiB and a minimum of 0 (ie always upload +multipart files). +.PP +The chunk sizes used in the multipart upload are specified by +\f[C]--s3-chunk-size\f[R] and the number of chunks uploaded concurrently +is specified by \f[C]--s3-upload-concurrency\f[R]. +.PP +Multipart uploads will use \f[C]--transfers\f[R] * +\f[C]--s3-upload-concurrency\f[R] * \f[C]--s3-chunk-size\f[R] extra +memory. +Single part uploads to not use extra memory. +.PP +Single part transfers can be faster than multipart transfers or slower +depending on your latency from S3 - the more latency, the more likely +single part transfers will be faster. +.PP +Increasing \f[C]--s3-upload-concurrency\f[R] will increase throughput (8 +would be a sensible value) and increasing \f[C]--s3-chunk-size\f[R] also +increases throughput (16M would be sensible). +Increasing either of these will use more memory. +The default values are high enough to gain most of the possible +performance without using too much memory. +.SS Buckets and Regions +.PP +With Amazon S3 you can list buckets (\f[C]rclone lsd\f[R]) using any +region, but you can only access the content of a bucket from the region +it was created in. +If you attempt to access a bucket from the wrong region, you will get an +error, +\f[C]incorrect region, the bucket is not in \[aq]XXX\[aq] region\f[R]. +.SS Authentication +.PP +There are a number of ways to supply \f[C]rclone\f[R] with a set of AWS +credentials, with and without using the environment. +.PP +The different authentication methods are tried in this order: .IP \[bu] 2 -\[dq]ap-south-1\[dq] +Directly in the rclone configuration file (\f[C]env_auth = false\f[R] in +the config file): .RS 2 .IP \[bu] 2 -Asia Pacific (Mumbai) Region +\f[C]access_key_id\f[R] and \f[C]secret_access_key\f[R] are required. +.IP \[bu] 2 +\f[C]session_token\f[R] can be optionally set when using AWS STS. .RE .IP \[bu] 2 -\[dq]ap-east-1\[dq] +Runtime configuration (\f[C]env_auth = true\f[R] in the config file): .RS 2 .IP \[bu] 2 -Asia Pacific (Hong Kong) Region -.RE -.IP \[bu] 2 -\[dq]sa-east-1\[dq] +Export the following environment variables before running +\f[C]rclone\f[R]: .RS 2 .IP \[bu] 2 -South America (Sao Paulo) Region -.RE +Access Key ID: \f[C]AWS_ACCESS_KEY_ID\f[R] or \f[C]AWS_ACCESS_KEY\f[R] .IP \[bu] 2 -\[dq]me-south-1\[dq] -.RS 2 +Secret Access Key: \f[C]AWS_SECRET_ACCESS_KEY\f[R] or +\f[C]AWS_SECRET_KEY\f[R] .IP \[bu] 2 -Middle East (Bahrain) Region +Session Token: \f[C]AWS_SESSION_TOKEN\f[R] (optional) .RE .IP \[bu] 2 -\[dq]af-south-1\[dq] +Or, use a named +profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html): .RS 2 .IP \[bu] 2 -Africa (Cape Town) Region -.RE +Profile files are standard files used by AWS CLI tools .IP \[bu] 2 -\[dq]cn-north-1\[dq] +By default it will use the profile in your home directory (e.g. +\f[C]\[ti]/.aws/credentials\f[R] on unix based systems) file and the +\[dq]default\[dq] profile, to change set these environment variables: .RS 2 .IP \[bu] 2 -China (Beijing) Region +\f[C]AWS_SHARED_CREDENTIALS_FILE\f[R] to control which file. +.IP \[bu] 2 +\f[C]AWS_PROFILE\f[R] to control which profile to use. +.RE .RE .IP \[bu] 2 -\[dq]cn-northwest-1\[dq] -.RS 2 +Or, run \f[C]rclone\f[R] in an ECS task with an IAM role (AWS only). .IP \[bu] 2 -China (Ningxia) Region +Or, run \f[C]rclone\f[R] on an EC2 instance with an IAM role (AWS only). +.IP \[bu] 2 +Or, run \f[C]rclone\f[R] in an EKS pod with an IAM role that is +associated with a service account (AWS only). .RE +.PP +If none of these option actually end up providing \f[C]rclone\f[R] with +AWS credentials then S3 interaction will be non-authenticated (see +below). +.SS S3 Permissions +.PP +When using the \f[C]sync\f[R] subcommand of \f[C]rclone\f[R] the +following minimum permissions are required to be available on the bucket +being written to: .IP \[bu] 2 -\[dq]us-gov-east-1\[dq] -.RS 2 +\f[C]ListBucket\f[R] .IP \[bu] 2 -AWS GovCloud (US-East) Region -.RE +\f[C]DeleteObject\f[R] .IP \[bu] 2 -\[dq]us-gov-west-1\[dq] -.RS 2 +\f[C]GetObject\f[R] .IP \[bu] 2 -AWS GovCloud (US) Region -.RE +\f[C]PutObject\f[R] +.IP \[bu] 2 +\f[C]PutObjectACL\f[R] +.PP +When using the \f[C]lsd\f[R] subcommand, the \f[C]ListAllMyBuckets\f[R] +permission is required. +.PP +Example policy: +.IP +.nf +\f[C] +{ + \[dq]Version\[dq]: \[dq]2012-10-17\[dq], + \[dq]Statement\[dq]: [ + { + \[dq]Effect\[dq]: \[dq]Allow\[dq], + \[dq]Principal\[dq]: { + \[dq]AWS\[dq]: \[dq]arn:aws:iam::USER_SID:user/USER_NAME\[dq] + }, + \[dq]Action\[dq]: [ + \[dq]s3:ListBucket\[dq], + \[dq]s3:DeleteObject\[dq], + \[dq]s3:GetObject\[dq], + \[dq]s3:PutObject\[dq], + \[dq]s3:PutObjectAcl\[dq] + ], + \[dq]Resource\[dq]: [ + \[dq]arn:aws:s3:::BUCKET_NAME/*\[dq], + \[dq]arn:aws:s3:::BUCKET_NAME\[dq] + ] + }, + { + \[dq]Effect\[dq]: \[dq]Allow\[dq], + \[dq]Action\[dq]: \[dq]s3:ListAllMyBuckets\[dq], + \[dq]Resource\[dq]: \[dq]arn:aws:s3:::*\[dq] + } + ] +} +\f[R] +.fi +.PP +Notes on above: +.IP "1." 3 +This is a policy that can be used when creating bucket. +It assumes that \f[C]USER_NAME\f[R] has been created. +.IP "2." 3 +The Resource entry must include both resource ARNs, as one implies the +bucket and the other implies the bucket\[aq]s objects. +.PP +For reference, here\[aq]s an Ansible +script (https://gist.github.com/ebridges/ebfc9042dd7c756cd101cfa807b7ae2b) +that will generate one or more buckets that will work with +\f[C]rclone sync\f[R]. +.SS Key Management System (KMS) +.PP +If you are using server-side encryption with KMS then you must make sure +rclone is configured with \f[C]server_side_encryption = aws:kms\f[R] +otherwise you will find you can\[aq]t transfer small objects - these +will create checksum errors. +.SS Glacier and Glacier Deep Archive +.PP +You can upload objects using the glacier storage class or transition +them to glacier using a lifecycle +policy (http://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-lifecycle.html). +The bucket can still be synced or copied into normally, but if rclone +tries to access data from the glacier storage class you will see an +error like below. +.IP +.nf +\f[C] +2017/09/11 19:07:43 Failed to sync: failed to open source object: Object in GLACIER, restore first: path/to/file +\f[R] +.fi +.PP +In this case you need to +restore (http://docs.aws.amazon.com/AmazonS3/latest/user-guide/restore-archived-objects.html) +the object(s) in question before using rclone. +.PP +Note that rclone only speaks the S3 API it does not speak the Glacier +Vault API, so rclone cannot directly access Glacier Vaults. +.SS Object-lock enabled S3 bucket +.PP +According to AWS\[aq]s documentation on S3 Object +Lock (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-overview.html#object-lock-permission): +.RS +.PP +If you configure a default retention period on a bucket, requests to +upload objects in such a bucket must include the Content-MD5 header. .RE -.SS --s3-location-constraint .PP -Location constraint - must match endpoint. +As mentioned in the Modification times and hashes section, small files +that are not uploaded as multipart, use a different tag, causing the +upload to fail. +A simple solution is to set the \f[C]--s3-upload-cutoff 0\f[R] and force +all the files to be uploaded as multipart. +.SS Standard options .PP -Used when creating buckets only. +Here are the Standard options specific to s3 (Amazon S3 Compliant +Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, +Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, +IONOS, LyveCloud, Leviia, Liara, Linode, Minio, Netease, Petabox, +RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, +TencentCOS, Wasabi, Qiniu and others). +.SS --s3-provider +.PP +Choose your S3 provider. .PP Properties: .IP \[bu] 2 -Config: location_constraint -.IP \[bu] 2 -Env Var: RCLONE_S3_LOCATION_CONSTRAINT +Config: provider .IP \[bu] 2 -Provider: ChinaMobile +Env Var: RCLONE_S3_PROVIDER .IP \[bu] 2 Type: string .IP \[bu] 2 @@ -30881,436 +29722,497 @@ Required: false Examples: .RS 2 .IP \[bu] 2 -\[dq]wuxi1\[dq] +\[dq]AWS\[dq] +.RS 2 +.IP \[bu] 2 +Amazon Web Services (AWS) S3 +.RE +.IP \[bu] 2 +\[dq]Alibaba\[dq] .RS 2 .IP \[bu] 2 -East China (Suzhou) +Alibaba Cloud Object Storage System (OSS) formerly Aliyun .RE .IP \[bu] 2 -\[dq]jinan1\[dq] +\[dq]ArvanCloud\[dq] .RS 2 .IP \[bu] 2 -East China (Jinan) +Arvan Cloud Object Storage (AOS) .RE .IP \[bu] 2 -\[dq]ningbo1\[dq] +\[dq]Ceph\[dq] .RS 2 .IP \[bu] 2 -East China (Hangzhou) +Ceph Object Storage .RE .IP \[bu] 2 -\[dq]shanghai1\[dq] +\[dq]ChinaMobile\[dq] .RS 2 .IP \[bu] 2 -East China (Shanghai-1) +China Mobile Ecloud Elastic Object Storage (EOS) .RE .IP \[bu] 2 -\[dq]zhengzhou1\[dq] +\[dq]Cloudflare\[dq] .RS 2 .IP \[bu] 2 -Central China (Zhengzhou) +Cloudflare R2 Storage .RE .IP \[bu] 2 -\[dq]hunan1\[dq] +\[dq]DigitalOcean\[dq] .RS 2 .IP \[bu] 2 -Central China (Changsha-1) +DigitalOcean Spaces .RE .IP \[bu] 2 -\[dq]zhuzhou1\[dq] +\[dq]Dreamhost\[dq] .RS 2 .IP \[bu] 2 -Central China (Changsha-2) +Dreamhost DreamObjects .RE .IP \[bu] 2 -\[dq]guangzhou1\[dq] +\[dq]GCS\[dq] .RS 2 .IP \[bu] 2 -South China (Guangzhou-2) +Google Cloud Storage .RE .IP \[bu] 2 -\[dq]dongguan1\[dq] +\[dq]HuaweiOBS\[dq] .RS 2 .IP \[bu] 2 -South China (Guangzhou-3) +Huawei Object Storage Service .RE .IP \[bu] 2 -\[dq]beijing1\[dq] +\[dq]IBMCOS\[dq] .RS 2 .IP \[bu] 2 -North China (Beijing-1) +IBM COS S3 .RE .IP \[bu] 2 -\[dq]beijing2\[dq] +\[dq]IDrive\[dq] .RS 2 .IP \[bu] 2 -North China (Beijing-2) +IDrive e2 .RE .IP \[bu] 2 -\[dq]beijing4\[dq] +\[dq]IONOS\[dq] .RS 2 .IP \[bu] 2 -North China (Beijing-3) +IONOS Cloud .RE .IP \[bu] 2 -\[dq]huhehaote1\[dq] +\[dq]LyveCloud\[dq] .RS 2 .IP \[bu] 2 -North China (Huhehaote) +Seagate Lyve Cloud .RE .IP \[bu] 2 -\[dq]chengdu1\[dq] +\[dq]Leviia\[dq] .RS 2 .IP \[bu] 2 -Southwest China (Chengdu) +Leviia Object Storage .RE .IP \[bu] 2 -\[dq]chongqing1\[dq] +\[dq]Liara\[dq] .RS 2 .IP \[bu] 2 -Southwest China (Chongqing) +Liara Object Storage .RE .IP \[bu] 2 -\[dq]guiyang1\[dq] +\[dq]Linode\[dq] .RS 2 .IP \[bu] 2 -Southwest China (Guiyang) +Linode Object Storage .RE .IP \[bu] 2 -\[dq]xian1\[dq] +\[dq]Minio\[dq] .RS 2 .IP \[bu] 2 -Nouthwest China (Xian) +Minio Object Storage .RE .IP \[bu] 2 -\[dq]yunnan\[dq] +\[dq]Netease\[dq] .RS 2 .IP \[bu] 2 -Yunnan China (Kunming) +Netease Object Storage (NOS) .RE .IP \[bu] 2 -\[dq]yunnan2\[dq] +\[dq]Petabox\[dq] .RS 2 .IP \[bu] 2 -Yunnan China (Kunming-2) +Petabox Object Storage .RE .IP \[bu] 2 -\[dq]tianjin1\[dq] +\[dq]RackCorp\[dq] .RS 2 .IP \[bu] 2 -Tianjin China (Tianjin) +RackCorp Object Storage .RE .IP \[bu] 2 -\[dq]jilin1\[dq] +\[dq]Rclone\[dq] .RS 2 .IP \[bu] 2 -Jilin China (Changchun) +Rclone S3 Server .RE .IP \[bu] 2 -\[dq]hubei1\[dq] +\[dq]Scaleway\[dq] .RS 2 .IP \[bu] 2 -Hubei China (Xiangyan) +Scaleway Object Storage .RE .IP \[bu] 2 -\[dq]jiangxi1\[dq] +\[dq]SeaweedFS\[dq] .RS 2 .IP \[bu] 2 -Jiangxi China (Nanchang) +SeaweedFS S3 .RE .IP \[bu] 2 -\[dq]gansu1\[dq] +\[dq]StackPath\[dq] .RS 2 .IP \[bu] 2 -Gansu China (Lanzhou) +StackPath Object Storage .RE .IP \[bu] 2 -\[dq]shanxi1\[dq] +\[dq]Storj\[dq] .RS 2 .IP \[bu] 2 -Shanxi China (Taiyuan) +Storj (S3 Compatible Gateway) .RE .IP \[bu] 2 -\[dq]liaoning1\[dq] +\[dq]Synology\[dq] .RS 2 .IP \[bu] 2 -Liaoning China (Shenyang) +Synology C2 Object Storage .RE .IP \[bu] 2 -\[dq]hebei1\[dq] +\[dq]TencentCOS\[dq] .RS 2 .IP \[bu] 2 -Hebei China (Shijiazhuang) +Tencent Cloud Object Storage (COS) .RE .IP \[bu] 2 -\[dq]fujian1\[dq] +\[dq]Wasabi\[dq] .RS 2 .IP \[bu] 2 -Fujian China (Xiamen) +Wasabi Object Storage .RE .IP \[bu] 2 -\[dq]guangxi1\[dq] +\[dq]Qiniu\[dq] .RS 2 .IP \[bu] 2 -Guangxi China (Nanning) +Qiniu Object Storage (Kodo) .RE .IP \[bu] 2 -\[dq]anhui1\[dq] +\[dq]Other\[dq] .RS 2 .IP \[bu] 2 -Anhui China (Huainan) +Any other S3 compatible provider .RE .RE -.SS --s3-location-constraint +.SS --s3-env-auth .PP -Location constraint - must match endpoint. +Get AWS credentials from runtime (environment variables or EC2/ECS meta +data if no env vars). .PP -Used when creating buckets only. +Only applies if access_key_id and secret_access_key is blank. .PP Properties: .IP \[bu] 2 -Config: location_constraint -.IP \[bu] 2 -Env Var: RCLONE_S3_LOCATION_CONSTRAINT +Config: env_auth .IP \[bu] 2 -Provider: ArvanCloud +Env Var: RCLONE_S3_ENV_AUTH .IP \[bu] 2 -Type: string +Type: bool .IP \[bu] 2 -Required: false +Default: false .IP \[bu] 2 Examples: .RS 2 .IP \[bu] 2 -\[dq]ir-thr-at1\[dq] +\[dq]false\[dq] .RS 2 .IP \[bu] 2 -Tehran Iran (Simin) +Enter AWS credentials in the next step. .RE .IP \[bu] 2 -\[dq]ir-tbz-sh1\[dq] +\[dq]true\[dq] .RS 2 .IP \[bu] 2 -Tabriz Iran (Shahriar) +Get AWS credentials from the environment (env vars or IAM). .RE .RE -.SS --s3-location-constraint +.SS --s3-access-key-id .PP -Location constraint - must match endpoint when using IBM Cloud Public. +AWS Access Key ID. .PP -For on-prem COS, do not make a selection from this list, hit enter. +Leave blank for anonymous access or runtime credentials. .PP Properties: .IP \[bu] 2 -Config: location_constraint -.IP \[bu] 2 -Env Var: RCLONE_S3_LOCATION_CONSTRAINT +Config: access_key_id .IP \[bu] 2 -Provider: IBMCOS +Env Var: RCLONE_S3_ACCESS_KEY_ID .IP \[bu] 2 Type: string .IP \[bu] 2 Required: false +.SS --s3-secret-access-key +.PP +AWS Secret Access Key (password). +.PP +Leave blank for anonymous access or runtime credentials. +.PP +Properties: .IP \[bu] 2 -Examples: -.RS 2 +Config: secret_access_key .IP \[bu] 2 -\[dq]us-standard\[dq] -.RS 2 +Env Var: RCLONE_S3_SECRET_ACCESS_KEY .IP \[bu] 2 -US Cross Region Standard -.RE +Type: string .IP \[bu] 2 -\[dq]us-vault\[dq] -.RS 2 +Required: false +.SS --s3-region +.PP +Region to connect to. +.PP +Properties: .IP \[bu] 2 -US Cross Region Vault -.RE +Config: region .IP \[bu] 2 -\[dq]us-cold\[dq] -.RS 2 +Env Var: RCLONE_S3_REGION .IP \[bu] 2 -US Cross Region Cold -.RE +Provider: AWS .IP \[bu] 2 -\[dq]us-flex\[dq] -.RS 2 +Type: string .IP \[bu] 2 -US Cross Region Flex -.RE +Required: false .IP \[bu] 2 -\[dq]us-east-standard\[dq] +Examples: .RS 2 .IP \[bu] 2 -US East Region Standard -.RE -.IP \[bu] 2 -\[dq]us-east-vault\[dq] +\[dq]us-east-1\[dq] .RS 2 .IP \[bu] 2 -US East Region Vault -.RE +The default endpoint - a good choice if you are unsure. .IP \[bu] 2 -\[dq]us-east-cold\[dq] -.RS 2 +US Region, Northern Virginia, or Pacific Northwest. .IP \[bu] 2 -US East Region Cold +Leave location constraint empty. .RE .IP \[bu] 2 -\[dq]us-east-flex\[dq] +\[dq]us-east-2\[dq] .RS 2 .IP \[bu] 2 -US East Region Flex -.RE -.IP \[bu] 2 -\[dq]us-south-standard\[dq] -.RS 2 +US East (Ohio) Region. .IP \[bu] 2 -US South Region Standard +Needs location constraint us-east-2. .RE .IP \[bu] 2 -\[dq]us-south-vault\[dq] +\[dq]us-west-1\[dq] .RS 2 .IP \[bu] 2 -US South Region Vault +US West (Northern California) Region. +.IP \[bu] 2 +Needs location constraint us-west-1. .RE .IP \[bu] 2 -\[dq]us-south-cold\[dq] +\[dq]us-west-2\[dq] .RS 2 .IP \[bu] 2 -US South Region Cold +US West (Oregon) Region. +.IP \[bu] 2 +Needs location constraint us-west-2. .RE .IP \[bu] 2 -\[dq]us-south-flex\[dq] +\[dq]ca-central-1\[dq] .RS 2 .IP \[bu] 2 -US South Region Flex +Canada (Central) Region. +.IP \[bu] 2 +Needs location constraint ca-central-1. .RE .IP \[bu] 2 -\[dq]eu-standard\[dq] +\[dq]eu-west-1\[dq] .RS 2 .IP \[bu] 2 -EU Cross Region Standard +EU (Ireland) Region. +.IP \[bu] 2 +Needs location constraint EU or eu-west-1. .RE .IP \[bu] 2 -\[dq]eu-vault\[dq] +\[dq]eu-west-2\[dq] .RS 2 .IP \[bu] 2 -EU Cross Region Vault +EU (London) Region. +.IP \[bu] 2 +Needs location constraint eu-west-2. .RE .IP \[bu] 2 -\[dq]eu-cold\[dq] +\[dq]eu-west-3\[dq] .RS 2 .IP \[bu] 2 -EU Cross Region Cold +EU (Paris) Region. +.IP \[bu] 2 +Needs location constraint eu-west-3. .RE .IP \[bu] 2 -\[dq]eu-flex\[dq] +\[dq]eu-north-1\[dq] .RS 2 .IP \[bu] 2 -EU Cross Region Flex +EU (Stockholm) Region. +.IP \[bu] 2 +Needs location constraint eu-north-1. .RE .IP \[bu] 2 -\[dq]eu-gb-standard\[dq] +\[dq]eu-south-1\[dq] .RS 2 .IP \[bu] 2 -Great Britain Standard +EU (Milan) Region. +.IP \[bu] 2 +Needs location constraint eu-south-1. .RE .IP \[bu] 2 -\[dq]eu-gb-vault\[dq] +\[dq]eu-central-1\[dq] .RS 2 .IP \[bu] 2 -Great Britain Vault +EU (Frankfurt) Region. +.IP \[bu] 2 +Needs location constraint eu-central-1. .RE .IP \[bu] 2 -\[dq]eu-gb-cold\[dq] +\[dq]ap-southeast-1\[dq] .RS 2 .IP \[bu] 2 -Great Britain Cold +Asia Pacific (Singapore) Region. +.IP \[bu] 2 +Needs location constraint ap-southeast-1. .RE .IP \[bu] 2 -\[dq]eu-gb-flex\[dq] +\[dq]ap-southeast-2\[dq] .RS 2 .IP \[bu] 2 -Great Britain Flex +Asia Pacific (Sydney) Region. +.IP \[bu] 2 +Needs location constraint ap-southeast-2. .RE .IP \[bu] 2 -\[dq]ap-standard\[dq] +\[dq]ap-northeast-1\[dq] .RS 2 .IP \[bu] 2 -APAC Standard +Asia Pacific (Tokyo) Region. +.IP \[bu] 2 +Needs location constraint ap-northeast-1. .RE .IP \[bu] 2 -\[dq]ap-vault\[dq] +\[dq]ap-northeast-2\[dq] .RS 2 .IP \[bu] 2 -APAC Vault +Asia Pacific (Seoul). +.IP \[bu] 2 +Needs location constraint ap-northeast-2. .RE .IP \[bu] 2 -\[dq]ap-cold\[dq] +\[dq]ap-northeast-3\[dq] .RS 2 .IP \[bu] 2 -APAC Cold +Asia Pacific (Osaka-Local). +.IP \[bu] 2 +Needs location constraint ap-northeast-3. .RE .IP \[bu] 2 -\[dq]ap-flex\[dq] +\[dq]ap-south-1\[dq] .RS 2 .IP \[bu] 2 -APAC Flex +Asia Pacific (Mumbai). +.IP \[bu] 2 +Needs location constraint ap-south-1. .RE .IP \[bu] 2 -\[dq]mel01-standard\[dq] +\[dq]ap-east-1\[dq] .RS 2 .IP \[bu] 2 -Melbourne Standard +Asia Pacific (Hong Kong) Region. +.IP \[bu] 2 +Needs location constraint ap-east-1. .RE .IP \[bu] 2 -\[dq]mel01-vault\[dq] +\[dq]sa-east-1\[dq] .RS 2 .IP \[bu] 2 -Melbourne Vault +South America (Sao Paulo) Region. +.IP \[bu] 2 +Needs location constraint sa-east-1. .RE .IP \[bu] 2 -\[dq]mel01-cold\[dq] +\[dq]me-south-1\[dq] .RS 2 .IP \[bu] 2 -Melbourne Cold +Middle East (Bahrain) Region. +.IP \[bu] 2 +Needs location constraint me-south-1. .RE .IP \[bu] 2 -\[dq]mel01-flex\[dq] +\[dq]af-south-1\[dq] .RS 2 .IP \[bu] 2 -Melbourne Flex +Africa (Cape Town) Region. +.IP \[bu] 2 +Needs location constraint af-south-1. .RE .IP \[bu] 2 -\[dq]tor01-standard\[dq] +\[dq]cn-north-1\[dq] .RS 2 .IP \[bu] 2 -Toronto Standard +China (Beijing) Region. +.IP \[bu] 2 +Needs location constraint cn-north-1. .RE .IP \[bu] 2 -\[dq]tor01-vault\[dq] +\[dq]cn-northwest-1\[dq] .RS 2 .IP \[bu] 2 -Toronto Vault +China (Ningxia) Region. +.IP \[bu] 2 +Needs location constraint cn-northwest-1. .RE .IP \[bu] 2 -\[dq]tor01-cold\[dq] +\[dq]us-gov-east-1\[dq] .RS 2 .IP \[bu] 2 -Toronto Cold +AWS GovCloud (US-East) Region. +.IP \[bu] 2 +Needs location constraint us-gov-east-1. .RE .IP \[bu] 2 -\[dq]tor01-flex\[dq] +\[dq]us-gov-west-1\[dq] .RS 2 .IP \[bu] 2 -Toronto Flex +AWS GovCloud (US) Region. +.IP \[bu] 2 +Needs location constraint us-gov-west-1. .RE .RE +.SS --s3-endpoint +.PP +Endpoint for S3 API. +.PP +Leave blank if using AWS to use the default endpoint for the region. +.PP +Properties: +.IP \[bu] 2 +Config: endpoint +.IP \[bu] 2 +Env Var: RCLONE_S3_ENDPOINT +.IP \[bu] 2 +Provider: AWS +.IP \[bu] 2 +Type: string +.IP \[bu] 2 +Required: false .SS --s3-location-constraint .PP -Location constraint - the location where your bucket will be located and -your data stored. +Location constraint - must be set to match the Region. +.PP +Used when creating buckets only. .PP Properties: .IP \[bu] 2 @@ -31318,7 +30220,7 @@ Config: location_constraint .IP \[bu] 2 Env Var: RCLONE_S3_LOCATION_CONSTRAINT .IP \[bu] 2 -Provider: RackCorp +Provider: AWS .IP \[bu] 2 Type: string .IP \[bu] 2 @@ -31327,202 +30229,156 @@ Required: false Examples: .RS 2 .IP \[bu] 2 -\[dq]global\[dq] +\[dq]\[dq] .RS 2 .IP \[bu] 2 -Global CDN Region +Empty for US Region, Northern Virginia, or Pacific Northwest .RE .IP \[bu] 2 -\[dq]au\[dq] +\[dq]us-east-2\[dq] .RS 2 .IP \[bu] 2 -Australia (All locations) +US East (Ohio) Region .RE .IP \[bu] 2 -\[dq]au-nsw\[dq] +\[dq]us-west-1\[dq] .RS 2 .IP \[bu] 2 -NSW (Australia) Region +US West (Northern California) Region .RE .IP \[bu] 2 -\[dq]au-qld\[dq] +\[dq]us-west-2\[dq] .RS 2 .IP \[bu] 2 -QLD (Australia) Region +US West (Oregon) Region .RE .IP \[bu] 2 -\[dq]au-vic\[dq] +\[dq]ca-central-1\[dq] .RS 2 .IP \[bu] 2 -VIC (Australia) Region +Canada (Central) Region .RE .IP \[bu] 2 -\[dq]au-wa\[dq] +\[dq]eu-west-1\[dq] .RS 2 .IP \[bu] 2 -Perth (Australia) Region +EU (Ireland) Region .RE .IP \[bu] 2 -\[dq]ph\[dq] +\[dq]eu-west-2\[dq] .RS 2 .IP \[bu] 2 -Manila (Philippines) Region +EU (London) Region .RE .IP \[bu] 2 -\[dq]th\[dq] +\[dq]eu-west-3\[dq] .RS 2 .IP \[bu] 2 -Bangkok (Thailand) Region +EU (Paris) Region .RE .IP \[bu] 2 -\[dq]hk\[dq] +\[dq]eu-north-1\[dq] .RS 2 .IP \[bu] 2 -HK (Hong Kong) Region +EU (Stockholm) Region .RE .IP \[bu] 2 -\[dq]mn\[dq] +\[dq]eu-south-1\[dq] .RS 2 .IP \[bu] 2 -Ulaanbaatar (Mongolia) Region +EU (Milan) Region .RE .IP \[bu] 2 -\[dq]kg\[dq] +\[dq]EU\[dq] .RS 2 .IP \[bu] 2 -Bishkek (Kyrgyzstan) Region +EU Region .RE .IP \[bu] 2 -\[dq]id\[dq] +\[dq]ap-southeast-1\[dq] .RS 2 .IP \[bu] 2 -Jakarta (Indonesia) Region +Asia Pacific (Singapore) Region .RE .IP \[bu] 2 -\[dq]jp\[dq] +\[dq]ap-southeast-2\[dq] .RS 2 .IP \[bu] 2 -Tokyo (Japan) Region +Asia Pacific (Sydney) Region .RE .IP \[bu] 2 -\[dq]sg\[dq] +\[dq]ap-northeast-1\[dq] .RS 2 .IP \[bu] 2 -SG (Singapore) Region +Asia Pacific (Tokyo) Region .RE .IP \[bu] 2 -\[dq]de\[dq] +\[dq]ap-northeast-2\[dq] .RS 2 .IP \[bu] 2 -Frankfurt (Germany) Region +Asia Pacific (Seoul) Region .RE .IP \[bu] 2 -\[dq]us\[dq] +\[dq]ap-northeast-3\[dq] .RS 2 .IP \[bu] 2 -USA (AnyCast) Region +Asia Pacific (Osaka-Local) Region .RE .IP \[bu] 2 -\[dq]us-east-1\[dq] +\[dq]ap-south-1\[dq] .RS 2 .IP \[bu] 2 -New York (USA) Region +Asia Pacific (Mumbai) Region .RE .IP \[bu] 2 -\[dq]us-west-1\[dq] +\[dq]ap-east-1\[dq] .RS 2 .IP \[bu] 2 -Freemont (USA) Region +Asia Pacific (Hong Kong) Region .RE .IP \[bu] 2 -\[dq]nz\[dq] +\[dq]sa-east-1\[dq] .RS 2 .IP \[bu] 2 -Auckland (New Zealand) Region -.RE +South America (Sao Paulo) Region .RE -.SS --s3-location-constraint -.PP -Location constraint - must be set to match the Region. -.PP -Used when creating buckets only. -.PP -Properties: -.IP \[bu] 2 -Config: location_constraint -.IP \[bu] 2 -Env Var: RCLONE_S3_LOCATION_CONSTRAINT -.IP \[bu] 2 -Provider: Qiniu -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 .IP \[bu] 2 -\[dq]cn-east-1\[dq] +\[dq]me-south-1\[dq] .RS 2 .IP \[bu] 2 -East China Region 1 +Middle East (Bahrain) Region .RE .IP \[bu] 2 -\[dq]cn-east-2\[dq] +\[dq]af-south-1\[dq] .RS 2 .IP \[bu] 2 -East China Region 2 +Africa (Cape Town) Region .RE .IP \[bu] 2 \[dq]cn-north-1\[dq] .RS 2 .IP \[bu] 2 -North China Region 1 -.RE -.IP \[bu] 2 -\[dq]cn-south-1\[dq] -.RS 2 -.IP \[bu] 2 -South China Region 1 +China (Beijing) Region .RE .IP \[bu] 2 -\[dq]us-north-1\[dq] +\[dq]cn-northwest-1\[dq] .RS 2 .IP \[bu] 2 -North America Region 1 +China (Ningxia) Region .RE .IP \[bu] 2 -\[dq]ap-southeast-1\[dq] +\[dq]us-gov-east-1\[dq] .RS 2 .IP \[bu] 2 -Southeast Asia Region 1 +AWS GovCloud (US-East) Region .RE .IP \[bu] 2 -\[dq]ap-northeast-1\[dq] +\[dq]us-gov-west-1\[dq] .RS 2 .IP \[bu] 2 -Northeast Asia Region 1 +AWS GovCloud (US) Region .RE .RE -.SS --s3-location-constraint -.PP -Location constraint - must be set to match the Region. -.PP -Leave blank if not sure. -Used when creating buckets only. -.PP -Properties: -.IP \[bu] 2 -Config: location_constraint -.IP \[bu] 2 -Env Var: RCLONE_S3_LOCATION_CONSTRAINT -.IP \[bu] 2 -Provider: -!AWS,Alibaba,ArvanCloud,HuaweiOBS,ChinaMobile,Cloudflare,IBMCOS,IDrive,IONOS,Leviia,Liara,Qiniu,RackCorp,Scaleway,StackPath,Storj,TencentCOS,Petabox -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false .SS --s3-acl .PP Canned ACL used when creating buckets and storing or copying objects. @@ -31803,292 +30659,14 @@ Intelligent-Tiering storage class Glacier Instant Retrieval storage class .RE .RE -.SS --s3-storage-class -.PP -The storage class to use when storing new objects in OSS. -.PP -Properties: -.IP \[bu] 2 -Config: storage_class -.IP \[bu] 2 -Env Var: RCLONE_S3_STORAGE_CLASS -.IP \[bu] 2 -Provider: Alibaba -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]\[dq] -.RS 2 -.IP \[bu] 2 -Default -.RE -.IP \[bu] 2 -\[dq]STANDARD\[dq] -.RS 2 -.IP \[bu] 2 -Standard storage class -.RE -.IP \[bu] 2 -\[dq]GLACIER\[dq] -.RS 2 -.IP \[bu] 2 -Archive storage mode -.RE -.IP \[bu] 2 -\[dq]STANDARD_IA\[dq] -.RS 2 -.IP \[bu] 2 -Infrequent access storage mode -.RE -.RE -.SS --s3-storage-class -.PP -The storage class to use when storing new objects in ChinaMobile. -.PP -Properties: -.IP \[bu] 2 -Config: storage_class -.IP \[bu] 2 -Env Var: RCLONE_S3_STORAGE_CLASS -.IP \[bu] 2 -Provider: ChinaMobile -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]\[dq] -.RS 2 -.IP \[bu] 2 -Default -.RE -.IP \[bu] 2 -\[dq]STANDARD\[dq] -.RS 2 -.IP \[bu] 2 -Standard storage class -.RE -.IP \[bu] 2 -\[dq]GLACIER\[dq] -.RS 2 -.IP \[bu] 2 -Archive storage mode -.RE -.IP \[bu] 2 -\[dq]STANDARD_IA\[dq] -.RS 2 -.IP \[bu] 2 -Infrequent access storage mode -.RE -.RE -.SS --s3-storage-class -.PP -The storage class to use when storing new objects in Liara -.PP -Properties: -.IP \[bu] 2 -Config: storage_class -.IP \[bu] 2 -Env Var: RCLONE_S3_STORAGE_CLASS -.IP \[bu] 2 -Provider: Liara -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]STANDARD\[dq] -.RS 2 -.IP \[bu] 2 -Standard storage class -.RE -.RE -.SS --s3-storage-class -.PP -The storage class to use when storing new objects in ArvanCloud. -.PP -Properties: -.IP \[bu] 2 -Config: storage_class -.IP \[bu] 2 -Env Var: RCLONE_S3_STORAGE_CLASS -.IP \[bu] 2 -Provider: ArvanCloud -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]STANDARD\[dq] -.RS 2 -.IP \[bu] 2 -Standard storage class -.RE -.RE -.SS --s3-storage-class -.PP -The storage class to use when storing new objects in Tencent COS. -.PP -Properties: -.IP \[bu] 2 -Config: storage_class -.IP \[bu] 2 -Env Var: RCLONE_S3_STORAGE_CLASS -.IP \[bu] 2 -Provider: TencentCOS -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]\[dq] -.RS 2 -.IP \[bu] 2 -Default -.RE -.IP \[bu] 2 -\[dq]STANDARD\[dq] -.RS 2 -.IP \[bu] 2 -Standard storage class -.RE -.IP \[bu] 2 -\[dq]ARCHIVE\[dq] -.RS 2 -.IP \[bu] 2 -Archive storage mode -.RE -.IP \[bu] 2 -\[dq]STANDARD_IA\[dq] -.RS 2 -.IP \[bu] 2 -Infrequent access storage mode -.RE -.RE -.SS --s3-storage-class -.PP -The storage class to use when storing new objects in S3. -.PP -Properties: -.IP \[bu] 2 -Config: storage_class -.IP \[bu] 2 -Env Var: RCLONE_S3_STORAGE_CLASS -.IP \[bu] 2 -Provider: Scaleway -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]\[dq] -.RS 2 -.IP \[bu] 2 -Default. -.RE -.IP \[bu] 2 -\[dq]STANDARD\[dq] -.RS 2 -.IP \[bu] 2 -The Standard class for any upload. -.IP \[bu] 2 -Suitable for on-demand content like streaming or CDN. -.IP \[bu] 2 -Available in all regions. -.RE -.IP \[bu] 2 -\[dq]GLACIER\[dq] -.RS 2 -.IP \[bu] 2 -Archived storage. -.IP \[bu] 2 -Prices are lower, but it needs to be restored first to be accessed. -.IP \[bu] 2 -Available in FR-PAR and NL-AMS regions. -.RE -.IP \[bu] 2 -\[dq]ONEZONE_IA\[dq] -.RS 2 -.IP \[bu] 2 -One Zone - Infrequent Access. -.IP \[bu] 2 -A good choice for storing secondary backup copies or easily re-creatable -data. -.IP \[bu] 2 -Available in the FR-PAR region only. -.RE -.RE -.SS --s3-storage-class -.PP -The storage class to use when storing new objects in Qiniu. -.PP -Properties: -.IP \[bu] 2 -Config: storage_class -.IP \[bu] 2 -Env Var: RCLONE_S3_STORAGE_CLASS -.IP \[bu] 2 -Provider: Qiniu -.IP \[bu] 2 -Type: string -.IP \[bu] 2 -Required: false -.IP \[bu] 2 -Examples: -.RS 2 -.IP \[bu] 2 -\[dq]STANDARD\[dq] -.RS 2 -.IP \[bu] 2 -Standard storage class -.RE -.IP \[bu] 2 -\[dq]LINE\[dq] -.RS 2 -.IP \[bu] 2 -Infrequent access storage mode -.RE -.IP \[bu] 2 -\[dq]GLACIER\[dq] -.RS 2 -.IP \[bu] 2 -Archive storage mode -.RE -.IP \[bu] 2 -\[dq]DEEP_ARCHIVE\[dq] -.RS 2 -.IP \[bu] 2 -Deep archive storage mode -.RE -.RE .SS Advanced options .PP Here are the Advanced options specific to s3 (Amazon S3 Compliant -Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, China -Mobile, Cloudflare, GCS, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, -IDrive e2, IONOS Cloud, Leviia, Liara, Lyve Cloud, Minio, Netease, -Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, -Tencent COS, Qiniu and Wasabi). +Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, +Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, +IONOS, LyveCloud, Leviia, Liara, Linode, Minio, Netease, Petabox, +RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, +TencentCOS, Wasabi, Qiniu and others). .SS --s3-bucket-acl .PP Canned ACL used when creating buckets. @@ -32712,7 +31290,7 @@ Config: encoding .IP \[bu] 2 Env Var: RCLONE_S3_ENCODING .IP \[bu] 2 -Type: MultiEncoder +Type: Encoding .IP \[bu] 2 Default: Slash,InvalidUtf8,Dot .SS --s3-memory-pool-flush-time @@ -32987,6 +31565,61 @@ Provider: AWS Type: string .IP \[bu] 2 Required: false +.SS --s3-use-already-exists +.PP +Set if rclone should report BucketAlreadyExists errors on bucket +creation. +.PP +At some point during the evolution of the s3 protocol, AWS started +returning an \f[C]AlreadyOwnedByYou\f[R] error when attempting to create +a bucket that the user already owned, rather than a +\f[C]BucketAlreadyExists\f[R] error. +.PP +Unfortunately exactly what has been implemented by s3 clones is a little +inconsistent, some return \f[C]AlreadyOwnedByYou\f[R], some return +\f[C]BucketAlreadyExists\f[R] and some return no error at all. +.PP +This is important to rclone because it ensures the bucket exists by +creating it on quite a lot of operations (unless +\f[C]--s3-no-check-bucket\f[R] is used). +.PP +If rclone knows the provider can return \f[C]AlreadyOwnedByYou\f[R] or +returns no error then it can report \f[C]BucketAlreadyExists\f[R] errors +when the user attempts to create a bucket not owned by them. +Otherwise rclone ignores the \f[C]BucketAlreadyExists\f[R] error which +can lead to confusion. +.PP +This should be automatically set correctly for all providers rclone +knows about - please make a bug report if not. +.PP +Properties: +.IP \[bu] 2 +Config: use_already_exists +.IP \[bu] 2 +Env Var: RCLONE_S3_USE_ALREADY_EXISTS +.IP \[bu] 2 +Type: Tristate +.IP \[bu] 2 +Default: unset +.SS --s3-use-multipart-uploads +.PP +Set if rclone should use multipart uploads. +.PP +You can change this if you want to disable the use of multipart uploads. +This shouldn\[aq]t be necessary in normal operation. +.PP +This should be automatically set correctly for all providers rclone +knows about - please make a bug report if not. +.PP +Properties: +.IP \[bu] 2 +Config: use_multipart_uploads +.IP \[bu] 2 +Env Var: RCLONE_S3_USE_MULTIPART_UPLOADS +.IP \[bu] 2 +Type: Tristate +.IP \[bu] 2 +Default: unset .SS Metadata .PP User metadata is stored as x-amz-meta- keys. @@ -33677,6 +32310,19 @@ secret_access_key = your_secret_key endpoint = https://storage.googleapis.com \f[R] .fi +.PP +\f[B]Note\f[R] that \f[C]--s3-versions\f[R] does not work with GCS when +it needs to do directory paging. +Rclone will return the error: +.IP +.nf +\f[C] +s3 protocol error: received versions listing with IsTruncated set with no NextKeyMarker +\f[R] +.fi +.PP +This is Google bug +#312292516 (https://issuetracker.google.com/u/0/issues/312292516). .SS DigitalOcean Spaces .PP Spaces (https://www.digitalocean.com/products/object-storage/) is an @@ -34764,6 +33410,39 @@ endpoint = s3.rackcorp.com location_constraint = au-nsw \f[R] .fi +.SS Rclone Serve S3 +.PP +Rclone can serve any remote over the S3 protocol. +For details see the rclone serve +s3 (https://rclone.org/commands/rclone_serve_http/) documentation. +.PP +For example, to serve \f[C]remote:path\f[R] over s3, run the server like +this: +.IP +.nf +\f[C] +rclone serve s3 --auth-key ACCESS_KEY_ID,SECRET_ACCESS_KEY remote:path +\f[R] +.fi +.PP +This will be compatible with an rclone remote which is defined like +this: +.IP +.nf +\f[C] +[serves3] +type = s3 +provider = Rclone +endpoint = http://127.0.0.1:8080/ +access_key_id = ACCESS_KEY_ID +secret_access_key = SECRET_ACCESS_KEY +use_multipart_uploads = false +\f[R] +.fi +.PP +Note that setting \f[C]disable_multipart_uploads = true\f[R] is to work +around a bug (https://rclone.org/commands/rclone_serve_http/#bugs) which +will be fixed in due course. .SS Scaleway .PP Scaleway (https://www.scaleway.com/object-storage/) The Object Storage @@ -35767,6 +34446,147 @@ server_side_encryption = storage_class = \f[R] .fi +.SS Linode +.PP +Here is an example of making a Linode Object +Storage (https://www.linode.com/products/object-storage/) configuration. +First run: +.IP +.nf +\f[C] +rclone config +\f[R] +.fi +.PP +This will guide you through an interactive setup process. +.IP +.nf +\f[C] +No remotes found, make a new one? +n) New remote +s) Set configuration password +q) Quit config +n/s/q> n + +Enter name for new remote. +name> linode + +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] + X / Amazon S3 Compliant Storage Providers including AWS, ...Linode, ...and others + \[rs] (s3) +[snip] +Storage> s3 + +Option provider. +Choose your S3 provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. +[snip] +XX / Linode Object Storage + \[rs] (Linode) +[snip] +provider> Linode + +Option env_auth. +Get AWS credentials from runtime (environment variables or EC2/ECS 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 boolean value (true or false). +Press Enter for the default (false). + 1 / Enter AWS credentials in the next step. + \[rs] (false) + 2 / Get AWS credentials from the environment (env vars or IAM). + \[rs] (true) +env_auth> + +Option access_key_id. +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +access_key_id> ACCESS_KEY + +Option secret_access_key. +AWS Secret Access Key (password). +Leave blank for anonymous access or runtime credentials. +Enter a value. Press Enter to leave empty. +secret_access_key> SECRET_ACCESS_KEY + +Option endpoint. +Endpoint for Linode Object Storage API. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / Atlanta, GA (USA), us-southeast-1 + \[rs] (us-southeast-1.linodeobjects.com) + 2 / Chicago, IL (USA), us-ord-1 + \[rs] (us-ord-1.linodeobjects.com) + 3 / Frankfurt (Germany), eu-central-1 + \[rs] (eu-central-1.linodeobjects.com) + 4 / Milan (Italy), it-mil-1 + \[rs] (it-mil-1.linodeobjects.com) + 5 / Newark, NJ (USA), us-east-1 + \[rs] (us-east-1.linodeobjects.com) + 6 / Paris (France), fr-par-1 + \[rs] (fr-par-1.linodeobjects.com) + 7 / Seattle, WA (USA), us-sea-1 + \[rs] (us-sea-1.linodeobjects.com) + 8 / Singapore ap-south-1 + \[rs] (ap-south-1.linodeobjects.com) + 9 / Stockholm (Sweden), se-sto-1 + \[rs] (se-sto-1.linodeobjects.com) +10 / Washington, DC, (USA), us-iad-1 + \[rs] (us-iad-1.linodeobjects.com) +endpoint> 3 + +Option acl. +Canned ACL used when creating buckets and storing or copying objects. +This ACL is used for creating objects and if bucket_acl isn\[aq]t set, for creating buckets too. +For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl +Note that this ACL is applied when server-side copying objects as S3 +doesn\[aq]t copy the ACL from the source but rather writes a fresh one. +If the acl is an empty string then no X-Amz-Acl: header is added and +the default (private) will be used. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + / Owner gets FULL_CONTROL. + 1 | No one else has access rights (default). + \[rs] (private) +[snip] +acl> + +Edit advanced config? +y) Yes +n) No (default) +y/n> n + +Configuration complete. +Options: +- type: s3 +- provider: Linode +- access_key_id: ACCESS_KEY +- secret_access_key: SECRET_ACCESS_KEY +- endpoint: eu-central-1.linodeobjects.com +Keep this \[dq]linode\[dq] remote? +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote +y/e/d> y +\f[R] +.fi +.PP +This will leave the config file looking like this. +.IP +.nf +\f[C] +[linode] +type = s3 +provider = Linode +access_key_id = ACCESS_KEY +secret_access_key = SECRET_ACCESS_KEY +endpoint = eu-central-1.linodeobjects.com +\f[R] +.fi .SS ArvanCloud .PP ArvanCloud (https://www.arvancloud.com/en/products/cloud-storage) @@ -36550,9 +35370,9 @@ This remote supports \[ga]--fast-list\[ga] which allows you to use fewer transactions in exchange for more memory. See the [rclone docs](https://rclone.org/docs/#fast-list) for more details. -### Modified time +### Modification times -The modified time is stored as metadata on the object as +The modification time is stored as metadata on the object as \[ga]X-Bz-Info-src_last_modified_millis\[ga] as milliseconds since 1970-01-01 in the Backblaze standard. Other tools should be able to use this as a modified time. @@ -36978,7 +35798,7 @@ Properties: - Config: upload_concurrency - Env Var: RCLONE_B2_UPLOAD_CONCURRENCY - Type: int -- Default: 16 +- Default: 4 #### --b2-disable-checksum @@ -37058,6 +35878,37 @@ Properties: - Type: bool - Default: false +#### --b2-lifecycle + +Set the number of days deleted files should be kept when creating a bucket. + +On bucket creation, this parameter is used to create a lifecycle rule +for the entire bucket. + +If lifecycle is 0 (the default) it does not create a lifecycle rule so +the default B2 behaviour applies. This is to create versions of files +on delete and overwrite and to keep them indefinitely. + +If lifecycle is >0 then it creates a single rule setting the number of +days before a file that is deleted or overwritten is deleted +permanently. This is known as daysFromHidingToDeleting in the b2 docs. + +The minimum value for this parameter is 1 day. + +You can also enable hard_delete in the config also which will mean +deletions won\[aq]t cause versions but overwrites will still cause +versions to be made. + +See: [rclone backend lifecycle](#lifecycle) for setting lifecycles after bucket creation. + + +Properties: + +- Config: lifecycle +- Env Var: RCLONE_B2_LIFECYCLE +- Type: int +- Default: 0 + #### --b2-encoding The encoding for the backend. @@ -37068,9 +35919,76 @@ Properties: - Config: encoding - Env Var: RCLONE_B2_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot +## Backend commands + +Here are the commands specific to the b2 backend. + +Run them with + + rclone backend COMMAND remote: + +The help below will explain what arguments each command takes. + +See the [backend](https://rclone.org/commands/rclone_backend/) command for more +info on how to pass options and arguments. + +These can be run on a running backend using the rc command +[backend/command](https://rclone.org/rc/#backend-command). + +### lifecycle + +Read or set the lifecycle for a bucket + + rclone backend lifecycle remote: [options] [+] + +This command can be used to read or set the lifecycle for a bucket. + +Usage Examples: + +To show the current lifecycle rules: + + rclone backend lifecycle b2:bucket + +This will dump something like this showing the lifecycle rules. + + [ + { + \[dq]daysFromHidingToDeleting\[dq]: 1, + \[dq]daysFromUploadingToHiding\[dq]: null, + \[dq]fileNamePrefix\[dq]: \[dq]\[dq] + } + ] + +If there are no lifecycle rules (the default) then it will just return []. + +To reset the current lifecycle rules: + + rclone backend lifecycle b2:bucket -o daysFromHidingToDeleting=30 + rclone backend lifecycle b2:bucket -o daysFromUploadingToHiding=5 -o daysFromHidingToDeleting=1 + +This will run and then print the new lifecycle rules as above. + +Rclone only lets you set lifecycles for the whole bucket with the +fileNamePrefix = \[dq]\[dq]. + +You can\[aq]t disable versioning with B2. The best you can do is to set +the daysFromHidingToDeleting to 1 day. You can enable hard_delete in +the config also which will mean deletions won\[aq]t cause versions but +overwrites will still cause versions to be made. + + rclone backend lifecycle b2:bucket -o daysFromHidingToDeleting=1 + +See: https://www.backblaze.com/docs/cloud-storage-lifecycle-rules + + +Options: + +- \[dq]daysFromHidingToDeleting\[dq]: After a file has been hidden for this many days it is deleted. 0 is off. +- \[dq]daysFromUploadingToHiding\[dq]: This many days after uploading a file is hidden + ## Limitations @@ -37258,7 +36176,7 @@ Delete this remote y/e/d> y .IP .nf \f[C] -### Modified time and hashes +### Modification times and hashes Box allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or @@ -37501,7 +36419,7 @@ Properties: Impersonate this user ID when using a service account. -Settng this flag allows rclone, when using a JWT service account, to +Setting this flag allows rclone, when using a JWT service account, to act on behalf of another user by setting the as-user header. The user ID is the Box identifier for a user. User IDs can found for @@ -37529,7 +36447,7 @@ Properties: - Config: encoding - Env Var: RCLONE_BOX_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,BackSlash,Del,Ctl,RightSpace,InvalidUtf8,Dot @@ -38443,7 +37361,7 @@ revert (sometimes silently) to time/size comparison if compatible hashsums between source and target are not found. -### Modified time +### Modification times Chunker stores modification times using the wrapped remote so support depends on that. For a small non-chunked file the chunker overlay simply @@ -38762,7 +37680,7 @@ To copy a local directory to an ShareFile directory called backup Paths may be as deep as required, e.g. \[ga]remote:directory/subdirectory\[ga]. -### Modified time and hashes +### Modification times and hashes ShareFile allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or @@ -38957,7 +37875,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SHAREFILE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot @@ -39344,7 +38262,7 @@ Example: \[ga]1/12/qgm4avr35m5loi1th53ato71v0\[ga] -### Modified time and hashes +### Modification times and hashes Crypt stores modification times using the underlying remote so support depends on that. @@ -39651,7 +38569,7 @@ has a header and is divided into chunks. The initial nonce is generated from the operating systems crypto strong random number generator. The nonce is incremented for each chunk read making sure each nonce is unique for each block written. -The chance of a nonce being re-used is minuscule. If you wrote an +The chance of a nonce being reused is minuscule. If you wrote an exabyte of data (10\[S1]\[u2078] bytes) you would have a probability of approximately 2\[tmu]10\[u207B]\[S3]\[S2] of re-using a nonce. @@ -40105,1088 +39023,1813 @@ To copy a local directory to a dropbox directory called backup ### Dropbox for business -Rclone supports Dropbox for business and Team Folders. +Rclone supports Dropbox for business and Team Folders. + +When using Dropbox for business \[ga]remote:\[ga] and \[ga]remote:path/to/file\[ga] +will refer to your personal folder. + +If you wish to see Team Folders you must use a leading \[ga]/\[ga] in the +path, so \[ga]rclone lsd remote:/\[ga] will refer to the root and show you all +Team Folders and your User Folder. + +You can then use team folders like this \[ga]remote:/TeamFolder\[ga] and +\[ga]remote:/TeamFolder/path/to/file\[ga]. + +A leading \[ga]/\[ga] for a Dropbox personal account will do nothing, but it +will take an extra HTTP transaction so it should be avoided. + +### Modification times and hashes + +Dropbox supports modified times, but the only way to set a +modification time is to re-upload the file. + +This means that if you uploaded your data with an older version of +rclone which didn\[aq]t support the v2 API and modified times, rclone will +decide to upload all your old data to fix the modification times. If +you don\[aq]t want this to happen use \[ga]--size-only\[ga] or \[ga]--checksum\[ga] flag +to stop it. + +Dropbox supports [its own hash +type](https://www.dropbox.com/developers/reference/content-hash) which +is checked for all transfers. + +### Restricted filename characters + +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| NUL | 0x00 | \[u2400] | +| / | 0x2F | \[uFF0F] | +| DEL | 0x7F | \[u2421] | +| \[rs] | 0x5C | \[uFF3C] | + +File names can also not end with the following characters. +These only get replaced if they are the last character in the name: + +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| SP | 0x20 | \[u2420] | + +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can\[aq]t be used in JSON strings. + +### Batch mode uploads {#batch-mode} + +Using batch mode uploads is very important for performance when using +the Dropbox API. See [the dropbox performance guide](https://developers.dropbox.com/dbx-performance-guide) +for more info. + +There are 3 modes rclone can use for uploads. + +#### --dropbox-batch-mode off + +In this mode rclone will not use upload batching. This was the default +before rclone v1.55. It has the disadvantage that it is very likely to +encounter \[ga]too_many_requests\[ga] errors like this + + NOTICE: too_many_requests/.: Too many requests or write operations. Trying again in 15 seconds. + +When rclone receives these it has to wait for 15s or sometimes 300s +before continuing which really slows down transfers. + +This will happen especially if \[ga]--transfers\[ga] is large, so this mode +isn\[aq]t recommended except for compatibility or investigating problems. + +#### --dropbox-batch-mode sync + +In this mode rclone will batch up uploads to the size specified by +\[ga]--dropbox-batch-size\[ga] and commit them together. + +Using this mode means you can use a much higher \[ga]--transfers\[ga] +parameter (32 or 64 works fine) without receiving \[ga]too_many_requests\[ga] +errors. + +This mode ensures full data integrity. + +Note that there may be a pause when quitting rclone while rclone +finishes up the last batch using this mode. + +#### --dropbox-batch-mode async + +In this mode rclone will batch up uploads to the size specified by +\[ga]--dropbox-batch-size\[ga] and commit them together. + +However it will not wait for the status of the batch to be returned to +the caller. This means rclone can use a much bigger batch size (much +bigger than \[ga]--transfers\[ga]), at the cost of not being able to check the +status of the upload. + +This provides the maximum possible upload speed especially with lots +of small files, however rclone can\[aq]t check the file got uploaded +properly using this mode. + +If you are using this mode then using \[dq]rclone check\[dq] after the +transfer completes is recommended. Or you could do an initial transfer +with \[ga]--dropbox-batch-mode async\[ga] then do a final transfer with +\[ga]--dropbox-batch-mode sync\[ga] (the default). + +Note that there may be a pause when quitting rclone while rclone +finishes up the last batch using this mode. + + + +### Standard options + +Here are the Standard options specific to dropbox (Dropbox). + +#### --dropbox-client-id + +OAuth Client Id. + +Leave blank normally. + +Properties: + +- Config: client_id +- Env Var: RCLONE_DROPBOX_CLIENT_ID +- Type: string +- Required: false + +#### --dropbox-client-secret + +OAuth Client Secret. + +Leave blank normally. + +Properties: + +- Config: client_secret +- Env Var: RCLONE_DROPBOX_CLIENT_SECRET +- Type: string +- Required: false + +### Advanced options + +Here are the Advanced options specific to dropbox (Dropbox). + +#### --dropbox-token + +OAuth Access Token as a JSON blob. + +Properties: + +- Config: token +- Env Var: RCLONE_DROPBOX_TOKEN +- Type: string +- Required: false + +#### --dropbox-auth-url + +Auth server URL. + +Leave blank to use the provider defaults. + +Properties: + +- Config: auth_url +- Env Var: RCLONE_DROPBOX_AUTH_URL +- Type: string +- Required: false + +#### --dropbox-token-url + +Token server url. + +Leave blank to use the provider defaults. + +Properties: + +- Config: token_url +- Env Var: RCLONE_DROPBOX_TOKEN_URL +- Type: string +- Required: false + +#### --dropbox-chunk-size + +Upload chunk size (< 150Mi). + +Any files larger than this will be uploaded in chunks of this size. + +Note that chunks are buffered in memory (one at a time) so rclone can +deal with retries. Setting this larger will increase the speed +slightly (at most 10% for 128 MiB in tests) at the cost of using more +memory. It can be set smaller if you are tight on memory. + +Properties: + +- Config: chunk_size +- Env Var: RCLONE_DROPBOX_CHUNK_SIZE +- Type: SizeSuffix +- Default: 48Mi + +#### --dropbox-impersonate + +Impersonate this user when using a business account. + +Note that if you want to use impersonate, you should make sure this +flag is set when running \[dq]rclone config\[dq] as this will cause rclone to +request the \[dq]members.read\[dq] scope which it won\[aq]t normally. This is +needed to lookup a members email address into the internal ID that +dropbox uses in the API. + +Using the \[dq]members.read\[dq] scope will require a Dropbox Team Admin +to approve during the OAuth flow. + +You will have to use your own App (setting your own client_id and +client_secret) to use this option as currently rclone\[aq]s default set of +permissions doesn\[aq]t include \[dq]members.read\[dq]. This can be added once +v1.55 or later is in use everywhere. + + +Properties: + +- Config: impersonate +- Env Var: RCLONE_DROPBOX_IMPERSONATE +- Type: string +- Required: false + +#### --dropbox-shared-files + +Instructs rclone to work on individual shared files. + +In this mode rclone\[aq]s features are extremely limited - only list (ls, lsl, etc.) +operations and read operations (e.g. downloading) are supported in this mode. +All other operations will be disabled. + +Properties: + +- Config: shared_files +- Env Var: RCLONE_DROPBOX_SHARED_FILES +- Type: bool +- Default: false + +#### --dropbox-shared-folders + +Instructs rclone to work on shared folders. + +When this flag is used with no path only the List operation is supported and +all available shared folders will be listed. If you specify a path the first part +will be interpreted as the name of shared folder. Rclone will then try to mount this +shared to the root namespace. On success shared folder rclone proceeds normally. +The shared folder is now pretty much a normal folder and all normal operations +are supported. + +Note that we don\[aq]t unmount the shared folder afterwards so the +--dropbox-shared-folders can be omitted after the first use of a particular +shared folder. + +Properties: + +- Config: shared_folders +- Env Var: RCLONE_DROPBOX_SHARED_FOLDERS +- Type: bool +- Default: false + +#### --dropbox-pacer-min-sleep + +Minimum time to sleep between API calls. + +Properties: + +- Config: pacer_min_sleep +- Env Var: RCLONE_DROPBOX_PACER_MIN_SLEEP +- Type: Duration +- Default: 10ms + +#### --dropbox-encoding + +The encoding for the backend. + +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + +Properties: + +- Config: encoding +- Env Var: RCLONE_DROPBOX_ENCODING +- Type: Encoding +- Default: Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot + +#### --dropbox-batch-mode + +Upload file batching sync|async|off. + +This sets the batch mode used by rclone. + +For full info see [the main docs](https://rclone.org/dropbox/#batch-mode) + +This has 3 possible values + +- off - no batching +- sync - batch uploads and check completion (default) +- async - batch upload and don\[aq]t check completion + +Rclone will close any outstanding batches when it exits which may make +a delay on quit. + + +Properties: + +- Config: batch_mode +- Env Var: RCLONE_DROPBOX_BATCH_MODE +- Type: string +- Default: \[dq]sync\[dq] + +#### --dropbox-batch-size + +Max number of files in upload batch. + +This sets the batch size of files to upload. It has to be less than 1000. + +By default this is 0 which means rclone which calculate the batch size +depending on the setting of batch_mode. + +- batch_mode: async - default batch_size is 100 +- batch_mode: sync - default batch_size is the same as --transfers +- batch_mode: off - not in use + +Rclone will close any outstanding batches when it exits which may make +a delay on quit. + +Setting this is a great idea if you are uploading lots of small files +as it will make them a lot quicker. You can use --transfers 32 to +maximise throughput. + + +Properties: + +- Config: batch_size +- Env Var: RCLONE_DROPBOX_BATCH_SIZE +- Type: int +- Default: 0 + +#### --dropbox-batch-timeout + +Max time to allow an idle upload batch before uploading. + +If an upload batch is idle for more than this long then it will be +uploaded. + +The default for this is 0 which means rclone will choose a sensible +default based on the batch_mode in use. + +- batch_mode: async - default batch_timeout is 10s +- batch_mode: sync - default batch_timeout is 500ms +- batch_mode: off - not in use + + +Properties: + +- Config: batch_timeout +- Env Var: RCLONE_DROPBOX_BATCH_TIMEOUT +- Type: Duration +- Default: 0s + +#### --dropbox-batch-commit-timeout + +Max time to wait for a batch to finish committing + +Properties: + +- Config: batch_commit_timeout +- Env Var: RCLONE_DROPBOX_BATCH_COMMIT_TIMEOUT +- Type: Duration +- Default: 10m0s + + + +## Limitations + +Note that Dropbox is case insensitive so you can\[aq]t have a file called +\[dq]Hello.doc\[dq] and one called \[dq]hello.doc\[dq]. + +There are some file names such as \[ga]thumbs.db\[ga] which Dropbox can\[aq]t +store. There is a full list of them in the [\[dq]Ignored Files\[dq] section +of this document](https://www.dropbox.com/en/help/145). Rclone will +issue an error message \[ga]File name disallowed - not uploading\[ga] if it +attempts to upload one of those file names, but the sync won\[aq]t fail. + +Some errors may occur if you try to sync copyright-protected files +because Dropbox has its own [copyright detector](https://techcrunch.com/2014/03/30/how-dropbox-knows-when-youre-sharing-copyrighted-stuff-without-actually-looking-at-your-stuff/) that +prevents this sort of file being downloaded. This will return the error \[ga]ERROR : +/path/to/your/file: Failed to copy: failed to open source object: +path/restricted_content/.\[ga] + +If you have more than 10,000 files in a directory then \[ga]rclone purge +dropbox:dir\[ga] will return the error \[ga]Failed to purge: There are too +many files involved in this operation\[ga]. As a work-around do an +\[ga]rclone delete dropbox:dir\[ga] followed by an \[ga]rclone rmdir dropbox:dir\[ga]. + +When using \[ga]rclone link\[ga] you\[aq]ll need to set \[ga]--expire\[ga] if using a +non-personal account otherwise the visibility may not be correct. +(Note that \[ga]--expire\[ga] isn\[aq]t supported on personal accounts). See the +[forum discussion](https://forum.rclone.org/t/rclone-link-dropbox-permissions/23211) and the +[dropbox SDK issue](https://github.com/dropbox/dropbox-sdk-go-unofficial/issues/75). + +## Get your own Dropbox App ID + +When you use rclone with Dropbox in its default configuration you are using rclone\[aq]s App ID. This is shared between all the rclone users. + +Here is how to create your own Dropbox App ID for rclone: + +1. Log into the [Dropbox App console](https://www.dropbox.com/developers/apps/create) with your Dropbox Account (It need not +to be the same account as the Dropbox you want to access) + +2. Choose an API => Usually this should be \[ga]Dropbox API\[ga] + +3. Choose the type of access you want to use => \[ga]Full Dropbox\[ga] or \[ga]App Folder\[ga]. If you want to use Team Folders, \[ga]Full Dropbox\[ga] is required ([see here](https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-create-team-folder-inside-my-app-s-folder/m-p/601005/highlight/true#M27911)). + +4. Name your App. The app name is global, so you can\[aq]t use \[ga]rclone\[ga] for example + +5. Click the button \[ga]Create App\[ga] + +6. Switch to the \[ga]Permissions\[ga] tab. Enable at least the following permissions: \[ga]account_info.read\[ga], \[ga]files.metadata.write\[ga], \[ga]files.content.write\[ga], \[ga]files.content.read\[ga], \[ga]sharing.write\[ga]. The \[ga]files.metadata.read\[ga] and \[ga]sharing.read\[ga] checkboxes will be marked too. Click \[ga]Submit\[ga] + +7. Switch to the \[ga]Settings\[ga] tab. Fill \[ga]OAuth2 - Redirect URIs\[ga] as \[ga]http://localhost:53682/\[ga] and click on \[ga]Add\[ga] + +8. Find the \[ga]App key\[ga] and \[ga]App secret\[ga] values on the \[ga]Settings\[ga] tab. Use these values in rclone config to add a new remote or edit an existing remote. The \[ga]App key\[ga] setting corresponds to \[ga]client_id\[ga] in rclone config, the \[ga]App secret\[ga] corresponds to \[ga]client_secret\[ga] + +# Enterprise File Fabric + +This backend supports [Storage Made Easy\[aq]s Enterprise File +Fabric\[tm]](https://storagemadeeasy.com/about/) which provides a software +solution to integrate and unify File and Object Storage accessible +through a global file system. + +## Configuration + +The initial setup for the Enterprise File Fabric backend involves +getting a token from the Enterprise File Fabric which you need to +do in your browser. \[ga]rclone config\[ga] walks you through it. + +Here is an example of how to make a remote called \[ga]remote\[ga]. First run: + + rclone config + +This will guide you through an interactive setup process: +\f[R] +.fi +.PP +No remotes found, make a new one? +n) New remote s) Set configuration password q) Quit config n/s/q> n +name> remote Type of storage to configure. +Enter a string value. +Press Enter for the default (\[dq]\[dq]). +Choose a number from below, or type in your own value [snip] XX / +Enterprise File Fabric \ \[dq]filefabric\[dq] [snip] Storage> filefabric +** See help for filefabric backend at: https://rclone.org/filefabric/ ** +.PP +URL of the Enterprise File Fabric to connect to Enter a string value. +Press Enter for the default (\[dq]\[dq]). +Choose a number from below, or type in your own value 1 / Storage Made +Easy US \ \[dq]https://storagemadeeasy.com\[dq] 2 / Storage Made Easy EU +\ \[dq]https://eu.storagemadeeasy.com\[dq] 3 / Connect to your +Enterprise File Fabric \ \[dq]https://yourfabric.smestorage.com\[dq] +url> https://yourfabric.smestorage.com/ ID of the root folder Leave +blank normally. +.PP +Fill in to make rclone start with directory of a given ID. +.PP +Enter a string value. +Press Enter for the default (\[dq]\[dq]). +root_folder_id> Permanent Authentication Token +.PP +A Permanent Authentication Token can be created in the Enterprise File +Fabric, on the users Dashboard under Security, there is an entry +you\[aq]ll see called \[dq]My Authentication Tokens\[dq]. +Click the Manage button to create one. +.PP +These tokens are normally valid for several years. +.PP +For more info see: +https://docs.storagemadeeasy.com/organisationcloud/api-tokens +.PP +Enter a string value. +Press Enter for the default (\[dq]\[dq]). +permanent_token> xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx Edit advanced config? +(y/n) y) Yes n) No (default) y/n> n Remote config -------------------- +[remote] type = filefabric url = https://yourfabric.smestorage.com/ +permanent_token = xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx -------------------- +y) Yes this is OK (default) e) Edit this remote d) Delete this remote +y/e/d> y +.IP +.nf +\f[C] +Once configured you can then use \[ga]rclone\[ga] like this, + +List directories in top level of your Enterprise File Fabric -When using Dropbox for business \[ga]remote:\[ga] and \[ga]remote:path/to/file\[ga] -will refer to your personal folder. + rclone lsd remote: -If you wish to see Team Folders you must use a leading \[ga]/\[ga] in the -path, so \[ga]rclone lsd remote:/\[ga] will refer to the root and show you all -Team Folders and your User Folder. +List all the files in your Enterprise File Fabric -You can then use team folders like this \[ga]remote:/TeamFolder\[ga] and -\[ga]remote:/TeamFolder/path/to/file\[ga]. + rclone ls remote: -A leading \[ga]/\[ga] for a Dropbox personal account will do nothing, but it -will take an extra HTTP transaction so it should be avoided. +To copy a local directory to an Enterprise File Fabric directory called backup -### Modified time and Hashes + rclone copy /home/source remote:backup -Dropbox supports modified times, but the only way to set a -modification time is to re-upload the file. +### Modification times and hashes -This means that if you uploaded your data with an older version of -rclone which didn\[aq]t support the v2 API and modified times, rclone will -decide to upload all your old data to fix the modification times. If -you don\[aq]t want this to happen use \[ga]--size-only\[ga] or \[ga]--checksum\[ga] flag -to stop it. +The Enterprise File Fabric allows modification times to be set on +files accurate to 1 second. These will be used to detect whether +objects need syncing or not. -Dropbox supports [its own hash -type](https://www.dropbox.com/developers/reference/content-hash) which -is checked for all transfers. +The Enterprise File Fabric does not support any data hashes at this time. ### Restricted filename characters -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| NUL | 0x00 | \[u2400] | -| / | 0x2F | \[uFF0F] | -| DEL | 0x7F | \[u2421] | -| \[rs] | 0x5C | \[uFF3C] | - -File names can also not end with the following characters. -These only get replaced if they are the last character in the name: - -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| SP | 0x20 | \[u2420] | +The [default restricted characters set](https://rclone.org/overview/#restricted-characters) +will be replaced. Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), as they can\[aq]t be used in JSON strings. -### Batch mode uploads {#batch-mode} +### Empty files -Using batch mode uploads is very important for performance when using -the Dropbox API. See [the dropbox performance guide](https://developers.dropbox.com/dbx-performance-guide) -for more info. +Empty files aren\[aq]t supported by the Enterprise File Fabric. Rclone will therefore +upload an empty file as a single space with a mime type of +\[ga]application/vnd.rclone.empty.file\[ga] and files with that mime type are +treated as empty. -There are 3 modes rclone can use for uploads. +### Root folder ID ### -#### --dropbox-batch-mode off +You can set the \[ga]root_folder_id\[ga] for rclone. This is the directory +(identified by its \[ga]Folder ID\[ga]) that rclone considers to be the root +of your Enterprise File Fabric. -In this mode rclone will not use upload batching. This was the default -before rclone v1.55. It has the disadvantage that it is very likely to -encounter \[ga]too_many_requests\[ga] errors like this +Normally you will leave this blank and rclone will determine the +correct root to use itself. - NOTICE: too_many_requests/.: Too many requests or write operations. Trying again in 15 seconds. +However you can set this to restrict rclone to a specific folder +hierarchy. -When rclone receives these it has to wait for 15s or sometimes 300s -before continuing which really slows down transfers. +In order to do this you will have to find the \[ga]Folder ID\[ga] of the +directory you wish rclone to display. These aren\[aq]t displayed in the +web interface, but you can use \[ga]rclone lsf\[ga] to find them, for example +\f[R] +.fi +.PP +$ rclone lsf --dirs-only -Fip --csv filefabric: 120673758,Burnt PDFs/ +120673759,My Quick Uploads/ 120673755,My Syncs/ 120673756,My backups/ +120673757,My contacts/ 120673761,S3 Storage/ +.IP +.nf +\f[C] +The ID for \[dq]S3 Storage\[dq] would be \[ga]120673761\[ga]. -This will happen especially if \[ga]--transfers\[ga] is large, so this mode -isn\[aq]t recommended except for compatibility or investigating problems. -#### --dropbox-batch-mode sync +### Standard options -In this mode rclone will batch up uploads to the size specified by -\[ga]--dropbox-batch-size\[ga] and commit them together. +Here are the Standard options specific to filefabric (Enterprise File Fabric). -Using this mode means you can use a much higher \[ga]--transfers\[ga] -parameter (32 or 64 works fine) without receiving \[ga]too_many_requests\[ga] -errors. +#### --filefabric-url -This mode ensures full data integrity. +URL of the Enterprise File Fabric to connect to. -Note that there may be a pause when quitting rclone while rclone -finishes up the last batch using this mode. +Properties: -#### --dropbox-batch-mode async +- Config: url +- Env Var: RCLONE_FILEFABRIC_URL +- Type: string +- Required: true +- Examples: + - \[dq]https://storagemadeeasy.com\[dq] + - Storage Made Easy US + - \[dq]https://eu.storagemadeeasy.com\[dq] + - Storage Made Easy EU + - \[dq]https://yourfabric.smestorage.com\[dq] + - Connect to your Enterprise File Fabric -In this mode rclone will batch up uploads to the size specified by -\[ga]--dropbox-batch-size\[ga] and commit them together. +#### --filefabric-root-folder-id -However it will not wait for the status of the batch to be returned to -the caller. This means rclone can use a much bigger batch size (much -bigger than \[ga]--transfers\[ga]), at the cost of not being able to check the -status of the upload. +ID of the root folder. -This provides the maximum possible upload speed especially with lots -of small files, however rclone can\[aq]t check the file got uploaded -properly using this mode. +Leave blank normally. -If you are using this mode then using \[dq]rclone check\[dq] after the -transfer completes is recommended. Or you could do an initial transfer -with \[ga]--dropbox-batch-mode async\[ga] then do a final transfer with -\[ga]--dropbox-batch-mode sync\[ga] (the default). +Fill in to make rclone start with directory of a given ID. -Note that there may be a pause when quitting rclone while rclone -finishes up the last batch using this mode. +Properties: +- Config: root_folder_id +- Env Var: RCLONE_FILEFABRIC_ROOT_FOLDER_ID +- Type: string +- Required: false -### Standard options +#### --filefabric-permanent-token -Here are the Standard options specific to dropbox (Dropbox). +Permanent Authentication Token. -#### --dropbox-client-id +A Permanent Authentication Token can be created in the Enterprise File +Fabric, on the users Dashboard under Security, there is an entry +you\[aq]ll see called \[dq]My Authentication Tokens\[dq]. Click the Manage button +to create one. -OAuth Client Id. +These tokens are normally valid for several years. + +For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens -Leave blank normally. Properties: -- Config: client_id -- Env Var: RCLONE_DROPBOX_CLIENT_ID +- Config: permanent_token +- Env Var: RCLONE_FILEFABRIC_PERMANENT_TOKEN - Type: string - Required: false -#### --dropbox-client-secret - -OAuth Client Secret. - -Leave blank normally. +### Advanced options -Properties: +Here are the Advanced options specific to filefabric (Enterprise File Fabric). -- Config: client_secret -- Env Var: RCLONE_DROPBOX_CLIENT_SECRET -- Type: string -- Required: false +#### --filefabric-token -### Advanced options +Session Token. -Here are the Advanced options specific to dropbox (Dropbox). +This is a session token which rclone caches in the config file. It is +usually valid for 1 hour. -#### --dropbox-token +Don\[aq]t set this value - rclone will set it automatically. -OAuth Access Token as a JSON blob. Properties: - Config: token -- Env Var: RCLONE_DROPBOX_TOKEN +- Env Var: RCLONE_FILEFABRIC_TOKEN - Type: string - Required: false -#### --dropbox-auth-url +#### --filefabric-token-expiry -Auth server URL. +Token expiry time. + +Don\[aq]t set this value - rclone will set it automatically. -Leave blank to use the provider defaults. Properties: -- Config: auth_url -- Env Var: RCLONE_DROPBOX_AUTH_URL +- Config: token_expiry +- Env Var: RCLONE_FILEFABRIC_TOKEN_EXPIRY - Type: string - Required: false -#### --dropbox-token-url +#### --filefabric-version -Token server url. +Version read from the file fabric. + +Don\[aq]t set this value - rclone will set it automatically. -Leave blank to use the provider defaults. Properties: -- Config: token_url -- Env Var: RCLONE_DROPBOX_TOKEN_URL +- Config: version +- Env Var: RCLONE_FILEFABRIC_VERSION - Type: string - Required: false -#### --dropbox-chunk-size - -Upload chunk size (< 150Mi). +#### --filefabric-encoding -Any files larger than this will be uploaded in chunks of this size. +The encoding for the backend. -Note that chunks are buffered in memory (one at a time) so rclone can -deal with retries. Setting this larger will increase the speed -slightly (at most 10% for 128 MiB in tests) at the cost of using more -memory. It can be set smaller if you are tight on memory. +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. Properties: -- Config: chunk_size -- Env Var: RCLONE_DROPBOX_CHUNK_SIZE -- Type: SizeSuffix -- Default: 48Mi - -#### --dropbox-impersonate - -Impersonate this user when using a business account. - -Note that if you want to use impersonate, you should make sure this -flag is set when running \[dq]rclone config\[dq] as this will cause rclone to -request the \[dq]members.read\[dq] scope which it won\[aq]t normally. This is -needed to lookup a members email address into the internal ID that -dropbox uses in the API. - -Using the \[dq]members.read\[dq] scope will require a Dropbox Team Admin -to approve during the OAuth flow. - -You will have to use your own App (setting your own client_id and -client_secret) to use this option as currently rclone\[aq]s default set of -permissions doesn\[aq]t include \[dq]members.read\[dq]. This can be added once -v1.55 or later is in use everywhere. - +- Config: encoding +- Env Var: RCLONE_FILEFABRIC_ENCODING +- Type: Encoding +- Default: Slash,Del,Ctl,InvalidUtf8,Dot -Properties: -- Config: impersonate -- Env Var: RCLONE_DROPBOX_IMPERSONATE -- Type: string -- Required: false -#### --dropbox-shared-files +# FTP -Instructs rclone to work on individual shared files. +FTP is the File Transfer Protocol. Rclone FTP support is provided using the +[github.com/jlaffaye/ftp](https://godoc.org/github.com/jlaffaye/ftp) +package. -In this mode rclone\[aq]s features are extremely limited - only list (ls, lsl, etc.) -operations and read operations (e.g. downloading) are supported in this mode. -All other operations will be disabled. +[Limitations of Rclone\[aq]s FTP backend](#limitations) -Properties: +Paths are specified as \[ga]remote:path\[ga]. If the path does not begin with +a \[ga]/\[ga] it is relative to the home directory of the user. An empty path +\[ga]remote:\[ga] refers to the user\[aq]s home directory. -- Config: shared_files -- Env Var: RCLONE_DROPBOX_SHARED_FILES -- Type: bool -- Default: false +## Configuration -#### --dropbox-shared-folders +To create an FTP configuration named \[ga]remote\[ga], run -Instructs rclone to work on shared folders. - -When this flag is used with no path only the List operation is supported and -all available shared folders will be listed. If you specify a path the first part -will be interpreted as the name of shared folder. Rclone will then try to mount this -shared to the root namespace. On success shared folder rclone proceeds normally. -The shared folder is now pretty much a normal folder and all normal operations -are supported. + rclone config -Note that we don\[aq]t unmount the shared folder afterwards so the ---dropbox-shared-folders can be omitted after the first use of a particular -shared folder. +Rclone config guides you through an interactive setup process. A minimal +rclone FTP remote definition only requires host, username and password. +For an anonymous FTP server, see [below](#anonymous-ftp). +\f[R] +.fi +.PP +No remotes found, make a new one? +n) New remote r) Rename remote c) Copy remote s) Set configuration +password q) Quit config n/r/c/s/q> n name> remote Type of storage to +configure. +Enter a string value. +Press Enter for the default (\[dq]\[dq]). +Choose a number from below, or type in your own value [snip] XX / FTP +\ \[dq]ftp\[dq] [snip] Storage> ftp ** See help for ftp backend at: +https://rclone.org/ftp/ ** +.PP +FTP host to connect to Enter a string value. +Press Enter for the default (\[dq]\[dq]). +Choose a number from below, or type in your own value 1 / Connect to +ftp.example.com \ \[dq]ftp.example.com\[dq] host> ftp.example.com FTP +username Enter a string value. +Press Enter for the default (\[dq]$USER\[dq]). +user> FTP port number Enter a signed integer. +Press Enter for the default (21). +port> FTP password y) Yes type in my own password g) Generate random +password y/g> y Enter the password: password: Confirm the password: +password: Use FTP over TLS (Implicit) Enter a boolean value (true or +false). +Press Enter for the default (\[dq]false\[dq]). +tls> Use FTP over TLS (Explicit) Enter a boolean value (true or false). +Press Enter for the default (\[dq]false\[dq]). +explicit_tls> Remote config -------------------- [remote] type = ftp +host = ftp.example.com pass = *** ENCRYPTED *** -------------------- y) +Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y +.IP +.nf +\f[C] +To see all directories in the home directory of \[ga]remote\[ga] -Properties: + rclone lsd remote: -- Config: shared_folders -- Env Var: RCLONE_DROPBOX_SHARED_FOLDERS -- Type: bool -- Default: false +Make a new directory -#### --dropbox-batch-mode + rclone mkdir remote:path/to/directory -Upload file batching sync|async|off. +List the contents of a directory -This sets the batch mode used by rclone. + rclone ls remote:path/to/directory -For full info see [the main docs](https://rclone.org/dropbox/#batch-mode) +Sync \[ga]/home/local/directory\[ga] to the remote directory, deleting any +excess files in the directory. -This has 3 possible values + rclone sync --interactive /home/local/directory remote:directory -- off - no batching -- sync - batch uploads and check completion (default) -- async - batch upload and don\[aq]t check completion +### Anonymous FTP -Rclone will close any outstanding batches when it exits which may make -a delay on quit. +When connecting to a FTP server that allows anonymous login, you can use the +special \[dq]anonymous\[dq] username. Traditionally, this user account accepts any +string as a password, although it is common to use either the password +\[dq]anonymous\[dq] or \[dq]guest\[dq]. Some servers require the use of a valid e-mail +address as password. +Using [on-the-fly](#backend-path-to-dir) or +[connection string](https://rclone.org/docs/#connection-strings) remotes makes it easy to access +such servers, without requiring any configuration in advance. The following +are examples of that: -Properties: + rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=$(rclone obscure dummy) + rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=$(rclone obscure dummy): -- Config: batch_mode -- Env Var: RCLONE_DROPBOX_BATCH_MODE -- Type: string -- Default: \[dq]sync\[dq] +The above examples work in Linux shells and in PowerShell, but not Windows +Command Prompt. They execute the [rclone obscure](https://rclone.org/commands/rclone_obscure/) +command to create a password string in the format required by the +[pass](#ftp-pass) option. The following examples are exactly the same, except use +an already obscured string representation of the same password \[dq]dummy\[dq], and +therefore works even in Windows Command Prompt: -#### --dropbox-batch-size + rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM + rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM: -Max number of files in upload batch. +### Implicit TLS -This sets the batch size of files to upload. It has to be less than 1000. +Rlone FTP supports implicit FTP over TLS servers (FTPS). This has to +be enabled in the FTP backend config for the remote, or with +[\[ga]--ftp-tls\[ga]](#ftp-tls). The default FTPS port is \[ga]990\[ga], not \[ga]21\[ga] and +can be set with [\[ga]--ftp-port\[ga]](#ftp-port). -By default this is 0 which means rclone which calculate the batch size -depending on the setting of batch_mode. +### Restricted filename characters -- batch_mode: async - default batch_size is 100 -- batch_mode: sync - default batch_size is the same as --transfers -- batch_mode: off - not in use +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) +the following characters are also replaced: -Rclone will close any outstanding batches when it exits which may make -a delay on quit. +File names cannot end with the following characters. Replacement is +limited to the last character in a file name: -Setting this is a great idea if you are uploading lots of small files -as it will make them a lot quicker. You can use --transfers 32 to -maximise throughput. +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| SP | 0x20 | \[u2420] | +Not all FTP servers can have all characters in file names, for example: -Properties: +| FTP Server| Forbidden characters | +| --------- |:--------------------:| +| proftpd | \[ga]*\[ga] | +| pureftpd | \[ga]\[rs] [ ]\[ga] | -- Config: batch_size -- Env Var: RCLONE_DROPBOX_BATCH_SIZE -- Type: int -- Default: 0 +This backend\[aq]s interactive configuration wizard provides a selection of +sensible encoding settings for major FTP servers: ProFTPd, PureFTPd, VsFTPd. +Just hit a selection number when prompted. -#### --dropbox-batch-timeout -Max time to allow an idle upload batch before uploading. +### Standard options -If an upload batch is idle for more than this long then it will be -uploaded. +Here are the Standard options specific to ftp (FTP). -The default for this is 0 which means rclone will choose a sensible -default based on the batch_mode in use. +#### --ftp-host -- batch_mode: async - default batch_timeout is 10s -- batch_mode: sync - default batch_timeout is 500ms -- batch_mode: off - not in use +FTP host to connect to. +E.g. \[dq]ftp.example.com\[dq]. Properties: -- Config: batch_timeout -- Env Var: RCLONE_DROPBOX_BATCH_TIMEOUT -- Type: Duration -- Default: 0s +- Config: host +- Env Var: RCLONE_FTP_HOST +- Type: string +- Required: true -#### --dropbox-batch-commit-timeout +#### --ftp-user -Max time to wait for a batch to finish committing +FTP username. Properties: -- Config: batch_commit_timeout -- Env Var: RCLONE_DROPBOX_BATCH_COMMIT_TIMEOUT -- Type: Duration -- Default: 10m0s +- Config: user +- Env Var: RCLONE_FTP_USER +- Type: string +- Default: \[dq]$USER\[dq] -#### --dropbox-pacer-min-sleep +#### --ftp-port -Minimum time to sleep between API calls. +FTP port number. Properties: -- Config: pacer_min_sleep -- Env Var: RCLONE_DROPBOX_PACER_MIN_SLEEP -- Type: Duration -- Default: 10ms +- Config: port +- Env Var: RCLONE_FTP_PORT +- Type: int +- Default: 21 -#### --dropbox-encoding +#### --ftp-pass -The encoding for the backend. +FTP password. -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: -- Config: encoding -- Env Var: RCLONE_DROPBOX_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot +- Config: pass +- Env Var: RCLONE_FTP_PASS +- Type: string +- Required: false +#### --ftp-tls +Use Implicit FTPS (FTP over TLS). -## Limitations +When using implicit FTP over TLS the client connects using TLS +right from the start which breaks compatibility with +non-TLS-aware servers. This is usually served over port 990 rather +than port 21. Cannot be used in combination with explicit FTPS. -Note that Dropbox is case insensitive so you can\[aq]t have a file called -\[dq]Hello.doc\[dq] and one called \[dq]hello.doc\[dq]. +Properties: -There are some file names such as \[ga]thumbs.db\[ga] which Dropbox can\[aq]t -store. There is a full list of them in the [\[dq]Ignored Files\[dq] section -of this document](https://www.dropbox.com/en/help/145). Rclone will -issue an error message \[ga]File name disallowed - not uploading\[ga] if it -attempts to upload one of those file names, but the sync won\[aq]t fail. +- Config: tls +- Env Var: RCLONE_FTP_TLS +- Type: bool +- Default: false -Some errors may occur if you try to sync copyright-protected files -because Dropbox has its own [copyright detector](https://techcrunch.com/2014/03/30/how-dropbox-knows-when-youre-sharing-copyrighted-stuff-without-actually-looking-at-your-stuff/) that -prevents this sort of file being downloaded. This will return the error \[ga]ERROR : -/path/to/your/file: Failed to copy: failed to open source object: -path/restricted_content/.\[ga] +#### --ftp-explicit-tls -If you have more than 10,000 files in a directory then \[ga]rclone purge -dropbox:dir\[ga] will return the error \[ga]Failed to purge: There are too -many files involved in this operation\[ga]. As a work-around do an -\[ga]rclone delete dropbox:dir\[ga] followed by an \[ga]rclone rmdir dropbox:dir\[ga]. +Use Explicit FTPS (FTP over TLS). -When using \[ga]rclone link\[ga] you\[aq]ll need to set \[ga]--expire\[ga] if using a -non-personal account otherwise the visibility may not be correct. -(Note that \[ga]--expire\[ga] isn\[aq]t supported on personal accounts). See the -[forum discussion](https://forum.rclone.org/t/rclone-link-dropbox-permissions/23211) and the -[dropbox SDK issue](https://github.com/dropbox/dropbox-sdk-go-unofficial/issues/75). +When using explicit FTP over TLS the client explicitly requests +security from the server in order to upgrade a plain text connection +to an encrypted one. Cannot be used in combination with implicit FTPS. -## Get your own Dropbox App ID +Properties: -When you use rclone with Dropbox in its default configuration you are using rclone\[aq]s App ID. This is shared between all the rclone users. +- Config: explicit_tls +- Env Var: RCLONE_FTP_EXPLICIT_TLS +- Type: bool +- Default: false -Here is how to create your own Dropbox App ID for rclone: +### Advanced options -1. Log into the [Dropbox App console](https://www.dropbox.com/developers/apps/create) with your Dropbox Account (It need not -to be the same account as the Dropbox you want to access) +Here are the Advanced options specific to ftp (FTP). + +#### --ftp-concurrency -2. Choose an API => Usually this should be \[ga]Dropbox API\[ga] +Maximum number of FTP simultaneous connections, 0 for unlimited. -3. Choose the type of access you want to use => \[ga]Full Dropbox\[ga] or \[ga]App Folder\[ga]. If you want to use Team Folders, \[ga]Full Dropbox\[ga] is required ([see here](https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-create-team-folder-inside-my-app-s-folder/m-p/601005/highlight/true#M27911)). +Note that setting this is very likely to cause deadlocks so it should +be used with care. -4. Name your App. The app name is global, so you can\[aq]t use \[ga]rclone\[ga] for example +If you are doing a sync or copy then make sure concurrency is one more +than the sum of \[ga]--transfers\[ga] and \[ga]--checkers\[ga]. -5. Click the button \[ga]Create App\[ga] +If you use \[ga]--check-first\[ga] then it just needs to be one more than the +maximum of \[ga]--checkers\[ga] and \[ga]--transfers\[ga]. -6. Switch to the \[ga]Permissions\[ga] tab. Enable at least the following permissions: \[ga]account_info.read\[ga], \[ga]files.metadata.write\[ga], \[ga]files.content.write\[ga], \[ga]files.content.read\[ga], \[ga]sharing.write\[ga]. The \[ga]files.metadata.read\[ga] and \[ga]sharing.read\[ga] checkboxes will be marked too. Click \[ga]Submit\[ga] +So for \[ga]concurrency 3\[ga] you\[aq]d use \[ga]--checkers 2 --transfers 2 +--check-first\[ga] or \[ga]--checkers 1 --transfers 1\[ga]. -7. Switch to the \[ga]Settings\[ga] tab. Fill \[ga]OAuth2 - Redirect URIs\[ga] as \[ga]http://localhost:53682/\[ga] and click on \[ga]Add\[ga] -8. Find the \[ga]App key\[ga] and \[ga]App secret\[ga] values on the \[ga]Settings\[ga] tab. Use these values in rclone config to add a new remote or edit an existing remote. The \[ga]App key\[ga] setting corresponds to \[ga]client_id\[ga] in rclone config, the \[ga]App secret\[ga] corresponds to \[ga]client_secret\[ga] -# Enterprise File Fabric +Properties: -This backend supports [Storage Made Easy\[aq]s Enterprise File -Fabric\[tm]](https://storagemadeeasy.com/about/) which provides a software -solution to integrate and unify File and Object Storage accessible -through a global file system. +- Config: concurrency +- Env Var: RCLONE_FTP_CONCURRENCY +- Type: int +- Default: 0 -## Configuration +#### --ftp-no-check-certificate -The initial setup for the Enterprise File Fabric backend involves -getting a token from the Enterprise File Fabric which you need to -do in your browser. \[ga]rclone config\[ga] walks you through it. +Do not verify the TLS certificate of the server. -Here is an example of how to make a remote called \[ga]remote\[ga]. First run: +Properties: - rclone config +- Config: no_check_certificate +- Env Var: RCLONE_FTP_NO_CHECK_CERTIFICATE +- Type: bool +- Default: false -This will guide you through an interactive setup process: -\f[R] -.fi -.PP -No remotes found, make a new one? -n) New remote s) Set configuration password q) Quit config n/s/q> n -name> remote Type of storage to configure. -Enter a string value. -Press Enter for the default (\[dq]\[dq]). -Choose a number from below, or type in your own value [snip] XX / -Enterprise File Fabric \ \[dq]filefabric\[dq] [snip] Storage> filefabric -** See help for filefabric backend at: https://rclone.org/filefabric/ ** -.PP -URL of the Enterprise File Fabric to connect to Enter a string value. -Press Enter for the default (\[dq]\[dq]). -Choose a number from below, or type in your own value 1 / Storage Made -Easy US \ \[dq]https://storagemadeeasy.com\[dq] 2 / Storage Made Easy EU -\ \[dq]https://eu.storagemadeeasy.com\[dq] 3 / Connect to your -Enterprise File Fabric \ \[dq]https://yourfabric.smestorage.com\[dq] -url> https://yourfabric.smestorage.com/ ID of the root folder Leave -blank normally. -.PP -Fill in to make rclone start with directory of a given ID. -.PP -Enter a string value. -Press Enter for the default (\[dq]\[dq]). -root_folder_id> Permanent Authentication Token -.PP -A Permanent Authentication Token can be created in the Enterprise File -Fabric, on the users Dashboard under Security, there is an entry -you\[aq]ll see called \[dq]My Authentication Tokens\[dq]. -Click the Manage button to create one. -.PP -These tokens are normally valid for several years. -.PP -For more info see: -https://docs.storagemadeeasy.com/organisationcloud/api-tokens -.PP -Enter a string value. -Press Enter for the default (\[dq]\[dq]). -permanent_token> xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx Edit advanced config? -(y/n) y) Yes n) No (default) y/n> n Remote config -------------------- -[remote] type = filefabric url = https://yourfabric.smestorage.com/ -permanent_token = xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx -------------------- -y) Yes this is OK (default) e) Edit this remote d) Delete this remote -y/e/d> y -.IP -.nf -\f[C] -Once configured you can then use \[ga]rclone\[ga] like this, +#### --ftp-disable-epsv -List directories in top level of your Enterprise File Fabric +Disable using EPSV even if server advertises support. - rclone lsd remote: +Properties: -List all the files in your Enterprise File Fabric +- Config: disable_epsv +- Env Var: RCLONE_FTP_DISABLE_EPSV +- Type: bool +- Default: false - rclone ls remote: +#### --ftp-disable-mlsd -To copy a local directory to an Enterprise File Fabric directory called backup +Disable using MLSD even if server advertises support. - rclone copy /home/source remote:backup +Properties: -### Modified time and hashes +- Config: disable_mlsd +- Env Var: RCLONE_FTP_DISABLE_MLSD +- Type: bool +- Default: false -The Enterprise File Fabric allows modification times to be set on -files accurate to 1 second. These will be used to detect whether -objects need syncing or not. +#### --ftp-disable-utf8 -The Enterprise File Fabric does not support any data hashes at this time. +Disable using UTF-8 even if server advertises support. -### Restricted filename characters +Properties: -The [default restricted characters set](https://rclone.org/overview/#restricted-characters) -will be replaced. +- Config: disable_utf8 +- Env Var: RCLONE_FTP_DISABLE_UTF8 +- Type: bool +- Default: false -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can\[aq]t be used in JSON strings. +#### --ftp-writing-mdtm -### Empty files +Use MDTM to set modification time (VsFtpd quirk) -Empty files aren\[aq]t supported by the Enterprise File Fabric. Rclone will therefore -upload an empty file as a single space with a mime type of -\[ga]application/vnd.rclone.empty.file\[ga] and files with that mime type are -treated as empty. +Properties: -### Root folder ID ### +- Config: writing_mdtm +- Env Var: RCLONE_FTP_WRITING_MDTM +- Type: bool +- Default: false -You can set the \[ga]root_folder_id\[ga] for rclone. This is the directory -(identified by its \[ga]Folder ID\[ga]) that rclone considers to be the root -of your Enterprise File Fabric. +#### --ftp-force-list-hidden -Normally you will leave this blank and rclone will determine the -correct root to use itself. +Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD. -However you can set this to restrict rclone to a specific folder -hierarchy. +Properties: -In order to do this you will have to find the \[ga]Folder ID\[ga] of the -directory you wish rclone to display. These aren\[aq]t displayed in the -web interface, but you can use \[ga]rclone lsf\[ga] to find them, for example -\f[R] -.fi -.PP -$ rclone lsf --dirs-only -Fip --csv filefabric: 120673758,Burnt PDFs/ -120673759,My Quick Uploads/ 120673755,My Syncs/ 120673756,My backups/ -120673757,My contacts/ 120673761,S3 Storage/ -.IP -.nf -\f[C] -The ID for \[dq]S3 Storage\[dq] would be \[ga]120673761\[ga]. +- Config: force_list_hidden +- Env Var: RCLONE_FTP_FORCE_LIST_HIDDEN +- Type: bool +- Default: false +#### --ftp-idle-timeout -### Standard options +Max time before closing idle connections. -Here are the Standard options specific to filefabric (Enterprise File Fabric). +If no connections have been returned to the connection pool in the time +given, rclone will empty the connection pool. -#### --filefabric-url +Set to 0 to keep connections indefinitely. -URL of the Enterprise File Fabric to connect to. Properties: -- Config: url -- Env Var: RCLONE_FILEFABRIC_URL -- Type: string -- Required: true -- Examples: - - \[dq]https://storagemadeeasy.com\[dq] - - Storage Made Easy US - - \[dq]https://eu.storagemadeeasy.com\[dq] - - Storage Made Easy EU - - \[dq]https://yourfabric.smestorage.com\[dq] - - Connect to your Enterprise File Fabric +- Config: idle_timeout +- Env Var: RCLONE_FTP_IDLE_TIMEOUT +- Type: Duration +- Default: 1m0s -#### --filefabric-root-folder-id +#### --ftp-close-timeout -ID of the root folder. +Maximum time to wait for a response to close. -Leave blank normally. +Properties: -Fill in to make rclone start with directory of a given ID. +- Config: close_timeout +- Env Var: RCLONE_FTP_CLOSE_TIMEOUT +- Type: Duration +- Default: 1m0s +#### --ftp-tls-cache-size + +Size of TLS session cache for all control and data connections. + +TLS cache allows to resume TLS sessions and reuse PSK between connections. +Increase if default size is not enough resulting in TLS resumption errors. +Enabled by default. Use 0 to disable. Properties: -- Config: root_folder_id -- Env Var: RCLONE_FILEFABRIC_ROOT_FOLDER_ID -- Type: string -- Required: false +- Config: tls_cache_size +- Env Var: RCLONE_FTP_TLS_CACHE_SIZE +- Type: int +- Default: 32 -#### --filefabric-permanent-token +#### --ftp-disable-tls13 -Permanent Authentication Token. +Disable TLS 1.3 (workaround for FTP servers with buggy TLS) -A Permanent Authentication Token can be created in the Enterprise File -Fabric, on the users Dashboard under Security, there is an entry -you\[aq]ll see called \[dq]My Authentication Tokens\[dq]. Click the Manage button -to create one. +Properties: -These tokens are normally valid for several years. +- Config: disable_tls13 +- Env Var: RCLONE_FTP_DISABLE_TLS13 +- Type: bool +- Default: false -For more info see: https://docs.storagemadeeasy.com/organisationcloud/api-tokens +#### --ftp-shut-timeout +Maximum time to wait for data connection closing status. Properties: -- Config: permanent_token -- Env Var: RCLONE_FILEFABRIC_PERMANENT_TOKEN -- Type: string -- Required: false +- Config: shut_timeout +- Env Var: RCLONE_FTP_SHUT_TIMEOUT +- Type: Duration +- Default: 1m0s -### Advanced options +#### --ftp-ask-password -Here are the Advanced options specific to filefabric (Enterprise File Fabric). +Allow asking for FTP password when needed. -#### --filefabric-token +If this is set and no password is supplied then rclone will ask for a password -Session Token. -This is a session token which rclone caches in the config file. It is -usually valid for 1 hour. +Properties: -Don\[aq]t set this value - rclone will set it automatically. +- Config: ask_password +- Env Var: RCLONE_FTP_ASK_PASSWORD +- Type: bool +- Default: false + +#### --ftp-socks-proxy +Socks 5 proxy host. + + Supports the format user:pass\[at]host:port, user\[at]host:port, host:port. + + Example: + + myUser:myPass\[at]localhost:9005 + Properties: -- Config: token -- Env Var: RCLONE_FILEFABRIC_TOKEN +- Config: socks_proxy +- Env Var: RCLONE_FTP_SOCKS_PROXY - Type: string - Required: false -#### --filefabric-token-expiry - -Token expiry time. +#### --ftp-encoding -Don\[aq]t set this value - rclone will set it automatically. +The encoding for the backend. +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. Properties: -- Config: token_expiry -- Env Var: RCLONE_FILEFABRIC_TOKEN_EXPIRY -- Type: string -- Required: false +- Config: encoding +- Env Var: RCLONE_FTP_ENCODING +- Type: Encoding +- Default: Slash,Del,Ctl,RightSpace,Dot +- Examples: + - \[dq]Asterisk,Ctl,Dot,Slash\[dq] + - ProFTPd can\[aq]t handle \[aq]*\[aq] in file names + - \[dq]BackSlash,Ctl,Del,Dot,RightSpace,Slash,SquareBracket\[dq] + - PureFTPd can\[aq]t handle \[aq][]\[aq] or \[aq]*\[aq] in file names + - \[dq]Ctl,LeftPeriod,Slash\[dq] + - VsFTPd can\[aq]t handle file names starting with dot -#### --filefabric-version -Version read from the file fabric. -Don\[aq]t set this value - rclone will set it automatically. +## Limitations +FTP servers acting as rclone remotes must support \[ga]passive\[ga] mode. +The mode cannot be configured as \[ga]passive\[ga] is the only supported one. +Rclone\[aq]s FTP implementation is not compatible with \[ga]active\[ga] mode +as [the library it uses doesn\[aq]t support it](https://github.com/jlaffaye/ftp/issues/29). +This will likely never be supported due to security concerns. -Properties: +Rclone\[aq]s FTP backend does not support any checksums but can compare +file sizes. -- Config: version -- Env Var: RCLONE_FILEFABRIC_VERSION -- Type: string -- Required: false +\[ga]rclone about\[ga] is not supported by the FTP backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy \[ga]mfs\[ga] (most free space) as a member of an rclone union +remote. -#### --filefabric-encoding +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -The encoding for the backend. +The implementation of : \[ga]--dump headers\[ga], +\[ga]--dump bodies\[ga], \[ga]--dump auth\[ga] for debugging isn\[aq]t the same as +for rclone HTTP based backends - it has less fine grained control. -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +\[ga]--timeout\[ga] isn\[aq]t supported (but \[ga]--contimeout\[ga] is). -Properties: +\[ga]--bind\[ga] isn\[aq]t supported. -- Config: encoding -- Env Var: RCLONE_FILEFABRIC_ENCODING -- Type: MultiEncoder -- Default: Slash,Del,Ctl,InvalidUtf8,Dot +Rclone\[aq]s FTP backend could support server-side move but does not +at present. +The \[ga]ftp_proxy\[ga] environment variable is not currently supported. +### Modification times -# FTP +File modification time (timestamps) is supported to 1 second resolution +for major FTP servers: ProFTPd, PureFTPd, VsFTPd, and FileZilla FTP server. +The \[ga]VsFTPd\[ga] server has non-standard implementation of time related protocol +commands and needs a special configuration setting: \[ga]writing_mdtm = true\[ga]. -FTP is the File Transfer Protocol. Rclone FTP support is provided using the -[github.com/jlaffaye/ftp](https://godoc.org/github.com/jlaffaye/ftp) -package. +Support for precise file time with other FTP servers varies depending on what +protocol extensions they advertise. If all the \[ga]MLSD\[ga], \[ga]MDTM\[ga] and \[ga]MFTM\[ga] +extensions are present, rclone will use them together to provide precise time. +Otherwise the times you see on the FTP server through rclone are those of the +last file upload. -[Limitations of Rclone\[aq]s FTP backend](#limitations) +You can use the following command to check whether rclone can use precise time +with your FTP server: \[ga]rclone backend features your_ftp_remote:\[ga] (the trailing +colon is important). Look for the number in the line tagged by \[ga]Precision\[ga] +designating the remote time precision expressed as nanoseconds. A value of +\[ga]1000000000\[ga] means that file time precision of 1 second is available. +A value of \[ga]3153600000000000000\[ga] (or another large number) means \[dq]unsupported\[dq]. -Paths are specified as \[ga]remote:path\[ga]. If the path does not begin with -a \[ga]/\[ga] it is relative to the home directory of the user. An empty path -\[ga]remote:\[ga] refers to the user\[aq]s home directory. +# Google Cloud Storage + +Paths are specified as \[ga]remote:bucket\[ga] (or \[ga]remote:\[ga] for the \[ga]lsd\[ga] +command.) You may put subdirectories in too, e.g. \[ga]remote:bucket/path/to/dir\[ga]. ## Configuration -To create an FTP configuration named \[ga]remote\[ga], run +The initial setup for google cloud storage involves getting a token from Google Cloud Storage +which you need to do in your browser. \[ga]rclone config\[ga] walks you +through it. - rclone config +Here is an example of how to make a remote called \[ga]remote\[ga]. First run: -Rclone config guides you through an interactive setup process. A minimal -rclone FTP remote definition only requires host, username and password. -For an anonymous FTP server, see [below](#anonymous-ftp). + rclone config + +This will guide you through an interactive setup process: \f[R] .fi -.PP -No remotes found, make a new one? -n) New remote r) Rename remote c) Copy remote s) Set configuration -password q) Quit config n/r/c/s/q> n name> remote Type of storage to -configure. -Enter a string value. -Press Enter for the default (\[dq]\[dq]). -Choose a number from below, or type in your own value [snip] XX / FTP -\ \[dq]ftp\[dq] [snip] Storage> ftp ** See help for ftp backend at: -https://rclone.org/ftp/ ** -.PP -FTP host to connect to Enter a string value. -Press Enter for the default (\[dq]\[dq]). -Choose a number from below, or type in your own value 1 / Connect to -ftp.example.com \ \[dq]ftp.example.com\[dq] host> ftp.example.com FTP -username Enter a string value. -Press Enter for the default (\[dq]$USER\[dq]). -user> FTP port number Enter a signed integer. -Press Enter for the default (21). -port> FTP password y) Yes type in my own password g) Generate random -password y/g> y Enter the password: password: Confirm the password: -password: Use FTP over TLS (Implicit) Enter a boolean value (true or -false). -Press Enter for the default (\[dq]false\[dq]). -tls> Use FTP over TLS (Explicit) Enter a boolean value (true or false). -Press Enter for the default (\[dq]false\[dq]). -explicit_tls> Remote config -------------------- [remote] type = ftp -host = ftp.example.com pass = *** ENCRYPTED *** -------------------- y) -Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y +.IP "n)" 3 +New remote +.IP "o)" 3 +Delete remote +.IP "p)" 3 +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 [snip] XX / Google +Cloud Storage (this is not Google Drive) \ \[dq]google cloud +storage\[dq] [snip] Storage> google cloud storage Google Application +Client Id - leave blank normally. +client_id> Google Application Client Secret - leave blank normally. +client_secret> Project number optional - needed only for +list/create/delete buckets - see your developer console. +project_number> 12345678 Service Account Credentials JSON file path - +needed only if you want use SA instead of interactive login. +service_account_file> Access Control List for new objects. +Choose a number from below, or type in your own value 1 / Object owner +gets OWNER access, and all Authenticated Users get READER access. +\ \[dq]authenticatedRead\[dq] 2 / Object owner gets OWNER access, and +project team owners get OWNER access. +\ \[dq]bucketOwnerFullControl\[dq] 3 / Object owner gets OWNER access, +and project team owners get READER access. +\ \[dq]bucketOwnerRead\[dq] 4 / Object owner gets OWNER access [default +if left blank]. +\ \[dq]private\[dq] 5 / Object owner gets OWNER access, and project team +members get access according to their roles. +\ \[dq]projectPrivate\[dq] 6 / Object owner gets OWNER access, and all +Users get READER access. +\ \[dq]publicRead\[dq] object_acl> 4 Access Control List for new +buckets. +Choose a number from below, or type in your own value 1 / Project team +owners get OWNER access, and all Authenticated Users get READER access. +\ \[dq]authenticatedRead\[dq] 2 / Project team owners get OWNER access +[default if left blank]. +\ \[dq]private\[dq] 3 / Project team members get access according to +their roles. +\ \[dq]projectPrivate\[dq] 4 / Project team owners get OWNER access, and +all Users get READER access. +\ \[dq]publicRead\[dq] 5 / Project team owners get OWNER access, and all +Users get WRITER access. +\ \[dq]publicReadWrite\[dq] bucket_acl> 2 Location for the newly created +buckets. +Choose a number from below, or type in your own value 1 / Empty for +default location (US). +\ \[dq]\[dq] 2 / Multi-regional location for Asia. +\ \[dq]asia\[dq] 3 / Multi-regional location for Europe. +\ \[dq]eu\[dq] 4 / Multi-regional location for United States. +\ \[dq]us\[dq] 5 / Taiwan. +\ \[dq]asia-east1\[dq] 6 / Tokyo. +\ \[dq]asia-northeast1\[dq] 7 / Singapore. +\ \[dq]asia-southeast1\[dq] 8 / Sydney. +\ \[dq]australia-southeast1\[dq] 9 / Belgium. +\ \[dq]europe-west1\[dq] 10 / London. +\ \[dq]europe-west2\[dq] 11 / Iowa. +\ \[dq]us-central1\[dq] 12 / South Carolina. +\ \[dq]us-east1\[dq] 13 / Northern Virginia. +\ \[dq]us-east4\[dq] 14 / Oregon. +\ \[dq]us-west1\[dq] location> 12 The storage class to use when storing +objects in Google Cloud Storage. +Choose a number from below, or type in your own value 1 / Default +\ \[dq]\[dq] 2 / Multi-regional storage class \ \[dq]MULTI_REGIONAL\[dq] +3 / Regional storage class \ \[dq]REGIONAL\[dq] 4 / Nearline storage +class \ \[dq]NEARLINE\[dq] 5 / Coldline storage class +\ \[dq]COLDLINE\[dq] 6 / Durable reduced availability storage class +\ \[dq]DURABLE_REDUCED_AVAILABILITY\[dq] storage_class> 5 Remote config +Use web browser to automatically authenticate rclone with remote? +.IP \[bu] 2 +Say Y if the machine running rclone has a web browser you can use +.IP \[bu] 2 +Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. +If Y failed, try N. +.IP "y)" 3 +Yes +.IP "z)" 3 +No y/n> y If your browser doesn\[aq]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] type = google cloud storage +client_id = client_secret = token = +{\[dq]AccessToken\[dq]:\[dq]xxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\[dq],\[dq]RefreshToken\[dq]:\[dq]x/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxx\[dq],\[dq]Expiry\[dq]:\[dq]2014-07-17T20:49:14.929208288+01:00\[dq],\[dq]Extra\[dq]:null} +project_number = 12345678 object_acl = private bucket_acl = private +-------------------- +.IP "a)" 3 +Yes this is OK +.IP "b)" 3 +Edit this remote +.IP "c)" 3 +Delete this remote y/e/d> y .IP .nf \f[C] -To see all directories in the home directory of \[ga]remote\[ga] +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a +machine with no Internet browser available. + +Note that rclone runs a webserver on your local machine to collect the +token as returned from Google if using web browser to automatically +authenticate. This only +runs from the moment it opens your browser to the moment you get back +the verification code. This is on \[ga]http://127.0.0.1:53682/\[ga] and this +it may require you to unblock it temporarily if you are running a host +firewall, or use manual mode. + +This remote is called \[ga]remote\[ga] and can now be used like this + +See all the buckets in your project + + rclone lsd remote: + +Make a new bucket + + rclone mkdir remote:bucket + +List the contents of a bucket + + rclone ls remote:bucket + +Sync \[ga]/home/local/directory\[ga] to the remote bucket, deleting any excess +files in the bucket. + + rclone sync --interactive /home/local/directory remote:bucket - rclone lsd remote: +### Service Account support -Make a new directory +You can set up rclone with Google Cloud Storage in an unattended mode, +i.e. not tied to a specific end-user Google account. This is useful +when you want to synchronise files onto machines that don\[aq]t have +actively logged-in users, for example build machines. - rclone mkdir remote:path/to/directory +To get credentials for Google Cloud Platform +[IAM Service Accounts](https://cloud.google.com/iam/docs/service-accounts), +please head to the +[Service Account](https://console.cloud.google.com/permissions/serviceaccounts) +section of the Google Developer Console. Service Accounts behave just +like normal \[ga]User\[ga] permissions in +[Google Cloud Storage ACLs](https://cloud.google.com/storage/docs/access-control), +so you can limit their access (e.g. make them read only). After +creating an account, a JSON file containing the Service Account\[aq]s +credentials will be downloaded onto your machines. These credentials +are what rclone will use for authentication. -List the contents of a directory +To use a Service Account instead of OAuth2 token flow, enter the path +to your Service Account credentials at the \[ga]service_account_file\[ga] +prompt and rclone won\[aq]t use the browser based authentication +flow. If you\[aq]d rather stuff the contents of the credentials file into +the rclone config file, you can set \[ga]service_account_credentials\[ga] with +the actual contents of the file instead, or set the equivalent +environment variable. - rclone ls remote:path/to/directory +### Anonymous Access -Sync \[ga]/home/local/directory\[ga] to the remote directory, deleting any -excess files in the directory. +For downloads of objects that permit public access you can configure rclone +to use anonymous access by setting \[ga]anonymous\[ga] to \[ga]true\[ga]. +With unauthorized access you can\[aq]t write or create files but only read or list +those buckets and objects that have public read access. - rclone sync --interactive /home/local/directory remote:directory +### Application Default Credentials -### Anonymous FTP +If no other source of credentials is provided, rclone will fall back +to +[Application Default Credentials](https://cloud.google.com/video-intelligence/docs/common/auth#authenticating_with_application_default_credentials) +this is useful both when you already have configured authentication +for your developer account, or in production when running on a google +compute host. Note that if running in docker, you may need to run +additional commands on your google compute machine - +[see this page](https://cloud.google.com/container-registry/docs/advanced-authentication#gcloud_as_a_docker_credential_helper). -When connecting to a FTP server that allows anonymous login, you can use the -special \[dq]anonymous\[dq] username. Traditionally, this user account accepts any -string as a password, although it is common to use either the password -\[dq]anonymous\[dq] or \[dq]guest\[dq]. Some servers require the use of a valid e-mail -address as password. +Note that in the case application default credentials are used, there +is no need to explicitly configure a project number. -Using [on-the-fly](#backend-path-to-dir) or -[connection string](https://rclone.org/docs/#connection-strings) remotes makes it easy to access -such servers, without requiring any configuration in advance. The following -are examples of that: +### --fast-list - rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=$(rclone obscure dummy) - rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=$(rclone obscure dummy): +This remote supports \[ga]--fast-list\[ga] which allows you to use fewer +transactions in exchange for more memory. See the [rclone +docs](https://rclone.org/docs/#fast-list) for more details. -The above examples work in Linux shells and in PowerShell, but not Windows -Command Prompt. They execute the [rclone obscure](https://rclone.org/commands/rclone_obscure/) -command to create a password string in the format required by the -[pass](#ftp-pass) option. The following examples are exactly the same, except use -an already obscured string representation of the same password \[dq]dummy\[dq], and -therefore works even in Windows Command Prompt: +### Custom upload headers - rclone lsf :ftp: --ftp-host=speedtest.tele2.net --ftp-user=anonymous --ftp-pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM - rclone lsf :ftp,host=speedtest.tele2.net,user=anonymous,pass=IXs2wc8OJOz7SYLBk47Ji1rHTmxM: +You can set custom upload headers with the \[ga]--header-upload\[ga] +flag. Google Cloud Storage supports the headers as described in the +[working with metadata documentation](https://cloud.google.com/storage/docs/gsutil/addlhelp/WorkingWithObjectMetadata) -### Implicit TLS +- Cache-Control +- Content-Disposition +- Content-Encoding +- Content-Language +- Content-Type +- X-Goog-Storage-Class +- X-Goog-Meta- -Rlone FTP supports implicit FTP over TLS servers (FTPS). This has to -be enabled in the FTP backend config for the remote, or with -[\[ga]--ftp-tls\[ga]](#ftp-tls). The default FTPS port is \[ga]990\[ga], not \[ga]21\[ga] and -can be set with [\[ga]--ftp-port\[ga]](#ftp-port). +Eg \[ga]--header-upload \[dq]Content-Type text/potato\[dq]\[ga] -### Restricted filename characters +Note that the last of these is for setting custom metadata in the form +\[ga]--header-upload \[dq]x-goog-meta-key: value\[dq]\[ga] -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) -the following characters are also replaced: +### Modification times -File names cannot end with the following characters. Replacement is -limited to the last character in a file name: +Google Cloud Storage stores md5sum natively. +Google\[aq]s [gsutil](https://cloud.google.com/storage/docs/gsutil) tool stores modification time +with one-second precision as \[ga]goog-reserved-file-mtime\[ga] in file metadata. -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| SP | 0x20 | \[u2420] | +To ensure compatibility with gsutil, rclone stores modification time in 2 separate metadata entries. +\[ga]mtime\[ga] uses RFC3339 format with one-nanosecond precision. +\[ga]goog-reserved-file-mtime\[ga] uses Unix timestamp format with one-second precision. +To get modification time from object metadata, rclone reads the metadata in the following order: \[ga]mtime\[ga], \[ga]goog-reserved-file-mtime\[ga], object updated time. -Not all FTP servers can have all characters in file names, for example: +Note that rclone\[aq]s default modify window is 1ns. +Files uploaded by gsutil only contain timestamps with one-second precision. +If you use rclone to sync files previously uploaded by gsutil, +rclone will attempt to update modification time for all these files. +To avoid these possibly unnecessary updates, use \[ga]--modify-window 1s\[ga]. -| FTP Server| Forbidden characters | -| --------- |:--------------------:| -| proftpd | \[ga]*\[ga] | -| pureftpd | \[ga]\[rs] [ ]\[ga] | +### Restricted filename characters -This backend\[aq]s interactive configuration wizard provides a selection of -sensible encoding settings for major FTP servers: ProFTPd, PureFTPd, VsFTPd. -Just hit a selection number when prompted. +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| NUL | 0x00 | \[u2400] | +| LF | 0x0A | \[u240A] | +| CR | 0x0D | \[u240D] | +| / | 0x2F | \[uFF0F] | + +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can\[aq]t be used in JSON strings. ### Standard options -Here are the Standard options specific to ftp (FTP). +Here are the Standard options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)). -#### --ftp-host +#### --gcs-client-id -FTP host to connect to. +OAuth Client Id. -E.g. \[dq]ftp.example.com\[dq]. +Leave blank normally. Properties: -- Config: host -- Env Var: RCLONE_FTP_HOST +- Config: client_id +- Env Var: RCLONE_GCS_CLIENT_ID - Type: string -- Required: true +- Required: false -#### --ftp-user +#### --gcs-client-secret -FTP username. +OAuth Client Secret. + +Leave blank normally. Properties: -- Config: user -- Env Var: RCLONE_FTP_USER +- Config: client_secret +- Env Var: RCLONE_GCS_CLIENT_SECRET - Type: string -- Default: \[dq]$USER\[dq] +- Required: false -#### --ftp-port +#### --gcs-project-number -FTP port number. +Project number. + +Optional - needed only for list/create/delete buckets - see your developer console. Properties: -- Config: port -- Env Var: RCLONE_FTP_PORT -- Type: int -- Default: 21 +- Config: project_number +- Env Var: RCLONE_GCS_PROJECT_NUMBER +- Type: string +- Required: false -#### --ftp-pass +#### --gcs-user-project -FTP password. +User project. -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +Optional - needed only for requester pays. Properties: -- Config: pass -- Env Var: RCLONE_FTP_PASS +- Config: user_project +- Env Var: RCLONE_GCS_USER_PROJECT - Type: string - Required: false -#### --ftp-tls +#### --gcs-service-account-file -Use Implicit FTPS (FTP over TLS). +Service Account Credentials JSON file path. -When using implicit FTP over TLS the client connects using TLS -right from the start which breaks compatibility with -non-TLS-aware servers. This is usually served over port 990 rather -than port 21. Cannot be used in combination with explicit FTPS. +Leave blank normally. +Needed only if you want use SA instead of interactive login. + +Leading \[ga]\[ti]\[ga] will be expanded in the file name as will environment variables such as \[ga]${RCLONE_CONFIG_DIR}\[ga]. Properties: -- Config: tls -- Env Var: RCLONE_FTP_TLS -- Type: bool -- Default: false +- Config: service_account_file +- Env Var: RCLONE_GCS_SERVICE_ACCOUNT_FILE +- Type: string +- Required: false -#### --ftp-explicit-tls +#### --gcs-service-account-credentials -Use Explicit FTPS (FTP over TLS). +Service Account Credentials JSON blob. -When using explicit FTP over TLS the client explicitly requests -security from the server in order to upgrade a plain text connection -to an encrypted one. Cannot be used in combination with implicit FTPS. +Leave blank normally. +Needed only if you want use SA instead of interactive login. Properties: -- Config: explicit_tls -- Env Var: RCLONE_FTP_EXPLICIT_TLS -- Type: bool -- Default: false - -### Advanced options - -Here are the Advanced options specific to ftp (FTP). - -#### --ftp-concurrency +- Config: service_account_credentials +- Env Var: RCLONE_GCS_SERVICE_ACCOUNT_CREDENTIALS +- Type: string +- Required: false -Maximum number of FTP simultaneous connections, 0 for unlimited. +#### --gcs-anonymous -Note that setting this is very likely to cause deadlocks so it should -be used with care. +Access public buckets and objects without credentials. -If you are doing a sync or copy then make sure concurrency is one more -than the sum of \[ga]--transfers\[ga] and \[ga]--checkers\[ga]. +Set to \[aq]true\[aq] if you just want to download files and don\[aq]t configure credentials. -If you use \[ga]--check-first\[ga] then it just needs to be one more than the -maximum of \[ga]--checkers\[ga] and \[ga]--transfers\[ga]. +Properties: -So for \[ga]concurrency 3\[ga] you\[aq]d use \[ga]--checkers 2 --transfers 2 ---check-first\[ga] or \[ga]--checkers 1 --transfers 1\[ga]. +- Config: anonymous +- Env Var: RCLONE_GCS_ANONYMOUS +- Type: bool +- Default: false +#### --gcs-object-acl +Access Control List for new objects. Properties: -- Config: concurrency -- Env Var: RCLONE_FTP_CONCURRENCY -- Type: int -- Default: 0 +- Config: object_acl +- Env Var: RCLONE_GCS_OBJECT_ACL +- Type: string +- Required: false +- Examples: + - \[dq]authenticatedRead\[dq] + - Object owner gets OWNER access. + - All Authenticated Users get READER access. + - \[dq]bucketOwnerFullControl\[dq] + - Object owner gets OWNER access. + - Project team owners get OWNER access. + - \[dq]bucketOwnerRead\[dq] + - Object owner gets OWNER access. + - Project team owners get READER access. + - \[dq]private\[dq] + - Object owner gets OWNER access. + - Default if left blank. + - \[dq]projectPrivate\[dq] + - Object owner gets OWNER access. + - Project team members get access according to their roles. + - \[dq]publicRead\[dq] + - Object owner gets OWNER access. + - All Users get READER access. -#### --ftp-no-check-certificate +#### --gcs-bucket-acl -Do not verify the TLS certificate of the server. +Access Control List for new buckets. Properties: -- Config: no_check_certificate -- Env Var: RCLONE_FTP_NO_CHECK_CERTIFICATE -- Type: bool -- Default: false +- Config: bucket_acl +- Env Var: RCLONE_GCS_BUCKET_ACL +- Type: string +- Required: false +- Examples: + - \[dq]authenticatedRead\[dq] + - Project team owners get OWNER access. + - All Authenticated Users get READER access. + - \[dq]private\[dq] + - Project team owners get OWNER access. + - Default if left blank. + - \[dq]projectPrivate\[dq] + - Project team members get access according to their roles. + - \[dq]publicRead\[dq] + - Project team owners get OWNER access. + - All Users get READER access. + - \[dq]publicReadWrite\[dq] + - Project team owners get OWNER access. + - All Users get WRITER access. -#### --ftp-disable-epsv +#### --gcs-bucket-policy-only -Disable using EPSV even if server advertises support. +Access checks should use bucket-level IAM policies. -Properties: +If you want to upload objects to a bucket with Bucket Policy Only set +then you will need to set this. -- Config: disable_epsv -- Env Var: RCLONE_FTP_DISABLE_EPSV -- Type: bool -- Default: false +When it is set, rclone: -#### --ftp-disable-mlsd +- ignores ACLs set on buckets +- ignores ACLs set on objects +- creates buckets with Bucket Policy Only set + +Docs: https://cloud.google.com/storage/docs/bucket-policy-only -Disable using MLSD even if server advertises support. Properties: -- Config: disable_mlsd -- Env Var: RCLONE_FTP_DISABLE_MLSD +- Config: bucket_policy_only +- Env Var: RCLONE_GCS_BUCKET_POLICY_ONLY - Type: bool - Default: false -#### --ftp-disable-utf8 +#### --gcs-location -Disable using UTF-8 even if server advertises support. +Location for the newly created buckets. Properties: -- Config: disable_utf8 -- Env Var: RCLONE_FTP_DISABLE_UTF8 -- Type: bool -- Default: false +- Config: location +- Env Var: RCLONE_GCS_LOCATION +- Type: string +- Required: false +- Examples: + - \[dq]\[dq] + - Empty for default location (US) + - \[dq]asia\[dq] + - Multi-regional location for Asia + - \[dq]eu\[dq] + - Multi-regional location for Europe + - \[dq]us\[dq] + - Multi-regional location for United States + - \[dq]asia-east1\[dq] + - Taiwan + - \[dq]asia-east2\[dq] + - Hong Kong + - \[dq]asia-northeast1\[dq] + - Tokyo + - \[dq]asia-northeast2\[dq] + - Osaka + - \[dq]asia-northeast3\[dq] + - Seoul + - \[dq]asia-south1\[dq] + - Mumbai + - \[dq]asia-south2\[dq] + - Delhi + - \[dq]asia-southeast1\[dq] + - Singapore + - \[dq]asia-southeast2\[dq] + - Jakarta + - \[dq]australia-southeast1\[dq] + - Sydney + - \[dq]australia-southeast2\[dq] + - Melbourne + - \[dq]europe-north1\[dq] + - Finland + - \[dq]europe-west1\[dq] + - Belgium + - \[dq]europe-west2\[dq] + - London + - \[dq]europe-west3\[dq] + - Frankfurt + - \[dq]europe-west4\[dq] + - Netherlands + - \[dq]europe-west6\[dq] + - Z\[:u]rich + - \[dq]europe-central2\[dq] + - Warsaw + - \[dq]us-central1\[dq] + - Iowa + - \[dq]us-east1\[dq] + - South Carolina + - \[dq]us-east4\[dq] + - Northern Virginia + - \[dq]us-west1\[dq] + - Oregon + - \[dq]us-west2\[dq] + - California + - \[dq]us-west3\[dq] + - Salt Lake City + - \[dq]us-west4\[dq] + - Las Vegas + - \[dq]northamerica-northeast1\[dq] + - Montr\['e]al + - \[dq]northamerica-northeast2\[dq] + - Toronto + - \[dq]southamerica-east1\[dq] + - S\[~a]o Paulo + - \[dq]southamerica-west1\[dq] + - Santiago + - \[dq]asia1\[dq] + - Dual region: asia-northeast1 and asia-northeast2. + - \[dq]eur4\[dq] + - Dual region: europe-north1 and europe-west4. + - \[dq]nam4\[dq] + - Dual region: us-central1 and us-east1. -#### --ftp-writing-mdtm +#### --gcs-storage-class -Use MDTM to set modification time (VsFtpd quirk) +The storage class to use when storing objects in Google Cloud Storage. Properties: -- Config: writing_mdtm -- Env Var: RCLONE_FTP_WRITING_MDTM -- Type: bool -- Default: false +- Config: storage_class +- Env Var: RCLONE_GCS_STORAGE_CLASS +- Type: string +- Required: false +- Examples: + - \[dq]\[dq] + - Default + - \[dq]MULTI_REGIONAL\[dq] + - Multi-regional storage class + - \[dq]REGIONAL\[dq] + - Regional storage class + - \[dq]NEARLINE\[dq] + - Nearline storage class + - \[dq]COLDLINE\[dq] + - Coldline storage class + - \[dq]ARCHIVE\[dq] + - Archive storage class + - \[dq]DURABLE_REDUCED_AVAILABILITY\[dq] + - Durable reduced availability storage class -#### --ftp-force-list-hidden +#### --gcs-env-auth -Use LIST -a to force listing of hidden files and folders. This will disable the use of MLSD. +Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars). + +Only applies if service_account_file and service_account_credentials is blank. Properties: -- Config: force_list_hidden -- Env Var: RCLONE_FTP_FORCE_LIST_HIDDEN +- Config: env_auth +- Env Var: RCLONE_GCS_ENV_AUTH - Type: bool - Default: false +- Examples: + - \[dq]false\[dq] + - Enter credentials in the next step. + - \[dq]true\[dq] + - Get GCP IAM credentials from the environment (env vars or IAM). -#### --ftp-idle-timeout - -Max time before closing idle connections. +### Advanced options -If no connections have been returned to the connection pool in the time -given, rclone will empty the connection pool. +Here are the Advanced options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)). -Set to 0 to keep connections indefinitely. +#### --gcs-token +OAuth Access Token as a JSON blob. Properties: -- Config: idle_timeout -- Env Var: RCLONE_FTP_IDLE_TIMEOUT -- Type: Duration -- Default: 1m0s +- Config: token +- Env Var: RCLONE_GCS_TOKEN +- Type: string +- Required: false -#### --ftp-close-timeout +#### --gcs-auth-url -Maximum time to wait for a response to close. +Auth server URL. + +Leave blank to use the provider defaults. Properties: -- Config: close_timeout -- Env Var: RCLONE_FTP_CLOSE_TIMEOUT -- Type: Duration -- Default: 1m0s +- Config: auth_url +- Env Var: RCLONE_GCS_AUTH_URL +- Type: string +- Required: false -#### --ftp-tls-cache-size +#### --gcs-token-url -Size of TLS session cache for all control and data connections. +Token server url. -TLS cache allows to resume TLS sessions and reuse PSK between connections. -Increase if default size is not enough resulting in TLS resumption errors. -Enabled by default. Use 0 to disable. +Leave blank to use the provider defaults. Properties: -- Config: tls_cache_size -- Env Var: RCLONE_FTP_TLS_CACHE_SIZE -- Type: int -- Default: 32 +- Config: token_url +- Env Var: RCLONE_GCS_TOKEN_URL +- Type: string +- Required: false -#### --ftp-disable-tls13 +#### --gcs-directory-markers + +Upload an empty object with a trailing slash when a new directory is created + +Empty folders are unsupported for bucket based remotes, this option creates an empty +object ending with \[dq]/\[dq], to persist the folder. -Disable TLS 1.3 (workaround for FTP servers with buggy TLS) Properties: -- Config: disable_tls13 -- Env Var: RCLONE_FTP_DISABLE_TLS13 +- Config: directory_markers +- Env Var: RCLONE_GCS_DIRECTORY_MARKERS - Type: bool - Default: false -#### --ftp-shut-timeout +#### --gcs-no-check-bucket + +If set, don\[aq]t attempt to check the bucket exists or create it. + +This can be useful when trying to minimise the number of transactions +rclone does if you know the bucket exists already. -Maximum time to wait for data connection closing status. Properties: -- Config: shut_timeout -- Env Var: RCLONE_FTP_SHUT_TIMEOUT -- Type: Duration -- Default: 1m0s +- Config: no_check_bucket +- Env Var: RCLONE_GCS_NO_CHECK_BUCKET +- Type: bool +- Default: false -#### --ftp-ask-password +#### --gcs-decompress -Allow asking for FTP password when needed. +If set this will decompress gzip encoded objects. -If this is set and no password is supplied then rclone will ask for a password +It is possible to upload objects to GCS with \[dq]Content-Encoding: gzip\[dq] +set. Normally rclone will download these files as compressed objects. + +If this flag is set then rclone will decompress these files with +\[dq]Content-Encoding: gzip\[dq] as they are received. This means that rclone +can\[aq]t check the size and hash but the file contents will be decompressed. Properties: -- Config: ask_password -- Env Var: RCLONE_FTP_ASK_PASSWORD +- Config: decompress +- Env Var: RCLONE_GCS_DECOMPRESS - Type: bool - Default: false -#### --ftp-socks-proxy +#### --gcs-endpoint -Socks 5 proxy host. - - Supports the format user:pass\[at]host:port, user\[at]host:port, host:port. - - Example: - - myUser:myPass\[at]localhost:9005 - +Endpoint for the service. + +Leave blank normally. Properties: -- Config: socks_proxy -- Env Var: RCLONE_FTP_SOCKS_PROXY +- Config: endpoint +- Env Var: RCLONE_GCS_ENDPOINT - Type: string - Required: false -#### --ftp-encoding +#### --gcs-encoding The encoding for the backend. @@ -41195,78 +40838,30 @@ See the [encoding section in the overview](https://rclone.org/overview/#encoding Properties: - Config: encoding -- Env Var: RCLONE_FTP_ENCODING -- Type: MultiEncoder -- Default: Slash,Del,Ctl,RightSpace,Dot -- Examples: - - \[dq]Asterisk,Ctl,Dot,Slash\[dq] - - ProFTPd can\[aq]t handle \[aq]*\[aq] in file names - - \[dq]BackSlash,Ctl,Del,Dot,RightSpace,Slash,SquareBracket\[dq] - - PureFTPd can\[aq]t handle \[aq][]\[aq] or \[aq]*\[aq] in file names - - \[dq]Ctl,LeftPeriod,Slash\[dq] - - VsFTPd can\[aq]t handle file names starting with dot +- Env Var: RCLONE_GCS_ENCODING +- Type: Encoding +- Default: Slash,CrLf,InvalidUtf8,Dot ## Limitations -FTP servers acting as rclone remotes must support \[ga]passive\[ga] mode. -The mode cannot be configured as \[ga]passive\[ga] is the only supported one. -Rclone\[aq]s FTP implementation is not compatible with \[ga]active\[ga] mode -as [the library it uses doesn\[aq]t support it](https://github.com/jlaffaye/ftp/issues/29). -This will likely never be supported due to security concerns. - -Rclone\[aq]s FTP backend does not support any checksums but can compare -file sizes. - -\[ga]rclone about\[ga] is not supported by the FTP backend. Backends without +\[ga]rclone about\[ga] is not supported by the Google Cloud Storage backend. Backends without this capability cannot determine free space for an rclone mount or use policy \[ga]mfs\[ga] (most free space) as a member of an rclone union remote. See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -The implementation of : \[ga]--dump headers\[ga], -\[ga]--dump bodies\[ga], \[ga]--dump auth\[ga] for debugging isn\[aq]t the same as -for rclone HTTP based backends - it has less fine grained control. - -\[ga]--timeout\[ga] isn\[aq]t supported (but \[ga]--contimeout\[ga] is). - -\[ga]--bind\[ga] isn\[aq]t supported. - -Rclone\[aq]s FTP backend could support server-side move but does not -at present. - -The \[ga]ftp_proxy\[ga] environment variable is not currently supported. - -#### Modified time - -File modification time (timestamps) is supported to 1 second resolution -for major FTP servers: ProFTPd, PureFTPd, VsFTPd, and FileZilla FTP server. -The \[ga]VsFTPd\[ga] server has non-standard implementation of time related protocol -commands and needs a special configuration setting: \[ga]writing_mdtm = true\[ga]. - -Support for precise file time with other FTP servers varies depending on what -protocol extensions they advertise. If all the \[ga]MLSD\[ga], \[ga]MDTM\[ga] and \[ga]MFTM\[ga] -extensions are present, rclone will use them together to provide precise time. -Otherwise the times you see on the FTP server through rclone are those of the -last file upload. - -You can use the following command to check whether rclone can use precise time -with your FTP server: \[ga]rclone backend features your_ftp_remote:\[ga] (the trailing -colon is important). Look for the number in the line tagged by \[ga]Precision\[ga] -designating the remote time precision expressed as nanoseconds. A value of -\[ga]1000000000\[ga] means that file time precision of 1 second is available. -A value of \[ga]3153600000000000000\[ga] (or another large number) means \[dq]unsupported\[dq]. +# Google Drive -# Google Cloud Storage +Paths are specified as \[ga]drive:path\[ga] -Paths are specified as \[ga]remote:bucket\[ga] (or \[ga]remote:\[ga] for the \[ga]lsd\[ga] -command.) You may put subdirectories in too, e.g. \[ga]remote:bucket/path/to/dir\[ga]. +Drive paths may be as deep as required, e.g. \[ga]drive:directory/subdirectory\[ga]. ## Configuration -The initial setup for google cloud storage involves getting a token from Google Cloud Storage +The initial setup for drive involves getting a token from Google drive which you need to do in your browser. \[ga]rclone config\[ga] walks you through it. @@ -41277,95 +40872,48 @@ Here is an example of how to make a remote called \[ga]remote\[ga]. First run: This will guide you through an interactive setup process: \f[R] .fi -.IP "n)" 3 -New remote -.IP "o)" 3 -Delete remote -.IP "p)" 3 -Quit config e/n/d/q> n name> remote Type of storage to configure. +.PP +No remotes found, make a new one? +n) New remote r) Rename remote c) Copy remote s) Set configuration +password q) Quit config n/r/c/s/q> n name> remote Type of storage to +configure. Choose a number from below, or type in your own value [snip] XX / Google -Cloud Storage (this is not Google Drive) \ \[dq]google cloud -storage\[dq] [snip] Storage> google cloud storage Google Application -Client Id - leave blank normally. +Drive \ \[dq]drive\[dq] [snip] Storage> drive Google Application Client +Id - leave blank normally. client_id> Google Application Client Secret - leave blank normally. -client_secret> Project number optional - needed only for -list/create/delete buckets - see your developer console. -project_number> 12345678 Service Account Credentials JSON file path - -needed only if you want use SA instead of interactive login. -service_account_file> Access Control List for new objects. -Choose a number from below, or type in your own value 1 / Object owner -gets OWNER access, and all Authenticated Users get READER access. -\ \[dq]authenticatedRead\[dq] 2 / Object owner gets OWNER access, and -project team owners get OWNER access. -\ \[dq]bucketOwnerFullControl\[dq] 3 / Object owner gets OWNER access, -and project team owners get READER access. -\ \[dq]bucketOwnerRead\[dq] 4 / Object owner gets OWNER access [default -if left blank]. -\ \[dq]private\[dq] 5 / Object owner gets OWNER access, and project team -members get access according to their roles. -\ \[dq]projectPrivate\[dq] 6 / Object owner gets OWNER access, and all -Users get READER access. -\ \[dq]publicRead\[dq] object_acl> 4 Access Control List for new -buckets. -Choose a number from below, or type in your own value 1 / Project team -owners get OWNER access, and all Authenticated Users get READER access. -\ \[dq]authenticatedRead\[dq] 2 / Project team owners get OWNER access -[default if left blank]. -\ \[dq]private\[dq] 3 / Project team members get access according to -their roles. -\ \[dq]projectPrivate\[dq] 4 / Project team owners get OWNER access, and -all Users get READER access. -\ \[dq]publicRead\[dq] 5 / Project team owners get OWNER access, and all -Users get WRITER access. -\ \[dq]publicReadWrite\[dq] bucket_acl> 2 Location for the newly created -buckets. -Choose a number from below, or type in your own value 1 / Empty for -default location (US). -\ \[dq]\[dq] 2 / Multi-regional location for Asia. -\ \[dq]asia\[dq] 3 / Multi-regional location for Europe. -\ \[dq]eu\[dq] 4 / Multi-regional location for United States. -\ \[dq]us\[dq] 5 / Taiwan. -\ \[dq]asia-east1\[dq] 6 / Tokyo. -\ \[dq]asia-northeast1\[dq] 7 / Singapore. -\ \[dq]asia-southeast1\[dq] 8 / Sydney. -\ \[dq]australia-southeast1\[dq] 9 / Belgium. -\ \[dq]europe-west1\[dq] 10 / London. -\ \[dq]europe-west2\[dq] 11 / Iowa. -\ \[dq]us-central1\[dq] 12 / South Carolina. -\ \[dq]us-east1\[dq] 13 / Northern Virginia. -\ \[dq]us-east4\[dq] 14 / Oregon. -\ \[dq]us-west1\[dq] location> 12 The storage class to use when storing -objects in Google Cloud Storage. -Choose a number from below, or type in your own value 1 / Default -\ \[dq]\[dq] 2 / Multi-regional storage class \ \[dq]MULTI_REGIONAL\[dq] -3 / Regional storage class \ \[dq]REGIONAL\[dq] 4 / Nearline storage -class \ \[dq]NEARLINE\[dq] 5 / Coldline storage class -\ \[dq]COLDLINE\[dq] 6 / Durable reduced availability storage class -\ \[dq]DURABLE_REDUCED_AVAILABILITY\[dq] storage_class> 5 Remote config -Use web browser to automatically authenticate rclone with remote? -.IP \[bu] 2 -Say Y if the machine running rclone has a web browser you can use -.IP \[bu] 2 +client_secret> Scope that rclone should use when requesting access from +drive. +Choose a number from below, or type in your own value 1 / Full access +all files, excluding Application Data Folder. +\ \[dq]drive\[dq] 2 / Read-only access to file metadata and file +contents. +\ \[dq]drive.readonly\[dq] / Access to files created by rclone only. +3 | These are visible in the drive website. +| File authorization is revoked when the user deauthorizes the app. +\ \[dq]drive.file\[dq] / Allows read and write access to the Application +Data folder. +4 | This is not visible in the drive website. +\ \[dq]drive.appfolder\[dq] / Allows read-only access to file metadata +but 5 | does not allow any access to read or download file content. +\ \[dq]drive.metadata.readonly\[dq] scope> 1 Service Account Credentials +JSON file path - needed only if you want use SA instead of interactive +login. +service_account_file> Remote config Use web browser to automatically +authenticate rclone with remote? +* Say Y if the machine running rclone has a web browser you can use * Say N if running rclone on a (remote) machine without web browser access If not sure try Y. If Y failed, try N. -.IP "y)" 3 -Yes -.IP "z)" 3 -No y/n> y If your browser doesn\[aq]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] type = google cloud storage -client_id = client_secret = token = -{\[dq]AccessToken\[dq]:\[dq]xxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\[dq],\[dq]RefreshToken\[dq]:\[dq]x/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxx\[dq],\[dq]Expiry\[dq]:\[dq]2014-07-17T20:49:14.929208288+01:00\[dq],\[dq]Extra\[dq]:null} -project_number = 12345678 object_acl = private bucket_acl = private --------------------- -.IP "a)" 3 -Yes this is OK -.IP "b)" 3 -Edit this remote -.IP "c)" 3 -Delete this remote y/e/d> y +y) Yes n) No y/n> y If your browser doesn\[aq]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 Configure this as a Shared Drive (Team Drive)? +y) Yes n) No y/n> n -------------------- [remote] client_id = +client_secret = scope = drive root_folder_id = service_account_file = +token = +{\[dq]access_token\[dq]:\[dq]XXX\[dq],\[dq]token_type\[dq]:\[dq]Bearer\[dq],\[dq]refresh_token\[dq]:\[dq]XXX\[dq],\[dq]expiry\[dq]:\[dq]2014-03-16T13:57:58.955387075Z\[dq]} +-------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y .IP .nf \f[C] @@ -41376,150 +40924,477 @@ Note that rclone runs a webserver on your local machine to collect the token as returned from Google if using web browser to automatically authenticate. This only runs from the moment it opens your browser to the moment you get back -the verification code. This is on \[ga]http://127.0.0.1:53682/\[ga] and this -it may require you to unblock it temporarily if you are running a host +the verification code. This is on \[ga]http://127.0.0.1:53682/\[ga] and it +may require you to unblock it temporarily if you are running a host firewall, or use manual mode. -This remote is called \[ga]remote\[ga] and can now be used like this +You can then use it like this, + +List directories in top level of your drive + + rclone lsd remote: + +List all the files in your drive + + rclone ls remote: + +To copy a local directory to a drive directory called backup + + rclone copy /home/source remote:backup + +### Scopes + +Rclone allows you to select which scope you would like for rclone to +use. This changes what type of token is granted to rclone. [The +scopes are defined +here](https://developers.google.com/drive/v3/web/about-auth). + +A comma-separated list is allowed e.g. \[ga]drive.readonly,drive.file\[ga]. + +The scope are + +#### drive + +This is the default scope and allows full access to all files, except +for the Application Data Folder (see below). + +Choose this one if you aren\[aq]t sure. + +#### drive.readonly + +This allows read only access to all files. Files may be listed and +downloaded but not uploaded, renamed or deleted. + +#### drive.file + +With this scope rclone can read/view/modify only those files and +folders it creates. + +So if you uploaded files to drive via the web interface (or any other +means) they will not be visible to rclone. + +This can be useful if you are using rclone to backup data and you want +to be sure confidential data on your drive is not visible to rclone. + +Files created with this scope are visible in the web interface. + +#### drive.appfolder + +This gives rclone its own private area to store files. Rclone will +not be able to see any other files on your drive and you won\[aq]t be able +to see rclone\[aq]s files from the web interface either. + +#### drive.metadata.readonly + +This allows read only access to file names only. It does not allow +rclone to download or upload data, or rename or delete files or +directories. + +### Root folder ID + +This option has been moved to the advanced section. You can set the \[ga]root_folder_id\[ga] for rclone. This is the directory +(identified by its \[ga]Folder ID\[ga]) that rclone considers to be the root +of your drive. + +Normally you will leave this blank and rclone will determine the +correct root to use itself. + +However you can set this to restrict rclone to a specific folder +hierarchy or to access data within the \[dq]Computers\[dq] tab on the drive +web interface (where files from Google\[aq]s Backup and Sync desktop +program go). + +In order to do this you will have to find the \[ga]Folder ID\[ga] of the +directory you wish rclone to display. This will be the last segment +of the URL when you open the relevant folder in the drive web +interface. + +So if the folder you want rclone to use has a URL which looks like +\[ga]https://drive.google.com/drive/folders/1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh\[ga] +in the browser, then you use \[ga]1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh\[ga] as +the \[ga]root_folder_id\[ga] in the config. + +**NB** folders under the \[dq]Computers\[dq] tab seem to be read only (drive +gives a 500 error) when using rclone. + +There doesn\[aq]t appear to be an API to discover the folder IDs of the +\[dq]Computers\[dq] tab - please contact us if you know otherwise! + +Note also that rclone can\[aq]t access any data under the \[dq]Backups\[dq] tab on +the google drive web interface yet. + +### Service Account support + +You can set up rclone with Google Drive in an unattended mode, +i.e. not tied to a specific end-user Google account. This is useful +when you want to synchronise files onto machines that don\[aq]t have +actively logged-in users, for example build machines. + +To use a Service Account instead of OAuth2 token flow, enter the path +to your Service Account credentials at the \[ga]service_account_file\[ga] +prompt during \[ga]rclone config\[ga] and rclone won\[aq]t use the browser based +authentication flow. If you\[aq]d rather stuff the contents of the +credentials file into the rclone config file, you can set +\[ga]service_account_credentials\[ga] with the actual contents of the file +instead, or set the equivalent environment variable. + +#### Use case - Google Apps/G-suite account and individual Drive + +Let\[aq]s say that you are the administrator of a Google Apps (old) or +G-suite account. +The goal is to store data on an individual\[aq]s Drive account, who IS +a member of the domain. +We\[aq]ll call the domain **example.com**, and the user +**foo\[at]example.com**. + +There\[aq]s a few steps we need to go through to accomplish this: + +##### 1. Create a service account for example.com + - To create a service account and obtain its credentials, go to the +[Google Developer Console](https://console.developers.google.com). + - You must have a project - create one if you don\[aq]t. + - Then go to \[dq]IAM & admin\[dq] -> \[dq]Service Accounts\[dq]. + - Use the \[dq]Create Service Account\[dq] button. Fill in \[dq]Service account name\[dq] +and \[dq]Service account ID\[dq] with something that identifies your client. + - Select \[dq]Create And Continue\[dq]. Step 2 and 3 are optional. + - These credentials are what rclone will use for authentication. +If you ever need to remove access, press the \[dq]Delete service +account key\[dq] button. + +##### 2. Allowing API access to example.com Google Drive + - Go to example.com\[aq]s admin console + - Go into \[dq]Security\[dq] (or use the search bar) + - Select \[dq]Show more\[dq] and then \[dq]Advanced settings\[dq] + - Select \[dq]Manage API client access\[dq] in the \[dq]Authentication\[dq] section + - In the \[dq]Client Name\[dq] field enter the service account\[aq]s +\[dq]Client ID\[dq] - this can be found in the Developer Console under +\[dq]IAM & Admin\[dq] -> \[dq]Service Accounts\[dq], then \[dq]View Client ID\[dq] for +the newly created service account. +It is a \[ti]21 character numerical string. + - In the next field, \[dq]One or More API Scopes\[dq], enter +\[ga]https://www.googleapis.com/auth/drive\[ga] +to grant access to Google Drive specifically. + +##### 3. Configure rclone, assuming a new install +\f[R] +.fi +.PP +rclone config +.PP +n/s/q> n # New name>gdrive # Gdrive is an example name Storage> # Select +the number shown for Google Drive client_id> # Can be left blank +client_secret> # Can be left blank scope> # Select your scope, 1 for +example root_folder_id> # Can be left blank service_account_file> +/home/foo/myJSONfile.json # This is where the JSON file goes! y/n> # +Auto config, n +.IP +.nf +\f[C] +##### 4. Verify that it\[aq]s working + - \[ga]rclone -v --drive-impersonate foo\[at]example.com lsf gdrive:backup\[ga] + - The arguments do: + - \[ga]-v\[ga] - verbose logging + - \[ga]--drive-impersonate foo\[at]example.com\[ga] - this is what does +the magic, pretending to be user foo. + - \[ga]lsf\[ga] - list files in a parsing friendly way + - \[ga]gdrive:backup\[ga] - use the remote called gdrive, work in +the folder named backup. + +Note: in case you configured a specific root folder on gdrive and rclone is unable to access the contents of that folder when using \[ga]--drive-impersonate\[ga], do this instead: + - in the gdrive web interface, share your root folder with the user/email of the new Service Account you created/selected at step #1 + - use rclone without specifying the \[ga]--drive-impersonate\[ga] option, like this: + \[ga]rclone -v lsf gdrive:backup\[ga] + + +### Shared drives (team drives) + +If you want to configure the remote to point to a Google Shared Drive +(previously known as Team Drives) then answer \[ga]y\[ga] to the question +\[ga]Configure this as a Shared Drive (Team Drive)?\[ga]. + +This will fetch the list of Shared Drives from google and allow you to +configure which one you want to use. You can also type in a Shared +Drive ID if you prefer. + +For example: +\f[R] +.fi +.PP +Configure this as a Shared Drive (Team Drive)? +y) Yes n) No y/n> y Fetching Shared Drive list... +Choose a number from below, or type in your own value 1 / Rclone Test +\ \[dq]xxxxxxxxxxxxxxxxxxxx\[dq] 2 / Rclone Test 2 +\ \[dq]yyyyyyyyyyyyyyyyyyyy\[dq] 3 / Rclone Test 3 +\ \[dq]zzzzzzzzzzzzzzzzzzzz\[dq] Enter a Shared Drive ID> 1 +-------------------- [remote] client_id = client_secret = token = +{\[dq]AccessToken\[dq]:\[dq]xxxx.x.xxxxx_xxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\[dq],\[dq]RefreshToken\[dq]:\[dq]1/xxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxx\[dq],\[dq]Expiry\[dq]:\[dq]2014-03-16T13:57:58.955387075Z\[dq],\[dq]Extra\[dq]:null} +team_drive = xxxxxxxxxxxxxxxxxxxx -------------------- y) Yes this is OK +e) Edit this remote d) Delete this remote y/e/d> y +.IP +.nf +\f[C] +### --fast-list + +This remote supports \[ga]--fast-list\[ga] which allows you to use fewer +transactions in exchange for more memory. See the [rclone +docs](https://rclone.org/docs/#fast-list) for more details. + +It does this by combining multiple \[ga]list\[ga] calls into a single API request. + +This works by combining many \[ga]\[aq]%s\[aq] in parents\[ga] filters into one expression. +To list the contents of directories a, b and c, the following requests will be send by the regular \[ga]List\[ga] function: +\f[R] +.fi +.PP +trashed=false and \[aq]a\[aq] in parents trashed=false and \[aq]b\[aq] +in parents trashed=false and \[aq]c\[aq] in parents +.IP +.nf +\f[C] +These can now be combined into a single request: +\f[R] +.fi +.PP +trashed=false and (\[aq]a\[aq] in parents or \[aq]b\[aq] in parents or +\[aq]c\[aq] in parents) +.IP +.nf +\f[C] +The implementation of \[ga]ListR\[ga] will put up to 50 \[ga]parents\[ga] filters into one request. +It will use the \[ga]--checkers\[ga] value to specify the number of requests to run in parallel. + +In tests, these batch requests were up to 20x faster than the regular method. +Running the following command against different sized folders gives: +\f[R] +.fi +.PP +rclone lsjson -vv -R --checkers=6 gdrive:folder +.IP +.nf +\f[C] +small folder (220 directories, 700 files): + +- without \[ga]--fast-list\[ga]: 38s +- with \[ga]--fast-list\[ga]: 10s + +large folder (10600 directories, 39000 files): + +- without \[ga]--fast-list\[ga]: 22:05 min +- with \[ga]--fast-list\[ga]: 58s + +### Modification times and hashes + +Google drive stores modification times accurate to 1 ms. + +Hash algorithms MD5, SHA1 and SHA256 are supported. Note, however, +that a small fraction of files uploaded may not have SHA1 or SHA256 +hashes especially if they were uploaded before 2018. + +### Restricted filename characters + +Only Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can\[aq]t be used in JSON strings. + +In contrast to other backends, \[ga]/\[ga] can also be used in names and \[ga].\[ga] +or \[ga]..\[ga] are valid names. + +### Revisions + +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. + +Revisions follow the standard google policy which at time of writing +was + + * They are deleted after 30 days or 100 revisions (whatever comes first). + * They do not count towards a user storage quota. + +### Deleting files + +By default rclone will send all files to the trash when deleting +files. If deleting them permanently is required then use the +\[ga]--drive-use-trash=false\[ga] flag, or set the equivalent environment +variable. -See all the buckets in your project +### Shortcuts - rclone lsd remote: +In March 2020 Google introduced a new feature in Google Drive called +[drive shortcuts](https://support.google.com/drive/answer/9700156) +([API](https://developers.google.com/drive/api/v3/shortcuts)). These +will (by September 2020) [replace the ability for files or folders to +be in multiple folders at once](https://cloud.google.com/blog/products/g-suite/simplifying-google-drives-folder-structure-and-sharing-models). -Make a new bucket +Shortcuts are files that link to other files on Google Drive somewhat +like a symlink in unix, except they point to the underlying file data +(e.g. the inode in unix terms) so they don\[aq]t break if the source is +renamed or moved about. - rclone mkdir remote:bucket +By default rclone treats these as follows. -List the contents of a bucket +For shortcuts pointing to files: - rclone ls remote:bucket +- When listing a file shortcut appears as the destination file. +- When downloading the contents of the destination file is downloaded. +- When updating shortcut file with a non shortcut file, the shortcut is removed then a new file is uploaded in place of the shortcut. +- When server-side moving (renaming) the shortcut is renamed, not the destination file. +- When server-side copying the shortcut is copied, not the contents of the shortcut. (unless \[ga]--drive-copy-shortcut-content\[ga] is in use in which case the contents of the shortcut gets copied). +- When deleting the shortcut is deleted not the linked file. +- When setting the modification time, the modification time of the linked file will be set. -Sync \[ga]/home/local/directory\[ga] to the remote bucket, deleting any excess -files in the bucket. +For shortcuts pointing to folders: - rclone sync --interactive /home/local/directory remote:bucket +- When listing the shortcut appears as a folder and that folder will contain the contents of the linked folder appear (including any sub folders) +- When downloading the contents of the linked folder and sub contents are downloaded +- When uploading to a shortcut folder the file will be placed in the linked folder +- When server-side moving (renaming) the shortcut is renamed, not the destination folder +- When server-side copying the contents of the linked folder is copied, not the shortcut. +- When deleting with \[ga]rclone rmdir\[ga] or \[ga]rclone purge\[ga] the shortcut is deleted not the linked folder. +- **NB** When deleting with \[ga]rclone remove\[ga] or \[ga]rclone mount\[ga] the contents of the linked folder will be deleted. -### Service Account support +The [rclone backend](https://rclone.org/commands/rclone_backend/) command can be used to create shortcuts. -You can set up rclone with Google Cloud Storage in an unattended mode, -i.e. not tied to a specific end-user Google account. This is useful -when you want to synchronise files onto machines that don\[aq]t have -actively logged-in users, for example build machines. +Shortcuts can be completely ignored with the \[ga]--drive-skip-shortcuts\[ga] flag +or the corresponding \[ga]skip_shortcuts\[ga] configuration setting. -To get credentials for Google Cloud Platform -[IAM Service Accounts](https://cloud.google.com/iam/docs/service-accounts), -please head to the -[Service Account](https://console.cloud.google.com/permissions/serviceaccounts) -section of the Google Developer Console. Service Accounts behave just -like normal \[ga]User\[ga] permissions in -[Google Cloud Storage ACLs](https://cloud.google.com/storage/docs/access-control), -so you can limit their access (e.g. make them read only). After -creating an account, a JSON file containing the Service Account\[aq]s -credentials will be downloaded onto your machines. These credentials -are what rclone will use for authentication. +### Emptying trash -To use a Service Account instead of OAuth2 token flow, enter the path -to your Service Account credentials at the \[ga]service_account_file\[ga] -prompt and rclone won\[aq]t use the browser based authentication -flow. If you\[aq]d rather stuff the contents of the credentials file into -the rclone config file, you can set \[ga]service_account_credentials\[ga] with -the actual contents of the file instead, or set the equivalent -environment variable. +If you wish to empty your trash you can use the \[ga]rclone cleanup remote:\[ga] +command which will permanently delete all your trashed files. This command +does not take any path arguments. -### Anonymous Access +Note that Google Drive takes some time (minutes to days) to empty the +trash even though the command returns within a few seconds. No output +is echoed, so there will be no confirmation even using -v or -vv. -For downloads of objects that permit public access you can configure rclone -to use anonymous access by setting \[ga]anonymous\[ga] to \[ga]true\[ga]. -With unauthorized access you can\[aq]t write or create files but only read or list -those buckets and objects that have public read access. +### Quota information -### Application Default Credentials +To view your current quota you can use the \[ga]rclone about remote:\[ga] +command which will display your usage limit (quota), the usage in Google +Drive, the size of all files in the Trash and the space used by other +Google services such as Gmail. This command does not take any path +arguments. -If no other source of credentials is provided, rclone will fall back -to -[Application Default Credentials](https://cloud.google.com/video-intelligence/docs/common/auth#authenticating_with_application_default_credentials) -this is useful both when you already have configured authentication -for your developer account, or in production when running on a google -compute host. Note that if running in docker, you may need to run -additional commands on your google compute machine - -[see this page](https://cloud.google.com/container-registry/docs/advanced-authentication#gcloud_as_a_docker_credential_helper). +#### Import/Export of google documents -Note that in the case application default credentials are used, there -is no need to explicitly configure a project number. +Google documents can be exported from and uploaded to Google Drive. -### --fast-list +When rclone downloads a Google doc it chooses a format to download +depending upon the \[ga]--drive-export-formats\[ga] setting. +By default the export formats are \[ga]docx,xlsx,pptx,svg\[ga] which are a +sensible default for an editable document. -This remote supports \[ga]--fast-list\[ga] which allows you to use fewer -transactions in exchange for more memory. See the [rclone -docs](https://rclone.org/docs/#fast-list) for more details. +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\[aq]t be exported to a format on the formats list, +then rclone will choose a format from the default list. -### Custom upload headers +If you prefer an archive copy then you might use \[ga]--drive-export-formats +pdf\[ga], or if you prefer openoffice/libreoffice formats you might use +\[ga]--drive-export-formats ods,odt,odp\[ga]. -You can set custom upload headers with the \[ga]--header-upload\[ga] -flag. Google Cloud Storage supports the headers as described in the -[working with metadata documentation](https://cloud.google.com/storage/docs/gsutil/addlhelp/WorkingWithObjectMetadata) +Note that rclone adds the extension to the google doc, so if it is +called \[ga]My Spreadsheet\[ga] on google docs, it will be exported as \[ga]My +Spreadsheet.xlsx\[ga] or \[ga]My Spreadsheet.pdf\[ga] etc. -- Cache-Control -- Content-Disposition -- Content-Encoding -- Content-Language -- Content-Type -- X-Goog-Storage-Class -- X-Goog-Meta- +When importing files into Google Drive, rclone will convert all +files with an extension in \[ga]--drive-import-formats\[ga] to their +associated document type. +rclone will not convert any files by default, since the conversion +is lossy process. -Eg \[ga]--header-upload \[dq]Content-Type text/potato\[dq]\[ga] +The conversion must result in a file with the same extension when +the \[ga]--drive-export-formats\[ga] rules are applied to the uploaded document. -Note that the last of these is for setting custom metadata in the form -\[ga]--header-upload \[dq]x-goog-meta-key: value\[dq]\[ga] +Here are some examples for allowed and prohibited conversions. -### Modification time +| export-formats | import-formats | Upload Ext | Document Ext | Allowed | +| -------------- | -------------- | ---------- | ------------ | ------- | +| odt | odt | odt | odt | Yes | +| odt | docx,odt | odt | odt | Yes | +| | docx | docx | docx | Yes | +| | odt | odt | docx | No | +| odt,docx | docx,odt | docx | odt | No | +| docx,odt | docx,odt | docx | docx | Yes | +| docx,odt | docx,odt | odt | docx | No | -Google Cloud Storage stores md5sum natively. -Google\[aq]s [gsutil](https://cloud.google.com/storage/docs/gsutil) tool stores modification time -with one-second precision as \[ga]goog-reserved-file-mtime\[ga] in file metadata. +This limitation can be disabled by specifying \[ga]--drive-allow-import-name-change\[ga]. +When using this flag, rclone can convert multiple files types resulting +in the same document type at once, e.g. with \[ga]--drive-import-formats docx,odt,txt\[ga], +all files having these extension would result in a document represented as a docx file. +This brings the additional risk of overwriting a document, if multiple files +have the same stem. Many rclone operations will not handle this name change +in any way. They assume an equal name when copying files and might copy the +file again or delete them when the name changes. -To ensure compatibility with gsutil, rclone stores modification time in 2 separate metadata entries. -\[ga]mtime\[ga] uses RFC3339 format with one-nanosecond precision. -\[ga]goog-reserved-file-mtime\[ga] uses Unix timestamp format with one-second precision. -To get modification time from object metadata, rclone reads the metadata in the following order: \[ga]mtime\[ga], \[ga]goog-reserved-file-mtime\[ga], object updated time. +Here are the possible export extensions with their corresponding mime types. +Most of these can also be used for importing, but there more that are not +listed here. Some of these additional ones might only be available when +the operating system provides the correct MIME type entries. -Note that rclone\[aq]s default modify window is 1ns. -Files uploaded by gsutil only contain timestamps with one-second precision. -If you use rclone to sync files previously uploaded by gsutil, -rclone will attempt to update modification time for all these files. -To avoid these possibly unnecessary updates, use \[ga]--modify-window 1s\[ga]. +This list can be changed by Google Drive at any time and might not +represent the currently available conversions. -### Restricted filename characters +| Extension | Mime Type | Description | +| --------- |-----------| ------------| +| bmp | image/bmp | Windows Bitmap format | +| csv | text/csv | Standard CSV format for Spreadsheets | +| doc | application/msword | Classic Word file | +| docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document | Microsoft Office Document | +| epub | application/epub+zip | E-book format | +| html | text/html | An HTML Document | +| jpg | image/jpeg | A JPEG Image File | +| json | application/vnd.google-apps.script+json | JSON Text Format for Google Apps scripts | +| odp | application/vnd.oasis.opendocument.presentation | Openoffice Presentation | +| ods | application/vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet | +| ods | application/x-vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet | +| odt | application/vnd.oasis.opendocument.text | Openoffice Document | +| pdf | application/pdf | Adobe PDF Format | +| pjpeg | image/pjpeg | Progressive JPEG Image | +| png | image/png | PNG Image Format| +| pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation | Microsoft Office Powerpoint | +| rtf | application/rtf | Rich Text Format | +| svg | image/svg+xml | Scalable Vector Graphics Format | +| tsv | text/tab-separated-values | Standard TSV format for spreadsheets | +| txt | text/plain | Plain Text | +| wmf | application/x-msmetafile | Windows Meta File | +| xls | application/vnd.ms-excel | Classic Excel file | +| xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | Microsoft Office Spreadsheet | +| zip | application/zip | A ZIP file of HTML, Images CSS | -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| NUL | 0x00 | \[u2400] | -| LF | 0x0A | \[u240A] | -| CR | 0x0D | \[u240D] | -| / | 0x2F | \[uFF0F] | +Google documents can also be exported as link files. These files will +open a browser window for the Google Docs website of that document +when opened. The link file extension has to be specified as a +\[ga]--drive-export-formats\[ga] parameter. They will match all available +Google Documents. -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can\[aq]t be used in JSON strings. +| Extension | Description | OS Support | +| --------- | ----------- | ---------- | +| desktop | freedesktop.org specified desktop entry | Linux | +| link.html | An HTML Document with a redirect | All | +| url | INI style link file | macOS, Windows | +| webloc | macOS specific XML format | macOS | ### Standard options -Here are the Standard options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)). - -#### --gcs-client-id +Here are the Standard options specific to drive (Google Drive). -OAuth Client Id. +#### --drive-client-id -Leave blank normally. +Google Application Client Id +Setting your own is recommended. +See https://rclone.org/drive/#making-your-own-client-id for how to create your own. +If you leave this blank, it will use an internal key which is low performance. Properties: - Config: client_id -- Env Var: RCLONE_GCS_CLIENT_ID +- Env Var: RCLONE_DRIVE_CLIENT_ID - Type: string - Required: false -#### --gcs-client-secret +#### --drive-client-secret OAuth Client Secret. @@ -41528,1647 +41403,2030 @@ Leave blank normally. Properties: - Config: client_secret -- Env Var: RCLONE_GCS_CLIENT_SECRET +- Env Var: RCLONE_DRIVE_CLIENT_SECRET - Type: string - Required: false -#### --gcs-project-number - -Project number. +#### --drive-scope -Optional - needed only for list/create/delete buckets - see your developer console. +Comma separated list of scopes that rclone should use when requesting access from drive. Properties: -- Config: project_number -- Env Var: RCLONE_GCS_PROJECT_NUMBER +- Config: scope +- Env Var: RCLONE_DRIVE_SCOPE - Type: string - Required: false +- Examples: + - \[dq]drive\[dq] + - Full access all files, excluding Application Data Folder. + - \[dq]drive.readonly\[dq] + - Read-only access to file metadata and file contents. + - \[dq]drive.file\[dq] + - Access to files created by rclone only. + - These are visible in the drive website. + - File authorization is revoked when the user deauthorizes the app. + - \[dq]drive.appfolder\[dq] + - Allows read and write access to the Application Data folder. + - This is not visible in the drive website. + - \[dq]drive.metadata.readonly\[dq] + - Allows read-only access to file metadata but + - does not allow any access to read or download file content. -#### --gcs-user-project +#### --drive-service-account-file -User project. +Service Account Credentials JSON file path. -Optional - needed only for requester pays. +Leave blank normally. +Needed only if you want use SA instead of interactive login. + +Leading \[ga]\[ti]\[ga] will be expanded in the file name as will environment variables such as \[ga]${RCLONE_CONFIG_DIR}\[ga]. Properties: -- Config: user_project -- Env Var: RCLONE_GCS_USER_PROJECT +- Config: service_account_file +- Env Var: RCLONE_DRIVE_SERVICE_ACCOUNT_FILE - Type: string - Required: false -#### --gcs-service-account-file +#### --drive-alternate-export -Service Account Credentials JSON file path. +Deprecated: No longer needed. -Leave blank normally. -Needed only if you want use SA instead of interactive login. +Properties: -Leading \[ga]\[ti]\[ga] will be expanded in the file name as will environment variables such as \[ga]${RCLONE_CONFIG_DIR}\[ga]. +- Config: alternate_export +- Env Var: RCLONE_DRIVE_ALTERNATE_EXPORT +- Type: bool +- Default: false + +### Advanced options + +Here are the Advanced options specific to drive (Google Drive). + +#### --drive-token + +OAuth Access Token as a JSON blob. Properties: -- Config: service_account_file -- Env Var: RCLONE_GCS_SERVICE_ACCOUNT_FILE +- Config: token +- Env Var: RCLONE_DRIVE_TOKEN - Type: string - Required: false -#### --gcs-service-account-credentials +#### --drive-auth-url -Service Account Credentials JSON blob. +Auth server URL. -Leave blank normally. -Needed only if you want use SA instead of interactive login. +Leave blank to use the provider defaults. Properties: -- Config: service_account_credentials -- Env Var: RCLONE_GCS_SERVICE_ACCOUNT_CREDENTIALS +- Config: auth_url +- Env Var: RCLONE_DRIVE_AUTH_URL - Type: string - Required: false -#### --gcs-anonymous +#### --drive-token-url -Access public buckets and objects without credentials. +Token server url. -Set to \[aq]true\[aq] if you just want to download files and don\[aq]t configure credentials. +Leave blank to use the provider defaults. Properties: -- Config: anonymous -- Env Var: RCLONE_GCS_ANONYMOUS -- Type: bool -- Default: false +- Config: token_url +- Env Var: RCLONE_DRIVE_TOKEN_URL +- Type: string +- Required: false -#### --gcs-object-acl +#### --drive-root-folder-id + +ID of the root folder. +Leave blank normally. + +Fill in to access \[dq]Computers\[dq] folders (see docs), or for rclone to use +a non root folder as its starting point. -Access Control List for new objects. Properties: -- Config: object_acl -- Env Var: RCLONE_GCS_OBJECT_ACL +- Config: root_folder_id +- Env Var: RCLONE_DRIVE_ROOT_FOLDER_ID - Type: string - Required: false -- Examples: - - \[dq]authenticatedRead\[dq] - - Object owner gets OWNER access. - - All Authenticated Users get READER access. - - \[dq]bucketOwnerFullControl\[dq] - - Object owner gets OWNER access. - - Project team owners get OWNER access. - - \[dq]bucketOwnerRead\[dq] - - Object owner gets OWNER access. - - Project team owners get READER access. - - \[dq]private\[dq] - - Object owner gets OWNER access. - - Default if left blank. - - \[dq]projectPrivate\[dq] - - Object owner gets OWNER access. - - Project team members get access according to their roles. - - \[dq]publicRead\[dq] - - Object owner gets OWNER access. - - All Users get READER access. -#### --gcs-bucket-acl +#### --drive-service-account-credentials -Access Control List for new buckets. +Service Account Credentials JSON blob. + +Leave blank normally. +Needed only if you want use SA instead of interactive login. Properties: -- Config: bucket_acl -- Env Var: RCLONE_GCS_BUCKET_ACL +- Config: service_account_credentials +- Env Var: RCLONE_DRIVE_SERVICE_ACCOUNT_CREDENTIALS - Type: string - Required: false -- Examples: - - \[dq]authenticatedRead\[dq] - - Project team owners get OWNER access. - - All Authenticated Users get READER access. - - \[dq]private\[dq] - - Project team owners get OWNER access. - - Default if left blank. - - \[dq]projectPrivate\[dq] - - Project team members get access according to their roles. - - \[dq]publicRead\[dq] - - Project team owners get OWNER access. - - All Users get READER access. - - \[dq]publicReadWrite\[dq] - - Project team owners get OWNER access. - - All Users get WRITER access. -#### --gcs-bucket-policy-only - -Access checks should use bucket-level IAM policies. +#### --drive-team-drive -If you want to upload objects to a bucket with Bucket Policy Only set -then you will need to set this. +ID of the Shared Drive (Team Drive). -When it is set, rclone: +Properties: -- ignores ACLs set on buckets -- ignores ACLs set on objects -- creates buckets with Bucket Policy Only set +- Config: team_drive +- Env Var: RCLONE_DRIVE_TEAM_DRIVE +- Type: string +- Required: false -Docs: https://cloud.google.com/storage/docs/bucket-policy-only +#### --drive-auth-owner-only +Only consider files owned by the authenticated user. Properties: -- Config: bucket_policy_only -- Env Var: RCLONE_GCS_BUCKET_POLICY_ONLY +- Config: auth_owner_only +- Env Var: RCLONE_DRIVE_AUTH_OWNER_ONLY - Type: bool - Default: false -#### --gcs-location +#### --drive-use-trash -Location for the newly created buckets. +Send files to the trash instead of deleting permanently. + +Defaults to true, namely sending files to the trash. +Use \[ga]--drive-use-trash=false\[ga] to delete files permanently instead. Properties: -- Config: location -- Env Var: RCLONE_GCS_LOCATION -- Type: string -- Required: false -- Examples: - - \[dq]\[dq] - - Empty for default location (US) - - \[dq]asia\[dq] - - Multi-regional location for Asia - - \[dq]eu\[dq] - - Multi-regional location for Europe - - \[dq]us\[dq] - - Multi-regional location for United States - - \[dq]asia-east1\[dq] - - Taiwan - - \[dq]asia-east2\[dq] - - Hong Kong - - \[dq]asia-northeast1\[dq] - - Tokyo - - \[dq]asia-northeast2\[dq] - - Osaka - - \[dq]asia-northeast3\[dq] - - Seoul - - \[dq]asia-south1\[dq] - - Mumbai - - \[dq]asia-south2\[dq] - - Delhi - - \[dq]asia-southeast1\[dq] - - Singapore - - \[dq]asia-southeast2\[dq] - - Jakarta - - \[dq]australia-southeast1\[dq] - - Sydney - - \[dq]australia-southeast2\[dq] - - Melbourne - - \[dq]europe-north1\[dq] - - Finland - - \[dq]europe-west1\[dq] - - Belgium - - \[dq]europe-west2\[dq] - - London - - \[dq]europe-west3\[dq] - - Frankfurt - - \[dq]europe-west4\[dq] - - Netherlands - - \[dq]europe-west6\[dq] - - Z\[:u]rich - - \[dq]europe-central2\[dq] - - Warsaw - - \[dq]us-central1\[dq] - - Iowa - - \[dq]us-east1\[dq] - - South Carolina - - \[dq]us-east4\[dq] - - Northern Virginia - - \[dq]us-west1\[dq] - - Oregon - - \[dq]us-west2\[dq] - - California - - \[dq]us-west3\[dq] - - Salt Lake City - - \[dq]us-west4\[dq] - - Las Vegas - - \[dq]northamerica-northeast1\[dq] - - Montr\['e]al - - \[dq]northamerica-northeast2\[dq] - - Toronto - - \[dq]southamerica-east1\[dq] - - S\[~a]o Paulo - - \[dq]southamerica-west1\[dq] - - Santiago - - \[dq]asia1\[dq] - - Dual region: asia-northeast1 and asia-northeast2. - - \[dq]eur4\[dq] - - Dual region: europe-north1 and europe-west4. - - \[dq]nam4\[dq] - - Dual region: us-central1 and us-east1. +- Config: use_trash +- Env Var: RCLONE_DRIVE_USE_TRASH +- Type: bool +- Default: true + +#### --drive-copy-shortcut-content + +Server side copy contents of shortcuts instead of the shortcut. + +When doing server side copies, normally rclone will copy shortcuts as +shortcuts. + +If this flag is used then rclone will copy the contents of shortcuts +rather than shortcuts themselves when doing server side copies. + +Properties: + +- Config: copy_shortcut_content +- Env Var: RCLONE_DRIVE_COPY_SHORTCUT_CONTENT +- Type: bool +- Default: false + +#### --drive-skip-gdocs + +Skip google documents in all listings. + +If given, gdocs practically become invisible to rclone. + +Properties: -#### --gcs-storage-class +- Config: skip_gdocs +- Env Var: RCLONE_DRIVE_SKIP_GDOCS +- Type: bool +- Default: false + +#### --drive-show-all-gdocs + +Show all Google Docs including non-exportable ones in listings. + +If you try a server side copy on a Google Form without this flag, you +will get this error: + + No export formats found for \[dq]application/vnd.google-apps.form\[dq] + +However adding this flag will allow the form to be server side copied. + +Note that rclone doesn\[aq]t add extensions to the Google Docs file names +in this mode. + +Do **not** use this flag when trying to download Google Docs - rclone +will fail to download them. -The storage class to use when storing objects in Google Cloud Storage. Properties: -- Config: storage_class -- Env Var: RCLONE_GCS_STORAGE_CLASS -- Type: string -- Required: false -- Examples: - - \[dq]\[dq] - - Default - - \[dq]MULTI_REGIONAL\[dq] - - Multi-regional storage class - - \[dq]REGIONAL\[dq] - - Regional storage class - - \[dq]NEARLINE\[dq] - - Nearline storage class - - \[dq]COLDLINE\[dq] - - Coldline storage class - - \[dq]ARCHIVE\[dq] - - Archive storage class - - \[dq]DURABLE_REDUCED_AVAILABILITY\[dq] - - Durable reduced availability storage class +- Config: show_all_gdocs +- Env Var: RCLONE_DRIVE_SHOW_ALL_GDOCS +- Type: bool +- Default: false -#### --gcs-env-auth +#### --drive-skip-checksum-gphotos -Get GCP IAM credentials from runtime (environment variables or instance meta data if no env vars). +Skip checksums on Google photos and videos only. -Only applies if service_account_file and service_account_credentials is blank. +Use this if you get checksum errors when transferring Google photos or +videos. + +Setting this flag will cause Google photos and videos to return a +blank checksums. + +Google photos are identified by being in the \[dq]photos\[dq] space. + +Corrupted checksums are caused by Google modifying the image/video but +not updating the checksum. Properties: -- Config: env_auth -- Env Var: RCLONE_GCS_ENV_AUTH +- Config: skip_checksum_gphotos +- Env Var: RCLONE_DRIVE_SKIP_CHECKSUM_GPHOTOS - Type: bool - Default: false -- Examples: - - \[dq]false\[dq] - - Enter credentials in the next step. - - \[dq]true\[dq] - - Get GCP IAM credentials from the environment (env vars or IAM). -### Advanced options +#### --drive-shared-with-me -Here are the Advanced options specific to google cloud storage (Google Cloud Storage (this is not Google Drive)). +Only show files that are shared with me. -#### --gcs-token +Instructs rclone to operate on your \[dq]Shared with me\[dq] folder (where +Google Drive lets you access the files and folders others have shared +with you). -OAuth Access Token as a JSON blob. +This works both with the \[dq]list\[dq] (lsd, lsl, etc.) and the \[dq]copy\[dq] +commands (copy, sync, etc.), and with all other commands too. Properties: -- Config: token -- Env Var: RCLONE_GCS_TOKEN -- Type: string -- Required: false +- Config: shared_with_me +- Env Var: RCLONE_DRIVE_SHARED_WITH_ME +- Type: bool +- Default: false -#### --gcs-auth-url +#### --drive-trashed-only -Auth server URL. +Only show files that are in the trash. -Leave blank to use the provider defaults. +This will show trashed files in their original directory structure. Properties: -- Config: auth_url -- Env Var: RCLONE_GCS_AUTH_URL -- Type: string -- Required: false +- Config: trashed_only +- Env Var: RCLONE_DRIVE_TRASHED_ONLY +- Type: bool +- Default: false -#### --gcs-token-url +#### --drive-starred-only -Token server url. +Only show files that are starred. -Leave blank to use the provider defaults. +Properties: + +- Config: starred_only +- Env Var: RCLONE_DRIVE_STARRED_ONLY +- Type: bool +- Default: false + +#### --drive-formats + +Deprecated: See export_formats. Properties: -- Config: token_url -- Env Var: RCLONE_GCS_TOKEN_URL +- Config: formats +- Env Var: RCLONE_DRIVE_FORMATS - Type: string - Required: false -#### --gcs-directory-markers +#### --drive-export-formats -Upload an empty object with a trailing slash when a new directory is created +Comma separated list of preferred formats for downloading Google docs. -Empty folders are unsupported for bucket based remotes, this option creates an empty -object ending with \[dq]/\[dq], to persist the folder. +Properties: +- Config: export_formats +- Env Var: RCLONE_DRIVE_EXPORT_FORMATS +- Type: string +- Default: \[dq]docx,xlsx,pptx,svg\[dq] -Properties: +#### --drive-import-formats -- Config: directory_markers -- Env Var: RCLONE_GCS_DIRECTORY_MARKERS -- Type: bool -- Default: false +Comma separated list of preferred formats for uploading Google docs. -#### --gcs-no-check-bucket +Properties: -If set, don\[aq]t attempt to check the bucket exists or create it. +- Config: import_formats +- Env Var: RCLONE_DRIVE_IMPORT_FORMATS +- Type: string +- Required: false -This can be useful when trying to minimise the number of transactions -rclone does if you know the bucket exists already. +#### --drive-allow-import-name-change +Allow the filetype to change when uploading Google docs. + +E.g. file.doc to file.docx. This will confuse sync and reupload every time. Properties: -- Config: no_check_bucket -- Env Var: RCLONE_GCS_NO_CHECK_BUCKET +- Config: allow_import_name_change +- Env Var: RCLONE_DRIVE_ALLOW_IMPORT_NAME_CHANGE - Type: bool - Default: false -#### --gcs-decompress +#### --drive-use-created-date -If set this will decompress gzip encoded objects. +Use file created date instead of modified date. -It is possible to upload objects to GCS with \[dq]Content-Encoding: gzip\[dq] -set. Normally rclone will download these files as compressed objects. +Useful when downloading data and you want the creation date used in +place of the last modified date. -If this flag is set then rclone will decompress these files with -\[dq]Content-Encoding: gzip\[dq] as they are received. This means that rclone -can\[aq]t check the size and hash but the file contents will be decompressed. +**WARNING**: This flag may have some unexpected consequences. + +When uploading to your drive all files will be overwritten unless they +haven\[aq]t been modified since their creation. And the inverse will occur +while downloading. This side effect can be avoided by using the +\[dq]--checksum\[dq] flag. +This feature was implemented to retain photos capture date as recorded +by google photos. You will first need to check the \[dq]Create a Google +Photos folder\[dq] option in your google drive settings. You can then copy +or move the photos locally and use the date the image was taken +(created) set as the modification date. Properties: -- Config: decompress -- Env Var: RCLONE_GCS_DECOMPRESS +- Config: use_created_date +- Env Var: RCLONE_DRIVE_USE_CREATED_DATE - Type: bool - Default: false -#### --gcs-endpoint +#### --drive-use-shared-date -Endpoint for the service. +Use date file was shared instead of modified date. -Leave blank normally. +Note that, as with \[dq]--drive-use-created-date\[dq], this flag may have +unexpected consequences when uploading/downloading files. -Properties: +If both this flag and \[dq]--drive-use-created-date\[dq] are set, the created +date is used. -- Config: endpoint -- Env Var: RCLONE_GCS_ENDPOINT -- Type: string -- Required: false +Properties: -#### --gcs-encoding +- Config: use_shared_date +- Env Var: RCLONE_DRIVE_USE_SHARED_DATE +- Type: bool +- Default: false -The encoding for the backend. +#### --drive-list-chunk -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Size of listing chunk 100-1000, 0 to disable. Properties: -- Config: encoding -- Env Var: RCLONE_GCS_ENCODING -- Type: MultiEncoder -- Default: Slash,CrLf,InvalidUtf8,Dot +- Config: list_chunk +- Env Var: RCLONE_DRIVE_LIST_CHUNK +- Type: int +- Default: 1000 +#### --drive-impersonate +Impersonate this user when using a service account. -## Limitations +Properties: -\[ga]rclone about\[ga] is not supported by the Google Cloud Storage backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy \[ga]mfs\[ga] (most free space) as a member of an rclone union -remote. +- Config: impersonate +- Env Var: RCLONE_DRIVE_IMPERSONATE +- Type: string +- Required: false -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) +#### --drive-upload-cutoff -# Google Drive +Cutoff for switching to chunked upload. -Paths are specified as \[ga]drive:path\[ga] +Properties: -Drive paths may be as deep as required, e.g. \[ga]drive:directory/subdirectory\[ga]. +- Config: upload_cutoff +- Env Var: RCLONE_DRIVE_UPLOAD_CUTOFF +- Type: SizeSuffix +- Default: 8Mi -## Configuration +#### --drive-chunk-size -The initial setup for drive involves getting a token from Google drive -which you need to do in your browser. \[ga]rclone config\[ga] walks you -through it. +Upload chunk size. -Here is an example of how to make a remote called \[ga]remote\[ga]. First run: +Must a power of 2 >= 256k. - rclone config +Making this larger will improve performance, but note that each chunk +is buffered in memory one per transfer. -This will guide you through an interactive setup process: -\f[R] -.fi -.PP -No remotes found, make a new one? -n) New remote r) Rename remote c) Copy remote s) Set configuration -password q) Quit config n/r/c/s/q> n name> remote Type of storage to -configure. -Choose a number from below, or type in your own value [snip] XX / Google -Drive \ \[dq]drive\[dq] [snip] Storage> drive Google Application Client -Id - leave blank normally. -client_id> Google Application Client Secret - leave blank normally. -client_secret> Scope that rclone should use when requesting access from -drive. -Choose a number from below, or type in your own value 1 / Full access -all files, excluding Application Data Folder. -\ \[dq]drive\[dq] 2 / Read-only access to file metadata and file -contents. -\ \[dq]drive.readonly\[dq] / Access to files created by rclone only. -3 | These are visible in the drive website. -| File authorization is revoked when the user deauthorizes the app. -\ \[dq]drive.file\[dq] / Allows read and write access to the Application -Data folder. -4 | This is not visible in the drive website. -\ \[dq]drive.appfolder\[dq] / Allows read-only access to file metadata -but 5 | does not allow any access to read or download file content. -\ \[dq]drive.metadata.readonly\[dq] scope> 1 Service Account Credentials -JSON file path - needed only if you want use SA instead of interactive -login. -service_account_file> Remote config Use web browser to automatically -authenticate rclone with remote? -* Say Y if the machine running rclone has a web browser you can use * -Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. -If Y failed, try N. -y) Yes n) No y/n> y If your browser doesn\[aq]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 Configure this as a Shared Drive (Team Drive)? -y) Yes n) No y/n> n -------------------- [remote] client_id = -client_secret = scope = drive root_folder_id = service_account_file = -token = -{\[dq]access_token\[dq]:\[dq]XXX\[dq],\[dq]token_type\[dq]:\[dq]Bearer\[dq],\[dq]refresh_token\[dq]:\[dq]XXX\[dq],\[dq]expiry\[dq]:\[dq]2014-03-16T13:57:58.955387075Z\[dq]} --------------------- y) Yes this is OK e) Edit this remote d) Delete -this remote y/e/d> y -.IP -.nf -\f[C] -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a -machine with no Internet browser available. +Reducing this will reduce memory usage but decrease performance. -Note that rclone runs a webserver on your local machine to collect the -token as returned from Google if using web browser to automatically -authenticate. This only -runs from the moment it opens your browser to the moment you get back -the verification code. This is on \[ga]http://127.0.0.1:53682/\[ga] and it -may require you to unblock it temporarily if you are running a host -firewall, or use manual mode. +Properties: -You can then use it like this, +- Config: chunk_size +- Env Var: RCLONE_DRIVE_CHUNK_SIZE +- Type: SizeSuffix +- Default: 8Mi -List directories in top level of your drive +#### --drive-acknowledge-abuse - rclone lsd remote: +Set to allow files which return cannotDownloadAbusiveFile to be downloaded. -List all the files in your drive +If downloading a file returns the error \[dq]This file has been identified +as malware or spam and cannot be downloaded\[dq] with the error code +\[dq]cannotDownloadAbusiveFile\[dq] then supply this flag to rclone to +indicate you acknowledge the risks of downloading the file and rclone +will download it anyway. - rclone ls remote: +Note that if you are using service account it will need Manager +permission (not Content Manager) to for this flag to work. If the SA +does not have the right permission, Google will just ignore the flag. -To copy a local directory to a drive directory called backup +Properties: - rclone copy /home/source remote:backup +- Config: acknowledge_abuse +- Env Var: RCLONE_DRIVE_ACKNOWLEDGE_ABUSE +- Type: bool +- Default: false -### Scopes +#### --drive-keep-revision-forever -Rclone allows you to select which scope you would like for rclone to -use. This changes what type of token is granted to rclone. [The -scopes are defined -here](https://developers.google.com/drive/v3/web/about-auth). +Keep new head revision of each file forever. -The scope are +Properties: -#### drive +- Config: keep_revision_forever +- Env Var: RCLONE_DRIVE_KEEP_REVISION_FOREVER +- Type: bool +- Default: false -This is the default scope and allows full access to all files, except -for the Application Data Folder (see below). +#### --drive-size-as-quota -Choose this one if you aren\[aq]t sure. +Show sizes as storage quota usage, not actual size. -#### drive.readonly +Show the size of a file as the storage quota used. This is the +current version plus any older versions that have been set to keep +forever. -This allows read only access to all files. Files may be listed and -downloaded but not uploaded, renamed or deleted. +**WARNING**: This flag may have some unexpected consequences. -#### drive.file +It is not recommended to set this flag in your config - the +recommended usage is using the flag form --drive-size-as-quota when +doing rclone ls/lsl/lsf/lsjson/etc only. -With this scope rclone can read/view/modify only those files and -folders it creates. +If you do use this flag for syncing (not recommended) then you will +need to use --ignore size also. -So if you uploaded files to drive via the web interface (or any other -means) they will not be visible to rclone. +Properties: -This can be useful if you are using rclone to backup data and you want -to be sure confidential data on your drive is not visible to rclone. +- Config: size_as_quota +- Env Var: RCLONE_DRIVE_SIZE_AS_QUOTA +- Type: bool +- Default: false -Files created with this scope are visible in the web interface. +#### --drive-v2-download-min-size -#### drive.appfolder +If Object\[aq]s are greater, use drive v2 API to download. -This gives rclone its own private area to store files. Rclone will -not be able to see any other files on your drive and you won\[aq]t be able -to see rclone\[aq]s files from the web interface either. +Properties: -#### drive.metadata.readonly +- Config: v2_download_min_size +- Env Var: RCLONE_DRIVE_V2_DOWNLOAD_MIN_SIZE +- Type: SizeSuffix +- Default: off -This allows read only access to file names only. It does not allow -rclone to download or upload data, or rename or delete files or -directories. +#### --drive-pacer-min-sleep -### Root folder ID +Minimum time to sleep between API calls. -This option has been moved to the advanced section. You can set the \[ga]root_folder_id\[ga] for rclone. This is the directory -(identified by its \[ga]Folder ID\[ga]) that rclone considers to be the root -of your drive. +Properties: -Normally you will leave this blank and rclone will determine the -correct root to use itself. +- Config: pacer_min_sleep +- Env Var: RCLONE_DRIVE_PACER_MIN_SLEEP +- Type: Duration +- Default: 100ms -However you can set this to restrict rclone to a specific folder -hierarchy or to access data within the \[dq]Computers\[dq] tab on the drive -web interface (where files from Google\[aq]s Backup and Sync desktop -program go). +#### --drive-pacer-burst -In order to do this you will have to find the \[ga]Folder ID\[ga] of the -directory you wish rclone to display. This will be the last segment -of the URL when you open the relevant folder in the drive web -interface. +Number of API calls to allow without sleeping. -So if the folder you want rclone to use has a URL which looks like -\[ga]https://drive.google.com/drive/folders/1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh\[ga] -in the browser, then you use \[ga]1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh\[ga] as -the \[ga]root_folder_id\[ga] in the config. +Properties: -**NB** folders under the \[dq]Computers\[dq] tab seem to be read only (drive -gives a 500 error) when using rclone. +- Config: pacer_burst +- Env Var: RCLONE_DRIVE_PACER_BURST +- Type: int +- Default: 100 -There doesn\[aq]t appear to be an API to discover the folder IDs of the -\[dq]Computers\[dq] tab - please contact us if you know otherwise! +#### --drive-server-side-across-configs -Note also that rclone can\[aq]t access any data under the \[dq]Backups\[dq] tab on -the google drive web interface yet. +Deprecated: use --server-side-across-configs instead. -### Service Account support +Allow server-side operations (e.g. copy) to work across different drive configs. -You can set up rclone with Google Drive in an unattended mode, -i.e. not tied to a specific end-user Google account. This is useful -when you want to synchronise files onto machines that don\[aq]t have -actively logged-in users, for example build machines. +This can be useful if you wish to do a server-side copy between two +different Google drives. Note that this isn\[aq]t enabled by default +because it isn\[aq]t easy to tell if it will work between any two +configurations. -To use a Service Account instead of OAuth2 token flow, enter the path -to your Service Account credentials at the \[ga]service_account_file\[ga] -prompt during \[ga]rclone config\[ga] and rclone won\[aq]t use the browser based -authentication flow. If you\[aq]d rather stuff the contents of the -credentials file into the rclone config file, you can set -\[ga]service_account_credentials\[ga] with the actual contents of the file -instead, or set the equivalent environment variable. +Properties: -#### Use case - Google Apps/G-suite account and individual Drive +- Config: server_side_across_configs +- Env Var: RCLONE_DRIVE_SERVER_SIDE_ACROSS_CONFIGS +- Type: bool +- Default: false -Let\[aq]s say that you are the administrator of a Google Apps (old) or -G-suite account. -The goal is to store data on an individual\[aq]s Drive account, who IS -a member of the domain. -We\[aq]ll call the domain **example.com**, and the user -**foo\[at]example.com**. +#### --drive-disable-http2 -There\[aq]s a few steps we need to go through to accomplish this: +Disable drive using http2. -##### 1. Create a service account for example.com - - To create a service account and obtain its credentials, go to the -[Google Developer Console](https://console.developers.google.com). - - You must have a project - create one if you don\[aq]t. - - Then go to \[dq]IAM & admin\[dq] -> \[dq]Service Accounts\[dq]. - - Use the \[dq]Create Service Account\[dq] button. Fill in \[dq]Service account name\[dq] -and \[dq]Service account ID\[dq] with something that identifies your client. - - Select \[dq]Create And Continue\[dq]. Step 2 and 3 are optional. - - These credentials are what rclone will use for authentication. -If you ever need to remove access, press the \[dq]Delete service -account key\[dq] button. +There is currently an unsolved issue with the google drive backend and +HTTP/2. HTTP/2 is therefore disabled by default for the drive backend +but can be re-enabled here. When the issue is solved this flag will +be removed. -##### 2. Allowing API access to example.com Google Drive - - Go to example.com\[aq]s admin console - - Go into \[dq]Security\[dq] (or use the search bar) - - Select \[dq]Show more\[dq] and then \[dq]Advanced settings\[dq] - - Select \[dq]Manage API client access\[dq] in the \[dq]Authentication\[dq] section - - In the \[dq]Client Name\[dq] field enter the service account\[aq]s -\[dq]Client ID\[dq] - this can be found in the Developer Console under -\[dq]IAM & Admin\[dq] -> \[dq]Service Accounts\[dq], then \[dq]View Client ID\[dq] for -the newly created service account. -It is a \[ti]21 character numerical string. - - In the next field, \[dq]One or More API Scopes\[dq], enter -\[ga]https://www.googleapis.com/auth/drive\[ga] -to grant access to Google Drive specifically. +See: https://github.com/rclone/rclone/issues/3631 -##### 3. Configure rclone, assuming a new install -\f[R] -.fi -.PP -rclone config -.PP -n/s/q> n # New name>gdrive # Gdrive is an example name Storage> # Select -the number shown for Google Drive client_id> # Can be left blank -client_secret> # Can be left blank scope> # Select your scope, 1 for -example root_folder_id> # Can be left blank service_account_file> -/home/foo/myJSONfile.json # This is where the JSON file goes! y/n> # -Auto config, n -.IP -.nf -\f[C] -##### 4. Verify that it\[aq]s working - - \[ga]rclone -v --drive-impersonate foo\[at]example.com lsf gdrive:backup\[ga] - - The arguments do: - - \[ga]-v\[ga] - verbose logging - - \[ga]--drive-impersonate foo\[at]example.com\[ga] - this is what does -the magic, pretending to be user foo. - - \[ga]lsf\[ga] - list files in a parsing friendly way - - \[ga]gdrive:backup\[ga] - use the remote called gdrive, work in -the folder named backup. -Note: in case you configured a specific root folder on gdrive and rclone is unable to access the contents of that folder when using \[ga]--drive-impersonate\[ga], do this instead: - - in the gdrive web interface, share your root folder with the user/email of the new Service Account you created/selected at step #1 - - use rclone without specifying the \[ga]--drive-impersonate\[ga] option, like this: - \[ga]rclone -v lsf gdrive:backup\[ga] +Properties: + +- Config: disable_http2 +- Env Var: RCLONE_DRIVE_DISABLE_HTTP2 +- Type: bool +- Default: true + +#### --drive-stop-on-upload-limit -### Shared drives (team drives) +Make upload limit errors be fatal. -If you want to configure the remote to point to a Google Shared Drive -(previously known as Team Drives) then answer \[ga]y\[ga] to the question -\[ga]Configure this as a Shared Drive (Team Drive)?\[ga]. +At the time of writing it is only possible to upload 750 GiB of data to +Google Drive a day (this is an undocumented limit). When this limit is +reached Google Drive produces a slightly different error message. When +this flag is set it causes these errors to be fatal. These will stop +the in-progress sync. -This will fetch the list of Shared Drives from google and allow you to -configure which one you want to use. You can also type in a Shared -Drive ID if you prefer. +Note that this detection is relying on error message strings which +Google don\[aq]t document so it may break in the future. -For example: -\f[R] -.fi -.PP -Configure this as a Shared Drive (Team Drive)? -y) Yes n) No y/n> y Fetching Shared Drive list... -Choose a number from below, or type in your own value 1 / Rclone Test -\ \[dq]xxxxxxxxxxxxxxxxxxxx\[dq] 2 / Rclone Test 2 -\ \[dq]yyyyyyyyyyyyyyyyyyyy\[dq] 3 / Rclone Test 3 -\ \[dq]zzzzzzzzzzzzzzzzzzzz\[dq] Enter a Shared Drive ID> 1 --------------------- [remote] client_id = client_secret = token = -{\[dq]AccessToken\[dq]:\[dq]xxxx.x.xxxxx_xxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\[dq],\[dq]RefreshToken\[dq]:\[dq]1/xxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxx\[dq],\[dq]Expiry\[dq]:\[dq]2014-03-16T13:57:58.955387075Z\[dq],\[dq]Extra\[dq]:null} -team_drive = xxxxxxxxxxxxxxxxxxxx -------------------- y) Yes this is OK -e) Edit this remote d) Delete this remote y/e/d> y -.IP -.nf -\f[C] -### --fast-list +See: https://github.com/rclone/rclone/issues/3857 -This remote supports \[ga]--fast-list\[ga] which allows you to use fewer -transactions in exchange for more memory. See the [rclone -docs](https://rclone.org/docs/#fast-list) for more details. -It does this by combining multiple \[ga]list\[ga] calls into a single API request. +Properties: -This works by combining many \[ga]\[aq]%s\[aq] in parents\[ga] filters into one expression. -To list the contents of directories a, b and c, the following requests will be send by the regular \[ga]List\[ga] function: -\f[R] -.fi -.PP -trashed=false and \[aq]a\[aq] in parents trashed=false and \[aq]b\[aq] -in parents trashed=false and \[aq]c\[aq] in parents -.IP -.nf -\f[C] -These can now be combined into a single request: -\f[R] -.fi -.PP -trashed=false and (\[aq]a\[aq] in parents or \[aq]b\[aq] in parents or -\[aq]c\[aq] in parents) -.IP -.nf -\f[C] -The implementation of \[ga]ListR\[ga] will put up to 50 \[ga]parents\[ga] filters into one request. -It will use the \[ga]--checkers\[ga] value to specify the number of requests to run in parallel. +- Config: stop_on_upload_limit +- Env Var: RCLONE_DRIVE_STOP_ON_UPLOAD_LIMIT +- Type: bool +- Default: false -In tests, these batch requests were up to 20x faster than the regular method. -Running the following command against different sized folders gives: -\f[R] -.fi -.PP -rclone lsjson -vv -R --checkers=6 gdrive:folder -.IP -.nf -\f[C] -small folder (220 directories, 700 files): +#### --drive-stop-on-download-limit -- without \[ga]--fast-list\[ga]: 38s -- with \[ga]--fast-list\[ga]: 10s +Make download limit errors be fatal. -large folder (10600 directories, 39000 files): +At the time of writing it is only possible to download 10 TiB of data from +Google Drive a day (this is an undocumented limit). When this limit is +reached Google Drive produces a slightly different error message. When +this flag is set it causes these errors to be fatal. These will stop +the in-progress sync. -- without \[ga]--fast-list\[ga]: 22:05 min -- with \[ga]--fast-list\[ga]: 58s +Note that this detection is relying on error message strings which +Google don\[aq]t document so it may break in the future. -### Modified time -Google drive stores modification times accurate to 1 ms. +Properties: -### Restricted filename characters +- Config: stop_on_download_limit +- Env Var: RCLONE_DRIVE_STOP_ON_DOWNLOAD_LIMIT +- Type: bool +- Default: false -Only Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can\[aq]t be used in JSON strings. +#### --drive-skip-shortcuts -In contrast to other backends, \[ga]/\[ga] can also be used in names and \[ga].\[ga] -or \[ga]..\[ga] are valid names. +If set skip shortcut files. -### Revisions +Normally rclone dereferences shortcut files making them appear as if +they are the original file (see [the shortcuts section](#shortcuts)). +If this flag is set then rclone will ignore shortcut files completely. -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. -Revisions follow the standard google policy which at time of writing -was +Properties: - * They are deleted after 30 days or 100 revisions (whatever comes first). - * They do not count towards a user storage quota. +- Config: skip_shortcuts +- Env Var: RCLONE_DRIVE_SKIP_SHORTCUTS +- Type: bool +- Default: false -### Deleting files +#### --drive-skip-dangling-shortcuts -By default rclone will send all files to the trash when deleting -files. If deleting them permanently is required then use the -\[ga]--drive-use-trash=false\[ga] flag, or set the equivalent environment -variable. +If set skip dangling shortcut files. -### Shortcuts +If this is set then rclone will not show any dangling shortcuts in listings. -In March 2020 Google introduced a new feature in Google Drive called -[drive shortcuts](https://support.google.com/drive/answer/9700156) -([API](https://developers.google.com/drive/api/v3/shortcuts)). These -will (by September 2020) [replace the ability for files or folders to -be in multiple folders at once](https://cloud.google.com/blog/products/g-suite/simplifying-google-drives-folder-structure-and-sharing-models). -Shortcuts are files that link to other files on Google Drive somewhat -like a symlink in unix, except they point to the underlying file data -(e.g. the inode in unix terms) so they don\[aq]t break if the source is -renamed or moved about. +Properties: -By default rclone treats these as follows. +- Config: skip_dangling_shortcuts +- Env Var: RCLONE_DRIVE_SKIP_DANGLING_SHORTCUTS +- Type: bool +- Default: false -For shortcuts pointing to files: +#### --drive-resource-key -- When listing a file shortcut appears as the destination file. -- When downloading the contents of the destination file is downloaded. -- When updating shortcut file with a non shortcut file, the shortcut is removed then a new file is uploaded in place of the shortcut. -- When server-side moving (renaming) the shortcut is renamed, not the destination file. -- When server-side copying the shortcut is copied, not the contents of the shortcut. (unless \[ga]--drive-copy-shortcut-content\[ga] is in use in which case the contents of the shortcut gets copied). -- When deleting the shortcut is deleted not the linked file. -- When setting the modification time, the modification time of the linked file will be set. +Resource key for accessing a link-shared file. -For shortcuts pointing to folders: +If you need to access files shared with a link like this -- When listing the shortcut appears as a folder and that folder will contain the contents of the linked folder appear (including any sub folders) -- When downloading the contents of the linked folder and sub contents are downloaded -- When uploading to a shortcut folder the file will be placed in the linked folder -- When server-side moving (renaming) the shortcut is renamed, not the destination folder -- When server-side copying the contents of the linked folder is copied, not the shortcut. -- When deleting with \[ga]rclone rmdir\[ga] or \[ga]rclone purge\[ga] the shortcut is deleted not the linked folder. -- **NB** When deleting with \[ga]rclone remove\[ga] or \[ga]rclone mount\[ga] the contents of the linked folder will be deleted. + https://drive.google.com/drive/folders/XXX?resourcekey=YYY&usp=sharing -The [rclone backend](https://rclone.org/commands/rclone_backend/) command can be used to create shortcuts. +Then you will need to use the first part \[dq]XXX\[dq] as the \[dq]root_folder_id\[dq] +and the second part \[dq]YYY\[dq] as the \[dq]resource_key\[dq] otherwise you will get +404 not found errors when trying to access the directory. -Shortcuts can be completely ignored with the \[ga]--drive-skip-shortcuts\[ga] flag -or the corresponding \[ga]skip_shortcuts\[ga] configuration setting. +See: https://developers.google.com/drive/api/guides/resource-keys -### Emptying trash +This resource key requirement only applies to a subset of old files. -If you wish to empty your trash you can use the \[ga]rclone cleanup remote:\[ga] -command which will permanently delete all your trashed files. This command -does not take any path arguments. +Note also that opening the folder once in the web interface (with the +user you\[aq]ve authenticated rclone with) seems to be enough so that the +resource key is not needed. -Note that Google Drive takes some time (minutes to days) to empty the -trash even though the command returns within a few seconds. No output -is echoed, so there will be no confirmation even using -v or -vv. -### Quota information +Properties: -To view your current quota you can use the \[ga]rclone about remote:\[ga] -command which will display your usage limit (quota), the usage in Google -Drive, the size of all files in the Trash and the space used by other -Google services such as Gmail. This command does not take any path -arguments. +- Config: resource_key +- Env Var: RCLONE_DRIVE_RESOURCE_KEY +- Type: string +- Required: false -#### Import/Export of google documents +#### --drive-fast-list-bug-fix -Google documents can be exported from and uploaded to Google Drive. +Work around a bug in Google Drive listing. -When rclone downloads a Google doc it chooses a format to download -depending upon the \[ga]--drive-export-formats\[ga] setting. -By default the export formats are \[ga]docx,xlsx,pptx,svg\[ga] which are a -sensible default for an editable document. +Normally rclone will work around a bug in Google Drive when using +--fast-list (ListR) where the search \[dq](A in parents) or (B in +parents)\[dq] returns nothing sometimes. See #3114, #4289 and +https://issuetracker.google.com/issues/149522397 -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\[aq]t be exported to a format on the formats list, -then rclone will choose a format from the default list. +Rclone detects this by finding no items in more than one directory +when listing and retries them as lists of individual directories. -If you prefer an archive copy then you might use \[ga]--drive-export-formats -pdf\[ga], or if you prefer openoffice/libreoffice formats you might use -\[ga]--drive-export-formats ods,odt,odp\[ga]. +This means that if you have a lot of empty directories rclone will end +up listing them all individually and this can take many more API +calls. -Note that rclone adds the extension to the google doc, so if it is -called \[ga]My Spreadsheet\[ga] on google docs, it will be exported as \[ga]My -Spreadsheet.xlsx\[ga] or \[ga]My Spreadsheet.pdf\[ga] etc. +This flag allows the work-around to be disabled. This is **not** +recommended in normal use - only if you have a particular case you are +having trouble with like many empty directories. -When importing files into Google Drive, rclone will convert all -files with an extension in \[ga]--drive-import-formats\[ga] to their -associated document type. -rclone will not convert any files by default, since the conversion -is lossy process. -The conversion must result in a file with the same extension when -the \[ga]--drive-export-formats\[ga] rules are applied to the uploaded document. +Properties: -Here are some examples for allowed and prohibited conversions. +- Config: fast_list_bug_fix +- Env Var: RCLONE_DRIVE_FAST_LIST_BUG_FIX +- Type: bool +- Default: true -| export-formats | import-formats | Upload Ext | Document Ext | Allowed | -| -------------- | -------------- | ---------- | ------------ | ------- | -| odt | odt | odt | odt | Yes | -| odt | docx,odt | odt | odt | Yes | -| | docx | docx | docx | Yes | -| | odt | odt | docx | No | -| odt,docx | docx,odt | docx | odt | No | -| docx,odt | docx,odt | docx | docx | Yes | -| docx,odt | docx,odt | odt | docx | No | +#### --drive-metadata-owner -This limitation can be disabled by specifying \[ga]--drive-allow-import-name-change\[ga]. -When using this flag, rclone can convert multiple files types resulting -in the same document type at once, e.g. with \[ga]--drive-import-formats docx,odt,txt\[ga], -all files having these extension would result in a document represented as a docx file. -This brings the additional risk of overwriting a document, if multiple files -have the same stem. Many rclone operations will not handle this name change -in any way. They assume an equal name when copying files and might copy the -file again or delete them when the name changes. +Control whether owner should be read or written in metadata. -Here are the possible export extensions with their corresponding mime types. -Most of these can also be used for importing, but there more that are not -listed here. Some of these additional ones might only be available when -the operating system provides the correct MIME type entries. +Owner is a standard part of the file metadata so is easy to read. But it +isn\[aq]t always desirable to set the owner from the metadata. -This list can be changed by Google Drive at any time and might not -represent the currently available conversions. +Note that you can\[aq]t set the owner on Shared Drives, and that setting +ownership will generate an email to the new owner (this can\[aq]t be +disabled), and you can\[aq]t transfer ownership to someone outside your +organization. -| Extension | Mime Type | Description | -| --------- |-----------| ------------| -| bmp | image/bmp | Windows Bitmap format | -| csv | text/csv | Standard CSV format for Spreadsheets | -| doc | application/msword | Classic Word file | -| docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document | Microsoft Office Document | -| epub | application/epub+zip | E-book format | -| html | text/html | An HTML Document | -| jpg | image/jpeg | A JPEG Image File | -| json | application/vnd.google-apps.script+json | JSON Text Format for Google Apps scripts | -| odp | application/vnd.oasis.opendocument.presentation | Openoffice Presentation | -| ods | application/vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet | -| ods | application/x-vnd.oasis.opendocument.spreadsheet | Openoffice Spreadsheet | -| odt | application/vnd.oasis.opendocument.text | Openoffice Document | -| pdf | application/pdf | Adobe PDF Format | -| pjpeg | image/pjpeg | Progressive JPEG Image | -| png | image/png | PNG Image Format| -| pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation | Microsoft Office Powerpoint | -| rtf | application/rtf | Rich Text Format | -| svg | image/svg+xml | Scalable Vector Graphics Format | -| tsv | text/tab-separated-values | Standard TSV format for spreadsheets | -| txt | text/plain | Plain Text | -| wmf | application/x-msmetafile | Windows Meta File | -| xls | application/vnd.ms-excel | Classic Excel file | -| xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | Microsoft Office Spreadsheet | -| zip | application/zip | A ZIP file of HTML, Images CSS | -Google documents can also be exported as link files. These files will -open a browser window for the Google Docs website of that document -when opened. The link file extension has to be specified as a -\[ga]--drive-export-formats\[ga] parameter. They will match all available -Google Documents. +Properties: -| Extension | Description | OS Support | -| --------- | ----------- | ---------- | -| desktop | freedesktop.org specified desktop entry | Linux | -| link.html | An HTML Document with a redirect | All | -| url | INI style link file | macOS, Windows | -| webloc | macOS specific XML format | macOS | +- Config: metadata_owner +- Env Var: RCLONE_DRIVE_METADATA_OWNER +- Type: Bits +- Default: read +- Examples: + - \[dq]off\[dq] + - Do not read or write the value + - \[dq]read\[dq] + - Read the value only + - \[dq]write\[dq] + - Write the value only + - \[dq]read,write\[dq] + - Read and Write the value. +#### --drive-metadata-permissions -### Standard options +Control whether permissions should be read or written in metadata. -Here are the Standard options specific to drive (Google Drive). +Reading permissions metadata from files can be done quickly, but it +isn\[aq]t always desirable to set the permissions from the metadata. -#### --drive-client-id +Note that rclone drops any inherited permissions on Shared Drives and +any owner permission on My Drives as these are duplicated in the owner +metadata. -Google Application Client Id -Setting your own is recommended. -See https://rclone.org/drive/#making-your-own-client-id for how to create your own. -If you leave this blank, it will use an internal key which is low performance. Properties: -- Config: client_id -- Env Var: RCLONE_DRIVE_CLIENT_ID -- Type: string -- Required: false - -#### --drive-client-secret +- Config: metadata_permissions +- Env Var: RCLONE_DRIVE_METADATA_PERMISSIONS +- Type: Bits +- Default: off +- Examples: + - \[dq]off\[dq] + - Do not read or write the value + - \[dq]read\[dq] + - Read the value only + - \[dq]write\[dq] + - Write the value only + - \[dq]read,write\[dq] + - Read and Write the value. -OAuth Client Secret. +#### --drive-metadata-labels -Leave blank normally. +Control whether labels should be read or written in metadata. -Properties: +Reading labels metadata from files takes an extra API transaction and +will slow down listings. It isn\[aq]t always desirable to set the labels +from the metadata. -- Config: client_secret -- Env Var: RCLONE_DRIVE_CLIENT_SECRET -- Type: string -- Required: false +The format of labels is documented in the drive API documentation at +https://developers.google.com/drive/api/reference/rest/v3/Label - +rclone just provides a JSON dump of this format. -#### --drive-scope +When setting labels, the label and fields must already exist - rclone +will not create them. This means that if you are transferring labels +from two different accounts you will have to create the labels in +advance and use the metadata mapper to translate the IDs between the +two accounts. -Scope that rclone should use when requesting access from drive. Properties: -- Config: scope -- Env Var: RCLONE_DRIVE_SCOPE -- Type: string -- Required: false +- Config: metadata_labels +- Env Var: RCLONE_DRIVE_METADATA_LABELS +- Type: Bits +- Default: off - Examples: - - \[dq]drive\[dq] - - Full access all files, excluding Application Data Folder. - - \[dq]drive.readonly\[dq] - - Read-only access to file metadata and file contents. - - \[dq]drive.file\[dq] - - Access to files created by rclone only. - - These are visible in the drive website. - - File authorization is revoked when the user deauthorizes the app. - - \[dq]drive.appfolder\[dq] - - Allows read and write access to the Application Data folder. - - This is not visible in the drive website. - - \[dq]drive.metadata.readonly\[dq] - - Allows read-only access to file metadata but - - does not allow any access to read or download file content. - -#### --drive-service-account-file + - \[dq]off\[dq] + - Do not read or write the value + - \[dq]read\[dq] + - Read the value only + - \[dq]write\[dq] + - Write the value only + - \[dq]read,write\[dq] + - Read and Write the value. -Service Account Credentials JSON file path. +#### --drive-encoding -Leave blank normally. -Needed only if you want use SA instead of interactive login. +The encoding for the backend. -Leading \[ga]\[ti]\[ga] will be expanded in the file name as will environment variables such as \[ga]${RCLONE_CONFIG_DIR}\[ga]. +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. Properties: -- Config: service_account_file -- Env Var: RCLONE_DRIVE_SERVICE_ACCOUNT_FILE -- Type: string -- Required: false +- Config: encoding +- Env Var: RCLONE_DRIVE_ENCODING +- Type: Encoding +- Default: InvalidUtf8 -#### --drive-alternate-export +#### --drive-env-auth -Deprecated: No longer needed. +Get IAM credentials from runtime (environment variables or instance meta data if no env vars). + +Only applies if service_account_file and service_account_credentials is blank. Properties: -- Config: alternate_export -- Env Var: RCLONE_DRIVE_ALTERNATE_EXPORT +- Config: env_auth +- Env Var: RCLONE_DRIVE_ENV_AUTH - Type: bool - Default: false +- Examples: + - \[dq]false\[dq] + - Enter credentials in the next step. + - \[dq]true\[dq] + - Get GCP IAM credentials from the environment (env vars or IAM). -### Advanced options +### Metadata -Here are the Advanced options specific to drive (Google Drive). +User metadata is stored in the properties field of the drive object. -#### --drive-token +Here are the possible system metadata items for the drive backend. -OAuth Access Token as a JSON blob. +| Name | Help | Type | Example | Read Only | +|------|------|------|---------|-----------| +| btime | Time of file birth (creation) with mS accuracy. Note that this is only writable on fresh uploads - it can\[aq]t be written for updates. | RFC 3339 | 2006-01-02T15:04:05.999Z07:00 | N | +| content-type | The MIME type of the file. | string | text/plain | N | +| copy-requires-writer-permission | Whether the options to copy, print, or download this file, should be disabled for readers and commenters. | boolean | true | N | +| description | A short description of the file. | string | Contract for signing | N | +| folder-color-rgb | The color for a folder or a shortcut to a folder as an RGB hex string. | string | 881133 | N | +| labels | Labels attached to this file in a JSON dump of Googled drive format. Enable with --drive-metadata-labels. | JSON | [] | N | +| mtime | Time of last modification with mS accuracy. | RFC 3339 | 2006-01-02T15:04:05.999Z07:00 | N | +| owner | The owner of the file. Usually an email address. Enable with --drive-metadata-owner. | string | user\[at]example.com | N | +| permissions | Permissions in a JSON dump of Google drive format. On shared drives these will only be present if they aren\[aq]t inherited. Enable with --drive-metadata-permissions. | JSON | {} | N | +| starred | Whether the user has starred the file. | boolean | false | N | +| viewed-by-me | Whether the file has been viewed by this user. | boolean | true | **Y** | +| writers-can-share | Whether users with only writer permission can modify the file\[aq]s permissions. Not populated for items in shared drives. | boolean | false | N | -Properties: +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -- Config: token -- Env Var: RCLONE_DRIVE_TOKEN -- Type: string -- Required: false +## Backend commands -#### --drive-auth-url +Here are the commands specific to the drive backend. -Auth server URL. +Run them with -Leave blank to use the provider defaults. + rclone backend COMMAND remote: -Properties: +The help below will explain what arguments each command takes. -- Config: auth_url -- Env Var: RCLONE_DRIVE_AUTH_URL -- Type: string -- Required: false +See the [backend](https://rclone.org/commands/rclone_backend/) command for more +info on how to pass options and arguments. -#### --drive-token-url +These can be run on a running backend using the rc command +[backend/command](https://rclone.org/rc/#backend-command). -Token server url. +### get -Leave blank to use the provider defaults. +Get command for fetching the drive config parameters -Properties: + rclone backend get remote: [options] [+] -- Config: token_url -- Env Var: RCLONE_DRIVE_TOKEN_URL -- Type: string -- Required: false +This is a get command which will be used to fetch the various drive config parameters -#### --drive-root-folder-id +Usage Examples: -ID of the root folder. -Leave blank normally. + rclone backend get drive: [-o service_account_file] [-o chunk_size] + rclone rc backend/command command=get fs=drive: [-o service_account_file] [-o chunk_size] -Fill in to access \[dq]Computers\[dq] folders (see docs), or for rclone to use -a non root folder as its starting point. +Options: -Properties: +- \[dq]chunk_size\[dq]: show the current upload chunk size +- \[dq]service_account_file\[dq]: show the current service account file -- Config: root_folder_id -- Env Var: RCLONE_DRIVE_ROOT_FOLDER_ID -- Type: string -- Required: false +### set -#### --drive-service-account-credentials +Set command for updating the drive config parameters -Service Account Credentials JSON blob. + rclone backend set remote: [options] [+] -Leave blank normally. -Needed only if you want use SA instead of interactive login. +This is a set command which will be used to update the various drive config parameters -Properties: +Usage Examples: -- Config: service_account_credentials -- Env Var: RCLONE_DRIVE_SERVICE_ACCOUNT_CREDENTIALS -- Type: string -- Required: false + rclone backend set drive: [-o service_account_file=sa.json] [-o chunk_size=67108864] + rclone rc backend/command command=set fs=drive: [-o service_account_file=sa.json] [-o chunk_size=67108864] + + +Options: + +- \[dq]chunk_size\[dq]: update the current upload chunk size +- \[dq]service_account_file\[dq]: update the current service account file + +### shortcut + +Create shortcuts from files or directories + + rclone backend shortcut remote: [options] [+] + +This command creates shortcuts from files or directories. + +Usage: + + rclone backend shortcut drive: source_item destination_shortcut + rclone backend shortcut drive: source_item -o target=drive2: destination_shortcut + +In the first example this creates a shortcut from the \[dq]source_item\[dq] +which can be a file or a directory to the \[dq]destination_shortcut\[dq]. The +\[dq]source_item\[dq] and the \[dq]destination_shortcut\[dq] should be relative paths +from \[dq]drive:\[dq] + +In the second example this creates a shortcut from the \[dq]source_item\[dq] +relative to \[dq]drive:\[dq] to the \[dq]destination_shortcut\[dq] relative to +\[dq]drive2:\[dq]. This may fail with a permission error if the user +authenticated with \[dq]drive2:\[dq] can\[aq]t read files from \[dq]drive:\[dq]. + + +Options: + +- \[dq]target\[dq]: optional target remote for the shortcut destination + +### drives + +List the Shared Drives available to this account + + rclone backend drives remote: [options] [+] + +This command lists the Shared Drives (Team Drives) available to this +account. + +Usage: + + rclone backend [-o config] drives drive: + +This will return a JSON list of objects like this + + [ + { + \[dq]id\[dq]: \[dq]0ABCDEF-01234567890\[dq], + \[dq]kind\[dq]: \[dq]drive#teamDrive\[dq], + \[dq]name\[dq]: \[dq]My Drive\[dq] + }, + { + \[dq]id\[dq]: \[dq]0ABCDEFabcdefghijkl\[dq], + \[dq]kind\[dq]: \[dq]drive#teamDrive\[dq], + \[dq]name\[dq]: \[dq]Test Drive\[dq] + } + ] -#### --drive-team-drive +With the -o config parameter it will output the list in a format +suitable for adding to a config file to make aliases for all the +drives found and a combined drive. -ID of the Shared Drive (Team Drive). + [My Drive] + type = alias + remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=: -Properties: + [Test Drive] + type = alias + remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=: -- Config: team_drive -- Env Var: RCLONE_DRIVE_TEAM_DRIVE -- Type: string -- Required: false + [AllDrives] + type = combine + upstreams = \[dq]My Drive=My Drive:\[dq] \[dq]Test Drive=Test Drive:\[dq] -#### --drive-auth-owner-only +Adding this to the rclone config file will cause those team drives to +be accessible with the aliases shown. Any illegal characters will be +substituted with \[dq]_\[dq] and duplicate names will have numbers suffixed. +It will also add a remote called AllDrives which shows all the shared +drives combined into one directory tree. -Only consider files owned by the authenticated user. -Properties: +### untrash -- Config: auth_owner_only -- Env Var: RCLONE_DRIVE_AUTH_OWNER_ONLY -- Type: bool -- Default: false +Untrash files and directories -#### --drive-use-trash + rclone backend untrash remote: [options] [+] -Send files to the trash instead of deleting permanently. +This command untrashes all the files and directories in the directory +passed in recursively. -Defaults to true, namely sending files to the trash. -Use \[ga]--drive-use-trash=false\[ga] to delete files permanently instead. +Usage: -Properties: +This takes an optional directory to trash which make this easier to +use via the API. -- Config: use_trash -- Env Var: RCLONE_DRIVE_USE_TRASH -- Type: bool -- Default: true + rclone backend untrash drive:directory + rclone backend --interactive untrash drive:directory subdir -#### --drive-copy-shortcut-content +Use the --interactive/-i or --dry-run flag to see what would be restored before restoring it. -Server side copy contents of shortcuts instead of the shortcut. +Result: -When doing server side copies, normally rclone will copy shortcuts as -shortcuts. + { + \[dq]Untrashed\[dq]: 17, + \[dq]Errors\[dq]: 0 + } -If this flag is used then rclone will copy the contents of shortcuts -rather than shortcuts themselves when doing server side copies. -Properties: +### copyid -- Config: copy_shortcut_content -- Env Var: RCLONE_DRIVE_COPY_SHORTCUT_CONTENT -- Type: bool -- Default: false +Copy files by ID -#### --drive-skip-gdocs + rclone backend copyid remote: [options] [+] -Skip google documents in all listings. +This command copies files by ID -If given, gdocs practically become invisible to rclone. +Usage: -Properties: + rclone backend copyid drive: ID path + rclone backend copyid drive: ID1 path1 ID2 path2 -- Config: skip_gdocs -- Env Var: RCLONE_DRIVE_SKIP_GDOCS -- Type: bool -- Default: false +It copies the drive file with ID given to the path (an rclone path which +will be passed internally to rclone copyto). The ID and path pairs can be +repeated. -#### --drive-skip-checksum-gphotos +The path should end with a / to indicate copy the file as named to +this directory. If it doesn\[aq]t end with a / then the last path +component will be used as the file name. -Skip MD5 checksum on Google photos and videos only. +If the destination is a drive backend then server-side copying will be +attempted if possible. -Use this if you get checksum errors when transferring Google photos or -videos. +Use the --interactive/-i or --dry-run flag to see what would be copied before copying. -Setting this flag will cause Google photos and videos to return a -blank MD5 checksum. -Google photos are identified by being in the \[dq]photos\[dq] space. +### exportformats -Corrupted checksums are caused by Google modifying the image/video but -not updating the checksum. +Dump the export formats for debug purposes -Properties: + rclone backend exportformats remote: [options] [+] -- Config: skip_checksum_gphotos -- Env Var: RCLONE_DRIVE_SKIP_CHECKSUM_GPHOTOS -- Type: bool -- Default: false +### importformats -#### --drive-shared-with-me +Dump the import formats for debug purposes -Only show files that are shared with me. + rclone backend importformats remote: [options] [+] -Instructs rclone to operate on your \[dq]Shared with me\[dq] folder (where -Google Drive lets you access the files and folders others have shared -with you). -This works both with the \[dq]list\[dq] (lsd, lsl, etc.) and the \[dq]copy\[dq] -commands (copy, sync, etc.), and with all other commands too. -Properties: +## Limitations -- Config: shared_with_me -- Env Var: RCLONE_DRIVE_SHARED_WITH_ME -- Type: bool -- Default: false +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 MiB/s but lots of +small files can take a long time. -#### --drive-trashed-only +Server side copies are also subject to a separate rate limit. If you +see User rate limit exceeded errors, wait at least 24 hours and retry. +You can disable server-side copies with \[ga]--disable copy\[ga] to download +and upload the files if you prefer. -Only show files that are in the trash. +### Limitations of Google Docs -This will show trashed files in their original directory structure. +Google docs will appear as size -1 in \[ga]rclone ls\[ga], \[ga]rclone ncdu\[ga] etc, +and as size 0 in anything which uses the VFS layer, e.g. \[ga]rclone mount\[ga] +and \[ga]rclone serve\[ga]. When calculating directory totals, e.g. in +\[ga]rclone size\[ga] and \[ga]rclone ncdu\[ga], they will be counted in as empty +files. -Properties: +This is because rclone can\[aq]t find out the size of the Google docs +without downloading them. -- Config: trashed_only -- Env Var: RCLONE_DRIVE_TRASHED_ONLY -- Type: bool -- Default: false +Google docs will transfer correctly with \[ga]rclone sync\[ga], \[ga]rclone copy\[ga] +etc as rclone knows to ignore the size when doing the transfer. -#### --drive-starred-only +However an unfortunate consequence of this is that you may not be able +to download Google docs using \[ga]rclone mount\[ga]. If it doesn\[aq]t work you +will get a 0 sized file. If you try again the doc may gain its +correct size and be downloadable. Whether it will work on not depends +on the application accessing the mount and the OS you are running - +experiment to find out if it does work for you! -Only show files that are starred. +### Duplicated files -Properties: +Sometimes, for no reason I\[aq]ve been able to track down, drive will +duplicate a file that rclone uploads. Drive unlike all the other +remotes can have duplicated files. -- Config: starred_only -- Env Var: RCLONE_DRIVE_STARRED_ONLY -- Type: bool -- Default: false +Duplicated files cause problems with the syncing and you will see +messages in the log about duplicates. -#### --drive-formats +Use \[ga]rclone dedupe\[ga] to fix duplicated files. -Deprecated: See export_formats. +Note that this isn\[aq]t just a problem with rclone, even Google Photos on +Android duplicates files on drive sometimes. -Properties: +### Rclone appears to be re-copying files it shouldn\[aq]t -- Config: formats -- Env Var: RCLONE_DRIVE_FORMATS -- Type: string -- Required: false +The most likely cause of this is the duplicated file issue above - run +\[ga]rclone dedupe\[ga] and check your logs for duplicate object or directory +messages. -#### --drive-export-formats +This can also be caused by a delay/caching on google drive\[aq]s end when +comparing directory listings. Specifically with team drives used in +combination with --fast-list. Files that were uploaded recently may +not appear on the directory list sent to rclone when using --fast-list. -Comma separated list of preferred formats for downloading Google docs. +Waiting a moderate period of time between attempts (estimated to be +approximately 1 hour) and/or not using --fast-list both seem to be +effective in preventing the problem. -Properties: +### SHA1 or SHA256 hashes may be missing -- Config: export_formats -- Env Var: RCLONE_DRIVE_EXPORT_FORMATS -- Type: string -- Default: \[dq]docx,xlsx,pptx,svg\[dq] +All files have MD5 hashes, but a small fraction of files uploaded may +not have SHA1 or SHA256 hashes especially if they were uploaded before 2018. -#### --drive-import-formats +## Making your own client_id -Comma separated list of preferred formats for uploading Google docs. +When you use rclone with Google drive in its default configuration you +are using rclone\[aq]s client_id. This is shared between all the rclone +users. There is a global rate limit on the number of queries per +second that each client_id can do set by Google. rclone already has a +high quota and I will continue to make sure it is high enough by +contacting Google. -Properties: +It is strongly recommended to use your own client ID as the default rclone ID is heavily used. If you have multiple services running, it is recommended to use an API key for each service. The default Google quota is 10 transactions per second so it is recommended to stay under that number as if you use more than that, it will cause rclone to rate limit and make things slower. -- Config: import_formats -- Env Var: RCLONE_DRIVE_IMPORT_FORMATS -- Type: string -- Required: false +Here is how to create your own Google Drive client ID for rclone: -#### --drive-allow-import-name-change +1. Log into the [Google API +Console](https://console.developers.google.com/) with your Google +account. It doesn\[aq]t matter what Google account you use. (It need not +be the same account as the Google Drive you want to access) -Allow the filetype to change when uploading Google docs. +2. Select a project or create a new project. -E.g. file.doc to file.docx. This will confuse sync and reupload every time. +3. Under \[dq]ENABLE APIS AND SERVICES\[dq] search for \[dq]Drive\[dq], and enable the +\[dq]Google Drive API\[dq]. -Properties: +4. Click \[dq]Credentials\[dq] in the left-side panel (not \[dq]Create +credentials\[dq], which opens the wizard). -- Config: allow_import_name_change -- Env Var: RCLONE_DRIVE_ALLOW_IMPORT_NAME_CHANGE -- Type: bool -- Default: false +5. If you already configured an \[dq]Oauth Consent Screen\[dq], then skip +to the next step; if not, click on \[dq]CONFIGURE CONSENT SCREEN\[dq] button +(near the top right corner of the right panel), then select \[dq]External\[dq] +and click on \[dq]CREATE\[dq]; on the next screen, enter an \[dq]Application name\[dq] +(\[dq]rclone\[dq] is OK); enter \[dq]User Support Email\[dq] (your own email is OK); +enter \[dq]Developer Contact Email\[dq] (your own email is OK); then click on +\[dq]Save\[dq] (all other data is optional). You will also have to add some scopes, +including \[ga].../auth/docs\[ga] and \[ga].../auth/drive\[ga] in order to be able to edit, +create and delete files with RClone. You may also want to include the +\[ga]../auth/drive.metadata.readonly\[ga] scope. After adding scopes, click +\[dq]Save and continue\[dq] to add test users. Be sure to add your own account to +the test users. Once you\[aq]ve added yourself as a test user and saved the +changes, click again on \[dq]Credentials\[dq] on the left panel to go back to +the \[dq]Credentials\[dq] screen. -#### --drive-use-created-date + (PS: if you are a GSuite user, you could also select \[dq]Internal\[dq] instead +of \[dq]External\[dq] above, but this will restrict API use to Google Workspace +users in your organisation). -Use file created date instead of modified date. +6. Click on the \[dq]+ CREATE CREDENTIALS\[dq] button at the top of the screen, +then select \[dq]OAuth client ID\[dq]. -Useful when downloading data and you want the creation date used in -place of the last modified date. +7. Choose an application type of \[dq]Desktop app\[dq] and click \[dq]Create\[dq]. (the default name is fine) -**WARNING**: This flag may have some unexpected consequences. +8. It will show you a client ID and client secret. Make a note of these. + + (If you selected \[dq]External\[dq] at Step 5 continue to Step 9. + If you chose \[dq]Internal\[dq] you don\[aq]t need to publish and can skip straight to + Step 10 but your destination drive must be part of the same Google Workspace.) -When uploading to your drive all files will be overwritten unless they -haven\[aq]t been modified since their creation. And the inverse will occur -while downloading. This side effect can be avoided by using the -\[dq]--checksum\[dq] flag. +9. Go to \[dq]Oauth consent screen\[dq] and then click \[dq]PUBLISH APP\[dq] button and confirm. + You will also want to add yourself as a test user. -This feature was implemented to retain photos capture date as recorded -by google photos. You will first need to check the \[dq]Create a Google -Photos folder\[dq] option in your google drive settings. You can then copy -or move the photos locally and use the date the image was taken -(created) set as the modification date. +10. Provide the noted client ID and client secret to rclone. -Properties: +Be aware that, due to the \[dq]enhanced security\[dq] recently introduced by +Google, you are theoretically expected to \[dq]submit your app for verification\[dq] +and then wait a few weeks(!) for their response; in practice, you can go right +ahead and use the client ID and client secret with rclone, the only issue will +be a very scary confirmation screen shown when you connect via your browser +for rclone to be able to get its token-id (but as this only happens during +the remote configuration, it\[aq]s not such a big deal). Keeping the application in +\[dq]Testing\[dq] will work as well, but the limitation is that any grants will expire +after a week, which can be annoying to refresh constantly. If, for whatever +reason, a short grant time is not a problem, then keeping the application in +testing mode would also be sufficient. -- Config: use_created_date -- Env Var: RCLONE_DRIVE_USE_CREATED_DATE -- Type: bool -- Default: false +(Thanks to \[at]balazer on github for these instructions.) -#### --drive-use-shared-date +Sometimes, creation of an OAuth consent in Google API Console fails due to an error message +\[lq]The request failed because changes to one of the field of the resource is not supported\[rq]. +As a convenient workaround, the necessary Google Drive API key can be created on the +[Python Quickstart](https://developers.google.com/drive/api/v3/quickstart/python) page. +Just push the Enable the Drive API button to receive the Client ID and Secret. +Note that it will automatically create a new project in the API Console. -Use date file was shared instead of modified date. +# Google Photos -Note that, as with \[dq]--drive-use-created-date\[dq], this flag may have -unexpected consequences when uploading/downloading files. +The rclone backend for [Google Photos](https://www.google.com/photos/about/) is +a specialized backend for transferring photos and videos to and from +Google Photos. -If both this flag and \[dq]--drive-use-created-date\[dq] are set, the created -date is used. +**NB** The Google Photos API which rclone uses has quite a few +limitations, so please read the [limitations section](#limitations) +carefully to make sure it is suitable for your use. -Properties: +## Configuration -- Config: use_shared_date -- Env Var: RCLONE_DRIVE_USE_SHARED_DATE -- Type: bool -- Default: false +The initial setup for google cloud storage involves getting a token from Google Photos +which you need to do in your browser. \[ga]rclone config\[ga] walks you +through it. -#### --drive-list-chunk +Here is an example of how to make a remote called \[ga]remote\[ga]. First run: -Size of listing chunk 100-1000, 0 to disable. + rclone config +This will guide you through an interactive setup process: +\f[R] +.fi +.PP +No remotes found, make a new one? +n) New remote s) Set configuration password q) Quit config n/s/q> n +name> remote Type of storage to configure. +Enter a string value. +Press Enter for the default (\[dq]\[dq]). +Choose a number from below, or type in your own value [snip] XX / Google +Photos \ \[dq]google photos\[dq] [snip] Storage> google photos ** See +help for google photos backend at: https://rclone.org/googlephotos/ ** +.PP +Google Application Client Id Leave blank normally. +Enter a string value. +Press Enter for the default (\[dq]\[dq]). +client_id> Google Application Client Secret Leave blank normally. +Enter a string value. +Press Enter for the default (\[dq]\[dq]). +client_secret> Set to make the Google Photos backend read only. +.PP +If you choose read only then rclone will only request read only access +to your photos, otherwise rclone will request full access. +Enter a boolean value (true or false). +Press Enter for the default (\[dq]false\[dq]). +read_only> Edit advanced config? +(y/n) y) Yes n) No y/n> n Remote config Use web browser to automatically +authenticate rclone with remote? +* Say Y if the machine running rclone has a web browser you can use * +Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. +If Y failed, try N. +y) Yes n) No y/n> y If your browser doesn\[aq]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 +.PP +*** IMPORTANT: All media items uploaded to Google Photos with rclone *** +are stored in full resolution at original quality. +These uploads *** will count towards storage in your Google Account. +.PP +.TS +tab(@); +lw(20.4n). +T{ +[remote] type = google photos token = +{\[dq]access_token\[dq]:\[dq]XXX\[dq],\[dq]token_type\[dq]:\[dq]Bearer\[dq],\[dq]refresh_token\[dq]:\[dq]XXX\[dq],\[dq]expiry\[dq]:\[dq]2019-06-28T17:38:04.644930156+01:00\[dq]} +T} +_ +T{ +y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y +\[ga]\[ga]\[ga] +T} +T{ +See the remote setup docs (https://rclone.org/remote_setup/) for how to +set it up on a machine with no Internet browser available. +T} +T{ +Note that rclone runs a webserver on your local machine to collect the +token as returned from Google if using web browser to automatically +authenticate. +This only runs from the moment it opens your browser to the moment you +get back the verification code. +This is on \f[C]http://127.0.0.1:53682/\f[R] and this may require you to +unblock it temporarily if you are running a host firewall, or use manual +mode. +T} +T{ +This remote is called \f[C]remote\f[R] and can now be used like this +T} +T{ +See all the albums in your photos +T} +T{ +rclone lsd remote:album +T} +T{ +Make a new album +T} +T{ +rclone mkdir remote:album/newAlbum +T} +T{ +List the contents of an album +T} +T{ +rclone ls remote:album/newAlbum +T} +T{ +Sync \f[C]/home/local/images\f[R] to the Google Photos, removing any +excess files in the album. +T} +T{ +rclone sync --interactive /home/local/image remote:album/newAlbum +T} +T{ +### Layout +T} +T{ +As Google Photos is not a general purpose cloud storage system, the +backend is laid out to help you navigate it. +T} +T{ +The directories under \f[C]media\f[R] show different ways of +categorizing the media. +Each file will appear multiple times. +So if you want to make a backup of your google photos you might choose +to backup \f[C]remote:media/by-month\f[R]. +(\f[B]NB\f[R] \f[C]remote:media/by-day\f[R] is rather slow at the moment +so avoid for syncing.) +T} +T{ +Note that all your photos and videos will appear somewhere under +\f[C]media\f[R], but they may not appear under \f[C]album\f[R] unless +you\[aq]ve put them into albums. +T} +T{ +\f[C]/ - upload - file1.jpg - file2.jpg - ... - media - all - file1.jpg - file2.jpg - ... - by-year - 2000 - file1.jpg - ... - 2001 - file2.jpg - ... - ... - by-month - 2000 - 2000-01 - file1.jpg - ... - 2000-02 - file2.jpg - ... - ... - by-day - 2000 - 2000-01-01 - file1.jpg - ... - 2000-01-02 - file2.jpg - ... - ... - album - album name - album name/sub - shared-album - album name - album name/sub - feature - favorites - file1.jpg - file2.jpg\f[R] +T} +T{ +There are two writable parts of the tree, the \f[C]upload\f[R] directory +and sub directories of the \f[C]album\f[R] directory. +T} +T{ +The \f[C]upload\f[R] directory is for uploading files you don\[aq]t want +to put into albums. +This will be empty to start with and will contain the files you\[aq]ve +uploaded for one rclone session only, becoming empty again when you +restart rclone. +The use case for this would be if you have a load of files you just want +to once off dump into Google Photos. +For repeated syncing, uploading to \f[C]album\f[R] will work better. +T} +T{ +Directories within the \f[C]album\f[R] directory are also writeable and +you may create new directories (albums) under \f[C]album\f[R]. +If you copy files with a directory hierarchy in there then rclone will +create albums with the \f[C]/\f[R] character in them. +For example if you do +T} +T{ +rclone copy /path/to/images remote:album/images +T} +T{ +and the images directory contains +T} +T{ +\f[C]images - file1.jpg dir file2.jpg dir2 dir3 file3.jpg\f[R] +T} +T{ +Then rclone will create the following albums with the following files in +T} +T{ +- images - file1.jpg - images/dir - file2.jpg - images/dir2/dir3 - +file3.jpg +T} +T{ +This means that you can use the \f[C]album\f[R] path pretty much like a +normal filesystem and it is a good target for repeated syncing. +T} +T{ +The \f[C]shared-album\f[R] directory shows albums shared with you or by +you. +This is similar to the Sharing tab in the Google Photos web interface. +T} +T{ +### Standard options +T} +T{ +Here are the Standard options specific to google photos (Google Photos). +T} +T{ +#### --gphotos-client-id +T} +T{ +OAuth Client Id. +T} +T{ +Leave blank normally. +T} +T{ +Properties: +T} +T{ +- Config: client_id - Env Var: RCLONE_GPHOTOS_CLIENT_ID - Type: string - +Required: false +T} +T{ +#### --gphotos-client-secret +T} +T{ +OAuth Client Secret. +T} +T{ +Leave blank normally. +T} +T{ Properties: - -- Config: list_chunk -- Env Var: RCLONE_DRIVE_LIST_CHUNK -- Type: int -- Default: 1000 - -#### --drive-impersonate - -Impersonate this user when using a service account. - +T} +T{ +- Config: client_secret - Env Var: RCLONE_GPHOTOS_CLIENT_SECRET - Type: +string - Required: false +T} +T{ +#### --gphotos-read-only +T} +T{ +Set to make the Google Photos backend read only. +T} +T{ +If you choose read only then rclone will only request read only access +to your photos, otherwise rclone will request full access. +T} +T{ Properties: - -- Config: impersonate -- Env Var: RCLONE_DRIVE_IMPERSONATE -- Type: string -- Required: false - -#### --drive-upload-cutoff - -Cutoff for switching to chunked upload. - +T} +T{ +- Config: read_only - Env Var: RCLONE_GPHOTOS_READ_ONLY - Type: bool - +Default: false +T} +T{ +### Advanced options +T} +T{ +Here are the Advanced options specific to google photos (Google Photos). +T} +T{ +#### --gphotos-token +T} +T{ +OAuth Access Token as a JSON blob. +T} +T{ Properties: - -- Config: upload_cutoff -- Env Var: RCLONE_DRIVE_UPLOAD_CUTOFF -- Type: SizeSuffix -- Default: 8Mi - -#### --drive-chunk-size - -Upload chunk size. - -Must a power of 2 >= 256k. - -Making this larger will improve performance, but note that each chunk -is buffered in memory one per transfer. - -Reducing this will reduce memory usage but decrease performance. - +T} +T{ +- Config: token - Env Var: RCLONE_GPHOTOS_TOKEN - Type: string - +Required: false +T} +T{ +#### --gphotos-auth-url +T} +T{ +Auth server URL. +T} +T{ +Leave blank to use the provider defaults. +T} +T{ Properties: - -- Config: chunk_size -- Env Var: RCLONE_DRIVE_CHUNK_SIZE -- Type: SizeSuffix -- Default: 8Mi - -#### --drive-acknowledge-abuse - -Set to allow files which return cannotDownloadAbusiveFile to be downloaded. - -If downloading a file returns the error \[dq]This file has been identified -as malware or spam and cannot be downloaded\[dq] with the error code -\[dq]cannotDownloadAbusiveFile\[dq] then supply this flag to rclone to -indicate you acknowledge the risks of downloading the file and rclone -will download it anyway. - -Note that if you are using service account it will need Manager -permission (not Content Manager) to for this flag to work. If the SA -does not have the right permission, Google will just ignore the flag. - +T} +T{ +- Config: auth_url - Env Var: RCLONE_GPHOTOS_AUTH_URL - Type: string - +Required: false +T} +T{ +#### --gphotos-token-url +T} +T{ +Token server url. +T} +T{ +Leave blank to use the provider defaults. +T} +T{ Properties: - -- Config: acknowledge_abuse -- Env Var: RCLONE_DRIVE_ACKNOWLEDGE_ABUSE -- Type: bool -- Default: false - -#### --drive-keep-revision-forever - -Keep new head revision of each file forever. - +T} +T{ +- Config: token_url - Env Var: RCLONE_GPHOTOS_TOKEN_URL - Type: string - +Required: false +T} +T{ +#### --gphotos-read-size +T} +T{ +Set to read the size of media items. +T} +T{ +Normally rclone does not read the size of media items since this takes +another transaction. +This isn\[aq]t necessary for syncing. +However rclone mount needs to know the size of files in advance of +reading them, so setting this flag when using rclone mount is +recommended if you want to read the media. +T} +T{ Properties: - -- Config: keep_revision_forever -- Env Var: RCLONE_DRIVE_KEEP_REVISION_FOREVER -- Type: bool -- Default: false - -#### --drive-size-as-quota - -Show sizes as storage quota usage, not actual size. - -Show the size of a file as the storage quota used. This is the -current version plus any older versions that have been set to keep -forever. - -**WARNING**: This flag may have some unexpected consequences. - -It is not recommended to set this flag in your config - the -recommended usage is using the flag form --drive-size-as-quota when -doing rclone ls/lsl/lsf/lsjson/etc only. - -If you do use this flag for syncing (not recommended) then you will -need to use --ignore size also. - +T} +T{ +- Config: read_size - Env Var: RCLONE_GPHOTOS_READ_SIZE - Type: bool - +Default: false +T} +T{ +#### --gphotos-start-year +T} +T{ +Year limits the photos to be downloaded to those which are uploaded +after the given year. +T} +T{ Properties: - -- Config: size_as_quota -- Env Var: RCLONE_DRIVE_SIZE_AS_QUOTA -- Type: bool -- Default: false - -#### --drive-v2-download-min-size - -If Object\[aq]s are greater, use drive v2 API to download. - +T} +T{ +- Config: start_year - Env Var: RCLONE_GPHOTOS_START_YEAR - Type: int - +Default: 2000 +T} +T{ +#### --gphotos-include-archived +T} +T{ +Also view and download archived media. +T} +T{ +By default, rclone does not request archived media. +Thus, when syncing, archived media is not visible in directory listings +or transferred. +T} +T{ +Note that media in albums is always visible and synced, no matter their +archive status. +T} +T{ +With this flag, archived media are always visible in directory listings +and transferred. +T} +T{ +Without this flag, archived media will not be visible in directory +listings and won\[aq]t be transferred. +T} +T{ Properties: - -- Config: v2_download_min_size -- Env Var: RCLONE_DRIVE_V2_DOWNLOAD_MIN_SIZE -- Type: SizeSuffix -- Default: off - -#### --drive-pacer-min-sleep - -Minimum time to sleep between API calls. - +T} +T{ +- Config: include_archived - Env Var: RCLONE_GPHOTOS_INCLUDE_ARCHIVED - +Type: bool - Default: false +T} +T{ +#### --gphotos-encoding +T} +T{ +The encoding for the backend. +T} +T{ +See the encoding section in the +overview (https://rclone.org/overview/#encoding) for more info. +T} +T{ Properties: - -- Config: pacer_min_sleep -- Env Var: RCLONE_DRIVE_PACER_MIN_SLEEP -- Type: Duration -- Default: 100ms - -#### --drive-pacer-burst - -Number of API calls to allow without sleeping. - +T} +T{ +- Config: encoding - Env Var: RCLONE_GPHOTOS_ENCODING - Type: Encoding - +Default: Slash,CrLf,InvalidUtf8,Dot +T} +T{ +#### --gphotos-batch-mode +T} +T{ +Upload file batching sync|async|off. +T} +T{ +This sets the batch mode used by rclone. +T} +T{ +This has 3 possible values +T} +T{ +- off - no batching - sync - batch uploads and check completion +(default) - async - batch upload and don\[aq]t check completion +T} +T{ +Rclone will close any outstanding batches when it exits which may make a +delay on quit. +T} +T{ Properties: - -- Config: pacer_burst -- Env Var: RCLONE_DRIVE_PACER_BURST -- Type: int -- Default: 100 - -#### --drive-server-side-across-configs - -Deprecated: use --server-side-across-configs instead. - -Allow server-side operations (e.g. copy) to work across different drive configs. - -This can be useful if you wish to do a server-side copy between two -different Google drives. Note that this isn\[aq]t enabled by default -because it isn\[aq]t easy to tell if it will work between any two -configurations. - +T} +T{ +- Config: batch_mode - Env Var: RCLONE_GPHOTOS_BATCH_MODE - Type: string +- Default: \[dq]sync\[dq] +T} +T{ +#### --gphotos-batch-size +T} +T{ +Max number of files in upload batch. +T} +T{ +This sets the batch size of files to upload. +It has to be less than 50. +T} +T{ +By default this is 0 which means rclone which calculate the batch size +depending on the setting of batch_mode. +T} +T{ +- batch_mode: async - default batch_size is 50 - batch_mode: sync - +default batch_size is the same as --transfers - batch_mode: off - not in +use +T} +T{ +Rclone will close any outstanding batches when it exits which may make a +delay on quit. +T} +T{ +Setting this is a great idea if you are uploading lots of small files as +it will make them a lot quicker. +You can use --transfers 32 to maximise throughput. +T} +T{ Properties: - -- Config: server_side_across_configs -- Env Var: RCLONE_DRIVE_SERVER_SIDE_ACROSS_CONFIGS -- Type: bool -- Default: false - -#### --drive-disable-http2 - -Disable drive using http2. - -There is currently an unsolved issue with the google drive backend and -HTTP/2. HTTP/2 is therefore disabled by default for the drive backend -but can be re-enabled here. When the issue is solved this flag will -be removed. - -See: https://github.com/rclone/rclone/issues/3631 - - - +T} +T{ +- Config: batch_size - Env Var: RCLONE_GPHOTOS_BATCH_SIZE - Type: int - +Default: 0 +T} +T{ +#### --gphotos-batch-timeout +T} +T{ +Max time to allow an idle upload batch before uploading. +T} +T{ +If an upload batch is idle for more than this long then it will be +uploaded. +T} +T{ +The default for this is 0 which means rclone will choose a sensible +default based on the batch_mode in use. +T} +T{ +- batch_mode: async - default batch_timeout is 10s - batch_mode: sync - +default batch_timeout is 1s - batch_mode: off - not in use +T} +T{ Properties: - -- Config: disable_http2 -- Env Var: RCLONE_DRIVE_DISABLE_HTTP2 -- Type: bool -- Default: true - -#### --drive-stop-on-upload-limit - -Make upload limit errors be fatal. - -At the time of writing it is only possible to upload 750 GiB of data to -Google Drive a day (this is an undocumented limit). When this limit is -reached Google Drive produces a slightly different error message. When -this flag is set it causes these errors to be fatal. These will stop -the in-progress sync. - -Note that this detection is relying on error message strings which -Google don\[aq]t document so it may break in the future. - -See: https://github.com/rclone/rclone/issues/3857 - - +T} +T{ +- Config: batch_timeout - Env Var: RCLONE_GPHOTOS_BATCH_TIMEOUT - Type: +Duration - Default: 0s +T} +T{ +#### --gphotos-batch-commit-timeout +T} +T{ +Max time to wait for a batch to finish committing +T} +T{ Properties: +T} +T{ +- Config: batch_commit_timeout - Env Var: +RCLONE_GPHOTOS_BATCH_COMMIT_TIMEOUT - Type: Duration - Default: 10m0s +T} +T{ +## Limitations +T} +T{ +Only images and videos can be uploaded. +If you attempt to upload non videos or images or formats that Google +Photos doesn\[aq]t understand, rclone will upload the file, then Google +Photos will give an error when it is put turned into a media item. +T} +T{ +Note that all media items uploaded to Google Photos through the API are +stored in full resolution at \[dq]original quality\[dq] and +\f[B]will\f[R] count towards your storage quota in your Google Account. +The API does \f[B]not\f[R] offer a way to upload in \[dq]high +quality\[dq] mode.. +T} +T{ +\f[C]rclone about\f[R] is not supported by the Google Photos backend. +Backends without this capability cannot determine free space for an +rclone mount or use policy \f[C]mfs\f[R] (most free space) as a member +of an rclone union remote. +T} +T{ +See List of backends that do not support rclone +about (https://rclone.org/overview/#optional-features) See rclone +about (https://rclone.org/commands/rclone_about/) +T} +T{ +### Downloading Images +T} +T{ +When Images are downloaded this strips EXIF location (according to the +docs and my tests). +This is a limitation of the Google Photos API and is covered by bug +#112096115 (https://issuetracker.google.com/issues/112096115). +T} +T{ +\f[B]The current google API does not allow photos to be downloaded at +original resolution. This is very important if you are, for example, +relying on \[dq]Google Photos\[dq] as a backup of your photos. You will +not be able to use rclone to redownload original images. You could use +\[aq]google takeout\[aq] to recover the original photos as a last +resort\f[R] +T} +T{ +### Downloading Videos +T} +T{ +When videos are downloaded they are downloaded in a really compressed +version of the video compared to downloading it via the Google Photos +web interface. +This is covered by bug +#113672044 (https://issuetracker.google.com/issues/113672044). +T} +T{ +### Duplicates +T} +T{ +If a file name is duplicated in a directory then rclone will add the +file ID into its name. +So two files called \f[C]file.jpg\f[R] would then appear as +\f[C]file {123456}.jpg\f[R] and \f[C]file {ABCDEF}.jpg\f[R] (the actual +IDs are a lot longer alas!). +T} +T{ +If you upload the same image (with the same binary data) twice then +Google Photos will deduplicate it. +However it will retain the filename from the first upload which may +confuse rclone. +For example if you uploaded an image to \f[C]upload\f[R] then uploaded +the same image to \f[C]album/my_album\f[R] the filename of the image in +\f[C]album/my_album\f[R] will be what it was uploaded with initially, +not what you uploaded it with to \f[C]album\f[R]. +In practise this shouldn\[aq]t cause too many problems. +T} +T{ +### Modification times +T} +T{ +The date shown of media in Google Photos is the creation date as +determined by the EXIF information, or the upload date if that is not +known. +T} +T{ +This is not changeable by rclone and is not the modification date of the +media on local disk. +This means that rclone cannot use the dates from Google Photos for +syncing purposes. +T} +T{ +### Size +T} +T{ +The Google Photos API does not return the size of media. +This means that when syncing to Google Photos, rclone can only do a file +existence check. +T} +T{ +It is possible to read the size of the media, but this needs an extra +HTTP HEAD request per media item so is \f[B]very slow\f[R] and uses up a +lot of transactions. +This can be enabled with the \f[C]--gphotos-read-size\f[R] option or the +\f[C]read_size = true\f[R] config parameter. +T} +T{ +If you want to use the backend with \f[C]rclone mount\f[R] you may need +to enable this flag (depending on your OS and application using the +photos) otherwise you may not be able to read media off the mount. +You\[aq]ll need to experiment to see if it works for you without the +flag. +T} +T{ +### Albums +T} +T{ +Rclone can only upload files to albums it created. +This is a limitation of the Google Photos +API (https://developers.google.com/photos/library/guides/manage-albums). +T} +T{ +Rclone can remove files it uploaded from albums it created only. +T} +T{ +### Deleting files +T} +T{ +Rclone can remove files from albums it created, but note that the Google +Photos API does not allow media to be deleted permanently so this media +will still remain. +See bug #109759781 (https://issuetracker.google.com/issues/109759781). +T} +T{ +Rclone cannot delete files anywhere except under \f[C]album\f[R]. +T} +T{ +### Deleting albums +T} +T{ +The Google Photos API does not support deleting albums - see bug +#135714733 (https://issuetracker.google.com/issues/135714733). +T} +T{ +# Hasher +T} +T{ +Hasher is a special overlay backend to create remotes which handle +checksums for other remotes. +It\[aq]s main functions include: - Emulate hash types unimplemented by +backends - Cache checksums to help with slow hashing of large local or +(S)FTP files - Warm up checksum cache from external SUM files +T} +T{ +## Getting started +T} +T{ +To use Hasher, first set up the underlying remote following the +configuration instructions for that remote. +You can also use a local pathname instead of a remote. +Check that your base remote is working. +T} +T{ +Let\[aq]s call the base remote \f[C]myRemote:path\f[R] here. +Note that anything inside \f[C]myRemote:path\f[R] will be handled by +hasher and anything outside won\[aq]t. +This means that if you are using a bucket based remote (S3, B2, Swift) +then you should put the bucket in the remote \f[C]s3:bucket\f[R]. +T} +T{ +Now proceed to interactive or manual configuration. +T} +T{ +### Interactive configuration +T} +T{ +Run \f[C]rclone config\f[R]: \[ga]\[ga]\[ga] No remotes found, make a +new one? +n) New remote s) Set configuration password q) Quit config n/s/q> n +name> Hasher1 Type of storage to configure. +Choose a number from below, or type in your own value [snip] XX / Handle +checksums for other remotes \ \[dq]hasher\[dq] [snip] Storage> hasher +Remote to cache checksums for, like myremote:mypath. +Enter a string value. +Press Enter for the default (\[dq]\[dq]). +remote> myRemote:path Comma separated list of supported checksum types. +Enter a string value. +Press Enter for the default (\[dq]md5,sha1\[dq]). +hashsums> md5 Maximum time to keep checksums in cache. +0 = no cache, off = cache forever. +max_age> off Edit advanced config? +(y/n) y) Yes n) No y/n> n Remote config +T} +.TE +.PP +[Hasher1] type = hasher remote = myRemote:path hashsums = md5 max_age = +off -------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y +.IP +.nf +\f[C] +### Manual configuration -- Config: stop_on_upload_limit -- Env Var: RCLONE_DRIVE_STOP_ON_UPLOAD_LIMIT -- Type: bool -- Default: false +Run \[ga]rclone config path\[ga] to see the path of current active config file, +usually \[ga]YOURHOME/.config/rclone/rclone.conf\[ga]. +Open it in your favorite text editor, find section for the base remote +and create new section for hasher like in the following examples: +\f[R] +.fi +.PP +[Hasher1] type = hasher remote = myRemote:path hashes = md5 max_age = +off +.PP +[Hasher2] type = hasher remote = /local/path hashes = dropbox,sha1 +max_age = 24h +.IP +.nf +\f[C] +Hasher takes basically the following parameters: +- \[ga]remote\[ga] is required, +- \[ga]hashes\[ga] is a comma separated list of supported checksums + (by default \[ga]md5,sha1\[ga]), +- \[ga]max_age\[ga] - maximum time to keep a checksum value in the cache, + \[ga]0\[ga] will disable caching completely, + \[ga]off\[ga] will cache \[dq]forever\[dq] (that is until the files get changed). -#### --drive-stop-on-download-limit +Make sure the \[ga]remote\[ga] has \[ga]:\[ga] (colon) in. If you specify the remote without +a colon then rclone will use a local directory of that name. So if you use +a remote of \[ga]/local/path\[ga] then rclone will handle hashes for that directory. +If you use \[ga]remote = name\[ga] literally then rclone will put files +**in a directory called \[ga]name\[ga] located under current directory**. -Make download limit errors be fatal. +## Usage -At the time of writing it is only possible to download 10 TiB of data from -Google Drive a day (this is an undocumented limit). When this limit is -reached Google Drive produces a slightly different error message. When -this flag is set it causes these errors to be fatal. These will stop -the in-progress sync. +### Basic operations -Note that this detection is relying on error message strings which -Google don\[aq]t document so it may break in the future. +Now you can use it as \[ga]Hasher2:subdir/file\[ga] instead of base remote. +Hasher will transparently update cache with new checksums when a file +is fully read or overwritten, like: +\f[R] +.fi +.PP +rclone copy External:path/file Hasher:dest/path +.PP +rclone cat Hasher:path/to/file > /dev/null +.IP +.nf +\f[C] +The way to refresh **all** cached checksums (even unsupported by the base backend) +for a subtree is to **re-download** all files in the subtree. For example, +use \[ga]hashsum --download\[ga] using **any** supported hashsum on the command line +(we just care to re-read): +\f[R] +.fi +.PP +rclone hashsum MD5 --download Hasher:path/to/subtree > /dev/null +.PP +rclone backend dump Hasher:path/to/subtree +.IP +.nf +\f[C] +You can print or drop hashsum cache using custom backend commands: +\f[R] +.fi +.PP +rclone backend dump Hasher:dir/subdir +.PP +rclone backend drop Hasher: +.IP +.nf +\f[C] +### Pre-Seed from a SUM File +Hasher supports two backend commands: generic SUM file \[ga]import\[ga] and faster +but less consistent \[ga]stickyimport\[ga]. +\f[R] +.fi +.PP +rclone backend import Hasher:dir/subdir SHA1 /path/to/SHA1SUM +[--checkers 4] +.IP +.nf +\f[C] +Instead of SHA1 it can be any hash supported by the remote. The last argument +can point to either a local or an \[ga]other-remote:path\[ga] text file in SUM format. +The command will parse the SUM file, then walk down the path given by the +first argument, snapshot current fingerprints and fill in the cache entries +correspondingly. +- Paths in the SUM file are treated as relative to \[ga]hasher:dir/subdir\[ga]. +- The command will **not** check that supplied values are correct. + You **must know** what you are doing. +- This is a one-time action. The SUM file will not get \[dq]attached\[dq] to the + remote. Cache entries can still be overwritten later, should the object\[aq]s + fingerprint change. +- The tree walk can take long depending on the tree size. You can increase + \[ga]--checkers\[ga] to make it faster. Or use \[ga]stickyimport\[ga] if you don\[aq]t care + about fingerprints and consistency. +\f[R] +.fi +.PP +rclone backend stickyimport hasher:path/to/data sha1 +remote:/path/to/sum.sha1 +.IP +.nf +\f[C] +\[ga]stickyimport\[ga] is similar to \[ga]import\[ga] but works much faster because it +does not need to stat existing files and skips initial tree walk. +Instead of binding cache entries to file fingerprints it creates _sticky_ +entries bound to the file name alone ignoring size, modification time etc. +Such hash entries can be replaced only by \[ga]purge\[ga], \[ga]delete\[ga], \[ga]backend drop\[ga] +or by full re-read/re-write of the files. -Properties: +## Configuration reference -- Config: stop_on_download_limit -- Env Var: RCLONE_DRIVE_STOP_ON_DOWNLOAD_LIMIT -- Type: bool -- Default: false -#### --drive-skip-shortcuts +### Standard options -If set skip shortcut files. +Here are the Standard options specific to hasher (Better checksums for other remotes). -Normally rclone dereferences shortcut files making them appear as if -they are the original file (see [the shortcuts section](#shortcuts)). -If this flag is set then rclone will ignore shortcut files completely. +#### --hasher-remote +Remote to cache checksums for (e.g. myRemote:path). Properties: -- Config: skip_shortcuts -- Env Var: RCLONE_DRIVE_SKIP_SHORTCUTS -- Type: bool -- Default: false - -#### --drive-skip-dangling-shortcuts - -If set skip dangling shortcut files. +- Config: remote +- Env Var: RCLONE_HASHER_REMOTE +- Type: string +- Required: true -If this is set then rclone will not show any dangling shortcuts in listings. +#### --hasher-hashes +Comma separated list of supported checksum types. Properties: -- Config: skip_dangling_shortcuts -- Env Var: RCLONE_DRIVE_SKIP_DANGLING_SHORTCUTS -- Type: bool -- Default: false - -#### --drive-resource-key - -Resource key for accessing a link-shared file. - -If you need to access files shared with a link like this - - https://drive.google.com/drive/folders/XXX?resourcekey=YYY&usp=sharing - -Then you will need to use the first part \[dq]XXX\[dq] as the \[dq]root_folder_id\[dq] -and the second part \[dq]YYY\[dq] as the \[dq]resource_key\[dq] otherwise you will get -404 not found errors when trying to access the directory. - -See: https://developers.google.com/drive/api/guides/resource-keys - -This resource key requirement only applies to a subset of old files. +- Config: hashes +- Env Var: RCLONE_HASHER_HASHES +- Type: CommaSepList +- Default: md5,sha1 -Note also that opening the folder once in the web interface (with the -user you\[aq]ve authenticated rclone with) seems to be enough so that the -resource key is not needed. +#### --hasher-max-age +Maximum time to keep checksums in cache (0 = no cache, off = cache forever). Properties: -- Config: resource_key -- Env Var: RCLONE_DRIVE_RESOURCE_KEY -- Type: string -- Required: false - -#### --drive-fast-list-bug-fix - -Work around a bug in Google Drive listing. - -Normally rclone will work around a bug in Google Drive when using ---fast-list (ListR) where the search \[dq](A in parents) or (B in -parents)\[dq] returns nothing sometimes. See #3114, #4289 and -https://issuetracker.google.com/issues/149522397 - -Rclone detects this by finding no items in more than one directory -when listing and retries them as lists of individual directories. - -This means that if you have a lot of empty directories rclone will end -up listing them all individually and this can take many more API -calls. - -This flag allows the work-around to be disabled. This is **not** -recommended in normal use - only if you have a particular case you are -having trouble with like many empty directories. - - -Properties: +- Config: max_age +- Env Var: RCLONE_HASHER_MAX_AGE +- Type: Duration +- Default: off -- Config: fast_list_bug_fix -- Env Var: RCLONE_DRIVE_FAST_LIST_BUG_FIX -- Type: bool -- Default: true +### Advanced options -#### --drive-encoding +Here are the Advanced options specific to hasher (Better checksums for other remotes). -The encoding for the backend. +#### --hasher-auto-size -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Auto-update checksum for files smaller than this size (disabled by default). Properties: -- Config: encoding -- Env Var: RCLONE_DRIVE_ENCODING -- Type: MultiEncoder -- Default: InvalidUtf8 - -#### --drive-env-auth - -Get IAM credentials from runtime (environment variables or instance meta data if no env vars). +- Config: auto_size +- Env Var: RCLONE_HASHER_AUTO_SIZE +- Type: SizeSuffix +- Default: 0 -Only applies if service_account_file and service_account_credentials is blank. +### Metadata -Properties: +Any metadata supported by the underlying remote is read and written. -- Config: env_auth -- Env Var: RCLONE_DRIVE_ENV_AUTH -- Type: bool -- Default: false -- Examples: - - \[dq]false\[dq] - - Enter credentials in the next step. - - \[dq]true\[dq] - - Get GCP IAM credentials from the environment (env vars or IAM). +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. ## Backend commands -Here are the commands specific to the drive backend. +Here are the commands specific to the hasher backend. Run them with @@ -43182,1596 +43440,1769 @@ info on how to pass options and arguments. These can be run on a running backend using the rc command [backend/command](https://rclone.org/rc/#backend-command). -### get +### drop -Get command for fetching the drive config parameters +Drop cache - rclone backend get remote: [options] [+] + rclone backend drop remote: [options] [+] -This is a get command which will be used to fetch the various drive config parameters +Completely drop checksum cache. +Usage Example: + rclone backend drop hasher: -Usage Examples: - rclone backend get drive: [-o service_account_file] [-o chunk_size] - rclone rc backend/command command=get fs=drive: [-o service_account_file] [-o chunk_size] +### dump +Dump the database -Options: + rclone backend dump remote: [options] [+] -- \[dq]chunk_size\[dq]: show the current upload chunk size -- \[dq]service_account_file\[dq]: show the current service account file +Dump cache records covered by the current remote -### set +### fulldump -Set command for updating the drive config parameters +Full dump of the database - rclone backend set remote: [options] [+] + rclone backend fulldump remote: [options] [+] -This is a set command which will be used to update the various drive config parameters +Dump all cache records in the database -Usage Examples: +### import - rclone backend set drive: [-o service_account_file=sa.json] [-o chunk_size=67108864] - rclone rc backend/command command=set fs=drive: [-o service_account_file=sa.json] [-o chunk_size=67108864] +Import a SUM file + rclone backend import remote: [options] [+] -Options: +Amend hash cache from a SUM file and bind checksums to files by size/time. +Usage Example: + rclone backend import hasher:subdir md5 /path/to/sum.md5 -- \[dq]chunk_size\[dq]: update the current upload chunk size -- \[dq]service_account_file\[dq]: update the current service account file -### shortcut +### stickyimport -Create shortcuts from files or directories +Perform fast import of a SUM file - rclone backend shortcut remote: [options] [+] + rclone backend stickyimport remote: [options] [+] -This command creates shortcuts from files or directories. +Fill hash cache from a SUM file without verifying file fingerprints. +Usage Example: + rclone backend stickyimport hasher:subdir md5 remote:path/to/sum.md5 -Usage: - rclone backend shortcut drive: source_item destination_shortcut - rclone backend shortcut drive: source_item -o target=drive2: destination_shortcut -In the first example this creates a shortcut from the \[dq]source_item\[dq] -which can be a file or a directory to the \[dq]destination_shortcut\[dq]. The -\[dq]source_item\[dq] and the \[dq]destination_shortcut\[dq] should be relative paths -from \[dq]drive:\[dq] -In the second example this creates a shortcut from the \[dq]source_item\[dq] -relative to \[dq]drive:\[dq] to the \[dq]destination_shortcut\[dq] relative to -\[dq]drive2:\[dq]. This may fail with a permission error if the user -authenticated with \[dq]drive2:\[dq] can\[aq]t read files from \[dq]drive:\[dq]. +## Implementation details (advanced) +This section explains how various rclone operations work on a hasher remote. -Options: +**Disclaimer. This section describes current implementation which can +change in future rclone versions!.** -- \[dq]target\[dq]: optional target remote for the shortcut destination +### Hashsum command -### drives +The \[ga]rclone hashsum\[ga] (or \[ga]md5sum\[ga] or \[ga]sha1sum\[ga]) command will: -List the Shared Drives available to this account +1. if requested hash is supported by lower level, just pass it. +2. if object size is below \[ga]auto_size\[ga] then download object and calculate + _requested_ hashes on the fly. +3. if unsupported and the size is big enough, build object \[ga]fingerprint\[ga] + (including size, modtime if supported, first-found _other_ hash if any). +4. if the strict match is found in cache for the requested remote, return + the stored hash. +5. if remote found but fingerprint mismatched, then purge the entry and + proceed to step 6. +6. if remote not found or had no requested hash type or after step 5: + download object, calculate all _supported_ hashes on the fly and store + in cache; return requested hash. - rclone backend drives remote: [options] [+] +### Other operations -This command lists the Shared Drives (Team Drives) available to this -account. +- whenever a file is uploaded or downloaded **in full**, capture the stream + to calculate all supported hashes on the fly and update database +- server-side \[ga]move\[ga] will update keys of existing cache entries +- \[ga]deletefile\[ga] will remove a single cache entry +- \[ga]purge\[ga] will remove all cache entries under the purged path -Usage: +Note that setting \[ga]max_age = 0\[ga] will disable checksum caching completely. - rclone backend [-o config] drives drive: +If you set \[ga]max_age = off\[ga], checksums in cache will never age, unless you +fully rewrite or delete the file. -This will return a JSON list of objects like this +### Cache storage - [ - { - \[dq]id\[dq]: \[dq]0ABCDEF-01234567890\[dq], - \[dq]kind\[dq]: \[dq]drive#teamDrive\[dq], - \[dq]name\[dq]: \[dq]My Drive\[dq] - }, - { - \[dq]id\[dq]: \[dq]0ABCDEFabcdefghijkl\[dq], - \[dq]kind\[dq]: \[dq]drive#teamDrive\[dq], - \[dq]name\[dq]: \[dq]Test Drive\[dq] - } - ] +Cached checksums are stored as \[ga]bolt\[ga] database files under rclone cache +directory, usually \[ga]\[ti]/.cache/rclone/kv/\[ga]. Databases are maintained +one per _base_ backend, named like \[ga]BaseRemote\[ti]hasher.bolt\[ga]. +Checksums for multiple \[ga]alias\[ga]-es into a single base backend +will be stored in the single database. All local paths are treated as +aliases into the \[ga]local\[ga] backend (unless encrypted or chunked) and stored +in \[ga]\[ti]/.cache/rclone/kv/local\[ti]hasher.bolt\[ga]. +Databases can be shared between multiple rclone processes. -With the -o config parameter it will output the list in a format -suitable for adding to a config file to make aliases for all the -drives found and a combined drive. +# HDFS - [My Drive] - type = alias - remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=: +[HDFS](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html) is a +distributed file-system, part of the [Apache Hadoop](https://hadoop.apache.org/) framework. + +Paths are specified as \[ga]remote:\[ga] or \[ga]remote:path/to/dir\[ga]. + +## Configuration + +Here is an example of how to make a remote called \[ga]remote\[ga]. First run: + + rclone config + +This will guide you through an interactive setup process: +\f[R] +.fi +.PP +No remotes found, make a new one? +n) New remote s) Set configuration password q) Quit config n/s/q> n +name> remote Type of storage to configure. +Enter a string value. +Press Enter for the default (\[dq]\[dq]). +Choose a number from below, or type in your own value [skip] XX / Hadoop +distributed file system \ \[dq]hdfs\[dq] [skip] Storage> hdfs ** See +help for hdfs backend at: https://rclone.org/hdfs/ ** +.PP +hadoop name node and port Enter a string value. +Press Enter for the default (\[dq]\[dq]). +Choose a number from below, or type in your own value 1 / Connect to +host namenode at port 8020 \ \[dq]namenode:8020\[dq] namenode> +namenode.hadoop:8020 hadoop user name Enter a string value. +Press Enter for the default (\[dq]\[dq]). +Choose a number from below, or type in your own value 1 / Connect to +hdfs as root \ \[dq]root\[dq] username> root Edit advanced config? +(y/n) y) Yes n) No (default) y/n> n Remote config -------------------- +[remote] type = hdfs namenode = namenode.hadoop:8020 username = root +-------------------- y) Yes this is OK (default) e) Edit this remote d) +Delete this remote y/e/d> y Current remotes: +.PP +Name Type ==== ==== hadoop hdfs +.IP "e)" 3 +Edit existing remote +.IP "f)" 3 +New remote +.IP "g)" 3 +Delete remote +.IP "h)" 3 +Rename remote +.IP "i)" 3 +Copy remote +.IP "j)" 3 +Set configuration password +.IP "k)" 3 +Quit config e/n/d/r/c/s/q> q +.IP +.nf +\f[C] +This remote is called \[ga]remote\[ga] and can now be used like this + +See all the top level directories + + rclone lsd remote: - [Test Drive] - type = alias - remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=: +List the contents of a directory - [AllDrives] - type = combine - upstreams = \[dq]My Drive=My Drive:\[dq] \[dq]Test Drive=Test Drive:\[dq] + rclone ls remote:directory -Adding this to the rclone config file will cause those team drives to -be accessible with the aliases shown. Any illegal characters will be -substituted with \[dq]_\[dq] and duplicate names will have numbers suffixed. -It will also add a remote called AllDrives which shows all the shared -drives combined into one directory tree. +Sync the remote \[ga]directory\[ga] to \[ga]/home/local/directory\[ga], deleting any excess files. + rclone sync --interactive remote:directory /home/local/directory -### untrash +### Setting up your own HDFS instance for testing -Untrash files and directories +You may start with a [manual setup](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/SingleCluster.html) +or use the docker image from the tests: - rclone backend untrash remote: [options] [+] +If you want to build the docker image +\f[R] +.fi +.PP +git clone https://github.com/rclone/rclone.git cd +rclone/fstest/testserver/images/test-hdfs docker build --rm -t +rclone/test-hdfs . +.IP +.nf +\f[C] +Or you can just use the latest one pushed +\f[R] +.fi +.PP +docker run --rm --name \[dq]rclone-hdfs\[dq] -p 127.0.0.1:9866:9866 -p +127.0.0.1:8020:8020 --hostname \[dq]rclone-hdfs\[dq] rclone/test-hdfs +.IP +.nf +\f[C] +**NB** it need few seconds to startup. -This command untrashes all the files and directories in the directory -passed in recursively. +For this docker image the remote needs to be configured like this: +\f[R] +.fi +.PP +[remote] type = hdfs namenode = 127.0.0.1:8020 username = root +.IP +.nf +\f[C] +You can stop this image with \[ga]docker kill rclone-hdfs\[ga] (**NB** it does not use volumes, so all data +uploaded will be lost.) -Usage: +### Modification times -This takes an optional directory to trash which make this easier to -use via the API. +Time accurate to 1 second is stored. - rclone backend untrash drive:directory - rclone backend --interactive untrash drive:directory subdir +### Checksum -Use the --interactive/-i or --dry-run flag to see what would be restored before restoring it. +No checksums are implemented. -Result: +### Usage information - { - \[dq]Untrashed\[dq]: 17, - \[dq]Errors\[dq]: 0 - } +You can use the \[ga]rclone about remote:\[ga] command which will display filesystem size and current usage. +### Restricted filename characters -### copyid +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) +the following characters are also replaced: -Copy files by ID +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| : | 0x3A | \[uFF1A] | - rclone backend copyid remote: [options] [+] +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8). -This command copies files by ID -Usage: +### Standard options - rclone backend copyid drive: ID path - rclone backend copyid drive: ID1 path1 ID2 path2 +Here are the Standard options specific to hdfs (Hadoop distributed file system). -It copies the drive file with ID given to the path (an rclone path which -will be passed internally to rclone copyto). The ID and path pairs can be -repeated. +#### --hdfs-namenode -The path should end with a / to indicate copy the file as named to -this directory. If it doesn\[aq]t end with a / then the last path -component will be used as the file name. +Hadoop name nodes and ports. -If the destination is a drive backend then server-side copying will be -attempted if possible. +E.g. \[dq]namenode-1:8020,namenode-2:8020,...\[dq] to connect to host namenodes at port 8020. -Use the --interactive/-i or --dry-run flag to see what would be copied before copying. +Properties: +- Config: namenode +- Env Var: RCLONE_HDFS_NAMENODE +- Type: CommaSepList +- Default: -### exportformats +#### --hdfs-username -Dump the export formats for debug purposes +Hadoop user name. - rclone backend exportformats remote: [options] [+] +Properties: -### importformats +- Config: username +- Env Var: RCLONE_HDFS_USERNAME +- Type: string +- Required: false +- Examples: + - \[dq]root\[dq] + - Connect to hdfs as root. -Dump the import formats for debug purposes +### Advanced options - rclone backend importformats remote: [options] [+] +Here are the Advanced options specific to hdfs (Hadoop distributed file system). +#### --hdfs-service-principal-name +Kerberos service principal name for the namenode. -## Limitations +Enables KERBEROS authentication. Specifies the Service Principal Name +(SERVICE/FQDN) for the namenode. E.g. \[rs]\[dq]hdfs/namenode.hadoop.docker\[rs]\[dq] +for namenode running as service \[aq]hdfs\[aq] with FQDN \[aq]namenode.hadoop.docker\[aq]. -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 MiB/s but lots of -small files can take a long time. +Properties: -Server side copies are also subject to a separate rate limit. If you -see User rate limit exceeded errors, wait at least 24 hours and retry. -You can disable server-side copies with \[ga]--disable copy\[ga] to download -and upload the files if you prefer. +- Config: service_principal_name +- Env Var: RCLONE_HDFS_SERVICE_PRINCIPAL_NAME +- Type: string +- Required: false -### Limitations of Google Docs +#### --hdfs-data-transfer-protection -Google docs will appear as size -1 in \[ga]rclone ls\[ga], \[ga]rclone ncdu\[ga] etc, -and as size 0 in anything which uses the VFS layer, e.g. \[ga]rclone mount\[ga] -and \[ga]rclone serve\[ga]. When calculating directory totals, e.g. in -\[ga]rclone size\[ga] and \[ga]rclone ncdu\[ga], they will be counted in as empty -files. +Kerberos data transfer protection: authentication|integrity|privacy. -This is because rclone can\[aq]t find out the size of the Google docs -without downloading them. +Specifies whether or not authentication, data signature integrity +checks, and wire encryption are required when communicating with +the datanodes. Possible values are \[aq]authentication\[aq], \[aq]integrity\[aq] +and \[aq]privacy\[aq]. Used only with KERBEROS enabled. -Google docs will transfer correctly with \[ga]rclone sync\[ga], \[ga]rclone copy\[ga] -etc as rclone knows to ignore the size when doing the transfer. +Properties: -However an unfortunate consequence of this is that you may not be able -to download Google docs using \[ga]rclone mount\[ga]. If it doesn\[aq]t work you -will get a 0 sized file. If you try again the doc may gain its -correct size and be downloadable. Whether it will work on not depends -on the application accessing the mount and the OS you are running - -experiment to find out if it does work for you! +- Config: data_transfer_protection +- Env Var: RCLONE_HDFS_DATA_TRANSFER_PROTECTION +- Type: string +- Required: false +- Examples: + - \[dq]privacy\[dq] + - Ensure authentication, integrity and encryption enabled. -### Duplicated files +#### --hdfs-encoding -Sometimes, for no reason I\[aq]ve been able to track down, drive will -duplicate a file that rclone uploads. Drive unlike all the other -remotes can have duplicated files. +The encoding for the backend. -Duplicated files cause problems with the syncing and you will see -messages in the log about duplicates. +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -Use \[ga]rclone dedupe\[ga] to fix duplicated files. +Properties: -Note that this isn\[aq]t just a problem with rclone, even Google Photos on -Android duplicates files on drive sometimes. +- Config: encoding +- Env Var: RCLONE_HDFS_ENCODING +- Type: Encoding +- Default: Slash,Colon,Del,Ctl,InvalidUtf8,Dot -### Rclone appears to be re-copying files it shouldn\[aq]t -The most likely cause of this is the duplicated file issue above - run -\[ga]rclone dedupe\[ga] and check your logs for duplicate object or directory -messages. -This can also be caused by a delay/caching on google drive\[aq]s end when -comparing directory listings. Specifically with team drives used in -combination with --fast-list. Files that were uploaded recently may -not appear on the directory list sent to rclone when using --fast-list. +## Limitations -Waiting a moderate period of time between attempts (estimated to be -approximately 1 hour) and/or not using --fast-list both seem to be -effective in preventing the problem. +- No server-side \[ga]Move\[ga] or \[ga]DirMove\[ga]. +- Checksums not implemented. -## Making your own client_id +# HiDrive -When you use rclone with Google drive in its default configuration you -are using rclone\[aq]s client_id. This is shared between all the rclone -users. There is a global rate limit on the number of queries per -second that each client_id can do set by Google. rclone already has a -high quota and I will continue to make sure it is high enough by -contacting Google. +Paths are specified as \[ga]remote:path\[ga] -It is strongly recommended to use your own client ID as the default rclone ID is heavily used. If you have multiple services running, it is recommended to use an API key for each service. The default Google quota is 10 transactions per second so it is recommended to stay under that number as if you use more than that, it will cause rclone to rate limit and make things slower. +Paths may be as deep as required, e.g. \[ga]remote:directory/subdirectory\[ga]. -Here is how to create your own Google Drive client ID for rclone: +The initial setup for hidrive involves getting a token from HiDrive +which you need to do in your browser. +\[ga]rclone config\[ga] walks you through it. -1. Log into the [Google API -Console](https://console.developers.google.com/) with your Google -account. It doesn\[aq]t matter what Google account you use. (It need not -be the same account as the Google Drive you want to access) +## Configuration -2. Select a project or create a new project. +Here is an example of how to make a remote called \[ga]remote\[ga]. First run: -3. Under \[dq]ENABLE APIS AND SERVICES\[dq] search for \[dq]Drive\[dq], and enable the -\[dq]Google Drive API\[dq]. + rclone config -4. Click \[dq]Credentials\[dq] in the left-side panel (not \[dq]Create -credentials\[dq], which opens the wizard). +This will guide you through an interactive setup process: +\f[R] +.fi +.PP +No remotes found - make a new one n) New remote s) Set configuration +password q) Quit config n/s/q> n name> remote Type of storage to +configure. +Choose a number from below, or type in your own value [snip] XX / +HiDrive \ \[dq]hidrive\[dq] [snip] Storage> hidrive OAuth Client Id - +Leave blank normally. +client_id> OAuth Client Secret - Leave blank normally. +client_secret> Access permissions that rclone should use when requesting +access from HiDrive. +Leave blank normally. +scope_access> Edit advanced config? +y/n> n Use web browser to automatically authenticate rclone with remote? +* Say Y if the machine running rclone has a web browser you can use * +Say N if running rclone on a (remote) machine without web browser access +If not sure try Y. +If Y failed, try N. +y/n> y If your browser doesn\[aq]t open automatically go to the +following link: http://127.0.0.1:53682/auth?state=xxxxxxxxxxxxxxxxxxxxxx +Log in and authorize rclone for access Waiting for code... +Got code -------------------- [remote] type = hidrive token = +{\[dq]access_token\[dq]:\[dq]xxxxxxxxxxxxxxxxxxxx\[dq],\[dq]token_type\[dq]:\[dq]Bearer\[dq],\[dq]refresh_token\[dq]:\[dq]xxxxxxxxxxxxxxxxxxxxxxx\[dq],\[dq]expiry\[dq]:\[dq]xxxxxxxxxxxxxxxxxxxxxxx\[dq]} +-------------------- y) Yes this is OK (default) e) Edit this remote d) +Delete this remote y/e/d> y +.IP +.nf +\f[C] +**You should be aware that OAuth-tokens can be used to access your account +and hence should not be shared with other persons.** +See the [below section](#keeping-your-tokens-safe) for more information. -5. If you already configured an \[dq]Oauth Consent Screen\[dq], then skip -to the next step; if not, click on \[dq]CONFIGURE CONSENT SCREEN\[dq] button -(near the top right corner of the right panel), then select \[dq]External\[dq] -and click on \[dq]CREATE\[dq]; on the next screen, enter an \[dq]Application name\[dq] -(\[dq]rclone\[dq] is OK); enter \[dq]User Support Email\[dq] (your own email is OK); -enter \[dq]Developer Contact Email\[dq] (your own email is OK); then click on -\[dq]Save\[dq] (all other data is optional). You will also have to add some scopes, -including \[ga].../auth/docs\[ga] and \[ga].../auth/drive\[ga] in order to be able to edit, -create and delete files with RClone. You may also want to include the -\[ga]../auth/drive.metadata.readonly\[ga] scope. After adding scopes, click -\[dq]Save and continue\[dq] to add test users. Be sure to add your own account to -the test users. Once you\[aq]ve added yourself as a test user and saved the -changes, click again on \[dq]Credentials\[dq] on the left panel to go back to -the \[dq]Credentials\[dq] screen. +See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a +machine with no Internet browser available. - (PS: if you are a GSuite user, you could also select \[dq]Internal\[dq] instead -of \[dq]External\[dq] above, but this will restrict API use to Google Workspace -users in your organisation). +Note that rclone runs a webserver on your local machine to collect the +token as returned from HiDrive. This only runs from the moment it opens +your browser to the moment you get back the verification code. +The webserver runs on \[ga]http://127.0.0.1:53682/\[ga]. +If local port \[ga]53682\[ga] is protected by a firewall you may need to temporarily +unblock the firewall to complete authorization. -6. Click on the \[dq]+ CREATE CREDENTIALS\[dq] button at the top of the screen, -then select \[dq]OAuth client ID\[dq]. +Once configured you can then use \[ga]rclone\[ga] like this, -7. Choose an application type of \[dq]Desktop app\[dq] and click \[dq]Create\[dq]. (the default name is fine) +List directories in top level of your HiDrive root folder -8. It will show you a client ID and client secret. Make a note of these. - - (If you selected \[dq]External\[dq] at Step 5 continue to Step 9. - If you chose \[dq]Internal\[dq] you don\[aq]t need to publish and can skip straight to - Step 10 but your destination drive must be part of the same Google Workspace.) + rclone lsd remote: -9. Go to \[dq]Oauth consent screen\[dq] and then click \[dq]PUBLISH APP\[dq] button and confirm. - You will also want to add yourself as a test user. +List all the files in your HiDrive filesystem -10. Provide the noted client ID and client secret to rclone. + rclone ls remote: -Be aware that, due to the \[dq]enhanced security\[dq] recently introduced by -Google, you are theoretically expected to \[dq]submit your app for verification\[dq] -and then wait a few weeks(!) for their response; in practice, you can go right -ahead and use the client ID and client secret with rclone, the only issue will -be a very scary confirmation screen shown when you connect via your browser -for rclone to be able to get its token-id (but as this only happens during -the remote configuration, it\[aq]s not such a big deal). Keeping the application in -\[dq]Testing\[dq] will work as well, but the limitation is that any grants will expire -after a week, which can be annoying to refresh constantly. If, for whatever -reason, a short grant time is not a problem, then keeping the application in -testing mode would also be sufficient. +To copy a local directory to a HiDrive directory called backup -(Thanks to \[at]balazer on github for these instructions.) + rclone copy /home/source remote:backup -Sometimes, creation of an OAuth consent in Google API Console fails due to an error message -\[lq]The request failed because changes to one of the field of the resource is not supported\[rq]. -As a convenient workaround, the necessary Google Drive API key can be created on the -[Python Quickstart](https://developers.google.com/drive/api/v3/quickstart/python) page. -Just push the Enable the Drive API button to receive the Client ID and Secret. -Note that it will automatically create a new project in the API Console. +### Keeping your tokens safe -# Google Photos +Any OAuth-tokens will be stored by rclone in the remote\[aq]s configuration file as unencrypted text. +Anyone can use a valid refresh-token to access your HiDrive filesystem without knowing your password. +Therefore you should make sure no one else can access your configuration. -The rclone backend for [Google Photos](https://www.google.com/photos/about/) is -a specialized backend for transferring photos and videos to and from -Google Photos. +It is possible to encrypt rclone\[aq]s configuration file. +You can find information on securing your configuration file by viewing the [configuration encryption docs](https://rclone.org/docs/#configuration-encryption). -**NB** The Google Photos API which rclone uses has quite a few -limitations, so please read the [limitations section](#limitations) -carefully to make sure it is suitable for your use. +### Invalid refresh token -## Configuration +As can be verified [here](https://developer.hidrive.com/basics-flows/), +each \[ga]refresh_token\[ga] (for Native Applications) is valid for 60 days. +If used to access HiDrivei, its validity will be automatically extended. -The initial setup for google cloud storage involves getting a token from Google Photos -which you need to do in your browser. \[ga]rclone config\[ga] walks you -through it. +This means that if you -Here is an example of how to make a remote called \[ga]remote\[ga]. First run: + * Don\[aq]t use the HiDrive remote for 60 days + +then rclone will return an error which includes a text +that implies the refresh token is *invalid* or *expired*. + +To fix this you will need to authorize rclone to access your HiDrive account again. + +Using + + rclone config reconnect remote: + +the process is very similar to the process of initial setup exemplified before. + +### Modification times and hashes + +HiDrive allows modification times to be set on objects accurate to 1 second. + +HiDrive supports [its own hash type](https://static.hidrive.com/dev/0001) +which is used to verify the integrity of file contents after successful transfers. + +### Restricted filename characters + +HiDrive cannot store files or folders that include +\[ga]/\[ga] (0x2F) or null-bytes (0x00) in their name. +Any other characters can be used in the names of files or folders. +Additionally, files or folders cannot be named either of the following: \[ga].\[ga] or \[ga]..\[ga] + +Therefore rclone will automatically replace these characters, +if files or folders are stored or accessed with such names. + +You can read about how this filename encoding works in general +[here](overview/#restricted-filenames). + +Keep in mind that HiDrive only supports file or folder names +with a length of 255 characters or less. + +### Transfers + +HiDrive limits file sizes per single request to a maximum of 2 GiB. +To allow storage of larger files and allow for better upload performance, +the hidrive backend will use a chunked transfer for files larger than 96 MiB. +Rclone will upload multiple parts/chunks of the file at the same time. +Chunks in the process of being uploaded are buffered in memory, +so you may want to restrict this behaviour on systems with limited resources. + +You can customize this behaviour using the following options: + +* \[ga]chunk_size\[ga]: size of file parts +* \[ga]upload_cutoff\[ga]: files larger or equal to this in size will use a chunked transfer +* \[ga]upload_concurrency\[ga]: number of file-parts to upload at the same time + +See the below section about configuration options for more details. + +### Root folder + +You can set the root folder for rclone. +This is the directory that rclone considers to be the root of your HiDrive. + +Usually, you will leave this blank, and rclone will use the root of the account. + +However, you can set this to restrict rclone to a specific folder hierarchy. + +This works by prepending the contents of the \[ga]root_prefix\[ga] option +to any paths accessed by rclone. +For example, the following two ways to access the home directory are equivalent: + + rclone lsd --hidrive-root-prefix=\[dq]/users/test/\[dq] remote:path + + rclone lsd remote:/users/test/path + +See the below section about configuration options for more details. + +### Directory member count + +By default, rclone will know the number of directory members contained in a directory. +For example, \[ga]rclone lsd\[ga] uses this information. + +The acquisition of this information will result in additional time costs for HiDrive\[aq]s API. +When dealing with large directory structures, it may be desirable to circumvent this time cost, +especially when this information is not explicitly needed. +For this, the \[ga]disable_fetching_member_count\[ga] option can be used. + +See the below section about configuration options for more details. - rclone config -This will guide you through an interactive setup process: -\f[R] -.fi -.PP -No remotes found, make a new one? -n) New remote s) Set configuration password q) Quit config n/s/q> n -name> remote Type of storage to configure. -Enter a string value. -Press Enter for the default (\[dq]\[dq]). -Choose a number from below, or type in your own value [snip] XX / Google -Photos \ \[dq]google photos\[dq] [snip] Storage> google photos ** See -help for google photos backend at: https://rclone.org/googlephotos/ ** -.PP -Google Application Client Id Leave blank normally. -Enter a string value. -Press Enter for the default (\[dq]\[dq]). -client_id> Google Application Client Secret Leave blank normally. -Enter a string value. -Press Enter for the default (\[dq]\[dq]). -client_secret> Set to make the Google Photos backend read only. -.PP -If you choose read only then rclone will only request read only access -to your photos, otherwise rclone will request full access. -Enter a boolean value (true or false). -Press Enter for the default (\[dq]false\[dq]). -read_only> Edit advanced config? -(y/n) y) Yes n) No y/n> n Remote config Use web browser to automatically -authenticate rclone with remote? -* Say Y if the machine running rclone has a web browser you can use * -Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. -If Y failed, try N. -y) Yes n) No y/n> y If your browser doesn\[aq]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 -.PP -*** IMPORTANT: All media items uploaded to Google Photos with rclone *** -are stored in full resolution at original quality. -These uploads *** will count towards storage in your Google Account. -.PP -.TS -tab(@); -lw(20.4n). -T{ -[remote] type = google photos token = -{\[dq]access_token\[dq]:\[dq]XXX\[dq],\[dq]token_type\[dq]:\[dq]Bearer\[dq],\[dq]refresh_token\[dq]:\[dq]XXX\[dq],\[dq]expiry\[dq]:\[dq]2019-06-28T17:38:04.644930156+01:00\[dq]} -T} -_ -T{ -y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y -\[ga]\[ga]\[ga] -T} -T{ -See the remote setup docs (https://rclone.org/remote_setup/) for how to -set it up on a machine with no Internet browser available. -T} -T{ -Note that rclone runs a webserver on your local machine to collect the -token as returned from Google if using web browser to automatically -authenticate. -This only runs from the moment it opens your browser to the moment you -get back the verification code. -This is on \f[C]http://127.0.0.1:53682/\f[R] and this may require you to -unblock it temporarily if you are running a host firewall, or use manual -mode. -T} -T{ -This remote is called \f[C]remote\f[R] and can now be used like this -T} -T{ -See all the albums in your photos -T} -T{ -rclone lsd remote:album -T} -T{ -Make a new album -T} -T{ -rclone mkdir remote:album/newAlbum -T} -T{ -List the contents of an album -T} -T{ -rclone ls remote:album/newAlbum -T} -T{ -Sync \f[C]/home/local/images\f[R] to the Google Photos, removing any -excess files in the album. -T} -T{ -rclone sync --interactive /home/local/image remote:album/newAlbum -T} -T{ -### Layout -T} -T{ -As Google Photos is not a general purpose cloud storage system, the -backend is laid out to help you navigate it. -T} -T{ -The directories under \f[C]media\f[R] show different ways of -categorizing the media. -Each file will appear multiple times. -So if you want to make a backup of your google photos you might choose -to backup \f[C]remote:media/by-month\f[R]. -(\f[B]NB\f[R] \f[C]remote:media/by-day\f[R] is rather slow at the moment -so avoid for syncing.) -T} -T{ -Note that all your photos and videos will appear somewhere under -\f[C]media\f[R], but they may not appear under \f[C]album\f[R] unless -you\[aq]ve put them into albums. -T} -T{ -\f[C]/ - upload - file1.jpg - file2.jpg - ... - media - all - file1.jpg - file2.jpg - ... - by-year - 2000 - file1.jpg - ... - 2001 - file2.jpg - ... - ... - by-month - 2000 - 2000-01 - file1.jpg - ... - 2000-02 - file2.jpg - ... - ... - by-day - 2000 - 2000-01-01 - file1.jpg - ... - 2000-01-02 - file2.jpg - ... - ... - album - album name - album name/sub - shared-album - album name - album name/sub - feature - favorites - file1.jpg - file2.jpg\f[R] -T} -T{ -There are two writable parts of the tree, the \f[C]upload\f[R] directory -and sub directories of the \f[C]album\f[R] directory. -T} -T{ -The \f[C]upload\f[R] directory is for uploading files you don\[aq]t want -to put into albums. -This will be empty to start with and will contain the files you\[aq]ve -uploaded for one rclone session only, becoming empty again when you -restart rclone. -The use case for this would be if you have a load of files you just want -to once off dump into Google Photos. -For repeated syncing, uploading to \f[C]album\f[R] will work better. -T} -T{ -Directories within the \f[C]album\f[R] directory are also writeable and -you may create new directories (albums) under \f[C]album\f[R]. -If you copy files with a directory hierarchy in there then rclone will -create albums with the \f[C]/\f[R] character in them. -For example if you do -T} -T{ -rclone copy /path/to/images remote:album/images -T} -T{ -and the images directory contains -T} -T{ -\f[C]images - file1.jpg dir file2.jpg dir2 dir3 file3.jpg\f[R] -T} -T{ -Then rclone will create the following albums with the following files in -T} -T{ -- images - file1.jpg - images/dir - file2.jpg - images/dir2/dir3 - -file3.jpg -T} -T{ -This means that you can use the \f[C]album\f[R] path pretty much like a -normal filesystem and it is a good target for repeated syncing. -T} -T{ -The \f[C]shared-album\f[R] directory shows albums shared with you or by -you. -This is similar to the Sharing tab in the Google Photos web interface. -T} -T{ ### Standard options -T} -T{ -Here are the Standard options specific to google photos (Google Photos). -T} -T{ -#### --gphotos-client-id -T} -T{ + +Here are the Standard options specific to hidrive (HiDrive). + +#### --hidrive-client-id + OAuth Client Id. -T} -T{ + Leave blank normally. -T} -T{ + Properties: -T} -T{ -- Config: client_id - Env Var: RCLONE_GPHOTOS_CLIENT_ID - Type: string - -Required: false -T} -T{ -#### --gphotos-client-secret -T} -T{ + +- Config: client_id +- Env Var: RCLONE_HIDRIVE_CLIENT_ID +- Type: string +- Required: false + +#### --hidrive-client-secret + OAuth Client Secret. -T} -T{ + Leave blank normally. -T} -T{ + Properties: -T} -T{ -- Config: client_secret - Env Var: RCLONE_GPHOTOS_CLIENT_SECRET - Type: -string - Required: false -T} -T{ -#### --gphotos-read-only -T} -T{ -Set to make the Google Photos backend read only. -T} -T{ -If you choose read only then rclone will only request read only access -to your photos, otherwise rclone will request full access. -T} -T{ + +- Config: client_secret +- Env Var: RCLONE_HIDRIVE_CLIENT_SECRET +- Type: string +- Required: false + +#### --hidrive-scope-access + +Access permissions that rclone should use when requesting access from HiDrive. + Properties: -T} -T{ -- Config: read_only - Env Var: RCLONE_GPHOTOS_READ_ONLY - Type: bool - -Default: false -T} -T{ + +- Config: scope_access +- Env Var: RCLONE_HIDRIVE_SCOPE_ACCESS +- Type: string +- Default: \[dq]rw\[dq] +- Examples: + - \[dq]rw\[dq] + - Read and write access to resources. + - \[dq]ro\[dq] + - Read-only access to resources. + ### Advanced options -T} -T{ -Here are the Advanced options specific to google photos (Google Photos). -T} -T{ -#### --gphotos-token -T} -T{ + +Here are the Advanced options specific to hidrive (HiDrive). + +#### --hidrive-token + OAuth Access Token as a JSON blob. -T} -T{ + Properties: -T} -T{ -- Config: token - Env Var: RCLONE_GPHOTOS_TOKEN - Type: string - -Required: false -T} -T{ -#### --gphotos-auth-url -T} -T{ + +- Config: token +- Env Var: RCLONE_HIDRIVE_TOKEN +- Type: string +- Required: false + +#### --hidrive-auth-url + Auth server URL. -T} -T{ + Leave blank to use the provider defaults. -T} -T{ + Properties: -T} -T{ -- Config: auth_url - Env Var: RCLONE_GPHOTOS_AUTH_URL - Type: string - -Required: false -T} -T{ -#### --gphotos-token-url -T} -T{ + +- Config: auth_url +- Env Var: RCLONE_HIDRIVE_AUTH_URL +- Type: string +- Required: false + +#### --hidrive-token-url + Token server url. -T} -T{ + Leave blank to use the provider defaults. -T} -T{ -Properties: -T} -T{ -- Config: token_url - Env Var: RCLONE_GPHOTOS_TOKEN_URL - Type: string - -Required: false -T} -T{ -#### --gphotos-read-size -T} -T{ -Set to read the size of media items. -T} -T{ -Normally rclone does not read the size of media items since this takes -another transaction. -This isn\[aq]t necessary for syncing. -However rclone mount needs to know the size of files in advance of -reading them, so setting this flag when using rclone mount is -recommended if you want to read the media. -T} -T{ -Properties: -T} -T{ -- Config: read_size - Env Var: RCLONE_GPHOTOS_READ_SIZE - Type: bool - -Default: false -T} -T{ -#### --gphotos-start-year -T} -T{ -Year limits the photos to be downloaded to those which are uploaded -after the given year. -T} -T{ -Properties: -T} -T{ -- Config: start_year - Env Var: RCLONE_GPHOTOS_START_YEAR - Type: int - -Default: 2000 -T} -T{ -#### --gphotos-include-archived -T} -T{ -Also view and download archived media. -T} -T{ -By default, rclone does not request archived media. -Thus, when syncing, archived media is not visible in directory listings -or transferred. -T} -T{ -Note that media in albums is always visible and synced, no matter their -archive status. -T} -T{ -With this flag, archived media are always visible in directory listings -and transferred. -T} -T{ -Without this flag, archived media will not be visible in directory -listings and won\[aq]t be transferred. -T} -T{ -Properties: -T} -T{ -- Config: include_archived - Env Var: RCLONE_GPHOTOS_INCLUDE_ARCHIVED - -Type: bool - Default: false -T} -T{ -#### --gphotos-encoding -T} -T{ -The encoding for the backend. -T} -T{ -See the encoding section in the -overview (https://rclone.org/overview/#encoding) for more info. -T} -T{ + Properties: -T} -T{ -- Config: encoding - Env Var: RCLONE_GPHOTOS_ENCODING - Type: -MultiEncoder - Default: Slash,CrLf,InvalidUtf8,Dot -T} -T{ -## Limitations -T} -T{ -Only images and videos can be uploaded. -If you attempt to upload non videos or images or formats that Google -Photos doesn\[aq]t understand, rclone will upload the file, then Google -Photos will give an error when it is put turned into a media item. -T} -T{ -Note that all media items uploaded to Google Photos through the API are -stored in full resolution at \[dq]original quality\[dq] and -\f[B]will\f[R] count towards your storage quota in your Google Account. -The API does \f[B]not\f[R] offer a way to upload in \[dq]high -quality\[dq] mode.. -T} -T{ -\f[C]rclone about\f[R] is not supported by the Google Photos backend. -Backends without this capability cannot determine free space for an -rclone mount or use policy \f[C]mfs\f[R] (most free space) as a member -of an rclone union remote. -T} -T{ -See List of backends that do not support rclone -about (https://rclone.org/overview/#optional-features) See rclone -about (https://rclone.org/commands/rclone_about/) -T} -T{ -### Downloading Images -T} -T{ -When Images are downloaded this strips EXIF location (according to the -docs and my tests). -This is a limitation of the Google Photos API and is covered by bug -#112096115 (https://issuetracker.google.com/issues/112096115). -T} -T{ -\f[B]The current google API does not allow photos to be downloaded at -original resolution. This is very important if you are, for example, -relying on \[dq]Google Photos\[dq] as a backup of your photos. You will -not be able to use rclone to redownload original images. You could use -\[aq]google takeout\[aq] to recover the original photos as a last -resort\f[R] -T} -T{ -### Downloading Videos -T} -T{ -When videos are downloaded they are downloaded in a really compressed -version of the video compared to downloading it via the Google Photos -web interface. -This is covered by bug -#113672044 (https://issuetracker.google.com/issues/113672044). -T} -T{ -### Duplicates -T} -T{ -If a file name is duplicated in a directory then rclone will add the -file ID into its name. -So two files called \f[C]file.jpg\f[R] would then appear as -\f[C]file {123456}.jpg\f[R] and \f[C]file {ABCDEF}.jpg\f[R] (the actual -IDs are a lot longer alas!). -T} -T{ -If you upload the same image (with the same binary data) twice then -Google Photos will deduplicate it. -However it will retain the filename from the first upload which may -confuse rclone. -For example if you uploaded an image to \f[C]upload\f[R] then uploaded -the same image to \f[C]album/my_album\f[R] the filename of the image in -\f[C]album/my_album\f[R] will be what it was uploaded with initially, -not what you uploaded it with to \f[C]album\f[R]. -In practise this shouldn\[aq]t cause too many problems. -T} -T{ -### Modified time -T} -T{ -The date shown of media in Google Photos is the creation date as -determined by the EXIF information, or the upload date if that is not -known. -T} -T{ -This is not changeable by rclone and is not the modification date of the -media on local disk. -This means that rclone cannot use the dates from Google Photos for -syncing purposes. -T} -T{ -### Size -T} -T{ -The Google Photos API does not return the size of media. -This means that when syncing to Google Photos, rclone can only do a file -existence check. -T} -T{ -It is possible to read the size of the media, but this needs an extra -HTTP HEAD request per media item so is \f[B]very slow\f[R] and uses up a -lot of transactions. -This can be enabled with the \f[C]--gphotos-read-size\f[R] option or the -\f[C]read_size = true\f[R] config parameter. -T} -T{ -If you want to use the backend with \f[C]rclone mount\f[R] you may need -to enable this flag (depending on your OS and application using the -photos) otherwise you may not be able to read media off the mount. -You\[aq]ll need to experiment to see if it works for you without the -flag. -T} -T{ -### Albums -T} -T{ -Rclone can only upload files to albums it created. -This is a limitation of the Google Photos -API (https://developers.google.com/photos/library/guides/manage-albums). -T} -T{ -Rclone can remove files it uploaded from albums it created only. -T} -T{ -### Deleting files -T} -T{ -Rclone can remove files from albums it created, but note that the Google -Photos API does not allow media to be deleted permanently so this media -will still remain. -See bug #109759781 (https://issuetracker.google.com/issues/109759781). -T} -T{ -Rclone cannot delete files anywhere except under \f[C]album\f[R]. -T} -T{ -### Deleting albums -T} -T{ -The Google Photos API does not support deleting albums - see bug -#135714733 (https://issuetracker.google.com/issues/135714733). -T} -T{ -# Hasher -T} -T{ -Hasher is a special overlay backend to create remotes which handle -checksums for other remotes. -It\[aq]s main functions include: - Emulate hash types unimplemented by -backends - Cache checksums to help with slow hashing of large local or -(S)FTP files - Warm up checksum cache from external SUM files -T} -T{ -## Getting started -T} -T{ -To use Hasher, first set up the underlying remote following the -configuration instructions for that remote. -You can also use a local pathname instead of a remote. -Check that your base remote is working. -T} -T{ -Let\[aq]s call the base remote \f[C]myRemote:path\f[R] here. -Note that anything inside \f[C]myRemote:path\f[R] will be handled by -hasher and anything outside won\[aq]t. -This means that if you are using a bucket based remote (S3, B2, Swift) -then you should put the bucket in the remote \f[C]s3:bucket\f[R]. -T} -T{ -Now proceed to interactive or manual configuration. -T} -T{ -### Interactive configuration -T} -T{ -Run \f[C]rclone config\f[R]: \[ga]\[ga]\[ga] No remotes found, make a -new one? -n) New remote s) Set configuration password q) Quit config n/s/q> n -name> Hasher1 Type of storage to configure. -Choose a number from below, or type in your own value [snip] XX / Handle -checksums for other remotes \ \[dq]hasher\[dq] [snip] Storage> hasher -Remote to cache checksums for, like myremote:mypath. -Enter a string value. -Press Enter for the default (\[dq]\[dq]). -remote> myRemote:path Comma separated list of supported checksum types. -Enter a string value. -Press Enter for the default (\[dq]md5,sha1\[dq]). -hashsums> md5 Maximum time to keep checksums in cache. -0 = no cache, off = cache forever. -max_age> off Edit advanced config? -(y/n) y) Yes n) No y/n> n Remote config -T} -.TE -.PP -[Hasher1] type = hasher remote = myRemote:path hashsums = md5 max_age = -off -------------------- y) Yes this is OK e) Edit this remote d) Delete -this remote y/e/d> y -.IP -.nf -\f[C] -### Manual configuration -Run \[ga]rclone config path\[ga] to see the path of current active config file, -usually \[ga]YOURHOME/.config/rclone/rclone.conf\[ga]. -Open it in your favorite text editor, find section for the base remote -and create new section for hasher like in the following examples: +- Config: token_url +- Env Var: RCLONE_HIDRIVE_TOKEN_URL +- Type: string +- Required: false + +#### --hidrive-scope-role + +User-level that rclone should use when requesting access from HiDrive. + +Properties: + +- Config: scope_role +- Env Var: RCLONE_HIDRIVE_SCOPE_ROLE +- Type: string +- Default: \[dq]user\[dq] +- Examples: + - \[dq]user\[dq] + - User-level access to management permissions. + - This will be sufficient in most cases. + - \[dq]admin\[dq] + - Extensive access to management permissions. + - \[dq]owner\[dq] + - Full access to management permissions. + +#### --hidrive-root-prefix + +The root/parent folder for all paths. + +Fill in to use the specified folder as the parent for all paths given to the remote. +This way rclone can use any folder as its starting point. + +Properties: + +- Config: root_prefix +- Env Var: RCLONE_HIDRIVE_ROOT_PREFIX +- Type: string +- Default: \[dq]/\[dq] +- Examples: + - \[dq]/\[dq] + - The topmost directory accessible by rclone. + - This will be equivalent with \[dq]root\[dq] if rclone uses a regular HiDrive user account. + - \[dq]root\[dq] + - The topmost directory of the HiDrive user account + - \[dq]\[dq] + - This specifies that there is no root-prefix for your paths. + - When using this you will always need to specify paths to this remote with a valid parent e.g. \[dq]remote:/path/to/dir\[dq] or \[dq]remote:root/path/to/dir\[dq]. + +#### --hidrive-endpoint + +Endpoint for the service. + +This is the URL that API-calls will be made to. + +Properties: + +- Config: endpoint +- Env Var: RCLONE_HIDRIVE_ENDPOINT +- Type: string +- Default: \[dq]https://api.hidrive.strato.com/2.1\[dq] + +#### --hidrive-disable-fetching-member-count + +Do not fetch number of objects in directories unless it is absolutely necessary. + +Requests may be faster if the number of objects in subdirectories is not fetched. + +Properties: + +- Config: disable_fetching_member_count +- Env Var: RCLONE_HIDRIVE_DISABLE_FETCHING_MEMBER_COUNT +- Type: bool +- Default: false + +#### --hidrive-chunk-size + +Chunksize for chunked uploads. + +Any files larger than the configured cutoff (or files of unknown size) will be uploaded in chunks of this size. + +The upper limit for this is 2147483647 bytes (about 2.000Gi). +That is the maximum amount of bytes a single upload-operation will support. +Setting this above the upper limit or to a negative value will cause uploads to fail. + +Setting this to larger values may increase the upload speed at the cost of using more memory. +It can be set to smaller values smaller to save on memory. + +Properties: + +- Config: chunk_size +- Env Var: RCLONE_HIDRIVE_CHUNK_SIZE +- Type: SizeSuffix +- Default: 48Mi + +#### --hidrive-upload-cutoff + +Cutoff/Threshold for chunked uploads. + +Any files larger than this will be uploaded in chunks of the configured chunksize. + +The upper limit for this is 2147483647 bytes (about 2.000Gi). +That is the maximum amount of bytes a single upload-operation will support. +Setting this above the upper limit will cause uploads to fail. + +Properties: + +- Config: upload_cutoff +- Env Var: RCLONE_HIDRIVE_UPLOAD_CUTOFF +- Type: SizeSuffix +- Default: 96Mi + +#### --hidrive-upload-concurrency + +Concurrency for chunked uploads. + +This is the upper limit for how many transfers for the same file are running concurrently. +Setting this above to a value smaller than 1 will cause uploads to deadlock. + +If you are uploading small numbers of large files over high-speed links +and these uploads do not fully utilize your bandwidth, then increasing +this may help to speed up the transfers. + +Properties: + +- Config: upload_concurrency +- Env Var: RCLONE_HIDRIVE_UPLOAD_CONCURRENCY +- Type: int +- Default: 4 + +#### --hidrive-encoding + +The encoding for the backend. + +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. + +Properties: + +- Config: encoding +- Env Var: RCLONE_HIDRIVE_ENCODING +- Type: Encoding +- Default: Slash,Dot + + + +## Limitations + +### Symbolic links + +HiDrive is able to store symbolic links (*symlinks*) by design, +for example, when unpacked from a zip archive. + +There exists no direct mechanism to manage native symlinks in remotes. +As such this implementation has chosen to ignore any native symlinks present in the remote. +rclone will not be able to access or show any symlinks stored in the hidrive-remote. +This means symlinks cannot be individually removed, copied, or moved, +except when removing, copying, or moving the parent folder. + +*This does not affect the \[ga].rclonelink\[ga]-files +that rclone uses to encode and store symbolic links.* + +### Sparse files + +It is possible to store sparse files in HiDrive. + +Note that copying a sparse file will expand the holes +into null-byte (0x00) regions that will then consume disk space. +Likewise, when downloading a sparse file, +the resulting file will have null-byte regions in the place of file holes. + +# HTTP + +The HTTP remote is a read only remote for reading files of a +webserver. The webserver should provide file listings which rclone +will read and turn into a remote. This has been tested with common +webservers such as Apache/Nginx/Caddy and will likely work with file +listings from most web servers. (If it doesn\[aq]t then please file an +issue, or send a pull request!) + +Paths are specified as \[ga]remote:\[ga] or \[ga]remote:path\[ga]. + +The \[ga]remote:\[ga] represents the configured [url](#http-url), and any path following +it will be resolved relative to this url, according to the URL standard. This +means with remote url \[ga]https://beta.rclone.org/branch\[ga] and path \[ga]fix\[ga], the +resolved URL will be \[ga]https://beta.rclone.org/branch/fix\[ga], while with path +\[ga]/fix\[ga] the resolved URL will be \[ga]https://beta.rclone.org/fix\[ga] as the absolute +path is resolved from the root of the domain. + +If the path following the \[ga]remote:\[ga] ends with \[ga]/\[ga] it will be assumed to point +to a directory. If the path does not end with \[ga]/\[ga], then a HEAD request is sent +and the response used to decide if it it is treated as a file or a directory +(run with \[ga]-vv\[ga] to see details). When [--http-no-head](#http-no-head) is +specified, a path without ending \[ga]/\[ga] is always assumed to be a file. If rclone +incorrectly assumes the path is a file, the solution is to specify the path with +ending \[ga]/\[ga]. When you know the path is a directory, ending it with \[ga]/\[ga] is always +better as it avoids the initial HEAD request. + +To just download a single file it is easier to use +[copyurl](https://rclone.org/commands/rclone_copyurl/). + +## Configuration + +Here is an example of how to make a remote called \[ga]remote\[ga]. First +run: + + rclone config + +This will guide you through an interactive setup process: \f[R] .fi .PP -[Hasher1] type = hasher remote = myRemote:path hashes = md5 max_age = -off +No remotes found, make a new one? +n) New remote s) Set configuration password q) Quit config n/s/q> n +name> remote Type of storage to configure. +Choose a number from below, or type in your own value [snip] XX / HTTP +\ \[dq]http\[dq] [snip] Storage> http URL of http host to connect to +Choose a number from below, or type in your own value 1 / Connect to +example.com \ \[dq]https://example.com\[dq] url> https://beta.rclone.org +Remote config -------------------- [remote] url = +https://beta.rclone.org -------------------- y) Yes this is OK e) Edit +this remote d) Delete this remote y/e/d> y Current remotes: .PP -[Hasher2] type = hasher remote = /local/path hashes = dropbox,sha1 -max_age = 24h +Name Type ==== ==== remote http +.IP "e)" 3 +Edit existing remote +.IP "f)" 3 +New remote +.IP "g)" 3 +Delete remote +.IP "h)" 3 +Rename remote +.IP "i)" 3 +Copy remote +.IP "j)" 3 +Set configuration password +.IP "k)" 3 +Quit config e/n/d/r/c/s/q> q .IP .nf \f[C] -Hasher takes basically the following parameters: -- \[ga]remote\[ga] is required, -- \[ga]hashes\[ga] is a comma separated list of supported checksums - (by default \[ga]md5,sha1\[ga]), -- \[ga]max_age\[ga] - maximum time to keep a checksum value in the cache, - \[ga]0\[ga] will disable caching completely, - \[ga]off\[ga] will cache \[dq]forever\[dq] (that is until the files get changed). +This remote is called \[ga]remote\[ga] and can now be used like this -Make sure the \[ga]remote\[ga] has \[ga]:\[ga] (colon) in. If you specify the remote without -a colon then rclone will use a local directory of that name. So if you use -a remote of \[ga]/local/path\[ga] then rclone will handle hashes for that directory. -If you use \[ga]remote = name\[ga] literally then rclone will put files -**in a directory called \[ga]name\[ga] located under current directory**. +See all the top level directories -## Usage + rclone lsd remote: -### Basic operations +List the contents of a directory -Now you can use it as \[ga]Hasher2:subdir/file\[ga] instead of base remote. -Hasher will transparently update cache with new checksums when a file -is fully read or overwritten, like: + rclone ls remote:directory + +Sync the remote \[ga]directory\[ga] to \[ga]/home/local/directory\[ga], deleting any excess files. + + rclone sync --interactive remote:directory /home/local/directory + +### Read only + +This remote is read only - you can\[aq]t upload files to an HTTP server. + +### Modification times + +Most HTTP servers store time accurate to 1 second. + +### Checksum + +No checksums are stored. + +### Usage without a config file + +Since the http remote only has one config parameter it is easy to use +without a config file: + + rclone lsd --http-url https://beta.rclone.org :http: + +or: + + rclone lsd :http,url=\[aq]https://beta.rclone.org\[aq]: + + +### Standard options + +Here are the Standard options specific to http (HTTP). + +#### --http-url + +URL of HTTP host to connect to. + +E.g. \[dq]https://example.com\[dq], or \[dq]https://user:pass\[at]example.com\[dq] to use a username and password. + +Properties: + +- Config: url +- Env Var: RCLONE_HTTP_URL +- Type: string +- Required: true + +### Advanced options + +Here are the Advanced options specific to http (HTTP). + +#### --http-headers + +Set HTTP headers for all transactions. + +Use this to set additional HTTP headers for all transactions. + +The input format is comma separated list of key,value pairs. Standard +[CSV encoding](https://godoc.org/encoding/csv) may be used. + +For example, to set a Cookie use \[aq]Cookie,name=value\[aq], or \[aq]\[dq]Cookie\[dq],\[dq]name=value\[dq]\[aq]. + +You can set multiple headers, e.g. \[aq]\[dq]Cookie\[dq],\[dq]name=value\[dq],\[dq]Authorization\[dq],\[dq]xxx\[dq]\[aq]. + +Properties: + +- Config: headers +- Env Var: RCLONE_HTTP_HEADERS +- Type: CommaSepList +- Default: + +#### --http-no-slash + +Set this if the site doesn\[aq]t end directories with /. + +Use this if your target website does not use / on the end of +directories. + +A / on the end of a path is how rclone normally tells the difference +between files and directories. If this flag is set, then rclone will +treat all files with Content-Type: text/html as directories and read +URLs from them rather than downloading them. + +Note that this may cause rclone to confuse genuine HTML files with +directories. + +Properties: + +- Config: no_slash +- Env Var: RCLONE_HTTP_NO_SLASH +- Type: bool +- Default: false + +#### --http-no-head + +Don\[aq]t use HEAD requests. + +HEAD requests are mainly used to find file sizes in dir listing. +If your site is being very slow to load then you can try this option. +Normally rclone does a HEAD request for each potential file in a +directory listing to: + +- find its size +- check it really exists +- check to see if it is a directory + +If you set this option, rclone will not do the HEAD request. This will mean +that directory listings are much quicker, but rclone won\[aq]t have the times or +sizes of any files, and some files that don\[aq]t exist may be in the listing. + +Properties: + +- Config: no_head +- Env Var: RCLONE_HTTP_NO_HEAD +- Type: bool +- Default: false + +## Backend commands + +Here are the commands specific to the http backend. + +Run them with + + rclone backend COMMAND remote: + +The help below will explain what arguments each command takes. + +See the [backend](https://rclone.org/commands/rclone_backend/) command for more +info on how to pass options and arguments. + +These can be run on a running backend using the rc command +[backend/command](https://rclone.org/rc/#backend-command). + +### set + +Set command for updating the config parameters. + + rclone backend set remote: [options] [+] + +This set command can be used to update the config parameters +for a running http backend. + +Usage Examples: + + rclone backend set remote: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=remote: [-o opt_name=opt_value] [-o opt_name2=opt_value2] + rclone rc backend/command command=set fs=remote: -o url=https://example.com + +The option keys are named as they are in the config file. + +This rebuilds the connection to the http backend when it is called with +the new parameters. Only new parameters need be passed as the values +will default to those currently in use. + +It doesn\[aq]t return anything. + + + + +## Limitations + +\[ga]rclone about\[ga] is not supported by the HTTP backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy \[ga]mfs\[ga] (most free space) as a member of an rclone union +remote. + +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) + +# ImageKit +This is a backend for the [ImageKit.io](https://imagekit.io/) storage service. + +#### About ImageKit +[ImageKit.io](https://imagekit.io/) provides real-time image and video optimizations, transformations, and CDN delivery. Over 1,000 businesses and 70,000 developers trust ImageKit with their images and videos on the web. + + +#### Accounts & Pricing + +To use this backend, you need to [create an account](https://imagekit.io/registration/) on ImageKit. Start with a free plan with generous usage limits. Then, as your requirements grow, upgrade to a plan that best fits your needs. See [the pricing details](https://imagekit.io/plans). + +## Configuration + +Here is an example of making an imagekit configuration. + +Firstly create a [ImageKit.io](https://imagekit.io/) account and choose a plan. + +You will need to log in and get the \[ga]publicKey\[ga] and \[ga]privateKey\[ga] for your account from the developer section. + +Now run \f[R] .fi .PP -rclone copy External:path/file Hasher:dest/path -.PP -rclone cat Hasher:path/to/file > /dev/null +rclone config .IP .nf \f[C] -The way to refresh **all** cached checksums (even unsupported by the base backend) -for a subtree is to **re-download** all files in the subtree. For example, -use \[ga]hashsum --download\[ga] using **any** supported hashsum on the command line -(we just care to re-read): +This will guide you through an interactive setup process: \f[R] .fi .PP -rclone hashsum MD5 --download Hasher:path/to/subtree > /dev/null +No remotes found, make a new one? +n) New remote s) Set configuration password q) Quit config n/s/q> n .PP -rclone backend dump Hasher:path/to/subtree +Enter the name for the new remote. +name> imagekit-media-library +.PP +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] XX / ImageKit.io \ (imagekit) [snip] Storage> imagekit +.PP +Option endpoint. +You can find your ImageKit.io URL endpoint in your +dashboard (https://imagekit.io/dashboard/developer/api-keys) Enter a +value. +endpoint> https://ik.imagekit.io/imagekit_id +.PP +Option public_key. +You can find your ImageKit.io public key in your +dashboard (https://imagekit.io/dashboard/developer/api-keys) Enter a +value. +public_key> public_**************************** +.PP +Option private_key. +You can find your ImageKit.io private key in your +dashboard (https://imagekit.io/dashboard/developer/api-keys) Enter a +value. +private_key> private_**************************** +.PP +Edit advanced config? +y) Yes n) No (default) y/n> n +.PP +Configuration complete. +Options: - type: imagekit - endpoint: https://ik.imagekit.io/imagekit_id +- public_key: public_**************************** - private_key: +private_**************************** +.PP +Keep this \[dq]imagekit-media-library\[dq] remote? +y) Yes this is OK (default) e) Edit this remote d) Delete this remote +y/e/d> y .IP .nf \f[C] -You can print or drop hashsum cache using custom backend commands: +List directories in the top level of your Media Library \f[R] .fi .PP -rclone backend dump Hasher:dir/subdir -.PP -rclone backend drop Hasher: +rclone lsd imagekit-media-library: .IP .nf \f[C] -### Pre-Seed from a SUM File - -Hasher supports two backend commands: generic SUM file \[ga]import\[ga] and faster -but less consistent \[ga]stickyimport\[ga]. +Make a new directory. \f[R] .fi .PP -rclone backend import Hasher:dir/subdir SHA1 /path/to/SHA1SUM -[--checkers 4] +rclone mkdir imagekit-media-library:directory .IP .nf \f[C] -Instead of SHA1 it can be any hash supported by the remote. The last argument -can point to either a local or an \[ga]other-remote:path\[ga] text file in SUM format. -The command will parse the SUM file, then walk down the path given by the -first argument, snapshot current fingerprints and fill in the cache entries -correspondingly. -- Paths in the SUM file are treated as relative to \[ga]hasher:dir/subdir\[ga]. -- The command will **not** check that supplied values are correct. - You **must know** what you are doing. -- This is a one-time action. The SUM file will not get \[dq]attached\[dq] to the - remote. Cache entries can still be overwritten later, should the object\[aq]s - fingerprint change. -- The tree walk can take long depending on the tree size. You can increase - \[ga]--checkers\[ga] to make it faster. Or use \[ga]stickyimport\[ga] if you don\[aq]t care - about fingerprints and consistency. +List the contents of a directory. \f[R] .fi .PP -rclone backend stickyimport hasher:path/to/data sha1 -remote:/path/to/sum.sha1 +rclone ls imagekit-media-library:directory .IP .nf \f[C] -\[ga]stickyimport\[ga] is similar to \[ga]import\[ga] but works much faster because it -does not need to stat existing files and skips initial tree walk. -Instead of binding cache entries to file fingerprints it creates _sticky_ -entries bound to the file name alone ignoring size, modification time etc. -Such hash entries can be replaced only by \[ga]purge\[ga], \[ga]delete\[ga], \[ga]backend drop\[ga] -or by full re-read/re-write of the files. - -## Configuration reference - - -### Standard options - -Here are the Standard options specific to hasher (Better checksums for other remotes). - -#### --hasher-remote - -Remote to cache checksums for (e.g. myRemote:path). +### Modified time and hashes -Properties: +ImageKit does not support modification times or hashes yet. -- Config: remote -- Env Var: RCLONE_HASHER_REMOTE -- Type: string -- Required: true +### Checksums -#### --hasher-hashes +No checksums are supported. -Comma separated list of supported checksum types. -Properties: +### Standard options -- Config: hashes -- Env Var: RCLONE_HASHER_HASHES -- Type: CommaSepList -- Default: md5,sha1 +Here are the Standard options specific to imagekit (ImageKit.io). -#### --hasher-max-age +#### --imagekit-endpoint -Maximum time to keep checksums in cache (0 = no cache, off = cache forever). +You can find your ImageKit.io URL endpoint in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) Properties: -- Config: max_age -- Env Var: RCLONE_HASHER_MAX_AGE -- Type: Duration -- Default: off +- Config: endpoint +- Env Var: RCLONE_IMAGEKIT_ENDPOINT +- Type: string +- Required: true -### Advanced options +#### --imagekit-public-key -Here are the Advanced options specific to hasher (Better checksums for other remotes). +You can find your ImageKit.io public key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) -#### --hasher-auto-size +Properties: -Auto-update checksum for files smaller than this size (disabled by default). +- Config: public_key +- Env Var: RCLONE_IMAGEKIT_PUBLIC_KEY +- Type: string +- Required: true + +#### --imagekit-private-key + +You can find your ImageKit.io private key in your [dashboard](https://imagekit.io/dashboard/developer/api-keys) Properties: -- Config: auto_size -- Env Var: RCLONE_HASHER_AUTO_SIZE -- Type: SizeSuffix -- Default: 0 +- Config: private_key +- Env Var: RCLONE_IMAGEKIT_PRIVATE_KEY +- Type: string +- Required: true -### Metadata +### Advanced options -Any metadata supported by the underlying remote is read and written. +Here are the Advanced options specific to imagekit (ImageKit.io). -See the [metadata](https://rclone.org/docs/#metadata) docs for more info. +#### --imagekit-only-signed -## Backend commands +If you have configured \[ga]Restrict unsigned image URLs\[ga] in your dashboard settings, set this to true. -Here are the commands specific to the hasher backend. +Properties: -Run them with +- Config: only_signed +- Env Var: RCLONE_IMAGEKIT_ONLY_SIGNED +- Type: bool +- Default: false - rclone backend COMMAND remote: +#### --imagekit-versions -The help below will explain what arguments each command takes. +Include old versions in directory listings. -See the [backend](https://rclone.org/commands/rclone_backend/) command for more -info on how to pass options and arguments. +Properties: -These can be run on a running backend using the rc command -[backend/command](https://rclone.org/rc/#backend-command). +- Config: versions +- Env Var: RCLONE_IMAGEKIT_VERSIONS +- Type: bool +- Default: false -### drop +#### --imagekit-upload-tags -Drop cache +Tags to add to the uploaded files, e.g. \[dq]tag1,tag2\[dq]. - rclone backend drop remote: [options] [+] +Properties: -Completely drop checksum cache. -Usage Example: - rclone backend drop hasher: +- Config: upload_tags +- Env Var: RCLONE_IMAGEKIT_UPLOAD_TAGS +- Type: string +- Required: false +#### --imagekit-encoding -### dump +The encoding for the backend. -Dump the database +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. - rclone backend dump remote: [options] [+] +Properties: -Dump cache records covered by the current remote +- Config: encoding +- Env Var: RCLONE_IMAGEKIT_ENCODING +- Type: Encoding +- Default: Slash,LtGt,DoubleQuote,Dollar,Question,Hash,Percent,BackSlash,Del,Ctl,InvalidUtf8,Dot,SquareBracket -### fulldump +### Metadata -Full dump of the database +Any metadata supported by the underlying remote is read and written. - rclone backend fulldump remote: [options] [+] +Here are the possible system metadata items for the imagekit backend. -Dump all cache records in the database +| Name | Help | Type | Example | Read Only | +|------|------|------|---------|-----------| +| aws-tags | AI generated tags by AWS Rekognition associated with the image | string | tag1,tag2 | **Y** | +| btime | Time of file birth (creation) read from Last-Modified header | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** | +| custom-coordinates | Custom coordinates of the file | string | 0,0,100,100 | **Y** | +| file-type | Type of the file | string | image | **Y** | +| google-tags | AI generated tags by Google Cloud Vision associated with the image | string | tag1,tag2 | **Y** | +| has-alpha | Whether the image has alpha channel or not | bool | | **Y** | +| height | Height of the image or video in pixels | int | | **Y** | +| is-private-file | Whether the file is private or not | bool | | **Y** | +| size | Size of the object in bytes | int64 | | **Y** | +| tags | Tags associated with the file | string | tag1,tag2 | **Y** | +| width | Width of the image or video in pixels | int | | **Y** | -### import +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -Import a SUM file - rclone backend import remote: [options] [+] -Amend hash cache from a SUM file and bind checksums to files by size/time. -Usage Example: - rclone backend import hasher:subdir md5 /path/to/sum.md5 +# Internet Archive +The Internet Archive backend utilizes Items on [archive.org](https://archive.org/) -### stickyimport +Refer to [IAS3 API documentation](https://archive.org/services/docs/api/ias3.html) for the API this backend uses. -Perform fast import of a SUM file +Paths are specified as \[ga]remote:bucket\[ga] (or \[ga]remote:\[ga] for the \[ga]lsd\[ga] +command.) You may put subdirectories in too, e.g. \[ga]remote:item/path/to/dir\[ga]. - rclone backend stickyimport remote: [options] [+] +Unlike S3, listing up all items uploaded by you isn\[aq]t supported. -Fill hash cache from a SUM file without verifying file fingerprints. -Usage Example: - rclone backend stickyimport hasher:subdir md5 remote:path/to/sum.md5 +Once you have made a remote, you can use it like this: +Make a new item + rclone mkdir remote:item +List the contents of a item -## Implementation details (advanced) + rclone ls remote:item -This section explains how various rclone operations work on a hasher remote. +Sync \[ga]/home/local/directory\[ga] to the remote item, deleting any excess +files in the item. -**Disclaimer. This section describes current implementation which can -change in future rclone versions!.** + rclone sync --interactive /home/local/directory remote:item -### Hashsum command +## Notes +Because of Internet Archive\[aq]s architecture, it enqueues write operations (and extra post-processings) in a per-item queue. You can check item\[aq]s queue at https://catalogd.archive.org/history/item-name-here . Because of that, all uploads/deletes will not show up immediately and takes some time to be available. +The per-item queue is enqueued to an another queue, Item Deriver Queue. [You can check the status of Item Deriver Queue here.](https://catalogd.archive.org/catalog.php?whereami=1) This queue has a limit, and it may block you from uploading, or even deleting. You should avoid uploading a lot of small files for better behavior. -The \[ga]rclone hashsum\[ga] (or \[ga]md5sum\[ga] or \[ga]sha1sum\[ga]) command will: +You can optionally wait for the server\[aq]s processing to finish, by setting non-zero value to \[ga]wait_archive\[ga] key. +By making it wait, rclone can do normal file comparison. +Make sure to set a large enough value (e.g. \[ga]30m0s\[ga] for smaller files) as it can take a long time depending on server\[aq]s queue. -1. if requested hash is supported by lower level, just pass it. -2. if object size is below \[ga]auto_size\[ga] then download object and calculate - _requested_ hashes on the fly. -3. if unsupported and the size is big enough, build object \[ga]fingerprint\[ga] - (including size, modtime if supported, first-found _other_ hash if any). -4. if the strict match is found in cache for the requested remote, return - the stored hash. -5. if remote found but fingerprint mismatched, then purge the entry and - proceed to step 6. -6. if remote not found or had no requested hash type or after step 5: - download object, calculate all _supported_ hashes on the fly and store - in cache; return requested hash. +## About metadata +This backend supports setting, updating and reading metadata of each file. +The metadata will appear as file metadata on Internet Archive. +However, some fields are reserved by both Internet Archive and rclone. -### Other operations +The following are reserved by Internet Archive: +- \[ga]name\[ga] +- \[ga]source\[ga] +- \[ga]size\[ga] +- \[ga]md5\[ga] +- \[ga]crc32\[ga] +- \[ga]sha1\[ga] +- \[ga]format\[ga] +- \[ga]old_version\[ga] +- \[ga]viruscheck\[ga] +- \[ga]summation\[ga] -- whenever a file is uploaded or downloaded **in full**, capture the stream - to calculate all supported hashes on the fly and update database -- server-side \[ga]move\[ga] will update keys of existing cache entries -- \[ga]deletefile\[ga] will remove a single cache entry -- \[ga]purge\[ga] will remove all cache entries under the purged path +Trying to set values to these keys is ignored with a warning. +Only setting \[ga]mtime\[ga] is an exception. Doing so make it the identical behavior as setting ModTime. -Note that setting \[ga]max_age = 0\[ga] will disable checksum caching completely. +rclone reserves all the keys starting with \[ga]rclone-\[ga]. Setting value for these keys will give you warnings, but values are set according to request. -If you set \[ga]max_age = off\[ga], checksums in cache will never age, unless you -fully rewrite or delete the file. +If there are multiple values for a key, only the first one is returned. +This is a limitation of rclone, that supports one value per one key. +It can be triggered when you did a server-side copy. -### Cache storage +Reading metadata will also provide custom (non-standard nor reserved) ones. -Cached checksums are stored as \[ga]bolt\[ga] database files under rclone cache -directory, usually \[ga]\[ti]/.cache/rclone/kv/\[ga]. Databases are maintained -one per _base_ backend, named like \[ga]BaseRemote\[ti]hasher.bolt\[ga]. -Checksums for multiple \[ga]alias\[ga]-es into a single base backend -will be stored in the single database. All local paths are treated as -aliases into the \[ga]local\[ga] backend (unless encrypted or chunked) and stored -in \[ga]\[ti]/.cache/rclone/kv/local\[ti]hasher.bolt\[ga]. -Databases can be shared between multiple rclone processes. +## Filtering auto generated files -# HDFS +The Internet Archive automatically creates metadata files after +upload. These can cause problems when doing an \[ga]rclone sync\[ga] as rclone +will try, and fail, to delete them. These metadata files are not +changeable, as they are created by the Internet Archive automatically. -[HDFS](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html) is a -distributed file-system, part of the [Apache Hadoop](https://hadoop.apache.org/) framework. +These auto-created files can be excluded from the sync using [metadata +filtering](https://rclone.org/filtering/#metadata). -Paths are specified as \[ga]remote:\[ga] or \[ga]remote:path/to/dir\[ga]. + rclone sync ... --metadata-exclude \[dq]source=metadata\[dq] --metadata-exclude \[dq]format=Metadata\[dq] + +Which excludes from the sync any files which have the +\[ga]source=metadata\[ga] or \[ga]format=Metadata\[ga] flags which are added to +Internet Archive auto-created files. ## Configuration -Here is an example of how to make a remote called \[ga]remote\[ga]. First run: +Here is an example of making an internetarchive configuration. +Most applies to the other providers as well, any differences are described [below](#providers). - rclone config +First run -This will guide you through an interactive setup process: + rclone config + +This will guide you through an interactive setup process. \f[R] .fi .PP No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n -name> remote Type of storage to configure. +name> remote Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +XX / InternetArchive Items \ (internetarchive) Storage> internetarchive +Option access_key_id. +IAS3 Access Key. +Leave blank for anonymous access. +You can find one here: https://archive.org/account/s3.php Enter a value. +Press Enter to leave empty. +access_key_id> XXXX Option secret_access_key. +IAS3 Secret Key (password). +Leave blank for anonymous access. +Enter a value. +Press Enter to leave empty. +secret_access_key> XXXX Edit advanced config? +y) Yes n) No (default) y/n> y Option endpoint. +IAS3 Endpoint. +Leave blank for default value. Enter a string value. -Press Enter for the default (\[dq]\[dq]). -Choose a number from below, or type in your own value [skip] XX / Hadoop -distributed file system \ \[dq]hdfs\[dq] [skip] Storage> hdfs ** See -help for hdfs backend at: https://rclone.org/hdfs/ ** -.PP -hadoop name node and port Enter a string value. -Press Enter for the default (\[dq]\[dq]). -Choose a number from below, or type in your own value 1 / Connect to -host namenode at port 8020 \ \[dq]namenode:8020\[dq] namenode> -namenode.hadoop:8020 hadoop user name Enter a string value. -Press Enter for the default (\[dq]\[dq]). -Choose a number from below, or type in your own value 1 / Connect to -hdfs as root \ \[dq]root\[dq] username> root Edit advanced config? -(y/n) y) Yes n) No (default) y/n> n Remote config -------------------- -[remote] type = hdfs namenode = namenode.hadoop:8020 username = root +Press Enter for the default (https://s3.us.archive.org). +endpoint> Option front_endpoint. +Host of InternetArchive Frontend. +Leave blank for default value. +Enter a string value. +Press Enter for the default (https://archive.org). +front_endpoint> Option disable_checksum. +Don\[aq]t store MD5 checksum with object metadata. +Normally rclone will calculate the MD5 checksum of the input before +uploading it so it can ask the server to check the object against +checksum. +This is great for data integrity checking but can cause long delays for +large files to start uploading. +Enter a boolean value (true or false). +Press Enter for the default (true). +disable_checksum> true Option encoding. +The encoding for the backend. +See the encoding section in the +overview (https://rclone.org/overview/#encoding) for more info. +Enter a encoder.MultiEncoder value. +Press Enter for the default +(Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot). +encoding> Edit advanced config? +y) Yes n) No (default) y/n> n -------------------- [remote] type = +internetarchive access_key_id = XXXX secret_access_key = XXXX -------------------- y) Yes this is OK (default) e) Edit this remote d) -Delete this remote y/e/d> y Current remotes: -.PP -Name Type ==== ==== hadoop hdfs -.IP "e)" 3 -Edit existing remote -.IP "f)" 3 -New remote -.IP "g)" 3 -Delete remote -.IP "h)" 3 -Rename remote -.IP "i)" 3 -Copy remote -.IP "j)" 3 -Set configuration password -.IP "k)" 3 -Quit config e/n/d/r/c/s/q> q +Delete this remote y/e/d> y .IP .nf \f[C] -This remote is called \[ga]remote\[ga] and can now be used like this -See all the top level directories +### Standard options - rclone lsd remote: +Here are the Standard options specific to internetarchive (Internet Archive). -List the contents of a directory +#### --internetarchive-access-key-id - rclone ls remote:directory +IAS3 Access Key. -Sync the remote \[ga]directory\[ga] to \[ga]/home/local/directory\[ga], deleting any excess files. +Leave blank for anonymous access. +You can find one here: https://archive.org/account/s3.php - rclone sync --interactive remote:directory /home/local/directory +Properties: -### Setting up your own HDFS instance for testing +- Config: access_key_id +- Env Var: RCLONE_INTERNETARCHIVE_ACCESS_KEY_ID +- Type: string +- Required: false -You may start with a [manual setup](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/SingleCluster.html) -or use the docker image from the tests: +#### --internetarchive-secret-access-key -If you want to build the docker image -\f[R] -.fi -.PP -git clone https://github.com/rclone/rclone.git cd -rclone/fstest/testserver/images/test-hdfs docker build --rm -t -rclone/test-hdfs . -.IP -.nf -\f[C] -Or you can just use the latest one pushed -\f[R] -.fi -.PP -docker run --rm --name \[dq]rclone-hdfs\[dq] -p 127.0.0.1:9866:9866 -p -127.0.0.1:8020:8020 --hostname \[dq]rclone-hdfs\[dq] rclone/test-hdfs -.IP -.nf -\f[C] -**NB** it need few seconds to startup. +IAS3 Secret Key (password). -For this docker image the remote needs to be configured like this: -\f[R] -.fi -.PP -[remote] type = hdfs namenode = 127.0.0.1:8020 username = root -.IP -.nf -\f[C] -You can stop this image with \[ga]docker kill rclone-hdfs\[ga] (**NB** it does not use volumes, so all data -uploaded will be lost.) +Leave blank for anonymous access. -### Modified time +Properties: -Time accurate to 1 second is stored. +- Config: secret_access_key +- Env Var: RCLONE_INTERNETARCHIVE_SECRET_ACCESS_KEY +- Type: string +- Required: false -### Checksum +### Advanced options -No checksums are implemented. +Here are the Advanced options specific to internetarchive (Internet Archive). -### Usage information +#### --internetarchive-endpoint -You can use the \[ga]rclone about remote:\[ga] command which will display filesystem size and current usage. +IAS3 Endpoint. -### Restricted filename characters +Leave blank for default value. -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) -the following characters are also replaced: +Properties: -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| : | 0x3A | \[uFF1A] | +- Config: endpoint +- Env Var: RCLONE_INTERNETARCHIVE_ENDPOINT +- Type: string +- Default: \[dq]https://s3.us.archive.org\[dq] -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8). +#### --internetarchive-front-endpoint +Host of InternetArchive Frontend. -### Standard options +Leave blank for default value. -Here are the Standard options specific to hdfs (Hadoop distributed file system). +Properties: -#### --hdfs-namenode +- Config: front_endpoint +- Env Var: RCLONE_INTERNETARCHIVE_FRONT_ENDPOINT +- Type: string +- Default: \[dq]https://archive.org\[dq] -Hadoop name node and port. +#### --internetarchive-disable-checksum -E.g. \[dq]namenode:8020\[dq] to connect to host namenode at port 8020. +Don\[aq]t ask the server to test against MD5 checksum calculated by rclone. +Normally rclone will calculate the MD5 checksum of the input before +uploading it so it can ask the server to check the object against checksum. +This is great for data integrity checking but can cause long delays for +large files to start uploading. Properties: -- Config: namenode -- Env Var: RCLONE_HDFS_NAMENODE -- Type: string -- Required: true +- Config: disable_checksum +- Env Var: RCLONE_INTERNETARCHIVE_DISABLE_CHECKSUM +- Type: bool +- Default: true -#### --hdfs-username +#### --internetarchive-wait-archive -Hadoop user name. +Timeout for waiting the server\[aq]s processing tasks (specifically archive and book_op) to finish. +Only enable if you need to be guaranteed to be reflected after write operations. +0 to disable waiting. No errors to be thrown in case of timeout. Properties: -- Config: username -- Env Var: RCLONE_HDFS_USERNAME -- Type: string -- Required: false -- Examples: - - \[dq]root\[dq] - - Connect to hdfs as root. +- Config: wait_archive +- Env Var: RCLONE_INTERNETARCHIVE_WAIT_ARCHIVE +- Type: Duration +- Default: 0s -### Advanced options +#### --internetarchive-encoding -Here are the Advanced options specific to hdfs (Hadoop distributed file system). +The encoding for the backend. -#### --hdfs-service-principal-name +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -Kerberos service principal name for the namenode. +Properties: -Enables KERBEROS authentication. Specifies the Service Principal Name -(SERVICE/FQDN) for the namenode. E.g. \[rs]\[dq]hdfs/namenode.hadoop.docker\[rs]\[dq] -for namenode running as service \[aq]hdfs\[aq] with FQDN \[aq]namenode.hadoop.docker\[aq]. +- Config: encoding +- Env Var: RCLONE_INTERNETARCHIVE_ENCODING +- Type: Encoding +- Default: Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot -Properties: +### Metadata -- Config: service_principal_name -- Env Var: RCLONE_HDFS_SERVICE_PRINCIPAL_NAME -- Type: string -- Required: false +Metadata fields provided by Internet Archive. +If there are multiple values for a key, only the first one is returned. +This is a limitation of Rclone, that supports one value per one key. -#### --hdfs-data-transfer-protection +Owner is able to add custom keys. Metadata feature grabs all the keys including them. -Kerberos data transfer protection: authentication|integrity|privacy. +Here are the possible system metadata items for the internetarchive backend. -Specifies whether or not authentication, data signature integrity -checks, and wire encryption are required when communicating with -the datanodes. Possible values are \[aq]authentication\[aq], \[aq]integrity\[aq] -and \[aq]privacy\[aq]. Used only with KERBEROS enabled. +| Name | Help | Type | Example | Read Only | +|------|------|------|---------|-----------| +| crc32 | CRC32 calculated by Internet Archive | string | 01234567 | **Y** | +| format | Name of format identified by Internet Archive | string | Comma-Separated Values | **Y** | +| md5 | MD5 hash calculated by Internet Archive | string | 01234567012345670123456701234567 | **Y** | +| mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | **Y** | +| name | Full file path, without the bucket part | filename | backend/internetarchive/internetarchive.go | **Y** | +| old_version | Whether the file was replaced and moved by keep-old-version flag | boolean | true | **Y** | +| rclone-ia-mtime | Time of last modification, managed by Internet Archive | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N | +| rclone-mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N | +| rclone-update-track | Random value used by Rclone for tracking changes inside Internet Archive | string | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | N | +| sha1 | SHA1 hash calculated by Internet Archive | string | 0123456701234567012345670123456701234567 | **Y** | +| size | File size in bytes | decimal number | 123456 | **Y** | +| source | The source of the file | string | original | **Y** | +| summation | Check https://forum.rclone.org/t/31922 for how it is used | string | md5 | **Y** | +| viruscheck | The last time viruscheck process was run for the file (?) | unixtime | 1654191352 | **Y** | -Properties: +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -- Config: data_transfer_protection -- Env Var: RCLONE_HDFS_DATA_TRANSFER_PROTECTION -- Type: string -- Required: false -- Examples: - - \[dq]privacy\[dq] - - Ensure authentication, integrity and encryption enabled. -#### --hdfs-encoding -The encoding for the backend. +# Jottacloud -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Jottacloud is a cloud storage service provider from a Norwegian company, using its own datacenters +in Norway. In addition to the official service at [jottacloud.com](https://www.jottacloud.com/), +it also provides white-label solutions to different companies, such as: +* Telia + * Telia Cloud (cloud.telia.se) + * Telia Sky (sky.telia.no) +* Tele2 + * Tele2 Cloud (mittcloud.tele2.se) +* Onlime + * Onlime Cloud Storage (onlime.dk) +* Elkj\[/o]p (with subsidiaries): + * Elkj\[/o]p Cloud (cloud.elkjop.no) + * Elgiganten Sweden (cloud.elgiganten.se) + * Elgiganten Denmark (cloud.elgiganten.dk) + * Giganti Cloud (cloud.gigantti.fi) + * ELKO Cloud (cloud.elko.is) -Properties: +Most of the white-label versions are supported by this backend, although may require different +authentication setup - described below. -- Config: encoding -- Env Var: RCLONE_HDFS_ENCODING -- Type: MultiEncoder -- Default: Slash,Colon,Del,Ctl,InvalidUtf8,Dot +Paths are specified as \[ga]remote:path\[ga] + +Paths may be as deep as required, e.g. \[ga]remote:directory/subdirectory\[ga]. + +## Authentication types + +Some of the whitelabel versions uses a different authentication method than the official service, +and you have to choose the correct one when setting up the remote. + +### Standard authentication + +The standard authentication method used by the official service (jottacloud.com), as well as +some of the whitelabel services, requires you to generate a single-use personal login token +from the account security settings in the service\[aq]s web interface. Log in to your account, +go to \[dq]Settings\[dq] and then \[dq]Security\[dq], or use the direct link presented to you by rclone when +configuring the remote: . Scroll down to the section +\[dq]Personal login token\[dq], and click the \[dq]Generate\[dq] button. Note that if you are using a +whitelabel service you probably can\[aq]t use the direct link, you need to find the same page in +their dedicated web interface, and also it may be in a different location than described above. + +To access your account from multiple instances of rclone, you need to configure each of them +with a separate personal login token. E.g. you create a Jottacloud remote with rclone in one +location, and copy the configuration file to a second location where you also want to run +rclone and access the same remote. Then you need to replace the token for one of them, using +the [config reconnect](https://rclone.org/commands/rclone_config_reconnect/) command, which +requires you to generate a new personal login token and supply as input. If you do not +do this, the token may easily end up being invalidated, resulting in both instances failing +with an error message something along the lines of: + + oauth2: cannot fetch token: 400 Bad Request + Response: {\[dq]error\[dq]:\[dq]invalid_grant\[dq],\[dq]error_description\[dq]:\[dq]Stale token\[dq]} + +When this happens, you need to replace the token as described above to be able to use your +remote again. + +All personal login tokens you have taken into use will be listed in the web interface under +\[dq]My logged in devices\[dq], and from the right side of that list you can click the \[dq]X\[dq] button to +revoke individual tokens. + +### Legacy authentication + +If you are using one of the whitelabel versions (e.g. from Elkj\[/o]p) you may not have the option +to generate a CLI token. In this case you\[aq]ll have to use the legacy authentication. To do this select +yes when the setup asks for legacy authentication and enter your username and password. +The rest of the setup is identical to the default setup. +### Telia Cloud authentication +Similar to other whitelabel versions Telia Cloud doesn\[aq]t offer the option of creating a CLI token, and +additionally uses a separate authentication flow where the username is generated internally. To setup +rclone to use Telia Cloud, choose Telia Cloud authentication in the setup. The rest of the setup is +identical to the default setup. -## Limitations +### Tele2 Cloud authentication -- No server-side \[ga]Move\[ga] or \[ga]DirMove\[ga]. -- Checksums not implemented. +As Tele2-Com Hem merger was completed this authentication can be used for former Com Hem Cloud and +Tele2 Cloud customers as no support for creating a CLI token exists, and additionally uses a separate +authentication flow where the username is generated internally. To setup rclone to use Tele2 Cloud, +choose Tele2 Cloud authentication in the setup. The rest of the setup is identical to the default setup. -# HiDrive +### Onlime Cloud Storage authentication -Paths are specified as \[ga]remote:path\[ga] +Onlime has sold access to Jottacloud proper, while providing localized support to Danish Customers, but +have recently set up their own hosting, transferring their customers from Jottacloud servers to their +own ones. -Paths may be as deep as required, e.g. \[ga]remote:directory/subdirectory\[ga]. +This, of course, necessitates using their servers for authentication, but otherwise functionality and +architecture seems equivalent to Jottacloud. -The initial setup for hidrive involves getting a token from HiDrive -which you need to do in your browser. -\[ga]rclone config\[ga] walks you through it. +To setup rclone to use Onlime Cloud Storage, choose Onlime Cloud authentication in the setup. The rest +of the setup is identical to the default setup. ## Configuration -Here is an example of how to make a remote called \[ga]remote\[ga]. First run: +Here is an example of how to make a remote called \[ga]remote\[ga] with the default setup. First run: - rclone config + rclone config This will guide you through an interactive setup process: \f[R] .fi .PP -No remotes found - make a new one n) New remote s) Set configuration -password q) Quit config n/s/q> n name> remote Type of storage to -configure. -Choose a number from below, or type in your own value [snip] XX / -HiDrive \ \[dq]hidrive\[dq] [snip] Storage> hidrive OAuth Client Id - -Leave blank normally. -client_id> OAuth Client Secret - Leave blank normally. -client_secret> Access permissions that rclone should use when requesting -access from HiDrive. -Leave blank normally. -scope_access> Edit advanced config? -y/n> n Use web browser to automatically authenticate rclone with remote? -* Say Y if the machine running rclone has a web browser you can use * -Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. -If Y failed, try N. -y/n> y If your browser doesn\[aq]t open automatically go to the -following link: http://127.0.0.1:53682/auth?state=xxxxxxxxxxxxxxxxxxxxxx -Log in and authorize rclone for access Waiting for code... -Got code -------------------- [remote] type = hidrive token = -{\[dq]access_token\[dq]:\[dq]xxxxxxxxxxxxxxxxxxxx\[dq],\[dq]token_type\[dq]:\[dq]Bearer\[dq],\[dq]refresh_token\[dq]:\[dq]xxxxxxxxxxxxxxxxxxxxxxx\[dq],\[dq]expiry\[dq]:\[dq]xxxxxxxxxxxxxxxxxxxxxxx\[dq]} --------------------- y) Yes this is OK (default) e) Edit this remote d) -Delete this remote y/e/d> y +No remotes found, make a new one? +n) New remote s) Set configuration password q) Quit config n/s/q> n +name> remote Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] XX / Jottacloud \ (jottacloud) [snip] Storage> jottacloud Edit +advanced config? +y) Yes n) No (default) y/n> n Option config_type. +Select authentication type. +Choose a number from below, or type in an existing string value. +Press Enter for the default (standard). +/ Standard authentication. +1 | Use this if you\[aq]re a normal Jottacloud user. +\ (standard) / Legacy authentication. +2 | This is only required for certain whitelabel versions of Jottacloud +and not recommended for normal users. +\ (legacy) / Telia Cloud authentication. +3 | Use this if you are using Telia Cloud. +\ (telia) / Tele2 Cloud authentication. +4 | Use this if you are using Tele2 Cloud. +\ (tele2) / Onlime Cloud authentication. +5 | Use this if you are using Onlime Cloud. +\ (onlime) config_type> 1 Personal login token. +Generate here: https://www.jottacloud.com/web/secure Login Token> Use a +non-standard device/mountpoint? +Choosing no, the default, will let you access the storage used for the +archive section of the official Jottacloud client. +If you instead want to access the sync or the backup section, for +example, you must choose yes. +y) Yes n) No (default) y/n> y Option config_device. +The device to use. +In standard setup the built-in Jotta device is used, which contains +predefined mountpoints for archive, sync etc. +All other devices are treated as backup devices by the official +Jottacloud client. +You may create a new by entering a unique name. +Choose a number from below, or type in your own string value. +Press Enter for the default (DESKTOP-3H31129). +1 > DESKTOP-3H31129 2 > Jotta config_device> 2 Option config_mountpoint. +The mountpoint to use for the built-in device Jotta. +The standard setup is to use the Archive mountpoint. +Most other mountpoints have very limited support in rclone and should +generally be avoided. +Choose a number from below, or type in an existing string value. +Press Enter for the default (Archive). +1 > Archive 2 > Shared 3 > Sync config_mountpoint> 1 +-------------------- [remote] type = jottacloud configVersion = 1 +client_id = jottacli client_secret = tokenURL = +https://id.jottacloud.com/auth/realms/jottacloud/protocol/openid-connect/token +token = {........} username = 2940e57271a93d987d6f8a21 device = Jotta +mountpoint = Archive -------------------- y) Yes this is OK (default) e) +Edit this remote d) Delete this remote y/e/d> y .IP .nf \f[C] -**You should be aware that OAuth-tokens can be used to access your account -and hence should not be shared with other persons.** -See the [below section](#keeping-your-tokens-safe) for more information. - -See the [remote setup docs](https://rclone.org/remote_setup/) for how to set it up on a -machine with no Internet browser available. - -Note that rclone runs a webserver on your local machine to collect the -token as returned from HiDrive. This only runs from the moment it opens -your browser to the moment you get back the verification code. -The webserver runs on \[ga]http://127.0.0.1:53682/\[ga]. -If local port \[ga]53682\[ga] is protected by a firewall you may need to temporarily -unblock the firewall to complete authorization. - Once configured you can then use \[ga]rclone\[ga] like this, -List directories in top level of your HiDrive root folder +List directories in top level of your Jottacloud rclone lsd remote: -List all the files in your HiDrive filesystem +List all the files in your Jottacloud rclone ls remote: -To copy a local directory to a HiDrive directory called backup +To copy a local directory to an Jottacloud directory called backup rclone copy /home/source remote:backup -### Keeping your tokens safe - -Any OAuth-tokens will be stored by rclone in the remote\[aq]s configuration file as unencrypted text. -Anyone can use a valid refresh-token to access your HiDrive filesystem without knowing your password. -Therefore you should make sure no one else can access your configuration. - -It is possible to encrypt rclone\[aq]s configuration file. -You can find information on securing your configuration file by viewing the [configuration encryption docs](https://rclone.org/docs/#configuration-encryption). +### Devices and Mountpoints -### Invalid refresh token +The official Jottacloud client registers a device for each computer you install +it on, and shows them in the backup section of the user interface. For each +folder you select for backup it will create a mountpoint within this device. +A built-in device called Jotta is special, and contains mountpoints Archive, +Sync and some others, used for corresponding features in official clients. -As can be verified [here](https://developer.hidrive.com/basics-flows/), -each \[ga]refresh_token\[ga] (for Native Applications) is valid for 60 days. -If used to access HiDrivei, its validity will be automatically extended. +With rclone you\[aq]ll want to use the standard Jotta/Archive device/mountpoint in +most cases. However, you may for example want to access files from the sync or +backup functionality provided by the official clients, and rclone therefore +provides the option to select other devices and mountpoints during config. -This means that if you +You are allowed to create new devices and mountpoints. All devices except the +built-in Jotta device are treated as backup devices by official Jottacloud +clients, and the mountpoints on them are individual backup sets. - * Don\[aq]t use the HiDrive remote for 60 days +With the built-in Jotta device, only existing, built-in, mountpoints can be +selected. In addition to the mentioned Archive and Sync, it may contain +several other mountpoints such as: Latest, Links, Shared and Trash. All of +these are special mountpoints with a different internal representation than +the \[dq]regular\[dq] mountpoints. Rclone will only to a very limited degree support +them. Generally you should avoid these, unless you know what you are doing. -then rclone will return an error which includes a text -that implies the refresh token is *invalid* or *expired*. +### --fast-list -To fix this you will need to authorize rclone to access your HiDrive account again. +This backend supports \[ga]--fast-list\[ga] which allows you to use fewer +transactions in exchange for more memory. See the [rclone +docs](https://rclone.org/docs/#fast-list) for more details. -Using +Note that the implementation in Jottacloud always uses only a single +API request to get the entire list, so for large folders this could +lead to long wait time before the first results are shown. - rclone config reconnect remote: +Note also that with rclone version 1.58 and newer, information about +[MIME types](https://rclone.org/overview/#mime-type) and metadata item [utime](#metadata) +are not available when using \[ga]--fast-list\[ga]. -the process is very similar to the process of initial setup exemplified before. +### Modification times and hashes -### Modified time and hashes +Jottacloud allows modification times to be set on objects accurate to 1 +second. These will be used to detect whether objects need syncing or +not. -HiDrive allows modification times to be set on objects accurate to 1 second. +Jottacloud supports MD5 type hashes, so you can use the \[ga]--checksum\[ga] +flag. -HiDrive supports [its own hash type](https://static.hidrive.com/dev/0001) -which is used to verify the integrity of file contents after successful transfers. +Note that Jottacloud requires the MD5 hash before upload so if the +source does not have an MD5 checksum then the file will be cached +temporarily on disk (in location given by +[--temp-dir](https://rclone.org/docs/#temp-dir-dir)) before it is uploaded. +Small files will be cached in memory - see the +[--jottacloud-md5-memory-limit](#jottacloud-md5-memory-limit) flag. +When uploading from local disk the source checksum is always available, +so this does not apply. Starting with rclone version 1.52 the same is +true for encrypted remotes (in older versions the crypt backend would not +calculate hashes for uploads from local disk, so the Jottacloud +backend had to do it as described above). ### Restricted filename characters -HiDrive cannot store files or folders that include -\[ga]/\[ga] (0x2F) or null-bytes (0x00) in their name. -Any other characters can be used in the names of files or folders. -Additionally, files or folders cannot be named either of the following: \[ga].\[ga] or \[ga]..\[ga] - -Therefore rclone will automatically replace these characters, -if files or folders are stored or accessed with such names. - -You can read about how this filename encoding works in general -[here](overview/#restricted-filenames). - -Keep in mind that HiDrive only supports file or folder names -with a length of 255 characters or less. - -### Transfers - -HiDrive limits file sizes per single request to a maximum of 2 GiB. -To allow storage of larger files and allow for better upload performance, -the hidrive backend will use a chunked transfer for files larger than 96 MiB. -Rclone will upload multiple parts/chunks of the file at the same time. -Chunks in the process of being uploaded are buffered in memory, -so you may want to restrict this behaviour on systems with limited resources. - -You can customize this behaviour using the following options: - -* \[ga]chunk_size\[ga]: size of file parts -* \[ga]upload_cutoff\[ga]: files larger or equal to this in size will use a chunked transfer -* \[ga]upload_concurrency\[ga]: number of file-parts to upload at the same time - -See the below section about configuration options for more details. - -### Root folder - -You can set the root folder for rclone. -This is the directory that rclone considers to be the root of your HiDrive. - -Usually, you will leave this blank, and rclone will use the root of the account. +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) +the following characters are also replaced: -However, you can set this to restrict rclone to a specific folder hierarchy. +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| \[dq] | 0x22 | \[uFF02] | +| * | 0x2A | \[uFF0A] | +| : | 0x3A | \[uFF1A] | +| < | 0x3C | \[uFF1C] | +| > | 0x3E | \[uFF1E] | +| ? | 0x3F | \[uFF1F] | +| \[rs]| | 0x7C | \[uFF5C] | -This works by prepending the contents of the \[ga]root_prefix\[ga] option -to any paths accessed by rclone. -For example, the following two ways to access the home directory are equivalent: +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can\[aq]t be used in XML strings. - rclone lsd --hidrive-root-prefix=\[dq]/users/test/\[dq] remote:path +### Deleting files - rclone lsd remote:/users/test/path +By default, rclone will send all files to the trash when deleting files. They will be permanently +deleted automatically after 30 days. You may bypass the trash and permanently delete files immediately +by using the [--jottacloud-hard-delete](#jottacloud-hard-delete) flag, or set the equivalent environment variable. +Emptying the trash is supported by the [cleanup](https://rclone.org/commands/rclone_cleanup/) command. -See the below section about configuration options for more details. +### Versions -### Directory member count +Jottacloud supports file versioning. When rclone uploads a new version of a file it creates a new version of it. +Currently rclone only supports retrieving the current version but older versions can be accessed via the Jottacloud Website. -By default, rclone will know the number of directory members contained in a directory. -For example, \[ga]rclone lsd\[ga] uses this information. +Versioning can be disabled by \[ga]--jottacloud-no-versions\[ga] option. This is achieved by deleting the remote file prior to uploading +a new version. If the upload the fails no version of the file will be available in the remote. -The acquisition of this information will result in additional time costs for HiDrive\[aq]s API. -When dealing with large directory structures, it may be desirable to circumvent this time cost, -especially when this information is not explicitly needed. -For this, the \[ga]disable_fetching_member_count\[ga] option can be used. +### Quota information -See the below section about configuration options for more details. +To view your current quota you can use the \[ga]rclone about remote:\[ga] +command which will display your usage limit (unless it is unlimited) +and the current usage. ### Standard options -Here are the Standard options specific to hidrive (HiDrive). +Here are the Standard options specific to jottacloud (Jottacloud). -#### --hidrive-client-id +#### --jottacloud-client-id OAuth Client Id. @@ -44780,11 +45211,11 @@ Leave blank normally. Properties: - Config: client_id -- Env Var: RCLONE_HIDRIVE_CLIENT_ID +- Env Var: RCLONE_JOTTACLOUD_CLIENT_ID - Type: string - Required: false -#### --hidrive-client-secret +#### --jottacloud-client-secret OAuth Client Secret. @@ -44793,42 +45224,26 @@ Leave blank normally. Properties: - Config: client_secret -- Env Var: RCLONE_HIDRIVE_CLIENT_SECRET +- Env Var: RCLONE_JOTTACLOUD_CLIENT_SECRET - Type: string - Required: false -#### --hidrive-scope-access - -Access permissions that rclone should use when requesting access from HiDrive. - -Properties: - -- Config: scope_access -- Env Var: RCLONE_HIDRIVE_SCOPE_ACCESS -- Type: string -- Default: \[dq]rw\[dq] -- Examples: - - \[dq]rw\[dq] - - Read and write access to resources. - - \[dq]ro\[dq] - - Read-only access to resources. - ### Advanced options -Here are the Advanced options specific to hidrive (HiDrive). +Here are the Advanced options specific to jottacloud (Jottacloud). -#### --hidrive-token +#### --jottacloud-token OAuth Access Token as a JSON blob. Properties: - Config: token -- Env Var: RCLONE_HIDRIVE_TOKEN +- Env Var: RCLONE_JOTTACLOUD_TOKEN - Type: string - Required: false -#### --hidrive-auth-url +#### --jottacloud-auth-url Auth server URL. @@ -44837,11 +45252,11 @@ Leave blank to use the provider defaults. Properties: - Config: auth_url -- Env Var: RCLONE_HIDRIVE_AUTH_URL +- Env Var: RCLONE_JOTTACLOUD_AUTH_URL - Type: string - Required: false -#### --hidrive-token-url +#### --jottacloud-token-url Token server url. @@ -44850,1055 +45265,1101 @@ Leave blank to use the provider defaults. Properties: - Config: token_url -- Env Var: RCLONE_HIDRIVE_TOKEN_URL +- Env Var: RCLONE_JOTTACLOUD_TOKEN_URL - Type: string - Required: false -#### --hidrive-scope-role +#### --jottacloud-md5-memory-limit -User-level that rclone should use when requesting access from HiDrive. +Files bigger than this will be cached on disk to calculate the MD5 if required. Properties: -- Config: scope_role -- Env Var: RCLONE_HIDRIVE_SCOPE_ROLE -- Type: string -- Default: \[dq]user\[dq] -- Examples: - - \[dq]user\[dq] - - User-level access to management permissions. - - This will be sufficient in most cases. - - \[dq]admin\[dq] - - Extensive access to management permissions. - - \[dq]owner\[dq] - - Full access to management permissions. +- Config: md5_memory_limit +- Env Var: RCLONE_JOTTACLOUD_MD5_MEMORY_LIMIT +- Type: SizeSuffix +- Default: 10Mi -#### --hidrive-root-prefix +#### --jottacloud-trashed-only -The root/parent folder for all paths. +Only show files that are in the trash. -Fill in to use the specified folder as the parent for all paths given to the remote. -This way rclone can use any folder as its starting point. +This will show trashed files in their original directory structure. Properties: -- Config: root_prefix -- Env Var: RCLONE_HIDRIVE_ROOT_PREFIX -- Type: string -- Default: \[dq]/\[dq] -- Examples: - - \[dq]/\[dq] - - The topmost directory accessible by rclone. - - This will be equivalent with \[dq]root\[dq] if rclone uses a regular HiDrive user account. - - \[dq]root\[dq] - - The topmost directory of the HiDrive user account - - \[dq]\[dq] - - This specifies that there is no root-prefix for your paths. - - When using this you will always need to specify paths to this remote with a valid parent e.g. \[dq]remote:/path/to/dir\[dq] or \[dq]remote:root/path/to/dir\[dq]. - -#### --hidrive-endpoint +- Config: trashed_only +- Env Var: RCLONE_JOTTACLOUD_TRASHED_ONLY +- Type: bool +- Default: false -Endpoint for the service. +#### --jottacloud-hard-delete -This is the URL that API-calls will be made to. +Delete files permanently rather than putting them into the trash. Properties: -- Config: endpoint -- Env Var: RCLONE_HIDRIVE_ENDPOINT -- Type: string -- Default: \[dq]https://api.hidrive.strato.com/2.1\[dq] +- Config: hard_delete +- Env Var: RCLONE_JOTTACLOUD_HARD_DELETE +- Type: bool +- Default: false -#### --hidrive-disable-fetching-member-count +#### --jottacloud-upload-resume-limit -Do not fetch number of objects in directories unless it is absolutely necessary. +Files bigger than this can be resumed if the upload fail\[aq]s. -Requests may be faster if the number of objects in subdirectories is not fetched. +Properties: + +- Config: upload_resume_limit +- Env Var: RCLONE_JOTTACLOUD_UPLOAD_RESUME_LIMIT +- Type: SizeSuffix +- Default: 10Mi + +#### --jottacloud-no-versions + +Avoid server side versioning by deleting files and recreating files instead of overwriting them. Properties: -- Config: disable_fetching_member_count -- Env Var: RCLONE_HIDRIVE_DISABLE_FETCHING_MEMBER_COUNT +- Config: no_versions +- Env Var: RCLONE_JOTTACLOUD_NO_VERSIONS - Type: bool - Default: false -#### --hidrive-chunk-size +#### --jottacloud-encoding -Chunksize for chunked uploads. +The encoding for the backend. -Any files larger than the configured cutoff (or files of unknown size) will be uploaded in chunks of this size. +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -The upper limit for this is 2147483647 bytes (about 2.000Gi). -That is the maximum amount of bytes a single upload-operation will support. -Setting this above the upper limit or to a negative value will cause uploads to fail. +Properties: -Setting this to larger values may increase the upload speed at the cost of using more memory. -It can be set to smaller values smaller to save on memory. +- Config: encoding +- Env Var: RCLONE_JOTTACLOUD_ENCODING +- Type: Encoding +- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot -Properties: +### Metadata -- Config: chunk_size -- Env Var: RCLONE_HIDRIVE_CHUNK_SIZE -- Type: SizeSuffix -- Default: 48Mi +Jottacloud has limited support for metadata, currently an extended set of timestamps. -#### --hidrive-upload-cutoff +Here are the possible system metadata items for the jottacloud backend. -Cutoff/Threshold for chunked uploads. +| Name | Help | Type | Example | Read Only | +|------|------|------|---------|-----------| +| btime | Time of file birth (creation), read from rclone metadata | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | N | +| content-type | MIME type, also known as media type | string | text/plain | **Y** | +| mtime | Time of last modification, read from rclone metadata | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | N | +| utime | Time of last upload, when current revision was created, generated by backend | RFC 3339 | 2006-01-02T15:04:05.999999999Z07:00 | **Y** | -Any files larger than this will be uploaded in chunks of the configured chunksize. +See the [metadata](https://rclone.org/docs/#metadata) docs for more info. -The upper limit for this is 2147483647 bytes (about 2.000Gi). -That is the maximum amount of bytes a single upload-operation will support. -Setting this above the upper limit will cause uploads to fail. -Properties: -- Config: upload_cutoff -- Env Var: RCLONE_HIDRIVE_UPLOAD_CUTOFF -- Type: SizeSuffix -- Default: 96Mi +## Limitations -#### --hidrive-upload-concurrency +Note that Jottacloud is case insensitive so you can\[aq]t have a file called +\[dq]Hello.doc\[dq] and one called \[dq]hello.doc\[dq]. -Concurrency for chunked uploads. +There are quite a few characters that can\[aq]t be in Jottacloud file names. Rclone will map these names to and from an identical +looking unicode equivalent. For example if a file has a ? in it will be mapped to \[uFF1F] instead. -This is the upper limit for how many transfers for the same file are running concurrently. -Setting this above to a value smaller than 1 will cause uploads to deadlock. +Jottacloud only supports filenames up to 255 characters in length. -If you are uploading small numbers of large files over high-speed links -and these uploads do not fully utilize your bandwidth, then increasing -this may help to speed up the transfers. +## Troubleshooting -Properties: +Jottacloud exhibits some inconsistent behaviours regarding deleted files and folders which may cause Copy, Move and DirMove +operations to previously deleted paths to fail. Emptying the trash should help in such cases. -- Config: upload_concurrency -- Env Var: RCLONE_HIDRIVE_UPLOAD_CONCURRENCY -- Type: int -- Default: 4 +# Koofr -#### --hidrive-encoding +Paths are specified as \[ga]remote:path\[ga] -The encoding for the backend. +Paths may be as deep as required, e.g. \[ga]remote:directory/subdirectory\[ga]. -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +## Configuration -Properties: +The initial setup for Koofr involves creating an application password for +rclone. You can do that by opening the Koofr +[web application](https://app.koofr.net/app/admin/preferences/password), +giving the password a nice name like \[ga]rclone\[ga] and clicking on generate. + +Here is an example of how to make a remote called \[ga]koofr\[ga]. First run: + + rclone config + +This will guide you through an interactive setup process: +\f[R] +.fi +.PP +No remotes found, make a new one? +n) New remote s) Set configuration password q) Quit config n/s/q> n +name> koofr Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] 22 / Koofr, Digi Storage and other Koofr-compatible storage +providers \ (koofr) [snip] Storage> koofr Option provider. +Choose your storage provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. +1 / Koofr, https://app.koofr.net/ \ (koofr) 2 / Digi Storage, +https://storage.rcs-rds.ro/ \ (digistorage) 3 / Any other Koofr API +compatible storage service \ (other) provider> 1 +.PD 0 +.P +.PD +Option user. +Your user name. +Enter a value. +user> USERNAME Option password. +Your password for rclone (generate one at +https://app.koofr.net/app/admin/preferences/password). +Choose an alternative below. +y) Yes, type in my own password g) Generate random password y/g> y Enter +the password: password: Confirm the password: password: Edit advanced +config? +y) Yes n) No (default) y/n> n Remote config -------------------- [koofr] +type = koofr provider = koofr user = USERNAME password = *** ENCRYPTED +*** -------------------- y) Yes this is OK (default) e) Edit this remote +d) Delete this remote y/e/d> y +.IP +.nf +\f[C] +You can choose to edit advanced config in order to enter your own service URL +if you use an on-premise or white label Koofr instance, or choose an alternative +mount instead of your primary storage. + +Once configured you can then use \[ga]rclone\[ga] like this, + +List directories in top level of your Koofr + + rclone lsd koofr: + +List all the files in your Koofr + + rclone ls koofr: + +To copy a local directory to an Koofr directory called backup -- Config: encoding -- Env Var: RCLONE_HIDRIVE_ENCODING -- Type: MultiEncoder -- Default: Slash,Dot + rclone copy /home/source koofr:backup +### Restricted filename characters +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) +the following characters are also replaced: -## Limitations +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| \[rs] | 0x5C | \[uFF3C] | -### Symbolic links +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can\[aq]t be used in XML strings. -HiDrive is able to store symbolic links (*symlinks*) by design, -for example, when unpacked from a zip archive. -There exists no direct mechanism to manage native symlinks in remotes. -As such this implementation has chosen to ignore any native symlinks present in the remote. -rclone will not be able to access or show any symlinks stored in the hidrive-remote. -This means symlinks cannot be individually removed, copied, or moved, -except when removing, copying, or moving the parent folder. +### Standard options -*This does not affect the \[ga].rclonelink\[ga]-files -that rclone uses to encode and store symbolic links.* +Here are the Standard options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers). -### Sparse files +#### --koofr-provider -It is possible to store sparse files in HiDrive. +Choose your storage provider. -Note that copying a sparse file will expand the holes -into null-byte (0x00) regions that will then consume disk space. -Likewise, when downloading a sparse file, -the resulting file will have null-byte regions in the place of file holes. +Properties: -# HTTP +- Config: provider +- Env Var: RCLONE_KOOFR_PROVIDER +- Type: string +- Required: false +- Examples: + - \[dq]koofr\[dq] + - Koofr, https://app.koofr.net/ + - \[dq]digistorage\[dq] + - Digi Storage, https://storage.rcs-rds.ro/ + - \[dq]other\[dq] + - Any other Koofr API compatible storage service -The HTTP remote is a read only remote for reading files of a -webserver. The webserver should provide file listings which rclone -will read and turn into a remote. This has been tested with common -webservers such as Apache/Nginx/Caddy and will likely work with file -listings from most web servers. (If it doesn\[aq]t then please file an -issue, or send a pull request!) +#### --koofr-endpoint -Paths are specified as \[ga]remote:\[ga] or \[ga]remote:path\[ga]. +The Koofr API endpoint to use. -The \[ga]remote:\[ga] represents the configured [url](#http-url), and any path following -it will be resolved relative to this url, according to the URL standard. This -means with remote url \[ga]https://beta.rclone.org/branch\[ga] and path \[ga]fix\[ga], the -resolved URL will be \[ga]https://beta.rclone.org/branch/fix\[ga], while with path -\[ga]/fix\[ga] the resolved URL will be \[ga]https://beta.rclone.org/fix\[ga] as the absolute -path is resolved from the root of the domain. +Properties: -If the path following the \[ga]remote:\[ga] ends with \[ga]/\[ga] it will be assumed to point -to a directory. If the path does not end with \[ga]/\[ga], then a HEAD request is sent -and the response used to decide if it it is treated as a file or a directory -(run with \[ga]-vv\[ga] to see details). When [--http-no-head](#http-no-head) is -specified, a path without ending \[ga]/\[ga] is always assumed to be a file. If rclone -incorrectly assumes the path is a file, the solution is to specify the path with -ending \[ga]/\[ga]. When you know the path is a directory, ending it with \[ga]/\[ga] is always -better as it avoids the initial HEAD request. +- Config: endpoint +- Env Var: RCLONE_KOOFR_ENDPOINT +- Provider: other +- Type: string +- Required: true -To just download a single file it is easier to use -[copyurl](https://rclone.org/commands/rclone_copyurl/). +#### --koofr-user -## Configuration +Your user name. -Here is an example of how to make a remote called \[ga]remote\[ga]. First -run: +Properties: - rclone config +- Config: user +- Env Var: RCLONE_KOOFR_USER +- Type: string +- Required: true -This will guide you through an interactive setup process: -\f[R] -.fi -.PP -No remotes found, make a new one? -n) New remote s) Set configuration password q) Quit config n/s/q> n -name> remote Type of storage to configure. -Choose a number from below, or type in your own value [snip] XX / HTTP -\ \[dq]http\[dq] [snip] Storage> http URL of http host to connect to -Choose a number from below, or type in your own value 1 / Connect to -example.com \ \[dq]https://example.com\[dq] url> https://beta.rclone.org -Remote config -------------------- [remote] url = -https://beta.rclone.org -------------------- y) Yes this is OK e) Edit -this remote d) Delete this remote y/e/d> y Current remotes: -.PP -Name Type ==== ==== remote http -.IP "e)" 3 -Edit existing remote -.IP "f)" 3 -New remote -.IP "g)" 3 -Delete remote -.IP "h)" 3 -Rename remote -.IP "i)" 3 -Copy remote -.IP "j)" 3 -Set configuration password -.IP "k)" 3 -Quit config e/n/d/r/c/s/q> q -.IP -.nf -\f[C] -This remote is called \[ga]remote\[ga] and can now be used like this +#### --koofr-password -See all the top level directories +Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password). - rclone lsd remote: +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -List the contents of a directory +Properties: - rclone ls remote:directory +- Config: password +- Env Var: RCLONE_KOOFR_PASSWORD +- Provider: koofr +- Type: string +- Required: true -Sync the remote \[ga]directory\[ga] to \[ga]/home/local/directory\[ga], deleting any excess files. +### Advanced options - rclone sync --interactive remote:directory /home/local/directory +Here are the Advanced options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers). -### Read only +#### --koofr-mountid -This remote is read only - you can\[aq]t upload files to an HTTP server. +Mount ID of the mount to use. -### Modified time +If omitted, the primary mount is used. -Most HTTP servers store time accurate to 1 second. +Properties: -### Checksum +- Config: mountid +- Env Var: RCLONE_KOOFR_MOUNTID +- Type: string +- Required: false -No checksums are stored. +#### --koofr-setmtime -### Usage without a config file +Does the backend support setting modification time. -Since the http remote only has one config parameter it is easy to use -without a config file: +Set this to false if you use a mount ID that points to a Dropbox or Amazon Drive backend. - rclone lsd --http-url https://beta.rclone.org :http: +Properties: -or: +- Config: setmtime +- Env Var: RCLONE_KOOFR_SETMTIME +- Type: bool +- Default: true - rclone lsd :http,url=\[aq]https://beta.rclone.org\[aq]: +#### --koofr-encoding +The encoding for the backend. -### Standard options +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. -Here are the Standard options specific to http (HTTP). +Properties: -#### --http-url +- Config: encoding +- Env Var: RCLONE_KOOFR_ENCODING +- Type: Encoding +- Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot -URL of HTTP host to connect to. -E.g. \[dq]https://example.com\[dq], or \[dq]https://user:pass\[at]example.com\[dq] to use a username and password. -Properties: +## Limitations -- Config: url -- Env Var: RCLONE_HTTP_URL -- Type: string -- Required: true +Note that Koofr is case insensitive so you can\[aq]t have a file called +\[dq]Hello.doc\[dq] and one called \[dq]hello.doc\[dq]. -### Advanced options +## Providers -Here are the Advanced options specific to http (HTTP). +### Koofr -#### --http-headers +This is the original [Koofr](https://koofr.eu) storage provider used as main example and described in the [configuration](#configuration) section above. -Set HTTP headers for all transactions. +### Digi Storage -Use this to set additional HTTP headers for all transactions. +[Digi Storage](https://www.digi.ro/servicii/online/digi-storage) is a cloud storage service run by [Digi.ro](https://www.digi.ro/) that +provides a Koofr API. -The input format is comma separated list of key,value pairs. Standard -[CSV encoding](https://godoc.org/encoding/csv) may be used. +Here is an example of how to make a remote called \[ga]ds\[ga]. First run: -For example, to set a Cookie use \[aq]Cookie,name=value\[aq], or \[aq]\[dq]Cookie\[dq],\[dq]name=value\[dq]\[aq]. + rclone config -You can set multiple headers, e.g. \[aq]\[dq]Cookie\[dq],\[dq]name=value\[dq],\[dq]Authorization\[dq],\[dq]xxx\[dq]\[aq]. +This will guide you through an interactive setup process: +\f[R] +.fi +.PP +No remotes found, make a new one? +n) New remote s) Set configuration password q) Quit config n/s/q> n +name> ds Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] 22 / Koofr, Digi Storage and other Koofr-compatible storage +providers \ (koofr) [snip] Storage> koofr Option provider. +Choose your storage provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. +1 / Koofr, https://app.koofr.net/ \ (koofr) 2 / Digi Storage, +https://storage.rcs-rds.ro/ \ (digistorage) 3 / Any other Koofr API +compatible storage service \ (other) provider> 2 Option user. +Your user name. +Enter a value. +user> USERNAME Option password. +Your password for rclone (generate one at +https://storage.rcs-rds.ro/app/admin/preferences/password). +Choose an alternative below. +y) Yes, type in my own password g) Generate random password y/g> y Enter +the password: password: Confirm the password: password: Edit advanced +config? +y) Yes n) No (default) y/n> n -------------------- [ds] type = koofr +provider = digistorage user = USERNAME password = *** ENCRYPTED *** +-------------------- y) Yes this is OK (default) e) Edit this remote d) +Delete this remote y/e/d> y +.IP +.nf +\f[C] +### Other -Properties: +You may also want to use another, public or private storage provider that runs a Koofr API compatible service, by simply providing the base URL to connect to. -- Config: headers -- Env Var: RCLONE_HTTP_HEADERS -- Type: CommaSepList -- Default: +Here is an example of how to make a remote called \[ga]other\[ga]. First run: -#### --http-no-slash + rclone config -Set this if the site doesn\[aq]t end directories with /. +This will guide you through an interactive setup process: +\f[R] +.fi +.PP +No remotes found, make a new one? +n) New remote s) Set configuration password q) Quit config n/s/q> n +name> other Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +[snip] 22 / Koofr, Digi Storage and other Koofr-compatible storage +providers \ (koofr) [snip] Storage> koofr Option provider. +Choose your storage provider. +Choose a number from below, or type in your own value. +Press Enter to leave empty. +1 / Koofr, https://app.koofr.net/ \ (koofr) 2 / Digi Storage, +https://storage.rcs-rds.ro/ \ (digistorage) 3 / Any other Koofr API +compatible storage service \ (other) provider> 3 Option endpoint. +The Koofr API endpoint to use. +Enter a value. +endpoint> https://koofr.other.org Option user. +Your user name. +Enter a value. +user> USERNAME Option password. +Your password for rclone (generate one at your service\[aq]s settings +page). +Choose an alternative below. +y) Yes, type in my own password g) Generate random password y/g> y Enter +the password: password: Confirm the password: password: Edit advanced +config? +y) Yes n) No (default) y/n> n -------------------- [other] type = koofr +provider = other endpoint = https://koofr.other.org user = USERNAME +password = *** ENCRYPTED *** -------------------- y) Yes this is OK +(default) e) Edit this remote d) Delete this remote y/e/d> y +.IP +.nf +\f[C] +# Linkbox -Use this if your target website does not use / on the end of -directories. +Linkbox is [a private cloud drive](https://linkbox.to/). -A / on the end of a path is how rclone normally tells the difference -between files and directories. If this flag is set, then rclone will -treat all files with Content-Type: text/html as directories and read -URLs from them rather than downloading them. +## Configuration -Note that this may cause rclone to confuse genuine HTML files with -directories. +Here is an example of making a remote for Linkbox. -Properties: +First run: -- Config: no_slash -- Env Var: RCLONE_HTTP_NO_SLASH -- Type: bool -- Default: false + rclone config -#### --http-no-head +This will guide you through an interactive setup process: +\f[R] +.fi +.PP +No remotes found, make a new one? +n) New remote s) Set configuration password q) Quit config n/s/q> n +.PP +Enter name for new remote. +name> remote +.PP +Option Storage. +Type of storage to configure. +Choose a number from below, or type in your own value. +XX / Linkbox \ (linkbox) Storage> XX +.PP +Option token. +Token from https://www.linkbox.to/admin/account Enter a value. +token> testFromCLToken +.PP +Configuration complete. +Options: - type: linkbox - token: XXXXXXXXXXX Keep this +\[dq]linkbox\[dq] remote? +y) Yes this is OK (default) e) Edit this remote d) Delete this remote +y/e/d> y +.IP +.nf +\f[C] -Don\[aq]t use HEAD requests. +### Standard options -HEAD requests are mainly used to find file sizes in dir listing. -If your site is being very slow to load then you can try this option. -Normally rclone does a HEAD request for each potential file in a -directory listing to: +Here are the Standard options specific to linkbox (Linkbox). -- find its size -- check it really exists -- check to see if it is a directory +#### --linkbox-token -If you set this option, rclone will not do the HEAD request. This will mean -that directory listings are much quicker, but rclone won\[aq]t have the times or -sizes of any files, and some files that don\[aq]t exist may be in the listing. +Token from https://www.linkbox.to/admin/account Properties: -- Config: no_head -- Env Var: RCLONE_HTTP_NO_HEAD -- Type: bool -- Default: false +- Config: token +- Env Var: RCLONE_LINKBOX_TOKEN +- Type: string +- Required: true ## Limitations -\[ga]rclone about\[ga] is not supported by the HTTP backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy \[ga]mfs\[ga] (most free space) as a member of an rclone union -remote. +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can\[aq]t be used in JSON strings. -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) +# Mail.ru Cloud -# Internet Archive +[Mail.ru Cloud](https://cloud.mail.ru/) is a cloud storage provided by a Russian internet company [Mail.Ru Group](https://mail.ru). The official desktop client is [Disk-O:](https://disk-o.cloud/en), available on Windows and Mac OS. -The Internet Archive backend utilizes Items on [archive.org](https://archive.org/) +## Features highlights -Refer to [IAS3 API documentation](https://archive.org/services/docs/api/ias3.html) for the API this backend uses. +- Paths may be as deep as required, e.g. \[ga]remote:directory/subdirectory\[ga] +- Files have a \[ga]last modified time\[ga] property, directories don\[aq]t +- Deleted files are by default moved to the trash +- Files and directories can be shared via public links +- Partial uploads or streaming are not supported, file size must be known before upload +- Maximum file size is limited to 2G for a free account, unlimited for paid accounts +- Storage keeps hash for all files and performs transparent deduplication, + the hash algorithm is a modified SHA1 +- If a particular file is already present in storage, one can quickly submit file hash + instead of long file upload (this optimization is supported by rclone) -Paths are specified as \[ga]remote:bucket\[ga] (or \[ga]remote:\[ga] for the \[ga]lsd\[ga] -command.) You may put subdirectories in too, e.g. \[ga]remote:item/path/to/dir\[ga]. +## Configuration -Unlike S3, listing up all items uploaded by you isn\[aq]t supported. +Here is an example of making a mailru configuration. -Once you have made a remote, you can use it like this: +First create a Mail.ru Cloud account and choose a tariff. -Make a new item +You will need to log in and create an app password for rclone. Rclone +**will not work** with your normal username and password - it will +give an error like \[ga]oauth2: server response missing access_token\[ga]. - rclone mkdir remote:item +- Click on your user icon in the top right +- Go to Security / \[dq]\[u041F]\[u0430]\[u0440]\[u043E]\[u043B]\[u044C] \[u0438] \[u0431]\[u0435]\[u0437]\[u043E]\[u043F]\[u0430]\[u0441]\[u043D]\[u043E]\[u0441]\[u0442]\[u044C]\[dq] +- Click password for apps / \[dq]\[u041F]\[u0430]\[u0440]\[u043E]\[u043B]\[u0438] \[u0434]\[u043B]\[u044F] \[u0432]\[u043D]\[u0435]\[u0448]\[u043D]\[u0438]\[u0445] \[u043F]\[u0440]\[u0438]\[u043B]\[u043E]\[u0436]\[u0435]\[u043D]\[u0438]\[u0439]\[dq] +- Add the password - give it a name - eg \[dq]rclone\[dq] +- Copy the password and use this password below - your normal login password won\[aq]t work. -List the contents of a item +Now run - rclone ls remote:item + rclone config -Sync \[ga]/home/local/directory\[ga] to the remote item, deleting any excess -files in the item. +This will guide you through an interactive setup process: +\f[R] +.fi +.PP +No remotes found, make a new one? +n) New remote s) Set configuration password q) Quit config n/s/q> n +name> remote Type of storage to configure. +Type of storage to configure. +Enter a string value. +Press Enter for the default (\[dq]\[dq]). +Choose a number from below, or type in your own value [snip] XX / +Mail.ru Cloud \ \[dq]mailru\[dq] [snip] Storage> mailru User name +(usually email) Enter a string value. +Press Enter for the default (\[dq]\[dq]). +user> username\[at]mail.ru Password +.PP +This must be an app password - rclone will not work with your normal +password. +See the Configuration section in the docs for how to make an app +password. +y) Yes type in my own password g) Generate random password y/g> y Enter +the password: password: Confirm the password: password: Skip full upload +if there is another file with same data hash. +This feature is called \[dq]speedup\[dq] or \[dq]put by hash\[dq]. +It is especially efficient in case of generally available files like +popular books, video or audio clips [snip] Enter a boolean value (true +or false). +Press Enter for the default (\[dq]true\[dq]). +Choose a number from below, or type in your own value 1 / Enable +\ \[dq]true\[dq] 2 / Disable \ \[dq]false\[dq] speedup_enable> 1 Edit +advanced config? +(y/n) y) Yes n) No y/n> n Remote config -------------------- [remote] +type = mailru user = username\[at]mail.ru pass = *** ENCRYPTED *** +speedup_enable = true -------------------- y) Yes this is OK e) Edit +this remote d) Delete this remote y/e/d> y +.IP +.nf +\f[C] +Configuration of this backend does not require a local web browser. +You can use the configured backend as shown below: - rclone sync --interactive /home/local/directory remote:item +See top level directories -## Notes -Because of Internet Archive\[aq]s architecture, it enqueues write operations (and extra post-processings) in a per-item queue. You can check item\[aq]s queue at https://catalogd.archive.org/history/item-name-here . Because of that, all uploads/deletes will not show up immediately and takes some time to be available. -The per-item queue is enqueued to an another queue, Item Deriver Queue. [You can check the status of Item Deriver Queue here.](https://catalogd.archive.org/catalog.php?whereami=1) This queue has a limit, and it may block you from uploading, or even deleting. You should avoid uploading a lot of small files for better behavior. + rclone lsd remote: -You can optionally wait for the server\[aq]s processing to finish, by setting non-zero value to \[ga]wait_archive\[ga] key. -By making it wait, rclone can do normal file comparison. -Make sure to set a large enough value (e.g. \[ga]30m0s\[ga] for smaller files) as it can take a long time depending on server\[aq]s queue. +Make a new directory -## About metadata -This backend supports setting, updating and reading metadata of each file. -The metadata will appear as file metadata on Internet Archive. -However, some fields are reserved by both Internet Archive and rclone. + rclone mkdir remote:directory -The following are reserved by Internet Archive: -- \[ga]name\[ga] -- \[ga]source\[ga] -- \[ga]size\[ga] -- \[ga]md5\[ga] -- \[ga]crc32\[ga] -- \[ga]sha1\[ga] -- \[ga]format\[ga] -- \[ga]old_version\[ga] -- \[ga]viruscheck\[ga] -- \[ga]summation\[ga] +List the contents of a directory -Trying to set values to these keys is ignored with a warning. -Only setting \[ga]mtime\[ga] is an exception. Doing so make it the identical behavior as setting ModTime. + rclone ls remote:directory -rclone reserves all the keys starting with \[ga]rclone-\[ga]. Setting value for these keys will give you warnings, but values are set according to request. +Sync \[ga]/home/local/directory\[ga] to the remote path, deleting any +excess files in the path. -If there are multiple values for a key, only the first one is returned. -This is a limitation of rclone, that supports one value per one key. -It can be triggered when you did a server-side copy. + rclone sync --interactive /home/local/directory remote:directory -Reading metadata will also provide custom (non-standard nor reserved) ones. +### Modification times and hashes -## Filtering auto generated files +Files support a modification time attribute with up to 1 second precision. +Directories do not have a modification time, which is shown as \[dq]Jan 1 1970\[dq]. -The Internet Archive automatically creates metadata files after -upload. These can cause problems when doing an \[ga]rclone sync\[ga] as rclone -will try, and fail, to delete them. These metadata files are not -changeable, as they are created by the Internet Archive automatically. +File hashes are supported, with a custom Mail.ru algorithm based on SHA1. +If file size is less than or equal to the SHA1 block size (20 bytes), +its hash is simply its data right-padded with zero bytes. +Hashes of a larger file is computed as a SHA1 of the file data +bytes concatenated with a decimal representation of the data length. -These auto-created files can be excluded from the sync using [metadata -filtering](https://rclone.org/filtering/#metadata). +### Emptying Trash - rclone sync ... --metadata-exclude \[dq]source=metadata\[dq] --metadata-exclude \[dq]format=Metadata\[dq] +Removing a file or directory actually moves it to the trash, which is not +visible to rclone but can be seen in a web browser. The trashed file +still occupies part of total quota. If you wish to empty your trash +and free some quota, you can use the \[ga]rclone cleanup remote:\[ga] command, +which will permanently delete all your trashed files. +This command does not take any path arguments. -Which excludes from the sync any files which have the -\[ga]source=metadata\[ga] or \[ga]format=Metadata\[ga] flags which are added to -Internet Archive auto-created files. +### Quota information -## Configuration +To view your current quota you can use the \[ga]rclone about remote:\[ga] +command which will display your usage limit (quota) and the current usage. -Here is an example of making an internetarchive configuration. -Most applies to the other providers as well, any differences are described [below](#providers). +### Restricted filename characters -First run +In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) +the following characters are also replaced: - rclone config +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| \[dq] | 0x22 | \[uFF02] | +| * | 0x2A | \[uFF0A] | +| : | 0x3A | \[uFF1A] | +| < | 0x3C | \[uFF1C] | +| > | 0x3E | \[uFF1E] | +| ? | 0x3F | \[uFF1F] | +| \[rs] | 0x5C | \[uFF3C] | +| \[rs]| | 0x7C | \[uFF5C] | + +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can\[aq]t be used in JSON strings. -This will guide you through an interactive setup process. -\f[R] -.fi -.PP -No remotes found, make a new one? -n) New remote s) Set configuration password q) Quit config n/s/q> n -name> remote Option Storage. -Type of storage to configure. -Choose a number from below, or type in your own value. -XX / InternetArchive Items \ (internetarchive) Storage> internetarchive -Option access_key_id. -IAS3 Access Key. -Leave blank for anonymous access. -You can find one here: https://archive.org/account/s3.php Enter a value. -Press Enter to leave empty. -access_key_id> XXXX Option secret_access_key. -IAS3 Secret Key (password). -Leave blank for anonymous access. -Enter a value. -Press Enter to leave empty. -secret_access_key> XXXX Edit advanced config? -y) Yes n) No (default) y/n> y Option endpoint. -IAS3 Endpoint. -Leave blank for default value. -Enter a string value. -Press Enter for the default (https://s3.us.archive.org). -endpoint> Option front_endpoint. -Host of InternetArchive Frontend. -Leave blank for default value. -Enter a string value. -Press Enter for the default (https://archive.org). -front_endpoint> Option disable_checksum. -Don\[aq]t store MD5 checksum with object metadata. -Normally rclone will calculate the MD5 checksum of the input before -uploading it so it can ask the server to check the object against -checksum. -This is great for data integrity checking but can cause long delays for -large files to start uploading. -Enter a boolean value (true or false). -Press Enter for the default (true). -disable_checksum> true Option encoding. -The encoding for the backend. -See the encoding section in the -overview (https://rclone.org/overview/#encoding) for more info. -Enter a encoder.MultiEncoder value. -Press Enter for the default -(Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot). -encoding> Edit advanced config? -y) Yes n) No (default) y/n> n -------------------- [remote] type = -internetarchive access_key_id = XXXX secret_access_key = XXXX --------------------- y) Yes this is OK (default) e) Edit this remote d) -Delete this remote y/e/d> y -.IP -.nf -\f[C] ### Standard options -Here are the Standard options specific to internetarchive (Internet Archive). +Here are the Standard options specific to mailru (Mail.ru Cloud). -#### --internetarchive-access-key-id +#### --mailru-client-id -IAS3 Access Key. +OAuth Client Id. -Leave blank for anonymous access. -You can find one here: https://archive.org/account/s3.php +Leave blank normally. Properties: -- Config: access_key_id -- Env Var: RCLONE_INTERNETARCHIVE_ACCESS_KEY_ID +- Config: client_id +- Env Var: RCLONE_MAILRU_CLIENT_ID - Type: string - Required: false -#### --internetarchive-secret-access-key +#### --mailru-client-secret -IAS3 Secret Key (password). +OAuth Client Secret. -Leave blank for anonymous access. +Leave blank normally. Properties: -- Config: secret_access_key -- Env Var: RCLONE_INTERNETARCHIVE_SECRET_ACCESS_KEY +- Config: client_secret +- Env Var: RCLONE_MAILRU_CLIENT_SECRET - Type: string - Required: false -### Advanced options - -Here are the Advanced options specific to internetarchive (Internet Archive). - -#### --internetarchive-endpoint - -IAS3 Endpoint. +#### --mailru-user -Leave blank for default value. +User name (usually email). Properties: -- Config: endpoint -- Env Var: RCLONE_INTERNETARCHIVE_ENDPOINT +- Config: user +- Env Var: RCLONE_MAILRU_USER - Type: string -- Default: \[dq]https://s3.us.archive.org\[dq] +- Required: true -#### --internetarchive-front-endpoint +#### --mailru-pass -Host of InternetArchive Frontend. +Password. -Leave blank for default value. +This must be an app password - rclone will not work with your normal +password. See the Configuration section in the docs for how to make an +app password. + + +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: -- Config: front_endpoint -- Env Var: RCLONE_INTERNETARCHIVE_FRONT_ENDPOINT +- Config: pass +- Env Var: RCLONE_MAILRU_PASS - Type: string -- Default: \[dq]https://archive.org\[dq] +- Required: true -#### --internetarchive-disable-checksum +#### --mailru-speedup-enable -Don\[aq]t ask the server to test against MD5 checksum calculated by rclone. -Normally rclone will calculate the MD5 checksum of the input before -uploading it so it can ask the server to check the object against checksum. -This is great for data integrity checking but can cause long delays for -large files to start uploading. +Skip full upload if there is another file with same data hash. + +This feature is called \[dq]speedup\[dq] or \[dq]put by hash\[dq]. It is especially efficient +in case of generally available files like popular books, video or audio clips, +because files are searched by hash in all accounts of all mailru users. +It is meaningless and ineffective if source file is unique or encrypted. +Please note that rclone may need local memory and disk space to calculate +content hash in advance and decide whether full upload is required. +Also, if rclone does not know file size in advance (e.g. in case of +streaming or partial uploads), it will not even try this optimization. Properties: -- Config: disable_checksum -- Env Var: RCLONE_INTERNETARCHIVE_DISABLE_CHECKSUM +- Config: speedup_enable +- Env Var: RCLONE_MAILRU_SPEEDUP_ENABLE - Type: bool - Default: true +- Examples: + - \[dq]true\[dq] + - Enable + - \[dq]false\[dq] + - Disable -#### --internetarchive-wait-archive +### Advanced options -Timeout for waiting the server\[aq]s processing tasks (specifically archive and book_op) to finish. -Only enable if you need to be guaranteed to be reflected after write operations. -0 to disable waiting. No errors to be thrown in case of timeout. +Here are the Advanced options specific to mailru (Mail.ru Cloud). + +#### --mailru-token + +OAuth Access Token as a JSON blob. Properties: -- Config: wait_archive -- Env Var: RCLONE_INTERNETARCHIVE_WAIT_ARCHIVE -- Type: Duration -- Default: 0s +- Config: token +- Env Var: RCLONE_MAILRU_TOKEN +- Type: string +- Required: false -#### --internetarchive-encoding +#### --mailru-auth-url -The encoding for the backend. +Auth server URL. -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Leave blank to use the provider defaults. Properties: -- Config: encoding -- Env Var: RCLONE_INTERNETARCHIVE_ENCODING -- Type: MultiEncoder -- Default: Slash,LtGt,CrLf,Del,Ctl,InvalidUtf8,Dot +- Config: auth_url +- Env Var: RCLONE_MAILRU_AUTH_URL +- Type: string +- Required: false -### Metadata +#### --mailru-token-url -Metadata fields provided by Internet Archive. -If there are multiple values for a key, only the first one is returned. -This is a limitation of Rclone, that supports one value per one key. +Token server url. -Owner is able to add custom keys. Metadata feature grabs all the keys including them. +Leave blank to use the provider defaults. -Here are the possible system metadata items for the internetarchive backend. +Properties: -| Name | Help | Type | Example | Read Only | -|------|------|------|---------|-----------| -| crc32 | CRC32 calculated by Internet Archive | string | 01234567 | **Y** | -| format | Name of format identified by Internet Archive | string | Comma-Separated Values | **Y** | -| md5 | MD5 hash calculated by Internet Archive | string | 01234567012345670123456701234567 | **Y** | -| mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | **Y** | -| name | Full file path, without the bucket part | filename | backend/internetarchive/internetarchive.go | **Y** | -| old_version | Whether the file was replaced and moved by keep-old-version flag | boolean | true | **Y** | -| rclone-ia-mtime | Time of last modification, managed by Internet Archive | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N | -| rclone-mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N | -| rclone-update-track | Random value used by Rclone for tracking changes inside Internet Archive | string | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | N | -| sha1 | SHA1 hash calculated by Internet Archive | string | 0123456701234567012345670123456701234567 | **Y** | -| size | File size in bytes | decimal number | 123456 | **Y** | -| source | The source of the file | string | original | **Y** | -| summation | Check https://forum.rclone.org/t/31922 for how it is used | string | md5 | **Y** | -| viruscheck | The last time viruscheck process was run for the file (?) | unixtime | 1654191352 | **Y** | +- Config: token_url +- Env Var: RCLONE_MAILRU_TOKEN_URL +- Type: string +- Required: false -See the [metadata](https://rclone.org/docs/#metadata) docs for more info. +#### --mailru-speedup-file-patterns +Comma separated list of file name patterns eligible for speedup (put by hash). +Patterns are case insensitive and can contain \[aq]*\[aq] or \[aq]?\[aq] meta characters. -# Jottacloud +Properties: -Jottacloud is a cloud storage service provider from a Norwegian company, using its own datacenters -in Norway. In addition to the official service at [jottacloud.com](https://www.jottacloud.com/), -it also provides white-label solutions to different companies, such as: -* Telia - * Telia Cloud (cloud.telia.se) - * Telia Sky (sky.telia.no) -* Tele2 - * Tele2 Cloud (mittcloud.tele2.se) -* Onlime - * Onlime Cloud Storage (onlime.dk) -* Elkj\[/o]p (with subsidiaries): - * Elkj\[/o]p Cloud (cloud.elkjop.no) - * Elgiganten Sweden (cloud.elgiganten.se) - * Elgiganten Denmark (cloud.elgiganten.dk) - * Giganti Cloud (cloud.gigantti.fi) - * ELKO Cloud (cloud.elko.is) +- Config: speedup_file_patterns +- Env Var: RCLONE_MAILRU_SPEEDUP_FILE_PATTERNS +- Type: string +- Default: \[dq]*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf\[dq] +- Examples: + - \[dq]\[dq] + - Empty list completely disables speedup (put by hash). + - \[dq]*\[dq] + - All files will be attempted for speedup. + - \[dq]*.mkv,*.avi,*.mp4,*.mp3\[dq] + - Only common audio/video files will be tried for put by hash. + - \[dq]*.zip,*.gz,*.rar,*.pdf\[dq] + - Only common archives or PDF books will be tried for speedup. -Most of the white-label versions are supported by this backend, although may require different -authentication setup - described below. +#### --mailru-speedup-max-disk -Paths are specified as \[ga]remote:path\[ga] +This option allows you to disable speedup (put by hash) for large files. -Paths may be as deep as required, e.g. \[ga]remote:directory/subdirectory\[ga]. +Reason is that preliminary hashing can exhaust your RAM or disk space. -## Authentication types +Properties: -Some of the whitelabel versions uses a different authentication method than the official service, -and you have to choose the correct one when setting up the remote. +- Config: speedup_max_disk +- Env Var: RCLONE_MAILRU_SPEEDUP_MAX_DISK +- Type: SizeSuffix +- Default: 3Gi +- Examples: + - \[dq]0\[dq] + - Completely disable speedup (put by hash). + - \[dq]1G\[dq] + - Files larger than 1Gb will be uploaded directly. + - \[dq]3G\[dq] + - Choose this option if you have less than 3Gb free on local disk. -### Standard authentication +#### --mailru-speedup-max-memory -The standard authentication method used by the official service (jottacloud.com), as well as -some of the whitelabel services, requires you to generate a single-use personal login token -from the account security settings in the service\[aq]s web interface. Log in to your account, -go to \[dq]Settings\[dq] and then \[dq]Security\[dq], or use the direct link presented to you by rclone when -configuring the remote: . Scroll down to the section -\[dq]Personal login token\[dq], and click the \[dq]Generate\[dq] button. Note that if you are using a -whitelabel service you probably can\[aq]t use the direct link, you need to find the same page in -their dedicated web interface, and also it may be in a different location than described above. +Files larger than the size given below will always be hashed on disk. -To access your account from multiple instances of rclone, you need to configure each of them -with a separate personal login token. E.g. you create a Jottacloud remote with rclone in one -location, and copy the configuration file to a second location where you also want to run -rclone and access the same remote. Then you need to replace the token for one of them, using -the [config reconnect](https://rclone.org/commands/rclone_config_reconnect/) command, which -requires you to generate a new personal login token and supply as input. If you do not -do this, the token may easily end up being invalidated, resulting in both instances failing -with an error message something along the lines of: +Properties: - oauth2: cannot fetch token: 400 Bad Request - Response: {\[dq]error\[dq]:\[dq]invalid_grant\[dq],\[dq]error_description\[dq]:\[dq]Stale token\[dq]} +- Config: speedup_max_memory +- Env Var: RCLONE_MAILRU_SPEEDUP_MAX_MEMORY +- Type: SizeSuffix +- Default: 32Mi +- Examples: + - \[dq]0\[dq] + - Preliminary hashing will always be done in a temporary disk location. + - \[dq]32M\[dq] + - Do not dedicate more than 32Mb RAM for preliminary hashing. + - \[dq]256M\[dq] + - You have at most 256Mb RAM free for hash calculations. -When this happens, you need to replace the token as described above to be able to use your -remote again. +#### --mailru-check-hash -All personal login tokens you have taken into use will be listed in the web interface under -\[dq]My logged in devices\[dq], and from the right side of that list you can click the \[dq]X\[dq] button to -revoke individual tokens. +What should copy do if file checksum is mismatched or invalid. -### Legacy authentication +Properties: -If you are using one of the whitelabel versions (e.g. from Elkj\[/o]p) you may not have the option -to generate a CLI token. In this case you\[aq]ll have to use the legacy authentication. To do this select -yes when the setup asks for legacy authentication and enter your username and password. -The rest of the setup is identical to the default setup. +- Config: check_hash +- Env Var: RCLONE_MAILRU_CHECK_HASH +- Type: bool +- Default: true +- Examples: + - \[dq]true\[dq] + - Fail with error. + - \[dq]false\[dq] + - Ignore and continue. -### Telia Cloud authentication +#### --mailru-user-agent -Similar to other whitelabel versions Telia Cloud doesn\[aq]t offer the option of creating a CLI token, and -additionally uses a separate authentication flow where the username is generated internally. To setup -rclone to use Telia Cloud, choose Telia Cloud authentication in the setup. The rest of the setup is -identical to the default setup. +HTTP user agent used internally by client. -### Tele2 Cloud authentication +Defaults to \[dq]rclone/VERSION\[dq] or \[dq]--user-agent\[dq] provided on command line. -As Tele2-Com Hem merger was completed this authentication can be used for former Com Hem Cloud and -Tele2 Cloud customers as no support for creating a CLI token exists, and additionally uses a separate -authentication flow where the username is generated internally. To setup rclone to use Tele2 Cloud, -choose Tele2 Cloud authentication in the setup. The rest of the setup is identical to the default setup. +Properties: -### Onlime Cloud Storage authentication +- Config: user_agent +- Env Var: RCLONE_MAILRU_USER_AGENT +- Type: string +- Required: false -Onlime has sold access to Jottacloud proper, while providing localized support to Danish Customers, but -have recently set up their own hosting, transferring their customers from Jottacloud servers to their -own ones. +#### --mailru-quirks -This, of course, necessitates using their servers for authentication, but otherwise functionality and -architecture seems equivalent to Jottacloud. +Comma separated list of internal maintenance flags. -To setup rclone to use Onlime Cloud Storage, choose Onlime Cloud authentication in the setup. The rest -of the setup is identical to the default setup. +This option must not be used by an ordinary user. It is intended only to +facilitate remote troubleshooting of backend issues. Strict meaning of +flags is not documented and not guaranteed to persist between releases. +Quirks will be removed when the backend grows stable. +Supported quirks: atomicmkdir binlist unknowndirs -## Configuration +Properties: -Here is an example of how to make a remote called \[ga]remote\[ga] with the default setup. First run: +- Config: quirks +- Env Var: RCLONE_MAILRU_QUIRKS +- Type: string +- Required: false - rclone config +#### --mailru-encoding -This will guide you through an interactive setup process: -\f[R] -.fi -.PP -No remotes found, make a new one? -n) New remote s) Set configuration password q) Quit config n/s/q> n -name> remote Option Storage. -Type of storage to configure. -Choose a number from below, or type in your own value. -[snip] XX / Jottacloud \ (jottacloud) [snip] Storage> jottacloud Edit -advanced config? -y) Yes n) No (default) y/n> n Option config_type. -Select authentication type. -Choose a number from below, or type in an existing string value. -Press Enter for the default (standard). -/ Standard authentication. -1 | Use this if you\[aq]re a normal Jottacloud user. -\ (standard) / Legacy authentication. -2 | This is only required for certain whitelabel versions of Jottacloud -and not recommended for normal users. -\ (legacy) / Telia Cloud authentication. -3 | Use this if you are using Telia Cloud. -\ (telia) / Tele2 Cloud authentication. -4 | Use this if you are using Tele2 Cloud. -\ (tele2) / Onlime Cloud authentication. -5 | Use this if you are using Onlime Cloud. -\ (onlime) config_type> 1 Personal login token. -Generate here: https://www.jottacloud.com/web/secure Login Token> Use a -non-standard device/mountpoint? -Choosing no, the default, will let you access the storage used for the -archive section of the official Jottacloud client. -If you instead want to access the sync or the backup section, for -example, you must choose yes. -y) Yes n) No (default) y/n> y Option config_device. -The device to use. -In standard setup the built-in Jotta device is used, which contains -predefined mountpoints for archive, sync etc. -All other devices are treated as backup devices by the official -Jottacloud client. -You may create a new by entering a unique name. -Choose a number from below, or type in your own string value. -Press Enter for the default (DESKTOP-3H31129). -1 > DESKTOP-3H31129 2 > Jotta config_device> 2 Option config_mountpoint. -The mountpoint to use for the built-in device Jotta. -The standard setup is to use the Archive mountpoint. -Most other mountpoints have very limited support in rclone and should -generally be avoided. -Choose a number from below, or type in an existing string value. -Press Enter for the default (Archive). -1 > Archive 2 > Shared 3 > Sync config_mountpoint> 1 --------------------- [remote] type = jottacloud configVersion = 1 -client_id = jottacli client_secret = tokenURL = -https://id.jottacloud.com/auth/realms/jottacloud/protocol/openid-connect/token -token = {........} username = 2940e57271a93d987d6f8a21 device = Jotta -mountpoint = Archive -------------------- y) Yes this is OK (default) e) -Edit this remote d) Delete this remote y/e/d> y -.IP -.nf -\f[C] -Once configured you can then use \[ga]rclone\[ga] like this, +The encoding for the backend. -List directories in top level of your Jottacloud +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. - rclone lsd remote: +Properties: -List all the files in your Jottacloud +- Config: encoding +- Env Var: RCLONE_MAILRU_ENCODING +- Type: Encoding +- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot - rclone ls remote: -To copy a local directory to an Jottacloud directory called backup - rclone copy /home/source remote:backup +## Limitations -### Devices and Mountpoints +File size limits depend on your account. A single file size is limited by 2G +for a free account and unlimited for paid tariffs. Please refer to the Mail.ru +site for the total uploaded size limits. -The official Jottacloud client registers a device for each computer you install -it on, and shows them in the backup section of the user interface. For each -folder you select for backup it will create a mountpoint within this device. -A built-in device called Jotta is special, and contains mountpoints Archive, -Sync and some others, used for corresponding features in official clients. +Note that Mailru is case insensitive so you can\[aq]t have a file called +\[dq]Hello.doc\[dq] and one called \[dq]hello.doc\[dq]. -With rclone you\[aq]ll want to use the standard Jotta/Archive device/mountpoint in -most cases. However, you may for example want to access files from the sync or -backup functionality provided by the official clients, and rclone therefore -provides the option to select other devices and mountpoints during config. +# Mega -You are allowed to create new devices and mountpoints. All devices except the -built-in Jotta device are treated as backup devices by official Jottacloud -clients, and the mountpoints on them are individual backup sets. +[Mega](https://mega.nz/) is a cloud storage and file hosting service +known for its security feature where all files are encrypted locally +before they are uploaded. This prevents anyone (including employees of +Mega) from accessing the files without knowledge of the key used for +encryption. -With the built-in Jotta device, only existing, built-in, mountpoints can be -selected. In addition to the mentioned Archive and Sync, it may contain -several other mountpoints such as: Latest, Links, Shared and Trash. All of -these are special mountpoints with a different internal representation than -the \[dq]regular\[dq] mountpoints. Rclone will only to a very limited degree support -them. Generally you should avoid these, unless you know what you are doing. +This is an rclone backend for Mega which supports the file transfer +features of Mega using the same client side encryption. -### --fast-list +Paths are specified as \[ga]remote:path\[ga] -This remote supports \[ga]--fast-list\[ga] which allows you to use fewer -transactions in exchange for more memory. See the [rclone -docs](https://rclone.org/docs/#fast-list) for more details. +Paths may be as deep as required, e.g. \[ga]remote:directory/subdirectory\[ga]. -Note that the implementation in Jottacloud always uses only a single -API request to get the entire list, so for large folders this could -lead to long wait time before the first results are shown. +## Configuration -Note also that with rclone version 1.58 and newer information about -[MIME types](https://rclone.org/overview/#mime-type) are not available when using \[ga]--fast-list\[ga]. +Here is an example of how to make a remote called \[ga]remote\[ga]. First run: -### Modified time and hashes + rclone config -Jottacloud allows modification times to be set on objects accurate to 1 -second. These will be used to detect whether objects need syncing or -not. +This will guide you through an interactive setup process: +\f[R] +.fi +.PP +No remotes found, make a new one? +n) New remote s) Set configuration password q) Quit config n/s/q> n +name> remote Type of storage to configure. +Choose a number from below, or type in your own value [snip] XX / Mega +\ \[dq]mega\[dq] [snip] Storage> mega User name user> +you\[at]example.com Password. +y) Yes type in my own password g) Generate random password n) No leave +this optional password blank y/g/n> y Enter the password: password: +Confirm the password: password: Remote config -------------------- +[remote] type = mega user = you\[at]example.com pass = *** ENCRYPTED *** +-------------------- y) Yes this is OK e) Edit this remote d) Delete +this remote y/e/d> y +.IP +.nf +\f[C] +**NOTE:** The encryption keys need to have been already generated after a regular login +via the browser, otherwise attempting to use the credentials in \[ga]rclone\[ga] will fail. -Jottacloud supports MD5 type hashes, so you can use the \[ga]--checksum\[ga] -flag. +Once configured you can then use \[ga]rclone\[ga] like this, -Note that Jottacloud requires the MD5 hash before upload so if the -source does not have an MD5 checksum then the file will be cached -temporarily on disk (in location given by -[--temp-dir](https://rclone.org/docs/#temp-dir-dir)) before it is uploaded. -Small files will be cached in memory - see the -[--jottacloud-md5-memory-limit](#jottacloud-md5-memory-limit) flag. -When uploading from local disk the source checksum is always available, -so this does not apply. Starting with rclone version 1.52 the same is -true for encrypted remotes (in older versions the crypt backend would not -calculate hashes for uploads from local disk, so the Jottacloud -backend had to do it as described above). +List directories in top level of your Mega + + rclone lsd remote: + +List all the files in your Mega -### Restricted filename characters + rclone ls remote: -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) -the following characters are also replaced: +To copy a local directory to an Mega directory called backup -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| \[dq] | 0x22 | \[uFF02] | -| * | 0x2A | \[uFF0A] | -| : | 0x3A | \[uFF1A] | -| < | 0x3C | \[uFF1C] | -| > | 0x3E | \[uFF1E] | -| ? | 0x3F | \[uFF1F] | -| \[rs]| | 0x7C | \[uFF5C] | + rclone copy /home/source remote:backup -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can\[aq]t be used in XML strings. +### Modification times and hashes -### Deleting files +Mega does not support modification times or hashes yet. -By default, rclone will send all files to the trash when deleting files. They will be permanently -deleted automatically after 30 days. You may bypass the trash and permanently delete files immediately -by using the [--jottacloud-hard-delete](#jottacloud-hard-delete) flag, or set the equivalent environment variable. -Emptying the trash is supported by the [cleanup](https://rclone.org/commands/rclone_cleanup/) command. +### Restricted filename characters -### Versions +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| NUL | 0x00 | \[u2400] | +| / | 0x2F | \[uFF0F] | -Jottacloud supports file versioning. When rclone uploads a new version of a file it creates a new version of it. -Currently rclone only supports retrieving the current version but older versions can be accessed via the Jottacloud Website. +Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), +as they can\[aq]t be used in JSON strings. -Versioning can be disabled by \[ga]--jottacloud-no-versions\[ga] option. This is achieved by deleting the remote file prior to uploading -a new version. If the upload the fails no version of the file will be available in the remote. +### Duplicated files -### Quota information +Mega can have two files with exactly the same name and path (unlike a +normal file system). -To view your current quota you can use the \[ga]rclone about remote:\[ga] -command which will display your usage limit (unless it is unlimited) -and the current usage. +Duplicated files cause problems with the syncing and you will see +messages in the log about duplicates. +Use \[ga]rclone dedupe\[ga] to fix duplicated files. -### Standard options +### Failure to log-in -Here are the Standard options specific to jottacloud (Jottacloud). +#### Object not found -#### --jottacloud-client-id +If you are connecting to your Mega remote for the first time, +to test access and synchronization, you may receive an error such as +\f[R] +.fi +.PP +Failed to create file system for \[dq]my-mega-remote:\[dq]: couldn\[aq]t +login: Object (typically, node or user) not found +.IP +.nf +\f[C] +The diagnostic steps often recommended in the [rclone forum](https://forum.rclone.org/search?q=mega) +start with the **MEGAcmd** utility. Note that this refers to +the official C++ command from https://github.com/meganz/MEGAcmd +and not the go language built command from t3rm1n4l/megacmd +that is no longer maintained. -OAuth Client Id. +Follow the instructions for installing MEGAcmd and try accessing +your remote as they recommend. You can establish whether or not +you can log in using MEGAcmd, and obtain diagnostic information +to help you, and search or work with others in the forum. +\f[R] +.fi +.PP +MEGA CMD> login me\[at]example.com Password: Fetching nodes ... +Loading transfers from local cache Login complete as me\[at]example.com +me\[at]example.com:/$ +.IP +.nf +\f[C] +Note that some have found issues with passwords containing special +characters. If you can not log on with rclone, but MEGAcmd logs on +just fine, then consider changing your password temporarily to +pure alphanumeric characters, in case that helps. -Leave blank normally. -Properties: +#### Repeated commands blocks access -- Config: client_id -- Env Var: RCLONE_JOTTACLOUD_CLIENT_ID -- Type: string -- Required: false +Mega remotes seem to get blocked (reject logins) under \[dq]heavy use\[dq]. +We haven\[aq]t worked out the exact blocking rules but it seems to be +related to fast paced, successive rclone commands. -#### --jottacloud-client-secret +For example, executing this command 90 times in a row \[ga]rclone link +remote:file\[ga] will cause the remote to become \[dq]blocked\[dq]. This is not an +abnormal situation, for example if you wish to get the public links of +a directory with hundred of files... After more or less a week, the +remote will remote accept rclone logins normally again. -OAuth Client Secret. +You can mitigate this issue by mounting the remote it with \[ga]rclone +mount\[ga]. This will log-in when mounting and a log-out when unmounting +only. You can also run \[ga]rclone rcd\[ga] and then use \[ga]rclone rc\[ga] to run +the commands over the API to avoid logging in each time. -Leave blank normally. +Rclone does not currently close mega sessions (you can see them in the +web interface), however closing the sessions does not solve the issue. -Properties: +If you space rclone commands by 3 seconds it will avoid blocking the +remote. We haven\[aq]t identified the exact blocking rules, so perhaps one +could execute the command 80 times without waiting and avoid blocking +by waiting 3 seconds, then continuing... -- Config: client_secret -- Env Var: RCLONE_JOTTACLOUD_CLIENT_SECRET -- Type: string -- Required: false +Note that this has been observed by trial and error and might not be +set in stone. -### Advanced options +Other tools seem not to produce this blocking effect, as they use a +different working approach (state-based, using sessionIDs instead of +log-in) which isn\[aq]t compatible with the current stateless rclone +approach. -Here are the Advanced options specific to jottacloud (Jottacloud). +Note that once blocked, the use of other tools (such as megacmd) is +not a sure workaround: following megacmd login times have been +observed in succession for blocked remote: 7 minutes, 20 min, 30min, 30 +min, 30min. Web access looks unaffected though. -#### --jottacloud-token +Investigation is continuing in relation to workarounds based on +timeouts, pacers, retrials and tpslimits - if you discover something +relevant, please post on the forum. -OAuth Access Token as a JSON blob. +So, if rclone was working nicely and suddenly you are unable to log-in +and you are sure the user and the password are correct, likely you +have got the remote blocked for a while. -Properties: -- Config: token -- Env Var: RCLONE_JOTTACLOUD_TOKEN -- Type: string -- Required: false +### Standard options -#### --jottacloud-auth-url +Here are the Standard options specific to mega (Mega). -Auth server URL. +#### --mega-user -Leave blank to use the provider defaults. +User name. Properties: -- Config: auth_url -- Env Var: RCLONE_JOTTACLOUD_AUTH_URL +- Config: user +- Env Var: RCLONE_MEGA_USER - Type: string -- Required: false +- Required: true -#### --jottacloud-token-url +#### --mega-pass -Token server url. +Password. -Leave blank to use the provider defaults. +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: -- Config: token_url -- Env Var: RCLONE_JOTTACLOUD_TOKEN_URL +- Config: pass +- Env Var: RCLONE_MEGA_PASS - Type: string -- Required: false - -#### --jottacloud-md5-memory-limit - -Files bigger than this will be cached on disk to calculate the MD5 if required. +- Required: true -Properties: +### Advanced options -- Config: md5_memory_limit -- Env Var: RCLONE_JOTTACLOUD_MD5_MEMORY_LIMIT -- Type: SizeSuffix -- Default: 10Mi +Here are the Advanced options specific to mega (Mega). -#### --jottacloud-trashed-only +#### --mega-debug -Only show files that are in the trash. +Output more debug from Mega. -This will show trashed files in their original directory structure. +If this flag is set (along with -vv) it will print further debugging +information from the mega backend. Properties: -- Config: trashed_only -- Env Var: RCLONE_JOTTACLOUD_TRASHED_ONLY +- Config: debug +- Env Var: RCLONE_MEGA_DEBUG - Type: bool - Default: false -#### --jottacloud-hard-delete +#### --mega-hard-delete Delete files permanently rather than putting them into the trash. +Normally the mega backend will put all deletions into the trash rather +than permanently deleting them. If you specify this then rclone will +permanently delete objects instead. + Properties: - Config: hard_delete -- Env Var: RCLONE_JOTTACLOUD_HARD_DELETE +- Env Var: RCLONE_MEGA_HARD_DELETE - Type: bool - Default: false -#### --jottacloud-upload-resume-limit - -Files bigger than this can be resumed if the upload fail\[aq]s. - -Properties: - -- Config: upload_resume_limit -- Env Var: RCLONE_JOTTACLOUD_UPLOAD_RESUME_LIMIT -- Type: SizeSuffix -- Default: 10Mi +#### --mega-use-https -#### --jottacloud-no-versions +Use HTTPS for transfers. -Avoid server side versioning by deleting files and recreating files instead of overwriting them. +MEGA uses plain text HTTP connections by default. +Some ISPs throttle HTTP connections, this causes transfers to become very slow. +Enabling this will force MEGA to use HTTPS for all transfers. +HTTPS is normally not necessary since all data is already encrypted anyway. +Enabling it will increase CPU usage and add network overhead. Properties: -- Config: no_versions -- Env Var: RCLONE_JOTTACLOUD_NO_VERSIONS +- Config: use_https +- Env Var: RCLONE_MEGA_USE_HTTPS - Type: bool - Default: false -#### --jottacloud-encoding +#### --mega-encoding The encoding for the backend. @@ -45907,377 +46368,386 @@ See the [encoding section in the overview](https://rclone.org/overview/#encoding Properties: - Config: encoding -- Env Var: RCLONE_JOTTACLOUD_ENCODING -- Type: MultiEncoder -- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Del,Ctl,InvalidUtf8,Dot +- Env Var: RCLONE_MEGA_ENCODING +- Type: Encoding +- Default: Slash,InvalidUtf8,Dot + +### Process \[ga]killed\[ga] + +On accounts with large files or something else, memory usage can significantly increase when executing list/sync instructions. When running on cloud providers (like AWS with EC2), check if the instance type has sufficient memory/CPU to execute the commands. Use the resource monitoring tools to inspect after sending the commands. Look [at this issue](https://forum.rclone.org/t/rclone-with-mega-appears-to-work-only-in-some-accounts/40233/4). ## Limitations -Note that Jottacloud is case insensitive so you can\[aq]t have a file called -\[dq]Hello.doc\[dq] and one called \[dq]hello.doc\[dq]. +This backend uses the [go-mega go library](https://github.com/t3rm1n4l/go-mega) which is an opensource +go library implementing the Mega API. There doesn\[aq]t appear to be any +documentation for the mega protocol beyond the [mega C++ SDK](https://github.com/meganz/sdk) source code +so there are likely quite a few errors still remaining in this library. -There are quite a few characters that can\[aq]t be in Jottacloud file names. Rclone will map these names to and from an identical -looking unicode equivalent. For example if a file has a ? in it will be mapped to \[uFF1F] instead. +Mega allows duplicate files which may confuse rclone. -Jottacloud only supports filenames up to 255 characters in length. +# Memory -## Troubleshooting +The memory backend is an in RAM backend. It does not persist its +data - use the local backend for that. -Jottacloud exhibits some inconsistent behaviours regarding deleted files and folders which may cause Copy, Move and DirMove -operations to previously deleted paths to fail. Emptying the trash should help in such cases. +The memory backend behaves like a bucket-based remote (e.g. like +s3). Because it has no parameters you can just use it with the +\[ga]:memory:\[ga] remote name. -# Koofr +## Configuration -Paths are specified as \[ga]remote:path\[ga] +You can configure it as a remote like this with \[ga]rclone config\[ga] too if +you want to: +\f[R] +.fi +.PP +No remotes found, make a new one? +n) New remote s) Set configuration password q) Quit config n/s/q> n +name> remote Type of storage to configure. +Enter a string value. +Press Enter for the default (\[dq]\[dq]). +Choose a number from below, or type in your own value [snip] XX / Memory +\ \[dq]memory\[dq] [snip] Storage> memory ** See help for memory backend +at: https://rclone.org/memory/ ** +.PP +Remote config +.PP +.TS +tab(@); +l. +T{ +[remote] +T} +T{ +type = memory +T} +.TE +.IP "y)" 3 +Yes this is OK (default) +.IP "z)" 3 +Edit this remote +.IP "a)" 3 +Delete this remote y/e/d> y +.IP +.nf +\f[C] +Because the memory backend isn\[aq]t persistent it is most useful for +testing or with an rclone server or rclone mount, e.g. -Paths may be as deep as required, e.g. \[ga]remote:directory/subdirectory\[ga]. + rclone mount :memory: /mnt/tmp + rclone serve webdav :memory: + rclone serve sftp :memory: -## Configuration +### Modification times and hashes -The initial setup for Koofr involves creating an application password for -rclone. You can do that by opening the Koofr -[web application](https://app.koofr.net/app/admin/preferences/password), -giving the password a nice name like \[ga]rclone\[ga] and clicking on generate. +The memory backend supports MD5 hashes and modification times accurate to 1 nS. -Here is an example of how to make a remote called \[ga]koofr\[ga]. First run: +### Restricted filename characters - rclone config +The memory backend replaces the [default restricted characters +set](https://rclone.org/overview/#restricted-characters). -This will guide you through an interactive setup process: + + + +# Akamai NetStorage + +Paths are specified as \[ga]remote:\[ga] +You may put subdirectories in too, e.g. \[ga]remote:/path/to/dir\[ga]. +If you have a CP code you can use that as the folder after the domain such as \[rs]\[rs]/\[rs]\[rs]/\[rs]. + +For example, this is commonly configured with or without a CP code: +* **With a CP code**. \[ga][your-domain-prefix]-nsu.akamaihd.net/123456/subdirectory/\[ga] +* **Without a CP code**. \[ga][your-domain-prefix]-nsu.akamaihd.net\[ga] + + +See all buckets + rclone lsd remote: +The initial setup for Netstorage involves getting an account and secret. Use \[ga]rclone config\[ga] to walk you through the setup process. + +## Configuration + +Here\[aq]s an example of how to make a remote called \[ga]ns1\[ga]. + +1. To begin the interactive configuration process, enter this command: +\f[R] +.fi +.PP +rclone config +.IP +.nf +\f[C] +2. Type \[ga]n\[ga] to create a new remote. +\f[R] +.fi +.IP "n)" 3 +New remote +.IP "o)" 3 +Delete remote +.IP "p)" 3 +Quit config e/n/d/q> n +.IP +.nf +\f[C] +3. For this example, enter \[ga]ns1\[ga] when you reach the name> prompt. +\f[R] +.fi +.PP +name> ns1 +.IP +.nf +\f[C] +4. Enter \[ga]netstorage\[ga] as the type of storage to configure. \f[R] .fi .PP -No remotes found, make a new one? -n) New remote s) Set configuration password q) Quit config n/s/q> n -name> koofr Option Storage. Type of storage to configure. -Choose a number from below, or type in your own value. -[snip] 22 / Koofr, Digi Storage and other Koofr-compatible storage -providers \ (koofr) [snip] Storage> koofr Option provider. -Choose your storage provider. -Choose a number from below, or type in your own value. -Press Enter to leave empty. -1 / Koofr, https://app.koofr.net/ \ (koofr) 2 / Digi Storage, -https://storage.rcs-rds.ro/ \ (digistorage) 3 / Any other Koofr API -compatible storage service \ (other) provider> 1 -.PD 0 -.P -.PD -Option user. -Your user name. -Enter a value. -user> USERNAME Option password. -Your password for rclone (generate one at -https://app.koofr.net/app/admin/preferences/password). -Choose an alternative below. -y) Yes, type in my own password g) Generate random password y/g> y Enter -the password: password: Confirm the password: password: Edit advanced -config? -y) Yes n) No (default) y/n> n Remote config -------------------- [koofr] -type = koofr provider = koofr user = USERNAME password = *** ENCRYPTED -*** -------------------- y) Yes this is OK (default) e) Edit this remote -d) Delete this remote y/e/d> y +Enter a string value. +Press Enter for the default (\[dq]\[dq]). +Choose a number from below, or type in your own value XX / NetStorage +\ \[dq]netstorage\[dq] Storage> netstorage .IP .nf \f[C] -You can choose to edit advanced config in order to enter your own service URL -if you use an on-premise or white label Koofr instance, or choose an alternative -mount instead of your primary storage. +5. Select between the HTTP or HTTPS protocol. Most users should choose HTTPS, which is the default. HTTP is provided primarily for debugging purposes. -Once configured you can then use \[ga]rclone\[ga] like this, +\f[R] +.fi +.PP +Enter a string value. +Press Enter for the default (\[dq]\[dq]). +Choose a number from below, or type in your own value 1 / HTTP protocol +\ \[dq]http\[dq] 2 / HTTPS protocol \ \[dq]https\[dq] protocol> 1 +.IP +.nf +\f[C] +6. Specify your NetStorage host, CP code, and any necessary content paths using this format: \[ga]///\[ga] +\f[R] +.fi +.PP +Enter a string value. +Press Enter for the default (\[dq]\[dq]). +host> baseball-nsu.akamaihd.net/123456/content/ +.IP +.nf +\f[C] +7. Set the netstorage account name +\f[R] +.fi +.PP +Enter a string value. +Press Enter for the default (\[dq]\[dq]). +account> username +.IP +.nf +\f[C] +8. Set the Netstorage account secret/G2O key which will be used for authentication purposes. Select the \[ga]y\[ga] option to set your own password then enter your secret. +Note: The secret is stored in the \[ga]rclone.conf\[ga] file with hex-encoded encryption. +\f[R] +.fi +.IP "y)" 3 +Yes type in my own password +.IP "z)" 3 +Generate random password y/g> y Enter the password: password: Confirm +the password: password: +.IP +.nf +\f[C] +9. View the summary and confirm your remote configuration. +\f[R] +.fi +.PP +[ns1] type = netstorage protocol = http host = +baseball-nsu.akamaihd.net/123456/content/ account = username secret = +*** ENCRYPTED *** -------------------- y) Yes this is OK (default) e) +Edit this remote d) Delete this remote y/e/d> y +.IP +.nf +\f[C] +This remote is called \[ga]ns1\[ga] and can now be used. -List directories in top level of your Koofr +## Example operations - rclone lsd koofr: +Get started with rclone and NetStorage with these examples. For additional rclone commands, visit https://rclone.org/commands/. -List all the files in your Koofr +### See contents of a directory in your project - rclone ls koofr: + rclone lsd ns1:/974012/testing/ -To copy a local directory to an Koofr directory called backup +### Sync the contents local with remote - rclone copy /home/source koofr:backup + rclone sync . ns1:/974012/testing/ -### Restricted filename characters +### Upload local content to remote + rclone copy notes.txt ns1:/974012/testing/ -In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) -the following characters are also replaced: +### Delete content on remote + rclone delete ns1:/974012/testing/notes.txt -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| \[rs] | 0x5C | \[uFF3C] | +### Move or copy content between CP codes. -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can\[aq]t be used in XML strings. +Your credentials must have access to two CP codes on the same remote. You can\[aq]t perform operations between different remotes. + rclone move ns1:/974012/testing/notes.txt ns1:/974450/testing2/ -### Standard options +## Features -Here are the Standard options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers). +### Symlink Support -#### --koofr-provider +The Netstorage backend changes the rclone \[ga]--links, -l\[ga] behavior. When uploading, instead of creating the .rclonelink file, use the \[dq]symlink\[dq] API in order to create the corresponding symlink on the remote. The .rclonelink file will not be created, the upload will be intercepted and only the symlink file that matches the source file name with no suffix will be created on the remote. -Choose your storage provider. +This will effectively allow commands like copy/copyto, move/moveto and sync to upload from local to remote and download from remote to local directories with symlinks. Due to internal rclone limitations, it is not possible to upload an individual symlink file to any remote backend. You can always use the \[dq]backend symlink\[dq] command to create a symlink on the NetStorage server, refer to \[dq]symlink\[dq] section below. -Properties: +Individual symlink files on the remote can be used with the commands like \[dq]cat\[dq] to print the destination name, or \[dq]delete\[dq] to delete symlink, or copy, copy/to and move/moveto to download from the remote to local. Note: individual symlink files on the remote should be specified including the suffix .rclonelink. -- Config: provider -- Env Var: RCLONE_KOOFR_PROVIDER -- Type: string -- Required: false -- Examples: - - \[dq]koofr\[dq] - - Koofr, https://app.koofr.net/ - - \[dq]digistorage\[dq] - - Digi Storage, https://storage.rcs-rds.ro/ - - \[dq]other\[dq] - - Any other Koofr API compatible storage service +**Note**: No file with the suffix .rclonelink should ever exist on the server since it is not possible to actually upload/create a file with .rclonelink suffix with rclone, it can only exist if it is manually created through a non-rclone method on the remote. + +### Implicit vs. Explicit Directories + +With NetStorage, directories can exist in one of two forms: + +1. **Explicit Directory**. This is an actual, physical directory that you have created in a storage group. +2. **Implicit Directory**. This refers to a directory within a path that has not been physically created. For example, during upload of a file, nonexistent subdirectories can be specified in the target path. NetStorage creates these as \[dq]implicit.\[dq] While the directories aren\[aq]t physically created, they exist implicitly and the noted path is connected with the uploaded file. + +Rclone will intercept all file uploads and mkdir commands for the NetStorage remote and will explicitly issue the mkdir command for each directory in the uploading path. This will help with the interoperability with the other Akamai services such as SFTP and the Content Management Shell (CMShell). Rclone will not guarantee correctness of operations with implicit directories which might have been created as a result of using an upload API directly. + +### \[ga]--fast-list\[ga] / ListR support + +NetStorage remote supports the ListR feature by using the \[dq]list\[dq] NetStorage API action to return a lexicographical list of all objects within the specified CP code, recursing into subdirectories as they\[aq]re encountered. + +* **Rclone will use the ListR method for some commands by default**. Commands such as \[ga]lsf -R\[ga] will use ListR by default. To disable this, include the \[ga]--disable listR\[ga] option to use the non-recursive method of listing objects. + +* **Rclone will not use the ListR method for some commands**. Commands such as \[ga]sync\[ga] don\[aq]t use ListR by default. To force using the ListR method, include the \[ga]--fast-list\[ga] option. -#### --koofr-endpoint +There are pros and cons of using the ListR method, refer to [rclone documentation](https://rclone.org/docs/#fast-list). In general, the sync command over an existing deep tree on the remote will run faster with the \[dq]--fast-list\[dq] flag but with extra memory usage as a side effect. It might also result in higher CPU utilization but the whole task can be completed faster. -The Koofr API endpoint to use. +**Note**: There is a known limitation that \[dq]lsf -R\[dq] will display number of files in the directory and directory size as -1 when ListR method is used. The workaround is to pass \[dq]--disable listR\[dq] flag if these numbers are important in the output. -Properties: +### Purge -- Config: endpoint -- Env Var: RCLONE_KOOFR_ENDPOINT -- Provider: other -- Type: string -- Required: true +NetStorage remote supports the purge feature by using the \[dq]quick-delete\[dq] NetStorage API action. The quick-delete action is disabled by default for security reasons and can be enabled for the account through the Akamai portal. Rclone will first try to use quick-delete action for the purge command and if this functionality is disabled then will fall back to a standard delete method. -#### --koofr-user +**Note**: Read the [NetStorage Usage API](https://learn.akamai.com/en-us/webhelp/netstorage/netstorage-http-api-developer-guide/GUID-15836617-9F50-405A-833C-EA2556756A30.html) for considerations when using \[dq]quick-delete\[dq]. In general, using quick-delete method will not delete the tree immediately and objects targeted for quick-delete may still be accessible. -Your user name. -Properties: +### Standard options -- Config: user -- Env Var: RCLONE_KOOFR_USER -- Type: string -- Required: true +Here are the Standard options specific to netstorage (Akamai NetStorage). -#### --koofr-password +#### --netstorage-host -Your password for rclone (generate one at https://app.koofr.net/app/admin/preferences/password). +Domain+path of NetStorage host to connect to. -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +Format should be \[ga]/\[ga] Properties: -- Config: password -- Env Var: RCLONE_KOOFR_PASSWORD -- Provider: koofr +- Config: host +- Env Var: RCLONE_NETSTORAGE_HOST - Type: string - Required: true -#### --koofr-password - -Your password for rclone (generate one at https://storage.rcs-rds.ro/app/admin/preferences/password). +#### --netstorage-account -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +Set the NetStorage account name Properties: -- Config: password -- Env Var: RCLONE_KOOFR_PASSWORD -- Provider: digistorage +- Config: account +- Env Var: RCLONE_NETSTORAGE_ACCOUNT - Type: string - Required: true -#### --koofr-password +#### --netstorage-secret + +Set the NetStorage account secret/G2O key for authentication. -Your password for rclone (generate one at your service\[aq]s settings page). +Please choose the \[aq]y\[aq] option to set your own password then enter your secret. **NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: -- Config: password -- Env Var: RCLONE_KOOFR_PASSWORD -- Provider: other +- Config: secret +- Env Var: RCLONE_NETSTORAGE_SECRET - Type: string - Required: true ### Advanced options -Here are the Advanced options specific to koofr (Koofr, Digi Storage and other Koofr-compatible storage providers). +Here are the Advanced options specific to netstorage (Akamai NetStorage). -#### --koofr-mountid +#### --netstorage-protocol -Mount ID of the mount to use. +Select between HTTP or HTTPS protocol. -If omitted, the primary mount is used. +Most users should choose HTTPS, which is the default. +HTTP is provided primarily for debugging purposes. Properties: -- Config: mountid -- Env Var: RCLONE_KOOFR_MOUNTID +- Config: protocol +- Env Var: RCLONE_NETSTORAGE_PROTOCOL - Type: string -- Required: false - -#### --koofr-setmtime - -Does the backend support setting modification time. - -Set this to false if you use a mount ID that points to a Dropbox or Amazon Drive backend. - -Properties: - -- Config: setmtime -- Env Var: RCLONE_KOOFR_SETMTIME -- Type: bool -- Default: true - -#### --koofr-encoding - -The encoding for the backend. - -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. - -Properties: - -- Config: encoding -- Env Var: RCLONE_KOOFR_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot +- Default: \[dq]https\[dq] +- Examples: + - \[dq]http\[dq] + - HTTP protocol + - \[dq]https\[dq] + - HTTPS protocol +## Backend commands +Here are the commands specific to the netstorage backend. -## Limitations +Run them with -Note that Koofr is case insensitive so you can\[aq]t have a file called -\[dq]Hello.doc\[dq] and one called \[dq]hello.doc\[dq]. + rclone backend COMMAND remote: -## Providers +The help below will explain what arguments each command takes. -### Koofr +See the [backend](https://rclone.org/commands/rclone_backend/) command for more +info on how to pass options and arguments. -This is the original [Koofr](https://koofr.eu) storage provider used as main example and described in the [configuration](#configuration) section above. +These can be run on a running backend using the rc command +[backend/command](https://rclone.org/rc/#backend-command). -### Digi Storage +### du -[Digi Storage](https://www.digi.ro/servicii/online/digi-storage) is a cloud storage service run by [Digi.ro](https://www.digi.ro/) that -provides a Koofr API. +Return disk usage information for a specified directory -Here is an example of how to make a remote called \[ga]ds\[ga]. First run: + rclone backend du remote: [options] [+] - rclone config +The usage information returned, includes the targeted directory as well as all +files stored in any sub-directories that may exist. -This will guide you through an interactive setup process: -\f[R] -.fi -.PP -No remotes found, make a new one? -n) New remote s) Set configuration password q) Quit config n/s/q> n -name> ds Option Storage. -Type of storage to configure. -Choose a number from below, or type in your own value. -[snip] 22 / Koofr, Digi Storage and other Koofr-compatible storage -providers \ (koofr) [snip] Storage> koofr Option provider. -Choose your storage provider. -Choose a number from below, or type in your own value. -Press Enter to leave empty. -1 / Koofr, https://app.koofr.net/ \ (koofr) 2 / Digi Storage, -https://storage.rcs-rds.ro/ \ (digistorage) 3 / Any other Koofr API -compatible storage service \ (other) provider> 2 Option user. -Your user name. -Enter a value. -user> USERNAME Option password. -Your password for rclone (generate one at -https://storage.rcs-rds.ro/app/admin/preferences/password). -Choose an alternative below. -y) Yes, type in my own password g) Generate random password y/g> y Enter -the password: password: Confirm the password: password: Edit advanced -config? -y) Yes n) No (default) y/n> n -------------------- [ds] type = koofr -provider = digistorage user = USERNAME password = *** ENCRYPTED *** --------------------- y) Yes this is OK (default) e) Edit this remote d) -Delete this remote y/e/d> y -.IP -.nf -\f[C] -### Other +### symlink -You may also want to use another, public or private storage provider that runs a Koofr API compatible service, by simply providing the base URL to connect to. +You can create a symbolic link in ObjectStore with the symlink action. -Here is an example of how to make a remote called \[ga]other\[ga]. First run: + rclone backend symlink remote: [options] [+] - rclone config +The desired path location (including applicable sub-directories) ending in +the object that will be the target of the symlink (for example, /links/mylink). +Include the file extension for the object, if applicable. +\[ga]rclone backend symlink \[ga] -This will guide you through an interactive setup process: -\f[R] -.fi -.PP -No remotes found, make a new one? -n) New remote s) Set configuration password q) Quit config n/s/q> n -name> other Option Storage. -Type of storage to configure. -Choose a number from below, or type in your own value. -[snip] 22 / Koofr, Digi Storage and other Koofr-compatible storage -providers \ (koofr) [snip] Storage> koofr Option provider. -Choose your storage provider. -Choose a number from below, or type in your own value. -Press Enter to leave empty. -1 / Koofr, https://app.koofr.net/ \ (koofr) 2 / Digi Storage, -https://storage.rcs-rds.ro/ \ (digistorage) 3 / Any other Koofr API -compatible storage service \ (other) provider> 3 Option endpoint. -The Koofr API endpoint to use. -Enter a value. -endpoint> https://koofr.other.org Option user. -Your user name. -Enter a value. -user> USERNAME Option password. -Your password for rclone (generate one at your service\[aq]s settings -page). -Choose an alternative below. -y) Yes, type in my own password g) Generate random password y/g> y Enter -the password: password: Confirm the password: password: Edit advanced -config? -y) Yes n) No (default) y/n> n -------------------- [other] type = koofr -provider = other endpoint = https://koofr.other.org user = USERNAME -password = *** ENCRYPTED *** -------------------- y) Yes this is OK -(default) e) Edit this remote d) Delete this remote y/e/d> y -.IP -.nf -\f[C] -# Mail.ru Cloud -[Mail.ru Cloud](https://cloud.mail.ru/) is a cloud storage provided by a Russian internet company [Mail.Ru Group](https://mail.ru). The official desktop client is [Disk-O:](https://disk-o.cloud/en), available on Windows and Mac OS. -## Features highlights +# Microsoft Azure Blob Storage -- Paths may be as deep as required, e.g. \[ga]remote:directory/subdirectory\[ga] -- Files have a \[ga]last modified time\[ga] property, directories don\[aq]t -- Deleted files are by default moved to the trash -- Files and directories can be shared via public links -- Partial uploads or streaming are not supported, file size must be known before upload -- Maximum file size is limited to 2G for a free account, unlimited for paid accounts -- Storage keeps hash for all files and performs transparent deduplication, - the hash algorithm is a modified SHA1 -- If a particular file is already present in storage, one can quickly submit file hash - instead of long file upload (this optimization is supported by rclone) +Paths are specified as \[ga]remote:container\[ga] (or \[ga]remote:\[ga] for the \[ga]lsd\[ga] +command.) You may put subdirectories in too, e.g. +\[ga]remote:container/path/to/dir\[ga]. ## Configuration -Here is an example of making a mailru configuration. - -First create a Mail.ru Cloud account and choose a tariff. - -You will need to log in and create an app password for rclone. Rclone -**will not work** with your normal username and password - it will -give an error like \[ga]oauth2: server response missing access_token\[ga]. - -- Click on your user icon in the top right -- Go to Security / \[dq]\[u041F]\[u0430]\[u0440]\[u043E]\[u043B]\[u044C] \[u0438] \[u0431]\[u0435]\[u0437]\[u043E]\[u043F]\[u0430]\[u0441]\[u043D]\[u043E]\[u0441]\[u0442]\[u044C]\[dq] -- Click password for apps / \[dq]\[u041F]\[u0430]\[u0440]\[u043E]\[u043B]\[u0438] \[u0434]\[u043B]\[u044F] \[u0432]\[u043D]\[u0435]\[u0448]\[u043D]\[u0438]\[u0445] \[u043F]\[u0440]\[u0438]\[u043B]\[u043E]\[u0436]\[u0435]\[u043D]\[u0438]\[u0439]\[dq] -- Add the password - give it a name - eg \[dq]rclone\[dq] -- Copy the password and use this password below - your normal login password won\[aq]t work. - -Now run +Here is an example of making a Microsoft Azure Blob Storage +configuration. For a remote called \[ga]remote\[ga]. First run: - rclone config + rclone config This will guide you through an interactive setup process: \f[R] @@ -46286,83 +46756,63 @@ This will guide you through an interactive setup process: No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. -Type of storage to configure. -Enter a string value. -Press Enter for the default (\[dq]\[dq]). Choose a number from below, or type in your own value [snip] XX / -Mail.ru Cloud \ \[dq]mailru\[dq] [snip] Storage> mailru User name -(usually email) Enter a string value. -Press Enter for the default (\[dq]\[dq]). -user> username\[at]mail.ru Password -.PP -This must be an app password - rclone will not work with your normal -password. -See the Configuration section in the docs for how to make an app -password. -y) Yes type in my own password g) Generate random password y/g> y Enter -the password: password: Confirm the password: password: Skip full upload -if there is another file with same data hash. -This feature is called \[dq]speedup\[dq] or \[dq]put by hash\[dq]. -It is especially efficient in case of generally available files like -popular books, video or audio clips [snip] Enter a boolean value (true -or false). -Press Enter for the default (\[dq]true\[dq]). -Choose a number from below, or type in your own value 1 / Enable -\ \[dq]true\[dq] 2 / Disable \ \[dq]false\[dq] speedup_enable> 1 Edit -advanced config? -(y/n) y) Yes n) No y/n> n Remote config -------------------- [remote] -type = mailru user = username\[at]mail.ru pass = *** ENCRYPTED *** -speedup_enable = true -------------------- y) Yes this is OK e) Edit -this remote d) Delete this remote y/e/d> y +Microsoft Azure Blob Storage \ \[dq]azureblob\[dq] [snip] Storage> +azureblob Storage Account Name account> account_name Storage Account Key +key> base64encodedkey== Endpoint for the service - leave blank normally. +endpoint> Remote config -------------------- [remote] account = +account_name key = base64encodedkey== endpoint = -------------------- y) +Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y .IP .nf \f[C] -Configuration of this backend does not require a local web browser. -You can use the configured backend as shown below: - -See top level directories +See all containers rclone lsd remote: -Make a new directory +Make a new container - rclone mkdir remote:directory + rclone mkdir remote:container -List the contents of a directory +List the contents of a container - rclone ls remote:directory + rclone ls remote:container -Sync \[ga]/home/local/directory\[ga] to the remote path, deleting any -excess files in the path. +Sync \[ga]/home/local/directory\[ga] to the remote container, deleting any excess +files in the container. - rclone sync --interactive /home/local/directory remote:directory + rclone sync --interactive /home/local/directory remote:container -### Modified time +### --fast-list -Files support a modification time attribute with up to 1 second precision. -Directories do not have a modification time, which is shown as \[dq]Jan 1 1970\[dq]. +This remote supports \[ga]--fast-list\[ga] which allows you to use fewer +transactions in exchange for more memory. See the [rclone +docs](https://rclone.org/docs/#fast-list) for more details. -### Hash checksums +### Modification times and hashes -Hash sums use a custom Mail.ru algorithm based on SHA1. -If file size is less than or equal to the SHA1 block size (20 bytes), -its hash is simply its data right-padded with zero bytes. -Hash sum of a larger file is computed as a SHA1 sum of the file data -bytes concatenated with a decimal representation of the data length. +The modification time is stored as metadata on the object with the +\[ga]mtime\[ga] key. It is stored using RFC3339 Format time with nanosecond +precision. The metadata is supplied during directory listings so +there is no performance overhead to using it. -### Emptying Trash +If you wish to use the Azure standard \[ga]LastModified\[ga] time stored on +the object as the modified time, then use the \[ga]--use-server-modtime\[ga] +flag. Note that rclone can\[aq]t set \[ga]LastModified\[ga], so using the +\[ga]--update\[ga] flag when syncing is recommended if using +\[ga]--use-server-modtime\[ga]. -Removing a file or directory actually moves it to the trash, which is not -visible to rclone but can be seen in a web browser. The trashed file -still occupies part of total quota. If you wish to empty your trash -and free some quota, you can use the \[ga]rclone cleanup remote:\[ga] command, -which will permanently delete all your trashed files. -This command does not take any path arguments. +MD5 hashes are stored with blobs. However blobs that were uploaded in +chunks only have an MD5 if the source remote was capable of MD5 +hashes, e.g. the local disk. -### Quota information +### Performance -To view your current quota you can use the \[ga]rclone about remote:\[ga] -command which will display your usage limit (quota) and the current usage. +When uploading large files, increasing the value of +\[ga]--azureblob-upload-concurrency\[ga] will increase performance at the cost +of using more memory. The default of 16 is set quite conservatively to +use less memory. It maybe be necessary raise it to 64 or higher to +fully utilize a 1 GBit/s link with a single file transfer. ### Restricted filename characters @@ -46371,905 +46821,781 @@ the following characters are also replaced: | Character | Value | Replacement | | --------- |:-----:|:-----------:| -| \[dq] | 0x22 | \[uFF02] | -| * | 0x2A | \[uFF0A] | -| : | 0x3A | \[uFF1A] | -| < | 0x3C | \[uFF1C] | -| > | 0x3E | \[uFF1E] | -| ? | 0x3F | \[uFF1F] | -| \[rs] | 0x5C | \[uFF3C] | -| \[rs]| | 0x7C | \[uFF5C] | +| / | 0x2F | \[uFF0F] | +| \[rs] | 0x5C | \[uFF3C] | + +File names can also not end with the following characters. +These only get replaced if they are the last character in the name: + +| Character | Value | Replacement | +| --------- |:-----:|:-----------:| +| . | 0x2E | \[uFF0E] | Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), as they can\[aq]t be used in JSON strings. +### Authentication {#authentication} -### Standard options +There are a number of ways of supplying credentials for Azure Blob +Storage. Rclone tries them in the order of the sections below. -Here are the Standard options specific to mailru (Mail.ru Cloud). +#### Env Auth -#### --mailru-client-id +If the \[ga]env_auth\[ga] config parameter is \[ga]true\[ga] then rclone will pull +credentials from the environment or runtime. -OAuth Client Id. +It tries these authentication methods in this order: -Leave blank normally. +1. Environment Variables +2. Managed Service Identity Credentials +3. Azure CLI credentials (as used by the az tool) -Properties: +These are described in the following sections -- Config: client_id -- Env Var: RCLONE_MAILRU_CLIENT_ID -- Type: string -- Required: false +##### Env Auth: 1. Environment Variables -#### --mailru-client-secret +If \[ga]env_auth\[ga] is set and environment variables are present rclone +authenticates a service principal with a secret or certificate, or a +user with a password, depending on which environment variable are set. +It reads configuration from these variables, in the following order: -OAuth Client Secret. +1. Service principal with client secret + - \[ga]AZURE_TENANT_ID\[ga]: ID of the service principal\[aq]s tenant. Also called its \[dq]directory\[dq] ID. + - \[ga]AZURE_CLIENT_ID\[ga]: the service principal\[aq]s client ID + - \[ga]AZURE_CLIENT_SECRET\[ga]: one of the service principal\[aq]s client secrets +2. Service principal with certificate + - \[ga]AZURE_TENANT_ID\[ga]: ID of the service principal\[aq]s tenant. Also called its \[dq]directory\[dq] ID. + - \[ga]AZURE_CLIENT_ID\[ga]: the service principal\[aq]s client ID + - \[ga]AZURE_CLIENT_CERTIFICATE_PATH\[ga]: path to a PEM or PKCS12 certificate file including the private key. + - \[ga]AZURE_CLIENT_CERTIFICATE_PASSWORD\[ga]: (optional) password for the certificate file. + - \[ga]AZURE_CLIENT_SEND_CERTIFICATE_CHAIN\[ga]: (optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to \[dq]true\[dq] or \[dq]1\[dq], authentication requests include the x5c header. +3. User with username and password + - \[ga]AZURE_TENANT_ID\[ga]: (optional) tenant to authenticate in. Defaults to \[dq]organizations\[dq]. + - \[ga]AZURE_CLIENT_ID\[ga]: client ID of the application the user will authenticate to + - \[ga]AZURE_USERNAME\[ga]: a username (usually an email address) + - \[ga]AZURE_PASSWORD\[ga]: the user\[aq]s password +4. Workload Identity + - \[ga]AZURE_TENANT_ID\[ga]: Tenant to authenticate in. + - \[ga]AZURE_CLIENT_ID\[ga]: Client ID of the application the user will authenticate to. + - \[ga]AZURE_FEDERATED_TOKEN_FILE\[ga]: Path to projected service account token file. + - \[ga]AZURE_AUTHORITY_HOST\[ga]: Authority of an Azure Active Directory endpoint (default: login.microsoftonline.com). -Leave blank normally. -Properties: +##### Env Auth: 2. Managed Service Identity Credentials -- Config: client_secret -- Env Var: RCLONE_MAILRU_CLIENT_SECRET -- Type: string -- Required: false +When using Managed Service Identity if the VM(SS) on which this +program is running has a system-assigned identity, it will be used by +default. If the resource has no system-assigned but exactly one +user-assigned identity, the user-assigned identity will be used by +default. -#### --mailru-user +If the resource has multiple user-assigned identities you will need to +unset \[ga]env_auth\[ga] and set \[ga]use_msi\[ga] instead. See the [\[ga]use_msi\[ga] +section](#use_msi). -User name (usually email). +##### Env Auth: 3. Azure CLI credentials (as used by the az tool) -Properties: +Credentials created with the \[ga]az\[ga] tool can be picked up using \[ga]env_auth\[ga]. -- Config: user -- Env Var: RCLONE_MAILRU_USER -- Type: string -- Required: true +For example if you were to login with a service principal like this: -#### --mailru-pass + az login --service-principal -u XXX -p XXX --tenant XXX -Password. +Then you could access rclone resources like this: -This must be an app password - rclone will not work with your normal -password. See the Configuration section in the docs for how to make an -app password. + rclone lsf :azureblob,env_auth,account=ACCOUNT:CONTAINER +Or -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). + rclone lsf --azureblob-env-auth --azureblob-account=ACCOUNT :azureblob:CONTAINER -Properties: +Which is analogous to using the \[ga]az\[ga] tool: -- Config: pass -- Env Var: RCLONE_MAILRU_PASS -- Type: string -- Required: true + az storage blob list --container-name CONTAINER --account-name ACCOUNT --auth-mode login -#### --mailru-speedup-enable +#### Account and Shared Key -Skip full upload if there is another file with same data hash. +This is the most straight forward and least flexible way. Just fill +in the \[ga]account\[ga] and \[ga]key\[ga] lines and leave the rest blank. -This feature is called \[dq]speedup\[dq] or \[dq]put by hash\[dq]. It is especially efficient -in case of generally available files like popular books, video or audio clips, -because files are searched by hash in all accounts of all mailru users. -It is meaningless and ineffective if source file is unique or encrypted. -Please note that rclone may need local memory and disk space to calculate -content hash in advance and decide whether full upload is required. -Also, if rclone does not know file size in advance (e.g. in case of -streaming or partial uploads), it will not even try this optimization. +#### SAS URL -Properties: +This can be an account level SAS URL or container level SAS URL. -- Config: speedup_enable -- Env Var: RCLONE_MAILRU_SPEEDUP_ENABLE -- Type: bool -- Default: true -- Examples: - - \[dq]true\[dq] - - Enable - - \[dq]false\[dq] - - Disable +To use it leave \[ga]account\[ga] and \[ga]key\[ga] blank and fill in \[ga]sas_url\[ga]. -### Advanced options +An account level SAS URL or container level SAS URL can be obtained +from the Azure portal or the Azure Storage Explorer. To get a +container level SAS URL right click on a container in the Azure Blob +explorer in the Azure portal. -Here are the Advanced options specific to mailru (Mail.ru Cloud). +If you use a container level SAS URL, rclone operations are permitted +only on a particular container, e.g. -#### --mailru-token + rclone ls azureblob:container -OAuth Access Token as a JSON blob. +You can also list the single container from the root. This will only +show the container specified by the SAS URL. -Properties: + $ rclone lsd azureblob: + container/ -- Config: token -- Env Var: RCLONE_MAILRU_TOKEN -- Type: string -- Required: false +Note that you can\[aq]t see or access any other containers - this will +fail -#### --mailru-auth-url + rclone ls azureblob:othercontainer -Auth server URL. +Container level SAS URLs are useful for temporarily allowing third +parties access to a single container or putting credentials into an +untrusted environment such as a CI build server. -Leave blank to use the provider defaults. +#### Service principal with client secret -Properties: +If these variables are set, rclone will authenticate with a service principal with a client secret. -- Config: auth_url -- Env Var: RCLONE_MAILRU_AUTH_URL -- Type: string -- Required: false +- \[ga]tenant\[ga]: ID of the service principal\[aq]s tenant. Also called its \[dq]directory\[dq] ID. +- \[ga]client_id\[ga]: the service principal\[aq]s client ID +- \[ga]client_secret\[ga]: one of the service principal\[aq]s client secrets + +The credentials can also be placed in a file using the +\[ga]service_principal_file\[ga] configuration option. + +#### Service principal with certificate + +If these variables are set, rclone will authenticate with a service principal with certificate. + +- \[ga]tenant\[ga]: ID of the service principal\[aq]s tenant. Also called its \[dq]directory\[dq] ID. +- \[ga]client_id\[ga]: the service principal\[aq]s client ID +- \[ga]client_certificate_path\[ga]: path to a PEM or PKCS12 certificate file including the private key. +- \[ga]client_certificate_password\[ga]: (optional) password for the certificate file. +- \[ga]client_send_certificate_chain\[ga]: (optional) Specifies whether an authentication request will include an x5c header to support subject name / issuer based authentication. When set to \[dq]true\[dq] or \[dq]1\[dq], authentication requests include the x5c header. -#### --mailru-token-url +**NB** \[ga]client_certificate_password\[ga] must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -Token server url. +#### User with username and password -Leave blank to use the provider defaults. +If these variables are set, rclone will authenticate with username and password. -Properties: +- \[ga]tenant\[ga]: (optional) tenant to authenticate in. Defaults to \[dq]organizations\[dq]. +- \[ga]client_id\[ga]: client ID of the application the user will authenticate to +- \[ga]username\[ga]: a username (usually an email address) +- \[ga]password\[ga]: the user\[aq]s password -- Config: token_url -- Env Var: RCLONE_MAILRU_TOKEN_URL -- Type: string -- Required: false +Microsoft doesn\[aq]t recommend this kind of authentication, because it\[aq]s +less secure than other authentication flows. This method is not +interactive, so it isn\[aq]t compatible with any form of multi-factor +authentication, and the application must already have user or admin +consent. This credential can only authenticate work and school +accounts; it can\[aq]t authenticate Microsoft accounts. -#### --mailru-speedup-file-patterns +**NB** \[ga]password\[ga] must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -Comma separated list of file name patterns eligible for speedup (put by hash). +#### Managed Service Identity Credentials {#use_msi} -Patterns are case insensitive and can contain \[aq]*\[aq] or \[aq]?\[aq] meta characters. +If \[ga]use_msi\[ga] is set then managed service identity credentials are +used. This authentication only works when running in an Azure service. +\[ga]env_auth\[ga] needs to be unset to use this. -Properties: +However if you have multiple user identities to choose from these must +be explicitly specified using exactly one of the \[ga]msi_object_id\[ga], +\[ga]msi_client_id\[ga], or \[ga]msi_mi_res_id\[ga] parameters. -- Config: speedup_file_patterns -- Env Var: RCLONE_MAILRU_SPEEDUP_FILE_PATTERNS -- Type: string -- Default: \[dq]*.mkv,*.avi,*.mp4,*.mp3,*.zip,*.gz,*.rar,*.pdf\[dq] -- Examples: - - \[dq]\[dq] - - Empty list completely disables speedup (put by hash). - - \[dq]*\[dq] - - All files will be attempted for speedup. - - \[dq]*.mkv,*.avi,*.mp4,*.mp3\[dq] - - Only common audio/video files will be tried for put by hash. - - \[dq]*.zip,*.gz,*.rar,*.pdf\[dq] - - Only common archives or PDF books will be tried for speedup. +If none of \[ga]msi_object_id\[ga], \[ga]msi_client_id\[ga], or \[ga]msi_mi_res_id\[ga] is +set, this is is equivalent to using \[ga]env_auth\[ga]. -#### --mailru-speedup-max-disk -This option allows you to disable speedup (put by hash) for large files. +### Standard options -Reason is that preliminary hashing can exhaust your RAM or disk space. +Here are the Standard options specific to azureblob (Microsoft Azure Blob Storage). -Properties: +#### --azureblob-account -- Config: speedup_max_disk -- Env Var: RCLONE_MAILRU_SPEEDUP_MAX_DISK -- Type: SizeSuffix -- Default: 3Gi -- Examples: - - \[dq]0\[dq] - - Completely disable speedup (put by hash). - - \[dq]1G\[dq] - - Files larger than 1Gb will be uploaded directly. - - \[dq]3G\[dq] - - Choose this option if you have less than 3Gb free on local disk. +Azure Storage Account Name. -#### --mailru-speedup-max-memory +Set this to the Azure Storage Account Name in use. + +Leave blank to use SAS URL or Emulator, otherwise it needs to be set. + +If this is blank and if env_auth is set it will be read from the +environment variable \[ga]AZURE_STORAGE_ACCOUNT_NAME\[ga] if possible. -Files larger than the size given below will always be hashed on disk. Properties: -- Config: speedup_max_memory -- Env Var: RCLONE_MAILRU_SPEEDUP_MAX_MEMORY -- Type: SizeSuffix -- Default: 32Mi -- Examples: - - \[dq]0\[dq] - - Preliminary hashing will always be done in a temporary disk location. - - \[dq]32M\[dq] - - Do not dedicate more than 32Mb RAM for preliminary hashing. - - \[dq]256M\[dq] - - You have at most 256Mb RAM free for hash calculations. +- Config: account +- Env Var: RCLONE_AZUREBLOB_ACCOUNT +- Type: string +- Required: false -#### --mailru-check-hash +#### --azureblob-env-auth -What should copy do if file checksum is mismatched or invalid. +Read credentials from runtime (environment variables, CLI or MSI). + +See the [authentication docs](/azureblob#authentication) for full info. Properties: -- Config: check_hash -- Env Var: RCLONE_MAILRU_CHECK_HASH +- Config: env_auth +- Env Var: RCLONE_AZUREBLOB_ENV_AUTH - Type: bool -- Default: true -- Examples: - - \[dq]true\[dq] - - Fail with error. - - \[dq]false\[dq] - - Ignore and continue. +- Default: false -#### --mailru-user-agent +#### --azureblob-key -HTTP user agent used internally by client. +Storage Account Shared Key. -Defaults to \[dq]rclone/VERSION\[dq] or \[dq]--user-agent\[dq] provided on command line. +Leave blank to use SAS URL or Emulator. Properties: -- Config: user_agent -- Env Var: RCLONE_MAILRU_USER_AGENT +- Config: key +- Env Var: RCLONE_AZUREBLOB_KEY - Type: string - Required: false -#### --mailru-quirks +#### --azureblob-sas-url -Comma separated list of internal maintenance flags. +SAS URL for container level access only. -This option must not be used by an ordinary user. It is intended only to -facilitate remote troubleshooting of backend issues. Strict meaning of -flags is not documented and not guaranteed to persist between releases. -Quirks will be removed when the backend grows stable. -Supported quirks: atomicmkdir binlist unknowndirs +Leave blank if using account/key or Emulator. Properties: -- Config: quirks -- Env Var: RCLONE_MAILRU_QUIRKS +- Config: sas_url +- Env Var: RCLONE_AZUREBLOB_SAS_URL - Type: string - Required: false -#### --mailru-encoding +#### --azureblob-tenant -The encoding for the backend. +ID of the service principal\[aq]s tenant. Also called its directory ID. -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Set this if using +- Service principal with client secret +- Service principal with certificate +- User with username and password -Properties: -- Config: encoding -- Env Var: RCLONE_MAILRU_ENCODING -- Type: MultiEncoder -- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,InvalidUtf8,Dot +Properties: +- Config: tenant +- Env Var: RCLONE_AZUREBLOB_TENANT +- Type: string +- Required: false +#### --azureblob-client-id -## Limitations +The ID of the client in use. -File size limits depend on your account. A single file size is limited by 2G -for a free account and unlimited for paid tariffs. Please refer to the Mail.ru -site for the total uploaded size limits. +Set this if using +- Service principal with client secret +- Service principal with certificate +- User with username and password -Note that Mailru is case insensitive so you can\[aq]t have a file called -\[dq]Hello.doc\[dq] and one called \[dq]hello.doc\[dq]. -# Mega +Properties: -[Mega](https://mega.nz/) is a cloud storage and file hosting service -known for its security feature where all files are encrypted locally -before they are uploaded. This prevents anyone (including employees of -Mega) from accessing the files without knowledge of the key used for -encryption. +- Config: client_id +- Env Var: RCLONE_AZUREBLOB_CLIENT_ID +- Type: string +- Required: false -This is an rclone backend for Mega which supports the file transfer -features of Mega using the same client side encryption. +#### --azureblob-client-secret -Paths are specified as \[ga]remote:path\[ga] +One of the service principal\[aq]s client secrets -Paths may be as deep as required, e.g. \[ga]remote:directory/subdirectory\[ga]. +Set this if using +- Service principal with client secret -## Configuration -Here is an example of how to make a remote called \[ga]remote\[ga]. First run: +Properties: - rclone config +- Config: client_secret +- Env Var: RCLONE_AZUREBLOB_CLIENT_SECRET +- Type: string +- Required: false -This will guide you through an interactive setup process: -\f[R] -.fi -.PP -No remotes found, make a new one? -n) New remote s) Set configuration password q) Quit config n/s/q> n -name> remote Type of storage to configure. -Choose a number from below, or type in your own value [snip] XX / Mega -\ \[dq]mega\[dq] [snip] Storage> mega User name user> -you\[at]example.com Password. -y) Yes type in my own password g) Generate random password n) No leave -this optional password blank y/g/n> y Enter the password: password: -Confirm the password: password: Remote config -------------------- -[remote] type = mega user = you\[at]example.com pass = *** ENCRYPTED *** --------------------- y) Yes this is OK e) Edit this remote d) Delete -this remote y/e/d> y -.IP -.nf -\f[C] -**NOTE:** The encryption keys need to have been already generated after a regular login -via the browser, otherwise attempting to use the credentials in \[ga]rclone\[ga] will fail. +#### --azureblob-client-certificate-path -Once configured you can then use \[ga]rclone\[ga] like this, +Path to a PEM or PKCS12 certificate file including the private key. -List directories in top level of your Mega +Set this if using +- Service principal with certificate - rclone lsd remote: -List all the files in your Mega +Properties: - rclone ls remote: +- Config: client_certificate_path +- Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PATH +- Type: string +- Required: false -To copy a local directory to an Mega directory called backup +#### --azureblob-client-certificate-password - rclone copy /home/source remote:backup +Password for the certificate file (optional). -### Modified time and hashes +Optionally set this if using +- Service principal with certificate -Mega does not support modification times or hashes yet. +And the certificate has a password. -### Restricted filename characters -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| NUL | 0x00 | \[u2400] | -| / | 0x2F | \[uFF0F] | +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -Invalid UTF-8 bytes will also be [replaced](https://rclone.org/overview/#invalid-utf8), -as they can\[aq]t be used in JSON strings. +Properties: -### Duplicated files +- Config: client_certificate_password +- Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PASSWORD +- Type: string +- Required: false -Mega can have two files with exactly the same name and path (unlike a -normal file system). +### Advanced options -Duplicated files cause problems with the syncing and you will see -messages in the log about duplicates. +Here are the Advanced options specific to azureblob (Microsoft Azure Blob Storage). -Use \[ga]rclone dedupe\[ga] to fix duplicated files. +#### --azureblob-client-send-certificate-chain -### Failure to log-in +Send the certificate chain when using certificate auth. -#### Object not found +Specifies whether an authentication request will include an x5c header +to support subject name / issuer based authentication. When set to +true, authentication requests include the x5c header. -If you are connecting to your Mega remote for the first time, -to test access and synchronization, you may receive an error such as -\f[R] -.fi -.PP -Failed to create file system for \[dq]my-mega-remote:\[dq]: couldn\[aq]t -login: Object (typically, node or user) not found -.IP -.nf -\f[C] -The diagnostic steps often recommended in the [rclone forum](https://forum.rclone.org/search?q=mega) -start with the **MEGAcmd** utility. Note that this refers to -the official C++ command from https://github.com/meganz/MEGAcmd -and not the go language built command from t3rm1n4l/megacmd -that is no longer maintained. +Optionally set this if using +- Service principal with certificate -Follow the instructions for installing MEGAcmd and try accessing -your remote as they recommend. You can establish whether or not -you can log in using MEGAcmd, and obtain diagnostic information -to help you, and search or work with others in the forum. -\f[R] -.fi -.PP -MEGA CMD> login me\[at]example.com Password: Fetching nodes ... -Loading transfers from local cache Login complete as me\[at]example.com -me\[at]example.com:/$ -.IP -.nf -\f[C] -Note that some have found issues with passwords containing special -characters. If you can not log on with rclone, but MEGAcmd logs on -just fine, then consider changing your password temporarily to -pure alphanumeric characters, in case that helps. +Properties: -#### Repeated commands blocks access +- Config: client_send_certificate_chain +- Env Var: RCLONE_AZUREBLOB_CLIENT_SEND_CERTIFICATE_CHAIN +- Type: bool +- Default: false -Mega remotes seem to get blocked (reject logins) under \[dq]heavy use\[dq]. -We haven\[aq]t worked out the exact blocking rules but it seems to be -related to fast paced, successive rclone commands. +#### --azureblob-username -For example, executing this command 90 times in a row \[ga]rclone link -remote:file\[ga] will cause the remote to become \[dq]blocked\[dq]. This is not an -abnormal situation, for example if you wish to get the public links of -a directory with hundred of files... After more or less a week, the -remote will remote accept rclone logins normally again. +User name (usually an email address) -You can mitigate this issue by mounting the remote it with \[ga]rclone -mount\[ga]. This will log-in when mounting and a log-out when unmounting -only. You can also run \[ga]rclone rcd\[ga] and then use \[ga]rclone rc\[ga] to run -the commands over the API to avoid logging in each time. +Set this if using +- User with username and password -Rclone does not currently close mega sessions (you can see them in the -web interface), however closing the sessions does not solve the issue. -If you space rclone commands by 3 seconds it will avoid blocking the -remote. We haven\[aq]t identified the exact blocking rules, so perhaps one -could execute the command 80 times without waiting and avoid blocking -by waiting 3 seconds, then continuing... +Properties: -Note that this has been observed by trial and error and might not be -set in stone. +- Config: username +- Env Var: RCLONE_AZUREBLOB_USERNAME +- Type: string +- Required: false -Other tools seem not to produce this blocking effect, as they use a -different working approach (state-based, using sessionIDs instead of -log-in) which isn\[aq]t compatible with the current stateless rclone -approach. +#### --azureblob-password -Note that once blocked, the use of other tools (such as megacmd) is -not a sure workaround: following megacmd login times have been -observed in succession for blocked remote: 7 minutes, 20 min, 30min, 30 -min, 30min. Web access looks unaffected though. +The user\[aq]s password -Investigation is continuing in relation to workarounds based on -timeouts, pacers, retrials and tpslimits - if you discover something -relevant, please post on the forum. +Set this if using +- User with username and password -So, if rclone was working nicely and suddenly you are unable to log-in -and you are sure the user and the password are correct, likely you -have got the remote blocked for a while. +**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). -### Standard options +Properties: -Here are the Standard options specific to mega (Mega). +- Config: password +- Env Var: RCLONE_AZUREBLOB_PASSWORD +- Type: string +- Required: false -#### --mega-user +#### --azureblob-service-principal-file -User name. +Path to file containing credentials for use with a service principal. -Properties: +Leave blank normally. Needed only if you want to use a service principal instead of interactive login. -- Config: user -- Env Var: RCLONE_MEGA_USER -- Type: string -- Required: true + $ az ad sp create-for-rbac --name \[dq]\[dq] \[rs] + --role \[dq]Storage Blob Data Owner\[dq] \[rs] + --scopes \[dq]/subscriptions//resourceGroups//providers/Microsoft.Storage/storageAccounts//blobServices/default/containers/\[dq] \[rs] + > azure-principal.json -#### --mega-pass +See [\[dq]Create an Azure service principal\[dq]](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) and [\[dq]Assign an Azure role for access to blob data\[dq]](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli) pages for more details. -Password. +It may be more convenient to put the credentials directly into the +rclone config file under the \[ga]client_id\[ga], \[ga]tenant\[ga] and \[ga]client_secret\[ga] +keys instead of setting \[ga]service_principal_file\[ga]. -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). Properties: -- Config: pass -- Env Var: RCLONE_MEGA_PASS +- Config: service_principal_file +- Env Var: RCLONE_AZUREBLOB_SERVICE_PRINCIPAL_FILE - Type: string -- Required: true - -### Advanced options +- Required: false -Here are the Advanced options specific to mega (Mega). +#### --azureblob-use-msi -#### --mega-debug +Use a managed service identity to authenticate (only works in Azure). -Output more debug from Mega. +When true, use a [managed service identity](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/) +to authenticate to Azure Storage instead of a SAS token or account key. -If this flag is set (along with -vv) it will print further debugging -information from the mega backend. +If the VM(SS) on which this program is running has a system-assigned identity, it will +be used by default. If the resource has no system-assigned but exactly one user-assigned identity, +the user-assigned identity will be used by default. If the resource has multiple user-assigned +identities, the identity to use must be explicitly specified using exactly one of the msi_object_id, +msi_client_id, or msi_mi_res_id parameters. Properties: -- Config: debug -- Env Var: RCLONE_MEGA_DEBUG +- Config: use_msi +- Env Var: RCLONE_AZUREBLOB_USE_MSI - Type: bool - Default: false -#### --mega-hard-delete +#### --azureblob-msi-object-id -Delete files permanently rather than putting them into the trash. +Object ID of the user-assigned MSI to use, if any. -Normally the mega backend will put all deletions into the trash rather -than permanently deleting them. If you specify this then rclone will -permanently delete objects instead. +Leave blank if msi_client_id or msi_mi_res_id specified. Properties: -- Config: hard_delete -- Env Var: RCLONE_MEGA_HARD_DELETE -- Type: bool -- Default: false +- Config: msi_object_id +- Env Var: RCLONE_AZUREBLOB_MSI_OBJECT_ID +- Type: string +- Required: false -#### --mega-use-https +#### --azureblob-msi-client-id -Use HTTPS for transfers. +Object ID of the user-assigned MSI to use, if any. -MEGA uses plain text HTTP connections by default. -Some ISPs throttle HTTP connections, this causes transfers to become very slow. -Enabling this will force MEGA to use HTTPS for all transfers. -HTTPS is normally not necessary since all data is already encrypted anyway. -Enabling it will increase CPU usage and add network overhead. +Leave blank if msi_object_id or msi_mi_res_id specified. Properties: -- Config: use_https -- Env Var: RCLONE_MEGA_USE_HTTPS -- Type: bool -- Default: false +- Config: msi_client_id +- Env Var: RCLONE_AZUREBLOB_MSI_CLIENT_ID +- Type: string +- Required: false -#### --mega-encoding +#### --azureblob-msi-mi-res-id -The encoding for the backend. +Azure resource ID of the user-assigned MSI to use, if any. -See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. +Leave blank if msi_client_id or msi_object_id specified. Properties: -- Config: encoding -- Env Var: RCLONE_MEGA_ENCODING -- Type: MultiEncoder -- Default: Slash,InvalidUtf8,Dot - - - -### Process \[ga]killed\[ga] - -On accounts with large files or something else, memory usage can significantly increase when executing list/sync instructions. When running on cloud providers (like AWS with EC2), check if the instance type has sufficient memory/CPU to execute the commands. Use the resource monitoring tools to inspect after sending the commands. Look [at this issue](https://forum.rclone.org/t/rclone-with-mega-appears-to-work-only-in-some-accounts/40233/4). - -## Limitations - -This backend uses the [go-mega go library](https://github.com/t3rm1n4l/go-mega) which is an opensource -go library implementing the Mega API. There doesn\[aq]t appear to be any -documentation for the mega protocol beyond the [mega C++ SDK](https://github.com/meganz/sdk) source code -so there are likely quite a few errors still remaining in this library. - -Mega allows duplicate files which may confuse rclone. - -# Memory +- Config: msi_mi_res_id +- Env Var: RCLONE_AZUREBLOB_MSI_MI_RES_ID +- Type: string +- Required: false -The memory backend is an in RAM backend. It does not persist its -data - use the local backend for that. +#### --azureblob-use-emulator -The memory backend behaves like a bucket-based remote (e.g. like -s3). Because it has no parameters you can just use it with the -\[ga]:memory:\[ga] remote name. +Uses local storage emulator if provided as \[aq]true\[aq]. -## Configuration +Leave blank if using real azure storage endpoint. -You can configure it as a remote like this with \[ga]rclone config\[ga] too if -you want to: -\f[R] -.fi -.PP -No remotes found, make a new one? -n) New remote s) Set configuration password q) Quit config n/s/q> n -name> remote Type of storage to configure. -Enter a string value. -Press Enter for the default (\[dq]\[dq]). -Choose a number from below, or type in your own value [snip] XX / Memory -\ \[dq]memory\[dq] [snip] Storage> memory ** See help for memory backend -at: https://rclone.org/memory/ ** -.PP -Remote config -.PP -.TS -tab(@); -l. -T{ -[remote] -T} -T{ -type = memory -T} -.TE -.IP "y)" 3 -Yes this is OK (default) -.IP "z)" 3 -Edit this remote -.IP "a)" 3 -Delete this remote y/e/d> y -.IP -.nf -\f[C] -Because the memory backend isn\[aq]t persistent it is most useful for -testing or with an rclone server or rclone mount, e.g. +Properties: - rclone mount :memory: /mnt/tmp - rclone serve webdav :memory: - rclone serve sftp :memory: +- Config: use_emulator +- Env Var: RCLONE_AZUREBLOB_USE_EMULATOR +- Type: bool +- Default: false -### Modified time and hashes +#### --azureblob-endpoint -The memory backend supports MD5 hashes and modification times accurate to 1 nS. +Endpoint for the service. -### Restricted filename characters +Leave blank normally. -The memory backend replaces the [default restricted characters -set](https://rclone.org/overview/#restricted-characters). +Properties: +- Config: endpoint +- Env Var: RCLONE_AZUREBLOB_ENDPOINT +- Type: string +- Required: false +#### --azureblob-upload-cutoff +Cutoff for switching to chunked upload (<= 256 MiB) (deprecated). -# Akamai NetStorage +Properties: -Paths are specified as \[ga]remote:\[ga] -You may put subdirectories in too, e.g. \[ga]remote:/path/to/dir\[ga]. -If you have a CP code you can use that as the folder after the domain such as \[rs]\[rs]/\[rs]\[rs]/\[rs]. +- Config: upload_cutoff +- Env Var: RCLONE_AZUREBLOB_UPLOAD_CUTOFF +- Type: string +- Required: false -For example, this is commonly configured with or without a CP code: -* **With a CP code**. \[ga][your-domain-prefix]-nsu.akamaihd.net/123456/subdirectory/\[ga] -* **Without a CP code**. \[ga][your-domain-prefix]-nsu.akamaihd.net\[ga] +#### --azureblob-chunk-size +Upload chunk size. -See all buckets - rclone lsd remote: -The initial setup for Netstorage involves getting an account and secret. Use \[ga]rclone config\[ga] to walk you through the setup process. +Note that this is stored in memory and there may be up to +\[dq]--transfers\[dq] * \[dq]--azureblob-upload-concurrency\[dq] chunks stored at once +in memory. -## Configuration +Properties: -Here\[aq]s an example of how to make a remote called \[ga]ns1\[ga]. +- Config: chunk_size +- Env Var: RCLONE_AZUREBLOB_CHUNK_SIZE +- Type: SizeSuffix +- Default: 4Mi -1. To begin the interactive configuration process, enter this command: -\f[R] -.fi -.PP -rclone config -.IP -.nf -\f[C] -2. Type \[ga]n\[ga] to create a new remote. -\f[R] -.fi -.IP "n)" 3 -New remote -.IP "o)" 3 -Delete remote -.IP "p)" 3 -Quit config e/n/d/q> n -.IP -.nf -\f[C] -3. For this example, enter \[ga]ns1\[ga] when you reach the name> prompt. -\f[R] -.fi -.PP -name> ns1 -.IP -.nf -\f[C] -4. Enter \[ga]netstorage\[ga] as the type of storage to configure. -\f[R] -.fi -.PP -Type of storage to configure. -Enter a string value. -Press Enter for the default (\[dq]\[dq]). -Choose a number from below, or type in your own value XX / NetStorage -\ \[dq]netstorage\[dq] Storage> netstorage -.IP -.nf -\f[C] -5. Select between the HTTP or HTTPS protocol. Most users should choose HTTPS, which is the default. HTTP is provided primarily for debugging purposes. +#### --azureblob-upload-concurrency -\f[R] -.fi -.PP -Enter a string value. -Press Enter for the default (\[dq]\[dq]). -Choose a number from below, or type in your own value 1 / HTTP protocol -\ \[dq]http\[dq] 2 / HTTPS protocol \ \[dq]https\[dq] protocol> 1 -.IP -.nf -\f[C] -6. Specify your NetStorage host, CP code, and any necessary content paths using this format: \[ga]///\[ga] -\f[R] -.fi -.PP -Enter a string value. -Press Enter for the default (\[dq]\[dq]). -host> baseball-nsu.akamaihd.net/123456/content/ -.IP -.nf -\f[C] -7. Set the netstorage account name -\f[R] -.fi -.PP -Enter a string value. -Press Enter for the default (\[dq]\[dq]). -account> username -.IP -.nf -\f[C] -8. Set the Netstorage account secret/G2O key which will be used for authentication purposes. Select the \[ga]y\[ga] option to set your own password then enter your secret. -Note: The secret is stored in the \[ga]rclone.conf\[ga] file with hex-encoded encryption. -\f[R] -.fi -.IP "y)" 3 -Yes type in my own password -.IP "z)" 3 -Generate random password y/g> y Enter the password: password: Confirm -the password: password: -.IP -.nf -\f[C] -9. View the summary and confirm your remote configuration. -\f[R] -.fi -.PP -[ns1] type = netstorage protocol = http host = -baseball-nsu.akamaihd.net/123456/content/ account = username secret = -*** ENCRYPTED *** -------------------- y) Yes this is OK (default) e) -Edit this remote d) Delete this remote y/e/d> y -.IP -.nf -\f[C] -This remote is called \[ga]ns1\[ga] and can now be used. +Concurrency for multipart uploads. -## Example operations +This is the number of chunks of the same file that are uploaded +concurrently. -Get started with rclone and NetStorage with these examples. For additional rclone commands, visit https://rclone.org/commands/. +If you are uploading small numbers of large files over high-speed +links and these uploads do not fully utilize your bandwidth, then +increasing this may help to speed up the transfers. -### See contents of a directory in your project +In tests, upload speed increases almost linearly with upload +concurrency. For example to fill a gigabit pipe it may be necessary to +raise this to 64. Note that this will use more memory. - rclone lsd ns1:/974012/testing/ +Note that chunks are stored in memory and there may be up to +\[dq]--transfers\[dq] * \[dq]--azureblob-upload-concurrency\[dq] chunks stored at once +in memory. -### Sync the contents local with remote +Properties: - rclone sync . ns1:/974012/testing/ +- Config: upload_concurrency +- Env Var: RCLONE_AZUREBLOB_UPLOAD_CONCURRENCY +- Type: int +- Default: 16 -### Upload local content to remote - rclone copy notes.txt ns1:/974012/testing/ +#### --azureblob-list-chunk -### Delete content on remote - rclone delete ns1:/974012/testing/notes.txt +Size of blob list. -### Move or copy content between CP codes. +This sets the number of blobs requested in each listing chunk. Default +is the maximum, 5000. \[dq]List blobs\[dq] requests are permitted 2 minutes +per megabyte to complete. If an operation is taking longer than 2 +minutes per megabyte on average, it will time out ( +[source](https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-blob-service-operations#exceptions-to-default-timeout-interval) +). This can be used to limit the number of blobs items to return, to +avoid the time out. -Your credentials must have access to two CP codes on the same remote. You can\[aq]t perform operations between different remotes. +Properties: - rclone move ns1:/974012/testing/notes.txt ns1:/974450/testing2/ +- Config: list_chunk +- Env Var: RCLONE_AZUREBLOB_LIST_CHUNK +- Type: int +- Default: 5000 -## Features +#### --azureblob-access-tier -### Symlink Support +Access tier of blob: hot, cool, cold or archive. -The Netstorage backend changes the rclone \[ga]--links, -l\[ga] behavior. When uploading, instead of creating the .rclonelink file, use the \[dq]symlink\[dq] API in order to create the corresponding symlink on the remote. The .rclonelink file will not be created, the upload will be intercepted and only the symlink file that matches the source file name with no suffix will be created on the remote. +Archived blobs can be restored by setting access tier to hot, cool or +cold. Leave blank if you intend to use default access tier, which is +set at account level -This will effectively allow commands like copy/copyto, move/moveto and sync to upload from local to remote and download from remote to local directories with symlinks. Due to internal rclone limitations, it is not possible to upload an individual symlink file to any remote backend. You can always use the \[dq]backend symlink\[dq] command to create a symlink on the NetStorage server, refer to \[dq]symlink\[dq] section below. +If there is no \[dq]access tier\[dq] specified, rclone doesn\[aq]t apply any tier. +rclone performs \[dq]Set Tier\[dq] operation on blobs while uploading, if objects +are not modified, specifying \[dq]access tier\[dq] to new one will have no effect. +If blobs are in \[dq]archive tier\[dq] at remote, trying to perform data transfer +operations from remote will not be allowed. User should first restore by +tiering blob to \[dq]Hot\[dq], \[dq]Cool\[dq] or \[dq]Cold\[dq]. -Individual symlink files on the remote can be used with the commands like \[dq]cat\[dq] to print the destination name, or \[dq]delete\[dq] to delete symlink, or copy, copy/to and move/moveto to download from the remote to local. Note: individual symlink files on the remote should be specified including the suffix .rclonelink. +Properties: -**Note**: No file with the suffix .rclonelink should ever exist on the server since it is not possible to actually upload/create a file with .rclonelink suffix with rclone, it can only exist if it is manually created through a non-rclone method on the remote. +- Config: access_tier +- Env Var: RCLONE_AZUREBLOB_ACCESS_TIER +- Type: string +- Required: false -### Implicit vs. Explicit Directories +#### --azureblob-archive-tier-delete -With NetStorage, directories can exist in one of two forms: +Delete archive tier blobs before overwriting. -1. **Explicit Directory**. This is an actual, physical directory that you have created in a storage group. -2. **Implicit Directory**. This refers to a directory within a path that has not been physically created. For example, during upload of a file, nonexistent subdirectories can be specified in the target path. NetStorage creates these as \[dq]implicit.\[dq] While the directories aren\[aq]t physically created, they exist implicitly and the noted path is connected with the uploaded file. +Archive tier blobs cannot be updated. So without this flag, if you +attempt to update an archive tier blob, then rclone will produce the +error: -Rclone will intercept all file uploads and mkdir commands for the NetStorage remote and will explicitly issue the mkdir command for each directory in the uploading path. This will help with the interoperability with the other Akamai services such as SFTP and the Content Management Shell (CMShell). Rclone will not guarantee correctness of operations with implicit directories which might have been created as a result of using an upload API directly. + can\[aq]t update archive tier blob without --azureblob-archive-tier-delete -### \[ga]--fast-list\[ga] / ListR support +With this flag set then before rclone attempts to overwrite an archive +tier blob, it will delete the existing blob before uploading its +replacement. This has the potential for data loss if the upload fails +(unlike updating a normal blob) and also may cost more since deleting +archive tier blobs early may be chargable. -NetStorage remote supports the ListR feature by using the \[dq]list\[dq] NetStorage API action to return a lexicographical list of all objects within the specified CP code, recursing into subdirectories as they\[aq]re encountered. -* **Rclone will use the ListR method for some commands by default**. Commands such as \[ga]lsf -R\[ga] will use ListR by default. To disable this, include the \[ga]--disable listR\[ga] option to use the non-recursive method of listing objects. +Properties: -* **Rclone will not use the ListR method for some commands**. Commands such as \[ga]sync\[ga] don\[aq]t use ListR by default. To force using the ListR method, include the \[ga]--fast-list\[ga] option. +- Config: archive_tier_delete +- Env Var: RCLONE_AZUREBLOB_ARCHIVE_TIER_DELETE +- Type: bool +- Default: false -There are pros and cons of using the ListR method, refer to [rclone documentation](https://rclone.org/docs/#fast-list). In general, the sync command over an existing deep tree on the remote will run faster with the \[dq]--fast-list\[dq] flag but with extra memory usage as a side effect. It might also result in higher CPU utilization but the whole task can be completed faster. +#### --azureblob-disable-checksum -**Note**: There is a known limitation that \[dq]lsf -R\[dq] will display number of files in the directory and directory size as -1 when ListR method is used. The workaround is to pass \[dq]--disable listR\[dq] flag if these numbers are important in the output. +Don\[aq]t store MD5 checksum with object metadata. -### Purge +Normally rclone will calculate the MD5 checksum of the input before +uploading it so it can add it to metadata on the object. This is great +for data integrity checking but can cause long delays for large files +to start uploading. -NetStorage remote supports the purge feature by using the \[dq]quick-delete\[dq] NetStorage API action. The quick-delete action is disabled by default for security reasons and can be enabled for the account through the Akamai portal. Rclone will first try to use quick-delete action for the purge command and if this functionality is disabled then will fall back to a standard delete method. +Properties: -**Note**: Read the [NetStorage Usage API](https://learn.akamai.com/en-us/webhelp/netstorage/netstorage-http-api-developer-guide/GUID-15836617-9F50-405A-833C-EA2556756A30.html) for considerations when using \[dq]quick-delete\[dq]. In general, using quick-delete method will not delete the tree immediately and objects targeted for quick-delete may still be accessible. +- Config: disable_checksum +- Env Var: RCLONE_AZUREBLOB_DISABLE_CHECKSUM +- Type: bool +- Default: false +#### --azureblob-memory-pool-flush-time -### Standard options +How often internal memory buffer pools will be flushed. (no longer used) -Here are the Standard options specific to netstorage (Akamai NetStorage). +Properties: -#### --netstorage-host +- Config: memory_pool_flush_time +- Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_FLUSH_TIME +- Type: Duration +- Default: 1m0s -Domain+path of NetStorage host to connect to. +#### --azureblob-memory-pool-use-mmap -Format should be \[ga]/\[ga] +Whether to use mmap buffers in internal memory pool. (no longer used) Properties: -- Config: host -- Env Var: RCLONE_NETSTORAGE_HOST -- Type: string -- Required: true +- Config: memory_pool_use_mmap +- Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_USE_MMAP +- Type: bool +- Default: false -#### --netstorage-account +#### --azureblob-encoding -Set the NetStorage account name +The encoding for the backend. + +See the [encoding section in the overview](https://rclone.org/overview/#encoding) for more info. Properties: -- Config: account -- Env Var: RCLONE_NETSTORAGE_ACCOUNT +- Config: encoding +- Env Var: RCLONE_AZUREBLOB_ENCODING +- Type: Encoding +- Default: Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8 + +#### --azureblob-public-access + +Public access level of a container: blob or container. + +Properties: + +- Config: public_access +- Env Var: RCLONE_AZUREBLOB_PUBLIC_ACCESS - Type: string -- Required: true +- Required: false +- Examples: + - \[dq]\[dq] + - The container and its blobs can be accessed only with an authorized request. + - It\[aq]s a default value. + - \[dq]blob\[dq] + - Blob data within this container can be read via anonymous request. + - \[dq]container\[dq] + - Allow full public read access for container and blob data. -#### --netstorage-secret +#### --azureblob-directory-markers -Set the NetStorage account secret/G2O key for authentication. +Upload an empty object with a trailing slash when a new directory is created -Please choose the \[aq]y\[aq] option to set your own password then enter your secret. +Empty folders are unsupported for bucket based remotes, this option +creates an empty object ending with \[dq]/\[dq], to persist the folder. -**NB** Input to this must be obscured - see [rclone obscure](https://rclone.org/commands/rclone_obscure/). +This object also has the metadata \[dq]hdi_isfolder = true\[dq] to conform to +the Microsoft standard. + Properties: -- Config: secret -- Env Var: RCLONE_NETSTORAGE_SECRET -- Type: string -- Required: true - -### Advanced options +- Config: directory_markers +- Env Var: RCLONE_AZUREBLOB_DIRECTORY_MARKERS +- Type: bool +- Default: false -Here are the Advanced options specific to netstorage (Akamai NetStorage). +#### --azureblob-no-check-container -#### --netstorage-protocol +If set, don\[aq]t attempt to check the container exists or create it. -Select between HTTP or HTTPS protocol. +This can be useful when trying to minimise the number of transactions +rclone does if you know the container exists already. -Most users should choose HTTPS, which is the default. -HTTP is provided primarily for debugging purposes. Properties: -- Config: protocol -- Env Var: RCLONE_NETSTORAGE_PROTOCOL -- Type: string -- Default: \[dq]https\[dq] -- Examples: - - \[dq]http\[dq] - - HTTP protocol - - \[dq]https\[dq] - - HTTPS protocol +- Config: no_check_container +- Env Var: RCLONE_AZUREBLOB_NO_CHECK_CONTAINER +- Type: bool +- Default: false -## Backend commands +#### --azureblob-no-head-object -Here are the commands specific to the netstorage backend. +If set, do not do HEAD before GET when getting objects. -Run them with +Properties: - rclone backend COMMAND remote: +- Config: no_head_object +- Env Var: RCLONE_AZUREBLOB_NO_HEAD_OBJECT +- Type: bool +- Default: false -The help below will explain what arguments each command takes. -See the [backend](https://rclone.org/commands/rclone_backend/) command for more -info on how to pass options and arguments. -These can be run on a running backend using the rc command -[backend/command](https://rclone.org/rc/#backend-command). +### Custom upload headers -### du +You can set custom upload headers with the \[ga]--header-upload\[ga] flag. -Return disk usage information for a specified directory +- Cache-Control +- Content-Disposition +- Content-Encoding +- Content-Language +- Content-Type - rclone backend du remote: [options] [+] +Eg \[ga]--header-upload \[dq]Content-Type: text/potato\[dq]\[ga] -The usage information returned, includes the targeted directory as well as all -files stored in any sub-directories that may exist. +## Limitations -### symlink +MD5 sums are only uploaded with chunked files if the source has an MD5 +sum. This will always be the case for a local to azure copy. -You can create a symbolic link in ObjectStore with the symlink action. +\[ga]rclone about\[ga] is not supported by the Microsoft Azure Blob storage backend. Backends without +this capability cannot determine free space for an rclone mount or +use policy \[ga]mfs\[ga] (most free space) as a member of an rclone union +remote. - rclone backend symlink remote: [options] [+] +See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) -The desired path location (including applicable sub-directories) ending in -the object that will be the target of the symlink (for example, /links/mylink). -Include the file extension for the object, if applicable. -\[ga]rclone backend symlink \[ga] +## Azure Storage Emulator Support +You can run rclone with the storage emulator (usually _azurite_). +To do this, just set up a new remote with \[ga]rclone config\[ga] following +the instructions in the introduction and set \[ga]use_emulator\[ga] in the +advanced settings as \[ga]true\[ga]. You do not need to provide a default +account name nor an account key. But you can override them in the +\[ga]account\[ga] and \[ga]key\[ga] options. (Prior to v1.61 they were hard coded to +_azurite_\[aq]s \[ga]devstoreaccount1\[ga].) -# Microsoft Azure Blob Storage +Also, if you want to access a storage emulator instance running on a +different machine, you can override the \[ga]endpoint\[ga] parameter in the +advanced settings, setting it to +\[ga]http(s)://:/devstoreaccount1\[ga] +(e.g. \[ga]http://10.254.2.5:10000/devstoreaccount1\[ga]). -Paths are specified as \[ga]remote:container\[ga] (or \[ga]remote:\[ga] for the \[ga]lsd\[ga] -command.) You may put subdirectories in too, e.g. -\[ga]remote:container/path/to/dir\[ga]. +# Microsoft Azure Files Storage + +Paths are specified as \[ga]remote:\[ga] You may put subdirectories in too, +e.g. \[ga]remote:path/to/dir\[ga]. ## Configuration -Here is an example of making a Microsoft Azure Blob Storage +Here is an example of making a Microsoft Azure Files Storage configuration. For a remote called \[ga]remote\[ga]. First run: rclone config @@ -47282,55 +47608,89 @@ No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] XX / -Microsoft Azure Blob Storage \ \[dq]azureblob\[dq] [snip] Storage> -azureblob Storage Account Name account> account_name Storage Account Key -key> base64encodedkey== Endpoint for the service - leave blank normally. -endpoint> Remote config -------------------- [remote] account = -account_name key = base64encodedkey== endpoint = -------------------- y) -Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y +Microsoft Azure Files Storage \ \[dq]azurefiles\[dq] [snip] +.PP +Option account. +Azure Storage Account Name. +Set this to the Azure Storage Account Name in use. +Leave blank to use SAS URL or connection string, otherwise it needs to +be set. +If this is blank and if env_auth is set it will be read from the +environment variable \f[C]AZURE_STORAGE_ACCOUNT_NAME\f[R] if possible. +Enter a value. +Press Enter to leave empty. +account> account_name +.PP +Option share_name. +Azure Files Share Name. +This is required and is the name of the share to access. +Enter a value. +Press Enter to leave empty. +share_name> share_name +.PP +Option env_auth. +Read credentials from runtime (environment variables, CLI or MSI). +See the authentication docs for full info. +Enter a boolean value (true or false). +Press Enter for the default (false). +env_auth> +.PP +Option key. +Storage Account Shared Key. +Leave blank to use SAS URL or connection string. +Enter a value. +Press Enter to leave empty. +key> base64encodedkey== +.PP +Option sas_url. +SAS URL. +Leave blank if using account/key or connection string. +Enter a value. +Press Enter to leave empty. +sas_url> +.PP +Option connection_string. +Azure Files Connection String. +Enter a value. +Press Enter to leave empty. +connection_string> [snip] +.PP +Configuration complete. +Options: - type: azurefiles - account: account_name - share_name: +share_name - key: base64encodedkey== Keep this \[dq]remote\[dq] remote? +y) Yes this is OK (default) e) Edit this remote d) Delete this remote +y/e/d> .IP .nf \f[C] -See all containers - - rclone lsd remote: +Once configured you can use rclone. -Make a new container +See all files in the top level: - rclone mkdir remote:container + rclone lsf remote: -List the contents of a container +Make a new directory in the root: - rclone ls remote:container + rclone mkdir remote:dir -Sync \[ga]/home/local/directory\[ga] to the remote container, deleting any excess -files in the container. +Recursively List the contents: - rclone sync --interactive /home/local/directory remote:container + rclone ls remote: -### --fast-list +Sync \[ga]/home/local/directory\[ga] to the remote directory, deleting any +excess files in the directory. -This remote supports \[ga]--fast-list\[ga] which allows you to use fewer -transactions in exchange for more memory. See the [rclone -docs](https://rclone.org/docs/#fast-list) for more details. + rclone sync --interactive /home/local/directory remote:dir ### Modified time -The modified time is stored as metadata on the object with the \[ga]mtime\[ga] -key. It is stored using RFC3339 Format time with nanosecond -precision. The metadata is supplied during directory listings so -there is no performance overhead to using it. - -If you wish to use the Azure standard \[ga]LastModified\[ga] time stored on -the object as the modified time, then use the \[ga]--use-server-modtime\[ga] -flag. Note that rclone can\[aq]t set \[ga]LastModified\[ga], so using the -\[ga]--update\[ga] flag when syncing is recommended if using -\[ga]--use-server-modtime\[ga]. +The modified time is stored as Azure standard \[ga]LastModified\[ga] time on +files ### Performance When uploading large files, increasing the value of -\[ga]--azureblob-upload-concurrency\[ga] will increase performance at the cost +\[ga]--azurefiles-upload-concurrency\[ga] will increase performance at the cost of using more memory. The default of 16 is set quite conservatively to use less memory. It maybe be necessary raise it to 64 or higher to fully utilize a 1 GBit/s link with a single file transfer. @@ -47342,8 +47702,14 @@ the following characters are also replaced: | Character | Value | Replacement | | --------- |:-----:|:-----------:| -| / | 0x2F | \[uFF0F] | -| \[rs] | 0x5C | \[uFF3C] | +| \[dq] | 0x22 | \[uFF02] | +| * | 0x2A | \[uFF0A] | +| : | 0x3A | \[uFF1A] | +| < | 0x3C | \[uFF1C] | +| > | 0x3E | \[uFF1E] | +| ? | 0x3F | \[uFF1F] | +| \[rs] | 0x5C | \[uFF3C] | +| \[rs]| | 0x7C | \[uFF5C] | File names can also not end with the following characters. These only get replaced if they are the last character in the name: @@ -47357,13 +47723,12 @@ as they can\[aq]t be used in JSON strings. ### Hashes -MD5 hashes are stored with blobs. However blobs that were uploaded in -chunks only have an MD5 if the source remote was capable of MD5 -hashes, e.g. the local disk. +MD5 hashes are stored with files. Not all files will have MD5 hashes +as these have to be uploaded with the file. ### Authentication {#authentication} -There are a number of ways of supplying credentials for Azure Blob +There are a number of ways of supplying credentials for Azure Files Storage. Rclone tries them in the order of the sections below. #### Env Auth @@ -47430,15 +47795,11 @@ For example if you were to login with a service principal like this: Then you could access rclone resources like this: - rclone lsf :azureblob,env_auth,account=ACCOUNT:CONTAINER + rclone lsf :azurefiles,env_auth,account=ACCOUNT: Or - rclone lsf --azureblob-env-auth --azureblob-account=ACCOUNT :azureblob:CONTAINER - -Which is analogous to using the \[ga]az\[ga] tool: - - az storage blob list --container-name CONTAINER --account-name ACCOUNT --auth-mode login + rclone lsf --azurefiles-env-auth --azurefiles-account=ACCOUNT :azurefiles: #### Account and Shared Key @@ -47447,34 +47808,11 @@ in the \[ga]account\[ga] and \[ga]key\[ga] lines and leave the rest blank. #### SAS URL -This can be an account level SAS URL or container level SAS URL. - -To use it leave \[ga]account\[ga] and \[ga]key\[ga] blank and fill in \[ga]sas_url\[ga]. - -An account level SAS URL or container level SAS URL can be obtained -from the Azure portal or the Azure Storage Explorer. To get a -container level SAS URL right click on a container in the Azure Blob -explorer in the Azure portal. - -If you use a container level SAS URL, rclone operations are permitted -only on a particular container, e.g. - - rclone ls azureblob:container - -You can also list the single container from the root. This will only -show the container specified by the SAS URL. - - $ rclone lsd azureblob: - container/ - -Note that you can\[aq]t see or access any other containers - this will -fail +To use it leave \[ga]account\[ga], \[ga]key\[ga] and \[ga]connection_string\[ga] blank and fill in \[ga]sas_url\[ga]. - rclone ls azureblob:othercontainer +#### Connection String -Container level SAS URLs are useful for temporarily allowing third -parties access to a single container or putting credentials into an -untrusted environment such as a CI build server. +To use it leave \[ga]account\[ga], \[ga]key\[ga] and \[dq]sas_url\[dq] blank and fill in \[ga]connection_string\[ga]. #### Service principal with client secret @@ -47533,15 +47871,15 @@ set, this is is equivalent to using \[ga]env_auth\[ga]. ### Standard options -Here are the Standard options specific to azureblob (Microsoft Azure Blob Storage). +Here are the Standard options specific to azurefiles (Microsoft Azure Files). -#### --azureblob-account +#### --azurefiles-account Azure Storage Account Name. Set this to the Azure Storage Account Name in use. -Leave blank to use SAS URL or Emulator, otherwise it needs to be set. +Leave blank to use SAS URL or connection string, otherwise it needs to be set. If this is blank and if env_auth is set it will be read from the environment variable \[ga]AZURE_STORAGE_ACCOUNT_NAME\[ga] if possible. @@ -47550,50 +47888,75 @@ environment variable \[ga]AZURE_STORAGE_ACCOUNT_NAME\[ga] if possible. Properties: - Config: account -- Env Var: RCLONE_AZUREBLOB_ACCOUNT +- Env Var: RCLONE_AZUREFILES_ACCOUNT - Type: string - Required: false -#### --azureblob-env-auth +#### --azurefiles-share-name + +Azure Files Share Name. + +This is required and is the name of the share to access. + + +Properties: + +- Config: share_name +- Env Var: RCLONE_AZUREFILES_SHARE_NAME +- Type: string +- Required: false + +#### --azurefiles-env-auth Read credentials from runtime (environment variables, CLI or MSI). -See the [authentication docs](/azureblob#authentication) for full info. +See the [authentication docs](/azurefiles#authentication) for full info. Properties: - Config: env_auth -- Env Var: RCLONE_AZUREBLOB_ENV_AUTH +- Env Var: RCLONE_AZUREFILES_ENV_AUTH - Type: bool - Default: false -#### --azureblob-key +#### --azurefiles-key Storage Account Shared Key. -Leave blank to use SAS URL or Emulator. +Leave blank to use SAS URL or connection string. Properties: - Config: key -- Env Var: RCLONE_AZUREBLOB_KEY +- Env Var: RCLONE_AZUREFILES_KEY - Type: string - Required: false -#### --azureblob-sas-url +#### --azurefiles-sas-url -SAS URL for container level access only. +SAS URL. -Leave blank if using account/key or Emulator. +Leave blank if using account/key or connection string. Properties: - Config: sas_url -- Env Var: RCLONE_AZUREBLOB_SAS_URL +- Env Var: RCLONE_AZUREFILES_SAS_URL - Type: string - Required: false -#### --azureblob-tenant +#### --azurefiles-connection-string + +Azure Files Connection String. + +Properties: + +- Config: connection_string +- Env Var: RCLONE_AZUREFILES_CONNECTION_STRING +- Type: string +- Required: false + +#### --azurefiles-tenant ID of the service principal\[aq]s tenant. Also called its directory ID. @@ -47606,11 +47969,11 @@ Set this if using Properties: - Config: tenant -- Env Var: RCLONE_AZUREBLOB_TENANT +- Env Var: RCLONE_AZUREFILES_TENANT - Type: string - Required: false -#### --azureblob-client-id +#### --azurefiles-client-id The ID of the client in use. @@ -47623,11 +47986,11 @@ Set this if using Properties: - Config: client_id -- Env Var: RCLONE_AZUREBLOB_CLIENT_ID +- Env Var: RCLONE_AZUREFILES_CLIENT_ID - Type: string - Required: false -#### --azureblob-client-secret +#### --azurefiles-client-secret One of the service principal\[aq]s client secrets @@ -47638,11 +48001,11 @@ Set this if using Properties: - Config: client_secret -- Env Var: RCLONE_AZUREBLOB_CLIENT_SECRET +- Env Var: RCLONE_AZUREFILES_CLIENT_SECRET - Type: string - Required: false -#### --azureblob-client-certificate-path +#### --azurefiles-client-certificate-path Path to a PEM or PKCS12 certificate file including the private key. @@ -47653,11 +48016,11 @@ Set this if using Properties: - Config: client_certificate_path -- Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PATH +- Env Var: RCLONE_AZUREFILES_CLIENT_CERTIFICATE_PATH - Type: string - Required: false -#### --azureblob-client-certificate-password +#### --azurefiles-client-certificate-password Password for the certificate file (optional). @@ -47672,15 +48035,15 @@ And the certificate has a password. Properties: - Config: client_certificate_password -- Env Var: RCLONE_AZUREBLOB_CLIENT_CERTIFICATE_PASSWORD +- Env Var: RCLONE_AZUREFILES_CLIENT_CERTIFICATE_PASSWORD - Type: string - Required: false ### Advanced options -Here are the Advanced options specific to azureblob (Microsoft Azure Blob Storage). +Here are the Advanced options specific to azurefiles (Microsoft Azure Files). -#### --azureblob-client-send-certificate-chain +#### --azurefiles-client-send-certificate-chain Send the certificate chain when using certificate auth. @@ -47695,11 +48058,11 @@ Optionally set this if using Properties: - Config: client_send_certificate_chain -- Env Var: RCLONE_AZUREBLOB_CLIENT_SEND_CERTIFICATE_CHAIN +- Env Var: RCLONE_AZUREFILES_CLIENT_SEND_CERTIFICATE_CHAIN - Type: bool - Default: false -#### --azureblob-username +#### --azurefiles-username User name (usually an email address) @@ -47710,11 +48073,11 @@ Set this if using Properties: - Config: username -- Env Var: RCLONE_AZUREBLOB_USERNAME +- Env Var: RCLONE_AZUREFILES_USERNAME - Type: string - Required: false -#### --azureblob-password +#### --azurefiles-password The user\[aq]s password @@ -47727,22 +48090,24 @@ Set this if using Properties: - Config: password -- Env Var: RCLONE_AZUREBLOB_PASSWORD +- Env Var: RCLONE_AZUREFILES_PASSWORD - Type: string - Required: false -#### --azureblob-service-principal-file +#### --azurefiles-service-principal-file Path to file containing credentials for use with a service principal. Leave blank normally. Needed only if you want to use a service principal instead of interactive login. $ az ad sp create-for-rbac --name \[dq]\[dq] \[rs] - --role \[dq]Storage Blob Data Owner\[dq] \[rs] + --role \[dq]Storage Files Data Owner\[dq] \[rs] --scopes \[dq]/subscriptions//resourceGroups//providers/Microsoft.Storage/storageAccounts//blobServices/default/containers/\[dq] \[rs] > azure-principal.json -See [\[dq]Create an Azure service principal\[dq]](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) and [\[dq]Assign an Azure role for access to blob data\[dq]](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli) pages for more details. +See [\[dq]Create an Azure service principal\[dq]](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) and [\[dq]Assign an Azure role for access to files data\[dq]](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli) pages for more details. + +**NB** this section needs updating for Azure Files - pull requests appreciated! It may be more convenient to put the credentials directly into the rclone config file under the \[ga]client_id\[ga], \[ga]tenant\[ga] and \[ga]client_secret\[ga] @@ -47752,11 +48117,11 @@ keys instead of setting \[ga]service_principal_file\[ga]. Properties: - Config: service_principal_file -- Env Var: RCLONE_AZUREBLOB_SERVICE_PRINCIPAL_FILE +- Env Var: RCLONE_AZUREFILES_SERVICE_PRINCIPAL_FILE - Type: string - Required: false -#### --azureblob-use-msi +#### --azurefiles-use-msi Use a managed service identity to authenticate (only works in Azure). @@ -47772,11 +48137,11 @@ msi_client_id, or msi_mi_res_id parameters. Properties: - Config: use_msi -- Env Var: RCLONE_AZUREBLOB_USE_MSI +- Env Var: RCLONE_AZUREFILES_USE_MSI - Type: bool - Default: false -#### --azureblob-msi-object-id +#### --azurefiles-msi-object-id Object ID of the user-assigned MSI to use, if any. @@ -47785,11 +48150,11 @@ Leave blank if msi_client_id or msi_mi_res_id specified. Properties: - Config: msi_object_id -- Env Var: RCLONE_AZUREBLOB_MSI_OBJECT_ID +- Env Var: RCLONE_AZUREFILES_MSI_OBJECT_ID - Type: string - Required: false -#### --azureblob-msi-client-id +#### --azurefiles-msi-client-id Object ID of the user-assigned MSI to use, if any. @@ -47798,11 +48163,11 @@ Leave blank if msi_object_id or msi_mi_res_id specified. Properties: - Config: msi_client_id -- Env Var: RCLONE_AZUREBLOB_MSI_CLIENT_ID +- Env Var: RCLONE_AZUREFILES_MSI_CLIENT_ID - Type: string - Required: false -#### --azureblob-msi-mi-res-id +#### --azurefiles-msi-mi-res-id Azure resource ID of the user-assigned MSI to use, if any. @@ -47811,24 +48176,11 @@ Leave blank if msi_client_id or msi_object_id specified. Properties: - Config: msi_mi_res_id -- Env Var: RCLONE_AZUREBLOB_MSI_MI_RES_ID +- Env Var: RCLONE_AZUREFILES_MSI_MI_RES_ID - Type: string - Required: false -#### --azureblob-use-emulator - -Uses local storage emulator if provided as \[aq]true\[aq]. - -Leave blank if using real azure storage endpoint. - -Properties: - -- Config: use_emulator -- Env Var: RCLONE_AZUREBLOB_USE_EMULATOR -- Type: bool -- Default: false - -#### --azureblob-endpoint +#### --azurefiles-endpoint Endpoint for the service. @@ -47837,37 +48189,26 @@ Leave blank normally. Properties: - Config: endpoint -- Env Var: RCLONE_AZUREBLOB_ENDPOINT +- Env Var: RCLONE_AZUREFILES_ENDPOINT - Type: string - Required: false -#### --azureblob-upload-cutoff - -Cutoff for switching to chunked upload (<= 256 MiB) (deprecated). - -Properties: - -- Config: upload_cutoff -- Env Var: RCLONE_AZUREBLOB_UPLOAD_CUTOFF -- Type: string -- Required: false - -#### --azureblob-chunk-size +#### --azurefiles-chunk-size Upload chunk size. Note that this is stored in memory and there may be up to -\[dq]--transfers\[dq] * \[dq]--azureblob-upload-concurrency\[dq] chunks stored at once +\[dq]--transfers\[dq] * \[dq]--azurefile-upload-concurrency\[dq] chunks stored at once in memory. Properties: - Config: chunk_size -- Env Var: RCLONE_AZUREBLOB_CHUNK_SIZE +- Env Var: RCLONE_AZUREFILES_CHUNK_SIZE - Type: SizeSuffix - Default: 4Mi -#### --azureblob-upload-concurrency +#### --azurefiles-upload-concurrency Concurrency for multipart uploads. @@ -47878,125 +48219,41 @@ If you are uploading small numbers of large files over high-speed links and these uploads do not fully utilize your bandwidth, then increasing this may help to speed up the transfers. -In tests, upload speed increases almost linearly with upload -concurrency. For example to fill a gigabit pipe it may be necessary to -raise this to 64. Note that this will use more memory. - Note that chunks are stored in memory and there may be up to -\[dq]--transfers\[dq] * \[dq]--azureblob-upload-concurrency\[dq] chunks stored at once +\[dq]--transfers\[dq] * \[dq]--azurefile-upload-concurrency\[dq] chunks stored at once in memory. Properties: - Config: upload_concurrency -- Env Var: RCLONE_AZUREBLOB_UPLOAD_CONCURRENCY +- Env Var: RCLONE_AZUREFILES_UPLOAD_CONCURRENCY - Type: int - Default: 16 -#### --azureblob-list-chunk - -Size of blob list. - -This sets the number of blobs requested in each listing chunk. Default -is the maximum, 5000. \[dq]List blobs\[dq] requests are permitted 2 minutes -per megabyte to complete. If an operation is taking longer than 2 -minutes per megabyte on average, it will time out ( -[source](https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-blob-service-operations#exceptions-to-default-timeout-interval) -). This can be used to limit the number of blobs items to return, to -avoid the time out. - -Properties: - -- Config: list_chunk -- Env Var: RCLONE_AZUREBLOB_LIST_CHUNK -- Type: int -- Default: 5000 - -#### --azureblob-access-tier - -Access tier of blob: hot, cool or archive. - -Archived blobs can be restored by setting access tier to hot or -cool. Leave blank if you intend to use default access tier, which is -set at account level - -If there is no \[dq]access tier\[dq] specified, rclone doesn\[aq]t apply any tier. -rclone performs \[dq]Set Tier\[dq] operation on blobs while uploading, if objects -are not modified, specifying \[dq]access tier\[dq] to new one will have no effect. -If blobs are in \[dq]archive tier\[dq] at remote, trying to perform data transfer -operations from remote will not be allowed. User should first restore by -tiering blob to \[dq]Hot\[dq] or \[dq]Cool\[dq]. - -Properties: - -- Config: access_tier -- Env Var: RCLONE_AZUREBLOB_ACCESS_TIER -- Type: string -- Required: false - -#### --azureblob-archive-tier-delete - -Delete archive tier blobs before overwriting. +#### --azurefiles-max-stream-size -Archive tier blobs cannot be updated. So without this flag, if you -attempt to update an archive tier blob, then rclone will produce the -error: - - can\[aq]t update archive tier blob without --azureblob-archive-tier-delete +Max size for streamed files. -With this flag set then before rclone attempts to overwrite an archive -tier blob, it will delete the existing blob before uploading its -replacement. This has the potential for data loss if the upload fails -(unlike updating a normal blob) and also may cost more since deleting -archive tier blobs early may be chargable. +Azure files needs to know in advance how big the file will be. When +rclone doesn\[aq]t know it uses this value instead. +This will be used when rclone is streaming data, the most common uses are: -Properties: +- Uploading files with \[ga]--vfs-cache-mode off\[ga] with \[ga]rclone mount\[ga] +- Using \[ga]rclone rcat\[ga] +- Copying files with unknown length -- Config: archive_tier_delete -- Env Var: RCLONE_AZUREBLOB_ARCHIVE_TIER_DELETE -- Type: bool -- Default: false +You will need this much free space in the share as the file will be this size temporarily. -#### --azureblob-disable-checksum - -Don\[aq]t store MD5 checksum with object metadata. - -Normally rclone will calculate the MD5 checksum of the input before -uploading it so it can add it to metadata on the object. This is great -for data integrity checking but can cause long delays for large files -to start uploading. Properties: -- Config: disable_checksum -- Env Var: RCLONE_AZUREBLOB_DISABLE_CHECKSUM -- Type: bool -- Default: false - -#### --azureblob-memory-pool-flush-time - -How often internal memory buffer pools will be flushed. (no longer used) - -Properties: - -- Config: memory_pool_flush_time -- Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_FLUSH_TIME -- Type: Duration -- Default: 1m0s - -#### --azureblob-memory-pool-use-mmap - -Whether to use mmap buffers in internal memory pool. (no longer used) - -Properties: - -- Config: memory_pool_use_mmap -- Env Var: RCLONE_AZUREBLOB_MEMORY_POOL_USE_MMAP -- Type: bool -- Default: false +- Config: max_stream_size +- Env Var: RCLONE_AZUREFILES_MAX_STREAM_SIZE +- Type: SizeSuffix +- Default: 10Gi -#### --azureblob-encoding +#### --azurefiles-encoding The encoding for the backend. @@ -48005,72 +48262,9 @@ See the [encoding section in the overview](https://rclone.org/overview/#encoding Properties: - Config: encoding -- Env Var: RCLONE_AZUREBLOB_ENCODING -- Type: MultiEncoder -- Default: Slash,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8 - -#### --azureblob-public-access - -Public access level of a container: blob or container. - -Properties: - -- Config: public_access -- Env Var: RCLONE_AZUREBLOB_PUBLIC_ACCESS -- Type: string -- Required: false -- Examples: - - \[dq]\[dq] - - The container and its blobs can be accessed only with an authorized request. - - It\[aq]s a default value. - - \[dq]blob\[dq] - - Blob data within this container can be read via anonymous request. - - \[dq]container\[dq] - - Allow full public read access for container and blob data. - -#### --azureblob-directory-markers - -Upload an empty object with a trailing slash when a new directory is created - -Empty folders are unsupported for bucket based remotes, this option -creates an empty object ending with \[dq]/\[dq], to persist the folder. - -This object also has the metadata \[dq]hdi_isfolder = true\[dq] to conform to -the Microsoft standard. - - -Properties: - -- Config: directory_markers -- Env Var: RCLONE_AZUREBLOB_DIRECTORY_MARKERS -- Type: bool -- Default: false - -#### --azureblob-no-check-container - -If set, don\[aq]t attempt to check the container exists or create it. - -This can be useful when trying to minimise the number of transactions -rclone does if you know the container exists already. - - -Properties: - -- Config: no_check_container -- Env Var: RCLONE_AZUREBLOB_NO_CHECK_CONTAINER -- Type: bool -- Default: false - -#### --azureblob-no-head-object - -If set, do not do HEAD before GET when getting objects. - -Properties: - -- Config: no_head_object -- Env Var: RCLONE_AZUREBLOB_NO_HEAD_OBJECT -- Type: bool -- Default: false +- Env Var: RCLONE_AZUREFILES_ENCODING +- Type: Encoding +- Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,RightPeriod,InvalidUtf8,Dot @@ -48091,30 +48285,6 @@ Eg \[ga]--header-upload \[dq]Content-Type: text/potato\[dq]\[ga] MD5 sums are only uploaded with chunked files if the source has an MD5 sum. This will always be the case for a local to azure copy. -\[ga]rclone about\[ga] is not supported by the Microsoft Azure Blob storage backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy \[ga]mfs\[ga] (most free space) as a member of an rclone union -remote. - -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) - -## Azure Storage Emulator Support - -You can run rclone with the storage emulator (usually _azurite_). - -To do this, just set up a new remote with \[ga]rclone config\[ga] following -the instructions in the introduction and set \[ga]use_emulator\[ga] in the -advanced settings as \[ga]true\[ga]. You do not need to provide a default -account name nor an account key. But you can override them in the -\[ga]account\[ga] and \[ga]key\[ga] options. (Prior to v1.61 they were hard coded to -_azurite_\[aq]s \[ga]devstoreaccount1\[ga].) - -Also, if you want to access a storage emulator instance running on a -different machine, you can override the \[ga]endpoint\[ga] parameter in the -advanced settings, setting it to -\[ga]http(s)://:/devstoreaccount1\[ga] -(e.g. \[ga]http://10.254.2.5:10000/devstoreaccount1\[ga]). - # Microsoft OneDrive Paths are specified as \[ga]remote:path\[ga] @@ -48267,7 +48437,7 @@ You may try to [verify you account](https://docs.microsoft.com/en-us/azure/activ Note: If you have a special region, you may need a different host in step 4 and 5. Here are [some hints](https://github.com/rclone/rclone/blob/bc23bf11db1c78c6ebbf8ea538fbebf7058b4176/backend/onedrive/onedrive.go#L86). -### Modification time and hashes +### Modification times and hashes OneDrive allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or @@ -48288,6 +48458,32 @@ your workflow. For all types of OneDrive you can use the \[ga]--checksum\[ga] flag. +### --fast-list + +This remote supports \[ga]--fast-list\[ga] which allows you to use fewer +transactions in exchange for more memory. See the [rclone +docs](https://rclone.org/docs/#fast-list) for more details. + +This must be enabled with the \[ga]--onedrive-delta\[ga] flag (or \[ga]delta = +true\[ga] in the config file) as it can cause performance degradation. + +It does this by using the delta listing facilities of OneDrive which +returns all the files in the remote very efficiently. This is much +more efficient than listing directories recursively and is Microsoft\[aq]s +recommended way of reading all the file information from a drive. + +This can be useful with \[ga]rclone mount\[ga] and [rclone rc vfs/refresh +recursive=true](https://rclone.org/rc/#vfs-refresh)) to very quickly fill the mount with +information about all the files. + +The API used for the recursive listing (\[ga]ListR\[ga]) only supports listing +from the root of the drive. This will become increasingly inefficient +the further away you get from the root as rclone will have to discard +files outside of the directory you are using. + +Some commands (like \[ga]rclone lsf -R\[ga]) will use \[ga]ListR\[ga] by default - you +can turn this off with \[ga]--disable ListR\[ga] if you need to. + ### Restricted filename characters In addition to the [default restricted characters set](https://rclone.org/overview/#restricted-characters) @@ -48699,6 +48895,43 @@ Properties: - Type: bool - Default: false +#### --onedrive-delta + +If set rclone will use delta listing to implement recursive listings. + +If this flag is set the the onedrive backend will advertise \[ga]ListR\[ga] +support for recursive listings. + +Setting this flag speeds up these things greatly: + + rclone lsf -R onedrive: + rclone size onedrive: + rclone rc vfs/refresh recursive=true + +**However** the delta listing API **only** works at the root of the +drive. If you use it not at the root then it recurses from the root +and discards all the data that is not under the directory you asked +for. So it will be correct but may not be very efficient. + +This is why this flag is not set as the default. + +As a rule of thumb if nearly all of your data is under rclone\[aq]s root +directory (the \[ga]root/directory\[ga] in \[ga]onedrive:root/directory\[ga]) then +using this flag will be be a big performance win. If your data is +mostly not under the root then using this flag will be a big +performance loss. + +It is recommended if you are mounting your onedrive at the root +(or near the root when using crypt) and using rclone \[ga]rc vfs/refresh\[ga]. + + +Properties: + +- Config: delta +- Env Var: RCLONE_ONEDRIVE_DELTA +- Type: bool +- Default: false + #### --onedrive-encoding The encoding for the backend. @@ -48709,7 +48942,7 @@ Properties: - Config: encoding - Env Var: RCLONE_ONEDRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8,Dot @@ -49006,12 +49239,14 @@ To copy a local directory to an OpenDrive directory called backup rclone copy /home/source remote:backup -### Modified time and MD5SUMs +### Modification times and hashes OpenDrive allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or not. +The MD5 hash algorithm is supported. + ### Restricted filename characters | Character | Value | Replacement | @@ -49085,7 +49320,7 @@ Properties: - Config: encoding - Env Var: RCLONE_OPENDRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,LeftSpace,LeftCrLfHtVt,RightSpace,RightCrLfHtVt,InvalidUtf8,Dot #### --opendrive-chunk-size @@ -49264,6 +49499,7 @@ Rclone supports the following OCI authentication provider. No authentication ### User Principal + Sample rclone config file for Authentication Provider User Principal: [oos] @@ -49284,6 +49520,7 @@ Considerations: - If the user is deleted, the config file will no longer work and may cause automation regressions that use the user\[aq]s credentials. ### Instance Principal + An OCI compute instance can be authorized to use rclone by using it\[aq]s identity and certificates as an instance principal. With this approach no credentials have to be stored and managed. @@ -49313,6 +49550,7 @@ Considerations: - It is applicable for oci compute instances only. It cannot be used on external instance or resources. ### Resource Principal + Resource principal auth is very similar to instance principal auth but used for resources that are not compute instances such as [serverless functions](https://docs.oracle.com/en-us/iaas/Content/Functions/Concepts/functionsoverview.htm). To use resource principal ensure Rclone process is started with these environment variables set in its process. @@ -49332,6 +49570,7 @@ Sample rclone configuration file for Authentication Provider Resource Principal: provider = resource_principal_auth ### No authentication + Public buckets do not require any authentication mechanism to read objects. Sample rclone configuration file for No authentication: @@ -49342,10 +49581,9 @@ Sample rclone configuration file for No authentication: region = us-ashburn-1 provider = no_auth -## Options -### Modified time +### Modification times and hashes -The modified time is stored as metadata on the object as +The modification time is stored as metadata on the object as \[ga]opc-meta-mtime\[ga] as floating point since the epoch, accurate to 1 ns. If the modification time needs to be updated rclone will attempt to perform a server @@ -49355,6 +49593,8 @@ In the case the object is larger than 5Gb, the object will be uploaded rather th Note that reading this from the object takes an additional \[ga]HEAD\[ga] request as the metadata isn\[aq]t returned in object listings. +The MD5 hash algorithm is supported. + ### Multipart uploads rclone supports multipart uploads with OOS which means that it can @@ -49657,7 +49897,7 @@ Properties: - Config: encoding - Env Var: RCLONE_OOS_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,InvalidUtf8,Dot #### --oos-leave-parts-on-error @@ -50161,7 +50401,7 @@ Properties: - Config: encoding - Env Var: RCLONE_QINGSTOR_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Ctl,InvalidUtf8 @@ -50284,7 +50524,7 @@ y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y \[ga]\[ga]\[ga] T} T{ -### Modified time and hashes +### Modification times and hashes T} T{ Quatrix allows modification times to be set on objects accurate to 1 @@ -50390,8 +50630,8 @@ T{ Properties: T} T{ -- Config: encoding - Env Var: RCLONE_QUATRIX_ENCODING - Type: -MultiEncoder - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot +- Config: encoding - Env Var: RCLONE_QUATRIX_ENCODING - Type: Encoding - +Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot T} T{ #### --quatrix-effective-upload-time @@ -50672,7 +50912,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SIA_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,Question,Hash,Percent,Del,Ctl,InvalidUtf8,Dot @@ -50864,7 +51104,7 @@ sufficient to determine if it is \[dq]dirty\[dq]. By using \[ga]--update\[ga] al \[ga]--use-server-modtime\[ga], you can avoid the extra API call and simply upload files whose local modtime is newer than the time it was last uploaded. -### Modified time +### Modification times and hashes The modified time is stored as metadata on the object as \[ga]X-Object-Meta-Mtime\[ga] as floating point since the epoch accurate to 1 @@ -50873,6 +51113,8 @@ ns. This is a de facto standard (used in the official python-swiftclient amongst others) for storing the modification time for an object. +The MD5 hash algorithm is supported. + ### Restricted filename characters | Character | Value | Replacement | @@ -51219,7 +51461,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SWIFT_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,InvalidUtf8 @@ -51331,7 +51573,7 @@ To copy a local directory to a pCloud directory called backup rclone copy /home/source remote:backup -### Modified time and hashes ### +### Modification times and hashes pCloud allows modification times to be set on objects accurate to 1 second. These will be used to detect whether objects need syncing or @@ -51470,7 +51712,7 @@ Properties: - Config: encoding - Env Var: RCLONE_PCLOUD_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot #### --pcloud-root-folder-id @@ -51588,6 +51830,13 @@ y/e/d> y .IP .nf \f[C] +### Modification times and hashes + +PikPak keeps modification times on objects, and updates them when uploading objects, +but it does not support changing only the modification time + +The MD5 hash algorithm is supported. + ### Standard options @@ -51747,7 +51996,7 @@ Properties: - Config: encoding - Env Var: RCLONE_PIKPAK_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,RightSpace,RightPeriod,InvalidUtf8,Dot ## Backend commands @@ -51811,15 +52060,16 @@ Result: -## Limitations ## +## Limitations -### Hashes ### +### Hashes may be empty PikPak supports MD5 hash, but sometimes given empty especially for user-uploaded files. -### Deleted files ### +### Deleted files still visible with trashed-only -Deleted files will still be visible with \[ga]--pikpak-trashed-only\[ga] even after the trash emptied. This goes away after few days. +Deleted files will still be visible with \[ga]--pikpak-trashed-only\[ga] even after the +trash emptied. This goes away after few days. # premiumize.me @@ -51889,7 +52139,7 @@ To copy a local directory to an premiumize.me directory called backup rclone copy /home/source remote:backup -### Modified time and hashes +### Modification times and hashes premiumize.me does not support modification times or hashes, therefore syncing will default to \[ga]--size-only\[ga] checking. Note that using @@ -52004,7 +52254,7 @@ Properties: - Config: encoding - Env Var: RCLONE_PREMIUMIZEME_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,DoubleQuote,BackSlash,Del,Ctl,InvalidUtf8,Dot @@ -52088,10 +52338,12 @@ To copy a local directory to an Proton Drive directory called backup rclone copy /home/source remote:backup -### Modified time +### Modification times and hashes Proton Drive Bridge does not support updating modification times yet. +The SHA1 hash algorithm is supported. + ### Restricted filename characters Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), also left and @@ -52237,7 +52489,7 @@ Properties: - Config: encoding - Env Var: RCLONE_PROTONDRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LeftSpace,RightSpace,InvalidUtf8,Dot #### --protondrive-original-file-size @@ -52530,7 +52782,7 @@ Properties: - Config: encoding - Env Var: RCLONE_PUTIO_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot @@ -52612,10 +52864,12 @@ To copy a local directory to an Proton Drive directory called backup rclone copy /home/source remote:backup -### Modified time +### Modification times and hashes Proton Drive Bridge does not support updating modification times yet. +The SHA1 hash algorithm is supported. + ### Restricted filename characters Invalid UTF-8 bytes will be [replaced](https://rclone.org/overview/#invalid-utf8), also left and @@ -52761,7 +53015,7 @@ Properties: - Config: encoding - Env Var: RCLONE_PROTONDRIVE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,LeftSpace,RightSpace,InvalidUtf8,Dot #### --protondrive-original-file-size @@ -53204,7 +53458,7 @@ Properties: - Config: encoding - Env Var: RCLONE_SEAFILE_ENCODING -- Type: MultiEncoder +- Type: Encoding - Default: Slash,DoubleQuote,BackSlash,Ctl,InvalidUtf8 @@ -53586,7 +53840,7 @@ Set the configuration option \f[C]disable_hashcheck\f[R] to \f[C]true\f[R] to disable checksumming entirely, or set \f[C]shell_type\f[R] to \f[C]none\f[R] to disable all functionality based on remote shell command execution. -.SS Modified time +.SS Modification times and hashes .PP Modified times are stored on the server to 1 second precision. .PP @@ -54434,6 +54688,34 @@ Env Var: RCLONE_SFTP_SOCKS_PROXY Type: string .IP \[bu] 2 Required: false +.SS --sftp-copy-is-hardlink +.PP +Set to enable server side copies using hardlinks. +.PP +The SFTP protocol does not define a copy command so normally server side +copies are not allowed with the sftp backend. +.PP +However the SFTP protocol does support hardlinking, and if you enable +this flag then the sftp backend will support server side copies. +These will be implemented by doing a hardlink from the source to the +destination. +.PP +Not all sftp servers support this. +.PP +Note that hardlinking two files together will use no additional space as +the source and the destination will be the same file. +.PP +This feature may be useful backups made with --copy-dest. +.PP +Properties: +.IP \[bu] 2 +Config: copy_is_hardlink +.IP \[bu] 2 +Env Var: RCLONE_SFTP_COPY_IS_HARDLINK +.IP \[bu] 2 +Type: bool +.IP \[bu] 2 +Default: false .SS Limitations .PP On some SFTP servers (e.g. @@ -54755,7 +55037,7 @@ Config: encoding .IP \[bu] 2 Env Var: RCLONE_SMB_ENCODING .IP \[bu] 2 -Type: MultiEncoder +Type: Encoding .IP \[bu] 2 Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,RightSpace,RightPeriod,InvalidUtf8,Dot @@ -55483,7 +55765,7 @@ Paths may be as deep as required, e.g. \f[B]NB\f[R] you can\[aq]t create files in the top level folder you have to create a folder, which rclone will create as a \[dq]Sync Folder\[dq] with SugarSync. -.SS Modified time and hashes +.SS Modification times and hashes .PP SugarSync does not support modification times or hashes, therefore syncing will default to \f[C]--size-only\f[R] checking. @@ -55673,7 +55955,7 @@ Config: encoding .IP \[bu] 2 Env Var: RCLONE_SUGARSYNC_ENCODING .IP \[bu] 2 -Type: MultiEncoder +Type: Encoding .IP \[bu] 2 Default: Slash,Ctl,InvalidUtf8,Dot .SS Limitations @@ -55791,7 +56073,7 @@ To copy a local directory to an Uptobox directory called backup rclone copy /home/source remote:backup \f[R] .fi -.SS Modified time and hashes +.SS Modification times and hashes .PP Uptobox supports neither modified times nor checksums. All timestamps will read as that set by \f[C]--default-time\f[R]. @@ -55878,7 +56160,7 @@ Config: encoding .IP \[bu] 2 Env Var: RCLONE_UPTOBOX_ENCODING .IP \[bu] 2 -Type: MultiEncoder +Type: Encoding .IP \[bu] 2 Default: Slash,LtGt,DoubleQuote,BackQuote,Del,Ctl,LeftSpace,InvalidUtf8,Dot @@ -55898,8 +56180,8 @@ During the initial setup with \f[C]rclone config\f[R] you will specify the upstream remotes as a space separated list. The upstream remotes can either be a local paths or other remotes. .PP -The attributes \f[C]:ro\f[R], \f[C]:nc\f[R] and \f[C]:nc\f[R] can be -attached to the end of the remote to tag the remote as \f[B]read +The attributes \f[C]:ro\f[R], \f[C]:nc\f[R] and \f[C]:writeback\f[R] can +be attached to the end of the remote to tag the remote as \f[B]read only\f[R], \f[B]no create\f[R] or \f[B]writeback\f[R], e.g. \f[C]remote:directory/subdirectory:ro\f[R] or \f[C]remote:directory/subdirectory:nc\f[R]. @@ -56452,7 +56734,9 @@ Choose a number from below, or type in your own value \[rs] (sharepoint) 5 / Sharepoint with NTLM authentication, usually self-hosted or on-premises \[rs] (sharepoint-ntlm) - 6 / Other site/service or software + 6 / rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol + \[rs] (rclone) + 7 / Other site/service or software \[rs] (other) vendor> 2 User name @@ -56510,7 +56794,7 @@ To copy a local directory to an WebDAV directory called backup rclone copy /home/source remote:backup \f[R] .fi -.SS Modified time and hashes +.SS Modification times and hashes .PP Plain WebDAV does not support modified times. However when used with Fastmail Files, Owncloud or Nextcloud rclone will @@ -56588,6 +56872,12 @@ Sharepoint Online, authenticated by Microsoft account Sharepoint with NTLM authentication, usually self-hosted or on-premises .RE .IP \[bu] 2 +\[dq]rclone\[dq] +.RS 2 +.IP \[bu] 2 +rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol +.RE +.IP \[bu] 2 \[dq]other\[dq] .RS 2 .IP \[bu] 2 @@ -56857,6 +57147,14 @@ datetime property to compare your documents: --ignore-size --ignore-checksum --update \f[R] .fi +.SS Rclone +.PP +Use this option if you are hosting remotes over WebDAV provided by +rclone. +Read rclone serve webdav for more details. +.PP +rclone serve supports modified times using the \f[C]X-OC-Mtime\f[R] +header. .SS dCache .PP dCache is a storage system that supports many protocols and @@ -57052,14 +57350,13 @@ rclone sync --interactive /home/local/directory remote:directory .PP Yandex paths may be as deep as required, e.g. \f[C]remote:directory/subdirectory\f[R]. -.SS Modified time +.SS Modification times and hashes .PP Modified times are supported and are stored accurate to 1 ns in custom metadata called \f[C]rclone_modified\f[R] in RFC3339 with nanoseconds format. -.SS MD5 checksums .PP -MD5 checksums are natively supported by Yandex Disk. +The MD5 hash algorithm is natively supported by Yandex Disk. .SS Emptying Trash .PP If you wish to empty your trash you can use the @@ -57184,7 +57481,7 @@ Config: encoding .IP \[bu] 2 Env Var: RCLONE_YANDEX_ENCODING .IP \[bu] 2 -Type: MultiEncoder +Type: Encoding .IP \[bu] 2 Default: Slash,Del,Ctl,InvalidUtf8,Dot .SS Limitations @@ -57339,12 +57636,11 @@ rclone sync --interactive /home/local/directory remote:directory .PP Zoho paths may be as deep as required, eg \f[C]remote:directory/subdirectory\f[R]. -.SS Modified time +.SS Modification times and hashes .PP Modified times are currently not supported for Zoho Workdrive -.SS Checksums .PP -No checksums are supported. +No hash algorithms are supported. .SS Usage information .PP To view your current quota you can use the @@ -57504,7 +57800,7 @@ Config: encoding .IP \[bu] 2 Env Var: RCLONE_ZOHO_ENCODING .IP \[bu] 2 -Type: MultiEncoder +Type: Encoding .IP \[bu] 2 Default: Del,Ctl,InvalidUtf8 .SS Setting up your own client_id @@ -57540,10 +57836,10 @@ For consistencies sake one can also configure a remote of type \f[C]local\f[R] in the config file, and access the local filesystem using rclone remote paths, e.g. \f[C]remote:path/to/wherever\f[R], but it is probably easier not to. -.SS Modified time +.SS Modification times .PP -Rclone reads and writes the modified time using an accuracy determined -by the OS. +Rclone reads and writes the modification times using an accuracy +determined by the OS. Typically this is 1ns on Linux, 10 ns on Windows and 1 Second on OS X. .SS Filenames .PP @@ -58350,6 +58646,13 @@ Only checksum the size that stat gave .IP \[bu] 2 Don\[aq]t update the stat info for the file .PP +\f[B]NB\f[R] do not use this flag on a Windows Volume Shadow (VSS). +For some unknown reason, files in a VSS sometimes show different sizes +from the directory listing (where the initial stat value comes from on +Windows) and when stat is called on them directly. +Other copy tools always use the direct stat value and setting this flag +will disable that. +.PP Properties: .IP \[bu] 2 Config: no_check_updated @@ -58478,7 +58781,7 @@ Config: encoding .IP \[bu] 2 Env Var: RCLONE_LOCAL_ENCODING .IP \[bu] 2 -Type: MultiEncoder +Type: Encoding .IP \[bu] 2 Default: Slash,Dot .SS Metadata @@ -58628,6 +58931,408 @@ Options: .IP \[bu] 2 \[dq]error\[dq]: return an error based on option value .SH Changelog +.SS v1.65.0 - 2023-11-26 +.PP +See commits (https://github.com/rclone/rclone/compare/v1.64.0...v1.65.0) +.IP \[bu] 2 +New backends +.RS 2 +.IP \[bu] 2 +Azure Files (karan, moongdal, Nick Craig-Wood) +.IP \[bu] 2 +ImageKit (Abhinav Dhiman) +.IP \[bu] 2 +Linkbox (viktor, Nick Craig-Wood) +.RE +.IP \[bu] 2 +New commands +.RS 2 +.IP \[bu] 2 +\f[C]serve s3\f[R]: Let rclone act as an S3 compatible server (Mikubill, +Artur Neumann, Saw-jan, Nick Craig-Wood) +.IP \[bu] 2 +\f[C]nfsmount\f[R]: mount command to provide mount mechanism on macOS +without FUSE (Saleh Dindar) +.IP \[bu] 2 +\f[C]serve nfs\f[R]: to serve a remote for use by \f[C]nfsmount\f[R] +(Saleh Dindar) +.RE +.IP \[bu] 2 +New Features +.RS 2 +.IP \[bu] 2 +install.sh: Clean up temp files in install script (Jacob Hands) +.IP \[bu] 2 +build +.RS 2 +.IP \[bu] 2 +Update all dependencies (Nick Craig-Wood) +.IP \[bu] 2 +Refactor version info and icon resource handling on windows (albertony) +.RE +.IP \[bu] 2 +doc updates (albertony, alfish2000, asdffdsazqqq, Dimitri Papadopoulos, +Herby Gillot, Joda St\[:o]\[ss]er, Manoj Ghosh, Nick Craig-Wood) +.IP \[bu] 2 +Implement \f[C]--metadata-mapper\f[R] to transform metatadata with a +user supplied program (Nick Craig-Wood) +.IP \[bu] 2 +Add \f[C]ChunkWriterDoesntSeek\f[R] feature flag and set it for b2 (Nick +Craig-Wood) +.IP \[bu] 2 +lib/http: Export basic go string functions for use in +\f[C]--template\f[R] (Gabriel Espinoza) +.IP \[bu] 2 +makefile: Use POSIX compatible install arguments (Mina Gali\['c]) +.IP \[bu] 2 +operations +.RS 2 +.IP \[bu] 2 +Use less memory when doing multithread uploads (Nick Craig-Wood) +.IP \[bu] 2 +Implement \f[C]--partial-suffix\f[R] to control extension of temporary +file names (Volodymyr) +.RE +.IP \[bu] 2 +rc +.RS 2 +.IP \[bu] 2 +Add \f[C]operations/check\f[R] to the rc API (Nick Craig-Wood) +.IP \[bu] 2 +Always report an error as JSON (Nick Craig-Wood) +.IP \[bu] 2 +Set \f[C]Last-Modified\f[R] header for files served by +\f[C]--rc-serve\f[R] (Nikita Shoshin) +.RE +.IP \[bu] 2 +size: Dont show duplicate object count when less than 1k (albertony) +.RE +.IP \[bu] 2 +Bug Fixes +.RS 2 +.IP \[bu] 2 +fshttp: Fix \f[C]--contimeout\f[R] being ignored +(\[u4F60]\[u77E5]\[u9053]\[u672A]\[u6765]\[u5417]) +.IP \[bu] 2 +march: Fix excessive parallelism when using \f[C]--no-traverse\f[R] +(Nick Craig-Wood) +.IP \[bu] 2 +ncdu: Fix crash when re-entering changed directory after rescan (Nick +Craig-Wood) +.IP \[bu] 2 +operations +.RS 2 +.IP \[bu] 2 +Fix overwrite of destination when multi-thread transfer fails (Nick +Craig-Wood) +.IP \[bu] 2 +Fix invalid UTF-8 when truncating file names when not using +\f[C]--inplace\f[R] (Nick Craig-Wood) +.RE +.IP \[bu] 2 +serve dnla: Fix crash on graceful exit (wuxingzhong) +.RE +.IP \[bu] 2 +Mount +.RS 2 +.IP \[bu] 2 +Disable mount for freebsd and alias cmount as mount on that platform +(Nick Craig-Wood) +.RE +.IP \[bu] 2 +VFS +.RS 2 +.IP \[bu] 2 +Add \f[C]--vfs-refresh\f[R] flag to read all the directories on start +(Beyond Meat) +.IP \[bu] 2 +Implement Name() method in WriteFileHandle and ReadFileHandle (Saleh +Dindar) +.IP \[bu] 2 +Add go-billy dependency and make sure vfs.Handle implements billy.File +(Saleh Dindar) +.IP \[bu] 2 +Error out early if can\[aq]t upload 0 length file (Nick Craig-Wood) +.RE +.IP \[bu] 2 +Local +.RS 2 +.IP \[bu] 2 +Fix copying from Windows Volume Shadows (Nick Craig-Wood) +.RE +.IP \[bu] 2 +Azure Blob +.RS 2 +.IP \[bu] 2 +Add support for cold tier (Ivan Yanitra) +.RE +.IP \[bu] 2 +B2 +.RS 2 +.IP \[bu] 2 +Implement \[dq]rclone backend lifecycle\[dq] to read and set bucket +lifecycles (Nick Craig-Wood) +.IP \[bu] 2 +Implement \f[C]--b2-lifecycle\f[R] to control lifecycle when creating +buckets (Nick Craig-Wood) +.IP \[bu] 2 +Fix listing all buckets when not needed (Nick Craig-Wood) +.IP \[bu] 2 +Fix multi-thread upload with copyto going to wrong name (Nick +Craig-Wood) +.IP \[bu] 2 +Fix server side chunked copy when file size was exactly +\f[C]--b2-copy-cutoff\f[R] (Nick Craig-Wood) +.IP \[bu] 2 +Fix streaming chunked files an exact multiple of chunk size (Nick +Craig-Wood) +.RE +.IP \[bu] 2 +Box +.RS 2 +.IP \[bu] 2 +Filter more EventIDs when polling (David Sze) +.IP \[bu] 2 +Add more logging for polling (David Sze) +.IP \[bu] 2 +Fix performance problem reading metadata for single files (Nick +Craig-Wood) +.RE +.IP \[bu] 2 +Drive +.RS 2 +.IP \[bu] 2 +Add read/write metadata support (Nick Craig-Wood) +.IP \[bu] 2 +Add support for SHA-1 and SHA-256 checksums (rinsuki) +.IP \[bu] 2 +Add \f[C]--drive-show-all-gdocs\f[R] to allow unexportable gdocs to be +server side copied (Nick Craig-Wood) +.IP \[bu] 2 +Add a note that \f[C]--drive-scope\f[R] accepts comma-separated list of +scopes (Keigo Imai) +.IP \[bu] 2 +Fix error updating created time metadata on existing object (Nick +Craig-Wood) +.IP \[bu] 2 +Fix integration tests by enabling metadata support from the context +(Nick Craig-Wood) +.RE +.IP \[bu] 2 +Dropbox +.RS 2 +.IP \[bu] 2 +Factor batcher into lib/batcher (Nick Craig-Wood) +.IP \[bu] 2 +Fix missing encoding for rclone purge (Nick Craig-Wood) +.RE +.IP \[bu] 2 +Google Cloud Storage +.RS 2 +.IP \[bu] 2 +Fix 400 Bad request errors when using multi-thread copy (Nick +Craig-Wood) +.RE +.IP \[bu] 2 +Googlephotos +.RS 2 +.IP \[bu] 2 +Implement batcher for uploads (Nick Craig-Wood) +.RE +.IP \[bu] 2 +Hdfs +.RS 2 +.IP \[bu] 2 +Added support for list of namenodes in hdfs remote config +(Tayo-pasedaRJ) +.RE +.IP \[bu] 2 +HTTP +.RS 2 +.IP \[bu] 2 +Implement set backend command to update running backend (Nick +Craig-Wood) +.IP \[bu] 2 +Enable methods used with WebDAV (Alen \[vS]iljak) +.RE +.IP \[bu] 2 +Jottacloud +.RS 2 +.IP \[bu] 2 +Add support for reading and writing metadata (albertony) +.RE +.IP \[bu] 2 +Onedrive +.RS 2 +.IP \[bu] 2 +Implement ListR method which gives \f[C]--fast-list\f[R] support (Nick +Craig-Wood) +.RS 2 +.IP \[bu] 2 +This must be enabled with the \f[C]--onedrive-delta\f[R] flag +.RE +.RE +.IP \[bu] 2 +Quatrix +.RS 2 +.IP \[bu] 2 +Add partial upload support (Oksana Zhykina) +.IP \[bu] 2 +Overwrite files on conflict during server-side move (Oksana Zhykina) +.RE +.IP \[bu] 2 +S3 +.RS 2 +.IP \[bu] 2 +Add Linode provider (Nick Craig-Wood) +.IP \[bu] 2 +Add docs on how to add a new provider (Nick Craig-Wood) +.IP \[bu] 2 +Fix no error being returned when creating a bucket we don\[aq]t own +(Nick Craig-Wood) +.IP \[bu] 2 +Emit a debug message if anonymous credentials are in use (Nick +Craig-Wood) +.IP \[bu] 2 +Add \f[C]--s3-disable-multipart-uploads\f[R] flag (Nick Craig-Wood) +.IP \[bu] 2 +Detect looping when using gcs and versions (Nick Craig-Wood) +.RE +.IP \[bu] 2 +SFTP +.RS 2 +.IP \[bu] 2 +Implement \f[C]--sftp-copy-is-hardlink\f[R] to server side copy as +hardlink (Nick Craig-Wood) +.RE +.IP \[bu] 2 +Smb +.RS 2 +.IP \[bu] 2 +Fix incorrect \f[C]about\f[R] size by switching to +\f[C]github.com/cloudsoda/go-smb2\f[R] fork (Nick Craig-Wood) +.IP \[bu] 2 +Fix modtime of multithread uploads by setting PartialUploads (Nick +Craig-Wood) +.RE +.IP \[bu] 2 +WebDAV +.RS 2 +.IP \[bu] 2 +Added an rclone vendor to work with \f[C]rclone serve webdav\f[R] +(Adithya Kumar) +.RE +.SS v1.64.2 - 2023-10-19 +.PP +See commits (https://github.com/rclone/rclone/compare/v1.64.1...v1.64.2) +.IP \[bu] 2 +Bug Fixes +.RS 2 +.IP \[bu] 2 +selfupdate: Fix \[dq]invalid hashsum signature\[dq] error (Nick +Craig-Wood) +.IP \[bu] 2 +build: Fix docker build running out of space (Nick Craig-Wood) +.RE +.SS v1.64.1 - 2023-10-17 +.PP +See commits (https://github.com/rclone/rclone/compare/v1.64.0...v1.64.1) +.IP \[bu] 2 +Bug Fixes +.RS 2 +.IP \[bu] 2 +cmd: Make \f[C]--progress\f[R] output logs in the same format as without +(Nick Craig-Wood) +.IP \[bu] 2 +docs fixes (Dimitri Papadopoulos Orfanos, Herby Gillot, Manoj Ghosh, +Nick Craig-Wood) +.IP \[bu] 2 +lsjson: Make sure we set the global metadata flag too (Nick Craig-Wood) +.IP \[bu] 2 +operations +.RS 2 +.IP \[bu] 2 +Ensure concurrency is no greater than the number of chunks (Pat +Patterson) +.IP \[bu] 2 +Fix OpenOptions ignored in copy if operation was a multiThreadCopy +(Vitor Gomes) +.IP \[bu] 2 +Fix error message on delete to have file name (Nick Craig-Wood) +.RE +.IP \[bu] 2 +serve sftp: Return not supported error for not supported commands (Nick +Craig-Wood) +.IP \[bu] 2 +build: Upgrade golang.org/x/net to v0.17.0 to fix HTTP/2 rapid reset +(Nick Craig-Wood) +.IP \[bu] 2 +pacer: Fix b2 deadlock by defaulting max connections to unlimited (Nick +Craig-Wood) +.RE +.IP \[bu] 2 +Mount +.RS 2 +.IP \[bu] 2 +Fix automount not detecting drive is ready (Nick Craig-Wood) +.RE +.IP \[bu] 2 +VFS +.RS 2 +.IP \[bu] 2 +Fix update dir modification time (Saleh Dindar) +.RE +.IP \[bu] 2 +Azure Blob +.RS 2 +.IP \[bu] 2 +Fix \[dq]fatal error: concurrent map writes\[dq] (Nick Craig-Wood) +.RE +.IP \[bu] 2 +B2 +.RS 2 +.IP \[bu] 2 +Fix multipart upload: corrupted on transfer: sizes differ XXX vs 0 (Nick +Craig-Wood) +.IP \[bu] 2 +Fix locking window when getting mutipart upload URL (Nick Craig-Wood) +.IP \[bu] 2 +Fix server side copies greater than 4GB (Nick Craig-Wood) +.IP \[bu] 2 +Fix chunked streaming uploads (Nick Craig-Wood) +.IP \[bu] 2 +Reduce default \f[C]--b2-upload-concurrency\f[R] to 4 to reduce memory +usage (Nick Craig-Wood) +.RE +.IP \[bu] 2 +Onedrive +.RS 2 +.IP \[bu] 2 +Fix the configurator to allow \f[C]/teams/ID\f[R] in the config (Nick +Craig-Wood) +.RE +.IP \[bu] 2 +Oracleobjectstorage +.RS 2 +.IP \[bu] 2 +Fix OpenOptions being ignored in uploadMultipart with chunkWriter (Nick +Craig-Wood) +.RE +.IP \[bu] 2 +S3 +.RS 2 +.IP \[bu] 2 +Fix slice bounds out of range error when listing (Nick Craig-Wood) +.IP \[bu] 2 +Fix OpenOptions being ignored in uploadMultipart with chunkWriter (Vitor +Gomes) +.RE +.IP \[bu] 2 +Storj +.RS 2 +.IP \[bu] 2 +Update storj.io/uplink to v1.12.0 (Kaloyan Raev) +.RE .SS v1.64.0 - 2023-09-11 .PP See commits (https://github.com/rclone/rclone/compare/v1.63.0...v1.64.0) @@ -58913,7 +59618,7 @@ Hdfs Retry \[dq]replication in progress\[dq] errors when uploading (Nick Craig-Wood) .IP \[bu] 2 -Fix uploading to the wrong object on Update with overriden remote name +Fix uploading to the wrong object on Update with overridden remote name (Nick Craig-Wood) .RE .IP \[bu] 2 @@ -58934,7 +59639,7 @@ Fix List on a just deleted and remade directory (Nick Craig-Wood) Oracleobjectstorage .RS 2 .IP \[bu] 2 -Use rclone\[aq]s rate limiter in mutipart transfers (Manoj Ghosh) +Use rclone\[aq]s rate limiter in multipart transfers (Manoj Ghosh) .IP \[bu] 2 Implement \f[C]OpenChunkWriter\f[R] and multi-thread uploads (Manoj Ghosh) @@ -59427,7 +60132,7 @@ Report any list errors during \f[C]rclone cleanup\f[R] (albertony) Putio .RS 2 .IP \[bu] 2 -Fix uploading to the wrong object on Update with overriden remote name +Fix uploading to the wrong object on Update with overridden remote name (Nick Craig-Wood) .IP \[bu] 2 Fix modification times not being preserved for server side copy and move @@ -59445,7 +60150,7 @@ Update Scaleway storage classes (Brian Starkey) .IP \[bu] 2 Fix \f[C]--s3-versions\f[R] on individual objects (Nick Craig-Wood) .IP \[bu] 2 -Fix hang on aborting multpart upload with iDrive e2 (Nick Craig-Wood) +Fix hang on aborting multipart upload with iDrive e2 (Nick Craig-Wood) .IP \[bu] 2 Fix missing \[dq]tier\[dq] metadata (Nick Craig-Wood) .IP \[bu] 2 @@ -59493,7 +60198,7 @@ Storj Fix \[dq]uplink: too many requests\[dq] errors when uploading to the same file (Nick Craig-Wood) .IP \[bu] 2 -Fix uploading to the wrong object on Update with overriden remote name +Fix uploading to the wrong object on Update with overridden remote name (Nick Craig-Wood) .RE .IP \[bu] 2 @@ -69309,7 +70014,7 @@ Wang) Mount .RS 2 .IP \[bu] 2 -Re-use \f[C]rcat\f[R] internals to support uploads from all remotes +Reuse \f[C]rcat\f[R] internals to support uploads from all remotes .RE .IP \[bu] 2 Dropbox @@ -72569,7 +73274,7 @@ Jonta <359397+Jonta@users.noreply.github.com> .IP \[bu] 2 YenForYang .IP \[bu] 2 -Joda St\[:o]\[ss]er +SimJoSt / Joda St\[:o]\[ss]er .IP \[bu] 2 Logeshwaran .IP \[bu] 2 @@ -73066,6 +73771,70 @@ Volodymyr Kit David Pedersen .IP \[bu] 2 Drew Stinnett +.IP \[bu] 2 +Pat Patterson +.IP \[bu] 2 +Herby Gillot +.IP \[bu] 2 +Nikita Shoshin +.IP \[bu] 2 +rinsuki <428rinsuki+git@gmail.com> +.IP \[bu] 2 +Beyond Meat <51850644+beyondmeat@users.noreply.github.com> +.IP \[bu] 2 +Saleh Dindar +.IP \[bu] 2 +Volodymyr <142890760+vkit-maytech@users.noreply.github.com> +.IP \[bu] 2 +Gabriel Espinoza <31670639+gspinoza@users.noreply.github.com> +.IP \[bu] 2 +Keigo Imai +.IP \[bu] 2 +Ivan Yanitra +.IP \[bu] 2 +alfish2000 +.IP \[bu] 2 +wuxingzhong +.IP \[bu] 2 +Adithya Kumar +.IP \[bu] 2 +Tayo-pasedaRJ <138471223+Tayo-pasedaRJ@users.noreply.github.com> +.IP \[bu] 2 +Peter Kreuser +.IP \[bu] 2 +Piyush +.IP \[bu] 2 +fotile96 +.IP \[bu] 2 +Luc Ritchie +.IP \[bu] 2 +cynful +.IP \[bu] 2 +wjielai +.IP \[bu] 2 +Jack Deng +.IP \[bu] 2 +Mikubill <31246794+Mikubill@users.noreply.github.com> +.IP \[bu] 2 +Artur Neumann +.IP \[bu] 2 +Saw-jan +.IP \[bu] 2 +Oksana Zhykina +.IP \[bu] 2 +karan +.IP \[bu] 2 +viktor +.IP \[bu] 2 +moongdal +.IP \[bu] 2 +Mina Gali\['c] +.IP \[bu] 2 +Alen \[vS]iljak +.IP \[bu] 2 +\[u4F60]\[u77E5]\[u9053]\[u672A]\[u6765]\[u5417] +.IP \[bu] 2 +Abhinav Dhiman <8640877+ahnv@users.noreply.github.com> .SH Contact the rclone project .SS Forum .PP From 85f142a206f83d1d3b03e271ada6509ef6b8c39e Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 26 Nov 2023 17:14:38 +0000 Subject: [PATCH 025/130] Start v1.66.0-DEV development --- VERSION | 2 +- docs/layouts/partials/version.html | 2 +- fs/versiontag.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 483a6500f21c2..0cff9236f8046 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v1.65.0 +v1.66.0 diff --git a/docs/layouts/partials/version.html b/docs/layouts/partials/version.html index d7303a711a4d1..a92802b0dbec5 100644 --- a/docs/layouts/partials/version.html +++ b/docs/layouts/partials/version.html @@ -1 +1 @@ -v1.65.0 \ No newline at end of file +v1.66.0 \ No newline at end of file diff --git a/fs/versiontag.go b/fs/versiontag.go index f9a696e2d1988..4d9e5d4ba55f9 100644 --- a/fs/versiontag.go +++ b/fs/versiontag.go @@ -1,4 +1,4 @@ package fs // VersionTag of rclone -var VersionTag = "v1.65.0" +var VersionTag = "v1.66.0" From 96f8b7c827261200dad7d7d786f6778cb87e0992 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 28 Nov 2023 19:08:49 +0000 Subject: [PATCH 026/130] install.sh: fix harmless error message on install This was caused by trying to write to a non existent file, and changing the order of the cleanup fixed it. https://forum.rclone.org/t/rclone-v1-65-0-release/43100/18 --- docs/content/install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/content/install.sh b/docs/content/install.sh index 302882d824204..075e6deef42d4 100755 --- a/docs/content/install.sh +++ b/docs/content/install.sh @@ -193,12 +193,12 @@ case "$OS" in exit 2 esac -#cleanup -rm -rf "$tmp_dir" - #update version variable post install version=$(rclone --version 2>>errors | head -n 1) +#cleanup +rm -rf "$tmp_dir" + printf "\n${version} has successfully installed." printf '\nNow run "rclone config" for setup. Check https://rclone.org/docs/ for more details.\n\n' exit 0 From 9bfbf2a4ae58d606d5d9badf68588eef7e718ba3 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 28 Nov 2023 19:42:00 +0000 Subject: [PATCH 027/130] mount: fix macOS not noticing errors with --daemon See: https://forum.rclone.org/t/rclone-mount-daemon-exits-successfully-even-when-mount-fails/43146 --- cmd/mountlib/mount.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/mountlib/mount.go b/cmd/mountlib/mount.go index 4bc9e066a9e83..558a7b2413171 100644 --- a/cmd/mountlib/mount.go +++ b/cmd/mountlib/mount.go @@ -10,6 +10,7 @@ import ( "runtime" "strings" "sync" + "syscall" "time" "github.com/rclone/rclone/cmd" @@ -222,6 +223,13 @@ func NewMountCommand(commandName string, hidden bool, mount MountFn) *cobra.Comm err = WaitMountReady(mnt.MountPoint, Opt.DaemonWait) if err != nil { killDaemon("Daemon timed out") + } else { + // Double check daemon is still alive + // on non Linux OSes WaitMountReady is just a no-op + err = daemon.Signal(syscall.Signal(0)) + if err != nil { + err = fmt.Errorf("daemon has died: %w", err) + } } atexit.Unregister(handle) } From 4d4f3de5a5f8f76567f8b299e368de8378c64eb0 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 8 Nov 2023 15:29:23 +0000 Subject: [PATCH 028/130] s3: add --s3-version-deleted to show delete markers in listings when using versions. See: https://forum.rclone.org/t/s3-object-deletion-times/42781 --- backend/s3/s3.go | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/backend/s3/s3.go b/backend/s3/s3.go index 8f690b38dc1f8..979423883fddc 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -2426,6 +2426,19 @@ See [the time option docs](/docs/#time-option) for valid formats. `, Default: fs.Time{}, Advanced: true, + }, { + Name: "version_deleted", + Help: `Show deleted file markers when using versions. + +This shows deleted file markers in the listing when using versions. These will appear +as 0 size files. The only operation which can be performed on them is deletion. + +Deleting a delete marker will reveal the previous version. + +Deleted files will always show with a timestamp. +`, + Default: false, + Advanced: true, }, { Name: "decompress", Help: `If set this will decompress gzip encoded objects. @@ -2653,6 +2666,7 @@ type Options struct { UsePresignedRequest bool `config:"use_presigned_request"` Versions bool `config:"versions"` VersionAt fs.Time `config:"version_at"` + VersionDeleted bool `config:"version_deleted"` Decompress bool `config:"decompress"` MightGzip fs.Tristate `config:"might_gzip"` UseAcceptEncodingGzip fs.Tristate `config:"use_accept_encoding_gzip"` @@ -3420,6 +3434,7 @@ func (f *Fs) getMetaDataListing(ctx context.Context, wantRemote string) (info *s withVersions: f.opt.Versions, findFile: true, versionAt: f.opt.VersionAt, + hidden: f.opt.VersionDeleted, }, func(gotRemote string, object *s3.Object, objectVersionID *string, isDirectory bool) error { if isDirectory { return nil @@ -3481,6 +3496,10 @@ func (f *Fs) newObjectWithInfo(ctx context.Context, remote string, info *s3.Obje o.bytes = aws.Int64Value(info.Size) o.storageClass = stringClonePointer(info.StorageClass) o.versionID = stringClonePointer(versionID) + // If is delete marker, show that metadata has been read as there is none to read + if info.Size == isDeleteMarker { + o.meta = map[string]string{} + } } else if !o.fs.opt.NoHeadObject { err := o.readMetaData(ctx) // reads info and meta, returning an error if err != nil { @@ -3778,7 +3797,7 @@ func (ls *versionsList) List(ctx context.Context) (resp *s3.ListObjectsV2Output, //structs.SetFrom(obj, objVersion) setFrom_s3Object_s3ObjectVersion(obj, objVersion) // Adjust the file names - if !ls.usingVersionAt && !aws.BoolValue(objVersion.IsLatest) { + if !ls.usingVersionAt && (!aws.BoolValue(objVersion.IsLatest) || objVersion.Size == isDeleteMarker) { if obj.Key != nil && objVersion.LastModified != nil { *obj.Key = version.Add(*obj.Key, *objVersion.LastModified) } @@ -4046,6 +4065,7 @@ func (f *Fs) listDir(ctx context.Context, bucket, directory, prefix string, addB addBucket: addBucket, withVersions: f.opt.Versions, versionAt: f.opt.VersionAt, + hidden: f.opt.VersionDeleted, }, func(remote string, object *s3.Object, versionID *string, isDirectory bool) error { entry, err := f.itemToDirEntry(ctx, remote, object, versionID, isDirectory) if err != nil { @@ -4132,6 +4152,7 @@ func (f *Fs) ListR(ctx context.Context, dir string, callback fs.ListRCallback) ( recurse: true, withVersions: f.opt.Versions, versionAt: f.opt.VersionAt, + hidden: f.opt.VersionDeleted, }, func(remote string, object *s3.Object, versionID *string, isDirectory bool) error { entry, err := f.itemToDirEntry(ctx, remote, object, versionID, isDirectory) if err != nil { @@ -4898,6 +4919,7 @@ func (f *Fs) restoreStatus(ctx context.Context, all bool) (out []restoreStatusOu recurse: true, withVersions: f.opt.Versions, versionAt: f.opt.VersionAt, + hidden: f.opt.VersionDeleted, restoreStatus: true, }, func(remote string, object *s3.Object, versionID *string, isDirectory bool) error { entry, err := f.itemToDirEntry(ctx, remote, object, versionID, isDirectory) From 58339845f43ec5f5aa97abb3006a65b91b33b7c7 Mon Sep 17 00:00:00 2001 From: halms <7513146+halms@users.noreply.github.com> Date: Wed, 29 Nov 2023 02:17:41 +0100 Subject: [PATCH 029/130] smb: fix shares not listed by updating go-smb2 Before this change the IP address of the server was used in the SMB connect request (see CloudSoda/go-smb2#18). The updated library now can pass the hostname instead. The update requires a small change in the dial method call. Fixes rclone#6672 --- backend/smb/connpool.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/smb/connpool.go b/backend/smb/connpool.go index a34e84f291d73..13a8c30420ee3 100644 --- a/backend/smb/connpool.go +++ b/backend/smb/connpool.go @@ -40,7 +40,7 @@ func (f *Fs) dial(ctx context.Context, network, addr string) (*conn, error) { }, } - session, err := d.DialContext(ctx, tconn) + session, err := d.DialConn(ctx, tconn, addr) if err != nil { return nil, err } diff --git a/go.mod b/go.mod index eb5d6ebfea15e..2283640416953 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/atotto/clipboard v0.1.4 github.com/aws/aws-sdk-go v1.46.6 github.com/buengese/sgzip v0.1.1 - github.com/cloudsoda/go-smb2 v0.0.0-20231106205947-b0758ecc4c67 + github.com/cloudsoda/go-smb2 v0.0.0-20231124195312-f3ec8ae2c891 github.com/colinmarc/hdfs/v2 v2.4.0 github.com/coreos/go-semver v0.3.1 github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf diff --git a/go.sum b/go.sum index 0196db684a53a..dd7f7f0bceaa5 100644 --- a/go.sum +++ b/go.sum @@ -133,8 +133,8 @@ github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtM github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/circl v1.3.6 h1:/xbKIqSHbZXHwkhbrhrt2YOHIwYJlXH94E3tI/gDlUg= github.com/cloudflare/circl v1.3.6/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= -github.com/cloudsoda/go-smb2 v0.0.0-20231106205947-b0758ecc4c67 h1:KzZU0EMkUm4vX/jPp5d/VttocDpocL/8QP0zyiI9Xiw= -github.com/cloudsoda/go-smb2 v0.0.0-20231106205947-b0758ecc4c67/go.mod h1:xFxVVe3plxwhM+6BgTTPByEgG8hggo8+gtRUkbc5W8Q= +github.com/cloudsoda/go-smb2 v0.0.0-20231124195312-f3ec8ae2c891 h1:nPP4suUiNage0vvyEBgfAnhTPwwXhNqtHmSuiCIQwKU= +github.com/cloudsoda/go-smb2 v0.0.0-20231124195312-f3ec8ae2c891/go.mod h1:xFxVVe3plxwhM+6BgTTPByEgG8hggo8+gtRUkbc5W8Q= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/colinmarc/hdfs/v2 v2.4.0 h1:v6R8oBx/Wu9fHpdPoJJjpGSUxo8NhHIwrwsfhFvU9W0= github.com/colinmarc/hdfs/v2 v2.4.0/go.mod h1:0NAO+/3knbMx6+5pCv+Hcbaz4xn/Zzbn9+WIib2rKVI= From 9061e8185054a713f0c218b0e33e64993f19a514 Mon Sep 17 00:00:00 2001 From: Manoj Ghosh Date: Tue, 28 Nov 2023 00:14:43 -0800 Subject: [PATCH 030/130] multipart copy create bucket if it doesn't exist. --- backend/oracleobjectstorage/multipart.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/oracleobjectstorage/multipart.go b/backend/oracleobjectstorage/multipart.go index d57a9092a68bc..93c7a9c3d696d 100644 --- a/backend/oracleobjectstorage/multipart.go +++ b/backend/oracleobjectstorage/multipart.go @@ -399,13 +399,17 @@ func (o *Object) prepareUpload(ctx context.Context, src fs.ObjectInfo, options [ func (o *Object) createMultipartUpload(ctx context.Context, putReq *objectstorage.PutObjectRequest) ( uploadID string, existingParts map[int]objectstorage.MultipartUploadPartSummary, err error) { bucketName, bucketPath := o.split() - f := o.fs - if f.opt.AttemptResumeUpload { + err = o.fs.makeBucket(ctx, bucketName) + if err != nil { + fs.Errorf(o, "failed to create bucket: %v, err: %v", bucketName, err) + return uploadID, existingParts, err + } + if o.fs.opt.AttemptResumeUpload { fs.Debugf(o, "attempting to resume upload for %v (if any)", o.remote) resumeUploads, err := o.fs.findLatestMultipartUpload(ctx, bucketName, bucketPath) if err == nil && len(resumeUploads) > 0 { uploadID = *resumeUploads[0].UploadId - existingParts, err = f.listMultipartUploadParts(ctx, bucketName, bucketPath, uploadID) + existingParts, err = o.fs.listMultipartUploadParts(ctx, bucketName, bucketPath, uploadID) if err == nil { fs.Debugf(o, "resuming with existing upload id: %v", uploadID) return uploadID, existingParts, err From 97d7945cef253616ef0048b248f11cce096bc16b Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 1 Dec 2023 09:35:54 +0000 Subject: [PATCH 031/130] Add halms to contributors --- docs/content/authors.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/content/authors.md b/docs/content/authors.md index 447fac7b84d15..191421bebaa7e 100644 --- a/docs/content/authors.md +++ b/docs/content/authors.md @@ -805,3 +805,4 @@ put them back in again.` >}} * Alen Šiljak * 你知道未来吗 * Abhinav Dhiman <8640877+ahnv@users.noreply.github.com> + * halms <7513146+halms@users.noreply.github.com> From caf5dd9d5e4fda9fbb752760d8dcc0127d6a7ed6 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 29 Nov 2023 15:11:11 +0000 Subject: [PATCH 032/130] mount: notice daemon dying much quicker Before this change we waited until until the timeout to check the daemon was alive. Now we check it every 100ms like we do the mount status. This also fixes compiling on all platforms which was broken by the previous change 9bfbf2a4a mount: fix macOS not noticing errors with --daemon See: https://forum.rclone.org/t/rclone-mount-daemon-exits-successfully-even-when-mount-fails/43146 --- cmd/mountlib/check_linux.go | 23 ++----------------- cmd/mountlib/check_other.go | 12 ++-------- cmd/mountlib/mount.go | 42 +++++++++++++++++++++++++++-------- lib/daemonize/daemon_other.go | 12 +++++++--- lib/daemonize/daemon_unix.go | 22 ++++++++++++++++-- 5 files changed, 66 insertions(+), 45 deletions(-) diff --git a/cmd/mountlib/check_linux.go b/cmd/mountlib/check_linux.go index 81e3ccf37a43c..58d839bf53aa8 100644 --- a/cmd/mountlib/check_linux.go +++ b/cmd/mountlib/check_linux.go @@ -7,15 +7,10 @@ import ( "fmt" "path/filepath" "strings" - "time" "github.com/moby/sys/mountinfo" ) -const ( - pollInterval = 100 * time.Millisecond -) - // CheckMountEmpty checks if folder is not already a mountpoint. // On Linux we use the OS-specific /proc/self/mountinfo API so the check won't access the path. // Directories marked as "mounted" by autofs are considered not mounted. @@ -80,19 +75,5 @@ func CheckMountReady(mountpoint string) error { return fmt.Errorf(msg, mountpointAbs) } -// WaitMountReady waits until mountpoint is mounted by rclone. -func WaitMountReady(mountpoint string, timeout time.Duration) (err error) { - endTime := time.Now().Add(timeout) - for { - err = CheckMountReady(mountpoint) - delay := time.Until(endTime) - if err == nil || delay <= 0 { - break - } - if delay > pollInterval { - delay = pollInterval - } - time.Sleep(delay) - } - return -} +// CanCheckMountReady is set if CheckMountReady is functional +var CanCheckMountReady = true diff --git a/cmd/mountlib/check_other.go b/cmd/mountlib/check_other.go index 328f83bca580d..760be4ec61f86 100644 --- a/cmd/mountlib/check_other.go +++ b/cmd/mountlib/check_other.go @@ -3,10 +3,6 @@ package mountlib -import ( - "time" -) - // CheckMountEmpty checks if mountpoint folder is empty. // On non-Linux unixes we list directory to ensure that. func CheckMountEmpty(mountpoint string) error { @@ -19,9 +15,5 @@ func CheckMountReady(mountpoint string) error { return nil } -// WaitMountReady should wait until mountpoint is mounted by rclone. -// The check is implemented only for Linux so we just sleep a little. -func WaitMountReady(mountpoint string, timeout time.Duration) error { - time.Sleep(timeout) - return nil -} +// CanCheckMountReady is set if CheckMountReady is functional +var CanCheckMountReady = false diff --git a/cmd/mountlib/mount.go b/cmd/mountlib/mount.go index 558a7b2413171..a94f4a7ddc08d 100644 --- a/cmd/mountlib/mount.go +++ b/cmd/mountlib/mount.go @@ -10,7 +10,6 @@ import ( "runtime" "strings" "sync" - "syscall" "time" "github.com/rclone/rclone/cmd" @@ -157,6 +156,38 @@ func AddFlags(flagSet *pflag.FlagSet) { flags.DurationVarP(flagSet, &Opt.DaemonWait, "daemon-wait", "", Opt.DaemonWait, "Time to wait for ready mount from daemon (maximum time on Linux, constant sleep time on OSX/BSD) (not supported on Windows)", "Mount") } +const ( + pollInterval = 100 * time.Millisecond +) + +// WaitMountReady waits until mountpoint is mounted by rclone. +// +// If the mount daemon dies prematurely it will notice too. +func WaitMountReady(mountpoint string, timeout time.Duration, daemon *os.Process) (err error) { + endTime := time.Now().Add(timeout) + for { + if CanCheckMountReady { + err = CheckMountReady(mountpoint) + if err == nil { + break + } + } + err = daemonize.Check(daemon) + if err != nil { + return err + } + delay := time.Until(endTime) + if delay <= 0 { + break + } + if delay > pollInterval { + delay = pollInterval + } + time.Sleep(delay) + } + return +} + // NewMountCommand makes a mount command with the given name and Mount function func NewMountCommand(commandName string, hidden bool, mount MountFn) *cobra.Command { var commandDefinition = &cobra.Command{ @@ -220,16 +251,9 @@ func NewMountCommand(commandName string, hidden bool, mount MountFn) *cobra.Comm handle := atexit.Register(func() { killDaemon("Got interrupt") }) - err = WaitMountReady(mnt.MountPoint, Opt.DaemonWait) + err = WaitMountReady(mnt.MountPoint, Opt.DaemonWait, daemon) if err != nil { killDaemon("Daemon timed out") - } else { - // Double check daemon is still alive - // on non Linux OSes WaitMountReady is just a no-op - err = daemon.Signal(syscall.Signal(0)) - if err != nil { - err = fmt.Errorf("daemon has died: %w", err) - } } atexit.Unregister(handle) } diff --git a/lib/daemonize/daemon_other.go b/lib/daemonize/daemon_other.go index a0781d45335bb..a7d663d0eb709 100644 --- a/lib/daemonize/daemon_other.go +++ b/lib/daemonize/daemon_other.go @@ -1,5 +1,4 @@ -//go:build windows || plan9 || js -// +build windows plan9 js +//go:build !unix // Package daemonize provides daemonization stub for non-Unix platforms. package daemonize @@ -10,7 +9,14 @@ import ( "runtime" ) +var errNotSupported = fmt.Errorf("daemon mode is not supported on the %s platform", runtime.GOOS) + // StartDaemon runs background twin of current process. func StartDaemon(args []string) (*os.Process, error) { - return nil, fmt.Errorf("background mode is not supported on %s platform", runtime.GOOS) + return nil, errNotSupported +} + +// Check returns non nil if the daemon process has died +func Check(daemon *os.Process) error { + return errNotSupported } diff --git a/lib/daemonize/daemon_unix.go b/lib/daemonize/daemon_unix.go index 1fcb2c55ce94a..6e1e0442ee0ee 100644 --- a/lib/daemonize/daemon_unix.go +++ b/lib/daemonize/daemon_unix.go @@ -1,15 +1,16 @@ -//go:build !windows && !plan9 && !js -// +build !windows,!plan9,!js +//go:build unix // Package daemonize provides daemonization interface for Unix platforms. package daemonize import ( + "fmt" "os" "strings" "syscall" "github.com/rclone/rclone/fs" + "golang.org/x/sys/unix" ) // StartDaemon runs background twin of current process. @@ -108,3 +109,20 @@ func argsToEnv(origArgs, origEnv []string) (args, env []string) { } return } + +// Check returns non nil if the daemon process has died +func Check(daemon *os.Process) error { + var status unix.WaitStatus + wpid, err := unix.Wait4(daemon.Pid, &status, unix.WNOHANG, nil) + // fs.Debugf(nil, "wait4 returned wpid=%d, err=%v, status=%d", wpid, err, status) + if err != nil { + return err + } + if wpid == 0 { + return nil + } + if status.Exited() { + return fmt.Errorf("daemon exited with error code %d", status.ExitStatus()) + } + return nil +} From e3d0bff9cad984de27ce4c90d56a5c5ab52bbd4d Mon Sep 17 00:00:00 2001 From: ben-ba Date: Fri, 1 Dec 2023 20:45:48 +0100 Subject: [PATCH 033/130] docs: fix typo in docs.md - OpenChunkedWriter + OpenChunkWriter --- docs/content/docs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/docs.md b/docs/content/docs.md index 30b2a5fbba6e2..fc40963f0e873 100644 --- a/docs/content/docs.md +++ b/docs/content/docs.md @@ -1674,7 +1674,7 @@ use multiple threads to transfer the file (default 256M). Capable backends are marked in the [overview](/overview/#optional-features) as `MultithreadUpload`. (They -need to implement either the `OpenWriterAt` or `OpenChunkedWriter` +need to implement either the `OpenWriterAt` or `OpenChunkWriter` internal interfaces). These include include, `local`, `s3`, `azureblob`, `b2`, `oracleobjectstorage` and `smb` at the time of writing. From 08c460dd1aebc1819a1fee76d6efca6c483b8ab2 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 2 Dec 2023 10:49:02 +0000 Subject: [PATCH 034/130] Add ben-ba to contributors --- docs/content/authors.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/content/authors.md b/docs/content/authors.md index 191421bebaa7e..88f7cf1cee419 100644 --- a/docs/content/authors.md +++ b/docs/content/authors.md @@ -806,3 +806,4 @@ put them back in again.` >}} * 你知道未来吗 * Abhinav Dhiman <8640877+ahnv@users.noreply.github.com> * halms <7513146+halms@users.noreply.github.com> + * ben-ba From f0c774156e5f4d4f51492756c7b1ebf2bc8b98d0 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 28 Nov 2023 18:49:38 +0000 Subject: [PATCH 035/130] onedrive: fix error listing: unknown object type This error was introduced in this commit when refactoring the list routine. b8591b230dbabc24 onedrive: implement ListR method which gives --fast-list support The error was caused by OneNote files not being skipped properly. --- backend/onedrive/onedrive.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.go index fbbdcac474cdd..00781db8d1c53 100644 --- a/backend/onedrive/onedrive.go +++ b/backend/onedrive/onedrive.go @@ -1241,10 +1241,14 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e } err = f.listAll(ctx, directoryID, false, false, func(info *api.Item) error { entry, err := f.itemToDirEntry(ctx, dir, info) - if err == nil { - entries = append(entries, entry) + if err != nil { + return err } - return err + if entry == nil { + return nil + } + entries = append(entries, entry) + return nil }) if err != nil { return nil, err @@ -1339,6 +1343,9 @@ func (f *Fs) ListR(ctx context.Context, dir string, callback fs.ListRCallback) ( if err != nil { return err } + if entry == nil { + return nil + } err = list.Add(entry) if err != nil { return err From 298c13e719929946f4abff0081e73bf4f3c07d32 Mon Sep 17 00:00:00 2001 From: Anagh Kumar Baranwal <6824881+darthShadow@users.noreply.github.com> Date: Wed, 29 Nov 2023 14:55:30 +0530 Subject: [PATCH 036/130] systemd: Fix detection and switch to the coreos package everywhere rather than having 2 separate libraries Signed-off-by: Anagh Kumar Baranwal <6824881+darthShadow@users.noreply.github.com> --- cmd/mountlib/mount.go | 28 +++++++++++++------------- cmd/serve/docker/driver.go | 10 ++++++---- cmd/serve/docker/systemd.go | 4 ++-- fs/log/log.go | 5 ++--- fs/log/systemd.go | 10 +++++++--- fs/log/systemd_unix.go | 40 +++++++++++++++++++++++-------------- go.mod | 3 +-- go.sum | 9 ++------- lib/systemd/notify.go | 14 ++++++++++--- vfs/vfscache/cache.go | 4 ++-- 10 files changed, 72 insertions(+), 55 deletions(-) diff --git a/cmd/mountlib/mount.go b/cmd/mountlib/mount.go index a94f4a7ddc08d..34795be609c24 100644 --- a/cmd/mountlib/mount.go +++ b/cmd/mountlib/mount.go @@ -23,7 +23,7 @@ import ( "github.com/rclone/rclone/vfs/vfscommon" "github.com/rclone/rclone/vfs/vfsflags" - sysdnotify "github.com/iguanesolutions/go-systemd/v5/notify" + "github.com/coreos/go-systemd/v22/daemon" "github.com/spf13/cobra" "github.com/spf13/pflag" ) @@ -222,10 +222,10 @@ func NewMountCommand(commandName string, hidden bool, mount MountFn) *cobra.Comm } mnt := NewMountPoint(mount, args[1], cmd.NewFsDir(args), &Opt, &vfsflags.Opt) - daemon, err := mnt.Mount() + mountDaemon, err := mnt.Mount() // Wait for foreground mount, if any... - if daemon == nil { + if mountDaemon == nil { if err == nil { err = mnt.Wait() } @@ -235,15 +235,15 @@ func NewMountCommand(commandName string, hidden bool, mount MountFn) *cobra.Comm return } - // Wait for daemon, if any... + // Wait for mountDaemon, if any... killOnce := sync.Once{} killDaemon := func(reason string) { killOnce.Do(func() { - if err := daemon.Signal(os.Interrupt); err != nil { - fs.Errorf(nil, "%s. Failed to terminate daemon pid %d: %v", reason, daemon.Pid, err) + if err := mountDaemon.Signal(os.Interrupt); err != nil { + fs.Errorf(nil, "%s. Failed to terminate daemon pid %d: %v", reason, mountDaemon.Pid, err) return } - fs.Debugf(nil, "%s. Terminating daemon pid %d", reason, daemon.Pid) + fs.Debugf(nil, "%s. Terminating daemon pid %d", reason, mountDaemon.Pid) }) } @@ -251,7 +251,7 @@ func NewMountCommand(commandName string, hidden bool, mount MountFn) *cobra.Comm handle := atexit.Register(func() { killDaemon("Got interrupt") }) - err = WaitMountReady(mnt.MountPoint, Opt.DaemonWait, daemon) + err = WaitMountReady(mnt.MountPoint, Opt.DaemonWait, mountDaemon) if err != nil { killDaemon("Daemon timed out") } @@ -275,7 +275,7 @@ func NewMountCommand(commandName string, hidden bool, mount MountFn) *cobra.Comm } // Mount the remote at mountpoint -func (m *MountPoint) Mount() (daemon *os.Process, err error) { +func (m *MountPoint) Mount() (mountDaemon *os.Process, err error) { // Ensure sensible defaults m.SetVolumeName(m.MountOpt.VolumeName) @@ -283,9 +283,9 @@ func (m *MountPoint) Mount() (daemon *os.Process, err error) { // Start background task if --daemon is specified if m.MountOpt.Daemon { - daemon, err = daemonize.StartDaemon(os.Args) - if daemon != nil || err != nil { - return daemon, err + mountDaemon, err = daemonize.StartDaemon(os.Args) + if mountDaemon != nil || err != nil { + return mountDaemon, err } } @@ -305,7 +305,7 @@ func (m *MountPoint) Wait() error { var finaliseOnce sync.Once finalise := func() { finaliseOnce.Do(func() { - _ = sysdnotify.Stopping() + _, _ = daemon.SdNotify(false, daemon.SdNotifyStopping) // Unmount only if directory was mounted by rclone, e.g. don't unmount autofs hooks. if err := CheckMountReady(m.MountPoint); err != nil { fs.Debugf(m.MountPoint, "Unmounted externally. Just exit now.") @@ -322,7 +322,7 @@ func (m *MountPoint) Wait() error { defer atexit.Unregister(fnHandle) // Notify systemd - if err := sysdnotify.Ready(); err != nil { + if _, err := daemon.SdNotify(false, daemon.SdNotifyReady); err != nil { return fmt.Errorf("failed to notify systemd: %w", err) } diff --git a/cmd/serve/docker/driver.go b/cmd/serve/docker/driver.go index dfdb190f9953f..278a24e315c2d 100644 --- a/cmd/serve/docker/driver.go +++ b/cmd/serve/docker/driver.go @@ -12,8 +12,7 @@ import ( "sync" "time" - sysdnotify "github.com/iguanesolutions/go-systemd/v5/notify" - + "github.com/coreos/go-systemd/v22/daemon" "github.com/rclone/rclone/cmd/mountlib" "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/config" @@ -87,7 +86,7 @@ func NewDriver(ctx context.Context, root string, mntOpt *mountlib.Options, vfsOp }) // notify systemd - if err := sysdnotify.Ready(); err != nil { + if _, err := daemon.SdNotify(false, daemon.SdNotifyReady); err != nil { return nil, fmt.Errorf("failed to notify systemd: %w", err) } @@ -100,7 +99,10 @@ func (drv *Driver) Exit() { drv.mu.Lock() defer drv.mu.Unlock() - reportErr(sysdnotify.Stopping()) + reportErr(func() error { + _, err := daemon.SdNotify(false, daemon.SdNotifyStopping) + return err + }()) drv.monChan <- true // ask monitor to exit for _, vol := range drv.volumes { reportErr(vol.unmountAll()) diff --git a/cmd/serve/docker/systemd.go b/cmd/serve/docker/systemd.go index 981964c1bb174..8a69f6b081597 100644 --- a/cmd/serve/docker/systemd.go +++ b/cmd/serve/docker/systemd.go @@ -6,8 +6,8 @@ package docker import ( "os" - "github.com/coreos/go-systemd/activation" - "github.com/coreos/go-systemd/util" + "github.com/coreos/go-systemd/v22/activation" + "github.com/coreos/go-systemd/v22/util" ) func systemdActivationFiles() []*os.File { diff --git a/fs/log/log.go b/fs/log/log.go index 9c66fdf02faee..bf2bfd74bf926 100644 --- a/fs/log/log.go +++ b/fs/log/log.go @@ -10,7 +10,6 @@ import ( "runtime" "strings" - systemd "github.com/iguanesolutions/go-systemd/v5" "github.com/rclone/rclone/fs" "github.com/sirupsen/logrus" ) @@ -49,7 +48,7 @@ func fnName() string { // Trace debugs the entry and exit of the calling function // -// It is designed to be used in a defer statement so it returns a +// It is designed to be used in a defer statement, so it returns a // function that logs the exit parameters. // // Any pointers in the exit function will be dereferenced @@ -141,7 +140,7 @@ func InitLogging() { // Activate systemd logger support if systemd invocation ID is // detected and output is going to stderr (not logging to a file or syslog) if !Redirected() { - if _, usingSystemd := systemd.GetInvocationID(); usingSystemd { + if isJournalStream() { Opt.LogSystemdSupport = true } } diff --git a/fs/log/systemd.go b/fs/log/systemd.go index 2e572790a99d1..c09227b095642 100644 --- a/fs/log/systemd.go +++ b/fs/log/systemd.go @@ -1,7 +1,7 @@ // Systemd interface for non-Unix variants only -//go:build windows || nacl || plan9 -// +build windows nacl plan9 +//go:build !unix +// +build !unix package log @@ -10,8 +10,12 @@ import ( "runtime" ) -// Enables systemd logs if configured or if auto detected +// Enables systemd logs if configured or if auto-detected func startSystemdLog() bool { log.Fatalf("--log-systemd not supported on %s platform", runtime.GOOS) return false } + +func isJournalStream() bool { + return false +} diff --git a/fs/log/systemd_unix.go b/fs/log/systemd_unix.go index a2aa8e51c2914..fa6700734e776 100644 --- a/fs/log/systemd_unix.go +++ b/fs/log/systemd_unix.go @@ -1,20 +1,21 @@ // Systemd interface for Unix variants only -//go:build !windows && !nacl && !plan9 -// +build !windows,!nacl,!plan9 +//go:build unix +// +build unix package log import ( "fmt" "log" + "strconv" "strings" - sysdjournald "github.com/iguanesolutions/go-systemd/v5/journald" + "github.com/coreos/go-systemd/v22/journal" "github.com/rclone/rclone/fs" ) -// Enables systemd logs if configured or if auto detected +// Enables systemd logs if configured or if auto-detected func startSystemdLog() bool { flagsStr := "," + Opt.Format + "," var flags int @@ -25,27 +26,36 @@ func startSystemdLog() bool { flags |= log.Lshortfile } log.SetFlags(flags) + // TODO: Use the native journal.Print approach rather than a custom implementation fs.LogPrint = func(level fs.LogLevel, text string) { - text = fmt.Sprintf("%s%-6s: %s", systemdLogPrefix(level), level, text) + text = fmt.Sprintf("<%s>%-6s: %s", systemdLogPrefix(level), level, text) _ = log.Output(4, text) } return true } -var logLevelToSystemdPrefix = []string{ - fs.LogLevelEmergency: sysdjournald.EmergPrefix, - fs.LogLevelAlert: sysdjournald.AlertPrefix, - fs.LogLevelCritical: sysdjournald.CritPrefix, - fs.LogLevelError: sysdjournald.ErrPrefix, - fs.LogLevelWarning: sysdjournald.WarningPrefix, - fs.LogLevelNotice: sysdjournald.NoticePrefix, - fs.LogLevelInfo: sysdjournald.InfoPrefix, - fs.LogLevelDebug: sysdjournald.DebugPrefix, +var logLevelToSystemdPrefix = []journal.Priority{ + fs.LogLevelEmergency: journal.PriEmerg, + fs.LogLevelAlert: journal.PriAlert, + fs.LogLevelCritical: journal.PriCrit, + fs.LogLevelError: journal.PriErr, + fs.LogLevelWarning: journal.PriWarning, + fs.LogLevelNotice: journal.PriNotice, + fs.LogLevelInfo: journal.PriInfo, + fs.LogLevelDebug: journal.PriDebug, } func systemdLogPrefix(l fs.LogLevel) string { if l >= fs.LogLevel(len(logLevelToSystemdPrefix)) { return "" } - return logLevelToSystemdPrefix[l] + return strconv.Itoa(int(logLevelToSystemdPrefix[l])) +} + +func isJournalStream() bool { + if usingJournald, _ := journal.StderrIsJournalStream(); usingJournald { + return true + } + + return false } diff --git a/go.mod b/go.mod index 2283640416953..046a3433c8688 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/cloudsoda/go-smb2 v0.0.0-20231124195312-f3ec8ae2c891 github.com/colinmarc/hdfs/v2 v2.4.0 github.com/coreos/go-semver v0.3.1 - github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf + github.com/coreos/go-systemd/v22 v22.5.0 github.com/dop251/scsu v0.0.0-20220106150536-84ac88021d00 github.com/dropbox/dropbox-sdk-go-unofficial/v6 v6.0.5 github.com/gabriel-vasile/mimetype v1.4.3 @@ -34,7 +34,6 @@ require ( github.com/hanwen/go-fuse/v2 v2.4.0 github.com/henrybear327/Proton-API-Bridge v1.0.0 github.com/henrybear327/go-proton-api v1.0.0 - github.com/iguanesolutions/go-systemd/v5 v5.1.1 github.com/jcmturner/gokrb5/v8 v8.4.4 github.com/jlaffaye/ftp v0.2.0 github.com/josephspurrier/goversioninfo v1.4.0 diff --git a/go.sum b/go.sum index dd7f7f0bceaa5..f9b8ce2990005 100644 --- a/go.sum +++ b/go.sum @@ -140,8 +140,8 @@ github.com/colinmarc/hdfs/v2 v2.4.0 h1:v6R8oBx/Wu9fHpdPoJJjpGSUxo8NhHIwrwsfhFvU9 github.com/colinmarc/hdfs/v2 v2.4.0/go.mod h1:0NAO+/3knbMx6+5pCv+Hcbaz4xn/Zzbn9+WIib2rKVI= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= -github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf h1:iW4rZ826su+pqaw19uhpSCzhj44qo35pNgKFGqzDKkU= -github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -315,8 +315,6 @@ github.com/henrybear327/go-proton-api v1.0.0 h1:zYi/IbjLwFAW7ltCeqXneUGJey0TN//X github.com/henrybear327/go-proton-api v1.0.0/go.mod h1:w63MZuzufKcIZ93pwRgiOtxMXYafI8H74D77AxytOBc= github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/iguanesolutions/go-systemd/v5 v5.1.1 h1:Hs0Z16knPGCBFnKECrICPh+RQ89Sgy0xyzcalrHMKdw= -github.com/iguanesolutions/go-systemd/v5 v5.1.1/go.mod h1:Quv57scs6S7T0rC6qyLfW20KU/P4p9hrbLPF+ILYrXY= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= @@ -395,7 +393,6 @@ github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= -github.com/miekg/dns v1.1.42/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= github.com/minio/minio-go/v6 v6.0.46/go.mod h1:qD0lajrGW49lKZLtXKtCB4X/qkMf0a5tBvN2PaZg7Gg= @@ -693,7 +690,6 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -731,7 +727,6 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/lib/systemd/notify.go b/lib/systemd/notify.go index a185b71a613c8..8dccafb4f0975 100644 --- a/lib/systemd/notify.go +++ b/lib/systemd/notify.go @@ -1,10 +1,11 @@ package systemd import ( + "fmt" "log" "sync" - sysdnotify "github.com/iguanesolutions/go-systemd/v5/notify" + "github.com/coreos/go-systemd/v22/daemon" "github.com/rclone/rclone/lib/atexit" ) @@ -13,13 +14,13 @@ import ( // stopping. This function will be called on exit if the service exits // on a signal. func Notify() func() { - if err := sysdnotify.Ready(); err != nil { + if _, err := daemon.SdNotify(false, daemon.SdNotifyReady); err != nil { log.Printf("failed to notify ready to systemd: %v", err) } var finaliseOnce sync.Once finalise := func() { finaliseOnce.Do(func() { - if err := sysdnotify.Stopping(); err != nil { + if _, err := daemon.SdNotify(false, daemon.SdNotifyStopping); err != nil { log.Printf("failed to notify stopping to systemd: %v", err) } }) @@ -30,3 +31,10 @@ func Notify() func() { finalise() } } + +// UpdateStatus updates the systemd status +func UpdateStatus(status string) error { + systemdStatus := fmt.Sprintf("STATUS=%s", status) + _, err := daemon.SdNotify(false, systemdStatus) + return err +} diff --git a/vfs/vfscache/cache.go b/vfs/vfscache/cache.go index e5bb19c79ef5c..9bcfc90ee3387 100644 --- a/vfs/vfscache/cache.go +++ b/vfs/vfscache/cache.go @@ -14,7 +14,6 @@ import ( "sync" "time" - sysdnotify "github.com/iguanesolutions/go-systemd/v5/notify" "github.com/rclone/rclone/fs" fscache "github.com/rclone/rclone/fs/cache" "github.com/rclone/rclone/fs/config" @@ -25,6 +24,7 @@ import ( "github.com/rclone/rclone/lib/diskusage" "github.com/rclone/rclone/lib/encoder" "github.com/rclone/rclone/lib/file" + "github.com/rclone/rclone/lib/systemd" "github.com/rclone/rclone/vfs/vfscache/writeback" "github.com/rclone/rclone/vfs/vfscommon" ) @@ -814,7 +814,7 @@ func (c *Cache) clean(kicked bool) { stats := fmt.Sprintf("objects %d (was %d) in use %d, to upload %d, uploading %d, total size %v (was %v)", newItems, oldItems, totalInUse, uploadsQueued, uploadsInProgress, newUsed, oldUsed) fs.Infof(nil, "vfs cache: cleaned: %s", stats) - if err = sysdnotify.Status(fmt.Sprintf("[%s] vfs cache: %s", time.Now().Format("15:04"), stats)); err != nil { + if err = systemd.UpdateStatus(fmt.Sprintf("[%s] vfs cache: %s", time.Now().Format("15:04"), stats)); err != nil { fs.Errorf(nil, "vfs cache: updating systemd status with current stats failed: %s", err) } } From aee787d33eb91f9d8173e9a124479068673f2bc5 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 27 Nov 2023 10:34:21 +0000 Subject: [PATCH 037/130] serve nfs: Mark as experimental --- cmd/serve/nfs/nfs.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/serve/nfs/nfs.go b/cmd/serve/nfs/nfs.go index 3e4722cb64661..7a67f679e4eda 100644 --- a/cmd/serve/nfs/nfs.go +++ b/cmd/serve/nfs/nfs.go @@ -92,6 +92,7 @@ This feature is only available on Unix platforms. Annotations: map[string]string{ "versionIntroduced": "v1.65", "groups": "Filter", + "status": "Experimental", }, Run: Run, } From 1ebbc74f1d62457aea660b9e4378cc085c0dd25e Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 27 Nov 2023 10:34:59 +0000 Subject: [PATCH 038/130] nfsmount: compile for all unix oses, add --sudo and fix error/option handling - make compile on all unix OSes - this will make the docs appear on linux and rclone.org! - add --sudo flag for using with mount - improve error reporting - fix option handling --- cmd/nfsmount/nfsmount.go | 59 +++++++++++++++++++++------- cmd/nfsmount/nfsmount_unsupported.go | 6 +-- 2 files changed, 48 insertions(+), 17 deletions(-) diff --git a/cmd/nfsmount/nfsmount.go b/cmd/nfsmount/nfsmount.go index 755197fa242e9..e515e995a8c82 100644 --- a/cmd/nfsmount/nfsmount.go +++ b/cmd/nfsmount/nfsmount.go @@ -1,29 +1,38 @@ -//go:build darwin && !cmount -// +build darwin,!cmount +//go:build unix +// +build unix // Package nfsmount implements mounting functionality using serve nfs command // -// NFS mount is only needed for macOS since it has no -// support for FUSE-based file systems +// This can potentially work on all unix like systems which can mount NFS. package nfsmount import ( + "bytes" "context" "fmt" "net" "os/exec" "runtime" - "strings" "github.com/rclone/rclone/cmd/mountlib" "github.com/rclone/rclone/cmd/serve/nfs" + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/config/flags" "github.com/rclone/rclone/vfs" ) +var ( + sudo = false +) + func init() { - cmd := mountlib.NewMountCommand("mount", false, mount) - cmd.Aliases = append(cmd.Aliases, "nfsmount") - mountlib.AddRc("nfsmount", mount) + name := "nfsmount" + cmd := mountlib.NewMountCommand(name, false, mount) + cmd.Annotations["versionIntroduced"] = "v1.65" + cmd.Annotations["status"] = "Experimental" + mountlib.AddRc(name, mount) + cmdFlags := cmd.Flags() + flags.BoolVarP(cmdFlags, &sudo, "sudo", "", sudo, "Use sudo to run the mount command as root.", "") } func mount(VFS *vfs.VFS, mountpoint string, opt *mountlib.Options) (asyncerrors <-chan error, unmount func() error, err error) { @@ -42,24 +51,46 @@ func mount(VFS *vfs.VFS, mountpoint string, opt *mountlib.Options) (asyncerrors err = fmt.Errorf("cannot find port number in %s", s.Addr().String()) return } - optionsString := strings.Join(opt.ExtraOptions, ",") - err = exec.Command("mount", fmt.Sprintf("-oport=%s,mountport=%s,%s", port, port, optionsString), "localhost:", mountpoint).Run() + + // Options + options := []string{ + "-o", fmt.Sprintf("port=%s", port), + "-o", fmt.Sprintf("mountport=%s", port), + } + for _, option := range opt.ExtraOptions { + options = append(options, "-o", option) + } + options = append(options, opt.ExtraFlags...) + + cmd := []string{} + if sudo { + cmd = append(cmd, "sudo") + } + cmd = append(cmd, "mount") + cmd = append(cmd, options...) + cmd = append(cmd, "localhost:", mountpoint) + fs.Debugf(nil, "Running mount command: %q", cmd) + + out, err := exec.Command(cmd[0], cmd[1:]...).CombinedOutput() if err != nil { - err = fmt.Errorf("failed to mount NFS volume %e", err) + out = bytes.TrimSpace(out) + err = fmt.Errorf("%s: failed to mount NFS volume: %v", out, err) return } asyncerrors = errChan unmount = func() error { var umountErr error + var out []byte if runtime.GOOS == "darwin" { - umountErr = exec.Command("diskutil", "umount", "force", mountpoint).Run() + out, umountErr = exec.Command("diskutil", "umount", "force", mountpoint).CombinedOutput() } else { - umountErr = exec.Command("umount", "-f", mountpoint).Run() + out, umountErr = exec.Command("umount", "-f", mountpoint).CombinedOutput() } shutdownErr := s.Shutdown() VFS.Shutdown() if umountErr != nil { - return fmt.Errorf("failed to umount the NFS volume %e", umountErr) + out = bytes.TrimSpace(out) + return fmt.Errorf("%s: failed to umount the NFS volume %e", out, umountErr) } else if shutdownErr != nil { return fmt.Errorf("failed to shutdown NFS server: %e", shutdownErr) } diff --git a/cmd/nfsmount/nfsmount_unsupported.go b/cmd/nfsmount/nfsmount_unsupported.go index d24115837015e..394374e665737 100644 --- a/cmd/nfsmount/nfsmount_unsupported.go +++ b/cmd/nfsmount/nfsmount_unsupported.go @@ -1,8 +1,8 @@ // Build for nfsmount for unsupported platforms to stop go complaining // about "no buildable Go source files " -//go:build !darwin || cmount -// +build !darwin cmount +//go:build !unix +// +build !unix -// Package nfsmount implements mount command using NFS, not needed on most platforms +// Package nfsmount implements mount command using NFS. package nfsmount From c3117d9efb469b56be43f6ddffba023c6273458b Mon Sep 17 00:00:00 2001 From: Eli Orzitzer Date: Thu, 7 Dec 2023 15:38:34 +0200 Subject: [PATCH 039/130] Doc change: Add the CreateBucket permission requirement for AWS S3 --- docs/content/s3.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/content/s3.md b/docs/content/s3.md index aa16509acdd8e..46b5873ed72a8 100644 --- a/docs/content/s3.md +++ b/docs/content/s3.md @@ -590,6 +590,7 @@ permissions are required to be available on the bucket being written to: * `GetObject` * `PutObject` * `PutObjectACL` +* `CreateBucket` (unless using [s3-no-check-bucket](#s3-no-check-bucket)) When using the `lsd` subcommand, the `ListAllMyBuckets` permission is required. @@ -631,6 +632,7 @@ Notes on above: that `USER_NAME` has been created. 2. The Resource entry must include both resource ARNs, as one implies the bucket and the other implies the bucket's objects. +3. When using [s3-no-check-bucket](#s3-no-check-bucket) and the bucket already exsits, the `"arn:aws:s3:::BUCKET_NAME"` doesn't have to be included. For reference, [here's an Ansible script](https://gist.github.com/ebridges/ebfc9042dd7c756cd101cfa807b7ae2b) that will generate one or more buckets that will work with `rclone sync`. From 2f5685b40562cf764da673543245ddb13c049a4a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Dec 2023 22:48:34 +0000 Subject: [PATCH 040/130] build(deps): bump actions/setup-go from 4 to 5 Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d12696daf1987..f2b3a0bd2ae60 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -104,7 +104,7 @@ jobs: fetch-depth: 0 - name: Install Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go }} check-latest: true @@ -241,7 +241,7 @@ jobs: # Run govulncheck on the latest go version, the one we build binaries with - name: Install Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: '1.21' check-latest: true @@ -266,7 +266,7 @@ jobs: # Upgrade together with NDK version - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: '1.21' From 9fe343b725965af79cae87d6148ad3a28a115c43 Mon Sep 17 00:00:00 2001 From: Anthony Metzidis Date: Sat, 2 Dec 2023 16:12:54 -0800 Subject: [PATCH 041/130] s3: S3 IPv6 support with option "use_dual_stack" (bool) dualstack_endpoint=true enables IPv6 DNS lookup for S3 endpoints in s3.go, add Options.DualstackEndpoint to support IPv6 on S3 --- backend/s3/s3.go | 11 +++++++++++ backend/s3/s3_test.go | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/backend/s3/s3.go b/backend/s3/s3.go index 979423883fddc..d7ca47a7762f0 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -2219,6 +2219,13 @@ If it is set then rclone will use v2 authentication. Use this only if v4 signatures don't work, e.g. pre Jewel/v10 CEPH.`, Default: false, Advanced: true, + }, { + Name: "use_dual_stack", + Help: `If true use AWS S3 dual-stack endpoint (IPv6 support). + +See [AWS Docs on Dualstack Endpoints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/dual-stack-endpoints.html)`, + Default: false, + Advanced: true, }, { Name: "use_accelerate_endpoint", Provider: "AWS", @@ -2628,6 +2635,7 @@ type Options struct { Region string `config:"region"` Endpoint string `config:"endpoint"` STSEndpoint string `config:"sts_endpoint"` + UseDualStack bool `config:"use_dual_stack"` LocationConstraint string `config:"location_constraint"` ACL string `config:"acl"` BucketACL string `config:"bucket_acl"` @@ -2956,6 +2964,9 @@ func s3Connection(ctx context.Context, opt *Options, client *http.Client) (*s3.S r.addService("sts", opt.STSEndpoint) awsConfig.WithEndpointResolver(r) } + if opt.UseDualStack { + awsConfig.UseDualStackEndpoint = endpoints.DualStackEndpointStateEnabled + } // awsConfig.WithLogLevel(aws.LogDebugWithSigning) awsSessionOpts := session.Options{ diff --git a/backend/s3/s3_test.go b/backend/s3/s3_test.go index 3415bebf2eef9..7e6e553600c9e 100644 --- a/backend/s3/s3_test.go +++ b/backend/s3/s3_test.go @@ -2,6 +2,9 @@ package s3 import ( + "context" + "net/http" + "strings" "testing" "github.com/rclone/rclone/fs" @@ -9,6 +12,13 @@ import ( "github.com/rclone/rclone/fstest/fstests" ) +func SetupS3Test(t *testing.T) (context.Context, *Options, *http.Client) { + ctx, opt := context.Background(), new(Options) + opt.Provider = "AWS" + client := getClient(ctx, opt) + return ctx, opt, client +} + // TestIntegration runs integration tests against the remote func TestIntegration(t *testing.T) { fstests.Run(t, &fstests.Opt{ @@ -39,6 +49,28 @@ func TestIntegration2(t *testing.T) { }) } +func TestAWSDualStackOption(t *testing.T) { + { + // test enabled + ctx, opt, client := SetupS3Test(t) + opt.UseDualStack = true + s3Conn, _, _ := s3Connection(ctx, opt, client) + if !strings.Contains(s3Conn.Endpoint, "dualstack") { + t.Errorf("dualstack failed got: %s, wanted: dualstack", s3Conn.Endpoint) + t.Fail() + } + } + { + // test default case + ctx, opt, client := SetupS3Test(t) + s3Conn, _, _ := s3Connection(ctx, opt, client) + if strings.Contains(s3Conn.Endpoint, "dualstack") { + t.Errorf("dualstack failed got: %s, NOT wanted: dualstack", s3Conn.Endpoint) + t.Fail() + } + } +} + func (f *Fs) SetUploadChunkSize(cs fs.SizeSuffix) (fs.SizeSuffix, error) { return f.setUploadChunkSize(cs) } From 4751980659238afe179fdf012d0ea165f93ffa3d Mon Sep 17 00:00:00 2001 From: emyarod Date: Thu, 7 Dec 2023 15:26:26 -0600 Subject: [PATCH 042/130] docs: update contributor email --- bin/.ignore-emails | 1 + docs/content/authors.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/.ignore-emails b/bin/.ignore-emails index 14cbc62fc8089..b453110997727 100644 --- a/bin/.ignore-emails +++ b/bin/.ignore-emails @@ -10,3 +10,4 @@ + \ No newline at end of file diff --git a/docs/content/authors.md b/docs/content/authors.md index 88f7cf1cee419..3ee7d0ca22178 100644 --- a/docs/content/authors.md +++ b/docs/content/authors.md @@ -57,7 +57,7 @@ put them back in again.` >}} * Scott McGillivray * Bjørn Erik Pedersen * Lukas Loesche - * emyarod + * emyarod * T.C. Ferguson * Brandur * Dario Giovannetti From 8e21c77ead79e9aca66bc3f27c27f20a5a975f63 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 8 Dec 2023 14:26:30 +0000 Subject: [PATCH 043/130] Add Eli Orzitzer to contributors --- docs/content/authors.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/content/authors.md b/docs/content/authors.md index 3ee7d0ca22178..55fcfc7913e65 100644 --- a/docs/content/authors.md +++ b/docs/content/authors.md @@ -807,3 +807,4 @@ put them back in again.` >}} * Abhinav Dhiman <8640877+ahnv@users.noreply.github.com> * halms <7513146+halms@users.noreply.github.com> * ben-ba + * Eli Orzitzer From 57ab4d279e11cd060e65d696ce4fb45006fb9224 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 8 Dec 2023 14:26:30 +0000 Subject: [PATCH 044/130] Add Anthony Metzidis to contributors --- docs/content/authors.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/content/authors.md b/docs/content/authors.md index 55fcfc7913e65..2143979b93057 100644 --- a/docs/content/authors.md +++ b/docs/content/authors.md @@ -808,3 +808,4 @@ put them back in again.` >}} * halms <7513146+halms@users.noreply.github.com> * ben-ba * Eli Orzitzer + * Anthony Metzidis From 113b2b648cf0f82ab44650eb0215573f3c31577c Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 8 Dec 2023 14:26:30 +0000 Subject: [PATCH 045/130] Add emyarod to contributors --- docs/content/authors.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/content/authors.md b/docs/content/authors.md index 2143979b93057..66ff5a961fd62 100644 --- a/docs/content/authors.md +++ b/docs/content/authors.md @@ -809,3 +809,4 @@ put them back in again.` >}} * ben-ba * Eli Orzitzer * Anthony Metzidis + * emyarod From ef0f3020e43b52b4b2f0ac553bec8761962eaca8 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 6 Dec 2023 11:00:04 +0000 Subject: [PATCH 046/130] vfs: note that --vfs-refresh runs in the background #6830 --- vfs/vfsflags/vfsflags.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vfs/vfsflags/vfsflags.go b/vfs/vfsflags/vfsflags.go index 2f1adafdee7c8..83b593d295f5a 100644 --- a/vfs/vfsflags/vfsflags.go +++ b/vfs/vfsflags/vfsflags.go @@ -22,7 +22,7 @@ func AddFlags(flagSet *pflag.FlagSet) { flags.BoolVarP(flagSet, &Opt.NoChecksum, "no-checksum", "", Opt.NoChecksum, "Don't compare checksums on up/download", "VFS") flags.BoolVarP(flagSet, &Opt.NoSeek, "no-seek", "", Opt.NoSeek, "Don't allow seeking in files", "VFS") flags.DurationVarP(flagSet, &Opt.DirCacheTime, "dir-cache-time", "", Opt.DirCacheTime, "Time to cache directory entries for", "VFS") - flags.BoolVarP(flagSet, &Opt.Refresh, "vfs-refresh", "", Opt.Refresh, "Refreshes the directory cache recursively on start", "VFS") + flags.BoolVarP(flagSet, &Opt.Refresh, "vfs-refresh", "", Opt.Refresh, "Refreshes the directory cache recursively in the background on start", "VFS") flags.DurationVarP(flagSet, &Opt.PollInterval, "poll-interval", "", Opt.PollInterval, "Time to wait between polling for changes, must be smaller than dir-cache-time and only on supported remotes (set 0 to disable)", "VFS") flags.BoolVarP(flagSet, &Opt.ReadOnly, "read-only", "", Opt.ReadOnly, "Only allow read-only access", "VFS") flags.FVarP(flagSet, &Opt.CacheMode, "vfs-cache-mode", "", "Cache mode off|minimal|writes|full", "VFS") From f45cee831ff2395db48598eaf51953e3a50117bd Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 8 Dec 2023 11:47:20 +0000 Subject: [PATCH 047/130] dropbox: fix used space on dropbox team accounts Before this change we were not using the used space from the team stats. This patch uses that as the used space if available as it seems to include the user stats in it. See: https://forum.rclone.org/t/rclone-about-with-dropbox-reporte-size-incorrectly/43269/ --- backend/dropbox/dropbox.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/dropbox/dropbox.go b/backend/dropbox/dropbox.go index 1b647af0819e2..0eea08c53cf55 100644 --- a/backend/dropbox/dropbox.go +++ b/backend/dropbox/dropbox.go @@ -1231,18 +1231,21 @@ func (f *Fs) About(ctx context.Context) (usage *fs.Usage, err error) { return nil, err } var total uint64 + var used = q.Used if q.Allocation != nil { if q.Allocation.Individual != nil { total += q.Allocation.Individual.Allocated } if q.Allocation.Team != nil { total += q.Allocation.Team.Allocated + // Override used with Team.Used as this includes q.Used already + used = q.Allocation.Team.Used } } usage = &fs.Usage{ - Total: fs.NewUsageValue(int64(total)), // quota of bytes that can be used - Used: fs.NewUsageValue(int64(q.Used)), // bytes in use - Free: fs.NewUsageValue(int64(total - q.Used)), // bytes which can be uploaded before reaching the quota + Total: fs.NewUsageValue(int64(total)), // quota of bytes that can be used + Used: fs.NewUsageValue(int64(used)), // bytes in use + Free: fs.NewUsageValue(int64(total - used)), // bytes which can be uploaded before reaching the quota } return usage, nil } From 110d07548fbe18937933239d823da904826205b3 Mon Sep 17 00:00:00 2001 From: keongalvin Date: Fri, 8 Dec 2023 01:00:13 +0800 Subject: [PATCH 048/130] docs: fix broken link --- docs/content/docs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/docs.md b/docs/content/docs.md index fc40963f0e873..a15cc51881bae 100644 --- a/docs/content/docs.md +++ b/docs/content/docs.md @@ -1614,7 +1614,7 @@ json.dump(o, sys.stdout, indent="\t") ``` You can find this example (slightly expanded) in the rclone source code at -[bin/test_metadata_mapper.py](https://github.com/rclone/rclone/blob/master/test_metadata_mapper.py). +[bin/test_metadata_mapper.py](https://github.com/rclone/rclone/blob/master/bin/test_metadata_mapper.py). If you want to see the input to the metadata mapper and the output returned from it in the log you can use `-vv --dump mapper`. From 6c58e9976c41d3e641c0aa59c585a1bd523525a6 Mon Sep 17 00:00:00 2001 From: rkonfj Date: Thu, 30 Nov 2023 14:16:22 +0800 Subject: [PATCH 049/130] oauthutil: add Shutdown method Before this change, calling the `oauthutil.NewRenew` func may cause goroutine leaks. This change adds a `Shutdown` method to allow the caller to exit the goroutine to avoid leaks. Signed-off-by: rkonfj --- lib/oauthutil/renew.go | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/lib/oauthutil/renew.go b/lib/oauthutil/renew.go index 7f98491e8a6cc..e3652ee9c637a 100644 --- a/lib/oauthutil/renew.go +++ b/lib/oauthutil/renew.go @@ -1,6 +1,7 @@ package oauthutil import ( + "sync" "sync/atomic" "github.com/rclone/rclone/fs" @@ -8,10 +9,12 @@ import ( // Renew allows tokens to be renewed on expiry if uploads are in progress. type Renew struct { - name string // name to use in logs - ts *TokenSource // token source that needs renewing - uploads atomic.Int32 // number of uploads in progress - run func() error // a transaction to run to renew the token on + name string // name to use in logs + ts *TokenSource // token source that needs renewing + uploads atomic.Int32 // number of uploads in progress + run func() error // a transaction to run to renew the token on + done chan any // channel to end the go routine + shutdown sync.Once } // NewRenew creates a new Renew struct and starts a background process @@ -24,6 +27,7 @@ func NewRenew(name string, ts *TokenSource, run func() error) *Renew { name: name, ts: ts, run: run, + done: make(chan any), } go r.renewOnExpiry() return r @@ -36,7 +40,11 @@ func NewRenew(name string, ts *TokenSource, run func() error) *Renew { func (r *Renew) renewOnExpiry() { expiry := r.ts.OnExpiry() for { - <-expiry + select { + case <-expiry: + case <-r.done: + return + } uploads := r.uploads.Load() if uploads != 0 { fs.Debugf(r.name, "Token expired - %d uploads in progress - refreshing", uploads) @@ -72,3 +80,15 @@ func (r *Renew) Invalidate() { func (r *Renew) Expire() error { return r.ts.Expire() } + +// Shutdown stops the timer and no more renewal will take place. +func (r *Renew) Shutdown() { + if r == nil { + return + } + // closing a channel can only be done once + r.shutdown.Do(func() { + r.ts.expiryTimer.Stop() + close(r.done) + }) +} From 3f159bac16301e69d32ec3a64474c0960af9f862 Mon Sep 17 00:00:00 2001 From: rkonfj Date: Fri, 8 Dec 2023 12:33:51 +0800 Subject: [PATCH 050/130] backend: fs implements the `Shutdowner` interface Since `tokenRenewer` adds a Shutdown method, we should call it to clean up resources. changes backends: onedrive,box,pcloud,amazonclouddrive,hidrive,jottacloud,sharefile ,premiumizeme Signed-off-by: rkonfj --- backend/amazonclouddrive/amazonclouddrive.go | 7 +++++++ backend/box/box.go | 7 +++++++ backend/hidrive/hidrive.go | 7 +++++++ backend/jottacloud/jottacloud.go | 7 +++++++ backend/onedrive/onedrive.go | 7 +++++++ backend/pcloud/pcloud.go | 7 +++++++ backend/premiumizeme/premiumizeme.go | 7 +++++++ backend/sharefile/sharefile.go | 7 +++++++ 8 files changed, 56 insertions(+) diff --git a/backend/amazonclouddrive/amazonclouddrive.go b/backend/amazonclouddrive/amazonclouddrive.go index 1bc6bcb8453c7..c5a123915623a 100644 --- a/backend/amazonclouddrive/amazonclouddrive.go +++ b/backend/amazonclouddrive/amazonclouddrive.go @@ -1346,6 +1346,12 @@ func (f *Fs) changeNotifyRunner(notifyFunc func(string, fs.EntryType), checkpoin return checkpoint } +// Shutdown shutdown the fs +func (f *Fs) Shutdown(ctx context.Context) error { + f.tokenRenewer.Shutdown() + return nil +} + // ID returns the ID of the Object if known, or "" if not func (o *Object) ID() string { if o.info.Id == nil { @@ -1363,6 +1369,7 @@ var ( _ fs.DirMover = (*Fs)(nil) _ fs.DirCacheFlusher = (*Fs)(nil) _ fs.ChangeNotifier = (*Fs)(nil) + _ fs.Shutdowner = (*Fs)(nil) _ fs.Object = (*Object)(nil) _ fs.MimeTyper = &Object{} _ fs.IDer = &Object{} diff --git a/backend/box/box.go b/backend/box/box.go index 26e2cb35642de..4f38955eb017c 100644 --- a/backend/box/box.go +++ b/backend/box/box.go @@ -1207,6 +1207,12 @@ func (f *Fs) CleanUp(ctx context.Context) (err error) { return err } +// Shutdown shutdown the fs +func (f *Fs) Shutdown(ctx context.Context) error { + f.tokenRenewer.Shutdown() + return nil +} + // ChangeNotify calls the passed function with a path that has had changes. // If the implementation uses polling, it should adhere to the given interval. // @@ -1719,6 +1725,7 @@ var ( _ fs.DirCacheFlusher = (*Fs)(nil) _ fs.PublicLinker = (*Fs)(nil) _ fs.CleanUpper = (*Fs)(nil) + _ fs.Shutdowner = (*Fs)(nil) _ fs.Object = (*Object)(nil) _ fs.IDer = (*Object)(nil) ) diff --git a/backend/hidrive/hidrive.go b/backend/hidrive/hidrive.go index 500e6f7cfc96c..6f690f6298a05 100644 --- a/backend/hidrive/hidrive.go +++ b/backend/hidrive/hidrive.go @@ -762,6 +762,12 @@ func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string return nil } +// Shutdown shutdown the fs +func (f *Fs) Shutdown(ctx context.Context) error { + f.tokenRenewer.Shutdown() + return nil +} + // ------------------------------------------------------------ // Fs returns the parent Fs. @@ -997,6 +1003,7 @@ var ( _ fs.Copier = (*Fs)(nil) _ fs.Mover = (*Fs)(nil) _ fs.DirMover = (*Fs)(nil) + _ fs.Shutdowner = (*Fs)(nil) _ fs.Object = (*Object)(nil) _ fs.IDer = (*Object)(nil) ) diff --git a/backend/jottacloud/jottacloud.go b/backend/jottacloud/jottacloud.go index e9176f5b05b55..6fb68b289015e 100644 --- a/backend/jottacloud/jottacloud.go +++ b/backend/jottacloud/jottacloud.go @@ -1680,6 +1680,12 @@ func (f *Fs) CleanUp(ctx context.Context) error { return nil } +// Shutdown shutdown the fs +func (f *Fs) Shutdown(ctx context.Context) error { + f.tokenRenewer.Shutdown() + return nil +} + // Hashes returns the supported hash sets. func (f *Fs) Hashes() hash.Set { return hash.Set(hash.MD5) @@ -2104,6 +2110,7 @@ var ( _ fs.Abouter = (*Fs)(nil) _ fs.UserInfoer = (*Fs)(nil) _ fs.CleanUpper = (*Fs)(nil) + _ fs.Shutdowner = (*Fs)(nil) _ fs.Object = (*Object)(nil) _ fs.MimeTyper = (*Object)(nil) _ fs.Metadataer = (*Object)(nil) diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.go index 00781db8d1c53..5d8c68d030dbf 100644 --- a/backend/onedrive/onedrive.go +++ b/backend/onedrive/onedrive.go @@ -1377,6 +1377,12 @@ func (f *Fs) ListR(ctx context.Context, dir string, callback fs.ListRCallback) ( } +// Shutdown shutdown the fs +func (f *Fs) Shutdown(ctx context.Context) error { + f.tokenRenewer.Shutdown() + return nil +} + // Creates from the parameters passed in a half finished Object which // must have setMetaData called on it // @@ -2755,6 +2761,7 @@ var ( _ fs.PublicLinker = (*Fs)(nil) _ fs.CleanUpper = (*Fs)(nil) _ fs.ListRer = (*Fs)(nil) + _ fs.Shutdowner = (*Fs)(nil) _ fs.Object = (*Object)(nil) _ fs.MimeTyper = &Object{} _ fs.IDer = &Object{} diff --git a/backend/pcloud/pcloud.go b/backend/pcloud/pcloud.go index 9d6256b1ac7d9..64a48c25c67cb 100644 --- a/backend/pcloud/pcloud.go +++ b/backend/pcloud/pcloud.go @@ -948,6 +948,12 @@ func (f *Fs) About(ctx context.Context) (usage *fs.Usage, err error) { return usage, nil } +// Shutdown shutdown the fs +func (f *Fs) Shutdown(ctx context.Context) error { + f.tokenRenewer.Shutdown() + return nil +} + // Hashes returns the supported hash sets. func (f *Fs) Hashes() hash.Set { // EU region supports SHA1 and SHA256 (but rclone doesn't @@ -1280,6 +1286,7 @@ var ( _ fs.DirCacheFlusher = (*Fs)(nil) _ fs.PublicLinker = (*Fs)(nil) _ fs.Abouter = (*Fs)(nil) + _ fs.Shutdowner = (*Fs)(nil) _ fs.Object = (*Object)(nil) _ fs.IDer = (*Object)(nil) ) diff --git a/backend/premiumizeme/premiumizeme.go b/backend/premiumizeme/premiumizeme.go index 4adaa5af285cf..ef54aac9f38ab 100644 --- a/backend/premiumizeme/premiumizeme.go +++ b/backend/premiumizeme/premiumizeme.go @@ -770,6 +770,12 @@ func (f *Fs) PublicLink(ctx context.Context, remote string, expire fs.Duration, return o.(*Object).url, nil } +// Shutdown shutdown the fs +func (f *Fs) Shutdown(ctx context.Context) error { + f.tokenRenewer.Shutdown() + return nil +} + // About gets quota information func (f *Fs) About(ctx context.Context) (usage *fs.Usage, err error) { var resp *http.Response @@ -1110,6 +1116,7 @@ var ( _ fs.DirCacheFlusher = (*Fs)(nil) _ fs.Abouter = (*Fs)(nil) _ fs.PublicLinker = (*Fs)(nil) + _ fs.Shutdowner = (*Fs)(nil) _ fs.Object = (*Object)(nil) _ fs.MimeTyper = (*Object)(nil) _ fs.IDer = (*Object)(nil) diff --git a/backend/sharefile/sharefile.go b/backend/sharefile/sharefile.go index 92e6180104918..a135f8705f9e6 100644 --- a/backend/sharefile/sharefile.go +++ b/backend/sharefile/sharefile.go @@ -1176,6 +1176,12 @@ func (f *Fs) DirCacheFlush() { f.dirCache.ResetRoot() } +// Shutdown shutdown the fs +func (f *Fs) Shutdown(ctx context.Context) error { + f.tokenRenewer.Shutdown() + return nil +} + // Hashes returns the supported hash sets. func (f *Fs) Hashes() hash.Set { return hash.Set(hash.MD5) @@ -1466,6 +1472,7 @@ var ( _ fs.Copier = (*Fs)(nil) // _ fs.PutStreamer = (*Fs)(nil) _ fs.DirCacheFlusher = (*Fs)(nil) + _ fs.Shutdowner = (*Fs)(nil) _ fs.Object = (*Object)(nil) _ fs.IDer = (*Object)(nil) ) From 242fe96b1857a43f475933214870cd6722c64c1a Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 10 Dec 2023 22:29:42 +0000 Subject: [PATCH 051/130] Add keongalvin to contributors --- docs/content/authors.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/content/authors.md b/docs/content/authors.md index 66ff5a961fd62..44fe472d4a77a 100644 --- a/docs/content/authors.md +++ b/docs/content/authors.md @@ -810,3 +810,4 @@ put them back in again.` >}} * Eli Orzitzer * Anthony Metzidis * emyarod + * keongalvin From f98e672f377f704eec9a1e1e527bd4aa9e713f54 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 9 Dec 2023 12:06:32 +0000 Subject: [PATCH 052/130] selfupdate: fix crash in tests if beta not found --- cmd/selfupdate/selfupdate_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/selfupdate/selfupdate_test.go b/cmd/selfupdate/selfupdate_test.go index 92d1d91c79005..032c28bec89a9 100644 --- a/cmd/selfupdate/selfupdate_test.go +++ b/cmd/selfupdate/selfupdate_test.go @@ -17,6 +17,7 @@ import ( _ "github.com/rclone/rclone/fstest" // needed to run under integration tests "github.com/rclone/rclone/fstest/testy" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestGetVersion(t *testing.T) { @@ -76,7 +77,7 @@ func TestInstallOnLinux(t *testing.T) { // Must keep non-standard permissions assert.NoError(t, os.Chmod(path, 0644)) - assert.NoError(t, InstallUpdate(ctx, &Options{Beta: true, Output: path})) + require.NoError(t, InstallUpdate(ctx, &Options{Beta: true, Output: path})) info, err := os.Stat(path) assert.NoError(t, err) From c69eb84573c85206ab028eda2987180e049ef2e4 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 8 Dec 2023 14:00:22 +0000 Subject: [PATCH 053/130] chunker,compress,crypt,hasher,union: fix rclone move a file over itself deleting the file This fixes the Root() returned by the backend when it has returned fs.ErrorIsFile. Before this change it returned a root which included the file path. Because Root() was wrong this caused the detection of the file being moved over itself check to fail. This adds an integration test to check it for all backends. See: https://forum.rclone.org/t/rclone-move-chunker-dir-file-chunker-dir-deletes-all-file-chunks/43333/ --- backend/chunker/chunker.go | 8 ++++++++ backend/compress/compress.go | 8 ++++++++ backend/crypt/crypt.go | 7 +++++++ backend/hasher/hasher.go | 7 +++++++ backend/union/union.go | 7 +++++++ fstest/fstests/fstests.go | 18 ++++++++++++++++++ 6 files changed, 55 insertions(+) diff --git a/backend/chunker/chunker.go b/backend/chunker/chunker.go index bb4b498126a1e..baf4656eda923 100644 --- a/backend/chunker/chunker.go +++ b/backend/chunker/chunker.go @@ -325,6 +325,14 @@ func NewFs(ctx context.Context, name, rpath string, m configmap.Mapper) (fs.Fs, } } + // Correct root if definitely pointing to a file + if err == fs.ErrorIsFile { + f.root = path.Dir(f.root) + if f.root == "." || f.root == "/" { + f.root = "" + } + } + // Note 1: the features here are ones we could support, and they are // ANDed with the ones from wrappedFs. // Note 2: features.Fill() points features.PutStream to our PutStream, diff --git a/backend/compress/compress.go b/backend/compress/compress.go index f635c5e595621..b477512e74942 100644 --- a/backend/compress/compress.go +++ b/backend/compress/compress.go @@ -14,6 +14,7 @@ import ( "fmt" "io" "os" + "path" "regexp" "strings" "time" @@ -172,6 +173,13 @@ func NewFs(ctx context.Context, name, rpath string, m configmap.Mapper) (fs.Fs, opt: *opt, mode: compressionModeFromName(opt.CompressionMode), } + // Correct root if definitely pointing to a file + if err == fs.ErrorIsFile { + f.root = path.Dir(f.root) + if f.root == "." || f.root == "/" { + f.root = "" + } + } // the features here are ones we could support, and they are // ANDed with the ones from wrappedFs f.features = (&fs.Features{ diff --git a/backend/crypt/crypt.go b/backend/crypt/crypt.go index 281805fd5bef2..54b1335dc833d 100644 --- a/backend/crypt/crypt.go +++ b/backend/crypt/crypt.go @@ -253,6 +253,13 @@ func NewFs(ctx context.Context, name, rpath string, m configmap.Mapper) (fs.Fs, cipher: cipher, } cache.PinUntilFinalized(f.Fs, f) + // Correct root if definitely pointing to a file + if err == fs.ErrorIsFile { + f.root = path.Dir(f.root) + if f.root == "." || f.root == "/" { + f.root = "" + } + } // the features here are ones we could support, and they are // ANDed with the ones from wrappedFs f.features = (&fs.Features{ diff --git a/backend/hasher/hasher.go b/backend/hasher/hasher.go index 3428b4dc2c0d1..325f7f6190fad 100644 --- a/backend/hasher/hasher.go +++ b/backend/hasher/hasher.go @@ -114,6 +114,13 @@ func NewFs(ctx context.Context, fsname, rpath string, cmap configmap.Mapper) (fs root: rpath, opt: opt, } + // Correct root if definitely pointing to a file + if err == fs.ErrorIsFile { + f.root = path.Dir(f.root) + if f.root == "." || f.root == "/" { + f.root = "" + } + } baseFeatures := baseFs.Features() f.fpTime = baseFs.Precision() != fs.ModTimeNotSupported diff --git a/backend/union/union.go b/backend/union/union.go index eeaed8f31b727..5854afc112da2 100644 --- a/backend/union/union.go +++ b/backend/union/union.go @@ -877,6 +877,13 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e opt: *opt, upstreams: usedUpstreams, } + // Correct root if definitely pointing to a file + if fserr == fs.ErrorIsFile { + f.root = path.Dir(f.root) + if f.root == "." || f.root == "/" { + f.root = "" + } + } err = upstream.Prepare(f.upstreams) if err != nil { return nil, err diff --git a/fstest/fstests/fstests.go b/fstest/fstests/fstests.go index 7ab03dd60541d..095a94d235d0b 100644 --- a/fstest/fstests/fstests.go +++ b/fstest/fstests/fstests.go @@ -1675,6 +1675,24 @@ func Run(t *testing.T, opt *Opt) { require.NotNil(t, fileRemote) assert.Equal(t, fs.ErrorIsFile, err) + // Check Fs.Root returns the right thing + t.Run("FsRoot", func(t *testing.T) { + skipIfNotOk(t) + got := fileRemote.Root() + remoteDir := path.Dir(remoteName) + want := remoteDir + colon := strings.LastIndex(want, ":") + if colon >= 0 { + want = want[colon+1:] + } + if isLocalRemote { + // only check last path element on local + require.Equal(t, filepath.Base(remoteDir), filepath.Base(got)) + } else { + require.Equal(t, want, got) + } + }) + if strings.HasPrefix(remoteName, "TestChunker") && strings.Contains(remoteName, "Nometa") { // TODO fix chunker and remove this bypass t.Logf("Skip listing check -- chunker can't yet handle this tricky case") From 743ea6ac263895fb0091df140bbb6c4e2196e97f Mon Sep 17 00:00:00 2001 From: Manoj Ghosh Date: Fri, 15 Dec 2023 02:13:35 -0800 Subject: [PATCH 054/130] oracle object storage: fix object storage endpoint for custom endpoints --- backend/oracleobjectstorage/client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/oracleobjectstorage/client.go b/backend/oracleobjectstorage/client.go index 6be770d425a5d..cd28ef66af515 100644 --- a/backend/oracleobjectstorage/client.go +++ b/backend/oracleobjectstorage/client.go @@ -70,6 +70,9 @@ func newObjectStorageClient(ctx context.Context, opt *Options) (*objectstorage.O if opt.Region != "" { client.SetRegion(opt.Region) } + if opt.Endpoint != "" { + client.Host = opt.Endpoint + } modifyClient(ctx, opt, &client.BaseClient) return &client, err } From 8503282a5adffc992e1834eed2cd8aeca57c01dd Mon Sep 17 00:00:00 2001 From: Oksana <142890647+oks-maytech@users.noreply.github.com> Date: Mon, 18 Dec 2023 16:15:13 +0200 Subject: [PATCH 055/130] azure-files: fix storage base url Documented in https://learn.microsoft.com/en-us/azure/storage/common/storage-account-overview --- backend/azurefiles/azurefiles.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/azurefiles/azurefiles.go b/backend/azurefiles/azurefiles.go index fd8b4a06e9147..95275f6d7333a 100644 --- a/backend/azurefiles/azurefiles.go +++ b/backend/azurefiles/azurefiles.go @@ -65,7 +65,7 @@ import ( const ( maxFileSize = 4 * fs.Tebi defaultChunkSize = 4 * fs.Mebi - storageDefaultBaseURL = "core.windows.net" // FIXME not sure this is correct + storageDefaultBaseURL = "file.core.windows.net" ) func init() { From fba2d4c4a7c4ae4059c5d0a21f90df3b524088cb Mon Sep 17 00:00:00 2001 From: rarspace01 Date: Sat, 30 Dec 2023 18:10:27 +0100 Subject: [PATCH 056/130] docs: fix broken link in serve webdav --- docs/content/commands/rclone_serve_webdav.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/commands/rclone_serve_webdav.md b/docs/content/commands/rclone_serve_webdav.md index a2f6554b17a33..cbd0ff0c027ef 100644 --- a/docs/content/commands/rclone_serve_webdav.md +++ b/docs/content/commands/rclone_serve_webdav.md @@ -506,7 +506,7 @@ together, if `--auth-proxy` is set the authorized keys option will be ignored. There is an example program -[bin/test_proxy.py](https://github.com/rclone/rclone/blob/master/test_proxy.py) +[bin/test_proxy.py](https://github.com/rclone/rclone/blob/master/bin/test_proxy.py) in the rclone source code. The program's job is to take a `user` and `pass` on the input and turn From 3bf8c877c3394a289d03bdd08a4d09c06e69e22b Mon Sep 17 00:00:00 2001 From: albertony <12441419+albertony@users.noreply.github.com> Date: Mon, 1 Jan 2024 21:36:50 +0100 Subject: [PATCH 057/130] docs/librclone: the newer and recommended ucrt64 subsystem of msys2 can now be used for building on windows --- librclone/README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/librclone/README.md b/librclone/README.md index 3b80f9f98ba85..7566d3091a3c4 100644 --- a/librclone/README.md +++ b/librclone/README.md @@ -12,16 +12,17 @@ notice will be removed. The shims are a thin wrapper over the rclone RPC. The implementation is based on cgo; to build it you need Go and a GCC compatible -C compiler (GCC or Clang). On Windows you can use the MinGW port of GCC, -e.g. by installing it in a [MSYS2](https://www.msys2.org) distribution -(make sure you install GCC in the classic mingw64 subsystem, the ucrt64 version -is not compatible with cgo). +C compiler (GCC or Clang). On Windows you can use the MinGW ports, e.g. by installing +in a [MSYS2](https://www.msys2.org) distribution (you may now install GCC in the newer +and recommended UCRT64 subsystem, however there were compatibility issues with previous +versions of cgo where, if not force rebuild with go build option `-a` helped, you had +to resort to the classic MINGW64 subsystem). -Build a shared library like this: +Build a shared library like this (change from .so to .dll on Windows): go build --buildmode=c-shared -o librclone.so github.com/rclone/rclone/librclone -Build a static library like this: +Build a static library like this (change from .a to .lib on Windows): go build --buildmode=c-archive -o librclone.a github.com/rclone/rclone/librclone From 3ca766b2f11a7e84322d04fbe65cc8334aa30ee5 Mon Sep 17 00:00:00 2001 From: nielash Date: Thu, 21 Dec 2023 14:06:06 -0500 Subject: [PATCH 058/130] hasher: fix invalid memory address error when MaxAge == 0 When f.opt.MaxAge == 0, f.db is never set, however several methods later assume it is set and attempt to access it, causing an invalid memory address error. This change fixes the issue in a few spots (there may still be others I haven't yet encountered.) --- backend/hasher/commands.go | 8 ++++++++ backend/hasher/hasher.go | 4 +++- backend/hasher/hasher_internal_test.go | 8 +++++--- backend/hasher/hasher_test.go | 5 +++++ lib/kv/bolt.go | 2 +- 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/backend/hasher/commands.go b/backend/hasher/commands.go index 517ab17ccd8be..a6eff7efded64 100644 --- a/backend/hasher/commands.go +++ b/backend/hasher/commands.go @@ -80,6 +80,14 @@ func (f *Fs) dbDump(ctx context.Context, full bool, root string) error { } root = fspath.JoinRootPath(remoteFs.Root(), f.Root()) } + if f.db == nil { + if f.opt.MaxAge == 0 { + fs.Errorf(f, "db not found. (disabled with max_age = 0)") + } else { + fs.Errorf(f, "db not found.") + } + return kv.ErrInactive + } op := &kvDump{ full: full, root: root, diff --git a/backend/hasher/hasher.go b/backend/hasher/hasher.go index 325f7f6190fad..a6e83039fb856 100644 --- a/backend/hasher/hasher.go +++ b/backend/hasher/hasher.go @@ -418,7 +418,9 @@ func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string // Shutdown the backend, closing any background tasks and any cached connections. func (f *Fs) Shutdown(ctx context.Context) (err error) { - err = f.db.Stop(false) + if f.db != nil { + err = f.db.Stop(false) + } if do := f.Fs.Features().Shutdown; do != nil { if err2 := do(ctx); err2 != nil { err = err2 diff --git a/backend/hasher/hasher_internal_test.go b/backend/hasher/hasher_internal_test.go index 0ca418e20a965..e289d8f0d98b7 100644 --- a/backend/hasher/hasher_internal_test.go +++ b/backend/hasher/hasher_internal_test.go @@ -60,9 +60,11 @@ func (f *Fs) testUploadFromCrypt(t *testing.T) { assert.NotNil(t, dst) // check that hash was created - hash, err = f.getRawHash(ctx, hashType, fileName, anyFingerprint, longTime) - assert.NoError(t, err) - assert.NotEmpty(t, hash) + if f.opt.MaxAge > 0 { + hash, err = f.getRawHash(ctx, hashType, fileName, anyFingerprint, longTime) + assert.NoError(t, err) + assert.NotEmpty(t, hash) + } //t.Logf("hash is %q", hash) _ = operations.Purge(ctx, f, dirName) } diff --git a/backend/hasher/hasher_test.go b/backend/hasher/hasher_test.go index f17303ecc16a2..f5119c724c5b9 100644 --- a/backend/hasher/hasher_test.go +++ b/backend/hasher/hasher_test.go @@ -37,4 +37,9 @@ func TestIntegration(t *testing.T) { opt.QuickTestOK = true } fstests.Run(t, &opt) + // test again with MaxAge = 0 + if *fstest.RemoteName == "" { + opt.ExtraConfig = append(opt.ExtraConfig, fstests.ExtraConfigItem{Name: "TestHasher", Key: "max_age", Value: "0"}) + fstests.Run(t, &opt) + } } diff --git a/lib/kv/bolt.go b/lib/kv/bolt.go index 6fcfe49ddc994..2a411c3dd9c90 100644 --- a/lib/kv/bolt.go +++ b/lib/kv/bolt.go @@ -216,7 +216,7 @@ func (db *DB) loop() { // Do a key-value operation and return error when done func (db *DB) Do(write bool, op Op) error { - if db.queue == nil { + if db == nil || db.queue == nil { return ErrInactive } r := &request{ From 394195cfdf9b2b407a47b03f6d768ad845891114 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 31 Dec 2023 18:07:11 +0000 Subject: [PATCH 059/130] Add rarspace01 to contributors --- docs/content/authors.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/content/authors.md b/docs/content/authors.md index 44fe472d4a77a..8e797320a67b7 100644 --- a/docs/content/authors.md +++ b/docs/content/authors.md @@ -811,3 +811,4 @@ put them back in again.` >}} * Anthony Metzidis * emyarod * keongalvin + * rarspace01 From a3d19942bd22d4c777420c2c3b2607949bd9c584 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 27 Dec 2023 16:19:31 +0000 Subject: [PATCH 060/130] googlephotos: fix nil pointer exception when batch failed This was a simple error check that was missing. Interestingly the errcheck linter did not spot this. See: https://forum.rclone.org/t/invalid-memory-address-or-nil-pointer-dereference-error-when-copy-to-google-photos/43634/ --- backend/googlephotos/googlephotos.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/googlephotos/googlephotos.go b/backend/googlephotos/googlephotos.go index df031b606d8df..0b0290d3ac962 100644 --- a/backend/googlephotos/googlephotos.go +++ b/backend/googlephotos/googlephotos.go @@ -1143,6 +1143,9 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op info = results[0] } } + if err != nil { + return fmt.Errorf("failed to commit batch: %w", err) + } o.setMetaData(info) From bb679a9def96019f05c2b9ca473b27c2de2190e2 Mon Sep 17 00:00:00 2001 From: Paul Stern Date: Sat, 2 Dec 2023 19:27:55 +0300 Subject: [PATCH 061/130] backend: add description field for all backends Fixes #4391 --- cmd/listremotes/listremotes.go | 12 +++++++++--- fs/config/ui_test.go | 1 + fs/registry.go | 8 ++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/cmd/listremotes/listremotes.go b/cmd/listremotes/listremotes.go index 6f63ba26b5856..68dd291c6f363 100644 --- a/cmd/listremotes/listremotes.go +++ b/cmd/listremotes/listremotes.go @@ -19,7 +19,7 @@ var ( func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() - flags.BoolVarP(cmdFlags, &listLong, "long", "", listLong, "Show the type as well as names", "") + flags.BoolVarP(cmdFlags, &listLong, "long", "", listLong, "Show the type and the description as well as names", "") } var commandDefinition = &cobra.Command{ @@ -28,7 +28,7 @@ var commandDefinition = &cobra.Command{ Long: ` rclone listremotes lists all the available remotes from the config file. -When used with the ` + "`--long`" + ` flag it lists the types too. +When used with the ` + "`--long`" + ` flag it lists the types and the descriptions too. `, Annotations: map[string]string{ "versionIntroduced": "v1.34", @@ -38,15 +38,21 @@ When used with the ` + "`--long`" + ` flag it lists the types too. remotes := config.FileSections() sort.Strings(remotes) maxlen := 1 + maxlentype := 1 for _, remote := range remotes { if len(remote) > maxlen { maxlen = len(remote) } + t := config.FileGet(remote, "type") + if len(t) > maxlentype { + maxlentype = len(t) + } } for _, remote := range remotes { if listLong { remoteType := config.FileGet(remote, "type") - fmt.Printf("%-*s %s\n", maxlen+1, remote+":", remoteType) + description := config.FileGet(remote, "description") + fmt.Printf("%-*s %-*s %s\n", maxlen+1, remote+":", maxlentype+1, remoteType, description) } else { fmt.Printf("%s:\n", remote) } diff --git a/fs/config/ui_test.go b/fs/config/ui_test.go index 6a4d5aee09142..172921c9b709b 100644 --- a/fs/config/ui_test.go +++ b/fs/config/ui_test.go @@ -104,6 +104,7 @@ func TestCRUD(t *testing.T) { "y", // type my own password "secret", // password "secret", // repeat + "n", // don't edit advanced config "y", // looks good, save }) require.NoError(t, config.NewRemote(ctx, "test")) diff --git a/fs/registry.go b/fs/registry.go index 1ecd2c3054405..ddabfd6df87ec 100644 --- a/fs/registry.go +++ b/fs/registry.go @@ -19,6 +19,13 @@ import ( // Registry of filesystems var Registry []*RegInfo +// optDescription is a basic description option +var optDescription = Option{ + Name: "description", + Help: "Description of the remote", + Advanced: true, +} + // RegInfo provides information about a filesystem type RegInfo struct { // Name of this fs @@ -283,6 +290,7 @@ func Register(info *RegInfo) { if info.Prefix == "" { info.Prefix = info.Name } + info.Options = append(info.Options, optDescription) Registry = append(Registry, info) for _, alias := range info.Aliases { // Copy the info block and rename and hide the alias and options From d977fa25fa0e0eaafeeb0bf1126dd312db51ede8 Mon Sep 17 00:00:00 2001 From: WeidiDeng Date: Wed, 3 Jan 2024 20:21:08 +0800 Subject: [PATCH 062/130] ftp: fix multi-thread copy Before this change multi-thread copies using the FTP backend used to error with 551 Error reading file This was caused by a spurious error being reported which this code silences. Fixes #7532 See #3942 --- fstest/test_all/config.yaml | 4 ---- lib/readers/limited.go | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/fstest/test_all/config.yaml b/fstest/test_all/config.yaml index 0e79602aa772a..cba00b2a6f817 100644 --- a/fstest/test_all/config.yaml +++ b/fstest/test_all/config.yaml @@ -298,10 +298,6 @@ backends: fastlist: false - backend: "ftp" remote: "TestFTPRclone:" - ignore: - - "TestMultithreadCopy/{size:131071_streams:2}" - - "TestMultithreadCopy/{size:131072_streams:2}" - - "TestMultithreadCopy/{size:131073_streams:2}" fastlist: false - backend: "box" remote: "TestBox:" diff --git a/lib/readers/limited.go b/lib/readers/limited.go index 218dd661a0a6d..2b346f47e6db9 100644 --- a/lib/readers/limited.go +++ b/lib/readers/limited.go @@ -1,6 +1,10 @@ package readers -import "io" +import ( + "io" + + "github.com/rclone/rclone/fs" +) // LimitedReadCloser adds io.Closer to io.LimitedReader. Create one with NewLimitedReadCloser type LimitedReadCloser struct { @@ -8,6 +12,16 @@ type LimitedReadCloser struct { io.Closer } +// Close closes the underlying io.Closer. The error, if any, will be ignored if data is read completely +func (lrc *LimitedReadCloser) Close() error { + err := lrc.Closer.Close() + if err != nil && lrc.N == 0 { + fs.Debugf(nil, "ignoring close error because we already got all the data") + err = nil + } + return err +} + // NewLimitedReadCloser returns a LimitedReadCloser wrapping rc to // limit it to reading limit bytes. If limit < 0 then it does not // wrap rc, it just returns it. From 451d7badf7ca4cd296029bff82119f4d2755ee94 Mon Sep 17 00:00:00 2001 From: rkonfj Date: Wed, 3 Jan 2024 20:25:42 +0800 Subject: [PATCH 063/130] oauthutil: avoid panic when `*token` and `*ts.token` are the same the field `raw` of `oauth2.Token` may be an uncomparable type(often map[string]interface{}), causing `*token != *ts.token` expression to panic(comparing uncomparable type ...). the semantics of comparing whether two tokens are the same can be achieved by comparing accessToken, refreshToken and expire to avoid panic. --- lib/oauthutil/oauthutil.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/oauthutil/oauthutil.go b/lib/oauthutil/oauthutil.go index d3562e41a2e74..7b0fb9d9d6ae4 100644 --- a/lib/oauthutil/oauthutil.go +++ b/lib/oauthutil/oauthutil.go @@ -292,7 +292,7 @@ func (ts *TokenSource) Token() (*oauth2.Token, error) { if err != nil { return nil, fmt.Errorf("couldn't fetch token: %w", err) } - changed = changed || (*token != *ts.token) + changed = changed || token.AccessToken != ts.token.AccessToken || token.RefreshToken != ts.token.RefreshToken || token.Expiry != ts.token.Expiry ts.token = token if changed { // Bump on the expiry timer if it is set From 64df4cf2db54500db2b02c7b5272b57d0c634ec1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Jan 2024 15:47:34 +0000 Subject: [PATCH 064/130] build(deps): bump golang.org/x/crypto to fix ssh terrapin CVE-2023-48795 Fixes SSH terrapin attack: see https://terrapin-attack.com. Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0. - [Commits](https://github.com/golang/crypto/compare/v0.14.0...v0.17.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 8 ++++---- go.sum | 12 ++++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 046a3433c8688..ebb54366dfc27 100644 --- a/go.mod +++ b/go.mod @@ -70,12 +70,12 @@ require ( github.com/yunify/qingstor-sdk-go/v3 v3.2.0 go.etcd.io/bbolt v1.3.8 goftp.io/server/v2 v2.0.1 - golang.org/x/crypto v0.14.0 + golang.org/x/crypto v0.17.0 golang.org/x/net v0.17.0 golang.org/x/oauth2 v0.13.0 golang.org/x/sync v0.4.0 - golang.org/x/sys v0.13.0 - golang.org/x/text v0.13.0 + golang.org/x/sys v0.15.0 + golang.org/x/text v0.14.0 golang.org/x/time v0.3.0 google.golang.org/api v0.148.0 gopkg.in/validator.v2 v2.0.1 @@ -192,5 +192,5 @@ require ( github.com/google/go-querystring v1.1.0 // indirect github.com/pkg/xattr v0.4.9 golang.org/x/mobile v0.0.0-20231006135142-2b44d11868fe - golang.org/x/term v0.13.0 + golang.org/x/term v0.15.0 ) diff --git a/go.sum b/go.sum index f9b8ce2990005..d6c5d8bb13295 100644 --- a/go.sum +++ b/go.sum @@ -589,8 +589,9 @@ golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -747,8 +748,9 @@ golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -757,8 +759,9 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -772,8 +775,9 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From 7aa066cff8024a0a62ab96018216e2e3f3a13696 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 3 Jan 2024 15:42:11 +0000 Subject: [PATCH 065/130] Add Paul Stern to contributors --- docs/content/authors.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/content/authors.md b/docs/content/authors.md index 8e797320a67b7..986b3628aad4b 100644 --- a/docs/content/authors.md +++ b/docs/content/authors.md @@ -812,3 +812,4 @@ put them back in again.` >}} * emyarod * keongalvin * rarspace01 + * Paul Stern From 208e49ce4bd230e342653ec7344e61a6668fb5ce Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 1 Dec 2023 16:31:51 +0000 Subject: [PATCH 066/130] fs: update use of math/rand to modern practice --- backend/onedrive/quickxorhash/quickxorhash_test.go | 6 ++++-- fstest/fstest.go | 4 +--- vfs/test_vfs/test_vfs.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/onedrive/quickxorhash/quickxorhash_test.go b/backend/onedrive/quickxorhash/quickxorhash_test.go index 40539439d058f..c38c4d88b7a5c 100644 --- a/backend/onedrive/quickxorhash/quickxorhash_test.go +++ b/backend/onedrive/quickxorhash/quickxorhash_test.go @@ -1,10 +1,10 @@ package quickxorhash import ( + "crypto/rand" "encoding/base64" "fmt" "hash" - "math/rand" "testing" "github.com/stretchr/testify/assert" @@ -171,7 +171,9 @@ var _ hash.Hash = (*quickXorHash)(nil) func BenchmarkQuickXorHash(b *testing.B) { b.SetBytes(1 << 20) buf := make([]byte, 1<<20) - rand.Read(buf) + n, err := rand.Read(buf) + require.NoError(b, err) + require.Equal(b, len(buf), n) h := New() b.ResetTimer() for i := 0; i < b.N; i++ { diff --git a/fstest/fstest.go b/fstest/fstest.go index 9a3f75753543d..8a6e9e918e3c9 100644 --- a/fstest/fstest.go +++ b/fstest/fstest.go @@ -10,7 +10,6 @@ import ( "fmt" "io" "log" - "math/rand" "os" "path" "path/filepath" @@ -52,8 +51,7 @@ var ( // Seed the random number generator func init() { - rand.Seed(time.Now().UnixNano()) - + _ = random.Seed() } // Initialise rclone for testing diff --git a/vfs/test_vfs/test_vfs.go b/vfs/test_vfs/test_vfs.go index 53a8208f115e7..3e70ce1cb69cd 100644 --- a/vfs/test_vfs/test_vfs.go +++ b/vfs/test_vfs/test_vfs.go @@ -31,7 +31,7 @@ var ( // Seed the random number generator func init() { - rand.Seed(time.Now().UnixNano()) + _ = random.Seed() } From 578b9df6eae50dd75283ba3190408542a0fb2f53 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 3 Jan 2024 17:26:13 +0000 Subject: [PATCH 067/130] build: fix docker build on arm/v6 Unexpectedly the team which runs the Go docker images have removed the arm/v6 image which means that the rclone docker images no longer build. One of the recommended fixes is what we've done here - switch to the alpine builder. This has the advantage that it actually builds arm/v6 architecture unlike the previous builder which build arm/v5. See: https://github.com/docker-library/golang/issues/502 --- Dockerfile | 3 ++- RELEASE.md | 31 ++++++++++--------------------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index fa6cc94c53c46..82f16aad784a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,9 @@ -FROM golang AS builder +FROM golang:alpine AS builder COPY . /go/src/github.com/rclone/rclone/ WORKDIR /go/src/github.com/rclone/rclone/ +RUN apk add --no-cache make bash gawk git RUN \ CGO_ENABLED=0 \ make diff --git a/RELEASE.md b/RELEASE.md index 09bc34a4dfcf6..71e5b791836af 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -124,32 +124,21 @@ Cherry pick any changes back to master and the stable branch if it is active. ## Making a manual build of docker -The rclone docker image should autobuild on via GitHub actions. If it doesn't -or needs to be updated then rebuild like this. +To do a basic build of rclone's docker image to debug builds locally: -See: https://github.com/ilteoood/docker_buildx/issues/19 -See: https://github.com/ilteoood/docker_buildx/blob/master/scripts/install_buildx.sh +``` +docker buildx build --load -t rclone/rclone:testing --progress=plain . +docker run --rm rclone/rclone:testing version +``` + +To test the multipatform build ``` -git co v1.54.1 -docker pull golang -export DOCKER_CLI_EXPERIMENTAL=enabled -docker buildx create --name actions_builder --use -docker run --rm --privileged docker/binfmt:820fdd95a9972a5308930a2bdfb8573dd4447ad3 -docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -SUPPORTED_PLATFORMS=$(docker buildx inspect --bootstrap | grep 'Platforms:*.*' | cut -d : -f2,3) -echo "Supported platforms: $SUPPORTED_PLATFORMS" -docker buildx build --platform linux/amd64,linux/386,linux/arm64,linux/arm/v7 -t rclone/rclone:1.54.1 -t rclone/rclone:1.54 -t rclone/rclone:1 -t rclone/rclone:latest --push . -docker buildx stop actions_builder +docker buildx build -t rclone/rclone:testing --progress=plain --platform linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6 . ``` -### Old build for linux/amd64 only +To make a full build then set the tags correctly and add `--push` ``` -docker pull golang -docker build --rm --ulimit memlock=67108864 -t rclone/rclone:1.52.0 -t rclone/rclone:1.52 -t rclone/rclone:1 -t rclone/rclone:latest . -docker push rclone/rclone:1.52.0 -docker push rclone/rclone:1.52 -docker push rclone/rclone:1 -docker push rclone/rclone:latest +docker buildx build --platform linux/amd64,linux/386,linux/arm64,linux/arm/v7 -t rclone/rclone:1.54.1 -t rclone/rclone:1.54 -t rclone/rclone:1 -t rclone/rclone:latest --push . ``` From 0e746f25a319269c39e2f5b55578b7a4bf38e9aa Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 3 Jan 2024 11:49:46 +0000 Subject: [PATCH 068/130] amazonclouddrive: remove Amazon Drive backend code and docs #7539 The Amazon Drive backend is closed from 2023-12-31. See: https://www.amazon.com/b?ie=UTF8&node=23943055011 --- README.md | 1 - backend/all/all.go | 1 - backend/amazonclouddrive/amazonclouddrive.go | 1376 ----------------- .../amazonclouddrive/amazonclouddrive_test.go | 21 - bin/make_changelog.py | 3 - bin/make_manual.py | 1 - cmd/test/info/all.sh | 1 - cmd/test/info/test.sh | 1 - docs/content/_index.md | 1 - docs/content/amazonclouddrive.md | 334 +--- docs/content/crypt.md | 2 +- docs/content/docs.md | 1 - docs/content/overview.md | 2 - docs/content/remote_setup.md | 4 +- docs/content/s3.md | 66 +- docs/layouts/chrome/navbar.html | 1 - fstest/fstest.go | 2 +- fstest/test_all/config.yaml | 3 - lib/pacer/pacer_test.go | 32 - lib/pacer/pacers.go | 64 - 20 files changed, 29 insertions(+), 1888 deletions(-) delete mode 100644 backend/amazonclouddrive/amazonclouddrive.go delete mode 100644 backend/amazonclouddrive/amazonclouddrive_test.go diff --git a/README.md b/README.md index fc8c8fe57bf12..87835b0f60684 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,6 @@ Rclone *("rsync for cloud storage")* is a command-line program to sync files and * 1Fichier [:page_facing_up:](https://rclone.org/fichier/) * Akamai Netstorage [:page_facing_up:](https://rclone.org/netstorage/) * Alibaba Cloud (Aliyun) Object Storage System (OSS) [:page_facing_up:](https://rclone.org/s3/#alibaba-oss) - * Amazon Drive [:page_facing_up:](https://rclone.org/amazonclouddrive/) ([See note](https://rclone.org/amazonclouddrive/#status)) * Amazon S3 [:page_facing_up:](https://rclone.org/s3/) * ArvanCloud Object Storage (AOS) [:page_facing_up:](https://rclone.org/s3/#arvan-cloud-object-storage-aos) * Backblaze B2 [:page_facing_up:](https://rclone.org/b2/) diff --git a/backend/all/all.go b/backend/all/all.go index 8afb991bba4cf..e90877eda4e6f 100644 --- a/backend/all/all.go +++ b/backend/all/all.go @@ -4,7 +4,6 @@ package all import ( // Active file systems _ "github.com/rclone/rclone/backend/alias" - _ "github.com/rclone/rclone/backend/amazonclouddrive" _ "github.com/rclone/rclone/backend/azureblob" _ "github.com/rclone/rclone/backend/azurefiles" _ "github.com/rclone/rclone/backend/b2" diff --git a/backend/amazonclouddrive/amazonclouddrive.go b/backend/amazonclouddrive/amazonclouddrive.go deleted file mode 100644 index c5a123915623a..0000000000000 --- a/backend/amazonclouddrive/amazonclouddrive.go +++ /dev/null @@ -1,1376 +0,0 @@ -// Package amazonclouddrive provides an interface to the Amazon Cloud -// Drive object storage system. -package amazonclouddrive - -/* -FIXME make searching for directory in id and file in id more efficient -- use the name: search parameter - remember the escaping rules -- use Folder GetNode and GetFile - -FIXME make the default for no files and no dirs be (FILE & FOLDER) so -we ignore assets completely! -*/ - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "io" - "net/http" - "path" - "strings" - "time" - - acd "github.com/ncw/go-acd" - "github.com/rclone/rclone/fs" - "github.com/rclone/rclone/fs/config" - "github.com/rclone/rclone/fs/config/configmap" - "github.com/rclone/rclone/fs/config/configstruct" - "github.com/rclone/rclone/fs/fserrors" - "github.com/rclone/rclone/fs/fshttp" - "github.com/rclone/rclone/fs/hash" - "github.com/rclone/rclone/lib/dircache" - "github.com/rclone/rclone/lib/encoder" - "github.com/rclone/rclone/lib/oauthutil" - "github.com/rclone/rclone/lib/pacer" - "golang.org/x/oauth2" -) - -const ( - folderKind = "FOLDER" - fileKind = "FILE" - statusAvailable = "AVAILABLE" - timeFormat = time.RFC3339 // 2014-03-07T22:31:12.173Z - minSleep = 20 * time.Millisecond - warnFileSize = 50000 << 20 // Display warning for files larger than this size - defaultTempLinkThreshold = fs.SizeSuffix(9 << 30) // Download files bigger than this via the tempLink -) - -// Globals -var ( - // Description of how to auth for this app - acdConfig = &oauth2.Config{ - Scopes: []string{"clouddrive:read_all", "clouddrive:write"}, - Endpoint: oauth2.Endpoint{ - AuthURL: "https://www.amazon.com/ap/oa", - TokenURL: "https://api.amazon.com/auth/o2/token", - }, - ClientID: "", - ClientSecret: "", - RedirectURL: oauthutil.RedirectURL, - } -) - -// Register with Fs -func init() { - fs.Register(&fs.RegInfo{ - Name: "amazon cloud drive", - Prefix: "acd", - Description: "Amazon Drive", - NewFs: NewFs, - Config: func(ctx context.Context, name string, m configmap.Mapper, config fs.ConfigIn) (*fs.ConfigOut, error) { - return oauthutil.ConfigOut("", &oauthutil.Options{ - OAuth2Config: acdConfig, - }) - }, - Options: append(oauthutil.SharedOptions, []fs.Option{{ - Name: "checkpoint", - Help: "Checkpoint for internal polling (debug).", - Hide: fs.OptionHideBoth, - Advanced: true, - }, { - Name: "upload_wait_per_gb", - Help: `Additional time per GiB to wait after a failed complete upload to see if it appears. - -Sometimes Amazon Drive gives an error when a file has been fully -uploaded but the file appears anyway after a little while. This -happens sometimes for files over 1 GiB in size and nearly every time for -files bigger than 10 GiB. This parameter controls the time rclone waits -for the file to appear. - -The default value for this parameter is 3 minutes per GiB, so by -default it will wait 3 minutes for every GiB uploaded to see if the -file appears. - -You can disable this feature by setting it to 0. This may cause -conflict errors as rclone retries the failed upload but the file will -most likely appear correctly eventually. - -These values were determined empirically by observing lots of uploads -of big files for a range of file sizes. - -Upload with the "-v" flag to see more info about what rclone is doing -in this situation.`, - Default: fs.Duration(180 * time.Second), - Advanced: true, - }, { - Name: "templink_threshold", - Help: `Files >= this size will be downloaded via their tempLink. - -Files this size or more will be downloaded via their "tempLink". This -is to work around a problem with Amazon Drive which blocks downloads -of files bigger than about 10 GiB. The default for this is 9 GiB which -shouldn't need to be changed. - -To download files above this threshold, rclone requests a "tempLink" -which downloads the file through a temporary URL directly from the -underlying S3 storage.`, - Default: defaultTempLinkThreshold, - Advanced: true, - }, { - Name: config.ConfigEncoding, - Help: config.ConfigEncodingHelp, - Advanced: true, - // Encode invalid UTF-8 bytes as json doesn't handle them properly. - Default: (encoder.Base | - encoder.EncodeInvalidUtf8), - }}...), - }) -} - -// Options defines the configuration for this backend -type Options struct { - Checkpoint string `config:"checkpoint"` - UploadWaitPerGB fs.Duration `config:"upload_wait_per_gb"` - TempLinkThreshold fs.SizeSuffix `config:"templink_threshold"` - Enc encoder.MultiEncoder `config:"encoding"` -} - -// Fs represents a remote acd server -type Fs struct { - name string // name of this remote - features *fs.Features // optional features - opt Options // options for this Fs - ci *fs.ConfigInfo // global config - c *acd.Client // the connection to the acd server - noAuthClient *http.Client // unauthenticated http client - root string // the path we are working on - dirCache *dircache.DirCache // Map of directory path to directory id - pacer *fs.Pacer // pacer for API calls - trueRootID string // ID of true root directory - tokenRenewer *oauthutil.Renew // renew the token on expiry -} - -// Object describes an acd object -// -// Will definitely have info but maybe not meta -type Object struct { - fs *Fs // what this object is part of - remote string // The remote path - info *acd.Node // Info from the acd object if known -} - -// ------------------------------------------------------------ - -// Name of the remote (as passed into NewFs) -func (f *Fs) Name() string { - return f.name -} - -// Root of the remote (as passed into NewFs) -func (f *Fs) Root() string { - return f.root -} - -// String converts this Fs to a string -func (f *Fs) String() string { - return fmt.Sprintf("amazon drive root '%s'", f.root) -} - -// Features returns the optional features of this Fs -func (f *Fs) Features() *fs.Features { - return f.features -} - -// parsePath parses an acd 'url' -func parsePath(path string) (root string) { - root = strings.Trim(path, "/") - return -} - -// retryErrorCodes is a slice of error codes that we will retry -var retryErrorCodes = []int{ - 400, // Bad request (seen in "Next token is expired") - 401, // Unauthorized (seen in "Token has expired") - 408, // Request Timeout - 429, // Rate exceeded. - 500, // Get occasional 500 Internal Server Error - 502, // Bad Gateway when doing big listings - 503, // Service Unavailable - 504, // Gateway Time-out -} - -// shouldRetry returns a boolean as to whether this resp and err -// deserve to be retried. It returns the err as a convenience -func (f *Fs) shouldRetry(ctx context.Context, resp *http.Response, err error) (bool, error) { - if fserrors.ContextError(ctx, &err) { - return false, err - } - if resp != nil { - if resp.StatusCode == 401 { - f.tokenRenewer.Invalidate() - fs.Debugf(f, "401 error received - invalidating token") - return true, err - } - // Work around receiving this error sporadically on authentication - // - // HTTP code 403: "403 Forbidden", response body: {"message":"Authorization header requires 'Credential' parameter. Authorization header requires 'Signature' parameter. Authorization header requires 'SignedHeaders' parameter. Authorization header requires existence of either a 'X-Amz-Date' or a 'Date' header. Authorization=Bearer"} - if resp.StatusCode == 403 && strings.Contains(err.Error(), "Authorization header requires") { - fs.Debugf(f, "403 \"Authorization header requires...\" error received - retry") - return true, err - } - } - return fserrors.ShouldRetry(err) || fserrors.ShouldRetryHTTP(resp, retryErrorCodes), err -} - -// If query parameters contain X-Amz-Algorithm remove Authorization header -// -// This happens when ACD redirects to S3 for the download. The oauth -// transport puts an Authorization header in which we need to remove -// otherwise we get this message from AWS -// -// Only one auth mechanism allowed; only the X-Amz-Algorithm query -// parameter, Signature query string parameter or the Authorization -// header should be specified -func filterRequest(req *http.Request) { - if req.URL.Query().Get("X-Amz-Algorithm") != "" { - fs.Debugf(nil, "Removing Authorization: header after redirect to S3") - req.Header.Del("Authorization") - } -} - -// NewFs constructs an Fs from the path, container:path -func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, error) { - // Parse config into Options struct - opt := new(Options) - err := configstruct.Set(m, opt) - if err != nil { - return nil, err - } - root = parsePath(root) - baseClient := fshttp.NewClient(ctx) - if do, ok := baseClient.Transport.(interface { - SetRequestFilter(f func(req *http.Request)) - }); ok { - do.SetRequestFilter(filterRequest) - } else { - fs.Debugf(name+":", "Couldn't add request filter - large file downloads will fail") - } - oAuthClient, ts, err := oauthutil.NewClientWithBaseClient(ctx, name, m, acdConfig, baseClient) - if err != nil { - return nil, fmt.Errorf("failed to configure Amazon Drive: %w", err) - } - - c := acd.NewClient(oAuthClient) - ci := fs.GetConfig(ctx) - f := &Fs{ - name: name, - root: root, - opt: *opt, - ci: ci, - c: c, - pacer: fs.NewPacer(ctx, pacer.NewAmazonCloudDrive(pacer.MinSleep(minSleep))), - noAuthClient: fshttp.NewClient(ctx), - } - f.features = (&fs.Features{ - CaseInsensitive: true, - ReadMimeType: true, - CanHaveEmptyDirectories: true, - }).Fill(ctx, f) - - // Renew the token in the background - f.tokenRenewer = oauthutil.NewRenew(f.String(), ts, func() error { - _, err := f.getRootInfo(ctx) - return err - }) - - // Update endpoints - var resp *http.Response - err = f.pacer.Call(func() (bool, error) { - _, resp, err = f.c.Account.GetEndpoints() - return f.shouldRetry(ctx, resp, err) - }) - if err != nil { - return nil, fmt.Errorf("failed to get endpoints: %w", err) - } - - // Get rootID - rootInfo, err := f.getRootInfo(ctx) - if err != nil || rootInfo.Id == nil { - return nil, fmt.Errorf("failed to get root: %w", err) - } - f.trueRootID = *rootInfo.Id - - f.dirCache = dircache.New(root, f.trueRootID, f) - - // Find the current root - err = f.dirCache.FindRoot(ctx, false) - if err != nil { - // Assume it is a file - newRoot, remote := dircache.SplitPath(root) - tempF := *f - tempF.dirCache = dircache.New(newRoot, f.trueRootID, &tempF) - tempF.root = newRoot - // Make new Fs which is the parent - err = tempF.dirCache.FindRoot(ctx, false) - if err != nil { - // No root so return old f - return f, nil - } - _, err := tempF.newObjectWithInfo(ctx, remote, nil) - if err != nil { - if err == fs.ErrorObjectNotFound { - // File doesn't exist so return old f - return f, nil - } - return nil, err - } - // XXX: update the old f here instead of returning tempF, since - // `features` were already filled with functions having *f as a receiver. - // See https://github.com/rclone/rclone/issues/2182 - f.dirCache = tempF.dirCache - f.root = tempF.root - // return an error with an fs which points to the parent - return f, fs.ErrorIsFile - } - return f, nil -} - -// getRootInfo gets the root folder info -func (f *Fs) getRootInfo(ctx context.Context) (rootInfo *acd.Folder, err error) { - var resp *http.Response - err = f.pacer.Call(func() (bool, error) { - rootInfo, resp, err = f.c.Nodes.GetRoot() - return f.shouldRetry(ctx, resp, err) - }) - return rootInfo, err -} - -// Return an Object from a path -// -// If it can't be found it returns the error fs.ErrorObjectNotFound. -func (f *Fs) newObjectWithInfo(ctx context.Context, remote string, info *acd.Node) (fs.Object, error) { - o := &Object{ - fs: f, - remote: remote, - } - if info != nil { - // Set info but not meta - o.info = info - } else { - err := o.readMetaData(ctx) // reads info and meta, returning an error - if err != nil { - return nil, err - } - } - return o, nil -} - -// NewObject finds the Object at remote. If it can't be found -// it returns the error fs.ErrorObjectNotFound. -func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error) { - return f.newObjectWithInfo(ctx, remote, nil) -} - -// FindLeaf finds a directory of name leaf in the folder with ID pathID -func (f *Fs) FindLeaf(ctx context.Context, pathID, leaf string) (pathIDOut string, found bool, err error) { - //fs.Debugf(f, "FindLeaf(%q, %q)", pathID, leaf) - folder := acd.FolderFromId(pathID, f.c.Nodes) - var resp *http.Response - var subFolder *acd.Folder - err = f.pacer.Call(func() (bool, error) { - subFolder, resp, err = folder.GetFolder(f.opt.Enc.FromStandardName(leaf)) - return f.shouldRetry(ctx, resp, err) - }) - if err != nil { - if err == acd.ErrorNodeNotFound { - //fs.Debugf(f, "...Not found") - return "", false, nil - } - //fs.Debugf(f, "...Error %v", err) - return "", false, err - } - if subFolder.Status != nil && *subFolder.Status != statusAvailable { - fs.Debugf(f, "Ignoring folder %q in state %q", leaf, *subFolder.Status) - time.Sleep(1 * time.Second) // FIXME wait for problem to go away! - return "", false, nil - } - //fs.Debugf(f, "...Found(%q, %v)", *subFolder.Id, leaf) - return *subFolder.Id, true, nil -} - -// CreateDir makes a directory with pathID as parent and name leaf -func (f *Fs) CreateDir(ctx context.Context, pathID, leaf string) (newID string, err error) { - //fmt.Printf("CreateDir(%q, %q)\n", pathID, leaf) - folder := acd.FolderFromId(pathID, f.c.Nodes) - var resp *http.Response - var info *acd.Folder - err = f.pacer.Call(func() (bool, error) { - info, resp, err = folder.CreateFolder(f.opt.Enc.FromStandardName(leaf)) - return f.shouldRetry(ctx, resp, err) - }) - if err != nil { - //fmt.Printf("...Error %v\n", err) - return "", err - } - //fmt.Printf("...Id %q\n", *info.Id) - return *info.Id, nil -} - -// list the objects into the function supplied -// -// If directories is set it only sends directories -// User function to process a File item from listAll -// -// Should return true to finish processing -type listAllFn func(*acd.Node) bool - -// Lists the directory required calling the user function on each item found -// -// If the user fn ever returns true then it early exits with found = true -func (f *Fs) listAll(ctx context.Context, dirID string, title string, directoriesOnly bool, filesOnly bool, fn listAllFn) (found bool, err error) { - query := "parents:" + dirID - if directoriesOnly { - query += " AND kind:" + folderKind - } else if filesOnly { - query += " AND kind:" + fileKind - //} else { - // FIXME none of these work - //query += " AND kind:(" + fileKind + " OR " + folderKind + ")" - //query += " AND (kind:" + fileKind + " OR kind:" + folderKind + ")" - } - opts := acd.NodeListOptions{ - Filters: query, - } - var nodes []*acd.Node - var out []*acd.Node - //var resp *http.Response - for { - var resp *http.Response - err = f.pacer.CallNoRetry(func() (bool, error) { - nodes, resp, err = f.c.Nodes.GetNodes(&opts) - return f.shouldRetry(ctx, resp, err) - }) - if err != nil { - return false, err - } - if nodes == nil { - break - } - for _, node := range nodes { - if node.Name != nil && node.Id != nil && node.Kind != nil && node.Status != nil { - // Ignore nodes if not AVAILABLE - if *node.Status != statusAvailable { - continue - } - // Ignore bogus nodes Amazon Drive sometimes reports - hasValidParent := false - for _, parent := range node.Parents { - if parent == dirID { - hasValidParent = true - break - } - } - if !hasValidParent { - continue - } - *node.Name = f.opt.Enc.ToStandardName(*node.Name) - // Store the nodes up in case we have to retry the listing - out = append(out, node) - } - } - } - // Send the nodes now - for _, node := range out { - if fn(node) { - found = true - break - } - } - return -} - -// List the objects and directories in dir into entries. The -// entries can be returned in any order but should be for a -// complete directory. -// -// dir should be "" to list the root, and should not have -// trailing slashes. -// -// This should return ErrDirNotFound if the directory isn't -// found. -func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err error) { - directoryID, err := f.dirCache.FindDir(ctx, dir, false) - if err != nil { - return nil, err - } - maxTries := f.ci.LowLevelRetries - var iErr error - for tries := 1; tries <= maxTries; tries++ { - entries = nil - _, err = f.listAll(ctx, directoryID, "", false, false, func(node *acd.Node) bool { - remote := path.Join(dir, *node.Name) - switch *node.Kind { - case folderKind: - // cache the directory ID for later lookups - f.dirCache.Put(remote, *node.Id) - when, _ := time.Parse(timeFormat, *node.ModifiedDate) // FIXME - d := fs.NewDir(remote, when).SetID(*node.Id) - entries = append(entries, d) - case fileKind: - o, err := f.newObjectWithInfo(ctx, remote, node) - if err != nil { - iErr = err - return true - } - entries = append(entries, o) - default: - // ignore ASSET, etc. - } - return false - }) - if iErr != nil { - return nil, iErr - } - if fserrors.IsRetryError(err) { - fs.Debugf(f, "Directory listing error for %q: %v - low level retry %d/%d", dir, err, tries, maxTries) - continue - } - if err != nil { - return nil, err - } - break - } - return entries, nil -} - -// checkUpload checks to see if an error occurred after the file was -// completely uploaded. -// -// If it was then it waits for a while to see if the file really -// exists and is the right size and returns an updated info. -// -// If the file wasn't found or was the wrong size then it returns the -// original error. -// -// This is a workaround for Amazon sometimes returning -// -// - 408 REQUEST_TIMEOUT -// - 504 GATEWAY_TIMEOUT -// - 500 Internal server error -// -// At the end of large uploads. The speculation is that the timeout -// is waiting for the sha1 hashing to complete and the file may well -// be properly uploaded. -func (f *Fs) checkUpload(ctx context.Context, resp *http.Response, in io.Reader, src fs.ObjectInfo, inInfo *acd.File, inErr error, uploadTime time.Duration) (fixedError bool, info *acd.File, err error) { - // Return if no error - all is well - if inErr == nil { - return false, inInfo, inErr - } - // If not one of the errors we can fix return - // if resp == nil || resp.StatusCode != 408 && resp.StatusCode != 500 && resp.StatusCode != 504 { - // return false, inInfo, inErr - // } - - // The HTTP status - httpStatus := "HTTP status UNKNOWN" - if resp != nil { - httpStatus = resp.Status - } - - // check to see if we read to the end - buf := make([]byte, 1) - n, err := in.Read(buf) - if !(n == 0 && err == io.EOF) { - fs.Debugf(src, "Upload error detected but didn't finish upload: %v (%q)", inErr, httpStatus) - return false, inInfo, inErr - } - - // Don't wait for uploads - assume they will appear later - if f.opt.UploadWaitPerGB <= 0 { - fs.Debugf(src, "Upload error detected but waiting disabled: %v (%q)", inErr, httpStatus) - return false, inInfo, inErr - } - - // Time we should wait for the upload - uploadWaitPerByte := float64(f.opt.UploadWaitPerGB) / 1024 / 1024 / 1024 - timeToWait := time.Duration(uploadWaitPerByte * float64(src.Size())) - - const sleepTime = 5 * time.Second // sleep between tries - retries := int((timeToWait + sleepTime - 1) / sleepTime) // number of retries, rounded up - - fs.Debugf(src, "Error detected after finished upload - waiting to see if object was uploaded correctly: %v (%q)", inErr, httpStatus) - remote := src.Remote() - for i := 1; i <= retries; i++ { - o, err := f.NewObject(ctx, remote) - if err == fs.ErrorObjectNotFound { - fs.Debugf(src, "Object not found - waiting (%d/%d)", i, retries) - } else if err != nil { - fs.Debugf(src, "Object returned error - waiting (%d/%d): %v", i, retries, err) - } else { - if src.Size() == o.Size() { - fs.Debugf(src, "Object found with correct size %d after waiting (%d/%d) - %v - returning with no error", src.Size(), i, retries, sleepTime*time.Duration(i-1)) - info = &acd.File{ - Node: o.(*Object).info, - } - return true, info, nil - } - fs.Debugf(src, "Object found but wrong size %d vs %d - waiting (%d/%d)", src.Size(), o.Size(), i, retries) - } - time.Sleep(sleepTime) - } - fs.Debugf(src, "Giving up waiting for object - returning original error: %v (%q)", inErr, httpStatus) - return false, inInfo, inErr -} - -// Put the object into the container -// -// Copy the reader in to the new object which is returned. -// -// The new object may have been created if an error is returned -func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { - remote := src.Remote() - size := src.Size() - // Temporary Object under construction - o := &Object{ - fs: f, - remote: remote, - } - // Check if object already exists - err := o.readMetaData(ctx) - switch err { - case nil: - return o, o.Update(ctx, in, src, options...) - case fs.ErrorObjectNotFound: - // Not found so create it - default: - return nil, err - } - // If not create it - leaf, directoryID, err := f.dirCache.FindPath(ctx, remote, true) - if err != nil { - return nil, err - } - if size > warnFileSize { - fs.Logf(f, "Warning: file %q may fail because it is too big. Use --max-size=%dM to skip large files.", remote, warnFileSize>>20) - } - folder := acd.FolderFromId(directoryID, o.fs.c.Nodes) - var info *acd.File - var resp *http.Response - err = f.pacer.CallNoRetry(func() (bool, error) { - start := time.Now() - f.tokenRenewer.Start() - info, resp, err = folder.Put(in, f.opt.Enc.FromStandardName(leaf)) - f.tokenRenewer.Stop() - var ok bool - ok, info, err = f.checkUpload(ctx, resp, in, src, info, err, time.Since(start)) - if ok { - return false, nil - } - return f.shouldRetry(ctx, resp, err) - }) - if err != nil { - return nil, err - } - o.info = info.Node - return o, nil -} - -// Mkdir creates the container if it doesn't exist -func (f *Fs) Mkdir(ctx context.Context, dir string) error { - _, err := f.dirCache.FindDir(ctx, dir, true) - return err -} - -// Move src to this remote using server-side move operations. -// -// This is stored with the remote path given. -// -// It returns the destination Object and a possible error. -// -// Will only be called if src.Fs().Name() == f.Name() -// -// If it isn't possible then return fs.ErrorCantMove -func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object, error) { - // go test -v -run '^Test(Setup|Init|FsMkdir|FsPutFile1|FsPutFile2|FsUpdateFile1|FsMove)$' - srcObj, ok := src.(*Object) - if !ok { - fs.Debugf(src, "Can't move - not same remote type") - return nil, fs.ErrorCantMove - } - - // create the destination directory if necessary - srcLeaf, srcDirectoryID, err := srcObj.fs.dirCache.FindPath(ctx, srcObj.remote, false) - if err != nil { - return nil, err - } - dstLeaf, dstDirectoryID, err := f.dirCache.FindPath(ctx, remote, true) - if err != nil { - return nil, err - } - err = f.moveNode(ctx, srcObj.remote, dstLeaf, dstDirectoryID, srcObj.info, srcLeaf, srcDirectoryID, false) - if err != nil { - return nil, err - } - // Wait for directory caching so we can no longer see the old - // object and see the new object - time.Sleep(200 * time.Millisecond) // enough time 90% of the time - var ( - dstObj fs.Object - srcErr, dstErr error - ) - for i := 1; i <= f.ci.LowLevelRetries; i++ { - _, srcErr = srcObj.fs.NewObject(ctx, srcObj.remote) // try reading the object - if srcErr != nil && srcErr != fs.ErrorObjectNotFound { - // exit if error on source - return nil, srcErr - } - dstObj, dstErr = f.NewObject(ctx, remote) - if dstErr != nil && dstErr != fs.ErrorObjectNotFound { - // exit if error on dst - return nil, dstErr - } - if srcErr == fs.ErrorObjectNotFound && dstErr == nil { - // finished if src not found and dst found - break - } - fs.Debugf(src, "Wait for directory listing to update after move %d/%d", i, f.ci.LowLevelRetries) - time.Sleep(1 * time.Second) - } - return dstObj, dstErr -} - -// DirCacheFlush resets the directory cache - used in testing as an -// optional interface -func (f *Fs) DirCacheFlush() { - f.dirCache.ResetRoot() -} - -// DirMove moves src, srcRemote to this remote at dstRemote -// using server-side move operations. -// -// Will only be called if src.Fs().Name() == f.Name() -// -// If it isn't possible then return fs.ErrorCantDirMove -// -// If destination exists then return fs.ErrorDirExists -func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string) (err error) { - srcFs, ok := src.(*Fs) - if !ok { - fs.Debugf(src, "DirMove error: not same remote type") - return fs.ErrorCantDirMove - } - srcPath := path.Join(srcFs.root, srcRemote) - dstPath := path.Join(f.root, dstRemote) - - // Refuse to move to or from the root - if srcPath == "" || dstPath == "" { - fs.Debugf(src, "DirMove error: Can't move root") - return errors.New("can't move root directory") - } - - // Find ID of dst parent, creating subdirs if necessary - dstLeaf, dstDirectoryID, err := f.dirCache.FindPath(ctx, dstRemote, true) - if err != nil { - return err - } - - // Check destination does not exist - _, err = f.dirCache.FindDir(ctx, dstRemote, false) - if err == fs.ErrorDirNotFound { - // OK - } else if err != nil { - return err - } else { - return fs.ErrorDirExists - } - - // Find ID of src parent - _, srcDirectoryID, err := srcFs.dirCache.FindPath(ctx, srcRemote, false) - if err != nil { - return err - } - srcLeaf, _ := dircache.SplitPath(srcPath) - - // Find ID of src - srcID, err := srcFs.dirCache.FindDir(ctx, srcRemote, false) - if err != nil { - return err - } - - // FIXME make a proper node.UpdateMetadata command - srcInfo := acd.NodeFromId(srcID, f.c.Nodes) - var jsonStr string - err = srcFs.pacer.Call(func() (bool, error) { - jsonStr, err = srcInfo.GetMetadata() - return srcFs.shouldRetry(ctx, nil, err) - }) - if err != nil { - fs.Debugf(src, "DirMove error: error reading src metadata: %v", err) - return err - } - err = json.Unmarshal([]byte(jsonStr), &srcInfo) - if err != nil { - fs.Debugf(src, "DirMove error: error reading unpacking src metadata: %v", err) - return err - } - - err = f.moveNode(ctx, srcPath, dstLeaf, dstDirectoryID, srcInfo, srcLeaf, srcDirectoryID, true) - if err != nil { - return err - } - - srcFs.dirCache.FlushDir(srcRemote) - return nil -} - -// purgeCheck remotes the root directory, if check is set then it -// refuses to do so if it has anything in -func (f *Fs) purgeCheck(ctx context.Context, dir string, check bool) error { - root := path.Join(f.root, dir) - if root == "" { - return errors.New("can't purge root directory") - } - dc := f.dirCache - rootID, err := dc.FindDir(ctx, dir, false) - if err != nil { - return err - } - - if check { - // check directory is empty - empty := true - _, err = f.listAll(ctx, rootID, "", false, false, func(node *acd.Node) bool { - switch *node.Kind { - case folderKind: - empty = false - return true - case fileKind: - empty = false - return true - default: - fs.Debugf("Found ASSET %s", *node.Id) - } - return false - }) - if err != nil { - return err - } - if !empty { - return errors.New("directory not empty") - } - } - - node := acd.NodeFromId(rootID, f.c.Nodes) - var resp *http.Response - err = f.pacer.Call(func() (bool, error) { - resp, err = node.Trash() - return f.shouldRetry(ctx, resp, err) - }) - if err != nil { - return err - } - - f.dirCache.FlushDir(dir) - if err != nil { - return err - } - return nil -} - -// Rmdir deletes the root folder -// -// Returns an error if it isn't empty -func (f *Fs) Rmdir(ctx context.Context, dir string) error { - return f.purgeCheck(ctx, dir, true) -} - -// Precision return the precision of this Fs -func (f *Fs) Precision() time.Duration { - return fs.ModTimeNotSupported -} - -// Hashes returns the supported hash sets. -func (f *Fs) Hashes() hash.Set { - return hash.Set(hash.MD5) -} - -// Copy src to this remote using server-side copy operations. -// -// This is stored with the remote path given -// -// It returns the destination Object and a possible error -// -// Will only be called if src.Fs().Name() == f.Name() -// -// If it isn't possible then return fs.ErrorCantCopy -//func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, error) { -// srcObj, ok := src.(*Object) -// if !ok { -// fs.Debugf(src, "Can't copy - not same remote type") -// return nil, fs.ErrorCantCopy -// } -// srcFs := srcObj.fs -// _, err := f.c.ObjectCopy(srcFs.container, srcFs.root+srcObj.remote, f.container, f.root+remote, nil) -// if err != nil { -// return nil, err -// } -// return f.NewObject(ctx, remote), nil -//} - -// Purge deletes all the files and the container -// -// Optional interface: Only implement this if you have a way of -// deleting all the files quicker than just running Remove() on the -// result of List() -func (f *Fs) Purge(ctx context.Context, dir string) error { - return f.purgeCheck(ctx, dir, false) -} - -// ------------------------------------------------------------ - -// Fs returns the parent Fs -func (o *Object) Fs() fs.Info { - return o.fs -} - -// Return a string version -func (o *Object) String() string { - if o == nil { - return "" - } - return o.remote -} - -// Remote returns the remote path -func (o *Object) Remote() string { - return o.remote -} - -// Hash returns the Md5sum of an object returning a lowercase hex string -func (o *Object) Hash(ctx context.Context, t hash.Type) (string, error) { - if t != hash.MD5 { - return "", hash.ErrUnsupported - } - if o.info.ContentProperties != nil && o.info.ContentProperties.Md5 != nil { - return *o.info.ContentProperties.Md5, nil - } - return "", nil -} - -// Size returns the size of an object in bytes -func (o *Object) Size() int64 { - if o.info.ContentProperties != nil && o.info.ContentProperties.Size != nil { - return int64(*o.info.ContentProperties.Size) - } - return 0 // Object is likely PENDING -} - -// readMetaData gets the metadata if it hasn't already been fetched -// -// it also sets the info -// -// If it can't be found it returns the error fs.ErrorObjectNotFound. -func (o *Object) readMetaData(ctx context.Context) (err error) { - if o.info != nil { - return nil - } - leaf, directoryID, err := o.fs.dirCache.FindPath(ctx, o.remote, false) - if err != nil { - if err == fs.ErrorDirNotFound { - return fs.ErrorObjectNotFound - } - return err - } - folder := acd.FolderFromId(directoryID, o.fs.c.Nodes) - var resp *http.Response - var info *acd.File - err = o.fs.pacer.Call(func() (bool, error) { - info, resp, err = folder.GetFile(o.fs.opt.Enc.FromStandardName(leaf)) - return o.fs.shouldRetry(ctx, resp, err) - }) - if err != nil { - if err == acd.ErrorNodeNotFound { - return fs.ErrorObjectNotFound - } - return err - } - o.info = info.Node - return nil -} - -// ModTime returns the modification time of the object -// -// It attempts to read the objects mtime and if that isn't present the -// LastModified returned in the http headers -func (o *Object) ModTime(ctx context.Context) time.Time { - err := o.readMetaData(ctx) - if err != nil { - fs.Debugf(o, "Failed to read metadata: %v", err) - return time.Now() - } - modTime, err := time.Parse(timeFormat, *o.info.ModifiedDate) - if err != nil { - fs.Debugf(o, "Failed to read mtime from object: %v", err) - return time.Now() - } - return modTime -} - -// SetModTime sets the modification time of the local fs object -func (o *Object) SetModTime(ctx context.Context, modTime time.Time) error { - // FIXME not implemented - return fs.ErrorCantSetModTime -} - -// Storable returns a boolean showing whether this object storable -func (o *Object) Storable() bool { - return true -} - -// Open an object for read -func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.ReadCloser, err error) { - bigObject := o.Size() >= int64(o.fs.opt.TempLinkThreshold) - if bigObject { - fs.Debugf(o, "Downloading large object via tempLink") - } - file := acd.File{Node: o.info} - var resp *http.Response - headers := fs.OpenOptionHeaders(options) - err = o.fs.pacer.Call(func() (bool, error) { - if !bigObject { - in, resp, err = file.OpenHeaders(headers) - } else { - in, resp, err = file.OpenTempURLHeaders(o.fs.noAuthClient, headers) - } - return o.fs.shouldRetry(ctx, resp, err) - }) - return in, err -} - -// Update the object with the contents of the io.Reader, modTime and size -// -// The new object may have been created if an error is returned -func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error { - file := acd.File{Node: o.info} - var info *acd.File - var resp *http.Response - var err error - err = o.fs.pacer.CallNoRetry(func() (bool, error) { - start := time.Now() - o.fs.tokenRenewer.Start() - info, resp, err = file.Overwrite(in) - o.fs.tokenRenewer.Stop() - var ok bool - ok, info, err = o.fs.checkUpload(ctx, resp, in, src, info, err, time.Since(start)) - if ok { - return false, nil - } - return o.fs.shouldRetry(ctx, resp, err) - }) - if err != nil { - return err - } - o.info = info.Node - return nil -} - -// Remove a node -func (f *Fs) removeNode(ctx context.Context, info *acd.Node) error { - var resp *http.Response - var err error - err = f.pacer.Call(func() (bool, error) { - resp, err = info.Trash() - return f.shouldRetry(ctx, resp, err) - }) - return err -} - -// Remove an object -func (o *Object) Remove(ctx context.Context) error { - return o.fs.removeNode(ctx, o.info) -} - -// Restore a node -func (f *Fs) restoreNode(ctx context.Context, info *acd.Node) (newInfo *acd.Node, err error) { - var resp *http.Response - err = f.pacer.Call(func() (bool, error) { - newInfo, resp, err = info.Restore() - return f.shouldRetry(ctx, resp, err) - }) - return newInfo, err -} - -// Changes name of given node -func (f *Fs) renameNode(ctx context.Context, info *acd.Node, newName string) (newInfo *acd.Node, err error) { - var resp *http.Response - err = f.pacer.Call(func() (bool, error) { - newInfo, resp, err = info.Rename(f.opt.Enc.FromStandardName(newName)) - return f.shouldRetry(ctx, resp, err) - }) - return newInfo, err -} - -// Replaces one parent with another, effectively moving the file. Leaves other -// parents untouched. ReplaceParent cannot be used when the file is trashed. -func (f *Fs) replaceParent(ctx context.Context, info *acd.Node, oldParentID string, newParentID string) error { - return f.pacer.Call(func() (bool, error) { - resp, err := info.ReplaceParent(oldParentID, newParentID) - return f.shouldRetry(ctx, resp, err) - }) -} - -// Adds one additional parent to object. -func (f *Fs) addParent(ctx context.Context, info *acd.Node, newParentID string) error { - return f.pacer.Call(func() (bool, error) { - resp, err := info.AddParent(newParentID) - return f.shouldRetry(ctx, resp, err) - }) -} - -// Remove given parent from object, leaving the other possible -// parents untouched. Object can end up having no parents. -func (f *Fs) removeParent(ctx context.Context, info *acd.Node, parentID string) error { - return f.pacer.Call(func() (bool, error) { - resp, err := info.RemoveParent(parentID) - return f.shouldRetry(ctx, resp, err) - }) -} - -// moveNode moves the node given from the srcLeaf,srcDirectoryID to -// the dstLeaf,dstDirectoryID -func (f *Fs) moveNode(ctx context.Context, name, dstLeaf, dstDirectoryID string, srcInfo *acd.Node, srcLeaf, srcDirectoryID string, useDirErrorMsgs bool) (err error) { - // fs.Debugf(name, "moveNode dst(%q,%s) <- src(%q,%s)", dstLeaf, dstDirectoryID, srcLeaf, srcDirectoryID) - cantMove := fs.ErrorCantMove - if useDirErrorMsgs { - cantMove = fs.ErrorCantDirMove - } - - if len(srcInfo.Parents) > 1 && srcLeaf != dstLeaf { - fs.Debugf(name, "Move error: object is attached to multiple parents and should be renamed. This would change the name of the node in all parents.") - return cantMove - } - - if srcLeaf != dstLeaf { - // fs.Debugf(name, "renaming") - _, err = f.renameNode(ctx, srcInfo, dstLeaf) - if err != nil { - fs.Debugf(name, "Move: quick path rename failed: %v", err) - goto OnConflict - } - } - if srcDirectoryID != dstDirectoryID { - // fs.Debugf(name, "trying parent replace: %s -> %s", oldParentID, newParentID) - err = f.replaceParent(ctx, srcInfo, srcDirectoryID, dstDirectoryID) - if err != nil { - fs.Debugf(name, "Move: quick path parent replace failed: %v", err) - return err - } - } - - return nil - -OnConflict: - fs.Debugf(name, "Could not directly rename file, presumably because there was a file with the same name already. Instead, the file will now be trashed where such operations do not cause errors. It will be restored to the correct parent after. If any of the subsequent calls fails, the rename/move will be in an invalid state.") - - // fs.Debugf(name, "Trashing file") - err = f.removeNode(ctx, srcInfo) - if err != nil { - fs.Debugf(name, "Move: remove node failed: %v", err) - return err - } - // fs.Debugf(name, "Renaming file") - _, err = f.renameNode(ctx, srcInfo, dstLeaf) - if err != nil { - fs.Debugf(name, "Move: rename node failed: %v", err) - return err - } - // note: replacing parent is forbidden by API, modifying them individually is - // okay though - // fs.Debugf(name, "Adding target parent") - err = f.addParent(ctx, srcInfo, dstDirectoryID) - if err != nil { - fs.Debugf(name, "Move: addParent failed: %v", err) - return err - } - // fs.Debugf(name, "removing original parent") - err = f.removeParent(ctx, srcInfo, srcDirectoryID) - if err != nil { - fs.Debugf(name, "Move: removeParent failed: %v", err) - return err - } - // fs.Debugf(name, "Restoring") - _, err = f.restoreNode(ctx, srcInfo) - if err != nil { - fs.Debugf(name, "Move: restoreNode node failed: %v", err) - return err - } - return nil -} - -// MimeType of an Object if known, "" otherwise -func (o *Object) MimeType(ctx context.Context) string { - if o.info.ContentProperties != nil && o.info.ContentProperties.ContentType != nil { - return *o.info.ContentProperties.ContentType - } - return "" -} - -// ChangeNotify calls the passed function with a path that has had changes. -// If the implementation uses polling, it should adhere to the given interval. -// -// Automatically restarts itself in case of unexpected behaviour of the remote. -// -// Close the returned channel to stop being notified. -func (f *Fs) ChangeNotify(ctx context.Context, notifyFunc func(string, fs.EntryType), pollIntervalChan <-chan time.Duration) { - checkpoint := f.opt.Checkpoint - - go func() { - var ticker *time.Ticker - var tickerC <-chan time.Time - for { - select { - case pollInterval, ok := <-pollIntervalChan: - if !ok { - if ticker != nil { - ticker.Stop() - } - return - } - if pollInterval == 0 { - if ticker != nil { - ticker.Stop() - ticker, tickerC = nil, nil - } - } else { - ticker = time.NewTicker(pollInterval) - tickerC = ticker.C - } - case <-tickerC: - checkpoint = f.changeNotifyRunner(notifyFunc, checkpoint) - if err := config.SetValueAndSave(f.name, "checkpoint", checkpoint); err != nil { - fs.Debugf(f, "Unable to save checkpoint: %v", err) - } - } - } - }() -} - -func (f *Fs) changeNotifyRunner(notifyFunc func(string, fs.EntryType), checkpoint string) string { - var err error - var resp *http.Response - var reachedEnd bool - var csCount int - var nodeCount int - - fs.Debugf(f, "Checking for changes on remote (Checkpoint %q)", checkpoint) - err = f.pacer.CallNoRetry(func() (bool, error) { - resp, err = f.c.Changes.GetChangesFunc(&acd.ChangesOptions{ - Checkpoint: checkpoint, - IncludePurged: true, - }, func(changeSet *acd.ChangeSet, err error) error { - if err != nil { - return err - } - - type entryType struct { - path string - entryType fs.EntryType - } - var pathsToClear []entryType - csCount++ - nodeCount += len(changeSet.Nodes) - if changeSet.End { - reachedEnd = true - } - if changeSet.Checkpoint != "" { - checkpoint = changeSet.Checkpoint - } - for _, node := range changeSet.Nodes { - if path, ok := f.dirCache.GetInv(*node.Id); ok { - if node.IsFile() { - pathsToClear = append(pathsToClear, entryType{path: path, entryType: fs.EntryObject}) - } else { - pathsToClear = append(pathsToClear, entryType{path: path, entryType: fs.EntryDirectory}) - } - continue - } - - if node.IsFile() { - // translate the parent dir of this object - if len(node.Parents) > 0 { - if path, ok := f.dirCache.GetInv(node.Parents[0]); ok { - // and append the drive file name to compute the full file name - name := f.opt.Enc.ToStandardName(*node.Name) - if len(path) > 0 { - path = path + "/" + name - } else { - path = name - } - // this will now clear the actual file too - pathsToClear = append(pathsToClear, entryType{path: path, entryType: fs.EntryObject}) - } - } else { // a true root object that is changed - pathsToClear = append(pathsToClear, entryType{path: *node.Name, entryType: fs.EntryObject}) - } - } - } - - visitedPaths := make(map[string]bool) - for _, entry := range pathsToClear { - if _, ok := visitedPaths[entry.path]; ok { - continue - } - visitedPaths[entry.path] = true - notifyFunc(entry.path, entry.entryType) - } - - return nil - }) - return false, err - }) - fs.Debugf(f, "Got %d ChangeSets with %d Nodes", csCount, nodeCount) - - if err != nil && err != io.ErrUnexpectedEOF { - fs.Debugf(f, "Failed to get Changes: %v", err) - return checkpoint - } - - if reachedEnd { - reachedEnd = false - fs.Debugf(f, "All changes were processed. Waiting for more.") - } else if checkpoint == "" { - fs.Debugf(f, "Did not get any checkpoint, something went wrong! %+v", resp) - } - return checkpoint -} - -// Shutdown shutdown the fs -func (f *Fs) Shutdown(ctx context.Context) error { - f.tokenRenewer.Shutdown() - return nil -} - -// ID returns the ID of the Object if known, or "" if not -func (o *Object) ID() string { - if o.info.Id == nil { - return "" - } - return *o.info.Id -} - -// Check the interfaces are satisfied -var ( - _ fs.Fs = (*Fs)(nil) - _ fs.Purger = (*Fs)(nil) - // _ fs.Copier = (*Fs)(nil) - _ fs.Mover = (*Fs)(nil) - _ fs.DirMover = (*Fs)(nil) - _ fs.DirCacheFlusher = (*Fs)(nil) - _ fs.ChangeNotifier = (*Fs)(nil) - _ fs.Shutdowner = (*Fs)(nil) - _ fs.Object = (*Object)(nil) - _ fs.MimeTyper = &Object{} - _ fs.IDer = &Object{} -) diff --git a/backend/amazonclouddrive/amazonclouddrive_test.go b/backend/amazonclouddrive/amazonclouddrive_test.go deleted file mode 100644 index 821a6f1ed50c3..0000000000000 --- a/backend/amazonclouddrive/amazonclouddrive_test.go +++ /dev/null @@ -1,21 +0,0 @@ -// Test AmazonCloudDrive filesystem interface - -//go:build acd -// +build acd - -package amazonclouddrive_test - -import ( - "testing" - - "github.com/rclone/rclone/backend/amazonclouddrive" - "github.com/rclone/rclone/fs" - "github.com/rclone/rclone/fstest/fstests" -) - -// TestIntegration runs integration tests against the remote -func TestIntegration(t *testing.T) { - fstests.NilObject = fs.Object((*amazonclouddrive.Object)(nil)) - fstests.RemoteName = "TestAmazonCloudDrive:" - fstests.Run(t) -} diff --git a/bin/make_changelog.py b/bin/make_changelog.py index 02a15d5ce4e62..fa48112e0a217 100755 --- a/bin/make_changelog.py +++ b/bin/make_changelog.py @@ -23,8 +23,6 @@ backends = [ x for x in os.listdir("backend") if x != "all"] backend_aliases = { - "amazon cloud drive" : "amazonclouddrive", - "acd" : "amazonclouddrive", "google cloud storage" : "googlecloudstorage", "gcs" : "googlecloudstorage", "azblob" : "azureblob", @@ -34,7 +32,6 @@ } backend_titles = { - "amazonclouddrive": "Amazon Cloud Drive", "googlecloudstorage": "Google Cloud Storage", "azureblob": "Azure Blob", "ftp": "FTP", diff --git a/bin/make_manual.py b/bin/make_manual.py index 94d3da215cf7f..98043e9a4d040 100755 --- a/bin/make_manual.py +++ b/bin/make_manual.py @@ -30,7 +30,6 @@ # Keep these alphabetical by full name "fichier.md", "alias.md", - "amazonclouddrive.md", "s3.md", "b2.md", "box.md", diff --git a/cmd/test/info/all.sh b/cmd/test/info/all.sh index fe1a65438779e..ab44a4f53a9d1 100755 --- a/cmd/test/info/all.sh +++ b/cmd/test/info/all.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash exec rclone --check-normalization=true --check-control=true --check-length=true info \ /tmp/testInfo \ - TestAmazonCloudDrive:testInfo \ TestB2:testInfo \ TestCryptDrive:testInfo \ TestCryptSwift:testInfo \ diff --git a/cmd/test/info/test.sh b/cmd/test/info/test.sh index d6cdca99f8f38..69c51692a248f 100755 --- a/cmd/test/info/test.sh +++ b/cmd/test/info/test.sh @@ -8,7 +8,6 @@ export PATH=$GOPATH/src/github.com/rclone/rclone:$PATH typeset -A allRemotes allRemotes=( - TestAmazonCloudDrive '--low-level-retries=2 --checkers=5 --upload-wait=5s' TestB2 '' TestBox '' TestDrive '--tpslimit=5' diff --git a/docs/content/_index.md b/docs/content/_index.md index a749137515c61..fc09ed522d989 100644 --- a/docs/content/_index.md +++ b/docs/content/_index.md @@ -107,7 +107,6 @@ WebDAV or S3, that work out of the box.) {{< provider name="1Fichier" home="https://1fichier.com/" config="/fichier/" start="true">}} {{< provider name="Akamai Netstorage" home="https://www.akamai.com/us/en/products/media-delivery/netstorage.jsp" config="/netstorage/" >}} {{< provider name="Alibaba Cloud (Aliyun) Object Storage System (OSS)" home="https://www.alibabacloud.com/product/oss/" config="/s3/#alibaba-oss" >}} -{{< provider name="Amazon Drive" home="https://www.amazon.com/clouddrive" config="/amazonclouddrive/" note="#status">}} {{< provider name="Amazon S3" home="https://aws.amazon.com/s3/" config="/s3/" >}} {{< provider name="Backblaze B2" home="https://www.backblaze.com/b2/cloud-storage.html" config="/b2/" >}} {{< provider name="Box" home="https://www.box.com/" config="/box/" >}} diff --git a/docs/content/amazonclouddrive.md b/docs/content/amazonclouddrive.md index cffc75e1f7285..8f9de1da1ba74 100644 --- a/docs/content/amazonclouddrive.md +++ b/docs/content/amazonclouddrive.md @@ -2,339 +2,15 @@ title: "Amazon Drive" description: "Rclone docs for Amazon Drive" versionIntroduced: "v1.20" +status: Deprecated --- # {{< icon "fab fa-amazon" >}} Amazon Drive -Amazon Drive, formerly known as Amazon Cloud Drive, is a cloud storage +Amazon Drive, formerly known as Amazon Cloud Drive, was a cloud storage service run by Amazon for consumers. -## Status - -**Important:** rclone supports Amazon Drive only if you have your own -set of API keys. Unfortunately the [Amazon Drive developer -program](https://developer.amazon.com/amazon-drive) is now closed to -new entries so if you don't already have your own set of keys you will -not be able to use rclone with Amazon Drive. - -For the history on why rclone no longer has a set of Amazon Drive API -keys see [the forum](https://forum.rclone.org/t/rclone-has-been-banned-from-amazon-drive/2314). - -If you happen to know anyone who works at Amazon then please ask them -to re-instate rclone into the Amazon Drive developer program - thanks! - -## Configuration - -The initial setup for Amazon Drive involves getting a token from -Amazon which you need to do in your browser. `rclone config` walks -you through it. - -The configuration process for Amazon Drive may involve using an [oauth -proxy](https://github.com/ncw/oauthproxy). This is used to keep the -Amazon credentials out of the source code. The proxy runs in Google's -very secure App Engine environment and doesn't store any credentials -which pass through it. - -Since rclone doesn't currently have its own Amazon Drive credentials -so you will either need to have your own `client_id` and -`client_secret` with Amazon Drive, or use a third-party oauth proxy -in which case you will need to enter `client_id`, `client_secret`, -`auth_url` and `token_url`. - -Note also if you are not using Amazon's `auth_url` and `token_url`, -(ie you filled in something for those) then if setting up on a remote -machine you can only use the [copying the config method of -configuration](https://rclone.org/remote_setup/#configuring-by-copying-the-config-file) -- `rclone authorize` will not work. - -Here is an example of how to make a remote called `remote`. First run: - - rclone config - -This will guide you through an interactive setup process: - -``` -No remotes found, make a new one? -n) New remote -r) Rename remote -c) Copy remote -s) Set configuration password -q) Quit config -n/r/c/s/q> n -name> remote -Type of storage to configure. -Choose a number from below, or type in your own value -[snip] -XX / Amazon Drive - \ "amazon cloud drive" -[snip] -Storage> amazon cloud drive -Amazon Application Client Id - required. -client_id> your client ID goes here -Amazon Application Client Secret - required. -client_secret> your client secret goes here -Auth server URL - leave blank to use Amazon's. -auth_url> Optional auth URL -Token server url - leave blank to use Amazon's. -token_url> Optional token URL -Remote config -Make sure your Redirect URL is set to "http://127.0.0.1:53682/" in your custom config. -Use web browser to automatically authenticate rclone with remote? - * Say Y if the machine running rclone has a web browser you can use - * Say N if running rclone on a (remote) machine without web browser access -If not sure try Y. If Y failed, try N. -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 = your client ID goes here -client_secret = your client secret goes here -auth_url = Optional auth URL -token_url = Optional token URL -token = {"access_token":"xxxxxxxxxxxxxxxxxxxxxxx","token_type":"bearer","refresh_token":"xxxxxxxxxxxxxxxxxx","expiry":"2015-09-06T16:07:39.658438471+01:00"} --------------------- -y) Yes this is OK -e) Edit this remote -d) Delete this remote -y/e/d> y -``` - -See the [remote setup docs](/remote_setup/) for how to set it up on a -machine with no Internet browser available. - -Note that rclone runs a webserver on your local machine to collect the -token as returned from Amazon. This only runs from the moment it -opens your browser to the moment you get back the verification -code. This is on `http://127.0.0.1:53682/` and this it may require -you to unblock it temporarily if you are running a host firewall. - -Once configured you can then use `rclone` like this, - -List directories in top level of your Amazon Drive - - rclone lsd remote: - -List all the files in your Amazon Drive - - rclone ls remote: - -To copy a local directory to an Amazon Drive directory called backup - - rclone copy /home/source remote:backup - -### Modification times and hashes - -Amazon Drive doesn't allow modification times to be changed via -the API so these won't be accurate or used for syncing. - -It does support the MD5 hash algorithm, so for a more accurate sync, -you can use the `--checksum` flag. - -### Restricted filename characters - -| Character | Value | Replacement | -| --------- |:-----:|:-----------:| -| NUL | 0x00 | ␀ | -| / | 0x2F | / | - -Invalid UTF-8 bytes will also be [replaced](/overview/#invalid-utf8), -as they can't be used in JSON strings. - -### Deleting files - -Any files you delete with rclone will end up in the trash. Amazon -don't provide an API to permanently delete files, nor to empty the -trash, so you will have to do that with one of Amazon's apps or via -the Amazon Drive website. As of November 17, 2016, files are -automatically deleted by Amazon from the trash after 30 days. - -### Using with non `.com` Amazon accounts - -Let's say you usually use `amazon.co.uk`. When you authenticate with -rclone it will take you to an `amazon.com` page to log in. Your -`amazon.co.uk` email and password should work here just fine. - -{{< rem autogenerated options start" - DO NOT EDIT - instead edit fs.RegInfo in backend/amazonclouddrive/amazonclouddrive.go then run make backenddocs" >}} -### Standard options - -Here are the Standard options specific to amazon cloud drive (Amazon Drive). - -#### --acd-client-id - -OAuth Client Id. - -Leave blank normally. - -Properties: - -- Config: client_id -- Env Var: RCLONE_ACD_CLIENT_ID -- Type: string -- Required: false - -#### --acd-client-secret - -OAuth Client Secret. - -Leave blank normally. - -Properties: - -- Config: client_secret -- Env Var: RCLONE_ACD_CLIENT_SECRET -- Type: string -- Required: false - -### Advanced options - -Here are the Advanced options specific to amazon cloud drive (Amazon Drive). - -#### --acd-token - -OAuth Access Token as a JSON blob. - -Properties: - -- Config: token -- Env Var: RCLONE_ACD_TOKEN -- Type: string -- Required: false - -#### --acd-auth-url - -Auth server URL. - -Leave blank to use the provider defaults. - -Properties: - -- Config: auth_url -- Env Var: RCLONE_ACD_AUTH_URL -- Type: string -- Required: false - -#### --acd-token-url - -Token server url. - -Leave blank to use the provider defaults. - -Properties: - -- Config: token_url -- Env Var: RCLONE_ACD_TOKEN_URL -- Type: string -- Required: false - -#### --acd-checkpoint - -Checkpoint for internal polling (debug). - -Properties: - -- Config: checkpoint -- Env Var: RCLONE_ACD_CHECKPOINT -- Type: string -- Required: false - -#### --acd-upload-wait-per-gb - -Additional time per GiB to wait after a failed complete upload to see if it appears. - -Sometimes Amazon Drive gives an error when a file has been fully -uploaded but the file appears anyway after a little while. This -happens sometimes for files over 1 GiB in size and nearly every time for -files bigger than 10 GiB. This parameter controls the time rclone waits -for the file to appear. - -The default value for this parameter is 3 minutes per GiB, so by -default it will wait 3 minutes for every GiB uploaded to see if the -file appears. - -You can disable this feature by setting it to 0. This may cause -conflict errors as rclone retries the failed upload but the file will -most likely appear correctly eventually. - -These values were determined empirically by observing lots of uploads -of big files for a range of file sizes. - -Upload with the "-v" flag to see more info about what rclone is doing -in this situation. - -Properties: - -- Config: upload_wait_per_gb -- Env Var: RCLONE_ACD_UPLOAD_WAIT_PER_GB -- Type: Duration -- Default: 3m0s - -#### --acd-templink-threshold - -Files >= this size will be downloaded via their tempLink. - -Files this size or more will be downloaded via their "tempLink". This -is to work around a problem with Amazon Drive which blocks downloads -of files bigger than about 10 GiB. The default for this is 9 GiB which -shouldn't need to be changed. - -To download files above this threshold, rclone requests a "tempLink" -which downloads the file through a temporary URL directly from the -underlying S3 storage. - -Properties: - -- Config: templink_threshold -- Env Var: RCLONE_ACD_TEMPLINK_THRESHOLD -- Type: SizeSuffix -- Default: 9Gi - -#### --acd-encoding - -The encoding for the backend. - -See the [encoding section in the overview](/overview/#encoding) for more info. - -Properties: - -- Config: encoding -- Env Var: RCLONE_ACD_ENCODING -- Type: Encoding -- Default: Slash,InvalidUtf8,Dot - -{{< rem autogenerated options stop >}} - -## Limitations - -Note that Amazon Drive is case insensitive so you can't have a -file called "Hello.doc" and one called "hello.doc". - -Amazon Drive has rate limiting so you may notice errors in the -sync (429 errors). rclone will automatically retry the sync up to 3 -times by default (see `--retries` flag) which should hopefully work -around this problem. - -Amazon Drive has an internal limit of file sizes that can be uploaded -to the service. This limit is not officially published, but all files -larger than this will fail. - -At the time of writing (Jan 2016) is in the area of 50 GiB per file. -This means that larger files are likely to fail. - -Unfortunately there is no way for rclone to see that this failure is -because of file size, so it will retry the operation, as any other -failure. To avoid this problem, use `--max-size 50000M` option to limit -the maximum size of uploaded files. Note that `--max-size` does not split -files into segments, it only ignores files over this size. - -`rclone about` is not supported by the Amazon Drive backend. Backends without -this capability cannot determine free space for an rclone mount or -use policy `mfs` (most free space) as a member of an rclone union -remote. - -See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) +From 2023-12-31, [Amazon Drive has been discontinued](https://www.amazon.com/b?ie=UTF8&node=23943055011) +by Amazon so the Amazon Drive backend has been removed. +You can still use Amazon Photos to access your photos and videos. diff --git a/docs/content/crypt.md b/docs/content/crypt.md index 269e26fed5392..44dd1d75317f2 100644 --- a/docs/content/crypt.md +++ b/docs/content/crypt.md @@ -784,7 +784,7 @@ encoding is modified in two ways: * we strip the padding character `=` `base32` is used rather than the more efficient `base64` so rclone can be -used on case insensitive remotes (e.g. Windows, Amazon Drive). +used on case insensitive remotes (e.g. Windows, Box, Dropbox, Onedrive etc). ### Key derivation diff --git a/docs/content/docs.md b/docs/content/docs.md index a15cc51881bae..ee3f7e4d78fc4 100644 --- a/docs/content/docs.md +++ b/docs/content/docs.md @@ -30,7 +30,6 @@ See the following for detailed instructions for * [1Fichier](/fichier/) * [Akamai Netstorage](/netstorage/) * [Alias](/alias/) - * [Amazon Drive](/amazonclouddrive/) * [Amazon S3](/s3/) * [Backblaze B2](/b2/) * [Box](/box/) diff --git a/docs/content/overview.md b/docs/content/overview.md index 7a05c39122539..731c4642dd674 100644 --- a/docs/content/overview.md +++ b/docs/content/overview.md @@ -18,7 +18,6 @@ Here is an overview of the major features of each cloud storage system. | ---------------------------- |:-----------------:|:-------:|:----------------:|:---------------:|:---------:|:--------:| | 1Fichier | Whirlpool | - | No | Yes | R | - | | Akamai Netstorage | MD5, SHA256 | R/W | No | No | R | - | -| Amazon Drive | MD5 | - | Yes | No | R | - | | Amazon S3 (or S3 compatible) | MD5 | R/W | No | No | R/W | RWU | | Backblaze B2 | SHA1 | R/W | No | No | R/W | - | | Box | SHA1 | R/W | Yes | No | - | - | @@ -471,7 +470,6 @@ upon backend-specific capabilities. | ---------------------------- |:-----:|:----:|:----:|:-------:|:-------:|:-----:|:------------:|:------------------|:------------:|:-----:|:--------:| | 1Fichier | No | Yes | Yes | No | No | No | No | No | Yes | No | Yes | | Akamai Netstorage | Yes | No | No | No | No | Yes | Yes | No | No | No | Yes | -| Amazon Drive | Yes | No | Yes | Yes | No | No | No | No | No | No | Yes | | Amazon S3 (or S3 compatible) | No | Yes | No | No | Yes | Yes | Yes | Yes | Yes | No | No | | Backblaze B2 | No | Yes | No | No | Yes | Yes | Yes | Yes | Yes | No | No | | Box | Yes | Yes | Yes | Yes | Yes | No | Yes | No | Yes | Yes | Yes | diff --git a/docs/content/remote_setup.md b/docs/content/remote_setup.md index 057e285dafc70..17cdeef4216c7 100644 --- a/docs/content/remote_setup.md +++ b/docs/content/remote_setup.md @@ -36,7 +36,7 @@ For more help and alternate methods see: https://rclone.org/remote_setup/ Execute the following on the machine with the web browser (same rclone version recommended): - rclone authorize "amazon cloud drive" + rclone authorize "dropbox" Then paste the result below: result> @@ -45,7 +45,7 @@ result> Then on your main desktop machine ``` -rclone authorize "amazon cloud drive" +rclone authorize "dropbox" 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... diff --git a/docs/content/s3.md b/docs/content/s3.md index 46b5873ed72a8..cfb5a7659e331 100644 --- a/docs/content/s3.md +++ b/docs/content/s3.md @@ -84,7 +84,7 @@ name> remote Type of storage to configure. Choose a number from below, or type in your own value [snip] -XX / Amazon S3 Compliant Storage Providers including AWS, Ceph, ChinaMobile, ArvanCloud, Dreamhost, IBM COS, Liara, Minio, and Tencent COS +XX / Amazon S3 Compliant Storage Providers including AWS, ... \ "s3" [snip] Storage> s3 @@ -2452,10 +2452,10 @@ Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. [snip] - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi +XX / Amazon S3 Compliant Storage Providers including AWS, ... \ (s3) [snip] -Storage> 5 +Storage> s3 Option provider. Choose your S3 provider. Choose a number from below, or type in your own value. @@ -2576,18 +2576,11 @@ To configure access to IBM COS S3, follow the steps below: 3. Select "s3" storage. ``` Choose a number from below, or type in your own value - 1 / Alias for an existing remote - \ "alias" - 2 / Amazon Drive - \ "amazon cloud drive" - 3 / Amazon S3 Complaint Storage Providers (Dreamhost, Ceph, ChinaMobile, Liara, ArvanCloud, Minio, IBM COS) - \ "s3" - 4 / Backblaze B2 - \ "b2" [snip] - 23 / HTTP - \ "http" -Storage> 3 +XX / Amazon S3 Compliant Storage Providers including AWS, ... + \ "s3" +[snip] +Storage> s3 ``` 4. Select IBM COS as the S3 Storage Provider. @@ -2747,7 +2740,7 @@ Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. [snip] -XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi +XX / Amazon S3 Compliant Storage Providers including AWS, ... \ (s3) [snip] Storage> s3 @@ -2853,7 +2846,7 @@ Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. [snip] -XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi +XX / Amazon S3 Compliant Storage Providers including AWS, ... \ (s3) [snip] Storage> s3 @@ -3091,15 +3084,8 @@ name> qiniu ``` Choose a number from below, or type in your own value - 1 / 1Fichier - \ (fichier) - 2 / Akamai NetStorage - \ (netstorage) - 3 / Alias for an existing remote - \ (alias) - 4 / Amazon Drive - \ (amazon cloud drive) - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi +[snip] +XX / Amazon S3 Compliant Storage Providers including AWS, ... \ (s3) [snip] Storage> s3 @@ -3364,7 +3350,7 @@ Choose `s3` backend Type of storage to configure. Choose a number from below, or type in your own value. [snip] -XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS +XX / Amazon S3 Compliant Storage Providers including AWS, ... \ (s3) [snip] Storage> s3 @@ -3665,7 +3651,7 @@ Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [snip] - 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Minio, and Tencent COS +XX / Amazon S3 Compliant Storage Providers including AWS, ... \ "s3" [snip] Storage> s3 @@ -3775,7 +3761,7 @@ Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. ... - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS +XX / Amazon S3 Compliant Storage Providers including AWS, ... \ (s3) ... Storage> s3 @@ -4031,15 +4017,8 @@ name> leviia ``` Choose a number from below, or type in your own value - 1 / 1Fichier - \ (fichier) - 2 / Akamai NetStorage - \ (netstorage) - 3 / Alias for an existing remote - \ (alias) - 4 / Amazon Drive - \ (amazon cloud drive) - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi +[snip] +XX / Amazon S3 Compliant Storage Providers including AWS, ... \ (s3) [snip] Storage> s3 @@ -4252,7 +4231,7 @@ Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. [snip] - X / Amazon S3 Compliant Storage Providers including AWS, ...Linode, ...and others +XX / Amazon S3 Compliant Storage Providers including AWS, ...Linode, ...and others \ (s3) [snip] Storage> s3 @@ -4497,13 +4476,8 @@ name> cos ``` Choose a number from below, or type in your own value -1 / 1Fichier - \ "fichier" - 2 / Alias for an existing remote - \ "alias" - 3 / Amazon Drive - \ "amazon cloud drive" - 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Liara, Minio, and Tencent COS +[snip] +XX / Amazon S3 Compliant Storage Providers including AWS, ... \ "s3" [snip] Storage> s3 @@ -4911,7 +4885,7 @@ Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, GCS, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi +XX / Amazon S3 Compliant Storage Providers including AWS, ... \ "s3" Storage> s3 diff --git a/docs/layouts/chrome/navbar.html b/docs/layouts/chrome/navbar.html index 8b3d7f8713028..4d7802a45536d 100644 --- a/docs/layouts/chrome/navbar.html +++ b/docs/layouts/chrome/navbar.html @@ -54,7 +54,6 @@ 1Fichier Akamai NetStorage Alias - Amazon Drive Amazon S3 Backblaze B2 Box diff --git a/fstest/fstest.go b/fstest/fstest.go index 8a6e9e918e3c9..eebdcbd3352b2 100644 --- a/fstest/fstest.go +++ b/fstest/fstest.go @@ -284,7 +284,7 @@ func CheckListingWithRoot(t *testing.T, f fs.Fs, dir string, items []Item, expec listingOK = wantListing == gotListing if listingOK && (expectedDirs == nil || len(dirs) == len(expectedDirs)) { // Put an extra sleep in if we did any retries just to make sure it really - // is consistent (here is looking at you Amazon Drive!) + // is consistent if i != 1 { extraSleep := 5*time.Second + sleep t.Logf("Sleeping for %v just to make sure", extraSleep) diff --git a/fstest/test_all/config.yaml b/fstest/test_all/config.yaml index cba00b2a6f817..71ae62f59138f 100644 --- a/fstest/test_all/config.yaml +++ b/fstest/test_all/config.yaml @@ -15,9 +15,6 @@ tests: - path: cmd/selfupdate localonly: true backends: - # - backend: "amazonclouddrive" - # remote: "TestAmazonCloudDrive:" - # fastlist: false - backend: "local" remote: "" fastlist: false diff --git a/lib/pacer/pacer_test.go b/lib/pacer/pacer_test.go index 11aebb4ab4e13..aac3cfb89b488 100644 --- a/lib/pacer/pacer_test.go +++ b/lib/pacer/pacer_test.go @@ -163,38 +163,6 @@ func TestDefaultPacer(t *testing.T) { } -func TestAmazonCloudDrivePacer(t *testing.T) { - c := NewAmazonCloudDrive(MinSleep(1 * time.Millisecond)) - // Do lots of times because of the random number! - for _, test := range []struct { - state State - want time.Duration - }{ - {State{SleepTime: 1 * time.Millisecond, ConsecutiveRetries: 0}, 1 * time.Millisecond}, - {State{SleepTime: 10 * time.Millisecond, ConsecutiveRetries: 0}, 1 * time.Millisecond}, - {State{SleepTime: 1 * time.Second, ConsecutiveRetries: 1}, 500 * time.Millisecond}, - {State{SleepTime: 1 * time.Second, ConsecutiveRetries: 2}, 1 * time.Second}, - {State{SleepTime: 1 * time.Second, ConsecutiveRetries: 3}, 2 * time.Second}, - {State{SleepTime: 1 * time.Second, ConsecutiveRetries: 4}, 4 * time.Second}, - {State{SleepTime: 1 * time.Second, ConsecutiveRetries: 5}, 8 * time.Second}, - {State{SleepTime: 1 * time.Second, ConsecutiveRetries: 6}, 16 * time.Second}, - {State{SleepTime: 1 * time.Second, ConsecutiveRetries: 7}, 32 * time.Second}, - {State{SleepTime: 1 * time.Second, ConsecutiveRetries: 8}, 64 * time.Second}, - {State{SleepTime: 1 * time.Second, ConsecutiveRetries: 9}, 128 * time.Second}, - {State{SleepTime: 1 * time.Second, ConsecutiveRetries: 10}, 128 * time.Second}, - {State{SleepTime: 1 * time.Second, ConsecutiveRetries: 11}, 128 * time.Second}, - } { - const n = 1000 - var sum time.Duration - // measure average time over n cycles - for i := 0; i < n; i++ { - sum += c.Calculate(test.state) - } - got := sum / n - assert.False(t, got < (test.want*9)/10 || got > (test.want*11)/10, "test: %+v", test) - } -} - func TestAzureIMDSPacer(t *testing.T) { c := NewAzureIMDS() for _, test := range []struct { diff --git a/lib/pacer/pacers.go b/lib/pacer/pacers.go index 94ef86ccbcf79..960d0469f0889 100644 --- a/lib/pacer/pacers.go +++ b/lib/pacer/pacers.go @@ -113,70 +113,6 @@ func (c *ZeroDelayCalculator) Calculate(state State) time.Duration { return 0 } -// AmazonCloudDrive is a specialized pacer for Amazon Drive -// -// It implements a truncated exponential backoff strategy with randomization. -// Normally operations are paced at the interval set with SetMinSleep. On errors -// the sleep timer is set to 0..2**retries seconds. -// -// See https://developer.amazon.com/public/apis/experience/cloud-drive/content/restful-api-best-practices -type AmazonCloudDrive struct { - minSleep time.Duration // minimum sleep time -} - -// AmazonCloudDriveOption is the interface implemented by all options for the AmazonCloudDrive Calculator -type AmazonCloudDriveOption interface { - ApplyAmazonCloudDrive(*AmazonCloudDrive) -} - -// NewAmazonCloudDrive returns a new AmazonCloudDrive Calculator with default values -func NewAmazonCloudDrive(opts ...AmazonCloudDriveOption) *AmazonCloudDrive { - c := &AmazonCloudDrive{ - minSleep: 10 * time.Millisecond, - } - c.Update(opts...) - return c -} - -// Update applies the Calculator options. -func (c *AmazonCloudDrive) Update(opts ...AmazonCloudDriveOption) { - for _, opt := range opts { - opt.ApplyAmazonCloudDrive(c) - } -} - -// ApplyAmazonCloudDrive updates the value on the Calculator -func (o MinSleep) ApplyAmazonCloudDrive(c *AmazonCloudDrive) { - c.minSleep = time.Duration(o) -} - -// Calculate takes the current Pacer state and return the wait time until the next try. -func (c *AmazonCloudDrive) Calculate(state State) time.Duration { - if t, ok := IsRetryAfter(state.LastError); ok { - if t < c.minSleep { - return c.minSleep - } - return t - } - - consecutiveRetries := state.ConsecutiveRetries - if consecutiveRetries == 0 { - return c.minSleep - } - if consecutiveRetries > 9 { - consecutiveRetries = 9 - } - // consecutiveRetries starts at 1 so - // maxSleep is 2**(consecutiveRetries-1) seconds - maxSleep := time.Second << uint(consecutiveRetries-1) - // actual sleep is random from 0..maxSleep - sleepTime := time.Duration(rand.Int63n(int64(maxSleep))) - if sleepTime < c.minSleep { - sleepTime = c.minSleep - } - return sleepTime -} - // AzureIMDS is a pacer for the Azure instance metadata service. type AzureIMDS struct { } From 5fa13e3e31d9945340ea5d8c08c69707aa053747 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 3 Jan 2024 11:00:59 +0000 Subject: [PATCH 069/130] protondrive: fix CVE-2023-45286 / GHSA-xwh9-gc39-5298 A race condition in go-resty can result in HTTP request body disclosure across requests. See: https://pkg.go.dev/vuln/GO-2023-2328 Fixes: #7491 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index ebb54366dfc27..14e3813df7d43 100644 --- a/go.mod +++ b/go.mod @@ -113,7 +113,7 @@ require ( github.com/gdamore/encoding v1.0.0 // indirect github.com/geoffgarside/ber v1.1.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect - github.com/go-resty/resty/v2 v2.10.0 // indirect + github.com/go-resty/resty/v2 v2.11.0 // indirect github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v5 v5.0.0 // indirect diff --git a/go.sum b/go.sum index d6c5d8bb13295..2611131027412 100644 --- a/go.sum +++ b/go.sum @@ -201,8 +201,8 @@ github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= -github.com/go-resty/resty/v2 v2.10.0 h1:Qla4W/+TMmv0fOeeRqzEpXPLfTUnR5HZ1+lGs+CkiCo= -github.com/go-resty/resty/v2 v2.10.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A= +github.com/go-resty/resty/v2 v2.11.0 h1:i7jMfNOJYMp69lq7qozJP+bjgzfAzeOhuGlyDrqxT/8= +github.com/go-resty/resty/v2 v2.11.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= From 486a10bec5879d8f7234aa6166517c50a955ca03 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 5 Dec 2023 11:11:29 +0000 Subject: [PATCH 070/130] serve s3: fix listing oddities Before this change, listing a subdirectory gave errors like this: Entry doesn't belong in directory "" (contains subdir) - ignoring It also did full recursive listings when it didn't need to. This was caused by the code using the underlying Fs to do recursive listings on bucket based backends. Using both the VFS and the underlying Fs is a mistake so this patch removes the code which uses the underlying Fs and just uses the VFS. Fixes #7500 --- cmd/serve/s3/backend.go | 12 +++--------- cmd/serve/s3/list.go | 40 ++-------------------------------------- 2 files changed, 5 insertions(+), 47 deletions(-) diff --git a/cmd/serve/s3/backend.go b/cmd/serve/s3/backend.go index 397760102b40b..4e88e418f80e0 100644 --- a/cmd/serve/s3/backend.go +++ b/cmd/serve/s3/backend.go @@ -77,13 +77,9 @@ func (b *s3Backend) ListBucket(bucket string, prefix *gofakes3.Prefix, page gofa } response := gofakes3.NewObjectList() - if b.vfs.Fs().Features().BucketBased || prefix.HasDelimiter && prefix.Delimiter != "/" { - err = b.getObjectsListArbitrary(bucket, prefix, response) - } else { - path, remaining := prefixParser(prefix) - err = b.entryListR(bucket, path, remaining, prefix.HasDelimiter, response) - } + path, remaining := prefixParser(prefix) + err = b.entryListR(bucket, path, remaining, prefix.HasDelimiter, response) if err == gofakes3.ErrNoSuchKey { // AWS just returns an empty list response = gofakes3.NewObjectList() @@ -366,9 +362,7 @@ func (b *s3Backend) deleteObject(bucketName, objectName string) error { } // FIXME: unsafe operation - if b.vfs.Fs().Features().CanHaveEmptyDirectories { - rmdirRecursive(fp, b.vfs) - } + rmdirRecursive(fp, b.vfs) return nil } diff --git a/cmd/serve/s3/list.go b/cmd/serve/s3/list.go index 93f0f87e3f264..d2373615242cb 100644 --- a/cmd/serve/s3/list.go +++ b/cmd/serve/s3/list.go @@ -1,16 +1,13 @@ package s3 import ( - "context" "path" "strings" "github.com/Mikubill/gofakes3" - "github.com/rclone/rclone/fs" - "github.com/rclone/rclone/fs/walk" ) -func (b *s3Backend) entryListR(bucket, fdPath, name string, acceptComPrefix bool, response *gofakes3.ObjectList) error { +func (b *s3Backend) entryListR(bucket, fdPath, name string, addPrefix bool, response *gofakes3.ObjectList) error { fp := path.Join(bucket, fdPath) dirEntries, err := getDirEntries(fp, b.vfs) @@ -29,7 +26,7 @@ func (b *s3Backend) entryListR(bucket, fdPath, name string, acceptComPrefix bool } if entry.IsDir() { - if acceptComPrefix { + if addPrefix { response.AddPrefix(gofakes3.URLEncode(objectPath)) continue } @@ -50,36 +47,3 @@ func (b *s3Backend) entryListR(bucket, fdPath, name string, acceptComPrefix bool } return nil } - -// getObjectsList lists the objects in the given bucket. -func (b *s3Backend) getObjectsListArbitrary(bucket string, prefix *gofakes3.Prefix, response *gofakes3.ObjectList) error { - // ignore error - vfs may have uncommitted updates, such as new dir etc. - _ = walk.ListR(context.Background(), b.vfs.Fs(), bucket, false, -1, walk.ListObjects, func(entries fs.DirEntries) error { - for _, entry := range entries { - entry := entry.(fs.Object) - objName := entry.Remote() - object := strings.TrimPrefix(objName, bucket)[1:] - - var matchResult gofakes3.PrefixMatch - if prefix.Match(object, &matchResult) { - if matchResult.CommonPrefix { - response.AddPrefix(gofakes3.URLEncode(object)) - continue - } - - item := &gofakes3.Content{ - Key: gofakes3.URLEncode(object), - LastModified: gofakes3.NewContentTime(entry.ModTime(context.Background())), - ETag: getFileHash(entry), - Size: entry.Size(), - StorageClass: gofakes3.StorageStandard, - } - response.Add(item) - } - } - - return nil - }) - - return nil -} From c16c22d6e110db889e2d677a9d9b070ce3ea7584 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 16 Dec 2023 11:34:38 +0000 Subject: [PATCH 071/130] s3: fix crash if no UploadId in multipart upload Before this change if the S3 API returned a multipart upload with no UploadId then rclone would crash. This detects the problem and attempts to retry the multipart upload creation. See: https://forum.rclone.org/t/panic-runtime-error-invalid-memory-address-or-nil-pointer-dereference/43425 --- backend/s3/s3.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/s3/s3.go b/backend/s3/s3.go index d7ca47a7762f0..c0359029e5cb7 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -5711,6 +5711,13 @@ func (f *Fs) OpenChunkWriter(ctx context.Context, remote string, src fs.ObjectIn var mOut *s3.CreateMultipartUploadOutput err = f.pacer.Call(func() (bool, error) { mOut, err = f.c.CreateMultipartUploadWithContext(ctx, &mReq) + if err == nil { + if mOut == nil { + err = fserrors.RetryErrorf("internal error: no info from multipart upload") + } else if mOut.UploadId == nil { + err = fserrors.RetryErrorf("internal error: no UploadId in multpart upload: %#v", *mOut) + } + } return f.shouldRetry(ctx, err) }) if err != nil { From 1f6271fa158db44728aa71a6b63cf0a1b66f01e2 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 1 Dec 2023 10:30:44 +0000 Subject: [PATCH 072/130] s3: copy parts in parallel when doing chunked server side copy Before this change rclone copied each chunk serially. After this change it does --s3-upload-concurrency at once. See: https://forum.rclone.org/t/transfer-big-files-50gb-from-s3-bucket-to-another-s3-bucket-doesnt-starts/43209 --- backend/s3/s3.go | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/backend/s3/s3.go b/backend/s3/s3.go index c0359029e5cb7..473f74ece14fd 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -61,6 +61,7 @@ import ( "github.com/rclone/rclone/lib/rest" "github.com/rclone/rclone/lib/version" "golang.org/x/net/http/httpguts" + "golang.org/x/sync/errgroup" ) // The S3 providers @@ -2185,10 +2186,10 @@ If empty it will default to the environment variable "AWS_PROFILE" or Sensitive: true, }, { Name: "upload_concurrency", - Help: `Concurrency for multipart uploads. + Help: `Concurrency for multipart uploads and copies. This is the number of chunks of the same file that are uploaded -concurrently. +concurrently for multipart uploads and copies. If you are uploading small numbers of large files over high-speed links and these uploads do not fully utilize your bandwidth, then increasing @@ -4507,10 +4508,20 @@ func (f *Fs) copyMultipart(ctx context.Context, copyReq *s3.CopyObjectInput, dst fs.Debugf(src, "Starting multipart copy with %d parts", numParts) - var parts []*s3.CompletedPart + var ( + parts = make([]*s3.CompletedPart, numParts) + g, gCtx = errgroup.WithContext(ctx) + ) + g.SetLimit(f.opt.UploadConcurrency) for partNum := int64(1); partNum <= numParts; partNum++ { - if err := f.pacer.Call(func() (bool, error) { - partNum := partNum + // Fail fast, in case an errgroup managed function returns an error + // gCtx is cancelled. There is no point in uploading all the other parts. + if gCtx.Err() != nil { + break + } + partNum := partNum // for closure + g.Go(func() error { + var uout *s3.UploadPartCopyOutput uploadPartReq := &s3.UploadPartCopyInput{} //structs.SetFrom(uploadPartReq, copyReq) setFrom_s3UploadPartCopyInput_s3CopyObjectInput(uploadPartReq, copyReq) @@ -4519,18 +4530,24 @@ func (f *Fs) copyMultipart(ctx context.Context, copyReq *s3.CopyObjectInput, dst uploadPartReq.PartNumber = &partNum uploadPartReq.UploadId = uid uploadPartReq.CopySourceRange = aws.String(calculateRange(partSize, partNum-1, numParts, srcSize)) - uout, err := f.c.UploadPartCopyWithContext(ctx, uploadPartReq) + err := f.pacer.Call(func() (bool, error) { + uout, err = f.c.UploadPartCopyWithContext(gCtx, uploadPartReq) + return f.shouldRetry(gCtx, err) + }) if err != nil { - return f.shouldRetry(ctx, err) + return err } - parts = append(parts, &s3.CompletedPart{ + parts[partNum-1] = &s3.CompletedPart{ PartNumber: &partNum, ETag: uout.CopyPartResult.ETag, - }) - return false, nil - }); err != nil { - return err - } + } + return nil + }) + } + + err = g.Wait() + if err != nil { + return err } return f.pacer.Call(func() (bool, error) { From dedad9f071d81a2b6bf980d5f48d7997cae160af Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 5 Jan 2024 12:43:19 +0000 Subject: [PATCH 073/130] onedrive: fix "unauthenticated: Unauthenticated" errors when uploading Before this change, sometimes when uploading files the onedrive servers return 401 Unauthorized errors with the text "unauthenticated: Unauthenticated". This is because we are sending the Authorization header with the request and it says in the docs that we shouldn't. https://learn.microsoft.com/en-us/graph/api/driveitem-createuploadsession?view=graph-rest-1.0#remarks > If you include the Authorization header when issuing the PUT call, > it may result in an HTTP 401 Unauthorized response. Only send the > Authorization header and bearer token when issuing the POST during > the first step. Don't include it when you issue the PUT call. This patch fixes the problem by doing the PUT request with an unauthenticated client. Fixes #7405 See: https://forum.rclone.org/t/onedrive-unauthenticated-when-trying-to-copy-sync-but-can-use-lsd/41149/ See: https://forum.rclone.org/t/onedrive-unauthenticated-issue/43792/ --- backend/onedrive/onedrive.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.go index 5d8c68d030dbf..291ce34355232 100644 --- a/backend/onedrive/onedrive.go +++ b/backend/onedrive/onedrive.go @@ -27,6 +27,7 @@ import ( "github.com/rclone/rclone/fs/config/configstruct" "github.com/rclone/rclone/fs/config/obscure" "github.com/rclone/rclone/fs/fserrors" + "github.com/rclone/rclone/fs/fshttp" "github.com/rclone/rclone/fs/hash" "github.com/rclone/rclone/fs/operations" "github.com/rclone/rclone/fs/walk" @@ -688,6 +689,7 @@ type Fs struct { ci *fs.ConfigInfo // global config features *fs.Features // optional features srv *rest.Client // the connection to the OneDrive server + unAuth *rest.Client // no authentication connection to the OneDrive server dirCache *dircache.DirCache // Map of directory path to directory id pacer *fs.Pacer // pacer for API calls tokenRenewer *oauthutil.Renew // renew the token on expiry @@ -946,8 +948,9 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e TokenURL: authEndpoint[opt.Region] + tokenPath, } + client := fshttp.NewClient(ctx) root = parsePath(root) - oAuthClient, ts, err := oauthutil.NewClient(ctx, name, m, oauthConfig) + oAuthClient, ts, err := oauthutil.NewClientWithBaseClient(ctx, name, m, oauthConfig, client) if err != nil { return nil, fmt.Errorf("failed to configure OneDrive: %w", err) } @@ -961,6 +964,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e driveID: opt.DriveID, driveType: opt.DriveType, srv: rest.NewClient(oAuthClient).SetRoot(rootURL), + unAuth: rest.NewClient(client).SetRoot(rootURL), pacer: fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(minSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant))), hashType: QuickXorHashType, } @@ -2245,7 +2249,7 @@ func (o *Object) uploadFragment(ctx context.Context, url string, start int64, to Options: options, } _, _ = chunk.Seek(skip, io.SeekStart) - resp, err = o.fs.srv.Call(ctx, &opts) + resp, err = o.fs.unAuth.Call(ctx, &opts) if err != nil && resp != nil && resp.StatusCode == http.StatusRequestedRangeNotSatisfiable { fs.Debugf(o, "Received 416 error - reading current position from server: %v", err) pos, posErr := o.getPosition(ctx, url) From d392f9fcd8e1403916a741f58278e59281241ab0 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 4 Jan 2024 11:39:51 +0000 Subject: [PATCH 074/130] accounting: fix stats to show server side transfers Before this fix we were not counting transferred files nor transferred bytes for server side moves/copies. If the server side move/copy has been marked as a transfer and not a checker then this accounts transferred files and transferred bytes. The transferred bytes are not accounted to the network though so this should not affect the network stats. --- fs/accounting/accounting.go | 33 ++++++++++++++++++++++----------- fs/accounting/stats.go | 7 +++++++ fs/accounting/transfer.go | 1 + 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/fs/accounting/accounting.go b/fs/accounting/accounting.go index 29681b604dc42..41eb71225d90e 100644 --- a/fs/accounting/accounting.go +++ b/fs/accounting/accounting.go @@ -49,17 +49,18 @@ type Account struct { // in http transport calls Read() after Do() returns on // CancelRequest so this race can happen when it apparently // shouldn't. - mu sync.Mutex // mutex protects these values - in io.Reader - ctx context.Context // current context for transfer - may change - ci *fs.ConfigInfo - origIn io.ReadCloser - close io.Closer - size int64 - name string - closed bool // set if the file is closed - exit chan struct{} // channel that will be closed when transfer is finished - withBuf bool // is using a buffered in + mu sync.Mutex // mutex protects these values + in io.Reader + ctx context.Context // current context for transfer - may change + ci *fs.ConfigInfo + origIn io.ReadCloser + close io.Closer + size int64 + name string + closed bool // set if the file is closed + exit chan struct{} // channel that will be closed when transfer is finished + withBuf bool // is using a buffered in + checking bool // set if attached transfer is checking tokenBucket buckets // per file bandwidth limiter (may be nil) @@ -295,14 +296,24 @@ func (acc *Account) ServerSideTransferEnd(n int64) { acc.stats.Bytes(n) } +// serverSideEnd accounts for non specific server side data +func (acc *Account) serverSideEnd(n int64) { + // Account for bytes unless we are checking + if !acc.checking { + acc.stats.BytesNoNetwork(n) + } +} + // ServerSideCopyEnd accounts for a read of n bytes in a sever side copy func (acc *Account) ServerSideCopyEnd(n int64) { acc.stats.AddServerSideCopy(n) + acc.serverSideEnd(n) } // ServerSideMoveEnd accounts for a read of n bytes in a sever side move func (acc *Account) ServerSideMoveEnd(n int64) { acc.stats.AddServerSideMove(n) + acc.serverSideEnd(n) } // DryRun accounts for statistics without running the operation diff --git a/fs/accounting/stats.go b/fs/accounting/stats.go index 24c9bcda1c00e..665f0345109a2 100644 --- a/fs/accounting/stats.go +++ b/fs/accounting/stats.go @@ -527,6 +527,13 @@ func (s *StatsInfo) Bytes(bytes int64) { s.bytes += bytes } +// BytesNoNetwork updates the stats for bytes bytes but doesn't include the transfer stats +func (s *StatsInfo) BytesNoNetwork(bytes int64) { + s.mu.Lock() + defer s.mu.Unlock() + s.bytes += bytes +} + // GetBytes returns the number of bytes transferred so far func (s *StatsInfo) GetBytes() int64 { s.mu.RLock() diff --git a/fs/accounting/transfer.go b/fs/accounting/transfer.go index d4515e201f049..5860eefb202ea 100644 --- a/fs/accounting/transfer.go +++ b/fs/accounting/transfer.go @@ -149,6 +149,7 @@ func (tr *Transfer) Account(ctx context.Context, in io.ReadCloser) *Account { } else { tr.acc.UpdateReader(ctx, in) } + tr.acc.checking = tr.checking tr.mu.Unlock() return tr.acc } From fbdf71ab64567c4715640ef761254a44fed2d9a9 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 4 Jan 2024 11:28:47 +0000 Subject: [PATCH 075/130] operations: fix files moved by rclone move not being counted as transfers Before this change we were only counting moves as checks. This means that when using `rclone move` the `Transfers` stat did not count up like it should do. This changes introduces a new primitive operations.MoveTransfers which counts moves as Transfers for use where that is appropriate, such as rclone move/moveto. Otherwise moves are counted as checks and their bytes are not accounted. See: #7183 See: https://forum.rclone.org/t/stats-one-line-date-broken-in-1-64-0-and-later/43263/ --- fs/operations/operations.go | 26 ++++++++++++++++++++++++-- fs/sync/sync.go | 2 +- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/fs/operations/operations.go b/fs/operations/operations.go index a7e2f6d50ac30..62d03ab37ee8a 100644 --- a/fs/operations/operations.go +++ b/fs/operations/operations.go @@ -332,9 +332,29 @@ func SameObject(src, dst fs.Object) bool { // // It returns the destination object if possible. Note that this may // be nil. +// +// This is accounted as a check. func Move(ctx context.Context, fdst fs.Fs, dst fs.Object, remote string, src fs.Object) (newDst fs.Object, err error) { + return move(ctx, fdst, dst, remote, src, false) +} + +// MoveTransfer moves src object to dst or fdst if nil. If dst is nil +// then it uses remote as the name of the new object. +// +// This is identical to Move but is accounted as a transfer. +func MoveTransfer(ctx context.Context, fdst fs.Fs, dst fs.Object, remote string, src fs.Object) (newDst fs.Object, err error) { + return move(ctx, fdst, dst, remote, src, true) +} + +// move - see Move for help +func move(ctx context.Context, fdst fs.Fs, dst fs.Object, remote string, src fs.Object, isTransfer bool) (newDst fs.Object, err error) { ci := fs.GetConfig(ctx) - tr := accounting.Stats(ctx).NewCheckingTransfer(src, "moving") + var tr *accounting.Transfer + if isTransfer { + tr = accounting.Stats(ctx).NewTransfer(src) + } else { + tr = accounting.Stats(ctx).NewCheckingTransfer(src, "moving") + } defer func() { if err == nil { accounting.Stats(ctx).Renames(1) @@ -1695,7 +1715,7 @@ func moveOrCopyFile(ctx context.Context, fdst fs.Fs, fsrc fs.Fs, dstFileName str } // Choose operations - Op := Move + Op := MoveTransfer if cp { Op = Copy } @@ -1797,6 +1817,8 @@ func moveOrCopyFile(ctx context.Context, fdst fs.Fs, fsrc fs.Fs, dstFileName str } // MoveFile moves a single file possibly to a new name +// +// This is treated as a transfer. func MoveFile(ctx context.Context, fdst fs.Fs, fsrc fs.Fs, dstFileName string, srcFileName string) (err error) { return moveOrCopyFile(ctx, fdst, fsrc, dstFileName, srcFileName, false) } diff --git a/fs/sync/sync.go b/fs/sync/sync.go index 255dfaf1a9fde..18a8b67b774a8 100644 --- a/fs/sync/sync.go +++ b/fs/sync/sync.go @@ -437,7 +437,7 @@ func (s *syncCopyMove) pairCopyOrMove(ctx context.Context, in *pipe, fdst fs.Fs, dst := pair.Dst if s.DoMove { if src != dst { - _, err = operations.Move(ctx, fdst, dst, src.Remote(), src) + _, err = operations.MoveTransfer(ctx, fdst, dst, src.Remote(), src) } else { // src == dst signals delete the src err = operations.DeleteFile(ctx, src) From 41b8935a6cc09a2db240039810e0e0b9a59c2252 Mon Sep 17 00:00:00 2001 From: Vincent Murphy Date: Mon, 8 Jan 2024 10:56:36 +0000 Subject: [PATCH 076/130] docs: Fix broken test_proxy.py link again The previous fix fixed the auto generated output - this fixes the source. --- cmd/serve/proxy/proxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/serve/proxy/proxy.go b/cmd/serve/proxy/proxy.go index 9e1d15878ba2f..6cff1782c30fb 100644 --- a/cmd/serve/proxy/proxy.go +++ b/cmd/serve/proxy/proxy.go @@ -36,7 +36,7 @@ together, if |--auth-proxy| is set the authorized keys option will be ignored. There is an example program -[bin/test_proxy.py](https://github.com/rclone/rclone/blob/master/test_proxy.py) +[bin/test_proxy.py](https://github.com/rclone/rclone/blob/master/bin/test_proxy.py) in the rclone source code. The program's job is to take a |user| and |pass| on the input and turn From e20f2eee59cebc1485e35c85e7fb65e9e0df2fbd Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 8 Jan 2024 11:53:18 +0000 Subject: [PATCH 077/130] Changelog updates from Version v1.65.1 --- docs/content/changelog.md | 50 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/docs/content/changelog.md b/docs/content/changelog.md index 17387e5b0d1b3..d9364b460759d 100644 --- a/docs/content/changelog.md +++ b/docs/content/changelog.md @@ -5,6 +5,56 @@ description: "Rclone Changelog" # Changelog +## v1.65.1 - 2024-01-08 + +[See commits](https://github.com/rclone/rclone/compare/v1.65.0...v1.65.1) + +* Bug Fixes + * build + * Bump golang.org/x/crypto to fix ssh terrapin CVE-2023-48795 (dependabot) + * Update to go1.21.5 to fix Windows path problems (Nick Craig-Wood) + * Fix docker build on arm/v6 (Nick Craig-Wood) + * install.sh: fix harmless error message on install (Nick Craig-Wood) + * accounting: fix stats to show server side transfers (Nick Craig-Wood) + * doc fixes (albertony, ben-ba, Eli Orzitzer, emyarod, keongalvin, rarspace01) + * nfsmount: Compile for all unix oses, add `--sudo` and fix error/option handling (Nick Craig-Wood) + * operations: Fix files moved by rclone move not being counted as transfers (Nick Craig-Wood) + * oauthutil: Avoid panic when `*token` and `*ts.token` are the same (rkonfj) + * serve s3: Fix listing oddities (Nick Craig-Wood) +* VFS + * Note that `--vfs-refresh` runs in the background (Nick Craig-Wood) +* Azurefiles + * Fix storage base url (Oksana) +* Crypt + * Fix rclone move a file over itself deleting the file (Nick Craig-Wood) +* Chunker + * Fix rclone move a file over itself deleting the file (Nick Craig-Wood) +* Compress + * Fix rclone move a file over itself deleting the file (Nick Craig-Wood) +* Dropbox + * Fix used space on dropbox team accounts (Nick Craig-Wood) +* FTP + * Fix multi-thread copy (WeidiDeng) +* Googlephotos + * Fix nil pointer exception when batch failed (Nick Craig-Wood) +* Hasher + * Fix rclone move a file over itself deleting the file (Nick Craig-Wood) + * Fix invalid memory address error when MaxAge == 0 (nielash) +* Onedrive + * Fix error listing: unknown object type `` (Nick Craig-Wood) + * Fix "unauthenticated: Unauthenticated" errors when uploading (Nick Craig-Wood) +* Oracleobjectstorage + * Fix object storage endpoint for custom endpoints (Manoj Ghosh) + * Multipart copy create bucket if it doesn't exist. (Manoj Ghosh) +* Protondrive + * Fix CVE-2023-45286 / GHSA-xwh9-gc39-5298 (Nick Craig-Wood) +* S3 + * Fix crash if no UploadId in multipart upload (Nick Craig-Wood) +* Smb + * Fix shares not listed by updating go-smb2 (halms) +* Union + * Fix rclone move a file over itself deleting the file (Nick Craig-Wood) + ## v1.65.0 - 2023-11-26 [See commits](https://github.com/rclone/rclone/compare/v1.64.0...v1.65.0) From 0563cc63144fe71d788eb5494e107c44f152cf37 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 16:54:10 +0000 Subject: [PATCH 078/130] build(deps): bump github.com/cloudflare/circl from 1.3.6 to 1.3.7 Bumps [github.com/cloudflare/circl](https://github.com/cloudflare/circl) from 1.3.6 to 1.3.7. - [Release notes](https://github.com/cloudflare/circl/releases) - [Commits](https://github.com/cloudflare/circl/compare/v1.3.6...v1.3.7) --- updated-dependencies: - dependency-name: github.com/cloudflare/circl dependency-type: indirect ... Signed-off-by: dependabot[bot] --- go.mod | 4 +--- go.sum | 9 ++------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 14e3813df7d43..7af4acf620a68 100644 --- a/go.mod +++ b/go.mod @@ -46,7 +46,6 @@ require ( github.com/minio/minio-go/v7 v7.0.63 github.com/mitchellh/go-homedir v1.1.0 github.com/moby/sys/mountinfo v0.6.2 - github.com/ncw/go-acd v0.0.0-20201019170801-fe55f33415b1 github.com/ncw/swift/v2 v2.0.2 github.com/oracle/oci-go-sdk/v65 v65.51.0 github.com/patrickmn/go-cache v2.1.0+incompatible @@ -101,7 +100,7 @@ require ( github.com/bradenaw/juniper v0.13.1 // indirect github.com/calebcase/tmpfile v1.0.3 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cloudflare/circl v1.3.6 // indirect + github.com/cloudflare/circl v1.3.7 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect github.com/cronokirby/saferith v0.33.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -189,7 +188,6 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c github.com/golang-jwt/jwt/v4 v4.5.0 github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/google/go-querystring v1.1.0 // indirect github.com/pkg/xattr v0.4.9 golang.org/x/mobile v0.0.0-20231006135142-2b44d11868fe golang.org/x/term v0.15.0 diff --git a/go.sum b/go.sum index 2611131027412..9d5941bdd506b 100644 --- a/go.sum +++ b/go.sum @@ -131,8 +131,8 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= -github.com/cloudflare/circl v1.3.6 h1:/xbKIqSHbZXHwkhbrhrt2YOHIwYJlXH94E3tI/gDlUg= -github.com/cloudflare/circl v1.3.6/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= +github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= +github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cloudsoda/go-smb2 v0.0.0-20231124195312-f3ec8ae2c891 h1:nPP4suUiNage0vvyEBgfAnhTPwwXhNqtHmSuiCIQwKU= github.com/cloudsoda/go-smb2 v0.0.0-20231124195312-f3ec8ae2c891/go.mod h1:xFxVVe3plxwhM+6BgTTPByEgG8hggo8+gtRUkbc5W8Q= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= @@ -256,15 +256,12 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= -github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -411,8 +408,6 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= -github.com/ncw/go-acd v0.0.0-20201019170801-fe55f33415b1 h1:nAjWYc03awJAjsozNehdGZsm5LP7AhLOvjgbS8zN1tk= -github.com/ncw/go-acd v0.0.0-20201019170801-fe55f33415b1/go.mod h1:MLIrzg7gp/kzVBxRE1olT7CWYMCklcUWU+ekoxOD9x0= github.com/ncw/swift/v2 v2.0.2 h1:jx282pcAKFhmoZBSdMcCRFn9VWkoBIRsCpe+yZq7vEk= github.com/ncw/swift/v2 v2.0.2/go.mod h1:z0A9RVdYPjNjXVo2pDOPxZ4eu3oarO1P91fTItcb+Kg= github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= From 1045f5412804c73fb729e7d1ab0a99713aef75f9 Mon Sep 17 00:00:00 2001 From: Nikhil Ahuja Date: Tue, 19 Dec 2023 20:56:32 +0530 Subject: [PATCH 079/130] oracleobjectstorage: Support "backend restore" command - fixes #7371 --- backend/oracleobjectstorage/command.go | 102 +++++++++++++++++++++++++ docs/content/oracleobjectstorage.md | 41 ++++++++++ 2 files changed, 143 insertions(+) diff --git a/backend/oracleobjectstorage/command.go b/backend/oracleobjectstorage/command.go index 4be61e3e5f9a6..e6b079231a0b8 100644 --- a/backend/oracleobjectstorage/command.go +++ b/backend/oracleobjectstorage/command.go @@ -7,12 +7,15 @@ import ( "context" "fmt" "sort" + "strconv" "strings" + "sync" "time" "github.com/oracle/oci-go-sdk/v65/common" "github.com/oracle/oci-go-sdk/v65/objectstorage" "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/operations" ) // ------------------------------------------------------------ @@ -23,6 +26,7 @@ const ( operationRename = "rename" operationListMultiPart = "list-multipart-uploads" operationCleanup = "cleanup" + operationRestore = "restore" ) var commandHelp = []fs.CommandHelp{{ @@ -77,6 +81,42 @@ Durations are parsed as per the rest of rclone, 2h, 7d, 7w etc. Opts: map[string]string{ "max-age": "Max age of upload to delete", }, +}, { + Name: operationRestore, + Short: "Restore objects from Archive to Standard storage", + Long: `This command can be used to restore one or more objects from Archive to Standard storage. + + Usage Examples: + + rclone backend restore oos:bucket/path/to/directory -o hours=HOURS + rclone backend restore oos:bucket -o hours=HOURS + +This flag also obeys the filters. Test first with --interactive/-i or --dry-run flags + + rclone --interactive backend restore --include "*.txt" oos:bucket/path -o hours=72 + +All the objects shown will be marked for restore, then + + rclone backend restore --include "*.txt" oos:bucket/path -o hours=72 + + It returns a list of status dictionaries with Object Name and Status + keys. The Status will be "RESTORED"" if it was successful or an error message + if not. + + [ + { + "Object": "test.txt" + "Status": "RESTORED", + }, + { + "Object": "test/file4.txt" + "Status": "RESTORED", + } + ] +`, + Opts: map[string]string{ + "hours": "The number of hours for which this object will be restored. Default is 24 hrs.", + }, }, } @@ -113,6 +153,8 @@ func (f *Fs) Command(ctx context.Context, commandName string, args []string, } } return nil, f.cleanUp(ctx, maxAge) + case operationRestore: + return f.restore(ctx, opt) default: return nil, fs.ErrorCommandNotFound } @@ -290,3 +332,63 @@ func (f *Fs) listMultipartUploadParts(ctx context.Context, bucketName, bucketPat } return uploadedParts, nil } + +func (f *Fs) restore(ctx context.Context, opt map[string]string) (interface{}, error) { + req := objectstorage.RestoreObjectsRequest{ + NamespaceName: common.String(f.opt.Namespace), + RestoreObjectsDetails: objectstorage.RestoreObjectsDetails{}, + } + if hours := opt["hours"]; hours != "" { + ihours, err := strconv.Atoi(hours) + if err != nil { + return nil, fmt.Errorf("bad value for hours: %w", err) + } + req.RestoreObjectsDetails.Hours = &ihours + } + type status struct { + Object string + Status string + } + var ( + outMu sync.Mutex + out = []status{} + err error + ) + err = operations.ListFn(ctx, f, func(obj fs.Object) { + // Remember this is run --checkers times concurrently + o, ok := obj.(*Object) + st := status{Object: obj.Remote(), Status: "RESTORED"} + defer func() { + outMu.Lock() + out = append(out, st) + outMu.Unlock() + }() + if !ok { + st.Status = "Not an OCI Object Storage object" + return + } + if o.storageTier == nil || (*o.storageTier != "archive") { + st.Status = "Object not in Archive storage tier" + return + } + if operations.SkipDestructive(ctx, obj, "restore") { + return + } + bucket, bucketPath := o.split() + reqCopy := req + reqCopy.BucketName = &bucket + reqCopy.ObjectName = &bucketPath + var response objectstorage.RestoreObjectsResponse + err = f.pacer.Call(func() (bool, error) { + response, err = f.srv.RestoreObjects(ctx, reqCopy) + return shouldRetry(ctx, response.HTTPResponse(), err) + }) + if err != nil { + st.Status = err.Error() + } + }) + if err != nil { + return out, err + } + return out, nil +} diff --git a/docs/content/oracleobjectstorage.md b/docs/content/oracleobjectstorage.md index a418ad8b30621..8ac76dc27bf46 100644 --- a/docs/content/oracleobjectstorage.md +++ b/docs/content/oracleobjectstorage.md @@ -771,6 +771,47 @@ Options: - "max-age": Max age of upload to delete +### restore + +Restore objects from Archive to Standard storage + + rclone backend restore remote: [options] [+] + +This command can be used to restore one or more objects from Archive to Standard storage. + + Usage Examples: + + rclone backend restore oos:bucket/path/to/directory -o hours=HOURS + rclone backend restore oos:bucket -o hours=HOURS + +This flag also obeys the filters. Test first with --interactive/-i or --dry-run flags + + rclone --interactive backend restore --include "*.txt" oos:bucket/path -o hours=72 + +All the objects shown will be marked for restore, then + + rclone backend restore --include "*.txt" oos:bucket/path -o hours=72 + + It returns a list of status dictionaries with Object Name and Status + keys. The Status will be "RESTORED"" if it was successful or an error message + if not. + + [ + { + "Object": "test.txt" + "Status": "RESTORED", + }, + { + "Object": "test/file4.txt" + "Status": "RESTORED", + } + ] + + +Options: + +- "hours": The number of hours for which this object will be restored. Default is 24 hrs. + {{< rem autogenerated options stop >}} ## Tutorials From 3df6518006556833191421ee9e90a8788113d226 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 13 Jan 2024 14:27:44 +0000 Subject: [PATCH 080/130] Add Nikhil Ahuja to contributors --- docs/content/authors.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/content/authors.md b/docs/content/authors.md index 986b3628aad4b..81c93d3c5ad86 100644 --- a/docs/content/authors.md +++ b/docs/content/authors.md @@ -813,3 +813,4 @@ put them back in again.` >}} * keongalvin * rarspace01 * Paul Stern + * Nikhil Ahuja From 519fe98e6e7798c3ae14ffd60af6ce2316b126a5 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 12 Jan 2024 09:45:59 +0000 Subject: [PATCH 081/130] azureblob: implement --azureblob-delete-snapshots This flag controls what happens when we try to delete a blob with a snapshot. The UI follows the azcopy tool. See: https://forum.rclone.org/t/how-to-delete-undeleted-blobs-on-azure/43911/ --- backend/azureblob/azureblob.go | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/backend/azureblob/azureblob.go b/backend/azureblob/azureblob.go index 89e308aed04be..22dc063c9c3ca 100644 --- a/backend/azureblob/azureblob.go +++ b/backend/azureblob/azureblob.go @@ -401,6 +401,24 @@ rclone does if you know the container exists already. Help: `If set, do not do HEAD before GET when getting objects.`, Default: false, Advanced: true, + }, { + Name: "delete_snapshots", + Help: `Set to specify how to deal with snapshots on blob deletion.`, + Examples: []fs.OptionExample{ + { + Value: "", + Help: "By default, the delete operation fails if a blob has snapshots", + }, { + Value: string(blob.DeleteSnapshotsOptionTypeInclude), + Help: "Specify 'include' to remove the root blob and all its snapshots", + }, { + Value: string(blob.DeleteSnapshotsOptionTypeOnly), + Help: "Specify 'only' to remove only the snapshots but keep the root blob.", + }, + }, + Default: "", + Exclusive: true, + Advanced: true, }}, }) } @@ -437,6 +455,7 @@ type Options struct { DirectoryMarkers bool `config:"directory_markers"` NoCheckContainer bool `config:"no_check_container"` NoHeadObject bool `config:"no_head_object"` + DeleteSnapshots string `config:"delete_snapshots"` } // Fs represents a remote azure server @@ -2356,9 +2375,10 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op // Remove an object func (o *Object) Remove(ctx context.Context) error { blb := o.getBlobSVC() - //only := blob.DeleteSnapshotsOptionTypeOnly - opt := blob.DeleteOptions{ - //DeleteSnapshots: &only, + opt := blob.DeleteOptions{} + if o.fs.opt.DeleteSnapshots != "" { + action := blob.DeleteSnapshotsOptionType(o.fs.opt.DeleteSnapshots) + opt.DeleteSnapshots = &action } return o.fs.pacer.Call(func() (bool, error) { _, err := blb.Delete(ctx, &opt) From 184459ba8fcfd7c790738d8b04cd9329cc87c226 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 14 Jan 2024 17:46:25 +0000 Subject: [PATCH 082/130] vfs: fix stale data when using --vfs-cache-mode full Before this change the VFS cache could get into a state where when an object was updated remotely, the fingerprint of the item was correct for the new object but the data in the VFS cache was for the old object. This fixes the problem by updating the fingerprint of the item at the point we remove the stale data. The empty cache item now represents the new item even though it has no data in. This stops the fallback code for an empty fingerprint running (used when we are writing items to the cache instead of reading them) which was causing the problem. Fixes #6053 See: https://forum.rclone.org/t/cached-webdav-mount-fingerprints-get-nuked-on-ls/43974/ --- vfs/read_write_test.go | 44 +++++++++++++++++++++++++++++++++++++++ vfs/vfscache/item.go | 1 + vfs/vfscache/item_test.go | 6 ++++++ 3 files changed, 51 insertions(+) diff --git a/vfs/read_write_test.go b/vfs/read_write_test.go index 7a49c9ab517b2..bc3389151ffcb 100644 --- a/vfs/read_write_test.go +++ b/vfs/read_write_test.go @@ -714,3 +714,47 @@ func TestRWCacheRename(t *testing.T) { assert.False(t, vfs.cache.Exists("rename_me")) assert.True(t, vfs.cache.Exists("i_was_renamed")) } + +// Test the cache reading a file that is updated externally +// +// See: https://github.com/rclone/rclone/issues/6053 +func TestRWCacheUpdate(t *testing.T) { + opt := vfscommon.DefaultOpt + opt.CacheMode = vfscommon.CacheModeFull + opt.WriteBack = writeBackDelay + opt.DirCacheTime = 100 * time.Millisecond + r, vfs := newTestVFSOpt(t, &opt) + + if r.Fremote.Precision() == fs.ModTimeNotSupported { + t.Skip("skip as modtime not supported") + } + + const filename = "TestRWCacheUpdate" + + modTime := time.Now().Add(-time.Hour) + for i := 0; i < 10; i++ { + modTime = modTime.Add(time.Minute) + // Refresh test file + contents := fmt.Sprintf("TestRWCacheUpdate%03d", i) + // Increase the size for second half of test + for j := 5; j < i; j++ { + contents += "*" + } + file1 := r.WriteObject(context.Background(), filename, contents, modTime) + r.CheckRemoteItems(t, file1) + + // Wait for directory cache to expire + time.Sleep(2 * opt.DirCacheTime) + + // Check the file is OK via the VFS + data, err := vfs.ReadFile(filename) + require.NoError(t, err) + require.Equal(t, contents, string(data)) + + // Check Stat + fi, err := vfs.Stat(filename) + require.NoError(t, err) + assert.Equal(t, int64(len(contents)), fi.Size()) + fstest.AssertTimeEqualWithPrecision(t, filename, modTime, fi.ModTime(), r.Fremote.Precision()) + } +} diff --git a/vfs/vfscache/item.go b/vfs/vfscache/item.go index 06a7454a5e0e0..34962a50390fe 100644 --- a/vfs/vfscache/item.go +++ b/vfs/vfscache/item.go @@ -810,6 +810,7 @@ func (item *Item) _checkObject(o fs.Object) error { if !item.info.Dirty { fs.Debugf(item.name, "vfs cache: removing cached entry as stale (remote fingerprint %q != cached fingerprint %q)", remoteFingerprint, item.info.Fingerprint) item._remove("stale (remote is different)") + item.info.Fingerprint = remoteFingerprint } else { fs.Debugf(item.name, "vfs cache: remote object has changed but local object modified - keeping it (remote fingerprint %q != cached fingerprint %q)", remoteFingerprint, item.info.Fingerprint) } diff --git a/vfs/vfscache/item_test.go b/vfs/vfscache/item_test.go index 27a40cbbd812f..fc3eeddadfebc 100644 --- a/vfs/vfscache/item_test.go +++ b/vfs/vfscache/item_test.go @@ -409,8 +409,14 @@ func TestItemReloadCacheStale(t *testing.T) { assert.NotEqual(t, contents, contents2) // Re-open with updated object + oldFingerprint := item.info.Fingerprint + assert.NotEqual(t, "", oldFingerprint) require.NoError(t, item.Open(obj)) + // Make sure fingerprint was updated + assert.NotEqual(t, oldFingerprint, item.info.Fingerprint) + assert.NotEqual(t, "", item.info.Fingerprint) + // Check size is now 110 size, err = item.GetSize() require.NoError(t, err) From a5972fe0d1cd737e1b500db03932b0e2ce389272 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 11 Jan 2024 12:34:40 +0000 Subject: [PATCH 083/130] docs: update website footer --- docs/layouts/_default/baseof.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/layouts/_default/baseof.html b/docs/layouts/_default/baseof.html index bf06ab1298c64..8884200cb43db 100644 --- a/docs/layouts/_default/baseof.html +++ b/docs/layouts/_default/baseof.html @@ -47,12 +47,14 @@

        - © Nick Craig-Wood 2014-{{ now.Format "2006" }}
        - {{ if .File}}{{ with $path := strings.TrimPrefix "/" .File.Path }}Source file {{ $path }}{{ end }} + © Nick Craig-Wood 2014-{{ now.Format "2006" }}
        + {{ if .File}}{{ with $path := strings.TrimPrefix "/" .File.Path }}Source file {{ $path }}{{ end }} last updated {{ .Lastmod.Format "2006-01-02" }}
        {{end}} Uploaded with rclone. - Built with Hugo. - Logo by @andy23. + Built with Hugo. + Logo by @andy23. + Served by Caddy. + Hosted at Hetzner Cloud.

        From f8c5695aed68f3163f9c91c61dcec290e4596f19 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 11 Jan 2024 10:57:54 +0000 Subject: [PATCH 084/130] docs: add warp.dev as a sponsor --- docs/layouts/chrome/menu.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/layouts/chrome/menu.html b/docs/layouts/chrome/menu.html index 9b293012ba4c1..ed2b3dce442f3 100644 --- a/docs/layouts/chrome/menu.html +++ b/docs/layouts/chrome/menu.html @@ -24,8 +24,8 @@
        Silver Sponsor
        -
        -
        +
        +
        {{end}} From cacfc100defdf51581c010ed682c5b1d9a79b1d3 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 11 Jan 2024 11:11:45 +0000 Subject: [PATCH 085/130] docs: add warp.dev sponsorship to github home page --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 87835b0f60684..e9e2c44b42ab4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ [rclone logo](https://rclone.org/#gh-light-mode-only) [rclone logo](https://rclone.org/#gh-dark-mode-only) +[](https://www.warp.dev/?utm_source=github&utm_medium=referral&utm_campaign=rclone_20231103#gh-light-mode-only) +[](https://www.warp.dev/?utm_source=github&utm_medium=referral&utm_campaign=rclone_20231103#gh-dark-mode-only) [Website](https://rclone.org) | [Documentation](https://rclone.org/docs/) | From 1b1e43074f0349cf5d77011f4a62af3433aed5fc Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 13 Jan 2024 16:32:42 +0000 Subject: [PATCH 086/130] build: update direct dependencies and fix serve nfs This updates the direct dependencies. The latest github.com/willscott/go-nfs has changed the interface slightly so this implements a dummy InvalidateHandle method in order to satisfy it. --- cmd/serve/nfs/handler.go | 5 ++ go.mod | 83 +++++++++--------- go.sum | 176 +++++++++++++++++++++------------------ 3 files changed, 146 insertions(+), 118 deletions(-) diff --git a/cmd/serve/nfs/handler.go b/cmd/serve/nfs/handler.go index 4a34d6138f76b..7d9a8e4d192ac 100644 --- a/cmd/serve/nfs/handler.go +++ b/cmd/serve/nfs/handler.go @@ -63,6 +63,11 @@ func (h *BackendAuthHandler) HandleLimit() int { return -1 } +// InvalidateHandle is called on removes or renames +func (h *BackendAuthHandler) InvalidateHandle(billy.Filesystem, []byte) error { + return nil +} + func newHandler(vfs *vfs.VFS) nfs.Handler { handler := NewBackendAuthHandler(vfs) cacheHelper := nfshelper.NewCachingHandler(handler, 1024) diff --git a/go.mod b/go.mod index 7af4acf620a68..54fa28fbd7d99 100644 --- a/go.mod +++ b/go.mod @@ -4,21 +4,21 @@ go 1.19 require ( bazil.org/fuse v0.0.0-20230120002735-62a210ff1fd5 - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0 - github.com/Azure/azure-sdk-for-go/sdk/storage/azfile v1.1.0 + github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1 + github.com/Azure/azure-sdk-for-go/sdk/storage/azfile v1.1.1 github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 github.com/Max-Sum/base32768 v0.0.0-20230304063302-18e6ce5945fd github.com/Mikubill/gofakes3 v0.0.3-0.20230622102024-284c0f988700 github.com/Unknwon/goconfig v1.0.0 - github.com/a8m/tree v0.0.0-20230208161321-36ae24ddad15 + github.com/a8m/tree v0.0.0-20240104212747-2c8764a5f17e github.com/aalpar/deheap v0.0.0-20210914013432-0cc84d79dec3 github.com/abbot/go-http-auth v0.4.0 github.com/anacrolix/dms v1.6.0 - github.com/anacrolix/log v0.14.2 + github.com/anacrolix/log v0.14.5 github.com/atotto/clipboard v0.1.4 - github.com/aws/aws-sdk-go v1.46.6 + github.com/aws/aws-sdk-go v1.49.20 github.com/buengese/sgzip v0.1.1 github.com/cloudsoda/go-smb2 v0.0.0-20231124195312-f3ec8ae2c891 github.com/colinmarc/hdfs/v2 v2.4.0 @@ -27,10 +27,10 @@ require ( github.com/dop251/scsu v0.0.0-20220106150536-84ac88021d00 github.com/dropbox/dropbox-sdk-go-unofficial/v6 v6.0.5 github.com/gabriel-vasile/mimetype v1.4.3 - github.com/gdamore/tcell/v2 v2.6.0 - github.com/go-chi/chi/v5 v5.0.10 + github.com/gdamore/tcell/v2 v2.7.0 + github.com/go-chi/chi/v5 v5.0.11 github.com/go-git/go-billy/v5 v5.5.0 - github.com/google/uuid v1.4.0 + github.com/google/uuid v1.5.0 github.com/hanwen/go-fuse/v2 v2.4.0 github.com/henrybear327/Proton-API-Bridge v1.0.0 github.com/henrybear327/go-proton-api v1.0.0 @@ -38,54 +38,54 @@ require ( github.com/jlaffaye/ftp v0.2.0 github.com/josephspurrier/goversioninfo v1.4.0 github.com/jzelinskie/whirlpool v0.0.0-20201016144138-0675e54bb004 - github.com/klauspost/compress v1.17.2 + github.com/klauspost/compress v1.17.4 github.com/koofr/go-httpclient v0.0.0-20230225102643-5d51a2e9dea6 github.com/koofr/go-koofrclient v0.0.0-20221207135200-cbd7fc9ad6a6 github.com/mattn/go-colorable v0.1.13 github.com/mattn/go-runewidth v0.0.15 - github.com/minio/minio-go/v7 v7.0.63 + github.com/minio/minio-go/v7 v7.0.66 github.com/mitchellh/go-homedir v1.1.0 - github.com/moby/sys/mountinfo v0.6.2 + github.com/moby/sys/mountinfo v0.7.1 github.com/ncw/swift/v2 v2.0.2 - github.com/oracle/oci-go-sdk/v65 v65.51.0 + github.com/oracle/oci-go-sdk/v65 v65.55.1 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/pkg/sftp v1.13.6 github.com/pmezard/go-difflib v1.0.0 - github.com/prometheus/client_golang v1.17.0 + github.com/prometheus/client_golang v1.18.0 github.com/putdotio/go-putio/putio v0.0.0-20200123120452-16d982cac2b8 github.com/rfjakob/eme v1.1.2 github.com/rivo/uniseg v0.4.4 - github.com/shirou/gopsutil/v3 v3.23.9 + github.com/shirou/gopsutil/v3 v3.23.12 github.com/sirupsen/logrus v1.9.3 github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 - github.com/spf13/cobra v1.7.0 + github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.4 github.com/t3rm1n4l/go-mega v0.0.0-20230228171823-a01a2cda13ca - github.com/willscott/go-nfs v0.0.0-20231028170411-e6abde417d5d + github.com/willscott/go-nfs v0.0.2 github.com/winfsp/cgofuse v1.5.1-0.20221118130120-84c0898ad2e0 github.com/xanzy/ssh-agent v0.3.3 github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a github.com/yunify/qingstor-sdk-go/v3 v3.2.0 go.etcd.io/bbolt v1.3.8 goftp.io/server/v2 v2.0.1 - golang.org/x/crypto v0.17.0 - golang.org/x/net v0.17.0 - golang.org/x/oauth2 v0.13.0 - golang.org/x/sync v0.4.0 - golang.org/x/sys v0.15.0 + golang.org/x/crypto v0.18.0 + golang.org/x/net v0.20.0 + golang.org/x/oauth2 v0.16.0 + golang.org/x/sync v0.6.0 + golang.org/x/sys v0.16.0 golang.org/x/text v0.14.0 - golang.org/x/time v0.3.0 - google.golang.org/api v0.148.0 + golang.org/x/time v0.5.0 + google.golang.org/api v0.156.0 gopkg.in/validator.v2 v2.0.1 gopkg.in/yaml.v2 v2.4.0 - storj.io/uplink v1.12.1 + storj.io/uplink v1.12.2 ) require ( - cloud.google.com/go/compute v1.23.2 // indirect + cloud.google.com/go/compute v1.23.3 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect - github.com/Azure/azure-sdk-for-go/sdk/internal v1.4.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.2.0 // indirect github.com/ProtonMail/bcrypt v0.0.0-20211005172633-e235017c1baf // indirect github.com/ProtonMail/gluon v0.17.1-0.20230724134000-308be39be96e // indirect @@ -108,9 +108,12 @@ require ( github.com/emersion/go-message v0.17.0 // indirect github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594 // indirect github.com/emersion/go-vcard v0.0.0-20230815062825-8fda7d206ec9 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect github.com/flynn/noise v1.0.0 // indirect github.com/gdamore/encoding v1.0.0 // indirect github.com/geoffgarside/ber v1.1.0 // indirect + github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-resty/resty/v2 v2.11.0 // indirect github.com/gofrs/flock v0.8.1 // indirect @@ -134,7 +137,7 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/jtolio/eventkit v0.0.0-20231019094657-5d77ebb407d9 // indirect github.com/jtolio/noiseconn v0.0.0-20230621152802-afeab29449e0 // indirect - github.com/klauspost/cpuid/v2 v2.2.5 // indirect + github.com/klauspost/cpuid/v2 v2.2.6 // indirect github.com/kr/fs v0.1.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect @@ -163,23 +166,27 @@ require ( github.com/spacemonkeygo/monkit/v3 v3.0.22 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect - github.com/vivint/infectious v0.0.0-20200605153912-25a574ae18a3 // indirect - github.com/willscott/go-nfs-client v0.0.0-20200605172546-271fa9065b33 // indirect + github.com/willscott/go-nfs-client v0.0.0-20240104095149-b44639837b00 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect github.com/zeebo/blake3 v0.2.3 // indirect github.com/zeebo/errs v1.3.0 // indirect go.opencensus.io v0.24.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect + go.opentelemetry.io/otel v1.21.0 // indirect + go.opentelemetry.io/otel/metric v1.21.0 // indirect + go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect - golang.org/x/mod v0.13.0 // indirect - golang.org/x/tools v0.14.0 // indirect + golang.org/x/mod v0.14.0 // indirect + golang.org/x/tools v0.17.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect - google.golang.org/grpc v1.59.0 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect + google.golang.org/grpc v1.60.1 // indirect + google.golang.org/protobuf v1.32.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - storj.io/common v0.0.0-20231027080355-b4cb1b0d728e // indirect + storj.io/common v0.0.0-20231101115145-09481ec98b57 // indirect storj.io/drpc v0.0.33 // indirect + storj.io/infectious v0.0.1 // indirect storj.io/picobuf v0.0.2-0.20230906122608-c4ba17033c6c // indirect ) @@ -189,6 +196,6 @@ require ( github.com/golang-jwt/jwt/v4 v4.5.0 github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/pkg/xattr v0.4.9 - golang.org/x/mobile v0.0.0-20231006135142-2b44d11868fe - golang.org/x/term v0.15.0 + golang.org/x/mobile v0.0.0-20240112133503-c713f31d574b + golang.org/x/term v0.16.0 ) diff --git a/go.sum b/go.sum index 9d5941bdd506b..65dd65764a4d2 100644 --- a/go.sum +++ b/go.sum @@ -21,8 +21,8 @@ cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvf cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/compute v1.23.2 h1:nWEMDhgbBkBJjfpVySqU4jgWdc22PLR0o4vEexZHers= -cloud.google.com/go/compute v1.23.2/go.mod h1:JJ0atRC0J/oWYiiVBmsSsrRnh92DhZPG4hFDcR04Rns= +cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= +cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= @@ -37,17 +37,17 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0 h1:9kDVnTz3vbfweTqAUmk/a/pH5pWFCHtvRpHYC0G/dcA= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0/go.mod h1:3Ug6Qzto9anB6mGlEdgYMDF5zHQ+wwhEaYR4s17PHMw= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 h1:lGlwhPtrX6EVml1hO0ivjkUxsSyl4dsiw9qcA1k/3IQ= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1/go.mod h1:RKUqNu35KJYcVG/fqTRqmuXJZYNhYkBrnC/hX7yGbTA= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 h1:BMAjVKJM0U/CYF27gA0ZMmXGkOcvfFtD0oHVZ1TIPRI= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0/go.mod h1:1fXstnBMas5kzG+S3q8UoJcmyU6nUeunJcMDHcRYHhs= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.4.0 h1:TuEMD+E+1aTjjLICGQOW6vLe8UWES7kopac9mUXL56Y= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.4.0/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.2.0 h1:Ma67P/GGprNwsslzEH6+Kb8nybI8jpDTm4Wmzu2ReK8= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0 h1:gggzg0SUMs6SQbEw+3LoSsYf9YMjkupeAnHMX8O9mmY= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0/go.mod h1:+6KLcKIVgxoBDMqMO/Nvy7bZ9a0nbU3I1DtFQK3YvB4= -github.com/Azure/azure-sdk-for-go/sdk/storage/azfile v1.1.0 h1:1MDP9LGZzH2Nd4NzS82YZpddy8xEvwkxpcVJz8/TffQ= -github.com/Azure/azure-sdk-for-go/sdk/storage/azfile v1.1.0/go.mod h1:qTVVvsSlVe5NZKdjBOJYxB0Ge5D+laQga/zckme+hw0= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 h1:6oNBlSdi1QqM1PNW7FPA6xOGA5UNsXnkaYZz9vdPGhA= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0 h1:AifHbc4mg0x9zW52WOpKbsHaDKuRhlI7TVl47thgQ70= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1 h1:AMf7YbZOZIW5b66cXNHMWWT/zkjhz5+a+k/3x40EO7E= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1/go.mod h1:uwfk06ZBcvL/g4VHNjurPfVln9NMbsk2XIZxJ+hu81k= +github.com/Azure/azure-sdk-for-go/sdk/storage/azfile v1.1.1 h1:pOz+ZkB4uqDgS75Ft6JPeMIsGs5MHz2lkHa1odQ9Ghk= +github.com/Azure/azure-sdk-for-go/sdk/storage/azfile v1.1.1/go.mod h1:eISpIuAeU2UzR3FO0ODAwvpAnVZsfEISxszPW/chkBw= github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 h1:mFRzDkZVAjdal+s7s0MwaRv9igoPqLRdzOLzw/8Xvq8= github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.0 h1:hVeq+yCyUi+MsoO/CU95yqCIcdzra5ovzk8Q2BBpV2M= @@ -82,8 +82,8 @@ github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJs github.com/RoaringBitmap/roaring v0.4.7/go.mod h1:8khRDP4HmeXns4xIj9oGrKSz7XTQiJx2zgh7AcNke4w= github.com/Unknwon/goconfig v1.0.0 h1:9IAu/BYbSLQi8puFjUQApZTxIHqSwrj5d8vpP8vTq4A= github.com/Unknwon/goconfig v1.0.0/go.mod h1:wngxua9XCNjvHjDiTiV26DaKDT+0c63QR6H5hjVUUxw= -github.com/a8m/tree v0.0.0-20230208161321-36ae24ddad15 h1:t3qDzTv8T15tVVhJHHgY7hX5jiIz67xE2SxWQ2ehjH4= -github.com/a8m/tree v0.0.0-20230208161321-36ae24ddad15/go.mod h1:j5astEcUkZQX8lK+KKlQ3NRQ50f4EE8ZjyZpCz3mrH4= +github.com/a8m/tree v0.0.0-20240104212747-2c8764a5f17e h1:KMVieI1/Ub++GYfnhyFPoGE3g5TUiG4srE3TMGr5nM4= +github.com/a8m/tree v0.0.0-20240104212747-2c8764a5f17e/go.mod h1:j5astEcUkZQX8lK+KKlQ3NRQ50f4EE8ZjyZpCz3mrH4= github.com/aalpar/deheap v0.0.0-20210914013432-0cc84d79dec3 h1:hhdWprfSpFbN7lz3W1gM40vOgvSh1WCSMxYD6gGB4Hs= github.com/aalpar/deheap v0.0.0-20210914013432-0cc84d79dec3/go.mod h1:XaUnRxSCYgL3kkgX0QHIV0D+znljPIDImxlv2kbGv0Y= github.com/abbot/go-http-auth v0.4.0 h1:QjmvZ5gSC7jm3Zg54DqWE/T5m1t2AfDu6QlXJT0EVT0= @@ -98,8 +98,8 @@ github.com/anacrolix/ffprobe v1.0.0/go.mod h1:BIw+Bjol6CWjm/CRWrVLk2Vy+UYlkgmBZ0 github.com/anacrolix/generics v0.0.0-20230911070922-5dd7545c6b13 h1:qwOprPTDMM3BASJRf84mmZnTXRsPGGJ8xoHKQS7m3so= github.com/anacrolix/generics v0.0.0-20230911070922-5dd7545c6b13/go.mod h1:ff2rHB/joTV03aMSSn/AZNnaIpUw0h3njetGsaXcMy8= github.com/anacrolix/log v0.13.1/go.mod h1:D4+CvN8SnruK6zIFS/xPoRJmtvtnxs+CSfDQ+BFxZ68= -github.com/anacrolix/log v0.14.2 h1:i9v/Lw/CceCKthcLW+UiajkSW8M/razXCwVYlZtAKsk= -github.com/anacrolix/log v0.14.2/go.mod h1:1OmJESOtxQGNMlUO5rcv96Vpp9mfMqXXbe2RdinFLdY= +github.com/anacrolix/log v0.14.5 h1:OkMjBquVSRb742LkecSGDGaGpNoSrw4syRIm0eRdmrg= +github.com/anacrolix/log v0.14.5/go.mod h1:1OmJESOtxQGNMlUO5rcv96Vpp9mfMqXXbe2RdinFLdY= github.com/anacrolix/missinggo v1.1.0/go.mod h1:MBJu3Sk/k3ZfGYcS7z18gwfu72Ey/xopPFJJbTi5yIo= github.com/anacrolix/tagflag v0.0.0-20180109131632-2146c8d41bf0/go.mod h1:1m2U/K6ZT+JZG0+bdMK6qauP49QT4wE5pmhJXOKKCHw= github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= @@ -107,8 +107,8 @@ github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsVi github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU= github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= -github.com/aws/aws-sdk-go v1.46.6 h1:6wFnNC9hETIZLMf6SOTN7IcclrOGwp/n9SLp8Pjt6E8= -github.com/aws/aws-sdk-go v1.46.6/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.49.20 h1:VgEUq2/ZbUkLbqPyDcxrirfXB+PgiZUUF5XbsgWe2S0= +github.com/aws/aws-sdk-go v1.49.20/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bradenaw/juniper v0.13.1 h1:9P7/xeaYuEyqPuJHSHCJoisWyPvZH4FAi59BxJLh7F8= @@ -142,7 +142,6 @@ github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -172,6 +171,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/flynn/noise v1.0.0 h1:DlTHqmzmvcEiKj+4RYo/imoswx/4r6iBlCMfVtrMXpQ= github.com/flynn/noise v1.0.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= @@ -180,21 +181,26 @@ github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uq github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko= github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= -github.com/gdamore/tcell/v2 v2.6.0 h1:OKbluoP9VYmJwZwq/iLb4BxwKcwGthaa1YNBJIyCySg= -github.com/gdamore/tcell/v2 v2.6.0/go.mod h1:be9omFATkdr0D9qewWW3d+MEvl5dha+Etb5y65J2H8Y= +github.com/gdamore/tcell/v2 v2.7.0 h1:I5LiGTQuwrysAt1KS9wg1yFfOI3arI3ucFrxtd/xqaA= +github.com/gdamore/tcell/v2 v2.7.0/go.mod h1:hl/KtAANGBecfIPxk+FzKvThTqI84oplgbPEmVX60b8= github.com/geoffgarside/ber v1.1.0 h1:qTmFG4jJbwiSzSXoNJeHcOprVzZ8Ulde2Rrrifu5U9w= github.com/geoffgarside/ber v1.1.0/go.mod h1:jVPKeCbj6MvQZhwLYsGwaGI52oUorHoHKNecGT85ZCc= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20180728074245-46e3a41ad493/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= -github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk= -github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-chi/chi/v5 v5.0.11 h1:BnpYbFZ3T3S1WMpD79r7R5ThWX40TaFB7L31Y8xqSwA= +github.com/go-chi/chi/v5 v5.0.11/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= @@ -277,8 +283,8 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4 github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= +github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -350,12 +356,12 @@ github.com/jzelinskie/whirlpool v0.0.0-20201016144138-0675e54bb004 h1:G+9t9cEtnC github.com/jzelinskie/whirlpool v0.0.0-20201016144138-0675e54bb004/go.mod h1:KmHnJWQrgEvbuy0vcvj00gtMqbvNn1L+3YUZLK/B92c= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= -github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= -github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= -github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= +github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/koofr/go-httpclient v0.0.0-20230225102643-5d51a2e9dea6 h1:uF5FHZ/L5gvZTyBNhhcm55rRorL66DOs4KIeeVXZ8eI= github.com/koofr/go-httpclient v0.0.0-20230225102643-5d51a2e9dea6/go.mod h1:6HAT62hK6QH+ljNtZayJCKpbZy5hJIB12+1Ze1bFS7M= @@ -385,7 +391,6 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= @@ -393,15 +398,16 @@ github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQth github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= github.com/minio/minio-go/v6 v6.0.46/go.mod h1:qD0lajrGW49lKZLtXKtCB4X/qkMf0a5tBvN2PaZg7Gg= -github.com/minio/minio-go/v7 v7.0.63 h1:GbZ2oCvaUdgT5640WJOpyDhhDxvknAJU2/T3yurwcbQ= -github.com/minio/minio-go/v7 v7.0.63/go.mod h1:Q6X7Qjb7WMhvG65qKf4gUgA5XaiSox74kR1uAEjxRS4= +github.com/minio/minio-go/v7 v7.0.66 h1:bnTOXOHjOqv/gcMuiVbN9o2ngRItvqE774dG9nq0Dzw= +github.com/minio/minio-go/v7 v7.0.66/go.mod h1:DHAgmyQEGdW3Cif0UooKOyrT3Vxs82zNdV6tkKhRtbs= github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/moby/sys/mountinfo v0.6.2 h1:BzJjoreD5BMFNmD9Rus6gdd1pLuecOFPt8wC+Vygl78= github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI= +github.com/moby/sys/mountinfo v0.7.1 h1:/tTvQaSJRr2FshkhXiIpux6fQ2Zvc4j7tAhMTStAG2g= +github.com/moby/sys/mountinfo v0.7.1/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -415,8 +421,8 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo/v2 v2.9.5 h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/oracle/oci-go-sdk/v65 v65.51.0 h1:BL1KjY4hTTvdmOuzYbULSwMwDSo2VApuaxLxfqtrkK0= -github.com/oracle/oci-go-sdk/v65 v65.51.0/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0= +github.com/oracle/oci-go-sdk/v65 v65.55.1 h1:82j4YHtqeJJiOPyLKxP4/x3Oi8tv2o1etKMziY7yM7o= +github.com/oracle/oci-go-sdk/v65 v65.55.1/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= @@ -437,8 +443,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b h1:0LFwY6Q3gMACTjAbMZBjXAqTOzOwFaj2Ld6cjeQ7Rig= github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= +github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= @@ -448,8 +454,8 @@ github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/putdotio/go-putio/putio v0.0.0-20200123120452-16d982cac2b8 h1:Y258uzXU/potCYnQd1r6wlAnoMB68BiCkCcCnKx1SH8= github.com/putdotio/go-putio/putio v0.0.0-20200123120452-16d982cac2b8/go.mod h1:bSJjRokAHHOhA+XFxplld8w2R/dXLH7Z3BZ532vhFwU= -github.com/quic-go/qtls-go1-20 v0.3.4 h1:MfFAPULvst4yoMgY9QmtpYmfij/em7O8UUi+bNVm7Cg= -github.com/quic-go/quic-go v0.39.3 h1:o3YB6t2SR+HU/pgwF29kJ6g4jJIJEwEZ8CKia1h1TKg= +github.com/quic-go/qtls-go1-20 v0.4.1 h1:D33340mCNDAIKBqXuAvexTNMUByrYmFYVfKfDN5nfFs= +github.com/quic-go/quic-go v0.40.0 h1:GYd1iznlKm7dpHD7pOVpUvItgMPo/jrMgDWZhMCecqw= github.com/rasky/go-xdr v0.0.0-20170124162913-1a41d1a06c93 h1:UVArwN/wkKjMVhh2EQGC0tEc1+FqiLlvYXY5mQ2f8Wg= github.com/rasky/go-xdr v0.0.0-20170124162913-1a41d1a06c93/go.mod h1:Nfe4efndBz4TibWycNE+lqyJZiMX4ycx+QKV8Ta0f/o= github.com/relvacode/iso8601 v1.3.0 h1:HguUjsGpIMh/zsTczGN3DVJFxTU/GX+MMmzcKoMO7ko= @@ -472,8 +478,8 @@ github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46 h1:GHRpF1pTW19a github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46/go.mod h1:uAQ5PCi+MFsC7HjREoAz1BU+Mq60+05gifQSsHSDG/8= github.com/shabbyrobe/gocovmerge v0.0.0-20190829150210-3e036491d500 h1:WnNuhiq+FOY3jNj6JXFT+eLN3CQ/oPIsDPRanvwsmbI= github.com/shabbyrobe/gocovmerge v0.0.0-20190829150210-3e036491d500/go.mod h1:+njLrG5wSeoG4Ds61rFgEzKvenR2UHbjMoDHsczxly0= -github.com/shirou/gopsutil/v3 v3.23.9 h1:ZI5bWVeu2ep4/DIxB4U9okeYJ7zp/QLTO4auRb/ty/E= -github.com/shirou/gopsutil/v3 v3.23.9/go.mod h1:x/NWSb71eMcjFIO0vhyGW5nZ7oSIgVjrCnADckb85GA= +github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4= +github.com/shirou/gopsutil/v3 v3.23.12/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= @@ -493,8 +499,8 @@ github.com/sony/gobreaker v0.5.0 h1:dRCvqm0P490vZPmy7ppEk2qCnCieBooFJ+YoXGYB+yg= github.com/sony/gobreaker v0.5.0/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/spacemonkeygo/monkit/v3 v3.0.22 h1:4/g8IVItBDKLdVnqrdHZrCVPpIrwDBzl1jrV0IHQHDU= github.com/spacemonkeygo/monkit/v3 v3.0.22/go.mod h1:XkZYGzknZwkD0AKUnZaSXhRiVTLCkq7CWVa3IsE72gA= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -524,13 +530,11 @@ github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9f github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c h1:u6SKchux2yDvFQnDHS3lPnIRmfVJ5Sxy3ao2SIdysLQ= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= -github.com/vivint/infectious v0.0.0-20200605153912-25a574ae18a3 h1:zMsHhfK9+Wdl1F7sIKLyx3wrOFofpb3rWFbA4HgcK5k= -github.com/vivint/infectious v0.0.0-20200605153912-25a574ae18a3/go.mod h1:R0Gbuw7ElaGSLOZUSwBm/GgVwMd30jWxBDdAyMOeTuc= github.com/willf/bitset v1.1.9/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= -github.com/willscott/go-nfs v0.0.0-20231028170411-e6abde417d5d h1:Mi3VHVbB25piluNw9KN1ZdsD1q65yQGr9GWPy9M6Tuk= -github.com/willscott/go-nfs v0.0.0-20231028170411-e6abde417d5d/go.mod h1:wWJ0QPsRtNrdtdYqKbFe8+u3wUsITJoqYw2TgnhI8GI= -github.com/willscott/go-nfs-client v0.0.0-20200605172546-271fa9065b33 h1:Wd8wdpRzPXskyHvZLyw7Wc1fp5oCE2mhBCj7bAiibUs= -github.com/willscott/go-nfs-client v0.0.0-20200605172546-271fa9065b33/go.mod h1:cOUKSNty+RabZqKhm5yTJT5Vq/Fe83ZRWAJ5Kj8nRes= +github.com/willscott/go-nfs v0.0.2 h1:BaBp1CpGDMooCT6bCgX6h6ZwgPcTMST4yToYZ9byee0= +github.com/willscott/go-nfs v0.0.2/go.mod h1:SvullWeHxr/924WQNbUaZqtluBt2vuZ61g6yAV+xj7w= +github.com/willscott/go-nfs-client v0.0.0-20240104095149-b44639837b00 h1:U0DnHRZFzoIV1oFEZczg5XyPut9yxk9jjtax/9Bxr/o= +github.com/willscott/go-nfs-client v0.0.0-20240104095149-b44639837b00/go.mod h1:Tq++Lr/FgiS3X48q5FETemXiSLGuYMQT2sPjYNPJSwA= github.com/winfsp/cgofuse v1.5.1-0.20221118130120-84c0898ad2e0 h1:j3un8DqYvvAOqKI5OPz+/RRVhDFipbPKI4t2Uk5RBJw= github.com/winfsp/cgofuse v1.5.1-0.20221118130120-84c0898ad2e0/go.mod h1:uxjoF2jEYT3+x+vC2KJddEGdk/LU8pRowXmyVMHSV5I= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= @@ -554,7 +558,6 @@ github.com/zeebo/errs v1.3.0 h1:hmiaKqgYZzcVgRL1Vkc1Mn2914BbzB0IBxs+ebeutGs= github.com/zeebo/errs v1.3.0/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4= github.com/zeebo/pcg v1.0.1 h1:lyqfGeWiv4ahac6ttHs+I5hwtH/+1mrhlCtVNQM2kHo= github.com/zeebo/pcg v1.0.1/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4= -github.com/zema1/go-nfs-client v0.0.0-20200604081958-0cf942f0e0fe/go.mod h1:im3CVJ32XM3+E+2RhY0sa5IVJVQehUrX0oE1wX4xOwU= go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -564,6 +567,14 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo= +go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= +go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= +go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= +go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= +go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= +go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo= goftp.io/server/v2 v2.0.1 h1:H+9UbCX2N206ePDSVNCjBftOKOgil6kQ5RAQNx5hJwE= @@ -585,8 +596,8 @@ golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2Uz golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -613,8 +624,8 @@ golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mobile v0.0.0-20231006135142-2b44d11868fe h1:lrXv4yHeD9FA8PSJATWowP1QvexpyAPWmPia+Kbzql8= -golang.org/x/mobile v0.0.0-20231006135142-2b44d11868fe/go.mod h1:BrnXpEObnFxpaT75Jo9hsCazwOWcp7nVIa8NNuH5cuA= +golang.org/x/mobile v0.0.0-20240112133503-c713f31d574b h1:kfWLZgb8iUBHdE9WydD5V5dHIS/F6HjlBZNyJfn2bs4= +golang.org/x/mobile v0.0.0-20240112133503-c713f31d574b/go.mod h1:4efzQnuA1nICq6h4kmZRMGzbPiP06lZvgADUu1VpJCE= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= @@ -623,8 +634,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= -golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -666,16 +677,17 @@ golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= -golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= +golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= +golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -689,8 +701,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= -golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -742,10 +754,10 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -755,8 +767,9 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= -golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= +golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -776,8 +789,9 @@ golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -824,8 +838,8 @@ golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= -golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= +golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -846,8 +860,8 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.148.0 h1:HBq4TZlN4/1pNcu0geJZ/Q50vIwIXT532UIMYoo0vOs= -google.golang.org/api v0.148.0/go.mod h1:8/TBgwaKjfqTdacOJrOv2+2Q6fBDU1uHKK06oGSkxzU= +google.golang.org/api v0.156.0 h1:yloYcGbBtVYjLKQe4enCunxvwn3s2w/XPrrhVf6MsvQ= +google.golang.org/api v0.156.0/go.mod h1:bUSmn4KFO0Q+69zo9CNIDp4Psi6BqM0np0CbzKRSiSY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -885,10 +899,10 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a h1:fwgW9j3vHirt4ObdHoYNwuO24BEZjSzbh+zPaNWoiY8= -google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 h1:W18sezcAYs+3tDZX4F80yctqa12jcP1PUS2gQu1zTPU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b h1:ZlWIi1wSK56/8hn4QcBp/j9M7Gt3U/3hZw3mC7vDICo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc= +google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 h1:YJ5pD9rF8o9Qtta0Cmy9rdBwkSjrTCT6XTiUQVOtIos= +google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 h1:s1w3X6gQxwrLEpxnLd/qXTVLgQE2yXwaOaoa6IlY/+o= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 h1:6G8oQ016D88m1xAKljMlBOOGWDZkes4kMhgGFlf8WcQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917/go.mod h1:xtjpI3tXFPP051KaWnhvxkiubL/6dJ18vLVf7q2pTOU= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -902,8 +916,8 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= -google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -916,8 +930,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -947,11 +961,13 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -storj.io/common v0.0.0-20231027080355-b4cb1b0d728e h1:wuqU8YLarJbnbkh4ficH+ocvu334p6CcyN3BU+piwiU= -storj.io/common v0.0.0-20231027080355-b4cb1b0d728e/go.mod h1:qzung7BKWOk/EHHKNkXUBevcVPCocfp90tMU3jUsEa0= +storj.io/common v0.0.0-20231101115145-09481ec98b57 h1:/u6GmKmMzGdoc71B2Tg5ukJ1Lli/oyO6MQzJAyuUO+c= +storj.io/common v0.0.0-20231101115145-09481ec98b57/go.mod h1:qjHfzW5RlGg5z04CwIEjJd1eQ3HCGhUNtxZ6K/W7yqM= storj.io/drpc v0.0.33 h1:yCGZ26r66ZdMP0IcTYsj7WDAUIIjzXk6DJhbhvt9FHI= storj.io/drpc v0.0.33/go.mod h1:vR804UNzhBa49NOJ6HeLjd2H3MakC1j5Gv8bsOQT6N4= +storj.io/infectious v0.0.1 h1:/EdG6zvf589iTaTBdv+7+Q34/gR/evAGyYT3I2XYRxw= +storj.io/infectious v0.0.1/go.mod h1:QEjKKww28Sjl1x8iDsjBpOM4r1Yp8RsowNcItsZJ1Vs= storj.io/picobuf v0.0.2-0.20230906122608-c4ba17033c6c h1:or/DtG5uaZpzimL61ahlgAA+MTYn/U3txz4fe+XBFUg= storj.io/picobuf v0.0.2-0.20230906122608-c4ba17033c6c/go.mod h1:JCuc3C0gzCJHQ4J6SOx/Yjg+QTpX0D+Fvs5H46FETCk= -storj.io/uplink v1.12.1 h1:bDc2dI6Q7EXcvPJLZuH9jIOTIf2oKxvW3xKEA+Y5EI0= -storj.io/uplink v1.12.1/go.mod h1:1+czctHG25pMzcUp4Mds6QnoJ7LvbgYA5d1qlpFFexg= +storj.io/uplink v1.12.2 h1:lqgOsMhUI2hP5N1twU9zmvhlu6rgyCsKg/MrnzSZGjk= +storj.io/uplink v1.12.2/go.mod h1:FijbSlvLWgzDg/gYyE+rVxTNOlQhCGTn7qPsbFHgeQU= From 43cc2435c3474e2f9b320ed4148e215bccf8ac53 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 13 Jan 2024 16:38:26 +0000 Subject: [PATCH 087/130] build: update indirect dependencies where possible --- go.mod | 30 +++++++++++++-------------- go.sum | 64 +++++++++++++++++++++++++++++----------------------------- 2 files changed, 47 insertions(+), 47 deletions(-) diff --git a/go.mod b/go.mod index 54fa28fbd7d99..f2c9e7fadde2f 100644 --- a/go.mod +++ b/go.mod @@ -86,7 +86,7 @@ require ( cloud.google.com/go/compute v1.23.3 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.0 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 // indirect github.com/ProtonMail/bcrypt v0.0.0-20211005172633-e235017c1baf // indirect github.com/ProtonMail/gluon v0.17.1-0.20230724134000-308be39be96e // indirect github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f // indirect @@ -97,7 +97,7 @@ require ( github.com/anacrolix/generics v0.0.0-20230911070922-5dd7545c6b13 // indirect github.com/andybalholm/cascadia v1.3.2 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/bradenaw/juniper v0.13.1 // indirect + github.com/bradenaw/juniper v0.15.2 // indirect github.com/calebcase/tmpfile v1.0.3 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cloudflare/circl v1.3.7 // indirect @@ -105,20 +105,20 @@ require ( github.com/cronokirby/saferith v0.33.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dustin/go-humanize v1.0.1 // indirect - github.com/emersion/go-message v0.17.0 // indirect + github.com/emersion/go-message v0.18.0 // indirect github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594 // indirect github.com/emersion/go-vcard v0.0.0-20230815062825-8fda7d206ec9 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/flynn/noise v1.0.0 // indirect + github.com/flynn/noise v1.0.1 // indirect github.com/gdamore/encoding v1.0.0 // indirect github.com/geoffgarside/ber v1.1.0 // indirect - github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-resty/resty/v2 v2.11.0 // indirect github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt/v5 v5.0.0 // indirect + github.com/golang-jwt/jwt/v5 v5.2.0 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/s2a-go v0.1.7 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect @@ -136,7 +136,7 @@ require ( github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/jtolio/eventkit v0.0.0-20231019094657-5d77ebb407d9 // indirect - github.com/jtolio/noiseconn v0.0.0-20230621152802-afeab29449e0 // indirect + github.com/jtolio/noiseconn v0.0.0-20231127013910-f6d9ecbf1de7 // indirect github.com/klauspost/cpuid/v2 v2.2.6 // indirect github.com/kr/fs v0.1.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect @@ -149,7 +149,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pengsrc/go-shared v0.2.1-0.20190131101655-1999055a4a14 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect + github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pkg/errors v0.9.1 // indirect github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect github.com/prometheus/client_model v0.5.0 // indirect @@ -160,12 +160,12 @@ require ( github.com/rs/xid v1.5.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46 // indirect - github.com/shabbyrobe/gocovmerge v0.0.0-20190829150210-3e036491d500 // indirect + github.com/shabbyrobe/gocovmerge v0.0.0-20230507112040-c3350d9342df // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/sony/gobreaker v0.5.0 // indirect github.com/spacemonkeygo/monkit/v3 v3.0.22 // indirect - github.com/tklauser/go-sysconf v0.3.12 // indirect - github.com/tklauser/numcpus v0.6.1 // indirect + github.com/tklauser/go-sysconf v0.3.13 // indirect + github.com/tklauser/numcpus v0.7.0 // indirect github.com/willscott/go-nfs-client v0.0.0-20240104095149-b44639837b00 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect github.com/zeebo/blake3 v0.2.3 // indirect @@ -175,18 +175,18 @@ require ( go.opentelemetry.io/otel v1.21.0 // indirect go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/trace v1.21.0 // indirect - golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect + golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/tools v0.17.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 // indirect google.golang.org/grpc v1.60.1 // indirect google.golang.org/protobuf v1.32.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - storj.io/common v0.0.0-20231101115145-09481ec98b57 // indirect + storj.io/common v0.0.0-20240111121419-ecae1362576c // indirect storj.io/drpc v0.0.33 // indirect - storj.io/infectious v0.0.1 // indirect + storj.io/infectious v0.0.2 // indirect storj.io/picobuf v0.0.2-0.20230906122608-c4ba17033c6c // indirect ) diff --git a/go.sum b/go.sum index 65dd65764a4d2..2e0dbbe738576 100644 --- a/go.sum +++ b/go.sum @@ -50,8 +50,8 @@ github.com/Azure/azure-sdk-for-go/sdk/storage/azfile v1.1.1 h1:pOz+ZkB4uqDgS75Ft github.com/Azure/azure-sdk-for-go/sdk/storage/azfile v1.1.1/go.mod h1:eISpIuAeU2UzR3FO0ODAwvpAnVZsfEISxszPW/chkBw= github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 h1:mFRzDkZVAjdal+s7s0MwaRv9igoPqLRdzOLzw/8Xvq8= github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.0 h1:hVeq+yCyUi+MsoO/CU95yqCIcdzra5ovzk8Q2BBpV2M= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.0/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 h1:DzHpqpoJVaCgOUdVHxE8QB52S6NiVdDQvGlny1qvPqA= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= @@ -111,8 +111,8 @@ github.com/aws/aws-sdk-go v1.49.20 h1:VgEUq2/ZbUkLbqPyDcxrirfXB+PgiZUUF5XbsgWe2S github.com/aws/aws-sdk-go v1.49.20/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bradenaw/juniper v0.13.1 h1:9P7/xeaYuEyqPuJHSHCJoisWyPvZH4FAi59BxJLh7F8= -github.com/bradenaw/juniper v0.13.1/go.mod h1:Z2B7aJlQ7xbfWsnMLROj5t/5FQ94/MkIdKC30J4WvzI= +github.com/bradenaw/juniper v0.15.2 h1:0JdjBGEF2jP1pOxmlNIrPhAoQN7Ng5IMAY5D0PHMW4U= +github.com/bradenaw/juniper v0.15.2/go.mod h1:UX4FX57kVSaDp4TPqvSjkAAewmRFAfXf27BOs5z9dq8= github.com/bradfitz/iter v0.0.0-20140124041915-454541ec3da2/go.mod h1:PyRFw1Lt2wKX4ZVSQ2mk+PeDa1rxyObEDlApuIsUKuo= github.com/buengese/sgzip v0.1.1 h1:ry+T8l1mlmiWEsDrH/YHZnCVWD2S3im1KLsyO+8ZmTU= github.com/buengese/sgzip v0.1.1/go.mod h1:i5ZiXGF3fhV7gL1xaRRL1nDnmpNj0X061FQzOS8VMas= @@ -161,8 +161,8 @@ github.com/dustin/go-humanize v0.0.0-20180421182945-02af3965c54e/go.mod h1:Htrtb github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/emersion/go-message v0.17.0 h1:NIdSKHiVUx4qKqdd0HyJFD41cW8iFguM2XJnRZWQH04= -github.com/emersion/go-message v0.17.0/go.mod h1:/9Bazlb1jwUNB0npYYBsdJ2EMOiiyN3m5UVHbY7GoNw= +github.com/emersion/go-message v0.18.0 h1:7LxAXHRpSeoO/Wom3ZApVZYG7c3d17yCScYce8WiXA8= +github.com/emersion/go-message v0.18.0/go.mod h1:Zi69ACvzaoV/MBnrxfVBPV3xWEuCmC2nEN39oJF4B8A= github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594 h1:IbFBtwoTQyw0fIM5xv1HF+Y+3ZijDR839WMulgxCcUY= github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594/go.mod h1:aqO8z8wPrjkscevZJFVE1wXJrLpC5LtJG7fqLOsPb2U= github.com/emersion/go-vcard v0.0.0-20230815062825-8fda7d206ec9 h1:ATgqloALX6cHCranzkLb8/zjivwQ9DWWDCQRnxTPfaA= @@ -173,8 +173,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/flynn/noise v1.0.0 h1:DlTHqmzmvcEiKj+4RYo/imoswx/4r6iBlCMfVtrMXpQ= -github.com/flynn/noise v1.0.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= +github.com/flynn/noise v1.0.1 h1:vPp/jdQLXC6ppsXSj/pM3W1BIJ5FEHE2TulSJBpb43Y= +github.com/flynn/noise v1.0.1/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= @@ -197,8 +197,8 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= @@ -218,8 +218,8 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= -github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= +github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -350,8 +350,8 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7 github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/jtolio/eventkit v0.0.0-20231019094657-5d77ebb407d9 h1:5aw4qPuPiOjYJGATzHQllDfom77cgZrzE1ttOj7GRWQ= github.com/jtolio/eventkit v0.0.0-20231019094657-5d77ebb407d9/go.mod h1:PXFUrknJu7TkBNyL8t7XWDPtDFFLFrNQQAdsXv9YfJE= -github.com/jtolio/noiseconn v0.0.0-20230621152802-afeab29449e0 h1:sR951BhhagmltT3d9bxQPHPwf1GKnzhzfarNxqhQMCE= -github.com/jtolio/noiseconn v0.0.0-20230621152802-afeab29449e0/go.mod h1:MEkhEPFwP3yudWO0lj6vfYpLIB+3eIcuIW+e0AZzUQk= +github.com/jtolio/noiseconn v0.0.0-20231127013910-f6d9ecbf1de7 h1:JcltaO1HXM5S2KYOYcKgAV7slU0xPy1OcvrVgn98sRQ= +github.com/jtolio/noiseconn v0.0.0-20231127013910-f6d9ecbf1de7/go.mod h1:MEkhEPFwP3yudWO0lj6vfYpLIB+3eIcuIW+e0AZzUQk= github.com/jzelinskie/whirlpool v0.0.0-20201016144138-0675e54bb004 h1:G+9t9cEtnC9jFiTxyptEKuNIAbiN5ZCQzX2a74lj3xg= github.com/jzelinskie/whirlpool v0.0.0-20201016144138-0675e54bb004/go.mod h1:KmHnJWQrgEvbuy0vcvj00gtMqbvNn1L+3YUZLK/B92c= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -429,8 +429,8 @@ github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZ github.com/pengsrc/go-shared v0.2.1-0.20190131101655-1999055a4a14 h1:XeOYlK9W1uCmhjJSsY78Mcuh7MVkNjTzmHx1yBzizSU= github.com/pengsrc/go-shared v0.2.1-0.20190131101655-1999055a4a14/go.mod h1:jVblp62SafmidSkvWrXyxAme3gaTfEtWwRPGz5cpvHg= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -455,7 +455,7 @@ github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3c github.com/putdotio/go-putio/putio v0.0.0-20200123120452-16d982cac2b8 h1:Y258uzXU/potCYnQd1r6wlAnoMB68BiCkCcCnKx1SH8= github.com/putdotio/go-putio/putio v0.0.0-20200123120452-16d982cac2b8/go.mod h1:bSJjRokAHHOhA+XFxplld8w2R/dXLH7Z3BZ532vhFwU= github.com/quic-go/qtls-go1-20 v0.4.1 h1:D33340mCNDAIKBqXuAvexTNMUByrYmFYVfKfDN5nfFs= -github.com/quic-go/quic-go v0.40.0 h1:GYd1iznlKm7dpHD7pOVpUvItgMPo/jrMgDWZhMCecqw= +github.com/quic-go/quic-go v0.40.1 h1:X3AGzUNFs0jVuO3esAGnTfvdgvL4fq655WaOi1snv1Q= github.com/rasky/go-xdr v0.0.0-20170124162913-1a41d1a06c93 h1:UVArwN/wkKjMVhh2EQGC0tEc1+FqiLlvYXY5mQ2f8Wg= github.com/rasky/go-xdr v0.0.0-20170124162913-1a41d1a06c93/go.mod h1:Nfe4efndBz4TibWycNE+lqyJZiMX4ycx+QKV8Ta0f/o= github.com/relvacode/iso8601 v1.3.0 h1:HguUjsGpIMh/zsTczGN3DVJFxTU/GX+MMmzcKoMO7ko= @@ -476,8 +476,8 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46 h1:GHRpF1pTW19a8tTFrMLUcfWwyC0pnifVo2ClaLq+hP8= github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46/go.mod h1:uAQ5PCi+MFsC7HjREoAz1BU+Mq60+05gifQSsHSDG/8= -github.com/shabbyrobe/gocovmerge v0.0.0-20190829150210-3e036491d500 h1:WnNuhiq+FOY3jNj6JXFT+eLN3CQ/oPIsDPRanvwsmbI= -github.com/shabbyrobe/gocovmerge v0.0.0-20190829150210-3e036491d500/go.mod h1:+njLrG5wSeoG4Ds61rFgEzKvenR2UHbjMoDHsczxly0= +github.com/shabbyrobe/gocovmerge v0.0.0-20230507112040-c3350d9342df h1:S77Pf5fIGMa7oSwp8SQPp7Hb4ZiI38K3RNBKD2LLeEM= +github.com/shabbyrobe/gocovmerge v0.0.0-20230507112040-c3350d9342df/go.mod h1:dcuzJZ83w/SqN9k4eQqwKYMgmKWzg/KzJAURBhRL1tc= github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4= github.com/shirou/gopsutil/v3 v3.23.12/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= @@ -523,10 +523,12 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/t3rm1n4l/go-mega v0.0.0-20230228171823-a01a2cda13ca h1:I9rVnNXdIkij4UvMT7OmKhH9sOIvS8iXkxfPdnn9wQA= github.com/t3rm1n4l/go-mega v0.0.0-20230228171823-a01a2cda13ca/go.mod h1:suDIky6yrK07NnaBadCB4sS0CqFOvUK91lH7CR+JlDA= github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= -github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= -github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= +github.com/tklauser/go-sysconf v0.3.13 h1:GBUpcahXSpR2xN01jhkNAbTLRk2Yzgggk8IM08lq3r4= +github.com/tklauser/go-sysconf v0.3.13/go.mod h1:zwleP4Q4OehZHGn4CYZDipCgg9usW5IJePewFCGVEa0= github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= +github.com/tklauser/numcpus v0.7.0 h1:yjuerZP127QG9m5Zh/mSO4wqurYil27tHrqwRoRjpr4= +github.com/tklauser/numcpus v0.7.0/go.mod h1:bb6dMVcj8A42tSE7i32fsIUCbQNllK5iDguyOZRUzAY= github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c h1:u6SKchux2yDvFQnDHS3lPnIRmfVJ5Sxy3ao2SIdysLQ= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= @@ -608,8 +610,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= -golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= +golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 h1:hNQpMuAJe5CtcUqCXaWga3FHu+kQvCqcsoVaQgSV60o= +golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -738,7 +740,6 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220408201424-a24fb2fb8a0f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -782,7 +783,6 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= @@ -899,10 +899,10 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 h1:YJ5pD9rF8o9Qtta0Cmy9rdBwkSjrTCT6XTiUQVOtIos= +google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 h1:nz5NESFLZbJGPFxDT/HCn+V1mZ8JGNoY4nUpmW/Y2eg= google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 h1:s1w3X6gQxwrLEpxnLd/qXTVLgQE2yXwaOaoa6IlY/+o= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 h1:6G8oQ016D88m1xAKljMlBOOGWDZkes4kMhgGFlf8WcQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917/go.mod h1:xtjpI3tXFPP051KaWnhvxkiubL/6dJ18vLVf7q2pTOU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 h1:gphdwh0npgs8elJ4T6J+DQJHPVF7RsuJHCfwztUb4J4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -961,12 +961,12 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -storj.io/common v0.0.0-20231101115145-09481ec98b57 h1:/u6GmKmMzGdoc71B2Tg5ukJ1Lli/oyO6MQzJAyuUO+c= -storj.io/common v0.0.0-20231101115145-09481ec98b57/go.mod h1:qjHfzW5RlGg5z04CwIEjJd1eQ3HCGhUNtxZ6K/W7yqM= +storj.io/common v0.0.0-20240111121419-ecae1362576c h1:pdNDgFEX2EWmjZLflwQUPKGsq8GYcrdUhihHzgSkutw= +storj.io/common v0.0.0-20240111121419-ecae1362576c/go.mod h1:s3e2Lyg2jCwqL9TLFmesDgoZBPQIByBiKZ+AJOI9qvc= storj.io/drpc v0.0.33 h1:yCGZ26r66ZdMP0IcTYsj7WDAUIIjzXk6DJhbhvt9FHI= storj.io/drpc v0.0.33/go.mod h1:vR804UNzhBa49NOJ6HeLjd2H3MakC1j5Gv8bsOQT6N4= -storj.io/infectious v0.0.1 h1:/EdG6zvf589iTaTBdv+7+Q34/gR/evAGyYT3I2XYRxw= -storj.io/infectious v0.0.1/go.mod h1:QEjKKww28Sjl1x8iDsjBpOM4r1Yp8RsowNcItsZJ1Vs= +storj.io/infectious v0.0.2 h1:rGIdDC/6gNYAStsxsZU79D/MqFjNyJc1tsyyj9sTl7Q= +storj.io/infectious v0.0.2/go.mod h1:QEjKKww28Sjl1x8iDsjBpOM4r1Yp8RsowNcItsZJ1Vs= storj.io/picobuf v0.0.2-0.20230906122608-c4ba17033c6c h1:or/DtG5uaZpzimL61ahlgAA+MTYn/U3txz4fe+XBFUg= storj.io/picobuf v0.0.2-0.20230906122608-c4ba17033c6c/go.mod h1:JCuc3C0gzCJHQ4J6SOx/Yjg+QTpX0D+Fvs5H46FETCk= storj.io/uplink v1.12.2 h1:lqgOsMhUI2hP5N1twU9zmvhlu6rgyCsKg/MrnzSZGjk= From 13fb2fb2ec7581ad7c44454249a5e22573bc18f1 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 13 Jan 2024 17:00:04 +0000 Subject: [PATCH 088/130] build: update to go1.22rc1 and make go1.20 the minimum required version --- .github/workflows/build.yml | 26 +++++++++++++------------- fs/versioncheck.go | 8 ++++---- go.mod | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f2b3a0bd2ae60..41dd9c41d7038 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,12 +27,12 @@ jobs: strategy: fail-fast: false matrix: - job_name: ['linux', 'linux_386', 'mac_amd64', 'mac_arm64', 'windows', 'other_os', 'go1.19', 'go1.20'] + job_name: ['linux', 'linux_386', 'mac_amd64', 'mac_arm64', 'windows', 'other_os', 'go1.20', 'go1.21'] include: - job_name: linux os: ubuntu-latest - go: '1.21' + go: '>=1.22.0-rc.1' gotags: cmount build_flags: '-include "^linux/"' check: true @@ -43,14 +43,14 @@ jobs: - job_name: linux_386 os: ubuntu-latest - go: '1.21' + go: '>=1.22.0-rc.1' goarch: 386 gotags: cmount quicktest: true - job_name: mac_amd64 os: macos-11 - go: '1.21' + go: '>=1.22.0-rc.1' gotags: 'cmount' build_flags: '-include "^darwin/amd64" -cgo' quicktest: true @@ -59,14 +59,14 @@ jobs: - job_name: mac_arm64 os: macos-11 - go: '1.21' + go: '>=1.22.0-rc.1' gotags: 'cmount' build_flags: '-include "^darwin/arm64" -cgo -macos-arch arm64 -cgo-cflags=-I/usr/local/include -cgo-ldflags=-L/usr/local/lib' deploy: true - job_name: windows os: windows-latest - go: '1.21' + go: '>=1.22.0-rc.1' gotags: cmount cgo: '0' build_flags: '-include "^windows/"' @@ -76,20 +76,20 @@ jobs: - job_name: other_os os: ubuntu-latest - go: '1.21' + go: '>=1.22.0-rc.1' build_flags: '-exclude "^(windows/|darwin/|linux/)"' compile_all: true deploy: true - - job_name: go1.19 + - job_name: go1.20 os: ubuntu-latest - go: '1.19' + go: '1.20' quicktest: true racequicktest: true - - job_name: go1.20 + - job_name: go1.21 os: ubuntu-latest - go: '1.20' + go: '1.21' quicktest: true racequicktest: true @@ -243,7 +243,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: '1.21' + go-version: '>=1.22.0-rc.1' check-latest: true - name: Install govulncheck @@ -268,7 +268,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.21' + go-version: '>=1.22.0-rc.1' - name: Go module cache uses: actions/cache@v3 diff --git a/fs/versioncheck.go b/fs/versioncheck.go index afa274c922990..263d31013ca59 100644 --- a/fs/versioncheck.go +++ b/fs/versioncheck.go @@ -1,8 +1,8 @@ -//go:build !go1.19 -// +build !go1.19 +//go:build !go1.20 +// +build !go1.20 package fs -// Upgrade to Go version 1.19 to compile rclone - latest stable go +// Upgrade to Go version 1.20 to compile rclone - latest stable go // compiler recommended. -func init() { Go_version_1_19_required_for_compilation() } +func init() { Go_version_1_20_required_for_compilation() } diff --git a/go.mod b/go.mod index f2c9e7fadde2f..51f8289480211 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/rclone/rclone -go 1.19 +go 1.20 require ( bazil.org/fuse v0.0.0-20230120002735-62a210ff1fd5 From 938b43c26cc23117c676d80ee28b026671912209 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 13 Jan 2024 16:56:11 +0000 Subject: [PATCH 089/130] build: remove random.Seed since random generator is seeded automatically in go1.20 Now that the minimum version is go1.20 we can stop seeding the random number generator. --- cmd/cmd.go | 4 ---- fstest/fstest.go | 5 ----- lib/random/random_seed.go | 17 ----------------- lib/random/random_seed_old.go | 29 ----------------------------- lib/random/random_test.go | 14 -------------- vfs/test_vfs/test_vfs.go | 6 ------ 6 files changed, 75 deletions(-) delete mode 100644 lib/random/random_seed.go delete mode 100644 lib/random/random_seed_old.go diff --git a/cmd/cmd.go b/cmd/cmd.go index 7043995f02b27..784d785e9308c 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -39,7 +39,6 @@ import ( "github.com/rclone/rclone/lib/atexit" "github.com/rclone/rclone/lib/buildinfo" "github.com/rclone/rclone/lib/exitcode" - "github.com/rclone/rclone/lib/random" "github.com/rclone/rclone/lib/terminal" "github.com/spf13/cobra" "github.com/spf13/pflag" @@ -562,9 +561,6 @@ func AddBackendFlags() { // Main runs rclone interpreting flags and commands out of os.Args func Main() { - if err := random.Seed(); err != nil { - log.Fatalf("Fatal error: %v", err) - } setupRootCommand(Root) AddBackendFlags() if err := Root.Execute(); err != nil { diff --git a/fstest/fstest.go b/fstest/fstest.go index eebdcbd3352b2..c74ae6e9a20af 100644 --- a/fstest/fstest.go +++ b/fstest/fstest.go @@ -49,11 +49,6 @@ var ( MatchTestRemote = regexp.MustCompile(`^rclone-test-[abcdefghijklmnopqrstuvwxyz0123456789]{24}$`) ) -// Seed the random number generator -func init() { - _ = random.Seed() -} - // Initialise rclone for testing func Initialise() { ctx := context.Background() diff --git a/lib/random/random_seed.go b/lib/random/random_seed.go deleted file mode 100644 index c0c165779ce7e..0000000000000 --- a/lib/random/random_seed.go +++ /dev/null @@ -1,17 +0,0 @@ -//go:build go1.20 - -package random - -// Seed the global math/rand with crypto strong data -// -// This doesn't make it OK to use math/rand in crypto sensitive -// environments - don't do that! However it does help to mitigate the -// problem if that happens accidentally. This would have helped with -// CVE-2020-28924 - #4783 -// -// As of Go 1.20 there is no reason to call math/rand.Seed with a -// random value as it is self seeded to a random 64 bit number so this -// does nothing. -func Seed() error { - return nil -} diff --git a/lib/random/random_seed_old.go b/lib/random/random_seed_old.go deleted file mode 100644 index 8fce03ec3b4c4..0000000000000 --- a/lib/random/random_seed_old.go +++ /dev/null @@ -1,29 +0,0 @@ -//go:build !go1.20 - -package random - -import ( - cryptorand "crypto/rand" - "encoding/binary" - "fmt" - mathrand "math/rand" -) - -// Seed the global math/rand with crypto strong data -// -// This doesn't make it OK to use math/rand in crypto sensitive -// environments - don't do that! However it does help to mitigate the -// problem if that happens accidentally. This would have helped with -// CVE-2020-28924 - #4783 -// -// As of Go 1.20 there is no reason to call math/rand.Seed with a -// random value as it is self seeded to a random 64 bit number. -func Seed() error { - var seed int64 - err := binary.Read(cryptorand.Reader, binary.LittleEndian, &seed) - if err != nil { - return fmt.Errorf("failed to read random seed: %w", err) - } - mathrand.Seed(seed) - return nil -} diff --git a/lib/random/random_test.go b/lib/random/random_test.go index a710833d3d765..1be57dda62113 100644 --- a/lib/random/random_test.go +++ b/lib/random/random_test.go @@ -1,7 +1,6 @@ package random import ( - "math/rand" "testing" "github.com/stretchr/testify/assert" @@ -49,16 +48,3 @@ func TestPasswordDuplicates(t *testing.T) { seen[s] = true } } - -func TestSeed(t *testing.T) { - // seed 100 times and check the first random number doesn't repeat - // This test could fail with a probability of ~ 10**-15 - const n = 100 - var seen = map[int64]bool{} - for i := 0; i < n; i++ { - assert.NoError(t, Seed()) - first := rand.Int63() - assert.False(t, seen[first]) - seen[first] = true - } -} diff --git a/vfs/test_vfs/test_vfs.go b/vfs/test_vfs/test_vfs.go index 3e70ce1cb69cd..4725a7bd7ec0c 100644 --- a/vfs/test_vfs/test_vfs.go +++ b/vfs/test_vfs/test_vfs.go @@ -29,12 +29,6 @@ var ( testNumber atomic.Int32 ) -// Seed the random number generator -func init() { - _ = random.Seed() - -} - // Test contains stats about the running test which work for files or // directories type Test struct { From da244a370982d2edb79e965e9c98a07feac0b102 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 13 Jan 2024 16:58:36 +0000 Subject: [PATCH 090/130] ssh: shorten wait delay for external ssh binaries now that we are using go1.20 Now we are guaranteed to have go1.20 or later we can use the WaitDelay flag when running external ssh binaries. --- backend/sftp/ssh_external.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/sftp/ssh_external.go b/backend/sftp/ssh_external.go index 0ac5e6539f794..bbea27ea83be9 100644 --- a/backend/sftp/ssh_external.go +++ b/backend/sftp/ssh_external.go @@ -10,6 +10,7 @@ import ( "io" "os/exec" "strings" + "time" "github.com/rclone/rclone/fs" ) @@ -93,8 +94,7 @@ func (f *Fs) newSSHSessionExternal() *sshSessionExternal { s.cmd = exec.CommandContext(ctx, ssh[0], ssh[1:]...) // Allow the command a short time only to shut down - // FIXME enable when we get rid of go1.19 - // s.cmd.WaitDelay = time.Second + s.cmd.WaitDelay = time.Second return s } From dd0e5b9a7f5c65f0776759ac1bfd9e3e93f5517e Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 13 Jan 2024 16:59:33 +0000 Subject: [PATCH 091/130] operations: use built in io.OffsetWriter for go1.20 --- fs/operations/multithread.go | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/fs/operations/multithread.go b/fs/operations/multithread.go index 46e66dfa40fa6..9cc5ce0fe380d 100644 --- a/fs/operations/multithread.go +++ b/fs/operations/multithread.go @@ -254,27 +254,6 @@ func multiThreadCopy(ctx context.Context, f fs.Fs, remote string, src fs.Object, return obj, nil } -// An offsetWriter maps writes at offset base to offset base+off in the underlying writer. -// -// Modified from the go source code. Can be replaced with -// io.OffsetWriter when we no longer need to support go1.19 -type offsetWriter struct { - w io.WriterAt - off int64 // the current offset -} - -// newOffsetWriter returns an offsetWriter that writes to w -// starting at offset off. -func newOffsetWriter(w io.WriterAt, off int64) *offsetWriter { - return &offsetWriter{w, off} -} - -func (o *offsetWriter) Write(p []byte) (n int, err error) { - n, err = o.w.WriteAt(p, o.off) - o.off += int64(n) - return -} - // writerAtChunkWriter converts a WriterAtCloser into a ChunkWriter type writerAtChunkWriter struct { remote string @@ -296,7 +275,7 @@ func (w *writerAtChunkWriter) WriteChunk(ctx context.Context, chunkNumber int, r bytesToWrite = w.size % w.chunkSize } - var writer io.Writer = newOffsetWriter(w.writerAt, int64(chunkNumber)*w.chunkSize) + var writer io.Writer = io.NewOffsetWriter(w.writerAt, int64(chunkNumber)*w.chunkSize) if w.writeBufferSize > 0 { writer = bufio.NewWriterSize(writer, int(w.writeBufferSize)) } From 223d8c5fe38751664d360c7ee4a50690936bca10 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 13 Jan 2024 17:14:16 +0000 Subject: [PATCH 092/130] serve dlna: now only supported on go1.21 or later This is due to use of go1.21 only constructs in github.com/anacrolix/log --- cmd/serve/dlna/cds.go | 2 ++ cmd/serve/dlna/cms.go | 2 ++ cmd/serve/dlna/dlna.go | 2 ++ cmd/serve/dlna/dlna_test.go | 2 ++ cmd/serve/dlna/dlna_unsupported.go | 9 +++++++++ cmd/serve/dlna/dlna_util.go | 2 ++ cmd/serve/dlna/mrrs.go | 2 ++ 7 files changed, 21 insertions(+) create mode 100644 cmd/serve/dlna/dlna_unsupported.go diff --git a/cmd/serve/dlna/cds.go b/cmd/serve/dlna/cds.go index 72fcceeab5850..59572f9265932 100644 --- a/cmd/serve/dlna/cds.go +++ b/cmd/serve/dlna/cds.go @@ -1,3 +1,5 @@ +//go:build go1.21 + package dlna import ( diff --git a/cmd/serve/dlna/cms.go b/cmd/serve/dlna/cms.go index 1edce9c3631a9..eb2bbc9b0842b 100644 --- a/cmd/serve/dlna/cms.go +++ b/cmd/serve/dlna/cms.go @@ -1,3 +1,5 @@ +//go:build go1.21 + package dlna import ( diff --git a/cmd/serve/dlna/dlna.go b/cmd/serve/dlna/dlna.go index 1a2a779149259..7739c910f40de 100644 --- a/cmd/serve/dlna/dlna.go +++ b/cmd/serve/dlna/dlna.go @@ -1,3 +1,5 @@ +//go:build go1.21 + // Package dlna provides DLNA server. package dlna diff --git a/cmd/serve/dlna/dlna_test.go b/cmd/serve/dlna/dlna_test.go index 389e3ba3c2c15..d6f7c42e45edd 100644 --- a/cmd/serve/dlna/dlna_test.go +++ b/cmd/serve/dlna/dlna_test.go @@ -1,3 +1,5 @@ +//go:build go1.21 + package dlna import ( diff --git a/cmd/serve/dlna/dlna_unsupported.go b/cmd/serve/dlna/dlna_unsupported.go new file mode 100644 index 0000000000000..d12f61e6f1da5 --- /dev/null +++ b/cmd/serve/dlna/dlna_unsupported.go @@ -0,0 +1,9 @@ +//go:build !go1.21 + +// Package dlna is unsupported on this platform +package dlna + +import "github.com/spf13/cobra" + +// Command definition is nil to show not implemented +var Command *cobra.Command diff --git a/cmd/serve/dlna/dlna_util.go b/cmd/serve/dlna/dlna_util.go index d54dfea5b942f..0347296e2dc03 100644 --- a/cmd/serve/dlna/dlna_util.go +++ b/cmd/serve/dlna/dlna_util.go @@ -1,3 +1,5 @@ +//go:build go1.21 + package dlna import ( diff --git a/cmd/serve/dlna/mrrs.go b/cmd/serve/dlna/mrrs.go index 70061bd719c79..0cc72d8c7a6b4 100644 --- a/cmd/serve/dlna/mrrs.go +++ b/cmd/serve/dlna/mrrs.go @@ -1,3 +1,5 @@ +//go:build go1.21 + package dlna import ( From 42cac4cf535251c11f12e4bca6c00c7b2df1c0dd Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 15 Jan 2024 15:34:37 +0000 Subject: [PATCH 093/130] build: use API when fetching golangci-lint as it is more reliable This was turned off previously because we used it in the CI and it rate limited. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 13b92fb9082e4..3503a91fb43c7 100644 --- a/Makefile +++ b/Makefile @@ -103,7 +103,7 @@ check: rclone # Get the build dependencies build_dep: - go run bin/get-github-release.go -extract golangci-lint golangci/golangci-lint 'golangci-lint-.*\.tar\.gz' + go run bin/get-github-release.go -use-api -extract golangci-lint golangci/golangci-lint 'golangci-lint-.*\.tar\.gz' # Get the release dependencies we only install on linux release_dep_linux: From 6521394865cc73efed2f19a5b97ac4a9e7e717c0 Mon Sep 17 00:00:00 2001 From: Harshit Budhraja <52413945+harshit-budhraja@users.noreply.github.com> Date: Tue, 16 Jan 2024 19:47:23 +0530 Subject: [PATCH 094/130] imagekit: Updated docs and web content --- README.md | 1 + docs/content/_index.md | 1 + docs/content/overview.md | 1 + docs/layouts/chrome/navbar.html | 1 + 4 files changed, 4 insertions(+) diff --git a/README.md b/README.md index e9e2c44b42ab4..0ab837953058c 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ Rclone *("rsync for cloud storage")* is a command-line program to sync files and * HiDrive [:page_facing_up:](https://rclone.org/hidrive/) * HTTP [:page_facing_up:](https://rclone.org/http/) * Huawei Cloud Object Storage Service(OBS) [:page_facing_up:](https://rclone.org/s3/#huawei-obs) + * ImageKit [:page_facing_up:](https://rclone.org/imagekit/) * Internet Archive [:page_facing_up:](https://rclone.org/internetarchive/) * Jottacloud [:page_facing_up:](https://rclone.org/jottacloud/) * IBM COS S3 [:page_facing_up:](https://rclone.org/s3/#ibm-cos-s3) diff --git a/docs/content/_index.md b/docs/content/_index.md index fc09ed522d989..d44068f7726ae 100644 --- a/docs/content/_index.md +++ b/docs/content/_index.md @@ -129,6 +129,7 @@ WebDAV or S3, that work out of the box.) {{< provider name="Hetzner Storage Box" home="https://www.hetzner.com/storage/storage-box" config="/sftp/#hetzner-storage-box" >}} {{< provider name="HiDrive" home="https://www.strato.de/cloud-speicher/" config="/hidrive/" >}} {{< provider name="HTTP" home="https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol" config="/http/" >}} +{{< provider name="ImageKit" home="https://imagekit.io" config="/imagekit/" >}} {{< provider name="Internet Archive" home="https://archive.org/" config="/internetarchive/" >}} {{< provider name="Jottacloud" home="https://www.jottacloud.com/en/" config="/jottacloud/" >}} {{< provider name="IBM COS S3" home="http://www.ibm.com/cloud/object-storage" config="/s3/#ibm-cos-s3" >}} diff --git a/docs/content/overview.md b/docs/content/overview.md index 731c4642dd674..610daecc5b570 100644 --- a/docs/content/overview.md +++ b/docs/content/overview.md @@ -483,6 +483,7 @@ upon backend-specific capabilities. | HDFS | Yes | No | Yes | Yes | No | No | Yes | No | No | Yes | Yes | | HiDrive | Yes | Yes | Yes | Yes | No | No | Yes | No | No | No | Yes | | HTTP | No | No | No | No | No | No | No | No | No | No | Yes | +| ImageKit | No | No | No | Yes | No | Yes | No | No | Yes | Yes | No | | Internet Archive | No | Yes | No | No | Yes | Yes | No | No | Yes | Yes | No | | Jottacloud | Yes | Yes | Yes | Yes | Yes | Yes | No | No | Yes | Yes | Yes | | Koofr | Yes | Yes | Yes | Yes | No | No | Yes | No | Yes | Yes | Yes | diff --git a/docs/layouts/chrome/navbar.html b/docs/layouts/chrome/navbar.html index 4d7802a45536d..9094f94ee527c 100644 --- a/docs/layouts/chrome/navbar.html +++ b/docs/layouts/chrome/navbar.html @@ -73,6 +73,7 @@ HDFS (Hadoop Distributed Filesystem) HiDrive HTTP + ImageKit Internet Archive Jottacloud Koofr From d20f647487a608cc54ad3b5c702dd05539acf8ac Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 17 Jan 2024 10:23:34 +0000 Subject: [PATCH 095/130] Add Harshit Budhraja to contributors --- docs/content/authors.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/content/authors.md b/docs/content/authors.md index 81c93d3c5ad86..268de520db2e6 100644 --- a/docs/content/authors.md +++ b/docs/content/authors.md @@ -814,3 +814,4 @@ put them back in again.` >}} * rarspace01 * Paul Stern * Nikhil Ahuja + * Harshit Budhraja <52413945+harshit-budhraja@users.noreply.github.com> From ae3c73f610bf7356427613cf63a005e6556f1b55 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 16 Jan 2024 17:30:24 +0000 Subject: [PATCH 096/130] stats: fix race between ResetCounters and stopAverageLoop called from time.AfterFunc Before this change StatsInfo.ResetCounters() and stopAverageLoop() (when called from time.AfterFunc) could race on StatsInfo.average. This was because the deferred stopAverageLoop accessed StatsInfo.average without locking. For some reason this only ever happened on macOS. This caused the CI to fail on macOS thus causing the macOS builds not to appear. This commit fixes the problem with a bit of extra locking. It also renames all StatsInfo methods that should be called without the lock to start with an initial underscore as this is the convention we use elsewhere. Fixes #7567 --- fs/accounting/prometheus.go | 2 +- fs/accounting/stats.go | 34 ++++++++++++++++++++++++---------- fs/accounting/stats_test.go | 12 ++++++------ 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/fs/accounting/prometheus.go b/fs/accounting/prometheus.go index 385a94e6200c8..cad79280457b7 100644 --- a/fs/accounting/prometheus.go +++ b/fs/accounting/prometheus.go @@ -90,7 +90,7 @@ func (c *RcloneCollector) Collect(ch chan<- prometheus.Metric) { s.mu.RLock() ch <- prometheus.MustNewConstMetric(c.bytesTransferred, prometheus.CounterValue, float64(s.bytes)) - ch <- prometheus.MustNewConstMetric(c.transferSpeed, prometheus.GaugeValue, s.speed()) + ch <- prometheus.MustNewConstMetric(c.transferSpeed, prometheus.GaugeValue, s._speed()) ch <- prometheus.MustNewConstMetric(c.numOfErrors, prometheus.CounterValue, float64(s.errors)) ch <- prometheus.MustNewConstMetric(c.numOfCheckFiles, prometheus.CounterValue, float64(s.checks)) ch <- prometheus.MustNewConstMetric(c.transferredFiles, prometheus.CounterValue, float64(s.transfers)) diff --git a/fs/accounting/stats.go b/fs/accounting/stats.go index 665f0345109a2..3d89defd42ca4 100644 --- a/fs/accounting/stats.go +++ b/fs/accounting/stats.go @@ -139,10 +139,10 @@ func (s *StatsInfo) RemoteStats() (out rc.Params, err error) { return out, nil } -// speed returns the average speed of the transfer in bytes/second +// _speed returns the average speed of the transfer in bytes/second // // Call with lock held -func (s *StatsInfo) speed() float64 { +func (s *StatsInfo) _speed() float64 { return s.average.speed } @@ -213,8 +213,9 @@ func (trs timeRanges) total() (total time.Duration) { // Total duration is union of durations of all transfers belonging to this // object. +// // Needs to be protected by mutex. -func (s *StatsInfo) totalDuration() time.Duration { +func (s *StatsInfo) _totalDuration() time.Duration { // copy of s.oldTimeRanges with extra room for the current transfers timeRanges := make(timeRanges, len(s.oldTimeRanges), len(s.oldTimeRanges)+len(s.startedTransfers)) copy(timeRanges, s.oldTimeRanges) @@ -313,7 +314,7 @@ func (s *StatsInfo) calculateTransferStats() (ts transferStats) { // we take it off here to avoid double counting ts.totalBytes = s.transferQueueSize + s.bytes + transferringBytesTotal - transferringBytesDone ts.speed = s.average.speed - dt := s.totalDuration() + dt := s._totalDuration() ts.transferTime = dt.Seconds() return ts @@ -355,20 +356,33 @@ func (s *StatsInfo) averageLoop() { } } +// Start the average loop func (s *StatsInfo) startAverageLoop() { + s.mu.RLock() + defer s.mu.RUnlock() s.average.startOnce.Do(func() { s.average.stopped.Add(1) go s.averageLoop() }) } -func (s *StatsInfo) stopAverageLoop() { +// Stop the average loop +// +// Call with the mutex held +func (s *StatsInfo) _stopAverageLoop() { s.average.stopOnce.Do(func() { close(s.average.stop) s.average.stopped.Wait() }) } +// Stop the average loop +func (s *StatsInfo) stopAverageLoop() { + s.mu.RLock() + defer s.mu.RUnlock() + s._stopAverageLoop() +} + // String convert the StatsInfo to a string for printing func (s *StatsInfo) String() string { // NB if adding more stats in here, remember to add them into @@ -682,7 +696,7 @@ func (s *StatsInfo) ResetCounters() { s.startedTransfers = nil s.oldDuration = 0 - s.stopAverageLoop() + s._stopAverageLoop() s.average = averageValues{stop: make(chan bool)} } @@ -822,11 +836,11 @@ func (s *StatsInfo) AddTransfer(transfer *Transfer) { s.mu.Unlock() } -// removeTransfer removes a reference to the started transfer in +// _removeTransfer removes a reference to the started transfer in // position i. // // Must be called with the lock held -func (s *StatsInfo) removeTransfer(transfer *Transfer, i int) { +func (s *StatsInfo) _removeTransfer(transfer *Transfer, i int) { now := time.Now() // add finished transfer onto old time ranges @@ -858,7 +872,7 @@ func (s *StatsInfo) RemoveTransfer(transfer *Transfer) { s.mu.Lock() for i, tr := range s.startedTransfers { if tr == transfer { - s.removeTransfer(tr, i) + s._removeTransfer(tr, i) break } } @@ -876,7 +890,7 @@ func (s *StatsInfo) PruneTransfers() { if len(s.startedTransfers) > MaxCompletedTransfers+s.ci.Transfers { for i, tr := range s.startedTransfers { if tr.IsDone() { - s.removeTransfer(tr, i) + s._removeTransfer(tr, i) break } } diff --git a/fs/accounting/stats_test.go b/fs/accounting/stats_test.go index 773311824aec0..35c22037fcfe6 100644 --- a/fs/accounting/stats_test.go +++ b/fs/accounting/stats_test.go @@ -157,7 +157,7 @@ func TestStatsTotalDuration(t *testing.T) { s.AddTransfer(tr1) s.mu.Lock() - total := s.totalDuration() + total := s._totalDuration() s.mu.Unlock() assert.Equal(t, 1, len(s.startedTransfers)) @@ -175,7 +175,7 @@ func TestStatsTotalDuration(t *testing.T) { s.AddTransfer(tr1) s.mu.Lock() - total := s.totalDuration() + total := s._totalDuration() s.mu.Unlock() assert.Equal(t, time.Since(time1)/time.Second, total/time.Second) @@ -213,7 +213,7 @@ func TestStatsTotalDuration(t *testing.T) { time.Sleep(time.Millisecond) s.mu.Lock() - total := s.totalDuration() + total := s._totalDuration() s.mu.Unlock() assert.Equal(t, time.Duration(30), total/time.Second) @@ -244,7 +244,7 @@ func TestStatsTotalDuration(t *testing.T) { }) s.mu.Lock() - total := s.totalDuration() + total := s._totalDuration() s.mu.Unlock() assert.Equal(t, startTime.Sub(time1)/time.Second, total/time.Second) @@ -449,7 +449,7 @@ func TestPruneTransfers(t *testing.T) { } s.mu.Lock() - assert.Equal(t, time.Duration(test.Transfers)*time.Second, s.totalDuration()) + assert.Equal(t, time.Duration(test.Transfers)*time.Second, s._totalDuration()) assert.Equal(t, test.Transfers, len(s.startedTransfers)) s.mu.Unlock() @@ -458,7 +458,7 @@ func TestPruneTransfers(t *testing.T) { } s.mu.Lock() - assert.Equal(t, time.Duration(test.Transfers)*time.Second, s.totalDuration()) + assert.Equal(t, time.Duration(test.Transfers)*time.Second, s._totalDuration()) assert.Equal(t, test.ExpectedStartedTransfers, len(s.startedTransfers)) s.mu.Unlock() From 78176d39fd591c5127eba9d25d2205e8a006339b Mon Sep 17 00:00:00 2001 From: Harshit Budhraja <52413945+harshit-budhraja@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:53:06 +0530 Subject: [PATCH 097/130] imagekit: updated overview - supported operations --- docs/content/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/overview.md b/docs/content/overview.md index 610daecc5b570..33792640e0935 100644 --- a/docs/content/overview.md +++ b/docs/content/overview.md @@ -483,7 +483,7 @@ upon backend-specific capabilities. | HDFS | Yes | No | Yes | Yes | No | No | Yes | No | No | Yes | Yes | | HiDrive | Yes | Yes | Yes | Yes | No | No | Yes | No | No | No | Yes | | HTTP | No | No | No | No | No | No | No | No | No | No | Yes | -| ImageKit | No | No | No | Yes | No | Yes | No | No | Yes | Yes | No | +| ImageKit | Yes | Yes | Yes | No | No | No | No | No | No | No | Yes | | Internet Archive | No | Yes | No | No | Yes | Yes | No | No | Yes | Yes | No | | Jottacloud | Yes | Yes | Yes | Yes | Yes | Yes | No | No | Yes | Yes | Yes | | Koofr | Yes | Yes | Yes | Yes | No | No | Yes | No | Yes | Yes | Yes | From 17fea90ac9a5bcebcb51f683e02dfd946ea46869 Mon Sep 17 00:00:00 2001 From: kapitainsky Date: Wed, 17 Jan 2024 15:55:02 +0000 Subject: [PATCH 098/130] docs: add rclone OS requirements Adds rclone OS requirements list and latest rclone versions known to be working with specific historical OS versions. Discussed on the forum: https://forum.rclone.org/t/rclone-1-65-1-runtime-exception-error-crash-immediately-after-running-the-command/44051 Fixes: #7571 --- docs/content/downloads.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/content/downloads.md b/docs/content/downloads.md index d1ae19af95e0a..70c83261db163 100644 --- a/docs/content/downloads.md +++ b/docs/content/downloads.md @@ -10,6 +10,17 @@ Rclone is single executable (`rclone`, or `rclone.exe` on Windows) that you can simply download as a zip archive and extract into a location of your choosing. See the [install](https://rclone.org/install/) documentation for more details. +## Release {{% version %}} OS requirements {#osrequirements} + +| OS | Minimum Version | +|:-------:|:-------:| +| Linux | kernel 2.6.32 | +| macOS (Intel) | 10.15 (Catalina) | +| macOS (ARM64) | 11 (Big Sur) | +| Windows | 10, Server 2016 | +| FreeBSD | 12.2 | +| OpenBSD | 6.9 | + ## Release {{% version %}} {#release} | Arch-OS | Windows | macOS | Linux | .deb | .rpm | FreeBSD | NetBSD | OpenBSD | Plan9 | Solaris | @@ -101,3 +112,19 @@ script) from a URL which doesn't change then you can use these links. ## Older Downloads Older downloads can be found [here](https://downloads.rclone.org/). + +The latest `rclone` version working for: +| OS | Maximum rclone version | +|:-------:|:-------:| +| Windows 7 | v1.63.1 | +| Windows Server 2008 | v1.63.1 | +| Windows Server 2012 | v1.63.1 | +| Windows XP | v1.42 | +| Windows Vista | v1.42 | +| macOS 10.14 (Mojave) | v1.63.1 | +| macOS 10.13 (High Sierra) | v1.63.1 | +| macOS 10.12 (Sierra) | v1.56.0 | +| macOS 10.11 (El Capitan) | v1.52.0 | +| macOS 10.10 (Yosemite) | v1.49.0 | +| OS X 10.9 (Mavericks) | v1.42 | +| OS X 10.8 (Mountain Lion) | v1.42 | From c482624a6ca5f2fff78bd97767bc7ca7427a50e9 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 17 Jan 2024 10:36:17 +0000 Subject: [PATCH 099/130] config: add config/paths to the rc as rclone config paths equivalent Fixes #7568 --- fs/config/rc.go | 36 ++++++++++++++++++++++++++++++++++++ fs/config/rc_test.go | 11 +++++++++++ 2 files changed, 47 insertions(+) diff --git a/fs/config/rc.go b/fs/config/rc.go index 951adefe5aa8f..114dcffd17eaa 100644 --- a/fs/config/rc.go +++ b/fs/config/rc.go @@ -3,6 +3,7 @@ package config import ( "context" "errors" + "os" "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/rc" @@ -242,3 +243,38 @@ func rcSetPath(ctx context.Context, in rc.Params) (out rc.Params, err error) { err = SetConfigPath(path) return nil, err } + +func init() { + rc.Add(rc.Call{ + Path: "config/paths", + Fn: rcPaths, + Title: "Reads the config file path and other important paths.", + AuthRequired: true, + Help: ` +Returns a JSON object with the following keys: + +- config: path to config file +- cache: path to root of cache directory +- temp: path to root of temporary directory + +Eg + + { + "cache": "/home/USER/.cache/rclone", + "config": "/home/USER/.rclone.conf", + "temp": "/tmp" + } + +See the [config paths](/commands/rclone_config_paths/) command for more information on the above. +`, + }) +} + +// Set the config file path +func rcPaths(ctx context.Context, in rc.Params) (out rc.Params, err error) { + return rc.Params{ + "config": GetConfigPath(), + "cache": GetCacheDir(), + "temp": os.TempDir(), + }, nil +} diff --git a/fs/config/rc_test.go b/fs/config/rc_test.go index ac5a60ca374fc..891b9bcbc3aef 100644 --- a/fs/config/rc_test.go +++ b/fs/config/rc_test.go @@ -177,3 +177,14 @@ func TestRcSetPath(t *testing.T) { require.NoError(t, err) assert.Equal(t, oldPath, config.GetConfigPath()) } + +func TestRcPaths(t *testing.T) { + call := rc.Calls.Get("config/paths") + assert.NotNil(t, call) + out, err := call.Fn(context.Background(), nil) + require.NoError(t, err) + + assert.Equal(t, config.GetConfigPath(), out["config"]) + assert.Equal(t, config.GetCacheDir(), out["cache"]) + assert.Equal(t, os.TempDir(), out["temp"]) +} From 806f6ab1ebe3cee4653d10626cf82a66c672da9c Mon Sep 17 00:00:00 2001 From: Tera <24725862+teraa@users.noreply.github.com> Date: Thu, 18 Jan 2024 10:48:34 +0100 Subject: [PATCH 100/130] add missing backtick --- docs/content/filtering.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/filtering.md b/docs/content/filtering.md index 7afd66ff0f77b..6c9fc8c27f466 100644 --- a/docs/content/filtering.md +++ b/docs/content/filtering.md @@ -533,7 +533,7 @@ E.g. for an alternative `filter-file.txt`: - * Files `file1.jpg`, `file3.png` and `file2.avi` are listed whilst -`secret17.jpg` and files without the suffix .jpg` or `.png` are excluded. +`secret17.jpg` and files without the suffix `.jpg` or `.png` are excluded. E.g. for an alternative `filter-file.txt`: From b06935a12e65fb439bcb9ded53543d364c1ba32a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 22:51:17 +0000 Subject: [PATCH 101/130] build(deps): bump actions/cache from 3 to 4 Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 41dd9c41d7038..9b2598b5ed46f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -168,7 +168,7 @@ jobs: env - name: Go module cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} @@ -271,7 +271,7 @@ jobs: go-version: '>=1.22.0-rc.1' - name: Go module cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} From 66929416d40f3ef61fe67a3b3adc4e5fb1495cb0 Mon Sep 17 00:00:00 2001 From: nielash Date: Thu, 7 Dec 2023 19:29:55 -0500 Subject: [PATCH 102/130] lsf: add --time-format flag Before this change, lsf's time format was hard-coded to "2006-01-02 15:04:05", regardless of the Fs's precision. After this change, a new optional --time-format flag is added to allow customizing the format (the default is unchanged). Examples: rclone lsf remote:path --format pt --time-format 'Jan 2, 2006 at 3:04pm (MST)' rclone lsf remote:path --format pt --time-format '2006-01-02 15:04:05.000000000' rclone lsf remote:path --format pt --time-format '2006-01-02T15:04:05.999999999Z07:00' rclone lsf remote:path --format pt --time-format RFC3339 rclone lsf remote:path --format pt --time-format DateOnly rclone lsf remote:path --format pt --time-format max --time-format max will automatically truncate '2006-01-02 15:04:05.000000000' to the maximum precision supported by the remote. --- cmd/lsf/lsf.go | 38 +++++++++++---- cmd/lsf/lsf_test.go | 80 ++++++++++++++++++++++++++++++++ fs/operations/operations.go | 74 ++++++++++++++++++++++++++++- fs/operations/operations_test.go | 6 +-- 4 files changed, 183 insertions(+), 15 deletions(-) diff --git a/cmd/lsf/lsf.go b/cmd/lsf/lsf.go index 22e4de754c822..38598c18e6d87 100644 --- a/cmd/lsf/lsf.go +++ b/cmd/lsf/lsf.go @@ -17,21 +17,23 @@ import ( ) var ( - format string - separator string - dirSlash bool - recurse bool - hashType = hash.MD5 - filesOnly bool - dirsOnly bool - csv bool - absolute bool + format string + timeFormat string + separator string + dirSlash bool + recurse bool + hashType = hash.MD5 + filesOnly bool + dirsOnly bool + csv bool + absolute bool ) func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() flags.StringVarP(cmdFlags, &format, "format", "F", "p", "Output format - see help for details", "") + flags.StringVarP(cmdFlags, &timeFormat, "time-format", "t", "", "Specify a custom time format, or 'max' for max precision supported by remote (default: 2006-01-02 15:04:05)", "") flags.StringVarP(cmdFlags, &separator, "separator", "s", ";", "Separator for the items in the format", "") flags.BoolVarP(cmdFlags, &dirSlash, "dir-slash", "d", true, "Append a slash to directory names", "") flags.FVarP(cmdFlags, &hashType, "hash", "", "Use this hash when `h` is used in the format MD5|SHA-1|DropboxHash", "") @@ -141,6 +143,19 @@ those only (without traversing the whole directory structure): rclone lsf --absolute --files-only --max-age 1d /path/to/local > new_files rclone copy --files-from-raw new_files /path/to/local remote:path +The default time format is ` + "`'2006-01-02 15:04:05'`" + `. +[Other formats](https://pkg.go.dev/time#pkg-constants) can be specified with the ` + "`--time-format`" + ` flag. +Examples: + + rclone lsf remote:path --format pt --time-format 'Jan 2, 2006 at 3:04pm (MST)' + rclone lsf remote:path --format pt --time-format '2006-01-02 15:04:05.000000000' + rclone lsf remote:path --format pt --time-format '2006-01-02T15:04:05.999999999Z07:00' + rclone lsf remote:path --format pt --time-format RFC3339 + rclone lsf remote:path --format pt --time-format DateOnly + rclone lsf remote:path --format pt --time-format max +` + "`--time-format max`" + ` will automatically truncate ` + "'`2006-01-02 15:04:05.000000000`'" + ` +to the maximum precision supported by the remote. + ` + lshelp.Help, Annotations: map[string]string{ "versionIntroduced": "v1.40", @@ -183,7 +198,10 @@ func Lsf(ctx context.Context, fsrc fs.Fs, out io.Writer) error { case 'p': list.AddPath() case 't': - list.AddModTime() + if timeFormat == "max" { + timeFormat = operations.FormatForLSFPrecision(fsrc.Precision()) + } + list.AddModTime(timeFormat) opt.NoModTime = false case 's': list.AddSize() diff --git a/cmd/lsf/lsf_test.go b/cmd/lsf/lsf_test.go index 72c0853b02ddf..886acbcf021c1 100644 --- a/cmd/lsf/lsf_test.go +++ b/cmd/lsf/lsf_test.go @@ -8,6 +8,7 @@ import ( _ "github.com/rclone/rclone/backend/local" "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/list" + "github.com/rclone/rclone/fs/operations" "github.com/rclone/rclone/fstest" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -223,3 +224,82 @@ subdir/file3_+_111_+_`+expectedOutput[6]+` recurse = false dirSlash = false } + +func TestTimeFormat(t *testing.T) { + fstest.Initialise() + f, err := fs.NewFs(context.Background(), "testfiles") + require.NoError(t, err) + format = "pst" + separator = "_+_" + recurse = true + dirSlash = true + timeFormat = "Jan 2, 2006 at 3:04pm (MST)" + + buf := new(bytes.Buffer) + err = Lsf(context.Background(), f, buf) + require.NoError(t, err) + + items, _ := list.DirSorted(context.Background(), f, true, "") + itemsInSubdir, _ := list.DirSorted(context.Background(), f, true, "subdir") + var expectedOutput []string + for _, item := range items { + expectedOutput = append(expectedOutput, item.ModTime(context.Background()).Format(timeFormat)) + } + for _, item := range itemsInSubdir { + expectedOutput = append(expectedOutput, item.ModTime(context.Background()).Format(timeFormat)) + } + + assert.Equal(t, `file1_+_0_+_`+expectedOutput[0]+` +file2_+_321_+_`+expectedOutput[1]+` +file3_+_1234_+_`+expectedOutput[2]+` +subdir/_+_-1_+_`+expectedOutput[3]+` +subdir/file1_+_0_+_`+expectedOutput[4]+` +subdir/file2_+_1_+_`+expectedOutput[5]+` +subdir/file3_+_111_+_`+expectedOutput[6]+` +`, buf.String()) + + format = "" + separator = "" + recurse = false + dirSlash = false +} + +func TestTimeFormatMax(t *testing.T) { + fstest.Initialise() + f, err := fs.NewFs(context.Background(), "testfiles") + require.NoError(t, err) + format = "pst" + separator = "_+_" + recurse = true + dirSlash = true + timeFormat = "max" + precision := operations.FormatForLSFPrecision(f.Precision()) + + buf := new(bytes.Buffer) + err = Lsf(context.Background(), f, buf) + require.NoError(t, err) + + items, _ := list.DirSorted(context.Background(), f, true, "") + itemsInSubdir, _ := list.DirSorted(context.Background(), f, true, "subdir") + var expectedOutput []string + for _, item := range items { + expectedOutput = append(expectedOutput, item.ModTime(context.Background()).Format(precision)) + } + for _, item := range itemsInSubdir { + expectedOutput = append(expectedOutput, item.ModTime(context.Background()).Format(precision)) + } + + assert.Equal(t, `file1_+_0_+_`+expectedOutput[0]+` +file2_+_321_+_`+expectedOutput[1]+` +file3_+_1234_+_`+expectedOutput[2]+` +subdir/_+_-1_+_`+expectedOutput[3]+` +subdir/file1_+_0_+_`+expectedOutput[4]+` +subdir/file2_+_1_+_`+expectedOutput[5]+` +subdir/file3_+_111_+_`+expectedOutput[6]+` +`, buf.String()) + + format = "" + separator = "" + recurse = false + dirSlash = false +} diff --git a/fs/operations/operations.go b/fs/operations/operations.go index 62d03ab37ee8a..d426c673c9f10 100644 --- a/fs/operations/operations.go +++ b/fs/operations/operations.go @@ -1916,9 +1916,54 @@ func (l *ListFormat) SetOutput(output []func(entry *ListJSONItem) string) { } // AddModTime adds file's Mod Time to output -func (l *ListFormat) AddModTime() { +func (l *ListFormat) AddModTime(timeFormat string) { + switch timeFormat { + case "": + timeFormat = "2006-01-02 15:04:05" + case "Layout": + timeFormat = time.Layout + case "ANSIC": + timeFormat = time.ANSIC + case "UnixDate": + timeFormat = time.UnixDate + case "RubyDate": + timeFormat = time.RubyDate + case "RFC822": + timeFormat = time.RFC822 + case "RFC822Z": + timeFormat = time.RFC822Z + case "RFC850": + timeFormat = time.RFC850 + case "RFC1123": + timeFormat = time.RFC1123 + case "RFC1123Z": + timeFormat = time.RFC1123Z + case "RFC3339": + timeFormat = time.RFC3339 + case "RFC3339Nano": + timeFormat = time.RFC3339Nano + case "Kitchen": + timeFormat = time.Kitchen + case "Stamp": + timeFormat = time.Stamp + case "StampMilli": + timeFormat = time.StampMilli + case "StampMicro": + timeFormat = time.StampMicro + case "StampNano": + timeFormat = time.StampNano + case "DateTime": + // timeFormat = time.DateTime // missing in go1.19 + timeFormat = "2006-01-02 15:04:05" + case "DateOnly": + // timeFormat = time.DateOnly // missing in go1.19 + timeFormat = "2006-01-02" + case "TimeOnly": + // timeFormat = time.TimeOnly // missing in go1.19 + timeFormat = "15:04:05" + } l.AppendOutput(func(entry *ListJSONItem) string { - return entry.ModTime.When.Local().Format("2006-01-02 15:04:05") + return entry.ModTime.When.Local().Format(timeFormat) }) } @@ -2030,6 +2075,31 @@ func (l *ListFormat) Format(entry *ListJSONItem) (result string) { return result } +// FormatForLSFPrecision Returns a time format for the given precision +func FormatForLSFPrecision(precision time.Duration) string { + switch { + case precision <= time.Nanosecond: + return "2006-01-02 15:04:05.000000000" + case precision <= 10*time.Nanosecond: + return "2006-01-02 15:04:05.00000000" + case precision <= 100*time.Nanosecond: + return "2006-01-02 15:04:05.0000000" + case precision <= time.Microsecond: + return "2006-01-02 15:04:05.000000" + case precision <= 10*time.Microsecond: + return "2006-01-02 15:04:05.00000" + case precision <= 100*time.Microsecond: + return "2006-01-02 15:04:05.0000" + case precision <= time.Millisecond: + return "2006-01-02 15:04:05.000" + case precision <= 10*time.Millisecond: + return "2006-01-02 15:04:05.00" + case precision <= 100*time.Millisecond: + return "2006-01-02 15:04:05.0" + } + return "2006-01-02 15:04:05" +} + // DirMove renames srcRemote to dstRemote // // It does this by loading the directory tree into memory (using ListR diff --git a/fs/operations/operations_test.go b/fs/operations/operations_test.go index 02f7b108c2386..19d58ea3049d6 100644 --- a/fs/operations/operations_test.go +++ b/fs/operations/operations_test.go @@ -1240,7 +1240,7 @@ func TestListFormat(t *testing.T) { assert.Equal(t, "a:::b", list.Format(item1)) list.SetOutput(nil) - list.AddModTime() + list.AddModTime("") assert.Equal(t, t1.Local().Format("2006-01-02 15:04:05"), list.Format(item0)) list.SetOutput(nil) @@ -1272,7 +1272,7 @@ func TestListFormat(t *testing.T) { assert.Equal(t, "1", list.Format(item0)) list.AddPath() - list.AddModTime() + list.AddModTime("") list.SetDirSlash(true) list.SetSeparator("__SEP__") assert.Equal(t, "1__SEP__a__SEP__"+t1.Local().Format("2006-01-02 15:04:05"), list.Format(item0)) @@ -1295,7 +1295,7 @@ func TestListFormat(t *testing.T) { list.SetCSV(true) list.AddSize() list.AddPath() - list.AddModTime() + list.AddModTime("") list.SetDirSlash(true) assert.Equal(t, "1|a|"+t1.Local().Format("2006-01-02 15:04:05"), list.Format(item0)) assert.Equal(t, "-1|subdir/|"+t2.Local().Format("2006-01-02 15:04:05"), list.Format(item1)) From 9933d6c07135926d904ccc3aec10c21e356a9cdc Mon Sep 17 00:00:00 2001 From: nielash Date: Thu, 21 Sep 2023 12:35:40 -0400 Subject: [PATCH 103/130] check: respect --no-unicode-normalization and --ignore-case-sync for --checkfile Before this change, --no-unicode-normalization and --ignore-case-sync were respected for rclone check but not for rclone check --checkfile, causing them to give different results. This change adds support for --checkfile so that the behavior is consistent. --- fs/operations/check.go | 22 +++++++++++--- fs/operations/check_test.go | 59 +++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 4 deletions(-) diff --git a/fs/operations/check.go b/fs/operations/check.go index 06d9f14ec56e1..239b3a72f01f6 100644 --- a/fs/operations/check.go +++ b/fs/operations/check.go @@ -20,6 +20,7 @@ import ( "github.com/rclone/rclone/fs/hash" "github.com/rclone/rclone/fs/march" "github.com/rclone/rclone/lib/readers" + "golang.org/x/text/unicode/norm" ) // checkFn is the type of the checking function used in CheckFn() @@ -375,6 +376,19 @@ func CheckDownload(ctx context.Context, opt *CheckOpt) error { return CheckFn(ctx, &optCopy) } +// ApplyTransforms handles --no-unicode-normalization and --ignore-case-sync for CheckSum +// so that it matches behavior of Check (where it's handled by March) +func ApplyTransforms(ctx context.Context, s string) string { + ci := fs.GetConfig(ctx) + if !ci.NoUnicodeNormalization { + s = norm.NFC.String(s) + } + if ci.IgnoreCaseSync { + s = strings.ToLower(s) + } + return s +} + // CheckSum checks filesystem hashes against a SUM file func CheckSum(ctx context.Context, fsrc, fsum fs.Fs, sumFile string, hashType hash.Type, opt *CheckOpt, download bool) error { var options CheckOpt @@ -440,10 +454,10 @@ func CheckSum(ctx context.Context, fsrc, fsum fs.Fs, sumFile string, hashType ha // checkSum checks single object against golden hashes func (c *checkMarch) checkSum(ctx context.Context, obj fs.Object, download bool, hashes HashSums, hashType hash.Type) { - remote := obj.Remote() + normalizedRemote := ApplyTransforms(ctx, obj.Remote()) c.ioMu.Lock() - sumHash, sumFound := hashes[remote] - hashes[remote] = "" // mark sum as consumed + sumHash, sumFound := hashes[normalizedRemote] + hashes[normalizedRemote] = "" // mark sum as consumed c.ioMu.Unlock() if !sumFound && c.opt.OneWay { @@ -563,7 +577,7 @@ func ParseSumFile(ctx context.Context, sumFile fs.Object) (HashSums, error) { continue } - fields := re.FindStringSubmatch(line) + fields := re.FindStringSubmatch(ApplyTransforms(ctx, line)) if fields == nil { numWarn++ if numWarn <= maxWarn { diff --git a/fs/operations/check_test.go b/fs/operations/check_test.go index 592485ed201b4..2f4213ad4e46e 100644 --- a/fs/operations/check_test.go +++ b/fs/operations/check_test.go @@ -20,6 +20,7 @@ import ( "github.com/rclone/rclone/lib/readers" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "golang.org/x/text/unicode/norm" ) func testCheck(t *testing.T, checkFunction func(ctx context.Context, opt *operations.CheckOpt) error) { @@ -544,3 +545,61 @@ func TestCheckSum(t *testing.T) { func TestCheckSumDownload(t *testing.T) { testCheckSum(t, true) } + +func TestApplyTransforms(t *testing.T) { + var ( + hashType = hash.MD5 + content = "Hello, World!" + hash = "65a8e27d8879283831b664bd8b7f0ad4" + nfc = norm.NFC.String(norm.NFD.String("測試_Русский___ě_áñ")) + nfd = norm.NFD.String(nfc) + nfcx2 = nfc + nfc + nfdx2 = nfd + nfd + both = nfc + nfd + upper = "HELLO, WORLD!" + lower = "hello, world!" + upperlowermixed = "HeLlO, wOrLd!" + ) + + testScenario := func(checkfileName, remotefileName, scenario string) { + r := fstest.NewRunIndividual(t) + if !r.Flocal.Hashes().Contains(hashType) || !r.Fremote.Hashes().Contains(hashType) { + t.Skipf("Fs lacks %s, skipping", hashType) + } + ctx := context.Background() + ci := fs.GetConfig(ctx) + opt := operations.CheckOpt{} + + remotefile := r.WriteObject(ctx, remotefileName, content, t2) + checkfile := r.WriteFile("test.sum", hash+" "+checkfileName, t2) + r.CheckLocalItems(t, checkfile) + assert.False(t, checkfileName == remotefile.Path, "Values match but should not: %s %s", checkfileName, remotefile.Path) + + testname := scenario + " (without normalization)" + println(testname) + ci.NoUnicodeNormalization = true + ci.IgnoreCaseSync = false + accounting.GlobalStats().ResetCounters() + err := operations.CheckSum(ctx, r.Fremote, r.Flocal, "test.sum", hashType, &opt, false) + assert.Error(t, err, "no expected error for %s %v %v", testname, checkfileName, remotefileName) + + testname = scenario + " (with normalization)" + println(testname) + ci.NoUnicodeNormalization = false + ci.IgnoreCaseSync = true + accounting.GlobalStats().ResetCounters() + err = operations.CheckSum(ctx, r.Fremote, r.Flocal, "test.sum", hashType, &opt, false) + assert.NoError(t, err, "unexpected error for %s %v %v", testname, checkfileName, remotefileName) + } + + testScenario(upper, lower, "upper checkfile vs. lower remote") + testScenario(lower, upper, "lower checkfile vs. upper remote") + testScenario(lower, upperlowermixed, "lower checkfile vs. upperlowermixed remote") + testScenario(upperlowermixed, upper, "upperlowermixed checkfile vs. upper remote") + testScenario(nfd, nfc, "NFD checkfile vs. NFC remote") + testScenario(nfc, nfd, "NFC checkfile vs. NFD remote") + testScenario(nfdx2, both, "NFDx2 checkfile vs. both remote") + testScenario(nfcx2, both, "NFCx2 checkfile vs. both remote") + testScenario(both, nfdx2, "both checkfile vs. NFDx2 remote") + testScenario(both, nfcx2, "both checkfile vs. NFCx2 remote") +} From 5c7ba0bfd34cb4aacb972747921ea50c83ac9ec2 Mon Sep 17 00:00:00 2001 From: nielash Date: Sun, 1 Oct 2023 04:12:39 -0400 Subject: [PATCH 104/130] bisync: fix tests on macOS normalizes unicode and ignores .DS_Store files to make testing possible on macOS --- cmd/bisync/bisync_test.go | 20 +++++++++++++++++-- .../golden/exclude-other-filtersfile.txt | 1 + .../golden/exclude-other-filtersfile.txt.md5 | 2 +- .../golden/include-other-filtersfile.txt | 1 + .../golden/include-other-filtersfile.txt.md5 | 2 +- .../modfiles/exclude-other-filtersfile.txt | 1 + .../modfiles/include-other-filtersfile.txt | 1 + 7 files changed, 24 insertions(+), 4 deletions(-) diff --git a/cmd/bisync/bisync_test.go b/cmd/bisync/bisync_test.go index 55e98a19eaad8..407cdab04bb12 100644 --- a/cmd/bisync/bisync_test.go +++ b/cmd/bisync/bisync_test.go @@ -35,6 +35,7 @@ import ( "github.com/rclone/rclone/fstest" "github.com/rclone/rclone/lib/atexit" "github.com/rclone/rclone/lib/random" + "golang.org/x/text/unicode/norm" "github.com/pmezard/go-difflib/difflib" "github.com/stretchr/testify/assert" @@ -277,6 +278,10 @@ func (b *bisyncTest) runTestCase(ctx context.Context, t *testing.T, testCase str b.goldenDir = b.ensureDir(b.testDir, "golden", false) b.dataDir = b.ensureDir(b.testDir, "modfiles", true) // optional + // normalize unicode so tets are runnable on macOS + b.sessionName = norm.NFC.String(b.sessionName) + b.goldenDir = norm.NFC.String(b.goldenDir) + // For test stability, jam initial dates to a fixed past date. // Test cases that change files will touch specific files to fixed new dates. initDate := time.Date(2000, time.January, 1, 0, 0, 0, 0, bisync.TZ) @@ -909,7 +914,7 @@ func (b *bisyncTest) compareResults() int { require.NoError(b.t, os.WriteFile(resultFile, []byte(resultText), bilib.PermSecure)) } - if goldenText == resultText { + if goldenText == resultText || strings.Contains(resultText, ".DS_Store") { continue } errorCount++ @@ -990,6 +995,10 @@ func (b *bisyncTest) storeGolden() { func (b *bisyncTest) mangleResult(dir, file string, golden bool) string { buf, err := os.ReadFile(filepath.Join(dir, file)) require.NoError(b.t, err) + + // normalize unicode so tets are runnable on macOS + buf = norm.NFC.Bytes(buf) + text := string(buf) switch fileType(strings.TrimSuffix(file, ".sav")) { @@ -1193,6 +1202,10 @@ func (b *bisyncTest) toGolden(name string) string { name = strings.ReplaceAll(name, b.canonPath1, goldenCanonBase) name = strings.ReplaceAll(name, b.canonPath2, goldenCanonBase) name = strings.TrimSuffix(name, ".sav") + + // normalize unicode so tets are runnable on macOS + name = norm.NFC.String(name) + return name } @@ -1214,7 +1227,10 @@ func (b *bisyncTest) listDir(dir string) (names []string) { files, err := os.ReadDir(dir) require.NoError(b.t, err) for _, file := range files { - names = append(names, filepath.Base(file.Name())) + if strings.Contains(file.Name(), ".lst-control") || strings.Contains(file.Name(), ".lst-dry-control") || strings.Contains(file.Name(), ".DS_Store") { + continue + } + names = append(names, filepath.Base(norm.NFC.String(file.Name()))) } // Sort files to ensure comparability. sort.Strings(names) diff --git a/cmd/bisync/testdata/test_check_access_filters/golden/exclude-other-filtersfile.txt b/cmd/bisync/testdata/test_check_access_filters/golden/exclude-other-filtersfile.txt index 18b83a070c21d..bbd76ecf310b2 100644 --- a/cmd/bisync/testdata/test_check_access_filters/golden/exclude-other-filtersfile.txt +++ b/cmd/bisync/testdata/test_check_access_filters/golden/exclude-other-filtersfile.txt @@ -5,5 +5,6 @@ - /subdir/subdirA/ + /subdir/** - /subdir-not/ +- .DS_Store + /* - ** diff --git a/cmd/bisync/testdata/test_check_access_filters/golden/exclude-other-filtersfile.txt.md5 b/cmd/bisync/testdata/test_check_access_filters/golden/exclude-other-filtersfile.txt.md5 index 407c05fe9cb41..7f262603e1335 100644 --- a/cmd/bisync/testdata/test_check_access_filters/golden/exclude-other-filtersfile.txt.md5 +++ b/cmd/bisync/testdata/test_check_access_filters/golden/exclude-other-filtersfile.txt.md5 @@ -1 +1 @@ -868aeb20dc983cd1aaa29f6c4f2537e6 \ No newline at end of file +5fcc6205d7df1c2e9ed3a15a1356b345 \ No newline at end of file diff --git a/cmd/bisync/testdata/test_check_access_filters/golden/include-other-filtersfile.txt b/cmd/bisync/testdata/test_check_access_filters/golden/include-other-filtersfile.txt index 8080e870ad2ba..8a23b08f56e7b 100644 --- a/cmd/bisync/testdata/test_check_access_filters/golden/include-other-filtersfile.txt +++ b/cmd/bisync/testdata/test_check_access_filters/golden/include-other-filtersfile.txt @@ -5,5 +5,6 @@ - /subdir/subdirA/ # + /subdir/** - /subdir-not/ +- .DS_Store #+ /* #- ** diff --git a/cmd/bisync/testdata/test_check_access_filters/golden/include-other-filtersfile.txt.md5 b/cmd/bisync/testdata/test_check_access_filters/golden/include-other-filtersfile.txt.md5 index c65db8b1447d7..e39cdd879a95c 100644 --- a/cmd/bisync/testdata/test_check_access_filters/golden/include-other-filtersfile.txt.md5 +++ b/cmd/bisync/testdata/test_check_access_filters/golden/include-other-filtersfile.txt.md5 @@ -1 +1 @@ -b9c5205dddfc926160c2442b2497d407 \ No newline at end of file +2ec13b2813141ed088e5978ef5a47b0e \ No newline at end of file diff --git a/cmd/bisync/testdata/test_check_access_filters/modfiles/exclude-other-filtersfile.txt b/cmd/bisync/testdata/test_check_access_filters/modfiles/exclude-other-filtersfile.txt index 18b83a070c21d..bbd76ecf310b2 100644 --- a/cmd/bisync/testdata/test_check_access_filters/modfiles/exclude-other-filtersfile.txt +++ b/cmd/bisync/testdata/test_check_access_filters/modfiles/exclude-other-filtersfile.txt @@ -5,5 +5,6 @@ - /subdir/subdirA/ + /subdir/** - /subdir-not/ +- .DS_Store + /* - ** diff --git a/cmd/bisync/testdata/test_check_access_filters/modfiles/include-other-filtersfile.txt b/cmd/bisync/testdata/test_check_access_filters/modfiles/include-other-filtersfile.txt index 8080e870ad2ba..8a23b08f56e7b 100644 --- a/cmd/bisync/testdata/test_check_access_filters/modfiles/include-other-filtersfile.txt +++ b/cmd/bisync/testdata/test_check_access_filters/modfiles/include-other-filtersfile.txt @@ -5,5 +5,6 @@ - /subdir/subdirA/ # + /subdir/** - /subdir-not/ +- .DS_Store #+ /* #- ** From 0e5f12126f8a6b1ae48a68242e563829fbe8ef00 Mon Sep 17 00:00:00 2001 From: nielash Date: Sun, 1 Oct 2023 04:47:46 -0400 Subject: [PATCH 105/130] bisync: merge copies and deletes, support --track-renames and --backup-dir -- fixes #5690 fixes #5685 Before this change, bisync handled copies and deletes in separate operations. After this change, they are combined in one sync operation, which is faster and also allows bisync to support --track-renames and --backup-dir. Bisync uses a --files-from filter containing only the paths bisync has determined need to be synced. Just like in sync (but in both directions), if a path is present on the dst but not the src, it's interpreted as a delete rather than a copy. --- cmd/bisync/deltas.go | 14 ++---- cmd/bisync/queue.go | 43 ++++--------------- ...testdir_path1.._testdir_path2.copy1to2.que | 1 + ...testdir_path1.._testdir_path2.copy2to1.que | 1 + .../testdata/test_changes/golden/test.log | 2 - .../test_createemptysrcdirs/golden/test.log | 4 +- ...testdir_path1.._testdir_path2.copy1to2.que | 1 + ...testdir_path1.._testdir_path2.copy2to1.que | 1 + ...testdir_path1.._testdir_path2.copy1to2.que | 1 + ...testdir_path1.._testdir_path2.copy2to1.que | 1 + .../testdata/test_dry_run/golden/test.log | 8 +--- ...testdir_path1.._testdir_path2.copy2to1.que | 2 + .../test_extended_filenames/golden/test.log | 1 - ...testdir_path1.._testdir_path2.copy1to2.que | 5 +++ .../test_max_delete_path1/golden/test.log | 2 +- ...testdir_path1.._testdir_path2.copy2to1.que | 5 +++ .../golden/test.log | 2 +- ...testdir_path1.._testdir_path2.copy1to2.que | 1 + .../testdata/test_rmdirs/golden/test.log | 2 +- docs/content/bisync.md | 14 +++++- 20 files changed, 50 insertions(+), 61 deletions(-) create mode 100644 cmd/bisync/testdata/test_max_delete_path1/golden/_testdir_path1.._testdir_path2.copy1to2.que create mode 100644 cmd/bisync/testdata/test_max_delete_path2_force/golden/_testdir_path1.._testdir_path2.copy2to1.que create mode 100644 cmd/bisync/testdata/test_rmdirs/golden/_testdir_path1.._testdir_path2.copy1to2.que diff --git a/cmd/bisync/deltas.go b/cmd/bisync/deltas.go index ccd43edbe7fc9..6e0542dfb6b71 100644 --- a/cmd/bisync/deltas.go +++ b/cmd/bisync/deltas.go @@ -327,6 +327,7 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change if !in2 { b.indent("Path2", p2, "Queue delete") delete2.Add(file) + copy1to2.Add(file) } else if d2.is(deltaOther) { b.indent("Path2", p1, "Queue copy to Path1") copy2to1.Add(file) @@ -351,6 +352,7 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change // Deleted b.indent("Path1", p1, "Queue delete") delete1.Add(file) + copy2to1.Add(file) } } @@ -380,25 +382,17 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change } if delete1.NotEmpty() { - changes1 = true - b.indent("", "Path1", "Do queued deletes on") - err = b.fastDelete(ctx, b.fs1, delete1, "delete1") - if err != nil { + if err = b.saveQueue(delete1, "delete1"); err != nil { return } - //propagate deletions of empty dirs from path2 to path1 (if --create-empty-src-dirs) b.syncEmptyDirs(ctx, b.fs1, delete1, dirs1, "remove") } if delete2.NotEmpty() { - changes2 = true - b.indent("", "Path2", "Do queued deletes on") - err = b.fastDelete(ctx, b.fs2, delete2, "delete2") - if err != nil { + if err = b.saveQueue(delete2, "delete2"); err != nil { return } - //propagate deletions of empty dirs from path1 to path2 (if --create-empty-src-dirs) b.syncEmptyDirs(ctx, b.fs2, delete2, dirs2, "remove") } diff --git a/cmd/bisync/queue.go b/cmd/bisync/queue.go index 701c8a922309b..d213ff74a99cc 100644 --- a/cmd/bisync/queue.go +++ b/cmd/bisync/queue.go @@ -24,39 +24,11 @@ func (b *bisyncRun) fastCopy(ctx context.Context, fsrc, fdst fs.Fs, files bilib. } } - return sync.CopyDir(ctxCopy, fdst, fsrc, b.opt.CreateEmptySrcDirs) -} - -func (b *bisyncRun) fastDelete(ctx context.Context, f fs.Fs, files bilib.Names, queueName string) error { - if err := b.saveQueue(files, queueName); err != nil { - return err - } - - transfers := fs.GetConfig(ctx).Transfers - - ctxRun, filterDelete := filter.AddConfig(b.opt.setDryRun(ctx)) - - for _, file := range files.ToList() { - if err := filterDelete.AddFile(file); err != nil { - return err - } - } - - objChan := make(fs.ObjectsChan, transfers) - errChan := make(chan error, 1) - go func() { - errChan <- operations.DeleteFiles(ctxRun, objChan) - }() - err := operations.ListFn(ctxRun, f, func(obj fs.Object) { - remote := obj.Remote() - if files.Has(remote) { - objChan <- obj - } - }) - close(objChan) - opErr := <-errChan - if err == nil { - err = opErr + var err error + if b.opt.Resync { + err = sync.CopyDir(ctxCopy, fdst, fsrc, b.opt.CreateEmptySrcDirs) + } else { + err = sync.Sync(ctxCopy, fdst, fsrc, b.opt.CreateEmptySrcDirs) } return err } @@ -75,8 +47,9 @@ func (b *bisyncRun) syncEmptyDirs(ctx context.Context, dst fs.Fs, candidates bil var direrr error if dirsList.has(s) { //make sure it's a dir, not a file if operation == "remove" { - //note: we need to use Rmdirs instead of Rmdir because directories will fail to delete if they have other empty dirs inside of them. - direrr = operations.Rmdirs(ctx, dst, s, false) + // directories made empty by the sync will have already been deleted during the sync + // this just catches the already-empty ones (excluded from sync by --files-from filter) + direrr = operations.TryRmdir(ctx, dst, s) } else if operation == "make" { direrr = operations.Mkdir(ctx, dst, s) } else { diff --git a/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.copy1to2.que b/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.copy1to2.que index 38a6601dbe388..5725b81842f15 100644 --- a/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.copy1to2.que +++ b/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.copy1to2.que @@ -1,4 +1,5 @@ "file11.txt" "file2.txt" +"file4.txt" "file5.txt..path1" "file7.txt" diff --git a/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.copy2to1.que b/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.copy2to1.que index 4146ce3e05ca0..3b79e78bd1166 100644 --- a/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.copy2to1.que +++ b/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.copy2to1.que @@ -1,4 +1,5 @@ "file1.txt" "file10.txt" +"file3.txt" "file5.txt..path2" "file6.txt" diff --git a/cmd/bisync/testdata/test_changes/golden/test.log b/cmd/bisync/testdata/test_changes/golden/test.log index 222b297587298..f77d40340ad85 100644 --- a/cmd/bisync/testdata/test_changes/golden/test.log +++ b/cmd/bisync/testdata/test_changes/golden/test.log @@ -88,8 +88,6 @@ INFO : - Path2 Queue copy to Path1 - {path1/}file10.txt INFO : - Path1 Queue delete - {path1/}file3.txt INFO : - Path2 Do queued copies to - Path1 INFO : - Path1 Do queued copies to - Path2 -INFO : - Do queued deletes on - Path1 -INFO : - Do queued deletes on - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log b/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log index b8799524a97eb..c63c8850cc1a8 100644 --- a/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log +++ b/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log @@ -77,7 +77,7 @@ INFO : - Path2 File was deleted - subdir INFO : Path2: 1 changes: 0 new, 0 newer, 0 older, 1 deleted INFO : Applying changes INFO : - Path2 Queue delete - {path2/}RCLONE_TEST -INFO : - Do queued deletes on - Path2 +INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" INFO : Bisync successful @@ -121,7 +121,7 @@ INFO : Path1: 1 changes: 0 new, 0 newer, 0 older, 1 deleted INFO : Path2 checking for diffs INFO : Applying changes INFO : - Path2 Queue delete - {path2/}subdir -INFO : - Do queued deletes on - Path2 +INFO : - Path1 Do queued copies to - Path2 INFO : subdir: Removing directory INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" diff --git a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.copy1to2.que b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.copy1to2.que index 38a6601dbe388..5725b81842f15 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.copy1to2.que +++ b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.copy1to2.que @@ -1,4 +1,5 @@ "file11.txt" "file2.txt" +"file4.txt" "file5.txt..path1" "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.copy2to1.que b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.copy2to1.que index 4146ce3e05ca0..3b79e78bd1166 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.copy2to1.que +++ b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.copy2to1.que @@ -1,4 +1,5 @@ "file1.txt" "file10.txt" +"file3.txt" "file5.txt..path2" "file6.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.copy1to2.que b/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.copy1to2.que index 38a6601dbe388..5725b81842f15 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.copy1to2.que +++ b/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.copy1to2.que @@ -1,4 +1,5 @@ "file11.txt" "file2.txt" +"file4.txt" "file5.txt..path1" "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.copy2to1.que b/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.copy2to1.que index 4146ce3e05ca0..3b79e78bd1166 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.copy2to1.que +++ b/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.copy2to1.que @@ -1,4 +1,5 @@ "file1.txt" "file10.txt" +"file3.txt" "file5.txt..path2" "file6.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/test.log b/cmd/bisync/testdata/test_dry_run/golden/test.log index 13bd9654aa21d..3d749965bc247 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/test.log +++ b/cmd/bisync/testdata/test_dry_run/golden/test.log @@ -106,15 +106,13 @@ INFO : - Path1 Queue delete - {path1/}file3.txt INFO : - Path2 Do queued copies to - Path1 NOTICE: file1.txt: Skipped copy as --dry-run is set (size 19) NOTICE: file10.txt: Skipped copy as --dry-run is set (size 19) +NOTICE: file3.txt: Skipped delete as --dry-run is set (size 0) NOTICE: file6.txt: Skipped copy as --dry-run is set (size 19) INFO : - Path1 Do queued copies to - Path2 NOTICE: file11.txt: Skipped copy as --dry-run is set (size 19) NOTICE: file2.txt: Skipped copy as --dry-run is set (size 13) -NOTICE: file7.txt: Skipped copy as --dry-run is set (size 19) -INFO : - Do queued deletes on - Path1 -NOTICE: file3.txt: Skipped delete as --dry-run is set (size 0) -INFO : - Do queued deletes on - Path2 NOTICE: file4.txt: Skipped delete as --dry-run is set (size 0) +NOTICE: file7.txt: Skipped copy as --dry-run is set (size 19) INFO : Updating listings INFO : Bisync successful (32) : copy-listings dryrun @@ -159,8 +157,6 @@ INFO : - Path2 Queue copy to Path1 - {path1/}file10.txt INFO : - Path1 Queue delete - {path1/}file3.txt INFO : - Path2 Do queued copies to - Path1 INFO : - Path1 Do queued copies to - Path2 -INFO : - Do queued deletes on - Path1 -INFO : - Do queued deletes on - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.copy2to1.que b/cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.copy2to1.que index eece110c1b926..5c39d3955d4ca 100644 --- a/cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.copy2to1.que +++ b/cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.copy2to1.que @@ -1,7 +1,9 @@ "New_top_level_mañana_funcionará.txt" "file_enconde_mañana_funcionará.txt" +"filename_contains_ࢺ_.txt" "subdir with␊white space.txt/file2 with␊white space.txt" "subdir_rawchars_␙_\x81_\xfe/file3_␙_\x81_\xfe" "subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path2" +"subdir_with_ࢺ_/filename_contains_ě_.txt" "subdir_with_ࢺ_/filename_contains_ࢺ_p2s.txt" "Русский.txt" diff --git a/cmd/bisync/testdata/test_extended_filenames/golden/test.log b/cmd/bisync/testdata/test_extended_filenames/golden/test.log index 5a7f6412ac9b6..d1db495d9731f 100644 --- a/cmd/bisync/testdata/test_extended_filenames/golden/test.log +++ b/cmd/bisync/testdata/test_extended_filenames/golden/test.log @@ -84,7 +84,6 @@ INFO : - Path1 Queue delete - {path1/}subdir_with_ࢺ INFO : - Path2 Queue copy to Path1 - {path1/}subdir_with_ࢺ_/filename_contains_ࢺ_p2s.txt INFO : - Path2 Do queued copies to - Path1 INFO : - Path1 Do queued copies to - Path2 -INFO : - Do queued deletes on - Path1 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_max_delete_path1/golden/_testdir_path1.._testdir_path2.copy1to2.que b/cmd/bisync/testdata/test_max_delete_path1/golden/_testdir_path1.._testdir_path2.copy1to2.que new file mode 100644 index 0000000000000..9c041c2baa656 --- /dev/null +++ b/cmd/bisync/testdata/test_max_delete_path1/golden/_testdir_path1.._testdir_path2.copy1to2.que @@ -0,0 +1,5 @@ +"file1.txt" +"file2.txt" +"file3.txt" +"file4.txt" +"file5.txt" diff --git a/cmd/bisync/testdata/test_max_delete_path1/golden/test.log b/cmd/bisync/testdata/test_max_delete_path1/golden/test.log index c7c20821160f3..7d83e9150961d 100644 --- a/cmd/bisync/testdata/test_max_delete_path1/golden/test.log +++ b/cmd/bisync/testdata/test_max_delete_path1/golden/test.log @@ -49,7 +49,7 @@ INFO : - Path2 Queue delete - {path2/}file2.txt INFO : - Path2 Queue delete - {path2/}file3.txt INFO : - Path2 Queue delete - {path2/}file4.txt INFO : - Path2 Queue delete - {path2/}file5.txt -INFO : - Do queued deletes on - Path2 +INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_max_delete_path2_force/golden/_testdir_path1.._testdir_path2.copy2to1.que b/cmd/bisync/testdata/test_max_delete_path2_force/golden/_testdir_path1.._testdir_path2.copy2to1.que new file mode 100644 index 0000000000000..9c041c2baa656 --- /dev/null +++ b/cmd/bisync/testdata/test_max_delete_path2_force/golden/_testdir_path1.._testdir_path2.copy2to1.que @@ -0,0 +1,5 @@ +"file1.txt" +"file2.txt" +"file3.txt" +"file4.txt" +"file5.txt" diff --git a/cmd/bisync/testdata/test_max_delete_path2_force/golden/test.log b/cmd/bisync/testdata/test_max_delete_path2_force/golden/test.log index 58da0c3a30081..23cc350c4a3fa 100644 --- a/cmd/bisync/testdata/test_max_delete_path2_force/golden/test.log +++ b/cmd/bisync/testdata/test_max_delete_path2_force/golden/test.log @@ -49,7 +49,7 @@ INFO : - Path1 Queue delete - {path1/}file2.txt INFO : - Path1 Queue delete - {path1/}file3.txt INFO : - Path1 Queue delete - {path1/}file4.txt INFO : - Path1 Queue delete - {path1/}file5.txt -INFO : - Do queued deletes on - Path1 +INFO : - Path2 Do queued copies to - Path1 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_rmdirs/golden/_testdir_path1.._testdir_path2.copy1to2.que b/cmd/bisync/testdata/test_rmdirs/golden/_testdir_path1.._testdir_path2.copy1to2.que new file mode 100644 index 0000000000000..a49deb16cb659 --- /dev/null +++ b/cmd/bisync/testdata/test_rmdirs/golden/_testdir_path1.._testdir_path2.copy1to2.que @@ -0,0 +1 @@ +"subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_rmdirs/golden/test.log b/cmd/bisync/testdata/test_rmdirs/golden/test.log index 936af897bd13f..b770c2482b42b 100644 --- a/cmd/bisync/testdata/test_rmdirs/golden/test.log +++ b/cmd/bisync/testdata/test_rmdirs/golden/test.log @@ -21,7 +21,7 @@ INFO : Path1: 1 changes: 0 new, 0 newer, 0 older, 1 deleted INFO : Path2 checking for diffs INFO : Applying changes INFO : - Path2 Queue delete - {path2/}subdir/file20.txt -INFO : - Do queued deletes on - Path2 +INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" INFO : Bisync successful diff --git a/docs/content/bisync.md b/docs/content/bisync.md index be03f8cb83757..94dc815e311eb 100644 --- a/docs/content/bisync.md +++ b/docs/content/bisync.md @@ -552,11 +552,17 @@ and use `--resync` when you need to switch. ### Renamed directories -Renaming a folder on the Path1 side results in deleting all files on +By default, renaming a folder on the Path1 side results in deleting all files on the Path2 side and then copying all files again from Path1 to Path2. Bisync sees this as all files in the old directory name as deleted and all files in the new directory name as new. -Currently, the most effective and efficient method of renaming a directory + +A recommended solution is to use [`--track-renames`](/docs/#track-renames), +which is now supported in bisync as of `rclone v1.65`. +Note that `--track-renames` is not available during `--resync`, +as `--resync` does not delete anything (`--track-renames` only supports `sync`, not `copy`.) + +Otherwise, the most effective and efficient method of renaming a directory is to rename it to the same name on both sides. (As of `rclone v1.64`, a `--resync` is no longer required after doing so, as bisync will automatically detect that Path1 and Path2 are in agreement.) @@ -1263,6 +1269,10 @@ about _Unison_ and synchronization in general. ## Changelog +### `v1.65` +* Copies and deletes are now handled in one operation instead of two +* `--track-renames` and `--backup-dir` are now supported + ### `v1.64` * Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Dry%20runs%20are%20not%20completely%20dry) causing dry runs to inadvertently commit filter changes From 932f9ec34aa60a0a7b5ad811ed157da2b98c1508 Mon Sep 17 00:00:00 2001 From: nielash Date: Wed, 8 Nov 2023 01:12:22 -0500 Subject: [PATCH 106/130] bisync: document support for atomic uploads --- docs/content/bisync.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/content/bisync.md b/docs/content/bisync.md index 94dc815e311eb..44bfc58c813b2 100644 --- a/docs/content/bisync.md +++ b/docs/content/bisync.md @@ -488,11 +488,11 @@ This limitation will be lifted in a future `rclone bisync` release. ### Concurrent modifications -When using **Local, FTP or SFTP** remotes rclone does not create _temporary_ +When using **Local, FTP or SFTP** remotes with [`--inplace`](/docs/#inplace), rclone does not create _temporary_ files at the destination when copying, and thus if the connection is lost the created file may be corrupt, which will likely propagate back to the original path on the next sync, resulting in data loss. -This will be solved in a future release, there is no workaround at the moment. +It is therefore recommended to _omit_ `--inplace`. Files that **change during** a bisync run may result in data loss. This has been seen in a highly dynamic environment, where the filesystem @@ -1272,6 +1272,7 @@ about _Unison_ and synchronization in general. ### `v1.65` * Copies and deletes are now handled in one operation instead of two * `--track-renames` and `--backup-dir` are now supported +* Partial uploads known issue on `local`/`ftp`/`sftp` has been resolved (unless using `--inplace`) ### `v1.64` * Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Dry%20runs%20are%20not%20completely%20dry) From c0968a0987e15027513ff6fe1728c9e61245a154 Mon Sep 17 00:00:00 2001 From: nielash Date: Sun, 1 Oct 2023 05:02:56 -0400 Subject: [PATCH 107/130] operations: add logger to log list of sync results -- fixes #7282 Logger instruments the Sync routine with a status report for each file pair, making it possible to output a list of the synced files, along with their attributes and sigil categorization (match/differ/missing/etc.) It is very customizable by passing in a custom LoggerFn, options, and io.Writers to be written to. Possible uses include: - allow sync to write path lists to a file, in the same format as rclone check - allow sync to output a --dest-after file using the same format flags as lsf - receive results as JSON when calling sync from an internal function - predict the post-sync state of the destination For usage examples, see bisync.WriteResults() or sync.SyncLoggerFn() --- fs/operations/check.go | 4 +- fs/operations/logger.go | 369 ++++++++++++++++++++++++++++++++++++ fs/operations/operations.go | 52 ++++- fs/sync/sync.go | 52 ++++- fs/sync/sync_test.go | 323 +++++++++++++++++++++++++++++++ go.mod | 1 + go.sum | 1 + 7 files changed, 791 insertions(+), 11 deletions(-) create mode 100644 fs/operations/logger.go diff --git a/fs/operations/check.go b/fs/operations/check.go index 239b3a72f01f6..328be21285cd9 100644 --- a/fs/operations/check.go +++ b/fs/operations/check.go @@ -67,10 +67,10 @@ func (c *checkMarch) report(o fs.DirEntry, out io.Writer, sigil rune) { func (c *checkMarch) reportFilename(filename string, out io.Writer, sigil rune) { if out != nil { - syncFprintf(out, "%s\n", filename) + SyncFprintf(out, "%s\n", filename) } if c.opt.Combined != nil { - syncFprintf(c.opt.Combined, "%c %s\n", sigil, filename) + SyncFprintf(c.opt.Combined, "%c %s\n", sigil, filename) } } diff --git a/fs/operations/logger.go b/fs/operations/logger.go new file mode 100644 index 0000000000000..9d0e213b40d6a --- /dev/null +++ b/fs/operations/logger.go @@ -0,0 +1,369 @@ +package operations + +import ( + "bytes" + "context" + "errors" + "fmt" + "io" + + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/config/flags" + "github.com/rclone/rclone/fs/hash" + "github.com/spf13/pflag" +) + +// Sigil represents the rune (-+=*!?) used by Logger to categorize files by their match/differ/missing status. +type Sigil rune + +// String converts sigil to more human-readable string +func (sigil Sigil) String() string { + switch sigil { + case '-': + return "MissingOnSrc" + case '+': + return "MissingOnDst" + case '=': + return "Match" + case '*': + return "Differ" + case '!': + return "Error" + // case '.': + // return "Completed" + case '?': + return "Other" + } + return "unknown" +} + +// Writer directs traffic from sigil -> LoggerOpt.Writer +func (sigil Sigil) Writer(opt LoggerOpt) io.Writer { + switch sigil { + case '-': + return opt.MissingOnSrc + case '+': + return opt.MissingOnDst + case '=': + return opt.Match + case '*': + return opt.Differ + case '!': + return opt.Error + } + return nil +} + +// Sigil constants +const ( + MissingOnSrc Sigil = '-' + MissingOnDst Sigil = '+' + Match Sigil = '=' + Differ Sigil = '*' + TransferError Sigil = '!' + Other Sigil = '?' // reserved but not currently used +) + +// LoggerFn uses fs.DirEntry instead of fs.Object so it can include Dirs +// For LoggerFn example, see bisync.WriteResults() or sync.SyncLoggerFn() +// Usage example: s.logger(ctx, operations.Differ, src, dst, nil) +type LoggerFn func(ctx context.Context, sigil Sigil, src, dst fs.DirEntry, err error) +type loggerContextKey struct{} +type loggerOptContextKey struct{} + +var loggerKey = loggerContextKey{} +var loggerOptKey = loggerOptContextKey{} + +// LoggerOpt contains options for the Sync Logger functions +// TODO: refactor Check in here too? +type LoggerOpt struct { + // Fdst, Fsrc fs.Fs // fses to check + // Check checkFn // function to use for checking + // OneWay bool // one way only? + LoggerFn LoggerFn // function to use for logging + Combined io.Writer // a file with file names with leading sigils + MissingOnSrc io.Writer // files only in the destination + MissingOnDst io.Writer // files only in the source + Match io.Writer // matching files + Differ io.Writer // differing files + Error io.Writer // files with errors of some kind + DestAfter io.Writer // files that exist on the destination post-sync + JSON *bytes.Buffer // used by bisync to read/write struct as JSON + DeleteModeOff bool //affects whether Logger expects MissingOnSrc to be deleted + + // lsf options for destAfter + ListFormat ListFormat + JSONOpt ListJSONOpt + LJ *listJSON + Format string + TimeFormat string + Separator string + DirSlash bool + // Recurse bool + HashType hash.Type + FilesOnly bool + DirsOnly bool + Csv bool + Absolute bool +} + +// AddLoggerFlags adds the logger flags to the cmdFlags command +func AddLoggerFlags(cmdFlags *pflag.FlagSet, opt *LoggerOpt, combined, missingOnSrc, missingOnDst, match, differ, errFile, destAfter *string) { + flags.StringVarP(cmdFlags, combined, "combined", "", *combined, "Make a combined report of changes to this file", "Sync") + flags.StringVarP(cmdFlags, missingOnSrc, "missing-on-src", "", *missingOnSrc, "Report all files missing from the source to this file", "Sync") + flags.StringVarP(cmdFlags, missingOnDst, "missing-on-dst", "", *missingOnDst, "Report all files missing from the destination to this file", "Sync") + flags.StringVarP(cmdFlags, match, "match", "", *match, "Report all matching files to this file", "Sync") + flags.StringVarP(cmdFlags, differ, "differ", "", *differ, "Report all non-matching files to this file", "Sync") + flags.StringVarP(cmdFlags, errFile, "error", "", *errFile, "Report all files with errors (hashing or reading) to this file", "Sync") + flags.StringVarP(cmdFlags, destAfter, "dest-after", "", *destAfter, "Report all files that exist on the dest post-sync", "Sync") + + // lsf flags for destAfter + flags.StringVarP(cmdFlags, &opt.Format, "format", "F", "p", "Output format - see lsf help for details", "Sync") + flags.StringVarP(cmdFlags, &opt.Separator, "separator", "s", ";", "Separator for the items in the format", "Sync") + flags.BoolVarP(cmdFlags, &opt.DirSlash, "dir-slash", "d", true, "Append a slash to directory names", "Sync") + flags.FVarP(cmdFlags, &opt.HashType, "hash", "", "Use this hash when `h` is used in the format MD5|SHA-1|DropboxHash", "Sync") + flags.BoolVarP(cmdFlags, &opt.FilesOnly, "files-only", "", true, "Only list files", "Sync") + flags.BoolVarP(cmdFlags, &opt.DirsOnly, "dirs-only", "", false, "Only list directories", "Sync") + flags.BoolVarP(cmdFlags, &opt.Csv, "csv", "", false, "Output in CSV format", "Sync") + flags.BoolVarP(cmdFlags, &opt.Absolute, "absolute", "", false, "Put a leading / in front of path names", "Sync") + // flags.BoolVarP(cmdFlags, &recurse, "recursive", "R", false, "Recurse into the listing", "") +} + +// WithLogger stores logger in ctx and returns a copy of ctx in which loggerKey = logger +func WithLogger(ctx context.Context, logger LoggerFn) context.Context { + return context.WithValue(ctx, loggerKey, logger) +} + +// WithLoggerOpt stores loggerOpt in ctx and returns a copy of ctx in which loggerOptKey = loggerOpt +func WithLoggerOpt(ctx context.Context, loggerOpt LoggerOpt) context.Context { + return context.WithValue(ctx, loggerOptKey, loggerOpt) +} + +// GetLogger attempts to retrieve LoggerFn from context, returns it if found, otherwise returns no-op function +func GetLogger(ctx context.Context) (LoggerFn, bool) { + logger, ok := ctx.Value(loggerKey).(LoggerFn) + if !ok { + logger = func(ctx context.Context, sigil Sigil, src, dst fs.DirEntry, err error) {} + } + return logger, ok +} + +// GetLoggerOpt attempts to retrieve LoggerOpt from context, returns it if found, otherwise returns NewLoggerOpt() +func GetLoggerOpt(ctx context.Context) LoggerOpt { + loggerOpt, ok := ctx.Value(loggerOptKey).(LoggerOpt) + if ok { + return loggerOpt + } + return NewLoggerOpt() +} + +// WithSyncLogger starts a new logger with the options passed in and saves it to ctx for retrieval later +func WithSyncLogger(ctx context.Context, opt LoggerOpt) context.Context { + ctx = WithLoggerOpt(ctx, opt) + return WithLogger(ctx, func(ctx context.Context, sigil Sigil, src, dst fs.DirEntry, err error) { + if opt.LoggerFn != nil { + opt.LoggerFn(ctx, sigil, src, dst, err) + } else { + SyncFprintf(opt.Combined, "%c %s\n", sigil, dst.Remote()) + } + }) +} + +// NewLoggerOpt returns a new LoggerOpt struct with defaults +func NewLoggerOpt() LoggerOpt { + opt := LoggerOpt{ + Combined: new(bytes.Buffer), + MissingOnSrc: new(bytes.Buffer), + MissingOnDst: new(bytes.Buffer), + Match: new(bytes.Buffer), + Differ: new(bytes.Buffer), + Error: new(bytes.Buffer), + DestAfter: new(bytes.Buffer), + JSON: new(bytes.Buffer), + } + return opt +} + +// Winner predicts which side (src or dst) should end up winning out on the dst. +type Winner struct { + Obj fs.DirEntry // the object that should exist on dst post-sync, if any + Side string // whether the winning object was from the src or dst + Err error // whether there's an error preventing us from predicting winner correctly (not whether there was a sync error more generally) +} + +// WinningSide can be called in a LoggerFn to predict what the dest will look like post-sync +// +// This attempts to account for every case in which dst (intentionally) does not match src after a sync. +// +// Known issues / cases we can't confidently predict yet: +// +// --max-duration / CutoffModeHard +// --compare-dest / --copy-dest (because equal() is called multiple times for the same file) +// server-side moves of an entire dir at once (because we never get the individual file objects in the dir) +// High-level retries, because there would be dupes (use --retries 1 to disable) +// Possibly some error scenarios +func WinningSide(ctx context.Context, sigil Sigil, src, dst fs.DirEntry, err error) Winner { + winner := Winner{nil, "none", nil} + opt := GetLoggerOpt(ctx) + ci := fs.GetConfig(ctx) + + if err == fs.ErrorIsDir { + winner.Err = err + if sigil == MissingOnSrc { + if (opt.DeleteModeOff || ci.DryRun) && dst != nil { + winner.Obj = dst + winner.Side = "dst" // whatever's on dst will remain so after DryRun + return winner + } + return winner // none, because dst should just get deleted + } + if sigil == MissingOnDst && ci.DryRun { + return winner // none, because it does not currently exist on dst, and will still not exist after DryRun + } else if ci.DryRun && dst != nil { + winner.Obj = dst + winner.Side = "dst" + } else if src != nil { + winner.Obj = src + winner.Side = "src" + } + return winner + } + + _, srcOk := src.(fs.Object) + _, dstOk := dst.(fs.Object) + if !srcOk && !dstOk { + return winner // none, because we don't have enough info to continue. + } + + switch sigil { + case MissingOnSrc: + if opt.DeleteModeOff || ci.DryRun { // i.e. it's a copy, not sync (or it's a DryRun) + winner.Obj = dst + winner.Side = "dst" // whatever's on dst will remain so after DryRun + return winner + } + return winner // none, because dst should just get deleted + case Match, Differ, MissingOnDst: + if sigil == MissingOnDst && ci.DryRun { + return winner // none, because it does not currently exist on dst, and will still not exist after DryRun + } + winner.Obj = src + winner.Side = "src" // presume dst will end up matching src unless changed below + if sigil == Match && (ci.SizeOnly || ci.CheckSum || ci.IgnoreSize || ci.UpdateOlder || ci.NoUpdateModTime) { + winner.Obj = dst + winner.Side = "dst" // ignore any differences with src because of user flags + } + if ci.IgnoreTimes { + winner.Obj = src + winner.Side = "src" // copy src to dst unconditionally + } + if (sigil == Match || sigil == Differ) && (ci.IgnoreExisting || ci.Immutable) { + winner.Obj = dst + winner.Side = "dst" // dst should remain unchanged if it already exists (and we know it does because it's Match or Differ) + } + if ci.DryRun { + winner.Obj = dst + winner.Side = "dst" // dst should remain unchanged after DryRun (note that we handled MissingOnDst earlier) + } + return winner + case TransferError: + winner.Obj = dst + winner.Side = "dst" // usually, dst should not change if there's an error + if dst == nil { + winner.Obj = src + winner.Side = "src" // but if for some reason we have a src and not a dst, go with it + } + if winner.Obj != nil { + if errors.Is(err, context.DeadlineExceeded) || errors.Is(err, errors.New("max transfer duration reached as set by --max-duration")) { + winner.Err = err // we can't confidently predict what survives if CutoffModeHard + } + return winner // we know at least one of the objects + } + } + // should only make it this far if it's TransferError and both src and dst are nil + winner.Side = "none" + winner.Err = fmt.Errorf("unknown case -- can't determine winner. %v", err) + fs.Debugf(winner.Obj, "%v", winner.Err) + return winner +} + +// SetListFormat sets opt.ListFormat for destAfter +// TODO: possibly refactor duplicate code from cmd/lsf, where this is mostly copied from +func (opt *LoggerOpt) SetListFormat(ctx context.Context, cmdFlags *pflag.FlagSet) { + // Work out if the separatorFlag was supplied or not + separatorFlag := cmdFlags.Lookup("separator") + separatorFlagSupplied := separatorFlag != nil && separatorFlag.Changed + // Default the separator to , if using CSV + if opt.Csv && !separatorFlagSupplied { + opt.Separator = "," + } + + var list ListFormat + list.SetSeparator(opt.Separator) + list.SetCSV(opt.Csv) + list.SetDirSlash(opt.DirSlash) + list.SetAbsolute(opt.Absolute) + var JSONOpt = ListJSONOpt{ + NoModTime: true, + NoMimeType: true, + DirsOnly: opt.DirsOnly, + FilesOnly: opt.FilesOnly, + // Recurse: opt.Recurse, + } + + for _, char := range opt.Format { + switch char { + case 'p': + list.AddPath() + case 't': + list.AddModTime(opt.TimeFormat) + JSONOpt.NoModTime = false + case 's': + list.AddSize() + case 'h': + list.AddHash(opt.HashType) + JSONOpt.ShowHash = true + JSONOpt.HashTypes = []string{opt.HashType.String()} + case 'i': + list.AddID() + case 'm': + list.AddMimeType() + JSONOpt.NoMimeType = false + case 'e': + list.AddEncrypted() + JSONOpt.ShowEncrypted = true + case 'o': + list.AddOrigID() + JSONOpt.ShowOrigIDs = true + case 'T': + list.AddTier() + case 'M': + list.AddMetadata() + JSONOpt.Metadata = true + default: + fs.Errorf(nil, "unknown format character %q", char) + } + } + opt.ListFormat = list + opt.JSONOpt = JSONOpt +} + +// NewListJSON makes a new *listJSON for destAfter +func (opt *LoggerOpt) NewListJSON(ctx context.Context, fdst fs.Fs, remote string) { + opt.LJ, _ = newListJSON(ctx, fdst, remote, &opt.JSONOpt) + fs.Debugf(nil, "%v", opt.LJ) +} + +// JSONEntry returns a *ListJSONItem for destAfter +func (opt *LoggerOpt) JSONEntry(ctx context.Context, entry fs.DirEntry) (*ListJSONItem, error) { + return opt.LJ.entry(ctx, entry) +} + +// PrintDestAfter writes a *ListJSONItem to opt.DestAfter +func (opt *LoggerOpt) PrintDestAfter(ctx context.Context, sigil Sigil, src, dst fs.DirEntry, err error) { + entry := WinningSide(ctx, sigil, src, dst, err) + if entry.Obj != nil { + JSONEntry, _ := opt.JSONEntry(ctx, entry.Obj) + _, _ = fmt.Fprintln(opt.DestAfter, opt.ListFormat.Format(JSONEntry)) + } +} diff --git a/fs/operations/operations.go b/fs/operations/operations.go index d426c673c9f10..efa3d4babfb4e 100644 --- a/fs/operations/operations.go +++ b/fs/operations/operations.go @@ -180,12 +180,15 @@ func logModTimeUpload(dst fs.Object) { func equal(ctx context.Context, src fs.ObjectInfo, dst fs.Object, opt equalOpt) bool { ci := fs.GetConfig(ctx) + logger, _ := GetLogger(ctx) if sizeDiffers(ctx, src, dst) { fs.Debugf(src, "Sizes differ (src %d vs dst %d)", src.Size(), dst.Size()) + logger(ctx, Differ, src, dst, nil) return false } if opt.sizeOnly { fs.Debugf(src, "Sizes identical") + logger(ctx, Match, src, dst, nil) return true } @@ -197,6 +200,7 @@ func equal(ctx context.Context, src fs.ObjectInfo, dst fs.Object, opt equalOpt) same, ht, _ := CheckHashes(ctx, src, dst) if !same { fs.Debugf(src, "%v differ", ht) + logger(ctx, Differ, src, dst, nil) return false } if ht == hash.None { @@ -210,6 +214,7 @@ func equal(ctx context.Context, src fs.ObjectInfo, dst fs.Object, opt equalOpt) } else { fs.Debugf(src, "Size and %v of src and dst objects identical", ht) } + logger(ctx, Match, src, dst, nil) return true } @@ -219,12 +224,14 @@ func equal(ctx context.Context, src fs.ObjectInfo, dst fs.Object, opt equalOpt) modifyWindow := fs.GetModifyWindow(ctx, src.Fs(), dst.Fs()) if modifyWindow == fs.ModTimeNotSupported { fs.Debugf(src, "Sizes identical") + logger(ctx, Match, src, dst, nil) return true } dstModTime := dst.ModTime(ctx) dt := dstModTime.Sub(srcModTime) if dt < modifyWindow && dt > -modifyWindow { fs.Debugf(src, "Size and modification time the same (differ by %s, within tolerance %s)", dt, modifyWindow) + logger(ctx, Match, src, dst, nil) return true } @@ -235,10 +242,12 @@ func equal(ctx context.Context, src fs.ObjectInfo, dst fs.Object, opt equalOpt) same, ht, _ := CheckHashes(ctx, src, dst) if !same { fs.Debugf(src, "%v differ", ht) + logger(ctx, Differ, src, dst, nil) return false } if ht == hash.None && !ci.RefreshTimes { // if couldn't check hash, return that they differ + logger(ctx, Differ, src, dst, nil) return false } @@ -249,6 +258,7 @@ func equal(ctx context.Context, src fs.ObjectInfo, dst fs.Object, opt equalOpt) // Error if objects are treated as immutable if ci.Immutable { fs.Errorf(dst, "Timestamp mismatch between immutable objects") + logger(ctx, Differ, src, dst, nil) return false } // Update the mtime of the dst object here @@ -256,6 +266,7 @@ func equal(ctx context.Context, src fs.ObjectInfo, dst fs.Object, opt equalOpt) if errors.Is(err, fs.ErrorCantSetModTime) { logModTimeUpload(dst) fs.Infof(dst, "src and dst identical but can't set mod time without re-uploading") + logger(ctx, Differ, src, dst, nil) return false } else if errors.Is(err, fs.ErrorCantSetModTimeWithoutDelete) { logModTimeUpload(dst) @@ -268,6 +279,7 @@ func equal(ctx context.Context, src fs.ObjectInfo, dst fs.Object, opt equalOpt) fs.Errorf(dst, "failed to delete before re-upload: %v", err) } } + logger(ctx, Differ, src, dst, nil) return false } else if err != nil { err = fs.CountError(err) @@ -277,6 +289,7 @@ func equal(ctx context.Context, src fs.ObjectInfo, dst fs.Object, opt equalOpt) } } } + logger(ctx, Match, src, dst, nil) return true } @@ -513,6 +526,8 @@ func DeleteFilesWithBackupDir(ctx context.Context, toBeDeleted fs.ObjectsChan, b err := DeleteFileWithBackupDir(ctx, dst, backupDir) if err != nil { errorCount.Add(1) + logger, _ := GetLogger(ctx) + logger(ctx, TransferError, nil, dst, err) if fserrors.IsFatalError(err) { fs.Errorf(dst, "Got fatal error on delete: %s", err) fatalErrorCount.Add(1) @@ -670,12 +685,12 @@ var SyncPrintf = func(format string, a ...interface{}) { fmt.Printf(format, a...) } -// Synchronized fmt.Fprintf +// SyncFprintf - Synchronized fmt.Fprintf // // Ignores errors from Fprintf. // // Prints to stdout if w is nil -func syncFprintf(w io.Writer, format string, a ...interface{}) { +func SyncFprintf(w io.Writer, format string, a ...interface{}) { if w == nil || w == os.Stdout { SyncPrintf(format, a...) } else { @@ -747,7 +762,7 @@ func CountStringField(count int64, humanReadable bool, rawWidth int) string { func List(ctx context.Context, f fs.Fs, w io.Writer) error { ci := fs.GetConfig(ctx) return ListFn(ctx, f, func(o fs.Object) { - syncFprintf(w, "%s %s\n", SizeStringField(o.Size(), ci.HumanReadable, 9), o.Remote()) + SyncFprintf(w, "%s %s\n", SizeStringField(o.Size(), ci.HumanReadable, 9), o.Remote()) }) } @@ -764,7 +779,7 @@ func ListLong(ctx context.Context, f fs.Fs, w io.Writer) error { tr.Done(ctx, nil) }() modTime := o.ModTime(ctx) - syncFprintf(w, "%s %s %s\n", SizeStringField(o.Size(), ci.HumanReadable, 9), modTime.Local().Format("2006-01-02 15:04:05.000000000"), o.Remote()) + SyncFprintf(w, "%s %s %s\n", SizeStringField(o.Size(), ci.HumanReadable, 9), modTime.Local().Format("2006-01-02 15:04:05.000000000"), o.Remote()) }) } @@ -864,7 +879,7 @@ func HashLister(ctx context.Context, ht hash.Type, outputBase64 bool, downloadFl fs.Errorf(o, "%v", fs.CountError(err)) return } - syncFprintf(w, "%*s %s\n", width, sum, o.Remote()) + SyncFprintf(w, "%*s %s\n", width, sum, o.Remote()) }() }) wg.Wait() @@ -889,7 +904,7 @@ func HashSumStream(ht hash.Type, outputBase64 bool, in io.ReadCloser, w io.Write return fmt.Errorf("hasher returned an error: %w", err) } width := hash.Width(ht, outputBase64) - syncFprintf(w, "%*s -\n", width, sum) + SyncFprintf(w, "%*s -\n", width, sum) return nil } @@ -925,7 +940,7 @@ func ListDir(ctx context.Context, f fs.Fs, w io.Writer) error { return walk.ListR(ctx, f, "", false, ConfigMaxDepth(ctx, false), walk.ListDirs, func(entries fs.DirEntries) error { entries.ForDir(func(dir fs.Directory) { if dir != nil { - syncFprintf(w, "%s %13s %s %s\n", SizeStringField(dir.Size(), ci.HumanReadable, 12), dir.ModTime(ctx).Local().Format("2006-01-02 15:04:05"), CountStringField(dir.Items(), ci.HumanReadable, 9), dir.Remote()) + SyncFprintf(w, "%s %13s %s %s\n", SizeStringField(dir.Size(), ci.HumanReadable, 12), dir.ModTime(ctx).Local().Format("2006-01-02 15:04:05"), CountStringField(dir.Items(), ci.HumanReadable, 9), dir.Remote()) } }) return nil @@ -1494,18 +1509,22 @@ func CompareOrCopyDest(ctx context.Context, fdst fs.Fs, dst, src fs.Object, Comp // transferred or not. func NeedTransfer(ctx context.Context, dst, src fs.Object) bool { ci := fs.GetConfig(ctx) + logger, _ := GetLogger(ctx) if dst == nil { fs.Debugf(src, "Need to transfer - File not found at Destination") + logger(ctx, MissingOnDst, src, nil, nil) return true } // If we should ignore existing files, don't transfer if ci.IgnoreExisting { fs.Debugf(src, "Destination exists, skipping") + logger(ctx, Match, src, dst, nil) return false } // If we should upload unconditionally if ci.IgnoreTimes { fs.Debugf(src, "Transferring unconditionally as --ignore-times is in use") + logger(ctx, Differ, src, dst, nil) return true } // If UpdateOlder is in effect, skip if dst is newer than src @@ -1524,6 +1543,7 @@ func NeedTransfer(ctx context.Context, dst, src fs.Object) bool { switch { case dt >= modifyWindow: fs.Debugf(src, "Destination is newer than source, skipping") + logger(ctx, Match, src, dst, nil) return false case dt <= -modifyWindow: // force --checksum on for the check and do update modtimes by default @@ -1707,10 +1727,16 @@ func MoveBackupDir(ctx context.Context, backupDir fs.Fs, dst fs.Object) (err err // moveOrCopyFile moves or copies a single file possibly to a new name func moveOrCopyFile(ctx context.Context, fdst fs.Fs, fsrc fs.Fs, dstFileName string, srcFileName string, cp bool) (err error) { ci := fs.GetConfig(ctx) + logger, usingLogger := GetLogger(ctx) dstFilePath := path.Join(fdst.Root(), dstFileName) srcFilePath := path.Join(fsrc.Root(), srcFileName) if fdst.Name() == fsrc.Name() && dstFilePath == srcFilePath { fs.Debugf(fdst, "don't need to copy/move %s, it is already at target location", dstFileName) + if usingLogger { + srcObj, _ := fsrc.NewObject(ctx, srcFileName) + dstObj, _ := fsrc.NewObject(ctx, dstFileName) + logger(ctx, Match, srcObj, dstObj, nil) + } return nil } @@ -1723,6 +1749,7 @@ func moveOrCopyFile(ctx context.Context, fdst fs.Fs, fsrc fs.Fs, dstFileName str // Find src object srcObj, err := fsrc.NewObject(ctx, srcFileName) if err != nil { + logger(ctx, TransferError, srcObj, nil, err) return err } @@ -1733,6 +1760,7 @@ func moveOrCopyFile(ctx context.Context, fdst fs.Fs, fsrc fs.Fs, dstFileName str if errors.Is(err, fs.ErrorObjectNotFound) { dstObj = nil } else if err != nil { + logger(ctx, TransferError, nil, dstObj, err) return err } } @@ -1744,11 +1772,13 @@ func moveOrCopyFile(ctx context.Context, fdst fs.Fs, fsrc fs.Fs, dstFileName str if !cp && fdst.Name() == fsrc.Name() && fdst.Features().CaseInsensitive && dstFileName != srcFileName && strings.EqualFold(dstFilePath, srcFilePath) { // Create random name to temporarily move file to tmpObjName := dstFileName + "-rclone-move-" + random.String(8) - _, err := fdst.NewObject(ctx, tmpObjName) + tmpObjFail, err := fdst.NewObject(ctx, tmpObjName) if err != fs.ErrorObjectNotFound { if err == nil { + logger(ctx, TransferError, nil, tmpObjFail, err) return errors.New("found an already existing file with a randomly generated name. Try the operation again") } + logger(ctx, TransferError, nil, tmpObjFail, err) return fmt.Errorf("error while attempting to move file to a temporary location: %w", err) } tr := accounting.Stats(ctx).NewTransfer(srcObj) @@ -1757,9 +1787,11 @@ func moveOrCopyFile(ctx context.Context, fdst fs.Fs, fsrc fs.Fs, dstFileName str }() tmpObj, err := Op(ctx, fdst, nil, tmpObjName, srcObj) if err != nil { + logger(ctx, TransferError, srcObj, tmpObj, err) return fmt.Errorf("error while moving file to temporary location: %w", err) } _, err = Op(ctx, fdst, nil, dstFileName, tmpObj) + logger(ctx, MissingOnDst, tmpObj, nil, err) return err } @@ -1797,9 +1829,11 @@ func moveOrCopyFile(ctx context.Context, fdst fs.Fs, fsrc fs.Fs, dstFileName str if dstObj != nil && backupDir != nil { err = MoveBackupDir(ctx, backupDir, dstObj) if err != nil { + logger(ctx, TransferError, dstObj, nil, err) return fmt.Errorf("moving to --backup-dir failed: %w", err) } // If successful zero out the dstObj as it is no longer there + logger(ctx, MissingOnDst, dstObj, nil, nil) dstObj = nil } @@ -1808,8 +1842,10 @@ func moveOrCopyFile(ctx context.Context, fdst fs.Fs, fsrc fs.Fs, dstFileName str if !cp { if ci.IgnoreExisting { fs.Debugf(srcObj, "Not removing source file as destination file exists and --ignore-existing is set") + logger(ctx, Match, srcObj, dstObj, nil) } else { err = DeleteFile(ctx, srcObj) + logger(ctx, Differ, srcObj, dstObj, nil) } } } diff --git a/fs/sync/sync.go b/fs/sync/sync.go index 18a8b67b774a8..9154171c51be1 100644 --- a/fs/sync/sync.go +++ b/fs/sync/sync.go @@ -82,6 +82,8 @@ type syncCopyMove struct { backupDir fs.Fs // place to store overwrites/deletes checkFirst bool // if set run all the checkers before starting transfers maxDurationEndTime time.Time // end time if --max-duration is set + logger operations.LoggerFn // LoggerFn used to report the results of a sync (or bisync) to an io.Writer + usingLogger bool // whether we are using logger } type trackRenamesStrategy byte @@ -135,6 +137,16 @@ func newSyncCopyMove(ctx context.Context, fdst, fsrc fs.Fs, deleteMode fs.Delete trackRenamesCh: make(chan fs.Object, ci.Checkers), checkFirst: ci.CheckFirst, } + + s.logger, s.usingLogger = operations.GetLogger(ctx) + + if deleteMode == fs.DeleteModeOff { + loggerOpt := operations.GetLoggerOpt(ctx) + loggerOpt.DeleteModeOff = true + loggerOpt.LoggerFn = s.logger + ctx = operations.WithLoggerOpt(ctx, loggerOpt) + } + backlog := ci.MaxBacklog if s.checkFirst { fs.Infof(s.fdst, "Running all checks before starting transfers") @@ -345,6 +357,7 @@ func (s *syncCopyMove) pairChecker(in *pipe, out *pipe, fraction int, wg *sync.W NoNeedTransfer, err := operations.CompareOrCopyDest(s.ctx, s.fdst, pair.Dst, pair.Src, s.compareCopyDest, s.backupDir) if err != nil { s.processError(err) + s.logger(s.ctx, operations.TransferError, pair.Src, pair.Dst, err) } if NoNeedTransfer { needTransfer = false @@ -362,6 +375,7 @@ func (s *syncCopyMove) pairChecker(in *pipe, out *pipe, fraction int, wg *sync.W err := operations.MoveBackupDir(s.ctx, s.backupDir, pair.Dst) if err != nil { s.processError(err) + s.logger(s.ctx, operations.TransferError, pair.Src, pair.Dst, err) } else { // If successful zero out the dst as it is no longer there and copy the file pair.Dst = nil @@ -394,7 +408,9 @@ func (s *syncCopyMove) pairChecker(in *pipe, out *pipe, fraction int, wg *sync.W return } } else { - s.processError(operations.DeleteFile(s.ctx, src)) + deleteFileErr := operations.DeleteFile(s.ctx, src) + s.processError(deleteFileErr) + s.logger(s.ctx, operations.TransferError, pair.Src, pair.Dst, deleteFileErr) } } } @@ -446,6 +462,9 @@ func (s *syncCopyMove) pairCopyOrMove(ctx context.Context, in *pipe, fdst fs.Fs, _, err = operations.Copy(ctx, fdst, dst, src.Remote(), src) } s.processError(err) + if err != nil { + s.logger(ctx, operations.TransferError, src, dst, err) + } } } @@ -556,6 +575,16 @@ func (s *syncCopyMove) stopDeleters() { func (s *syncCopyMove) deleteFiles(checkSrcMap bool) error { if accounting.Stats(s.ctx).Errored() && !s.ci.IgnoreErrors { fs.Errorf(s.fdst, "%v", fs.ErrorNotDeleting) + // log all deletes as errors + for remote, o := range s.dstFiles { + if checkSrcMap { + _, exists := s.srcFiles[remote] + if exists { + continue + } + } + s.logger(s.ctx, operations.TransferError, nil, o, fs.ErrorNotDeleting) + } return fs.ErrorNotDeleting } @@ -967,10 +996,23 @@ func (s *syncCopyMove) run() error { // DstOnly have an object which is in the destination only func (s *syncCopyMove) DstOnly(dst fs.DirEntry) (recurse bool) { if s.deleteMode == fs.DeleteModeOff { + if s.usingLogger { + switch x := dst.(type) { + case fs.Object: + s.logger(s.ctx, operations.MissingOnSrc, nil, x, nil) + case fs.Directory: + // it's a directory that we'd normally skip, because we're not deleting anything on the dest + // however, to make sure every file is logged, we need to list it, so we need to return true here. + // we skip this when not using logger. + s.logger(s.ctx, operations.MissingOnSrc, nil, dst, fs.ErrorIsDir) + return true + } + } return false } switch x := dst.(type) { case fs.Object: + s.logger(s.ctx, operations.MissingOnSrc, nil, x, nil) switch s.deleteMode { case fs.DeleteModeAfter: // record object as needs deleting @@ -992,6 +1034,7 @@ func (s *syncCopyMove) DstOnly(dst fs.DirEntry) (recurse bool) { if s.fdst.Features().CanHaveEmptyDirectories { s.dstEmptyDirsMu.Lock() s.dstEmptyDirs[dst.Remote()] = dst + s.logger(s.ctx, operations.MissingOnSrc, nil, dst, fs.ErrorIsDir) s.dstEmptyDirsMu.Unlock() } return true @@ -1009,6 +1052,7 @@ func (s *syncCopyMove) SrcOnly(src fs.DirEntry) (recurse bool) { } switch x := src.(type) { case fs.Object: + s.logger(s.ctx, operations.MissingOnDst, x, nil, nil) // If it's a copy operation, // remove parent directory from srcEmptyDirs // since it's not really empty @@ -1028,6 +1072,7 @@ func (s *syncCopyMove) SrcOnly(src fs.DirEntry) (recurse bool) { NoNeedTransfer, err := operations.CompareOrCopyDest(s.ctx, s.fdst, nil, x, s.compareCopyDest, s.backupDir) if err != nil { s.processError(err) + s.logger(s.ctx, operations.TransferError, x, nil, err) } if !NoNeedTransfer { // No need to check since doesn't exist @@ -1044,6 +1089,7 @@ func (s *syncCopyMove) SrcOnly(src fs.DirEntry) (recurse bool) { s.srcEmptyDirsMu.Lock() s.srcParentDirCheck(src) s.srcEmptyDirs[src.Remote()] = src + s.logger(s.ctx, operations.MissingOnDst, src, nil, fs.ErrorIsDir) s.srcEmptyDirsMu.Unlock() return true default: @@ -1065,6 +1111,7 @@ func (s *syncCopyMove) Match(ctx context.Context, dst, src fs.DirEntry) (recurse } dstX, ok := dst.(fs.Object) if ok { + // No logger here because we'll handle it in equal() ok = s.toBeChecked.Put(s.inCtx, fs.ObjectPair{Src: srcX, Dst: dstX}) if !ok { return false @@ -1074,11 +1121,13 @@ func (s *syncCopyMove) Match(ctx context.Context, dst, src fs.DirEntry) (recurse err := errors.New("can't overwrite directory with file") fs.Errorf(dst, "%v", err) s.processError(err) + s.logger(ctx, operations.TransferError, srcX, dstX, err) } case fs.Directory: // Do the same thing to the entire contents of the directory _, ok := dst.(fs.Directory) if ok { + s.logger(s.ctx, operations.Match, src, dst, fs.ErrorIsDir) // Only record matched (src & dst) empty dirs when performing move if s.DoMove { // Record the src directory for deletion @@ -1094,6 +1143,7 @@ func (s *syncCopyMove) Match(ctx context.Context, dst, src fs.DirEntry) (recurse err := errors.New("can't overwrite file with directory") fs.Errorf(dst, "%v", err) s.processError(err) + s.logger(ctx, operations.TransferError, src.(fs.ObjectInfo), dst.(fs.ObjectInfo), err) default: panic("Bad object in DirEntries") } diff --git a/fs/sync/sync_test.go b/fs/sync/sync_test.go index f24a783ed0a7a..e757af77ccee8 100644 --- a/fs/sync/sync_test.go +++ b/fs/sync/sync_test.go @@ -3,14 +3,20 @@ package sync import ( + "bytes" "context" "errors" "fmt" + "os" + "os/exec" "runtime" + "sort" "strings" "testing" "time" + mutex "sync" // renamed as "sync" already in use + _ "github.com/rclone/rclone/backend/all" // import all backends "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/accounting" @@ -45,7 +51,9 @@ func TestCopyWithDryRun(t *testing.T) { r.Mkdir(ctx, r.Fremote) ci.DryRun = true + ctx = predictDstFromLogger(ctx) err := CopyDir(ctx, r.Fremote, r.Flocal, false) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) // error expected here because dry-run require.NoError(t, err) r.CheckLocalItems(t, file1) @@ -59,8 +67,10 @@ func TestCopy(t *testing.T) { file1 := r.WriteFile("sub dir/hello world", "hello world", t1) r.Mkdir(ctx, r.Fremote) + ctx = predictDstFromLogger(ctx) err := CopyDir(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalItems(t, file1) r.CheckRemoteItems(t, file1) @@ -76,8 +86,10 @@ func TestCopyMissingDirectory(t *testing.T) { t.Fatal(err) } + ctx = predictDstFromLogger(ctx) err = CopyDir(ctx, r.Fremote, nonExistingFs, false) require.Error(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) } // Now with --no-traverse @@ -90,8 +102,10 @@ func TestCopyNoTraverse(t *testing.T) { file1 := r.WriteFile("sub dir/hello world", "hello world", t1) + ctx = predictDstFromLogger(ctx) err := CopyDir(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalItems(t, file1) r.CheckRemoteItems(t, file1) @@ -107,8 +121,10 @@ func TestCopyCheckFirst(t *testing.T) { file1 := r.WriteFile("sub dir/hello world", "hello world", t1) + ctx = predictDstFromLogger(ctx) err := CopyDir(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalItems(t, file1) r.CheckRemoteItems(t, file1) @@ -125,8 +141,10 @@ func TestSyncNoTraverse(t *testing.T) { file1 := r.WriteFile("sub dir/hello world", "hello world", t1) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err := Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalItems(t, file1) r.CheckRemoteItems(t, file1) @@ -143,8 +161,10 @@ func TestCopyWithDepth(t *testing.T) { // Check the MaxDepth too ci.MaxDepth = 1 + ctx = predictDstFromLogger(ctx) err := CopyDir(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalItems(t, file1, file2) r.CheckRemoteItems(t, file2) @@ -169,8 +189,10 @@ func testCopyWithFilesFrom(t *testing.T, noTraverse bool) { ci.NoTraverse = noTraverse + ctx = predictDstFromLogger(ctx) err = CopyDir(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalItems(t, file1, file2) r.CheckRemoteItems(t, file1) @@ -187,8 +209,10 @@ func TestCopyEmptyDirectories(t *testing.T) { require.NoError(t, err) r.Mkdir(ctx, r.Fremote) + ctx = predictDstFromLogger(ctx) err = CopyDir(ctx, r.Fremote, r.Flocal, true) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckRemoteListing( t, @@ -211,8 +235,10 @@ func TestMoveEmptyDirectories(t *testing.T) { require.NoError(t, err) r.Mkdir(ctx, r.Fremote) + ctx = predictDstFromLogger(ctx) err = MoveDir(ctx, r.Fremote, r.Flocal, false, true) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckRemoteListing( t, @@ -235,8 +261,10 @@ func TestSyncEmptyDirectories(t *testing.T) { require.NoError(t, err) r.Mkdir(ctx, r.Fremote) + ctx = predictDstFromLogger(ctx) err = Sync(ctx, r.Fremote, r.Flocal, true) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckRemoteListing( t, @@ -262,8 +290,10 @@ func TestServerSideCopy(t *testing.T) { defer finaliseCopy() t.Logf("Server side copy (if possible) %v -> %v", r.Fremote, FremoteCopy) + ctx = predictDstFromLogger(ctx) err = CopyDir(ctx, FremoteCopy, r.Fremote, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) fstest.CheckItems(t, FremoteCopy, file1) } @@ -280,8 +310,10 @@ func TestCopyAfterDelete(t *testing.T) { err := operations.Mkdir(ctx, r.Flocal, "") require.NoError(t, err) + ctx = predictDstFromLogger(ctx) err = CopyDir(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalItems(t) r.CheckRemoteItems(t, file1) @@ -294,8 +326,10 @@ func TestCopyRedownload(t *testing.T) { file1 := r.WriteObject(ctx, "sub dir/hello world", "hello world", t1) r.CheckRemoteItems(t, file1) + ctx = predictDstFromLogger(ctx) err := CopyDir(ctx, r.Flocal, r.Fremote, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) // Test with combined precision of local and remote as we copied it there and back r.CheckLocalListing(t, []fstest.Item{file1}, nil) @@ -314,8 +348,10 @@ func TestSyncBasedOnCheckSum(t *testing.T) { r.CheckLocalItems(t, file1) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err := Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) // We should have transferred exactly one file. assert.Equal(t, toyFileTransfers(r), accounting.GlobalStats().GetTransfers()) @@ -326,8 +362,10 @@ func TestSyncBasedOnCheckSum(t *testing.T) { r.CheckLocalItems(t, file2) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err = Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) // We should have transferred no files assert.Equal(t, int64(0), accounting.GlobalStats().GetTransfers()) @@ -348,8 +386,10 @@ func TestSyncSizeOnly(t *testing.T) { r.CheckLocalItems(t, file1) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err := Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) // We should have transferred exactly one file. assert.Equal(t, toyFileTransfers(r), accounting.GlobalStats().GetTransfers()) @@ -360,8 +400,10 @@ func TestSyncSizeOnly(t *testing.T) { r.CheckLocalItems(t, file2) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err = Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) // We should have transferred no files assert.Equal(t, int64(0), accounting.GlobalStats().GetTransfers()) @@ -382,8 +424,10 @@ func TestSyncIgnoreSize(t *testing.T) { r.CheckLocalItems(t, file1) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err := Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) // We should have transferred exactly one file. assert.Equal(t, toyFileTransfers(r), accounting.GlobalStats().GetTransfers()) @@ -394,8 +438,10 @@ func TestSyncIgnoreSize(t *testing.T) { r.CheckLocalItems(t, file2) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err = Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) // We should have transferred no files assert.Equal(t, int64(0), accounting.GlobalStats().GetTransfers()) @@ -411,8 +457,10 @@ func TestSyncIgnoreTimes(t *testing.T) { r.CheckRemoteItems(t, file1) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err := Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) // We should have transferred exactly 0 files because the // files were identical. @@ -421,8 +469,10 @@ func TestSyncIgnoreTimes(t *testing.T) { ci.IgnoreTimes = true accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err = Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) // We should have transferred exactly one file even though the // files were identical. @@ -441,18 +491,22 @@ func TestSyncIgnoreExisting(t *testing.T) { ci.IgnoreExisting = true accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err := Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) r.CheckLocalItems(t, file1) r.CheckRemoteItems(t, file1) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) // Change everything r.WriteFile("existing", "newpotatoes", t2) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err = Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) // Items should not change r.CheckRemoteItems(t, file1) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) } func TestSyncIgnoreErrors(t *testing.T) { @@ -490,8 +544,10 @@ func TestSyncIgnoreErrors(t *testing.T) { ) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) _ = fs.CountError(errors.New("boom")) assert.NoError(t, Sync(ctx, r.Fremote, r.Flocal, false)) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalListing( t, @@ -530,8 +586,10 @@ func TestSyncAfterChangingModtimeOnly(t *testing.T) { ci.DryRun = true accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err := Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalItems(t, file1) r.CheckRemoteItems(t, file2) @@ -539,8 +597,10 @@ func TestSyncAfterChangingModtimeOnly(t *testing.T) { ci.DryRun = false accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err = Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalItems(t, file1) r.CheckRemoteItems(t, file1) @@ -565,8 +625,10 @@ func TestSyncAfterChangingModtimeOnlyWithNoUpdateModTime(t *testing.T) { r.CheckRemoteItems(t, file2) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err := Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalItems(t, file1) r.CheckRemoteItems(t, file2) @@ -586,8 +648,10 @@ func TestSyncDoesntUpdateModtime(t *testing.T) { r.CheckRemoteItems(t, file2) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err := Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalItems(t, file1) r.CheckRemoteItems(t, file1) @@ -606,8 +670,10 @@ func TestSyncAfterAddingAFile(t *testing.T) { r.CheckRemoteItems(t, file1) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err := Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalItems(t, file1, file2) r.CheckRemoteItems(t, file1, file2) } @@ -621,8 +687,10 @@ func TestSyncAfterChangingFilesSizeOnly(t *testing.T) { r.CheckLocalItems(t, file2) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err := Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalItems(t, file2) r.CheckRemoteItems(t, file2) } @@ -644,8 +712,10 @@ func TestSyncAfterChangingContentsOnly(t *testing.T) { r.CheckLocalItems(t, file2) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err := Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalItems(t, file2) r.CheckRemoteItems(t, file2) } @@ -661,9 +731,11 @@ func TestSyncAfterRemovingAFileAndAddingAFileDryRun(t *testing.T) { ci.DryRun = true accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err := Sync(ctx, r.Fremote, r.Flocal, false) ci.DryRun = false require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalItems(t, file3, file1) r.CheckRemoteItems(t, file3, file2) @@ -679,8 +751,10 @@ func testSyncAfterRemovingAFileAndAddingAFile(ctx context.Context, t *testing.T) r.CheckLocalItems(t, file1, file3) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err := Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalItems(t, file1, file3) r.CheckRemoteItems(t, file1, file3) } @@ -724,8 +798,10 @@ func testSyncAfterRemovingAFileAndAddingAFileSubDir(ctx context.Context, t *test ) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err := Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalListing( t, @@ -788,10 +864,12 @@ func TestSyncAfterRemovingAFileAndAddingAFileSubDirWithErrors(t *testing.T) { }, ) + ctx = predictDstFromLogger(ctx) accounting.GlobalStats().ResetCounters() _ = fs.CountError(errors.New("boom")) err := Sync(ctx, r.Fremote, r.Flocal, false) assert.Equal(t, fs.ErrorNotDeleting, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalListing( t, @@ -861,8 +939,10 @@ func TestCopyDeleteBefore(t *testing.T) { r.CheckLocalItems(t, file2) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err := CopyDir(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckRemoteItems(t, file1, file2) r.CheckLocalItems(t, file2) @@ -884,15 +964,19 @@ func TestSyncWithExclude(t *testing.T) { ctx = filter.ReplaceConfig(ctx, fi) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err = Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckRemoteItems(t, file2, file1) // Now sync the other way round and check enormous doesn't get // deleted as it is excluded from the sync accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err = Sync(ctx, r.Flocal, r.Fremote, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalItems(t, file2, file1, file3) } @@ -913,15 +997,19 @@ func TestSyncWithExcludeAndDeleteExcluded(t *testing.T) { ctx = filter.ReplaceConfig(ctx, fi) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err = Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckRemoteItems(t, file2) // Check sync the other way round to make sure enormous gets // deleted even though it is excluded accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err = Sync(ctx, r.Flocal, r.Fremote, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalItems(t, file2) } @@ -950,9 +1038,11 @@ func TestSyncWithUpdateOlder(t *testing.T) { ci.UpdateOlder = true ci.ModifyWindow = fs.ModTimeNotSupported + ctx = predictDstFromLogger(ctx) err := Sync(ctx, r.Fremote, r.Flocal, false) require.NoError(t, err) r.CheckRemoteItems(t, oneO, twoF, threeO, fourF, fiveF) + // testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) // no modtime if r.Fremote.Hashes().Count() == 0 { t.Logf("Skip test with --checksum as no hashes supported") @@ -994,8 +1084,10 @@ func testSyncWithMaxDuration(t *testing.T, cutoffMode fs.CutoffMode) { r.CheckRemoteItems(t) accounting.GlobalStats().ResetCounters() + // ctx = predictDstFromLogger(ctx) // not currently supported (but tests do pass for CutoffModeSoft) startTime := time.Now() err := Sync(ctx, r.Fremote, r.Flocal, false) + // testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) require.True(t, errors.Is(err, ErrorMaxDurationReached)) if cutoffMode == fs.CutoffModeHard { @@ -1042,7 +1134,9 @@ func TestSyncWithTrackRenames(t *testing.T) { f2 := r.WriteFile("yam", "Yam Content", t2) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) require.NoError(t, Sync(ctx, r.Fremote, r.Flocal, false)) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckRemoteItems(t, f1, f2) r.CheckLocalItems(t, f1, f2) @@ -1051,7 +1145,9 @@ func TestSyncWithTrackRenames(t *testing.T) { f2 = r.RenameFile(f2, "yaml") accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) require.NoError(t, Sync(ctx, r.Fremote, r.Flocal, false)) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckRemoteItems(t, f1, f2) @@ -1110,7 +1206,9 @@ func TestSyncWithTrackRenamesStrategyModtime(t *testing.T) { f2 := r.WriteFile("yam", "Yam Content", t2) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) require.NoError(t, Sync(ctx, r.Fremote, r.Flocal, false)) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckRemoteItems(t, f1, f2) r.CheckLocalItems(t, f1, f2) @@ -1119,7 +1217,9 @@ func TestSyncWithTrackRenamesStrategyModtime(t *testing.T) { f2 = r.RenameFile(f2, "yaml") accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) require.NoError(t, Sync(ctx, r.Fremote, r.Flocal, false)) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckRemoteItems(t, f1, f2) @@ -1145,7 +1245,9 @@ func TestSyncWithTrackRenamesStrategyLeaf(t *testing.T) { f2 := r.WriteFile("sub/yam", "Yam Content", t2) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) require.NoError(t, Sync(ctx, r.Fremote, r.Flocal, false)) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckRemoteItems(t, f1, f2) r.CheckLocalItems(t, f1, f2) @@ -1154,7 +1256,9 @@ func TestSyncWithTrackRenamesStrategyLeaf(t *testing.T) { f2 = r.RenameFile(f2, "yam") accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) require.NoError(t, Sync(ctx, r.Fremote, r.Flocal, false)) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckRemoteItems(t, f1, f2) @@ -1200,8 +1304,10 @@ func testServerSideMove(ctx context.Context, t *testing.T, r *fstest.Run, withFi // Do server-side move accounting.GlobalStats().ResetCounters() + // ctx = predictDstFromLogger(ctx) // not currently supported -- doesn't list all contents of dir. err = MoveDir(ctx, FremoteMove, r.Fremote, testDeleteEmptyDirs, false) require.NoError(t, err) + // testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) if withFilter { r.CheckRemoteItems(t, file2) @@ -1227,8 +1333,10 @@ func testServerSideMove(ctx context.Context, t *testing.T, r *fstest.Run, withFi // Move it back to a new empty remote, dst does not exist this time accounting.GlobalStats().ResetCounters() + // ctx = predictDstFromLogger(ctx) err = MoveDir(ctx, FremoteMove2, FremoteMove, testDeleteEmptyDirs, false) require.NoError(t, err) + // testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) if withFilter { fstest.CheckItems(t, FremoteMove2, file1, file3u) @@ -1252,8 +1360,10 @@ func TestMoveWithDeleteEmptySrcDirs(t *testing.T) { r.Mkdir(ctx, r.Fremote) // run move with --delete-empty-src-dirs + ctx = predictDstFromLogger(ctx) err := MoveDir(ctx, r.Fremote, r.Flocal, true, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalListing( t, @@ -1270,8 +1380,10 @@ func TestMoveWithoutDeleteEmptySrcDirs(t *testing.T) { file2 := r.WriteFile("nested/sub dir/file", "nested", t1) r.Mkdir(ctx, r.Fremote) + ctx = predictDstFromLogger(ctx) err := MoveDir(ctx, r.Fremote, r.Flocal, false, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalListing( t, @@ -1295,8 +1407,10 @@ func TestMoveWithIgnoreExisting(t *testing.T) { ci.IgnoreExisting = true accounting.GlobalStats().ResetCounters() + // ctx = predictDstFromLogger(ctx) err := MoveDir(ctx, r.Fremote, r.Flocal, false, false) require.NoError(t, err) + // testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) r.CheckLocalListing( t, []fstest.Item{}, @@ -1314,8 +1428,10 @@ func TestMoveWithIgnoreExisting(t *testing.T) { // Recreate first file with modified content file1b := r.WriteFile("existing", "newpotatoes", t2) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err = MoveDir(ctx, r.Fremote, r.Flocal, false, false) require.NoError(t, err) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) // Source items should still exist in modified state r.CheckLocalListing( t, @@ -1379,8 +1495,10 @@ func TestServerSideMoveOverlap(t *testing.T) { r.CheckRemoteItems(t, file1) // Subdir move with no filters should return ErrorCantMoveOverlapping + ctx = predictDstFromLogger(ctx) err = MoveDir(ctx, FremoteMove, r.Fremote, false, false) assert.EqualError(t, err, fs.ErrorOverlapping.Error()) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) // Now try with a filter which should also fail with ErrorCantMoveOverlapping fi, err := filter.NewFilter(nil) @@ -1388,8 +1506,10 @@ func TestServerSideMoveOverlap(t *testing.T) { fi.Opt.MinSize = 40 ctx = filter.ReplaceConfig(ctx, fi) + ctx = predictDstFromLogger(ctx) err = MoveDir(ctx, FremoteMove, r.Fremote, false, false) assert.EqualError(t, err, fs.ErrorOverlapping.Error()) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) } // Test a sync with overlap @@ -1407,10 +1527,18 @@ func TestSyncOverlap(t *testing.T) { assert.Equal(t, fs.ErrorOverlapping.Error(), err.Error()) } + ctx = predictDstFromLogger(ctx) checkErr(Sync(ctx, FremoteSync, r.Fremote, false)) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) + ctx = predictDstFromLogger(ctx) checkErr(Sync(ctx, r.Fremote, FremoteSync, false)) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) + ctx = predictDstFromLogger(ctx) checkErr(Sync(ctx, r.Fremote, r.Fremote, false)) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) + ctx = predictDstFromLogger(ctx) checkErr(Sync(ctx, FremoteSync, FremoteSync, false)) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) } // Test a sync with filtered overlap @@ -1453,29 +1581,63 @@ func TestSyncOverlapWithFilter(t *testing.T) { } accounting.GlobalStats().ResetCounters() + filterCtx = predictDstFromLogger(filterCtx) checkNoErr(Sync(filterCtx, FremoteSync, r.Fremote, false)) checkErr(Sync(ctx, FremoteSync, r.Fremote, false)) checkNoErr(Sync(filterCtx, r.Fremote, FremoteSync, false)) + testLoggerVsLsf(filterCtx, r.Fremote, operations.GetLoggerOpt(filterCtx).JSON, t) + filterCtx = predictDstFromLogger(filterCtx) checkErr(Sync(ctx, r.Fremote, FremoteSync, false)) + testLoggerVsLsf(filterCtx, r.Fremote, operations.GetLoggerOpt(filterCtx).JSON, t) + filterCtx = predictDstFromLogger(filterCtx) checkErr(Sync(filterCtx, r.Fremote, r.Fremote, false)) + testLoggerVsLsf(filterCtx, r.Fremote, operations.GetLoggerOpt(filterCtx).JSON, t) + filterCtx = predictDstFromLogger(filterCtx) checkErr(Sync(ctx, r.Fremote, r.Fremote, false)) + testLoggerVsLsf(filterCtx, r.Fremote, operations.GetLoggerOpt(filterCtx).JSON, t) + filterCtx = predictDstFromLogger(filterCtx) checkErr(Sync(filterCtx, FremoteSync, FremoteSync, false)) + testLoggerVsLsf(filterCtx, r.Fremote, operations.GetLoggerOpt(filterCtx).JSON, t) + filterCtx = predictDstFromLogger(filterCtx) checkErr(Sync(ctx, FremoteSync, FremoteSync, false)) + testLoggerVsLsf(filterCtx, r.Fremote, operations.GetLoggerOpt(filterCtx).JSON, t) + filterCtx = predictDstFromLogger(filterCtx) checkNoErr(Sync(filterCtx, FremoteSync2, r.Fremote, false)) + testLoggerVsLsf(filterCtx, r.Fremote, operations.GetLoggerOpt(filterCtx).JSON, t) + filterCtx = predictDstFromLogger(filterCtx) checkErr(Sync(ctx, FremoteSync2, r.Fremote, false)) + testLoggerVsLsf(filterCtx, r.Fremote, operations.GetLoggerOpt(filterCtx).JSON, t) + filterCtx = predictDstFromLogger(filterCtx) checkNoErr(Sync(filterCtx, r.Fremote, FremoteSync2, false)) + testLoggerVsLsf(filterCtx, r.Fremote, operations.GetLoggerOpt(filterCtx).JSON, t) + filterCtx = predictDstFromLogger(filterCtx) checkErr(Sync(ctx, r.Fremote, FremoteSync2, false)) + testLoggerVsLsf(filterCtx, r.Fremote, operations.GetLoggerOpt(filterCtx).JSON, t) + filterCtx = predictDstFromLogger(filterCtx) checkErr(Sync(filterCtx, FremoteSync2, FremoteSync2, false)) + testLoggerVsLsf(filterCtx, r.Fremote, operations.GetLoggerOpt(filterCtx).JSON, t) + filterCtx = predictDstFromLogger(filterCtx) checkErr(Sync(ctx, FremoteSync2, FremoteSync2, false)) + testLoggerVsLsf(filterCtx, r.Fremote, operations.GetLoggerOpt(filterCtx).JSON, t) + filterCtx = predictDstFromLogger(filterCtx) checkNoErr(Sync(filterCtx, FremoteSync3, r.Fremote, false)) + testLoggerVsLsf(filterCtx, r.Fremote, operations.GetLoggerOpt(filterCtx).JSON, t) + filterCtx = predictDstFromLogger(filterCtx) checkErr(Sync(ctx, FremoteSync3, r.Fremote, false)) + testLoggerVsLsf(filterCtx, r.Fremote, operations.GetLoggerOpt(filterCtx).JSON, t) + filterCtx = predictDstFromLogger(filterCtx) // Destination is excluded so this test makes no sense // checkNoErr(Sync(filterCtx, r.Fremote, FremoteSync3, false)) checkErr(Sync(ctx, r.Fremote, FremoteSync3, false)) + testLoggerVsLsf(filterCtx, r.Fremote, operations.GetLoggerOpt(filterCtx).JSON, t) + filterCtx = predictDstFromLogger(filterCtx) checkErr(Sync(filterCtx, FremoteSync3, FremoteSync3, false)) + testLoggerVsLsf(filterCtx, r.Fremote, operations.GetLoggerOpt(filterCtx).JSON, t) + filterCtx = predictDstFromLogger(filterCtx) checkErr(Sync(ctx, FremoteSync3, FremoteSync3, false)) + testLoggerVsLsf(filterCtx, r.Fremote, operations.GetLoggerOpt(filterCtx).JSON, t) } // Test with CompareDest set @@ -1494,7 +1656,9 @@ func TestSyncCompareDest(t *testing.T) { r.CheckLocalItems(t, file1) accounting.GlobalStats().ResetCounters() + // ctx = predictDstFromLogger(ctx) // not currently supported due to duplicate equal() checks err = Sync(ctx, fdst, r.Flocal, false) + // testLoggerVsLsf(ctx, fdst, operations.GetLoggerOpt(ctx).JSON, t) require.NoError(t, err) file1dst := file1 @@ -1508,7 +1672,9 @@ func TestSyncCompareDest(t *testing.T) { r.CheckLocalItems(t, file1b) accounting.GlobalStats().ResetCounters() + // ctx = predictDstFromLogger(ctx) err = Sync(ctx, fdst, r.Flocal, false) + // testLoggerVsLsf(ctx, fdst, operations.GetLoggerOpt(ctx).JSON, t) require.NoError(t, err) file1bdst := file1b @@ -1524,7 +1690,9 @@ func TestSyncCompareDest(t *testing.T) { r.CheckLocalItems(t, file1c) accounting.GlobalStats().ResetCounters() + // ctx = predictDstFromLogger(ctx) err = Sync(ctx, fdst, r.Flocal, false) + // testLoggerVsLsf(ctx, fdst, operations.GetLoggerOpt(ctx).JSON, t) require.NoError(t, err) r.CheckRemoteItems(t, file2, file3) @@ -1536,14 +1704,18 @@ func TestSyncCompareDest(t *testing.T) { r.CheckLocalItems(t, file1c, file5) accounting.GlobalStats().ResetCounters() + // ctx = predictDstFromLogger(ctx) err = Sync(ctx, fdst, r.Flocal, false) + // testLoggerVsLsf(ctx, fdst, operations.GetLoggerOpt(ctx).JSON, t) require.NoError(t, err) r.CheckRemoteItems(t, file2, file3, file4) // check new dest, new compare accounting.GlobalStats().ResetCounters() + // ctx = predictDstFromLogger(ctx) err = Sync(ctx, fdst, r.Flocal, false) + // testLoggerVsLsf(ctx, fdst, operations.GetLoggerOpt(ctx).JSON, t) require.NoError(t, err) r.CheckRemoteItems(t, file2, file3, file4) @@ -1570,7 +1742,9 @@ func TestSyncCompareDest(t *testing.T) { r.CheckLocalItems(t, file1c, file5b) accounting.GlobalStats().ResetCounters() + // ctx = predictDstFromLogger(ctx) err = Sync(ctx, fdst, r.Flocal, false) + // testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) require.NoError(t, err) r.CheckRemoteItems(t, file2, file3, file4) @@ -1584,7 +1758,9 @@ func TestSyncCompareDest(t *testing.T) { r.CheckLocalItems(t, file1c, file5c) accounting.GlobalStats().ResetCounters() + // ctx = predictDstFromLogger(ctx) err = Sync(ctx, fdst, r.Flocal, false) + // testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) require.NoError(t, err) file5cdst := file5c @@ -1615,7 +1791,9 @@ func TestSyncMultipleCompareDest(t *testing.T) { accounting.GlobalStats().ResetCounters() fdst, err := fs.NewFs(ctx, r.FremoteName+"/dest") require.NoError(t, err) + // ctx = predictDstFromLogger(ctx) require.NoError(t, Sync(ctx, fdst, r.Flocal, false)) + // testLoggerVsLsf(ctx, fdst, operations.GetLoggerOpt(ctx).JSON, t) fdest3 := fsrc3 fdest3.Path = "dest/3" @@ -1644,7 +1822,9 @@ func TestSyncCopyDest(t *testing.T) { r.CheckLocalItems(t, file1) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err = Sync(ctx, fdst, r.Flocal, false) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) require.NoError(t, err) file1dst := file1 @@ -1658,7 +1838,9 @@ func TestSyncCopyDest(t *testing.T) { r.CheckLocalItems(t, file1b) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err = Sync(ctx, fdst, r.Flocal, false) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) require.NoError(t, err) file1bdst := file1b @@ -1677,7 +1859,9 @@ func TestSyncCopyDest(t *testing.T) { r.CheckLocalItems(t, file1c) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err = Sync(ctx, fdst, r.Flocal, false) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) require.NoError(t, err) file2dst := file2 @@ -1694,6 +1878,8 @@ func TestSyncCopyDest(t *testing.T) { r.CheckLocalItems(t, file1c, file5) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) err = Sync(ctx, fdst, r.Flocal, false) require.NoError(t, err) @@ -1704,7 +1890,9 @@ func TestSyncCopyDest(t *testing.T) { // check new dest, new copy accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err = Sync(ctx, fdst, r.Flocal, false) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) require.NoError(t, err) r.CheckRemoteItems(t, file2, file2dst, file3, file4, file4dst) @@ -1716,7 +1904,9 @@ func TestSyncCopyDest(t *testing.T) { r.CheckLocalItems(t, file1c, file5, file7) accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err = Sync(ctx, fdst, r.Flocal, false) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) require.NoError(t, err) file7dst := file7 @@ -1928,7 +2118,9 @@ func TestSyncUTFNorm(t *testing.T) { r.CheckRemoteItems(t, file2) accounting.GlobalStats().ResetCounters() + // ctx = predictDstFromLogger(ctx) err := Sync(ctx, r.Fremote, r.Flocal, false) + // testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) // can't test this on macOS require.NoError(t, err) // We should have transferred exactly one file, but kept the @@ -1954,7 +2146,9 @@ func TestSyncImmutable(t *testing.T) { // Should succeed accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err := Sync(ctx, r.Fremote, r.Flocal, false) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) require.NoError(t, err) r.CheckLocalItems(t, file1) r.CheckRemoteItems(t, file1) @@ -1966,7 +2160,9 @@ func TestSyncImmutable(t *testing.T) { // Should fail with ErrorImmutableModified and not modify local or remote files accounting.GlobalStats().ResetCounters() + ctx = predictDstFromLogger(ctx) err = Sync(ctx, r.Fremote, r.Flocal, false) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) assert.EqualError(t, err, fs.ErrorImmutableModified.Error()) r.CheckLocalItems(t, file2) r.CheckRemoteItems(t, file1) @@ -1993,7 +2189,9 @@ func TestSyncIgnoreCase(t *testing.T) { // Should not copy files that are differently-cased but otherwise identical accounting.GlobalStats().ResetCounters() + // ctx = predictDstFromLogger(ctx) err := Sync(ctx, r.Fremote, r.Flocal, false) + // testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) // can't test this on macOS require.NoError(t, err) r.CheckLocalItems(t, file1) r.CheckRemoteItems(t, file2) @@ -2025,7 +2223,9 @@ func TestMaxTransfer(t *testing.T) { accounting.GlobalStats().ResetCounters() + // ctx = predictDstFromLogger(ctx) // not currently supported err := Sync(ctx, r.Fremote, r.Flocal, false) + // testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) expectedErr := fserrors.FsError(accounting.ErrorMaxTransferLimitReachedFatal) if cutoff != fs.CutoffModeHard { expectedErr = accounting.ErrorMaxTransferLimitReachedGraceful @@ -2075,7 +2275,9 @@ func testSyncConcurrent(t *testing.T, subtest string) { r.CheckRemoteItems(t, itemsBefore...) stats.ResetErrors() + ctx = predictDstFromLogger(ctx) err := Sync(ctx, r.Fremote, r.Flocal, false) + testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) if errors.Is(err, fs.ErrorCantUploadEmptyFiles) { t.Skipf("Skip test because remote cannot upload empty files") } @@ -2091,3 +2293,124 @@ func TestSyncConcurrentDelete(t *testing.T) { func TestSyncConcurrentTruncate(t *testing.T) { testSyncConcurrent(t, "truncate") } + +// for testing logger: +func predictDstFromLogger(ctx context.Context) context.Context { + opt := operations.NewLoggerOpt() + var lock mutex.Mutex + + opt.LoggerFn = func(ctx context.Context, sigil operations.Sigil, src, dst fs.DirEntry, err error) { + lock.Lock() + defer lock.Unlock() + + // ignore dirs for our purposes here + if err == fs.ErrorIsDir { + return + } + winner := operations.WinningSide(ctx, sigil, src, dst, err) + if winner.Obj != nil { + file := winner.Obj + obj, ok := file.(fs.ObjectInfo) + checksum := "" + if ok { + if obj.Fs().Hashes().GetOne() == hash.MD5 { + // skip if no MD5 + checksum, _ = obj.Hash(ctx, obj.Fs().Hashes().GetOne()) + } + } + errMsg := "" + if winner.Err != nil { + errMsg = ";" + winner.Err.Error() + } + operations.SyncFprintf(opt.JSON, "%s;%s;%v;%s%s\n", file.ModTime(ctx).Local().Format("2006-01-02 15:04:05.000000000"), checksum, file.Size(), file.Remote(), errMsg) + } + } + return operations.WithSyncLogger(ctx, opt) +} + +func DstLsf(ctx context.Context, Fremote fs.Fs) *bytes.Buffer { + var opt = operations.ListJSONOpt{ + NoModTime: false, + NoMimeType: true, + DirsOnly: false, + FilesOnly: true, + Recurse: true, + ShowHash: true, + HashTypes: []string{"MD5"}, + } + + var list operations.ListFormat + + list.SetSeparator(";") + timeFormat := operations.FormatForLSFPrecision(Fremote.Precision()) + list.AddModTime(timeFormat) + list.AddHash(hash.MD5) + list.AddSize() + list.AddPath() + + out := new(bytes.Buffer) + + err := operations.ListJSON(ctx, Fremote, "", &opt, func(item *operations.ListJSONItem) error { + _, _ = fmt.Fprintln(out, list.Format(item)) + return nil + }) + if err != nil { + fs.Errorf(Fremote, "ListJSON error: %v", err) + } + + return out +} + +func LoggerMatchesLsf(logger, lsf *bytes.Buffer) error { + loggerSplit := bytes.Split(logger.Bytes(), []byte("\n")) + sort.SliceStable(loggerSplit, func(i int, j int) bool { return string(loggerSplit[i]) < string(loggerSplit[j]) }) + lsfSplit := bytes.Split(lsf.Bytes(), []byte("\n")) + sort.SliceStable(lsfSplit, func(i int, j int) bool { return string(lsfSplit[i]) < string(lsfSplit[j]) }) + + loggerJoined := bytes.Join(loggerSplit, []byte("\n")) + lsfJoined := bytes.Join(lsfSplit, []byte("\n")) + + if bytes.Equal(loggerJoined, lsfJoined) { + return nil + } + Diff(string(loggerJoined), string(lsfJoined)) + return fmt.Errorf("logger does not match lsf! \nlogger: \n%s \nlsf: \n%s", loggerJoined, lsfJoined) +} + +func Diff(rev1, rev2 string) { + fmt.Printf("Diff of %q and %q\n", "logger", "lsf") + cmd := exec.Command("bash", "-c", fmt.Sprintf(`diff <(echo "%s") <(echo "%s")`, rev1, rev2)) + out, _ := cmd.Output() + _, _ = os.Stdout.Write(out) +} + +func testLoggerVsLsf(ctx context.Context, Fremote fs.Fs, logger *bytes.Buffer, t *testing.T) { + var newlogger bytes.Buffer + canTestModtime := fs.GetModifyWindow(ctx, Fremote) != fs.ModTimeNotSupported + canTestHash := Fremote.Hashes().Contains(hash.MD5) + if !canTestHash || !canTestModtime { + loggerSplit := bytes.Split(logger.Bytes(), []byte("\n")) + for i, line := range loggerSplit { + elements := bytes.Split(line, []byte(";")) + if len(elements) >= 2 { + if !canTestModtime { + elements[0] = []byte("") + } + if !canTestHash { + elements[1] = []byte("") + } + } + loggerSplit[i] = bytes.Join(elements, []byte(";")) + } + newlogger.Write(bytes.Join(loggerSplit, []byte("\n"))) + } else { + newlogger.Write(logger.Bytes()) + } + + lsf := DstLsf(ctx, Fremote) + err := LoggerMatchesLsf(&newlogger, lsf) + r := fstest.NewRun(t) + if r.Flocal.Precision() == Fremote.Precision() && r.Flocal.Hashes().Contains(hash.MD5) && canTestHash { + require.NoError(t, err) + } +} diff --git a/go.mod b/go.mod index 51f8289480211..8f1db25d00178 100644 --- a/go.mod +++ b/go.mod @@ -158,6 +158,7 @@ require ( github.com/rasky/go-xdr v0.0.0-20170124162913-1a41d1a06c93 // indirect github.com/relvacode/iso8601 v1.3.0 // indirect github.com/rs/xid v1.5.0 // indirect + github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46 // indirect github.com/shabbyrobe/gocovmerge v0.0.0-20230507112040-c3350d9342df // indirect diff --git a/go.sum b/go.sum index 2e0dbbe738576..ef1dd4fdca606 100644 --- a/go.sum +++ b/go.sum @@ -472,6 +472,7 @@ github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6po github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46 h1:GHRpF1pTW19a8tTFrMLUcfWwyC0pnifVo2ClaLq+hP8= From 3a50f35df9ff8e4fa9a3e0745c9997f28991d086 Mon Sep 17 00:00:00 2001 From: nielash Date: Mon, 6 Nov 2023 02:45:51 -0500 Subject: [PATCH 108/130] sync: report list of synced paths to file -- see #7282 Allows rclone sync to accept the same output file flags as rclone check, for the purpose of writing results to a file. A new --dest-after option is also supported, which writes a list file using the same ListFormat flags as lsf (including customizable options for hash, modtime, etc.) Conceptually it is similar to rsync's --itemize-changes, but not identical -- it should output an accurate list of what will be on the destination after the sync. Note that it has a few limitations, and certain scenarios are not currently supported: --max-duration / CutoffModeHard --compare-dest / --copy-dest (because equal() is called multiple times for the same file) server-side moves of an entire dir at once (because we never get the individual file objects in the dir) High-level retries, because there would be dupes Possibly some error scenarios that didn't come up on the tests Note also that each file is logged during the sync, as opposed to after, so it is most useful as a predictor of what SHOULD happen to each file (which may or may not match what actually DID.) Only rclone sync is currently supported -- support for copy and move may be added in the future. --- cmd/sync/sync.go | 169 +++++++++++++++++- docs/content/commands/rclone_sync.md | 37 ++++ fs/logger/logger.go | 17 ++ fs/logger/logger_test.go | 33 ++++ .../testdata/script/TestBeforeVsAfter.txtar | 48 +++++ .../testdata/script/TestCheckVsSync.txtar | 48 +++++ .../testdata/script/TestRepoCompare.txtar | 52 ++++++ fs/operations/logger.go | 23 --- .../operationsflags/operationsflags.go | 45 +++++ fs/sync/sync_test.go | 42 ++--- 10 files changed, 469 insertions(+), 45 deletions(-) create mode 100644 fs/logger/logger.go create mode 100644 fs/logger/logger_test.go create mode 100644 fs/logger/testdata/script/TestBeforeVsAfter.txtar create mode 100644 fs/logger/testdata/script/TestCheckVsSync.txtar create mode 100644 fs/logger/testdata/script/TestRepoCompare.txtar create mode 100644 fs/operations/operationsflags/operationsflags.go diff --git a/cmd/sync/sync.go b/cmd/sync/sync.go index da9184f300740..38076541e792b 100644 --- a/cmd/sync/sync.go +++ b/cmd/sync/sync.go @@ -3,22 +3,137 @@ package sync import ( "context" + "io" + "os" + + mutex "sync" // renamed as "sync" already in use "github.com/rclone/rclone/cmd" + "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/config/flags" "github.com/rclone/rclone/fs/operations" + "github.com/rclone/rclone/fs/operations/operationsflags" "github.com/rclone/rclone/fs/sync" "github.com/spf13/cobra" ) var ( createEmptySrcDirs = false + opt = operations.LoggerOpt{} + loggerFlagsOpt = operationsflags.AddLoggerFlagsOptions{} ) func init() { cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() flags.BoolVarP(cmdFlags, &createEmptySrcDirs, "create-empty-src-dirs", "", createEmptySrcDirs, "Create empty source dirs on destination after sync", "") + operationsflags.AddLoggerFlags(cmdFlags, &opt, &loggerFlagsOpt) + // TODO: add same flags to move and copy +} + +var lock mutex.Mutex + +func syncLoggerFn(ctx context.Context, sigil operations.Sigil, src, dst fs.DirEntry, err error) { + lock.Lock() + defer lock.Unlock() + + if err == fs.ErrorIsDir && !opt.FilesOnly && opt.DestAfter != nil { + opt.PrintDestAfter(ctx, sigil, src, dst, err) + return + } + + _, srcOk := src.(fs.Object) + _, dstOk := dst.(fs.Object) + var filename string + if !srcOk && !dstOk { + return + } else if srcOk && !dstOk { + filename = src.String() + } else { + filename = dst.String() + } + + if sigil.Writer(opt) != nil { + operations.SyncFprintf(sigil.Writer(opt), "%s\n", filename) + } + if opt.Combined != nil { + operations.SyncFprintf(opt.Combined, "%c %s\n", sigil, filename) + fs.Debugf(nil, "Sync Logger: %s: %c %s\n", sigil.String(), sigil, filename) + } + if opt.DestAfter != nil { + opt.PrintDestAfter(ctx, sigil, src, dst, err) + } +} + +// GetSyncLoggerOpt gets the options corresponding to the logger flags +func GetSyncLoggerOpt(ctx context.Context, fdst fs.Fs, command *cobra.Command) (operations.LoggerOpt, func(), error) { + closers := []io.Closer{} + + opt.LoggerFn = syncLoggerFn + if opt.TimeFormat == "max" { + opt.TimeFormat = operations.FormatForLSFPrecision(fdst.Precision()) + } + opt.SetListFormat(ctx, command.Flags()) + opt.NewListJSON(ctx, fdst, "") + + open := func(name string, pout *io.Writer) error { + if name == "" { + return nil + } + if name == "-" { + *pout = os.Stdout + return nil + } + out, err := os.Create(name) + if err != nil { + return err + } + *pout = out + closers = append(closers, out) + return nil + } + + if err := open(loggerFlagsOpt.Combined, &opt.Combined); err != nil { + return opt, nil, err + } + if err := open(loggerFlagsOpt.MissingOnSrc, &opt.MissingOnSrc); err != nil { + return opt, nil, err + } + if err := open(loggerFlagsOpt.MissingOnDst, &opt.MissingOnDst); err != nil { + return opt, nil, err + } + if err := open(loggerFlagsOpt.Match, &opt.Match); err != nil { + return opt, nil, err + } + if err := open(loggerFlagsOpt.Differ, &opt.Differ); err != nil { + return opt, nil, err + } + if err := open(loggerFlagsOpt.ErrFile, &opt.Error); err != nil { + return opt, nil, err + } + if err := open(loggerFlagsOpt.DestAfter, &opt.DestAfter); err != nil { + return opt, nil, err + } + + close := func() { + for _, closer := range closers { + err := closer.Close() + if err != nil { + fs.Errorf(nil, "Failed to close report output: %v", err) + } + } + } + + return opt, close, nil +} + +func anyNotBlank(s ...string) bool { + for _, x := range s { + if x != "" { + return true + } + } + return false } var commandDefinition = &cobra.Command{ @@ -59,6 +174,44 @@ destination that is inside the source directory. **Note**: Use the ` + "`rclone dedupe`" + ` command to deal with "Duplicate object/directory found in source/destination - ignoring" errors. See [this forum post](https://forum.rclone.org/t/sync-not-clearing-duplicates/14372) for more info. + +## Logger Flags + +The ` + "`--differ`" + `, ` + "`--missing-on-dst`" + `, ` + "`--missing-on-src`" + `, ` + + "`--match`" + ` and ` + "`--error`" + ` flags write paths, one per line, to the file name (or +stdout if it is ` + "`-`" + `) supplied. What they write is described in the +help below. For example ` + "`--differ`" + ` will write all paths which are +present on both the source and destination but different. + +The ` + "`--combined`" + ` flag will write a file (or stdout) which contains all +file paths with a symbol and then a space and then the path to tell +you what happened to it. These are reminiscent of diff files. + +- ` + "`= path`" + ` means path was found in source and destination and was identical +- ` + "`- path`" + ` means path was missing on the source, so only in the destination +- ` + "`+ path`" + ` means path was missing on the destination, so only in the source +- ` + "`* path`" + ` means path was present in source and destination but different. +- ` + "`! path`" + ` means there was an error reading or hashing the source or dest. + +The ` + "`--dest-after`" + ` flag writes a list file using the same format flags +as [` + "`lsf`" + `](/commands/rclone_lsf/#synopsis) (including [customizable options +for hash, modtime, etc.](/commands/rclone_lsf/#synopsis)) +Conceptually it is similar to rsync's ` + "`--itemize-changes`" + `, but not identical +-- it should output an accurate list of what will be on the destination +after the sync. + +Note that these logger flags have a few limitations, and certain scenarios +are not currently supported: + +- ` + "`--max-duration`" + ` / ` + "`CutoffModeHard`" + ` +- ` + "`--compare-dest`" + ` / ` + "`--copy-dest`" + ` +- server-side moves of an entire dir at once +- High-level retries, because there would be duplicates (use ` + "`--retries 1`" + ` to disable) +- Possibly some unusual error scenarios + +Note also that each file is logged during the sync, as opposed to after, so it +is most useful as a predictor of what SHOULD happen to each file +(which may or may not match what actually DID.) `, Annotations: map[string]string{ "groups": "Sync,Copy,Filter,Listing,Important", @@ -67,10 +220,22 @@ See [this forum post](https://forum.rclone.org/t/sync-not-clearing-duplicates/14 cmd.CheckArgs(2, 2, command, args) fsrc, srcFileName, fdst := cmd.NewFsSrcFileDst(args) cmd.Run(true, true, command, func() error { + ctx := context.Background() + opt, close, err := GetSyncLoggerOpt(ctx, fdst, command) + if err != nil { + return err + } + defer close() + + if anyNotBlank(loggerFlagsOpt.Combined, loggerFlagsOpt.MissingOnSrc, loggerFlagsOpt.MissingOnDst, + loggerFlagsOpt.Match, loggerFlagsOpt.Differ, loggerFlagsOpt.ErrFile, loggerFlagsOpt.DestAfter) { + ctx = operations.WithSyncLogger(ctx, opt) + } + if srcFileName == "" { - return sync.Sync(context.Background(), fdst, fsrc, createEmptySrcDirs) + return sync.Sync(ctx, fdst, fsrc, createEmptySrcDirs) } - return operations.CopyFile(context.Background(), fdst, fsrc, srcFileName, srcFileName) + return operations.CopyFile(ctx, fdst, fsrc, srcFileName, srcFileName) }) }, } diff --git a/docs/content/commands/rclone_sync.md b/docs/content/commands/rclone_sync.md index 8096e01c3ebec..5ecbb3c03e79d 100644 --- a/docs/content/commands/rclone_sync.md +++ b/docs/content/commands/rclone_sync.md @@ -48,6 +48,43 @@ destination that is inside the source directory. **Note**: Use the `rclone dedupe` command to deal with "Duplicate object/directory found in source/destination - ignoring" errors. See [this forum post](https://forum.rclone.org/t/sync-not-clearing-duplicates/14372) for more info. +## Logger Flags + +The `--differ`, `--missing-on-dst`, `--missing-on-src`, `--match` +and `--error` flags write paths, one per line, to the file name (or +stdout if it is `-`) supplied. What they write is described in the +help below. For example `--differ` will write all paths which are +present on both the source and destination but different. + +The `--combined` flag will write a file (or stdout) which contains all +file paths with a symbol and then a space and then the path to tell +you what happened to it. These are reminiscent of diff files. + +- `= path` means path was found in source and destination and was identical +- `- path` means path was missing on the source, so only in the destination +- `+ path` means path was missing on the destination, so only in the source +- `* path` means path was present in source and destination but different. +- `! path` means there was an error reading or hashing the source or dest. + +The `--dest-after` flag writes a list file using the same format flags +as [`lsf`](/commands/rclone_lsf/#synopsis) (including [customizable options +for hash, modtime, etc.](/commands/rclone_lsf/#synopsis)) +Conceptually it is similar to rsync's `--itemize-changes`, but not identical +-- it should output an accurate list of what will be on the destination +after the sync. + +Note that these logger flags have a few limitations, and certain scenarios +are not currently supported: + +- `--max-duration` / `CutoffModeHard` +- `--compare-dest` / `--copy-dest` +- server-side moves of an entire dir at once +- High-level retries, because there would be duplicates (use `--retries 1` to disable) +- Possibly some unusual error scenarios + +Note also that each file is logged during the sync, as opposed to after, so it +is most useful as a predictor of what SHOULD happen to each file +(which may or may not match what actually DID.) ``` rclone sync source:path dest:path [flags] diff --git a/fs/logger/logger.go b/fs/logger/logger.go new file mode 100644 index 0000000000000..722b5d396f7c2 --- /dev/null +++ b/fs/logger/logger.go @@ -0,0 +1,17 @@ +// Package logger implements testing for the sync (and bisync) logger +package logger + +import ( + _ "github.com/rclone/rclone/backend/all" // import all backends + "github.com/rclone/rclone/cmd" + _ "github.com/rclone/rclone/cmd/all" // import all commands + _ "github.com/rclone/rclone/lib/plugin" // import plugins +) + +// Main enables the testscript package. See: +// https://bitfieldconsulting.com/golang/cli-testing +// https://pkg.go.dev/github.com/rogpeppe/go-internal@v1.11.0/testscript +func Main() int { + cmd.Main() + return 0 +} diff --git a/fs/logger/logger_test.go b/fs/logger/logger_test.go new file mode 100644 index 0000000000000..0e53563ce23f6 --- /dev/null +++ b/fs/logger/logger_test.go @@ -0,0 +1,33 @@ +package logger_test + +import ( + "os" + "path/filepath" + "testing" + + "github.com/rclone/rclone/fs/logger" + "github.com/rogpeppe/go-internal/testscript" +) + +// TestMain drives the tests +func TestMain(m *testing.M) { + // This enables the testscript package. See: + // https://bitfieldconsulting.com/golang/cli-testing + // https://pkg.go.dev/github.com/rogpeppe/go-internal@v1.11.0/testscript + os.Exit(testscript.RunMain(m, map[string]func() int{ + "rclone": logger.Main, + })) +} + +func TestLogger(t *testing.T) { + // Usage: https://bitfieldconsulting.com/golang/cli-testing + + testscript.Run(t, testscript.Params{ + Dir: "testdata/script", + Setup: func(env *testscript.Env) error { + env.Setenv("SRC", filepath.Join("$WORK", "src")) + env.Setenv("DST", filepath.Join("$WORK", "dst")) + return nil + }, + }) +} diff --git a/fs/logger/testdata/script/TestBeforeVsAfter.txtar b/fs/logger/testdata/script/TestBeforeVsAfter.txtar new file mode 100644 index 0000000000000..0ccadc9730904 --- /dev/null +++ b/fs/logger/testdata/script/TestBeforeVsAfter.txtar @@ -0,0 +1,48 @@ +# tests whether an md5sum file generated post-sync matches our pre-sync prediction + +# Filling src and dst with two different versions of rclone source!: +exec rclone copyurl https://github.com/rclone/rclone/archive/refs/tags/v1.49.1.zip $SRC/src.zip +exec rclone copyurl https://github.com/rclone/rclone/archive/refs/tags/v1.54.1.zip $DST/dst.zip +exec unzip $SRC/src.zip -d $SRC +exec unzip $DST/dst.zip -d $DST + + +# generating sumfiles: +exec rclone md5sum $SRC --output-file $WORK/src-before.txt +exec rclone md5sum $DST --output-file $WORK/dst-before.txt + +# running sync with output files: +exec rclone sync $SRC $DST --match $WORK/SYNCmatch.txt --combined $WORK/SYNCcombined.txt --missing-on-src $WORK/SYNCmissingonsrc.txt --missing-on-dst $WORK/SYNCmissingondst.txt --error $WORK/SYNCerr.txt --differ $WORK/SYNCdiffer.txt --dest-after $WORK/SYNCdestafter.txt --format 'hp' --separator ' ' + +# generating sumfiles: +exec rclone md5sum $SRC --output-file $WORK/src-after.txt +exec rclone md5sum $DST --output-file $WORK/dst-after.txt + +# sorting them by line and diffing: +exec sort $WORK/src-before.txt -o $WORK/src-before.txt +exec sort $WORK/dst-before.txt -o $WORK/dst-before.txt +exec sort $WORK/src-after.txt -o $WORK/src-after.txt +exec sort $WORK/dst-after.txt -o $WORK/dst-after.txt + +exec sort $WORK/SYNCmatch.txt -o $WORK/SYNCmatch.txt +exec sort $WORK/SYNCcombined.txt -o $WORK/SYNCcombined.txt +exec sort $WORK/SYNCmissingonsrc.txt -o $WORK/SYNCmissingonsrc.txt +exec sort $WORK/SYNCmissingondst.txt -o $WORK/SYNCmissingondst.txt +exec sort $WORK/SYNCerr.txt -o $WORK/SYNCerr.txt +exec sort $WORK/SYNCdiffer.txt -o $WORK/SYNCdiffer.txt +exec sort $WORK/SYNCdestafter.txt -o $WORK/SYNCdestafter.txt + +# diff src before vs src after: +cmp $WORK/src-before.txt $WORK/src-after.txt + +# diff dst before vs dst after: +! cmp $WORK/dst-before.txt $WORK/dst-after.txt + +# diff src before vs dst after: +cmp $WORK/src-before.txt $WORK/dst-after.txt + +# diff dst before vs src after: +! cmp $WORK/dst-before.txt $WORK/src-after.txt + +# diff md5sum dst after vs sync dest-after: +cmp $WORK/dst-after.txt $WORK/SYNCdestafter.txt \ No newline at end of file diff --git a/fs/logger/testdata/script/TestCheckVsSync.txtar b/fs/logger/testdata/script/TestCheckVsSync.txtar new file mode 100644 index 0000000000000..11d2803d1cf52 --- /dev/null +++ b/fs/logger/testdata/script/TestCheckVsSync.txtar @@ -0,0 +1,48 @@ +# tests whether rclone check and rclone sync output exactly the same file lists. + +# Filling src and dst with makefiles: +exec rclone test makefiles $SRC --seed 0 +exec rclone test makefiles $DST --seed 1 +exec rclone test makefiles $SRC --seed 2 +exec rclone test makefiles $DST --seed 2 + +# running rclone check for baseline test: +# error is expected here: +! exec rclone check $SRC $DST --match $WORK/CHECKmatch.txt --combined $WORK/CHECKcombined.txt --missing-on-src $WORK/CHECKmissingonsrc.txt --missing-on-dst $WORK/CHECKmissingondst.txt --error $WORK/CHECKerr.txt --differ $WORK/CHECKdiffer.txt -q + +# running sync with output files: +exec rclone sync $SRC $DST --match $WORK/SYNCmatch.txt --combined $WORK/SYNCcombined.txt --missing-on-src $WORK/SYNCmissingonsrc.txt --missing-on-dst $WORK/SYNCmissingondst.txt --error $WORK/SYNCerr.txt --differ $WORK/SYNCdiffer.txt + +# sorting them by line and diffing: +exec sort $WORK/CHECKmatch.txt -o $WORK/CHECKmatch.txt +exec sort $WORK/CHECKcombined.txt -o $WORK/CHECKcombined.txt +exec sort $WORK/CHECKmissingonsrc.txt -o $WORK/CHECKmissingonsrc.txt +exec sort $WORK/CHECKmissingondst.txt -o $WORK/CHECKmissingondst.txt +exec sort $WORK/CHECKerr.txt -o $WORK/CHECKerr.txt +exec sort $WORK/CHECKdiffer.txt -o $WORK/CHECKdiffer.txt + +exec sort $WORK/SYNCmatch.txt -o $WORK/SYNCmatch.txt +exec sort $WORK/SYNCcombined.txt -o $WORK/SYNCcombined.txt +exec sort $WORK/SYNCmissingonsrc.txt -o $WORK/SYNCmissingonsrc.txt +exec sort $WORK/SYNCmissingondst.txt -o $WORK/SYNCmissingondst.txt +exec sort $WORK/SYNCerr.txt -o $WORK/SYNCerr.txt +exec sort $WORK/SYNCdiffer.txt -o $WORK/SYNCdiffer.txt + +# diff match check vs. sync: +cmp $WORK/CHECKmatch.txt $WORK/SYNCmatch.txt +# diff combined check vs. sync: +cmp $WORK/CHECKcombined.txt $WORK/SYNCcombined.txt +# diff missingonsrc check vs. sync: +cmp $WORK/CHECKmissingonsrc.txt $WORK/SYNCmissingonsrc.txt +# diff missingondst check vs. sync: +cmp $WORK/CHECKmissingondst.txt $WORK/SYNCmissingondst.txt +# diff error check vs. sync: +cmp $WORK/CHECKerr.txt $WORK/SYNCerr.txt +# diff differ check vs. sync: +cmp $WORK/CHECKdiffer.txt $WORK/SYNCdiffer.txt + +# verify accuracy +exec rclone check $SRC $DST +exec diff -rya --suppress-common-lines $SRC $DST +[!windows] exec rsync -aEvhPu $SRC/ $WORK/rsyncDst +[!windows] exec rclone check $DST $WORK/rsyncDst \ No newline at end of file diff --git a/fs/logger/testdata/script/TestRepoCompare.txtar b/fs/logger/testdata/script/TestRepoCompare.txtar new file mode 100644 index 0000000000000..4bbe9220a0343 --- /dev/null +++ b/fs/logger/testdata/script/TestRepoCompare.txtar @@ -0,0 +1,52 @@ +# tests whether rclone check and rclone sync output exactly the same file lists. +# uses two different old versions of rclone source code for the src and dst +# to produce a more realistic test than makefiles +# (has lots of files with same name but different content) + +# Filling src and dst with two different versions of rclone source!: +exec rclone copyurl https://github.com/rclone/rclone/archive/refs/tags/v1.49.1.zip $SRC/src.zip +exec rclone copyurl https://github.com/rclone/rclone/archive/refs/tags/v1.54.1.zip $DST/dst.zip +exec unzip $SRC/src.zip -d $SRC +exec unzip $DST/dst.zip -d $DST + + +# running rclone check for baseline test: +# error is expected here: +! exec rclone check $SRC $DST --match $WORK/CHECKmatch.txt --combined $WORK/CHECKcombined.txt --missing-on-src $WORK/CHECKmissingonsrc.txt --missing-on-dst $WORK/CHECKmissingondst.txt --error $WORK/CHECKerr.txt --differ $WORK/CHECKdiffer.txt -q + +# running sync with output files: +exec rclone sync $SRC $DST --match $WORK/SYNCmatch.txt --combined $WORK/SYNCcombined.txt --missing-on-src $WORK/SYNCmissingonsrc.txt --missing-on-dst $WORK/SYNCmissingondst.txt --error $WORK/SYNCerr.txt --differ $WORK/SYNCdiffer.txt + +# sorting them by line and diffing: +exec sort $WORK/CHECKmatch.txt -o $WORK/CHECKmatch.txt +exec sort $WORK/CHECKcombined.txt -o $WORK/CHECKcombined.txt +exec sort $WORK/CHECKmissingonsrc.txt -o $WORK/CHECKmissingonsrc.txt +exec sort $WORK/CHECKmissingondst.txt -o $WORK/CHECKmissingondst.txt +exec sort $WORK/CHECKerr.txt -o $WORK/CHECKerr.txt +exec sort $WORK/CHECKdiffer.txt -o $WORK/CHECKdiffer.txt + +exec sort $WORK/SYNCmatch.txt -o $WORK/SYNCmatch.txt +exec sort $WORK/SYNCcombined.txt -o $WORK/SYNCcombined.txt +exec sort $WORK/SYNCmissingonsrc.txt -o $WORK/SYNCmissingonsrc.txt +exec sort $WORK/SYNCmissingondst.txt -o $WORK/SYNCmissingondst.txt +exec sort $WORK/SYNCerr.txt -o $WORK/SYNCerr.txt +exec sort $WORK/SYNCdiffer.txt -o $WORK/SYNCdiffer.txt + +# diff match check vs. sync: +cmp $WORK/CHECKmatch.txt $WORK/SYNCmatch.txt +# diff combined check vs. sync: +cmp $WORK/CHECKcombined.txt $WORK/SYNCcombined.txt +# diff missingonsrc check vs. sync: +cmp $WORK/CHECKmissingonsrc.txt $WORK/SYNCmissingonsrc.txt +# diff missingondst check vs. sync: +cmp $WORK/CHECKmissingondst.txt $WORK/SYNCmissingondst.txt +# diff error check vs. sync: +cmp $WORK/CHECKerr.txt $WORK/SYNCerr.txt +# diff differ check vs. sync: +cmp $WORK/CHECKdiffer.txt $WORK/SYNCdiffer.txt + +# verify accuracy +exec rclone check $SRC $DST +exec diff -rya --suppress-common-lines $SRC $DST +[!windows] exec rsync -aEvhPu $SRC/ $WORK/rsyncDst +[!windows] exec rclone check $DST $WORK/rsyncDst \ No newline at end of file diff --git a/fs/operations/logger.go b/fs/operations/logger.go index 9d0e213b40d6a..e0447659dc4d4 100644 --- a/fs/operations/logger.go +++ b/fs/operations/logger.go @@ -8,7 +8,6 @@ import ( "io" "github.com/rclone/rclone/fs" - "github.com/rclone/rclone/fs/config/flags" "github.com/rclone/rclone/fs/hash" "github.com/spf13/pflag" ) @@ -107,28 +106,6 @@ type LoggerOpt struct { Absolute bool } -// AddLoggerFlags adds the logger flags to the cmdFlags command -func AddLoggerFlags(cmdFlags *pflag.FlagSet, opt *LoggerOpt, combined, missingOnSrc, missingOnDst, match, differ, errFile, destAfter *string) { - flags.StringVarP(cmdFlags, combined, "combined", "", *combined, "Make a combined report of changes to this file", "Sync") - flags.StringVarP(cmdFlags, missingOnSrc, "missing-on-src", "", *missingOnSrc, "Report all files missing from the source to this file", "Sync") - flags.StringVarP(cmdFlags, missingOnDst, "missing-on-dst", "", *missingOnDst, "Report all files missing from the destination to this file", "Sync") - flags.StringVarP(cmdFlags, match, "match", "", *match, "Report all matching files to this file", "Sync") - flags.StringVarP(cmdFlags, differ, "differ", "", *differ, "Report all non-matching files to this file", "Sync") - flags.StringVarP(cmdFlags, errFile, "error", "", *errFile, "Report all files with errors (hashing or reading) to this file", "Sync") - flags.StringVarP(cmdFlags, destAfter, "dest-after", "", *destAfter, "Report all files that exist on the dest post-sync", "Sync") - - // lsf flags for destAfter - flags.StringVarP(cmdFlags, &opt.Format, "format", "F", "p", "Output format - see lsf help for details", "Sync") - flags.StringVarP(cmdFlags, &opt.Separator, "separator", "s", ";", "Separator for the items in the format", "Sync") - flags.BoolVarP(cmdFlags, &opt.DirSlash, "dir-slash", "d", true, "Append a slash to directory names", "Sync") - flags.FVarP(cmdFlags, &opt.HashType, "hash", "", "Use this hash when `h` is used in the format MD5|SHA-1|DropboxHash", "Sync") - flags.BoolVarP(cmdFlags, &opt.FilesOnly, "files-only", "", true, "Only list files", "Sync") - flags.BoolVarP(cmdFlags, &opt.DirsOnly, "dirs-only", "", false, "Only list directories", "Sync") - flags.BoolVarP(cmdFlags, &opt.Csv, "csv", "", false, "Output in CSV format", "Sync") - flags.BoolVarP(cmdFlags, &opt.Absolute, "absolute", "", false, "Put a leading / in front of path names", "Sync") - // flags.BoolVarP(cmdFlags, &recurse, "recursive", "R", false, "Recurse into the listing", "") -} - // WithLogger stores logger in ctx and returns a copy of ctx in which loggerKey = logger func WithLogger(ctx context.Context, logger LoggerFn) context.Context { return context.WithValue(ctx, loggerKey, logger) diff --git a/fs/operations/operationsflags/operationsflags.go b/fs/operations/operationsflags/operationsflags.go new file mode 100644 index 0000000000000..80a6d77fbeb51 --- /dev/null +++ b/fs/operations/operationsflags/operationsflags.go @@ -0,0 +1,45 @@ +// Package operationsflags defines the flags used by rclone operations. +// It is decoupled into a separate package so it can be replaced. +package operationsflags + +import ( + "github.com/rclone/rclone/fs/config/flags" + "github.com/rclone/rclone/fs/hash" + "github.com/rclone/rclone/fs/operations" + "github.com/spf13/pflag" +) + +// AddLoggerFlagsOptions contains options for the Logger Flags +type AddLoggerFlagsOptions struct { + Combined string // a file with file names with leading sigils + MissingOnSrc string // files only in the destination + MissingOnDst string // files only in the source + Match string // matching files + Differ string // differing files + ErrFile string // files with errors of some kind + DestAfter string // files that exist on the destination post-sync +} + +// AddLoggerFlags adds the logger flags to the cmdFlags command +func AddLoggerFlags(cmdFlags *pflag.FlagSet, opt *operations.LoggerOpt, flagsOpt *AddLoggerFlagsOptions) { + flags.StringVarP(cmdFlags, &flagsOpt.Combined, "combined", "", flagsOpt.Combined, "Make a combined report of changes to this file", "Sync") + flags.StringVarP(cmdFlags, &flagsOpt.MissingOnSrc, "missing-on-src", "", flagsOpt.MissingOnSrc, "Report all files missing from the source to this file", "Sync") + flags.StringVarP(cmdFlags, &flagsOpt.MissingOnDst, "missing-on-dst", "", flagsOpt.MissingOnDst, "Report all files missing from the destination to this file", "Sync") + flags.StringVarP(cmdFlags, &flagsOpt.Match, "match", "", flagsOpt.Match, "Report all matching files to this file", "Sync") + flags.StringVarP(cmdFlags, &flagsOpt.Differ, "differ", "", flagsOpt.Differ, "Report all non-matching files to this file", "Sync") + flags.StringVarP(cmdFlags, &flagsOpt.ErrFile, "error", "", flagsOpt.ErrFile, "Report all files with errors (hashing or reading) to this file", "Sync") + flags.StringVarP(cmdFlags, &flagsOpt.DestAfter, "dest-after", "", flagsOpt.DestAfter, "Report all files that exist on the dest post-sync", "Sync") + + // lsf flags for destAfter + flags.StringVarP(cmdFlags, &opt.Format, "format", "F", "p", "Output format - see lsf help for details", "Sync") + flags.StringVarP(cmdFlags, &opt.TimeFormat, "timeformat", "t", "", "Specify a custom time format, or 'max' for max precision supported by remote (default: 2006-01-02 15:04:05)", "") + flags.StringVarP(cmdFlags, &opt.Separator, "separator", "s", ";", "Separator for the items in the format", "Sync") + flags.BoolVarP(cmdFlags, &opt.DirSlash, "dir-slash", "d", true, "Append a slash to directory names", "Sync") + opt.HashType = hash.MD5 + flags.FVarP(cmdFlags, &opt.HashType, "hash", "", "Use this hash when `h` is used in the format MD5|SHA-1|DropboxHash", "Sync") + flags.BoolVarP(cmdFlags, &opt.FilesOnly, "files-only", "", true, "Only list files", "Sync") + flags.BoolVarP(cmdFlags, &opt.DirsOnly, "dirs-only", "", false, "Only list directories", "Sync") + flags.BoolVarP(cmdFlags, &opt.Csv, "csv", "", false, "Output in CSV format", "Sync") + flags.BoolVarP(cmdFlags, &opt.Absolute, "absolute", "", false, "Put a leading / in front of path names", "Sync") + // flags.BoolVarP(cmdFlags, &recurse, "recursive", "R", false, "Recurse into the listing", "") +} diff --git a/fs/sync/sync_test.go b/fs/sync/sync_test.go index e757af77ccee8..4438477f45c96 100644 --- a/fs/sync/sync_test.go +++ b/fs/sync/sync_test.go @@ -1495,10 +1495,10 @@ func TestServerSideMoveOverlap(t *testing.T) { r.CheckRemoteItems(t, file1) // Subdir move with no filters should return ErrorCantMoveOverlapping - ctx = predictDstFromLogger(ctx) + // ctx = predictDstFromLogger(ctx) err = MoveDir(ctx, FremoteMove, r.Fremote, false, false) assert.EqualError(t, err, fs.ErrorOverlapping.Error()) - testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) + // testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) // Now try with a filter which should also fail with ErrorCantMoveOverlapping fi, err := filter.NewFilter(nil) @@ -1506,10 +1506,10 @@ func TestServerSideMoveOverlap(t *testing.T) { fi.Opt.MinSize = 40 ctx = filter.ReplaceConfig(ctx, fi) - ctx = predictDstFromLogger(ctx) + // ctx = predictDstFromLogger(ctx) err = MoveDir(ctx, FremoteMove, r.Fremote, false, false) assert.EqualError(t, err, fs.ErrorOverlapping.Error()) - testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) + // testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) } // Test a sync with overlap @@ -1822,9 +1822,9 @@ func TestSyncCopyDest(t *testing.T) { r.CheckLocalItems(t, file1) accounting.GlobalStats().ResetCounters() - ctx = predictDstFromLogger(ctx) + // ctx = predictDstFromLogger(ctx) err = Sync(ctx, fdst, r.Flocal, false) - testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) + // testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) // not currently supported require.NoError(t, err) file1dst := file1 @@ -1838,9 +1838,9 @@ func TestSyncCopyDest(t *testing.T) { r.CheckLocalItems(t, file1b) accounting.GlobalStats().ResetCounters() - ctx = predictDstFromLogger(ctx) + // ctx = predictDstFromLogger(ctx) err = Sync(ctx, fdst, r.Flocal, false) - testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) + // testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) require.NoError(t, err) file1bdst := file1b @@ -1859,9 +1859,9 @@ func TestSyncCopyDest(t *testing.T) { r.CheckLocalItems(t, file1c) accounting.GlobalStats().ResetCounters() - ctx = predictDstFromLogger(ctx) + // ctx = predictDstFromLogger(ctx) err = Sync(ctx, fdst, r.Flocal, false) - testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) + // testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) require.NoError(t, err) file2dst := file2 @@ -1878,8 +1878,8 @@ func TestSyncCopyDest(t *testing.T) { r.CheckLocalItems(t, file1c, file5) accounting.GlobalStats().ResetCounters() - ctx = predictDstFromLogger(ctx) - testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) + // ctx = predictDstFromLogger(ctx) + // testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) err = Sync(ctx, fdst, r.Flocal, false) require.NoError(t, err) @@ -1890,9 +1890,9 @@ func TestSyncCopyDest(t *testing.T) { // check new dest, new copy accounting.GlobalStats().ResetCounters() - ctx = predictDstFromLogger(ctx) + // ctx = predictDstFromLogger(ctx) err = Sync(ctx, fdst, r.Flocal, false) - testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) + // testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) require.NoError(t, err) r.CheckRemoteItems(t, file2, file2dst, file3, file4, file4dst) @@ -1904,9 +1904,9 @@ func TestSyncCopyDest(t *testing.T) { r.CheckLocalItems(t, file1c, file5, file7) accounting.GlobalStats().ResetCounters() - ctx = predictDstFromLogger(ctx) + // ctx = predictDstFromLogger(ctx) err = Sync(ctx, fdst, r.Flocal, false) - testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) + // testLoggerVsLsf(ctx, r.Fremote, operations.GetLoggerOpt(ctx).JSON, t) require.NoError(t, err) file7dst := file7 @@ -2312,17 +2312,19 @@ func predictDstFromLogger(ctx context.Context) context.Context { file := winner.Obj obj, ok := file.(fs.ObjectInfo) checksum := "" + timeFormat := "2006-01-02 15:04:05" if ok { if obj.Fs().Hashes().GetOne() == hash.MD5 { // skip if no MD5 - checksum, _ = obj.Hash(ctx, obj.Fs().Hashes().GetOne()) + checksum, _ = obj.Hash(ctx, hash.MD5) } + timeFormat = operations.FormatForLSFPrecision(obj.Fs().Precision()) } errMsg := "" if winner.Err != nil { errMsg = ";" + winner.Err.Error() } - operations.SyncFprintf(opt.JSON, "%s;%s;%v;%s%s\n", file.ModTime(ctx).Local().Format("2006-01-02 15:04:05.000000000"), checksum, file.Size(), file.Remote(), errMsg) + operations.SyncFprintf(opt.JSON, "%s;%s;%v;%s%s\n", file.ModTime(ctx).Local().Format(timeFormat), checksum, file.Size(), file.Remote(), errMsg) } } return operations.WithSyncLogger(ctx, opt) @@ -2407,10 +2409,10 @@ func testLoggerVsLsf(ctx context.Context, Fremote fs.Fs, logger *bytes.Buffer, t newlogger.Write(logger.Bytes()) } - lsf := DstLsf(ctx, Fremote) - err := LoggerMatchesLsf(&newlogger, lsf) r := fstest.NewRun(t) if r.Flocal.Precision() == Fremote.Precision() && r.Flocal.Hashes().Contains(hash.MD5) && canTestHash { + lsf := DstLsf(ctx, Fremote) + err := LoggerMatchesLsf(&newlogger, lsf) require.NoError(t, err) } } From 978cbf9360bb2f894baa8e6922fc7c856c1125c5 Mon Sep 17 00:00:00 2001 From: nielash Date: Sun, 1 Oct 2023 09:36:19 -0400 Subject: [PATCH 109/130] bisync: generate final listing from sync results, not relisting -- fixes #5676 Before this change, if there were changes to sync, bisync listed each path twice: once before the sync and once after. The second listing caused quite a lot of problems, in addition to making each run much slower and more expensive. A serious side-effect was that file changes could slip through undetected, if they happened to occur while a sync was running (between the first and second listing snapshots.) After this change, the second listing is eliminated by getting the underlying sync operation to report back a list of what it changed. Not only is this more efficient, but also much more robust to concurrent modifications. It should no longer be necessary to avoid make changes while it's running -- bisync will simply learn about those changes next time and handle them on the next run. Additionally, this also makes --check-sync usable again. For further discussion, see: https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=5.%20Final%20listings%20should%20be%20created%20from%20initial%20snapshot%20%2B%20deltas%2C%20not%20full%20re%2Dscans%2C%20to%20avoid%20errors%20if%20files%20changed%20during%20sync --- cmd/bisync/bilib/canonical.go | 2 +- cmd/bisync/bisync_test.go | 2 + cmd/bisync/deltas.go | 39 ++- cmd/bisync/listing.go | 253 +++++++++++++++++- cmd/bisync/operations.go | 64 ++++- cmd/bisync/queue.go | 194 +++++++++++++- ...testdir_path1.._testdir_path2.copy1to2.que | 1 + ...testdir_path1.._testdir_path2.copy2to1.que | 1 + .../_testdir_path1.._testdir_path2.path1.lst | 9 + ...estdir_path1.._testdir_path2.path1.lst-new | 9 + .../_testdir_path1.._testdir_path2.path2.lst | 9 + ...estdir_path1.._testdir_path2.path2.lst-new | 9 + .../golden/test.log | 39 +++ .../initial/RCLONE_TEST | 1 + .../initial/file1.copy1.txt | 0 .../initial/file1.copy2.txt | 0 .../initial/file1.copy3.txt | 0 .../initial/file1.copy4.txt | 0 .../initial/file1.copy5.txt | 0 .../initial/file1.txt | 0 .../initial/subdir/file20.txt | 0 .../modfiles/file1.txt | 1 + .../test_ignorelistingchecksum/scenario.txt | 14 + docs/content/bisync.md | 93 +++---- 24 files changed, 664 insertions(+), 76 deletions(-) create mode 100644 cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.copy1to2.que create mode 100644 cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.copy2to1.que create mode 100644 cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path1.lst create mode 100644 cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path1.lst-new create mode 100644 cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path2.lst create mode 100644 cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path2.lst-new create mode 100644 cmd/bisync/testdata/test_ignorelistingchecksum/golden/test.log create mode 100644 cmd/bisync/testdata/test_ignorelistingchecksum/initial/RCLONE_TEST create mode 100644 cmd/bisync/testdata/test_ignorelistingchecksum/initial/file1.copy1.txt create mode 100644 cmd/bisync/testdata/test_ignorelistingchecksum/initial/file1.copy2.txt create mode 100644 cmd/bisync/testdata/test_ignorelistingchecksum/initial/file1.copy3.txt create mode 100644 cmd/bisync/testdata/test_ignorelistingchecksum/initial/file1.copy4.txt create mode 100644 cmd/bisync/testdata/test_ignorelistingchecksum/initial/file1.copy5.txt create mode 100644 cmd/bisync/testdata/test_ignorelistingchecksum/initial/file1.txt create mode 100644 cmd/bisync/testdata/test_ignorelistingchecksum/initial/subdir/file20.txt create mode 100644 cmd/bisync/testdata/test_ignorelistingchecksum/modfiles/file1.txt create mode 100644 cmd/bisync/testdata/test_ignorelistingchecksum/scenario.txt diff --git a/cmd/bisync/bilib/canonical.go b/cmd/bisync/bilib/canonical.go index 8dff41bffb459..be99d7f2d8376 100644 --- a/cmd/bisync/bilib/canonical.go +++ b/cmd/bisync/bilib/canonical.go @@ -11,7 +11,7 @@ import ( ) // FsPath converts Fs to a suitable rclone argument -func FsPath(f fs.Fs) string { +func FsPath(f fs.Info) string { name, path, slash := f.Name(), f.Root(), "/" if name == "local" { slash = string(os.PathSeparator) diff --git a/cmd/bisync/bisync_test.go b/cmd/bisync/bisync_test.go index 407cdab04bb12..97c84fc8117ef 100644 --- a/cmd/bisync/bisync_test.go +++ b/cmd/bisync/bisync_test.go @@ -641,6 +641,8 @@ func (b *bisyncTest) runBisync(ctx context.Context, args []string) (err error) { case "subdir": fs1 = addSubdir(b.path1, val) fs2 = addSubdir(b.path2, val) + case "ignore-listing-checksum": + opt.IgnoreListingChecksum = true default: return fmt.Errorf("invalid bisync option %q", arg) } diff --git a/cmd/bisync/deltas.go b/cmd/bisync/deltas.go index 6e0542dfb6b71..9d565eba62308 100644 --- a/cmd/bisync/deltas.go +++ b/cmd/bisync/deltas.go @@ -176,9 +176,11 @@ func (b *bisyncRun) findDeltas(fctx context.Context, f fs.Fs, oldListing, newLis } else { if old.getTime(file) != now.getTime(file) { if old.beforeOther(now, file) { + fs.Debugf(file, "(old: %v current: %v", old.getTime(file), now.getTime(file)) b.indent(msg, file, "File is newer") d |= deltaNewer } else { // Current version is older than prior sync. + fs.Debugf(file, "(old: %v current: %v", old.getTime(file), now.getTime(file)) b.indent(msg, file, "File is OLDER") d |= deltaOlder } @@ -217,7 +219,7 @@ func (b *bisyncRun) findDeltas(fctx context.Context, f fs.Fs, oldListing, newLis } // applyDeltas -func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (changes1, changes2 bool, err error) { +func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (changes1, changes2 bool, results2to1, results1to2 []Results, queues queues, err error) { path1 := bilib.FsPath(b.fs1) path2 := bilib.FsPath(b.fs2) @@ -226,6 +228,10 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change delete1 := bilib.Names{} delete2 := bilib.Names{} handled := bilib.Names{} + renamed1 := bilib.Names{} + renamed2 := bilib.Names{} + renameSkipped := bilib.Names{} + deletedonboth := bilib.Names{} ctxMove := b.opt.setDryRun(ctx) @@ -299,6 +305,7 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change equal := matches.Has(file) if equal { fs.Infof(nil, "Files are equal! Skipping: %s", file) + renameSkipped.Add(file) } else { fs.Debugf(nil, "Files are NOT equal: %s", file) b.indent("!Path1", p1+"..path1", "Renaming Path1 copy") @@ -307,6 +314,11 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change b.critical = true return } + if b.opt.DryRun { + renameSkipped.Add(file) + } else { + renamed1.Add(file) + } b.indent("!Path1", p2+"..path1", "Queue copy to Path2") copy1to2.Add(file + "..path1") @@ -315,6 +327,11 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change err = fmt.Errorf("path2 rename failed for %s: %w", file, err) return } + if b.opt.DryRun { + renameSkipped.Add(file) + } else { + renamed2.Add(file) + } b.indent("!Path2", p1+"..path2", "Queue copy to Path1") copy2to1.Add(file + "..path2") } @@ -334,6 +351,7 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change handled.Add(file) } else if d2.is(deltaDeleted) { handled.Add(file) + deletedonboth.Add(file) } } } @@ -360,25 +378,25 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change if copy2to1.NotEmpty() { changes1 = true b.indent("Path2", "Path1", "Do queued copies to") - err = b.fastCopy(ctx, b.fs2, b.fs1, copy2to1, "copy2to1") + results2to1, err = b.fastCopy(ctx, b.fs2, b.fs1, copy2to1, "copy2to1") if err != nil { return } //copy empty dirs from path2 to path1 (if --create-empty-src-dirs) - b.syncEmptyDirs(ctx, b.fs1, copy2to1, dirs2, "make") + b.syncEmptyDirs(ctx, b.fs1, copy2to1, dirs2, &results2to1, "make") } if copy1to2.NotEmpty() { changes2 = true b.indent("Path1", "Path2", "Do queued copies to") - err = b.fastCopy(ctx, b.fs1, b.fs2, copy1to2, "copy1to2") + results1to2, err = b.fastCopy(ctx, b.fs1, b.fs2, copy1to2, "copy1to2") if err != nil { return } //copy empty dirs from path1 to path2 (if --create-empty-src-dirs) - b.syncEmptyDirs(ctx, b.fs2, copy1to2, dirs1, "make") + b.syncEmptyDirs(ctx, b.fs2, copy1to2, dirs1, &results1to2, "make") } if delete1.NotEmpty() { @@ -386,7 +404,7 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change return } //propagate deletions of empty dirs from path2 to path1 (if --create-empty-src-dirs) - b.syncEmptyDirs(ctx, b.fs1, delete1, dirs1, "remove") + b.syncEmptyDirs(ctx, b.fs1, delete1, dirs1, &results2to1, "remove") } if delete2.NotEmpty() { @@ -394,9 +412,16 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change return } //propagate deletions of empty dirs from path1 to path2 (if --create-empty-src-dirs) - b.syncEmptyDirs(ctx, b.fs2, delete2, dirs2, "remove") + b.syncEmptyDirs(ctx, b.fs2, delete2, dirs2, &results1to2, "remove") } + queues.copy1to2 = copy1to2 + queues.copy2to1 = copy2to1 + queues.renamed1 = renamed1 + queues.renamed2 = renamed2 + queues.renameSkipped = renameSkipped + queues.deletedonboth = deletedonboth + return } diff --git a/cmd/bisync/listing.go b/cmd/bisync/listing.go index b2edb7ec948f2..4a71d150041f8 100644 --- a/cmd/bisync/listing.go +++ b/cmd/bisync/listing.go @@ -9,14 +9,18 @@ import ( "io" "os" "regexp" + "sort" "strconv" "strings" "sync" "time" "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/filter" "github.com/rclone/rclone/fs/hash" + "github.com/rclone/rclone/fs/operations" "github.com/rclone/rclone/fs/walk" + "golang.org/x/exp/slices" ) // ListingHeader defines first line of a listing @@ -70,11 +74,29 @@ func (ls *fileList) empty() bool { func (ls *fileList) has(file string) bool { _, found := ls.info[file] + if !found { + //try unquoting + file, _ = strconv.Unquote(`"` + file + `"`) + _, found = ls.info[file] + } return found } func (ls *fileList) get(file string) *fileInfo { - return ls.info[file] + info, found := ls.info[file] + if !found { + //try unquoting + file, _ = strconv.Unquote(`"` + file + `"`) + info = ls.info[fmt.Sprint(file)] + } + return info +} + +func (ls *fileList) remove(file string) { + if ls.has(file) { + ls.list = slices.Delete(ls.list, slices.Index(ls.list, file), slices.Index(ls.list, file)+1) + delete(ls.info, file) + } } func (ls *fileList) put(file string, size int64, time time.Time, hash, id string, flags string) { @@ -82,6 +104,9 @@ func (ls *fileList) put(file string, size int64, time time.Time, hash, id string if fi != nil { fi.size = size fi.time = time + fi.hash = hash + fi.id = id + fi.flags = flags } else { fi = &fileInfo{ size: size, @@ -120,12 +145,20 @@ func (ls *fileList) afterTime(file string, time time.Time) bool { return fi.time.After(time) } +// sort by path name +func (ls *fileList) sort() { + sort.SliceStable(ls.list, func(i, j int) bool { + return ls.list[i] < ls.list[j] + }) +} + // save will save listing to a file. func (ls *fileList) save(ctx context.Context, listing string) error { file, err := os.Create(listing) if err != nil { return err } + ls.sort() hashName := "" if ls.hash != hash.None { @@ -376,3 +409,221 @@ func (b *bisyncRun) listDirsOnly(listingNum int) (*fileList, error) { return dirsonly, err } + +// ConvertPrecision returns the Modtime rounded to Dest's precision if lower, otherwise unchanged +// Need to use the other fs's precision (if lower) when copying +// Note: we need to use Truncate rather than Round so that After() is reliable. +// (2023-11-02 20:22:45.552679442 +0000 < UTC 2023-11-02 20:22:45.553 +0000 UTC) +func ConvertPrecision(Modtime time.Time, dst fs.Fs) time.Time { + DestPrecision := dst.Precision() + + // In case it's wrapping an Fs with lower precision, try unwrapping and use the lowest. + if Modtime.Truncate(DestPrecision).After(Modtime.Truncate(fs.UnWrapFs(dst).Precision())) { + DestPrecision = fs.UnWrapFs(dst).Precision() + } + + if Modtime.After(Modtime.Truncate(DestPrecision)) { + return Modtime.Truncate(DestPrecision) + } + return Modtime +} + +// modifyListing will modify the listing based on the results of the sync +func (b *bisyncRun) modifyListing(ctx context.Context, src fs.Fs, dst fs.Fs, srcListing string, dstListing string, results []Results, queues queues, is1to2 bool) (err error) { + queue := queues.copy2to1 + renames := queues.renamed2 + direction := "2to1" + if is1to2 { + queue = queues.copy1to2 + renames = queues.renamed1 + direction = "1to2" + } + + fs.Debugf(nil, "updating %s", direction) + fs.Debugf(nil, "RESULTS: %v", results) + fs.Debugf(nil, "QUEUE: %v", queue) + + srcList, err := b.loadListing(srcListing) + if err != nil { + return fmt.Errorf("cannot read prior listing: %w", err) + } + dstList, err := b.loadListing(dstListing) + if err != nil { + return fmt.Errorf("cannot read prior listing: %w", err) + } + // set list hash type + if b.opt.Resync && !b.opt.IgnoreListingChecksum { + srcList.hash = src.Hashes().GetOne() + dstList.hash = dst.Hashes().GetOne() + } + + srcWinners := newFileList() + dstWinners := newFileList() + errors := newFileList() + ctxRecheck, filterRecheck := filter.AddConfig(ctx) + + for _, result := range results { + if result.Name == "" { + continue + } + + if result.Flags == "d" && !b.opt.CreateEmptySrcDirs { + continue + } + + // build src winners list + if result.IsSrc && result.Src != "" && (result.Winner.Err == nil || result.Flags == "d") { + srcWinners.put(result.Name, result.Size, ConvertPrecision(result.Modtime, src), result.Hash, "-", result.Flags) + fs.Debugf(nil, "winner: copy to src: %v", result) + } + + // build dst winners list + if result.IsWinner && result.Winner.Side != "none" && (result.Winner.Err == nil || result.Flags == "d") { + dstWinners.put(result.Name, result.Size, ConvertPrecision(result.Modtime, dst), result.Hash, "-", result.Flags) + fs.Debugf(nil, "winner: copy to dst: %v", result) + } + + // build errors list + if result.Err != nil || result.Winner.Err != nil { + errors.put(result.Name, result.Size, result.Modtime, result.Hash, "-", result.Flags) + if err := filterRecheck.AddFile(result.Name); err != nil { + fs.Debugf(result.Name, "error adding file to recheck filter: %v", err) + } + } + } + + updateLists := func(side string, winners, list *fileList) { + // removals from side + for _, oldFile := range queue.ToList() { + if !winners.has(oldFile) && list.has(oldFile) && !errors.has(oldFile) { + list.remove(oldFile) + fs.Debugf(nil, "decision: removed from %s: %v", side, oldFile) + } else if winners.has(oldFile) { + // copies to side + new := winners.get(oldFile) + list.put(oldFile, new.size, new.time, new.hash, new.id, new.flags) + fs.Debugf(nil, "decision: copied to %s: %v", side, oldFile) + } else { + fs.Debugf(oldFile, "file in queue but missing from %s transfers", side) + if err := filterRecheck.AddFile(oldFile); err != nil { + fs.Debugf(oldFile, "error adding file to recheck filter: %v", err) + } + } + } + } + updateLists("src", srcWinners, srcList) + updateLists("dst", dstWinners, dstList) + + // TODO: rollback on error + + // account for "deltaOthers" we handled separately + if queues.deletedonboth.NotEmpty() { + for file := range queues.deletedonboth { + srcList.remove(file) + dstList.remove(file) + } + } + if renames.NotEmpty() && !b.opt.DryRun { + // renamed on src and copied to dst + renamesList := renames.ToList() + for _, file := range renamesList { + // we'll handle the other side when we go the other direction + newName := file + "..path2" + oppositeName := file + "..path1" + if is1to2 { + newName = file + "..path1" + oppositeName = file + "..path2" + } + var new *fileInfo + // we prefer to get the info from the ..path1 / ..path2 versions + // since they were actually copied as opposed to operations.MoveFile()'d. + // the size/time/hash info is therefore fresher on the renames + // but we'll settle for the original if we have to. + if srcList.has(newName) { + new = srcList.get(newName) + } else if srcList.has(oppositeName) { + new = srcList.get(oppositeName) + } else if srcList.has(file) { + new = srcList.get(file) + } else { + if err := filterRecheck.AddFile(file); err != nil { + fs.Debugf(file, "error adding file to recheck filter: %v", err) + } + } + srcList.put(newName, new.size, new.time, new.hash, new.id, new.flags) + dstList.put(newName, new.size, ConvertPrecision(new.time, src), new.hash, new.id, new.flags) + srcList.remove(file) + dstList.remove(file) + } + } + + // recheck the ones we skipped because they were equal + // we never got their info because they were never synced. + // TODO: add flag to skip this for people who don't care and would rather avoid? + if queues.renameSkipped.NotEmpty() { + skippedList := queues.renameSkipped.ToList() + for _, file := range skippedList { + if err := filterRecheck.AddFile(file); err != nil { + fs.Debugf(file, "error adding file to recheck filter: %v", err) + } + } + } + + if filterRecheck.HaveFilesFrom() { + b.recheck(ctxRecheck, src, dst, srcList, dstList) + } + + // update files + err = srcList.save(ctx, srcListing) + if err != nil { + b.abort = true + } + err = dstList.save(ctx, dstListing) + if err != nil { + b.abort = true + } + + return err +} + +// recheck the ones we're not sure about +func (b *bisyncRun) recheck(ctxRecheck context.Context, src, dst fs.Fs, srcList, dstList *fileList) { + var srcObjs []fs.Object + var dstObjs []fs.Object + + if err := operations.ListFn(ctxRecheck, src, func(obj fs.Object) { + srcObjs = append(srcObjs, obj) + }); err != nil { + fs.Debugf(src, "error recchecking src obj: %v", err) + } + if err := operations.ListFn(ctxRecheck, dst, func(obj fs.Object) { + dstObjs = append(dstObjs, obj) + }); err != nil { + fs.Debugf(dst, "error recchecking dst obj: %v", err) + } + + putObj := func(obj fs.Object, f fs.Fs, list *fileList) { + hashVal := "" + if !b.opt.IgnoreListingChecksum { + hashType := f.Hashes().GetOne() + if hashType != hash.None { + hashVal, _ = obj.Hash(ctxRecheck, hashType) + } + } + list.put(obj.Remote(), obj.Size(), obj.ModTime(ctxRecheck), hashVal, "-", "-") + } + + for _, srcObj := range srcObjs { + fs.Debugf(srcObj, "rechecking") + for _, dstObj := range dstObjs { + if srcObj.Remote() == dstObj.Remote() { + if operations.Equal(ctxRecheck, srcObj, dstObj) || b.opt.DryRun { + putObj(srcObj, src, srcList) + putObj(dstObj, dst, dstList) + } else { + fs.Infof(srcObj, "files not equal on recheck: %v %v", srcObj, dstObj) + } + } + } + } +} diff --git a/cmd/bisync/operations.go b/cmd/bisync/operations.go index 250437e626b41..d53a9c40a1db5 100644 --- a/cmd/bisync/operations.go +++ b/cmd/bisync/operations.go @@ -16,7 +16,6 @@ import ( "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/filter" "github.com/rclone/rclone/fs/operations" - "github.com/rclone/rclone/fs/sync" "github.com/rclone/rclone/lib/atexit" ) @@ -35,6 +34,15 @@ type bisyncRun struct { opt *Options } +type queues struct { + copy1to2 bilib.Names + copy2to1 bilib.Names + renamed1 bilib.Names // renamed on 1 and copied to 2 + renamed2 bilib.Names // renamed on 2 and copied to 1 + renameSkipped bilib.Names // not renamed because it was equal + deletedonboth bilib.Names +} + // Bisync handles lock file, performs bisync run and checks exit status func Bisync(ctx context.Context, fs1, fs2 fs.Fs, optArg *Options) (err error) { opt := *optArg // ensure that input is never changed @@ -256,13 +264,18 @@ func (b *bisyncRun) runLocked(octx context.Context, listing1, listing2 string) ( // Determine and apply changes to Path1 and Path2 noChanges := ds1.empty() && ds2.empty() - changes1 := false - changes2 := false + changes1 := false // 2to1 + changes2 := false // 1to2 + results2to1 := []Results{} + results1to2 := []Results{} + + queues := queues{} + if noChanges { fs.Infof(nil, "No changes found") } else { fs.Infof(nil, "Applying changes") - changes1, changes2, err = b.applyDeltas(octx, ds1, ds2) + changes1, changes2, results2to1, results1to2, queues, err = b.applyDeltas(octx, ds1, ds2) if err != nil { b.critical = true // b.retryable = true // not sure about this one @@ -277,13 +290,13 @@ func (b *bisyncRun) runLocked(octx context.Context, listing1, listing2 string) ( err1 = bilib.CopyFileIfExists(newListing1, listing1) err2 = bilib.CopyFileIfExists(newListing2, listing2) } else { - if changes1 { - _, err1 = b.makeListing(fctx, b.fs1, listing1) + if changes1 { // 2to1 + err1 = b.modifyListing(fctx, b.fs2, b.fs1, listing2, listing1, results2to1, queues, false) } else { err1 = bilib.CopyFileIfExists(newListing1, listing1) } - if changes2 { - _, err2 = b.makeListing(fctx, b.fs2, listing2) + if changes2 { // 1to2 + err2 = b.modifyListing(fctx, b.fs1, b.fs2, listing1, listing2, results1to2, queues, true) } else { err2 = bilib.CopyFileIfExists(newListing2, listing2) } @@ -394,11 +407,15 @@ func (b *bisyncRun) resync(octx, fctx context.Context, listing1, listing2 string copy2to1 = append(copy2to1, file) } } + var results2to1 []Results + var results1to2 []Results + var results2to1Dirs []Results + queues := queues{} if len(copy2to1) > 0 { b.indent("Path2", "Path1", "Resync is doing queued copies to") // octx does not have extra filters! - err = b.fastCopy(octx, b.fs2, b.fs1, bilib.ToNames(copy2to1), "resync-copy2to1") + results2to1, err = b.fastCopy(octx, b.fs2, b.fs1, bilib.ToNames(copy2to1), "resync-copy2to1") if err != nil { b.critical = true return err @@ -413,7 +430,7 @@ func (b *bisyncRun) resync(octx, fctx context.Context, listing1, listing2 string // prevent overwriting Google Doc files (their size is -1) filterSync.Opt.MinSize = 0 } - if err = sync.CopyDir(ctxSync, b.fs2, b.fs1, b.opt.CreateEmptySrcDirs); err != nil { + if results1to2, err = b.resyncDir(ctxSync, b.fs1, b.fs2); err != nil { b.critical = true return err } @@ -434,20 +451,39 @@ func (b *bisyncRun) resync(octx, fctx context.Context, listing1, listing2 string fs.Infof(nil, "Resynching Path2 to Path1 (for empty dirs)") - //note copy (not sync) and dst comes before src - if err = sync.CopyDir(ctxSync, b.fs1, b.fs2, b.opt.CreateEmptySrcDirs); err != nil { + // note copy (not sync) and dst comes before src + if results2to1Dirs, err = b.resyncDir(ctxSync, b.fs2, b.fs1); err != nil { b.critical = true return err } } fs.Infof(nil, "Resync updating listings") - if _, err = b.makeListing(fctx, b.fs1, listing1); err != nil { + if err := bilib.CopyFileIfExists(newListing1, listing1); err != nil { + return err + } + if err := bilib.CopyFileIfExists(newListing2, listing2); err != nil { + return err + } + + // resync 2to1 + queues.copy2to1 = bilib.ToNames(copy2to1) + if err = b.modifyListing(fctx, b.fs2, b.fs1, listing2, listing1, results2to1, queues, false); err != nil { + b.critical = true + return err + } + + // resync 1to2 + queues.copy1to2 = bilib.ToNames(filesNow1.list) + if err = b.modifyListing(fctx, b.fs1, b.fs2, listing1, listing2, results1to2, queues, true); err != nil { b.critical = true return err } - if _, err = b.makeListing(fctx, b.fs2, listing2); err != nil { + // resync 2to1 (dirs) + dirs2, _ := b.listDirsOnly(2) + queues.copy2to1 = bilib.ToNames(dirs2.list) + if err = b.modifyListing(fctx, b.fs2, b.fs1, listing2, listing1, results2to1Dirs, queues, false); err != nil { b.critical = true return err } diff --git a/cmd/bisync/queue.go b/cmd/bisync/queue.go index d213ff74a99cc..111b8991b97b0 100644 --- a/cmd/bisync/queue.go +++ b/cmd/bisync/queue.go @@ -2,39 +2,187 @@ package bisync import ( "context" + "encoding/json" "fmt" + "io" "sort" + mutex "sync" // renamed as "sync" already in use + "time" "github.com/rclone/rclone/cmd/bisync/bilib" "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/filter" "github.com/rclone/rclone/fs/operations" "github.com/rclone/rclone/fs/sync" + "golang.org/x/text/unicode/norm" ) -func (b *bisyncRun) fastCopy(ctx context.Context, fsrc, fdst fs.Fs, files bilib.Names, queueName string) error { +// Results represents a pair of synced files, as reported by the LoggerFn +// Bisync uses this to determine what happened during the sync, and modify the listings accordingly +type Results struct { + Src string + Dst string + Name string + Size int64 + Modtime time.Time + Hash string + Flags string + Sigil operations.Sigil + Err error + Winner operations.Winner + IsWinner bool + IsSrc bool + IsDst bool +} + +var logger = operations.NewLoggerOpt() +var lock mutex.Mutex +var ignoreListingChecksum bool + +// FsPathIfAny handles type assertions and returns a formatted bilib.FsPath if valid, otherwise "" +func FsPathIfAny(x fs.DirEntry) string { + obj, ok := x.(fs.Object) + if x != nil && ok { + return bilib.FsPath(obj.Fs()) + } + return "" +} + +func resultName(result Results, side, src, dst fs.DirEntry) string { + if side != nil { + return side.Remote() + } else if result.IsSrc && dst != nil { + return dst.Remote() + } else if src != nil { + return src.Remote() + } + return "" +} + +// WriteResults is Bisync's LoggerFn +func WriteResults(ctx context.Context, sigil operations.Sigil, src, dst fs.DirEntry, err error) { + lock.Lock() + defer lock.Unlock() + + opt := operations.GetLoggerOpt(ctx) + result := Results{ + Sigil: sigil, + Src: FsPathIfAny(src), + Dst: FsPathIfAny(dst), + Err: err, + } + + result.Winner = operations.WinningSide(ctx, sigil, src, dst, err) + + fss := []fs.DirEntry{src, dst} + for i, side := range fss { + + result.Name = resultName(result, side, src, dst) + result.IsSrc = i == 0 + result.IsDst = i == 1 + result.Flags = "-" + if side != nil { + result.Size = side.Size() + result.Modtime = side.ModTime(ctx).In(time.UTC) + + if !ignoreListingChecksum { + sideObj, ok := side.(fs.ObjectInfo) + if ok { + result.Hash, _ = sideObj.Hash(ctx, sideObj.Fs().Hashes().GetOne()) + } + } + } + result.IsWinner = result.Winner.Obj == side + + // used during resync only + if err == fs.ErrorIsDir { + if src != nil { + result.Src = src.Remote() + result.Name = src.Remote() + } else { + result.Dst = dst.Remote() + result.Name = dst.Remote() + } + result.Flags = "d" + result.Size = 0 + } + + fs.Debugf(nil, "writing result: %v", result) + err := json.NewEncoder(opt.JSON).Encode(result) + if err != nil { + fs.Errorf(result, "Error encoding JSON: %v", err) + } + } +} + +// ReadResults decodes the JSON data from WriteResults +func ReadResults(results io.Reader) []Results { + dec := json.NewDecoder(results) + var slice []Results + for { + var r Results + if err := dec.Decode(&r); err == io.EOF { + break + } + fs.Debugf(nil, "result: %v", r) + slice = append(slice, r) + } + return slice +} + +func (b *bisyncRun) fastCopy(ctx context.Context, fsrc, fdst fs.Fs, files bilib.Names, queueName string) ([]Results, error) { if err := b.saveQueue(files, queueName); err != nil { - return err + return nil, err } ctxCopy, filterCopy := filter.AddConfig(b.opt.setDryRun(ctx)) for _, file := range files.ToList() { if err := filterCopy.AddFile(file); err != nil { - return err + return nil, err + } + // macOS + if err := filterCopy.AddFile(norm.NFD.String(file)); err != nil { + return nil, err } } + ignoreListingChecksum = b.opt.IgnoreListingChecksum + logger.LoggerFn = WriteResults + ctxCopyLogger := operations.WithSyncLogger(ctxCopy, logger) var err error if b.opt.Resync { - err = sync.CopyDir(ctxCopy, fdst, fsrc, b.opt.CreateEmptySrcDirs) + err = sync.CopyDir(ctxCopyLogger, fdst, fsrc, b.opt.CreateEmptySrcDirs) } else { - err = sync.Sync(ctxCopy, fdst, fsrc, b.opt.CreateEmptySrcDirs) + err = sync.Sync(ctxCopyLogger, fdst, fsrc, b.opt.CreateEmptySrcDirs) } - return err + fs.Debugf(nil, "logger is: %v", logger) + + getResults := ReadResults(logger.JSON) + fs.Debugf(nil, "Got %v results for %v", len(getResults), queueName) + + lineFormat := "%s %8d %s %s %s %q\n" + for _, result := range getResults { + fs.Debugf(nil, lineFormat, result.Flags, result.Size, result.Hash, "", result.Modtime, result.Name) + } + + return getResults, err +} + +func (b *bisyncRun) resyncDir(ctx context.Context, fsrc, fdst fs.Fs) ([]Results, error) { + ignoreListingChecksum = b.opt.IgnoreListingChecksum + logger.LoggerFn = WriteResults + ctxCopyLogger := operations.WithSyncLogger(ctx, logger) + err := sync.CopyDir(ctxCopyLogger, fdst, fsrc, b.opt.CreateEmptySrcDirs) + fs.Debugf(nil, "logger is: %v", logger) + + getResults := ReadResults(logger.JSON) + fs.Debugf(nil, "Got %v results for %v", len(getResults), "resync") + + return getResults, err } // operation should be "make" or "remove" -func (b *bisyncRun) syncEmptyDirs(ctx context.Context, dst fs.Fs, candidates bilib.Names, dirsList *fileList, operation string) { +func (b *bisyncRun) syncEmptyDirs(ctx context.Context, dst fs.Fs, candidates bilib.Names, dirsList *fileList, results *[]Results, operation string) { if b.opt.CreateEmptySrcDirs && (!b.opt.Resync || operation == "make") { candidatesList := candidates.ToList() @@ -46,18 +194,50 @@ func (b *bisyncRun) syncEmptyDirs(ctx context.Context, dst fs.Fs, candidates bil for _, s := range candidatesList { var direrr error if dirsList.has(s) { //make sure it's a dir, not a file + r := Results{} + r.Name = s + r.Size = 0 + r.Modtime = dirsList.getTime(s).In(time.UTC) + r.Flags = "d" + r.Err = nil + r.Winner = operations.Winner{ // note: Obj not set + Side: "src", + Err: nil, + } + + rSrc := r + rDst := r + rSrc.IsSrc = true + rSrc.IsDst = false + rDst.IsSrc = false + rDst.IsDst = true + rSrc.IsWinner = true + rDst.IsWinner = false + if operation == "remove" { // directories made empty by the sync will have already been deleted during the sync // this just catches the already-empty ones (excluded from sync by --files-from filter) direrr = operations.TryRmdir(ctx, dst, s) + rSrc.Sigil = operations.MissingOnSrc + rDst.Sigil = operations.MissingOnSrc + rSrc.Dst = s + rDst.Dst = s + rSrc.Winner.Side = "none" + rDst.Winner.Side = "none" } else if operation == "make" { direrr = operations.Mkdir(ctx, dst, s) + rSrc.Sigil = operations.MissingOnDst + rDst.Sigil = operations.MissingOnDst + rSrc.Src = s + rDst.Src = s } else { direrr = fmt.Errorf("invalid operation. Expected 'make' or 'remove', received '%q'", operation) } if direrr != nil { fs.Debugf(nil, "Error syncing directory: %v", direrr) + } else { + *results = append(*results, rSrc, rDst) } } } diff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.copy1to2.que b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.copy1to2.que new file mode 100644 index 0000000000000..a49deb16cb659 --- /dev/null +++ b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.copy1to2.que @@ -0,0 +1 @@ +"subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.copy2to1.que b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.copy2to1.que new file mode 100644 index 0000000000000..029f3e190ed2c --- /dev/null +++ b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.copy2to1.que @@ -0,0 +1 @@ +"file1.txt" diff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path1.lst b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path1.lst new file mode 100644 index 0000000000000..f0208cb9a5d79 --- /dev/null +++ b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path1.lst @@ -0,0 +1,9 @@ +# bisync listing v1 from test +- 109 - - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" +- 19 - - 2001-01-02T00:00:00.000000000+0000 "file1.txt" +- 19 - - 2001-01-02T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path1.lst-new b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path1.lst-new new file mode 100644 index 0000000000000..ff700931622c2 --- /dev/null +++ b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path1.lst-new @@ -0,0 +1,9 @@ +# bisync listing v1 from test +- 109 - - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 19 - - 2001-01-02T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path2.lst b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path2.lst new file mode 100644 index 0000000000000..f0208cb9a5d79 --- /dev/null +++ b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path2.lst @@ -0,0 +1,9 @@ +# bisync listing v1 from test +- 109 - - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" +- 19 - - 2001-01-02T00:00:00.000000000+0000 "file1.txt" +- 19 - - 2001-01-02T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path2.lst-new b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path2.lst-new new file mode 100644 index 0000000000000..21a22d1e30a4b --- /dev/null +++ b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path2.lst-new @@ -0,0 +1,9 @@ +# bisync listing v1 from test +- 109 - - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" +- 19 - - 2001-01-02T00:00:00.000000000+0000 "file1.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/golden/test.log b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/test.log new file mode 100644 index 0000000000000..993e3655989f5 --- /dev/null +++ b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/test.log @@ -0,0 +1,39 @@ +(01) : test basic + + +(02) : test initial bisync +(03) : bisync resync +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Copying unique Path2 files to Path1 +INFO : Resynching Path1 to Path2 +INFO : Resync updating listings +INFO : Bisync successful +(04) : bisync resync ignore-listing-checksum +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Copying unique Path2 files to Path1 +INFO : Resynching Path1 to Path2 +INFO : Resync updating listings +INFO : Bisync successful + +(05) : test place newer files on both paths + +(06) : touch-copy 2001-01-02 {datadir/}file1.txt {path2/} +(07) : copy-as {datadir/}file1.txt {path1/}subdir file20.txt + +(08) : test bisync run +(09) : bisync ignore-listing-checksum +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Path1 checking for diffs +INFO : - Path1 File is newer - subdir/file20.txt +INFO : Path1: 1 changes: 0 new, 1 newer, 0 older, 0 deleted +INFO : Path2 checking for diffs +INFO : - Path2 File is newer - file1.txt +INFO : Path2: 1 changes: 0 new, 1 newer, 0 older, 0 deleted +INFO : Applying changes +INFO : - Path1 Queue copy to Path2 - {path2/}subdir/file20.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt +INFO : - Path2 Do queued copies to - Path1 +INFO : - Path1 Do queued copies to - Path2 +INFO : Updating listings +INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" +INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/initial/RCLONE_TEST b/cmd/bisync/testdata/test_ignorelistingchecksum/initial/RCLONE_TEST new file mode 100644 index 0000000000000..d8ca97c2a4dbe --- /dev/null +++ b/cmd/bisync/testdata/test_ignorelistingchecksum/initial/RCLONE_TEST @@ -0,0 +1 @@ +This file is used for testing the health of rclone accesses to the local/remote file system. Do not delete. diff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/initial/file1.copy1.txt b/cmd/bisync/testdata/test_ignorelistingchecksum/initial/file1.copy1.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/initial/file1.copy2.txt b/cmd/bisync/testdata/test_ignorelistingchecksum/initial/file1.copy2.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/initial/file1.copy3.txt b/cmd/bisync/testdata/test_ignorelistingchecksum/initial/file1.copy3.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/initial/file1.copy4.txt b/cmd/bisync/testdata/test_ignorelistingchecksum/initial/file1.copy4.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/initial/file1.copy5.txt b/cmd/bisync/testdata/test_ignorelistingchecksum/initial/file1.copy5.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/initial/file1.txt b/cmd/bisync/testdata/test_ignorelistingchecksum/initial/file1.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/initial/subdir/file20.txt b/cmd/bisync/testdata/test_ignorelistingchecksum/initial/subdir/file20.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/modfiles/file1.txt b/cmd/bisync/testdata/test_ignorelistingchecksum/modfiles/file1.txt new file mode 100644 index 0000000000000..464147f09c0c8 --- /dev/null +++ b/cmd/bisync/testdata/test_ignorelistingchecksum/modfiles/file1.txt @@ -0,0 +1 @@ +This file is newer diff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/scenario.txt b/cmd/bisync/testdata/test_ignorelistingchecksum/scenario.txt new file mode 100644 index 0000000000000..b4bd11e34e9ee --- /dev/null +++ b/cmd/bisync/testdata/test_ignorelistingchecksum/scenario.txt @@ -0,0 +1,14 @@ +test basic +# Simple test case for development + +test initial bisync +bisync resync +bisync resync ignore-listing-checksum + +test place newer files on both paths +# force specific modification time since file time is lost through git +touch-copy 2001-01-02 {datadir/}file1.txt {path2/} +copy-as {datadir/}file1.txt {path1/}subdir file20.txt + +test bisync run +bisync ignore-listing-checksum diff --git a/docs/content/bisync.md b/docs/content/bisync.md index 44bfc58c813b2..e010eba02cb75 100644 --- a/docs/content/bisync.md +++ b/docs/content/bisync.md @@ -277,7 +277,39 @@ sync run times for very large numbers of files. The check may be run manually with `--check-sync=only`. It runs only the integrity check and terminates without actually synching. -See also: [Concurrent modifications](#concurrent-modifications) +Note that currently, `--check-sync` **only checks filenames and NOT modtime, size, or hash.** +For a more robust integrity check of the current state, consider using [`check`](commands/rclone_check/) +(or [`cryptcheck`](/commands/rclone_cryptcheck/), if at least one path is a `crypt` remote.) +For example, a possible sequence could look like this: + +1. Normally scheduled bisync run: + +``` +rclone bisync Path1 Path2 -MPc --check-access --max-delete 10 --filters-file /path/to/filters.txt -v --no-cleanup --ignore-listing-checksum --disable ListR --checkers=16 --drive-pacer-min-sleep=10ms --create-empty-src-dirs --resilient +``` + +2. Periodic independent integrity check (perhaps scheduled nightly or weekly): + +``` +rclone check -MvPc Path1 Path2 --filter-from /path/to/filters.txt +``` + +3. If diffs are found, you have some choices to correct them. +If one side is more up-to-date and you want to make the other side match it, you could run: + +``` +rclone sync Path1 Path2 --filter-from /path/to/filters.txt --create-empty-src-dirs -MPc -v +``` +(or switch Path1 and Path2 to make Path2 the source-of-truth) + +Or, if neither side is totally up-to-date, you could run a `--resync` to bring them back into agreement +(but remember that this could cause deleted files to re-appear.) + +*Note also that `rclone check` does not currently include empty directories, +so if you want to know if any empty directories are out of sync, +consider alternatively running the above `rclone sync` command with `--dry-run` added. + +See also: [Concurrent modifications](#concurrent-modifications), [`--resilient`](#resilient) #### --ignore-listing-checksum @@ -299,13 +331,6 @@ if there ARE diffs. * Unless `--ignore-listing-checksum` is passed, bisync currently computes hashes for one path *even when there's no common hash with the other path* (for example, a [crypt](/crypt/#modification-times-and-hashes) remote.) -* If both paths support checksums and have a common hash, -AND `--ignore-listing-checksum` was not specified when creating the listings, -`--check-sync=only` can be used to compare Path1 vs. Path2 checksums (as of the time the previous listings were created.) -However, `--check-sync=only` will NOT include checksums if the previous listings -were generated on a run using `--ignore-listing-checksum`. For a more robust integrity check of the current state, -consider using [`check`](commands/rclone_check/) -(or [`cryptcheck`](/commands/rclone_cryptcheck/), if at least one path is a `crypt` remote.) #### --resilient @@ -495,44 +520,18 @@ original path on the next sync, resulting in data loss. It is therefore recommended to _omit_ `--inplace`. Files that **change during** a bisync run may result in data loss. -This has been seen in a highly dynamic environment, where the filesystem -is getting hammered by running processes during the sync. -The currently recommended solution is to sync at quiet times or [filter out](#filtering) -unnecessary directories and files. - -As an [alternative approach](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=scans%2C%20to%20avoid-,errors%20if%20files%20changed%20during%20sync,-Given%20the%20number), -consider using `--check-sync=false` (and possibly `--resilient`) to make bisync more forgiving -of filesystems that change during the sync. -Be advised that this may cause bisync to miss events that occur during a bisync run, -so it is a good idea to supplement this with a periodic independent integrity check, -and corrective sync if diffs are found. For example, a possible sequence could look like this: - -1. Normally scheduled bisync run: - -``` -rclone bisync Path1 Path2 -MPc --check-access --max-delete 10 --filters-file /path/to/filters.txt -v --check-sync=false --no-cleanup --ignore-listing-checksum --disable ListR --checkers=16 --drive-pacer-min-sleep=10ms --create-empty-src-dirs --resilient -``` - -2. Periodic independent integrity check (perhaps scheduled nightly or weekly): - -``` -rclone check -MvPc Path1 Path2 --filter-from /path/to/filters.txt -``` - -3. If diffs are found, you have some choices to correct them. -If one side is more up-to-date and you want to make the other side match it, you could run: - -``` -rclone sync Path1 Path2 --filter-from /path/to/filters.txt --create-empty-src-dirs -MPc -v -``` -(or switch Path1 and Path2 to make Path2 the source-of-truth) - -Or, if neither side is totally up-to-date, you could run a `--resync` to bring them back into agreement -(but remember that this could cause deleted files to re-appear.) - -*Note also that `rclone check` does not currently include empty directories, -so if you want to know if any empty directories are out of sync, -consider alternatively running the above `rclone sync` command with `--dry-run` added. +Prior to `rclone v1.65`, this was commonly seen in highly dynamic environments, where the filesystem +was getting hammered by running processes during the sync. +As of `rclone v1.65`, bisync was redesigned to use a "snapshot" model, +greatly reducing the risks from changes during a sync. +Changes that are not detected during the current sync will now be detected during the following sync, +and will no longer cause the entire run to throw a critical error. +There is additionally a mechanism to mark files as needing to be internally rechecked next time, for added safety. +It should therefore no longer be necessary to sync only at quiet times -- +however, note that an error can still occur if a file happens to change at the exact moment it's +being read/written by bisync (same as would happen in `rclone sync`.) +(See also: [`--ignore-checksum`](https://rclone.org/docs/#ignore-checksum), +[`--local-no-check-updated`](https://rclone.org/local/#local-no-check-updated)) ### Empty directories @@ -1273,6 +1272,8 @@ about _Unison_ and synchronization in general. * Copies and deletes are now handled in one operation instead of two * `--track-renames` and `--backup-dir` are now supported * Partial uploads known issue on `local`/`ftp`/`sftp` has been resolved (unless using `--inplace`) +* Final listings are now generated from sync results, to avoid needing to re-list +* Bisync is now much more resilient to changes that happen during a bisync run, and far less prone to critical errors / undetected changes ### `v1.64` * Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Dry%20runs%20are%20not%20completely%20dry) From 079763f09ade2d6e92a5995c1c02fad42c8e48cd Mon Sep 17 00:00:00 2001 From: nielash Date: Fri, 6 Oct 2023 16:36:00 -0400 Subject: [PATCH 110/130] bisync: isDir check for deltas Before this change, if --create-empty-src-dirs was specified, bisync would include directories in the list of deltas to evaluate by their modtime, relative to the prior sync. This was unnecessary, as rclone does not yet support setting modtime for directories. After this change, we skip directories when comparing modtimes. (In other words, we care only if a directory is created or deleted, not whether it is newer or older.) --- cmd/bisync/deltas.go | 23 +++++++++++++---------- cmd/bisync/listing.go | 11 +++++++++++ 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/cmd/bisync/deltas.go b/cmd/bisync/deltas.go index 9d565eba62308..87e274d0e24d4 100644 --- a/cmd/bisync/deltas.go +++ b/cmd/bisync/deltas.go @@ -174,18 +174,21 @@ func (b *bisyncRun) findDeltas(fctx context.Context, f fs.Fs, oldListing, newLis ds.deleted++ d |= deltaDeleted } else { - if old.getTime(file) != now.getTime(file) { - if old.beforeOther(now, file) { - fs.Debugf(file, "(old: %v current: %v", old.getTime(file), now.getTime(file)) - b.indent(msg, file, "File is newer") - d |= deltaNewer - } else { // Current version is older than prior sync. - fs.Debugf(file, "(old: %v current: %v", old.getTime(file), now.getTime(file)) - b.indent(msg, file, "File is OLDER") - d |= deltaOlder + // skip dirs here, as we only care if they are new/deleted, not newer/older + if !now.isDir(file) { + if old.getTime(file) != now.getTime(file) { + if old.beforeOther(now, file) { + fs.Debugf(file, "(old: %v current: %v", old.getTime(file), now.getTime(file)) + b.indent(msg, file, "File is newer") + d |= deltaNewer + } else { // Current version is older than prior sync. + fs.Debugf(file, "(old: %v current: %v", old.getTime(file), now.getTime(file)) + b.indent(msg, file, "File is OLDER") + d |= deltaOlder + } } + // TODO Compare sizes and hashes } - // TODO Compare sizes and hashes } if d.is(deltaModified) { diff --git a/cmd/bisync/listing.go b/cmd/bisync/listing.go index 4a71d150041f8..a6474b78aa378 100644 --- a/cmd/bisync/listing.go +++ b/cmd/bisync/listing.go @@ -128,6 +128,17 @@ func (ls *fileList) getTime(file string) time.Time { return fi.time } +// also returns false if not found +func (ls *fileList) isDir(file string) bool { + fi := ls.get(file) + if fi != nil { + if fi.flags == "d" { + return true + } + } + return false +} + func (ls *fileList) beforeOther(other *fileList, file string) bool { thisTime := ls.getTime(file) thatTime := other.getTime(file) From 6d6dc00abba2bbc7f6e87a141387c36bc0a3f0a4 Mon Sep 17 00:00:00 2001 From: nielash Date: Fri, 6 Oct 2023 16:38:47 -0400 Subject: [PATCH 111/130] bisync: rollback listing on error Before this change, bisync had no mechanism for "retrying" a file again next time, in the event of an unexpected and possibly temporary error. After this change, bisync is now essentially able to mark a file as needing to be rechecked next time. Bisync does this by keeping one prior listing on hand at all times. In a low-confidence situation, bisync can revert a given file row back to its state at the end of the last known successful sync, ensuring that any subsequent changes will be re-noticed on the next run. This can potentially be helpful for a dynamically changing file system, where files may be changing quickly while bisync is working with them. --- cmd/bisync/bisync_test.go | 35 ++- cmd/bisync/cmd.go | 4 + cmd/bisync/listing.go | 65 +++- cmd/bisync/operations.go | 123 ++++---- cmd/bisync/queue.go | 1 + ...estdir_path1.._testdir_path2.path1.lst-old | 9 + ...estdir_path1.._testdir_path2.path2.lst-old | 9 + .../_testdir_path1.._testdir_path2.path1.lst | 1 + ...estdir_path1.._testdir_path2.path1.lst-new | 1 + ...estdir_path1.._testdir_path2.path1.lst-old | 10 + .../_testdir_path1.._testdir_path2.path2.lst | 1 + ...estdir_path1.._testdir_path2.path2.lst-new | 1 + ...estdir_path1.._testdir_path2.path2.lst-old | 10 + ...estdir_path1.._testdir_path2.path1.lst-old | 10 + ...estdir_path1.._testdir_path2.path2.lst-old | 10 + ...estdir_path1.._testdir_path2.path1.lst-old | 8 + ...estdir_path1.._testdir_path2.path2.lst-old | 8 + ...estdir_path1.._testdir_path2.path1.lst-old | 8 + ...estdir_path1.._testdir_path2.path2.lst-old | 8 + ...estdir_path1.._testdir_path2.path1.lst-old | 8 + ...estdir_path1.._testdir_path2.path2.lst-old | 8 + ...estdir_path1.._testdir_path2.path1.lst-old | 8 + ...estdir_path1.._testdir_path2.path2.lst-old | 8 + ...estdir_path1.._testdir_path2.path1.lst-old | 10 + ...estdir_path1.._testdir_path2.path2.lst-old | 10 + ...estdir_path1.._testdir_path2.path1.lst-old | 10 + ...estdir_path1.._testdir_path2.path2.lst-old | 10 + ...estdir_path1.._testdir_path2.path1.lst-old | 10 + ...estdir_path1.._testdir_path2.path2.lst-old | 10 + ...estdir_path1.._testdir_path2.path1.lst-old | 14 + ...estdir_path1.._testdir_path2.path2.lst-old | 14 + ...estdir_path1.._testdir_path2.path1.lst-old | 14 + ...estdir_path1.._testdir_path2.path2.lst-old | 14 + ...estdir_path1.._testdir_path2.path1.lst-old | 14 + ...estdir_path1.._testdir_path2.path2.lst-old | 14 + ...estdir_path1.._testdir_path2.path1.lst-old | 8 + ...estdir_path1.._testdir_path2.path2.lst-old | 8 + ...estdir_path1.._testdir_path2.path1.lst-old | 8 + ...estdir_path1.._testdir_path2.path2.lst-old | 8 + ...estdir_path1.._testdir_path2.path1.lst-old | 8 + ...estdir_path1.._testdir_path2.path2.lst-old | 8 + ...estdir_path1.._testdir_path2.path1.lst-old | 10 + ...estdir_path1.._testdir_path2.path2.lst-old | 10 + ...estdir_path1.._testdir_path2.path1.lst-old | 7 + ...estdir_path1.._testdir_path2.path2.lst-old | 7 + ...ir_path1.._testdir_path2.path1.lst-dry-old | 9 + ...estdir_path1.._testdir_path2.path1.lst-old | 9 + ...ir_path1.._testdir_path2.path2.lst-dry-old | 9 + ...estdir_path1.._testdir_path2.path2.lst-old | 9 + ...ir_path1.._testdir_path2.path1.lst-dry-old | 9 + ...ir_path1.._testdir_path2.path2.lst-dry-old | 9 + ...ir_path1.._testdir_path2.path1.lst-dry-old | 9 + ...ir_path1.._testdir_path2.path2.lst-dry-old | 9 + ...estdir_path1.._testdir_path2.path1.lst-old | 4 + ...estdir_path1.._testdir_path2.path2.lst-old | 4 + ...estdir_path1.._testdir_path2.path1.lst-old | 13 + ...estdir_path1.._testdir_path2.path2.lst-old | 13 + ...estdir_path1.._testdir_path2.path1.lst-old | 13 + ...estdir_path1.._testdir_path2.path2.lst-old | 13 + ...__\304\233_\303\241\303\261.path1.lst-old" | 4 + ...__\304\233_\303\241\303\261.path2.lst-old" | 4 + ...estdir_path1.._testdir_path2.path1.lst-old | 11 + ...estdir_path1.._testdir_path2.path2.lst-old | 11 + ...estdir_path1.._testdir_path2.path1.lst-old | 10 + ...estdir_path1.._testdir_path2.path2.lst-old | 10 + ...estdir_path1.._testdir_path2.path1.lst-old | 5 + ...estdir_path1.._testdir_path2.path2.lst-old | 5 + ...estdir_path1.._testdir_path2.path1.lst-old | 9 + ...estdir_path1.._testdir_path2.path2.lst-old | 9 + ...estdir_path1.._testdir_path2.path1.lst-old | 10 + ...estdir_path1.._testdir_path2.path2.lst-old | 10 + ...estdir_path1.._testdir_path2.path1.lst-old | 10 + ...estdir_path1.._testdir_path2.path2.lst-old | 10 + ...estdir_path1.._testdir_path2.path1.lst-old | 6 + ...estdir_path1.._testdir_path2.path2.lst-old | 6 + ...estdir_path1.._testdir_path2.path1.lst-old | 9 + ...estdir_path1.._testdir_path2.path2.lst-old | 9 + ...1._testdir_path1.._testdir_path2.path1.lst | 16 +- ...2._testdir_path1.._testdir_path2.path2.lst | 16 +- ...estdir_path1.._testdir_path2.path1.lst-old | 8 + ...estdir_path1.._testdir_path2.path2.lst-old | 8 + ...testdir_path1.._testdir_path2.copy1to2.que | 1 + ...testdir_path1.._testdir_path2.copy2to1.que | 1 + .../_testdir_path1.._testdir_path2.path1.lst | 103 ++++++ ...estdir_path1.._testdir_path2.path1.lst-new | 104 +++++++ ...estdir_path1.._testdir_path2.path1.lst-old | 103 ++++++ .../_testdir_path1.._testdir_path2.path2.lst | 103 ++++++ ...estdir_path1.._testdir_path2.path2.lst-new | 104 +++++++ ...estdir_path1.._testdir_path2.path2.lst-old | 103 ++++++ .../testdata/test_volatile/golden/test.log | 292 ++++++++++++++++++ .../test_volatile/initial/RCLONE_TEST | 1 + .../testdata/test_volatile/initial/file1.txt | 0 .../testdata/test_volatile/initial/file2.txt | 0 .../testdata/test_volatile/initial/file3.txt | 0 .../testdata/test_volatile/initial/file4.txt | 0 .../testdata/test_volatile/initial/file5.txt | 0 .../testdata/test_volatile/initial/file6.txt | 0 .../testdata/test_volatile/initial/file7.txt | 0 .../testdata/test_volatile/initial/file8.txt | 0 .../testdata/test_volatile/modfiles/dummy.txt | 0 .../testdata/test_volatile/modfiles/file1.txt | 1 + .../test_volatile/modfiles/file10.txt | 1 + .../test_volatile/modfiles/file11.txt | 1 + .../testdata/test_volatile/modfiles/file2.txt | 1 + .../test_volatile/modfiles/file5L.txt | 1 + .../test_volatile/modfiles/file5R.txt | 1 + .../testdata/test_volatile/modfiles/file6.txt | 1 + .../testdata/test_volatile/modfiles/file7.txt | 1 + .../testdata/test_volatile/scenario.txt | 34 ++ docs/content/bisync.md | 1 + 110 files changed, 1791 insertions(+), 75 deletions(-) create mode 100644 cmd/bisync/testdata/test_all_changed/golden/_testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_all_changed/golden/_testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_check_access/golden/_testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_check_access/golden/_testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_check_access/golden/missing-listings._testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_check_access/golden/missing-listings._testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_check_access/golden/path1-missing._testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_check_access/golden/path1-missing._testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_check_access/golden/path2-missing._testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_check_access/golden/path2-missing._testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_check_access_filters/golden/exclude-error-run._testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_check_access_filters/golden/exclude-error-run._testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_check_access_filters/golden/exclude-initial._testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_check_access_filters/golden/exclude-initial._testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_check_access_filters/golden/exclude-pass-run._testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_check_access_filters/golden/exclude-pass-run._testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_check_access_filters/golden/include-error-run._testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_check_access_filters/golden/include-error-run._testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_check_access_filters/golden/include-initial._testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_check_access_filters/golden/include-initial._testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_check_access_filters/golden/include-pass-run._testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_check_access_filters/golden/include-pass-run._testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_check_filename/golden/_testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_check_filename/golden/_testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_check_filename/golden/initial-pass._testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_check_filename/golden/initial-pass._testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_check_filename/golden/path2-missing._testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_check_filename/golden/path2-missing._testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_check_sync/golden/_testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_check_sync/golden/_testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst-dry-old create mode 100644 cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst-dry-old create mode 100644 cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path1.lst-dry-old create mode 100644 cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path2.lst-dry-old create mode 100644 cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path1.lst-dry-old create mode 100644 cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path2.lst-dry-old create mode 100644 cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_extended_char_paths/golden/_testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_extended_char_paths/golden/_testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_extended_char_paths/golden/check-access-pass._testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_extended_char_paths/golden/check-access-pass._testdir_path1.._testdir_path2.path2.lst-old create mode 100644 "cmd/bisync/testdata/test_extended_char_paths/golden/normal-sync._testdir_path1_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.._testdir_path2_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.path1.lst-old" create mode 100644 "cmd/bisync/testdata/test_extended_char_paths/golden/normal-sync._testdir_path1_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.._testdir_path2_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.path2.lst-old" create mode 100644 cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_filters/golden/_testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_filters/golden/_testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_max_delete_path1/golden/_testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_max_delete_path1/golden/_testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_max_delete_path2_force/golden/_testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_max_delete_path2_force/golden/_testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_rclone_args/golden/_testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_rclone_args/golden/_testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_resync/golden/_testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_resync/golden/_testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_rmdirs/golden/_testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_rmdirs/golden/_testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.copy1to2.que create mode 100644 cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.copy2to1.que create mode 100644 cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst create mode 100644 cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst-new create mode 100644 cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst create mode 100644 cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst-new create mode 100644 cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_volatile/golden/test.log create mode 100644 cmd/bisync/testdata/test_volatile/initial/RCLONE_TEST create mode 100644 cmd/bisync/testdata/test_volatile/initial/file1.txt create mode 100644 cmd/bisync/testdata/test_volatile/initial/file2.txt create mode 100644 cmd/bisync/testdata/test_volatile/initial/file3.txt create mode 100644 cmd/bisync/testdata/test_volatile/initial/file4.txt create mode 100644 cmd/bisync/testdata/test_volatile/initial/file5.txt create mode 100644 cmd/bisync/testdata/test_volatile/initial/file6.txt create mode 100644 cmd/bisync/testdata/test_volatile/initial/file7.txt create mode 100644 cmd/bisync/testdata/test_volatile/initial/file8.txt create mode 100644 cmd/bisync/testdata/test_volatile/modfiles/dummy.txt create mode 100644 cmd/bisync/testdata/test_volatile/modfiles/file1.txt create mode 100644 cmd/bisync/testdata/test_volatile/modfiles/file10.txt create mode 100644 cmd/bisync/testdata/test_volatile/modfiles/file11.txt create mode 100644 cmd/bisync/testdata/test_volatile/modfiles/file2.txt create mode 100644 cmd/bisync/testdata/test_volatile/modfiles/file5L.txt create mode 100644 cmd/bisync/testdata/test_volatile/modfiles/file5R.txt create mode 100644 cmd/bisync/testdata/test_volatile/modfiles/file6.txt create mode 100644 cmd/bisync/testdata/test_volatile/modfiles/file7.txt create mode 100644 cmd/bisync/testdata/test_volatile/scenario.txt diff --git a/cmd/bisync/bisync_test.go b/cmd/bisync/bisync_test.go index 97c84fc8117ef..89b6b18ee83ad 100644 --- a/cmd/bisync/bisync_test.go +++ b/cmd/bisync/bisync_test.go @@ -166,6 +166,7 @@ type bisyncTest struct { golden bool debug bool stopAt int + TestFn bisync.TestFunc } // TestBisync is a test engine for bisync test cases. @@ -466,6 +467,21 @@ func (b *bisyncTest) runTestStep(ctx context.Context, line string) (err error) { ci.LogLevel = fs.LogLevelDebug } + testFunc := func() { + testname := "volatile" + path := "path1" + src := filepath.Join(b.tempDir, testname, path, "file7.txt") + dstBase1 := filepath.Join(b.tempDir, testname, "path1", "file") + dstBase2 := filepath.Join(b.tempDir, testname, "path2", "file") + + for i := 0; i < 50; i++ { + dst := dstBase2 + fmt.Sprint(i) + ".txt" + _ = bilib.CopyFile(src, dst) + dst = dstBase1 + fmt.Sprint(100-i) + ".txt" + _ = bilib.CopyFile(src, dst) + } + } + args := splitLine(line) switch args[0] { case "test": @@ -545,6 +561,9 @@ func (b *bisyncTest) runTestStep(ctx context.Context, line string) (err error) { return b.listSubdirs(ctx, args[1]) case "bisync": return b.runBisync(ctx, args[1:]) + case "test-func": + b.TestFn = testFunc + return default: return fmt.Errorf("unknown command: %q", args[0]) } @@ -594,6 +613,7 @@ func (b *bisyncTest) runBisync(ctx context.Context, args []string) (err error) { MaxDelete: bisync.DefaultMaxDelete, CheckFilename: bisync.DefaultCheckFilename, CheckSync: bisync.CheckSyncTrue, + TestFn: b.TestFn, } octx, ci := fs.AddConfig(ctx) fs1, fs2 := b.fs1, b.fs2 @@ -1228,8 +1248,19 @@ func (b *bisyncTest) ensureDir(parent, dir string, optional bool) string { func (b *bisyncTest) listDir(dir string) (names []string) { files, err := os.ReadDir(dir) require.NoError(b.t, err) + ignoreIt := func(file string) bool { + ignoreList := []string{ + // ".lst-control", ".lst-dry-control", ".lst-old", ".lst-dry-old", + ".DS_Store"} + for _, s := range ignoreList { + if strings.Contains(file, s) { + return true + } + } + return false + } for _, file := range files { - if strings.Contains(file.Name(), ".lst-control") || strings.Contains(file.Name(), ".lst-dry-control") || strings.Contains(file.Name(), ".DS_Store") { + if ignoreIt(file.Name()) { continue } names = append(names, filepath.Base(norm.NFC.String(file.Name()))) @@ -1248,7 +1279,7 @@ func fileType(fileName string) string { return "log" } switch filepath.Ext(fileName) { - case ".lst", ".lst-new", ".lst-err", ".lst-dry", ".lst-dry-new": + case ".lst", ".lst-new", ".lst-err", ".lst-dry", ".lst-dry-new", ".lst-old", ".lst-dry-old", ".lst-control", ".lst-dry-control": return "listing" case ".que": return "queue" diff --git a/cmd/bisync/cmd.go b/cmd/bisync/cmd.go index 1a48660354188..c3a2e1e57fea3 100644 --- a/cmd/bisync/cmd.go +++ b/cmd/bisync/cmd.go @@ -25,6 +25,9 @@ import ( "github.com/spf13/cobra" ) +// TestFunc allows mocking errors during tests +type TestFunc func() + // Options keep bisync options type Options struct { Resync bool @@ -42,6 +45,7 @@ type Options struct { SaveQueues bool // save extra debugging files (test only flag) IgnoreListingChecksum bool Resilient bool + TestFn TestFunc // test-only option, for mocking errors } // Default values diff --git a/cmd/bisync/listing.go b/cmd/bisync/listing.go index a6474b78aa378..25953a4ec9a16 100644 --- a/cmd/bisync/listing.go +++ b/cmd/bisync/listing.go @@ -15,6 +15,7 @@ import ( "sync" "time" + "github.com/rclone/rclone/cmd/bisync/bilib" "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/filter" "github.com/rclone/rclone/fs/hash" @@ -92,6 +93,12 @@ func (ls *fileList) get(file string) *fileInfo { return info } +// copy file from ls to dest +func (ls *fileList) getPut(file string, dest *fileList) { + f := ls.get(file) + dest.put(file, f.size, f.time, f.hash, f.id, f.flags) +} + func (ls *fileList) remove(file string) { if ls.has(file) { ls.list = slices.Delete(ls.list, slices.Index(ls.list, file), slices.Index(ls.list, file)+1) @@ -285,6 +292,15 @@ func (b *bisyncRun) loadListing(listing string) (*fileList, error) { return ls, nil } +func (b *bisyncRun) saveOldListings() { + if err := bilib.CopyFileIfExists(b.listing1, b.listing1+"-old"); err != nil { + fs.Debugf(b.listing1, "error saving old listing1: %v", err) + } + if err := bilib.CopyFileIfExists(b.listing2, b.listing2+"-old"); err != nil { + fs.Debugf(b.listing1, "error saving old listing2: %v", err) + } +} + func parseHash(str string) (string, string, error) { if str == "-" { return "", "", nil @@ -440,7 +456,7 @@ func ConvertPrecision(Modtime time.Time, dst fs.Fs) time.Time { } // modifyListing will modify the listing based on the results of the sync -func (b *bisyncRun) modifyListing(ctx context.Context, src fs.Fs, dst fs.Fs, srcListing string, dstListing string, results []Results, queues queues, is1to2 bool) (err error) { +func (b *bisyncRun) modifyListing(ctx context.Context, src fs.Fs, dst fs.Fs, results []Results, queues queues, is1to2 bool) (err error) { queue := queues.copy2to1 renames := queues.renamed2 direction := "2to1" @@ -454,6 +470,7 @@ func (b *bisyncRun) modifyListing(ctx context.Context, src fs.Fs, dst fs.Fs, src fs.Debugf(nil, "RESULTS: %v", results) fs.Debugf(nil, "QUEUE: %v", queue) + srcListing, dstListing := b.getListingNames(is1to2) srcList, err := b.loadListing(srcListing) if err != nil { return fmt.Errorf("cannot read prior listing: %w", err) @@ -581,7 +598,7 @@ func (b *bisyncRun) modifyListing(ctx context.Context, src fs.Fs, dst fs.Fs, src } if filterRecheck.HaveFilesFrom() { - b.recheck(ctxRecheck, src, dst, srcList, dstList) + b.recheck(ctxRecheck, src, dst, srcList, dstList, is1to2) } // update files @@ -598,9 +615,11 @@ func (b *bisyncRun) modifyListing(ctx context.Context, src fs.Fs, dst fs.Fs, src } // recheck the ones we're not sure about -func (b *bisyncRun) recheck(ctxRecheck context.Context, src, dst fs.Fs, srcList, dstList *fileList) { +func (b *bisyncRun) recheck(ctxRecheck context.Context, src, dst fs.Fs, srcList, dstList *fileList, is1to2 bool) { var srcObjs []fs.Object var dstObjs []fs.Object + var resolved []string + var toRollback []string if err := operations.ListFn(ctxRecheck, src, func(obj fs.Object) { srcObjs = append(srcObjs, obj) @@ -631,10 +650,50 @@ func (b *bisyncRun) recheck(ctxRecheck context.Context, src, dst fs.Fs, srcList, if operations.Equal(ctxRecheck, srcObj, dstObj) || b.opt.DryRun { putObj(srcObj, src, srcList) putObj(dstObj, dst, dstList) + resolved = append(resolved, srcObj.Remote()) } else { fs.Infof(srcObj, "files not equal on recheck: %v %v", srcObj, dstObj) } } } + // if srcObj not resolved by now (either because no dstObj match or files not equal), + // roll it back to old version, so it gets retried next time. + if !slices.Contains(resolved, srcObj.Remote()) && !b.opt.DryRun { + toRollback = append(toRollback, srcObj.Remote()) + } + } + if len(toRollback) > 0 { + srcListing, dstListing := b.getListingNames(is1to2) + oldSrc, err := b.loadListing(srcListing + "-old") + handleErr(oldSrc, "error loading old src listing", err) // TODO: make this critical? + oldDst, err := b.loadListing(dstListing + "-old") + handleErr(oldDst, "error loading old dst listing", err) // TODO: make this critical? + + for _, item := range toRollback { + rollback(item, oldSrc, srcList) + rollback(item, oldDst, dstList) + } + } +} + +func (b *bisyncRun) getListingNames(is1to2 bool) (srcListing string, dstListing string) { + if is1to2 { + return b.listing1, b.listing2 + } + return b.listing2, b.listing1 +} + +func handleErr(o interface{}, msg string, err error) { + // TODO: add option to make critical? + if err != nil { + fs.Debugf(o, "%s: %v", msg, err) + } +} + +func rollback(item string, oldList, newList *fileList) { + if oldList.has(item) { + oldList.getPut(item, newList) + } else { + newList.remove(item) } } diff --git a/cmd/bisync/operations.go b/cmd/bisync/operations.go index d53a9c40a1db5..38978ee718fb4 100644 --- a/cmd/bisync/operations.go +++ b/cmd/bisync/operations.go @@ -24,14 +24,18 @@ var ErrBisyncAborted = errors.New("bisync aborted") // bisyncRun keeps bisync runtime state type bisyncRun struct { - fs1 fs.Fs - fs2 fs.Fs - abort bool - critical bool - retryable bool - basePath string - workDir string - opt *Options + fs1 fs.Fs + fs2 fs.Fs + abort bool + critical bool + retryable bool + basePath string + workDir string + listing1 string + listing2 string + newListing1 string + newListing2 string + opt *Options } type queues struct { @@ -77,8 +81,10 @@ func Bisync(ctx context.Context, fs1, fs2 fs.Fs, optArg *Options) (err error) { // Produce a unique name for the sync operation b.basePath = filepath.Join(b.workDir, bilib.SessionName(b.fs1, b.fs2)) - listing1 := b.basePath + ".path1.lst" - listing2 := b.basePath + ".path2.lst" + b.listing1 = b.basePath + ".path1.lst" + b.listing2 = b.basePath + ".path2.lst" + b.newListing1 = b.listing1 + "-new" + b.newListing2 = b.listing2 + "-new" // Handle lock file lockFile := "" @@ -108,8 +114,8 @@ func Bisync(ctx context.Context, fs1, fs2 fs.Fs, optArg *Options) (err error) { finaliseOnce.Do(func() { if atexit.Signalled() { fs.Logf(nil, "Bisync interrupted. Must run --resync to recover.") - markFailed(listing1) - markFailed(listing2) + markFailed(b.listing1) + markFailed(b.listing2) _ = os.Remove(lockFile) } }) @@ -118,7 +124,7 @@ func Bisync(ctx context.Context, fs1, fs2 fs.Fs, optArg *Options) (err error) { defer atexit.Unregister(fnHandle) // run bisync - err = b.runLocked(ctx, listing1, listing2) + err = b.runLocked(ctx) if lockFile != "" { errUnlock := os.Remove(lockFile) @@ -136,11 +142,11 @@ func Bisync(ctx context.Context, fs1, fs2 fs.Fs, optArg *Options) (err error) { fs.Errorf(nil, "Bisync critical error: %v", err) fs.Errorf(nil, "Bisync aborted. Error is retryable without --resync due to --resilient mode.") } else { - if bilib.FileExists(listing1) { - _ = os.Rename(listing1, listing1+"-err") + if bilib.FileExists(b.listing1) { + _ = os.Rename(b.listing1, b.listing1+"-err") } - if bilib.FileExists(listing2) { - _ = os.Rename(listing2, listing2+"-err") + if bilib.FileExists(b.listing2) { + _ = os.Rename(b.listing2, b.listing2+"-err") } fs.Errorf(nil, "Bisync critical error: %v", err) fs.Errorf(nil, "Bisync aborted. Must run --resync to recover.") @@ -157,14 +163,14 @@ func Bisync(ctx context.Context, fs1, fs2 fs.Fs, optArg *Options) (err error) { } // runLocked performs a full bisync run -func (b *bisyncRun) runLocked(octx context.Context, listing1, listing2 string) (err error) { +func (b *bisyncRun) runLocked(octx context.Context) (err error) { opt := b.opt path1 := bilib.FsPath(b.fs1) path2 := bilib.FsPath(b.fs2) if opt.CheckSync == CheckSyncOnly { fs.Infof(nil, "Validating listings for Path1 %s vs Path2 %s", quotePath(path1), quotePath(path2)) - if err = b.checkSync(listing1, listing2); err != nil { + if err = b.checkSync(b.listing1, b.listing2); err != nil { b.critical = true b.retryable = true } @@ -175,14 +181,16 @@ func (b *bisyncRun) runLocked(octx context.Context, listing1, listing2 string) ( if opt.DryRun { // In --dry-run mode, preserve original listings and save updates to the .lst-dry files - origListing1 := listing1 - origListing2 := listing2 - listing1 += "-dry" - listing2 += "-dry" - if err := bilib.CopyFileIfExists(origListing1, listing1); err != nil { + origListing1 := b.listing1 + origListing2 := b.listing2 + b.listing1 += "-dry" + b.listing2 += "-dry" + b.newListing1 = b.listing1 + "-new" + b.newListing2 = b.listing2 + "-new" + if err := bilib.CopyFileIfExists(origListing1, b.listing1); err != nil { return err } - if err := bilib.CopyFileIfExists(origListing2, listing2); err != nil { + if err := bilib.CopyFileIfExists(origListing2, b.listing2); err != nil { return err } } @@ -197,11 +205,11 @@ func (b *bisyncRun) runLocked(octx context.Context, listing1, listing2 string) ( // Generate Path1 and Path2 listings and copy any unique Path2 files to Path1 if opt.Resync { - return b.resync(octx, fctx, listing1, listing2) + return b.resync(octx, fctx) } // Check for existence of prior Path1 and Path2 listings - if !bilib.FileExists(listing1) || !bilib.FileExists(listing2) { + if !bilib.FileExists(b.listing1) || !bilib.FileExists(b.listing2) { // On prior critical error abort, the prior listings are renamed to .lst-err to lock out further runs b.critical = true b.retryable = true @@ -210,8 +218,8 @@ func (b *bisyncRun) runLocked(octx context.Context, listing1, listing2 string) ( // Check for Path1 deltas relative to the prior sync fs.Infof(nil, "Path1 checking for diffs") - newListing1 := listing1 + "-new" - ds1, err := b.findDeltas(fctx, b.fs1, listing1, newListing1, "Path1") + newListing1 := b.listing1 + "-new" + ds1, err := b.findDeltas(fctx, b.fs1, b.listing1, newListing1, "Path1") if err != nil { return err } @@ -219,8 +227,8 @@ func (b *bisyncRun) runLocked(octx context.Context, listing1, listing2 string) ( // Check for Path2 deltas relative to the prior sync fs.Infof(nil, "Path2 checking for diffs") - newListing2 := listing2 + "-new" - ds2, err := b.findDeltas(fctx, b.fs2, listing2, newListing2, "Path2") + newListing2 := b.listing2 + "-new" + ds2, err := b.findDeltas(fctx, b.fs2, b.listing2, newListing2, "Path2") if err != nil { return err } @@ -286,19 +294,21 @@ func (b *bisyncRun) runLocked(octx context.Context, listing1, listing2 string) ( // Clean up and check listings integrity fs.Infof(nil, "Updating listings") var err1, err2 error + b.saveOldListings() + // save new listings if noChanges { - err1 = bilib.CopyFileIfExists(newListing1, listing1) - err2 = bilib.CopyFileIfExists(newListing2, listing2) + err1 = bilib.CopyFileIfExists(newListing1, b.listing1) + err2 = bilib.CopyFileIfExists(newListing2, b.listing2) } else { if changes1 { // 2to1 - err1 = b.modifyListing(fctx, b.fs2, b.fs1, listing2, listing1, results2to1, queues, false) + err1 = b.modifyListing(fctx, b.fs2, b.fs1, results2to1, queues, false) } else { - err1 = bilib.CopyFileIfExists(newListing1, listing1) + err1 = bilib.CopyFileIfExists(b.newListing1, b.listing1) } if changes2 { // 1to2 - err2 = b.modifyListing(fctx, b.fs1, b.fs2, listing1, listing2, results1to2, queues, true) + err2 = b.modifyListing(fctx, b.fs1, b.fs2, results1to2, queues, true) } else { - err2 = bilib.CopyFileIfExists(newListing2, listing2) + err2 = bilib.CopyFileIfExists(b.newListing2, b.listing2) } } err = err1 @@ -312,13 +322,13 @@ func (b *bisyncRun) runLocked(octx context.Context, listing1, listing2 string) ( } if !opt.NoCleanup { - _ = os.Remove(newListing1) - _ = os.Remove(newListing2) + _ = os.Remove(b.newListing1) + _ = os.Remove(b.newListing2) } if opt.CheckSync == CheckSyncTrue && !opt.DryRun { fs.Infof(nil, "Validating listings for Path1 %s vs Path2 %s", quotePath(path1), quotePath(path2)) - if err := b.checkSync(listing1, listing2); err != nil { + if err := b.checkSync(b.listing1, b.listing2); err != nil { b.critical = true return err } @@ -346,22 +356,20 @@ func (b *bisyncRun) runLocked(octx context.Context, listing1, listing2 string) ( // resync implements the --resync mode. // It will generate path1 and path2 listings // and copy any unique path2 files to path1. -func (b *bisyncRun) resync(octx, fctx context.Context, listing1, listing2 string) error { +func (b *bisyncRun) resync(octx, fctx context.Context) error { fs.Infof(nil, "Copying unique Path2 files to Path1") - newListing1 := listing1 + "-new" - filesNow1, err := b.makeListing(fctx, b.fs1, newListing1) + filesNow1, err := b.makeListing(fctx, b.fs1, b.newListing1) if err == nil { - err = b.checkListing(filesNow1, newListing1, "current Path1") + err = b.checkListing(filesNow1, b.newListing1, "current Path1") } if err != nil { return err } - newListing2 := listing2 + "-new" - filesNow2, err := b.makeListing(fctx, b.fs2, newListing2) + filesNow2, err := b.makeListing(fctx, b.fs2, b.newListing2) if err == nil { - err = b.checkListing(filesNow2, newListing2, "current Path2") + err = b.checkListing(filesNow2, b.newListing2, "current Path2") } if err != nil { return err @@ -459,23 +467,24 @@ func (b *bisyncRun) resync(octx, fctx context.Context, listing1, listing2 string } fs.Infof(nil, "Resync updating listings") - if err := bilib.CopyFileIfExists(newListing1, listing1); err != nil { + b.saveOldListings() // TODO: also make replaceCurrentListings? + if err := bilib.CopyFileIfExists(b.newListing1, b.listing1); err != nil { return err } - if err := bilib.CopyFileIfExists(newListing2, listing2); err != nil { + if err := bilib.CopyFileIfExists(b.newListing2, b.listing2); err != nil { return err } // resync 2to1 queues.copy2to1 = bilib.ToNames(copy2to1) - if err = b.modifyListing(fctx, b.fs2, b.fs1, listing2, listing1, results2to1, queues, false); err != nil { + if err = b.modifyListing(fctx, b.fs2, b.fs1, results2to1, queues, false); err != nil { b.critical = true return err } // resync 1to2 queues.copy1to2 = bilib.ToNames(filesNow1.list) - if err = b.modifyListing(fctx, b.fs1, b.fs2, listing1, listing2, results1to2, queues, true); err != nil { + if err = b.modifyListing(fctx, b.fs1, b.fs2, results1to2, queues, true); err != nil { b.critical = true return err } @@ -483,14 +492,14 @@ func (b *bisyncRun) resync(octx, fctx context.Context, listing1, listing2 string // resync 2to1 (dirs) dirs2, _ := b.listDirsOnly(2) queues.copy2to1 = bilib.ToNames(dirs2.list) - if err = b.modifyListing(fctx, b.fs2, b.fs1, listing2, listing1, results2to1Dirs, queues, false); err != nil { + if err = b.modifyListing(fctx, b.fs2, b.fs1, results2to1Dirs, queues, false); err != nil { b.critical = true return err } if !b.opt.NoCleanup { - _ = os.Remove(newListing1) - _ = os.Remove(newListing2) + _ = os.Remove(b.newListing1) + _ = os.Remove(b.newListing2) } return nil } @@ -558,3 +567,9 @@ func (b *bisyncRun) checkAccess(checkFiles1, checkFiles2 bilib.Names) error { fs.Infof(nil, "Found %d matching %q files on both paths", numChecks1, opt.CheckFilename) return nil } + +func (b *bisyncRun) testFn() { + if b.opt.TestFn != nil { + b.opt.TestFn() + } +} diff --git a/cmd/bisync/queue.go b/cmd/bisync/queue.go index 111b8991b97b0..d670c033d3bb3 100644 --- a/cmd/bisync/queue.go +++ b/cmd/bisync/queue.go @@ -153,6 +153,7 @@ func (b *bisyncRun) fastCopy(ctx context.Context, fsrc, fdst fs.Fs, files bilib. if b.opt.Resync { err = sync.CopyDir(ctxCopyLogger, fdst, fsrc, b.opt.CreateEmptySrcDirs) } else { + b.testFn() err = sync.Sync(ctxCopyLogger, fdst, fsrc, b.opt.CreateEmptySrcDirs) } fs.Debugf(nil, "logger is: %v", logger) diff --git a/cmd/bisync/testdata/test_all_changed/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_all_changed/golden/_testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..2f8714b930811 --- /dev/null +++ b/cmd/bisync/testdata/test_all_changed/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,9 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2005-01-02T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2005-01-02T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2005-01-02T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2005-01-02T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2005-01-02T00:00:00.000000000+0000 "file1.copy5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2005-01-02T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2005-01-02T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_all_changed/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_all_changed/golden/_testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..2f8714b930811 --- /dev/null +++ b/cmd/bisync/testdata/test_all_changed/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,9 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2005-01-02T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2005-01-02T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2005-01-02T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2005-01-02T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2005-01-02T00:00:00.000000000+0000 "file1.copy5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2005-01-02T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2005-01-02T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst index 86b9e86ee25a7..7471a27cf44bb 100644 --- a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst +++ b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst @@ -1,4 +1,5 @@ # bisync listing v1 from test +- 6148 md5:23b446fda9938c607142c5133cf90689 - 2000-01-01T00:00:00.000000000+0000 ".DS_Store" - 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" diff --git a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst-new b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst-new index 465d2455d7627..f243ade04e741 100644 --- a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst-new +++ b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst-new @@ -1,4 +1,5 @@ # bisync listing v1 from test +- 6148 md5:23b446fda9938c607142c5133cf90689 - 2000-01-01T00:00:00.000000000+0000 ".DS_Store" - 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" diff --git a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..991f89b82a5aa --- /dev/null +++ b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,10 @@ +# bisync listing v1 from test +- 6148 md5:23b446fda9938c607142c5133cf90689 - 2000-01-01T00:00:00.000000000+0000 ".DS_Store" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst index 86b9e86ee25a7..7471a27cf44bb 100644 --- a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst +++ b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst @@ -1,4 +1,5 @@ # bisync listing v1 from test +- 6148 md5:23b446fda9938c607142c5133cf90689 - 2000-01-01T00:00:00.000000000+0000 ".DS_Store" - 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" diff --git a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst-new b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst-new index 9e8bc8a1a516e..dac88bd2cd680 100644 --- a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst-new +++ b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst-new @@ -1,4 +1,5 @@ # bisync listing v1 from test +- 6148 md5:23b446fda9938c607142c5133cf90689 - 2000-01-01T00:00:00.000000000+0000 ".DS_Store" - 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" diff --git a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..991f89b82a5aa --- /dev/null +++ b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,10 @@ +# bisync listing v1 from test +- 6148 md5:23b446fda9938c607142c5133cf90689 - 2000-01-01T00:00:00.000000000+0000 ".DS_Store" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..6af4a00fa097b --- /dev/null +++ b/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,10 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt" diff --git a/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..6af4a00fa097b --- /dev/null +++ b/cmd/bisync/testdata/test_changes/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,10 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt" diff --git a/cmd/bisync/testdata/test_check_access/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_check_access/golden/_testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..788d3f653630b --- /dev/null +++ b/cmd/bisync/testdata/test_check_access/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,8 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_check_access/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_check_access/golden/_testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..788d3f653630b --- /dev/null +++ b/cmd/bisync/testdata/test_check_access/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,8 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_check_access/golden/missing-listings._testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_check_access/golden/missing-listings._testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..788d3f653630b --- /dev/null +++ b/cmd/bisync/testdata/test_check_access/golden/missing-listings._testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,8 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_check_access/golden/missing-listings._testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_check_access/golden/missing-listings._testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..788d3f653630b --- /dev/null +++ b/cmd/bisync/testdata/test_check_access/golden/missing-listings._testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,8 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_check_access/golden/path1-missing._testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_check_access/golden/path1-missing._testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..788d3f653630b --- /dev/null +++ b/cmd/bisync/testdata/test_check_access/golden/path1-missing._testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,8 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_check_access/golden/path1-missing._testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_check_access/golden/path1-missing._testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..788d3f653630b --- /dev/null +++ b/cmd/bisync/testdata/test_check_access/golden/path1-missing._testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,8 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_check_access/golden/path2-missing._testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_check_access/golden/path2-missing._testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..788d3f653630b --- /dev/null +++ b/cmd/bisync/testdata/test_check_access/golden/path2-missing._testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,8 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_check_access/golden/path2-missing._testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_check_access/golden/path2-missing._testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..788d3f653630b --- /dev/null +++ b/cmd/bisync/testdata/test_check_access/golden/path2-missing._testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,8 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_check_access_filters/golden/exclude-error-run._testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_check_access_filters/golden/exclude-error-run._testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..211bd4e31f31c --- /dev/null +++ b/cmd/bisync/testdata/test_check_access_filters/golden/exclude-error-run._testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,10 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/file30.txt" diff --git a/cmd/bisync/testdata/test_check_access_filters/golden/exclude-error-run._testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_check_access_filters/golden/exclude-error-run._testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..211bd4e31f31c --- /dev/null +++ b/cmd/bisync/testdata/test_check_access_filters/golden/exclude-error-run._testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,10 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/file30.txt" diff --git a/cmd/bisync/testdata/test_check_access_filters/golden/exclude-initial._testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_check_access_filters/golden/exclude-initial._testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..211bd4e31f31c --- /dev/null +++ b/cmd/bisync/testdata/test_check_access_filters/golden/exclude-initial._testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,10 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/file30.txt" diff --git a/cmd/bisync/testdata/test_check_access_filters/golden/exclude-initial._testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_check_access_filters/golden/exclude-initial._testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..211bd4e31f31c --- /dev/null +++ b/cmd/bisync/testdata/test_check_access_filters/golden/exclude-initial._testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,10 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/file30.txt" diff --git a/cmd/bisync/testdata/test_check_access_filters/golden/exclude-pass-run._testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_check_access_filters/golden/exclude-pass-run._testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..211bd4e31f31c --- /dev/null +++ b/cmd/bisync/testdata/test_check_access_filters/golden/exclude-pass-run._testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,10 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/file30.txt" diff --git a/cmd/bisync/testdata/test_check_access_filters/golden/exclude-pass-run._testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_check_access_filters/golden/exclude-pass-run._testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..211bd4e31f31c --- /dev/null +++ b/cmd/bisync/testdata/test_check_access_filters/golden/exclude-pass-run._testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,10 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/file30.txt" diff --git a/cmd/bisync/testdata/test_check_access_filters/golden/include-error-run._testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_check_access_filters/golden/include-error-run._testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..cbfc00336486b --- /dev/null +++ b/cmd/bisync/testdata/test_check_access_filters/golden/include-error-run._testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,14 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/file30.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdirX/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdirX/file20.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdirX/subdirX1/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdirX/subdirX1/file30.txt" diff --git a/cmd/bisync/testdata/test_check_access_filters/golden/include-error-run._testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_check_access_filters/golden/include-error-run._testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..cbfc00336486b --- /dev/null +++ b/cmd/bisync/testdata/test_check_access_filters/golden/include-error-run._testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,14 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/file30.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdirX/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdirX/file20.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdirX/subdirX1/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdirX/subdirX1/file30.txt" diff --git a/cmd/bisync/testdata/test_check_access_filters/golden/include-initial._testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_check_access_filters/golden/include-initial._testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..cbfc00336486b --- /dev/null +++ b/cmd/bisync/testdata/test_check_access_filters/golden/include-initial._testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,14 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/file30.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdirX/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdirX/file20.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdirX/subdirX1/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdirX/subdirX1/file30.txt" diff --git a/cmd/bisync/testdata/test_check_access_filters/golden/include-initial._testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_check_access_filters/golden/include-initial._testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..cbfc00336486b --- /dev/null +++ b/cmd/bisync/testdata/test_check_access_filters/golden/include-initial._testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,14 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/file30.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdirX/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdirX/file20.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdirX/subdirX1/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdirX/subdirX1/file30.txt" diff --git a/cmd/bisync/testdata/test_check_access_filters/golden/include-pass-run._testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_check_access_filters/golden/include-pass-run._testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..cbfc00336486b --- /dev/null +++ b/cmd/bisync/testdata/test_check_access_filters/golden/include-pass-run._testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,14 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/file30.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdirX/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdirX/file20.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdirX/subdirX1/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdirX/subdirX1/file30.txt" diff --git a/cmd/bisync/testdata/test_check_access_filters/golden/include-pass-run._testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_check_access_filters/golden/include-pass-run._testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..cbfc00336486b --- /dev/null +++ b/cmd/bisync/testdata/test_check_access_filters/golden/include-pass-run._testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,14 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/subdirB/file30.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdirX/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdirX/file20.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdirX/subdirX1/RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdirX/subdirX1/file30.txt" diff --git a/cmd/bisync/testdata/test_check_filename/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_check_filename/golden/_testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..d9b82dd1caec3 --- /dev/null +++ b/cmd/bisync/testdata/test_check_filename/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,8 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 ".chk_file" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/.chk_file" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_check_filename/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_check_filename/golden/_testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..d9b82dd1caec3 --- /dev/null +++ b/cmd/bisync/testdata/test_check_filename/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,8 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 ".chk_file" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/.chk_file" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_check_filename/golden/initial-pass._testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_check_filename/golden/initial-pass._testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..d9b82dd1caec3 --- /dev/null +++ b/cmd/bisync/testdata/test_check_filename/golden/initial-pass._testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,8 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 ".chk_file" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/.chk_file" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_check_filename/golden/initial-pass._testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_check_filename/golden/initial-pass._testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..d9b82dd1caec3 --- /dev/null +++ b/cmd/bisync/testdata/test_check_filename/golden/initial-pass._testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,8 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 ".chk_file" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/.chk_file" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_check_filename/golden/path2-missing._testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_check_filename/golden/path2-missing._testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..d9b82dd1caec3 --- /dev/null +++ b/cmd/bisync/testdata/test_check_filename/golden/path2-missing._testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,8 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 ".chk_file" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/.chk_file" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_check_filename/golden/path2-missing._testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_check_filename/golden/path2-missing._testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..d9b82dd1caec3 --- /dev/null +++ b/cmd/bisync/testdata/test_check_filename/golden/path2-missing._testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,8 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 ".chk_file" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "subdir/.chk_file" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_check_sync/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_check_sync/golden/_testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..6af4a00fa097b --- /dev/null +++ b/cmd/bisync/testdata/test_check_sync/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,10 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt" diff --git a/cmd/bisync/testdata/test_check_sync/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_check_sync/golden/_testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..6af4a00fa097b --- /dev/null +++ b/cmd/bisync/testdata/test_check_sync/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,10 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt" diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..5d46d406910a8 --- /dev/null +++ b/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,7 @@ +# bisync listing v1 from test +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.txt" diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..5d46d406910a8 --- /dev/null +++ b/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,7 @@ +# bisync listing v1 from test +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.copy5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2001-01-02T00:00:00.000000000+0000 "file1.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst-dry-old b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst-dry-old new file mode 100644 index 0000000000000..8ff472b603e97 --- /dev/null +++ b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst-dry-old @@ -0,0 +1,9 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..8ff472b603e97 --- /dev/null +++ b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,9 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst-dry-old b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst-dry-old new file mode 100644 index 0000000000000..8ff472b603e97 --- /dev/null +++ b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst-dry-old @@ -0,0 +1,9 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..8ff472b603e97 --- /dev/null +++ b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,9 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path1.lst-dry-old b/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path1.lst-dry-old new file mode 100644 index 0000000000000..8ff472b603e97 --- /dev/null +++ b/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path1.lst-dry-old @@ -0,0 +1,9 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path2.lst-dry-old b/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path2.lst-dry-old new file mode 100644 index 0000000000000..8ff472b603e97 --- /dev/null +++ b/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path2.lst-dry-old @@ -0,0 +1,9 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path1.lst-dry-old b/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path1.lst-dry-old new file mode 100644 index 0000000000000..8ff472b603e97 --- /dev/null +++ b/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path1.lst-dry-old @@ -0,0 +1,9 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path2.lst-dry-old b/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path2.lst-dry-old new file mode 100644 index 0000000000000..8ff472b603e97 --- /dev/null +++ b/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path2.lst-dry-old @@ -0,0 +1,9 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..74a0975d9ecc5 --- /dev/null +++ b/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,4 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" diff --git a/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..74a0975d9ecc5 --- /dev/null +++ b/cmd/bisync/testdata/test_equal/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,4 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" diff --git a/cmd/bisync/testdata/test_extended_char_paths/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_extended_char_paths/golden/_testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..577a3380288eb --- /dev/null +++ b/cmd/bisync/testdata/test_extended_char_paths/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,13 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file_enconde_mañana_funcionará.txt" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "filename_contains_ě_.txt" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "filename_contains_ࢺ_.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "Русский.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "測試_check file" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "測試_Русский_ _ _ě_áñ/filename_contains_ě_.txt" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "測試_Русский_ _ _ě_áñ/filename_contains_ࢺ_.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "測試_Русский_ _ _ě_áñ/測試_check file" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "測試_Русский_ _ _ě_áñ/測試_file1p1" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "測試_Русский_ _ _ě_áñ/測試_file1p2" diff --git a/cmd/bisync/testdata/test_extended_char_paths/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_extended_char_paths/golden/_testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..577a3380288eb --- /dev/null +++ b/cmd/bisync/testdata/test_extended_char_paths/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,13 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file_enconde_mañana_funcionará.txt" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "filename_contains_ě_.txt" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "filename_contains_ࢺ_.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "Русский.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "測試_check file" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "測試_Русский_ _ _ě_áñ/filename_contains_ě_.txt" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "測試_Русский_ _ _ě_áñ/filename_contains_ࢺ_.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "測試_Русский_ _ _ě_áñ/測試_check file" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "測試_Русский_ _ _ě_áñ/測試_file1p1" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "測試_Русский_ _ _ě_áñ/測試_file1p2" diff --git a/cmd/bisync/testdata/test_extended_char_paths/golden/check-access-pass._testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_extended_char_paths/golden/check-access-pass._testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..577a3380288eb --- /dev/null +++ b/cmd/bisync/testdata/test_extended_char_paths/golden/check-access-pass._testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,13 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file_enconde_mañana_funcionará.txt" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "filename_contains_ě_.txt" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "filename_contains_ࢺ_.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "Русский.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "測試_check file" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "測試_Русский_ _ _ě_áñ/filename_contains_ě_.txt" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "測試_Русский_ _ _ě_áñ/filename_contains_ࢺ_.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "測試_Русский_ _ _ě_áñ/測試_check file" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "測試_Русский_ _ _ě_áñ/測試_file1p1" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "測試_Русский_ _ _ě_áñ/測試_file1p2" diff --git a/cmd/bisync/testdata/test_extended_char_paths/golden/check-access-pass._testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_extended_char_paths/golden/check-access-pass._testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..577a3380288eb --- /dev/null +++ b/cmd/bisync/testdata/test_extended_char_paths/golden/check-access-pass._testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,13 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file_enconde_mañana_funcionará.txt" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "filename_contains_ě_.txt" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "filename_contains_ࢺ_.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "Русский.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "測試_check file" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "測試_Русский_ _ _ě_áñ/filename_contains_ě_.txt" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "測試_Русский_ _ _ě_áñ/filename_contains_ࢺ_.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "測試_Русский_ _ _ě_áñ/測試_check file" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "測試_Русский_ _ _ě_áñ/測試_file1p1" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "測試_Русский_ _ _ě_áñ/測試_file1p2" diff --git "a/cmd/bisync/testdata/test_extended_char_paths/golden/normal-sync._testdir_path1_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.._testdir_path2_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.path1.lst-old" "b/cmd/bisync/testdata/test_extended_char_paths/golden/normal-sync._testdir_path1_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.._testdir_path2_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.path1.lst-old" new file mode 100644 index 0000000000000..d5769bf3da832 --- /dev/null +++ "b/cmd/bisync/testdata/test_extended_char_paths/golden/normal-sync._testdir_path1_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.._testdir_path2_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.path1.lst-old" @@ -0,0 +1,4 @@ +# bisync listing v1 from test +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "filename_contains_ě_.txt" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "filename_contains_ࢺ_.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "測試_check file" diff --git "a/cmd/bisync/testdata/test_extended_char_paths/golden/normal-sync._testdir_path1_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.._testdir_path2_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.path2.lst-old" "b/cmd/bisync/testdata/test_extended_char_paths/golden/normal-sync._testdir_path1_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.._testdir_path2_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.path2.lst-old" new file mode 100644 index 0000000000000..d5769bf3da832 --- /dev/null +++ "b/cmd/bisync/testdata/test_extended_char_paths/golden/normal-sync._testdir_path1_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.._testdir_path2_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.path2.lst-old" @@ -0,0 +1,4 @@ +# bisync listing v1 from test +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "filename_contains_ě_.txt" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "filename_contains_ࢺ_.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "測試_check file" diff --git a/cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..fc36112a8675d --- /dev/null +++ b/cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,11 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1 - Copy (2).txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1 - Copy.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file_enconde_mañana_funcionará.txt" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "filename_contains_ě_.txt" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "filename_contains_ࢺ_.txt" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "subdir_with_ࢺ_/filename_contains_ě_.txt" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "subdir_with_ࢺ_/filename_contains_ࢺ_.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "Русский.txt" diff --git a/cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..fc36112a8675d --- /dev/null +++ b/cmd/bisync/testdata/test_extended_filenames/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,11 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1 - Copy (2).txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1 - Copy.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file_enconde_mañana_funcionará.txt" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "filename_contains_ě_.txt" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "filename_contains_ࢺ_.txt" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "subdir_with_ࢺ_/filename_contains_ě_.txt" +- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "subdir_with_ࢺ_/filename_contains_ࢺ_.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "Русский.txt" diff --git a/cmd/bisync/testdata/test_filters/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_filters/golden/_testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..c3767400b8e8a --- /dev/null +++ b/cmd/bisync/testdata/test_filters/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,10 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_filters/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_filters/golden/_testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..c3767400b8e8a --- /dev/null +++ b/cmd/bisync/testdata/test_filters/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,10 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..84468462625ab --- /dev/null +++ b/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,5 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..84468462625ab --- /dev/null +++ b/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,5 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..7819f9efca8e6 --- /dev/null +++ b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,9 @@ +# bisync listing v1 from test +- 109 - - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..7819f9efca8e6 --- /dev/null +++ b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,9 @@ +# bisync listing v1 from test +- 109 - - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_max_delete_path1/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_max_delete_path1/golden/_testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..a105688f25ee5 --- /dev/null +++ b/cmd/bisync/testdata/test_max_delete_path1/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,10 @@ +# bisync listing v1 from test +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "file9.txt" diff --git a/cmd/bisync/testdata/test_max_delete_path1/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_max_delete_path1/golden/_testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..a105688f25ee5 --- /dev/null +++ b/cmd/bisync/testdata/test_max_delete_path1/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,10 @@ +# bisync listing v1 from test +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "file9.txt" diff --git a/cmd/bisync/testdata/test_max_delete_path2_force/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_max_delete_path2_force/golden/_testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..a105688f25ee5 --- /dev/null +++ b/cmd/bisync/testdata/test_max_delete_path2_force/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,10 @@ +# bisync listing v1 from test +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "file9.txt" diff --git a/cmd/bisync/testdata/test_max_delete_path2_force/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_max_delete_path2_force/golden/_testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..a105688f25ee5 --- /dev/null +++ b/cmd/bisync/testdata/test_max_delete_path2_force/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,10 @@ +# bisync listing v1 from test +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "file9.txt" diff --git a/cmd/bisync/testdata/test_rclone_args/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_rclone_args/golden/_testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..df7868befba32 --- /dev/null +++ b/cmd/bisync/testdata/test_rclone_args/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,6 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file21.txt" diff --git a/cmd/bisync/testdata/test_rclone_args/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_rclone_args/golden/_testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..df7868befba32 --- /dev/null +++ b/cmd/bisync/testdata/test_rclone_args/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,6 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file21.txt" diff --git a/cmd/bisync/testdata/test_resync/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_resync/golden/_testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..565120782fab2 --- /dev/null +++ b/cmd/bisync/testdata/test_resync/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,9 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2002-02-02T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 1999-09-09T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_resync/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_resync/golden/_testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..565120782fab2 --- /dev/null +++ b/cmd/bisync/testdata/test_resync/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,9 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2002-02-02T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 1999-09-09T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_resync/golden/empty-path1._testdir_path1.._testdir_path2.path1.lst b/cmd/bisync/testdata/test_resync/golden/empty-path1._testdir_path1.._testdir_path2.path1.lst index 8ff472b603e97..a82119a440c1f 100644 --- a/cmd/bisync/testdata/test_resync/golden/empty-path1._testdir_path1.._testdir_path2.path1.lst +++ b/cmd/bisync/testdata/test_resync/golden/empty-path1._testdir_path1.._testdir_path2.path1.lst @@ -1,9 +1,9 @@ # bisync listing v1 from test -- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" +- 109 - - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_resync/golden/empty-path2._testdir_path1.._testdir_path2.path2.lst b/cmd/bisync/testdata/test_resync/golden/empty-path2._testdir_path1.._testdir_path2.path2.lst index 8ff472b603e97..a82119a440c1f 100644 --- a/cmd/bisync/testdata/test_resync/golden/empty-path2._testdir_path1.._testdir_path2.path2.lst +++ b/cmd/bisync/testdata/test_resync/golden/empty-path2._testdir_path1.._testdir_path2.path2.lst @@ -1,9 +1,9 @@ # bisync listing v1 from test -- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" +- 109 - - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_rmdirs/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_rmdirs/golden/_testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..dfacfb52035ee --- /dev/null +++ b/cmd/bisync/testdata/test_rmdirs/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,8 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" diff --git a/cmd/bisync/testdata/test_rmdirs/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_rmdirs/golden/_testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..dfacfb52035ee --- /dev/null +++ b/cmd/bisync/testdata/test_rmdirs/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,8 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" diff --git a/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.copy1to2.que b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.copy1to2.que new file mode 100644 index 0000000000000..cc3b08914b8cd --- /dev/null +++ b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.copy1to2.que @@ -0,0 +1 @@ +"file5.txt..path1" diff --git a/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.copy2to1.que b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.copy2to1.que new file mode 100644 index 0000000000000..8457cd213488e --- /dev/null +++ b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.copy2to1.que @@ -0,0 +1 @@ +"file5.txt..path2" diff --git a/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst new file mode 100644 index 0000000000000..27dbd194a8180 --- /dev/null +++ b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst @@ -0,0 +1,103 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file0.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file10.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file100.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file11.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file12.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file13.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file14.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file15.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file16.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file17.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file18.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file19.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file20.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file21.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file22.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file23.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file24.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file25.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file26.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file27.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file28.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file29.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file30.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file31.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file32.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file33.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file34.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file35.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file36.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file37.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file38.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file39.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file40.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file41.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file42.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file43.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file44.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file45.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file46.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file47.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file48.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file49.txt" +- 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt..path1" +- 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt..path2" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file51.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file52.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file53.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file54.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file55.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file56.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file57.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file58.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file59.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file60.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file61.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file62.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file63.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file64.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file65.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file66.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file67.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file68.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file69.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file70.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file71.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file72.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file73.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file74.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file75.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file76.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file77.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file78.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file79.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file80.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file81.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file82.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file83.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file84.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file85.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file86.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file87.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file88.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file89.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file9.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file90.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file91.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file92.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file93.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file94.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file95.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file96.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file97.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file98.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file99.txt" diff --git a/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst-new b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst-new new file mode 100644 index 0000000000000..74a73a22cdc97 --- /dev/null +++ b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst-new @@ -0,0 +1,104 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file0.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file10.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file100.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file11.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file12.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file13.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file14.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file15.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file16.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file17.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file18.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file19.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file20.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file21.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file22.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file23.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file24.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file25.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file26.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file27.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file28.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file29.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file30.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file31.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file32.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file33.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file34.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file35.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file36.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file37.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file38.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file39.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file40.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file41.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file42.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file43.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file44.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file45.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file46.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file47.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file48.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file49.txt" +- 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt" +- 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt..path1" +- 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt..path2" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file51.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file52.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file53.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file54.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file55.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file56.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file57.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file58.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file59.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file60.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file61.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file62.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file63.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file64.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file65.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file66.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file67.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file68.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file69.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file70.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file71.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file72.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file73.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file74.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file75.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file76.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file77.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file78.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file79.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file80.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file81.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file82.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file83.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file84.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file85.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file86.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file87.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file88.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file89.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file9.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file90.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file91.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file92.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file93.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file94.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file95.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file96.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file97.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file98.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file99.txt" diff --git a/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..27dbd194a8180 --- /dev/null +++ b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,103 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file0.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file10.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file100.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file11.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file12.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file13.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file14.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file15.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file16.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file17.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file18.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file19.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file20.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file21.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file22.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file23.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file24.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file25.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file26.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file27.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file28.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file29.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file30.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file31.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file32.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file33.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file34.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file35.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file36.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file37.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file38.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file39.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file40.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file41.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file42.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file43.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file44.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file45.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file46.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file47.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file48.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file49.txt" +- 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt..path1" +- 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt..path2" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file51.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file52.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file53.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file54.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file55.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file56.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file57.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file58.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file59.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file60.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file61.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file62.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file63.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file64.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file65.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file66.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file67.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file68.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file69.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file70.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file71.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file72.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file73.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file74.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file75.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file76.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file77.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file78.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file79.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file80.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file81.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file82.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file83.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file84.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file85.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file86.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file87.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file88.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file89.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file9.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file90.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file91.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file92.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file93.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file94.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file95.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file96.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file97.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file98.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file99.txt" diff --git a/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst new file mode 100644 index 0000000000000..27dbd194a8180 --- /dev/null +++ b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst @@ -0,0 +1,103 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file0.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file10.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file100.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file11.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file12.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file13.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file14.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file15.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file16.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file17.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file18.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file19.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file20.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file21.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file22.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file23.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file24.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file25.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file26.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file27.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file28.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file29.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file30.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file31.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file32.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file33.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file34.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file35.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file36.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file37.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file38.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file39.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file40.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file41.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file42.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file43.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file44.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file45.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file46.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file47.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file48.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file49.txt" +- 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt..path1" +- 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt..path2" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file51.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file52.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file53.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file54.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file55.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file56.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file57.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file58.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file59.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file60.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file61.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file62.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file63.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file64.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file65.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file66.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file67.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file68.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file69.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file70.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file71.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file72.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file73.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file74.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file75.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file76.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file77.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file78.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file79.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file80.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file81.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file82.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file83.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file84.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file85.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file86.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file87.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file88.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file89.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file9.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file90.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file91.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file92.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file93.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file94.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file95.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file96.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file97.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file98.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file99.txt" diff --git a/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst-new b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst-new new file mode 100644 index 0000000000000..af4d4e41b8776 --- /dev/null +++ b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst-new @@ -0,0 +1,104 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file0.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file10.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file100.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file11.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file12.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file13.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file14.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file15.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file16.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file17.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file18.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file19.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file20.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file21.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file22.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file23.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file24.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file25.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file26.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file27.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file28.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file29.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file30.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file31.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file32.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file33.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file34.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file35.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file36.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file37.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file38.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file39.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file40.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file41.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file42.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file43.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file44.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file45.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file46.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file47.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file48.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file49.txt" +- 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt" +- 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt..path1" +- 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt..path2" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file51.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file52.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file53.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file54.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file55.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file56.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file57.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file58.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file59.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file60.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file61.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file62.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file63.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file64.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file65.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file66.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file67.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file68.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file69.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file70.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file71.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file72.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file73.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file74.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file75.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file76.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file77.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file78.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file79.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file80.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file81.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file82.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file83.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file84.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file85.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file86.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file87.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file88.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file89.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file9.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file90.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file91.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file92.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file93.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file94.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file95.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file96.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file97.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file98.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file99.txt" diff --git a/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..27dbd194a8180 --- /dev/null +++ b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,103 @@ +# bisync listing v1 from test +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file0.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file10.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file100.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file11.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file12.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file13.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file14.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file15.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file16.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file17.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file18.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file19.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file20.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file21.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file22.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file23.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file24.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file25.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file26.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file27.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file28.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file29.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file30.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file31.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file32.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file33.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file34.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file35.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file36.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file37.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file38.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file39.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file40.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file41.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file42.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file43.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file44.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file45.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file46.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file47.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file48.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file49.txt" +- 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt..path1" +- 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt..path2" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file51.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file52.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file53.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file54.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file55.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file56.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file57.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file58.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file59.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file60.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file61.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file62.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file63.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file64.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file65.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file66.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file67.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file68.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file69.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file70.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file71.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file72.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file73.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file74.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file75.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file76.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file77.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file78.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file79.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file80.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file81.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file82.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file83.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file84.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file85.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file86.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file87.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file88.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file89.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file9.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file90.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file91.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file92.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file93.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file94.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file95.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file96.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file97.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file98.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file99.txt" diff --git a/cmd/bisync/testdata/test_volatile/golden/test.log b/cmd/bisync/testdata/test_volatile/golden/test.log new file mode 100644 index 0000000000000..6964fa9e297a9 --- /dev/null +++ b/cmd/bisync/testdata/test_volatile/golden/test.log @@ -0,0 +1,292 @@ +(01) : test volatile + +(02) : test initial bisync +(03) : bisync resync +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Copying unique Path2 files to Path1 +INFO : Resynching Path1 to Path2 +INFO : Resync updating listings +INFO : Bisync successful + +(04) : test changed on both paths - file5 (file5R, file5L) +(05) : touch-glob 2001-01-02 {datadir/} file5R.txt +(06) : copy-as {datadir/}file5R.txt {path2/} file5.txt +(07) : touch-glob 2001-03-04 {datadir/} file5L.txt +(08) : copy-as {datadir/}file5L.txt {path1/} file5.txt + +(09) : test bisync with 50 files created during - should ignore new files +(10) : test-func +(11) : bisync +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Path1 checking for diffs +INFO : - Path1 File is newer - file5.txt +INFO : Path1: 1 changes: 0 new, 1 newer, 0 older, 0 deleted +INFO : Path2 checking for diffs +INFO : - Path2 File is newer - file5.txt +INFO : Path2: 1 changes: 0 new, 1 newer, 0 older, 0 deleted +INFO : Applying changes +INFO : Checking potential conflicts... +ERROR : file5.txt: md5 differ +NOTICE: Local file system at {path2}: 1 differences found +NOTICE: Local file system at {path2}: 1 errors while checking +INFO : Finished checking the potential conflicts. 1 differences found +NOTICE: - WARNING New or changed in both paths - file5.txt +NOTICE: - Path1 Renaming Path1 copy - {path1/}file5.txt..path1 +NOTICE: - Path1 Queue copy to Path2 - {path2/}file5.txt..path1 +NOTICE: - Path2 Renaming Path2 copy - {path2/}file5.txt..path2 +NOTICE: - Path2 Queue copy to Path1 - {path1/}file5.txt..path2 +INFO : - Path2 Do queued copies to - Path1 +INFO : - Path1 Do queued copies to - Path2 +INFO : Updating listings +INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" +INFO : Bisync successful + +(12) : test changed on both paths - file5 (file5R, file5L) +(13) : touch-glob 2001-01-02 {datadir/} file5R.txt +(14) : copy-as {datadir/}file5R.txt {path2/} file5.txt +(15) : touch-glob 2001-03-04 {datadir/} file5L.txt +(16) : copy-as {datadir/}file5L.txt {path1/} file5.txt + +(17) : test next bisync - should now notice new files +(18) : test-func +(19) : bisync +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Path1 checking for diffs +INFO : - Path1 File is new - file100.txt +INFO : - Path1 File is new - file5.txt +INFO : - Path1 File is new - file51.txt +INFO : - Path1 File is new - file52.txt +INFO : - Path1 File is new - file53.txt +INFO : - Path1 File is new - file54.txt +INFO : - Path1 File is new - file55.txt +INFO : - Path1 File is new - file56.txt +INFO : - Path1 File is new - file57.txt +INFO : - Path1 File is new - file58.txt +INFO : - Path1 File is new - file59.txt +INFO : - Path1 File is new - file60.txt +INFO : - Path1 File is new - file61.txt +INFO : - Path1 File is new - file62.txt +INFO : - Path1 File is new - file63.txt +INFO : - Path1 File is new - file64.txt +INFO : - Path1 File is new - file65.txt +INFO : - Path1 File is new - file66.txt +INFO : - Path1 File is new - file67.txt +INFO : - Path1 File is new - file68.txt +INFO : - Path1 File is new - file69.txt +INFO : - Path1 File is new - file70.txt +INFO : - Path1 File is new - file71.txt +INFO : - Path1 File is new - file72.txt +INFO : - Path1 File is new - file73.txt +INFO : - Path1 File is new - file74.txt +INFO : - Path1 File is new - file75.txt +INFO : - Path1 File is new - file76.txt +INFO : - Path1 File is new - file77.txt +INFO : - Path1 File is new - file78.txt +INFO : - Path1 File is new - file79.txt +INFO : - Path1 File is new - file80.txt +INFO : - Path1 File is new - file81.txt +INFO : - Path1 File is new - file82.txt +INFO : - Path1 File is new - file83.txt +INFO : - Path1 File is new - file84.txt +INFO : - Path1 File is new - file85.txt +INFO : - Path1 File is new - file86.txt +INFO : - Path1 File is new - file87.txt +INFO : - Path1 File is new - file88.txt +INFO : - Path1 File is new - file89.txt +INFO : - Path1 File is new - file90.txt +INFO : - Path1 File is new - file91.txt +INFO : - Path1 File is new - file92.txt +INFO : - Path1 File is new - file93.txt +INFO : - Path1 File is new - file94.txt +INFO : - Path1 File is new - file95.txt +INFO : - Path1 File is new - file96.txt +INFO : - Path1 File is new - file97.txt +INFO : - Path1 File is new - file98.txt +INFO : - Path1 File is new - file99.txt +INFO : Path1: 51 changes: 51 new, 0 newer, 0 older, 0 deleted +INFO : Path2 checking for diffs +INFO : - Path2 File is new - file0.txt +INFO : - Path2 File is new - file10.txt +INFO : - Path2 File is new - file11.txt +INFO : - Path2 File is new - file12.txt +INFO : - Path2 File is new - file13.txt +INFO : - Path2 File is new - file14.txt +INFO : - Path2 File is new - file15.txt +INFO : - Path2 File is new - file16.txt +INFO : - Path2 File is new - file17.txt +INFO : - Path2 File is new - file18.txt +INFO : - Path2 File is new - file19.txt +INFO : - Path2 File is new - file20.txt +INFO : - Path2 File is new - file21.txt +INFO : - Path2 File is new - file22.txt +INFO : - Path2 File is new - file23.txt +INFO : - Path2 File is new - file24.txt +INFO : - Path2 File is new - file25.txt +INFO : - Path2 File is new - file26.txt +INFO : - Path2 File is new - file27.txt +INFO : - Path2 File is new - file28.txt +INFO : - Path2 File is new - file29.txt +INFO : - Path2 File is new - file30.txt +INFO : - Path2 File is new - file31.txt +INFO : - Path2 File is new - file32.txt +INFO : - Path2 File is new - file33.txt +INFO : - Path2 File is new - file34.txt +INFO : - Path2 File is new - file35.txt +INFO : - Path2 File is new - file36.txt +INFO : - Path2 File is new - file37.txt +INFO : - Path2 File is new - file38.txt +INFO : - Path2 File is new - file39.txt +INFO : - Path2 File is new - file40.txt +INFO : - Path2 File is new - file41.txt +INFO : - Path2 File is new - file42.txt +INFO : - Path2 File is new - file43.txt +INFO : - Path2 File is new - file44.txt +INFO : - Path2 File is new - file45.txt +INFO : - Path2 File is new - file46.txt +INFO : - Path2 File is new - file47.txt +INFO : - Path2 File is new - file48.txt +INFO : - Path2 File is new - file49.txt +INFO : - Path2 File is new - file5.txt +INFO : - Path2 File is new - file9.txt +INFO : Path2: 43 changes: 43 new, 0 newer, 0 older, 0 deleted +INFO : Applying changes +INFO : Checking potential conflicts... +ERROR : file5.txt: md5 differ +NOTICE: Local file system at {path2}: 1 differences found +NOTICE: Local file system at {path2}: 1 errors while checking +INFO : Finished checking the potential conflicts. 1 differences found +INFO : - Path1 Queue copy to Path2 - {path2/}file100.txt +NOTICE: - WARNING New or changed in both paths - file5.txt +NOTICE: - Path1 Renaming Path1 copy - {path1/}file5.txt..path1 +NOTICE: - Path1 Queue copy to Path2 - {path2/}file5.txt..path1 +NOTICE: - Path2 Renaming Path2 copy - {path2/}file5.txt..path2 +NOTICE: - Path2 Queue copy to Path1 - {path1/}file5.txt..path2 +INFO : - Path1 Queue copy to Path2 - {path2/}file51.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file52.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file53.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file54.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file55.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file56.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file57.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file58.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file59.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file60.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file61.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file62.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file63.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file64.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file65.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file66.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file67.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file68.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file69.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file70.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file71.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file72.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file73.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file74.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file75.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file76.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file77.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file78.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file79.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file80.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file81.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file82.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file83.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file84.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file85.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file86.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file87.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file88.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file89.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file90.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file91.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file92.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file93.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file94.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file95.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file96.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file97.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file98.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file99.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file0.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file10.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file11.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file12.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file13.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file14.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file15.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file16.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file17.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file18.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file19.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file20.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file21.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file22.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file23.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file24.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file25.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file26.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file27.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file28.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file29.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file30.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file31.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file32.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file33.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file34.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file35.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file36.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file37.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file38.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file39.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file40.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file41.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file42.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file43.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file44.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file45.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file46.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file47.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file48.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file49.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file9.txt +INFO : - Path2 Do queued copies to - Path1 +INFO : - Path1 Do queued copies to - Path2 +INFO : Updating listings +INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" +INFO : Bisync successful + +(20) : test changed on both paths - file5 (file5R, file5L) +(21) : touch-glob 2001-01-02 {datadir/} file5R.txt +(22) : copy-as {datadir/}file5R.txt {path2/} file5.txt +(23) : touch-glob 2001-03-04 {datadir/} file5L.txt +(24) : copy-as {datadir/}file5L.txt {path1/} file5.txt + +(25) : test next bisync - should be no changes except dummy +(26) : test-func +(27) : bisync +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Path1 checking for diffs +INFO : - Path1 File is new - file5.txt +INFO : Path1: 1 changes: 1 new, 0 newer, 0 older, 0 deleted +INFO : Path2 checking for diffs +INFO : - Path2 File is new - file5.txt +INFO : Path2: 1 changes: 1 new, 0 newer, 0 older, 0 deleted +INFO : Applying changes +INFO : Checking potential conflicts... +ERROR : file5.txt: md5 differ +NOTICE: Local file system at {path2}: 1 differences found +NOTICE: Local file system at {path2}: 1 errors while checking +INFO : Finished checking the potential conflicts. 1 differences found +NOTICE: - WARNING New or changed in both paths - file5.txt +NOTICE: - Path1 Renaming Path1 copy - {path1/}file5.txt..path1 +NOTICE: - Path1 Queue copy to Path2 - {path2/}file5.txt..path1 +NOTICE: - Path2 Renaming Path2 copy - {path2/}file5.txt..path2 +NOTICE: - Path2 Queue copy to Path1 - {path1/}file5.txt..path2 +INFO : - Path2 Do queued copies to - Path1 +INFO : - Path1 Do queued copies to - Path2 +INFO : Updating listings +INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" +INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_volatile/initial/RCLONE_TEST b/cmd/bisync/testdata/test_volatile/initial/RCLONE_TEST new file mode 100644 index 0000000000000..d8ca97c2a4dbe --- /dev/null +++ b/cmd/bisync/testdata/test_volatile/initial/RCLONE_TEST @@ -0,0 +1 @@ +This file is used for testing the health of rclone accesses to the local/remote file system. Do not delete. diff --git a/cmd/bisync/testdata/test_volatile/initial/file1.txt b/cmd/bisync/testdata/test_volatile/initial/file1.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_volatile/initial/file2.txt b/cmd/bisync/testdata/test_volatile/initial/file2.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_volatile/initial/file3.txt b/cmd/bisync/testdata/test_volatile/initial/file3.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_volatile/initial/file4.txt b/cmd/bisync/testdata/test_volatile/initial/file4.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_volatile/initial/file5.txt b/cmd/bisync/testdata/test_volatile/initial/file5.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_volatile/initial/file6.txt b/cmd/bisync/testdata/test_volatile/initial/file6.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_volatile/initial/file7.txt b/cmd/bisync/testdata/test_volatile/initial/file7.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_volatile/initial/file8.txt b/cmd/bisync/testdata/test_volatile/initial/file8.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_volatile/modfiles/dummy.txt b/cmd/bisync/testdata/test_volatile/modfiles/dummy.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_volatile/modfiles/file1.txt b/cmd/bisync/testdata/test_volatile/modfiles/file1.txt new file mode 100644 index 0000000000000..464147f09c0c8 --- /dev/null +++ b/cmd/bisync/testdata/test_volatile/modfiles/file1.txt @@ -0,0 +1 @@ +This file is newer diff --git a/cmd/bisync/testdata/test_volatile/modfiles/file10.txt b/cmd/bisync/testdata/test_volatile/modfiles/file10.txt new file mode 100644 index 0000000000000..464147f09c0c8 --- /dev/null +++ b/cmd/bisync/testdata/test_volatile/modfiles/file10.txt @@ -0,0 +1 @@ +This file is newer diff --git a/cmd/bisync/testdata/test_volatile/modfiles/file11.txt b/cmd/bisync/testdata/test_volatile/modfiles/file11.txt new file mode 100644 index 0000000000000..464147f09c0c8 --- /dev/null +++ b/cmd/bisync/testdata/test_volatile/modfiles/file11.txt @@ -0,0 +1 @@ +This file is newer diff --git a/cmd/bisync/testdata/test_volatile/modfiles/file2.txt b/cmd/bisync/testdata/test_volatile/modfiles/file2.txt new file mode 100644 index 0000000000000..0fd70321acd6b --- /dev/null +++ b/cmd/bisync/testdata/test_volatile/modfiles/file2.txt @@ -0,0 +1 @@ +Newer version \ No newline at end of file diff --git a/cmd/bisync/testdata/test_volatile/modfiles/file5L.txt b/cmd/bisync/testdata/test_volatile/modfiles/file5L.txt new file mode 100644 index 0000000000000..43ceff1dbe273 --- /dev/null +++ b/cmd/bisync/testdata/test_volatile/modfiles/file5L.txt @@ -0,0 +1 @@ +This file is newer and not equal to 5R diff --git a/cmd/bisync/testdata/test_volatile/modfiles/file5R.txt b/cmd/bisync/testdata/test_volatile/modfiles/file5R.txt new file mode 100644 index 0000000000000..a928fcf1382e0 --- /dev/null +++ b/cmd/bisync/testdata/test_volatile/modfiles/file5R.txt @@ -0,0 +1 @@ +This file is newer and not equal to 5L diff --git a/cmd/bisync/testdata/test_volatile/modfiles/file6.txt b/cmd/bisync/testdata/test_volatile/modfiles/file6.txt new file mode 100644 index 0000000000000..464147f09c0c8 --- /dev/null +++ b/cmd/bisync/testdata/test_volatile/modfiles/file6.txt @@ -0,0 +1 @@ +This file is newer diff --git a/cmd/bisync/testdata/test_volatile/modfiles/file7.txt b/cmd/bisync/testdata/test_volatile/modfiles/file7.txt new file mode 100644 index 0000000000000..464147f09c0c8 --- /dev/null +++ b/cmd/bisync/testdata/test_volatile/modfiles/file7.txt @@ -0,0 +1 @@ +This file is newer diff --git a/cmd/bisync/testdata/test_volatile/scenario.txt b/cmd/bisync/testdata/test_volatile/scenario.txt new file mode 100644 index 0000000000000..499faf8a43759 --- /dev/null +++ b/cmd/bisync/testdata/test_volatile/scenario.txt @@ -0,0 +1,34 @@ +test volatile + +test initial bisync +bisync resync + +test changed on both paths - file5 (file5R, file5L) +touch-glob 2001-01-02 {datadir/} file5R.txt +copy-as {datadir/}file5R.txt {path2/} file5.txt +touch-glob 2001-03-04 {datadir/} file5L.txt +copy-as {datadir/}file5L.txt {path1/} file5.txt + +test bisync with 50 files created during - should ignore new files +test-func +bisync + +test changed on both paths - file5 (file5R, file5L) +touch-glob 2001-01-02 {datadir/} file5R.txt +copy-as {datadir/}file5R.txt {path2/} file5.txt +touch-glob 2001-03-04 {datadir/} file5L.txt +copy-as {datadir/}file5L.txt {path1/} file5.txt + +test next bisync - should now notice new files +test-func +bisync + +test changed on both paths - file5 (file5R, file5L) +touch-glob 2001-01-02 {datadir/} file5R.txt +copy-as {datadir/}file5R.txt {path2/} file5.txt +touch-glob 2001-03-04 {datadir/} file5L.txt +copy-as {datadir/}file5L.txt {path1/} file5.txt + +test next bisync - should be no changes except dummy +test-func +bisync \ No newline at end of file diff --git a/docs/content/bisync.md b/docs/content/bisync.md index e010eba02cb75..c34073890ffd6 100644 --- a/docs/content/bisync.md +++ b/docs/content/bisync.md @@ -1274,6 +1274,7 @@ about _Unison_ and synchronization in general. * Partial uploads known issue on `local`/`ftp`/`sftp` has been resolved (unless using `--inplace`) * Final listings are now generated from sync results, to avoid needing to re-list * Bisync is now much more resilient to changes that happen during a bisync run, and far less prone to critical errors / undetected changes +* Bisync is now capable of rolling a file listing back in cases of uncertainty, essentially marking the file as needing to be rechecked next time. ### `v1.64` * Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Dry%20runs%20are%20not%20completely%20dry) From 0cac5d67abc048a8bfad7487e52a40ae7b35ff87 Mon Sep 17 00:00:00 2001 From: nielash Date: Mon, 6 Nov 2023 06:59:41 -0500 Subject: [PATCH 112/130] bisync: introduce terminal colors This introduces a few basic color codings to make the terminal output more readable (and more fun). Rclone's standard --color flag is supported. (AUTO|NEVER|ALWAYS) Only a few lines have colors right now -- more will probably be added in future versions. --- cmd/bisync/bisync_test.go | 23 +- cmd/bisync/log.go | 13 +- cmd/bisync/operations.go | 13 +- .../testdata/test_all_changed/golden/test.log | 118 ++--- .../testdata/test_basic/golden/test.log | 32 +- .../testdata/test_changes/golden/test.log | 126 ++--- .../test_check_access/golden/test.log | 86 ++-- .../test_check_access_filters/golden/test.log | 130 ++--- .../test_check_filename/golden/test.log | 46 +- .../testdata/test_check_sync/golden/test.log | 68 +-- .../test_createemptysrcdirs/golden/test.log | 152 +++--- .../testdata/test_dry_run/golden/test.log | 192 +++---- .../testdata/test_equal/golden/test.log | 56 +- .../test_extended_char_paths/golden/test.log | 88 ++-- .../test_extended_filenames/golden/test.log | 130 ++--- .../testdata/test_filters/golden/test.log | 32 +- .../test_filtersfile_checks/golden/test.log | 66 +-- .../golden/test.log | 36 +- .../test_max_delete_path1/golden/test.log | 66 +-- .../golden/test.log | 66 +-- .../testdata/test_rclone_args/golden/test.log | 46 +- .../testdata/test_resync/golden/test.log | 108 ++-- .../testdata/test_rmdirs/golden/test.log | 42 +- .../testdata/test_volatile/golden/test.log | 484 +++++++++--------- 24 files changed, 1118 insertions(+), 1101 deletions(-) diff --git a/cmd/bisync/bisync_test.go b/cmd/bisync/bisync_test.go index 89b6b18ee83ad..11a0862c36052 100644 --- a/cmd/bisync/bisync_test.go +++ b/cmd/bisync/bisync_test.go @@ -35,6 +35,7 @@ import ( "github.com/rclone/rclone/fstest" "github.com/rclone/rclone/lib/atexit" "github.com/rclone/rclone/lib/random" + "github.com/rclone/rclone/lib/terminal" "golang.org/x/text/unicode/norm" "github.com/pmezard/go-difflib/difflib" @@ -106,8 +107,8 @@ var logHoppers = []string{ // Some log lines can contain Windows path separator that must be // converted to "/" in every matching token to match golden logs. var logLinesWithSlash = []string{ - `\(\d\d\) : (touch-glob|touch-copy|copy-file|copy-as|copy-dir|delete-file) `, - `INFO : - Path[12] +Queue copy to Path[12] `, + `.*\(\d\d\) :.*(touch-glob|touch-copy|copy-file|copy-as|copy-dir|delete-file) `, + `INFO : - .*Path[12].* +.*Queue copy to Path[12].*`, `INFO : Synching Path1 .*? with Path2 `, `INFO : Validating listings for `, } @@ -169,6 +170,10 @@ type bisyncTest struct { TestFn bisync.TestFunc } +const TerminalColorMode = fs.TerminalColorModeAlways + +var color = bisync.Color + // TestBisync is a test engine for bisync test cases. func TestBisync(t *testing.T) { ctx := context.Background() @@ -379,16 +384,16 @@ func (b *bisyncTest) runTestCase(ctx context.Context, t *testing.T, testCase str var passed bool switch errorCount { case 0: - msg = fmt.Sprintf("TEST %s PASSED", b.testCase) + msg = color(terminal.GreenFg, fmt.Sprintf("TEST %s PASSED", b.testCase)) passed = true case -2: - msg = fmt.Sprintf("TEST %s SKIPPED", b.testCase) + msg = color(terminal.YellowFg, fmt.Sprintf("TEST %s SKIPPED", b.testCase)) passed = true case -1: - msg = fmt.Sprintf("TEST %s FAILED - WRONG NUMBER OF FILES", b.testCase) + msg = color(terminal.RedFg, fmt.Sprintf("TEST %s FAILED - WRONG NUMBER OF FILES", b.testCase)) passed = false default: - msg = fmt.Sprintf("TEST %s FAILED - %d MISCOMPARED FILES", b.testCase, errorCount) + msg = color(terminal.RedFg, fmt.Sprintf("TEST %s FAILED - %d MISCOMPARED FILES", b.testCase, errorCount)) buckets := b.fs1.Features().BucketBased || b.fs2.Features().BucketBased passed = false if b.testCase == "rmdirs" && buckets { @@ -455,7 +460,7 @@ func (b *bisyncTest) cleanupCase(ctx context.Context) { func (b *bisyncTest) runTestStep(ctx context.Context, line string) (err error) { var fsrc, fdst fs.Fs accounting.Stats(ctx).ResetErrors() - b.logPrintf("%s %s", b.stepStr, line) + b.logPrintf("%s %s", color(terminal.CyanFg, b.stepStr), color(terminal.BlueFg, line)) ci := fs.GetConfig(ctx) ciSave := *ci @@ -900,7 +905,7 @@ func (b *bisyncTest) compareResults() int { if goldenNum != resultNum { log.Print(divider) - log.Printf("MISCOMPARE - Number of Golden and Results files do not match:") + log.Print(color(terminal.RedFg, "MISCOMPARE - Number of Golden and Results files do not match:")) log.Printf(" Golden count: %d", goldenNum) log.Printf(" Result count: %d", resultNum) log.Printf(" Golden files: %s", strings.Join(goldenFiles, ", ")) @@ -950,7 +955,7 @@ func (b *bisyncTest) compareResults() int { require.NoError(b.t, err, "diff failed") log.Print(divider) - log.Printf("| MISCOMPARE -Golden vs +Results for %s", file) + log.Printf(color(terminal.RedFg, "| MISCOMPARE -Golden vs +Results for %s"), file) for _, line := range strings.Split(strings.TrimSpace(text), "\n") { log.Printf("| %s", strings.TrimSpace(line)) } diff --git a/cmd/bisync/log.go b/cmd/bisync/log.go index 6c4a7dfc29662..5a7ce507a30b5 100644 --- a/cmd/bisync/log.go +++ b/cmd/bisync/log.go @@ -7,6 +7,7 @@ import ( "strings" "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/lib/terminal" ) func (b *bisyncRun) indentf(tag, file, format string, args ...interface{}) { @@ -25,7 +26,11 @@ func (b *bisyncRun) indent(tag, file, msg string) { tag = tag[1:] logf = fs.Logf } - logf(nil, "- %-9s%-35s - %s", tag, msg, escapePath(file, false)) + + tag = Color(terminal.BlueFg, tag) + msg = Color(terminal.MagentaFg, msg) + file = Color(terminal.CyanFg, escapePath(file, false)) + logf(nil, "- %-18s%-43s - %s", tag, msg, file) } // escapePath will escape control characters in path. @@ -47,3 +52,9 @@ func escapePath(path string, forceQuotes bool) string { func quotePath(path string) string { return escapePath(path, true) } + +// Color handles terminal colors for bisync +func Color(style string, s string) string { + terminal.Start() + return style + s + terminal.Reset +} diff --git a/cmd/bisync/operations.go b/cmd/bisync/operations.go index 38978ee718fb4..e3f590b45f35f 100644 --- a/cmd/bisync/operations.go +++ b/cmd/bisync/operations.go @@ -17,6 +17,7 @@ import ( "github.com/rclone/rclone/fs/filter" "github.com/rclone/rclone/fs/operations" "github.com/rclone/rclone/lib/atexit" + "github.com/rclone/rclone/lib/terminal" ) // ErrBisyncAborted signals that bisync is aborted and forces exit code 2 @@ -139,8 +140,8 @@ func Bisync(ctx context.Context, fs1, fs2 fs.Fs, optArg *Options) (err error) { if b.critical { if b.retryable && b.opt.Resilient { - fs.Errorf(nil, "Bisync critical error: %v", err) - fs.Errorf(nil, "Bisync aborted. Error is retryable without --resync due to --resilient mode.") + fs.Errorf(nil, Color(terminal.RedFg, "Bisync critical error: %v"), err) + fs.Errorf(nil, Color(terminal.YellowFg, "Bisync aborted. Error is retryable without --resync due to --resilient mode.")) } else { if bilib.FileExists(b.listing1) { _ = os.Rename(b.listing1, b.listing1+"-err") @@ -148,16 +149,16 @@ func Bisync(ctx context.Context, fs1, fs2 fs.Fs, optArg *Options) (err error) { if bilib.FileExists(b.listing2) { _ = os.Rename(b.listing2, b.listing2+"-err") } - fs.Errorf(nil, "Bisync critical error: %v", err) - fs.Errorf(nil, "Bisync aborted. Must run --resync to recover.") + fs.Errorf(nil, Color(terminal.RedFg, "Bisync critical error: %v"), err) + fs.Errorf(nil, Color(terminal.RedFg, "Bisync aborted. Must run --resync to recover.")) } return ErrBisyncAborted } if b.abort { - fs.Logf(nil, "Bisync aborted. Please try again.") + fs.Logf(nil, Color(terminal.RedFg, "Bisync aborted. Please try again.")) } if err == nil { - fs.Infof(nil, "Bisync successful") + fs.Infof(nil, Color(terminal.GreenFg, "Bisync successful")) } return err } diff --git a/cmd/bisync/testdata/test_all_changed/golden/test.log b/cmd/bisync/testdata/test_all_changed/golden/test.log index af0c24c5d66b1..c2daac34d035c 100644 --- a/cmd/bisync/testdata/test_all_changed/golden/test.log +++ b/cmd/bisync/testdata/test_all_changed/golden/test.log @@ -1,90 +1,90 @@ -(01) : test all-changed +(01) : test all-changed -(02) : test initial bisync -(03) : bisync resync +(02) : test initial bisync +(03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(04) : test change timestamp on all files except RCLONE_TEST -(05) : touch-glob 2005-01-02 {path1/} file* -(06) : touch-glob 2005-01-02 {path1/}subdir file* +(04) : test change timestamp on all files except RCLONE_TEST +(05) : touch-glob 2005-01-02 {path1/} file* +(06) : touch-glob 2005-01-02 {path1/}subdir file* -(07) : test sync should pass -(08) : bisync +(07) : test sync should pass +(08) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs -INFO : - Path1 File is newer - file1.copy1.txt -INFO : - Path1 File is newer - file1.copy2.txt -INFO : - Path1 File is newer - file1.copy3.txt -INFO : - Path1 File is newer - file1.copy4.txt -INFO : - Path1 File is newer - file1.copy5.txt -INFO : - Path1 File is newer - file1.txt -INFO : - Path1 File is newer - subdir/file20.txt +INFO : - Path1 File is newer - file1.copy1.txt +INFO : - Path1 File is newer - file1.copy2.txt +INFO : - Path1 File is newer - file1.copy3.txt +INFO : - Path1 File is newer - file1.copy4.txt +INFO : - Path1 File is newer - file1.copy5.txt +INFO : - Path1 File is newer - file1.txt +INFO : - Path1 File is newer - subdir/file20.txt INFO : Path1: 7 changes: 0 new, 7 newer, 0 older, 0 deleted INFO : Path2 checking for diffs INFO : Applying changes -INFO : - Path1 Queue copy to Path2 - {path2/}file1.copy1.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file1.copy2.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file1.copy3.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file1.copy4.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file1.copy5.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file1.txt -INFO : - Path1 Queue copy to Path2 - {path2/}subdir/file20.txt -INFO : - Path1 Do queued copies to - Path2 +INFO : - Path1 Queue copy to Path2 - {path2/}file1.copy1.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file1.copy2.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file1.copy3.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file1.copy4.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file1.copy5.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file1.txt +INFO : - Path1 Queue copy to Path2 - {path2/}subdir/file20.txt +INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful -(09) : test change timestamp on all files including RCLONE_TEST -(10) : touch-glob 2004-01-02 {path1/} * -(11) : touch-glob 2004-01-02 {path1/}subdir * +(09) : test change timestamp on all files including RCLONE_TEST +(10) : touch-glob 2004-01-02 {path1/} * +(11) : touch-glob 2004-01-02 {path1/}subdir * -(12) : test sync should fail -(13) : bisync +(12) : test sync should fail +(13) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs -INFO : - Path1 File is OLDER - file1.copy1.txt -INFO : - Path1 File is OLDER - file1.copy2.txt -INFO : - Path1 File is OLDER - file1.copy3.txt -INFO : - Path1 File is OLDER - file1.copy4.txt -INFO : - Path1 File is OLDER - file1.copy5.txt -INFO : - Path1 File is OLDER - file1.txt -INFO : - Path1 File is OLDER - subdir/file20.txt -INFO : - Path1 File is newer - RCLONE_TEST +INFO : - Path1 File is newer - RCLONE_TEST +INFO : - Path1 File is OLDER - file1.copy1.txt +INFO : - Path1 File is OLDER - file1.copy2.txt +INFO : - Path1 File is OLDER - file1.copy3.txt +INFO : - Path1 File is OLDER - file1.copy4.txt +INFO : - Path1 File is OLDER - file1.copy5.txt +INFO : - Path1 File is OLDER - file1.txt +INFO : - Path1 File is OLDER - subdir/file20.txt INFO : Path1: 8 changes: 0 new, 1 newer, 7 older, 0 deleted INFO : Path2 checking for diffs ERROR : Safety abort: all files were changed on Path1 "{path1/}". Run with --force if desired. -NOTICE: Bisync aborted. Please try again. +NOTICE: Bisync aborted. Please try again. Bisync error: all files were changed -(14) : test sync with force should pass -(15) : bisync force +(14) : test sync with force should pass +(15) : bisync force INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs -INFO : - Path1 File is OLDER - file1.copy1.txt -INFO : - Path1 File is OLDER - file1.copy2.txt -INFO : - Path1 File is OLDER - file1.copy3.txt -INFO : - Path1 File is OLDER - file1.copy4.txt -INFO : - Path1 File is OLDER - file1.copy5.txt -INFO : - Path1 File is OLDER - file1.txt -INFO : - Path1 File is OLDER - subdir/file20.txt -INFO : - Path1 File is newer - RCLONE_TEST +INFO : - Path1 File is newer - RCLONE_TEST +INFO : - Path1 File is OLDER - file1.copy1.txt +INFO : - Path1 File is OLDER - file1.copy2.txt +INFO : - Path1 File is OLDER - file1.copy3.txt +INFO : - Path1 File is OLDER - file1.copy4.txt +INFO : - Path1 File is OLDER - file1.copy5.txt +INFO : - Path1 File is OLDER - file1.txt +INFO : - Path1 File is OLDER - subdir/file20.txt INFO : Path1: 8 changes: 0 new, 1 newer, 7 older, 0 deleted INFO : Path2 checking for diffs INFO : Applying changes -INFO : - Path1 Queue copy to Path2 - {path2/}RCLONE_TEST -INFO : - Path1 Queue copy to Path2 - {path2/}file1.copy1.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file1.copy2.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file1.copy3.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file1.copy4.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file1.copy5.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file1.txt -INFO : - Path1 Queue copy to Path2 - {path2/}subdir/file20.txt -INFO : - Path1 Do queued copies to - Path2 +INFO : - Path1 Queue copy to Path2 - {path2/}RCLONE_TEST +INFO : - Path1 Queue copy to Path2 - {path2/}file1.copy1.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file1.copy2.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file1.copy3.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file1.copy4.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file1.copy5.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file1.txt +INFO : - Path1 Queue copy to Path2 - {path2/}subdir/file20.txt +INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_basic/golden/test.log b/cmd/bisync/testdata/test_basic/golden/test.log index e82d9c88e27ea..57d6541a01074 100644 --- a/cmd/bisync/testdata/test_basic/golden/test.log +++ b/cmd/bisync/testdata/test_basic/golden/test.log @@ -1,33 +1,33 @@ -(01) : test basic +(01) : test basic -(02) : test initial bisync -(03) : bisync resync +(02) : test initial bisync +(03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(04) : test place newer files on both paths +(04) : test place newer files on both paths -(05) : touch-copy 2001-01-02 {datadir/}file1.txt {path2/} -(06) : copy-as {datadir/}file1.txt {path1/}subdir file20.txt +(05) : touch-copy 2001-01-02 {datadir/}file1.txt {path2/} +(06) : copy-as {datadir/}file1.txt {path1/}subdir file20.txt -(07) : test bisync run -(08) : bisync +(07) : test bisync run +(08) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs -INFO : - Path1 File is newer - subdir/file20.txt +INFO : - Path1 File is newer - subdir/file20.txt INFO : Path1: 1 changes: 0 new, 1 newer, 0 older, 0 deleted INFO : Path2 checking for diffs -INFO : - Path2 File is newer - file1.txt +INFO : - Path2 File is newer - file1.txt INFO : Path2: 1 changes: 0 new, 1 newer, 0 older, 0 deleted INFO : Applying changes -INFO : - Path1 Queue copy to Path2 - {path2/}subdir/file20.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt -INFO : - Path2 Do queued copies to - Path1 -INFO : - Path1 Do queued copies to - Path2 +INFO : - Path1 Queue copy to Path2 - {path2/}subdir/file20.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt +INFO : - Path2 Do queued copies to - Path1 +INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_changes/golden/test.log b/cmd/bisync/testdata/test_changes/golden/test.log index f77d40340ad85..aff7b456d0c57 100644 --- a/cmd/bisync/testdata/test_changes/golden/test.log +++ b/cmd/bisync/testdata/test_changes/golden/test.log @@ -1,71 +1,71 @@ -(01) : test changes +(01) : test changes -(02) : test initial bisync -(03) : bisync resync +(02) : test initial bisync +(03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(04) : test make modifications on both paths -(05) : test new on path2 - file10 -(06) : touch-copy 2001-01-02 {datadir/}file10.txt {path2/} +(04) : test make modifications on both paths +(05) : test new on path2 - file10 +(06) : touch-copy 2001-01-02 {datadir/}file10.txt {path2/} -(07) : test newer on path2 - file1 -(08) : touch-copy 2001-01-02 {datadir/}file1.txt {path2/} +(07) : test newer on path2 - file1 +(08) : touch-copy 2001-01-02 {datadir/}file1.txt {path2/} -(09) : test new on path1 - file11 -(10) : touch-copy 2001-01-02 {datadir/}file11.txt {path1/} +(09) : test new on path1 - file11 +(10) : touch-copy 2001-01-02 {datadir/}file11.txt {path1/} -(11) : test newer on path1 - file2 -(12) : touch-copy 2001-01-02 {datadir/}file2.txt {path1/} +(11) : test newer on path1 - file2 +(12) : touch-copy 2001-01-02 {datadir/}file2.txt {path1/} -(13) : test deleted on path2 - file3 -(14) : delete-file {path2/}file3.txt +(13) : test deleted on path2 - file3 +(14) : delete-file {path2/}file3.txt -(15) : test deleted on path1 - file4 -(16) : delete-file {path1/}file4.txt +(15) : test deleted on path1 - file4 +(16) : delete-file {path1/}file4.txt -(17) : test deleted on both paths - file8 -(18) : delete-file {path1/}file8.txt -(19) : delete-file {path2/}file8.txt +(17) : test deleted on both paths - file8 +(18) : delete-file {path1/}file8.txt +(19) : delete-file {path2/}file8.txt -(20) : test changed on both paths - file5 (file5R, file5L) -(21) : touch-glob 2001-01-02 {datadir/} file5R.txt -(22) : copy-as {datadir/}file5R.txt {path2/} file5.txt -(23) : touch-glob 2001-03-04 {datadir/} file5L.txt -(24) : copy-as {datadir/}file5L.txt {path1/} file5.txt +(20) : test changed on both paths - file5 (file5R, file5L) +(21) : touch-glob 2001-01-02 {datadir/} file5R.txt +(22) : copy-as {datadir/}file5R.txt {path2/} file5.txt +(23) : touch-glob 2001-03-04 {datadir/} file5L.txt +(24) : copy-as {datadir/}file5L.txt {path1/} file5.txt -(25) : test newer on path2 and deleted on path1 - file6 -(26) : touch-copy 2001-01-02 {datadir/}file6.txt {path2/} -(27) : delete-file {path1/}file6.txt +(25) : test newer on path2 and deleted on path1 - file6 +(26) : touch-copy 2001-01-02 {datadir/}file6.txt {path2/} +(27) : delete-file {path1/}file6.txt -(28) : test newer on path1 and deleted on path2 - file7 -(29) : touch-copy 2001-01-02 {datadir/}file7.txt {path1/} -(30) : delete-file {path2/}file7.txt +(28) : test newer on path1 and deleted on path2 - file7 +(29) : touch-copy 2001-01-02 {datadir/}file7.txt {path1/} +(30) : delete-file {path2/}file7.txt -(31) : test bisync run -(32) : bisync +(31) : test bisync run +(32) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs -INFO : - Path1 File is new - file11.txt -INFO : - Path1 File is newer - file2.txt -INFO : - Path1 File is newer - file5.txt -INFO : - Path1 File is newer - file7.txt -INFO : - Path1 File was deleted - file4.txt -INFO : - Path1 File was deleted - file6.txt -INFO : - Path1 File was deleted - file8.txt +INFO : - Path1 File is newer - file2.txt +INFO : - Path1 File was deleted - file4.txt +INFO : - Path1 File is newer - file5.txt +INFO : - Path1 File was deleted - file6.txt +INFO : - Path1 File is newer - file7.txt +INFO : - Path1 File was deleted - file8.txt +INFO : - Path1 File is new - file11.txt INFO : Path1: 7 changes: 1 new, 3 newer, 0 older, 3 deleted INFO : Path2 checking for diffs -INFO : - Path2 File is new - file10.txt -INFO : - Path2 File is newer - file1.txt -INFO : - Path2 File is newer - file5.txt -INFO : - Path2 File is newer - file6.txt -INFO : - Path2 File was deleted - file3.txt -INFO : - Path2 File was deleted - file7.txt -INFO : - Path2 File was deleted - file8.txt +INFO : - Path2 File is newer - file1.txt +INFO : - Path2 File was deleted - file3.txt +INFO : - Path2 File is newer - file5.txt +INFO : - Path2 File is newer - file6.txt +INFO : - Path2 File was deleted - file7.txt +INFO : - Path2 File was deleted - file8.txt +INFO : - Path2 File is new - file10.txt INFO : Path2: 7 changes: 1 new, 3 newer, 0 older, 3 deleted INFO : Applying changes INFO : Checking potential conflicts... @@ -73,21 +73,21 @@ ERROR : file5.txt: md5 differ NOTICE: Local file system at {path2}: 1 differences found NOTICE: Local file system at {path2}: 1 errors while checking INFO : Finished checking the potential conflicts. 1 differences found -INFO : - Path1 Queue copy to Path2 - {path2/}file11.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file2.txt -INFO : - Path2 Queue delete - {path2/}file4.txt -NOTICE: - WARNING New or changed in both paths - file5.txt -NOTICE: - Path1 Renaming Path1 copy - {path1/}file5.txt..path1 -NOTICE: - Path1 Queue copy to Path2 - {path2/}file5.txt..path1 -NOTICE: - Path2 Renaming Path2 copy - {path2/}file5.txt..path2 -NOTICE: - Path2 Queue copy to Path1 - {path1/}file5.txt..path2 -INFO : - Path2 Queue copy to Path1 - {path1/}file6.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file7.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file10.txt -INFO : - Path1 Queue delete - {path1/}file3.txt -INFO : - Path2 Do queued copies to - Path1 -INFO : - Path1 Do queued copies to - Path2 +INFO : - Path1 Queue copy to Path2 - {path2/}file11.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file2.txt +INFO : - Path2 Queue delete - {path2/}file4.txt +NOTICE: - WARNING New or changed in both paths - file5.txt +NOTICE: - Path1 Renaming Path1 copy - {path1/}file5.txt..path1 +NOTICE: - Path1 Queue copy to Path2 - {path2/}file5.txt..path1 +NOTICE: - Path2 Renaming Path2 copy - {path2/}file5.txt..path2 +NOTICE: - Path2 Queue copy to Path1 - {path1/}file5.txt..path2 +INFO : - Path2 Queue copy to Path1 - {path1/}file6.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file7.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file10.txt +INFO : - Path1 Queue delete - {path1/}file3.txt +INFO : - Path2 Do queued copies to - Path1 +INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_check_access/golden/test.log b/cmd/bisync/testdata/test_check_access/golden/test.log index 61d671649a7c5..d7382b9afea3b 100644 --- a/cmd/bisync/testdata/test_check_access/golden/test.log +++ b/cmd/bisync/testdata/test_check_access/golden/test.log @@ -1,16 +1,16 @@ -(01) : test check-access +(01) : test check-access -(02) : test initial bisync -(03) : bisync resync +(02) : test initial bisync +(03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(04) : test 1. see that check-access passes with the initial setup -(05) : bisync check-access +(04) : test 1. see that check-access passes with the initial setup +(05) : bisync check-access INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs INFO : Path2 checking for diffs @@ -19,35 +19,35 @@ INFO : Found 2 matching "RCLONE_TEST" files on both paths INFO : No changes found INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful -(06) : test 2. delete the path2 subdir RCLONE_TEST and run sync. should fail critical. -(07) : delete-file {path2/}subdir/RCLONE_TEST -(08) : bisync check-access +(06) : test 2. delete the path2 subdir RCLONE_TEST and run sync. should fail critical. +(07) : delete-file {path2/}subdir/RCLONE_TEST +(08) : bisync check-access INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs INFO : Path2 checking for diffs -INFO : - Path2 File was deleted - subdir/RCLONE_TEST +INFO : - Path2 File was deleted - subdir/RCLONE_TEST INFO : Path2: 1 changes: 0 new, 0 newer, 0 older, 1 deleted INFO : Checking access health ERROR : Access test failed: Path1 count 2, Path2 count 1 - RCLONE_TEST -ERROR : - Access test failed: Path1 file not found in Path2 - subdir/RCLONE_TEST -ERROR : Bisync critical error: check file check failed -ERROR : Bisync aborted. Must run --resync to recover. +ERROR : -  Access test failed: Path1 file not found in Path2 - subdir/RCLONE_TEST +ERROR : Bisync critical error: check file check failed +ERROR : Bisync aborted. Must run --resync to recover. Bisync error: bisync aborted -(09) : copy-listings path2-missing +(09) : copy-listings path2-missing -(10) : test 3. put the path2 subdir RCLONE_TEST back, resync. -(11) : copy-file {path1/}subdir/RCLONE_TEST {path2/} -(12) : bisync resync +(10) : test 3. put the path2 subdir RCLONE_TEST back, resync. +(11) : copy-file {path1/}subdir/RCLONE_TEST {path2/} +(12) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(13) : test 4. run sync with check-access. should pass. -(14) : bisync check-access +(13) : test 4. run sync with check-access. should pass. +(14) : bisync check-access INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs INFO : Path2 checking for diffs @@ -56,44 +56,44 @@ INFO : Found 2 matching "RCLONE_TEST" files on both paths INFO : No changes found INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful -(15) : test 5. delete path1 top level RCLONE_TEST, run sync. should fail critical. -(16) : delete-file {path1/}RCLONE_TEST -(17) : bisync check-access +(15) : test 5. delete path1 top level RCLONE_TEST, run sync. should fail critical. +(16) : delete-file {path1/}RCLONE_TEST +(17) : bisync check-access INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs -INFO : - Path1 File was deleted - RCLONE_TEST +INFO : - Path1 File was deleted - RCLONE_TEST INFO : Path1: 1 changes: 0 new, 0 newer, 0 older, 1 deleted INFO : Path2 checking for diffs INFO : Checking access health ERROR : Access test failed: Path1 count 1, Path2 count 2 - RCLONE_TEST -ERROR : - Access test failed: Path2 file not found in Path1 - RCLONE_TEST -ERROR : Bisync critical error: check file check failed -ERROR : Bisync aborted. Must run --resync to recover. +ERROR : -  Access test failed: Path2 file not found in Path1 - RCLONE_TEST +ERROR : Bisync critical error: check file check failed +ERROR : Bisync aborted. Must run --resync to recover. Bisync error: bisync aborted -(18) : copy-listings path1-missing +(18) : copy-listings path1-missing -(19) : test 6. run again. should fail critical due to missing listings. -(20) : bisync check-access +(19) : test 6. run again. should fail critical due to missing listings. +(20) : bisync check-access INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" -ERROR : Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run -ERROR : Bisync aborted. Must run --resync to recover. +ERROR : Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run +ERROR : Bisync aborted. Must run --resync to recover. Bisync error: bisync aborted -(21) : move-listings missing-listings +(21) : move-listings missing-listings -(22) : test 7. run resync, which will copy the path2 top level back to path1. -(23) : bisync resync +(22) : test 7. run resync, which will copy the path2 top level back to path1. +(23) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : - Path2 Resync will copy to Path1 - RCLONE_TEST -INFO : - Path2 Resync is doing queued copies to - Path1 +INFO : - Path2 Resync will copy to Path1 - RCLONE_TEST +INFO : - Path2 Resync is doing queued copies to - Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(24) : test 8. run sync with --check-access. should pass. -(25) : bisync check-access +(24) : test 8. run sync with --check-access. should pass. +(25) : bisync check-access INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs INFO : Path2 checking for diffs @@ -102,4 +102,4 @@ INFO : Found 2 matching "RCLONE_TEST" files on both paths INFO : No changes found INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_check_access_filters/golden/test.log b/cmd/bisync/testdata/test_check_access_filters/golden/test.log index b58a0e2635461..cd7753a9fc6b8 100644 --- a/cmd/bisync/testdata/test_check_access_filters/golden/test.log +++ b/cmd/bisync/testdata/test_check_access_filters/golden/test.log @@ -1,21 +1,21 @@ -(01) : test check-access-filters +(01) : test check-access-filters -(02) : test EXCLUDE - OTHER TESTS -(03) : copy-file {datadir/}exclude-other-filtersfile.txt {workdir/} +(02) : test EXCLUDE - OTHER TESTS +(03) : copy-file {datadir/}exclude-other-filtersfile.txt {workdir/} -(04) : test resync to get the filters file md5 built. -(05) : bisync resync filters-file={workdir/}exclude-other-filtersfile.txt +(04) : test resync to get the filters file md5 built. +(05) : bisync resync filters-file={workdir/}exclude-other-filtersfile.txt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}exclude-other-filtersfile.txt INFO : Storing filters file hash to {workdir/}exclude-other-filtersfile.txt.md5 INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(06) : test EXCLUDE - test filters for check access -(07) : bisync check-access filters-file={workdir/}exclude-other-filtersfile.txt +(06) : test EXCLUDE - test filters for check access +(07) : bisync check-access filters-file={workdir/}exclude-other-filtersfile.txt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}exclude-other-filtersfile.txt INFO : Path1 checking for diffs @@ -25,17 +25,17 @@ INFO : Found 3 matching "RCLONE_TEST" files on both paths INFO : No changes found INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful -(08) : copy-listings exclude-initial +INFO : Bisync successful +(08) : copy-listings exclude-initial -(09) : test EXCLUDE - delete RCLONE_TEST files in excluded directories -(10) : delete-file {path2/}subdir/subdirA/RCLONE_TEST -(11) : delete-file {path1/}subdir-not/RCLONE_TEST -(12) : delete-file {path2/}subdir-not/subdir-not2/RCLONE_TEST -(13) : delete-file {path1/}subdirX/RCLONE_TEST +(09) : test EXCLUDE - delete RCLONE_TEST files in excluded directories +(10) : delete-file {path2/}subdir/subdirA/RCLONE_TEST +(11) : delete-file {path1/}subdir-not/RCLONE_TEST +(12) : delete-file {path2/}subdir-not/subdir-not2/RCLONE_TEST +(13) : delete-file {path1/}subdirX/RCLONE_TEST -(14) : test EXCLUDE - test should PASS -(15) : bisync check-access filters-file={workdir/}exclude-other-filtersfile.txt +(14) : test EXCLUDE - test should PASS +(15) : bisync check-access filters-file={workdir/}exclude-other-filtersfile.txt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}exclude-other-filtersfile.txt INFO : Path1 checking for diffs @@ -45,47 +45,47 @@ INFO : Found 3 matching "RCLONE_TEST" files on both paths INFO : No changes found INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful -(16) : copy-listings exclude-pass-run +INFO : Bisync successful +(16) : copy-listings exclude-pass-run -(17) : test EXCLUDE - delete RCLONE_TEST files in included directories -(18) : delete-file {path2/}RCLONE_TEST -(19) : delete-file {path1/}subdir/RCLONE_TEST +(17) : test EXCLUDE - delete RCLONE_TEST files in included directories +(18) : delete-file {path2/}RCLONE_TEST +(19) : delete-file {path1/}subdir/RCLONE_TEST -(20) : test EXCLUDE - test should ABORT -(21) : bisync check-access filters-file={workdir/}exclude-other-filtersfile.txt +(20) : test EXCLUDE - test should ABORT +(21) : bisync check-access filters-file={workdir/}exclude-other-filtersfile.txt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}exclude-other-filtersfile.txt INFO : Path1 checking for diffs -INFO : - Path1 File was deleted - subdir/RCLONE_TEST +INFO : - Path1 File was deleted - subdir/RCLONE_TEST INFO : Path1: 1 changes: 0 new, 0 newer, 0 older, 1 deleted INFO : Path2 checking for diffs -INFO : - Path2 File was deleted - RCLONE_TEST +INFO : - Path2 File was deleted - RCLONE_TEST INFO : Path2: 1 changes: 0 new, 0 newer, 0 older, 1 deleted INFO : Checking access health -ERROR : - Access test failed: Path1 file not found in Path2 - RCLONE_TEST -ERROR : - Access test failed: Path2 file not found in Path1 - subdir/RCLONE_TEST -ERROR : Bisync critical error: check file check failed -ERROR : Bisync aborted. Must run --resync to recover. +ERROR : -  Access test failed: Path1 file not found in Path2 - RCLONE_TEST +ERROR : -  Access test failed: Path2 file not found in Path1 - subdir/RCLONE_TEST +ERROR : Bisync critical error: check file check failed +ERROR : Bisync aborted. Must run --resync to recover. Bisync error: bisync aborted -(22) : move-listings exclude-error-run +(22) : move-listings exclude-error-run -(23) : test INCLUDE - OTHER TESTS -(24) : test reset to the initial state -(25) : copy-dir {testdir/}initial {path1/} -(26) : sync-dir {path1/} {path2/} -(27) : copy-file {datadir/}include-other-filtersfile.txt {workdir/} -(28) : bisync resync filters-file={workdir/}include-other-filtersfile.txt +(23) : test INCLUDE - OTHER TESTS +(24) : test reset to the initial state +(25) : copy-dir {testdir/}initial {path1/} +(26) : sync-dir {path1/} {path2/} +(27) : copy-file {datadir/}include-other-filtersfile.txt {workdir/} +(28) : bisync resync filters-file={workdir/}include-other-filtersfile.txt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}include-other-filtersfile.txt INFO : Storing filters file hash to {workdir/}include-other-filtersfile.txt.md5 INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(29) : test INCLUDE - test include/exclude filters for check access -(30) : bisync check-access filters-file={workdir/}include-other-filtersfile.txt +(29) : test INCLUDE - test include/exclude filters for check access +(30) : bisync check-access filters-file={workdir/}include-other-filtersfile.txt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}include-other-filtersfile.txt INFO : Path1 checking for diffs @@ -95,16 +95,16 @@ INFO : Found 5 matching "RCLONE_TEST" files on both paths INFO : No changes found INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful -(31) : copy-listings include-initial +INFO : Bisync successful +(31) : copy-listings include-initial -(32) : test INCLUDE - delete RCLONE_TEST files in excluded directories -(33) : delete-file {path2/}subdir/subdirA/RCLONE_TEST -(34) : delete-file {path1/}subdir-not/RCLONE_TEST -(35) : delete-file {path2/}subdir-not/subdir-not2/RCLONE_TEST +(32) : test INCLUDE - delete RCLONE_TEST files in excluded directories +(33) : delete-file {path2/}subdir/subdirA/RCLONE_TEST +(34) : delete-file {path1/}subdir-not/RCLONE_TEST +(35) : delete-file {path2/}subdir-not/subdir-not2/RCLONE_TEST -(36) : test INCLUDE - test should PASS -(37) : bisync check-access filters-file={workdir/}include-other-filtersfile.txt +(36) : test INCLUDE - test should PASS +(37) : bisync check-access filters-file={workdir/}include-other-filtersfile.txt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}include-other-filtersfile.txt INFO : Path1 checking for diffs @@ -114,31 +114,31 @@ INFO : Found 5 matching "RCLONE_TEST" files on both paths INFO : No changes found INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful -(38) : copy-listings include-pass-run +INFO : Bisync successful +(38) : copy-listings include-pass-run -(39) : test INCLUDE - delete RCLONE_TEST files in included directories -(40) : delete-file {path2/}RCLONE_TEST -(41) : delete-file {path1/}subdir/RCLONE_TEST -(42) : delete-file {path1/}subdirX/subdirX1/RCLONE_TEST +(39) : test INCLUDE - delete RCLONE_TEST files in included directories +(40) : delete-file {path2/}RCLONE_TEST +(41) : delete-file {path1/}subdir/RCLONE_TEST +(42) : delete-file {path1/}subdirX/subdirX1/RCLONE_TEST -(43) : test INCLUDE - test should ABORT -(44) : bisync check-access filters-file={workdir/}include-other-filtersfile.txt +(43) : test INCLUDE - test should ABORT +(44) : bisync check-access filters-file={workdir/}include-other-filtersfile.txt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}include-other-filtersfile.txt INFO : Path1 checking for diffs -INFO : - Path1 File was deleted - subdir/RCLONE_TEST -INFO : - Path1 File was deleted - subdirX/subdirX1/RCLONE_TEST +INFO : - Path1 File was deleted - subdir/RCLONE_TEST +INFO : - Path1 File was deleted - subdirX/subdirX1/RCLONE_TEST INFO : Path1: 2 changes: 0 new, 0 newer, 0 older, 2 deleted INFO : Path2 checking for diffs -INFO : - Path2 File was deleted - RCLONE_TEST +INFO : - Path2 File was deleted - RCLONE_TEST INFO : Path2: 1 changes: 0 new, 0 newer, 0 older, 1 deleted INFO : Checking access health ERROR : Access test failed: Path1 count 3, Path2 count 4 - RCLONE_TEST -ERROR : - Access test failed: Path1 file not found in Path2 - RCLONE_TEST -ERROR : - Access test failed: Path2 file not found in Path1 - subdir/RCLONE_TEST -ERROR : - Access test failed: Path2 file not found in Path1 - subdirX/subdirX1/RCLONE_TEST -ERROR : Bisync critical error: check file check failed -ERROR : Bisync aborted. Must run --resync to recover. +ERROR : -  Access test failed: Path1 file not found in Path2 - RCLONE_TEST +ERROR : -  Access test failed: Path2 file not found in Path1 - subdirX/subdirX1/RCLONE_TEST +ERROR : -  Access test failed: Path2 file not found in Path1 - subdir/RCLONE_TEST +ERROR : Bisync critical error: check file check failed +ERROR : Bisync aborted. Must run --resync to recover. Bisync error: bisync aborted -(45) : move-listings include-error-run +(45) : move-listings include-error-run diff --git a/cmd/bisync/testdata/test_check_filename/golden/test.log b/cmd/bisync/testdata/test_check_filename/golden/test.log index d008b934d731a..f03e1fdc2b962 100644 --- a/cmd/bisync/testdata/test_check_filename/golden/test.log +++ b/cmd/bisync/testdata/test_check_filename/golden/test.log @@ -1,16 +1,16 @@ -(01) : test check-filename +(01) : test check-filename -(02) : test initial bisync -(03) : bisync resync +(02) : test initial bisync +(03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(04) : test 1. see that check-access passes with the initial setup -(05) : bisync check-access check-filename=.chk_file +(04) : test 1. see that check-access passes with the initial setup +(05) : bisync check-access check-filename=.chk_file INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs INFO : Path2 checking for diffs @@ -19,38 +19,38 @@ INFO : Found 2 matching ".chk_file" files on both paths INFO : No changes found INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful -(06) : copy-listings initial-pass +INFO : Bisync successful +(06) : copy-listings initial-pass -(07) : test 2. delete the remote subdir .chk_file, run sync. should fail critical. -(08) : delete-file {path2/}subdir/.chk_file -(09) : bisync check-access check-filename=.chk_file +(07) : test 2. delete the remote subdir .chk_file, run sync. should fail critical. +(08) : delete-file {path2/}subdir/.chk_file +(09) : bisync check-access check-filename=.chk_file INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs INFO : Path2 checking for diffs -INFO : - Path2 File was deleted - subdir/.chk_file +INFO : - Path2 File was deleted - subdir/.chk_file INFO : Path2: 1 changes: 0 new, 0 newer, 0 older, 1 deleted INFO : Checking access health ERROR : Access test failed: Path1 count 2, Path2 count 1 - .chk_file -ERROR : - Access test failed: Path1 file not found in Path2 - subdir/.chk_file -ERROR : Bisync critical error: check file check failed -ERROR : Bisync aborted. Must run --resync to recover. +ERROR : -  Access test failed: Path1 file not found in Path2 - subdir/.chk_file +ERROR : Bisync critical error: check file check failed +ERROR : Bisync aborted. Must run --resync to recover. Bisync error: bisync aborted -(10) : move-listings path2-missing +(10) : move-listings path2-missing -(11) : test 3. put the remote subdir .chk_file back, run resync. -(12) : copy-file {path1/}subdir/.chk_file {path2/}subdir/ -(13) : bisync check-access resync check-filename=.chk_file +(11) : test 3. put the remote subdir .chk_file back, run resync. +(12) : copy-file {path1/}subdir/.chk_file {path2/}subdir/ +(13) : bisync check-access resync check-filename=.chk_file INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Checking access health INFO : Found 2 matching ".chk_file" files on both paths INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(14) : test 4. run sync with check-access. should pass. -(15) : bisync check-access check-filename=.chk_file +(14) : test 4. run sync with check-access. should pass. +(15) : bisync check-access check-filename=.chk_file INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs INFO : Path2 checking for diffs @@ -59,4 +59,4 @@ INFO : Found 2 matching ".chk_file" files on both paths INFO : No changes found INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_check_sync/golden/test.log b/cmd/bisync/testdata/test_check_sync/golden/test.log index 8984a8b812a78..d70224b29c6d1 100644 --- a/cmd/bisync/testdata/test_check_sync/golden/test.log +++ b/cmd/bisync/testdata/test_check_sync/golden/test.log @@ -1,68 +1,68 @@ -(01) : test check-sync +(01) : test check-sync -(02) : test initial bisync -(03) : bisync resync +(02) : test initial bisync +(03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(04) : test 1. run check-sync-only on a clean sync -(05) : bisync check-sync-only +(04) : test 1. run check-sync-only on a clean sync +(05) : bisync check-sync-only INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful -(06) : test 2. inject modified listings into the workdir -(07) : copy-as {datadir/}_testdir_path1.._testdir_path2.path1.lst {workdir/} {session}.path1.lst -(08) : copy-as {datadir/}_testdir_path1.._testdir_path2.path2.lst {workdir/} {session}.path2.lst +(06) : test 2. inject modified listings into the workdir +(07) : copy-as {datadir/}_testdir_path1.._testdir_path2.path1.lst {workdir/} {session}.path1.lst +(08) : copy-as {datadir/}_testdir_path1.._testdir_path2.path2.lst {workdir/} {session}.path2.lst -(09) : test 3. run check-sync-only on modified listings -(10) : bisync check-sync-only +(09) : test 3. run check-sync-only on modified listings +(10) : bisync check-sync-only INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -ERROR : - Path1 file not found in Path2 - file2.txt -ERROR : - Path2 file not found in Path1 - file1.txt -ERROR : Bisync critical error: path1 and path2 are out of sync, run --resync to recover -ERROR : Bisync aborted. Must run --resync to recover. +ERROR : -  Path1 file not found in Path2 - file2.txt +ERROR : -  Path2 file not found in Path1 - file1.txt +ERROR : Bisync critical error: path1 and path2 are out of sync, run --resync to recover +ERROR : Bisync aborted. Must run --resync to recover. Bisync error: bisync aborted -(11) : copy-listings check-sync-only +(11) : copy-listings check-sync-only -(12) : test 4. run normal sync to check that it aborts -(13) : bisync +(12) : test 4. run normal sync to check that it aborts +(13) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" -ERROR : Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run -ERROR : Bisync aborted. Must run --resync to recover. +ERROR : Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run +ERROR : Bisync aborted. Must run --resync to recover. Bisync error: bisync aborted -(14) : test 5. prune failure listings after critical abort -(15) : delete-glob {workdir/} *.lst -(16) : delete-glob {workdir/} *.lst-err -(17) : delete-glob {workdir/} *.lst-new +(14) : test 5. prune failure listings after critical abort +(15) : delete-glob {workdir/} *.lst +(16) : delete-glob {workdir/} *.lst-err +(17) : delete-glob {workdir/} *.lst-new -(18) : test 6. run resync -(19) : bisync resync +(18) : test 6. run resync +(19) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(20) : test 7. run normal sync with check-sync enabled (default) -(21) : bisync +(20) : test 7. run normal sync with check-sync enabled (default) +(21) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : No changes found INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful -(22) : test 8. run normal sync with no-check-sync -(23) : bisync no-check-sync +(22) : test 8. run normal sync with no-check-sync +(23) : bisync no-check-sync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : No changes found INFO : Updating listings -INFO : Bisync successful +INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log b/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log index c63c8850cc1a8..1b2583d27486e 100644 --- a/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log +++ b/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log @@ -1,142 +1,142 @@ -(01) : test createemptysrcdirs +(01) : test createemptysrcdirs -(02) : test initial bisync -(03) : touch-glob 2001-01-02 {datadir/} placeholder.txt -(04) : copy-as {datadir/}placeholder.txt {path1/} file1.txt -(05) : copy-as {datadir/}placeholder.txt {path1/} file1.copy1.txt -(06) : copy-as {datadir/}placeholder.txt {path1/} file1.copy2.txt -(07) : copy-as {datadir/}placeholder.txt {path1/} file1.copy3.txt -(08) : copy-as {datadir/}placeholder.txt {path1/} file1.copy4.txt -(09) : copy-as {datadir/}placeholder.txt {path1/} file1.copy5.txt -(10) : bisync resync +(02) : test initial bisync +(03) : touch-glob 2001-01-02 {datadir/} placeholder.txt +(04) : copy-as {datadir/}placeholder.txt {path1/} file1.txt +(05) : copy-as {datadir/}placeholder.txt {path1/} file1.copy1.txt +(06) : copy-as {datadir/}placeholder.txt {path1/} file1.copy2.txt +(07) : copy-as {datadir/}placeholder.txt {path1/} file1.copy3.txt +(08) : copy-as {datadir/}placeholder.txt {path1/} file1.copy4.txt +(09) : copy-as {datadir/}placeholder.txt {path1/} file1.copy5.txt +(10) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(11) : test 1. Create an empty dir on Path1 by creating subdir/placeholder.txt and then deleting the placeholder -(12) : copy-as {datadir/}placeholder.txt {path1/} subdir/placeholder.txt -(13) : touch-glob 2001-01-02 {path1/} subdir -(14) : delete-file {path1/}subdir/placeholder.txt +(11) : test 1. Create an empty dir on Path1 by creating subdir/placeholder.txt and then deleting the placeholder +(12) : copy-as {datadir/}placeholder.txt {path1/} subdir/placeholder.txt +(13) : touch-glob 2001-01-02 {path1/} subdir +(14) : delete-file {path1/}subdir/placeholder.txt -(15) : test 2. Run bisync without --create-empty-src-dirs -(16) : bisync +(15) : test 2. Run bisync without --create-empty-src-dirs +(16) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : No changes found INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful -(17) : test 3. Confirm the subdir exists only on Path1 and not Path2 -(18) : list-dirs {path1/} +(17) : test 3. Confirm the subdir exists only on Path1 and not Path2 +(18) : list-dirs {path1/} subdir/ -(19) : list-dirs {path2/} +(19) : list-dirs {path2/} -(20) : test 4.Run bisync WITH --create-empty-src-dirs -(21) : bisync create-empty-src-dirs +(20) : test 4.Run bisync WITH --create-empty-src-dirs +(21) : bisync create-empty-src-dirs INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs -INFO : - Path1 File is new - subdir +INFO : - Path1 File is new - subdir INFO : Path1: 1 changes: 1 new, 0 newer, 0 older, 0 deleted INFO : Path2 checking for diffs INFO : Applying changes -INFO : - Path1 Queue copy to Path2 - {path2/}subdir -INFO : - Path1 Do queued copies to - Path2 +INFO : - Path1 Queue copy to Path2 - {path2/}subdir +INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful -(22) : test 5. Confirm the subdir exists on both paths -(23) : list-dirs {path1/} +(22) : test 5. Confirm the subdir exists on both paths +(23) : list-dirs {path1/} subdir/ -(24) : list-dirs {path2/} +(24) : list-dirs {path2/} subdir/ -(25) : test 6. Delete the empty dir on Path1 using purge-children (and also add files so the path isn't empty) -(26) : purge-children {path1/} -(27) : copy-as {datadir/}placeholder.txt {path1/} file1.txt -(28) : copy-as {datadir/}placeholder.txt {path1/} file1.copy1.txt -(29) : copy-as {datadir/}placeholder.txt {path1/} file1.copy2.txt -(30) : copy-as {datadir/}placeholder.txt {path1/} file1.copy3.txt -(31) : copy-as {datadir/}placeholder.txt {path1/} file1.copy4.txt -(32) : copy-as {datadir/}placeholder.txt {path1/} file1.copy5.txt +(25) : test 6. Delete the empty dir on Path1 using purge-children (and also add files so the path isn't empty) +(26) : purge-children {path1/} +(27) : copy-as {datadir/}placeholder.txt {path1/} file1.txt +(28) : copy-as {datadir/}placeholder.txt {path1/} file1.copy1.txt +(29) : copy-as {datadir/}placeholder.txt {path1/} file1.copy2.txt +(30) : copy-as {datadir/}placeholder.txt {path1/} file1.copy3.txt +(31) : copy-as {datadir/}placeholder.txt {path1/} file1.copy4.txt +(32) : copy-as {datadir/}placeholder.txt {path1/} file1.copy5.txt -(33) : test 7. Run bisync without --create-empty-src-dirs -(34) : bisync +(33) : test 7. Run bisync without --create-empty-src-dirs +(34) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs -INFO : - Path1 File was deleted - RCLONE_TEST -INFO : - Path1 File was deleted - subdir +INFO : - Path1 File was deleted - RCLONE_TEST +INFO : - Path1 File was deleted - subdir INFO : Path1: 2 changes: 0 new, 0 newer, 0 older, 2 deleted INFO : Path2 checking for diffs -INFO : - Path2 File was deleted - subdir +INFO : - Path2 File was deleted - subdir INFO : Path2: 1 changes: 0 new, 0 newer, 0 older, 1 deleted INFO : Applying changes -INFO : - Path2 Queue delete - {path2/}RCLONE_TEST -INFO : - Path1 Do queued copies to - Path2 +INFO : - Path2 Queue delete - {path2/}RCLONE_TEST +INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful -(35) : test 8. Confirm the subdir exists only on Path2 and not Path1 -(36) : list-dirs {path1/} -(37) : list-dirs {path2/} +(35) : test 8. Confirm the subdir exists only on Path2 and not Path1 +(36) : list-dirs {path1/} +(37) : list-dirs {path2/} subdir/ -(38) : test 9. Reset, do the delete again, and run bisync WITH --create-empty-src-dirs -(39) : bisync resync create-empty-src-dirs +(38) : test 9. Reset, do the delete again, and run bisync WITH --create-empty-src-dirs +(39) : bisync resync create-empty-src-dirs INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : - Path2 Resync will copy to Path1 - subdir -INFO : - Path2 Resync is doing queued copies to - Path1 +INFO : - Path2 Resync will copy to Path1 - subdir +INFO : - Path2 Resync is doing queued copies to - Path1 INFO : Resynching Path1 to Path2 INFO : Resynching Path2 to Path1 (for empty dirs) INFO : Resync updating listings -INFO : Bisync successful -(40) : list-dirs {path1/} +INFO : Bisync successful +(40) : list-dirs {path1/} subdir/ -(41) : list-dirs {path2/} +(41) : list-dirs {path2/} subdir/ -(42) : purge-children {path1/} -(43) : copy-as {datadir/}placeholder.txt {path1/} file1.txt -(44) : copy-as {datadir/}placeholder.txt {path1/} file1.copy1.txt -(45) : copy-as {datadir/}placeholder.txt {path1/} file1.copy2.txt -(46) : copy-as {datadir/}placeholder.txt {path1/} file1.copy3.txt -(47) : copy-as {datadir/}placeholder.txt {path1/} file1.copy4.txt -(48) : copy-as {datadir/}placeholder.txt {path1/} file1.copy5.txt -(49) : list-dirs {path1/} -(50) : list-dirs {path2/} +(42) : purge-children {path1/} +(43) : copy-as {datadir/}placeholder.txt {path1/} file1.txt +(44) : copy-as {datadir/}placeholder.txt {path1/} file1.copy1.txt +(45) : copy-as {datadir/}placeholder.txt {path1/} file1.copy2.txt +(46) : copy-as {datadir/}placeholder.txt {path1/} file1.copy3.txt +(47) : copy-as {datadir/}placeholder.txt {path1/} file1.copy4.txt +(48) : copy-as {datadir/}placeholder.txt {path1/} file1.copy5.txt +(49) : list-dirs {path1/} +(50) : list-dirs {path2/} subdir/ -(51) : bisync create-empty-src-dirs +(51) : bisync create-empty-src-dirs INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs -INFO : - Path1 File was deleted - subdir +INFO : - Path1 File was deleted - subdir INFO : Path1: 1 changes: 0 new, 0 newer, 0 older, 1 deleted INFO : Path2 checking for diffs INFO : Applying changes -INFO : - Path2 Queue delete - {path2/}subdir -INFO : - Path1 Do queued copies to - Path2 +INFO : - Path2 Queue delete - {path2/}subdir +INFO : - Path1 Do queued copies to - Path2 INFO : subdir: Removing directory INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful -(52) : test 10. Confirm the subdir has been removed on both paths -(53) : list-dirs {path1/} -(54) : list-dirs {path2/} +(52) : test 10. Confirm the subdir has been removed on both paths +(53) : list-dirs {path1/} +(54) : list-dirs {path2/} -(55) : test 11. bisync again (because if we leave subdir in listings, test will fail due to mismatched modtime) -(56) : bisync create-empty-src-dirs +(55) : test 11. bisync again (because if we leave subdir in listings, test will fail due to mismatched modtime) +(56) : bisync create-empty-src-dirs INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : No changes found INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_dry_run/golden/test.log b/cmd/bisync/testdata/test_dry_run/golden/test.log index 3d749965bc247..db5a487fa09d9 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/test.log +++ b/cmd/bisync/testdata/test_dry_run/golden/test.log @@ -1,54 +1,54 @@ -(01) : test dry-run +(01) : test dry-run -(02) : test initial bisync -(03) : bisync resync +(02) : test initial bisync +(03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(04) : test new on path2 - file10 -(05) : touch-copy 2001-01-02 {datadir/}file10.txt {path2/} +(04) : test new on path2 - file10 +(05) : touch-copy 2001-01-02 {datadir/}file10.txt {path2/} -(06) : test newer on path2 - file1 -(07) : touch-copy 2001-01-02 {datadir/}file1.txt {path2/} +(06) : test newer on path2 - file1 +(07) : touch-copy 2001-01-02 {datadir/}file1.txt {path2/} -(08) : test new on path1 - file11 -(09) : touch-copy 2001-01-02 {datadir/}file11.txt {path1/} +(08) : test new on path1 - file11 +(09) : touch-copy 2001-01-02 {datadir/}file11.txt {path1/} -(10) : test newer on path1 - file2 -(11) : touch-copy 2001-01-02 {datadir/}file2.txt {path1/} +(10) : test newer on path1 - file2 +(11) : touch-copy 2001-01-02 {datadir/}file2.txt {path1/} -(12) : test deleted on path2 - file3 -(13) : delete-file {path2/}file3.txt +(12) : test deleted on path2 - file3 +(13) : delete-file {path2/}file3.txt -(14) : test deleted on path1 - file4 -(15) : delete-file {path1/}file4.txt +(14) : test deleted on path1 - file4 +(15) : delete-file {path1/}file4.txt -(16) : test changed on path2 and on path1 - file5 (file5R, file5L) -(17) : touch-glob 2001-01-02 {datadir/} file5R.txt -(18) : copy-as {datadir/}file5R.txt {path2/} file5.txt -(19) : touch-glob 2001-03-04 {datadir/} file5L.txt -(20) : copy-as {datadir/}file5L.txt {path1/} file5.txt +(16) : test changed on path2 and on path1 - file5 (file5R, file5L) +(17) : touch-glob 2001-01-02 {datadir/} file5R.txt +(18) : copy-as {datadir/}file5R.txt {path2/} file5.txt +(19) : touch-glob 2001-03-04 {datadir/} file5L.txt +(20) : copy-as {datadir/}file5L.txt {path1/} file5.txt -(21) : test newer on path2 and deleted on path1 - file6 -(22) : touch-copy 2001-01-02 {datadir/}file6.txt {path2/} -(23) : delete-file {path1/}file6.txt +(21) : test newer on path2 and deleted on path1 - file6 +(22) : touch-copy 2001-01-02 {datadir/}file6.txt {path2/} +(23) : delete-file {path1/}file6.txt -(24) : test newer on path1 and deleted on path2 - file7 -(25) : touch-copy 2001-01-02 {datadir/}file7.txt {path1/} -(26) : delete-file {path2/}file7.txt +(24) : test newer on path1 and deleted on path2 - file7 +(25) : touch-copy 2001-01-02 {datadir/}file7.txt {path1/} +(26) : delete-file {path2/}file7.txt -(27) : test sync with dry-run and resync -(28) : bisync dry-run resync +(27) : test sync with dry-run and resync +(28) : bisync dry-run resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : - Path2 Resync will copy to Path1 - file10.txt -INFO : - Path2 Resync will copy to Path1 - file4.txt -INFO : - Path2 Resync will copy to Path1 - file6.txt -INFO : - Path2 Resync is doing queued copies to - Path1 +INFO : - Path2 Resync will copy to Path1 - file10.txt +INFO : - Path2 Resync will copy to Path1 - file4.txt +INFO : - Path2 Resync will copy to Path1 - file6.txt +INFO : - Path2 Resync is doing queued copies to - Path1 NOTICE: file10.txt: Skipped copy as --dry-run is set (size 19) NOTICE: file4.txt: Skipped copy as --dry-run is set (size 0) NOTICE: file6.txt: Skipped copy as --dry-run is set (size 19) @@ -60,27 +60,27 @@ NOTICE: file3.txt: Skipped copy as --dry-run is set (size 0) NOTICE: file5.txt: Skipped copy (or update modification time) as --dry-run is set (size 39) NOTICE: file7.txt: Skipped copy as --dry-run is set (size 19) INFO : Resync updating listings -INFO : Bisync successful -(29) : copy-listings dryrun-resync +INFO : Bisync successful +(29) : copy-listings dryrun-resync -(30) : test sync with dry-run -(31) : bisync dry-run +(30) : test sync with dry-run +(31) : bisync dry-run INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs -INFO : - Path1 File is new - file11.txt -INFO : - Path1 File is newer - file2.txt -INFO : - Path1 File is newer - file5.txt -INFO : - Path1 File is newer - file7.txt -INFO : - Path1 File was deleted - file4.txt -INFO : - Path1 File was deleted - file6.txt +INFO : - Path1 File is newer - file2.txt +INFO : - Path1 File was deleted - file4.txt +INFO : - Path1 File is newer - file5.txt +INFO : - Path1 File was deleted - file6.txt +INFO : - Path1 File is newer - file7.txt +INFO : - Path1 File is new - file11.txt INFO : Path1: 6 changes: 1 new, 3 newer, 0 older, 2 deleted INFO : Path2 checking for diffs -INFO : - Path2 File is new - file10.txt -INFO : - Path2 File is newer - file1.txt -INFO : - Path2 File is newer - file5.txt -INFO : - Path2 File is newer - file6.txt -INFO : - Path2 File was deleted - file3.txt -INFO : - Path2 File was deleted - file7.txt +INFO : - Path2 File is newer - file1.txt +INFO : - Path2 File was deleted - file3.txt +INFO : - Path2 File is newer - file5.txt +INFO : - Path2 File is newer - file6.txt +INFO : - Path2 File was deleted - file7.txt +INFO : - Path2 File is new - file10.txt INFO : Path2: 6 changes: 1 new, 3 newer, 0 older, 2 deleted INFO : Applying changes INFO : Checking potential conflicts... @@ -88,53 +88,53 @@ ERROR : file5.txt: md5 differ NOTICE: Local file system at {path2}: 1 differences found NOTICE: Local file system at {path2}: 1 errors while checking INFO : Finished checking the potential conflicts. 1 differences found -INFO : - Path1 Queue copy to Path2 - {path2/}file11.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file2.txt -INFO : - Path2 Queue delete - {path2/}file4.txt -NOTICE: - WARNING New or changed in both paths - file5.txt -NOTICE: - Path1 Renaming Path1 copy - {path1/}file5.txt..path1 +INFO : - Path1 Queue copy to Path2 - {path2/}file11.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file2.txt +INFO : - Path2 Queue delete - {path2/}file4.txt +NOTICE: - WARNING New or changed in both paths - file5.txt +NOTICE: - Path1 Renaming Path1 copy - {path1/}file5.txt..path1 NOTICE: file5.txt: Skipped move as --dry-run is set (size 39) -NOTICE: - Path1 Queue copy to Path2 - {path2/}file5.txt..path1 -NOTICE: - Path2 Renaming Path2 copy - {path2/}file5.txt..path2 +NOTICE: - Path1 Queue copy to Path2 - {path2/}file5.txt..path1 +NOTICE: - Path2 Renaming Path2 copy - {path2/}file5.txt..path2 NOTICE: file5.txt: Skipped move as --dry-run is set (size 39) -NOTICE: - Path2 Queue copy to Path1 - {path1/}file5.txt..path2 -INFO : - Path2 Queue copy to Path1 - {path1/}file6.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file7.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file10.txt -INFO : - Path1 Queue delete - {path1/}file3.txt -INFO : - Path2 Do queued copies to - Path1 +NOTICE: - Path2 Queue copy to Path1 - {path1/}file5.txt..path2 +INFO : - Path2 Queue copy to Path1 - {path1/}file6.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file7.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file10.txt +INFO : - Path1 Queue delete - {path1/}file3.txt +INFO : - Path2 Do queued copies to - Path1 NOTICE: file1.txt: Skipped copy as --dry-run is set (size 19) NOTICE: file10.txt: Skipped copy as --dry-run is set (size 19) NOTICE: file3.txt: Skipped delete as --dry-run is set (size 0) NOTICE: file6.txt: Skipped copy as --dry-run is set (size 19) -INFO : - Path1 Do queued copies to - Path2 +INFO : - Path1 Do queued copies to - Path2 NOTICE: file11.txt: Skipped copy as --dry-run is set (size 19) NOTICE: file2.txt: Skipped copy as --dry-run is set (size 13) NOTICE: file4.txt: Skipped delete as --dry-run is set (size 0) NOTICE: file7.txt: Skipped copy as --dry-run is set (size 19) INFO : Updating listings -INFO : Bisync successful -(32) : copy-listings dryrun +INFO : Bisync successful +(32) : copy-listings dryrun -(33) : test sync without dry-run -(34) : bisync +(33) : test sync without dry-run +(34) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs -INFO : - Path1 File is new - file11.txt -INFO : - Path1 File is newer - file2.txt -INFO : - Path1 File is newer - file5.txt -INFO : - Path1 File is newer - file7.txt -INFO : - Path1 File was deleted - file4.txt -INFO : - Path1 File was deleted - file6.txt +INFO : - Path1 File is newer - file2.txt +INFO : - Path1 File was deleted - file4.txt +INFO : - Path1 File is newer - file5.txt +INFO : - Path1 File was deleted - file6.txt +INFO : - Path1 File is newer - file7.txt +INFO : - Path1 File is new - file11.txt INFO : Path1: 6 changes: 1 new, 3 newer, 0 older, 2 deleted INFO : Path2 checking for diffs -INFO : - Path2 File is new - file10.txt -INFO : - Path2 File is newer - file1.txt -INFO : - Path2 File is newer - file5.txt -INFO : - Path2 File is newer - file6.txt -INFO : - Path2 File was deleted - file3.txt -INFO : - Path2 File was deleted - file7.txt +INFO : - Path2 File is newer - file1.txt +INFO : - Path2 File was deleted - file3.txt +INFO : - Path2 File is newer - file5.txt +INFO : - Path2 File is newer - file6.txt +INFO : - Path2 File was deleted - file7.txt +INFO : - Path2 File is new - file10.txt INFO : Path2: 6 changes: 1 new, 3 newer, 0 older, 2 deleted INFO : Applying changes INFO : Checking potential conflicts... @@ -142,21 +142,21 @@ ERROR : file5.txt: md5 differ NOTICE: Local file system at {path2}: 1 differences found NOTICE: Local file system at {path2}: 1 errors while checking INFO : Finished checking the potential conflicts. 1 differences found -INFO : - Path1 Queue copy to Path2 - {path2/}file11.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file2.txt -INFO : - Path2 Queue delete - {path2/}file4.txt -NOTICE: - WARNING New or changed in both paths - file5.txt -NOTICE: - Path1 Renaming Path1 copy - {path1/}file5.txt..path1 -NOTICE: - Path1 Queue copy to Path2 - {path2/}file5.txt..path1 -NOTICE: - Path2 Renaming Path2 copy - {path2/}file5.txt..path2 -NOTICE: - Path2 Queue copy to Path1 - {path1/}file5.txt..path2 -INFO : - Path2 Queue copy to Path1 - {path1/}file6.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file7.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file10.txt -INFO : - Path1 Queue delete - {path1/}file3.txt -INFO : - Path2 Do queued copies to - Path1 -INFO : - Path1 Do queued copies to - Path2 +INFO : - Path1 Queue copy to Path2 - {path2/}file11.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file2.txt +INFO : - Path2 Queue delete - {path2/}file4.txt +NOTICE: - WARNING New or changed in both paths - file5.txt +NOTICE: - Path1 Renaming Path1 copy - {path1/}file5.txt..path1 +NOTICE: - Path1 Queue copy to Path2 - {path2/}file5.txt..path1 +NOTICE: - Path2 Renaming Path2 copy - {path2/}file5.txt..path2 +NOTICE: - Path2 Queue copy to Path1 - {path1/}file5.txt..path2 +INFO : - Path2 Queue copy to Path1 - {path1/}file6.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file7.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file10.txt +INFO : - Path1 Queue delete - {path1/}file3.txt +INFO : - Path2 Do queued copies to - Path1 +INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_equal/golden/test.log b/cmd/bisync/testdata/test_equal/golden/test.log index 34cffc03748b1..37bd0d41a400f 100644 --- a/cmd/bisync/testdata/test_equal/golden/test.log +++ b/cmd/bisync/testdata/test_equal/golden/test.log @@ -1,35 +1,35 @@ -(01) : test equal +(01) : test equal -(02) : test initial bisync -(03) : bisync resync +(02) : test initial bisync +(03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(04) : test changed on both paths and NOT identical - file1 (file1R, file1L) -(05) : touch-glob 2001-01-02 {datadir/} file1R.txt -(06) : copy-as {datadir/}file1R.txt {path2/} file1.txt -(07) : touch-glob 2001-03-04 {datadir/} file1L.txt -(08) : copy-as {datadir/}file1L.txt {path1/} file1.txt +(04) : test changed on both paths and NOT identical - file1 (file1R, file1L) +(05) : touch-glob 2001-01-02 {datadir/} file1R.txt +(06) : copy-as {datadir/}file1R.txt {path2/} file1.txt +(07) : touch-glob 2001-03-04 {datadir/} file1L.txt +(08) : copy-as {datadir/}file1L.txt {path1/} file1.txt -(09) : test changed on both paths and identical - file2 -(10) : touch-glob 2001-01-02 {datadir/} file2.txt -(11) : copy-as {datadir/}file2.txt {path1/} file2.txt -(12) : copy-as {datadir/}file2.txt {path2/} file2.txt +(09) : test changed on both paths and identical - file2 +(10) : touch-glob 2001-01-02 {datadir/} file2.txt +(11) : copy-as {datadir/}file2.txt {path1/} file2.txt +(12) : copy-as {datadir/}file2.txt {path2/} file2.txt -(13) : test bisync run -(14) : bisync +(13) : test bisync run +(14) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs -INFO : - Path1 File is newer - file1.txt -INFO : - Path1 File is newer - file2.txt +INFO : - Path1 File is newer - file1.txt +INFO : - Path1 File is newer - file2.txt INFO : Path1: 2 changes: 0 new, 2 newer, 0 older, 0 deleted INFO : Path2 checking for diffs -INFO : - Path2 File is newer - file1.txt -INFO : - Path2 File is newer - file2.txt +INFO : - Path2 File is newer - file1.txt +INFO : - Path2 File is newer - file2.txt INFO : Path2: 2 changes: 0 new, 2 newer, 0 older, 0 deleted INFO : Applying changes INFO : Checking potential conflicts... @@ -38,15 +38,15 @@ NOTICE: Local file system at {path2}: 1 differences found NOTICE: Local file system at {path2}: 1 errors while checking NOTICE: Local file system at {path2}: 1 matching files INFO : Finished checking the potential conflicts. 1 differences found -NOTICE: - WARNING New or changed in both paths - file1.txt -NOTICE: - Path1 Renaming Path1 copy - {path1/}file1.txt..path1 -NOTICE: - Path1 Queue copy to Path2 - {path2/}file1.txt..path1 -NOTICE: - Path2 Renaming Path2 copy - {path2/}file1.txt..path2 -NOTICE: - Path2 Queue copy to Path1 - {path1/}file1.txt..path2 -NOTICE: - WARNING New or changed in both paths - file2.txt +NOTICE: - WARNING New or changed in both paths - file1.txt +NOTICE: - Path1 Renaming Path1 copy - {path1/}file1.txt..path1 +NOTICE: - Path1 Queue copy to Path2 - {path2/}file1.txt..path1 +NOTICE: - Path2 Renaming Path2 copy - {path2/}file1.txt..path2 +NOTICE: - Path2 Queue copy to Path1 - {path1/}file1.txt..path2 +NOTICE: - WARNING New or changed in both paths - file2.txt INFO : Files are equal! Skipping: file2.txt -INFO : - Path2 Do queued copies to - Path1 -INFO : - Path1 Do queued copies to - Path2 +INFO : - Path2 Do queued copies to - Path1 +INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_extended_char_paths/golden/test.log b/cmd/bisync/testdata/test_extended_char_paths/golden/test.log index 25010065b6dd2..772d88ad62620 100644 --- a/cmd/bisync/testdata/test_extended_char_paths/golden/test.log +++ b/cmd/bisync/testdata/test_extended_char_paths/golden/test.log @@ -1,72 +1,72 @@ -(01) : test extended-char-paths +(01) : test extended-char-paths -(02) : test resync subdirs with extended chars -(03) : bisync subdir=測試_Русский_{spc}_{spc}_ě_áñ resync +(02) : test resync subdirs with extended chars +(03) : bisync subdir=測試_Русский_{spc}_{spc}_ě_áñ resync INFO : Synching Path1 "{path1/}測試_Русский_ _ _ě_áñ/" with Path2 "{path2/}測試_Русский_ _ _ě_áñ/" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful -(04) : copy-listings resync +INFO : Bisync successful +(04) : copy-listings resync -(05) : test place new files with extended chars on each side +(05) : test place new files with extended chars on each side -(06) : touch-glob 2001-01-02 {datadir/} file1.txt -(07) : copy-as {datadir/}file1.txt {path1/}測試_Русский_{spc}_{spc}_ě_áñ 測試_file1p1 -(08) : copy-as {datadir/}file1.txt {path2/}測試_Русский_{spc}_{spc}_ě_áñ 測試_file1p2 +(06) : touch-glob 2001-01-02 {datadir/} file1.txt +(07) : copy-as {datadir/}file1.txt {path1/}測試_Русский_{spc}_{spc}_ě_áñ 測試_file1p1 +(08) : copy-as {datadir/}file1.txt {path2/}測試_Русский_{spc}_{spc}_ě_áñ 測試_file1p2 -(09) : test normal sync of subdirs with extended chars -(10) : bisync subdir=測試_Русский_{spc}_{spc}_ě_áñ +(09) : test normal sync of subdirs with extended chars +(10) : bisync subdir=測試_Русский_{spc}_{spc}_ě_áñ INFO : Synching Path1 "{path1/}測試_Русский_ _ _ě_áñ/" with Path2 "{path2/}測試_Русский_ _ _ě_áñ/" INFO : Path1 checking for diffs -INFO : - Path1 File is new - 測試_file1p1 +INFO : - Path1 File is new - 測試_file1p1 INFO : Path1: 1 changes: 1 new, 0 newer, 0 older, 0 deleted INFO : Path2 checking for diffs -INFO : - Path2 File is new - 測試_file1p2 +INFO : - Path2 File is new - 測試_file1p2 INFO : Path2: 1 changes: 1 new, 0 newer, 0 older, 0 deleted INFO : Applying changes -INFO : - Path1 Queue copy to Path2 - {path2/}測試_Русский_ _ _ě_áñ/測試_file1p1 -INFO : - Path2 Queue copy to Path1 - {path1/}測試_Русский_ _ _ě_áñ/測試_file1p2 -INFO : - Path2 Do queued copies to - Path1 -INFO : - Path1 Do queued copies to - Path2 +INFO : - Path1 Queue copy to Path2 - {path2/}測試_Русский_ _ _ě_áñ/測試_file1p1 +INFO : - Path2 Queue copy to Path1 - {path1/}測試_Русский_ _ _ě_áñ/測試_file1p2 +INFO : - Path2 Do queued copies to - Path1 +INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}測試_Русский_ _ _ě_áñ/" vs Path2 "{path2/}測試_Русский_ _ _ě_áñ/" -INFO : Bisync successful -(11) : move-listings normal-sync +INFO : Bisync successful +(11) : move-listings normal-sync -(12) : test check-filename with extended chars. check should fail. -(13) : bisync resync +(12) : test check-filename with extended chars. check should fail. +(13) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful -(14) : delete-file {path1/}測試_Русский_{spc}_{spc}_ě_áñ/測試_check{spc}file -(15) : bisync check-access check-filename=測試_check{spc}file +INFO : Bisync successful +(14) : delete-file {path1/}測試_Русский_{spc}_{spc}_ě_áñ/測試_check{spc}file +(15) : bisync check-access check-filename=測試_check{spc}file INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs -INFO : - Path1 File was deleted - 測試_Русский_ _ _ě_áñ/測試_check file +INFO : - Path1 File was deleted - 測試_Русский_ _ _ě_áñ/測試_check file INFO : Path1: 1 changes: 0 new, 0 newer, 0 older, 1 deleted INFO : Path2 checking for diffs INFO : Checking access health ERROR : Access test failed: Path1 count 1, Path2 count 2 - 測試_check file -ERROR : - Access test failed: Path2 file not found in Path1 - 測試_Русский_ _ _ě_áñ/測試_check file -ERROR : Bisync critical error: check file check failed -ERROR : Bisync aborted. Must run --resync to recover. +ERROR : -  Access test failed: Path2 file not found in Path1 - 測試_Русский_ _ _ě_áñ/測試_check file +ERROR : Bisync critical error: check file check failed +ERROR : Bisync aborted. Must run --resync to recover. Bisync error: bisync aborted -(16) : copy-listings check-access-fail +(16) : copy-listings check-access-fail -(17) : test check-filename with extended chars. check should pass. -(18) : bisync resync +(17) : test check-filename with extended chars. check should pass. +(18) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : - Path2 Resync will copy to Path1 - 測試_Русский_ _ _ě_áñ/測試_check file -INFO : - Path2 Resync is doing queued copies to - Path1 +INFO : - Path2 Resync will copy to Path1 - 測試_Русский_ _ _ě_áñ/測試_check file +INFO : - Path2 Resync is doing queued copies to - Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful -(19) : bisync check-access check-filename=測試_check{spc}file +INFO : Bisync successful +(19) : bisync check-access check-filename=測試_check{spc}file INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs INFO : Path2 checking for diffs @@ -75,21 +75,21 @@ INFO : Found 2 matching "測試_check file" files on both paths INFO : No changes found INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful -(20) : move-listings check-access-pass +INFO : Bisync successful +(20) : move-listings check-access-pass -(21) : test filters-file path with extended chars - masks /fileZ.txt -(22) : copy-file {datadir/}測試_filtersfile.txt {workdir/} -(23) : bisync filters-file={workdir/}測試_filtersfile.txt resync +(21) : test filters-file path with extended chars - masks /fileZ.txt +(22) : copy-file {datadir/}測試_filtersfile.txt {workdir/} +(23) : bisync filters-file={workdir/}測試_filtersfile.txt resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}測試_filtersfile.txt INFO : Storing filters file hash to {workdir/}測試_filtersfile.txt.md5 INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful -(24) : copy-as {datadir/}file1.txt {path1/} fileZ.txt -(25) : bisync filters-file={workdir/}測試_filtersfile.txt +INFO : Bisync successful +(24) : copy-as {datadir/}file1.txt {path1/} fileZ.txt +(25) : bisync filters-file={workdir/}測試_filtersfile.txt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}測試_filtersfile.txt INFO : Path1 checking for diffs @@ -97,4 +97,4 @@ INFO : Path2 checking for diffs INFO : No changes found INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_extended_filenames/golden/test.log b/cmd/bisync/testdata/test_extended_filenames/golden/test.log index d1db495d9731f..039ed9e82db48 100644 --- a/cmd/bisync/testdata/test_extended_filenames/golden/test.log +++ b/cmd/bisync/testdata/test_extended_filenames/golden/test.log @@ -1,62 +1,62 @@ -(01) : test extended-filenames +(01) : test extended-filenames -(02) : test initial bisync -(03) : bisync resync +(02) : test initial bisync +(03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(04) : test place a newer files on both paths +(04) : test place a newer files on both paths -(05) : touch-glob 2001-01-02 {datadir/} file1.txt -(06) : touch-glob 2001-01-02 {datadir/} file2.txt -(07) : copy-as {datadir/}file1.txt {path2/} New_top_level_mañana_funcionará.txt -(08) : copy-as {datadir/}file1.txt {path2/} file_enconde_mañana_funcionará.txt -(09) : copy-as {datadir/}file1.txt {path1/} filename_contains_ࢺ_p1m.txt -(10) : copy-as {datadir/}file1.txt {path2/} Русский.txt -(11) : copy-as {datadir/}file1.txt {path1/} file1_with{spc}white{spc}space.txt -(12) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ test.txt -(13) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ mañana_funcionará.txt -(14) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ file_with_測試_.txt -(15) : copy-as {datadir/}file1.txt {path2/}subdir_with_ࢺ_ filename_contains_ࢺ_p2s.txt -(16) : copy-as {datadir/}file1.txt {path2/}subdir{spc}with{eol}white{spc}space.txt file2{spc}with{eol}white{spc}space.txt -(17) : copy-as {datadir/}file1.txt {path2/}subdir_rawchars_{chr:19}_{chr:81}_{chr:fe} file3_{chr:19}_{chr:81}_{chr:fe} +(05) : touch-glob 2001-01-02 {datadir/} file1.txt +(06) : touch-glob 2001-01-02 {datadir/} file2.txt +(07) : copy-as {datadir/}file1.txt {path2/} New_top_level_mañana_funcionará.txt +(08) : copy-as {datadir/}file1.txt {path2/} file_enconde_mañana_funcionará.txt +(09) : copy-as {datadir/}file1.txt {path1/} filename_contains_ࢺ_p1m.txt +(10) : copy-as {datadir/}file1.txt {path2/} Русский.txt +(11) : copy-as {datadir/}file1.txt {path1/} file1_with{spc}white{spc}space.txt +(12) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ test.txt +(13) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ mañana_funcionará.txt +(14) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ file_with_測試_.txt +(15) : copy-as {datadir/}file1.txt {path2/}subdir_with_ࢺ_ filename_contains_ࢺ_p2s.txt +(16) : copy-as {datadir/}file1.txt {path2/}subdir{spc}with{eol}white{spc}space.txt file2{spc}with{eol}white{spc}space.txt +(17) : copy-as {datadir/}file1.txt {path2/}subdir_rawchars_{chr:19}_{chr:81}_{chr:fe} file3_{chr:19}_{chr:81}_{chr:fe} -(18) : test place a new file on both paths -(19) : copy-as {datadir/}file2.txt {path2/}subdir_with_ࢺ_ filechangedbothpaths_ࢺ_.txt -(20) : touch-glob 2001-01-03 {datadir/} file1.txt -(21) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ filechangedbothpaths_ࢺ_.txt +(18) : test place a new file on both paths +(19) : copy-as {datadir/}file2.txt {path2/}subdir_with_ࢺ_ filechangedbothpaths_ࢺ_.txt +(20) : touch-glob 2001-01-03 {datadir/} file1.txt +(21) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ filechangedbothpaths_ࢺ_.txt -(22) : test delete files on both paths -(23) : delete-file {path2/}filename_contains_ࢺ_.txt -(24) : delete-file {path2/}subdir_with_ࢺ_/filename_contains_ě_.txt -(25) : delete-file {path1/}Русский.txt +(22) : test delete files on both paths +(23) : delete-file {path2/}filename_contains_ࢺ_.txt +(24) : delete-file {path2/}subdir_with_ࢺ_/filename_contains_ě_.txt +(25) : delete-file {path1/}Русский.txt -(26) : test bisync run -(27) : bisync +(26) : test bisync run +(27) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs -INFO : - Path1 File is new - file1_with white space.txt -INFO : - Path1 File is new - filename_contains_ࢺ_p1m.txt -INFO : - Path1 File is new - subdir_with_ࢺ_/file_with_測試_.txt -INFO : - Path1 File is new - subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt -INFO : - Path1 File is new - subdir_with_ࢺ_/mañana_funcionará.txt -INFO : - Path1 File is new - subdir_with_ࢺ_/test.txt -INFO : - Path1 File was deleted - Русский.txt +INFO : - Path1 File was deleted - Русский.txt +INFO : - Path1 File is new - file1_with white space.txt +INFO : - Path1 File is new - filename_contains_ࢺ_p1m.txt +INFO : - Path1 File is new - subdir_with_ࢺ_/file_with_測試_.txt +INFO : - Path1 File is new - subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt +INFO : - Path1 File is new - subdir_with_ࢺ_/mañana_funcionará.txt +INFO : - Path1 File is new - subdir_with_ࢺ_/test.txt INFO : Path1: 7 changes: 6 new, 0 newer, 0 older, 1 deleted INFO : Path2 checking for diffs -INFO : - Path2 File is new - "subdir_rawchars_␙_\x81_\xfe/file3_␙_\x81_\xfe" -INFO : - Path2 File is new - New_top_level_mañana_funcionará.txt -INFO : - Path2 File is new - subdir with␊white space.txt/file2 with␊white space.txt -INFO : - Path2 File is new - subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt -INFO : - Path2 File is new - subdir_with_ࢺ_/filename_contains_ࢺ_p2s.txt -INFO : - Path2 File is newer - file_enconde_mañana_funcionará.txt -INFO : - Path2 File is newer - Русский.txt -INFO : - Path2 File was deleted - filename_contains_ࢺ_.txt -INFO : - Path2 File was deleted - subdir_with_ࢺ_/filename_contains_ě_.txt +INFO : - Path2 File is newer - file_enconde_mañana_funcionará.txt +INFO : - Path2 File was deleted - filename_contains_ࢺ_.txt +INFO : - Path2 File was deleted - subdir_with_ࢺ_/filename_contains_ě_.txt +INFO : - Path2 File is newer - Русский.txt +INFO : - Path2 File is new - New_top_level_mañana_funcionará.txt +INFO : - Path2 File is new - subdir with␊white space.txt/file2 with␊white space.txt +INFO : - Path2 File is new - "subdir_rawchars_␙_\x81_\xfe/file3_␙_\x81_\xfe" +INFO : - Path2 File is new - subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt +INFO : - Path2 File is new - subdir_with_ࢺ_/filename_contains_ࢺ_p2s.txt INFO : Path2: 9 changes: 5 new, 2 newer, 0 older, 2 deleted INFO : Applying changes INFO : Checking potential conflicts... @@ -64,26 +64,26 @@ ERROR : subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt: sizes differ NOTICE: Local file system at {path2}: 1 differences found NOTICE: Local file system at {path2}: 1 errors while checking INFO : Finished checking the potential conflicts. 1 differences found -INFO : - Path1 Queue copy to Path2 - {path2/}file1_with white space.txt -INFO : - Path1 Queue copy to Path2 - {path2/}filename_contains_ࢺ_p1m.txt -INFO : - Path1 Queue copy to Path2 - {path2/}subdir_with_ࢺ_/file_with_測試_.txt -NOTICE: - WARNING New or changed in both paths - subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt -NOTICE: - Path1 Renaming Path1 copy - {path1/}subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path1 -NOTICE: - Path1 Queue copy to Path2 - {path2/}subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path1 -NOTICE: - Path2 Renaming Path2 copy - {path2/}subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path2 -NOTICE: - Path2 Queue copy to Path1 - {path1/}subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path2 -INFO : - Path1 Queue copy to Path2 - {path2/}subdir_with_ࢺ_/mañana_funcionará.txt -INFO : - Path1 Queue copy to Path2 - {path2/}subdir_with_ࢺ_/test.txt -INFO : - Path2 Queue copy to Path1 - {path1/}Русский.txt -INFO : - Path2 Queue copy to Path1 - {path1/}New_top_level_mañana_funcionará.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file_enconde_mañana_funcionará.txt -INFO : - Path1 Queue delete - {path1/}filename_contains_ࢺ_.txt -INFO : - Path2 Queue copy to Path1 - {path1/}subdir with␊white space.txt/file2 with␊white space.txt -INFO : - Path2 Queue copy to Path1 - "{path1/}subdir_rawchars_␙_\x81_\xfe/file3_␙_\x81_\xfe" -INFO : - Path1 Queue delete - {path1/}subdir_with_ࢺ_/filename_contains_ě_.txt -INFO : - Path2 Queue copy to Path1 - {path1/}subdir_with_ࢺ_/filename_contains_ࢺ_p2s.txt -INFO : - Path2 Do queued copies to - Path1 -INFO : - Path1 Do queued copies to - Path2 +INFO : - Path1 Queue copy to Path2 - {path2/}file1_with white space.txt +INFO : - Path1 Queue copy to Path2 - {path2/}filename_contains_ࢺ_p1m.txt +INFO : - Path1 Queue copy to Path2 - {path2/}subdir_with_ࢺ_/file_with_測試_.txt +NOTICE: - WARNING New or changed in both paths - subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt +NOTICE: - Path1 Renaming Path1 copy - {path1/}subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path1 +NOTICE: - Path1 Queue copy to Path2 - {path2/}subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path1 +NOTICE: - Path2 Renaming Path2 copy - {path2/}subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path2 +NOTICE: - Path2 Queue copy to Path1 - {path1/}subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt..path2 +INFO : - Path1 Queue copy to Path2 - {path2/}subdir_with_ࢺ_/mañana_funcionará.txt +INFO : - Path1 Queue copy to Path2 - {path2/}subdir_with_ࢺ_/test.txt +INFO : - Path2 Queue copy to Path1 - {path1/}Русский.txt +INFO : - Path2 Queue copy to Path1 - {path1/}New_top_level_mañana_funcionará.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file_enconde_mañana_funcionará.txt +INFO : - Path1 Queue delete - {path1/}filename_contains_ࢺ_.txt +INFO : - Path2 Queue copy to Path1 - {path1/}subdir with␊white space.txt/file2 with␊white space.txt +INFO : - Path2 Queue copy to Path1 - "{path1/}subdir_rawchars_␙_\x81_\xfe/file3_␙_\x81_\xfe" +INFO : - Path1 Queue delete - {path1/}subdir_with_ࢺ_/filename_contains_ě_.txt +INFO : - Path2 Queue copy to Path1 - {path1/}subdir_with_ࢺ_/filename_contains_ࢺ_p2s.txt +INFO : - Path2 Do queued copies to - Path1 +INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_filters/golden/test.log b/cmd/bisync/testdata/test_filters/golden/test.log index fa4b62d31e627..dfea30ddf1a8e 100644 --- a/cmd/bisync/testdata/test_filters/golden/test.log +++ b/cmd/bisync/testdata/test_filters/golden/test.log @@ -1,36 +1,36 @@ -(01) : test filters +(01) : test filters -(02) : copy-file {datadir/}filtersfile.flt {workdir/} +(02) : copy-file {datadir/}filtersfile.flt {workdir/} -(03) : test resync to force building of the filters md5 hash -(04) : bisync filters-file={workdir/}filtersfile.flt resync +(03) : test resync to force building of the filters md5 hash +(04) : bisync filters-file={workdir/}filtersfile.flt resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}filtersfile.flt INFO : Storing filters file hash to {workdir/}filtersfile.flt.md5 INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(05) : copy-listings resync +(05) : copy-listings resync -(06) : test place new files on the remote -(07) : touch-glob 2001-01-02 {datadir/} fileZ.txt -(08) : copy-as {datadir/}fileZ.txt {path2/} fileZ.txt -(09) : copy-as {datadir/}fileZ.txt {path1/}subdir fileZ.txt +(06) : test place new files on the remote +(07) : touch-glob 2001-01-02 {datadir/} fileZ.txt +(08) : copy-as {datadir/}fileZ.txt {path2/} fileZ.txt +(09) : copy-as {datadir/}fileZ.txt {path1/}subdir fileZ.txt -(10) : test bisync with filters-file. path2-side fileZ.txt will be filtered. -(11) : bisync filters-file={workdir/}filtersfile.flt +(10) : test bisync with filters-file. path2-side fileZ.txt will be filtered. +(11) : bisync filters-file={workdir/}filtersfile.flt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}filtersfile.flt INFO : Path1 checking for diffs -INFO : - Path1 File is new - subdir/fileZ.txt +INFO : - Path1 File is new - subdir/fileZ.txt INFO : Path1: 1 changes: 1 new, 0 newer, 0 older, 0 deleted INFO : Path2 checking for diffs INFO : Applying changes -INFO : - Path1 Queue copy to Path2 - {path2/}subdir/fileZ.txt -INFO : - Path1 Do queued copies to - Path2 +INFO : - Path1 Queue copy to Path2 - {path2/}subdir/fileZ.txt +INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log b/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log index ab50cf9cfc446..937d4fbee23c0 100644 --- a/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log +++ b/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log @@ -1,44 +1,44 @@ -(01) : test filtersfile-checks +(01) : test filtersfile-checks -(02) : test initial bisync -(03) : bisync resync +(02) : test initial bisync +(03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(04) : test 1. inject filters file in workdir. -(05) : copy-file {datadir/}filtersfile.txt {workdir/} +(04) : test 1. inject filters file in workdir. +(05) : copy-file {datadir/}filtersfile.txt {workdir/} -(06) : test 2. run with filters-file but without md5. should abort. -(07) : bisync filters-file={workdir/}filtersfile.txt +(06) : test 2. run with filters-file but without md5. should abort. +(07) : bisync filters-file={workdir/}filtersfile.txt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}filtersfile.txt -ERROR : Bisync critical error: filters file md5 hash not found (must run --resync): {workdir/}filtersfile.txt -ERROR : Bisync aborted. Must run --resync to recover. +ERROR : Bisync critical error: filters file md5 hash not found (must run --resync): {workdir/}filtersfile.txt +ERROR : Bisync aborted. Must run --resync to recover. Bisync error: bisync aborted -(08) : test 3. run without filters-file. should be blocked due to prior abort. -(09) : bisync +(08) : test 3. run without filters-file. should be blocked due to prior abort. +(09) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" -ERROR : Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run -ERROR : Bisync aborted. Must run --resync to recover. +ERROR : Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run +ERROR : Bisync aborted. Must run --resync to recover. Bisync error: bisync aborted -(10) : test 4. run with filters-file and resync. -(11) : bisync filters-file={workdir/}filtersfile.txt resync +(10) : test 4. run with filters-file and resync. +(11) : bisync filters-file={workdir/}filtersfile.txt resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}filtersfile.txt INFO : Storing filters file hash to {workdir/}filtersfile.txt.md5 INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(12) : test 5. run with filters-file alone. should run. -(13) : bisync filters-file={workdir/}filtersfile.txt +(12) : test 5. run with filters-file alone. should run. +(13) : bisync filters-file={workdir/}filtersfile.txt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}filtersfile.txt INFO : Path1 checking for diffs @@ -46,33 +46,33 @@ INFO : Path2 checking for diffs INFO : No changes found INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful -(14) : test 6. push changed filters-file to workdir. -(15) : copy-as {datadir/}filtersfile2.txt {workdir/} filtersfile.txt +(14) : test 6. push changed filters-file to workdir. +(15) : copy-as {datadir/}filtersfile2.txt {workdir/} filtersfile.txt -(16) : test 7. run with filters-file alone. should abort. -(17) : bisync filters-file={workdir/}filtersfile.txt +(16) : test 7. run with filters-file alone. should abort. +(17) : bisync filters-file={workdir/}filtersfile.txt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}filtersfile.txt -ERROR : Bisync critical error: filters file has changed (must run --resync): {workdir/}filtersfile.txt -ERROR : Bisync aborted. Must run --resync to recover. +ERROR : Bisync critical error: filters file has changed (must run --resync): {workdir/}filtersfile.txt +ERROR : Bisync aborted. Must run --resync to recover. Bisync error: bisync aborted -(18) : test 8. run with filters-file and resync and dry-run. should do the dry-run but still cause next non-resync run to abort. -(19) : bisync filters-file={workdir/}filtersfile.txt resync dry-run +(18) : test 8. run with filters-file and resync and dry-run. should do the dry-run but still cause next non-resync run to abort. +(19) : bisync filters-file={workdir/}filtersfile.txt resync dry-run INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}filtersfile.txt INFO : Skipped storing filters file hash to {workdir/}filtersfile.txt.md5 as --dry-run is set INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(20) : test 9. run with filters-file alone. should abort. -(21) : bisync filters-file={workdir/}filtersfile.txt +(20) : test 9. run with filters-file alone. should abort. +(21) : bisync filters-file={workdir/}filtersfile.txt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}filtersfile.txt -ERROR : Bisync critical error: filters file has changed (must run --resync): {workdir/}filtersfile.txt -ERROR : Bisync aborted. Must run --resync to recover. +ERROR : Bisync critical error: filters file has changed (must run --resync): {workdir/}filtersfile.txt +ERROR : Bisync aborted. Must run --resync to recover. Bisync error: bisync aborted diff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/golden/test.log b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/test.log index 993e3655989f5..6e383f78454c2 100644 --- a/cmd/bisync/testdata/test_ignorelistingchecksum/golden/test.log +++ b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/test.log @@ -1,39 +1,39 @@ -(01) : test basic +(01) : test basic -(02) : test initial bisync -(03) : bisync resync +(02) : test initial bisync +(03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful -(04) : bisync resync ignore-listing-checksum +INFO : Bisync successful +(04) : bisync resync ignore-listing-checksum INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(05) : test place newer files on both paths +(05) : test place newer files on both paths -(06) : touch-copy 2001-01-02 {datadir/}file1.txt {path2/} -(07) : copy-as {datadir/}file1.txt {path1/}subdir file20.txt +(06) : touch-copy 2001-01-02 {datadir/}file1.txt {path2/} +(07) : copy-as {datadir/}file1.txt {path1/}subdir file20.txt -(08) : test bisync run -(09) : bisync ignore-listing-checksum +(08) : test bisync run +(09) : bisync ignore-listing-checksum INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs -INFO : - Path1 File is newer - subdir/file20.txt +INFO : - Path1 File is newer - subdir/file20.txt INFO : Path1: 1 changes: 0 new, 1 newer, 0 older, 0 deleted INFO : Path2 checking for diffs -INFO : - Path2 File is newer - file1.txt +INFO : - Path2 File is newer - file1.txt INFO : Path2: 1 changes: 0 new, 1 newer, 0 older, 0 deleted INFO : Applying changes -INFO : - Path1 Queue copy to Path2 - {path2/}subdir/file20.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt -INFO : - Path2 Do queued copies to - Path1 -INFO : - Path1 Do queued copies to - Path2 +INFO : - Path1 Queue copy to Path2 - {path2/}subdir/file20.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt +INFO : - Path2 Do queued copies to - Path1 +INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_max_delete_path1/golden/test.log b/cmd/bisync/testdata/test_max_delete_path1/golden/test.log index 7d83e9150961d..c6d802a2f4fea 100644 --- a/cmd/bisync/testdata/test_max_delete_path1/golden/test.log +++ b/cmd/bisync/testdata/test_max_delete_path1/golden/test.log @@ -1,55 +1,55 @@ -(01) : test max-delete-path1 +(01) : test max-delete-path1 -(02) : test initial bisync -(03) : bisync resync +(02) : test initial bisync +(03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(04) : test delete >50% of local files -(05) : delete-file {path1/}file1.txt -(06) : delete-file {path1/}file2.txt -(07) : delete-file {path1/}file3.txt -(08) : delete-file {path1/}file4.txt -(09) : delete-file {path1/}file5.txt +(04) : test delete >50% of local files +(05) : delete-file {path1/}file1.txt +(06) : delete-file {path1/}file2.txt +(07) : delete-file {path1/}file3.txt +(08) : delete-file {path1/}file4.txt +(09) : delete-file {path1/}file5.txt -(10) : test sync should fail due to too many local deletes -(11) : bisync +(10) : test sync should fail due to too many local deletes +(11) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs -INFO : - Path1 File was deleted - file1.txt -INFO : - Path1 File was deleted - file2.txt -INFO : - Path1 File was deleted - file3.txt -INFO : - Path1 File was deleted - file4.txt -INFO : - Path1 File was deleted - file5.txt +INFO : - Path1 File was deleted - file1.txt +INFO : - Path1 File was deleted - file2.txt +INFO : - Path1 File was deleted - file3.txt +INFO : - Path1 File was deleted - file4.txt +INFO : - Path1 File was deleted - file5.txt INFO : Path1: 5 changes: 0 new, 0 newer, 0 older, 5 deleted INFO : Path2 checking for diffs ERROR : Safety abort: too many deletes (>50%, 5 of 9) on Path1 "{path1/}". Run with --force if desired. -NOTICE: Bisync aborted. Please try again. +NOTICE: Bisync aborted. Please try again. Bisync error: too many deletes -(12) : copy-listings initial-fail +(12) : copy-listings initial-fail -(13) : test change max-delete limit to 60%. sync should run. -(14) : bisync max-delete=60 +(13) : test change max-delete limit to 60%. sync should run. +(14) : bisync max-delete=60 INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs -INFO : - Path1 File was deleted - file1.txt -INFO : - Path1 File was deleted - file2.txt -INFO : - Path1 File was deleted - file3.txt -INFO : - Path1 File was deleted - file4.txt -INFO : - Path1 File was deleted - file5.txt +INFO : - Path1 File was deleted - file1.txt +INFO : - Path1 File was deleted - file2.txt +INFO : - Path1 File was deleted - file3.txt +INFO : - Path1 File was deleted - file4.txt +INFO : - Path1 File was deleted - file5.txt INFO : Path1: 5 changes: 0 new, 0 newer, 0 older, 5 deleted INFO : Path2 checking for diffs INFO : Applying changes -INFO : - Path2 Queue delete - {path2/}file1.txt -INFO : - Path2 Queue delete - {path2/}file2.txt -INFO : - Path2 Queue delete - {path2/}file3.txt -INFO : - Path2 Queue delete - {path2/}file4.txt -INFO : - Path2 Queue delete - {path2/}file5.txt -INFO : - Path1 Do queued copies to - Path2 +INFO : - Path2 Queue delete - {path2/}file1.txt +INFO : - Path2 Queue delete - {path2/}file2.txt +INFO : - Path2 Queue delete - {path2/}file3.txt +INFO : - Path2 Queue delete - {path2/}file4.txt +INFO : - Path2 Queue delete - {path2/}file5.txt +INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_max_delete_path2_force/golden/test.log b/cmd/bisync/testdata/test_max_delete_path2_force/golden/test.log index 23cc350c4a3fa..ca5a0f6364bba 100644 --- a/cmd/bisync/testdata/test_max_delete_path2_force/golden/test.log +++ b/cmd/bisync/testdata/test_max_delete_path2_force/golden/test.log @@ -1,55 +1,55 @@ -(01) : test max-delete-path2-force +(01) : test max-delete-path2-force -(02) : test initial bisync -(03) : bisync resync +(02) : test initial bisync +(03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(04) : test delete >50% of remote files -(05) : delete-file {path2/}file1.txt -(06) : delete-file {path2/}file2.txt -(07) : delete-file {path2/}file3.txt -(08) : delete-file {path2/}file4.txt -(09) : delete-file {path2/}file5.txt +(04) : test delete >50% of remote files +(05) : delete-file {path2/}file1.txt +(06) : delete-file {path2/}file2.txt +(07) : delete-file {path2/}file3.txt +(08) : delete-file {path2/}file4.txt +(09) : delete-file {path2/}file5.txt -(10) : test sync should fail due to too many path2 deletes -(11) : bisync +(10) : test sync should fail due to too many path2 deletes +(11) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs INFO : Path2 checking for diffs -INFO : - Path2 File was deleted - file1.txt -INFO : - Path2 File was deleted - file2.txt -INFO : - Path2 File was deleted - file3.txt -INFO : - Path2 File was deleted - file4.txt -INFO : - Path2 File was deleted - file5.txt +INFO : - Path2 File was deleted - file1.txt +INFO : - Path2 File was deleted - file2.txt +INFO : - Path2 File was deleted - file3.txt +INFO : - Path2 File was deleted - file4.txt +INFO : - Path2 File was deleted - file5.txt INFO : Path2: 5 changes: 0 new, 0 newer, 0 older, 5 deleted ERROR : Safety abort: too many deletes (>50%, 5 of 9) on Path2 "{path2/}". Run with --force if desired. -NOTICE: Bisync aborted. Please try again. +NOTICE: Bisync aborted. Please try again. Bisync error: too many deletes -(12) : copy-listings initial-fail +(12) : copy-listings initial-fail -(13) : test apply force option. sync should run. -(14) : bisync force +(13) : test apply force option. sync should run. +(14) : bisync force INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs INFO : Path2 checking for diffs -INFO : - Path2 File was deleted - file1.txt -INFO : - Path2 File was deleted - file2.txt -INFO : - Path2 File was deleted - file3.txt -INFO : - Path2 File was deleted - file4.txt -INFO : - Path2 File was deleted - file5.txt +INFO : - Path2 File was deleted - file1.txt +INFO : - Path2 File was deleted - file2.txt +INFO : - Path2 File was deleted - file3.txt +INFO : - Path2 File was deleted - file4.txt +INFO : - Path2 File was deleted - file5.txt INFO : Path2: 5 changes: 0 new, 0 newer, 0 older, 5 deleted INFO : Applying changes -INFO : - Path1 Queue delete - {path1/}file1.txt -INFO : - Path1 Queue delete - {path1/}file2.txt -INFO : - Path1 Queue delete - {path1/}file3.txt -INFO : - Path1 Queue delete - {path1/}file4.txt -INFO : - Path1 Queue delete - {path1/}file5.txt -INFO : - Path2 Do queued copies to - Path1 +INFO : - Path1 Queue delete - {path1/}file1.txt +INFO : - Path1 Queue delete - {path1/}file2.txt +INFO : - Path1 Queue delete - {path1/}file3.txt +INFO : - Path1 Queue delete - {path1/}file4.txt +INFO : - Path1 Queue delete - {path1/}file5.txt +INFO : - Path2 Do queued copies to - Path1 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_rclone_args/golden/test.log b/cmd/bisync/testdata/test_rclone_args/golden/test.log index 644cab613cd99..f0caf729ab679 100644 --- a/cmd/bisync/testdata/test_rclone_args/golden/test.log +++ b/cmd/bisync/testdata/test_rclone_args/golden/test.log @@ -1,43 +1,43 @@ -(01) : test rclone-args +(01) : test rclone-args -(02) : test initial bisync -(03) : bisync resync +(02) : test initial bisync +(03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(04) : test place newer files on both paths +(04) : test place newer files on both paths -(05) : touch-glob 2001-01-02 {datadir/} * +(05) : touch-glob 2001-01-02 {datadir/} * -(06) : copy-file {datadir/}file1.txt {path1/} -(07) : copy-file {datadir/}file2.txt {path2/} +(06) : copy-file {datadir/}file1.txt {path1/} +(07) : copy-file {datadir/}file2.txt {path2/} -(08) : copy-file {datadir/}file20.txt {path1/}subdir -(09) : copy-file {datadir/}file21.txt {path2/}subdir +(08) : copy-file {datadir/}file20.txt {path1/}subdir +(09) : copy-file {datadir/}file21.txt {path2/}subdir -(10) : test run bisync with custom options -(11) : bisync size-only +(10) : test run bisync with custom options +(11) : bisync size-only INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs -INFO : - Path1 File is newer - file1.txt -INFO : - Path1 File is newer - subdir/file20.txt +INFO : - Path1 File is newer - file1.txt +INFO : - Path1 File is newer - subdir/file20.txt INFO : Path1: 2 changes: 0 new, 2 newer, 0 older, 0 deleted INFO : Path2 checking for diffs -INFO : - Path2 File is newer - file2.txt -INFO : - Path2 File is newer - subdir/file21.txt +INFO : - Path2 File is newer - file2.txt +INFO : - Path2 File is newer - subdir/file21.txt INFO : Path2: 2 changes: 0 new, 2 newer, 0 older, 0 deleted INFO : Applying changes -INFO : - Path1 Queue copy to Path2 - {path2/}file1.txt -INFO : - Path1 Queue copy to Path2 - {path2/}subdir/file20.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file2.txt -INFO : - Path2 Queue copy to Path1 - {path1/}subdir/file21.txt -INFO : - Path2 Do queued copies to - Path1 -INFO : - Path1 Do queued copies to - Path2 +INFO : - Path1 Queue copy to Path2 - {path2/}file1.txt +INFO : - Path1 Queue copy to Path2 - {path2/}subdir/file20.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file2.txt +INFO : - Path2 Queue copy to Path1 - {path1/}subdir/file21.txt +INFO : - Path2 Do queued copies to - Path1 +INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_resync/golden/test.log b/cmd/bisync/testdata/test_resync/golden/test.log index 1c60be8a8e58a..39f35b09e00f2 100644 --- a/cmd/bisync/testdata/test_resync/golden/test.log +++ b/cmd/bisync/testdata/test_resync/golden/test.log @@ -1,91 +1,91 @@ -(01) : test resync +(01) : test resync -(02) : test 1. resync with empty path1, resulting in copying all content from path2. -(03) : purge-children {path1/} -(04) : bisync resync +(02) : test 1. resync with empty path1, resulting in copying all content from path2. +(03) : purge-children {path1/} +(04) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : - Path2 Resync will copy to Path1 - RCLONE_TEST -INFO : - Path2 Resync will copy to Path1 - file1.txt -INFO : - Path2 Resync will copy to Path1 - file2.txt -INFO : - Path2 Resync will copy to Path1 - file3.txt -INFO : - Path2 Resync will copy to Path1 - file4.txt -INFO : - Path2 Resync will copy to Path1 - file5.txt -INFO : - Path2 Resync will copy to Path1 - file6.txt -INFO : - Path2 Resync will copy to Path1 - file7.txt -INFO : - Path2 Resync is doing queued copies to - Path1 +INFO : - Path2 Resync will copy to Path1 - RCLONE_TEST +INFO : - Path2 Resync will copy to Path1 - file1.txt +INFO : - Path2 Resync will copy to Path1 - file2.txt +INFO : - Path2 Resync will copy to Path1 - file3.txt +INFO : - Path2 Resync will copy to Path1 - file4.txt +INFO : - Path2 Resync will copy to Path1 - file5.txt +INFO : - Path2 Resync will copy to Path1 - file6.txt +INFO : - Path2 Resync will copy to Path1 - file7.txt +INFO : - Path2 Resync is doing queued copies to - Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful -(05) : move-listings empty-path1 +INFO : Bisync successful +(05) : move-listings empty-path1 -(06) : test 2. resync with empty path2, resulting in synching all content to path2. -(07) : purge-children {path2/} -(08) : bisync resync +(06) : test 2. resync with empty path2, resulting in synching all content to path2. +(07) : purge-children {path2/} +(08) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful -(09) : move-listings empty-path2 +INFO : Bisync successful +(09) : move-listings empty-path2 -(10) : test 3. exercise all of the various file difference scenarios during a resync. -(11) : touch-glob 2002-02-02 {datadir/} fileA.txt -(12) : touch-glob 1999-09-09 {datadir/} fileB.txt +(10) : test 3. exercise all of the various file difference scenarios during a resync. +(11) : touch-glob 2002-02-02 {datadir/} fileA.txt +(12) : touch-glob 1999-09-09 {datadir/} fileB.txt -(13) : test = file - path1 - path2 - expected action - who wins -(14) : test - file1.txt - exists - missing - sync path1 > path2 - path1 -(15) : delete-file {path2/}file1.txt +(13) : test = file - path1 - path2 - expected action - who wins +(14) : test - file1.txt - exists - missing - sync path1 > path2 - path1 +(15) : delete-file {path2/}file1.txt -(16) : test - file2.txt - missing - exists - copy path2 > path1 - path2 -(17) : delete-file {path1/}file2.txt +(16) : test - file2.txt - missing - exists - copy path2 > path1 - path2 +(17) : delete-file {path1/}file2.txt -(18) : test - file3.txt - exists - newer date - sync path1 > path2 - path1 -(19) : copy-as {datadir/}fileA.txt {path2/} file3.txt +(18) : test - file3.txt - exists - newer date - sync path1 > path2 - path1 +(19) : copy-as {datadir/}fileA.txt {path2/} file3.txt -(20) : test - file4.txt - missing - newer date - copy path2 > path1 - path2 -(21) : delete-file {path1/}file4.txt -(22) : copy-as {datadir/}fileA.txt {path2/} file4.txt +(20) : test - file4.txt - missing - newer date - copy path2 > path1 - path2 +(21) : delete-file {path1/}file4.txt +(22) : copy-as {datadir/}fileA.txt {path2/} file4.txt -(23) : test - file5.txt - exists - older date - sync path1 > path2 - path1 -(24) : copy-as {datadir/}fileB.txt {path2/} file5.txt +(23) : test - file5.txt - exists - older date - sync path1 > path2 - path1 +(24) : copy-as {datadir/}fileB.txt {path2/} file5.txt -(25) : test - file6.txt - older date - newer date - sync path1 > path2 - path1 -(26) : copy-as {datadir/}fileB.txt {path1/} file6.txt -(27) : copy-as {datadir/}fileA.txt {path2/} file6.txt +(25) : test - file6.txt - older date - newer date - sync path1 > path2 - path1 +(26) : copy-as {datadir/}fileB.txt {path1/} file6.txt +(27) : copy-as {datadir/}fileA.txt {path2/} file6.txt -(28) : test - file7.txt - exists - exists (same) - none - same +(28) : test - file7.txt - exists - exists (same) - none - same -(29) : test run bisync with resync -(30) : bisync resync +(29) : test run bisync with resync +(30) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : - Path2 Resync will copy to Path1 - file2.txt -INFO : - Path2 Resync will copy to Path1 - file4.txt -INFO : - Path2 Resync is doing queued copies to - Path1 +INFO : - Path2 Resync will copy to Path1 - file2.txt +INFO : - Path2 Resync will copy to Path1 - file4.txt +INFO : - Path2 Resync is doing queued copies to - Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful -(31) : copy-listings mixed-diffs +INFO : Bisync successful +(31) : copy-listings mixed-diffs -(32) : test run normal bisync -(33) : bisync +(32) : test run normal bisync +(33) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : No changes found INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful -(34) : test 4. confirm critical error on normal sync of empty path. -(35) : purge-children {path2/} -(36) : bisync +(34) : test 4. confirm critical error on normal sync of empty path. +(35) : purge-children {path2/} +(36) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs INFO : Path2 checking for diffs ERROR : Empty current Path2 listing. Cannot sync to an empty directory: {workdir/}{session}.path2.lst-new -ERROR : Bisync critical error: empty current Path2 listing: {workdir/}{session}.path2.lst-new -ERROR : Bisync aborted. Must run --resync to recover. +ERROR : Bisync critical error: empty current Path2 listing: {workdir/}{session}.path2.lst-new +ERROR : Bisync aborted. Must run --resync to recover. Bisync error: bisync aborted diff --git a/cmd/bisync/testdata/test_rmdirs/golden/test.log b/cmd/bisync/testdata/test_rmdirs/golden/test.log index b770c2482b42b..eca4e4fba7096 100644 --- a/cmd/bisync/testdata/test_rmdirs/golden/test.log +++ b/cmd/bisync/testdata/test_rmdirs/golden/test.log @@ -1,39 +1,39 @@ -(01) : test rmdirs +(01) : test rmdirs -(02) : test initial bisync -(03) : bisync resync +(02) : test initial bisync +(03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(04) : test 1. delete path1 subdir file -(05) : delete-file {path1/}subdir/file20.txt +(04) : test 1. delete path1 subdir file +(05) : delete-file {path1/}subdir/file20.txt -(06) : test 2. run bisync without remove-empty-dirs -(07) : bisync +(06) : test 2. run bisync without remove-empty-dirs +(07) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs -INFO : - Path1 File was deleted - subdir/file20.txt +INFO : - Path1 File was deleted - subdir/file20.txt INFO : Path1: 1 changes: 0 new, 0 newer, 0 older, 1 deleted INFO : Path2 checking for diffs INFO : Applying changes -INFO : - Path2 Queue delete - {path2/}subdir/file20.txt -INFO : - Path1 Do queued copies to - Path2 +INFO : - Path2 Queue delete - {path2/}subdir/file20.txt +INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful -(08) : test 3. confirm the subdir still exists on both paths -(09) : list-dirs {path1/} +(08) : test 3. confirm the subdir still exists on both paths +(09) : list-dirs {path1/} subdir/ -(10) : list-dirs {path2/} +(10) : list-dirs {path2/} subdir/ -(11) : test 4. run bisync with remove-empty-dirs -(12) : bisync remove-empty-dirs +(11) : test 4. run bisync with remove-empty-dirs +(12) : bisync remove-empty-dirs INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs INFO : Path2 checking for diffs @@ -43,8 +43,8 @@ INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" INFO : Removing empty directories INFO : subdir: Removing directory INFO : subdir: Removing directory -INFO : Bisync successful +INFO : Bisync successful -(13) : test 5. confirm the subdir has been removed on both paths -(14) : list-dirs {path1/} -(15) : list-dirs {path2/} +(13) : test 5. confirm the subdir has been removed on both paths +(14) : list-dirs {path1/} +(15) : list-dirs {path2/} diff --git a/cmd/bisync/testdata/test_volatile/golden/test.log b/cmd/bisync/testdata/test_volatile/golden/test.log index 6964fa9e297a9..b65c8a26e1b31 100644 --- a/cmd/bisync/testdata/test_volatile/golden/test.log +++ b/cmd/bisync/testdata/test_volatile/golden/test.log @@ -1,28 +1,28 @@ -(01) : test volatile +(01) : test volatile -(02) : test initial bisync -(03) : bisync resync +(02) : test initial bisync +(03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Resynching Path1 to Path2 INFO : Resync updating listings -INFO : Bisync successful +INFO : Bisync successful -(04) : test changed on both paths - file5 (file5R, file5L) -(05) : touch-glob 2001-01-02 {datadir/} file5R.txt -(06) : copy-as {datadir/}file5R.txt {path2/} file5.txt -(07) : touch-glob 2001-03-04 {datadir/} file5L.txt -(08) : copy-as {datadir/}file5L.txt {path1/} file5.txt +(04) : test changed on both paths - file5 (file5R, file5L) +(05) : touch-glob 2001-01-02 {datadir/} file5R.txt +(06) : copy-as {datadir/}file5R.txt {path2/} file5.txt +(07) : touch-glob 2001-03-04 {datadir/} file5L.txt +(08) : copy-as {datadir/}file5L.txt {path1/} file5.txt -(09) : test bisync with 50 files created during - should ignore new files -(10) : test-func -(11) : bisync +(09) : test bisync with 50 files created during - should ignore new files +(10) : test-func +(11) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs -INFO : - Path1 File is newer - file5.txt +INFO : - Path1 File is newer - file5.txt INFO : Path1: 1 changes: 0 new, 1 newer, 0 older, 0 deleted INFO : Path2 checking for diffs -INFO : - Path2 File is newer - file5.txt +INFO : - Path2 File is newer - file5.txt INFO : Path2: 1 changes: 0 new, 1 newer, 0 older, 0 deleted INFO : Applying changes INFO : Checking potential conflicts... @@ -30,124 +30,124 @@ ERROR : file5.txt: md5 differ NOTICE: Local file system at {path2}: 1 differences found NOTICE: Local file system at {path2}: 1 errors while checking INFO : Finished checking the potential conflicts. 1 differences found -NOTICE: - WARNING New or changed in both paths - file5.txt -NOTICE: - Path1 Renaming Path1 copy - {path1/}file5.txt..path1 -NOTICE: - Path1 Queue copy to Path2 - {path2/}file5.txt..path1 -NOTICE: - Path2 Renaming Path2 copy - {path2/}file5.txt..path2 -NOTICE: - Path2 Queue copy to Path1 - {path1/}file5.txt..path2 -INFO : - Path2 Do queued copies to - Path1 -INFO : - Path1 Do queued copies to - Path2 +NOTICE: - WARNING New or changed in both paths - file5.txt +NOTICE: - Path1 Renaming Path1 copy - {path1/}file5.txt..path1 +NOTICE: - Path1 Queue copy to Path2 - {path2/}file5.txt..path1 +NOTICE: - Path2 Renaming Path2 copy - {path2/}file5.txt..path2 +NOTICE: - Path2 Queue copy to Path1 - {path1/}file5.txt..path2 +INFO : - Path2 Do queued copies to - Path1 +INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful -(12) : test changed on both paths - file5 (file5R, file5L) -(13) : touch-glob 2001-01-02 {datadir/} file5R.txt -(14) : copy-as {datadir/}file5R.txt {path2/} file5.txt -(15) : touch-glob 2001-03-04 {datadir/} file5L.txt -(16) : copy-as {datadir/}file5L.txt {path1/} file5.txt +(12) : test changed on both paths - file5 (file5R, file5L) +(13) : touch-glob 2001-01-02 {datadir/} file5R.txt +(14) : copy-as {datadir/}file5R.txt {path2/} file5.txt +(15) : touch-glob 2001-03-04 {datadir/} file5L.txt +(16) : copy-as {datadir/}file5L.txt {path1/} file5.txt -(17) : test next bisync - should now notice new files -(18) : test-func -(19) : bisync +(17) : test next bisync - should now notice new files +(18) : test-func +(19) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs -INFO : - Path1 File is new - file100.txt -INFO : - Path1 File is new - file5.txt -INFO : - Path1 File is new - file51.txt -INFO : - Path1 File is new - file52.txt -INFO : - Path1 File is new - file53.txt -INFO : - Path1 File is new - file54.txt -INFO : - Path1 File is new - file55.txt -INFO : - Path1 File is new - file56.txt -INFO : - Path1 File is new - file57.txt -INFO : - Path1 File is new - file58.txt -INFO : - Path1 File is new - file59.txt -INFO : - Path1 File is new - file60.txt -INFO : - Path1 File is new - file61.txt -INFO : - Path1 File is new - file62.txt -INFO : - Path1 File is new - file63.txt -INFO : - Path1 File is new - file64.txt -INFO : - Path1 File is new - file65.txt -INFO : - Path1 File is new - file66.txt -INFO : - Path1 File is new - file67.txt -INFO : - Path1 File is new - file68.txt -INFO : - Path1 File is new - file69.txt -INFO : - Path1 File is new - file70.txt -INFO : - Path1 File is new - file71.txt -INFO : - Path1 File is new - file72.txt -INFO : - Path1 File is new - file73.txt -INFO : - Path1 File is new - file74.txt -INFO : - Path1 File is new - file75.txt -INFO : - Path1 File is new - file76.txt -INFO : - Path1 File is new - file77.txt -INFO : - Path1 File is new - file78.txt -INFO : - Path1 File is new - file79.txt -INFO : - Path1 File is new - file80.txt -INFO : - Path1 File is new - file81.txt -INFO : - Path1 File is new - file82.txt -INFO : - Path1 File is new - file83.txt -INFO : - Path1 File is new - file84.txt -INFO : - Path1 File is new - file85.txt -INFO : - Path1 File is new - file86.txt -INFO : - Path1 File is new - file87.txt -INFO : - Path1 File is new - file88.txt -INFO : - Path1 File is new - file89.txt -INFO : - Path1 File is new - file90.txt -INFO : - Path1 File is new - file91.txt -INFO : - Path1 File is new - file92.txt -INFO : - Path1 File is new - file93.txt -INFO : - Path1 File is new - file94.txt -INFO : - Path1 File is new - file95.txt -INFO : - Path1 File is new - file96.txt -INFO : - Path1 File is new - file97.txt -INFO : - Path1 File is new - file98.txt -INFO : - Path1 File is new - file99.txt +INFO : - Path1 File is new - file100.txt +INFO : - Path1 File is new - file5.txt +INFO : - Path1 File is new - file51.txt +INFO : - Path1 File is new - file52.txt +INFO : - Path1 File is new - file53.txt +INFO : - Path1 File is new - file54.txt +INFO : - Path1 File is new - file55.txt +INFO : - Path1 File is new - file56.txt +INFO : - Path1 File is new - file57.txt +INFO : - Path1 File is new - file58.txt +INFO : - Path1 File is new - file59.txt +INFO : - Path1 File is new - file60.txt +INFO : - Path1 File is new - file61.txt +INFO : - Path1 File is new - file62.txt +INFO : - Path1 File is new - file63.txt +INFO : - Path1 File is new - file64.txt +INFO : - Path1 File is new - file65.txt +INFO : - Path1 File is new - file66.txt +INFO : - Path1 File is new - file67.txt +INFO : - Path1 File is new - file68.txt +INFO : - Path1 File is new - file69.txt +INFO : - Path1 File is new - file70.txt +INFO : - Path1 File is new - file71.txt +INFO : - Path1 File is new - file72.txt +INFO : - Path1 File is new - file73.txt +INFO : - Path1 File is new - file74.txt +INFO : - Path1 File is new - file75.txt +INFO : - Path1 File is new - file76.txt +INFO : - Path1 File is new - file77.txt +INFO : - Path1 File is new - file78.txt +INFO : - Path1 File is new - file79.txt +INFO : - Path1 File is new - file80.txt +INFO : - Path1 File is new - file81.txt +INFO : - Path1 File is new - file82.txt +INFO : - Path1 File is new - file83.txt +INFO : - Path1 File is new - file84.txt +INFO : - Path1 File is new - file85.txt +INFO : - Path1 File is new - file86.txt +INFO : - Path1 File is new - file87.txt +INFO : - Path1 File is new - file88.txt +INFO : - Path1 File is new - file89.txt +INFO : - Path1 File is new - file90.txt +INFO : - Path1 File is new - file91.txt +INFO : - Path1 File is new - file92.txt +INFO : - Path1 File is new - file93.txt +INFO : - Path1 File is new - file94.txt +INFO : - Path1 File is new - file95.txt +INFO : - Path1 File is new - file96.txt +INFO : - Path1 File is new - file97.txt +INFO : - Path1 File is new - file98.txt +INFO : - Path1 File is new - file99.txt INFO : Path1: 51 changes: 51 new, 0 newer, 0 older, 0 deleted INFO : Path2 checking for diffs -INFO : - Path2 File is new - file0.txt -INFO : - Path2 File is new - file10.txt -INFO : - Path2 File is new - file11.txt -INFO : - Path2 File is new - file12.txt -INFO : - Path2 File is new - file13.txt -INFO : - Path2 File is new - file14.txt -INFO : - Path2 File is new - file15.txt -INFO : - Path2 File is new - file16.txt -INFO : - Path2 File is new - file17.txt -INFO : - Path2 File is new - file18.txt -INFO : - Path2 File is new - file19.txt -INFO : - Path2 File is new - file20.txt -INFO : - Path2 File is new - file21.txt -INFO : - Path2 File is new - file22.txt -INFO : - Path2 File is new - file23.txt -INFO : - Path2 File is new - file24.txt -INFO : - Path2 File is new - file25.txt -INFO : - Path2 File is new - file26.txt -INFO : - Path2 File is new - file27.txt -INFO : - Path2 File is new - file28.txt -INFO : - Path2 File is new - file29.txt -INFO : - Path2 File is new - file30.txt -INFO : - Path2 File is new - file31.txt -INFO : - Path2 File is new - file32.txt -INFO : - Path2 File is new - file33.txt -INFO : - Path2 File is new - file34.txt -INFO : - Path2 File is new - file35.txt -INFO : - Path2 File is new - file36.txt -INFO : - Path2 File is new - file37.txt -INFO : - Path2 File is new - file38.txt -INFO : - Path2 File is new - file39.txt -INFO : - Path2 File is new - file40.txt -INFO : - Path2 File is new - file41.txt -INFO : - Path2 File is new - file42.txt -INFO : - Path2 File is new - file43.txt -INFO : - Path2 File is new - file44.txt -INFO : - Path2 File is new - file45.txt -INFO : - Path2 File is new - file46.txt -INFO : - Path2 File is new - file47.txt -INFO : - Path2 File is new - file48.txt -INFO : - Path2 File is new - file49.txt -INFO : - Path2 File is new - file5.txt -INFO : - Path2 File is new - file9.txt +INFO : - Path2 File is new - file0.txt +INFO : - Path2 File is new - file10.txt +INFO : - Path2 File is new - file11.txt +INFO : - Path2 File is new - file12.txt +INFO : - Path2 File is new - file13.txt +INFO : - Path2 File is new - file14.txt +INFO : - Path2 File is new - file15.txt +INFO : - Path2 File is new - file16.txt +INFO : - Path2 File is new - file17.txt +INFO : - Path2 File is new - file18.txt +INFO : - Path2 File is new - file19.txt +INFO : - Path2 File is new - file20.txt +INFO : - Path2 File is new - file21.txt +INFO : - Path2 File is new - file22.txt +INFO : - Path2 File is new - file23.txt +INFO : - Path2 File is new - file24.txt +INFO : - Path2 File is new - file25.txt +INFO : - Path2 File is new - file26.txt +INFO : - Path2 File is new - file27.txt +INFO : - Path2 File is new - file28.txt +INFO : - Path2 File is new - file29.txt +INFO : - Path2 File is new - file30.txt +INFO : - Path2 File is new - file31.txt +INFO : - Path2 File is new - file32.txt +INFO : - Path2 File is new - file33.txt +INFO : - Path2 File is new - file34.txt +INFO : - Path2 File is new - file35.txt +INFO : - Path2 File is new - file36.txt +INFO : - Path2 File is new - file37.txt +INFO : - Path2 File is new - file38.txt +INFO : - Path2 File is new - file39.txt +INFO : - Path2 File is new - file40.txt +INFO : - Path2 File is new - file41.txt +INFO : - Path2 File is new - file42.txt +INFO : - Path2 File is new - file43.txt +INFO : - Path2 File is new - file44.txt +INFO : - Path2 File is new - file45.txt +INFO : - Path2 File is new - file46.txt +INFO : - Path2 File is new - file47.txt +INFO : - Path2 File is new - file48.txt +INFO : - Path2 File is new - file49.txt +INFO : - Path2 File is new - file5.txt +INFO : - Path2 File is new - file9.txt INFO : Path2: 43 changes: 43 new, 0 newer, 0 older, 0 deleted INFO : Applying changes INFO : Checking potential conflicts... @@ -155,124 +155,124 @@ ERROR : file5.txt: md5 differ NOTICE: Local file system at {path2}: 1 differences found NOTICE: Local file system at {path2}: 1 errors while checking INFO : Finished checking the potential conflicts. 1 differences found -INFO : - Path1 Queue copy to Path2 - {path2/}file100.txt -NOTICE: - WARNING New or changed in both paths - file5.txt -NOTICE: - Path1 Renaming Path1 copy - {path1/}file5.txt..path1 -NOTICE: - Path1 Queue copy to Path2 - {path2/}file5.txt..path1 -NOTICE: - Path2 Renaming Path2 copy - {path2/}file5.txt..path2 -NOTICE: - Path2 Queue copy to Path1 - {path1/}file5.txt..path2 -INFO : - Path1 Queue copy to Path2 - {path2/}file51.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file52.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file53.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file54.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file55.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file56.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file57.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file58.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file59.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file60.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file61.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file62.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file63.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file64.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file65.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file66.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file67.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file68.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file69.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file70.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file71.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file72.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file73.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file74.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file75.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file76.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file77.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file78.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file79.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file80.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file81.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file82.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file83.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file84.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file85.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file86.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file87.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file88.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file89.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file90.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file91.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file92.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file93.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file94.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file95.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file96.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file97.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file98.txt -INFO : - Path1 Queue copy to Path2 - {path2/}file99.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file0.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file10.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file11.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file12.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file13.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file14.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file15.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file16.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file17.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file18.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file19.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file20.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file21.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file22.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file23.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file24.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file25.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file26.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file27.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file28.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file29.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file30.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file31.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file32.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file33.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file34.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file35.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file36.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file37.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file38.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file39.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file40.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file41.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file42.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file43.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file44.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file45.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file46.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file47.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file48.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file49.txt -INFO : - Path2 Queue copy to Path1 - {path1/}file9.txt -INFO : - Path2 Do queued copies to - Path1 -INFO : - Path1 Do queued copies to - Path2 +INFO : - Path1 Queue copy to Path2 - {path2/}file100.txt +NOTICE: - WARNING New or changed in both paths - file5.txt +NOTICE: - Path1 Renaming Path1 copy - {path1/}file5.txt..path1 +NOTICE: - Path1 Queue copy to Path2 - {path2/}file5.txt..path1 +NOTICE: - Path2 Renaming Path2 copy - {path2/}file5.txt..path2 +NOTICE: - Path2 Queue copy to Path1 - {path1/}file5.txt..path2 +INFO : - Path1 Queue copy to Path2 - {path2/}file51.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file52.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file53.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file54.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file55.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file56.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file57.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file58.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file59.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file60.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file61.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file62.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file63.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file64.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file65.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file66.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file67.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file68.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file69.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file70.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file71.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file72.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file73.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file74.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file75.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file76.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file77.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file78.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file79.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file80.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file81.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file82.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file83.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file84.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file85.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file86.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file87.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file88.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file89.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file90.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file91.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file92.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file93.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file94.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file95.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file96.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file97.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file98.txt +INFO : - Path1 Queue copy to Path2 - {path2/}file99.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file0.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file10.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file11.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file12.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file13.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file14.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file15.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file16.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file17.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file18.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file19.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file20.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file21.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file22.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file23.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file24.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file25.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file26.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file27.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file28.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file29.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file30.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file31.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file32.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file33.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file34.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file35.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file36.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file37.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file38.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file39.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file40.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file41.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file42.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file43.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file44.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file45.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file46.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file47.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file48.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file49.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file9.txt +INFO : - Path2 Do queued copies to - Path1 +INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful -(20) : test changed on both paths - file5 (file5R, file5L) -(21) : touch-glob 2001-01-02 {datadir/} file5R.txt -(22) : copy-as {datadir/}file5R.txt {path2/} file5.txt -(23) : touch-glob 2001-03-04 {datadir/} file5L.txt -(24) : copy-as {datadir/}file5L.txt {path1/} file5.txt +(20) : test changed on both paths - file5 (file5R, file5L) +(21) : touch-glob 2001-01-02 {datadir/} file5R.txt +(22) : copy-as {datadir/}file5R.txt {path2/} file5.txt +(23) : touch-glob 2001-03-04 {datadir/} file5L.txt +(24) : copy-as {datadir/}file5L.txt {path1/} file5.txt -(25) : test next bisync - should be no changes except dummy -(26) : test-func -(27) : bisync +(25) : test next bisync - should be no changes except dummy +(26) : test-func +(27) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Path1 checking for diffs -INFO : - Path1 File is new - file5.txt +INFO : - Path1 File is new - file5.txt INFO : Path1: 1 changes: 1 new, 0 newer, 0 older, 0 deleted INFO : Path2 checking for diffs -INFO : - Path2 File is new - file5.txt +INFO : - Path2 File is new - file5.txt INFO : Path2: 1 changes: 1 new, 0 newer, 0 older, 0 deleted INFO : Applying changes INFO : Checking potential conflicts... @@ -280,13 +280,13 @@ ERROR : file5.txt: md5 differ NOTICE: Local file system at {path2}: 1 differences found NOTICE: Local file system at {path2}: 1 errors while checking INFO : Finished checking the potential conflicts. 1 differences found -NOTICE: - WARNING New or changed in both paths - file5.txt -NOTICE: - Path1 Renaming Path1 copy - {path1/}file5.txt..path1 -NOTICE: - Path1 Queue copy to Path2 - {path2/}file5.txt..path1 -NOTICE: - Path2 Renaming Path2 copy - {path2/}file5.txt..path2 -NOTICE: - Path2 Queue copy to Path1 - {path1/}file5.txt..path2 -INFO : - Path2 Do queued copies to - Path1 -INFO : - Path1 Do queued copies to - Path2 +NOTICE: - WARNING New or changed in both paths - file5.txt +NOTICE: - Path1 Renaming Path1 copy - {path1/}file5.txt..path1 +NOTICE: - Path1 Queue copy to Path2 - {path2/}file5.txt..path1 +NOTICE: - Path2 Renaming Path2 copy - {path2/}file5.txt..path2 +NOTICE: - Path2 Queue copy to Path1 - {path1/}file5.txt..path2 +INFO : - Path2 Do queued copies to - Path1 +INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" -INFO : Bisync successful +INFO : Bisync successful From fd955110918527167246681531653a13436e95c4 Mon Sep 17 00:00:00 2001 From: nielash Date: Sat, 7 Oct 2023 06:33:43 -0400 Subject: [PATCH 113/130] bisync: generate listings concurrently with march -- fixes #7332 Before this change, bisync needed to build a full listing for Path1, then a full listing for Path2, then compare them -- and each of those tasks needed to finish before the next one could start. In addition to being slow and inefficient, it also caused real problems if a file changed between the time bisync checked it on Path1 and the time it checked the corresponding file on Path2. This change solves these problems by listing both paths concurrently, using the same March infrastructure that check and sync use to traverse two directories in lock-step, optimized by Go's robust concurrency support. Listings should now be much faster, and any given path is now checked nearly-instantaneously on both sides, minimizing room for error. Further discussion: https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=4.%20Listings%20should%20alternate%20between%20paths%20to%20minimize%20errors --- cmd/bisync/bilib/files.go | 2 +- cmd/bisync/deltas.go | 12 +- cmd/bisync/listing.go | 120 ++++------- cmd/bisync/march.go | 189 ++++++++++++++++++ cmd/bisync/operations.go | 50 +++-- .../testdata/test_all_changed/golden/test.log | 3 + .../testdata/test_basic/golden/test.log | 1 + .../testdata/test_changes/golden/test.log | 1 + .../test_check_access/golden/test.log | 5 + .../test_check_access_filters/golden/test.log | 8 +- .../test_check_filename/golden/test.log | 3 + .../testdata/test_check_sync/golden/test.log | 2 + .../test_createemptysrcdirs/golden/test.log | 5 + .../testdata/test_dry_run/golden/test.log | 2 + .../testdata/test_equal/golden/test.log | 1 + .../test_extended_char_paths/golden/test.log | 4 + .../test_extended_filenames/golden/test.log | 1 + .../testdata/test_filters/golden/test.log | 1 + .../test_filtersfile_checks/golden/test.log | 1 + .../golden/test.log | 1 + .../test_max_delete_path1/golden/test.log | 2 + .../golden/test.log | 2 + .../testdata/test_rclone_args/golden/test.log | 1 + .../testdata/test_resync/golden/test.log | 2 + .../testdata/test_rmdirs/golden/test.log | 2 + .../testdata/test_volatile/golden/test.log | 3 + docs/content/bisync.md | 3 + 27 files changed, 319 insertions(+), 108 deletions(-) create mode 100644 cmd/bisync/march.go diff --git a/cmd/bisync/bilib/files.go b/cmd/bisync/bilib/files.go index e2c7bb1e8d035..0d0134635fb08 100644 --- a/cmd/bisync/bilib/files.go +++ b/cmd/bisync/bilib/files.go @@ -39,7 +39,7 @@ func FileExists(file string) bool { return !os.IsNotExist(err) } -// CopyFileIfExists is like CopyFile but does to fail if source does not exist +// CopyFileIfExists is like CopyFile but does not fail if source does not exist func CopyFileIfExists(srcFile, dstFile string) error { if !FileExists(srcFile) { return nil diff --git a/cmd/bisync/deltas.go b/cmd/bisync/deltas.go index 87e274d0e24d4..3167dfb006b27 100644 --- a/cmd/bisync/deltas.go +++ b/cmd/bisync/deltas.go @@ -137,8 +137,9 @@ func (b *bisyncRun) checkconflicts(ctxCheck context.Context, filterCheck *filter } // findDeltas -func (b *bisyncRun) findDeltas(fctx context.Context, f fs.Fs, oldListing, newListing, msg string) (ds *deltaSet, err error) { - var old, now *fileList +func (b *bisyncRun) findDeltas(fctx context.Context, f fs.Fs, oldListing string, now *fileList, msg string) (ds *deltaSet, err error) { + var old *fileList + newListing := oldListing + "-new" old, err = b.loadListing(oldListing) if err != nil { @@ -150,7 +151,6 @@ func (b *bisyncRun) findDeltas(fctx context.Context, f fs.Fs, oldListing, newLis return } - now, err = b.makeListing(fctx, f, newListing) if err == nil { err = b.checkListing(now, newListing, "current "+msg) } @@ -235,6 +235,8 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change renamed2 := bilib.Names{} renameSkipped := bilib.Names{} deletedonboth := bilib.Names{} + skippedDirs1 := newFileList() + skippedDirs2 := newFileList() ctxMove := b.opt.setDryRun(ctx) @@ -304,6 +306,8 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change //if files are identical, leave them alone instead of renaming if dirs1.has(file) && dirs2.has(file) { fs.Debugf(nil, "This is a directory, not a file. Skipping equality check and will not rename: %s", file) + ls1.getPut(file, skippedDirs1) + ls2.getPut(file, skippedDirs2) } else { equal := matches.Has(file) if equal { @@ -424,6 +428,8 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change queues.renamed2 = renamed2 queues.renameSkipped = renameSkipped queues.deletedonboth = deletedonboth + queues.skippedDirs1 = skippedDirs1 + queues.skippedDirs2 = skippedDirs2 return } diff --git a/cmd/bisync/listing.go b/cmd/bisync/listing.go index 25953a4ec9a16..7875036fa4a80 100644 --- a/cmd/bisync/listing.go +++ b/cmd/bisync/listing.go @@ -12,7 +12,6 @@ import ( "sort" "strconv" "strings" - "sync" "time" "github.com/rclone/rclone/cmd/bisync/bilib" @@ -20,7 +19,6 @@ import ( "github.com/rclone/rclone/fs/filter" "github.com/rclone/rclone/fs/hash" "github.com/rclone/rclone/fs/operations" - "github.com/rclone/rclone/fs/walk" "golang.org/x/exp/slices" ) @@ -70,6 +68,9 @@ func newFileList() *fileList { } func (ls *fileList) empty() bool { + if ls == nil { + return true + } return len(ls.list) == 0 } @@ -99,6 +100,12 @@ func (ls *fileList) getPut(file string, dest *fileList) { dest.put(file, f.size, f.time, f.hash, f.id, f.flags) } +func (ls *fileList) getPutAll(dest *fileList) { + for file, f := range ls.info { + dest.put(file, f.size, f.time, f.hash, f.id, f.flags) + } +} + func (ls *fileList) remove(file string) { if ls.has(file) { ls.list = slices.Delete(ls.list, slices.Index(ls.list, file), slices.Index(ls.list, file)+1) @@ -292,13 +299,16 @@ func (b *bisyncRun) loadListing(listing string) (*fileList, error) { return ls, nil } +// saveOldListings saves the most recent successful listing, in case we need to rollback on error func (b *bisyncRun) saveOldListings() { - if err := bilib.CopyFileIfExists(b.listing1, b.listing1+"-old"); err != nil { - fs.Debugf(b.listing1, "error saving old listing1: %v", err) - } - if err := bilib.CopyFileIfExists(b.listing2, b.listing2+"-old"); err != nil { - fs.Debugf(b.listing1, "error saving old listing2: %v", err) - } + b.handleErr(b.listing1, "error saving old Path1 listing", bilib.CopyFileIfExists(b.listing1, b.listing1+"-old"), true, true) + b.handleErr(b.listing2, "error saving old Path2 listing", bilib.CopyFileIfExists(b.listing2, b.listing2+"-old"), true, true) +} + +// replaceCurrentListings saves both ".lst-new" listings as ".lst" +func (b *bisyncRun) replaceCurrentListings() { + b.handleErr(b.newListing1, "error replacing Path1 listing", bilib.CopyFileIfExists(b.newListing1, b.listing1), true, true) + b.handleErr(b.newListing2, "error replacing Path2 listing", bilib.CopyFileIfExists(b.newListing2, b.listing2), true, true) } func parseHash(str string) (string, string, error) { @@ -314,71 +324,6 @@ func parseHash(str string) (string, string, error) { return "", "", fmt.Errorf("invalid hash %q", str) } -// makeListing will produce listing from directory tree and write it to a file -func (b *bisyncRun) makeListing(ctx context.Context, f fs.Fs, listing string) (ls *fileList, err error) { - ci := fs.GetConfig(ctx) - depth := ci.MaxDepth - hashType := hash.None - if !b.opt.IgnoreListingChecksum { - // Currently bisync just honors --ignore-listing-checksum - // (note that this is different from --ignore-checksum) - // TODO add full support for checksums and related flags - hashType = f.Hashes().GetOne() - } - ls = newFileList() - ls.hash = hashType - var lock sync.Mutex - listType := walk.ListObjects - if b.opt.CreateEmptySrcDirs { - listType = walk.ListAll - } - err = walk.ListR(ctx, f, "", false, depth, listType, func(entries fs.DirEntries) error { - var firstErr error - entries.ForObject(func(o fs.Object) { - //tr := accounting.Stats(ctx).NewCheckingTransfer(o) // TODO - var ( - hashVal string - hashErr error - ) - if hashType != hash.None { - hashVal, hashErr = o.Hash(ctx, hashType) - if firstErr == nil { - firstErr = hashErr - } - } - time := o.ModTime(ctx).In(TZ) - id := "" // TODO - flags := "-" // "-" for a file and "d" for a directory - lock.Lock() - ls.put(o.Remote(), o.Size(), time, hashVal, id, flags) - lock.Unlock() - //tr.Done(ctx, nil) // TODO - }) - if b.opt.CreateEmptySrcDirs { - entries.ForDir(func(o fs.Directory) { - var ( - hashVal string - ) - time := o.ModTime(ctx).In(TZ) - id := "" // TODO - flags := "d" // "-" for a file and "d" for a directory - lock.Lock() - //record size as 0 instead of -1, so bisync doesn't think it's a google doc - ls.put(o.Remote(), 0, time, hashVal, id, flags) - lock.Unlock() - }) - } - return firstErr - }) - if err == nil { - err = ls.save(ctx, listing) - } - if err != nil { - b.abort = true - } - return -} - // checkListing verifies that listing is not empty (unless resynching) func (b *bisyncRun) checkListing(ls *fileList, listing, msg string) error { if b.opt.Resync || !ls.empty() { @@ -542,8 +487,6 @@ func (b *bisyncRun) modifyListing(ctx context.Context, src fs.Fs, dst fs.Fs, res updateLists("src", srcWinners, srcList) updateLists("dst", dstWinners, dstList) - // TODO: rollback on error - // account for "deltaOthers" we handled separately if queues.deletedonboth.NotEmpty() { for file := range queues.deletedonboth { @@ -587,7 +530,7 @@ func (b *bisyncRun) modifyListing(ctx context.Context, src fs.Fs, dst fs.Fs, res // recheck the ones we skipped because they were equal // we never got their info because they were never synced. - // TODO: add flag to skip this for people who don't care and would rather avoid? + // TODO: add flag to skip this? (since it re-lists) if queues.renameSkipped.NotEmpty() { skippedList := queues.renameSkipped.ToList() for _, file := range skippedList { @@ -596,6 +539,20 @@ func (b *bisyncRun) modifyListing(ctx context.Context, src fs.Fs, dst fs.Fs, res } } } + // skipped dirs -- nothing to recheck, just add them + // (they are not necessarily there already, if they are new) + path1List := srcList + path2List := dstList + if !is1to2 { + path1List = dstList + path2List = srcList + } + if !queues.skippedDirs1.empty() { + queues.skippedDirs1.getPutAll(path1List) + } + if !queues.skippedDirs2.empty() { + queues.skippedDirs2.getPutAll(path2List) + } if filterRecheck.HaveFilesFrom() { b.recheck(ctxRecheck, src, dst, srcList, dstList, is1to2) @@ -665,9 +622,9 @@ func (b *bisyncRun) recheck(ctxRecheck context.Context, src, dst fs.Fs, srcList, if len(toRollback) > 0 { srcListing, dstListing := b.getListingNames(is1to2) oldSrc, err := b.loadListing(srcListing + "-old") - handleErr(oldSrc, "error loading old src listing", err) // TODO: make this critical? + b.handleErr(oldSrc, "error loading old src listing", err, true, true) oldDst, err := b.loadListing(dstListing + "-old") - handleErr(oldDst, "error loading old dst listing", err) // TODO: make this critical? + b.handleErr(oldDst, "error loading old dst listing", err, true, true) for _, item := range toRollback { rollback(item, oldSrc, srcList) @@ -683,13 +640,6 @@ func (b *bisyncRun) getListingNames(is1to2 bool) (srcListing string, dstListing return b.listing2, b.listing1 } -func handleErr(o interface{}, msg string, err error) { - // TODO: add option to make critical? - if err != nil { - fs.Debugf(o, "%s: %v", msg, err) - } -} - func rollback(item string, oldList, newList *fileList) { if oldList.has(item) { oldList.getPut(item, newList) diff --git a/cmd/bisync/march.go b/cmd/bisync/march.go new file mode 100644 index 0000000000000..229f3ed63af05 --- /dev/null +++ b/cmd/bisync/march.go @@ -0,0 +1,189 @@ +package bisync + +import ( + "context" + "sync" + + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/accounting" + "github.com/rclone/rclone/fs/hash" + "github.com/rclone/rclone/fs/march" +) + +var ls1 = newFileList() +var ls2 = newFileList() +var err error +var firstErr error +var marchLsLock sync.Mutex +var marchErrLock sync.Mutex +var marchCtx context.Context + +func (b *bisyncRun) makeMarchListing(ctx context.Context) (*fileList, *fileList, error) { + ci := fs.GetConfig(ctx) + marchCtx = ctx + b.setupListing() + fs.Debugf(b, "starting to march!") + + // set up a march over fdst (Path2) and fsrc (Path1) + m := &march.March{ + Ctx: ctx, + Fdst: b.fs2, + Fsrc: b.fs1, + Dir: "", + NoTraverse: false, + Callback: b, + DstIncludeAll: false, + NoCheckDest: false, + NoUnicodeNormalization: ci.NoUnicodeNormalization, + } + err = m.Run(ctx) + + fs.Debugf(b, "march completed. err: %v", err) + if err == nil { + err = firstErr + } + if err != nil { + b.abort = true + } + + // save files + err = ls1.save(ctx, b.newListing1) + if err != nil { + b.abort = true + } + err = ls2.save(ctx, b.newListing2) + if err != nil { + b.abort = true + } + + return ls1, ls2, err +} + +// SrcOnly have an object which is on path1 only +func (b *bisyncRun) SrcOnly(o fs.DirEntry) (recurse bool) { + fs.Debugf(o, "path1 only") + b.parse(o, true) + return isDir(o) +} + +// DstOnly have an object which is on path2 only +func (b *bisyncRun) DstOnly(o fs.DirEntry) (recurse bool) { + fs.Debugf(o, "path2 only") + b.parse(o, false) + return isDir(o) +} + +// Match is called when object exists on both path1 and path2 (whether equal or not) +func (b *bisyncRun) Match(ctx context.Context, o2, o1 fs.DirEntry) (recurse bool) { + fs.Debugf(o1, "both path1 and path2") + b.parse(o1, true) + b.parse(o2, false) + return isDir(o1) +} + +func isDir(e fs.DirEntry) bool { + switch x := e.(type) { + case fs.Object: + fs.Debugf(x, "is Object") + return false + case fs.Directory: + fs.Debugf(x, "is Dir") + return true + default: + fs.Debugf(e, "is unknown") + } + return false +} + +func (b *bisyncRun) parse(e fs.DirEntry, isPath1 bool) { + switch x := e.(type) { + case fs.Object: + b.ForObject(x, isPath1) + case fs.Directory: + if b.opt.CreateEmptySrcDirs { + b.ForDir(x, isPath1) + } + default: + fs.Debugf(e, "is unknown") + } +} + +func (b *bisyncRun) setupListing() { + ls1 = newFileList() + ls2 = newFileList() + + hashType1 := hash.None + hashType2 := hash.None + if !b.opt.IgnoreListingChecksum { + // Currently bisync just honors --ignore-listing-checksum + // (note that this is different from --ignore-checksum) + // TODO add full support for checksums and related flags + hashType1 = b.fs1.Hashes().GetOne() + hashType2 = b.fs2.Hashes().GetOne() + } + + ls1.hash = hashType1 + ls2.hash = hashType2 +} + +func (b *bisyncRun) ForObject(o fs.Object, isPath1 bool) { + tr := accounting.Stats(marchCtx).NewCheckingTransfer(o, "listing file - "+whichPath(isPath1)) + defer func() { + tr.Done(marchCtx, nil) + }() + var ( + hashVal string + hashErr error + ) + ls := whichLs(isPath1) + hashType := ls.hash + if hashType != hash.None { + hashVal, hashErr = o.Hash(marchCtx, hashType) + marchErrLock.Lock() + if firstErr == nil { + firstErr = hashErr + } + marchErrLock.Unlock() + } + time := o.ModTime(marchCtx).In(TZ) + id := "" // TODO + flags := "-" // "-" for a file and "d" for a directory + marchLsLock.Lock() + ls.put(o.Remote(), o.Size(), time, hashVal, id, flags) + marchLsLock.Unlock() +} + +func (b *bisyncRun) ForDir(o fs.Directory, isPath1 bool) { + tr := accounting.Stats(marchCtx).NewCheckingTransfer(o, "listing dir - "+whichPath(isPath1)) + defer func() { + tr.Done(marchCtx, nil) + }() + ls := whichLs(isPath1) + time := o.ModTime(marchCtx).In(TZ) + id := "" // TODO + flags := "d" // "-" for a file and "d" for a directory + marchLsLock.Lock() + //record size as 0 instead of -1, so bisync doesn't think it's a google doc + ls.put(o.Remote(), 0, time, "", id, flags) + marchLsLock.Unlock() +} + +func whichLs(isPath1 bool) *fileList { + ls := ls1 + if !isPath1 { + ls = ls2 + } + return ls +} + +func whichPath(isPath1 bool) string { + s := "Path1" + if !isPath1 { + s = "Path2" + } + return s +} + +// TODO: +// equality check? +// unicode stuff diff --git a/cmd/bisync/operations.go b/cmd/bisync/operations.go index e3f590b45f35f..67cb5b4400035 100644 --- a/cmd/bisync/operations.go +++ b/cmd/bisync/operations.go @@ -45,6 +45,8 @@ type queues struct { renamed1 bilib.Names // renamed on 1 and copied to 2 renamed2 bilib.Names // renamed on 2 and copied to 1 renameSkipped bilib.Names // not renamed because it was equal + skippedDirs1 *fileList + skippedDirs2 *fileList deletedonboth bilib.Names } @@ -217,10 +219,15 @@ func (b *bisyncRun) runLocked(octx context.Context) (err error) { return errors.New("cannot find prior Path1 or Path2 listings, likely due to critical error on prior run") } + fs.Infof(nil, "Building Path1 and Path2 listings") + ls1, ls2, err = b.makeMarchListing(fctx) + if err != nil { + return err + } + // Check for Path1 deltas relative to the prior sync fs.Infof(nil, "Path1 checking for diffs") - newListing1 := b.listing1 + "-new" - ds1, err := b.findDeltas(fctx, b.fs1, b.listing1, newListing1, "Path1") + ds1, err := b.findDeltas(fctx, b.fs1, b.listing1, ls1, "Path1") if err != nil { return err } @@ -228,8 +235,7 @@ func (b *bisyncRun) runLocked(octx context.Context) (err error) { // Check for Path2 deltas relative to the prior sync fs.Infof(nil, "Path2 checking for diffs") - newListing2 := b.listing2 + "-new" - ds2, err := b.findDeltas(fctx, b.fs2, b.listing2, newListing2, "Path2") + ds2, err := b.findDeltas(fctx, b.fs2, b.listing2, ls2, "Path2") if err != nil { return err } @@ -298,8 +304,7 @@ func (b *bisyncRun) runLocked(octx context.Context) (err error) { b.saveOldListings() // save new listings if noChanges { - err1 = bilib.CopyFileIfExists(newListing1, b.listing1) - err2 = bilib.CopyFileIfExists(newListing2, b.listing2) + b.replaceCurrentListings() } else { if changes1 { // 2to1 err1 = b.modifyListing(fctx, b.fs2, b.fs1, results2to1, queues, false) @@ -360,7 +365,10 @@ func (b *bisyncRun) runLocked(octx context.Context) (err error) { func (b *bisyncRun) resync(octx, fctx context.Context) error { fs.Infof(nil, "Copying unique Path2 files to Path1") - filesNow1, err := b.makeListing(fctx, b.fs1, b.newListing1) + // TODO: remove this listing eventually. + // Listing here is only really necessary for our --ignore-existing logic + // which would be more efficiently implemented by setting ci.IgnoreExisting + filesNow1, filesNow2, err := b.makeMarchListing(fctx) if err == nil { err = b.checkListing(filesNow1, b.newListing1, "current Path1") } @@ -368,10 +376,7 @@ func (b *bisyncRun) resync(octx, fctx context.Context) error { return err } - filesNow2, err := b.makeListing(fctx, b.fs2, b.newListing2) - if err == nil { - err = b.checkListing(filesNow2, b.newListing2, "current Path2") - } + err = b.checkListing(filesNow2, b.newListing2, "current Path2") if err != nil { return err } @@ -468,13 +473,8 @@ func (b *bisyncRun) resync(octx, fctx context.Context) error { } fs.Infof(nil, "Resync updating listings") - b.saveOldListings() // TODO: also make replaceCurrentListings? - if err := bilib.CopyFileIfExists(b.newListing1, b.listing1); err != nil { - return err - } - if err := bilib.CopyFileIfExists(b.newListing2, b.listing2); err != nil { - return err - } + b.saveOldListings() + b.replaceCurrentListings() // resync 2to1 queues.copy2to1 = bilib.ToNames(copy2to1) @@ -574,3 +574,17 @@ func (b *bisyncRun) testFn() { b.opt.TestFn() } } + +func (b *bisyncRun) handleErr(o interface{}, msg string, err error, critical, retryable bool) { + if err != nil { + if retryable { + b.retryable = true + } + if critical { + b.critical = true + fs.Errorf(o, "%s: %v", msg, err) + } else { + fs.Debugf(o, "%s: %v", msg, err) + } + } +} diff --git a/cmd/bisync/testdata/test_all_changed/golden/test.log b/cmd/bisync/testdata/test_all_changed/golden/test.log index c2daac34d035c..9922112e7c62b 100644 --- a/cmd/bisync/testdata/test_all_changed/golden/test.log +++ b/cmd/bisync/testdata/test_all_changed/golden/test.log @@ -16,6 +16,7 @@ INFO : Bisync successful (07) : test sync should pass (08) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File is newer - file1.copy1.txt INFO : - Path1 File is newer - file1.copy2.txt @@ -46,6 +47,7 @@ INFO : Bisync successful (12) : test sync should fail (13) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File is newer - RCLONE_TEST INFO : - Path1 File is OLDER - file1.copy1.txt @@ -64,6 +66,7 @@ Bisync error: all files were changed (14) : test sync with force should pass (15) : bisync force INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File is newer - RCLONE_TEST INFO : - Path1 File is OLDER - file1.copy1.txt diff --git a/cmd/bisync/testdata/test_basic/golden/test.log b/cmd/bisync/testdata/test_basic/golden/test.log index 57d6541a01074..8eb3e47f42d8f 100644 --- a/cmd/bisync/testdata/test_basic/golden/test.log +++ b/cmd/bisync/testdata/test_basic/golden/test.log @@ -17,6 +17,7 @@ INFO : Bisync successful (07) : test bisync run (08) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File is newer - subdir/file20.txt INFO : Path1: 1 changes: 0 new, 1 newer, 0 older, 0 deleted diff --git a/cmd/bisync/testdata/test_changes/golden/test.log b/cmd/bisync/testdata/test_changes/golden/test.log index aff7b456d0c57..e595678dabbd1 100644 --- a/cmd/bisync/testdata/test_changes/golden/test.log +++ b/cmd/bisync/testdata/test_changes/golden/test.log @@ -49,6 +49,7 @@ INFO : Bisync successful (31) : test bisync run (32) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File is newer - file2.txt INFO : - Path1 File was deleted - file4.txt diff --git a/cmd/bisync/testdata/test_check_access/golden/test.log b/cmd/bisync/testdata/test_check_access/golden/test.log index d7382b9afea3b..d99ef694d0afb 100644 --- a/cmd/bisync/testdata/test_check_access/golden/test.log +++ b/cmd/bisync/testdata/test_check_access/golden/test.log @@ -12,6 +12,7 @@ INFO : Bisync successful (04) : test 1. see that check-access passes with the initial setup (05) : bisync check-access INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : Checking access health @@ -25,6 +26,7 @@ INFO : Bisync successful (07) : delete-file {path2/}subdir/RCLONE_TEST (08) : bisync check-access INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : - Path2 File was deleted - subdir/RCLONE_TEST @@ -49,6 +51,7 @@ INFO : Bisync successful (13) : test 4. run sync with check-access. should pass. (14) : bisync check-access INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : Checking access health @@ -62,6 +65,7 @@ INFO : Bisync successful (16) : delete-file {path1/}RCLONE_TEST (17) : bisync check-access INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File was deleted - RCLONE_TEST INFO : Path1: 1 changes: 0 new, 0 newer, 0 older, 1 deleted @@ -95,6 +99,7 @@ INFO : Bisync successful (24) : test 8. run sync with --check-access. should pass. (25) : bisync check-access INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : Checking access health diff --git a/cmd/bisync/testdata/test_check_access_filters/golden/test.log b/cmd/bisync/testdata/test_check_access_filters/golden/test.log index cd7753a9fc6b8..c121263746bc6 100644 --- a/cmd/bisync/testdata/test_check_access_filters/golden/test.log +++ b/cmd/bisync/testdata/test_check_access_filters/golden/test.log @@ -18,6 +18,7 @@ INFO : Bisync successful (07) : bisync check-access filters-file={workdir/}exclude-other-filtersfile.txt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}exclude-other-filtersfile.txt +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : Checking access health @@ -38,6 +39,7 @@ INFO : Bisync successful (15) : bisync check-access filters-file={workdir/}exclude-other-filtersfile.txt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}exclude-other-filtersfile.txt +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : Checking access health @@ -56,6 +58,7 @@ INFO : Bisync successful (21) : bisync check-access filters-file={workdir/}exclude-other-filtersfile.txt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}exclude-other-filtersfile.txt +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File was deleted - subdir/RCLONE_TEST INFO : Path1: 1 changes: 0 new, 0 newer, 0 older, 1 deleted @@ -88,6 +91,7 @@ INFO : Bisync successful (30) : bisync check-access filters-file={workdir/}include-other-filtersfile.txt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}include-other-filtersfile.txt +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : Checking access health @@ -107,6 +111,7 @@ INFO : Bisync successful (37) : bisync check-access filters-file={workdir/}include-other-filtersfile.txt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}include-other-filtersfile.txt +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : Checking access health @@ -126,6 +131,7 @@ INFO : Bisync successful (44) : bisync check-access filters-file={workdir/}include-other-filtersfile.txt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}include-other-filtersfile.txt +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File was deleted - subdir/RCLONE_TEST INFO : - Path1 File was deleted - subdirX/subdirX1/RCLONE_TEST @@ -136,8 +142,8 @@ INFO : Path2: 1 changes: 0 new, 0 newer, 0 older, 1 deleted INFO : Checking access health ERROR : Access test failed: Path1 count 3, Path2 count 4 - RCLONE_TEST ERROR : -  Access test failed: Path1 file not found in Path2 - RCLONE_TEST -ERROR : -  Access test failed: Path2 file not found in Path1 - subdirX/subdirX1/RCLONE_TEST ERROR : -  Access test failed: Path2 file not found in Path1 - subdir/RCLONE_TEST +ERROR : -  Access test failed: Path2 file not found in Path1 - subdirX/subdirX1/RCLONE_TEST ERROR : Bisync critical error: check file check failed ERROR : Bisync aborted. Must run --resync to recover. Bisync error: bisync aborted diff --git a/cmd/bisync/testdata/test_check_filename/golden/test.log b/cmd/bisync/testdata/test_check_filename/golden/test.log index f03e1fdc2b962..c860b6e20e366 100644 --- a/cmd/bisync/testdata/test_check_filename/golden/test.log +++ b/cmd/bisync/testdata/test_check_filename/golden/test.log @@ -12,6 +12,7 @@ INFO : Bisync successful (04) : test 1. see that check-access passes with the initial setup (05) : bisync check-access check-filename=.chk_file INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : Checking access health @@ -26,6 +27,7 @@ INFO : Bisync successful (08) : delete-file {path2/}subdir/.chk_file (09) : bisync check-access check-filename=.chk_file INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : - Path2 File was deleted - subdir/.chk_file @@ -52,6 +54,7 @@ INFO : Bisync successful (14) : test 4. run sync with check-access. should pass. (15) : bisync check-access check-filename=.chk_file INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : Checking access health diff --git a/cmd/bisync/testdata/test_check_sync/golden/test.log b/cmd/bisync/testdata/test_check_sync/golden/test.log index d70224b29c6d1..277b45ff3e42b 100644 --- a/cmd/bisync/testdata/test_check_sync/golden/test.log +++ b/cmd/bisync/testdata/test_check_sync/golden/test.log @@ -51,6 +51,7 @@ INFO : Bisync successful (20) : test 7. run normal sync with check-sync enabled (default) (21) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : No changes found @@ -61,6 +62,7 @@ INFO : Bisync successful (22) : test 8. run normal sync with no-check-sync (23) : bisync no-check-sync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : No changes found diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log b/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log index 1b2583d27486e..dd9be0d672c96 100644 --- a/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log +++ b/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log @@ -24,6 +24,7 @@ INFO : Bisync successful (15) : test 2. Run bisync without --create-empty-src-dirs (16) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : No changes found @@ -39,6 +40,7 @@ subdir/ (20) : test 4.Run bisync WITH --create-empty-src-dirs (21) : bisync create-empty-src-dirs INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File is new - subdir INFO : Path1: 1 changes: 1 new, 0 newer, 0 older, 0 deleted @@ -68,6 +70,7 @@ subdir/ (33) : test 7. Run bisync without --create-empty-src-dirs (34) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File was deleted - RCLONE_TEST INFO : - Path1 File was deleted - subdir @@ -115,6 +118,7 @@ subdir/ (51) : bisync create-empty-src-dirs INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File was deleted - subdir INFO : Path1: 1 changes: 0 new, 0 newer, 0 older, 1 deleted @@ -134,6 +138,7 @@ INFO : Bisync successful (55) : test 11. bisync again (because if we leave subdir in listings, test will fail due to mismatched modtime) (56) : bisync create-empty-src-dirs INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : No changes found diff --git a/cmd/bisync/testdata/test_dry_run/golden/test.log b/cmd/bisync/testdata/test_dry_run/golden/test.log index db5a487fa09d9..f29698f0a2707 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/test.log +++ b/cmd/bisync/testdata/test_dry_run/golden/test.log @@ -66,6 +66,7 @@ INFO : Bisync successful (30) : test sync with dry-run (31) : bisync dry-run INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File is newer - file2.txt INFO : - Path1 File was deleted - file4.txt @@ -120,6 +121,7 @@ INFO : Bisync successful (33) : test sync without dry-run (34) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File is newer - file2.txt INFO : - Path1 File was deleted - file4.txt diff --git a/cmd/bisync/testdata/test_equal/golden/test.log b/cmd/bisync/testdata/test_equal/golden/test.log index 37bd0d41a400f..fe32ce71052b2 100644 --- a/cmd/bisync/testdata/test_equal/golden/test.log +++ b/cmd/bisync/testdata/test_equal/golden/test.log @@ -23,6 +23,7 @@ INFO : Bisync successful (13) : test bisync run (14) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File is newer - file1.txt INFO : - Path1 File is newer - file2.txt diff --git a/cmd/bisync/testdata/test_extended_char_paths/golden/test.log b/cmd/bisync/testdata/test_extended_char_paths/golden/test.log index 772d88ad62620..e0ff286c2eafa 100644 --- a/cmd/bisync/testdata/test_extended_char_paths/golden/test.log +++ b/cmd/bisync/testdata/test_extended_char_paths/golden/test.log @@ -19,6 +19,7 @@ INFO : Bisync successful (09) : test normal sync of subdirs with extended chars (10) : bisync subdir=測試_Русский_{spc}_{spc}_ě_áñ INFO : Synching Path1 "{path1/}測試_Русский_ _ _ě_áñ/" with Path2 "{path2/}測試_Русский_ _ _ě_áñ/" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File is new - 測試_file1p1 INFO : Path1: 1 changes: 1 new, 0 newer, 0 older, 0 deleted @@ -45,6 +46,7 @@ INFO : Bisync successful (14) : delete-file {path1/}測試_Русский_{spc}_{spc}_ě_áñ/測試_check{spc}file (15) : bisync check-access check-filename=測試_check{spc}file INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File was deleted - 測試_Русский_ _ _ě_áñ/測試_check file INFO : Path1: 1 changes: 0 new, 0 newer, 0 older, 1 deleted @@ -68,6 +70,7 @@ INFO : Resync updating listings INFO : Bisync successful (19) : bisync check-access check-filename=測試_check{spc}file INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : Checking access health @@ -92,6 +95,7 @@ INFO : Bisync successful (25) : bisync filters-file={workdir/}測試_filtersfile.txt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}測試_filtersfile.txt +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : No changes found diff --git a/cmd/bisync/testdata/test_extended_filenames/golden/test.log b/cmd/bisync/testdata/test_extended_filenames/golden/test.log index 039ed9e82db48..790a722da3c40 100644 --- a/cmd/bisync/testdata/test_extended_filenames/golden/test.log +++ b/cmd/bisync/testdata/test_extended_filenames/golden/test.log @@ -38,6 +38,7 @@ INFO : Bisync successful (26) : test bisync run (27) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File was deleted - Русский.txt INFO : - Path1 File is new - file1_with white space.txt diff --git a/cmd/bisync/testdata/test_filters/golden/test.log b/cmd/bisync/testdata/test_filters/golden/test.log index dfea30ddf1a8e..2821e617b1f7c 100644 --- a/cmd/bisync/testdata/test_filters/golden/test.log +++ b/cmd/bisync/testdata/test_filters/golden/test.log @@ -24,6 +24,7 @@ INFO : Bisync successful (11) : bisync filters-file={workdir/}filtersfile.flt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}filtersfile.flt +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File is new - subdir/fileZ.txt INFO : Path1: 1 changes: 1 new, 0 newer, 0 older, 0 deleted diff --git a/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log b/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log index 937d4fbee23c0..b4494cbdf9255 100644 --- a/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log +++ b/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log @@ -41,6 +41,7 @@ INFO : Bisync successful (13) : bisync filters-file={workdir/}filtersfile.txt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}filtersfile.txt +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : No changes found diff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/golden/test.log b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/test.log index 6e383f78454c2..4baad3309fa95 100644 --- a/cmd/bisync/testdata/test_ignorelistingchecksum/golden/test.log +++ b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/test.log @@ -23,6 +23,7 @@ INFO : Bisync successful (08) : test bisync run (09) : bisync ignore-listing-checksum INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File is newer - subdir/file20.txt INFO : Path1: 1 changes: 0 new, 1 newer, 0 older, 0 deleted diff --git a/cmd/bisync/testdata/test_max_delete_path1/golden/test.log b/cmd/bisync/testdata/test_max_delete_path1/golden/test.log index c6d802a2f4fea..83c33ef2d6975 100644 --- a/cmd/bisync/testdata/test_max_delete_path1/golden/test.log +++ b/cmd/bisync/testdata/test_max_delete_path1/golden/test.log @@ -19,6 +19,7 @@ INFO : Bisync successful (10) : test sync should fail due to too many local deletes (11) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File was deleted - file1.txt INFO : - Path1 File was deleted - file2.txt @@ -35,6 +36,7 @@ Bisync error: too many deletes (13) : test change max-delete limit to 60%. sync should run. (14) : bisync max-delete=60 INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File was deleted - file1.txt INFO : - Path1 File was deleted - file2.txt diff --git a/cmd/bisync/testdata/test_max_delete_path2_force/golden/test.log b/cmd/bisync/testdata/test_max_delete_path2_force/golden/test.log index ca5a0f6364bba..326987c4bd279 100644 --- a/cmd/bisync/testdata/test_max_delete_path2_force/golden/test.log +++ b/cmd/bisync/testdata/test_max_delete_path2_force/golden/test.log @@ -19,6 +19,7 @@ INFO : Bisync successful (10) : test sync should fail due to too many path2 deletes (11) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : - Path2 File was deleted - file1.txt @@ -35,6 +36,7 @@ Bisync error: too many deletes (13) : test apply force option. sync should run. (14) : bisync force INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : - Path2 File was deleted - file1.txt diff --git a/cmd/bisync/testdata/test_rclone_args/golden/test.log b/cmd/bisync/testdata/test_rclone_args/golden/test.log index f0caf729ab679..f92ecfe1d8475 100644 --- a/cmd/bisync/testdata/test_rclone_args/golden/test.log +++ b/cmd/bisync/testdata/test_rclone_args/golden/test.log @@ -23,6 +23,7 @@ INFO : Bisync successful (10) : test run bisync with custom options (11) : bisync size-only INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File is newer - file1.txt INFO : - Path1 File is newer - subdir/file20.txt diff --git a/cmd/bisync/testdata/test_resync/golden/test.log b/cmd/bisync/testdata/test_resync/golden/test.log index 39f35b09e00f2..41e84ce5827e4 100644 --- a/cmd/bisync/testdata/test_resync/golden/test.log +++ b/cmd/bisync/testdata/test_resync/golden/test.log @@ -72,6 +72,7 @@ INFO : Bisync successful (32) : test run normal bisync (33) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : No changes found @@ -83,6 +84,7 @@ INFO : Bisync successful (35) : purge-children {path2/} (36) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs ERROR : Empty current Path2 listing. Cannot sync to an empty directory: {workdir/}{session}.path2.lst-new diff --git a/cmd/bisync/testdata/test_rmdirs/golden/test.log b/cmd/bisync/testdata/test_rmdirs/golden/test.log index eca4e4fba7096..5ea1bacddd680 100644 --- a/cmd/bisync/testdata/test_rmdirs/golden/test.log +++ b/cmd/bisync/testdata/test_rmdirs/golden/test.log @@ -15,6 +15,7 @@ INFO : Bisync successful (06) : test 2. run bisync without remove-empty-dirs (07) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File was deleted - subdir/file20.txt INFO : Path1: 1 changes: 0 new, 0 newer, 0 older, 1 deleted @@ -35,6 +36,7 @@ subdir/ (11) : test 4. run bisync with remove-empty-dirs (12) : bisync remove-empty-dirs INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : Path2 checking for diffs INFO : No changes found diff --git a/cmd/bisync/testdata/test_volatile/golden/test.log b/cmd/bisync/testdata/test_volatile/golden/test.log index b65c8a26e1b31..97fce76aff4e8 100644 --- a/cmd/bisync/testdata/test_volatile/golden/test.log +++ b/cmd/bisync/testdata/test_volatile/golden/test.log @@ -18,6 +18,7 @@ INFO : Bisync successful (10) : test-func (11) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File is newer - file5.txt INFO : Path1: 1 changes: 0 new, 1 newer, 0 older, 0 deleted @@ -51,6 +52,7 @@ INFO : Bisync successful (18) : test-func (19) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File is new - file100.txt INFO : - Path1 File is new - file5.txt @@ -268,6 +270,7 @@ INFO : Bisync successful (26) : test-func (27) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File is new - file5.txt INFO : Path1: 1 changes: 1 new, 0 newer, 0 older, 0 deleted diff --git a/docs/content/bisync.md b/docs/content/bisync.md index c34073890ffd6..b01e82cc035e6 100644 --- a/docs/content/bisync.md +++ b/docs/content/bisync.md @@ -1275,6 +1275,9 @@ about _Unison_ and synchronization in general. * Final listings are now generated from sync results, to avoid needing to re-list * Bisync is now much more resilient to changes that happen during a bisync run, and far less prone to critical errors / undetected changes * Bisync is now capable of rolling a file listing back in cases of uncertainty, essentially marking the file as needing to be rechecked next time. +* A few basic terminal colors are now supported, controllable with [`--color`](/docs/#color-when) (`AUTO`|`NEVER`|`ALWAYS`) +* Initial listing snapshots of Path1 and Path2 are now generated concurrently, using the same "march" infrastructure as `check` and `sync`, +for performance improvements and less [risk of error](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=4.%20Listings%20should%20alternate%20between%20paths%20to%20minimize%20errors). ### `v1.64` * Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Dry%20runs%20are%20not%20completely%20dry) From 88e516adee46f439cd0f53ccbbf3b7a86272e538 Mon Sep 17 00:00:00 2001 From: nielash Date: Tue, 10 Oct 2023 07:21:56 -0400 Subject: [PATCH 114/130] moveOrCopyFile: avoid panic on --dry-run Before this change, changing the case of a file on a case insensitive remote would fatally panic when `--dry-run` was set, due to `moveOrCopyFile` attempting to access the non-existent `tmpObj` it (would normally have) created. After this change, the panic is avoided by skipping this step during a `--dry-run` (with the usual "skipped as --dry-run is set" log message.) --- fs/operations/operations.go | 4 ++++ fs/operations/operations_test.go | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/fs/operations/operations.go b/fs/operations/operations.go index efa3d4babfb4e..b71e6adc52288 100644 --- a/fs/operations/operations.go +++ b/fs/operations/operations.go @@ -1770,6 +1770,10 @@ func moveOrCopyFile(ctx context.Context, fdst fs.Fs, fsrc fs.Fs, dstFileName str // move it back to the intended destination. This is required // to avoid issues with certain remotes and avoid file deletion. if !cp && fdst.Name() == fsrc.Name() && fdst.Features().CaseInsensitive && dstFileName != srcFileName && strings.EqualFold(dstFilePath, srcFilePath) { + if SkipDestructive(ctx, srcFileName, "rename to "+dstFileName) { + // avoid fatalpanic on --dry-run (trying to access non-existent tmpObj) + return nil + } // Create random name to temporarily move file to tmpObjName := dstFileName + "-rclone-move-" + random.String(8) tmpObjFail, err := fdst.NewObject(ctx, tmpObjName) diff --git a/fs/operations/operations_test.go b/fs/operations/operations_test.go index 19d58ea3049d6..325db174837a3 100644 --- a/fs/operations/operations_test.go +++ b/fs/operations/operations_test.go @@ -997,6 +997,23 @@ func TestCaseInsensitiveMoveFile(t *testing.T) { r.CheckRemoteItems(t, file2Capitalized) } +func TestCaseInsensitiveMoveFileDryRun(t *testing.T) { + ctx := context.Background() + ctx, ci := fs.AddConfig(ctx) + r := fstest.NewRun(t) + if !r.Fremote.Features().CaseInsensitive { + return + } + + ci.DryRun = true + file1 := r.WriteObject(ctx, "hello", "world", t1) + r.CheckRemoteItems(t, file1) + + err := operations.MoveFile(ctx, r.Fremote, r.Fremote, "HELLO", file1.Path) + require.NoError(t, err) + r.CheckRemoteItems(t, file1) +} + func TestMoveFileBackupDir(t *testing.T) { ctx := context.Background() ctx, ci := fs.AddConfig(ctx) From 11afc3dde0720ff5f8312bb26e3dde2f8956c410 Mon Sep 17 00:00:00 2001 From: nielash Date: Sun, 8 Oct 2023 22:59:22 -0400 Subject: [PATCH 115/130] sync: --fix-case flag to rename case insensitive dest - fixes #4854 Before this change, a sync to a case insensitive dest (such as macOS / Windows) would not result in a matching filename if the source and dest had casing differences but were otherwise equal. For example, syncing `hello.txt` to `HELLO.txt` would result in the dest filename remaining `HELLO.txt`. Furthermore, `--local-case-sensitive` did not solve this, as it actually caused `HELLO.txt` to get deleted! After this change, `HELLO.txt` is renamed to `hello.txt` to match the source, only if the `--fix-case` flag is specified. (The old behavior remains the default.) --- docs/content/docs.md | 20 ++++++++++++++++ fs/config.go | 1 + fs/config/configflags/configflags.go | 1 + fs/sync/sync.go | 36 ++++++++++++++++++++++++++++ fs/sync/sync_test.go | 33 +++++++++++++++++++++++++ 5 files changed, 91 insertions(+) diff --git a/docs/content/docs.md b/docs/content/docs.md index ee3f7e4d78fc4..821d6f4b0fec0 100644 --- a/docs/content/docs.md +++ b/docs/content/docs.md @@ -1107,6 +1107,26 @@ triggering follow-on actions if data was copied, or skipping if not. NB: Enabling this option turns a usually non-fatal error into a potentially fatal one - please check and adjust your scripts accordingly! +### --fix-case ### + +Normally, a sync to a case insensitive dest (such as macOS / Windows) will +not result in a matching filename if the source and dest filenames have +casing differences but are otherwise identical. For example, syncing `hello.txt` +to `HELLO.txt` will normally result in the dest filename remaining `HELLO.txt`. +If `--fix-case` is set, then `HELLO.txt` will be renamed to `hello.txt` +to match the source. + +NB: +- directory names with incorrect casing will also be fixed +- `--fix-case` will be ignored if `--immutable` is set +- using `--local-case-sensitive` instead is not advisable; +it will cause `HELLO.txt` to get deleted! +- the old dest filename must not be excluded by filters. +Be especially careful with [`--files-from`](/filtering/#files-from-read-list-of-source-file-names), +which does not respect [`--ignore-case`](/filtering/#ignore-case-make-searches-case-insensitive)! +- on remotes that do not support server-side move, `--fix-case` will require +downloading the file and re-uploading it. To avoid this, do not use `--fix-case`. + ### --fs-cache-expire-duration=TIME When using rclone via the API rclone caches created remotes for 5 diff --git a/fs/config.go b/fs/config.go index d405f55bb7ea6..5b1e483dc0279 100644 --- a/fs/config.go +++ b/fs/config.go @@ -81,6 +81,7 @@ type ConfigInfo struct { IgnoreSize bool IgnoreChecksum bool IgnoreCaseSync bool + FixCase bool NoTraverse bool CheckFirst bool NoCheckDest bool diff --git a/fs/config/configflags/configflags.go b/fs/config/configflags/configflags.go index 7d856cf12d1f0..232af61d5aa7d 100644 --- a/fs/config/configflags/configflags.go +++ b/fs/config/configflags/configflags.go @@ -83,6 +83,7 @@ func AddFlags(ci *fs.ConfigInfo, flagSet *pflag.FlagSet) { flags.BoolVarP(flagSet, &ci.IgnoreSize, "ignore-size", "", false, "Ignore size when skipping use modtime or checksum", "Copy") flags.BoolVarP(flagSet, &ci.IgnoreChecksum, "ignore-checksum", "", ci.IgnoreChecksum, "Skip post copy check of checksums", "Copy") flags.BoolVarP(flagSet, &ci.IgnoreCaseSync, "ignore-case-sync", "", ci.IgnoreCaseSync, "Ignore case when synchronizing", "Copy") + flags.BoolVarP(flagSet, &ci.FixCase, "fix-case", "", ci.FixCase, "Force rename of case insensitive dest to match source", "Sync") flags.BoolVarP(flagSet, &ci.NoTraverse, "no-traverse", "", ci.NoTraverse, "Don't traverse destination file system on copy", "Copy") flags.BoolVarP(flagSet, &ci.CheckFirst, "check-first", "", ci.CheckFirst, "Do all the checks before starting transfers", "Copy") flags.BoolVarP(flagSet, &ci.NoCheckDest, "no-check-dest", "", ci.NoCheckDest, "Don't check the destination, copy regardless", "Copy") diff --git a/fs/sync/sync.go b/fs/sync/sync.go index 9154171c51be1..39dfb38188572 100644 --- a/fs/sync/sync.go +++ b/fs/sync/sync.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" "path" + "path/filepath" "sort" "strings" "sync" @@ -18,6 +19,7 @@ import ( "github.com/rclone/rclone/fs/hash" "github.com/rclone/rclone/fs/march" "github.com/rclone/rclone/fs/operations" + "github.com/rclone/rclone/lib/random" ) // ErrorMaxDurationReached defines error when transfer duration is reached @@ -363,6 +365,16 @@ func (s *syncCopyMove) pairChecker(in *pipe, out *pipe, fraction int, wg *sync.W needTransfer = false } } + // Fix case for case insensitive filesystems + if s.ci.FixCase && !s.ci.Immutable && src.Remote() != pair.Dst.Remote() { + if newDst, err := operations.Move(s.ctx, s.fdst, nil, src.Remote(), pair.Dst); err != nil { + fs.Errorf(pair.Dst, "Error while attempting to rename to %s: %v", src.Remote(), err) + s.processError(err) + } else { + fs.Infof(pair.Dst, "Fixed case by renaming to: %s", src.Remote()) + pair.Dst = newDst + } + } if needTransfer { // If files are treated as immutable, fail if destination exists and does not match if s.ci.Immutable && pair.Dst != nil { @@ -1136,6 +1148,30 @@ func (s *syncCopyMove) Match(ctx context.Context, dst, src fs.DirEntry) (recurse s.srcEmptyDirs[src.Remote()] = src s.srcEmptyDirsMu.Unlock() } + if s.ci.FixCase && !s.ci.Immutable && src.Remote() != dst.Remote() { + // Fix case for case insensitive filesystems + // Fix each dir before recursing into subdirs and files + oldDirFs, err := fs.NewFs(s.ctx, filepath.Join(s.fdst.Root(), dst.Remote())) + s.processError(err) + newDirPath := filepath.Join(s.fdst.Root(), filepath.Dir(dst.Remote()), filepath.Base(src.Remote())) + newDirFs, err := fs.NewFs(s.ctx, newDirPath) + s.processError(err) + // Create random name to temporarily move dir to + tmpDirName := newDirPath + "-rclone-move-" + random.String(8) + tmpDirFs, err := fs.NewFs(s.ctx, tmpDirName) + s.processError(err) + if err = MoveDir(s.ctx, tmpDirFs, oldDirFs, s.deleteEmptySrcDirs, s.copyEmptySrcDirs); err != nil { + fs.Errorf(dst, "Error while attempting to move dir to temporary location %s: %v", tmpDirName, err) + s.processError(err) + } else { + if err = MoveDir(s.ctx, newDirFs, tmpDirFs, s.deleteEmptySrcDirs, s.copyEmptySrcDirs); err != nil { + fs.Errorf(dst, "Error while attempting to rename to %s: %v", src.Remote(), err) + s.processError(err) + } else { + fs.Infof(dst, "Fixed case by renaming to: %s", src.Remote()) + } + } + } return true } diff --git a/fs/sync/sync_test.go b/fs/sync/sync_test.go index 4438477f45c96..34085ee6e90e6 100644 --- a/fs/sync/sync_test.go +++ b/fs/sync/sync_test.go @@ -2197,6 +2197,39 @@ func TestSyncIgnoreCase(t *testing.T) { r.CheckRemoteItems(t, file2) } +// Test --fix-case +func TestFixCase(t *testing.T) { + ctx := context.Background() + ctx, ci := fs.AddConfig(ctx) + r := fstest.NewRun(t) + + // Only test if remote is case insensitive + if !r.Fremote.Features().CaseInsensitive { + t.Skip("Skipping test as local or remote are case-sensitive") + } + + ci.FixCase = true + + // Create files with different filename casing + file1a := r.WriteFile("existing", "potato", t1) + file1b := r.WriteFile("existingbutdifferent", "donut", t1) + file1c := r.WriteFile("subdira/subdirb/subdirc/hello", "donut", t1) + file1d := r.WriteFile("subdira/subdirb/subdirc/subdird/filewithoutcasedifferences", "donut", t1) + r.CheckLocalItems(t, file1a, file1b, file1c, file1d) + file2a := r.WriteObject(ctx, "EXISTING", "potato", t1) + file2b := r.WriteObject(ctx, "EXISTINGBUTDIFFERENT", "lemonade", t1) + file2c := r.WriteObject(ctx, "SUBDIRA/subdirb/SUBDIRC/HELLO", "lemonade", t1) + file2d := r.WriteObject(ctx, "SUBDIRA/subdirb/SUBDIRC/subdird/filewithoutcasedifferences", "lemonade", t1) + r.CheckRemoteItems(t, file2a, file2b, file2c, file2d) + + // Should force rename of dest file that is differently-cased + accounting.GlobalStats().ResetCounters() + err := Sync(ctx, r.Fremote, r.Flocal, false) + require.NoError(t, err) + r.CheckLocalItems(t, file1a, file1b, file1c, file1d) + r.CheckRemoteItems(t, file1a, file1b, file1c, file1d) +} + // Test that aborting on --max-transfer works func TestMaxTransfer(t *testing.T) { ctx := context.Background() From f7f465182832fe4448b1b638088bb8e96a8af029 Mon Sep 17 00:00:00 2001 From: nielash Date: Sun, 8 Oct 2023 23:16:23 -0400 Subject: [PATCH 116/130] bisync: handle unicode and case normalization consistently - mostly-fixes #7270 Before this change, Bisync sometimes normalized NFD to NFC and sometimes did not, causing errors in some scenarios (particularly for users of macOS). It was similarly inconsistent in its handling of case-insensitivity. There were three main places where Bisync should have normalized, but didn't: 1. When building the list of files that need to be transferred during --resync 2. When building the list of deltas during a non-resync 3. When comparing Path1 to Path2 during --check-sync After this change, 1 and 3 are resolved, and bisync supports --no-unicode-normalization and --ignore-case-sync in the same way as sync. 2 will be addressed in a future update. --- cmd/bisync/bisync_test.go | 28 +++- cmd/bisync/deltas.go | 10 +- cmd/bisync/listing.go | 68 +++++++-- cmd/bisync/march.go | 4 - cmd/bisync/operations.go | 21 ++- cmd/bisync/queue.go | 31 +++- .../_testdir_path1.._testdir_path2.path1.lst | 17 +-- ...estdir_path1.._testdir_path2.path1.lst-new | 1 - ...estdir_path1.._testdir_path2.path1.lst-old | 17 +-- .../_testdir_path1.._testdir_path2.path2.lst | 17 +-- ...estdir_path1.._testdir_path2.path2.lst-new | 1 - ...estdir_path1.._testdir_path2.path2.lst-old | 17 +-- .../test_check_access_filters/golden/test.log | 2 +- ...testdir_path1.._testdir_path2.copy1to2.que | 3 + ...testdir_path1.._testdir_path2.copy2to1.que | 3 + .../_testdir_path1.._testdir_path2.path1.lst | 5 + ...estdir_path1.._testdir_path2.path1.lst-new | 5 + ...estdir_path1.._testdir_path2.path1.lst-old | 5 + .../_testdir_path1.._testdir_path2.path2.lst | 5 + ...estdir_path1.._testdir_path2.path2.lst-new | 5 + ...estdir_path1.._testdir_path2.path2.lst-old | 5 + ..._path1.._testdir_path2.resync-copy2to1.que | 2 + .../test_normalization/golden/test.log | 144 ++++++++++++++++++ .../test_normalization/initial/RCLONE_TEST | 1 + .../test_normalization/initial/file1.txt | 0 .../filename_contains_\304\233_.txt" | 7 + .../filename_contains_\340\242\272_.txt" | 7 + .../\346\270\254\350\251\246_check file" | 0 .../test_normalization/modfiles/file1.txt | 1 + .../\346\270\254\350\251\246_filtersfile.txt" | 5 + .../testdata/test_normalization/scenario.txt | 53 +++++++ docs/content/bisync.md | 20 ++- 32 files changed, 441 insertions(+), 69 deletions(-) create mode 100644 cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.copy1to2.que create mode 100644 cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.copy2to1.que create mode 100644 cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst create mode 100644 cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-new create mode 100644 cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-old create mode 100644 cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst create mode 100644 cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-new create mode 100644 cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-old create mode 100644 cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que create mode 100644 cmd/bisync/testdata/test_normalization/golden/test.log create mode 100644 cmd/bisync/testdata/test_normalization/initial/RCLONE_TEST create mode 100644 cmd/bisync/testdata/test_normalization/initial/file1.txt create mode 100644 "cmd/bisync/testdata/test_normalization/initial/\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_ _ _\304\233_\303\241\303\261/filename_contains_\304\233_.txt" create mode 100644 "cmd/bisync/testdata/test_normalization/initial/\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_ _ _\304\233_\303\241\303\261/filename_contains_\340\242\272_.txt" create mode 100644 "cmd/bisync/testdata/test_normalization/initial/\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_ _ _\304\233_\303\241\303\261/\346\270\254\350\251\246_check file" create mode 100644 cmd/bisync/testdata/test_normalization/modfiles/file1.txt create mode 100644 "cmd/bisync/testdata/test_normalization/modfiles/\346\270\254\350\251\246_filtersfile.txt" create mode 100644 cmd/bisync/testdata/test_normalization/scenario.txt diff --git a/cmd/bisync/bisync_test.go b/cmd/bisync/bisync_test.go index 11a0862c36052..185981a2c77b3 100644 --- a/cmd/bisync/bisync_test.go +++ b/cmd/bisync/bisync_test.go @@ -98,10 +98,13 @@ var logHoppers = []string{ // subdirectories. The order inconsistency initially showed up in the // listings and triggered reordering of log messages, but the actual // files will in fact match. - `ERROR : - +Access test failed: Path[12] file not found in Path[12] - .*`, + `.* +.....Access test failed: Path[12] file not found in Path[12].*`, // Test case `resync` suffered from the order of queued copies. `(?:INFO |NOTICE): - Path2 Resync will copy to Path1 +- .*`, + + // Test case `normalization` can have random order of fix-case files. + `(?:INFO |NOTICE): .*: Fixed case by renaming to: .*`, } // Some log lines can contain Windows path separator that must be @@ -546,6 +549,16 @@ func (b *bisyncTest) runTestStep(ctx context.Context, line string) (err error) { case "copy-as": b.checkArgs(args, 3, 3) return b.copyFile(ctx, args[1], args[2], args[3]) + case "copy-as-NFC": + b.checkArgs(args, 3, 3) + ci.NoUnicodeNormalization = true + ci.FixCase = true + return b.copyFile(ctx, args[1], norm.NFC.String(args[2]), norm.NFC.String(args[3])) + case "copy-as-NFD": + b.checkArgs(args, 3, 3) + ci.NoUnicodeNormalization = true + ci.FixCase = true + return b.copyFile(ctx, args[1], norm.NFD.String(args[2]), norm.NFD.String(args[3])) case "copy-dir", "sync-dir": b.checkArgs(args, 2, 2) if fsrc, err = cache.Get(ctx, args[1]); err != nil { @@ -565,6 +578,9 @@ func (b *bisyncTest) runTestStep(ctx context.Context, line string) (err error) { b.checkArgs(args, 1, 1) return b.listSubdirs(ctx, args[1]) case "bisync": + ci.NoUnicodeNormalization = false + ci.IgnoreCaseSync = false + // ci.FixCase = true return b.runBisync(ctx, args[1:]) case "test-func": b.TestFn = testFunc @@ -668,6 +684,16 @@ func (b *bisyncTest) runBisync(ctx context.Context, args []string) (err error) { fs2 = addSubdir(b.path2, val) case "ignore-listing-checksum": opt.IgnoreListingChecksum = true + case "no-norm": + ci.NoUnicodeNormalization = true + ci.IgnoreCaseSync = false + case "norm": + ci.NoUnicodeNormalization = false + ci.IgnoreCaseSync = true + case "fix-case": + ci.NoUnicodeNormalization = false + ci.IgnoreCaseSync = true + ci.FixCase = true default: return fmt.Errorf("invalid bisync option %q", arg) } diff --git a/cmd/bisync/deltas.go b/cmd/bisync/deltas.go index 3167dfb006b27..d0c0cd8aa3532 100644 --- a/cmd/bisync/deltas.go +++ b/cmd/bisync/deltas.go @@ -381,11 +381,17 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change } } + // find alternate names according to normalization settings + altNames1to2 := bilib.Names{} + altNames2to1 := bilib.Names{} + b.findAltNames(ctx, b.fs1, copy2to1, b.newListing1, altNames2to1) + b.findAltNames(ctx, b.fs2, copy1to2, b.newListing2, altNames1to2) + // Do the batch operation if copy2to1.NotEmpty() { changes1 = true b.indent("Path2", "Path1", "Do queued copies to") - results2to1, err = b.fastCopy(ctx, b.fs2, b.fs1, copy2to1, "copy2to1") + results2to1, err = b.fastCopy(ctx, b.fs2, b.fs1, copy2to1, "copy2to1", altNames2to1) if err != nil { return } @@ -397,7 +403,7 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change if copy1to2.NotEmpty() { changes2 = true b.indent("Path1", "Path2", "Do queued copies to") - results1to2, err = b.fastCopy(ctx, b.fs1, b.fs2, copy1to2, "copy1to2") + results1to2, err = b.fastCopy(ctx, b.fs1, b.fs2, copy1to2, "copy1to2", altNames1to2) if err != nil { return } diff --git a/cmd/bisync/listing.go b/cmd/bisync/listing.go index 7875036fa4a80..f94883d97cc2f 100644 --- a/cmd/bisync/listing.go +++ b/cmd/bisync/listing.go @@ -20,6 +20,7 @@ import ( "github.com/rclone/rclone/fs/hash" "github.com/rclone/rclone/fs/operations" "golang.org/x/exp/slices" + "golang.org/x/text/unicode/norm" ) // ListingHeader defines first line of a listing @@ -400,6 +401,18 @@ func ConvertPrecision(Modtime time.Time, dst fs.Fs) time.Time { return Modtime } +// ApplyTransforms handles unicode and case normalization +func ApplyTransforms(ctx context.Context, dst fs.Fs, s string) string { + ci := fs.GetConfig(ctx) + if !ci.NoUnicodeNormalization { + s = norm.NFC.String(s) + } + if ci.IgnoreCaseSync || dst.Features().CaseInsensitive { + s = strings.ToLower(s) + } + return s +} + // modifyListing will modify the listing based on the results of the sync func (b *bisyncRun) modifyListing(ctx context.Context, src fs.Fs, dst fs.Fs, results []Results, queues queues, is1to2 bool) (err error) { queue := queues.copy2to1 @@ -429,6 +442,10 @@ func (b *bisyncRun) modifyListing(ctx context.Context, src fs.Fs, dst fs.Fs, res srcList.hash = src.Hashes().GetOne() dstList.hash = dst.Hashes().GetOne() } + dstListNew, err := b.loadListing(dstListing + "-new") + if err != nil { + return fmt.Errorf("cannot read new listing: %w", err) + } srcWinners := newFileList() dstWinners := newFileList() @@ -466,20 +483,47 @@ func (b *bisyncRun) modifyListing(ctx context.Context, src fs.Fs, dst fs.Fs, res } updateLists := func(side string, winners, list *fileList) { - // removals from side - for _, oldFile := range queue.ToList() { - if !winners.has(oldFile) && list.has(oldFile) && !errors.has(oldFile) { - list.remove(oldFile) - fs.Debugf(nil, "decision: removed from %s: %v", side, oldFile) - } else if winners.has(oldFile) { + for _, queueFile := range queue.ToList() { + if !winners.has(queueFile) && list.has(queueFile) && !errors.has(queueFile) { + // removals from side + list.remove(queueFile) + fs.Debugf(nil, "decision: removed from %s: %v", side, queueFile) + } else if winners.has(queueFile) { // copies to side - new := winners.get(oldFile) - list.put(oldFile, new.size, new.time, new.hash, new.id, new.flags) - fs.Debugf(nil, "decision: copied to %s: %v", side, oldFile) + new := winners.get(queueFile) + + // handle normalization according to settings + ci := fs.GetConfig(ctx) + if side == "dst" && (!ci.NoUnicodeNormalization || ci.IgnoreCaseSync || dst.Features().CaseInsensitive) { + // search list for existing file that matches queueFile when normalized + normalizedName := ApplyTransforms(ctx, dst, queueFile) + matchFound := false + matchedName := "" + for _, filename := range dstListNew.list { + if ApplyTransforms(ctx, dst, filename) == normalizedName { + matchFound = true + matchedName = filename // original, not normalized + break + } + } + if matchFound && matchedName != queueFile { + // use the (non-identical) existing name, unless --fix-case + if ci.FixCase { + fs.Debugf(direction, "removing %s and adding %s as --fix-case was specified", matchedName, queueFile) + list.remove(matchedName) + } else { + fs.Debugf(direction, "casing/unicode difference detected. using %s instead of %s", matchedName, queueFile) + queueFile = matchedName + } + } + } + + list.put(queueFile, new.size, new.time, new.hash, new.id, new.flags) + fs.Debugf(nil, "decision: copied to %s: %v", side, queueFile) } else { - fs.Debugf(oldFile, "file in queue but missing from %s transfers", side) - if err := filterRecheck.AddFile(oldFile); err != nil { - fs.Debugf(oldFile, "error adding file to recheck filter: %v", err) + fs.Debugf(queueFile, "file in queue but missing from %s transfers", side) + if err := filterRecheck.AddFile(queueFile); err != nil { + fs.Debugf(queueFile, "error adding file to recheck filter: %v", err) } } } diff --git a/cmd/bisync/march.go b/cmd/bisync/march.go index 229f3ed63af05..63536063be067 100644 --- a/cmd/bisync/march.go +++ b/cmd/bisync/march.go @@ -183,7 +183,3 @@ func whichPath(isPath1 bool) string { } return s } - -// TODO: -// equality check? -// unicode stuff diff --git a/cmd/bisync/operations.go b/cmd/bisync/operations.go index 67cb5b4400035..fce29f4d08dec 100644 --- a/cmd/bisync/operations.go +++ b/cmd/bisync/operations.go @@ -428,8 +428,11 @@ func (b *bisyncRun) resync(octx, fctx context.Context) error { if len(copy2to1) > 0 { b.indent("Path2", "Path1", "Resync is doing queued copies to") + resync2to1 := bilib.ToNames(copy2to1) + altNames2to1 := bilib.Names{} + b.findAltNames(octx, b.fs1, resync2to1, b.newListing1, altNames2to1) // octx does not have extra filters! - results2to1, err = b.fastCopy(octx, b.fs2, b.fs1, bilib.ToNames(copy2to1), "resync-copy2to1") + results2to1, err = b.fastCopy(octx, b.fs2, b.fs1, resync2to1, "resync-copy2to1", altNames2to1) if err != nil { b.critical = true return err @@ -516,15 +519,27 @@ func (b *bisyncRun) checkSync(listing1, listing2 string) error { return fmt.Errorf("cannot read prior listing of Path2: %w", err) } + transformList := func(files *fileList, fs fs.Fs) *fileList { + transformed := newFileList() + for _, file := range files.list { + f := files.get(file) + transformed.put(ApplyTransforms(context.Background(), fs, file), f.size, f.time, f.hash, f.id, f.flags) + } + return transformed + } + + files1Transformed := transformList(files1, b.fs1) + files2Transformed := transformList(files2, b.fs2) + ok := true for _, file := range files1.list { - if !files2.has(file) { + if !files2.has(file) && !files2Transformed.has(ApplyTransforms(context.Background(), b.fs1, file)) { b.indent("ERROR", file, "Path1 file not found in Path2") ok = false } } for _, file := range files2.list { - if !files1.has(file) { + if !files1.has(file) && !files1Transformed.has(ApplyTransforms(context.Background(), b.fs2, file)) { b.indent("ERROR", file, "Path2 file not found in Path1") ok = false } diff --git a/cmd/bisync/queue.go b/cmd/bisync/queue.go index d670c033d3bb3..d16f06fcc3e90 100644 --- a/cmd/bisync/queue.go +++ b/cmd/bisync/queue.go @@ -14,7 +14,6 @@ import ( "github.com/rclone/rclone/fs/filter" "github.com/rclone/rclone/fs/operations" "github.com/rclone/rclone/fs/sync" - "golang.org/x/text/unicode/norm" ) // Results represents a pair of synced files, as reported by the LoggerFn @@ -130,7 +129,7 @@ func ReadResults(results io.Reader) []Results { return slice } -func (b *bisyncRun) fastCopy(ctx context.Context, fsrc, fdst fs.Fs, files bilib.Names, queueName string) ([]Results, error) { +func (b *bisyncRun) fastCopy(ctx context.Context, fsrc, fdst fs.Fs, files bilib.Names, queueName string, altNames bilib.Names) ([]Results, error) { if err := b.saveQueue(files, queueName); err != nil { return nil, err } @@ -140,9 +139,12 @@ func (b *bisyncRun) fastCopy(ctx context.Context, fsrc, fdst fs.Fs, files bilib. if err := filterCopy.AddFile(file); err != nil { return nil, err } - // macOS - if err := filterCopy.AddFile(norm.NFD.String(file)); err != nil { - return nil, err + } + if altNames.NotEmpty() { + for _, file := range altNames.ToList() { + if err := filterCopy.AddFile(file); err != nil { + return nil, err + } } } @@ -252,3 +254,22 @@ func (b *bisyncRun) saveQueue(files bilib.Names, jobName string) error { queueFile := fmt.Sprintf("%s.%s.que", b.basePath, jobName) return files.Save(queueFile) } + +func (b *bisyncRun) findAltNames(ctx context.Context, dst fs.Fs, queue bilib.Names, newListing string, altNames bilib.Names) { + ci := fs.GetConfig(ctx) + if queue.NotEmpty() && (!ci.NoUnicodeNormalization || ci.IgnoreCaseSync || b.fs1.Features().CaseInsensitive || b.fs2.Features().CaseInsensitive) { + // search list for existing file that matches queueFile when normalized + for _, queueFile := range queue.ToList() { + normalizedName := ApplyTransforms(ctx, dst, queueFile) + candidates, err := b.loadListing(newListing) + if err != nil { + fs.Errorf(candidates, "cannot read new listing: %v", err) + } + for _, filename := range candidates.list { + if ApplyTransforms(ctx, dst, filename) == normalizedName && filename != queueFile { + altNames.Add(filename) // original, not normalized + } + } + } + } +} diff --git a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst index 7471a27cf44bb..f0208cb9a5d79 100644 --- a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst +++ b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst @@ -1,10 +1,9 @@ # bisync listing v1 from test -- 6148 md5:23b446fda9938c607142c5133cf90689 - 2000-01-01T00:00:00.000000000+0000 ".DS_Store" -- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file1.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "subdir/file20.txt" +- 109 - - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" +- 19 - - 2001-01-02T00:00:00.000000000+0000 "file1.txt" +- 19 - - 2001-01-02T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst-new b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst-new index f243ade04e741..465d2455d7627 100644 --- a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst-new +++ b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst-new @@ -1,5 +1,4 @@ # bisync listing v1 from test -- 6148 md5:23b446fda9938c607142c5133cf90689 - 2000-01-01T00:00:00.000000000+0000 ".DS_Store" - 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" diff --git a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst-old index 991f89b82a5aa..7819f9efca8e6 100644 --- a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst-old +++ b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -1,10 +1,9 @@ # bisync listing v1 from test -- 6148 md5:23b446fda9938c607142c5133cf90689 - 2000-01-01T00:00:00.000000000+0000 ".DS_Store" -- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" +- 109 - - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst index 7471a27cf44bb..f0208cb9a5d79 100644 --- a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst +++ b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst @@ -1,10 +1,9 @@ # bisync listing v1 from test -- 6148 md5:23b446fda9938c607142c5133cf90689 - 2000-01-01T00:00:00.000000000+0000 ".DS_Store" -- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file1.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "subdir/file20.txt" +- 109 - - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" +- 19 - - 2001-01-02T00:00:00.000000000+0000 "file1.txt" +- 19 - - 2001-01-02T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst-new b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst-new index dac88bd2cd680..9e8bc8a1a516e 100644 --- a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst-new +++ b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst-new @@ -1,5 +1,4 @@ # bisync listing v1 from test -- 6148 md5:23b446fda9938c607142c5133cf90689 - 2000-01-01T00:00:00.000000000+0000 ".DS_Store" - 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" - 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" diff --git a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst-old index 991f89b82a5aa..7819f9efca8e6 100644 --- a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst-old +++ b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -1,10 +1,9 @@ # bisync listing v1 from test -- 6148 md5:23b446fda9938c607142c5133cf90689 - 2000-01-01T00:00:00.000000000+0000 ".DS_Store" -- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" +- 109 - - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 - - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_check_access_filters/golden/test.log b/cmd/bisync/testdata/test_check_access_filters/golden/test.log index c121263746bc6..9ade7ee1b3d68 100644 --- a/cmd/bisync/testdata/test_check_access_filters/golden/test.log +++ b/cmd/bisync/testdata/test_check_access_filters/golden/test.log @@ -142,8 +142,8 @@ INFO : Path2: 1 changes: 0 new, 0 newer, 0 older, 1 deleted INFO : Checking access health ERROR : Access test failed: Path1 count 3, Path2 count 4 - RCLONE_TEST ERROR : -  Access test failed: Path1 file not found in Path2 - RCLONE_TEST -ERROR : -  Access test failed: Path2 file not found in Path1 - subdir/RCLONE_TEST ERROR : -  Access test failed: Path2 file not found in Path1 - subdirX/subdirX1/RCLONE_TEST +ERROR : -  Access test failed: Path2 file not found in Path1 - subdir/RCLONE_TEST ERROR : Bisync critical error: check file check failed ERROR : Bisync aborted. Must run --resync to recover. Bisync error: bisync aborted diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.copy1to2.que b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.copy1to2.que new file mode 100644 index 0000000000000..bd7f8e7dde8d9 --- /dev/null +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.copy1to2.que @@ -0,0 +1,3 @@ +"folder/HeLlO,wOrLd!.txt" +"folder/éééö.txt" +"測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.copy2to1.que b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.copy2to1.que new file mode 100644 index 0000000000000..85deec9f9c605 --- /dev/null +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.copy2to1.que @@ -0,0 +1,3 @@ +"file1.txt" +"folder/hello,WORLD!.txt" +"folder/éééö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst new file mode 100644 index 0000000000000..0cdecd335b0bb --- /dev/null +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst @@ -0,0 +1,5 @@ +# bisync listing v1 from test +- 19 - - 2001-01-05T00:00:00.000000000+0000 "file1.txt" +- 19 - - 2001-01-05T00:00:00.000000000+0000 "folder/HeLlO,wOrLd!.txt" +- 19 - - 2001-01-05T00:00:00.000000000+0000 "folder/éééö.txt" +- 19 - - 2001-01-05T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-new b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-new new file mode 100644 index 0000000000000..bd44aea5b8ce7 --- /dev/null +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-new @@ -0,0 +1,5 @@ +# bisync listing v1 from test +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-03T00:00:00.000000000+0000 "file1.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "folder/HeLlO,wOrLd!.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "folder/éééö.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-old new file mode 100644 index 0000000000000..441434161ed55 --- /dev/null +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -0,0 +1,5 @@ +# bisync listing v1 from test +- 19 - - 2001-01-03T00:00:00.000000000+0000 "file1.txt" +- 19 - - 2001-01-03T00:00:00.000000000+0000 "folder/HeLlO,wOrLd!.txt" +- 19 - - 2001-01-03T00:00:00.000000000+0000 "folder/éééö.txt" +- 19 - - 2001-01-02T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst new file mode 100644 index 0000000000000..f7c2c0ea6db20 --- /dev/null +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst @@ -0,0 +1,5 @@ +# bisync listing v1 from test +- 19 - - 2001-01-05T00:00:00.000000000+0000 "file1.txt" +- 19 - - 2001-01-05T00:00:00.000000000+0000 "folder/hello,WORLD!.txt" +- 19 - - 2001-01-05T00:00:00.000000000+0000 "folder/éééö.txt" +- 19 - - 2001-01-05T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-new b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-new new file mode 100644 index 0000000000000..225fe66c1ea7f --- /dev/null +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-new @@ -0,0 +1,5 @@ +# bisync listing v1 from test +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "file1.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "folder/hello,WORLD!.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "folder/éééö.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-old new file mode 100644 index 0000000000000..ab169560115bb --- /dev/null +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -0,0 +1,5 @@ +# bisync listing v1 from test +- 19 - - 2001-01-03T00:00:00.000000000+0000 "file1.txt" +- 19 - - 2001-01-03T00:00:00.000000000+0000 "folder/hello,WORLD!.txt" +- 19 - - 2001-01-03T00:00:00.000000000+0000 "folder/éééö.txt" +- 19 - - 2001-01-02T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que new file mode 100644 index 0000000000000..007f0aadaa840 --- /dev/null +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que @@ -0,0 +1,2 @@ +"folder/hello,WORLD!.txt" +"folder/éééö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/test.log b/cmd/bisync/testdata/test_normalization/golden/test.log new file mode 100644 index 0000000000000..accd69d143cb7 --- /dev/null +++ b/cmd/bisync/testdata/test_normalization/golden/test.log @@ -0,0 +1,144 @@ +(01) : test normalization + + +(02) : touch-copy 2001-01-02 {datadir/}file1.txt {path2/} +(03) : test initial bisync +(04) : bisync resync +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Copying unique Path2 files to Path1 +INFO : Resynching Path1 to Path2 +INFO : Resync updating listings +INFO : Bisync successful + + +(05) : copy-as-NFC {datadir/}file1.txt {path1/}測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö 測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö.txt +(06) : copy-as-NFC {datadir/}file1.txt {path1/}folder éééö.txt +(07) : copy-as-NFC {datadir/}file1.txt {path1/}folder HeLlO,wOrLd!.txt + + +(08) : touch-copy 2001-01-03 {datadir/}file1.txt {path2/} +(09) : copy-as-NFD {datadir/}file1.txt {path2/}folder éééö.txt +(10) : copy-as-NFD {datadir/}file1.txt {path2/}folder hello,WORLD!.txt + +(11) : test bisync run with fix-case +(12) : bisync fix-case +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings +INFO : Path1 checking for diffs +INFO : - Path1 File is new - folder/HeLlO,wOrLd!.txt +INFO : - Path1 File is new - folder/éééö.txt +INFO : - Path1 File is new - "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +INFO : Path1: 3 changes: 3 new, 0 newer, 0 older, 0 deleted +INFO : Path2 checking for diffs +INFO : - Path2 File is newer - file1.txt +INFO : - Path2 File is new - folder/éééö.txt +INFO : - Path2 File is new - folder/hello,WORLD!.txt +INFO : Path2: 3 changes: 2 new, 1 newer, 0 older, 0 deleted +INFO : Applying changes +INFO : - Path1 Queue copy to Path2 - {path2/}folder/HeLlO,wOrLd!.txt +INFO : - Path1 Queue copy to Path2 - {path2/}folder/éééö.txt +INFO : - Path1 Queue copy to Path2 - "{path2/}測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt +INFO : - Path2 Queue copy to Path1 - {path1/}folder/éééö.txt +INFO : - Path2 Queue copy to Path1 - {path1/}folder/hello,WORLD!.txt +INFO : - Path2 Do queued copies to - Path1 +INFO : folder/HeLlO,wOrLd!.txt: Fixed case by renaming to: folder/hello,WORLD!.txt +INFO : folder/éééö.txt: Fixed case by renaming to: folder/éééö.txt +INFO : - Path1 Do queued copies to - Path2 +INFO : Updating listings +INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" +INFO : Bisync successful + + +(13) : purge-children {path1/} +(14) : purge-children {path2/} +(15) : touch-copy 2001-01-02 {datadir/}file1.txt {path2/} +(16) : bisync resync +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Copying unique Path2 files to Path1 +INFO : - Path2 Resync will copy to Path1 - file1.txt +INFO : - Path2 Resync is doing queued copies to - Path1 +INFO : Resynching Path1 to Path2 +INFO : Resync updating listings +INFO : Bisync successful + + +(17) : copy-as-NFC {datadir/}file1.txt {path1/}測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö 測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö.txt +(18) : copy-as-NFC {datadir/}file1.txt {path1/}folder éééö.txt +(19) : copy-as-NFC {datadir/}file1.txt {path1/}folder HeLlO,wOrLd!.txt + + +(20) : touch-copy 2001-01-03 {datadir/}file1.txt {path2/} +(21) : copy-as-NFD {datadir/}file1.txt {path2/}folder éééö.txt +(22) : copy-as-NFD {datadir/}file1.txt {path2/}folder hello,WORLD!.txt + +(23) : test bisync run with normalization +(24) : bisync norm force +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings +INFO : Path1 checking for diffs +INFO : - Path1 File is new - folder/HeLlO,wOrLd!.txt +INFO : - Path1 File is new - folder/éééö.txt +INFO : - Path1 File is new - "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +INFO : Path1: 3 changes: 3 new, 0 newer, 0 older, 0 deleted +INFO : Path2 checking for diffs +INFO : - Path2 File is newer - file1.txt +INFO : - Path2 File is new - folder/éééö.txt +INFO : - Path2 File is new - folder/hello,WORLD!.txt +INFO : Path2: 3 changes: 2 new, 1 newer, 0 older, 0 deleted +INFO : Applying changes +INFO : - Path1 Queue copy to Path2 - {path2/}folder/HeLlO,wOrLd!.txt +INFO : - Path1 Queue copy to Path2 - {path2/}folder/éééö.txt +INFO : - Path1 Queue copy to Path2 - "{path2/}測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt +INFO : - Path2 Queue copy to Path1 - {path1/}folder/éééö.txt +INFO : - Path2 Queue copy to Path1 - {path1/}folder/hello,WORLD!.txt +INFO : - Path2 Do queued copies to - Path1 +INFO : - Path1 Do queued copies to - Path2 +INFO : Updating listings +INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" +INFO : Bisync successful + +(25) : test resync +(26) : bisync resync norm +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Copying unique Path2 files to Path1 +INFO : - Path2 Resync will copy to Path1 - folder/éééö.txt +INFO : - Path2 Resync will copy to Path1 - folder/hello,WORLD!.txt +INFO : - Path2 Resync is doing queued copies to - Path1 +INFO : Resynching Path1 to Path2 +INFO : Resync updating listings +INFO : Bisync successful + +(27) : test changed on both paths +(28) : touch-copy 2001-01-05 {datadir/}file1.txt {path2/} +(29) : copy-as-NFC {datadir/}file1.txt {path1/}測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö 測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö.txt +(30) : copy-as-NFC {datadir/}file1.txt {path1/}folder éééö.txt +(31) : copy-as-NFC {datadir/}file1.txt {path1/}folder HeLlO,wOrLd!.txt +(32) : copy-as-NFD {datadir/}file1.txt {path2/}folder éééö.txt +(33) : copy-as-NFD {datadir/}file1.txt {path2/}folder hello,WORLD!.txt +(34) : bisync norm +INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" +INFO : Building Path1 and Path2 listings +INFO : Path1 checking for diffs +INFO : - Path1 File is newer - folder/HeLlO,wOrLd!.txt +INFO : - Path1 File is newer - folder/éééö.txt +INFO : - Path1 File is newer - "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +INFO : Path1: 3 changes: 0 new, 3 newer, 0 older, 0 deleted +INFO : Path2 checking for diffs +INFO : - Path2 File is newer - file1.txt +INFO : - Path2 File is newer - folder/éééö.txt +INFO : - Path2 File is newer - folder/hello,WORLD!.txt +INFO : Path2: 3 changes: 0 new, 3 newer, 0 older, 0 deleted +INFO : Applying changes +INFO : - Path1 Queue copy to Path2 - {path2/}folder/HeLlO,wOrLd!.txt +INFO : - Path1 Queue copy to Path2 - {path2/}folder/éééö.txt +INFO : - Path1 Queue copy to Path2 - "{path2/}測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt +INFO : - Path2 Queue copy to Path1 - {path1/}folder/éééö.txt +INFO : - Path2 Queue copy to Path1 - {path1/}folder/hello,WORLD!.txt +INFO : - Path2 Do queued copies to - Path1 +INFO : - Path1 Do queued copies to - Path2 +INFO : Updating listings +INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" +INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_normalization/initial/RCLONE_TEST b/cmd/bisync/testdata/test_normalization/initial/RCLONE_TEST new file mode 100644 index 0000000000000..d8ca97c2a4dbe --- /dev/null +++ b/cmd/bisync/testdata/test_normalization/initial/RCLONE_TEST @@ -0,0 +1 @@ +This file is used for testing the health of rclone accesses to the local/remote file system. Do not delete. diff --git a/cmd/bisync/testdata/test_normalization/initial/file1.txt b/cmd/bisync/testdata/test_normalization/initial/file1.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git "a/cmd/bisync/testdata/test_normalization/initial/\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_ _ _\304\233_\303\241\303\261/filename_contains_\304\233_.txt" "b/cmd/bisync/testdata/test_normalization/initial/\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_ _ _\304\233_\303\241\303\261/filename_contains_\304\233_.txt" new file mode 100644 index 0000000000000..a378eaef568c0 --- /dev/null +++ "b/cmd/bisync/testdata/test_normalization/initial/\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_ _ _\304\233_\303\241\303\261/filename_contains_\304\233_.txt" @@ -0,0 +1,7 @@ +maana << Coded as xF1, which is the unicode ID name, but not the correct byte stream coding. +filename_contains_\u011b_ +filename_contains_e_ + +_mañana_funcionará.txt + +file_enconde_mañana_funcionará << Valid byte stream unicode is read correctly diff --git "a/cmd/bisync/testdata/test_normalization/initial/\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_ _ _\304\233_\303\241\303\261/filename_contains_\340\242\272_.txt" "b/cmd/bisync/testdata/test_normalization/initial/\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_ _ _\304\233_\303\241\303\261/filename_contains_\340\242\272_.txt" new file mode 100644 index 0000000000000..a378eaef568c0 --- /dev/null +++ "b/cmd/bisync/testdata/test_normalization/initial/\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_ _ _\304\233_\303\241\303\261/filename_contains_\340\242\272_.txt" @@ -0,0 +1,7 @@ +maana << Coded as xF1, which is the unicode ID name, but not the correct byte stream coding. +filename_contains_\u011b_ +filename_contains_e_ + +_mañana_funcionará.txt + +file_enconde_mañana_funcionará << Valid byte stream unicode is read correctly diff --git "a/cmd/bisync/testdata/test_normalization/initial/\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_ _ _\304\233_\303\241\303\261/\346\270\254\350\251\246_check file" "b/cmd/bisync/testdata/test_normalization/initial/\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_ _ _\304\233_\303\241\303\261/\346\270\254\350\251\246_check file" new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/cmd/bisync/testdata/test_normalization/modfiles/file1.txt b/cmd/bisync/testdata/test_normalization/modfiles/file1.txt new file mode 100644 index 0000000000000..464147f09c0c8 --- /dev/null +++ b/cmd/bisync/testdata/test_normalization/modfiles/file1.txt @@ -0,0 +1 @@ +This file is newer diff --git "a/cmd/bisync/testdata/test_normalization/modfiles/\346\270\254\350\251\246_filtersfile.txt" "b/cmd/bisync/testdata/test_normalization/modfiles/\346\270\254\350\251\246_filtersfile.txt" new file mode 100644 index 0000000000000..c85f097fca206 --- /dev/null +++ "b/cmd/bisync/testdata/test_normalization/modfiles/\346\270\254\350\251\246_filtersfile.txt" @@ -0,0 +1,5 @@ +# Test filters file +# Note that this test checks for bisync's access to and usage of a filters file, not an extensive test of rclone's filter capability + +# Exclude fileZ.txt in root only. The copy in the subdir should be found and synched. +- /fileZ.txt diff --git a/cmd/bisync/testdata/test_normalization/scenario.txt b/cmd/bisync/testdata/test_normalization/scenario.txt new file mode 100644 index 0000000000000..e44265fd2783f --- /dev/null +++ b/cmd/bisync/testdata/test_normalization/scenario.txt @@ -0,0 +1,53 @@ +test normalization +# Tests support for --no-unicode-normalization and --ignore-case-sync +# note: this test is written carefully to be runnable regardless of case/unicode sensitivity +# i.e. the results should be the same on linux and macOS + +# force specific modification time since file time is lost through git +touch-copy 2001-01-02 {datadir/}file1.txt {path2/} +test initial bisync +bisync resync + +# copy NFC version to Path1 +copy-as-NFC {datadir/}file1.txt {path1/}測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö 測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö.txt +copy-as-NFC {datadir/}file1.txt {path1/}folder éééö.txt +copy-as-NFC {datadir/}file1.txt {path1/}folder HeLlO,wOrLd!.txt + +# place newer NFD version on Path2 +touch-copy 2001-01-03 {datadir/}file1.txt {path2/} +copy-as-NFD {datadir/}file1.txt {path2/}folder éééö.txt +copy-as-NFD {datadir/}file1.txt {path2/}folder hello,WORLD!.txt + +test bisync run with fix-case +bisync fix-case + +# purge and reset +purge-children {path1/} +purge-children {path2/} +touch-copy 2001-01-02 {datadir/}file1.txt {path2/} +bisync resync + +# copy NFC version to Path1 +copy-as-NFC {datadir/}file1.txt {path1/}測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö 測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö.txt +copy-as-NFC {datadir/}file1.txt {path1/}folder éééö.txt +copy-as-NFC {datadir/}file1.txt {path1/}folder HeLlO,wOrLd!.txt + +# place newer NFD version on Path2 +touch-copy 2001-01-03 {datadir/}file1.txt {path2/} +copy-as-NFD {datadir/}file1.txt {path2/}folder éééö.txt +copy-as-NFD {datadir/}file1.txt {path2/}folder hello,WORLD!.txt + +test bisync run with normalization +bisync norm force + +test resync +bisync resync norm + +test changed on both paths +touch-copy 2001-01-05 {datadir/}file1.txt {path2/} +copy-as-NFC {datadir/}file1.txt {path1/}測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö 測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö.txt +copy-as-NFC {datadir/}file1.txt {path1/}folder éééö.txt +copy-as-NFC {datadir/}file1.txt {path1/}folder HeLlO,wOrLd!.txt +copy-as-NFD {datadir/}file1.txt {path2/}folder éééö.txt +copy-as-NFD {datadir/}file1.txt {path2/}folder hello,WORLD!.txt +bisync norm \ No newline at end of file diff --git a/docs/content/bisync.md b/docs/content/bisync.md index b01e82cc035e6..109010827a359 100644 --- a/docs/content/bisync.md +++ b/docs/content/bisync.md @@ -588,13 +588,26 @@ and refuses to run again until the user runs a `--resync` (unless using `--resil The best workaround at the moment is to set any backend-specific flags in the [config file](/commands/rclone_config/) instead of specifying them with command flags. (You can still override them as needed for other rclone commands.) -### Case sensitivity +### Case (and unicode) sensitivity {#case-sensitivity} Synching with **case-insensitive** filesystems, such as Windows or `Box`, -can result in file name conflicts. This will be fixed in a future release. -The near-term workaround is to make sure that files on both sides +can result in unusual behavior. As of `v1.65`, case and unicode form differences no longer cause critical errors, +however they may cause unexpected delta outcomes, due to the delta engine still being case-sensitive. +This will be fixed in a future release. The near-term workaround is to make sure that files on both sides don't have spelling case differences (`Smile.jpg` vs. `smile.jpg`). +The same limitation applies to Unicode normalization forms. +This [particularly applies to macOS](https://github.com/rclone/rclone/issues/7270), +which prefers NFD and sometimes auto-converts filenames from the NFC form used by most other platforms. +This should no longer cause bisync to fail entirely, but may cause surprising delta results, as explained above. + +See the following options (all of which are supported by bisync) to control this behavior more granularly: +- [`--fix-case`](/docs/#fix-case) +- [`--ignore-case-sync`](/docs/#ignore-case-sync) +- [`--no-unicode-normalization`](/docs/#no-unicode-normalization) +- [`--local-unicode-normalization`](/local/#local-unicode-normalization) and +[`--local-case-sensitive`](/local/#local-case-sensitive) (caution: these are normally not what you want.) + ## Windows support {#windows} Bisync has been tested on Windows 8.1, Windows 10 Pro 64-bit and on Windows @@ -1278,6 +1291,7 @@ about _Unison_ and synchronization in general. * A few basic terminal colors are now supported, controllable with [`--color`](/docs/#color-when) (`AUTO`|`NEVER`|`ALWAYS`) * Initial listing snapshots of Path1 and Path2 are now generated concurrently, using the same "march" infrastructure as `check` and `sync`, for performance improvements and less [risk of error](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=4.%20Listings%20should%20alternate%20between%20paths%20to%20minimize%20errors). +* Better handling of unicode normalization and case insensitivity, support for [`--fix-case`](/docs/#fix-case), [`--ignore-case-sync`](/docs/#ignore-case-sync), [`--no-unicode-normalization`](/docs/#no-unicode-normalization) ### `v1.64` * Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Dry%20runs%20are%20not%20completely%20dry) From 9c96c13a35633cb032a04ccea57f1a256b6e86cd Mon Sep 17 00:00:00 2001 From: nielash Date: Mon, 6 Nov 2023 10:34:47 -0500 Subject: [PATCH 117/130] bisync: optimize --resync performance -- partially addresses #5681 Before this change, --resync was handled in three steps, and needed to do a lot of unnecessary work to implement its own --ignore-existing logic, which also caused problems with unicode normalization, in addition to being pretty slow. After this change, it is refactored to produce the same result much more efficiently, by reducing the three steps to two and letting ci.IgnoreExisting do the work instead of reinventing the wheel. The behavior and sync order remain unchanged for now -- just faster (but see the ongoing lively discussions about potential future changes in #5681!) --- cmd/bisync/listing.go | 20 ++- cmd/bisync/march.go | 36 ++++++ cmd/bisync/operations.go | 117 ++++++++---------- cmd/bisync/queue.go | 9 +- .../testdata/test_all_changed/golden/test.log | 3 +- .../_testdir_path1.._testdir_path2.path1.lst | 16 +-- ...estdir_path1.._testdir_path2.path1.lst-old | 16 +-- .../_testdir_path1.._testdir_path2.path2.lst | 16 +-- ...estdir_path1.._testdir_path2.path2.lst-old | 16 +-- .../testdata/test_basic/golden/test.log | 3 +- .../testdata/test_changes/golden/test.log | 3 +- ..._path1.._testdir_path2.resync-copy2to1.que | 1 - .../test_check_access/golden/test.log | 11 +- .../test_check_access_filters/golden/test.log | 8 +- .../test_check_filename/golden/test.log | 6 +- ...estdir_path1.._testdir_path2.path1.lst-new | 9 -- ...estdir_path1.._testdir_path2.path2.lst-new | 9 -- .../testdata/test_check_sync/golden/test.log | 6 +- ..._path1.._testdir_path2.resync-copy2to1.que | 1 - .../test_createemptysrcdirs/golden/test.log | 9 +- ..._path1.._testdir_path2.resync-copy2to1.que | 3 - ...ir_path1.._testdir_path2.path1.lst-dry-new | 7 -- ...estdir_path1.._testdir_path2.path1.lst-new | 8 -- ...ir_path1.._testdir_path2.path2.lst-dry-new | 7 -- ...estdir_path1.._testdir_path2.path2.lst-new | 8 -- ..._path1.._testdir_path2.resync-copy2to1.que | 3 - ...estdir_path1.._testdir_path2.path1.lst-new | 8 -- ...estdir_path1.._testdir_path2.path2.lst-new | 8 -- ..._path1.._testdir_path2.resync-copy2to1.que | 3 - .../testdata/test_dry_run/golden/test.log | 10 +- .../testdata/test_equal/golden/test.log | 3 +- ..._path1.._testdir_path2.resync-copy2to1.que | 1 - ...__\304\233_\303\241\303\261.path1.lst-new" | 3 - ...__\304\233_\303\241\303\261.path2.lst-new" | 3 - .../test_extended_char_paths/golden/test.log | 14 ++- .../test_extended_filenames/golden/test.log | 3 +- ...estdir_path1.._testdir_path2.path1.lst-new | 9 -- ...estdir_path1.._testdir_path2.path2.lst-new | 9 -- .../testdata/test_filters/golden/test.log | 3 +- ...ir_path1.._testdir_path2.path1.lst-dry-new | 4 - ...ir_path1.._testdir_path2.path2.lst-dry-new | 4 - .../test_filtersfile_checks/golden/test.log | 9 +- .../golden/test.log | 6 +- .../test_max_delete_path1/golden/test.log | 3 +- .../golden/test.log | 3 +- .../_testdir_path1.._testdir_path2.path1.lst | 8 +- ...estdir_path1.._testdir_path2.path1.lst-old | 8 +- .../_testdir_path1.._testdir_path2.path2.lst | 8 +- ...estdir_path1.._testdir_path2.path2.lst-old | 8 +- ..._path1.._testdir_path2.resync-copy2to1.que | 2 - .../test_normalization/golden/test.log | 14 +-- .../testdata/test_rclone_args/golden/test.log | 3 +- ..._path1.._testdir_path2.resync-copy2to1.que | 2 - ...1._testdir_path1.._testdir_path2.path1.lst | 16 +-- ...estdir_path1.._testdir_path2.path2.lst-new | 8 -- ..._path1.._testdir_path2.resync-copy2to1.que | 8 -- ...estdir_path1.._testdir_path2.path1.lst-new | 8 -- ...2._testdir_path1.._testdir_path2.path2.lst | 16 +-- ...estdir_path1.._testdir_path2.path1.lst-new | 6 - ...estdir_path1.._testdir_path2.path2.lst-new | 7 -- ..._path1.._testdir_path2.resync-copy2to1.que | 2 - .../testdata/test_resync/golden/test.log | 21 +--- .../testdata/test_rmdirs/golden/test.log | 3 +- .../testdata/test_volatile/golden/test.log | 3 +- docs/content/bisync.md | 26 ++-- 65 files changed, 261 insertions(+), 373 deletions(-) delete mode 100644 cmd/bisync/testdata/test_check_access/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que delete mode 100644 cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que delete mode 100644 cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que delete mode 100644 cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.resync-copy2to1.que delete mode 100644 cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.resync-copy2to1.que delete mode 100644 cmd/bisync/testdata/test_extended_char_paths/golden/check-access-pass._testdir_path1.._testdir_path2.resync-copy2to1.que delete mode 100644 cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que delete mode 100644 cmd/bisync/testdata/test_resync/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que delete mode 100644 cmd/bisync/testdata/test_resync/golden/empty-path1._testdir_path1.._testdir_path2.resync-copy2to1.que delete mode 100644 cmd/bisync/testdata/test_resync/golden/mixed-diffs._testdir_path1.._testdir_path2.resync-copy2to1.que diff --git a/cmd/bisync/listing.go b/cmd/bisync/listing.go index f94883d97cc2f..70a2aaf5f81a4 100644 --- a/cmd/bisync/listing.go +++ b/cmd/bisync/listing.go @@ -114,18 +114,24 @@ func (ls *fileList) remove(file string) { } } -func (ls *fileList) put(file string, size int64, time time.Time, hash, id string, flags string) { +func (ls *fileList) put(file string, size int64, modtime time.Time, hash, id string, flags string) { fi := ls.get(file) if fi != nil { fi.size = size - fi.time = time + // if already have higher precision of same time, avoid overwriting it + if fi.time != modtime { + if modtime.Before(fi.time) && fi.time.Sub(modtime) < time.Second { + modtime = fi.time + } + } + fi.time = modtime fi.hash = hash fi.id = id fi.flags = flags } else { fi = &fileInfo{ size: size, - time: time, + time: modtime, hash: hash, id: id, flags: flags, @@ -446,6 +452,14 @@ func (b *bisyncRun) modifyListing(ctx context.Context, src fs.Fs, dst fs.Fs, res if err != nil { return fmt.Errorf("cannot read new listing: %w", err) } + // for resync only, dstListNew will be empty, so need to use results instead + if b.opt.Resync { + for _, result := range results { + if result.Name != "" && result.IsDst { + dstListNew.put(result.Name, result.Size, result.Modtime, result.Hash, "-", result.Flags) + } + } + } srcWinners := newFileList() dstWinners := newFileList() diff --git a/cmd/bisync/march.go b/cmd/bisync/march.go index 63536063be067..6e8c5bf8198e3 100644 --- a/cmd/bisync/march.go +++ b/cmd/bisync/march.go @@ -6,6 +6,7 @@ import ( "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/accounting" + "github.com/rclone/rclone/fs/filter" "github.com/rclone/rclone/fs/hash" "github.com/rclone/rclone/fs/march" ) @@ -183,3 +184,38 @@ func whichPath(isPath1 bool) string { } return s } + +func (b *bisyncRun) findCheckFiles(ctx context.Context) (*fileList, *fileList, error) { + ctxCheckFile, filterCheckFile := filter.AddConfig(ctx) + b.handleErr(b.opt.CheckFilename, "error adding CheckFilename to filter", filterCheckFile.Add(true, b.opt.CheckFilename), true, true) + b.handleErr(b.opt.CheckFilename, "error adding ** exclusion to filter", filterCheckFile.Add(false, "**"), true, true) + ci := fs.GetConfig(ctxCheckFile) + marchCtx = ctxCheckFile + + b.setupListing() + fs.Debugf(b, "starting to march!") + + // set up a march over fdst (Path2) and fsrc (Path1) + m := &march.March{ + Ctx: ctxCheckFile, + Fdst: b.fs2, + Fsrc: b.fs1, + Dir: "", + NoTraverse: false, + Callback: b, + DstIncludeAll: false, + NoCheckDest: false, + NoUnicodeNormalization: ci.NoUnicodeNormalization, + } + err = m.Run(ctxCheckFile) + + fs.Debugf(b, "march completed. err: %v", err) + if err == nil { + err = firstErr + } + if err != nil { + b.abort = true + } + + return ls1, ls2, err +} diff --git a/cmd/bisync/operations.go b/cmd/bisync/operations.go index fce29f4d08dec..70f7593436a8e 100644 --- a/cmd/bisync/operations.go +++ b/cmd/bisync/operations.go @@ -37,6 +37,8 @@ type bisyncRun struct { newListing1 string newListing2 string opt *Options + octx context.Context + fctx context.Context } type queues struct { @@ -205,6 +207,8 @@ func (b *bisyncRun) runLocked(octx context.Context) (err error) { b.retryable = true return } + b.octx = octx + b.fctx = fctx // Generate Path1 and Path2 listings and copy any unique Path2 files to Path1 if opt.Resync { @@ -365,20 +369,16 @@ func (b *bisyncRun) runLocked(octx context.Context) (err error) { func (b *bisyncRun) resync(octx, fctx context.Context) error { fs.Infof(nil, "Copying unique Path2 files to Path1") - // TODO: remove this listing eventually. - // Listing here is only really necessary for our --ignore-existing logic - // which would be more efficiently implemented by setting ci.IgnoreExisting - filesNow1, filesNow2, err := b.makeMarchListing(fctx) - if err == nil { - err = b.checkListing(filesNow1, b.newListing1, "current Path1") - } + // Save blank filelists (will be filled from sync results) + var ls1 = newFileList() + var ls2 = newFileList() + err = ls1.save(fctx, b.newListing1) if err != nil { - return err + b.abort = true } - - err = b.checkListing(filesNow2, b.newListing2, "current Path2") + err = ls2.save(fctx, b.newListing2) if err != nil { - return err + b.abort = true } // Check access health on the Path1 and Path2 filesystems @@ -386,6 +386,13 @@ func (b *bisyncRun) resync(octx, fctx context.Context) error { if b.opt.CheckAccess { fs.Infof(nil, "Checking access health") + filesNow1, filesNow2, err := b.findCheckFiles(fctx) + if err != nil { + b.critical = true + b.retryable = true + return err + } + ds1 := &deltaSet{ checkFiles: bilib.Names{}, } @@ -414,32 +421,11 @@ func (b *bisyncRun) resync(octx, fctx context.Context) error { } } - copy2to1 := []string{} - for _, file := range filesNow2.list { - if !filesNow1.has(file) { - b.indent("Path2", file, "Resync will copy to Path1") - copy2to1 = append(copy2to1, file) - } - } var results2to1 []Results var results1to2 []Results - var results2to1Dirs []Results queues := queues{} - if len(copy2to1) > 0 { - b.indent("Path2", "Path1", "Resync is doing queued copies to") - resync2to1 := bilib.ToNames(copy2to1) - altNames2to1 := bilib.Names{} - b.findAltNames(octx, b.fs1, resync2to1, b.newListing1, altNames2to1) - // octx does not have extra filters! - results2to1, err = b.fastCopy(octx, b.fs2, b.fs1, resync2to1, "resync-copy2to1", altNames2to1) - if err != nil { - b.critical = true - return err - } - } - - fs.Infof(nil, "Resynching Path1 to Path2") + b.indent("Path2", "Path1", "Resync is copying UNIQUE files to") ctxRun := b.opt.setDryRun(fctx) // fctx has our extra filters added! ctxSync, filterSync := filter.AddConfig(ctxRun) @@ -447,60 +433,51 @@ func (b *bisyncRun) resync(octx, fctx context.Context) error { // prevent overwriting Google Doc files (their size is -1) filterSync.Opt.MinSize = 0 } - if results1to2, err = b.resyncDir(ctxSync, b.fs1, b.fs2); err != nil { + ci := fs.GetConfig(ctxSync) + ci.IgnoreExisting = true + if results2to1, err = b.resyncDir(ctxSync, b.fs2, b.fs1); err != nil { b.critical = true return err } - if b.opt.CreateEmptySrcDirs { - // copy Path2 back to Path1, for empty dirs - // the fastCopy above cannot include directories, because it relies on --files-from for filtering, - // so instead we'll copy them here, relying on fctx for our filtering. - - // This preserves the original resync order for backward compatibility. It is essentially: - // rclone copy Path2 Path1 --ignore-existing - // rclone copy Path1 Path2 --create-empty-src-dirs - // rclone copy Path2 Path1 --create-empty-src-dirs - - // although if we were starting from scratch, it might be cleaner and faster to just do: - // rclone copy Path2 Path1 --create-empty-src-dirs - // rclone copy Path1 Path2 --create-empty-src-dirs - - fs.Infof(nil, "Resynching Path2 to Path1 (for empty dirs)") - - // note copy (not sync) and dst comes before src - if results2to1Dirs, err = b.resyncDir(ctxSync, b.fs2, b.fs1); err != nil { - b.critical = true - return err - } + b.indent("Path1", "Path2", "Resync is copying UNIQUE OR DIFFERING files to") + ci.IgnoreExisting = false + if results1to2, err = b.resyncDir(ctxSync, b.fs1, b.fs2); err != nil { + b.critical = true + return err } fs.Infof(nil, "Resync updating listings") b.saveOldListings() b.replaceCurrentListings() + resultsToQueue := func(results []Results) bilib.Names { + names := bilib.Names{} + for _, result := range results { + if result.Name != "" && + (result.Flags != "d" || b.opt.CreateEmptySrcDirs) && + result.IsSrc && result.Src != "" && + (result.Winner.Err == nil || result.Flags == "d") { + names.Add(result.Name) + } + } + return names + } + // resync 2to1 - queues.copy2to1 = bilib.ToNames(copy2to1) + queues.copy2to1 = resultsToQueue(results2to1) if err = b.modifyListing(fctx, b.fs2, b.fs1, results2to1, queues, false); err != nil { b.critical = true return err } // resync 1to2 - queues.copy1to2 = bilib.ToNames(filesNow1.list) + queues.copy1to2 = resultsToQueue(results1to2) if err = b.modifyListing(fctx, b.fs1, b.fs2, results1to2, queues, true); err != nil { b.critical = true return err } - // resync 2to1 (dirs) - dirs2, _ := b.listDirsOnly(2) - queues.copy2to1 = bilib.ToNames(dirs2.list) - if err = b.modifyListing(fctx, b.fs2, b.fs1, results2to1Dirs, queues, false); err != nil { - b.critical = true - return err - } - if !b.opt.NoCleanup { _ = os.Remove(b.newListing1) _ = os.Remove(b.newListing2) @@ -523,7 +500,7 @@ func (b *bisyncRun) checkSync(listing1, listing2 string) error { transformed := newFileList() for _, file := range files.list { f := files.get(file) - transformed.put(ApplyTransforms(context.Background(), fs, file), f.size, f.time, f.hash, f.id, f.flags) + transformed.put(ApplyTransforms(b.fctx, fs, file), f.size, f.time, f.hash, f.id, f.flags) } return transformed } @@ -531,15 +508,19 @@ func (b *bisyncRun) checkSync(listing1, listing2 string) error { files1Transformed := transformList(files1, b.fs1) files2Transformed := transformList(files2, b.fs2) + // DEBUG + fs.Debugf(nil, "files1Transformed: %v", files1Transformed) + fs.Debugf(nil, "files2Transformed: %v", files2Transformed) + ok := true for _, file := range files1.list { - if !files2.has(file) && !files2Transformed.has(ApplyTransforms(context.Background(), b.fs1, file)) { + if !files2.has(file) && !files2Transformed.has(ApplyTransforms(b.fctx, b.fs1, file)) { b.indent("ERROR", file, "Path1 file not found in Path2") ok = false } } for _, file := range files2.list { - if !files1.has(file) && !files1Transformed.has(ApplyTransforms(context.Background(), b.fs2, file)) { + if !files1.has(file) && !files1Transformed.has(ApplyTransforms(b.fctx, b.fs2, file)) { b.indent("ERROR", file, "Path2 file not found in Path1") ok = false } diff --git a/cmd/bisync/queue.go b/cmd/bisync/queue.go index d16f06fcc3e90..12bcb9b698d37 100644 --- a/cmd/bisync/queue.go +++ b/cmd/bisync/queue.go @@ -151,13 +151,8 @@ func (b *bisyncRun) fastCopy(ctx context.Context, fsrc, fdst fs.Fs, files bilib. ignoreListingChecksum = b.opt.IgnoreListingChecksum logger.LoggerFn = WriteResults ctxCopyLogger := operations.WithSyncLogger(ctxCopy, logger) - var err error - if b.opt.Resync { - err = sync.CopyDir(ctxCopyLogger, fdst, fsrc, b.opt.CreateEmptySrcDirs) - } else { - b.testFn() - err = sync.Sync(ctxCopyLogger, fdst, fsrc, b.opt.CreateEmptySrcDirs) - } + b.testFn() + err := sync.Sync(ctxCopyLogger, fdst, fsrc, b.opt.CreateEmptySrcDirs) fs.Debugf(nil, "logger is: %v", logger) getResults := ReadResults(logger.JSON) diff --git a/cmd/bisync/testdata/test_all_changed/golden/test.log b/cmd/bisync/testdata/test_all_changed/golden/test.log index 9922112e7c62b..ccd2c47b29f6a 100644 --- a/cmd/bisync/testdata/test_all_changed/golden/test.log +++ b/cmd/bisync/testdata/test_all_changed/golden/test.log @@ -5,7 +5,8 @@ (03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst index f0208cb9a5d79..86b9e86ee25a7 100644 --- a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst +++ b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst @@ -1,9 +1,9 @@ # bisync listing v1 from test -- 109 - - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" -- 19 - - 2001-01-02T00:00:00.000000000+0000 "file1.txt" -- 19 - - 2001-01-02T00:00:00.000000000+0000 "subdir/file20.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file1.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst-old index 7819f9efca8e6..fbedf0f5e55b2 100644 --- a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst-old +++ b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -1,9 +1,9 @@ # bisync listing v1 from test -- 109 - - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst index f0208cb9a5d79..86b9e86ee25a7 100644 --- a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst +++ b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst @@ -1,9 +1,9 @@ # bisync listing v1 from test -- 109 - - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" -- 19 - - 2001-01-02T00:00:00.000000000+0000 "file1.txt" -- 19 - - 2001-01-02T00:00:00.000000000+0000 "subdir/file20.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file1.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst-old index 7819f9efca8e6..fbedf0f5e55b2 100644 --- a/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst-old +++ b/cmd/bisync/testdata/test_basic/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -1,9 +1,9 @@ # bisync listing v1 from test -- 109 - - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.copy5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_basic/golden/test.log b/cmd/bisync/testdata/test_basic/golden/test.log index 8eb3e47f42d8f..a37bbe392f5e0 100644 --- a/cmd/bisync/testdata/test_basic/golden/test.log +++ b/cmd/bisync/testdata/test_basic/golden/test.log @@ -5,7 +5,8 @@ (03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_changes/golden/test.log b/cmd/bisync/testdata/test_changes/golden/test.log index e595678dabbd1..42a58cfed1515 100644 --- a/cmd/bisync/testdata/test_changes/golden/test.log +++ b/cmd/bisync/testdata/test_changes/golden/test.log @@ -5,7 +5,8 @@ (03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_check_access/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que b/cmd/bisync/testdata/test_check_access/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que deleted file mode 100644 index e042d885c3318..0000000000000 --- a/cmd/bisync/testdata/test_check_access/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que +++ /dev/null @@ -1 +0,0 @@ -"RCLONE_TEST" diff --git a/cmd/bisync/testdata/test_check_access/golden/test.log b/cmd/bisync/testdata/test_check_access/golden/test.log index d99ef694d0afb..39d7452a7af6e 100644 --- a/cmd/bisync/testdata/test_check_access/golden/test.log +++ b/cmd/bisync/testdata/test_check_access/golden/test.log @@ -5,7 +5,8 @@ (03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful @@ -44,7 +45,8 @@ Bisync error: bisync aborted (12) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful @@ -90,9 +92,8 @@ Bisync error: bisync aborted (23) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : - Path2 Resync will copy to Path1 - RCLONE_TEST -INFO : - Path2 Resync is doing queued copies to - Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_check_access_filters/golden/test.log b/cmd/bisync/testdata/test_check_access_filters/golden/test.log index 9ade7ee1b3d68..cf4fabcbc327e 100644 --- a/cmd/bisync/testdata/test_check_access_filters/golden/test.log +++ b/cmd/bisync/testdata/test_check_access_filters/golden/test.log @@ -10,7 +10,8 @@ INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}exclude-other-filtersfile.txt INFO : Storing filters file hash to {workdir/}exclude-other-filtersfile.txt.md5 INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful @@ -83,7 +84,8 @@ INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}include-other-filtersfile.txt INFO : Storing filters file hash to {workdir/}include-other-filtersfile.txt.md5 INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful @@ -142,8 +144,8 @@ INFO : Path2: 1 changes: 0 new, 0 newer, 0 older, 1 deleted INFO : Checking access health ERROR : Access test failed: Path1 count 3, Path2 count 4 - RCLONE_TEST ERROR : -  Access test failed: Path1 file not found in Path2 - RCLONE_TEST -ERROR : -  Access test failed: Path2 file not found in Path1 - subdirX/subdirX1/RCLONE_TEST ERROR : -  Access test failed: Path2 file not found in Path1 - subdir/RCLONE_TEST +ERROR : -  Access test failed: Path2 file not found in Path1 - subdirX/subdirX1/RCLONE_TEST ERROR : Bisync critical error: check file check failed ERROR : Bisync aborted. Must run --resync to recover. Bisync error: bisync aborted diff --git a/cmd/bisync/testdata/test_check_filename/golden/test.log b/cmd/bisync/testdata/test_check_filename/golden/test.log index c860b6e20e366..b8be8484ac988 100644 --- a/cmd/bisync/testdata/test_check_filename/golden/test.log +++ b/cmd/bisync/testdata/test_check_filename/golden/test.log @@ -5,7 +5,8 @@ (03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful @@ -47,7 +48,8 @@ INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : Checking access health INFO : Found 2 matching ".chk_file" files on both paths -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_check_sync/golden/check-sync-only._testdir_path1.._testdir_path2.path1.lst-new b/cmd/bisync/testdata/test_check_sync/golden/check-sync-only._testdir_path1.._testdir_path2.path1.lst-new index 6af4a00fa097b..4f98654dca5ce 100644 --- a/cmd/bisync/testdata/test_check_sync/golden/check-sync-only._testdir_path1.._testdir_path2.path1.lst-new +++ b/cmd/bisync/testdata/test_check_sync/golden/check-sync-only._testdir_path1.._testdir_path2.path1.lst-new @@ -1,10 +1 @@ # bisync listing v1 from test -- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt" diff --git a/cmd/bisync/testdata/test_check_sync/golden/check-sync-only._testdir_path1.._testdir_path2.path2.lst-new b/cmd/bisync/testdata/test_check_sync/golden/check-sync-only._testdir_path1.._testdir_path2.path2.lst-new index 6af4a00fa097b..4f98654dca5ce 100644 --- a/cmd/bisync/testdata/test_check_sync/golden/check-sync-only._testdir_path1.._testdir_path2.path2.lst-new +++ b/cmd/bisync/testdata/test_check_sync/golden/check-sync-only._testdir_path1.._testdir_path2.path2.lst-new @@ -1,10 +1 @@ # bisync listing v1 from test -- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt" diff --git a/cmd/bisync/testdata/test_check_sync/golden/test.log b/cmd/bisync/testdata/test_check_sync/golden/test.log index 277b45ff3e42b..f971b6d1dccfe 100644 --- a/cmd/bisync/testdata/test_check_sync/golden/test.log +++ b/cmd/bisync/testdata/test_check_sync/golden/test.log @@ -5,7 +5,8 @@ (03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful @@ -44,7 +45,8 @@ Bisync error: bisync aborted (19) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que b/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que deleted file mode 100644 index 4f985e416e189..0000000000000 --- a/cmd/bisync/testdata/test_createemptysrcdirs/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que +++ /dev/null @@ -1 +0,0 @@ -"subdir" diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log b/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log index dd9be0d672c96..45529684465be 100644 --- a/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log +++ b/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log @@ -12,7 +12,8 @@ (10) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful @@ -94,10 +95,8 @@ subdir/ (39) : bisync resync create-empty-src-dirs INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : - Path2 Resync will copy to Path1 - subdir -INFO : - Path2 Resync is doing queued copies to - Path1 -INFO : Resynching Path1 to Path2 -INFO : Resynching Path2 to Path1 (for empty dirs) +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful (40) : list-dirs {path1/} diff --git a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que b/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que deleted file mode 100644 index 53d435fb9094b..0000000000000 --- a/cmd/bisync/testdata/test_dry_run/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que +++ /dev/null @@ -1,3 +0,0 @@ -"file10.txt" -"file4.txt" -"file6.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path1.lst-dry-new b/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path1.lst-dry-new index 8ea562aab97d2..4f98654dca5ce 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path1.lst-dry-new +++ b/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path1.lst-dry-new @@ -1,8 +1 @@ # bisync listing v1 from test -- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file11.txt" -- 13 md5:fb3ecfb2800400fb01b0bfd39903e9fb - 2001-01-02T00:00:00.000000000+0000 "file2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path1.lst-new b/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path1.lst-new index 8ff472b603e97..4f98654dca5ce 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path1.lst-new +++ b/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path1.lst-new @@ -1,9 +1 @@ # bisync listing v1 from test -- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path2.lst-dry-new b/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path2.lst-dry-new index ba1b8daab2073..4f98654dca5ce 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path2.lst-dry-new +++ b/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path2.lst-dry-new @@ -1,8 +1 @@ # bisync listing v1 from test -- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file1.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file10.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file6.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path2.lst-new b/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path2.lst-new index 8ff472b603e97..4f98654dca5ce 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path2.lst-new +++ b/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.path2.lst-new @@ -1,9 +1 @@ # bisync listing v1 from test -- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.resync-copy2to1.que b/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.resync-copy2to1.que deleted file mode 100644 index 53d435fb9094b..0000000000000 --- a/cmd/bisync/testdata/test_dry_run/golden/dryrun-resync._testdir_path1.._testdir_path2.resync-copy2to1.que +++ /dev/null @@ -1,3 +0,0 @@ -"file10.txt" -"file4.txt" -"file6.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path1.lst-new b/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path1.lst-new index 8ff472b603e97..4f98654dca5ce 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path1.lst-new +++ b/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path1.lst-new @@ -1,9 +1 @@ # bisync listing v1 from test -- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path2.lst-new b/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path2.lst-new index 8ff472b603e97..4f98654dca5ce 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path2.lst-new +++ b/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.path2.lst-new @@ -1,9 +1 @@ # bisync listing v1 from test -- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.resync-copy2to1.que b/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.resync-copy2to1.que deleted file mode 100644 index 53d435fb9094b..0000000000000 --- a/cmd/bisync/testdata/test_dry_run/golden/dryrun._testdir_path1.._testdir_path2.resync-copy2to1.que +++ /dev/null @@ -1,3 +0,0 @@ -"file10.txt" -"file4.txt" -"file6.txt" diff --git a/cmd/bisync/testdata/test_dry_run/golden/test.log b/cmd/bisync/testdata/test_dry_run/golden/test.log index f29698f0a2707..83019af70dbaa 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/test.log +++ b/cmd/bisync/testdata/test_dry_run/golden/test.log @@ -5,7 +5,8 @@ (03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful @@ -45,14 +46,11 @@ INFO : Bisync successful (28) : bisync dry-run resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : - Path2 Resync will copy to Path1 - file10.txt -INFO : - Path2 Resync will copy to Path1 - file4.txt -INFO : - Path2 Resync will copy to Path1 - file6.txt -INFO : - Path2 Resync is doing queued copies to - Path1 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 NOTICE: file10.txt: Skipped copy as --dry-run is set (size 19) NOTICE: file4.txt: Skipped copy as --dry-run is set (size 0) NOTICE: file6.txt: Skipped copy as --dry-run is set (size 19) -INFO : Resynching Path1 to Path2 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 NOTICE: file1.txt: Skipped copy as --dry-run is set (size 0) NOTICE: file11.txt: Skipped copy as --dry-run is set (size 19) NOTICE: file2.txt: Skipped copy as --dry-run is set (size 13) diff --git a/cmd/bisync/testdata/test_equal/golden/test.log b/cmd/bisync/testdata/test_equal/golden/test.log index fe32ce71052b2..ced7587dda838 100644 --- a/cmd/bisync/testdata/test_equal/golden/test.log +++ b/cmd/bisync/testdata/test_equal/golden/test.log @@ -5,7 +5,8 @@ (03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_extended_char_paths/golden/check-access-pass._testdir_path1.._testdir_path2.resync-copy2to1.que b/cmd/bisync/testdata/test_extended_char_paths/golden/check-access-pass._testdir_path1.._testdir_path2.resync-copy2to1.que deleted file mode 100644 index 7a6560a8ae6c8..0000000000000 --- a/cmd/bisync/testdata/test_extended_char_paths/golden/check-access-pass._testdir_path1.._testdir_path2.resync-copy2to1.que +++ /dev/null @@ -1 +0,0 @@ -"測試_Русский_ _ _ě_áñ/測試_check file" diff --git "a/cmd/bisync/testdata/test_extended_char_paths/golden/resync._testdir_path1_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.._testdir_path2_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.path1.lst-new" "b/cmd/bisync/testdata/test_extended_char_paths/golden/resync._testdir_path1_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.._testdir_path2_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.path1.lst-new" index d5769bf3da832..4f98654dca5ce 100644 --- "a/cmd/bisync/testdata/test_extended_char_paths/golden/resync._testdir_path1_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.._testdir_path2_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.path1.lst-new" +++ "b/cmd/bisync/testdata/test_extended_char_paths/golden/resync._testdir_path1_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.._testdir_path2_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.path1.lst-new" @@ -1,4 +1 @@ # bisync listing v1 from test -- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "filename_contains_ě_.txt" -- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "filename_contains_ࢺ_.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "測試_check file" diff --git "a/cmd/bisync/testdata/test_extended_char_paths/golden/resync._testdir_path1_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.._testdir_path2_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.path2.lst-new" "b/cmd/bisync/testdata/test_extended_char_paths/golden/resync._testdir_path1_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.._testdir_path2_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.path2.lst-new" index d5769bf3da832..4f98654dca5ce 100644 --- "a/cmd/bisync/testdata/test_extended_char_paths/golden/resync._testdir_path1_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.._testdir_path2_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.path2.lst-new" +++ "b/cmd/bisync/testdata/test_extended_char_paths/golden/resync._testdir_path1_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.._testdir_path2_\346\270\254\350\251\246_\320\240\321\203\321\201\321\201\320\272\320\270\320\271_____\304\233_\303\241\303\261.path2.lst-new" @@ -1,4 +1 @@ # bisync listing v1 from test -- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "filename_contains_ě_.txt" -- 272 md5:0033328434f9662a7dae0d1aee7768b6 - 2000-01-01T00:00:00.000000000+0000 "filename_contains_ࢺ_.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "測試_check file" diff --git a/cmd/bisync/testdata/test_extended_char_paths/golden/test.log b/cmd/bisync/testdata/test_extended_char_paths/golden/test.log index e0ff286c2eafa..6b83d7542d77b 100644 --- a/cmd/bisync/testdata/test_extended_char_paths/golden/test.log +++ b/cmd/bisync/testdata/test_extended_char_paths/golden/test.log @@ -5,7 +5,8 @@ (03) : bisync subdir=測試_Русский_{spc}_{spc}_ě_áñ resync INFO : Synching Path1 "{path1/}測試_Русский_ _ _ě_áñ/" with Path2 "{path2/}測試_Русский_ _ _ě_áñ/" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful (04) : copy-listings resync @@ -40,7 +41,8 @@ INFO : Bisync successful (13) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful (14) : delete-file {path1/}測試_Русский_{spc}_{spc}_ě_áñ/測試_check{spc}file @@ -63,9 +65,8 @@ Bisync error: bisync aborted (18) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : - Path2 Resync will copy to Path1 - 測試_Русский_ _ _ě_áñ/測試_check file -INFO : - Path2 Resync is doing queued copies to - Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful (19) : bisync check-access check-filename=測試_check{spc}file @@ -88,7 +89,8 @@ INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}測試_filtersfile.txt INFO : Storing filters file hash to {workdir/}測試_filtersfile.txt.md5 INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful (24) : copy-as {datadir/}file1.txt {path1/} fileZ.txt diff --git a/cmd/bisync/testdata/test_extended_filenames/golden/test.log b/cmd/bisync/testdata/test_extended_filenames/golden/test.log index 790a722da3c40..61c7b1ad6da98 100644 --- a/cmd/bisync/testdata/test_extended_filenames/golden/test.log +++ b/cmd/bisync/testdata/test_extended_filenames/golden/test.log @@ -5,7 +5,8 @@ (03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_filters/golden/resync._testdir_path1.._testdir_path2.path1.lst-new b/cmd/bisync/testdata/test_filters/golden/resync._testdir_path1.._testdir_path2.path1.lst-new index c3767400b8e8a..4f98654dca5ce 100644 --- a/cmd/bisync/testdata/test_filters/golden/resync._testdir_path1.._testdir_path2.path1.lst-new +++ b/cmd/bisync/testdata/test_filters/golden/resync._testdir_path1.._testdir_path2.path1.lst-new @@ -1,10 +1 @@ # bisync listing v1 from test -- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_filters/golden/resync._testdir_path1.._testdir_path2.path2.lst-new b/cmd/bisync/testdata/test_filters/golden/resync._testdir_path1.._testdir_path2.path2.lst-new index c3767400b8e8a..4f98654dca5ce 100644 --- a/cmd/bisync/testdata/test_filters/golden/resync._testdir_path1.._testdir_path2.path2.lst-new +++ b/cmd/bisync/testdata/test_filters/golden/resync._testdir_path1.._testdir_path2.path2.lst-new @@ -1,10 +1 @@ # bisync listing v1 from test -- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_filters/golden/test.log b/cmd/bisync/testdata/test_filters/golden/test.log index 2821e617b1f7c..1b1af0935446f 100644 --- a/cmd/bisync/testdata/test_filters/golden/test.log +++ b/cmd/bisync/testdata/test_filters/golden/test.log @@ -9,7 +9,8 @@ INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}filtersfile.flt INFO : Storing filters file hash to {workdir/}filtersfile.flt.md5 INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path1.lst-dry-new b/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path1.lst-dry-new index 84468462625ab..4f98654dca5ce 100644 --- a/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path1.lst-dry-new +++ b/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path1.lst-dry-new @@ -1,5 +1 @@ # bisync listing v1 from test -- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path2.lst-dry-new b/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path2.lst-dry-new index 84468462625ab..4f98654dca5ce 100644 --- a/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path2.lst-dry-new +++ b/cmd/bisync/testdata/test_filtersfile_checks/golden/_testdir_path1.._testdir_path2.path2.lst-dry-new @@ -1,5 +1 @@ # bisync listing v1 from test -- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "subdir/file20.txt" diff --git a/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log b/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log index b4494cbdf9255..4685d005e0df6 100644 --- a/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log +++ b/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log @@ -5,7 +5,8 @@ (03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful @@ -33,7 +34,8 @@ INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}filtersfile.txt INFO : Storing filters file hash to {workdir/}filtersfile.txt.md5 INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful @@ -66,7 +68,8 @@ INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}filtersfile.txt INFO : Skipped storing filters file hash to {workdir/}filtersfile.txt.md5 as --dry-run is set INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_ignorelistingchecksum/golden/test.log b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/test.log index 4baad3309fa95..cf2dcd35c382c 100644 --- a/cmd/bisync/testdata/test_ignorelistingchecksum/golden/test.log +++ b/cmd/bisync/testdata/test_ignorelistingchecksum/golden/test.log @@ -5,13 +5,15 @@ (03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful (04) : bisync resync ignore-listing-checksum INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_max_delete_path1/golden/test.log b/cmd/bisync/testdata/test_max_delete_path1/golden/test.log index 83c33ef2d6975..99259ad9225a6 100644 --- a/cmd/bisync/testdata/test_max_delete_path1/golden/test.log +++ b/cmd/bisync/testdata/test_max_delete_path1/golden/test.log @@ -5,7 +5,8 @@ (03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_max_delete_path2_force/golden/test.log b/cmd/bisync/testdata/test_max_delete_path2_force/golden/test.log index 326987c4bd279..b8f91faefa50e 100644 --- a/cmd/bisync/testdata/test_max_delete_path2_force/golden/test.log +++ b/cmd/bisync/testdata/test_max_delete_path2_force/golden/test.log @@ -5,7 +5,8 @@ (03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst index 0cdecd335b0bb..76c15edcdfc7e 100644 --- a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst @@ -1,5 +1,5 @@ # bisync listing v1 from test -- 19 - - 2001-01-05T00:00:00.000000000+0000 "file1.txt" -- 19 - - 2001-01-05T00:00:00.000000000+0000 "folder/HeLlO,wOrLd!.txt" -- 19 - - 2001-01-05T00:00:00.000000000+0000 "folder/éééö.txt" -- 19 - - 2001-01-05T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "file1.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "folder/HeLlO,wOrLd!.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "folder/éééö.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-old index 441434161ed55..0f2ac67fe8abc 100644 --- a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-old +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -1,5 +1,5 @@ # bisync listing v1 from test -- 19 - - 2001-01-03T00:00:00.000000000+0000 "file1.txt" -- 19 - - 2001-01-03T00:00:00.000000000+0000 "folder/HeLlO,wOrLd!.txt" -- 19 - - 2001-01-03T00:00:00.000000000+0000 "folder/éééö.txt" -- 19 - - 2001-01-02T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-03T00:00:00.000000000+0000 "file1.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-03T00:00:00.000000000+0000 "folder/HeLlO,wOrLd!.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-03T00:00:00.000000000+0000 "folder/éééö.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst index f7c2c0ea6db20..48252d18d23aa 100644 --- a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst @@ -1,5 +1,5 @@ # bisync listing v1 from test -- 19 - - 2001-01-05T00:00:00.000000000+0000 "file1.txt" -- 19 - - 2001-01-05T00:00:00.000000000+0000 "folder/hello,WORLD!.txt" -- 19 - - 2001-01-05T00:00:00.000000000+0000 "folder/éééö.txt" -- 19 - - 2001-01-05T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "file1.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "folder/hello,WORLD!.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "folder/éééö.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-old index ab169560115bb..a8c82fc736cf5 100644 --- a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-old +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -1,5 +1,5 @@ # bisync listing v1 from test -- 19 - - 2001-01-03T00:00:00.000000000+0000 "file1.txt" -- 19 - - 2001-01-03T00:00:00.000000000+0000 "folder/hello,WORLD!.txt" -- 19 - - 2001-01-03T00:00:00.000000000+0000 "folder/éééö.txt" -- 19 - - 2001-01-02T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-03T00:00:00.000000000+0000 "file1.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-03T00:00:00.000000000+0000 "folder/hello,WORLD!.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-03T00:00:00.000000000+0000 "folder/éééö.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que deleted file mode 100644 index 007f0aadaa840..0000000000000 --- a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que +++ /dev/null @@ -1,2 +0,0 @@ -"folder/hello,WORLD!.txt" -"folder/éééö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/test.log b/cmd/bisync/testdata/test_normalization/golden/test.log index accd69d143cb7..54045e130ed51 100644 --- a/cmd/bisync/testdata/test_normalization/golden/test.log +++ b/cmd/bisync/testdata/test_normalization/golden/test.log @@ -6,7 +6,8 @@ (04) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful @@ -56,9 +57,8 @@ INFO : Bisync successful (16) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : - Path2 Resync will copy to Path1 - file1.txt -INFO : - Path2 Resync is doing queued copies to - Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful @@ -103,10 +103,8 @@ INFO : Bisync successful (26) : bisync resync norm INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : - Path2 Resync will copy to Path1 - folder/éééö.txt -INFO : - Path2 Resync will copy to Path1 - folder/hello,WORLD!.txt -INFO : - Path2 Resync is doing queued copies to - Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_rclone_args/golden/test.log b/cmd/bisync/testdata/test_rclone_args/golden/test.log index f92ecfe1d8475..e68bd74116f6d 100644 --- a/cmd/bisync/testdata/test_rclone_args/golden/test.log +++ b/cmd/bisync/testdata/test_rclone_args/golden/test.log @@ -5,7 +5,8 @@ (03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_resync/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que b/cmd/bisync/testdata/test_resync/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que deleted file mode 100644 index a5b6f9f63135c..0000000000000 --- a/cmd/bisync/testdata/test_resync/golden/_testdir_path1.._testdir_path2.resync-copy2to1.que +++ /dev/null @@ -1,2 +0,0 @@ -"file2.txt" -"file4.txt" diff --git a/cmd/bisync/testdata/test_resync/golden/empty-path1._testdir_path1.._testdir_path2.path1.lst b/cmd/bisync/testdata/test_resync/golden/empty-path1._testdir_path1.._testdir_path2.path1.lst index a82119a440c1f..8ff472b603e97 100644 --- a/cmd/bisync/testdata/test_resync/golden/empty-path1._testdir_path1.._testdir_path2.path1.lst +++ b/cmd/bisync/testdata/test_resync/golden/empty-path1._testdir_path1.._testdir_path2.path1.lst @@ -1,9 +1,9 @@ # bisync listing v1 from test -- 109 - - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file5.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file6.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file7.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_resync/golden/empty-path1._testdir_path1.._testdir_path2.path2.lst-new b/cmd/bisync/testdata/test_resync/golden/empty-path1._testdir_path1.._testdir_path2.path2.lst-new index 8ff472b603e97..4f98654dca5ce 100644 --- a/cmd/bisync/testdata/test_resync/golden/empty-path1._testdir_path1.._testdir_path2.path2.lst-new +++ b/cmd/bisync/testdata/test_resync/golden/empty-path1._testdir_path1.._testdir_path2.path2.lst-new @@ -1,9 +1 @@ # bisync listing v1 from test -- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_resync/golden/empty-path1._testdir_path1.._testdir_path2.resync-copy2to1.que b/cmd/bisync/testdata/test_resync/golden/empty-path1._testdir_path1.._testdir_path2.resync-copy2to1.que deleted file mode 100644 index e999f575d3e95..0000000000000 --- a/cmd/bisync/testdata/test_resync/golden/empty-path1._testdir_path1.._testdir_path2.resync-copy2to1.que +++ /dev/null @@ -1,8 +0,0 @@ -"RCLONE_TEST" -"file1.txt" -"file2.txt" -"file3.txt" -"file4.txt" -"file5.txt" -"file6.txt" -"file7.txt" diff --git a/cmd/bisync/testdata/test_resync/golden/empty-path2._testdir_path1.._testdir_path2.path1.lst-new b/cmd/bisync/testdata/test_resync/golden/empty-path2._testdir_path1.._testdir_path2.path1.lst-new index 8ff472b603e97..4f98654dca5ce 100644 --- a/cmd/bisync/testdata/test_resync/golden/empty-path2._testdir_path1.._testdir_path2.path1.lst-new +++ b/cmd/bisync/testdata/test_resync/golden/empty-path2._testdir_path1.._testdir_path2.path1.lst-new @@ -1,9 +1 @@ # bisync listing v1 from test -- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_resync/golden/empty-path2._testdir_path1.._testdir_path2.path2.lst b/cmd/bisync/testdata/test_resync/golden/empty-path2._testdir_path1.._testdir_path2.path2.lst index a82119a440c1f..8ff472b603e97 100644 --- a/cmd/bisync/testdata/test_resync/golden/empty-path2._testdir_path1.._testdir_path2.path2.lst +++ b/cmd/bisync/testdata/test_resync/golden/empty-path2._testdir_path1.._testdir_path2.path2.lst @@ -1,9 +1,9 @@ # bisync listing v1 from test -- 109 - - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file5.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file6.txt" -- 0 - - 2000-01-01T00:00:00.000000000+0000 "file7.txt" +- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" +- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_resync/golden/mixed-diffs._testdir_path1.._testdir_path2.path1.lst-new b/cmd/bisync/testdata/test_resync/golden/mixed-diffs._testdir_path1.._testdir_path2.path1.lst-new index 650fcc1a7061f..4f98654dca5ce 100644 --- a/cmd/bisync/testdata/test_resync/golden/mixed-diffs._testdir_path1.._testdir_path2.path1.lst-new +++ b/cmd/bisync/testdata/test_resync/golden/mixed-diffs._testdir_path1.._testdir_path2.path1.lst-new @@ -1,7 +1 @@ # bisync listing v1 from test -- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file5.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 1999-09-09T00:00:00.000000000+0000 "file6.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_resync/golden/mixed-diffs._testdir_path1.._testdir_path2.path2.lst-new b/cmd/bisync/testdata/test_resync/golden/mixed-diffs._testdir_path1.._testdir_path2.path2.lst-new index 26f56859a438f..4f98654dca5ce 100644 --- a/cmd/bisync/testdata/test_resync/golden/mixed-diffs._testdir_path1.._testdir_path2.path2.lst-new +++ b/cmd/bisync/testdata/test_resync/golden/mixed-diffs._testdir_path1.._testdir_path2.path2.lst-new @@ -1,8 +1 @@ # bisync listing v1 from test -- 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2002-02-02T00:00:00.000000000+0000 "file3.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2002-02-02T00:00:00.000000000+0000 "file4.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 1999-09-09T00:00:00.000000000+0000 "file5.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2002-02-02T00:00:00.000000000+0000 "file6.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" diff --git a/cmd/bisync/testdata/test_resync/golden/mixed-diffs._testdir_path1.._testdir_path2.resync-copy2to1.que b/cmd/bisync/testdata/test_resync/golden/mixed-diffs._testdir_path1.._testdir_path2.resync-copy2to1.que deleted file mode 100644 index a5b6f9f63135c..0000000000000 --- a/cmd/bisync/testdata/test_resync/golden/mixed-diffs._testdir_path1.._testdir_path2.resync-copy2to1.que +++ /dev/null @@ -1,2 +0,0 @@ -"file2.txt" -"file4.txt" diff --git a/cmd/bisync/testdata/test_resync/golden/test.log b/cmd/bisync/testdata/test_resync/golden/test.log index 41e84ce5827e4..1ae9daea2ed71 100644 --- a/cmd/bisync/testdata/test_resync/golden/test.log +++ b/cmd/bisync/testdata/test_resync/golden/test.log @@ -6,16 +6,8 @@ (04) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : - Path2 Resync will copy to Path1 - RCLONE_TEST -INFO : - Path2 Resync will copy to Path1 - file1.txt -INFO : - Path2 Resync will copy to Path1 - file2.txt -INFO : - Path2 Resync will copy to Path1 - file3.txt -INFO : - Path2 Resync will copy to Path1 - file4.txt -INFO : - Path2 Resync will copy to Path1 - file5.txt -INFO : - Path2 Resync will copy to Path1 - file6.txt -INFO : - Path2 Resync will copy to Path1 - file7.txt -INFO : - Path2 Resync is doing queued copies to - Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful (05) : move-listings empty-path1 @@ -25,7 +17,8 @@ INFO : Bisync successful (08) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful (09) : move-listings empty-path2 @@ -61,10 +54,8 @@ INFO : Bisync successful (30) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : - Path2 Resync will copy to Path1 - file2.txt -INFO : - Path2 Resync will copy to Path1 - file4.txt -INFO : - Path2 Resync is doing queued copies to - Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful (31) : copy-listings mixed-diffs diff --git a/cmd/bisync/testdata/test_rmdirs/golden/test.log b/cmd/bisync/testdata/test_rmdirs/golden/test.log index 5ea1bacddd680..4094070a951ce 100644 --- a/cmd/bisync/testdata/test_rmdirs/golden/test.log +++ b/cmd/bisync/testdata/test_rmdirs/golden/test.log @@ -5,7 +5,8 @@ (03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful diff --git a/cmd/bisync/testdata/test_volatile/golden/test.log b/cmd/bisync/testdata/test_volatile/golden/test.log index 97fce76aff4e8..8e138c011dfa8 100644 --- a/cmd/bisync/testdata/test_volatile/golden/test.log +++ b/cmd/bisync/testdata/test_volatile/golden/test.log @@ -4,7 +4,8 @@ (03) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 -INFO : Resynching Path1 to Path2 +INFO : - Path2 Resync is copying UNIQUE files to - Path1 +INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful diff --git a/docs/content/bisync.md b/docs/content/bisync.md index 109010827a359..165e73db2396b 100644 --- a/docs/content/bisync.md +++ b/docs/content/bisync.md @@ -13,7 +13,7 @@ versionIntroduced: "v1.58" Make sure that this location is writable. - Run bisync with the `--resync` flag, specifying the paths to the local and remote sync directory roots. -- For successive sync runs, leave off the `--resync` flag. +- For successive sync runs, leave off the `--resync` flag. (**Important!**) - Consider using a [filters file](#filtering) for excluding unnecessary files and directories from the sync. - Consider setting up the [--check-access](#check-access) feature @@ -150,14 +150,8 @@ be copied to Path1, and the process will then copy the Path1 tree to Path2. The `--resync` sequence is roughly equivalent to: ``` -rclone copy Path2 Path1 --ignore-existing -rclone copy Path1 Path2 -``` -Or, if using `--create-empty-src-dirs`: -``` -rclone copy Path2 Path1 --ignore-existing -rclone copy Path1 Path2 --create-empty-src-dirs -rclone copy Path2 Path1 --create-empty-src-dirs +rclone copy Path2 Path1 --ignore-existing [--create-empty-src-dirs] +rclone copy Path1 Path2 [--create-empty-src-dirs] ``` The base directories on both Path1 and Path2 filesystems must exist @@ -169,9 +163,6 @@ will be overwritten by the Path1 filesystem version. (Note that this is [NOT entirely symmetrical](https://github.com/rclone/rclone/issues/5681#issuecomment-938761815).) Carefully evaluate deltas using [--dry-run](/flags/#non-backend-flags). -[//]: # (I reverted a recent change in the above paragraph, as it was incorrect. -https://github.com/rclone/rclone/commit/dd72aff98a46c6e20848ac7ae5f7b19d45802493 ) - For a resync run, one of the paths may be empty (no files in the path tree). The resync run should result in files on both paths, else a normal non-resync run will fail. @@ -181,6 +172,16 @@ For a non-resync run, either path being empty (no files in the tree) fails with This is a safety check that an unexpected empty path does not result in deleting **everything** in the other path. +**Note:** `--resync` should only be used under three specific (rare) circumstances: +1. It is your _first_ bisync run (between these two paths) +2. You've just made changes to your bisync settings (such as editing the contents of your `--filters-file`) +3. There was an error on the prior run, and as a result, bisync now requires `--resync` to recover + +The rest of the time, you should _omit_ `--resync`. The reason is because `--resync` will only _copy_ (not _sync_) each side to the other. +Therefore, if you included `--resync` for every bisync run, it would never be possible to delete a file -- +the deleted file would always keep reappearing at the end of every run (because it's being copied from the other side where it still exists). +Similarly, renaming a file would always result in a duplicate copy (both old and new name) on both sides. + #### --check-access Access check files are an additional safety measure against data loss. @@ -1292,6 +1293,7 @@ about _Unison_ and synchronization in general. * Initial listing snapshots of Path1 and Path2 are now generated concurrently, using the same "march" infrastructure as `check` and `sync`, for performance improvements and less [risk of error](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=4.%20Listings%20should%20alternate%20between%20paths%20to%20minimize%20errors). * Better handling of unicode normalization and case insensitivity, support for [`--fix-case`](/docs/#fix-case), [`--ignore-case-sync`](/docs/#ignore-case-sync), [`--no-unicode-normalization`](/docs/#no-unicode-normalization) +* `--resync` is now much more efficient (especially for users of `--create-empty-src-dirs`) ### `v1.64` * Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Dry%20runs%20are%20not%20completely%20dry) From 58fd6d7b947582971001886ee308af0d2ae0ffc0 Mon Sep 17 00:00:00 2001 From: nielash Date: Wed, 8 Nov 2023 00:46:44 -0500 Subject: [PATCH 118/130] docs: add bisync to index --- README.md | 1 + docs/content/_index.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 0ab837953058c..ddd94d53a0880 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,7 @@ These backends adapt or modify other storage providers * Partial syncs supported on a whole file basis * [Copy](https://rclone.org/commands/rclone_copy/) mode to just copy new/changed files * [Sync](https://rclone.org/commands/rclone_sync/) (one way) mode to make a directory identical + * [Bisync](https://rclone.org/bisync/) (two way) to keep two directories in sync bidirectionally * [Check](https://rclone.org/commands/rclone_check/) mode to check for file hash equality * Can sync to and from network, e.g. two different cloud accounts * Optional large file chunking ([Chunker](https://rclone.org/chunker/)) diff --git a/docs/content/_index.md b/docs/content/_index.md index d44068f7726ae..5068425b31614 100644 --- a/docs/content/_index.md +++ b/docs/content/_index.md @@ -92,6 +92,7 @@ Rclone helps you: - Can use multi-threaded downloads to local disk - [Copy](/commands/rclone_copy/) new or changed files to cloud storage - [Sync](/commands/rclone_sync/) (one way) to make a directory identical +- [Bisync](/bisync/) (two way) to keep two directories in sync bidirectionally - [Move](/commands/rclone_move/) files to cloud storage deleting the local after verification - [Check](/commands/rclone_check/) hashes and for missing/extra files - [Mount](/commands/rclone_mount/) your cloud storage as a network disk From 98f539de8f91192e68f8252ad1641747950570e1 Mon Sep 17 00:00:00 2001 From: nielash Date: Thu, 9 Nov 2023 05:04:33 -0500 Subject: [PATCH 119/130] bisync: refactor normalization code, fix deltas - fixes #7270 Refactored the case / unicode normalization logic to be much more efficient, and fix the last outstanding issue from #7270. Before this change, we were doing lots of for loops and re-normalizing strings we had already normalized earlier. Now, we leave the normalizing entirely to March and avoid re-transforming later, which seems to make a large difference in terms of performance. --- cmd/bisync/bilib/names.go | 24 +++ cmd/bisync/deltas.go | 145 +++++++++++++++--- cmd/bisync/listing.go | 80 ++++------ cmd/bisync/march.go | 4 + cmd/bisync/operations.go | 26 +--- cmd/bisync/queue.go | 45 +++--- ...testdir_path1.._testdir_path2.copy2to1.que | 2 - ...estdir_path1.._testdir_path2.path2.lst-new | 4 +- .../test_normalization/golden/test.log | 42 ++--- .../testdata/test_normalization/scenario.txt | 4 +- docs/content/bisync.md | 19 +-- 11 files changed, 242 insertions(+), 153 deletions(-) diff --git a/cmd/bisync/bilib/names.go b/cmd/bisync/bilib/names.go index 41c4692b5f6b3..3093dff553c69 100644 --- a/cmd/bisync/bilib/names.go +++ b/cmd/bisync/bilib/names.go @@ -59,3 +59,27 @@ func SaveList(list []string, path string) error { } return os.WriteFile(path, buf.Bytes(), PermSecure) } + +// AliasMap comprises a pair of names that are not equal but treated as equal for comparison purposes +// For example, when normalizing unicode and casing +// This helps reduce repeated normalization functions, which really slow things down +type AliasMap map[string]string + +// Add adds new pair to the set, in both directions +func (am AliasMap) Add(name1, name2 string) { + if name1 != name2 { + am[name1] = name2 + am[name2] = name1 + } +} + +// Alias returns the alternate version, if any, else the original. +func (am AliasMap) Alias(name1 string) string { + // note: we don't need to check normalization settings, because we already did it in March. + // the AliasMap will only exist if March paired up two unequal filenames. + name2, ok := am[name1] + if ok { + return name2 + } + return name1 +} diff --git a/cmd/bisync/deltas.go b/cmd/bisync/deltas.go index d0c0cd8aa3532..68fb538c39d06 100644 --- a/cmd/bisync/deltas.go +++ b/cmd/bisync/deltas.go @@ -16,6 +16,7 @@ import ( "github.com/rclone/rclone/fs/accounting" "github.com/rclone/rclone/fs/filter" "github.com/rclone/rclone/fs/operations" + "golang.org/x/text/unicode/norm" ) // delta @@ -240,6 +241,9 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change ctxMove := b.opt.setDryRun(ctx) + // update AliasMap for deleted files, as march does not know about them + b.updateAliases(ctx, ds1, ds2) + // efficient isDir check // we load the listing just once and store only the dirs dirs1, dirs1Err := b.listDirsOnly(1) @@ -270,14 +274,24 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change ctxCheck, filterCheck := filter.AddConfig(ctxNew) for _, file := range ds1.sort() { + alias := b.aliases.Alias(file) d1 := ds1.deltas[file] if d1.is(deltaOther) { - d2 := ds2.deltas[file] + d2, in2 := ds2.deltas[file] + if !in2 && file != alias { + d2 = ds2.deltas[alias] + } if d2.is(deltaOther) { - if err := filterCheck.AddFile(file); err != nil { - fs.Debugf(nil, "Non-critical error adding file to list of potential conflicts to check: %s", err) - } else { - fs.Debugf(nil, "Added file to list of potential conflicts to check: %s", file) + checkit := func(filename string) { + if err := filterCheck.AddFile(filename); err != nil { + fs.Debugf(nil, "Non-critical error adding file to list of potential conflicts to check: %s", err) + } else { + fs.Debugf(nil, "Added file to list of potential conflicts to check: %s", filename) + } + } + checkit(file) + if file != alias { + checkit(alias) } } } @@ -287,12 +301,17 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change matches, err := b.checkconflicts(ctxCheck, filterCheck, b.fs1, b.fs2) for _, file := range ds1.sort() { + alias := b.aliases.Alias(file) p1 := path1 + file - p2 := path2 + file + p2 := path2 + alias d1 := ds1.deltas[file] if d1.is(deltaOther) { d2, in2 := ds2.deltas[file] + // try looking under alternate name + if !in2 && file != alias { + d2, in2 = ds2.deltas[alias] + } if !in2 { b.indent("Path1", p2, "Queue copy to Path2") copy1to2.Add(file) @@ -304,15 +323,26 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change b.indent("!WARNING", file, "New or changed in both paths") //if files are identical, leave them alone instead of renaming - if dirs1.has(file) && dirs2.has(file) { + if (dirs1.has(file) || dirs1.has(alias)) && (dirs2.has(file) || dirs2.has(alias)) { fs.Debugf(nil, "This is a directory, not a file. Skipping equality check and will not rename: %s", file) ls1.getPut(file, skippedDirs1) ls2.getPut(file, skippedDirs2) } else { equal := matches.Has(file) + if !equal { + equal = matches.Has(alias) + } if equal { - fs.Infof(nil, "Files are equal! Skipping: %s", file) - renameSkipped.Add(file) + if ciCheck.FixCase && file != alias { + // the content is equal but filename still needs to be FixCase'd, so copy1to2 + // the Path1 version is deemed "correct" in this scenario + fs.Infof(alias, "Files are equal but will copy anyway to fix case to %s", file) + copy1to2.Add(file) + } else { + fs.Infof(nil, "Files are equal! Skipping: %s", file) + renameSkipped.Add(file) + renameSkipped.Add(alias) + } } else { fs.Debugf(nil, "Files are NOT equal: %s", file) b.indent("!Path1", p1+"..path1", "Renaming Path1 copy") @@ -330,17 +360,17 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change copy1to2.Add(file + "..path1") b.indent("!Path2", p2+"..path2", "Renaming Path2 copy") - if err = operations.MoveFile(ctxMove, b.fs2, b.fs2, file+"..path2", file); err != nil { - err = fmt.Errorf("path2 rename failed for %s: %w", file, err) + if err = operations.MoveFile(ctxMove, b.fs2, b.fs2, alias+"..path2", alias); err != nil { + err = fmt.Errorf("path2 rename failed for %s: %w", alias, err) return } if b.opt.DryRun { - renameSkipped.Add(file) + renameSkipped.Add(alias) } else { - renamed2.Add(file) + renamed2.Add(alias) } b.indent("!Path2", p1+"..path2", "Queue copy to Path1") - copy2to1.Add(file + "..path2") + copy2to1.Add(alias + "..path2") } } handled.Add(file) @@ -348,6 +378,15 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change } else { // Path1 deleted d2, in2 := ds2.deltas[file] + // try looking under alternate name + fs.Debugf(file, "alias: %s, in2: %v", alias, in2) + if !in2 && file != alias { + fs.Debugf(file, "looking for alias: %s", alias) + d2, in2 = ds2.deltas[alias] + if in2 { + fs.Debugf(file, "detected alias: %s", alias) + } + } if !in2 { b.indent("Path2", p2, "Queue delete") delete2.Add(file) @@ -359,15 +398,17 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change } else if d2.is(deltaDeleted) { handled.Add(file) deletedonboth.Add(file) + deletedonboth.Add(alias) } } } for _, file := range ds2.sort() { - p1 := path1 + file + alias := b.aliases.Alias(file) + p1 := path1 + alias d2 := ds2.deltas[file] - if handled.Has(file) { + if handled.Has(file) || handled.Has(alias) { continue } if d2.is(deltaOther) { @@ -381,17 +422,11 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change } } - // find alternate names according to normalization settings - altNames1to2 := bilib.Names{} - altNames2to1 := bilib.Names{} - b.findAltNames(ctx, b.fs1, copy2to1, b.newListing1, altNames2to1) - b.findAltNames(ctx, b.fs2, copy1to2, b.newListing2, altNames1to2) - // Do the batch operation if copy2to1.NotEmpty() { changes1 = true b.indent("Path2", "Path1", "Do queued copies to") - results2to1, err = b.fastCopy(ctx, b.fs2, b.fs1, copy2to1, "copy2to1", altNames2to1) + results2to1, err = b.fastCopy(ctx, b.fs2, b.fs1, copy2to1, "copy2to1") if err != nil { return } @@ -403,7 +438,7 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change if copy1to2.NotEmpty() { changes2 = true b.indent("Path1", "Path2", "Do queued copies to") - results1to2, err = b.fastCopy(ctx, b.fs1, b.fs2, copy1to2, "copy1to2", altNames1to2) + results1to2, err = b.fastCopy(ctx, b.fs1, b.fs2, copy1to2, "copy1to2") if err != nil { return } @@ -458,3 +493,65 @@ func (ds *deltaSet) excessDeletes() bool { maxDelete, ds.deleted, ds.oldCount, ds.msg, quotePath(bilib.FsPath(ds.fs))) return true } + +// normally we build the AliasMap from march results, +// however, march does not know about deleted files, so need to manually check them for aliases +func (b *bisyncRun) updateAliases(ctx context.Context, ds1, ds2 *deltaSet) { + ci := fs.GetConfig(ctx) + // skip if not needed + if ci.NoUnicodeNormalization && !ci.IgnoreCaseSync && !b.fs1.Features().CaseInsensitive && !b.fs2.Features().CaseInsensitive { + return + } + if ds1.deleted < 1 && ds2.deleted < 1 { + return + } + + fs.Debugf(nil, "Updating AliasMap") + + transform := func(s string) string { + if !ci.NoUnicodeNormalization { + s = norm.NFC.String(s) + } + // note: march only checks the dest, but we check both here + if ci.IgnoreCaseSync || b.fs1.Features().CaseInsensitive || b.fs2.Features().CaseInsensitive { + s = strings.ToLower(s) + } + return s + } + + delMap1 := map[string]string{} // [transformedname]originalname + delMap2 := map[string]string{} // [transformedname]originalname + fullMap1 := map[string]string{} // [transformedname]originalname + fullMap2 := map[string]string{} // [transformedname]originalname + + for _, name := range ls1.list { + fullMap1[transform(name)] = name + } + for _, name := range ls2.list { + fullMap2[transform(name)] = name + } + + addDeletes := func(ds *deltaSet, delMap, fullMap map[string]string) { + for _, file := range ds.sort() { + d := ds.deltas[file] + if d.is(deltaDeleted) { + delMap[transform(file)] = file + fullMap[transform(file)] = file + } + } + } + addDeletes(ds1, delMap1, fullMap1) + addDeletes(ds2, delMap2, fullMap2) + + addAliases := func(delMap, fullMap map[string]string) { + for transformedname, name := range delMap { + matchedName, found := fullMap[transformedname] + if found && name != matchedName { + fs.Debugf(name, "adding alias %s", matchedName) + b.aliases.Add(name, matchedName) + } + } + } + addAliases(delMap1, fullMap2) + addAliases(delMap2, fullMap1) +} diff --git a/cmd/bisync/listing.go b/cmd/bisync/listing.go index 70a2aaf5f81a4..5c44101f0139e 100644 --- a/cmd/bisync/listing.go +++ b/cmd/bisync/listing.go @@ -5,6 +5,7 @@ package bisync import ( "bufio" "context" + "errors" "fmt" "io" "os" @@ -20,7 +21,6 @@ import ( "github.com/rclone/rclone/fs/hash" "github.com/rclone/rclone/fs/operations" "golang.org/x/exp/slices" - "golang.org/x/text/unicode/norm" ) // ListingHeader defines first line of a listing @@ -407,18 +407,6 @@ func ConvertPrecision(Modtime time.Time, dst fs.Fs) time.Time { return Modtime } -// ApplyTransforms handles unicode and case normalization -func ApplyTransforms(ctx context.Context, dst fs.Fs, s string) string { - ci := fs.GetConfig(ctx) - if !ci.NoUnicodeNormalization { - s = norm.NFC.String(s) - } - if ci.IgnoreCaseSync || dst.Features().CaseInsensitive { - s = strings.ToLower(s) - } - return s -} - // modifyListing will modify the listing based on the results of the sync func (b *bisyncRun) modifyListing(ctx context.Context, src fs.Fs, dst fs.Fs, results []Results, queues queues, is1to2 bool) (err error) { queue := queues.copy2to1 @@ -448,18 +436,6 @@ func (b *bisyncRun) modifyListing(ctx context.Context, src fs.Fs, dst fs.Fs, res srcList.hash = src.Hashes().GetOne() dstList.hash = dst.Hashes().GetOne() } - dstListNew, err := b.loadListing(dstListing + "-new") - if err != nil { - return fmt.Errorf("cannot read new listing: %w", err) - } - // for resync only, dstListNew will be empty, so need to use results instead - if b.opt.Resync { - for _, result := range results { - if result.Name != "" && result.IsDst { - dstListNew.put(result.Name, result.Size, result.Modtime, result.Hash, "-", result.Flags) - } - } - } srcWinners := newFileList() dstWinners := newFileList() @@ -471,6 +447,10 @@ func (b *bisyncRun) modifyListing(ctx context.Context, src fs.Fs, dst fs.Fs, res continue } + if result.AltName != "" { + b.aliases.Add(result.Name, result.AltName) + } + if result.Flags == "d" && !b.opt.CreateEmptySrcDirs { continue } @@ -496,6 +476,7 @@ func (b *bisyncRun) modifyListing(ctx context.Context, src fs.Fs, dst fs.Fs, res } } + ci := fs.GetConfig(ctx) updateLists := func(side string, winners, list *fileList) { for _, queueFile := range queue.ToList() { if !winners.has(queueFile) && list.has(queueFile) && !errors.has(queueFile) { @@ -506,28 +487,17 @@ func (b *bisyncRun) modifyListing(ctx context.Context, src fs.Fs, dst fs.Fs, res // copies to side new := winners.get(queueFile) - // handle normalization according to settings - ci := fs.GetConfig(ctx) - if side == "dst" && (!ci.NoUnicodeNormalization || ci.IgnoreCaseSync || dst.Features().CaseInsensitive) { - // search list for existing file that matches queueFile when normalized - normalizedName := ApplyTransforms(ctx, dst, queueFile) - matchFound := false - matchedName := "" - for _, filename := range dstListNew.list { - if ApplyTransforms(ctx, dst, filename) == normalizedName { - matchFound = true - matchedName = filename // original, not normalized - break - } - } - if matchFound && matchedName != queueFile { + // handle normalization + if side == "dst" { + alias := b.aliases.Alias(queueFile) + if alias != queueFile { // use the (non-identical) existing name, unless --fix-case if ci.FixCase { - fs.Debugf(direction, "removing %s and adding %s as --fix-case was specified", matchedName, queueFile) - list.remove(matchedName) + fs.Debugf(direction, "removing %s and adding %s as --fix-case was specified", alias, queueFile) + list.remove(alias) } else { - fs.Debugf(direction, "casing/unicode difference detected. using %s instead of %s", matchedName, queueFile) - queueFile = matchedName + fs.Debugf(direction, "casing/unicode difference detected. using %s instead of %s", alias, queueFile) + queueFile = alias } } } @@ -613,6 +583,16 @@ func (b *bisyncRun) modifyListing(ctx context.Context, src fs.Fs, dst fs.Fs, res } if filterRecheck.HaveFilesFrom() { + // also include any aliases + recheckFiles := filterRecheck.Files() + for recheckFile := range recheckFiles { + alias := b.aliases.Alias(recheckFile) + if recheckFile != alias { + if err := filterRecheck.AddFile(alias); err != nil { + fs.Debugf(alias, "error adding file to recheck filter: %v", err) + } + } + } b.recheck(ctxRecheck, src, dst, srcList, dstList, is1to2) } @@ -661,7 +641,7 @@ func (b *bisyncRun) recheck(ctxRecheck context.Context, src, dst fs.Fs, srcList, for _, srcObj := range srcObjs { fs.Debugf(srcObj, "rechecking") for _, dstObj := range dstObjs { - if srcObj.Remote() == dstObj.Remote() { + if srcObj.Remote() == dstObj.Remote() || srcObj.Remote() == b.aliases.Alias(dstObj.Remote()) { if operations.Equal(ctxRecheck, srcObj, dstObj) || b.opt.DryRun { putObj(srcObj, src, srcList) putObj(dstObj, dst, dstList) @@ -673,8 +653,13 @@ func (b *bisyncRun) recheck(ctxRecheck context.Context, src, dst fs.Fs, srcList, } // if srcObj not resolved by now (either because no dstObj match or files not equal), // roll it back to old version, so it gets retried next time. + // skip and error during --resync, as rollback is not possible if !slices.Contains(resolved, srcObj.Remote()) && !b.opt.DryRun { - toRollback = append(toRollback, srcObj.Remote()) + if b.opt.Resync { + b.handleErr(srcObj, "Unable to rollback during --resync", errors.New("no dstObj match or files not equal"), true, false) + } else { + toRollback = append(toRollback, srcObj.Remote()) + } } } if len(toRollback) > 0 { @@ -683,6 +668,9 @@ func (b *bisyncRun) recheck(ctxRecheck context.Context, src, dst fs.Fs, srcList, b.handleErr(oldSrc, "error loading old src listing", err, true, true) oldDst, err := b.loadListing(dstListing + "-old") b.handleErr(oldDst, "error loading old dst listing", err, true, true) + if b.critical { + return + } for _, item := range toRollback { rollback(item, oldSrc, srcList) diff --git a/cmd/bisync/march.go b/cmd/bisync/march.go index 6e8c5bf8198e3..66d8fdb05660a 100644 --- a/cmd/bisync/march.go +++ b/cmd/bisync/march.go @@ -15,6 +15,7 @@ var ls1 = newFileList() var ls2 = newFileList() var err error var firstErr error +var marchAliasLock sync.Mutex var marchLsLock sync.Mutex var marchErrLock sync.Mutex var marchCtx context.Context @@ -77,6 +78,9 @@ func (b *bisyncRun) DstOnly(o fs.DirEntry) (recurse bool) { // Match is called when object exists on both path1 and path2 (whether equal or not) func (b *bisyncRun) Match(ctx context.Context, o2, o1 fs.DirEntry) (recurse bool) { fs.Debugf(o1, "both path1 and path2") + marchAliasLock.Lock() + b.aliases.Add(o1.Remote(), o2.Remote()) + marchAliasLock.Unlock() b.parse(o1, true) b.parse(o2, false) return isDir(o1) diff --git a/cmd/bisync/operations.go b/cmd/bisync/operations.go index 70f7593436a8e..00d879dbc3725 100644 --- a/cmd/bisync/operations.go +++ b/cmd/bisync/operations.go @@ -36,6 +36,7 @@ type bisyncRun struct { listing2 string newListing1 string newListing2 string + aliases bilib.AliasMap opt *Options octx context.Context fctx context.Context @@ -90,6 +91,7 @@ func Bisync(ctx context.Context, fs1, fs2 fs.Fs, optArg *Options) (err error) { b.listing2 = b.basePath + ".path2.lst" b.newListing1 = b.listing1 + "-new" b.newListing2 = b.listing2 + "-new" + b.aliases = bilib.AliasMap{} // Handle lock file lockFile := "" @@ -448,7 +450,7 @@ func (b *bisyncRun) resync(octx, fctx context.Context) error { } fs.Infof(nil, "Resync updating listings") - b.saveOldListings() + b.saveOldListings() // may not exist, as this is --resync b.replaceCurrentListings() resultsToQueue := func(results []Results) bilib.Names { @@ -496,31 +498,15 @@ func (b *bisyncRun) checkSync(listing1, listing2 string) error { return fmt.Errorf("cannot read prior listing of Path2: %w", err) } - transformList := func(files *fileList, fs fs.Fs) *fileList { - transformed := newFileList() - for _, file := range files.list { - f := files.get(file) - transformed.put(ApplyTransforms(b.fctx, fs, file), f.size, f.time, f.hash, f.id, f.flags) - } - return transformed - } - - files1Transformed := transformList(files1, b.fs1) - files2Transformed := transformList(files2, b.fs2) - - // DEBUG - fs.Debugf(nil, "files1Transformed: %v", files1Transformed) - fs.Debugf(nil, "files2Transformed: %v", files2Transformed) - ok := true for _, file := range files1.list { - if !files2.has(file) && !files2Transformed.has(ApplyTransforms(b.fctx, b.fs1, file)) { + if !files2.has(file) && !files2.has(b.aliases.Alias(file)) { b.indent("ERROR", file, "Path1 file not found in Path2") ok = false } } for _, file := range files2.list { - if !files1.has(file) && !files1Transformed.has(ApplyTransforms(b.fctx, b.fs2, file)) { + if !files1.has(file) && !files1.has(b.aliases.Alias(file)) { b.indent("ERROR", file, "Path2 file not found in Path1") ok = false } @@ -580,7 +566,7 @@ func (b *bisyncRun) handleErr(o interface{}, msg string, err error, critical, re b.critical = true fs.Errorf(o, "%s: %v", msg, err) } else { - fs.Debugf(o, "%s: %v", msg, err) + fs.Infof(o, "%s: %v", msg, err) } } } diff --git a/cmd/bisync/queue.go b/cmd/bisync/queue.go index 12bcb9b698d37..f08a82f89a5fc 100644 --- a/cmd/bisync/queue.go +++ b/cmd/bisync/queue.go @@ -22,6 +22,7 @@ type Results struct { Src string Dst string Name string + AltName string Size int64 Modtime time.Time Hash string @@ -58,6 +59,21 @@ func resultName(result Results, side, src, dst fs.DirEntry) string { return "" } +// returns the opposite side's name, only if different +func altName(name string, src, dst fs.DirEntry) string { + if src != nil && dst != nil { + if src.Remote() != dst.Remote() { + switch name { + case src.Remote(): + return dst.Remote() + case dst.Remote(): + return src.Remote() + } + } + } + return "" +} + // WriteResults is Bisync's LoggerFn func WriteResults(ctx context.Context, sigil operations.Sigil, src, dst fs.DirEntry, err error) { lock.Lock() @@ -77,6 +93,7 @@ func WriteResults(ctx context.Context, sigil operations.Sigil, src, dst fs.DirEn for i, side := range fss { result.Name = resultName(result, side, src, dst) + result.AltName = altName(result.Name, src, dst) result.IsSrc = i == 0 result.IsDst = i == 1 result.Flags = "-" @@ -129,7 +146,7 @@ func ReadResults(results io.Reader) []Results { return slice } -func (b *bisyncRun) fastCopy(ctx context.Context, fsrc, fdst fs.Fs, files bilib.Names, queueName string, altNames bilib.Names) ([]Results, error) { +func (b *bisyncRun) fastCopy(ctx context.Context, fsrc, fdst fs.Fs, files bilib.Names, queueName string) ([]Results, error) { if err := b.saveQueue(files, queueName); err != nil { return nil, err } @@ -139,10 +156,9 @@ func (b *bisyncRun) fastCopy(ctx context.Context, fsrc, fdst fs.Fs, files bilib. if err := filterCopy.AddFile(file); err != nil { return nil, err } - } - if altNames.NotEmpty() { - for _, file := range altNames.ToList() { - if err := filterCopy.AddFile(file); err != nil { + alias := b.aliases.Alias(file) + if alias != file { + if err := filterCopy.AddFile(alias); err != nil { return nil, err } } @@ -249,22 +265,3 @@ func (b *bisyncRun) saveQueue(files bilib.Names, jobName string) error { queueFile := fmt.Sprintf("%s.%s.que", b.basePath, jobName) return files.Save(queueFile) } - -func (b *bisyncRun) findAltNames(ctx context.Context, dst fs.Fs, queue bilib.Names, newListing string, altNames bilib.Names) { - ci := fs.GetConfig(ctx) - if queue.NotEmpty() && (!ci.NoUnicodeNormalization || ci.IgnoreCaseSync || b.fs1.Features().CaseInsensitive || b.fs2.Features().CaseInsensitive) { - // search list for existing file that matches queueFile when normalized - for _, queueFile := range queue.ToList() { - normalizedName := ApplyTransforms(ctx, dst, queueFile) - candidates, err := b.loadListing(newListing) - if err != nil { - fs.Errorf(candidates, "cannot read new listing: %v", err) - } - for _, filename := range candidates.list { - if ApplyTransforms(ctx, dst, filename) == normalizedName && filename != queueFile { - altNames.Add(filename) // original, not normalized - } - } - } - } -} diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.copy2to1.que b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.copy2to1.que index 85deec9f9c605..029f3e190ed2c 100644 --- a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.copy2to1.que +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.copy2to1.que @@ -1,3 +1 @@ "file1.txt" -"folder/hello,WORLD!.txt" -"folder/éééö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-new b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-new index 225fe66c1ea7f..9afa4b347deb2 100644 --- a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-new +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-new @@ -1,5 +1,5 @@ # bisync listing v1 from test - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "file1.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "folder/hello,WORLD!.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "folder/éééö.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-03T00:00:00.000000000+0000 "folder/hello,WORLD!.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-03T00:00:00.000000000+0000 "folder/éééö.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/test.log b/cmd/bisync/testdata/test_normalization/golden/test.log index 54045e130ed51..db66b5e75cbbb 100644 --- a/cmd/bisync/testdata/test_normalization/golden/test.log +++ b/cmd/bisync/testdata/test_normalization/golden/test.log @@ -36,16 +36,20 @@ INFO : - Path2 File is new - f INFO : - Path2 File is new - folder/hello,WORLD!.txt INFO : Path2: 3 changes: 2 new, 1 newer, 0 older, 0 deleted INFO : Applying changes -INFO : - Path1 Queue copy to Path2 - {path2/}folder/HeLlO,wOrLd!.txt -INFO : - Path1 Queue copy to Path2 - {path2/}folder/éééö.txt +INFO : Checking potential conflicts... +NOTICE: Local file system at {path2}: 0 differences found +NOTICE: Local file system at {path2}: 2 matching files +INFO : Finished checking the potential conflicts. %!s() +NOTICE: - WARNING New or changed in both paths - folder/HeLlO,wOrLd!.txt +INFO : folder/hello,WORLD!.txt: Files are equal but will copy anyway to fix case to folder/HeLlO,wOrLd!.txt +NOTICE: - WARNING New or changed in both paths - folder/éééö.txt +INFO : folder/éééö.txt: Files are equal but will copy anyway to fix case to folder/éééö.txt INFO : - Path1 Queue copy to Path2 - "{path2/}測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt -INFO : - Path2 Queue copy to Path1 - {path1/}folder/éééö.txt -INFO : - Path2 Queue copy to Path1 - {path1/}folder/hello,WORLD!.txt INFO : - Path2 Do queued copies to - Path1 -INFO : folder/HeLlO,wOrLd!.txt: Fixed case by renaming to: folder/hello,WORLD!.txt -INFO : folder/éééö.txt: Fixed case by renaming to: folder/éééö.txt INFO : - Path1 Do queued copies to - Path2 +INFO : folder/hello,WORLD!.txt: Fixed case by renaming to: folder/HeLlO,wOrLd!.txt +INFO : folder/éééö.txt: Fixed case by renaming to: folder/éééö.txt INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" INFO : Bisync successful @@ -87,12 +91,16 @@ INFO : - Path2 File is new - f INFO : - Path2 File is new - folder/hello,WORLD!.txt INFO : Path2: 3 changes: 2 new, 1 newer, 0 older, 0 deleted INFO : Applying changes -INFO : - Path1 Queue copy to Path2 - {path2/}folder/HeLlO,wOrLd!.txt -INFO : - Path1 Queue copy to Path2 - {path2/}folder/éééö.txt +INFO : Checking potential conflicts... +NOTICE: Local file system at {path2}: 0 differences found +NOTICE: Local file system at {path2}: 2 matching files +INFO : Finished checking the potential conflicts. %!s() +NOTICE: - WARNING New or changed in both paths - folder/HeLlO,wOrLd!.txt +INFO : Files are equal! Skipping: folder/HeLlO,wOrLd!.txt +NOTICE: - WARNING New or changed in both paths - folder/éééö.txt +INFO : Files are equal! Skipping: folder/éééö.txt INFO : - Path1 Queue copy to Path2 - "{path2/}測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt -INFO : - Path2 Queue copy to Path1 - {path1/}folder/éééö.txt -INFO : - Path2 Queue copy to Path1 - {path1/}folder/hello,WORLD!.txt INFO : - Path2 Do queued copies to - Path1 INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings @@ -108,14 +116,12 @@ INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to INFO : Resync updating listings INFO : Bisync successful -(27) : test changed on both paths +(27) : test changed on one path (28) : touch-copy 2001-01-05 {datadir/}file1.txt {path2/} (29) : copy-as-NFC {datadir/}file1.txt {path1/}測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö 測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö.txt (30) : copy-as-NFC {datadir/}file1.txt {path1/}folder éééö.txt (31) : copy-as-NFC {datadir/}file1.txt {path1/}folder HeLlO,wOrLd!.txt -(32) : copy-as-NFD {datadir/}file1.txt {path2/}folder éééö.txt -(33) : copy-as-NFD {datadir/}file1.txt {path2/}folder hello,WORLD!.txt -(34) : bisync norm +(32) : bisync norm INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs @@ -125,16 +131,12 @@ INFO : - Path1 File is newer - " INFO : Path1: 3 changes: 0 new, 3 newer, 0 older, 0 deleted INFO : Path2 checking for diffs INFO : - Path2 File is newer - file1.txt -INFO : - Path2 File is newer - folder/éééö.txt -INFO : - Path2 File is newer - folder/hello,WORLD!.txt -INFO : Path2: 3 changes: 0 new, 3 newer, 0 older, 0 deleted +INFO : Path2: 1 changes: 0 new, 1 newer, 0 older, 0 deleted INFO : Applying changes -INFO : - Path1 Queue copy to Path2 - {path2/}folder/HeLlO,wOrLd!.txt +INFO : - Path1 Queue copy to Path2 - {path2/}folder/hello,WORLD!.txt INFO : - Path1 Queue copy to Path2 - {path2/}folder/éééö.txt INFO : - Path1 Queue copy to Path2 - "{path2/}測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt -INFO : - Path2 Queue copy to Path1 - {path1/}folder/éééö.txt -INFO : - Path2 Queue copy to Path1 - {path1/}folder/hello,WORLD!.txt INFO : - Path2 Do queued copies to - Path1 INFO : - Path1 Do queued copies to - Path2 INFO : Updating listings diff --git a/cmd/bisync/testdata/test_normalization/scenario.txt b/cmd/bisync/testdata/test_normalization/scenario.txt index e44265fd2783f..bc42bbdb5e089 100644 --- a/cmd/bisync/testdata/test_normalization/scenario.txt +++ b/cmd/bisync/testdata/test_normalization/scenario.txt @@ -43,11 +43,9 @@ bisync norm force test resync bisync resync norm -test changed on both paths +test changed on one path touch-copy 2001-01-05 {datadir/}file1.txt {path2/} copy-as-NFC {datadir/}file1.txt {path1/}測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö 測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö.txt copy-as-NFC {datadir/}file1.txt {path1/}folder éééö.txt copy-as-NFC {datadir/}file1.txt {path1/}folder HeLlO,wOrLd!.txt -copy-as-NFD {datadir/}file1.txt {path2/}folder éééö.txt -copy-as-NFD {datadir/}file1.txt {path2/}folder hello,WORLD!.txt bisync norm \ No newline at end of file diff --git a/docs/content/bisync.md b/docs/content/bisync.md index 165e73db2396b..bfde514cd7196 100644 --- a/docs/content/bisync.md +++ b/docs/content/bisync.md @@ -591,17 +591,8 @@ instead of specifying them with command flags. (You can still override them as n ### Case (and unicode) sensitivity {#case-sensitivity} -Synching with **case-insensitive** filesystems, such as Windows or `Box`, -can result in unusual behavior. As of `v1.65`, case and unicode form differences no longer cause critical errors, -however they may cause unexpected delta outcomes, due to the delta engine still being case-sensitive. -This will be fixed in a future release. The near-term workaround is to make sure that files on both sides -don't have spelling case differences (`Smile.jpg` vs. `smile.jpg`). - -The same limitation applies to Unicode normalization forms. -This [particularly applies to macOS](https://github.com/rclone/rclone/issues/7270), -which prefers NFD and sometimes auto-converts filenames from the NFC form used by most other platforms. -This should no longer cause bisync to fail entirely, but may cause surprising delta results, as explained above. - +As of `v1.65`, case and unicode form differences no longer cause critical errors, +and normalization (when comparing between filesystems) is handled according to the same flags and defaults as `rclone sync`. See the following options (all of which are supported by bisync) to control this behavior more granularly: - [`--fix-case`](/docs/#fix-case) - [`--ignore-case-sync`](/docs/#ignore-case-sync) @@ -609,6 +600,10 @@ See the following options (all of which are supported by bisync) to control this - [`--local-unicode-normalization`](/local/#local-unicode-normalization) and [`--local-case-sensitive`](/local/#local-case-sensitive) (caution: these are normally not what you want.) +Note that in the (probably rare) event that `--fix-case` is used AND a file is new/changed on both sides +AND the checksums match AND the filename case does not match, the Path1 filename is considered the winner, +for the purposes of `--fix-case` (Path2 will be renamed to match it). + ## Windows support {#windows} Bisync has been tested on Windows 8.1, Windows 10 Pro 64-bit and on Windows @@ -1292,7 +1287,7 @@ about _Unison_ and synchronization in general. * A few basic terminal colors are now supported, controllable with [`--color`](/docs/#color-when) (`AUTO`|`NEVER`|`ALWAYS`) * Initial listing snapshots of Path1 and Path2 are now generated concurrently, using the same "march" infrastructure as `check` and `sync`, for performance improvements and less [risk of error](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=4.%20Listings%20should%20alternate%20between%20paths%20to%20minimize%20errors). -* Better handling of unicode normalization and case insensitivity, support for [`--fix-case`](/docs/#fix-case), [`--ignore-case-sync`](/docs/#ignore-case-sync), [`--no-unicode-normalization`](/docs/#no-unicode-normalization) +* Fixed handling of unicode normalization and case insensitivity, support for [`--fix-case`](/docs/#fix-case), [`--ignore-case-sync`](/docs/#ignore-case-sync), [`--no-unicode-normalization`](/docs/#no-unicode-normalization) * `--resync` is now much more efficient (especially for users of `--create-empty-src-dirs`) ### `v1.64` From 44637dcd7fe1b4328cc9e6d73966f556c8747562 Mon Sep 17 00:00:00 2001 From: nielash Date: Fri, 10 Nov 2023 22:56:28 -0500 Subject: [PATCH 120/130] bisync: high-level retries if --resilient Before this change, bisync had no ability to retry in the event of sync errors. After this change, bisync will retry if --resilient is passed, but only in one direction at a time. We can safely retry in one direction because the source is still intact, even if the dest was left in a messy state. If the first direction still fails after our final retry, we abort and do NOT continue in the other direction, to prevent the messy dest from polluting the source. If the first direction succeeds, we do then allow retries in the other direction. The number of retries is controllable by --retries (default 3) bisync: high-level retries if --resilient Before this change, bisync had no ability to retry in the event of sync errors. After this change, bisync will retry if --resilient is passed, but only in one direction at a time. We can safely retry in one direction because the source is still intact, even if the dest was left in a messy state. If the first direction still fails after our final retry, we abort and do NOT continue in the other direction, to prevent the messy dest from polluting the source. If the first direction succeeds, we do then allow retries in the other direction. The number of retries is controllable by --retries (default 3) --- cmd/bisync/cmd.go | 3 +++ cmd/bisync/deltas.go | 8 ++++++++ cmd/bisync/queue.go | 11 +++++++++++ 3 files changed, 22 insertions(+) diff --git a/cmd/bisync/cmd.go b/cmd/bisync/cmd.go index c3a2e1e57fea3..54a417cb4ba38 100644 --- a/cmd/bisync/cmd.go +++ b/cmd/bisync/cmd.go @@ -46,6 +46,7 @@ type Options struct { IgnoreListingChecksum bool Resilient bool TestFn TestFunc // test-only option, for mocking errors + Retries int } // Default values @@ -103,6 +104,7 @@ func (x *CheckSyncMode) Type() string { var Opt Options func init() { + Opt.Retries = 3 cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() flags.BoolVarP(cmdFlags, &Opt.Resync, "resync", "1", Opt.Resync, "Performs the resync run. Path1 files may overwrite Path2 versions. Consider using --verbose or --dry-run first.", "") @@ -118,6 +120,7 @@ func init() { flags.BoolVarP(cmdFlags, &Opt.NoCleanup, "no-cleanup", "", Opt.NoCleanup, "Retain working files (useful for troubleshooting and testing).", "") flags.BoolVarP(cmdFlags, &Opt.IgnoreListingChecksum, "ignore-listing-checksum", "", Opt.IgnoreListingChecksum, "Do not use checksums for listings (add --ignore-checksum to additionally skip post-copy checksum checks)", "") flags.BoolVarP(cmdFlags, &Opt.Resilient, "resilient", "", Opt.Resilient, "Allow future runs to retry after certain less-serious errors, instead of requiring --resync. Use at your own risk!", "") + flags.IntVarP(cmdFlags, &Opt.Retries, "retries", "", Opt.Retries, "Retry operations this many times if they fail", "") } // bisync command definition diff --git a/cmd/bisync/deltas.go b/cmd/bisync/deltas.go index 68fb538c39d06..770dac7505d6d 100644 --- a/cmd/bisync/deltas.go +++ b/cmd/bisync/deltas.go @@ -427,6 +427,10 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change changes1 = true b.indent("Path2", "Path1", "Do queued copies to") results2to1, err = b.fastCopy(ctx, b.fs2, b.fs1, copy2to1, "copy2to1") + + // retries, if any + results2to1, err = b.retryFastCopy(ctx, b.fs2, b.fs1, copy2to1, "copy2to1", results2to1, err) + if err != nil { return } @@ -439,6 +443,10 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change changes2 = true b.indent("Path1", "Path2", "Do queued copies to") results1to2, err = b.fastCopy(ctx, b.fs1, b.fs2, copy1to2, "copy1to2") + + // retries, if any + results1to2, err = b.retryFastCopy(ctx, b.fs1, b.fs2, copy1to2, "copy1to2", results1to2, err) + if err != nil { return } diff --git a/cmd/bisync/queue.go b/cmd/bisync/queue.go index f08a82f89a5fc..1c4a56b8ee790 100644 --- a/cmd/bisync/queue.go +++ b/cmd/bisync/queue.go @@ -14,6 +14,7 @@ import ( "github.com/rclone/rclone/fs/filter" "github.com/rclone/rclone/fs/operations" "github.com/rclone/rclone/fs/sync" + "github.com/rclone/rclone/lib/terminal" ) // Results represents a pair of synced files, as reported by the LoggerFn @@ -182,6 +183,16 @@ func (b *bisyncRun) fastCopy(ctx context.Context, fsrc, fdst fs.Fs, files bilib. return getResults, err } +func (b *bisyncRun) retryFastCopy(ctx context.Context, fsrc, fdst fs.Fs, files bilib.Names, queueName string, results []Results, err error) ([]Results, error) { + if err != nil && b.opt.Resilient && b.opt.Retries > 1 { + for tries := 1; tries <= b.opt.Retries; tries++ { + fs.Logf(queueName, Color(terminal.YellowFg, "Received error: %v - retrying as --resilient is set. Retry %d/%d"), err, tries, b.opt.Retries) + results, err = b.fastCopy(ctx, fsrc, fdst, files, queueName) + } + } + return results, err +} + func (b *bisyncRun) resyncDir(ctx context.Context, fsrc, fdst fs.Fs) ([]Results, error) { ignoreListingChecksum = b.opt.IgnoreListingChecksum logger.LoggerFn = WriteResults From 4d5d6ee61b2f59902916b5c103906389b5487167 Mon Sep 17 00:00:00 2001 From: nielash Date: Sat, 11 Nov 2023 00:34:41 -0500 Subject: [PATCH 121/130] bisync: provide more info in critical error msgs --- cmd/bisync/bisync_test.go | 1 + cmd/bisync/operations.go | 16 ++++++++++++++-- .../testdata/test_check_access/golden/test.log | 7 ++++++- .../testdata/test_check_sync/golden/test.log | 7 ++++++- .../test_filtersfile_checks/golden/test.log | 7 ++++++- 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/cmd/bisync/bisync_test.go b/cmd/bisync/bisync_test.go index 185981a2c77b3..d0ce2e2258745 100644 --- a/cmd/bisync/bisync_test.go +++ b/cmd/bisync/bisync_test.go @@ -1231,6 +1231,7 @@ func (b *bisyncTest) newReplacer(mangle bool) *strings.Replacer { "//?/" + strings.TrimSuffix(strings.Replace(b.path2, slash, "/", -1), "/"), "{path2}", strings.TrimSuffix(b.path1, slash), "{path1}", // ensure it's still recognized without trailing slash strings.TrimSuffix(b.path2, slash), "{path2}", + b.workDir, "{workdir}", b.sessionName, "{session}", } if fixSlash { diff --git a/cmd/bisync/operations.go b/cmd/bisync/operations.go index 00d879dbc3725..a49aa64425f71 100644 --- a/cmd/bisync/operations.go +++ b/cmd/bisync/operations.go @@ -98,7 +98,10 @@ func Bisync(ctx context.Context, fs1, fs2 fs.Fs, optArg *Options) (err error) { if !opt.DryRun { lockFile = b.basePath + ".lck" if bilib.FileExists(lockFile) { - return fmt.Errorf("prior lock file found: %s", lockFile) + errTip := Color(terminal.MagentaFg, "Tip: this indicates that another bisync run (of these same paths) either is still running or was interrupted before completion. \n") + errTip += Color(terminal.MagentaFg, "If you're SURE you want to override this safety feature, you can delete the lock file with the following command, then run bisync again: \n") + errTip += fmt.Sprintf(Color(terminal.HiRedFg, "rclone deletefile \"%s\""), lockFile) + return fmt.Errorf(Color(terminal.RedFg, "prior lock file found: %s \n")+errTip, Color(terminal.HiYellowFg, lockFile)) } pidStr := []byte(strconv.Itoa(os.Getpid())) @@ -222,7 +225,13 @@ func (b *bisyncRun) runLocked(octx context.Context) (err error) { // On prior critical error abort, the prior listings are renamed to .lst-err to lock out further runs b.critical = true b.retryable = true - return errors.New("cannot find prior Path1 or Path2 listings, likely due to critical error on prior run") + errTip := Color(terminal.MagentaFg, "Tip: here are the filenames we were looking for. Do they exist? \n") + errTip += fmt.Sprintf(Color(terminal.CyanFg, "Path1: %s\n"), Color(terminal.HiBlueFg, b.listing1)) + errTip += fmt.Sprintf(Color(terminal.CyanFg, "Path2: %s\n"), Color(terminal.HiBlueFg, b.listing2)) + errTip += Color(terminal.MagentaFg, "Try running this command to inspect the work dir: \n") + errTip += fmt.Sprintf(Color(terminal.HiCyanFg, "rclone lsl \"%s\""), b.workDir) + + return errors.New("cannot find prior Path1 or Path2 listings, likely due to critical error on prior run \n" + errTip) } fs.Infof(nil, "Building Path1 and Path2 listings") @@ -526,6 +535,9 @@ func (b *bisyncRun) checkAccess(checkFiles1, checkFiles2 bilib.Names) error { numChecks1 := len(checkFiles1) numChecks2 := len(checkFiles2) if numChecks1 == 0 || numChecks1 != numChecks2 { + if numChecks1 == 0 && numChecks2 == 0 { + fs.Logf("--check-access", Color(terminal.RedFg, "Failed to find any files named %s\n More info: %s"), Color(terminal.CyanFg, opt.CheckFilename), Color(terminal.BlueFg, "https://rclone.org/bisync/#check-access")) + } fs.Errorf(nil, "%s Path1 count %d, Path2 count %d - %s", prefix, numChecks1, numChecks2, opt.CheckFilename) ok = false } diff --git a/cmd/bisync/testdata/test_check_access/golden/test.log b/cmd/bisync/testdata/test_check_access/golden/test.log index 39d7452a7af6e..2b8e6c9822cb3 100644 --- a/cmd/bisync/testdata/test_check_access/golden/test.log +++ b/cmd/bisync/testdata/test_check_access/golden/test.log @@ -83,7 +83,12 @@ Bisync error: bisync aborted (19) : test 6. run again. should fail critical due to missing listings. (20) : bisync check-access INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" -ERROR : Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run +ERROR : Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run +Tip: here are the filenames we were looking for. Do they exist? +Path1: {workdir/}{session}.path1.lst +Path2: {workdir/}{session}.path2.lst +Try running this command to inspect the work dir: +rclone lsl "{workdir}" ERROR : Bisync aborted. Must run --resync to recover. Bisync error: bisync aborted (21) : move-listings missing-listings diff --git a/cmd/bisync/testdata/test_check_sync/golden/test.log b/cmd/bisync/testdata/test_check_sync/golden/test.log index f971b6d1dccfe..edc5c221f3689 100644 --- a/cmd/bisync/testdata/test_check_sync/golden/test.log +++ b/cmd/bisync/testdata/test_check_sync/golden/test.log @@ -32,7 +32,12 @@ Bisync error: bisync aborted (12) : test 4. run normal sync to check that it aborts (13) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" -ERROR : Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run +ERROR : Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run +Tip: here are the filenames we were looking for. Do they exist? +Path1: {workdir/}{session}.path1.lst +Path2: {workdir/}{session}.path2.lst +Try running this command to inspect the work dir: +rclone lsl "{workdir}" ERROR : Bisync aborted. Must run --resync to recover. Bisync error: bisync aborted diff --git a/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log b/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log index 4685d005e0df6..2e099b9f6de56 100644 --- a/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log +++ b/cmd/bisync/testdata/test_filtersfile_checks/golden/test.log @@ -24,7 +24,12 @@ Bisync error: bisync aborted (08) : test 3. run without filters-file. should be blocked due to prior abort. (09) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" -ERROR : Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run +ERROR : Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run +Tip: here are the filenames we were looking for. Do they exist? +Path1: {workdir/}{session}.path1.lst +Path2: {workdir/}{session}.path2.lst +Try running this command to inspect the work dir: +rclone lsl "{workdir}" ERROR : Bisync aborted. Must run --resync to recover. Bisync error: bisync aborted From 9cf783677ed0ac6483bf2b3e7f72734f297dd60e Mon Sep 17 00:00:00 2001 From: nielash Date: Thu, 24 Aug 2023 08:13:02 -0400 Subject: [PATCH 122/130] bisync: support files with unknown length, including Google Docs - fixes #5696 Before this change, bisync intentionally ignored Google Docs (albeit in a buggy way that caused problems during --resync.) After this change, Google Docs (including Google Sheets, Slides, etc.) are now supported in bisync, subject to the same options, defaults, and limitations as in `rclone sync`. When bisyncing drive with non-drive backends, the drive -> non-drive direction is controlled by `--drive-export-formats` (default `"docx,xlsx,pptx,svg"`) and the non-drive -> drive direction is controlled by `--drive-import-formats` (default none.) For example, with the default export/import formats, a Google Sheet on the drive side will be synced to an `.xlsx` file on the non-drive side. In the reverse direction, `.xlsx` files with filenames that match an existing Google Sheet will be synced to that Google Sheet, while `.xlsx` files that do NOT match an existing Google Sheet will be copied to drive as normal `.xlsx` files (without conversion to Sheets, although the Google Drive web browser UI may still give you the option to open it as one.) If `--drive-import-formats` is set (it's not, by default), then all of the specified formats will be converted to Google Docs, if there is no existing Google Doc with a matching name. Caution: such conversion can be quite lossy, and in most cases it's probably not what you want! To bisync Google Docs as URL shortcut links (in a manner similar to "Drive for Desktop"), use: `--drive-export-formats url` (or alternatives.) Note that these link files cannot be edited on the non-drive side -- you will get errors if you try to sync an edited link file back to drive. They CAN be deleted (it will result in deleting the corresponding Google Doc.) If you create a `.url` file on the non-drive side that does not match an existing Google Doc, bisyncing it will just result in copying the literal `.url` file over to drive (no Google Doc will be created.) So, as a general rule of thumb, think of them as read-only placeholders on the non-drive side, and make all your changes on the drive side. Likewise, even with other export-formats, it is best to only move/rename Google Docs on the drive side. This is because otherwise, bisync will interpret this as a file deleted and another created, and accordingly, it will delete the Google Doc and create a new file at the new path. (Whether or not that new file is a Google Doc depends on `--drive-import-formats`.) Lastly, take note that all Google Docs on the drive side have a size of `-1` and no checksum. Therefore, they cannot be reliably synced with the `--checksum` or `--size-only` flags. (To be exact: they will still get created/deleted, and bisync's delta engine will notice changes and queue them for syncing, but the underlying sync function will consider them identical and skip them.) To work around this, use the default (modtime and size) instead of `--checksum` or `--size-only`. To ignore Google Docs entirely, use `--drive-skip-gdocs`. Nearly all of the Google Docs logic is outsourced to the Drive backend, so future changes should also be supported by bisync. --- cmd/bisync/listing.go | 3 +- cmd/bisync/march.go | 3 +- cmd/bisync/operations.go | 3 +- cmd/bisync/queue.go | 12 ++++++- docs/content/bisync.md | 74 +++++++++++++++++++++++++++++++--------- 5 files changed, 71 insertions(+), 24 deletions(-) diff --git a/cmd/bisync/listing.go b/cmd/bisync/listing.go index 5c44101f0139e..313569ed853fc 100644 --- a/cmd/bisync/listing.go +++ b/cmd/bisync/listing.go @@ -36,7 +36,7 @@ const ListingHeader = "# bisync listing v1 from" // id: "-" (reserved) const lineFormat = "%s %8d %s %s %s %q\n" -var lineRegex = regexp.MustCompile(`^(\S) +(\d+) (\S+) (\S+) (\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d{9}[+-]\d{4}) (".+")$`) +var lineRegex = regexp.MustCompile(`^(\S) +(-?\d+) (\S+) (\S+) (\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d{9}[+-]\d{4}) (".+")$`) // timeFormat defines time format used in listings const timeFormat = "2006-01-02T15:04:05.000000000-0700" @@ -237,7 +237,6 @@ func (ls *fileList) save(ctx context.Context, listing string) error { // loadListing will load listing from a file. // The key is the path to the file relative to the Path1/Path2 base. -// File size of -1, as for Google Docs, prints a warning and won't be loaded. func (b *bisyncRun) loadListing(listing string) (*fileList, error) { file, err := os.Open(listing) if err != nil { diff --git a/cmd/bisync/march.go b/cmd/bisync/march.go index 66d8fdb05660a..95f4efeb973c9 100644 --- a/cmd/bisync/march.go +++ b/cmd/bisync/march.go @@ -168,8 +168,7 @@ func (b *bisyncRun) ForDir(o fs.Directory, isPath1 bool) { id := "" // TODO flags := "d" // "-" for a file and "d" for a directory marchLsLock.Lock() - //record size as 0 instead of -1, so bisync doesn't think it's a google doc - ls.put(o.Remote(), 0, time, "", id, flags) + ls.put(o.Remote(), -1, time, "", id, flags) marchLsLock.Unlock() } diff --git a/cmd/bisync/operations.go b/cmd/bisync/operations.go index a49aa64425f71..5d4926c7d010c 100644 --- a/cmd/bisync/operations.go +++ b/cmd/bisync/operations.go @@ -441,8 +441,7 @@ func (b *bisyncRun) resync(octx, fctx context.Context) error { // fctx has our extra filters added! ctxSync, filterSync := filter.AddConfig(ctxRun) if filterSync.Opt.MinSize == -1 { - // prevent overwriting Google Doc files (their size is -1) - filterSync.Opt.MinSize = 0 + fs.Debugf(nil, "filterSync.Opt.MinSize: %v", filterSync.Opt.MinSize) } ci := fs.GetConfig(ctxSync) ci.IgnoreExisting = true diff --git a/cmd/bisync/queue.go b/cmd/bisync/queue.go index 1c4a56b8ee790..a0411253df4e4 100644 --- a/cmd/bisync/queue.go +++ b/cmd/bisync/queue.go @@ -38,7 +38,9 @@ type Results struct { var logger = operations.NewLoggerOpt() var lock mutex.Mutex +var once mutex.Once var ignoreListingChecksum bool +var ci *fs.ConfigInfo // FsPathIfAny handles type assertions and returns a formatted bilib.FsPath if valid, otherwise "" func FsPathIfAny(x fs.DirEntry) string { @@ -121,7 +123,13 @@ func WriteResults(ctx context.Context, sigil operations.Sigil, src, dst fs.DirEn result.Name = dst.Remote() } result.Flags = "d" - result.Size = 0 + result.Size = -1 + } + + if result.Size < 0 && result.Flags != "d" && (ci.CheckSum || ci.SizeOnly) { + once.Do(func() { + fs.Logf(result.Name, Color(terminal.YellowFg, "Files of unknown size (such as Google Docs) do not sync reliably with --checksum or --size-only. Consider using modtime instead (the default) or --drive-skip-gdocs")) + }) } fs.Debugf(nil, "writing result: %v", result) @@ -166,6 +174,7 @@ func (b *bisyncRun) fastCopy(ctx context.Context, fsrc, fdst fs.Fs, files bilib. } ignoreListingChecksum = b.opt.IgnoreListingChecksum + ci = fs.GetConfig(ctx) logger.LoggerFn = WriteResults ctxCopyLogger := operations.WithSyncLogger(ctxCopy, logger) b.testFn() @@ -194,6 +203,7 @@ func (b *bisyncRun) retryFastCopy(ctx context.Context, fsrc, fdst fs.Fs, files b } func (b *bisyncRun) resyncDir(ctx context.Context, fsrc, fdst fs.Fs) ([]Results, error) { + ci = fs.GetConfig(ctx) ignoreListingChecksum = b.opt.IgnoreListingChecksum logger.LoggerFn = WriteResults ctxCopyLogger := operations.WithSyncLogger(ctx, logger) diff --git a/docs/content/bisync.md b/docs/content/bisync.md index bfde514cd7196..67d338287e1d5 100644 --- a/docs/content/bisync.md +++ b/docs/content/bisync.md @@ -883,23 +883,62 @@ files are generating complaints. If the error is consider using the flag [--drive-acknowledge-abuse](/drive/#drive-acknowledge-abuse). -### Google Doc files - -Google docs exist as virtual files on Google Drive and cannot be transferred -to other filesystems natively. While it is possible to export a Google doc to -a normal file (with `.xlsx` extension, for example), it is not possible -to import a normal file back into a Google document. - -Bisync's handling of Google Doc files is to flag them in the run log output -for user's attention and ignore them for any file transfers, deletes, or syncs. -They will show up with a length of `-1` in the listings. -This bisync run is otherwise successful: - -``` -2021/05/11 08:23:15 INFO : Synching Path1 "/path/to/local/tree/base/" with Path2 "GDrive:" -2021/05/11 08:23:15 INFO : ...path2.lst-new: Ignoring incorrect line: "- -1 - - 2018-07-29T08:49:30.136000000+0000 GoogleDoc.docx" -2021/05/11 08:23:15 INFO : Bisync successful -``` +### Google Docs (and other files of unknown size) {#gdocs} + +As of `v1.65`, [Google Docs](/drive/#import-export-of-google-documents) +(including Google Sheets, Slides, etc.) are now supported in bisync, subject to +the same options, defaults, and limitations as in `rclone sync`. When bisyncing +drive with non-drive backends, the drive -> non-drive direction is controlled +by [`--drive-export-formats`](/drive/#drive-export-formats) (default +`"docx,xlsx,pptx,svg"`) and the non-drive -> drive direction is controlled by +[`--drive-import-formats`](/drive/#drive-import-formats) (default none.) + +For example, with the default export/import formats, a Google Sheet on the +drive side will be synced to an `.xlsx` file on the non-drive side. In the +reverse direction, `.xlsx` files with filenames that match an existing Google +Sheet will be synced to that Google Sheet, while `.xlsx` files that do NOT +match an existing Google Sheet will be copied to drive as normal `.xlsx` files +(without conversion to Sheets, although the Google Drive web browser UI may +still give you the option to open it as one.) + +If `--drive-import-formats` is set (it's not, by default), then all of the +specified formats will be converted to Google Docs, if there is no existing +Google Doc with a matching name. Caution: such conversion can be quite lossy, +and in most cases it's probably not what you want! + +To bisync Google Docs as URL shortcut links (in a manner similar to "Drive for +Desktop"), use: `--drive-export-formats url` (or +[alternatives](https://rclone.org/drive/#exportformats:~:text=available%20Google%20Documents.-,Extension,macOS,-Standard%20options).) + +Note that these link files cannot be edited on the non-drive side -- you will +get errors if you try to sync an edited link file back to drive. They CAN be +deleted (it will result in deleting the corresponding Google Doc.) If you +create a `.url` file on the non-drive side that does not match an existing +Google Doc, bisyncing it will just result in copying the literal `.url` file +over to drive (no Google Doc will be created.) So, as a general rule of thumb, +think of them as read-only placeholders on the non-drive side, and make all +your changes on the drive side. + +Likewise, even with other export-formats, it is best to only move/rename Google +Docs on the drive side. This is because otherwise, bisync will interpret this +as a file deleted and another created, and accordingly, it will delete the +Google Doc and create a new file at the new path. (Whether or not that new file +is a Google Doc depends on `--drive-import-formats`.) + +Lastly, take note that all Google Docs on the drive side have a size of `-1` +and no checksum. Therefore, they cannot be reliably synced with the +`--checksum` or `--size-only` flags. (To be exact: they will still get +created/deleted, and bisync's delta engine will notice changes and queue them +for syncing, but the underlying sync function will consider them identical and +skip them.) To work around this, use the default (modtime and size) instead of +`--checksum` or `--size-only`. + +To ignore Google Docs entirely, use +[`--drive-skip-gdocs`](/drive/#drive-skip-gdocs). + +(Note that all flags starting with `--drive` are backend-specific, and +therefore will cause the behavior explained in [Overridden +Configs](/#overridden-configs).) ## Usage examples @@ -1289,6 +1328,7 @@ about _Unison_ and synchronization in general. for performance improvements and less [risk of error](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=4.%20Listings%20should%20alternate%20between%20paths%20to%20minimize%20errors). * Fixed handling of unicode normalization and case insensitivity, support for [`--fix-case`](/docs/#fix-case), [`--ignore-case-sync`](/docs/#ignore-case-sync), [`--no-unicode-normalization`](/docs/#no-unicode-normalization) * `--resync` is now much more efficient (especially for users of `--create-empty-src-dirs`) +* Google Docs (and other files of unknown size) are now supported (with the same options as in `sync`) ### `v1.64` * Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Dry%20runs%20are%20not%20completely%20dry) From bbf9b1b3d212731c477f150dba7d452e5e06e488 Mon Sep 17 00:00:00 2001 From: nielash Date: Sun, 12 Nov 2023 10:34:38 -0500 Subject: [PATCH 123/130] bisync: support two --backup-dir paths on different remotes Before this change, bisync supported `--backup-dir` only when `Path1` and `Path2` were different paths on the same remote. With this change, bisync introduces new `--backup-dir1` and `--backup-dir2` flags to support separate backup-dirs for `Path1` and `Path2`. `--backup-dir1` and `--backup-dir2` can use different remotes from each other, but `--backup-dir1` must use the same remote as `Path1`, and `--backup-dir2` must use the same remote as `Path2`. Each backup directory must not overlap its respective bisync Path without being excluded by a filter rule. The standard `--backup-dir` will also work, if both paths use the same remote (but note that deleted files from both paths would be mixed together in the same dir). If either `--backup-dir1` and `--backup-dir2` are set, they will override `--backup-dir`. --- cmd/bisync/cmd.go | 7 +++++++ cmd/bisync/deltas.go | 4 ++++ cmd/bisync/help.go | 6 ++++-- cmd/bisync/operations.go | 22 ++++++++++++++++++++++ cmd/bisync/rc.go | 6 ++++++ docs/content/bisync.md | 38 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 81 insertions(+), 2 deletions(-) diff --git a/cmd/bisync/cmd.go b/cmd/bisync/cmd.go index 54a417cb4ba38..fafbfaff5506f 100644 --- a/cmd/bisync/cmd.go +++ b/cmd/bisync/cmd.go @@ -40,6 +40,9 @@ type Options struct { Force bool FiltersFile string Workdir string + OrigBackupDir string + BackupDir1 string + BackupDir2 string DryRun bool NoCleanup bool SaveQueues bool // save extra debugging files (test only flag) @@ -107,6 +110,8 @@ func init() { Opt.Retries = 3 cmd.Root.AddCommand(commandDefinition) cmdFlags := commandDefinition.Flags() + // when adding new flags, remember to also update the rc params: + // cmd/bisync/rc.go cmd/bisync/help.go (not docs/content/rc.md) flags.BoolVarP(cmdFlags, &Opt.Resync, "resync", "1", Opt.Resync, "Performs the resync run. Path1 files may overwrite Path2 versions. Consider using --verbose or --dry-run first.", "") flags.BoolVarP(cmdFlags, &Opt.CheckAccess, "check-access", "", Opt.CheckAccess, makeHelp("Ensure expected {CHECKFILE} files are found on both Path1 and Path2 filesystems, else abort."), "") flags.StringVarP(cmdFlags, &Opt.CheckFilename, "check-filename", "", Opt.CheckFilename, makeHelp("Filename for --check-access (default: {CHECKFILE})"), "") @@ -116,6 +121,8 @@ func init() { flags.BoolVarP(cmdFlags, &Opt.RemoveEmptyDirs, "remove-empty-dirs", "", Opt.RemoveEmptyDirs, "Remove ALL empty directories at the final cleanup step.", "") flags.StringVarP(cmdFlags, &Opt.FiltersFile, "filters-file", "", Opt.FiltersFile, "Read filtering patterns from a file", "") flags.StringVarP(cmdFlags, &Opt.Workdir, "workdir", "", Opt.Workdir, makeHelp("Use custom working dir - useful for testing. (default: {WORKDIR})"), "") + flags.StringVarP(cmdFlags, &Opt.BackupDir1, "backup-dir1", "", Opt.BackupDir1, "--backup-dir for Path1. Must be a non-overlapping path on the same remote.", "") + flags.StringVarP(cmdFlags, &Opt.BackupDir2, "backup-dir2", "", Opt.BackupDir2, "--backup-dir for Path2. Must be a non-overlapping path on the same remote.", "") flags.BoolVarP(cmdFlags, &tzLocal, "localtime", "", tzLocal, "Use local time in listings (default: UTC)", "") flags.BoolVarP(cmdFlags, &Opt.NoCleanup, "no-cleanup", "", Opt.NoCleanup, "Retain working files (useful for troubleshooting and testing).", "") flags.BoolVarP(cmdFlags, &Opt.IgnoreListingChecksum, "ignore-listing-checksum", "", Opt.IgnoreListingChecksum, "Do not use checksums for listings (add --ignore-checksum to additionally skip post-copy checksum checks)", "") diff --git a/cmd/bisync/deltas.go b/cmd/bisync/deltas.go index 770dac7505d6d..23a10540f2f1e 100644 --- a/cmd/bisync/deltas.go +++ b/cmd/bisync/deltas.go @@ -346,6 +346,7 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change } else { fs.Debugf(nil, "Files are NOT equal: %s", file) b.indent("!Path1", p1+"..path1", "Renaming Path1 copy") + ctxMove = b.setBackupDir(ctxMove, 1) // in case already a file with new name if err = operations.MoveFile(ctxMove, b.fs1, b.fs1, file+"..path1", file); err != nil { err = fmt.Errorf("path1 rename failed for %s: %w", p1, err) b.critical = true @@ -360,6 +361,7 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change copy1to2.Add(file + "..path1") b.indent("!Path2", p2+"..path2", "Renaming Path2 copy") + ctxMove = b.setBackupDir(ctxMove, 2) // in case already a file with new name if err = operations.MoveFile(ctxMove, b.fs2, b.fs2, alias+"..path2", alias); err != nil { err = fmt.Errorf("path2 rename failed for %s: %w", alias, err) return @@ -426,6 +428,7 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change if copy2to1.NotEmpty() { changes1 = true b.indent("Path2", "Path1", "Do queued copies to") + ctx = b.setBackupDir(ctx, 1) results2to1, err = b.fastCopy(ctx, b.fs2, b.fs1, copy2to1, "copy2to1") // retries, if any @@ -442,6 +445,7 @@ func (b *bisyncRun) applyDeltas(ctx context.Context, ds1, ds2 *deltaSet) (change if copy1to2.NotEmpty() { changes2 = true b.indent("Path1", "Path2", "Do queued copies to") + ctx = b.setBackupDir(ctx, 2) results1to2, err = b.fastCopy(ctx, b.fs1, b.fs2, copy1to2, "copy1to2") // retries, if any diff --git a/cmd/bisync/help.go b/cmd/bisync/help.go index 84e78ab9d9b37..61c944a5928ca 100644 --- a/cmd/bisync/help.go +++ b/cmd/bisync/help.go @@ -10,7 +10,7 @@ func makeHelp(help string) string { "|", "`", "{MAXDELETE}", strconv.Itoa(DefaultMaxDelete), "{CHECKFILE}", DefaultCheckFilename, - "{WORKDIR}", DefaultWorkdir, + // "{WORKDIR}", DefaultWorkdir, ) return replacer.Replace(help) } @@ -37,7 +37,9 @@ var rcHelp = makeHelp(`This takes the following parameters - ignoreListingChecksum - Do not use checksums for listings - resilient - Allow future runs to retry after certain less-serious errors, instead of requiring resync. Use at your own risk! -- workdir - server directory for history files (default: {WORKDIR}) +- workdir - server directory for history files (default: |~/.cache/rclone/bisync|) +- backupdir1 - --backup-dir for Path1. Must be a non-overlapping path on the same remote. +- backupdir2 - --backup-dir for Path2. Must be a non-overlapping path on the same remote. - noCleanup - retain working files See [bisync command help](https://rclone.org/commands/rclone_bisync/) diff --git a/cmd/bisync/operations.go b/cmd/bisync/operations.go index 5d4926c7d010c..d845b4826aec8 100644 --- a/cmd/bisync/operations.go +++ b/cmd/bisync/operations.go @@ -68,6 +68,8 @@ func Bisync(ctx context.Context, fs1, fs2 fs.Fs, optArg *Options) (err error) { if opt.Workdir == "" { opt.Workdir = DefaultWorkdir } + ci := fs.GetConfig(ctx) + opt.OrigBackupDir = ci.BackupDir if !opt.DryRun && !opt.Force { if fs1.Precision() == fs.ModTimeNotSupported { @@ -358,7 +360,9 @@ func (b *bisyncRun) runLocked(octx context.Context) (err error) { // Optional rmdirs for empty directories if opt.RemoveEmptyDirs { fs.Infof(nil, "Removing empty directories") + fctx = b.setBackupDir(fctx, 1) err1 := operations.Rmdirs(fctx, b.fs1, "", true) + fctx = b.setBackupDir(fctx, 2) err2 := operations.Rmdirs(fctx, b.fs2, "", true) err := err1 if err == nil { @@ -445,6 +449,8 @@ func (b *bisyncRun) resync(octx, fctx context.Context) error { } ci := fs.GetConfig(ctxSync) ci.IgnoreExisting = true + ctxSync = b.setBackupDir(ctxSync, 1) + // 2 to 1 if results2to1, err = b.resyncDir(ctxSync, b.fs2, b.fs1); err != nil { b.critical = true return err @@ -452,6 +458,8 @@ func (b *bisyncRun) resync(octx, fctx context.Context) error { b.indent("Path1", "Path2", "Resync is copying UNIQUE OR DIFFERING files to") ci.IgnoreExisting = false + ctxSync = b.setBackupDir(ctxSync, 2) + // 1 to 2 if results1to2, err = b.resyncDir(ctxSync, b.fs1, b.fs2); err != nil { b.critical = true return err @@ -581,3 +589,17 @@ func (b *bisyncRun) handleErr(o interface{}, msg string, err error, critical, re } } } + +// setBackupDir overrides --backup-dir with path-specific version, if set, in each direction +func (b *bisyncRun) setBackupDir(ctx context.Context, destPath int) context.Context { + ci := fs.GetConfig(ctx) + ci.BackupDir = b.opt.OrigBackupDir + if destPath == 1 && b.opt.BackupDir1 != "" { + ci.BackupDir = b.opt.BackupDir1 + } + if destPath == 2 && b.opt.BackupDir2 != "" { + ci.BackupDir = b.opt.BackupDir1 + } + fs.Debugf(ci.BackupDir, "updated backup-dir for Path%d", destPath) + return ctx +} diff --git a/cmd/bisync/rc.go b/cmd/bisync/rc.go index 550be5e381343..c0d36a372c43a 100644 --- a/cmd/bisync/rc.go +++ b/cmd/bisync/rc.go @@ -74,6 +74,12 @@ func rcBisync(ctx context.Context, in rc.Params) (out rc.Params, err error) { if opt.Workdir, err = in.GetString("workdir"); rc.NotErrParamNotFound(err) { return } + if opt.BackupDir1, err = in.GetString("backupdir1"); rc.NotErrParamNotFound(err) { + return + } + if opt.BackupDir2, err = in.GetString("backupdir2"); rc.NotErrParamNotFound(err) { + return + } checkSync, err := in.GetString("checkSync") if rc.NotErrParamNotFound(err) { diff --git a/docs/content/bisync.md b/docs/content/bisync.md index 67d338287e1d5..f3354dc1e8360 100644 --- a/docs/content/bisync.md +++ b/docs/content/bisync.md @@ -105,6 +105,8 @@ Optional Flags: --no-cleanup Retain working files (useful for troubleshooting and testing). --workdir PATH Use custom working directory (useful for testing). (default: `~/.cache/rclone/bisync`) + --backup-dir1 PATH --backup-dir for Path1. Must be a non-overlapping path on the same remote. + --backup-dir2 PATH --backup-dir for Path2. Must be a non-overlapping path on the same remote. -n, --dry-run Go through the motions - No files are copied/deleted. -v, --verbose Increases logging verbosity. May be specified more than once for more details. @@ -357,6 +359,42 @@ Certain more serious errors will still enforce a `--resync` lockout, even in `-- Behavior of `--resilient` may change in a future version. +#### --backup-dir1 and --backup-dir2 + +As of `v1.65`, [`--backup-dir`](/docs/#backup-dir-dir) is supported in bisync. +Because `--backup-dir` must be a non-overlapping path on the same remote, +Bisync has introduced new `--backup-dir1` and `--backup-dir2` flags to support +separate backup-dirs for `Path1` and `Path2` (bisyncing between different +remotes with `--backup-dir` would not otherwise be possible.) `--backup-dir1` +and `--backup-dir2` can use different remotes from each other, but +`--backup-dir1` must use the same remote as `Path1`, and `--backup-dir2` must +use the same remote as `Path2`. Each backup directory must not overlap its +respective bisync Path without being excluded by a filter rule. + +The standard `--backup-dir` will also work, if both paths use the same remote +(but note that deleted files from both paths would be mixed together in the +same dir). If either `--backup-dir1` and `--backup-dir2` are set, they will +override `--backup-dir`. + +Example: +``` +rclone bisync /Users/someuser/some/local/path/Bisync gdrive:Bisync --backup-dir1 /Users/someuser/some/local/path/BackupDir --backup-dir2 gdrive:BackupDir --suffix -2023-08-26 --suffix-keep-extension --check-access --max-delete 10 --filters-file /Users/someuser/some/local/path/bisync_filters.txt --no-cleanup --ignore-listing-checksum --checkers=16 --drive-pacer-min-sleep=10ms --create-empty-src-dirs --resilient -MvP --drive-skip-gdocs --fix-case +``` + +In this example, if the user deletes a file in +`/Users/someuser/some/local/path/Bisync`, bisync will propagate the delete to +the other side by moving the corresponding file from `gdrive:Bisync` to +`gdrive:BackupDir`. If the user deletes a file from `gdrive:Bisync`, bisync +moves it from `/Users/someuser/some/local/path/Bisync` to +`/Users/someuser/some/local/path/BackupDir`. + +In the event of a `..path1` / `..path2` rename due to a sync conflict, the +rename is not considered a delete, unless a previous conflict with the same +name already exists and would get overwritten. + +See also: [`--suffix`](/docs/#suffix-suffix), +[`--suffix-keep-extension`](/docs/#suffix-keep-extension) + ## Operation ### Runtime flow details From 7f854acb0569644f6bab69e550ab6d8e3d281763 Mon Sep 17 00:00:00 2001 From: nielash Date: Wed, 15 Nov 2023 15:12:45 -0500 Subject: [PATCH 124/130] local: fix cleanRootPath on Windows after go1.21.4 stdlib update Similar to https://github.com/rclone/rclone/commit/acf1e2df84a350b7a86d7672d749dfb1ba090a44, go1.21.4 appears to have broken sync.MoveDir on Windows because filepath.VolumeName() returns `\\?` instead of `\\?\C:` in cleanRootPath. It looks like the Go team is aware of the issue and planning a fix, so this may only be needed temporarily. --- backend/local/local.go | 4 ++++ fs/sync/sync_test.go | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/backend/local/local.go b/backend/local/local.go index c444267f150a9..832390d5a569e 100644 --- a/backend/local/local.go +++ b/backend/local/local.go @@ -1447,6 +1447,10 @@ func cleanRootPath(s string, noUNC bool, enc encoder.MultiEncoder) string { if runtime.GOOS == "windows" { s = filepath.ToSlash(s) vol := filepath.VolumeName(s) + if vol == `\\?` && len(s) >= 6 { + // `\\?\C:` + vol = s[:6] + } s = vol + enc.FromStandardPath(s[len(vol):]) s = filepath.FromSlash(s) if !noUNC { diff --git a/fs/sync/sync_test.go b/fs/sync/sync_test.go index 34085ee6e90e6..7911be1d0f907 100644 --- a/fs/sync/sync_test.go +++ b/fs/sync/sync_test.go @@ -1351,6 +1351,22 @@ func testServerSideMove(ctx context.Context, t *testing.T, r *fstest.Run, withFi } } +// Test MoveDir on Local +func TestServerSideMoveLocal(t *testing.T) { + ctx := context.Background() + r := fstest.NewRun(t) + f1 := r.WriteFile("dir1/file1.txt", "hello", t1) + f2 := r.WriteFile("dir2/file2.txt", "hello again", t2) + r.CheckLocalItems(t, f1, f2) + + dir1, err := fs.NewFs(ctx, r.Flocal.Root()+"/dir1") + require.NoError(t, err) + dir2, err := fs.NewFs(ctx, r.Flocal.Root()+"/dir2") + require.NoError(t, err) + err = MoveDir(ctx, dir2, dir1, false, false) + require.NoError(t, err) +} + // Test move func TestMoveWithDeleteEmptySrcDirs(t *testing.T) { ctx := context.Background() From 422b0370870324f6bc1be5a08f9e7b0da355fa1b Mon Sep 17 00:00:00 2001 From: nielash Date: Tue, 21 Nov 2023 17:43:17 -0500 Subject: [PATCH 125/130] bisync: fallback to cryptcheck or --download when can't check hash Bisync checks file equality before renaming sync conflicts by comparing checksums. Before this change, backends without checksum support (notably Crypt) would fall back to --size-only for these checks, which is not a very safe method (differing files can sometimes have the same size, especially if they're small.) After this change, Crypt remotes fallback to using Cryptcheck so that checksums can be compared. As a last resort when neither Check nor Cryptcheck are available, files are compared using --download so that we can be certain the files are identical regardless of checksum support. --- cmd/bisync/checkfn.go | 191 ++++++++++++++++++ cmd/bisync/deltas.go | 44 ---- cmd/bisync/listing.go | 6 +- ...estdir_path1.._testdir_path2.path1.lst-old | 4 +- ...estdir_path1.._testdir_path2.path2.lst-new | 4 +- ...estdir_path1.._testdir_path2.path2.lst-old | 4 +- docs/content/bisync.md | 2 + 7 files changed, 203 insertions(+), 52 deletions(-) create mode 100644 cmd/bisync/checkfn.go diff --git a/cmd/bisync/checkfn.go b/cmd/bisync/checkfn.go new file mode 100644 index 0000000000000..cc462772b0c1c --- /dev/null +++ b/cmd/bisync/checkfn.go @@ -0,0 +1,191 @@ +package bisync + +import ( + "bytes" + "context" + "fmt" + "strings" + + "github.com/rclone/rclone/backend/crypt" + "github.com/rclone/rclone/cmd/bisync/bilib" + "github.com/rclone/rclone/cmd/check" + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/accounting" + "github.com/rclone/rclone/fs/filter" + "github.com/rclone/rclone/fs/hash" + "github.com/rclone/rclone/fs/operations" +) + +var hashType hash.Type +var fsrc, fdst fs.Fs +var fcrypt *crypt.Fs + +// WhichCheck determines which CheckFn we should use based on the Fs types +// It is more robust and accurate than Check because +// it will fallback to CryptCheck or DownloadCheck instead of --size-only! +// it returns the *operations.CheckOpt with the CheckFn set. +func WhichCheck(ctx context.Context, opt *operations.CheckOpt) *operations.CheckOpt { + ci := fs.GetConfig(ctx) + common := opt.Fsrc.Hashes().Overlap(opt.Fdst.Hashes()) + + // note that ci.IgnoreChecksum doesn't change the behavior of Check -- it's just a way to opt-out of cryptcheck/download + if common.Count() > 0 || ci.SizeOnly || ci.IgnoreChecksum { + // use normal check + opt.Check = CheckFn + return opt + } + + FsrcCrypt, srcIsCrypt := opt.Fsrc.(*crypt.Fs) + FdstCrypt, dstIsCrypt := opt.Fdst.(*crypt.Fs) + + if (srcIsCrypt && dstIsCrypt) || (!srcIsCrypt && dstIsCrypt) { + // if both are crypt or only dst is crypt + hashType = FdstCrypt.UnWrap().Hashes().GetOne() + if hashType != hash.None { + // use cryptcheck + fsrc = opt.Fsrc + fdst = opt.Fdst + fcrypt = FdstCrypt + fs.Infof(fdst, "Crypt detected! Using cryptcheck instead of check. (Use --size-only or --ignore-checksum to disable)") + opt.Check = CryptCheckFn + return opt + } + } else if srcIsCrypt && !dstIsCrypt { + // if only src is crypt + hashType = FsrcCrypt.UnWrap().Hashes().GetOne() + if hashType != hash.None { + // use reverse cryptcheck + fsrc = opt.Fdst + fdst = opt.Fsrc + fcrypt = FsrcCrypt + fs.Infof(fdst, "Crypt detected! Using cryptcheck instead of check. (Use --size-only or --ignore-checksum to disable)") + opt.Check = ReverseCryptCheckFn + return opt + } + } + + // if we've gotten this far, niether check or cryptcheck will work, so use --download + fs.Infof(fdst, "Can't compare hashes, so using check --download for safety. (Use --size-only or --ignore-checksum to disable)") + opt.Check = DownloadCheckFn + return opt +} + +// CheckFn is a slightly modified version of Check +func CheckFn(ctx context.Context, dst, src fs.Object) (differ bool, noHash bool, err error) { + same, ht, err := operations.CheckHashes(ctx, src, dst) + if err != nil { + return true, false, err + } + if ht == hash.None { + return false, true, nil + } + if !same { + err = fmt.Errorf("%v differ", ht) + fs.Errorf(src, "%v", err) + return true, false, nil + } + return false, false, nil +} + +// CryptCheckFn is a slightly modified version of CryptCheck +func CryptCheckFn(ctx context.Context, dst, src fs.Object) (differ bool, noHash bool, err error) { + cryptDst := dst.(*crypt.Object) + underlyingDst := cryptDst.UnWrap() + underlyingHash, err := underlyingDst.Hash(ctx, hashType) + if err != nil { + return true, false, fmt.Errorf("error reading hash from underlying %v: %w", underlyingDst, err) + } + if underlyingHash == "" { + return false, true, nil + } + cryptHash, err := fcrypt.ComputeHash(ctx, cryptDst, src, hashType) + if err != nil { + return true, false, fmt.Errorf("error computing hash: %w", err) + } + if cryptHash == "" { + return false, true, nil + } + if cryptHash != underlyingHash { + err = fmt.Errorf("hashes differ (%s:%s) %q vs (%s:%s) %q", fdst.Name(), fdst.Root(), cryptHash, fsrc.Name(), fsrc.Root(), underlyingHash) + fs.Errorf(src, err.Error()) + return true, false, nil + } + return false, false, nil +} + +// ReverseCryptCheckFn is like CryptCheckFn except src and dst are switched +// result: src is crypt, dst is non-crypt +func ReverseCryptCheckFn(ctx context.Context, dst, src fs.Object) (differ bool, noHash bool, err error) { + return CryptCheckFn(ctx, src, dst) +} + +// DownloadCheckFn is a slightly modified version of Check with --download +func DownloadCheckFn(ctx context.Context, a, b fs.Object) (differ bool, noHash bool, err error) { + differ, err = operations.CheckIdenticalDownload(ctx, a, b) + if err != nil { + return true, true, fmt.Errorf("failed to download: %w", err) + } + return differ, false, nil +} + +// check potential conflicts (to avoid renaming if already identical) +func (b *bisyncRun) checkconflicts(ctxCheck context.Context, filterCheck *filter.Filter, fs1, fs2 fs.Fs) (bilib.Names, error) { + matches := bilib.Names{} + if filterCheck.HaveFilesFrom() { + fs.Debugf(nil, "There are potential conflicts to check.") + + opt, close, checkopterr := check.GetCheckOpt(b.fs1, b.fs2) + if checkopterr != nil { + b.critical = true + b.retryable = true + fs.Debugf(nil, "GetCheckOpt error: %v", checkopterr) + return matches, checkopterr + } + defer close() + + opt.Match = new(bytes.Buffer) + + opt = WhichCheck(ctxCheck, opt) + + fs.Infof(nil, "Checking potential conflicts...") + check := operations.CheckFn(ctxCheck, opt) + fs.Infof(nil, "Finished checking the potential conflicts. %s", check) + + //reset error count, because we don't want to count check errors as bisync errors + accounting.Stats(ctxCheck).ResetErrors() + + //return the list of identical files to check against later + if len(fmt.Sprint(opt.Match)) > 0 { + matches = bilib.ToNames(strings.Split(fmt.Sprint(opt.Match), "\n")) + } + if matches.NotEmpty() { + fs.Debugf(nil, "The following potential conflicts were determined to be identical. %v", matches) + } else { + fs.Debugf(nil, "None of the conflicts were determined to be identical.") + } + + } + return matches, nil +} + +// WhichEqual is similar to WhichCheck, but checks a single object. +// Returns true if the objects are equal, false if they differ or if we don't know +func WhichEqual(ctx context.Context, src, dst fs.Object, Fsrc, Fdst fs.Fs) bool { + opt, close, checkopterr := check.GetCheckOpt(Fsrc, Fdst) + if checkopterr != nil { + fs.Debugf(nil, "GetCheckOpt error: %v", checkopterr) + } + defer close() + + opt = WhichCheck(ctx, opt) + differ, noHash, err := opt.Check(ctx, dst, src) + if err != nil { + fs.Errorf(src, "failed to check: %v", err) + return false + } + if noHash { + fs.Errorf(src, "failed to check as hash is missing") + return false + } + return !differ +} diff --git a/cmd/bisync/deltas.go b/cmd/bisync/deltas.go index 23a10540f2f1e..d441ca404304b 100644 --- a/cmd/bisync/deltas.go +++ b/cmd/bisync/deltas.go @@ -3,7 +3,6 @@ package bisync import ( - "bytes" "context" "fmt" "path/filepath" @@ -11,9 +10,7 @@ import ( "strings" "github.com/rclone/rclone/cmd/bisync/bilib" - "github.com/rclone/rclone/cmd/check" "github.com/rclone/rclone/fs" - "github.com/rclone/rclone/fs/accounting" "github.com/rclone/rclone/fs/filter" "github.com/rclone/rclone/fs/operations" "golang.org/x/text/unicode/norm" @@ -96,47 +93,6 @@ func (ds *deltaSet) printStats() { ds.msg, nAll, nNew, nNewer, nOlder, nDeleted) } -// check potential conflicts (to avoid renaming if already identical) -func (b *bisyncRun) checkconflicts(ctxCheck context.Context, filterCheck *filter.Filter, fs1, fs2 fs.Fs) (bilib.Names, error) { - matches := bilib.Names{} - if filterCheck.HaveFilesFrom() { - fs.Debugf(nil, "There are potential conflicts to check.") - - opt, close, checkopterr := check.GetCheckOpt(b.fs1, b.fs2) - if checkopterr != nil { - b.critical = true - b.retryable = true - fs.Debugf(nil, "GetCheckOpt error: %v", checkopterr) - return matches, checkopterr - } - defer close() - - opt.Match = new(bytes.Buffer) - - // TODO: consider using custom CheckFn to act like cryptcheck, if either fs is a crypt remote and -c has been passed - // note that cryptCheck() is not currently exported - - fs.Infof(nil, "Checking potential conflicts...") - check := operations.Check(ctxCheck, opt) - fs.Infof(nil, "Finished checking the potential conflicts. %s", check) - - //reset error count, because we don't want to count check errors as bisync errors - accounting.Stats(ctxCheck).ResetErrors() - - //return the list of identical files to check against later - if len(fmt.Sprint(opt.Match)) > 0 { - matches = bilib.ToNames(strings.Split(fmt.Sprint(opt.Match), "\n")) - } - if matches.NotEmpty() { - fs.Debugf(nil, "The following potential conflicts were determined to be identical. %v", matches) - } else { - fs.Debugf(nil, "None of the conflicts were determined to be identical.") - } - - } - return matches, nil -} - // findDeltas func (b *bisyncRun) findDeltas(fctx context.Context, f fs.Fs, oldListing string, now *fileList, msg string) (ds *deltaSet, err error) { var old *fileList diff --git a/cmd/bisync/listing.go b/cmd/bisync/listing.go index 313569ed853fc..20f2fa00b6158 100644 --- a/cmd/bisync/listing.go +++ b/cmd/bisync/listing.go @@ -641,7 +641,8 @@ func (b *bisyncRun) recheck(ctxRecheck context.Context, src, dst fs.Fs, srcList, fs.Debugf(srcObj, "rechecking") for _, dstObj := range dstObjs { if srcObj.Remote() == dstObj.Remote() || srcObj.Remote() == b.aliases.Alias(dstObj.Remote()) { - if operations.Equal(ctxRecheck, srcObj, dstObj) || b.opt.DryRun { + // note: unlike Equal(), WhichEqual() does not update the modtime in dest if sums match but modtimes don't. + if b.opt.DryRun || WhichEqual(ctxRecheck, srcObj, dstObj, src, dst) { putObj(srcObj, src, srcList) putObj(dstObj, dst, dstList) resolved = append(resolved, srcObj.Remote()) @@ -655,7 +656,8 @@ func (b *bisyncRun) recheck(ctxRecheck context.Context, src, dst fs.Fs, srcList, // skip and error during --resync, as rollback is not possible if !slices.Contains(resolved, srcObj.Remote()) && !b.opt.DryRun { if b.opt.Resync { - b.handleErr(srcObj, "Unable to rollback during --resync", errors.New("no dstObj match or files not equal"), true, false) + err = errors.New("no dstObj match or files not equal") + b.handleErr(srcObj, "Unable to rollback during --resync", err, true, false) } else { toRollback = append(toRollback, srcObj.Remote()) } diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-old index 0f2ac67fe8abc..6815fa4ee3a8b 100644 --- a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-old +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -1,5 +1,5 @@ # bisync listing v1 from test - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-03T00:00:00.000000000+0000 "file1.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-03T00:00:00.000000000+0000 "folder/HeLlO,wOrLd!.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-03T00:00:00.000000000+0000 "folder/éééö.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "folder/HeLlO,wOrLd!.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "folder/éééö.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-new b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-new index 9afa4b347deb2..6f843cfa932f6 100644 --- a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-new +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-new @@ -1,5 +1,5 @@ # bisync listing v1 from test - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "file1.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-03T00:00:00.000000000+0000 "folder/hello,WORLD!.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-03T00:00:00.000000000+0000 "folder/éééö.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "folder/hello,WORLD!.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "folder/éééö.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-old index a8c82fc736cf5..ed2547754b132 100644 --- a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-old +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -1,5 +1,5 @@ # bisync listing v1 from test - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-03T00:00:00.000000000+0000 "file1.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-03T00:00:00.000000000+0000 "folder/hello,WORLD!.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-03T00:00:00.000000000+0000 "folder/éééö.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "folder/hello,WORLD!.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "folder/éééö.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" diff --git a/docs/content/bisync.md b/docs/content/bisync.md index f3354dc1e8360..947128feed143 100644 --- a/docs/content/bisync.md +++ b/docs/content/bisync.md @@ -1367,6 +1367,8 @@ for performance improvements and less [risk of error](https://forum.rclone.org/t * Fixed handling of unicode normalization and case insensitivity, support for [`--fix-case`](/docs/#fix-case), [`--ignore-case-sync`](/docs/#ignore-case-sync), [`--no-unicode-normalization`](/docs/#no-unicode-normalization) * `--resync` is now much more efficient (especially for users of `--create-empty-src-dirs`) * Google Docs (and other files of unknown size) are now supported (with the same options as in `sync`) +* Equality checks before a sync conflict rename now fall back to `cryptcheck` (when possible) or `--download`, +instead of of `--size-only`, when `check` is not available. ### `v1.64` * Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Dry%20runs%20are%20not%20completely%20dry) From 7c6f0cc455f5136e20ffc3c36400e3eb95b6a361 Mon Sep 17 00:00:00 2001 From: nielash Date: Mon, 20 Nov 2023 11:04:54 -0500 Subject: [PATCH 126/130] operations: fix renaming a file on macOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this change, a file would sometimes be silently deleted instead of renamed on macOS, due to its unique handling of unicode normalization. Rclone already had a SameObject check in place for case insensitivity before deleting the source (for example if "hello.txt" was renamed to "HELLO.txt"), but had no such check for unicode normalization. After this change, the delete is skipped on macOS if the src and dst filenames normalize to the same NFC string. Example of the previous behavior: ~ % rclone touch /Users/nielash/rename_test/ö ~ % rclone lsl /Users/nielash/rename_test/ö 0 2023-11-21 17:28:06.170486000 ö ~ % rclone moveto /Users/nielash/rename_test/ö /Users/nielash/rename_test/ö -vv 2023/11/21 17:28:51 DEBUG : rclone: Version "v1.64.0" starting with parameters ["rclone" "moveto" "/Users/nielash/rename_test/ö" "/Users/nielash/rename_test/ö" "-vv"] 2023/11/21 17:28:51 DEBUG : Creating backend with remote "/Users/nielash/rename_test/ö" 2023/11/21 17:28:51 DEBUG : Using config file from "/Users/nielash/.config/rclone/rclone.conf" 2023/11/21 17:28:51 DEBUG : fs cache: adding new entry for parent of "/Users/nielash/rename_test/ö", "/Users/nielash/rename_test" 2023/11/21 17:28:51 DEBUG : Creating backend with remote "/Users/nielash/rename_test/" 2023/11/21 17:28:51 DEBUG : fs cache: renaming cache item "/Users/nielash/rename_test/" to be canonical "/Users/nielash/rename_test" 2023/11/21 17:28:51 DEBUG : ö: Size and modification time the same (differ by 0s, within tolerance 1ns) 2023/11/21 17:28:51 DEBUG : ö: Unchanged skipping 2023/11/21 17:28:51 INFO : ö: Deleted 2023/11/21 17:28:51 INFO : Transferred: 0 B / 0 B, -, 0 B/s, ETA - Checks: 1 / 1, 100% Deleted: 1 (files), 0 (dirs) Elapsed time: 0.0s 2023/11/21 17:28:51 DEBUG : 5 go routines active ~ % rclone lsl /Users/nielash/rename_test/ ~ % --- fs/operations/operations.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/fs/operations/operations.go b/fs/operations/operations.go index b71e6adc52288..8772f0d6a6ba9 100644 --- a/fs/operations/operations.go +++ b/fs/operations/operations.go @@ -16,6 +16,7 @@ import ( "os" "path" "path/filepath" + "runtime" "sort" "strconv" "strings" @@ -37,6 +38,7 @@ import ( "github.com/rclone/rclone/lib/random" "github.com/rclone/rclone/lib/readers" "golang.org/x/sync/errgroup" + "golang.org/x/text/unicode/norm" ) // CheckHashes checks the two files to see if they have common @@ -328,6 +330,11 @@ func SameObject(src, dst fs.Object) bool { } srcPath := path.Join(srcFs.Root(), src.Remote()) dstPath := path.Join(dstFs.Root(), dst.Remote()) + if srcFs.Features().IsLocal && dstFs.Features().IsLocal && runtime.GOOS == "darwin" { + if norm.NFC.String(srcPath) == norm.NFC.String(dstPath) { + return true + } + } if dst.Fs().Features().CaseInsensitive { srcPath = strings.ToLower(srcPath) dstPath = strings.ToLower(dstPath) @@ -1565,7 +1572,7 @@ func NeedTransfer(ctx context.Context, dst, src fs.Object) bool { } } else { // Check to see if changed or not - if Equal(ctx, src, dst) { + if Equal(ctx, src, dst) && !SameObject(src, dst) { fs.Debugf(src, "Unchanged skipping") return false } @@ -1847,7 +1854,7 @@ func moveOrCopyFile(ctx context.Context, fdst fs.Fs, fsrc fs.Fs, dstFileName str if ci.IgnoreExisting { fs.Debugf(srcObj, "Not removing source file as destination file exists and --ignore-existing is set") logger(ctx, Match, srcObj, dstObj, nil) - } else { + } else if !SameObject(srcObj, dstObj) { err = DeleteFile(ctx, srcObj) logger(ctx, Differ, srcObj, dstObj, nil) } From 57624629d6b43177846fd64b3e252d1ad364bec4 Mon Sep 17 00:00:00 2001 From: nielash Date: Fri, 17 Nov 2023 12:14:38 -0500 Subject: [PATCH 127/130] bisync: account for differences in backend features on integration tests - see #5679 Before this change, integration tests often could not be run on backends with differing features from the local system that goldenized them. In particular, differences in modtime precision, checksum support, and encoding would cause false positives. After this change, the tests more accurately account for the features of the backend being tested, which allows us to see true positives more clearly, and more meaningfully assess whether a backend is supported. --- cmd/bisync/bisync_test.go | 271 ++++++++++++++++-- cmd/bisync/checkfn.go | 3 + cmd/bisync/log.go | 6 + .../testdata/test_changes/golden/test.log | 4 +- .../test_createemptysrcdirs/golden/test.log | 14 +- .../testdata/test_dry_run/golden/test.log | 8 +- .../testdata/test_equal/golden/test.log | 6 +- .../test_extended_char_paths/golden/test.log | 59 ++-- .../test_extended_char_paths/scenario.txt | 12 + .../test_extended_filenames/golden/test.log | 66 +++-- .../test_extended_filenames/scenario.txt | 11 + ...testdir_path1.._testdir_path2.copy1to2.que | 2 +- .../_testdir_path1.._testdir_path2.path1.lst | 4 +- ...estdir_path1.._testdir_path2.path1.lst-new | 4 +- ...estdir_path1.._testdir_path2.path1.lst-old | 4 +- .../_testdir_path1.._testdir_path2.path2.lst | 4 +- ...estdir_path1.._testdir_path2.path2.lst-new | 4 +- ...estdir_path1.._testdir_path2.path2.lst-old | 4 +- .../test_normalization/golden/test.log | 58 ++-- .../testdata/test_normalization/scenario.txt | 9 +- .../testdata/test_rmdirs/golden/test.log | 4 +- .../_testdir_path1.._testdir_path2.path1.lst | 198 ++++++------- ...estdir_path1.._testdir_path2.path1.lst-new | 198 ++++++------- ...estdir_path1.._testdir_path2.path1.lst-old | 198 ++++++------- .../_testdir_path1.._testdir_path2.path2.lst | 198 ++++++------- ...estdir_path1.._testdir_path2.path2.lst-new | 198 ++++++------- ...estdir_path1.._testdir_path2.path2.lst-old | 198 ++++++------- .../testdata/test_volatile/golden/test.log | 73 +++-- .../testdata/test_volatile/scenario.txt | 1 + 29 files changed, 1064 insertions(+), 755 deletions(-) diff --git a/cmd/bisync/bisync_test.go b/cmd/bisync/bisync_test.go index d0ce2e2258745..42130ca262c49 100644 --- a/cmd/bisync/bisync_test.go +++ b/cmd/bisync/bisync_test.go @@ -21,6 +21,7 @@ import ( "strings" "testing" "time" + "unicode/utf8" "github.com/rclone/rclone/cmd/bisync" "github.com/rclone/rclone/cmd/bisync/bilib" @@ -29,11 +30,13 @@ import ( "github.com/rclone/rclone/fs/cache" "github.com/rclone/rclone/fs/filter" "github.com/rclone/rclone/fs/fspath" + "github.com/rclone/rclone/fs/hash" "github.com/rclone/rclone/fs/object" "github.com/rclone/rclone/fs/operations" "github.com/rclone/rclone/fs/sync" "github.com/rclone/rclone/fstest" "github.com/rclone/rclone/lib/atexit" + "github.com/rclone/rclone/lib/encoder" "github.com/rclone/rclone/lib/random" "github.com/rclone/rclone/lib/terminal" "golang.org/x/text/unicode/norm" @@ -73,6 +76,10 @@ var logReplacements = []string{ `^NOTICE: too_many_(requests|write_operations)/\.*: Too many requests or write operations.*$`, dropMe, `^NOTICE: Dropbox root .*?: Forced to upload files to set modification times on this backend.$`, dropMe, `^INFO : .*?: src and dst identical but can't set mod time without deleting and re-uploading$`, dropMe, + // ignore crypt info messages + `^INFO : .*?: Crypt detected! Using cryptcheck instead of check. \(Use --size-only or --ignore-checksum to disable\)$`, dropMe, + // ignore drive info messages + `^NOTICE:.*?Files of unknown size \(such as Google Docs\) do not sync reliably with --checksum or --size-only\. Consider using modtime instead \(the default\) or --drive-skip-gdocs.*?$`, dropMe, } // Some dry-run messages differ depending on the particular remote. @@ -110,7 +117,7 @@ var logHoppers = []string{ // Some log lines can contain Windows path separator that must be // converted to "/" in every matching token to match golden logs. var logLinesWithSlash = []string{ - `.*\(\d\d\) :.*(touch-glob|touch-copy|copy-file|copy-as|copy-dir|delete-file) `, + `.*\(\d\d\) :.*(fix-names|touch-glob|touch-copy|copy-file|copy-as|copy-dir|delete-file) `, `INFO : - .*Path[12].* +.*Queue copy to Path[12].*`, `INFO : Synching Path1 .*? with Path2 `, `INFO : Validating listings for `, @@ -476,17 +483,19 @@ func (b *bisyncTest) runTestStep(ctx context.Context, line string) (err error) { } testFunc := func() { - testname := "volatile" - path := "path1" - src := filepath.Join(b.tempDir, testname, path, "file7.txt") - dstBase1 := filepath.Join(b.tempDir, testname, "path1", "file") - dstBase2 := filepath.Join(b.tempDir, testname, "path2", "file") + src := filepath.Join(b.dataDir, "file7.txt") for i := 0; i < 50; i++ { - dst := dstBase2 + fmt.Sprint(i) + ".txt" - _ = bilib.CopyFile(src, dst) - dst = dstBase1 + fmt.Sprint(100-i) + ".txt" - _ = bilib.CopyFile(src, dst) + dst := "file" + fmt.Sprint(i) + ".txt" + err := b.copyFile(ctx, src, b.path2, dst) + if err != nil { + fs.Errorf(src, "error copying file: %v", err) + } + dst = "file" + fmt.Sprint(100-i) + ".txt" + err = b.copyFile(ctx, src, b.path1, dst) + if err != nil { + fs.Errorf(dst, "error copying file: %v", err) + } } } @@ -506,7 +515,12 @@ func (b *bisyncTest) runTestStep(ctx context.Context, line string) (err error) { if fsrc, err = fs.NewFs(ctx, args[1]); err != nil { return err } - return purgeChildren(ctx, fsrc, "") + err = purgeChildren(ctx, fsrc, "") + if err != nil { + return err + } + flushCache(fsrc) + return case "delete-file": b.checkArgs(args, 1, 1) dir, file := filepath.Split(args[1]) @@ -576,7 +590,10 @@ func (b *bisyncTest) runTestStep(ctx context.Context, line string) (err error) { return err case "list-dirs": b.checkArgs(args, 1, 1) - return b.listSubdirs(ctx, args[1]) + return b.listSubdirs(ctx, args[1], true) + case "list-files": + b.checkArgs(args, 1, 1) + return b.listSubdirs(ctx, args[1], false) case "bisync": ci.NoUnicodeNormalization = false ci.IgnoreCaseSync = false @@ -585,6 +602,119 @@ func (b *bisyncTest) runTestStep(ctx context.Context, line string) (err error) { case "test-func": b.TestFn = testFunc return + case "fix-names": + // in case the local os converted any filenames + ci.NoUnicodeNormalization = true + ci.FixCase = true + ci.IgnoreTimes = true + reset := func() { + ci.NoUnicodeNormalization = false + ci.FixCase = false + ci.IgnoreTimes = false + } + defer reset() + b.checkArgs(args, 1, 1) + var ok bool + var remoteName string + var remotePath string + remoteName, remotePath, err = fspath.SplitFs(args[1]) + if err != nil { + return err + } + if remoteName == "" { + remoteName = "/" + } + + fsrc, err = fs.NewFs(ctx, remoteName) + if err != nil { + return err + } + + // DEBUG + fs.Debugf(remotePath, "is NFC: %v", norm.NFC.IsNormalString(remotePath)) + fs.Debugf(remotePath, "is NFD: %v", norm.NFD.IsNormalString(remotePath)) + fs.Debugf(remotePath, "is valid UTF8: %v", utf8.ValidString(remotePath)) + + // check if it's a dir, try moving it + var leaf string + _, leaf, err = fspath.Split(remotePath) + if err == nil && leaf == "" { + remotePath = args[1] + fs.Debugf(remotePath, "attempting to fix directory") + + fixDirname := func(old, new string) { + if new != old { + oldName, err := fs.NewFs(ctx, old) + if err != nil { + fs.Logf(old, "error getting Fs: %v", err) + } + fs.Debugf(nil, "Attempting to move %s to %s", oldName.Root(), new) + // Create random name to temporarily move dir to + tmpDirName := strings.TrimSuffix(new, slash) + "-rclone-move-" + random.String(8) + var tmpDirFs fs.Fs + tmpDirFs, _ = fs.NewFs(ctx, tmpDirName) + err = sync.MoveDir(ctx, tmpDirFs, oldName, true, true) + if err != nil { + fs.Debugf(oldName, "error attempting to move folder: %v", err) + } + // now move the temp dir to real name + fsrc, _ = fs.NewFs(ctx, new) + err = sync.MoveDir(ctx, fsrc, tmpDirFs, true, true) + if err != nil { + fs.Debugf(tmpDirFs, "error attempting to move folder to %s: %v", fsrc.Root(), err) + } + } else { + fs.Debugf(nil, "old and new are equal. Skipping. %s (%s) %s (%s)", old, stringToHash(old), new, stringToHash(new)) + } + } + + if norm.NFC.String(remotePath) != remotePath && norm.NFD.String(remotePath) != remotePath { + fs.Debugf(remotePath, "This is neither fully NFD or NFC -- can't fix reliably!") + } + fixDirname(norm.NFC.String(remotePath), remotePath) + fixDirname(norm.NFD.String(remotePath), remotePath) + return + } + + // if it's a file + fs.Debugf(remotePath, "attempting to fix file -- filename hash: %s", stringToHash(leaf)) + fixFilename := func(old, new string) { + ok, err := fs.FileExists(ctx, fsrc, old) + if err != nil { + fs.Debugf(remotePath, "error checking if file exists: %v", err) + } + fs.Debugf(old, "file exists: %v %s", ok, stringToHash(old)) + fs.Debugf(nil, "FILE old: %s new: %s equal: %v", old, new, old == new) + fs.Debugf(nil, "HASH old: %s new: %s equal: %v", stringToHash(old), stringToHash(new), stringToHash(old) == stringToHash(new)) + if ok && new != old { + fs.Debugf(new, "attempting to rename %s to %s", old, new) + err = operations.MoveFile(ctx, fsrc, fsrc, new, old) + if err != nil { + fs.Errorf(new, "error trying to rename %s to %s - %v", old, new, err) + } + } + } + + // look for NFC version + fixFilename(norm.NFC.String(remotePath), remotePath) + // if it's in a subdir we just moved, the file and directory might have different encodings. Check for that. + mixed := strings.TrimSuffix(norm.NFD.String(remotePath), norm.NFD.String(leaf)) + norm.NFC.String(leaf) + fixFilename(mixed, remotePath) + // Try NFD + fixFilename(norm.NFD.String(remotePath), remotePath) + // Try mixed in reverse + mixed = strings.TrimSuffix(norm.NFC.String(remotePath), norm.NFC.String(leaf)) + norm.NFD.String(leaf) + fixFilename(mixed, remotePath) + // check if it's right now, error if not + ok, err = fs.FileExists(ctx, fsrc, remotePath) + if !ok || err != nil { + fs.Logf(remotePath, "Can't find expected file %s (was it renamed by the os?) %v", args[1], err) + return + } else { + // include hash of filename to make unicode form differences easier to see in logs + fs.Debugf(remotePath, "verified file exists at correct path. filename hash: %s", stringToHash(leaf)) + } + return default: return fmt.Errorf("unknown command: %q", args[0]) } @@ -626,6 +756,13 @@ func (b *bisyncTest) checkArgs(args []string, min, max int) { } } +func flushCache(f fs.Fs) { + dirCacheFlush := f.Features().DirCacheFlush + if dirCacheFlush == nil { + fs.Errorf(nil, "%v: can't flush dir cache", f) + } +} + func (b *bisyncTest) runBisync(ctx context.Context, args []string) (err error) { opt := &bisync.Options{ Workdir: b.workDir, @@ -639,6 +776,10 @@ func (b *bisyncTest) runBisync(ctx context.Context, args []string) (err error) { octx, ci := fs.AddConfig(ctx) fs1, fs2 := b.fs1, b.fs2 + // flush cache + flushCache(fs1) + flushCache(fs2) + addSubdir := func(path, subdir string) fs.Fs { remote := path + subdir f, err := fs.NewFs(ctx, remote) @@ -747,7 +888,7 @@ func (b *bisyncTest) copyFile(ctx context.Context, src, dst, asName string) (err var fsrc, fdst fs.Fs var srcPath, srcFile, dstPath, dstFile string - switch fsrc, err = cache.Get(ctx, src); err { + switch fsrc, err = fs.NewFs(ctx, src); err { case fs.ErrorIsFile: // ok case nil: @@ -770,7 +911,7 @@ func (b *bisyncTest) copyFile(ctx context.Context, src, dst, asName string) (err if dstFile != "" { dstPath = dst // force directory } - if fdst, err = cache.Get(ctx, dstPath); err != nil { + if fdst, err = fs.NewFs(ctx, dstPath); err != nil { return err } @@ -787,23 +928,27 @@ func (b *bisyncTest) copyFile(ctx context.Context, src, dst, asName string) (err return operations.CopyFile(fctx, fdst, fsrc, dstFile, srcFile) } -// listSubdirs is equivalent to `rclone lsf -R --dirs-only` -func (b *bisyncTest) listSubdirs(ctx context.Context, remote string) error { +// listSubdirs is equivalent to `rclone lsf -R [--dirs-only]` +func (b *bisyncTest) listSubdirs(ctx context.Context, remote string, DirsOnly bool) error { f, err := fs.NewFs(ctx, remote) if err != nil { return err } + + // flush cache + flushCache(f) + opt := operations.ListJSONOpt{ NoModTime: true, NoMimeType: true, - DirsOnly: true, + DirsOnly: DirsOnly, Recurse: true, } fmt := operations.ListFormat{} fmt.SetDirSlash(true) fmt.AddPath() printItem := func(item *operations.ListJSONItem) error { - b.logPrintf("%s", fmt.Format(item)) + b.logPrintf("%s - filename hash: %s", fmt.Format(item), stringToHash(item.Name)) return nil } return operations.ListJSON(ctx, f, "", &opt, printItem) @@ -1058,9 +1203,12 @@ func (b *bisyncTest) mangleResult(dir, file string, golden bool) string { case "queue": lines := strings.Split(text, eol) sort.Strings(lines) + for i, line := range lines { + lines[i] = normalizeEncoding(line) + } return joinLines(lines) case "listing": - return mangleListing(text, golden) + return b.mangleListing(text, golden, file) case "log": // fall thru default: @@ -1068,7 +1216,16 @@ func (b *bisyncTest) mangleResult(dir, file string, golden bool) string { } // Adapt log lines to the golden way. - lines := strings.Split(string(buf), eol) + // First replace filenames with whitespace + // some backends (such as crypt) log them on multiple lines due to encoding differences, while others (local) do not + wsrep := []string{ + "subdir with" + eol + "white space.txt/file2 with" + eol + "white space.txt", + "subdir with white space.txt/file2 with white space.txt", + } + whitespaceJoiner := strings.NewReplacer(wsrep...) + s := whitespaceJoiner.Replace(string(buf)) + + lines := strings.Split(s, eol) pathReplacer := b.newReplacer(true) rep := logReplacements @@ -1152,7 +1309,7 @@ func (b *bisyncTest) mangleResult(dir, file string, golden bool) string { } // mangleListing sorts listing lines before comparing. -func mangleListing(text string, golden bool) string { +func (b *bisyncTest) mangleListing(text string, golden bool, file string) string { lines := strings.Split(text, eol) hasHeader := len(lines) > 0 && strings.HasPrefix(lines[0], bisync.ListingHeader) @@ -1176,12 +1333,43 @@ func mangleListing(text string, golden bool) string { return getFile(lines[i]) < getFile(lines[j]) }) - // Store hash as golden but ignore when comparing. + // parse whether this is Path1 or Path2 (so we can apply per-Fs precision/hash settings) + isPath1 := strings.Contains(file, ".path1.lst") + f := b.fs2 + if isPath1 { + f = b.fs1 + } + + // account for differences in backend features when comparing if !golden { for i, s := range lines { + // Store hash as golden but ignore when comparing (only if no md5 support). match := regex.FindStringSubmatch(strings.TrimSpace(s)) - if match != nil && match[2] != "-" { - lines[i] = match[1] + "-" + match[3] + match[4] + if match != nil && match[2] != "-" && (!b.fs1.Hashes().Contains(hash.MD5) || !b.fs2.Hashes().Contains(hash.MD5)) { // if hash is not empty and either side lacks md5 + lines[i] = match[1] + "-" + match[3] + match[4] // replace it with "-" for comparison purposes (see #5679) + } + // account for modtime precision + var lineRegex = regexp.MustCompile(`^(\S) +(-?\d+) (\S+) (\S+) (\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d{9}[+-]\d{4}) (".+")$`) + const timeFormat = "2006-01-02T15:04:05.000000000-0700" + const lineFormat = "%s %8d %s %s %s %q\n" + var TZ = time.UTC + fields := lineRegex.FindStringSubmatch(strings.TrimSuffix(lines[i], "\n")) + if fields != nil { + sizeVal, sizeErr := strconv.ParseInt(fields[2], 10, 64) + if sizeErr == nil { + // account for filename encoding differences by normalizing to OS encoding + fields[6] = normalizeEncoding(fields[6]) + timeStr := fields[5] + if f.Precision() == fs.ModTimeNotSupported { + lines[i] = fmt.Sprintf(lineFormat, fields[1], sizeVal, fields[3], fields[4], "-", fields[6]) + continue + } + timeVal, timeErr := time.ParseInLocation(timeFormat, timeStr, TZ) + if timeErr == nil { + timeRound := timeVal.Round(f.Precision() * 2) + lines[i] = fmt.Sprintf(lineFormat, fields[1], sizeVal, fields[3], fields[4], timeRound, fields[6]) + } + } } } } @@ -1225,6 +1413,8 @@ func (b *bisyncTest) newReplacer(mangle bool) *strings.Replacer { b.dataDir + slash, "{datadir/}", b.testDir + slash, "{testdir/}", b.workDir + slash, "{workdir/}", + b.fs1.String(), "{path1String}", + b.fs2.String(), "{path2String}", b.path1, "{path1/}", b.path2, "{path2/}", "//?/" + strings.TrimSuffix(strings.Replace(b.path1, slash, "/", -1), "/"), "{path1}", // fix windows-specific issue @@ -1335,3 +1525,36 @@ func (b *bisyncTest) logPrintf(text string, args ...interface{}) { require.NoError(b.t, err, "writing log file") } } + +// account for filename encoding differences between remotes by normalizing to OS encoding +func normalizeEncoding(s string) string { + if s == "" || s == "." { + return s + } + nameVal, err := strconv.Unquote(s) + if err != nil { + nameVal = s + } + nameVal = filepath.Clean(nameVal) + nameVal = encoder.OS.FromStandardPath(nameVal) + return strconv.Quote(encoder.OS.ToStandardPath(filepath.ToSlash(nameVal))) +} + +func stringToHash(s string) string { + ht := hash.MD5 + hasher, err := hash.NewMultiHasherTypes(hash.NewHashSet(ht)) + if err != nil { + fs.Errorf(s, "hash unsupported: %v", err) + } + + _, err = hasher.Write([]byte(s)) + if err != nil { + fs.Errorf(s, "failed to write to hasher: %v", err) + } + + sum, err := hasher.SumString(ht, false) + if err != nil { + fs.Errorf(s, "hasher returned an error: %v", err) + } + return sum +} diff --git a/cmd/bisync/checkfn.go b/cmd/bisync/checkfn.go index cc462772b0c1c..a097ec55984d1 100644 --- a/cmd/bisync/checkfn.go +++ b/cmd/bisync/checkfn.go @@ -107,6 +107,9 @@ func CryptCheckFn(ctx context.Context, dst, src fs.Object) (differ bool, noHash } if cryptHash != underlyingHash { err = fmt.Errorf("hashes differ (%s:%s) %q vs (%s:%s) %q", fdst.Name(), fdst.Root(), cryptHash, fsrc.Name(), fsrc.Root(), underlyingHash) + fs.Debugf(src, err.Error()) + // using same error msg as CheckFn so integration tests match + err = fmt.Errorf("%v differ", hashType) fs.Errorf(src, err.Error()) return true, false, nil } diff --git a/cmd/bisync/log.go b/cmd/bisync/log.go index 5a7ce507a30b5..29bf513389d18 100644 --- a/cmd/bisync/log.go +++ b/cmd/bisync/log.go @@ -7,6 +7,7 @@ import ( "strings" "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/lib/encoder" "github.com/rclone/rclone/lib/terminal" ) @@ -36,6 +37,7 @@ func (b *bisyncRun) indent(tag, file, msg string) { // escapePath will escape control characters in path. // It won't quote just due to backslashes on Windows. func escapePath(path string, forceQuotes bool) string { + path = encode(path) test := path if runtime.GOOS == "windows" { test = strings.ReplaceAll(path, "\\", "/") @@ -58,3 +60,7 @@ func Color(style string, s string) string { terminal.Start() return style + s + terminal.Reset } + +func encode(s string) string { + return encoder.OS.ToStandardPath(encoder.OS.FromStandardPath(s)) +} diff --git a/cmd/bisync/testdata/test_changes/golden/test.log b/cmd/bisync/testdata/test_changes/golden/test.log index 42a58cfed1515..b3702f98aa3b5 100644 --- a/cmd/bisync/testdata/test_changes/golden/test.log +++ b/cmd/bisync/testdata/test_changes/golden/test.log @@ -72,8 +72,8 @@ INFO : Path2: 7 changes: 1 new, 3 newer, 0 older, 3 deleted INFO : Applying changes INFO : Checking potential conflicts... ERROR : file5.txt: md5 differ -NOTICE: Local file system at {path2}: 1 differences found -NOTICE: Local file system at {path2}: 1 errors while checking +NOTICE: {path2String}: 1 differences found +NOTICE: {path2String}: 1 errors while checking INFO : Finished checking the potential conflicts. 1 differences found INFO : - Path1 Queue copy to Path2 - {path2/}file11.txt INFO : - Path1 Queue copy to Path2 - {path2/}file2.txt diff --git a/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log b/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log index 45529684465be..85a9c69384921 100644 --- a/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log +++ b/cmd/bisync/testdata/test_createemptysrcdirs/golden/test.log @@ -35,7 +35,7 @@ INFO : Bisync successful (17) : test 3. Confirm the subdir exists only on Path1 and not Path2 (18) : list-dirs {path1/} -subdir/ +subdir/ - filename hash: 86ae37b338459868804e9697025ba4c2 (19) : list-dirs {path2/} (20) : test 4.Run bisync WITH --create-empty-src-dirs @@ -55,9 +55,9 @@ INFO : Bisync successful (22) : test 5. Confirm the subdir exists on both paths (23) : list-dirs {path1/} -subdir/ +subdir/ - filename hash: 86ae37b338459868804e9697025ba4c2 (24) : list-dirs {path2/} -subdir/ +subdir/ - filename hash: 86ae37b338459868804e9697025ba4c2 (25) : test 6. Delete the empty dir on Path1 using purge-children (and also add files so the path isn't empty) (26) : purge-children {path1/} @@ -89,7 +89,7 @@ INFO : Bisync successful (35) : test 8. Confirm the subdir exists only on Path2 and not Path1 (36) : list-dirs {path1/} (37) : list-dirs {path2/} -subdir/ +subdir/ - filename hash: 86ae37b338459868804e9697025ba4c2 (38) : test 9. Reset, do the delete again, and run bisync WITH --create-empty-src-dirs (39) : bisync resync create-empty-src-dirs @@ -100,9 +100,9 @@ INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to INFO : Resync updating listings INFO : Bisync successful (40) : list-dirs {path1/} -subdir/ +subdir/ - filename hash: 86ae37b338459868804e9697025ba4c2 (41) : list-dirs {path2/} -subdir/ +subdir/ - filename hash: 86ae37b338459868804e9697025ba4c2 (42) : purge-children {path1/} (43) : copy-as {datadir/}placeholder.txt {path1/} file1.txt @@ -113,7 +113,7 @@ subdir/ (48) : copy-as {datadir/}placeholder.txt {path1/} file1.copy5.txt (49) : list-dirs {path1/} (50) : list-dirs {path2/} -subdir/ +subdir/ - filename hash: 86ae37b338459868804e9697025ba4c2 (51) : bisync create-empty-src-dirs INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" diff --git a/cmd/bisync/testdata/test_dry_run/golden/test.log b/cmd/bisync/testdata/test_dry_run/golden/test.log index 83019af70dbaa..d5b938003be28 100644 --- a/cmd/bisync/testdata/test_dry_run/golden/test.log +++ b/cmd/bisync/testdata/test_dry_run/golden/test.log @@ -84,8 +84,8 @@ INFO : Path2: 6 changes: 1 new, 3 newer, 0 older, 2 deleted INFO : Applying changes INFO : Checking potential conflicts... ERROR : file5.txt: md5 differ -NOTICE: Local file system at {path2}: 1 differences found -NOTICE: Local file system at {path2}: 1 errors while checking +NOTICE: {path2String}: 1 differences found +NOTICE: {path2String}: 1 errors while checking INFO : Finished checking the potential conflicts. 1 differences found INFO : - Path1 Queue copy to Path2 - {path2/}file11.txt INFO : - Path1 Queue copy to Path2 - {path2/}file2.txt @@ -139,8 +139,8 @@ INFO : Path2: 6 changes: 1 new, 3 newer, 0 older, 2 deleted INFO : Applying changes INFO : Checking potential conflicts... ERROR : file5.txt: md5 differ -NOTICE: Local file system at {path2}: 1 differences found -NOTICE: Local file system at {path2}: 1 errors while checking +NOTICE: {path2String}: 1 differences found +NOTICE: {path2String}: 1 errors while checking INFO : Finished checking the potential conflicts. 1 differences found INFO : - Path1 Queue copy to Path2 - {path2/}file11.txt INFO : - Path1 Queue copy to Path2 - {path2/}file2.txt diff --git a/cmd/bisync/testdata/test_equal/golden/test.log b/cmd/bisync/testdata/test_equal/golden/test.log index ced7587dda838..097be45a6f8bd 100644 --- a/cmd/bisync/testdata/test_equal/golden/test.log +++ b/cmd/bisync/testdata/test_equal/golden/test.log @@ -36,9 +36,9 @@ INFO : Path2: 2 changes: 0 new, 2 newer, 0 older, 0 deleted INFO : Applying changes INFO : Checking potential conflicts... ERROR : file1.txt: md5 differ -NOTICE: Local file system at {path2}: 1 differences found -NOTICE: Local file system at {path2}: 1 errors while checking -NOTICE: Local file system at {path2}: 1 matching files +NOTICE: {path2String}: 1 differences found +NOTICE: {path2String}: 1 errors while checking +NOTICE: {path2String}: 1 matching files INFO : Finished checking the potential conflicts. 1 differences found NOTICE: - WARNING New or changed in both paths - file1.txt NOTICE: - Path1 Renaming Path1 copy - {path1/}file1.txt..path1 diff --git a/cmd/bisync/testdata/test_extended_char_paths/golden/test.log b/cmd/bisync/testdata/test_extended_char_paths/golden/test.log index 6b83d7542d77b..8e3c32045613f 100644 --- a/cmd/bisync/testdata/test_extended_char_paths/golden/test.log +++ b/cmd/bisync/testdata/test_extended_char_paths/golden/test.log @@ -1,24 +1,35 @@ (01) : test extended-char-paths -(02) : test resync subdirs with extended chars -(03) : bisync subdir=測試_Русский_{spc}_{spc}_ě_áñ resync +(02) : fix-names {path1/}測試_Русский_{spc}_{spc}_ě_áñ/ +(03) : fix-names {path2/}測試_Русский_{spc}_{spc}_ě_áñ/ +(04) : fix-names {path1/}測試_Русский_{spc}_{spc}_ě_áñ/測試_check{spc}file +(05) : fix-names {path2/}測試_Русский_{spc}_{spc}_ě_áñ/測試_check{spc}file +(06) : fix-names {path1/}測試_Русский_{spc}_{spc}_ě_áñ/filename_contains_ě_.txt +(07) : fix-names {path2/}測試_Русский_{spc}_{spc}_ě_áñ/filename_contains_ě_.txt +(08) : fix-names {path1/}測試_check{spc}file +(09) : fix-names {path2/}測試_check{spc}file +(10) : fix-names {path1/}測試_Русский_{spc}_{spc}_ě_áñ/測試_check{spc}file +(11) : fix-names {path2/}測試_Русский_{spc}_{spc}_ě_áñ/測試_check{spc}file + +(12) : test resync subdirs with extended chars +(13) : bisync subdir=測試_Русский_{spc}_{spc}_ě_áñ resync INFO : Synching Path1 "{path1/}測試_Русский_ _ _ě_áñ/" with Path2 "{path2/}測試_Русский_ _ _ě_áñ/" INFO : Copying unique Path2 files to Path1 INFO : - Path2 Resync is copying UNIQUE files to - Path1 INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful -(04) : copy-listings resync +(14) : copy-listings resync -(05) : test place new files with extended chars on each side +(15) : test place new files with extended chars on each side -(06) : touch-glob 2001-01-02 {datadir/} file1.txt -(07) : copy-as {datadir/}file1.txt {path1/}測試_Русский_{spc}_{spc}_ě_áñ 測試_file1p1 -(08) : copy-as {datadir/}file1.txt {path2/}測試_Русский_{spc}_{spc}_ě_áñ 測試_file1p2 +(16) : touch-glob 2001-01-02 {datadir/} file1.txt +(17) : copy-as {datadir/}file1.txt {path1/}測試_Русский_{spc}_{spc}_ě_áñ 測試_file1p1 +(18) : copy-as {datadir/}file1.txt {path2/}測試_Русский_{spc}_{spc}_ě_áñ 測試_file1p2 -(09) : test normal sync of subdirs with extended chars -(10) : bisync subdir=測試_Русский_{spc}_{spc}_ě_áñ +(19) : test normal sync of subdirs with extended chars +(20) : bisync subdir=測試_Русский_{spc}_{spc}_ě_áñ INFO : Synching Path1 "{path1/}測試_Русский_ _ _ě_áñ/" with Path2 "{path2/}測試_Русский_ _ _ě_áñ/" INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs @@ -35,18 +46,18 @@ INFO : - Path1 Do queued copies to - P INFO : Updating listings INFO : Validating listings for Path1 "{path1/}測試_Русский_ _ _ě_áñ/" vs Path2 "{path2/}測試_Русский_ _ _ě_áñ/" INFO : Bisync successful -(11) : move-listings normal-sync +(21) : move-listings normal-sync -(12) : test check-filename with extended chars. check should fail. -(13) : bisync resync +(22) : test check-filename with extended chars. check should fail. +(23) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : - Path2 Resync is copying UNIQUE files to - Path1 INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful -(14) : delete-file {path1/}測試_Русский_{spc}_{spc}_ě_áñ/測試_check{spc}file -(15) : bisync check-access check-filename=測試_check{spc}file +(24) : delete-file {path1/}測試_Русский_{spc}_{spc}_ě_áñ/測試_check{spc}file +(25) : bisync check-access check-filename=測試_check{spc}file INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs @@ -59,17 +70,17 @@ ERROR : -  Access test failed: Path2 file not found in Pat ERROR : Bisync critical error: check file check failed ERROR : Bisync aborted. Must run --resync to recover. Bisync error: bisync aborted -(16) : copy-listings check-access-fail +(26) : copy-listings check-access-fail -(17) : test check-filename with extended chars. check should pass. -(18) : bisync resync +(27) : test check-filename with extended chars. check should pass. +(28) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : - Path2 Resync is copying UNIQUE files to - Path1 INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful -(19) : bisync check-access check-filename=測試_check{spc}file +(29) : bisync check-access check-filename=測試_check{spc}file INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs @@ -80,11 +91,11 @@ INFO : No changes found INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" INFO : Bisync successful -(20) : move-listings check-access-pass +(30) : move-listings check-access-pass -(21) : test filters-file path with extended chars - masks /fileZ.txt -(22) : copy-file {datadir/}測試_filtersfile.txt {workdir/} -(23) : bisync filters-file={workdir/}測試_filtersfile.txt resync +(31) : test filters-file path with extended chars - masks /fileZ.txt +(32) : copy-file {datadir/}測試_filtersfile.txt {workdir/} +(33) : bisync filters-file={workdir/}測試_filtersfile.txt resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}測試_filtersfile.txt INFO : Storing filters file hash to {workdir/}測試_filtersfile.txt.md5 @@ -93,8 +104,8 @@ INFO : - Path2 Resync is copying UNIQUE files to - P INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to - Path2 INFO : Resync updating listings INFO : Bisync successful -(24) : copy-as {datadir/}file1.txt {path1/} fileZ.txt -(25) : bisync filters-file={workdir/}測試_filtersfile.txt +(34) : copy-as {datadir/}file1.txt {path1/} fileZ.txt +(35) : bisync filters-file={workdir/}測試_filtersfile.txt INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Using filters file {workdir/}測試_filtersfile.txt INFO : Building Path1 and Path2 listings diff --git a/cmd/bisync/testdata/test_extended_char_paths/scenario.txt b/cmd/bisync/testdata/test_extended_char_paths/scenario.txt index 32ad3fe7573b3..b53656bb34226 100644 --- a/cmd/bisync/testdata/test_extended_char_paths/scenario.txt +++ b/cmd/bisync/testdata/test_extended_char_paths/scenario.txt @@ -13,6 +13,18 @@ test extended-char-paths # - Due to different encoding local backend returns the literal tab # in logs or listings, but remotes return two ASCII chars `\t`. +# verify expected files, attempt to fix +fix-names {path1/}測試_Русский_{spc}_{spc}_ě_áñ{/} +fix-names {path2/}測試_Русский_{spc}_{spc}_ě_áñ{/} +fix-names {path1/}測試_Русский_{spc}_{spc}_ě_áñ/測試_check{spc}file +fix-names {path2/}測試_Русский_{spc}_{spc}_ě_áñ/測試_check{spc}file +fix-names {path1/}測試_Русский_{spc}_{spc}_ě_áñ/filename_contains_ě_.txt +fix-names {path2/}測試_Русский_{spc}_{spc}_ě_áñ/filename_contains_ě_.txt +fix-names {path1/}測試_check{spc}file +fix-names {path2/}測試_check{spc}file +fix-names {path1/}測試_Русский_{spc}_{spc}_ě_áñ/測試_check{spc}file +fix-names {path2/}測試_Русский_{spc}_{spc}_ě_áñ/測試_check{spc}file + test resync subdirs with extended chars bisync subdir=測試_Русский_{spc}_{spc}_ě_áñ resync copy-listings resync diff --git a/cmd/bisync/testdata/test_extended_filenames/golden/test.log b/cmd/bisync/testdata/test_extended_filenames/golden/test.log index 61c7b1ad6da98..b2cdcd002dc63 100644 --- a/cmd/bisync/testdata/test_extended_filenames/golden/test.log +++ b/cmd/bisync/testdata/test_extended_filenames/golden/test.log @@ -1,8 +1,17 @@ (01) : test extended-filenames -(02) : test initial bisync -(03) : bisync resync +(02) : fix-names {path1/}subdir_with_ࢺ_/ +(03) : fix-names {path2/}subdir_with_ࢺ_/ +(04) : fix-names {path1/}subdir_with_ࢺ_/filename_contains_ě_.txt +(05) : fix-names {path2/}subdir_with_ࢺ_/filename_contains_ě_.txt +(06) : fix-names {path1/}Русский.txt +(07) : fix-names {path2/}Русский.txt +(08) : fix-names {path1/}file_enconde_mañana_funcionará.txt +(09) : fix-names {path2/}file_enconde_mañana_funcionará.txt + +(10) : test initial bisync +(11) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : - Path2 Resync is copying UNIQUE files to - Path1 @@ -10,34 +19,35 @@ INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to INFO : Resync updating listings INFO : Bisync successful -(04) : test place a newer files on both paths +(12) : test place a newer files on both paths -(05) : touch-glob 2001-01-02 {datadir/} file1.txt -(06) : touch-glob 2001-01-02 {datadir/} file2.txt -(07) : copy-as {datadir/}file1.txt {path2/} New_top_level_mañana_funcionará.txt -(08) : copy-as {datadir/}file1.txt {path2/} file_enconde_mañana_funcionará.txt -(09) : copy-as {datadir/}file1.txt {path1/} filename_contains_ࢺ_p1m.txt -(10) : copy-as {datadir/}file1.txt {path2/} Русский.txt -(11) : copy-as {datadir/}file1.txt {path1/} file1_with{spc}white{spc}space.txt -(12) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ test.txt -(13) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ mañana_funcionará.txt -(14) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ file_with_測試_.txt -(15) : copy-as {datadir/}file1.txt {path2/}subdir_with_ࢺ_ filename_contains_ࢺ_p2s.txt -(16) : copy-as {datadir/}file1.txt {path2/}subdir{spc}with{eol}white{spc}space.txt file2{spc}with{eol}white{spc}space.txt -(17) : copy-as {datadir/}file1.txt {path2/}subdir_rawchars_{chr:19}_{chr:81}_{chr:fe} file3_{chr:19}_{chr:81}_{chr:fe} +(13) : touch-glob 2001-01-02 {datadir/} file1.txt +(14) : touch-glob 2001-01-02 {datadir/} file2.txt +(15) : copy-as {datadir/}file1.txt {path2/} New_top_level_mañana_funcionará.txt +(16) : copy-as {datadir/}file1.txt {path2/} file_enconde_mañana_funcionará.txt +(17) : copy-as {datadir/}file1.txt {path1/} filename_contains_ࢺ_p1m.txt +(18) : copy-as {datadir/}file1.txt {path2/} Русский.txt +(19) : copy-as {datadir/}file1.txt {path1/} file1_with{spc}white{spc}space.txt +(20) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ test.txt +(21) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ mañana_funcionará.txt +(22) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ file_with_測試_.txt +(23) : copy-as {datadir/}file1.txt {path2/}subdir_with_ࢺ_ filename_contains_ࢺ_p2s.txt +(24) : copy-as {datadir/}file1.txt {path2/}subdir{spc}with{eol}white{spc}space.txt file2{spc}with{eol}white{spc}space.txt +(25) : copy-as {datadir/}file1.txt {path2/}subdir_rawchars_{chr:19}_{chr:81}_{chr:fe} file3_{chr:19}_{chr:81}_{chr:fe} +(26) : fix-names {path2/}subdir{spc}with{eol}white{spc}space.txt/file2{spc}with{eol}white{spc}space.txt -(18) : test place a new file on both paths -(19) : copy-as {datadir/}file2.txt {path2/}subdir_with_ࢺ_ filechangedbothpaths_ࢺ_.txt -(20) : touch-glob 2001-01-03 {datadir/} file1.txt -(21) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ filechangedbothpaths_ࢺ_.txt +(27) : test place a new file on both paths +(28) : copy-as {datadir/}file2.txt {path2/}subdir_with_ࢺ_ filechangedbothpaths_ࢺ_.txt +(29) : touch-glob 2001-01-03 {datadir/} file1.txt +(30) : copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ filechangedbothpaths_ࢺ_.txt -(22) : test delete files on both paths -(23) : delete-file {path2/}filename_contains_ࢺ_.txt -(24) : delete-file {path2/}subdir_with_ࢺ_/filename_contains_ě_.txt -(25) : delete-file {path1/}Русский.txt +(31) : test delete files on both paths +(32) : delete-file {path2/}filename_contains_ࢺ_.txt +(33) : delete-file {path2/}subdir_with_ࢺ_/filename_contains_ě_.txt +(34) : delete-file {path1/}Русский.txt -(26) : test bisync run -(27) : bisync +(35) : test bisync run +(36) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs @@ -63,8 +73,8 @@ INFO : Path2: 9 changes: 5 new, 2 newer, 0 older, 2 deleted INFO : Applying changes INFO : Checking potential conflicts... ERROR : subdir_with_ࢺ_/filechangedbothpaths_ࢺ_.txt: sizes differ -NOTICE: Local file system at {path2}: 1 differences found -NOTICE: Local file system at {path2}: 1 errors while checking +NOTICE: {path2String}: 1 differences found +NOTICE: {path2String}: 1 errors while checking INFO : Finished checking the potential conflicts. 1 differences found INFO : - Path1 Queue copy to Path2 - {path2/}file1_with white space.txt INFO : - Path1 Queue copy to Path2 - {path2/}filename_contains_ࢺ_p1m.txt diff --git a/cmd/bisync/testdata/test_extended_filenames/scenario.txt b/cmd/bisync/testdata/test_extended_filenames/scenario.txt index 774f5db8f5153..c2c948114a6fa 100644 --- a/cmd/bisync/testdata/test_extended_filenames/scenario.txt +++ b/cmd/bisync/testdata/test_extended_filenames/scenario.txt @@ -10,6 +10,16 @@ test extended-filenames # `name{spc}with{eol}white{spc}space` instead of # `name{tab}with{eol}white{spc}space`. +# verify expected files, attempt to fix +fix-names {path1/}subdir_with_ࢺ_{/} +fix-names {path2/}subdir_with_ࢺ_{/} +fix-names {path1/}subdir_with_ࢺ_/filename_contains_ě_.txt +fix-names {path2/}subdir_with_ࢺ_/filename_contains_ě_.txt +fix-names {path1/}Русский.txt +fix-names {path2/}Русский.txt +fix-names {path1/}file_enconde_mañana_funcionará.txt +fix-names {path2/}file_enconde_mañana_funcionará.txt + test initial bisync bisync resync @@ -28,6 +38,7 @@ copy-as {datadir/}file1.txt {path1/}subdir_with_ࢺ_ file_with_測試_.txt copy-as {datadir/}file1.txt {path2/}subdir_with_ࢺ_ filename_contains_ࢺ_p2s.txt copy-as {datadir/}file1.txt {path2/}subdir{spc}with{eol}white{spc}space.txt file2{spc}with{eol}white{spc}space.txt copy-as {datadir/}file1.txt {path2/}subdir_rawchars_{chr:19}_{chr:81}_{chr:fe} file3_{chr:19}_{chr:81}_{chr:fe} +fix-names {path2/}subdir{spc}with{eol}white{spc}space.txt{/}file2{spc}with{eol}white{spc}space.txt test place a new file on both paths copy-as {datadir/}file2.txt {path2/}subdir_with_ࢺ_ filechangedbothpaths_ࢺ_.txt diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.copy1to2.que b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.copy1to2.que index bd7f8e7dde8d9..896fa3f120e6e 100644 --- a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.copy1to2.que +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.copy1to2.que @@ -1,3 +1,3 @@ "folder/HeLlO,wOrLd!.txt" "folder/éééö.txt" -"測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +"測試_Руский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö/測試_Руский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst index 76c15edcdfc7e..ae1a6278b46e2 100644 --- a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst @@ -1,5 +1,7 @@ # bisync listing v1 from test - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "file1.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file2.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file3.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "folder/HeLlO,wOrLd!.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "folder/éééö.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "測試_Руский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö/測試_Руский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-new b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-new index bd44aea5b8ce7..7c2dc81561cb3 100644 --- a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-new +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-new @@ -1,5 +1,7 @@ # bisync listing v1 from test - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-03T00:00:00.000000000+0000 "file1.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file2.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file3.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "folder/HeLlO,wOrLd!.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "folder/éééö.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "測試_Руский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö/測試_Руский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-old index 6815fa4ee3a8b..ef150b300ea9d 100644 --- a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-old +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -1,5 +1,7 @@ # bisync listing v1 from test - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-03T00:00:00.000000000+0000 "file1.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file2.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file3.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "folder/HeLlO,wOrLd!.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "folder/éééö.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "測試_Руский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö/測試_Руский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst index 48252d18d23aa..d4a293c84de63 100644 --- a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst @@ -1,5 +1,7 @@ # bisync listing v1 from test - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "file1.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file2.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file3.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "folder/hello,WORLD!.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "folder/éééö.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "測試_Руский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö/測試_Руский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-new b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-new index 6f843cfa932f6..c0a689c72750e 100644 --- a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-new +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-new @@ -1,5 +1,7 @@ # bisync listing v1 from test - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-05T00:00:00.000000000+0000 "file1.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file2.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file3.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "folder/hello,WORLD!.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "folder/éééö.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "測試_Руский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö/測試_Руский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-old index ed2547754b132..b85b8c3b656c7 100644 --- a/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-old +++ b/cmd/bisync/testdata/test_normalization/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -1,5 +1,7 @@ # bisync listing v1 from test - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-03T00:00:00.000000000+0000 "file1.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file2.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "file3.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "folder/hello,WORLD!.txt" - 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "folder/éééö.txt" -- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2001-01-02T00:00:00.000000000+0000 "測試_Руский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö/測試_Руский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö.txt" diff --git a/cmd/bisync/testdata/test_normalization/golden/test.log b/cmd/bisync/testdata/test_normalization/golden/test.log index db66b5e75cbbb..dd473711caf04 100644 --- a/cmd/bisync/testdata/test_normalization/golden/test.log +++ b/cmd/bisync/testdata/test_normalization/golden/test.log @@ -12,7 +12,7 @@ INFO : Resync updating listings INFO : Bisync successful -(05) : copy-as-NFC {datadir/}file1.txt {path1/}測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö 測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö.txt +(05) : copy-as-NFC {datadir/}file1.txt {path1/}測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éö 測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éö.txt (06) : copy-as-NFC {datadir/}file1.txt {path1/}folder éééö.txt (07) : copy-as-NFC {datadir/}file1.txt {path1/}folder HeLlO,wOrLd!.txt @@ -28,7 +28,7 @@ INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File is new - folder/HeLlO,wOrLd!.txt INFO : - Path1 File is new - folder/éééö.txt -INFO : - Path1 File is new - "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +INFO : - Path1 File is new - "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö.txt" INFO : Path1: 3 changes: 3 new, 0 newer, 0 older, 0 deleted INFO : Path2 checking for diffs INFO : - Path2 File is newer - file1.txt @@ -37,14 +37,14 @@ INFO : - Path2 File is new - f INFO : Path2: 3 changes: 2 new, 1 newer, 0 older, 0 deleted INFO : Applying changes INFO : Checking potential conflicts... -NOTICE: Local file system at {path2}: 0 differences found -NOTICE: Local file system at {path2}: 2 matching files +NOTICE: {path2String}: 0 differences found +NOTICE: {path2String}: 2 matching files INFO : Finished checking the potential conflicts. %!s() NOTICE: - WARNING New or changed in both paths - folder/HeLlO,wOrLd!.txt INFO : folder/hello,WORLD!.txt: Files are equal but will copy anyway to fix case to folder/HeLlO,wOrLd!.txt NOTICE: - WARNING New or changed in both paths - folder/éééö.txt INFO : folder/éééö.txt: Files are equal but will copy anyway to fix case to folder/éééö.txt -INFO : - Path1 Queue copy to Path2 - "{path2/}測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +INFO : - Path1 Queue copy to Path2 - "{path2/}測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö.txt" INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt INFO : - Path2 Do queued copies to - Path1 INFO : - Path1 Do queued copies to - Path2 @@ -58,7 +58,9 @@ INFO : Bisync successful (13) : purge-children {path1/} (14) : purge-children {path2/} (15) : touch-copy 2001-01-02 {datadir/}file1.txt {path2/} -(16) : bisync resync +(16) : copy-as-NFC {datadir/}file1.txt {path2/} file2.txt +(17) : copy-as-NFC {datadir/}file1.txt {path1/} file3.txt +(18) : bisync resync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : - Path2 Resync is copying UNIQUE files to - Path1 @@ -67,23 +69,23 @@ INFO : Resync updating listings INFO : Bisync successful -(17) : copy-as-NFC {datadir/}file1.txt {path1/}測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö 測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö.txt -(18) : copy-as-NFC {datadir/}file1.txt {path1/}folder éééö.txt -(19) : copy-as-NFC {datadir/}file1.txt {path1/}folder HeLlO,wOrLd!.txt +(19) : copy-as-NFC {datadir/}file1.txt {path1/}測試_Руский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éö 測試_Руский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éö.txt +(20) : copy-as-NFC {datadir/}file1.txt {path1/}folder éééö.txt +(21) : copy-as-NFC {datadir/}file1.txt {path1/}folder HeLlO,wOrLd!.txt -(20) : touch-copy 2001-01-03 {datadir/}file1.txt {path2/} -(21) : copy-as-NFD {datadir/}file1.txt {path2/}folder éééö.txt -(22) : copy-as-NFD {datadir/}file1.txt {path2/}folder hello,WORLD!.txt +(22) : touch-copy 2001-01-03 {datadir/}file1.txt {path2/} +(23) : copy-as-NFD {datadir/}file1.txt {path2/}folder éééö.txt +(24) : copy-as-NFD {datadir/}file1.txt {path2/}folder hello,WORLD!.txt -(23) : test bisync run with normalization -(24) : bisync norm force +(25) : test bisync run with normalization +(26) : bisync norm force INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File is new - folder/HeLlO,wOrLd!.txt INFO : - Path1 File is new - folder/éééö.txt -INFO : - Path1 File is new - "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +INFO : - Path1 File is new - "測試_Руский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö/測試_Руский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö.txt" INFO : Path1: 3 changes: 3 new, 0 newer, 0 older, 0 deleted INFO : Path2 checking for diffs INFO : - Path2 File is newer - file1.txt @@ -92,14 +94,14 @@ INFO : - Path2 File is new - f INFO : Path2: 3 changes: 2 new, 1 newer, 0 older, 0 deleted INFO : Applying changes INFO : Checking potential conflicts... -NOTICE: Local file system at {path2}: 0 differences found -NOTICE: Local file system at {path2}: 2 matching files +NOTICE: {path2String}: 0 differences found +NOTICE: {path2String}: 2 matching files INFO : Finished checking the potential conflicts. %!s() NOTICE: - WARNING New or changed in both paths - folder/HeLlO,wOrLd!.txt INFO : Files are equal! Skipping: folder/HeLlO,wOrLd!.txt NOTICE: - WARNING New or changed in both paths - folder/éééö.txt INFO : Files are equal! Skipping: folder/éééö.txt -INFO : - Path1 Queue copy to Path2 - "{path2/}測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +INFO : - Path1 Queue copy to Path2 - "{path2/}測試_Руский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö/測試_Руский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö.txt" INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt INFO : - Path2 Do queued copies to - Path1 INFO : - Path1 Do queued copies to - Path2 @@ -107,8 +109,8 @@ INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" INFO : Bisync successful -(25) : test resync -(26) : bisync resync norm +(27) : test resync +(28) : bisync resync norm INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Copying unique Path2 files to Path1 INFO : - Path2 Resync is copying UNIQUE files to - Path1 @@ -116,18 +118,18 @@ INFO : - Path1 Resync is copying UNIQUE OR DIFFERING files to INFO : Resync updating listings INFO : Bisync successful -(27) : test changed on one path -(28) : touch-copy 2001-01-05 {datadir/}file1.txt {path2/} -(29) : copy-as-NFC {datadir/}file1.txt {path1/}測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö 測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö.txt -(30) : copy-as-NFC {datadir/}file1.txt {path1/}folder éééö.txt -(31) : copy-as-NFC {datadir/}file1.txt {path1/}folder HeLlO,wOrLd!.txt -(32) : bisync norm +(29) : test changed on one path +(30) : touch-copy 2001-01-05 {datadir/}file1.txt {path2/} +(31) : copy-as-NFC {datadir/}file1.txt {path1/}測試_Руский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éö 測試_Руский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éö.txt +(32) : copy-as-NFC {datadir/}file1.txt {path1/}folder éééö.txt +(33) : copy-as-NFC {datadir/}file1.txt {path1/}folder HeLlO,wOrLd!.txt +(34) : bisync norm INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs INFO : - Path1 File is newer - folder/HeLlO,wOrLd!.txt INFO : - Path1 File is newer - folder/éééö.txt -INFO : - Path1 File is newer - "測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +INFO : - Path1 File is newer - "測試_Руский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö/測試_Руский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö.txt" INFO : Path1: 3 changes: 0 new, 3 newer, 0 older, 0 deleted INFO : Path2 checking for diffs INFO : - Path2 File is newer - file1.txt @@ -135,7 +137,7 @@ INFO : Path2: 1 changes: 0 new, 1 newer, 0 older, 0 deleted INFO : Applying changes INFO : - Path1 Queue copy to Path2 - {path2/}folder/hello,WORLD!.txt INFO : - Path1 Queue copy to Path2 - {path2/}folder/éééö.txt -INFO : - Path1 Queue copy to Path2 - "{path2/}測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö/測試_Русский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éééö.txt" +INFO : - Path1 Queue copy to Path2 - "{path2/}測試_Руский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö/測試_Руский___ě_áñ👸🏼🧝🏾\u200d♀️💆🏿\u200d♂️🐨🤙🏼🤮🧑🏻\u200d🔧🧑\u200d🔬éö.txt" INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt INFO : - Path2 Do queued copies to - Path1 INFO : - Path1 Do queued copies to - Path2 diff --git a/cmd/bisync/testdata/test_normalization/scenario.txt b/cmd/bisync/testdata/test_normalization/scenario.txt index bc42bbdb5e089..d31d2cf27d664 100644 --- a/cmd/bisync/testdata/test_normalization/scenario.txt +++ b/cmd/bisync/testdata/test_normalization/scenario.txt @@ -9,7 +9,7 @@ test initial bisync bisync resync # copy NFC version to Path1 -copy-as-NFC {datadir/}file1.txt {path1/}測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö 測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö.txt +copy-as-NFC {datadir/}file1.txt {path1/}測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éö 測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éö.txt copy-as-NFC {datadir/}file1.txt {path1/}folder éééö.txt copy-as-NFC {datadir/}file1.txt {path1/}folder HeLlO,wOrLd!.txt @@ -25,10 +25,13 @@ bisync fix-case purge-children {path1/} purge-children {path2/} touch-copy 2001-01-02 {datadir/}file1.txt {path2/} +copy-as-NFC {datadir/}file1.txt {path2/} file2.txt +copy-as-NFC {datadir/}file1.txt {path1/} file3.txt bisync resync # copy NFC version to Path1 -copy-as-NFC {datadir/}file1.txt {path1/}測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö 測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö.txt +# note: need to slightly change the name to avoid Drive known issue #3262 which could try to copy the old name from the trash +copy-as-NFC {datadir/}file1.txt {path1/}測試_Руский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éö 測試_Руский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éö.txt copy-as-NFC {datadir/}file1.txt {path1/}folder éééö.txt copy-as-NFC {datadir/}file1.txt {path1/}folder HeLlO,wOrLd!.txt @@ -45,7 +48,7 @@ bisync resync norm test changed on one path touch-copy 2001-01-05 {datadir/}file1.txt {path2/} -copy-as-NFC {datadir/}file1.txt {path1/}測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö 測試_Русский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éééö.txt +copy-as-NFC {datadir/}file1.txt {path1/}測試_Руский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éö 測試_Руский___ě_áñ👸🏼🧝🏾‍♀️💆🏿‍♂️🐨🤙🏼🤮🧑🏻‍🔧🧑‍🔬éö.txt copy-as-NFC {datadir/}file1.txt {path1/}folder éééö.txt copy-as-NFC {datadir/}file1.txt {path1/}folder HeLlO,wOrLd!.txt bisync norm \ No newline at end of file diff --git a/cmd/bisync/testdata/test_rmdirs/golden/test.log b/cmd/bisync/testdata/test_rmdirs/golden/test.log index 4094070a951ce..32d79b746b24d 100644 --- a/cmd/bisync/testdata/test_rmdirs/golden/test.log +++ b/cmd/bisync/testdata/test_rmdirs/golden/test.log @@ -30,9 +30,9 @@ INFO : Bisync successful (08) : test 3. confirm the subdir still exists on both paths (09) : list-dirs {path1/} -subdir/ +subdir/ - filename hash: 86ae37b338459868804e9697025ba4c2 (10) : list-dirs {path2/} -subdir/ +subdir/ - filename hash: 86ae37b338459868804e9697025ba4c2 (11) : test 4. run bisync with remove-empty-dirs (12) : bisync remove-empty-dirs diff --git a/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst index 27dbd194a8180..fe9dd1f50e74b 100644 --- a/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst +++ b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst @@ -1,103 +1,103 @@ # bisync listing v1 from test - 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file0.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file10.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file100.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file11.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file12.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file13.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file14.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file15.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file16.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file17.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file18.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file19.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file20.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file21.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file22.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file23.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file24.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file25.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file26.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file27.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file28.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file29.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file30.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file31.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file32.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file33.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file34.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file35.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file36.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file37.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file38.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file39.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file40.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file41.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file42.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file43.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file44.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file45.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file46.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file47.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file48.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file49.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file0.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file1.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file10.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file100.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file11.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file12.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file13.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file14.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file15.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file16.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file17.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file18.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file19.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file2.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file20.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file21.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file22.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file23.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file24.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file25.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file26.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file27.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file28.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file29.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file3.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file30.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file31.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file32.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file33.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file34.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file35.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file36.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file37.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file38.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file39.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file4.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file40.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file41.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file42.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file43.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file44.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file45.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file46.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file47.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file48.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file49.txt" - 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt..path1" - 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt..path2" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file51.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file52.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file53.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file54.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file55.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file56.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file57.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file58.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file59.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file60.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file61.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file62.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file63.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file64.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file65.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file66.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file67.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file68.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file69.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file70.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file71.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file72.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file73.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file74.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file75.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file76.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file77.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file78.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file79.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file80.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file81.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file82.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file83.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file84.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file85.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file86.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file87.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file88.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file89.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file9.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file90.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file91.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file92.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file93.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file94.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file95.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file96.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file97.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file98.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file99.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file51.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file52.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file53.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file54.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file55.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file56.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file57.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file58.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file59.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file6.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file60.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file61.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file62.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file63.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file64.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file65.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file66.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file67.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file68.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file69.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file7.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file70.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file71.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file72.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file73.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file74.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file75.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file76.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file77.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file78.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file79.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file8.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file80.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file81.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file82.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file83.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file84.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file85.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file86.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file87.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file88.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file89.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file9.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file90.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file91.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file92.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file93.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file94.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file95.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file96.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file97.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file98.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file99.txt" diff --git a/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst-new b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst-new index 74a73a22cdc97..deb7f2753ab2e 100644 --- a/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst-new +++ b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst-new @@ -1,104 +1,104 @@ # bisync listing v1 from test - 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file0.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file10.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file100.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file11.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file12.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file13.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file14.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file15.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file16.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file17.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file18.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file19.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file20.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file21.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file22.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file23.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file24.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file25.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file26.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file27.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file28.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file29.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file30.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file31.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file32.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file33.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file34.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file35.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file36.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file37.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file38.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file39.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file40.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file41.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file42.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file43.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file44.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file45.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file46.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file47.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file48.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file49.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file0.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file1.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file10.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file100.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file11.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file12.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file13.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file14.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file15.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file16.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file17.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file18.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file19.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file2.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file20.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file21.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file22.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file23.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file24.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file25.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file26.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file27.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file28.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file29.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file3.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file30.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file31.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file32.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file33.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file34.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file35.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file36.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file37.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file38.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file39.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file4.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file40.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file41.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file42.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file43.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file44.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file45.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file46.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file47.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file48.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file49.txt" - 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt" - 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt..path1" - 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt..path2" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file51.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file52.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file53.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file54.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file55.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file56.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file57.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file58.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file59.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file60.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file61.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file62.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file63.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file64.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file65.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file66.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file67.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file68.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file69.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file70.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file71.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file72.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file73.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file74.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file75.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file76.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file77.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file78.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file79.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file80.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file81.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file82.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file83.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file84.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file85.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file86.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file87.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file88.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file89.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file9.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file90.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file91.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file92.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file93.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file94.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file95.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file96.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file97.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file98.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file99.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file51.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file52.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file53.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file54.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file55.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file56.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file57.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file58.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file59.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file6.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file60.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file61.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file62.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file63.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file64.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file65.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file66.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file67.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file68.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file69.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file7.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file70.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file71.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file72.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file73.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file74.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file75.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file76.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file77.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file78.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file79.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file8.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file80.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file81.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file82.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file83.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file84.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file85.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file86.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file87.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file88.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file89.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file9.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file90.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file91.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file92.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file93.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file94.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file95.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file96.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file97.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file98.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file99.txt" diff --git a/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst-old b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst-old index 27dbd194a8180..fe9dd1f50e74b 100644 --- a/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst-old +++ b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path1.lst-old @@ -1,103 +1,103 @@ # bisync listing v1 from test - 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file0.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file10.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file100.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file11.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file12.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file13.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file14.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file15.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file16.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file17.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file18.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file19.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file20.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file21.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file22.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file23.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file24.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file25.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file26.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file27.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file28.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file29.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file30.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file31.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file32.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file33.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file34.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file35.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file36.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file37.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file38.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file39.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file40.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file41.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file42.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file43.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file44.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file45.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file46.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file47.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file48.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file49.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file0.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file1.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file10.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file100.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file11.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file12.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file13.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file14.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file15.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file16.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file17.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file18.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file19.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file2.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file20.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file21.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file22.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file23.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file24.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file25.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file26.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file27.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file28.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file29.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file3.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file30.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file31.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file32.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file33.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file34.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file35.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file36.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file37.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file38.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file39.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file4.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file40.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file41.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file42.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file43.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file44.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file45.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file46.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file47.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file48.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file49.txt" - 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt..path1" - 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt..path2" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file51.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file52.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file53.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file54.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file55.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file56.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file57.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file58.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file59.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file60.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file61.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file62.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file63.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file64.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file65.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file66.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file67.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file68.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file69.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file70.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file71.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file72.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file73.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file74.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file75.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file76.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file77.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file78.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file79.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file80.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file81.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file82.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file83.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file84.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file85.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file86.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file87.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file88.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file89.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file9.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file90.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file91.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file92.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file93.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file94.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file95.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file96.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file97.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file98.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file99.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file51.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file52.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file53.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file54.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file55.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file56.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file57.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file58.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file59.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file6.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file60.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file61.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file62.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file63.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file64.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file65.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file66.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file67.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file68.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file69.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file7.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file70.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file71.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file72.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file73.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file74.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file75.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file76.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file77.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file78.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file79.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file8.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file80.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file81.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file82.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file83.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file84.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file85.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file86.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file87.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file88.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file89.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file9.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file90.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file91.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file92.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file93.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file94.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file95.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file96.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file97.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file98.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file99.txt" diff --git a/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst index 27dbd194a8180..fe9dd1f50e74b 100644 --- a/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst +++ b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst @@ -1,103 +1,103 @@ # bisync listing v1 from test - 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file0.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file10.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file100.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file11.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file12.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file13.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file14.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file15.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file16.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file17.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file18.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file19.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file20.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file21.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file22.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file23.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file24.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file25.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file26.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file27.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file28.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file29.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file30.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file31.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file32.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file33.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file34.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file35.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file36.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file37.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file38.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file39.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file40.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file41.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file42.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file43.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file44.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file45.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file46.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file47.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file48.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file49.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file0.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file1.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file10.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file100.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file11.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file12.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file13.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file14.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file15.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file16.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file17.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file18.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file19.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file2.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file20.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file21.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file22.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file23.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file24.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file25.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file26.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file27.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file28.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file29.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file3.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file30.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file31.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file32.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file33.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file34.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file35.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file36.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file37.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file38.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file39.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file4.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file40.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file41.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file42.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file43.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file44.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file45.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file46.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file47.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file48.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file49.txt" - 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt..path1" - 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt..path2" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file51.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file52.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file53.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file54.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file55.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file56.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file57.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file58.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file59.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file60.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file61.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file62.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file63.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file64.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file65.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file66.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file67.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file68.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file69.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file70.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file71.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file72.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file73.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file74.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file75.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file76.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file77.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file78.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file79.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file80.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file81.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file82.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file83.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file84.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file85.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file86.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file87.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file88.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file89.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file9.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file90.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file91.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file92.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file93.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file94.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file95.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file96.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file97.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file98.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file99.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file51.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file52.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file53.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file54.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file55.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file56.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file57.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file58.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file59.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file6.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file60.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file61.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file62.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file63.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file64.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file65.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file66.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file67.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file68.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file69.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file7.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file70.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file71.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file72.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file73.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file74.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file75.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file76.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file77.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file78.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file79.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file8.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file80.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file81.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file82.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file83.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file84.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file85.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file86.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file87.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file88.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file89.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file9.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file90.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file91.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file92.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file93.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file94.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file95.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file96.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file97.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file98.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file99.txt" diff --git a/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst-new b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst-new index af4d4e41b8776..f6d4b4bdc80fa 100644 --- a/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst-new +++ b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst-new @@ -1,104 +1,104 @@ # bisync listing v1 from test - 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file0.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file10.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file100.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file11.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file12.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file13.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file14.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file15.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file16.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file17.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file18.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file19.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file20.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file21.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file22.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file23.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file24.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file25.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file26.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file27.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file28.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file29.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file30.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file31.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file32.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file33.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file34.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file35.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file36.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file37.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file38.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file39.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file40.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file41.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file42.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file43.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file44.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file45.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file46.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file47.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file48.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file49.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file0.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file1.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file10.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file100.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file11.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file12.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file13.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file14.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file15.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file16.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file17.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file18.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file19.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file2.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file20.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file21.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file22.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file23.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file24.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file25.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file26.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file27.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file28.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file29.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file3.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file30.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file31.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file32.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file33.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file34.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file35.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file36.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file37.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file38.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file39.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file4.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file40.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file41.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file42.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file43.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file44.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file45.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file46.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file47.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file48.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file49.txt" - 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt" - 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt..path1" - 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt..path2" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file51.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file52.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file53.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file54.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file55.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file56.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file57.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file58.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file59.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file60.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file61.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file62.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file63.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file64.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file65.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file66.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file67.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file68.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file69.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file70.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file71.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file72.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file73.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file74.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file75.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file76.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file77.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file78.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file79.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file80.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file81.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file82.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file83.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file84.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file85.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file86.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file87.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file88.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file89.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file9.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file90.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file91.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file92.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file93.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file94.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file95.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file96.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file97.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file98.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file99.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file51.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file52.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file53.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file54.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file55.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file56.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file57.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file58.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file59.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file6.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file60.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file61.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file62.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file63.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file64.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file65.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file66.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file67.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file68.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file69.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file7.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file70.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file71.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file72.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file73.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file74.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file75.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file76.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file77.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file78.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file79.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file8.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file80.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file81.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file82.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file83.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file84.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file85.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file86.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file87.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file88.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file89.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file9.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file90.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file91.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file92.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file93.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file94.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file95.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file96.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file97.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file98.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file99.txt" diff --git a/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst-old b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst-old index 27dbd194a8180..fe9dd1f50e74b 100644 --- a/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst-old +++ b/cmd/bisync/testdata/test_volatile/golden/_testdir_path1.._testdir_path2.path2.lst-old @@ -1,103 +1,103 @@ # bisync listing v1 from test - 109 md5:294d25b294ff26a5243dba914ac3fbf7 - 2000-01-01T00:00:00.000000000+0000 "RCLONE_TEST" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file0.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file1.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file10.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file100.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file11.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file12.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file13.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file14.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file15.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file16.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file17.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file18.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file19.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file2.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file20.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file21.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file22.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file23.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file24.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file25.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file26.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file27.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file28.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file29.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file3.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file30.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file31.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file32.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file33.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file34.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file35.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file36.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file37.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file38.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file39.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file4.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file40.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file41.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file42.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file43.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file44.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file45.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file46.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file47.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file48.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file49.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file0.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file1.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file10.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file100.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file11.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file12.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file13.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file14.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file15.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file16.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file17.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file18.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file19.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file2.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file20.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file21.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file22.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file23.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file24.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file25.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file26.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file27.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file28.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file29.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file3.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file30.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file31.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file32.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file33.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file34.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file35.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file36.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file37.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file38.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file39.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file4.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file40.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file41.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file42.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file43.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file44.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file45.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file46.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file47.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file48.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file49.txt" - 39 md5:0860a03592626642f8fd6c8bfb447d2a - 2001-03-04T00:00:00.000000000+0000 "file5.txt..path1" - 39 md5:979a803b15d27df0c31ad7d29006d10b - 2001-01-02T00:00:00.000000000+0000 "file5.txt..path2" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file51.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file52.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file53.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file54.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file55.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file56.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file57.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file58.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file59.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file6.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file60.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file61.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file62.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file63.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file64.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file65.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file66.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file67.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file68.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file69.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file7.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file70.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file71.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file72.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file73.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file74.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file75.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file76.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file77.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file78.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file79.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file8.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file80.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file81.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file82.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file83.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file84.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file85.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file86.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file87.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file88.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file89.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file9.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file90.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file91.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file92.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file93.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file94.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file95.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file96.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file97.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file98.txt" -- 0 md5:d41d8cd98f00b204e9800998ecf8427e - 2000-01-01T00:00:00.000000000+0000 "file99.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file51.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file52.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file53.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file54.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file55.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file56.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file57.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file58.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file59.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file6.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file60.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file61.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file62.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file63.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file64.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file65.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file66.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file67.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file68.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file69.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file7.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file70.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file71.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file72.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file73.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file74.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file75.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file76.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file77.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file78.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file79.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file8.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file80.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file81.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file82.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file83.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file84.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file85.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file86.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file87.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file88.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file89.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file9.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file90.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file91.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file92.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file93.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file94.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file95.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file96.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file97.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file98.txt" +- 19 md5:7fe98ed88552b828777d8630900346b8 - 2023-08-26T00:00:00.000000000+0000 "file99.txt" diff --git a/cmd/bisync/testdata/test_volatile/golden/test.log b/cmd/bisync/testdata/test_volatile/golden/test.log index 8e138c011dfa8..fcfe3f5807d32 100644 --- a/cmd/bisync/testdata/test_volatile/golden/test.log +++ b/cmd/bisync/testdata/test_volatile/golden/test.log @@ -11,13 +11,14 @@ INFO : Bisync successful (04) : test changed on both paths - file5 (file5R, file5L) (05) : touch-glob 2001-01-02 {datadir/} file5R.txt -(06) : copy-as {datadir/}file5R.txt {path2/} file5.txt -(07) : touch-glob 2001-03-04 {datadir/} file5L.txt -(08) : copy-as {datadir/}file5L.txt {path1/} file5.txt +(06) : touch-glob 2023-08-26 {datadir/} file7.txt +(07) : copy-as {datadir/}file5R.txt {path2/} file5.txt +(08) : touch-glob 2001-03-04 {datadir/} file5L.txt +(09) : copy-as {datadir/}file5L.txt {path1/} file5.txt -(09) : test bisync with 50 files created during - should ignore new files -(10) : test-func -(11) : bisync +(10) : test bisync with 50 files created during - should ignore new files +(11) : test-func +(12) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs @@ -29,8 +30,8 @@ INFO : Path2: 1 changes: 0 new, 1 newer, 0 older, 0 deleted INFO : Applying changes INFO : Checking potential conflicts... ERROR : file5.txt: md5 differ -NOTICE: Local file system at {path2}: 1 differences found -NOTICE: Local file system at {path2}: 1 errors while checking +NOTICE: {path2String}: 1 differences found +NOTICE: {path2String}: 1 errors while checking INFO : Finished checking the potential conflicts. 1 differences found NOTICE: - WARNING New or changed in both paths - file5.txt NOTICE: - Path1 Renaming Path1 copy - {path1/}file5.txt..path1 @@ -43,15 +44,15 @@ INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" INFO : Bisync successful -(12) : test changed on both paths - file5 (file5R, file5L) -(13) : touch-glob 2001-01-02 {datadir/} file5R.txt -(14) : copy-as {datadir/}file5R.txt {path2/} file5.txt -(15) : touch-glob 2001-03-04 {datadir/} file5L.txt -(16) : copy-as {datadir/}file5L.txt {path1/} file5.txt +(13) : test changed on both paths - file5 (file5R, file5L) +(14) : touch-glob 2001-01-02 {datadir/} file5R.txt +(15) : copy-as {datadir/}file5R.txt {path2/} file5.txt +(16) : touch-glob 2001-03-04 {datadir/} file5L.txt +(17) : copy-as {datadir/}file5L.txt {path1/} file5.txt -(17) : test next bisync - should now notice new files -(18) : test-func -(19) : bisync +(18) : test next bisync - should now notice new files +(19) : test-func +(20) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs @@ -108,6 +109,13 @@ INFO : - Path1 File is new - f INFO : - Path1 File is new - file99.txt INFO : Path1: 51 changes: 51 new, 0 newer, 0 older, 0 deleted INFO : Path2 checking for diffs +INFO : - Path2 File is newer - file1.txt +INFO : - Path2 File is newer - file2.txt +INFO : - Path2 File is newer - file3.txt +INFO : - Path2 File is newer - file4.txt +INFO : - Path2 File is newer - file6.txt +INFO : - Path2 File is newer - file7.txt +INFO : - Path2 File is newer - file8.txt INFO : - Path2 File is new - file0.txt INFO : - Path2 File is new - file10.txt INFO : - Path2 File is new - file11.txt @@ -151,12 +159,12 @@ INFO : - Path2 File is new - f INFO : - Path2 File is new - file49.txt INFO : - Path2 File is new - file5.txt INFO : - Path2 File is new - file9.txt -INFO : Path2: 43 changes: 43 new, 0 newer, 0 older, 0 deleted +INFO : Path2: 50 changes: 43 new, 7 newer, 0 older, 0 deleted INFO : Applying changes INFO : Checking potential conflicts... ERROR : file5.txt: md5 differ -NOTICE: Local file system at {path2}: 1 differences found -NOTICE: Local file system at {path2}: 1 errors while checking +NOTICE: {path2String}: 1 differences found +NOTICE: {path2String}: 1 errors while checking INFO : Finished checking the potential conflicts. 1 differences found INFO : - Path1 Queue copy to Path2 - {path2/}file100.txt NOTICE: - WARNING New or changed in both paths - file5.txt @@ -214,6 +222,7 @@ INFO : - Path1 Queue copy to Path2 - { INFO : - Path1 Queue copy to Path2 - {path2/}file98.txt INFO : - Path1 Queue copy to Path2 - {path2/}file99.txt INFO : - Path2 Queue copy to Path1 - {path1/}file0.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file1.txt INFO : - Path2 Queue copy to Path1 - {path1/}file10.txt INFO : - Path2 Queue copy to Path1 - {path1/}file11.txt INFO : - Path2 Queue copy to Path1 - {path1/}file12.txt @@ -224,6 +233,7 @@ INFO : - Path2 Queue copy to Path1 - { INFO : - Path2 Queue copy to Path1 - {path1/}file17.txt INFO : - Path2 Queue copy to Path1 - {path1/}file18.txt INFO : - Path2 Queue copy to Path1 - {path1/}file19.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file2.txt INFO : - Path2 Queue copy to Path1 - {path1/}file20.txt INFO : - Path2 Queue copy to Path1 - {path1/}file21.txt INFO : - Path2 Queue copy to Path1 - {path1/}file22.txt @@ -234,6 +244,7 @@ INFO : - Path2 Queue copy to Path1 - { INFO : - Path2 Queue copy to Path1 - {path1/}file27.txt INFO : - Path2 Queue copy to Path1 - {path1/}file28.txt INFO : - Path2 Queue copy to Path1 - {path1/}file29.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file3.txt INFO : - Path2 Queue copy to Path1 - {path1/}file30.txt INFO : - Path2 Queue copy to Path1 - {path1/}file31.txt INFO : - Path2 Queue copy to Path1 - {path1/}file32.txt @@ -244,6 +255,7 @@ INFO : - Path2 Queue copy to Path1 - { INFO : - Path2 Queue copy to Path1 - {path1/}file37.txt INFO : - Path2 Queue copy to Path1 - {path1/}file38.txt INFO : - Path2 Queue copy to Path1 - {path1/}file39.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file4.txt INFO : - Path2 Queue copy to Path1 - {path1/}file40.txt INFO : - Path2 Queue copy to Path1 - {path1/}file41.txt INFO : - Path2 Queue copy to Path1 - {path1/}file42.txt @@ -254,6 +266,9 @@ INFO : - Path2 Queue copy to Path1 - { INFO : - Path2 Queue copy to Path1 - {path1/}file47.txt INFO : - Path2 Queue copy to Path1 - {path1/}file48.txt INFO : - Path2 Queue copy to Path1 - {path1/}file49.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file6.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file7.txt +INFO : - Path2 Queue copy to Path1 - {path1/}file8.txt INFO : - Path2 Queue copy to Path1 - {path1/}file9.txt INFO : - Path2 Do queued copies to - Path1 INFO : - Path1 Do queued copies to - Path2 @@ -261,15 +276,15 @@ INFO : Updating listings INFO : Validating listings for Path1 "{path1/}" vs Path2 "{path2/}" INFO : Bisync successful -(20) : test changed on both paths - file5 (file5R, file5L) -(21) : touch-glob 2001-01-02 {datadir/} file5R.txt -(22) : copy-as {datadir/}file5R.txt {path2/} file5.txt -(23) : touch-glob 2001-03-04 {datadir/} file5L.txt -(24) : copy-as {datadir/}file5L.txt {path1/} file5.txt +(21) : test changed on both paths - file5 (file5R, file5L) +(22) : touch-glob 2001-01-02 {datadir/} file5R.txt +(23) : copy-as {datadir/}file5R.txt {path2/} file5.txt +(24) : touch-glob 2001-03-04 {datadir/} file5L.txt +(25) : copy-as {datadir/}file5L.txt {path1/} file5.txt -(25) : test next bisync - should be no changes except dummy -(26) : test-func -(27) : bisync +(26) : test next bisync - should be no changes except dummy +(27) : test-func +(28) : bisync INFO : Synching Path1 "{path1/}" with Path2 "{path2/}" INFO : Building Path1 and Path2 listings INFO : Path1 checking for diffs @@ -281,8 +296,8 @@ INFO : Path2: 1 changes: 1 new, 0 newer, 0 older, 0 deleted INFO : Applying changes INFO : Checking potential conflicts... ERROR : file5.txt: md5 differ -NOTICE: Local file system at {path2}: 1 differences found -NOTICE: Local file system at {path2}: 1 errors while checking +NOTICE: {path2String}: 1 differences found +NOTICE: {path2String}: 1 errors while checking INFO : Finished checking the potential conflicts. 1 differences found NOTICE: - WARNING New or changed in both paths - file5.txt NOTICE: - Path1 Renaming Path1 copy - {path1/}file5.txt..path1 diff --git a/cmd/bisync/testdata/test_volatile/scenario.txt b/cmd/bisync/testdata/test_volatile/scenario.txt index 499faf8a43759..2aedf44085763 100644 --- a/cmd/bisync/testdata/test_volatile/scenario.txt +++ b/cmd/bisync/testdata/test_volatile/scenario.txt @@ -5,6 +5,7 @@ bisync resync test changed on both paths - file5 (file5R, file5L) touch-glob 2001-01-02 {datadir/} file5R.txt +touch-glob 2023-08-26 {datadir/} file7.txt copy-as {datadir/}file5R.txt {path2/} file5.txt touch-glob 2001-03-04 {datadir/} file5L.txt copy-as {datadir/}file5L.txt {path1/} file5.txt From 16f7591ec464dd5342b68ba385ede1cbe1a497b5 Mon Sep 17 00:00:00 2001 From: nielash Date: Wed, 6 Dec 2023 01:22:00 -0500 Subject: [PATCH 128/130] bisync: update version number in docs as these changes did not make it in time for 1.65 --- docs/content/bisync.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/content/bisync.md b/docs/content/bisync.md index 947128feed143..c4758a4e53525 100644 --- a/docs/content/bisync.md +++ b/docs/content/bisync.md @@ -361,7 +361,7 @@ Behavior of `--resilient` may change in a future version. #### --backup-dir1 and --backup-dir2 -As of `v1.65`, [`--backup-dir`](/docs/#backup-dir-dir) is supported in bisync. +As of `v1.66`, [`--backup-dir`](/docs/#backup-dir-dir) is supported in bisync. Because `--backup-dir` must be a non-overlapping path on the same remote, Bisync has introduced new `--backup-dir1` and `--backup-dir2` flags to support separate backup-dirs for `Path1` and `Path2` (bisyncing between different @@ -559,9 +559,9 @@ original path on the next sync, resulting in data loss. It is therefore recommended to _omit_ `--inplace`. Files that **change during** a bisync run may result in data loss. -Prior to `rclone v1.65`, this was commonly seen in highly dynamic environments, where the filesystem +Prior to `rclone v1.66`, this was commonly seen in highly dynamic environments, where the filesystem was getting hammered by running processes during the sync. -As of `rclone v1.65`, bisync was redesigned to use a "snapshot" model, +As of `rclone v1.66`, bisync was redesigned to use a "snapshot" model, greatly reducing the risks from changes during a sync. Changes that are not detected during the current sync will now be detected during the following sync, and will no longer cause the entire run to throw a critical error. @@ -596,7 +596,7 @@ Bisync sees this as all files in the old directory name as deleted and all files in the new directory name as new. A recommended solution is to use [`--track-renames`](/docs/#track-renames), -which is now supported in bisync as of `rclone v1.65`. +which is now supported in bisync as of `rclone v1.66`. Note that `--track-renames` is not available during `--resync`, as `--resync` does not delete anything (`--track-renames` only supports `sync`, not `copy`.) @@ -629,7 +629,7 @@ instead of specifying them with command flags. (You can still override them as n ### Case (and unicode) sensitivity {#case-sensitivity} -As of `v1.65`, case and unicode form differences no longer cause critical errors, +As of `v1.66`, case and unicode form differences no longer cause critical errors, and normalization (when comparing between filesystems) is handled according to the same flags and defaults as `rclone sync`. See the following options (all of which are supported by bisync) to control this behavior more granularly: - [`--fix-case`](/docs/#fix-case) @@ -923,7 +923,7 @@ consider using the flag ### Google Docs (and other files of unknown size) {#gdocs} -As of `v1.65`, [Google Docs](/drive/#import-export-of-google-documents) +As of `v1.66`, [Google Docs](/drive/#import-export-of-google-documents) (including Google Sheets, Slides, etc.) are now supported in bisync, subject to the same options, defaults, and limitations as in `rclone sync`. When bisyncing drive with non-drive backends, the drive -> non-drive direction is controlled @@ -1354,7 +1354,7 @@ about _Unison_ and synchronization in general. ## Changelog -### `v1.65` +### `v1.66` * Copies and deletes are now handled in one operation instead of two * `--track-renames` and `--backup-dir` are now supported * Partial uploads known issue on `local`/`ftp`/`sftp` has been resolved (unless using `--inplace`) From de27759553bb799a9923d09eaa4cf42ae3909da7 Mon Sep 17 00:00:00 2001 From: nielash Date: Thu, 30 Nov 2023 19:46:11 -0500 Subject: [PATCH 129/130] bisync: normalize session name to non-canonical - fixes #7423 Before this change, bisync used the "canonical" Fs name in the filename for its listing files, including any {hexstring} suffix. An unintended consequence of this was that if a user added a backend-specific flag from the command line (thus "overriding" the config), bisync would fail to find the listing files it created during the prior run without this flag, due to the path now having a {hexstring} suffix that wasn't there before (or vice versa, if the flag was present when the session was established, and later removed.) This would sometimes cause bisync to fail with a critical error (if no listing existed with the alternate name), or worse -- it would sometimes cause bisync to use an old, incorrect listing (if old listings with the alternate name DID still exist, from before the user changed their flags.) After this change, the issue is fixed by always normalizing the SessionName to the non-canonical version (no {hexstring} suffix), regardless of the flags. To avoid a breaking change, we first check if a suffixed listing exists. If so, we rename it (and overwrite the non-suffixed version, if any.) If not, we carry on with the non-suffixed version. (We should only find a suffixed version if created prior to this commit.) The result for the user is that the same pair of paths will always use the same .lst filenames, with or without backend-specific flags. --- cmd/bisync/bilib/canonical.go | 57 ++++++++++++++++++++++++++++++++++- cmd/bisync/operations.go | 2 +- docs/content/bisync.md | 18 +---------- 3 files changed, 58 insertions(+), 19 deletions(-) diff --git a/cmd/bisync/bilib/canonical.go b/cmd/bisync/bilib/canonical.go index be99d7f2d8376..dac147670287c 100644 --- a/cmd/bisync/bilib/canonical.go +++ b/cmd/bisync/bilib/canonical.go @@ -2,12 +2,15 @@ package bilib import ( + "context" "os" + "path/filepath" "regexp" "runtime" "strings" "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/operations" ) // FsPath converts Fs to a suitable rclone argument @@ -38,5 +41,57 @@ var nonCanonicalChars = regexp.MustCompile(`[\s\\/:?*]`) // SessionName makes a unique base name for the sync operation func SessionName(fs1, fs2 fs.Fs) string { - return CanonicalPath(FsPath(fs1)) + ".." + CanonicalPath(FsPath(fs2)) + return StripHexString(CanonicalPath(FsPath(fs1))) + ".." + StripHexString(CanonicalPath(FsPath(fs2))) +} + +// StripHexString strips the (first) canonical {hexstring} suffix +func StripHexString(path string) string { + open := strings.IndexRune(path, '{') + close := strings.IndexRune(path, '}') + if open >= 0 && close > open { + return path[:open] + path[close+1:] // (trailing underscore) + } + return path +} + +// HasHexString returns true if path contains at least one canonical {hexstring} suffix +func HasHexString(path string) bool { + open := strings.IndexRune(path, '{') + if open >= 0 && strings.IndexRune(path, '}') > open { + return true + } + return false +} + +// BasePath joins the workDir with the SessionName, stripping {hexstring} suffix if necessary +func BasePath(ctx context.Context, workDir string, fs1, fs2 fs.Fs) string { + suffixedSession := CanonicalPath(FsPath(fs1)) + ".." + CanonicalPath(FsPath(fs2)) + suffixedBasePath := filepath.Join(workDir, suffixedSession) + listing1 := suffixedBasePath + ".path1.lst" + listing2 := suffixedBasePath + ".path2.lst" + + sessionName := SessionName(fs1, fs2) + basePath := filepath.Join(workDir, sessionName) + + // Normalize to non-canonical version for overridden configs + // to ensure that backend-specific flags don't change the listing filename. + // For backward-compatibility, we first check if we found a listing file with the suffixed version. + // If so, we rename it (and overwrite non-suffixed version, if any.) + // If not, we carry on with the non-suffixed version. + // We should only find a suffixed version if bisync v1.66 or older created it. + if HasHexString(suffixedSession) && FileExists(listing1) { + fs.Infof(listing1, "renaming to: %s", basePath+".path1.lst") + if !operations.SkipDestructive(ctx, listing1, "rename to "+basePath+".path1.lst") { + _ = os.Rename(listing1, basePath+".path1.lst") + } + } + if HasHexString(suffixedSession) && FileExists(listing2) { + fs.Infof(listing2, "renaming to: %s", basePath+".path2.lst") + if !operations.SkipDestructive(ctx, listing1, "rename to "+basePath+".path2.lst") { + _ = os.Rename(listing2, basePath+".path2.lst") + } else { + return suffixedBasePath + } + } + return basePath } diff --git a/cmd/bisync/operations.go b/cmd/bisync/operations.go index d845b4826aec8..e7c56c2f3f261 100644 --- a/cmd/bisync/operations.go +++ b/cmd/bisync/operations.go @@ -88,7 +88,7 @@ func Bisync(ctx context.Context, fs1, fs2 fs.Fs, optArg *Options) (err error) { } // Produce a unique name for the sync operation - b.basePath = filepath.Join(b.workDir, bilib.SessionName(b.fs1, b.fs2)) + b.basePath = bilib.BasePath(ctx, b.workDir, b.fs1, b.fs2) b.listing1 = b.basePath + ".path1.lst" b.listing2 = b.basePath + ".path2.lst" b.newListing1 = b.listing1 + "-new" diff --git a/docs/content/bisync.md b/docs/content/bisync.md index c4758a4e53525..30d45b8840253 100644 --- a/docs/content/bisync.md +++ b/docs/content/bisync.md @@ -614,19 +614,6 @@ and there is also a [known issue concerning Google Drive users with many empty d For now, the recommended way to avoid using `--fast-list` is to add `--disable ListR` to all bisync commands. The default behavior may change in a future version. -### Overridden Configs - -When rclone detects an overridden config, it adds a suffix like `{ABCDE}` on the fly -to the internal name of the remote. Bisync follows suit by including this suffix in its listing filenames. -However, this suffix does not necessarily persist from run to run, especially if different flags are provided. -So if next time the suffix assigned is `{FGHIJ}`, bisync will get confused, -because it's looking for a listing file with `{FGHIJ}`, when the file it wants has `{ABCDE}`. -As a result, it throws -`Bisync critical error: cannot find prior Path1 or Path2 listings, likely due to critical error on prior run` -and refuses to run again until the user runs a `--resync` (unless using `--resilient`). -The best workaround at the moment is to set any backend-specific flags in the [config file](/commands/rclone_config/) -instead of specifying them with command flags. (You can still override them as needed for other rclone commands.) - ### Case (and unicode) sensitivity {#case-sensitivity} As of `v1.66`, case and unicode form differences no longer cause critical errors, @@ -974,10 +961,6 @@ skip them.) To work around this, use the default (modtime and size) instead of To ignore Google Docs entirely, use [`--drive-skip-gdocs`](/drive/#drive-skip-gdocs). -(Note that all flags starting with `--drive` are backend-specific, and -therefore will cause the behavior explained in [Overridden -Configs](/#overridden-configs).) - ## Usage examples ### Cron {#cron} @@ -1369,6 +1352,7 @@ for performance improvements and less [risk of error](https://forum.rclone.org/t * Google Docs (and other files of unknown size) are now supported (with the same options as in `sync`) * Equality checks before a sync conflict rename now fall back to `cryptcheck` (when possible) or `--download`, instead of of `--size-only`, when `check` is not available. +* Bisync no longer fails to find the correct listing file when configs are overridden with backend-specific flags. ### `v1.64` * Fixed an [issue](https://forum.rclone.org/t/bisync-bugs-and-feature-requests/37636#:~:text=1.%20Dry%20runs%20are%20not%20completely%20dry) From 7b78acfe6fc6bf00ae9386e528a4b5be05d5e7ec Mon Sep 17 00:00:00 2001 From: nielash Date: Mon, 4 Dec 2023 07:37:05 -0500 Subject: [PATCH 130/130] bisync: document beta status more clearly - fixes #6082 --- cmd/bisync/cmd.go | 3 ++- cmd/bisync/help.go | 5 +++++ docs/content/bisync.md | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cmd/bisync/cmd.go b/cmd/bisync/cmd.go index fafbfaff5506f..76768248e977c 100644 --- a/cmd/bisync/cmd.go +++ b/cmd/bisync/cmd.go @@ -138,6 +138,7 @@ var commandDefinition = &cobra.Command{ Annotations: map[string]string{ "versionIntroduced": "v1.58", "groups": "Filter,Copy,Important", + "status": "Beta", }, RunE: func(command *cobra.Command, args []string) error { cmd.CheckArgs(2, 2, command, args) @@ -163,7 +164,7 @@ var commandDefinition = &cobra.Command{ } } - fs.Logf(nil, "bisync is EXPERIMENTAL. Don't use in production!") + fs.Logf(nil, "bisync is IN BETA. Don't use in production!") cmd.Run(false, true, command, func() error { err := Bisync(ctx, fs1, fs2, &opt) if err == ErrBisyncAborted { diff --git a/cmd/bisync/help.go b/cmd/bisync/help.go index 61c944a5928ca..68ad27570320d 100644 --- a/cmd/bisync/help.go +++ b/cmd/bisync/help.go @@ -56,5 +56,10 @@ On each successive run it will: Changes include |New|, |Newer|, |Older|, and |Deleted| files. - Propagate changes on Path1 to Path2, and vice-versa. +Bisync is **in beta** and is considered an **advanced command**, so use with care. +Make sure you have read and understood the entire [manual](https://rclone.org/bisync) +(especially the [Limitations](https://rclone.org/bisync/#limitations) section) before using, +or data loss can result. Questions can be asked in the [Rclone Forum](https://forum.rclone.org/). + See [full bisync description](https://rclone.org/bisync/) for details. `) diff --git a/docs/content/bisync.md b/docs/content/bisync.md index 30d45b8840253..6d8e5cd1ba8e3 100644 --- a/docs/content/bisync.md +++ b/docs/content/bisync.md @@ -2,8 +2,13 @@ title: "Bisync" description: "Bidirectional cloud sync solution in rclone" versionIntroduced: "v1.58" +status: Beta --- +## Bisync +`bisync` is **in beta** and is considered an **advanced command**, so use with care. +Make sure you have read and understood the entire [manual](https://rclone.org/bisync) (especially the [Limitations](#limitations) section) before using, or data loss can result. Questions can be asked in the [Rclone Forum](https://forum.rclone.org/). + ## Getting started {#getting-started} - [Install rclone](/install/) and setup your remotes.