Compare commits

...
177 Commits
Author SHA1 Message Date
Nick Craig-Wood 118e26f8e2 Version v1.36 2017-03-18 11:16:43 +00:00
Nick Craig-Wood 5355881332 local: fix unnormalised unicode causing problems reading directories #1212 2017-03-16 22:37:56 +00:00
Nick Craig-Wood b94b50a808 Prepare website for https 2017-03-16 22:36:23 +00:00
Nick Craig-Wood 9b07d32c02 onedrive, drive, amazonclouddrive: make sure we find the root
This fixes copyto copying things to the wrong place - fixes #1231
2017-03-16 09:42:49 +00:00
Nick Craig-Wood 986a2851bf onedrive: make sure we create root for server side copy 2017-03-15 19:40:58 +00:00
Nick Craig-Wood 6474f2c7c2 onedrive: fix uploading empty files with go1.8 2017-03-15 14:01:08 +00:00
Nick Craig-Wood 99f7fe736a onedrive: implement Move #197 2017-03-15 14:01:08 +00:00
Nick Craig-Wood e80d8db417 Fix typo in option name 2017-03-13 12:51:01 +00:00
Nick Craig-Wood 320c53eab0 Start Cat tests from 2 as onedrive doesn't support ranging from 1
This has been reported here: https://github.com/OneDrive/onedrive-api-docs/issues/543
2017-03-12 14:24:33 +00:00
Nick Craig-Wood 4d5b73df85 Fix TestListDirSorted eventual consistency listing problems 2017-03-12 14:00:22 +00:00
Nick Craig-Wood 0faf82702b onedrive: fix waitForJob to parse errors correctly #1224 2017-03-12 12:00:10 +00:00
Nick Craig-Wood 194a8f56e1 rest: Implement IgnoreStatus option to not parse the error return 2017-03-12 11:44:43 +00:00
Nick Craig-Wood f046c00d3b onedrive: fix overwrite detection in Copy - fixes #1224 2017-03-11 22:22:13 +00:00
Nick Craig-Wood 488353c977 acd: Fix Move returning nil objects and nil error #1226 2017-03-09 21:32:50 +00:00
Nick Craig-Wood c45c604997 onedrive: fix NewObject so it doesn't return an object when given a directory 2017-03-06 20:11:54 +00:00
Nick Craig-Wood b2a4ea9304 fs/buffer: Fix panic on concurrent Read/Close - fixes #1213 2017-03-06 19:22:17 +00:00
Nick Craig-Wood 8dc7bf883d vendor: Update go-acd 2017-03-06 19:21:18 +00:00
Nick Craig-Wood 61f186c8a3 Add missing dependency 2017-03-05 10:24:46 +00:00
Nick Craig-Wood e88623e3c8 Add cryptcheck and obscure to docs 2017-03-05 10:19:22 +00:00
Nick Craig-Wood 4652db34a4 Update config docs - fixes #1174 2017-03-05 10:14:57 +00:00
Dedsec1 05d72385b5 created .pkgr.yml file for automated apt-get 2017-03-04 12:19:23 +00:00
Dedsec1 9bb408e1a9 Update snapcraft.yaml 2017-03-04 12:05:48 +00:00
Nick Craig-Wood 10e532bce9 Fix --files-from with an empty file copying everything - fixes #1196 2017-03-04 10:12:54 +00:00
Nick Craig-Wood 4ab7e05e02 Fix MimeType propagation
In fs.Copy, don't wrap objects if possible, and if not, then add a
MimeType method into the wrapped object.
2017-03-04 10:10:55 +00:00
Nick Craig-Wood 1cc58e4e09 mount: fix logging for unimplemented file open modes #1195 2017-03-02 22:07:01 +00:00
Nick Craig-Wood fdaac6df67 local: open files in write only mode so they can write to an rclone mount
Fixes #1195
2017-03-02 22:03:07 +00:00
Nick Craig-Wood 1d42a343d2 b2: fix inconsistent listings and rclone check
This was caused by re-using a variable for the results of a JSON
unmarshal and the unmarshaller picking up existing entries.

See https://forum.rclone.org/t/check-command-gives-unreliable-results/
2017-03-02 15:08:31 +00:00
Nick Craig-Wood 0ce34be41d Fix bulleted list doc formatting errors - fixes #1170 2017-03-02 15:07:25 +00:00
Nick Craig-Wood 5fba913207 local: fix detection of directories in new object creation
This stops the local listing erroring on all symlinks
2017-02-27 17:03:31 +00:00
Nick Craig-Wood f7252645ba Make the Makefile build rclone with the correct version number by default 2017-02-27 11:53:03 +00:00
Nick Craig-Wood e48d19f895 acd: make file size warning at Info level so it appears by default 2017-02-26 13:23:12 +00:00
Nick Craig-Wood 6bad0ad9c4 Fix installation instructions to install in /usr/bin not /usr/sbin 2017-02-26 10:09:23 +00:00
Nick Craig-Wood dc5b7dc102 rest: don't duplicate headers on redirect now go1.8 does it 2017-02-25 21:41:03 +00:00
Nick Craig-Wood 55eafb3a9a gcs: fix depth 1 directory listings 2017-02-25 16:03:29 +00:00
Nick Craig-Wood 5b6dd36307 dropbox, yandex: fix return of wrapped nil introduced in 79e3c67bbd 2017-02-25 15:23:27 +00:00
Nick Craig-Wood 175c39e1d0 b2: fix uploading empty files with go1.8 2017-02-25 15:22:14 +00:00
Nick Craig-Wood 84b12574de sftp: fix detection of file vs directory 2017-02-25 14:31:27 +00:00
Nick Craig-Wood efbb040e3f yandex: fix single level directory listing 2017-02-25 13:41:24 +00:00
Nick Craig-Wood 79e3c67bbd local, yandex, dropbox: fix NewObject suceeding on a directory #1079
Add tests to make it consistent across all remotes
2017-02-25 11:09:57 +00:00
Nick Craig-Wood 527099ae72 dropbox: normalise the case for single level directory listings #1165
This should fix directory at a time syncs having strange case.
2017-02-24 22:49:29 +00:00
Nick Craig-Wood e2f0feef3c Add debugging to print hash values on failed hash comparison 2017-02-23 11:23:19 +00:00
Nick Craig-Wood 30e97ad9ec Fix parsing of remotes in moveto and copyto - fixes #1079 2017-02-22 22:09:33 +00:00
Nick Craig-Wood 07dc76eff0 Remove unused test file 2017-02-22 20:58:24 +00:00
Nick Craig-Wood e59dc81658 Stop --track-renames deleting case folded source files - fixes #1094
What was happening is that when Move was implemented as Copy + Delete,
MoveFile was seeing the files didn't need transferring (because they
were identical) then deleted the source.

The fix uses Move instead and patches onedrive to disallow a case
folded identical copy (which errors with 500 error)
2017-02-22 19:28:22 +00:00
Nick Craig-Wood f40443359d Fix exit code docs - fixes #1169 2017-02-22 18:00:56 +00:00
Nick Craig-Wood 6b0f2ef4bd Fix --delete-before deleting files on copy - fixes #1166 2017-02-22 13:17:38 +00:00
Nick Craig-Wood 12aa03f5b8 dropbox: fix depth 1 listing - fixes #1165 2017-02-22 12:48:16 +00:00
Nick Craig-Wood 73a96dc588 Improve directory listing tests to detect issue #1165 2017-02-22 11:53:40 +00:00
Nick Craig-Wood 980cd5bfd8 Put the -beta-latest files at the root of beta.rclone.org - fixes #1047 2017-02-20 18:03:02 +00:00
Nick Craig-Wood 86cc9f3dfb Include git-log.txt into beta releases - fixes #1047 2017-02-20 17:08:07 +00:00
Nick Craig-Wood 1ae604fcf4 cross-compile: make rclone-beta-latest* for download #1047 2017-02-20 16:58:46 +00:00
Nick Craig-Wood 5e93fe96d3 cross-compile: add missing .exe suffix to windows binaries 2017-02-20 16:36:54 +00:00
Nick Craig-Wood 31745320c8 Log the rclone version at the end of the run - fixes #847 2017-02-20 16:36:25 +00:00
Nick Craig-Wood 2da6cd7f84 Introduce AtExit to fix --cpuprofile and --memprofile to write profiles at end of run 2017-02-20 16:33:45 +00:00
Nick Craig-Wood 6e0e1ad9cb Add more description to the snapcraft files 2017-02-18 12:02:04 +00:00
Dedsec1 dd62c94d05 Create dev-snapcraft.yaml for current snapshot rclone 2017-02-18 11:53:12 +00:00
Nick Craig-Wood ee70b99143 Add Hisham Zarka to contributors 2017-02-18 11:42:26 +00:00
Hisham Zarka b3a526814e fix --ignore-checksum 2017-02-18 13:13:53 +04:00
Nick Craig-Wood 69a15ae173 Replace gox with a go script to do cross compiling
gox wasn't building the mips binaries for some reason.
2017-02-17 21:54:32 +00:00
Nick Craig-Wood 1d7f95da8e Support MIPS big and little endian - fixes #849 2017-02-17 19:11:08 +00:00
Nick Craig-Wood 8ec57d145e Update vendor directory
Re-added cobra patch 499475bb41
2017-02-17 16:49:51 +00:00
Nick Craig-Wood 3ef9f6f016 mount: add test scripts 2017-02-17 11:37:19 +00:00
Nick Craig-Wood 990b676e13 travis: only run go latest on OS X and include go tip, but allow failures
fixup
2017-02-17 10:34:29 +00:00
Nick Craig-Wood 5cdfe9c7ae Updae to go1.8 2017-02-17 09:40:14 +00:00
Nick Craig-Wood 033d1eb7af Refactor Account interface 2017-02-17 09:15:24 +00:00
Nick Craig-Wood ac62ef430d Prevent double closes on async buffer 2017-02-17 08:55:24 +00:00
Nick Craig-Wood 928be0f1fd mount: fix seek with buffering to use correct interface
Stop pre-cache before seeking which stops lots of excess data transfer
2017-02-17 08:55:24 +00:00
Nick Craig-Wood 6f75290678 Make async buffering start slowly to improve seek performance 2017-02-17 08:26:14 +00:00
Dedsec1 8c2b50c7ed Update snapcraft.yaml 2017-02-16 22:25:44 +00:00
Nick Craig-Wood 2b1695e09b Add Dedsec1 to contributors 2017-02-16 22:22:47 +00:00
Nick Craig-Wood ef604f6100 mount: implement renaming directories - fixes #954
This also fixes various caching issues renaming files.
2017-02-16 17:42:38 +00:00
Nick Craig-Wood f3c5745468 Add srcRemote and dstRemote parameters to DirMove #954 2017-02-16 17:42:37 +00:00
Nick Craig-Wood e4835f535d sftp: remove stray debug 2017-02-16 12:40:29 +00:00
Nick Craig-Wood 33c2873ae9 drive: Fix Rmdir on directories with trashed files - fixes #1040
When we try to delete a directory which is empty other than with
trashed files, we trash the directory rather than deleting it.
2017-02-16 12:29:37 +00:00
Nick Craig-Wood dac4bb22d3 mount: Make include and exclude filters apply to mount - fixes #1060 2017-02-15 23:28:53 +00:00
Nick Craig-Wood b52c80e85c sync: don't update mod times if --dry-run set - fixes #1100 2017-02-15 23:09:44 +00:00
Nick Craig-Wood f15c6b68b6 Re-add the async buffer on seek - fixes #1137 2017-02-15 22:54:21 +00:00
Nick Craig-Wood 3f778d70f7 Add sync.Pool to async reader 2017-02-15 22:37:58 +00:00
Dedsec1 6fc114d681 Create Ubuntu snap for rclone #1120 2017-02-15 09:56:55 +00:00
Nick Craig-Wood 9a9d09845c mount: put read and write async buffers back - control with --buffer-size #1043 2017-02-14 22:59:52 +00:00
Nick Craig-Wood 7fa687b3e1 fs: Async buffer: use ReadFill to fill the chunks and increase to 1MB 2017-02-14 22:36:37 +00:00
Nick Craig-Wood 493da54113 Add --buffer-size parameter to control buffer size for copy 2017-02-14 22:36:37 +00:00
Nick Craig-Wood 541929258b check: Add --download flag to check all the data, not just hashes 2017-02-13 10:48:26 +00:00
Nick Craig-Wood 370f242fa2 local: Fix interaction between -x flag and --max-depth - fixes #1126
This was causing the by directory sync to ignore the -x flag because
it was putting directories into the listing which should have been
excluded.
2017-02-13 09:24:29 +00:00
Nick Craig-Wood 7047c67a5e sync: Fix log message containing <nil> 2017-02-13 09:23:21 +00:00
Nick Craig-Wood 18c75a81f9 Add notes on cryptcheck and backups to crypt docs 2017-02-12 16:49:31 +00:00
Nick Craig-Wood 01c747e7db Add cryptcheck command to check integrity of crypt remotes #1102 2017-02-12 16:30:18 +00:00
Nick Craig-Wood 186aedda98 Fix go vet on go 1.7 2017-02-12 12:43:13 +00:00
Nick Craig-Wood ca0e25b1a1 Remove spurious comment 2017-02-12 10:56:52 +00:00
Nick Craig-Wood f87a694d10 Make donation page easier to find and add bitcoin address 2017-02-11 23:03:05 +00:00
Nick Craig-Wood 006227baed Replace -v with -vv where necessary or change Debugf to Logf 2017-02-11 20:27:46 +00:00
Nick Craig-Wood 4d28b5ed22 Update list of commands in docs. 2017-02-11 20:27:46 +00:00
Nick Craig-Wood 499475bb41 Fix -vv by temporarily patching vendored cobra
This is a temporary fix until this pull request gets merged

https://github.com/spf13/cobra/pull/391

See original ticket

https://github.com/spf13/pflag/issues/112
2017-02-11 20:27:46 +00:00
Nick Craig-Wood 666dae4229 Add --syslog flag to optionally log to syslog on capable platforms 2017-02-11 20:27:46 +00:00
Nick Craig-Wood ac1c041377 Redo log level flags
* -vv or --log-level DEBUG
  * -v or --log-level INFO
  * --log-level NOTICE (default)
  * -q --log-level ERROR

Replace Config.Verbose and Config.Quiet with Config.LogLevel

Fixes #739 Fixes #1108 Fixes #1000
2017-02-11 20:22:42 +00:00
Nick Craig-Wood 0366ea39c5 Reassign some logging levels 2017-02-11 17:56:05 +00:00
Nick Craig-Wood 80f53176d9 Rename log functions and factor into own file 2017-02-11 17:54:50 +00:00
Nick Craig-Wood 40c02989f1 acd: Fix panic on token expiry - fixes #1117 2017-02-11 17:49:59 +00:00
Nick Craig-Wood 50e190ff54 cat: don't allocate buffers if not needed to reduce memory usage 2017-02-09 11:46:53 +00:00
Nick Craig-Wood dd20a297d6 cat: Fix go routine leak 2017-02-09 11:25:36 +00:00
Nick Craig-Wood c0ad29c06c Clarify logging and docs for --no-traverse incompatibilities - fixes #1059 2017-02-08 22:35:12 +00:00
Nick Craig-Wood d091d4a8bb rclone cat: add --head, --tail, --offset, --count and --discard
Fixes #819
2017-02-08 08:09:41 +00:00
Nick Craig-Wood 381b845307 acd: Fix nil pointer deref after Move #1098
Don't attempt to read the info in moveNode as there are paths which
don't, read it again from the directory afterwards.
2017-02-04 12:56:21 +00:00
Nick Craig-Wood 48cdedc97b Re-implement sync routine to work a directory at a time
Multiple directories (up to --checkers worth) are scanned at once.

This uses much less memory than the previous scheme - only the amount
of memory needed to hold an entire directory listing of objects.

For directory based remotes the speed is unchanged.

For bucket based remotes, instead of doing one API call to list the
whole bucket, it does multiple calls, one for each pseudo directory.
However these are done in parallel so in practice this seems to speed
up directory listings.

This replaces the existing sync method as it performs faster and uses
less memory.

The old sync method is available with the temporary --old-sync-method
flag.

Fixes #517
Fixes #439
Fixes #236
Fixes #1067
2017-02-04 10:30:25 +00:00
Nick Craig-Wood 7c6cd3a9e1 Make --delete-after the default and refactor --delete-{before,during,after} parsing 2017-02-04 10:30:25 +00:00
Nick Craig-Wood bcdd73369f Ignore --delete-before with --track-renames 2017-02-04 10:30:25 +00:00
Nick Craig-Wood 86bec20b56 sync: factor accumulating the rename checks 2017-02-04 10:30:25 +00:00
Nick Craig-Wood c3b2b89473 Add ListDirSorted function to list a directory
* fix error return of readFilesFn also
2017-02-04 10:30:25 +00:00
Nick Craig-Wood 85f05c57d1 Clean empty directories between test runs 2017-02-04 10:30:25 +00:00
Nick Craig-Wood 16d91246c4 sftp: Fix remote race on creating directories
Because there is a period of time between checking a directory needs
creating and creating it, the leads to errors where directories are
attempting to be created twice.

Add locking on a per directory basis to fix while doing mkdir.
2017-02-04 10:29:46 +00:00
Nick Craig-Wood 726cb43be9 Complete SFTP remote #521
* Add unit tests
  * Fix up remote so it passes tests
  * Add docs
2017-02-04 10:29:46 +00:00
Nick Craig-Wood 288302c2cf Make fallback purge delete empty directories too.
This was implemented to make the SFTP unit tests pass.
2017-02-04 10:29:46 +00:00
Nick Craig-Wood 609671aabc Add Jack Schmidt to contributors 2017-02-04 10:29:46 +00:00
Jack Schmidt b9a8315696 Basic SFTP support, Issue #521 2017-02-04 10:29:18 +00:00
Jack Schmidt 27e18b6efa sftp: add required packages to vendor 2017-02-04 10:29:18 +00:00
Nick Craig-Wood 9d331ce04b Implement --ignore-checksum flag
Fixes #793 Fixes #863 Fixes #981
2017-02-03 08:11:10 +00:00
Nick Craig-Wood 916569102c b2: constrain memory usage when doing multipart uploads #439
Each part of a multipart upload takes 96M of memory, so we make sure
that we don't user more than `--transfers` * 96M of memory buffering
the multipart uploads.

This has the consequence that some uploads may appear to be at 0% for
a while, however they will get going eventually so this won't
re-introduce #731.
2017-02-03 08:03:04 +00:00
Nick Craig-Wood 28f9b9b611 drive: detect files using file size as well as md5 - fixes 980 2017-02-03 08:00:03 +00:00
Nick Craig-Wood 7679620f4b drive: Experimentally add --drive-list-chunk 2017-02-02 21:49:02 +00:00
Nick Craig-Wood 8a11da4e14 mount: Make fsync be a no-op for direectories too #1045 2017-02-02 21:31:41 +00:00
Nick Craig-Wood f11867d810 Add Jon Yergatian to contributors 2017-02-02 21:14:24 +00:00
Jon Yergatian 6f8501e9a1 s3: Added ca-central-1 region 2017-02-02 21:14:10 +00:00
Nick Craig-Wood 37fe6d56e5 mount: fix docs for umount flags - fixes #1036 2017-01-30 18:17:16 +00:00
Nick Craig-Wood ff8f11d79c Add Károly Oláh to contributors 2017-01-29 20:55:21 +00:00
okaresz cbc113492a Add Drive specific option: --drive-skip-gdocs - fixes #1035 2017-01-29 20:53:51 +00:00
Nick Craig-Wood 74702554da onedrive: use token renewer to stop auth errors on long uploads
Fixes #820
2017-01-29 20:45:45 +00:00
Nick Craig-Wood bd29015022 Factor token renewer from amazonclouddrive to oauthutil 2017-01-29 20:45:44 +00:00
Nick Craig-Wood 2192805360 rclone config: when choosing from a list, allow the value to be entered 2017-01-29 15:51:26 +00:00
Nick Craig-Wood db0b93c0ad rclone config: allow rename and copy of remotes - fixes #641 2017-01-29 15:37:44 +00:00
Nick Craig-Wood 94947f2523 Implement -L, --copy-links flag to allow rclone to follow symlinks
Fixes #40
2017-01-29 13:43:20 +00:00
Nick Craig-Wood 29c6e22024 mount: Make fsync be a no-op rather than returning an error - fixes #1045 2017-01-29 11:29:42 +00:00
Nick Craig-Wood 390f3cf35b crypt: Add --crypt-show-mapping to show encrypted file mapping
Fixes #1004
2017-01-29 10:14:17 +00:00
Nick Craig-Wood 20c033b484 Add a writing documentation section and update document 2017-01-29 09:47:47 +00:00
Nick Craig-Wood 8068ef96b6 Add Dario Giovannetti to contributors 2017-01-26 10:29:21 +00:00
Dario Giovannetti 9d36258923 Comply with XDG Base Directory specification
Fixes #868
2017-01-26 10:22:08 +00:00
Nick Craig-Wood 9fdeb82328 Fix tests under Windows 2017-01-20 17:12:05 +00:00
Nick Craig-Wood 2abfae283c crypt: fix crypt writer getting stuck in a loop #902
This happened when the underlying reader returned io.ErrUnexpectedEOF.
The error handling for the call to io.ReadFull failed to take this
into account.

io.ErrUnexpectedEOF is reasonably common when SSL connections go wrong
when communicating with ACD, so it manifested itself as transfers from
non-encrypted ACD to encrypted ACD getting stuck.
2017-01-20 16:00:55 +00:00
Nick Craig-Wood b6848a3edb Fix race in Lister.Finished which was causing the tests to be unreliable 2017-01-19 20:11:17 +00:00
Nick Craig-Wood e2bf9eb8e9 Implement --suffix for use with --backup-dir only #98
This also makes sure we remove files we are about to override in the
--backup-dir properly.
2017-01-19 20:11:17 +00:00
Nick Craig-Wood a77659e47d Make directory listing checks more reliable and easier to read 2017-01-19 20:11:17 +00:00
Nick Craig-Wood e9da14ac2e acd: After moving a file, wait for the file to no longer be in the directory
This fixes a Move followed quickly by a Copy updating the wrong file.
2017-01-19 20:11:17 +00:00
Nick Craig-Wood a4bf22e620 b2: fix upload url not being refreshed properly #825 2017-01-17 17:34:21 +00:00
Nick Craig-Wood a6b4065e13 mount: fix retry on network failure when reading off crypt - fixes #1042 2017-01-17 16:32:04 +00:00
Nick Craig-Wood 07ebf35987 Clarify what happens to files already in the --backup-dir DIR 2017-01-16 19:26:56 +00:00
Nick Craig-Wood 47ebd0789c Make "make quicktest" ignore a config file if present for local running
This means "make quicktest" should give the same result as when run by
Travis.
2017-01-16 17:54:18 +00:00
Nick Craig-Wood 166fd50451 oauthutil: copy the config before modifying it
The stops simultaneous use of oauth configs with different client IDs
causing a problem.
2017-01-16 17:33:25 +00:00
Nick Craig-Wood 0604d3dbf2 acd, onedrive: make sure we have found the root before purging
If we don't, purge can try to trash the root node which fortunately
doesn't succeed.
2017-01-16 17:33:25 +00:00
Nick Craig-Wood 1fa258c2b4 Define a new Features() method for Fs
Optional interfaces are becoming more important in rclone,
--track-renames and --backup-dir both rely on them.

Up to this point rclone has used interface upgrades to define optional
behaviour on Fs objects.  However when one Fs object wraps another it
is very difficult for this scheme to work accurately.  rclone has
relied on specific error messages being returned when the interface
isn't supported - this is unsatisfactory because it means you have to
call the interface to see whether it is supported.

This change enables accurate detection of optional interfaces by use
of a Features struct as returned by an obligatory Fs.Features()
method.  The Features struct contains flags and function pointers
which can be tested against nil to see whether they can be used.

As a result crypt and hubic can accurately reflect the capabilities of
the underlying Fs they are wrapping.
2017-01-16 17:33:25 +00:00
ncw 3745c526f1 Implement --backup-dir - fixes #98
The parameter of backup-dir specifies a remote that all deleted or
overwritten files will be copied to.
2017-01-16 17:33:25 +00:00
Nick Craig-Wood c123c702ab Fix fs.Overlapping and factor fs.SameConfig 2017-01-14 09:55:53 +00:00
ncw 4aae7bcca6 Factor server side move detection 2017-01-14 09:55:53 +00:00
Nick Craig-Wood aa62e93094 acd: fix panic when renaming files - fixes #973
Fixed by no longer overwriting the parameters in a retry loop
2017-01-14 09:50:45 +00:00
Nick Craig-Wood 45862f4c16 Add Brandur to contributors 2017-01-12 10:08:40 +00:00
Brandur 3b1e0b66bb Return error on not found from ListFn
This changes `ListFn`'s implementation so that if it encounters a not
found error, instead of sending a fatal error to log, it coordinates the
return of the error between checker goroutines and sends it back to the
caller.

The main impetus here is that it allows an external program compiling
against rclone as a package to handle a not found, where it currently it
cannot.

This does change error output on a not found a little bit, we go from
this:

    2017/01/09 21:14:03 directory not found

To this:

    2017/01/09 21:13:44 Failed to ls: directory not found
2017-01-12 10:07:59 +00:00
Nick Craig-Wood a7d8ccd265 Add T.C. Ferguson to contributors 2017-01-10 13:22:51 +00:00
T.C. Ferguson d4c923a5cc Add obscure command for generating encrypted passwords for rclone's config 2017-01-10 13:18:09 +00:00
Nick Craig-Wood e426cb1d1a Add emyarod to contributors 2017-01-10 13:13:14 +00:00
emyarod 3c87a0d0dc Update remote docs to show correct setup process 2017-01-10 13:09:52 +00:00
0xJAKE 499766f6ab Update amazonclouddrive.md
Added details about Amazon Drive's latest trash retention policy.
See:
https://www.reddit.com/r/DataHoarder/comments/5dh96j/files_in_amazon_cloud_drive_trash_now_deleted/
https://www.amazon.com/gp/help/customer/display.html?nodeId=201376760
2017-01-08 10:24:03 -06:00
Nick Craig-Wood 35a6436983 mount: implement proper directory handling (mkdir, rmdir)
Before this change mount only simulated rmdir & mkdir, now it actually
runs mkdir & rmdir on the underlying remote, using the new parmaeters
to fs.Mkdir and fs.Rmdir.

Fixes #956
2017-01-06 11:24:22 +00:00
Nick Craig-Wood 341745d4d5 Update docs on server side copy 2017-01-05 21:11:46 +00:00
Nick Craig-Wood 78c1f2839e Fix filters to add ** rules to directory rules
This fixes `--exclude ".*{,/**}"` to exclude all . files and
. directories.
2017-01-05 19:33:49 +00:00
Nick Craig-Wood de2d967abd Stop --track-renames hashing matching files - fixes #984
Also only hash files of the correct size.

This speeds it up a lot.
2017-01-05 17:58:01 +00:00
Marco Paganini 6611d92e21 Only start bandwidth ticker when necessary.
- Only start the token ticker when the timetable entry has more than one
  entry.
- This fixes the "Scheduled bandwidth change" log message when no
  bwlimit is specified.
- Fixes #987
2017-01-04 19:03:49 -08:00
Nick Craig-Wood e1a49ca426 Document environment variable usage 2017-01-04 21:38:54 +00:00
Nick Craig-Wood f73ee5eade Make all config file variables be settable in the environment
These are set in the form RCLONE_CONFIG_remote_option where remote is
the uppercased remote name and option is the uppercased config file
option name.  Note that RCLONE_CONFIG_remote_TYPE must be set if
defining a new remote.

Fixes #616
2017-01-03 22:42:47 +00:00
Nick Craig-Wood 0d75d2585f Allow all options to be set from environment variables
The option names are munged changing - to _ making upper case and
prepending RCLONE_.  The values are as parsed by pflag.
2017-01-03 22:42:47 +00:00
Marco Paganini 3b0f944e23 Add time-based bandwidth limits.
- Change the --bwlimit command line parameter to accept both a limit (as
  before) or a full timetable (formatted as "hh:mm,limit
  hh:mm,limit...")
- The timetable is checked once a minute by a ticker function. A new
  tokenBucket is created every time a bandwidth change is necessary.
- This change is compatible with the SIGUSR2 change to toggle bandwidth
  limits.

This resolves #221.
2017-01-03 21:00:38 +00:00
Nick Craig-Wood aaeab58ce6 Add Lukas Loesche to contributors 2017-01-03 20:49:04 +00:00
Lukas Loesche 5894c02a34 Typo: the the -> the in docs and comments 2017-01-03 20:48:26 +00:00
Nick Craig-Wood f1221b510b Change --track-renames to use the length,hash pair stored in a map
This makes it much faster in the case of many files and use less
memory.

This also detects use of --no-traverse and disables it.
2017-01-03 20:37:06 +00:00
Nick Craig-Wood 274ab349f4 sync: Only allow --track-renames if have a common hash 2017-01-03 20:35:05 +00:00
Nick Craig-Wood 86392fb800 Add Bjørn Erik Pedersen to contributors 2017-01-03 20:35:05 +00:00
Bjørn Erik Pedersen adc156ab2a docs: Document track-renames option
See #888
2017-01-03 20:35:05 +00:00
Bjørn Erik Pedersen 47d3a450a4 sync: Track and perform server-side renames
This commits adds support for tracking of file renames if `track-renames` flag is set,
and it then performs server-side renames for remotes that support it, i.e.
remotes that implement either the `Mover` or the `Copier` interface.

Fixes #888
2017-01-03 20:35:05 +00:00
Nick Craig-Wood 5c89fd679d Fix incorrect vendoring for swift library
(vendored a feature branch by accident)
2017-01-03 17:39:56 +00:00
Nick Craig-Wood 1cad759306 Update vendor directory 2017-01-02 16:12:05 +00:00
490 changed files with 51727 additions and 8590 deletions

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
default_dependencies: false
cli: false
+9 -2
View File
@@ -3,11 +3,12 @@ sudo: false
osx_image: xcode7.3
os:
- linux
- osx
go:
- 1.5.4
- 1.6.4
- 1.7.4
- 1.8
- tip
install:
- git fetch --unshallow --tags
- make vars
@@ -18,10 +19,16 @@ script:
env:
matrix:
secure: gU8gCV9R8Kv/Gn0SmCP37edpfIbPoSvsub48GK7qxJdTU628H0KOMiZW/T0gtV5d67XJZ4eKnhJYlxwwxgSgfejO32Rh5GlYEKT/FuVoH0BD72dM1GDFLSrUiUYOdoHvf/BKIFA3dJFT4lk2ASy4Zh7SEoXHG6goBlqUpYx8hVA=
matrix:
allow_failures:
- go: tip
include:
- os: osx
go: 1.8
deploy:
provider: script
script: make travis_beta
on:
branch: master
go: 1.7.4
go: 1.8
condition: "`uname` == 'Linux'"
+29 -12
View File
@@ -4,13 +4,18 @@ This is a short guide on how to contribute things to rclone.
## Reporting a bug ##
Bug reports are welcome. Check your issue exists with the latest
version first. Please add when submitting:
If you've just got a question or aren't sure if you've found a bug
then please use the [rclone forum](https://forum.rclone.org/) instead
of filing an issue.
When filing an issue, please include the following information if
possible as well as a description of the problem. Make sure you test
with the [latest beta of rclone](http://beta.rclone.org/):
* Rclone version (eg output from `rclone -V`)
* Which OS you are using and how many bits (eg Windows 7, 64 bit)
* The command you were trying to run (eg `rclone copy /tmp remote:tmp`)
* A log of the command with the `-v` flag (eg output from `rclone -v copy /tmp remote:tmp`)
* A log of the command with the `-vv` flag (eg output from `rclone -vv copy /tmp remote:tmp`)
* if the log contains secrets then edit the file with a text editor first to obscure them
## Submitting a pull request ##
@@ -43,7 +48,7 @@ When ready - run the unit tests for the code you changed
go test -v
Note that you make need to make a test remote, eg `TestSwift` for some
Note that you may need to make a test remote, eg `TestSwift` for some
of the unit tests.
Note the top level Makefile targets
@@ -59,7 +64,7 @@ packages which you can install with
Make sure you
* Add documentation for a new feature
* Add documentation for a new feature (see below for where)
* Add unit tests for a new feature
* squash commits down to one per feature
* rebase to master `git rebase master`
@@ -111,16 +116,28 @@ then run in that directory
go run test_all.go
## Writing Documentation ##
If you are adding a new feature then please update the documentation.
If you add a new flag, then if it is a general flag, document it in
`docs/content/docs.md` - the flags there are supposed to be in
alphabetical order. If it is a remote specific flag, then document it
in `docs/content/remote.md`.
The only documentation you need to edit are the `docs/content/*.md`
files. The MANUAL.*, rclone.1, web site etc are all auto generated
from those during the release process. See the `make doc` and `make
website` targets in the Makefile if you are interested in how. You
don't need to run these when adding a feature.
Documentation for rclone sub commands is with their code, eg
`cmd/ls/ls.go`.
## Making a release ##
There are separate instructions for making a release in the RELEASE.md
file - doing the first few steps is useful before making a
contribution.
* go get -u -f -v ./...
* make check
* make test
* make tag
file.
## Updating the vendor dirctory ##
+180 -138
View File
@@ -1,6 +1,6 @@
{
"ImportPath": "github.com/ncw/rclone",
"GoVersion": "devel-41908a5",
"GoVersion": "go1.7",
"GodepVersion": "v75",
"Packages": [
"./..."
@@ -20,13 +20,13 @@
},
{
"ImportPath": "cloud.google.com/go/compute/metadata",
"Comment": "v0.5.0-11-gbfdc39b",
"Rev": "bfdc39bde7a3c8dd361ea7fcdb69e7a41a475bb9"
"Comment": "v0.6.0-68-g0b87d14",
"Rev": "0b87d14d90086b53a97dfbd66f3000f7f112b494"
},
{
"ImportPath": "cloud.google.com/go/internal",
"Comment": "v0.5.0-11-gbfdc39b",
"Rev": "bfdc39bde7a3c8dd361ea7fcdb69e7a41a475bb9"
"Comment": "v0.6.0-68-g0b87d14",
"Rev": "0b87d14d90086b53a97dfbd66f3000f7f112b494"
},
{
"ImportPath": "github.com/Unknwon/goconfig",
@@ -39,138 +39,138 @@
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/awserr",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/awsutil",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/client",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/client/metadata",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/corehandlers",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/credentials",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/credentials/endpointcreds",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/credentials/stscreds",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/defaults",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/ec2metadata",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/endpoints",
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/request",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/session",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/signer/v4",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/endpoints",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/query",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/query/queryutil",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/rest",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/restxml",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/waiter",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/s3",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/s3/s3iface",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/s3/s3manager",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/sts",
"Comment": "v1.5.13-3-gc50c370",
"Rev": "c50c37095f7ff735e74842842f9ec157c6300273"
"Comment": "v1.6.24-1-g2d3b3bc",
"Rev": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918"
},
{
"ImportPath": "github.com/cpuguy83/go-md2man/md2man",
@@ -179,12 +179,13 @@
},
{
"ImportPath": "github.com/davecgh/go-spew/spew",
"Rev": "5215b55f46b2b919f50a1df0eaa5886afe4e3b3d"
"Comment": "v1.1.0",
"Rev": "346938d642f2ec3594ed81d874461961cd0faa76"
},
{
"ImportPath": "github.com/go-ini/ini",
"Comment": "v1.9.0",
"Rev": "193d1ecb466bf97aae8b454a5cfc192941c64809"
"Comment": "v1.24.0-2-gee900ca",
"Rev": "ee900ca565931451fe4e4409bcbd4316331cec1c"
},
{
"ImportPath": "github.com/golang/protobuf/proto",
@@ -192,7 +193,7 @@
},
{
"ImportPath": "github.com/google/go-querystring/query",
"Rev": "9235644dd9e52eeae6fa48efd539fdc351a0af53"
"Rev": "53e6ce116135b80d037921a7fdd5138cf32d7a8a"
},
{
"ImportPath": "github.com/googleapis/gax-go",
@@ -204,8 +205,12 @@
},
{
"ImportPath": "github.com/jmespath/go-jmespath",
"Comment": "0.2.2-12-g0b12d6b",
"Rev": "0b12d6b521d83fc7f755e7cfc1b1fbdd35a01a74"
"Comment": "0.2.2-14-gbd40a43",
"Rev": "bd40a432e4c76585ef6b72d3fd96fb9b6dc7b68d"
},
{
"ImportPath": "github.com/kr/fs",
"Rev": "2788f0dbd16903de03cb8186e5c7d97b69ad387b"
},
{
"ImportPath": "github.com/ncw/go-acd",
@@ -213,30 +218,35 @@
},
{
"ImportPath": "github.com/ncw/swift",
"Rev": "cefd25ce9a2fdb37e4deecc743a2c58cafecdf3f"
"Rev": "6c1b1510538e1f00d49a558b7b9b87d71bc454d6"
},
{
"ImportPath": "github.com/pkg/errors",
"Comment": "v0.8.0-2-g248dadf",
"Rev": "248dadf4e9068a0b3e79f02ed0a610d935de5302"
},
{
"ImportPath": "github.com/pkg/sftp",
"Rev": "ff7e52ffd762466ebd2c4e710d5436dccc539f54"
},
{
"ImportPath": "github.com/pmezard/go-difflib/difflib",
"Comment": "v1.0.0",
"Rev": "792786c7400a136282c1664665ae0a8db921c6c2"
},
{
"ImportPath": "github.com/rfjakob/eme",
"Comment": "v1.0-10-g601d0e2",
"Rev": "601d0e278ceda9aa2085a61c9265f6e690ef5255"
"Comment": "v1.0-15-gfd00240",
"Rev": "fd00240838d2e0fe6b2c58bf5b27db843d828ad5"
},
{
"ImportPath": "github.com/russross/blackfriday",
"Comment": "v1.4-38-g93622da",
"Rev": "93622da34e54fb6529bfb7c57e710f37a8d9cbd8"
"Comment": "v1.4-40-g5f33e7b",
"Rev": "5f33e7b7878355cd2b7e6b8eefc48a5472c69f70"
},
{
"ImportPath": "github.com/shurcooL/sanitized_anchor_name",
"Rev": "10ef21a441db47d8b13ebcc5fd2310f636973c77"
"Rev": "1dba4b3954bc059efc3991ec364f9f9a35f597d2"
},
{
"ImportPath": "github.com/skratchdot/open-golang/open",
@@ -244,15 +254,15 @@
},
{
"ImportPath": "github.com/spf13/cobra",
"Rev": "9495bc009a56819bdb0ddbc1a373e29c140bc674"
"Rev": "b5d8e8f46a2f829f755b6e33b454e25c61c935e1"
},
{
"ImportPath": "github.com/spf13/cobra/doc",
"Rev": "9495bc009a56819bdb0ddbc1a373e29c140bc674"
"Rev": "b5d8e8f46a2f829f755b6e33b454e25c61c935e1"
},
{
"ImportPath": "github.com/spf13/pflag",
"Rev": "5ccb023bc27df288a957c5e994cd44fd19619465"
"Rev": "9ff6c6923cfffbcd502984b8e0c80539a94968b7"
},
{
"ImportPath": "github.com/stacktic/dropbox",
@@ -260,212 +270,244 @@
},
{
"ImportPath": "github.com/stretchr/testify/assert",
"Comment": "v1.1.4-6-g18a02ba",
"Rev": "18a02ba4a312f95da08ff4cfc0055750ce50ae9e"
"Comment": "v1.1.4-27-g4d4bfba",
"Rev": "4d4bfba8f1d1027c4fdbe371823030df51419987"
},
{
"ImportPath": "github.com/stretchr/testify/require",
"Comment": "v1.1.4-6-g18a02ba",
"Rev": "18a02ba4a312f95da08ff4cfc0055750ce50ae9e"
"Comment": "v1.1.4-27-g4d4bfba",
"Rev": "4d4bfba8f1d1027c4fdbe371823030df51419987"
},
{
"ImportPath": "github.com/tsenart/tb",
"Rev": "19f4c3d79d2bd67d0911b2e310b999eeea4454c1"
},
{
"ImportPath": "golang.org/x/crypto/curve25519",
"Rev": "453249f01cfeb54c3d549ddb75ff152ca243f9d8"
},
{
"ImportPath": "golang.org/x/crypto/ed25519",
"Rev": "453249f01cfeb54c3d549ddb75ff152ca243f9d8"
},
{
"ImportPath": "golang.org/x/crypto/ed25519/internal/edwards25519",
"Rev": "453249f01cfeb54c3d549ddb75ff152ca243f9d8"
},
{
"ImportPath": "golang.org/x/crypto/nacl/secretbox",
"Rev": "8a549a1948fc5271eb24f36dcb0d3b47dec75a16"
"Rev": "453249f01cfeb54c3d549ddb75ff152ca243f9d8"
},
{
"ImportPath": "golang.org/x/crypto/pbkdf2",
"Rev": "8a549a1948fc5271eb24f36dcb0d3b47dec75a16"
"Rev": "453249f01cfeb54c3d549ddb75ff152ca243f9d8"
},
{
"ImportPath": "golang.org/x/crypto/poly1305",
"Rev": "8a549a1948fc5271eb24f36dcb0d3b47dec75a16"
"Rev": "453249f01cfeb54c3d549ddb75ff152ca243f9d8"
},
{
"ImportPath": "golang.org/x/crypto/salsa20/salsa",
"Rev": "8a549a1948fc5271eb24f36dcb0d3b47dec75a16"
"Rev": "453249f01cfeb54c3d549ddb75ff152ca243f9d8"
},
{
"ImportPath": "golang.org/x/crypto/scrypt",
"Rev": "8a549a1948fc5271eb24f36dcb0d3b47dec75a16"
"Rev": "453249f01cfeb54c3d549ddb75ff152ca243f9d8"
},
{
"ImportPath": "golang.org/x/crypto/ssh",
"Rev": "453249f01cfeb54c3d549ddb75ff152ca243f9d8"
},
{
"ImportPath": "golang.org/x/crypto/ssh/agent",
"Rev": "453249f01cfeb54c3d549ddb75ff152ca243f9d8"
},
{
"ImportPath": "golang.org/x/crypto/ssh/terminal",
"Rev": "8a549a1948fc5271eb24f36dcb0d3b47dec75a16"
"Rev": "453249f01cfeb54c3d549ddb75ff152ca243f9d8"
},
{
"ImportPath": "golang.org/x/net/context",
"Rev": "6cdc0daab091c43fc46193327e0047b4f883c613"
"Rev": "b4690f45fa1cafc47b1c280c2e75116efe40cc13"
},
{
"ImportPath": "golang.org/x/net/context/ctxhttp",
"Rev": "6cdc0daab091c43fc46193327e0047b4f883c613"
"Rev": "b4690f45fa1cafc47b1c280c2e75116efe40cc13"
},
{
"ImportPath": "golang.org/x/net/http2",
"Rev": "6cdc0daab091c43fc46193327e0047b4f883c613"
"Rev": "b4690f45fa1cafc47b1c280c2e75116efe40cc13"
},
{
"ImportPath": "golang.org/x/net/http2/hpack",
"Rev": "6cdc0daab091c43fc46193327e0047b4f883c613"
"Rev": "b4690f45fa1cafc47b1c280c2e75116efe40cc13"
},
{
"ImportPath": "golang.org/x/net/idna",
"Rev": "6cdc0daab091c43fc46193327e0047b4f883c613"
"Rev": "b4690f45fa1cafc47b1c280c2e75116efe40cc13"
},
{
"ImportPath": "golang.org/x/net/internal/timeseries",
"Rev": "6cdc0daab091c43fc46193327e0047b4f883c613"
"Rev": "b4690f45fa1cafc47b1c280c2e75116efe40cc13"
},
{
"ImportPath": "golang.org/x/net/lex/httplex",
"Rev": "6cdc0daab091c43fc46193327e0047b4f883c613"
"Rev": "b4690f45fa1cafc47b1c280c2e75116efe40cc13"
},
{
"ImportPath": "golang.org/x/net/trace",
"Rev": "6cdc0daab091c43fc46193327e0047b4f883c613"
"Rev": "b4690f45fa1cafc47b1c280c2e75116efe40cc13"
},
{
"ImportPath": "golang.org/x/oauth2",
"Rev": "f6093e37b6cb4092101a298aba5d794eb570757f"
"Rev": "b9780ec78894ab900c062d58ee3076cd9b2a4501"
},
{
"ImportPath": "golang.org/x/oauth2/google",
"Rev": "f6093e37b6cb4092101a298aba5d794eb570757f"
"Rev": "b9780ec78894ab900c062d58ee3076cd9b2a4501"
},
{
"ImportPath": "golang.org/x/oauth2/internal",
"Rev": "f6093e37b6cb4092101a298aba5d794eb570757f"
"Rev": "b9780ec78894ab900c062d58ee3076cd9b2a4501"
},
{
"ImportPath": "golang.org/x/oauth2/jws",
"Rev": "f6093e37b6cb4092101a298aba5d794eb570757f"
"Rev": "b9780ec78894ab900c062d58ee3076cd9b2a4501"
},
{
"ImportPath": "golang.org/x/oauth2/jwt",
"Rev": "f6093e37b6cb4092101a298aba5d794eb570757f"
"Rev": "b9780ec78894ab900c062d58ee3076cd9b2a4501"
},
{
"ImportPath": "golang.org/x/sys/unix",
"Rev": "478fcf54317e52ab69f40bb4c7a1520288d7f7ea"
"Rev": "075e574b89e4c2d22f2286a7e2b919519c6f3547"
},
{
"ImportPath": "golang.org/x/text/transform",
"Rev": "5c6cf4f9a2357d38515014cea8c488ed22bdab90"
"Rev": "85c29909967d7f171f821e7a42e7b7af76fb9598"
},
{
"ImportPath": "golang.org/x/text/unicode/norm",
"Rev": "5c6cf4f9a2357d38515014cea8c488ed22bdab90"
"Rev": "85c29909967d7f171f821e7a42e7b7af76fb9598"
},
{
"ImportPath": "google.golang.org/api/drive/v2",
"Rev": "eeba0f9a5982027f920574de995cd46f96058368"
"Rev": "bc20c61134e1d25265dd60049f5735381e79b631"
},
{
"ImportPath": "google.golang.org/api/gensupport",
"Rev": "eeba0f9a5982027f920574de995cd46f96058368"
"Rev": "bc20c61134e1d25265dd60049f5735381e79b631"
},
{
"ImportPath": "google.golang.org/api/googleapi",
"Rev": "eeba0f9a5982027f920574de995cd46f96058368"
"Rev": "bc20c61134e1d25265dd60049f5735381e79b631"
},
{
"ImportPath": "google.golang.org/api/googleapi/internal/uritemplates",
"Rev": "eeba0f9a5982027f920574de995cd46f96058368"
"Rev": "bc20c61134e1d25265dd60049f5735381e79b631"
},
{
"ImportPath": "google.golang.org/api/storage/v1",
"Rev": "eeba0f9a5982027f920574de995cd46f96058368"
"Rev": "bc20c61134e1d25265dd60049f5735381e79b631"
},
{
"ImportPath": "google.golang.org/appengine",
"Rev": "c98f627282072b1230c8795abe98e2914c8a1de9"
"Comment": "v1.0.0-28-g2e4a801",
"Rev": "2e4a801b39fc199db615bfca7d0b9f8cd9580599"
},
{
"ImportPath": "google.golang.org/appengine/internal",
"Rev": "c98f627282072b1230c8795abe98e2914c8a1de9"
"Comment": "v1.0.0-28-g2e4a801",
"Rev": "2e4a801b39fc199db615bfca7d0b9f8cd9580599"
},
{
"ImportPath": "google.golang.org/appengine/internal/app_identity",
"Rev": "c98f627282072b1230c8795abe98e2914c8a1de9"
"Comment": "v1.0.0-28-g2e4a801",
"Rev": "2e4a801b39fc199db615bfca7d0b9f8cd9580599"
},
{
"ImportPath": "google.golang.org/appengine/internal/base",
"Rev": "c98f627282072b1230c8795abe98e2914c8a1de9"
"Comment": "v1.0.0-28-g2e4a801",
"Rev": "2e4a801b39fc199db615bfca7d0b9f8cd9580599"
},
{
"ImportPath": "google.golang.org/appengine/internal/datastore",
"Rev": "c98f627282072b1230c8795abe98e2914c8a1de9"
"Comment": "v1.0.0-28-g2e4a801",
"Rev": "2e4a801b39fc199db615bfca7d0b9f8cd9580599"
},
{
"ImportPath": "google.golang.org/appengine/internal/log",
"Rev": "c98f627282072b1230c8795abe98e2914c8a1de9"
"Comment": "v1.0.0-28-g2e4a801",
"Rev": "2e4a801b39fc199db615bfca7d0b9f8cd9580599"
},
{
"ImportPath": "google.golang.org/appengine/internal/modules",
"Rev": "c98f627282072b1230c8795abe98e2914c8a1de9"
"Comment": "v1.0.0-28-g2e4a801",
"Rev": "2e4a801b39fc199db615bfca7d0b9f8cd9580599"
},
{
"ImportPath": "google.golang.org/appengine/internal/remote_api",
"Rev": "c98f627282072b1230c8795abe98e2914c8a1de9"
"Comment": "v1.0.0-28-g2e4a801",
"Rev": "2e4a801b39fc199db615bfca7d0b9f8cd9580599"
},
{
"ImportPath": "google.golang.org/grpc",
"Comment": "v1.0.4-78-g708a7f9",
"Rev": "708a7f9f3283aa2d4f6132d287d78683babe55c8"
"Comment": "v1.0.5-52-gd0c32ee",
"Rev": "d0c32ee6a441117d49856d6120ca9552af413ee0"
},
{
"ImportPath": "google.golang.org/grpc/codes",
"Comment": "v1.0.4-78-g708a7f9",
"Rev": "708a7f9f3283aa2d4f6132d287d78683babe55c8"
"Comment": "v1.0.5-52-gd0c32ee",
"Rev": "d0c32ee6a441117d49856d6120ca9552af413ee0"
},
{
"ImportPath": "google.golang.org/grpc/credentials",
"Comment": "v1.0.4-78-g708a7f9",
"Rev": "708a7f9f3283aa2d4f6132d287d78683babe55c8"
"Comment": "v1.0.5-52-gd0c32ee",
"Rev": "d0c32ee6a441117d49856d6120ca9552af413ee0"
},
{
"ImportPath": "google.golang.org/grpc/grpclog",
"Comment": "v1.0.4-78-g708a7f9",
"Rev": "708a7f9f3283aa2d4f6132d287d78683babe55c8"
"Comment": "v1.0.5-52-gd0c32ee",
"Rev": "d0c32ee6a441117d49856d6120ca9552af413ee0"
},
{
"ImportPath": "google.golang.org/grpc/internal",
"Comment": "v1.0.4-78-g708a7f9",
"Rev": "708a7f9f3283aa2d4f6132d287d78683babe55c8"
"Comment": "v1.0.5-52-gd0c32ee",
"Rev": "d0c32ee6a441117d49856d6120ca9552af413ee0"
},
{
"ImportPath": "google.golang.org/grpc/metadata",
"Comment": "v1.0.4-78-g708a7f9",
"Rev": "708a7f9f3283aa2d4f6132d287d78683babe55c8"
"Comment": "v1.0.5-52-gd0c32ee",
"Rev": "d0c32ee6a441117d49856d6120ca9552af413ee0"
},
{
"ImportPath": "google.golang.org/grpc/naming",
"Comment": "v1.0.4-78-g708a7f9",
"Rev": "708a7f9f3283aa2d4f6132d287d78683babe55c8"
"Comment": "v1.0.5-52-gd0c32ee",
"Rev": "d0c32ee6a441117d49856d6120ca9552af413ee0"
},
{
"ImportPath": "google.golang.org/grpc/peer",
"Comment": "v1.0.4-78-g708a7f9",
"Rev": "708a7f9f3283aa2d4f6132d287d78683babe55c8"
"Comment": "v1.0.5-52-gd0c32ee",
"Rev": "d0c32ee6a441117d49856d6120ca9552af413ee0"
},
{
"ImportPath": "google.golang.org/grpc/stats",
"Comment": "v1.0.4-78-g708a7f9",
"Rev": "708a7f9f3283aa2d4f6132d287d78683babe55c8"
"Comment": "v1.0.5-52-gd0c32ee",
"Rev": "d0c32ee6a441117d49856d6120ca9552af413ee0"
},
{
"ImportPath": "google.golang.org/grpc/tap",
"Comment": "v1.0.4-78-g708a7f9",
"Rev": "708a7f9f3283aa2d4f6132d287d78683babe55c8"
"Comment": "v1.0.5-52-gd0c32ee",
"Rev": "d0c32ee6a441117d49856d6120ca9552af413ee0"
},
{
"ImportPath": "google.golang.org/grpc/transport",
"Comment": "v1.0.4-78-g708a7f9",
"Rev": "708a7f9f3283aa2d4f6132d287d78683babe55c8"
"Comment": "v1.0.5-52-gd0c32ee",
"Rev": "d0c32ee6a441117d49856d6120ca9552af413ee0"
},
{
"ImportPath": "gopkg.in/yaml.v2",
"Rev": "a3f3340b5840cee44f372bddb5880fcbc419b46a"
}
]
}
+6 -3
View File
@@ -1,6 +1,9 @@
When filing an issue, please include the following information if possible as well as a description of the problem. Make sure you test with the [latest beta of rclone](http://rclone.org/downloads/).
When filing an issue, please include the following information if possible as well as a description of the problem. Make sure you test with the latest beta of rclone.
If you've just got a question then please use the [rclone forum](https://forum.rclone.org/) instead of filing an issue.
http://beta.rclone.org/
http://rclone.org/downloads/
If you've just got a question or aren't sure if you've found a bug then please use the [rclone forum](https://forum.rclone.org/) instead of filing an issue.
> What is your rclone version (eg output from `rclone -V`)
@@ -10,5 +13,5 @@ If you've just got a question then please use the [rclone forum](https://forum.r
> The command you were trying to run (eg `rclone copy /tmp remote:tmp`)
> A log from the command with the `-v` flag (eg output from `rclone -v copy /tmp remote:tmp`)
> A log from the command with the `-vv` flag (eg output from `rclone -vv copy /tmp remote:tmp`)
+752 -225
View File
File diff suppressed because it is too large. Load diff
+977 -246
View File
File diff suppressed because it is too large. Load diff
+988 -260
View File
File diff suppressed because it is too large. Load diff
+21 -16
View File
@@ -4,13 +4,17 @@ LAST_TAG := $(shell git describe --tags --abbrev=0)
NEW_TAG := $(shell echo $(LAST_TAG) | perl -lpe 's/v//; $$_ += 0.01; $$_ = sprintf("v%.2f", $$_)')
GO_VERSION := $(shell go version)
GO_FILES := $(shell go list ./... | grep -v /vendor/ )
GO_LATEST := $(findstring go1.7,$(GO_VERSION))
GO_LATEST := $(findstring go1.8,$(GO_VERSION))
BETA_URL := http://beta.rclone.org/$(TAG)/
# Only needed for Go 1.5
export GO15VENDOREXPERIMENT=1
.PHONY: rclone
rclone:
go install -v
touch fs/version.go
go install -v --ldflags "-s -X github.com/ncw/rclone/fs.Version=$(TAG)"
cp -av `go env GOPATH`/bin/rclone .
vars:
@echo SHELL="'$(SHELL)'"
@@ -28,13 +32,13 @@ test: rclone
# Quick test
quicktest:
go test $(GO_FILES)
go test -cpu=2 -race $(GO_FILES)
RCLONE_CONFIG="/notfound" go test $(GO_FILES)
RCLONE_CONFIG="/notfound" go test -cpu=2 -race $(GO_FILES)
# Do source code quality checks
check: rclone
ifdef GO_LATEST
go vet $(GO_FILES)
go tool vet -printfuncs Debugf,Infof,Logf,Errorf . 2>&1 | grep -E -v vendor/ ; test $$? -eq 1
errcheck $(GO_FILES)
find . -name \*.go | grep -v /vendor/ | xargs goimports -d | grep . ; test $$? -eq 1
go list ./... | grep -v /vendor/ | xargs -i golint {} | grep -E -v '(StorageUrl|CdnUrl)' ; test $$? -eq 1
@@ -48,7 +52,6 @@ ifdef GO_LATEST
go get -u github.com/kisielk/errcheck
go get -u golang.org/x/tools/cmd/goimports
go get -u github.com/golang/lint/golint
go get -u github.com/mitchellh/gox
go get -u github.com/inconshreveable/mousetrap
go get -u github.com/tools/godep
endif
@@ -99,18 +102,18 @@ upload_github:
./bin/upload-github $(TAG)
cross: doc
./bin/cross-compile $(TAG)
go run bin/cross-compile.go -release current $(TAG)
beta:
./bin/cross-compile $(TAG)β
rm build/*-current-*
go run bin/cross-compile.go $(TAG)β
rclone -v copy build/ memstore:pub-rclone-org/$(TAG)β
@echo Beta release ready at http://pub.rclone.org/$(TAG)%CE%B2/
travis_beta:
./bin/cross-compile $(TAG)β
rm build/*-current-*
rclone --config bin/travis.rclone.conf -v copy build/ memstore:beta-rclone-org/$(TAG)
git log $(LAST_TAG).. > /tmp/git-log.txt
go run bin/cross-compile.go -release beta-latest -git-log /tmp/git-log.txt $(TAG)β
rclone --config bin/travis.rclone.conf -v copy --exclude '*beta-latest*' build/ memstore:beta-rclone-org/$(TAG)
rclone --config bin/travis.rclone.conf -v copy --include '*beta-latest*' build/ memstore:beta-rclone-org
@echo Beta release ready at $(BETA_URL)
serve: website
@@ -119,18 +122,20 @@ serve: website
tag: doc
@echo "Old tag is $(LAST_TAG)"
@echo "New tag is $(NEW_TAG)"
echo -e "package fs\n\n// Version of rclone\nvar Version = \"$(NEW_TAG)-DEV\"\n" | gofmt > fs/version.go
echo -e "package fs\n\n// Version of rclone\nvar Version = \"$(NEW_TAG)\"\n" | gofmt > fs/version.go
perl -lpe 's/VERSION/${NEW_TAG}/g; s/DATE/'`date -I`'/g;' docs/content/downloads.md.in > docs/content/downloads.md
git tag $(NEW_TAG)
@echo "Add this to changelog in docs/content/changelog.md"
@echo " * $(NEW_TAG) -" `date -I`
@git log $(LAST_TAG)..$(NEW_TAG) --oneline
@echo "Edit the new changelog in docs/content/changelog.md"
@echo " * $(NEW_TAG) -" `date -I` >> docs/content/changelog.md
@git log $(LAST_TAG)..$(NEW_TAG) --oneline >> docs/content/changelog.md
@echo "Then commit the changes"
@echo git commit -m \"Version $(NEW_TAG)\" -a -v
@echo "And finally run make retag before make cross etc"
retag:
git tag -f $(LAST_TAG)
echo -e "package fs\n\n// Version of rclone\nvar Version = \"$(LAST_TAG)-DEV\"\n" | gofmt > fs/version.go
git commit -m "Start $(LAST_TAG)-DEV development" fs/version.go
gen_tests:
cd fstest/fstests && go generate
+1
View File
@@ -23,6 +23,7 @@ Rclone is a command line program to sync files and directories to and from
* Hubic
* Backblaze B2
* Yandex Disk
* SFTP
* The local filesystem
Features
+7 -6
View File
@@ -1,11 +1,6 @@
Required software for making a release
Extra required software for making a release
* [github-release](https://github.com/aktau/github-release) for uploading packages
* [gox](https://github.com/mitchellh/gox) for cross compiling
* Run `gox -build-toolchain`
* This assumes you have your own source checkout
* pandoc for making the html and man pages
* errcheck - go get github.com/kisielk/errcheck
* golint - go get github.com/golang/lint
Making a release
* git status - make sure everything is checked in
@@ -16,6 +11,7 @@ Making a release
* edit docs/content/changelog.md
* make doc
* git status - to check for new man pages - git add them
* # Update version number in snapcraft.yml
* git commit -a -v -m "Version v1.XX"
* make retag
* # Set the GOPATH for a current stable go compiler
@@ -23,6 +19,7 @@ Making a release
* make upload
* make upload_website
* git push --tags origin master
* git push --tags origin master:stable # update the stable branch for packager.io
* make upload_github
Early in the next release cycle update the vendored dependencies
@@ -31,3 +28,7 @@ Early in the next release cycle update the vendored dependencies
* git add new files
* carry forward any patches to vendor stuff
* git commit -a -v
## Make version number go to -DEV and check in
Make the version number be just in a file?
+186 -153
View File
@@ -21,7 +21,6 @@ import (
"path"
"regexp"
"strings"
"sync/atomic"
"time"
"github.com/ncw/go-acd"
@@ -31,7 +30,6 @@ import (
"github.com/ncw/rclone/pacer"
"github.com/ncw/rclone/rest"
"github.com/pkg/errors"
"github.com/spf13/pflag"
"golang.org/x/oauth2"
)
@@ -51,7 +49,7 @@ const (
var (
// Flags
tempLinkThreshold = fs.SizeSuffix(9 << 30) // Download files bigger than this via the tempLink
uploadWaitPerGB = pflag.DurationP("acd-upload-wait-per-gb", "", 180*time.Second, "Additional time per GB to wait after a failed complete upload to see if it appears.")
uploadWaitPerGB = fs.DurationP("acd-upload-wait-per-gb", "", 180*time.Second, "Additional time per GB to wait after a failed complete upload to see if it appears.")
// Description of how to auth for this app
acdConfig = &oauth2.Config{
Scopes: []string{"clouddrive:read_all", "clouddrive:write"},
@@ -85,20 +83,20 @@ func init() {
Help: "Amazon Application Client Secret - leave blank normally.",
}},
})
pflag.VarP(&tempLinkThreshold, "acd-templink-threshold", "", "Files >= this size will be downloaded via their tempLink.")
fs.VarP(&tempLinkThreshold, "acd-templink-threshold", "", "Files >= this size will be downloaded via their tempLink.")
}
// Fs represents a remote acd server
type Fs struct {
name string // name of this remote
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 *pacer.Pacer // pacer for API calls
ts *oauthutil.TokenSource // token source for oauth
uploads int32 // number of uploads in progress - atomic access required
trueRootID string // ID of true root directory
name string // name of this remote
features *fs.Features // optional features
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 *pacer.Pacer // pacer for API calls
trueRootID string // ID of true root directory
tokenRenewer *oauthutil.Renew // renew the token on expiry
}
// Object describes a acd object
@@ -127,6 +125,11 @@ 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
}
// Pattern to match a acd path
var matcher = regexp.MustCompile(`^([^/]*)(.*)$`)
@@ -153,15 +156,15 @@ var retryErrorCodes = []int{
func (f *Fs) shouldRetry(resp *http.Response, err error) (bool, error) {
if resp != nil {
if resp.StatusCode == 401 {
f.ts.Invalidate()
fs.Log(f, "401 error received - invalidating token")
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", reponse 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.Log(f, "403 \"Authorization header requires...\" error received - retry")
fs.Debugf(f, "403 \"Authorization header requires...\" error received - retry")
return true, err
}
}
@@ -183,8 +186,8 @@ func NewFs(name, root string) (fs.Fs, error) {
c: c,
pacer: pacer.New().SetMinSleep(minSleep).SetPacer(pacer.AmazonCloudDrivePacer),
noAuthClient: fs.Config.Client(),
ts: ts,
}
f.features = (&fs.Features{CaseInsensitive: true, ReadMimeType: true}).Fill(f)
// Update endpoints
var resp *http.Response
@@ -204,7 +207,10 @@ func NewFs(name, root string) (fs.Fs, error) {
f.trueRootID = *rootInfo.Id
// Renew the token in the background
go f.renewToken()
f.tokenRenewer = oauthutil.NewRenew(f.String(), ts, func() error {
_, err := f.getRootInfo()
return err
})
f.dirCache = dircache.New(root, f.trueRootID, f)
@@ -246,39 +252,6 @@ func (f *Fs) getRootInfo() (rootInfo *acd.Folder, err error) {
return rootInfo, err
}
// Renew the token - runs in the background
//
// Renews the token whenever it expires. Useful when there are lots
// of uploads in progress and the token doesn't get renewed. Amazon
// seem to cancel your uploads if you don't renew your token for 2hrs.
func (f *Fs) renewToken() {
expiry := f.ts.OnExpiry()
for {
<-expiry
uploads := atomic.LoadInt32(&f.uploads)
if uploads != 0 {
fs.Debug(f, "Token expired - %d uploads in progress - refreshing", uploads)
// Do a transaction
_, err := f.getRootInfo()
if err == nil {
fs.Debug(f, "Token refresh successful")
} else {
fs.ErrorLog(f, "Token refresh failed: %v", err)
}
} else {
fs.Debug(f, "Token expired but no uploads in progress - doing nothing")
}
}
}
func (f *Fs) startUpload() {
atomic.AddInt32(&f.uploads, 1)
}
func (f *Fs) stopUpload() {
atomic.AddInt32(&f.uploads, -1)
}
// Return an Object from a path
//
// If it can't be found it returns the error fs.ErrorObjectNotFound.
@@ -307,7 +280,7 @@ func (f *Fs) NewObject(remote string) (fs.Object, error) {
// FindLeaf finds a directory of name leaf in the folder with ID pathID
func (f *Fs) FindLeaf(pathID, leaf string) (pathIDOut string, found bool, err error) {
//fs.Debug(f, "FindLeaf(%q, %q)", pathID, leaf)
//fs.Debugf(f, "FindLeaf(%q, %q)", pathID, leaf)
folder := acd.FolderFromId(pathID, f.c.Nodes)
var resp *http.Response
var subFolder *acd.Folder
@@ -317,18 +290,18 @@ func (f *Fs) FindLeaf(pathID, leaf string) (pathIDOut string, found bool, err er
})
if err != nil {
if err == acd.ErrorNodeNotFound {
//fs.Debug(f, "...Not found")
//fs.Debugf(f, "...Not found")
return "", false, nil
}
//fs.Debug(f, "...Error %v", err)
//fs.Debugf(f, "...Error %v", err)
return "", false, err
}
if subFolder.Status != nil && *subFolder.Status != statusAvailable {
fs.Debug(f, "Ignoring folder %q in state %q", leaf, *subFolder.Status)
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.Debug(f, "...Found(%q, %v)", *subFolder.Id, leaf)
//fs.Debugf(f, "...Found(%q, %v)", *subFolder.Id, leaf)
return *subFolder.Id, true, nil
}
@@ -424,7 +397,7 @@ func (f *Fs) listAll(dirID string, title string, directoriesOnly bool, filesOnly
// ListDir reads the directory specified by the job into out, returning any more jobs
func (f *Fs) ListDir(out fs.ListOpts, job dircache.ListDirJob) (jobs []dircache.ListDirJob, err error) {
fs.Debug(f, "Reading %q", job.Path)
fs.Debugf(f, "Reading %q", job.Path)
maxTries := fs.Config.LowLevelRetries
for tries := 1; tries <= maxTries; tries++ {
_, err = f.listAll(job.DirID, "", false, false, func(node *acd.Node) bool {
@@ -460,7 +433,7 @@ func (f *Fs) ListDir(out fs.ListOpts, job dircache.ListDirJob) (jobs []dircache.
return false
})
if fs.IsRetryError(err) {
fs.Debug(f, "Directory listing error for %q: %v - low level retry %d/%d", job.Path, err, tries, maxTries)
fs.Debugf(f, "Directory listing error for %q: %v - low level retry %d/%d", job.Path, err, tries, maxTries)
continue
}
if err != nil {
@@ -468,7 +441,7 @@ func (f *Fs) ListDir(out fs.ListOpts, job dircache.ListDirJob) (jobs []dircache.
}
break
}
fs.Debug(f, "Finished reading %q", job.Path)
fs.Debugf(f, "Finished reading %q", job.Path)
return jobs, err
}
@@ -515,13 +488,13 @@ func (f *Fs) checkUpload(resp *http.Response, in io.Reader, src fs.ObjectInfo, i
buf := make([]byte, 1)
n, err := in.Read(buf)
if !(n == 0 && err == io.EOF) {
fs.Debug(src, "Upload error detected but didn't finish upload: %v (%q)", inErr, httpStatus)
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 *uploadWaitPerGB <= 0 {
fs.Debug(src, "Upload error detected but waiting disabled: %v (%q)", inErr, httpStatus)
fs.Debugf(src, "Upload error detected but waiting disabled: %v (%q)", inErr, httpStatus)
return false, inInfo, inErr
}
@@ -532,27 +505,27 @@ func (f *Fs) checkUpload(resp *http.Response, in io.Reader, src fs.ObjectInfo, i
const sleepTime = 5 * time.Second // sleep between tries
retries := int((timeToWait + sleepTime - 1) / sleepTime) // number of retries, rounded up
fs.Debug(src, "Error detected after finished upload - waiting to see if object was uploaded correctly: %v (%q)", inErr, httpStatus)
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(remote)
if err == fs.ErrorObjectNotFound {
fs.Debug(src, "Object not found - waiting (%d/%d)", i, retries)
fs.Debugf(src, "Object not found - waiting (%d/%d)", i, retries)
} else if err != nil {
fs.Debug(src, "Object returned error - waiting (%d/%d): %v", i, retries, err)
fs.Debugf(src, "Object returned error - waiting (%d/%d): %v", i, retries, err)
} else {
if src.Size() == o.Size() {
fs.Debug(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))
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.Debug(src, "Object found but wrong size %d vs %d - waiting (%d/%d)", src.Size(), o.Size(), i, retries)
fs.Debugf(src, "Object found but wrong size %d vs %d - waiting (%d/%d)", src.Size(), o.Size(), i, retries)
}
time.Sleep(sleepTime)
}
fs.Debug(src, "Giving up waiting for object - returning original error: %v (%q)", inErr, httpStatus)
fs.Debugf(src, "Giving up waiting for object - returning original error: %v (%q)", inErr, httpStatus)
return false, inInfo, inErr
}
@@ -580,21 +553,21 @@ func (f *Fs) Put(in io.Reader, src fs.ObjectInfo) (fs.Object, error) {
return nil, err
}
// If not create it
leaf, directoryID, err := f.dirCache.FindPath(remote, true)
leaf, directoryID, err := f.dirCache.FindRootAndPath(remote, true)
if err != nil {
return nil, err
}
if size > warnFileSize {
fs.Debug(f, "Warning: file %q may fail because it is too big. Use --max-size=%dM to skip large files.", remote, warnFileSize>>20)
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.startUpload()
f.tokenRenewer.Start()
info, resp, err = folder.Put(in, leaf)
f.stopUpload()
f.tokenRenewer.Stop()
var ok bool
ok, info, err = f.checkUpload(resp, in, src, info, err, time.Since(start))
if ok {
@@ -634,7 +607,7 @@ func (f *Fs) Move(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.Debug(src, "Can't move - not same remote type")
fs.Debugf(src, "Can't move - not same remote type")
return nil, fs.ErrorCantMove
}
@@ -651,16 +624,36 @@ func (f *Fs) Move(src fs.Object, remote string) (fs.Object, error) {
if err != nil {
return nil, err
}
dstInfo, err := f.moveNode(srcObj.remote, dstLeaf, dstDirectoryID, srcObj.info, srcLeaf, srcDirectoryID, false)
err = f.moveNode(srcObj.remote, dstLeaf, dstDirectoryID, srcObj.info, srcLeaf, srcDirectoryID, false)
if err != nil {
return nil, err
}
dstObj := &Object{
fs: f,
remote: remote,
info: dstInfo,
// 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 <= fs.Config.LowLevelRetries; i++ {
_, srcErr = srcObj.fs.NewObject(srcObj.remote) // try reading the object
if srcErr != nil && srcErr != fs.ErrorObjectNotFound {
// exit if error on source
return nil, srcErr
}
dstObj, dstErr = f.NewObject(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, fs.Config.LowLevelRetries)
time.Sleep(1 * time.Second)
}
return dstObj, nil
return dstObj, dstErr
}
// DirCacheFlush resets the directory cache - used in testing as an
@@ -669,74 +662,112 @@ func (f *Fs) DirCacheFlush() {
f.dirCache.ResetRoot()
}
// DirMove moves src directory to this remote using server side move
// operations.
// 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(src fs.Fs) (err error) {
// go test -v -run '^Test(Setup|Init|FsMkdir|FsPutFile1|FsPutFile2|FsUpdateFile1|FsDirMove)$
func (f *Fs) DirMove(src fs.Fs, srcRemote, dstRemote string) (err error) {
srcFs, ok := src.(*Fs)
if !ok {
fs.Debug(src, "DirMove error: not same remote type")
fs.Debugf(src, "DirMove error: not same remote type")
return fs.ErrorCantDirMove
}
// Check if destination exists
if f.dirCache.FoundRoot() {
fs.Debug(src, "DirMove error: destination exists")
return fs.ErrorDirExists
}
srcPath := path.Join(srcFs.root, srcRemote)
dstPath := path.Join(f.root, dstRemote)
// Refuse to move to or from the root
if f.root == "" || srcFs.root == "" {
fs.Debug(src, "DirMove error: Can't move root")
if srcPath == "" || dstPath == "" {
fs.Debugf(src, "DirMove error: Can't move root")
return errors.New("can't move root directory")
}
// Find ID of parent
dstLeaf, dstDirectoryID, err := f.dirCache.FindPath(f.root, true)
if err != nil {
return err
}
// Find the ID of the source and make a node from it
// find the root src directory
err = srcFs.dirCache.FindRoot(false)
if err != nil {
fs.Debug(src, "DirMove error: error finding src root: %v", err)
return err
}
srcDirectoryID, err := srcFs.dirCache.RootParentID()
// find the root dst directory
if dstRemote != "" {
err = f.dirCache.FindRoot(true)
if err != nil {
return err
}
} else {
if f.dirCache.FoundRoot() {
return fs.ErrorDirExists
}
}
// Find ID of dst parent, creating subdirs if necessary
findPath := dstRemote
if dstRemote == "" {
findPath = f.root
}
dstLeaf, dstDirectoryID, err := f.dirCache.FindPath(findPath, true)
if err != nil {
return err
}
// Check destination does not exist
if dstRemote != "" {
_, err = f.dirCache.FindDir(dstRemote, false)
if err == fs.ErrorDirNotFound {
// OK
} else if err != nil {
return err
} else {
return fs.ErrorDirExists
}
}
// Find ID of src parent
findPath = srcRemote
var srcDirectoryID string
if srcRemote == "" {
srcDirectoryID, err = srcFs.dirCache.RootParentID()
} else {
_, srcDirectoryID, err = srcFs.dirCache.FindPath(findPath, false)
}
if err != nil {
return err
}
srcLeaf, _ := dircache.SplitPath(srcPath)
// Find ID of src
srcID, err := srcFs.dirCache.FindDir(srcRemote, false)
if err != nil {
fs.Debug(src, "DirMove error: error finding src RootParentID: %v", err)
return err
}
srcLeaf, _ := dircache.SplitPath(srcFs.root)
// FIXME make a proper node.UpdateMetadata command
srcInfo := acd.NodeFromId(srcFs.dirCache.RootID(), f.c.Nodes)
srcInfo := acd.NodeFromId(srcID, f.c.Nodes)
var jsonStr string
err = srcFs.pacer.Call(func() (bool, error) {
jsonStr, err = srcInfo.GetMetadata()
return srcFs.shouldRetry(nil, err)
})
if err != nil {
fs.Debug(src, "DirMove error: error reading src metadata: %v", err)
fs.Debugf(src, "DirMove error: error reading src metadata: %v", err)
return err
}
err = json.Unmarshal([]byte(jsonStr), &srcInfo)
if err != nil {
fs.Debug(src, "DirMove error: error reading unpacking src metadata: %v", err)
fs.Debugf(src, "DirMove error: error reading unpacking src metadata: %v", err)
return err
}
_, err = f.moveNode(srcFs.root, dstLeaf, dstDirectoryID, srcInfo, srcLeaf, srcDirectoryID, true)
err = f.moveNode(srcPath, dstLeaf, dstDirectoryID, srcInfo, srcLeaf, srcDirectoryID, true)
if err != nil {
return err
}
srcFs.dirCache.ResetRoot()
return err
srcFs.dirCache.FlushDir(srcRemote)
return nil
}
// purgeCheck remotes the root directory, if check is set then it
@@ -747,6 +778,10 @@ func (f *Fs) purgeCheck(dir string, check bool) error {
return errors.New("can't purge root directory")
}
dc := f.dirCache
err := dc.FindRoot(false)
if err != nil {
return err
}
rootID, err := dc.FindDir(dir, false)
if err != nil {
return err
@@ -764,7 +799,7 @@ func (f *Fs) purgeCheck(dir string, check bool) error {
empty = false
return true
default:
fs.Debug("Found ASSET %s", *node.Id)
fs.Debugf("Found ASSET %s", *node.Id)
}
return false
})
@@ -822,7 +857,7 @@ func (f *Fs) Hashes() fs.HashSet {
//func (f *Fs) Copy(src fs.Object, remote string) (fs.Object, error) {
// srcObj, ok := src.(*Object)
// if !ok {
// fs.Debug(src, "Can't copy - not same remote type")
// fs.Debugf(src, "Can't copy - not same remote type")
// return nil, fs.ErrorCantCopy
// }
// srcFs := srcObj.fs
@@ -890,7 +925,7 @@ func (o *Object) readMetaData() (err error) {
if o.info != nil {
return nil
}
leaf, directoryID, err := o.fs.dirCache.FindPath(o.remote, false)
leaf, directoryID, err := o.fs.dirCache.FindRootAndPath(o.remote, false)
if err != nil {
if err == fs.ErrorDirNotFound {
return fs.ErrorObjectNotFound
@@ -922,12 +957,12 @@ func (o *Object) readMetaData() (err error) {
func (o *Object) ModTime() time.Time {
err := o.readMetaData()
if err != nil {
fs.Log(o, "Failed to read metadata: %v", err)
fs.Debugf(o, "Failed to read metadata: %v", err)
return time.Now()
}
modTime, err := time.Parse(timeFormat, *o.info.ModifiedDate)
if err != nil {
fs.Log(o, "Failed to read mtime from object: %v", err)
fs.Debugf(o, "Failed to read mtime from object: %v", err)
return time.Now()
}
return modTime
@@ -948,7 +983,7 @@ func (o *Object) Storable() bool {
func (o *Object) Open(options ...fs.OpenOption) (in io.ReadCloser, err error) {
bigObject := o.Size() >= int64(tempLinkThreshold)
if bigObject {
fs.Debug(o, "Dowloading large object via tempLink")
fs.Debugf(o, "Dowloading large object via tempLink")
}
file := acd.File{Node: o.info}
var resp *http.Response
@@ -974,9 +1009,9 @@ func (o *Object) Update(in io.Reader, src fs.ObjectInfo) error {
var err error
err = o.fs.pacer.CallNoRetry(func() (bool, error) {
start := time.Now()
o.fs.startUpload()
o.fs.tokenRenewer.Start()
info, resp, err = file.Overwrite(in)
o.fs.stopUpload()
o.fs.tokenRenewer.Stop()
var ok bool
ok, info, err = o.fs.checkUpload(resp, in, src, info, err, time.Since(start))
if ok {
@@ -1008,25 +1043,23 @@ func (o *Object) Remove() error {
}
// Restore a node
func (f *Fs) restoreNode(info *acd.Node) (*acd.Node, error) {
func (f *Fs) restoreNode(info *acd.Node) (newInfo *acd.Node, err error) {
var resp *http.Response
var err error
err = f.pacer.Call(func() (bool, error) {
info, resp, err = info.Restore()
newInfo, resp, err = info.Restore()
return f.shouldRetry(resp, err)
})
return info, err
return newInfo, err
}
// Changes name of given node
func (f *Fs) renameNode(info *acd.Node, newName string) (*acd.Node, error) {
func (f *Fs) renameNode(info *acd.Node, newName string) (newInfo *acd.Node, err error) {
var resp *http.Response
var err error
err = f.pacer.Call(func() (bool, error) {
info, resp, err = info.Rename(newName)
newInfo, resp, err = info.Rename(newName)
return f.shouldRetry(resp, err)
})
return info, err
return newInfo, err
}
// Replaces one parent with another, effectively moving the file. Leaves other
@@ -1057,73 +1090,73 @@ func (f *Fs) removeParent(info *acd.Node, parentID string) error {
// moveNode moves the node given from the srcLeaf,srcDirectoryID to
// the dstLeaf,dstDirectoryID
func (f *Fs) moveNode(name, dstLeaf, dstDirectoryID string, srcInfo *acd.Node, srcLeaf, srcDirectoryID string, useDirErrorMsgs bool) (dstInfo *acd.Node, err error) {
// fs.Debug(name, "moveNode dst(%q,%s) <- src(%q,%s)", dstLeaf, dstDirectoryID, srcLeaf, srcDirectoryID)
func (f *Fs) moveNode(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.Debug(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 nil, cantMove
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.Debug(name, "renaming")
dstInfo, err = f.renameNode(srcInfo, dstLeaf)
// fs.Debugf(name, "renaming")
_, err = f.renameNode(srcInfo, dstLeaf)
if err != nil {
fs.Debug(name, "Move: quick path rename failed: %v", err)
fs.Debugf(name, "Move: quick path rename failed: %v", err)
goto OnConflict
}
}
if srcDirectoryID != dstDirectoryID {
// fs.Debug(name, "trying parent replace: %s -> %s", oldParentID, newParentID)
// fs.Debugf(name, "trying parent replace: %s -> %s", oldParentID, newParentID)
err = f.replaceParent(srcInfo, srcDirectoryID, dstDirectoryID)
if err != nil {
fs.Debug(name, "Move: quick path parent replace failed: %v", err)
return nil, err
fs.Debugf(name, "Move: quick path parent replace failed: %v", err)
return err
}
}
return dstInfo, nil
return nil
OnConflict:
fs.Debug(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, "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.Debug(name, "Trashing file")
// fs.Debugf(name, "Trashing file")
err = f.removeNode(srcInfo)
if err != nil {
fs.Debug(name, "Move: remove node failed: %v", err)
return nil, err
fs.Debugf(name, "Move: remove node failed: %v", err)
return err
}
// fs.Debug(name, "Renaming file")
// fs.Debugf(name, "Renaming file")
_, err = f.renameNode(srcInfo, dstLeaf)
if err != nil {
fs.Debug(name, "Move: rename node failed: %v", err)
return nil, err
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.Debug(name, "Adding target parent")
// fs.Debugf(name, "Adding target parent")
err = f.addParent(srcInfo, dstDirectoryID)
if err != nil {
fs.Debug(name, "Move: addParent failed: %v", err)
return nil, err
fs.Debugf(name, "Move: addParent failed: %v", err)
return err
}
// fs.Debug(name, "removing original parent")
// fs.Debugf(name, "removing original parent")
err = f.removeParent(srcInfo, srcDirectoryID)
if err != nil {
fs.Debug(name, "Move: removeParent failed: %v", err)
return nil, err
fs.Debugf(name, "Move: removeParent failed: %v", err)
return err
}
// fs.Debug(name, "Restoring")
dstInfo, err = f.restoreNode(srcInfo)
// fs.Debugf(name, "Restoring")
_, err = f.restoreNode(srcInfo)
if err != nil {
fs.Debug(name, "Move: restoreNode node failed: %v", err)
return nil, err
fs.Debugf(name, "Move: restoreNode node failed: %v", err)
return err
}
return dstInfo, nil
return nil
}
// MimeType of an Object if known, "" otherwise
@@ -37,6 +37,7 @@ func TestFsListSubdir(t *testing.T) { fstests.TestFsListSubdir(t) }
func TestFsListLevel2(t *testing.T) { fstests.TestFsListLevel2(t) }
func TestFsListFile1(t *testing.T) { fstests.TestFsListFile1(t) }
func TestFsNewObject(t *testing.T) { fstests.TestFsNewObject(t) }
func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsListFile1and2(t *testing.T) { fstests.TestFsListFile1and2(t) }
func TestFsCopy(t *testing.T) { fstests.TestFsCopy(t) }
func TestFsMove(t *testing.T) { fstests.TestFsMove(t) }
+57 -103
View File
@@ -25,7 +25,6 @@ import (
"github.com/ncw/rclone/pacer"
"github.com/ncw/rclone/rest"
"github.com/pkg/errors"
"github.com/spf13/pflag"
)
const (
@@ -50,8 +49,8 @@ var (
minChunkSize = fs.SizeSuffix(100E6)
chunkSize = fs.SizeSuffix(96 * 1024 * 1024)
uploadCutoff = fs.SizeSuffix(200E6)
b2TestMode = pflag.StringP("b2-test-mode", "", "", "A flag string for X-Bz-Test-Mode header.")
b2Versions = pflag.BoolP("b2-versions", "", false, "Include old versions in directory listings.")
b2TestMode = fs.StringP("b2-test-mode", "", "", "A flag string for X-Bz-Test-Mode header.")
b2Versions = fs.BoolP("b2-versions", "", false, "Include old versions in directory listings.")
errNotWithVersions = errors.New("can't modify or delete files in --b2-versions mode")
)
@@ -73,13 +72,15 @@ func init() {
},
},
})
pflag.VarP(&uploadCutoff, "b2-upload-cutoff", "", "Cutoff for switching to chunked upload")
pflag.VarP(&chunkSize, "b2-chunk-size", "", "Upload chunk size. Must fit in memory.")
fs.VarP(&uploadCutoff, "b2-upload-cutoff", "", "Cutoff for switching to chunked upload")
fs.VarP(&chunkSize, "b2-chunk-size", "", "Upload chunk size. Must fit in memory.")
}
// Fs represents a remote b2 server
type Fs struct {
name string // name of this remote
root string // the path we are working on if any
features *fs.Features // optional features
account string // account name
key string // auth key
endpoint string // name of the starting api endpoint
@@ -87,14 +88,12 @@ type Fs struct {
bucket string // the bucket we are working on
bucketIDMutex sync.Mutex // mutex to protect _bucketID
_bucketID string // the ID of the bucket we are working on
root string // the path we are working on if any
info api.AuthorizeAccountResponse // result of authorize call
uploadMu sync.Mutex // lock for upload variable
uploads []*api.GetUploadURLResponse // result of get upload URL calls
authMu sync.Mutex // lock for authorizing the account
pacer *pacer.Pacer // To pace and retry the API calls
uploadTokens chan struct{} // control concurrency of uploads
extraTokens chan struct{} // extra tokens for multipart uploads
bufferTokens chan []byte // control concurrency of multipart uploads
}
// Object describes a b2 object
@@ -131,6 +130,11 @@ func (f *Fs) String() string {
return fmt.Sprintf("B2 bucket %s path %s", f.bucket, f.root)
}
// Features returns the optional features of this Fs
func (f *Fs) Features() *fs.Features {
return f.features
}
// Pattern to match a b2 path
var matcher = regexp.MustCompile(`^([^/]*)(.*)$`)
@@ -169,12 +173,12 @@ func (f *Fs) shouldRetryNoReauth(resp *http.Response, err error) (bool, error) {
var err error
retryAfter, err = strconv.Atoi(retryAfterString)
if err != nil {
fs.ErrorLog(f, "Malformed %s header %q: %v", retryAfterHeader, retryAfterString, err)
fs.Errorf(f, "Malformed %s header %q: %v", retryAfterHeader, retryAfterString, err)
}
}
retryAfterDuration := time.Duration(retryAfter) * time.Second
if f.pacer.GetSleep() < retryAfterDuration {
fs.Debug(f, "Setting sleep to %v after error: %v", retryAfterDuration, err)
fs.Debugf(f, "Setting sleep to %v after error: %v", retryAfterDuration, err)
// We set 1/2 the value here because the pacer will double it immediately
f.pacer.SetSleep(retryAfterDuration / 2)
}
@@ -187,7 +191,7 @@ func (f *Fs) shouldRetryNoReauth(resp *http.Response, err error) (bool, error) {
// deserve to be retried. It returns the err as a convenience
func (f *Fs) shouldRetry(resp *http.Response, err error) (bool, error) {
if resp != nil && resp.StatusCode == 401 {
fs.Debug(f, "Unauthorized: %v", err)
fs.Debugf(f, "Unauthorized: %v", err)
// Reauth
authErr := f.authorizeAccount()
if authErr != nil {
@@ -204,7 +208,7 @@ func errorHandler(resp *http.Response) error {
errResponse := new(api.Error)
err := rest.DecodeJSON(resp, &errResponse)
if err != nil {
fs.Debug(nil, "Couldn't decode error response: %v", err)
fs.Debugf(nil, "Couldn't decode error response: %v", err)
}
if errResponse.Code == "" {
errResponse.Code = "unknown"
@@ -230,15 +234,15 @@ func NewFs(name, root string) (fs.Fs, error) {
if err != nil {
return nil, err
}
account := fs.ConfigFile.MustValue(name, "account")
account := fs.ConfigFileGet(name, "account")
if account == "" {
return nil, errors.New("account not found")
}
key := fs.ConfigFile.MustValue(name, "key")
key := fs.ConfigFileGet(name, "key")
if key == "" {
return nil, errors.New("key not found")
}
endpoint := fs.ConfigFile.MustValue(name, "endpoint", defaultEndpoint)
endpoint := fs.ConfigFileGet(name, "endpoint", defaultEndpoint)
f := &Fs{
name: name,
bucket: bucket,
@@ -248,19 +252,18 @@ func NewFs(name, root string) (fs.Fs, error) {
endpoint: endpoint,
srv: rest.NewClient(fs.Config.Client()).SetErrorHandler(errorHandler),
pacer: pacer.New().SetMinSleep(minSleep).SetMaxSleep(maxSleep).SetDecayConstant(decayConstant),
uploadTokens: make(chan struct{}, fs.Config.Transfers),
extraTokens: make(chan struct{}, fs.Config.Transfers),
bufferTokens: make(chan []byte, fs.Config.Transfers),
}
f.features = (&fs.Features{ReadMimeType: true, WriteMimeType: true}).Fill(f)
// Set the test flag if required
if *b2TestMode != "" {
testMode := strings.TrimSpace(*b2TestMode)
f.srv.SetHeader(testModeHeader, testMode)
fs.Debug(f, "Setting test header \"%s: %s\"", testModeHeader, testMode)
fs.Debugf(f, "Setting test header \"%s: %s\"", testModeHeader, testMode)
}
// Fill up the upload and extra tokens
// Fill up the buffer tokens
for i := 0; i < fs.Config.Transfers; i++ {
f.returnUploadToken()
f.extraTokens <- struct{}{}
f.bufferTokens <- nil
}
err = f.authorizeAccount()
if err != nil {
@@ -364,77 +367,24 @@ func (f *Fs) clearUploadURL() {
f.uploadMu.Unlock()
}
// Gets an upload token to control the concurrency
func (f *Fs) getUploadToken() {
<-f.uploadTokens
}
// Return an upload token
func (f *Fs) returnUploadToken() {
f.uploadTokens <- struct{}{}
}
// Help count the multipart uploads
type multipartUploadCounter struct {
f *Fs
uploadToken chan struct{}
}
// Create a new upload counter. This gets an upload token for
// exclusive use by this multipart upload - the other tokens are
// shared between all the multipart uploads.
//
// Call .finished() when done to return the upload token.
func (f *Fs) newMultipartUploadCounter() *multipartUploadCounter {
m := &multipartUploadCounter{
f: f,
uploadToken: make(chan struct{}, 1),
// getUploadBlock gets a block from the pool of size chunkSize
func (f *Fs) getUploadBlock() []byte {
buf := <-f.bufferTokens
if buf == nil {
buf = make([]byte, chunkSize)
}
f.getUploadToken()
m.uploadToken <- struct{}{}
return m
// fs.Debugf(f, "Getting upload block %p", buf)
return buf
}
// Gets an upload token for a multipart upload
//
// This gets one token only from the first class tokens. This means
// that the multiplart upload is guaranteed at least one token as
// there is one first class token per possible upload.
//
// Pass the return value to returnMultipartUploadToken
func (m *multipartUploadCounter) getMultipartUploadToken() bool {
// get the upload token by preference
select {
case <-m.uploadToken:
return true
default:
// putUploadBlock returns a block to the pool of size chunkSize
func (f *Fs) putUploadBlock(buf []byte) {
buf = buf[:cap(buf)]
if len(buf) != int(chunkSize) {
panic("bad blocksize returned to pool")
}
// ...otherwise wait for the first one to appear.
//
// If both uploadToken and extraTokens are ready at this point
// (unlikely but possible) and we get an extraToken instead of
// an uploadToken this will not cause any harm - this
// multipart upload will get an extra upload slot temporarily.
select {
case <-m.uploadToken:
return true
case <-m.f.extraTokens:
return false
}
}
// Return a multipart upload token retreived from getMultipartUploadToken
func (m *multipartUploadCounter) returnMultipartUploadToken(firstClass bool) {
if firstClass {
m.uploadToken <- struct{}{}
} else {
m.f.extraTokens <- struct{}{}
}
}
// Mark us finished with this upload counter
func (m *multipartUploadCounter) finished() {
m.f.returnUploadToken()
// fs.Debugf(f, "Returning upload block %p", buf)
f.bufferTokens <- buf
}
// Return an Object from a path
@@ -517,7 +467,6 @@ func (f *Fs) list(dir string, level int, prefix string, limit int, hidden bool,
if prefix != "" {
request.StartFileName = prefix
}
var response api.ListFileNamesResponse
opts := rest.Opts{
Method: "POST",
Path: "/b2_list_file_names",
@@ -526,6 +475,7 @@ func (f *Fs) list(dir string, level int, prefix string, limit int, hidden bool,
opts.Path = "/b2_list_file_versions"
}
for {
var response api.ListFileNamesResponse
err := f.pacer.Call(func() (bool, error) {
resp, err := f.srv.CallJSON(&opts, &request, &response)
return f.shouldRetry(resp, err)
@@ -540,7 +490,7 @@ func (f *Fs) list(dir string, level int, prefix string, limit int, hidden bool,
return nil
}
if !strings.HasPrefix(file.Name, f.root) {
fs.Log(f, "Odd name received %q", file.Name)
fs.Debugf(f, "Odd name received %q", file.Name)
continue
}
remote := file.Name[len(f.root):]
@@ -750,7 +700,7 @@ func (f *Fs) Mkdir(dir string) error {
return nil
}
if getBucketErr != fs.ErrorDirNotFound {
fs.Debug(f, "Error checking bucket exists: %v", getBucketErr)
fs.Debugf(f, "Error checking bucket exists: %v", getBucketErr)
}
}
}
@@ -857,13 +807,13 @@ func (f *Fs) purge(oldOnly bool) error {
fs.Stats.Checking(remote)
if oldOnly && last != remote {
if object.Action == "hide" {
fs.Debug(remote, "Deleting current version (id %q) as it is a hide marker", object.ID)
fs.Debugf(remote, "Deleting current version (id %q) as it is a hide marker", object.ID)
toBeDeleted <- object
} else {
fs.Debug(remote, "Not deleting current version (id %q) %q", object.ID, object.Action)
fs.Debugf(remote, "Not deleting current version (id %q) %q", object.ID, object.Action)
}
} else {
fs.Debug(remote, "Deleting (id %q)", object.ID)
fs.Debugf(remote, "Deleting (id %q)", object.ID)
toBeDeleted <- object
}
last = remote
@@ -1036,7 +986,7 @@ func (o *Object) parseTimeString(timeString string) (err error) {
}
unixMilliseconds, err := strconv.ParseInt(timeString, 10, 64)
if err != nil {
fs.Debug(o, "Failed to parse mod time string %q: %v", timeString, err)
fs.Debugf(o, "Failed to parse mod time string %q: %v", timeString, err)
return err
}
o.modTime = time.Unix(unixMilliseconds/1E3, (unixMilliseconds%1E3)*1E6).UTC()
@@ -1158,12 +1108,12 @@ func (o *Object) Open(options ...fs.OpenOption) (in io.ReadCloser, err error) {
// Read sha1 from header if it isn't set
if o.sha1 == "" {
o.sha1 = resp.Header.Get(sha1Header)
fs.Debug(o, "Reading sha1 from header - %q", o.sha1)
fs.Debugf(o, "Reading sha1 from header - %q", o.sha1)
// if sha1 header is "none" (in big files), then need
// to read it from the metadata
if o.sha1 == "none" {
o.sha1 = resp.Header.Get(sha1InfoHeader)
fs.Debug(o, "Reading sha1 from info - %q", o.sha1)
fs.Debugf(o, "Reading sha1 from info - %q", o.sha1)
}
}
// Don't check length or hash on partial content
@@ -1265,16 +1215,15 @@ func (o *Object) Update(in io.Reader, src fs.ObjectInfo) (err error) {
in = fd
}
// Get upload Token
o.fs.getUploadToken()
defer o.fs.returnUploadToken()
// Get upload URL
upload, err := o.fs.getUploadURL()
if err != nil {
return err
}
defer o.fs.returnUploadURL(upload)
defer func() {
// return it like this because we might nil it out
o.fs.returnUploadURL(upload)
}()
// Headers for upload file
//
@@ -1343,6 +1292,11 @@ func (o *Object) Update(in io.Reader, src fs.ObjectInfo) (err error) {
},
ContentLength: &size,
}
// for go1.8 (see release notes) we must nil the Body if we want a
// "Content-Length: 0" header which b2 requires for all files.
if size == 0 {
opts.Body = nil
}
var response api.FileInfo
// Don't retry, return a retry error instead
err = o.fs.pacer.CallNoRetry(func() (bool, error) {
@@ -1350,7 +1304,7 @@ func (o *Object) Update(in io.Reader, src fs.ObjectInfo) (err error) {
retry, err := o.fs.shouldRetry(resp, err)
// On retryable error clear UploadURL
if retry {
fs.Debug(o, "Clearing upload URL because of error: %v", err)
fs.Debugf(o, "Clearing upload URL because of error: %v", err)
upload = nil
}
return retry, err
+1
View File
@@ -37,6 +37,7 @@ func TestFsListSubdir(t *testing.T) { fstests.TestFsListSubdir(t) }
func TestFsListLevel2(t *testing.T) { fstests.TestFsListLevel2(t) }
func TestFsListFile1(t *testing.T) { fstests.TestFsListFile1(t) }
func TestFsNewObject(t *testing.T) { fstests.TestFsNewObject(t) }
func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsListFile1and2(t *testing.T) { fstests.TestFsListFile1and2(t) }
func TestFsCopy(t *testing.T) { fstests.TestFsCopy(t) }
func TestFsMove(t *testing.T) { fstests.TestFsMove(t) }
+15 -16
View File
@@ -132,7 +132,7 @@ func (up *largeUpload) transferChunk(part int64, body []byte) error {
up.sha1s[part-1] = calculatedSHA1
size := int64(len(body))
err := up.f.pacer.Call(func() (bool, error) {
fs.Debug(up.o, "Sending chunk %d length %d", part, len(body))
fs.Debugf(up.o, "Sending chunk %d length %d", part, len(body))
// Get upload URL
upload, err := up.getUploadURL()
@@ -181,16 +181,16 @@ func (up *largeUpload) transferChunk(part int64, body []byte) error {
retry, err := up.f.shouldRetry(resp, err)
// On retryable error clear PartUploadURL
if retry {
fs.Debug(up.o, "Clearing part upload URL because of error: %v", err)
fs.Debugf(up.o, "Clearing part upload URL because of error: %v", err)
upload = nil
}
up.returnUploadURL(upload)
return retry, err
})
if err != nil {
fs.Debug(up.o, "Error sending chunk %d: %v", part, err)
fs.Debugf(up.o, "Error sending chunk %d: %v", part, err)
} else {
fs.Debug(up.o, "Done sending chunk %d", part)
fs.Debugf(up.o, "Done sending chunk %d", part)
}
return err
}
@@ -235,13 +235,11 @@ func (up *largeUpload) cancel() error {
// Upload uploads the chunks from the input
func (up *largeUpload) Upload() error {
fs.Debug(up.o, "Starting upload of large file in %d chunks (id %q)", up.parts, up.id)
fs.Debugf(up.o, "Starting upload of large file in %d chunks (id %q)", up.parts, up.id)
remaining := up.size
errs := make(chan error, 1)
var wg sync.WaitGroup
var err error
uploadCounter := up.f.newMultipartUploadCounter()
defer uploadCounter.finished()
fs.AccountByPart(up.o) // Cancel whole file accounting before reading
outer:
for part := int64(1); part <= up.parts; part++ {
@@ -257,20 +255,21 @@ outer:
reqSize = int64(chunkSize)
}
// Get a block of memory
buf := up.f.getUploadBlock()[:reqSize]
// Read the chunk
buf := make([]byte, reqSize)
_, err = io.ReadFull(up.in, buf)
if err != nil {
up.f.putUploadBlock(buf)
break outer
}
// Transfer the chunk
// Get upload Token
token := uploadCounter.getMultipartUploadToken()
wg.Add(1)
go func(part int64, buf []byte, token bool) {
defer uploadCounter.returnMultipartUploadToken(token)
go func(part int64, buf []byte) {
defer wg.Done()
defer up.f.putUploadBlock(buf)
err := up.transferChunk(part, buf)
if err != nil {
select {
@@ -278,7 +277,7 @@ outer:
default:
}
}
}(part, buf, token)
}(part, buf)
remaining -= reqSize
}
@@ -290,14 +289,14 @@ outer:
}
}
if err != nil {
fs.Debug(up.o, "Cancelling large file upload due to error: %v", err)
fs.Debugf(up.o, "Cancelling large file upload due to error: %v", err)
cancelErr := up.cancel()
if cancelErr != nil {
fs.ErrorLog(up.o, "Failed to cancel large file upload: %v", cancelErr)
fs.Errorf(up.o, "Failed to cancel large file upload: %v", cancelErr)
}
return err
}
// Check any errors
fs.Debug(up.o, "Finishing large file upload")
fs.Debugf(up.o, "Finishing large file upload")
return up.finish()
}
-64
View File
@@ -1,64 +0,0 @@
#!/bin/bash
set -e
# This uses gox from https://github.com/mitchellh/gox
# Make sure you've run gox -build-toolchain - not required for go >= 1.5
if [ "$1" == "" ]; then
echo "Syntax: $0 Version"
exit 1
fi
VERSION="$1"
rm -rf build
# Disable CGO and dynamic builds on all platforms (including build patform)
export CGO_ENABLED=0
# Arch pairs we build for
# gox -osarch-list - for definitive list
# go tool dist list - or this
OSARCH="\
windows/386
windows/amd64
darwin/386
darwin/amd64
linux/386
linux/amd64
linux/arm
linux/arm64
freebsd/386
freebsd/amd64
freebsd/arm
netbsd/386
netbsd/amd64
netbsd/arm
openbsd/386
openbsd/amd64
plan9/386
plan9/amd64
solaris/amd64"
# Make space separated
OSARCH=${OSARCH//$'\n'/ }
gox --ldflags "-s -X github.com/ncw/rclone/fs.Version=${VERSION}" -output "build/{{.Dir}}-${VERSION}-{{.OS}}-{{.Arch}}/{{.Dir}}" -osarch "${OSARCH}"
mv build/rclone-${VERSION}-darwin-amd64 build/rclone-${VERSION}-osx-amd64
mv build/rclone-${VERSION}-darwin-386 build/rclone-${VERSION}-osx-386
cd build
for d in `ls`; do
cp -a ../MANUAL.txt $d/README.txt
cp -a ../MANUAL.html $d/README.html
cp -a ../rclone.1 $d/
zip -r9 $d.zip $d
d_current=${d/-${VERSION}/-current}
ln $d.zip $d_current.zip
rm -rf $d
done
cd ..
+162
View File
@@ -0,0 +1,162 @@
// +build ignore
// Cross compile rclone - in go because I hate bash ;-)
package main
import (
"flag"
"log"
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"sync"
"time"
)
var (
// Flags
debug = flag.Bool("d", false, "Print commands instead of running them.")
parallel = flag.Int("parallel", runtime.NumCPU(), "Number of commands to run in parallel.")
copyAs = flag.String("release", "", "Make copies of the releases with this name")
gitLog = flag.String("git-log", "", "git log to include as well")
)
// GOOS/GOARCH pairs we build for
var osarches = []string{
"windows/386",
"windows/amd64",
"darwin/386",
"darwin/amd64",
"linux/386",
"linux/amd64",
"linux/arm",
"linux/arm64",
"linux/mips",
"linux/mipsle",
"freebsd/386",
"freebsd/amd64",
"freebsd/arm",
"netbsd/386",
"netbsd/amd64",
"netbsd/arm",
"openbsd/386",
"openbsd/amd64",
"plan9/386",
"plan9/amd64",
"solaris/amd64",
}
// runEnv - run a shell command with env
func runEnv(args, env []string) {
if *debug {
args = append([]string{"echo"}, args...)
}
cmd := exec.Command(args[0], args[1:]...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if env != nil {
cmd.Env = append(os.Environ(), env...)
}
err := cmd.Run()
if err != nil {
log.Fatalf("Failed to run %v: %v", args, err)
}
}
// run a shell command
func run(args ...string) {
runEnv(args, nil)
}
// build the binary in dir
func compileArch(version, goos, goarch, dir string) {
log.Printf("Compiling %s/%s", goos, goarch)
output := filepath.Join(dir, "rclone")
if goos == "windows" {
output += ".exe"
}
err := os.MkdirAll(dir, 0777)
if err != nil {
log.Fatalf("Failed to mkdir: %v", err)
}
args := []string{
"go", "build",
"--ldflags", "-s -X github.com/ncw/rclone/fs.Version=" + version,
"-i",
"-o", output,
"..",
}
env := []string{
"GOOS=" + goos,
"GOARCH=" + goarch,
"CGO_ENABLED=0",
}
runEnv(args, env)
// Now build the zip
run("cp", "-a", "../MANUAL.txt", filepath.Join(dir, "README.txt"))
run("cp", "-a", "../MANUAL.html", filepath.Join(dir, "README.html"))
run("cp", "-a", "../rclone.1", dir)
if *gitLog != "" {
run("cp", "-a", *gitLog, dir)
}
zip := dir + ".zip"
run("zip", "-r9", zip, dir)
if *copyAs != "" {
copyAsZip := strings.Replace(zip, "-"+version, "-"+*copyAs, 1)
run("ln", zip, copyAsZip)
}
run("rm", "-rf", dir)
log.Printf("Done compiling %s/%s", goos, goarch)
}
func compile(version string) {
start := time.Now()
wg := new(sync.WaitGroup)
run := make(chan func(), *parallel)
for i := 0; i < *parallel; i++ {
wg.Add(1)
go func() {
defer wg.Done()
for f := range run {
f()
}
}()
}
for _, osarch := range osarches {
parts := strings.Split(osarch, "/")
if len(parts) != 2 {
log.Fatalf("Bad osarch %q", osarch)
}
goos, goarch := parts[0], parts[1]
userGoos := goos
if goos == "darwin" {
userGoos = "osx"
}
dir := filepath.Join("rclone-" + version + "-" + userGoos + "-" + goarch)
run <- func() {
compileArch(version, goos, goarch, dir)
}
}
close(run)
wg.Wait()
log.Printf("Compiled %d arches in %v", len(osarches), time.Since(start))
}
func main() {
flag.Parse()
args := flag.Args()
if len(args) != 1 {
log.Fatalf("Syntax: %s <version>", os.Args[0])
}
version := args[0]
run("rm", "-rf", "build")
run("mkdir", "build")
err := os.Chdir("build")
if err != nil {
log.Fatalf("Couldn't cd into build dir: %v", err)
}
compile(version)
}
+1
View File
@@ -29,6 +29,7 @@ docs = [
"hubic.md",
"b2.md",
"yandex.md",
"sftp.md",
"crypt.md",
"local.md",
"changelog.md",
+2
View File
@@ -11,6 +11,7 @@ import (
_ "github.com/ncw/rclone/cmd/config"
_ "github.com/ncw/rclone/cmd/copy"
_ "github.com/ncw/rclone/cmd/copyto"
_ "github.com/ncw/rclone/cmd/cryptcheck"
_ "github.com/ncw/rclone/cmd/dedupe"
_ "github.com/ncw/rclone/cmd/delete"
_ "github.com/ncw/rclone/cmd/genautocomplete"
@@ -25,6 +26,7 @@ import (
_ "github.com/ncw/rclone/cmd/mount"
_ "github.com/ncw/rclone/cmd/move"
_ "github.com/ncw/rclone/cmd/moveto"
_ "github.com/ncw/rclone/cmd/obscure"
_ "github.com/ncw/rclone/cmd/purge"
_ "github.com/ncw/rclone/cmd/rmdir"
_ "github.com/ncw/rclone/cmd/rmdirs"
+45
View File
@@ -0,0 +1,45 @@
package cmd
// Atexit handling
import (
"os"
"os/signal"
"sync"
"github.com/ncw/rclone/fs"
)
var (
atExitFns []func()
atExitOnce sync.Once
atExitRegisterOnce sync.Once
)
// AtExit registers a function to be added on exit
func AtExit(fn func()) {
atExitFns = append(atExitFns, fn)
// Run AtExit handlers on SIGINT or SIGTERM so everything gets
// tidied up properly
atExitRegisterOnce.Do(func() {
go func() {
ch := make(chan os.Signal, 1)
signal.Notify(ch, os.Interrupt) // syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT
sig := <-ch
fs.Infof(nil, "Signal received: %s", sig)
runAtExitFunctions()
fs.Infof(nil, "Exiting...")
os.Exit(0)
}()
})
}
// Runs all the AtExit functions if they haven't been run already
func runAtExitFunctions() {
atExitOnce.Do(func() {
for _, fn := range atExitFns {
fn()
}
})
}
+41 -1
View File
@@ -1,6 +1,9 @@
package cat
import (
"io"
"io/ioutil"
"log"
"os"
"github.com/ncw/rclone/cmd"
@@ -8,8 +11,22 @@ import (
"github.com/spf13/cobra"
)
// Globals
var (
head = int64(0)
tail = int64(0)
offset = int64(0)
count = int64(-1)
discard = false
)
func init() {
cmd.Root.AddCommand(commandDefintion)
commandDefintion.Flags().Int64VarP(&head, "head", "", head, "Only print the first N characters.")
commandDefintion.Flags().Int64VarP(&tail, "tail", "", tail, "Only print the last N characters.")
commandDefintion.Flags().Int64VarP(&offset, "offset", "", offset, "Start printing at offset N (or from end if -ve).")
commandDefintion.Flags().Int64VarP(&count, "count", "", count, "Only print N characters.")
commandDefintion.Flags().BoolVarP(&discard, "discard", "", discard, "Discard the output instead of printing.")
}
var commandDefintion = &cobra.Command{
@@ -29,12 +46,35 @@ Or like this to output any file in dir or subdirectories.
Or like this to output any .txt files in dir or subdirectories.
rclone --include "*.txt" cat remote:path/to/dir
Use the --head flag to print characters only at the start, --tail for
the end and --offset and --count to print a section in the middle.
Note that if offset is negative it will count from the end, so
--offset -1 --count 1 is equivalent to --tail 1.
`,
Run: func(command *cobra.Command, args []string) {
usedOffset := offset != 0 || count >= 0
usedHead := head > 0
usedTail := tail > 0
if usedHead && usedTail || usedHead && usedOffset || usedTail && usedOffset {
log.Fatalf("Can only use one of --head, --tail or --offset with --count")
}
if head > 0 {
offset = 0
count = head
}
if tail > 0 {
offset = -tail
count = -1
}
cmd.CheckArgs(1, 1, command, args)
fsrc := cmd.NewFsSrc(args)
var w io.Writer = os.Stdout
if discard {
w = ioutil.Discard
}
cmd.Run(false, false, command, func() error {
return fs.Cat(fsrc, os.Stdout)
return fs.Cat(fsrc, w, offset, count)
})
},
}
+19 -4
View File
@@ -6,24 +6,39 @@ import (
"github.com/spf13/cobra"
)
// Globals
var (
download = false
)
func init() {
cmd.Root.AddCommand(commandDefintion)
commandDefintion.Flags().BoolVarP(&download, "download", "", download, "Check by downloading rather than with hash.")
}
var commandDefintion = &cobra.Command{
Use: "check source:path dest:path",
Short: `Checks the files in the source and destination match.`,
Long: `
Checks the files in the source and destination match. It
compares sizes and MD5SUMs and prints a report of files which
don't match. It doesn't alter the source or destination.
Checks the files in the source and destination match. It compares
sizes and hashes (MD5 or SHA1) and logs a report of files which don't
match. It doesn't alter the source or destination.
` + "`" + `--size-only` + "`" + ` may be used to only compare the sizes, not the MD5SUMs.
If you supply the --size-only flag, it will only compare the sizes not
the hashes as well. Use this for a quick check.
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.
`,
Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(2, 2, command, args)
fsrc, fdst := cmd.NewFsSrcDst(args)
cmd.Run(false, false, command, func() error {
if download {
return fs.CheckDownload(fdst, fsrc)
}
return fs.Check(fdst, fsrc)
})
},
+41 -53
View File
@@ -26,13 +26,12 @@ import (
// Globals
var (
// Flags
cpuProfile = pflag.StringP("cpuprofile", "", "", "Write cpu profile to file")
memProfile = pflag.String("memprofile", "", "Write memory profile to file")
statsInterval = pflag.DurationP("stats", "", time.Minute*1, "Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable)")
dataRateUnit = pflag.StringP("stats-unit", "", "bytes", "Show data rate in stats as either 'bits' or 'bytes'/s")
cpuProfile = fs.StringP("cpuprofile", "", "", "Write cpu profile to file")
memProfile = fs.StringP("memprofile", "", "", "Write memory profile to file")
statsInterval = fs.DurationP("stats", "", time.Minute*1, "Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable)")
dataRateUnit = fs.StringP("stats-unit", "", "bytes", "Show data rate in stats as either 'bits' or 'bytes'/s")
version bool
logFile = pflag.StringP("log-file", "", "", "Log everything to this file")
retries = pflag.IntP("retries", "", 3, "Retry operations this many times if they fail")
retries = fs.IntP("retries", "", 3, "Retry operations this many times if they fail")
)
// Root is the main rclone command
@@ -70,6 +69,10 @@ and configuration walkthroughs.
* http://rclone.org/
`,
PersistentPostRun: func(cmd *cobra.Command, args []string) {
fs.Debugf("rclone", "Version %q finishing with parameters %q", fs.Version, os.Args)
runAtExitFunctions()
},
}
// runRoot implements the main rclone command with no subcommands
@@ -163,7 +166,11 @@ func NewFsSrcDst(args []string) (fs.Fs, fs.Fs) {
// RemoteSplit splits a remote into a parent and a leaf
//
// if it returns parent as an empty string then it wasn't possible
// if it returns leaf as an empty string then remote is a directory
//
// if it returns parent as an empty string then that means the current directory
//
// The returned values have the property that parent + leaf == remote
func RemoteSplit(remote string) (parent string, leaf string) {
// Split remote on :
i := strings.Index(remote, ":")
@@ -172,23 +179,13 @@ func RemoteSplit(remote string) (parent string, leaf string) {
if i >= 0 {
remoteName = remote[:i+1]
remotePath = remote[i+1:]
}
if remotePath == "" {
return "", ""
} else if strings.HasSuffix(remotePath, "/") {
// if no : and ends with / must be directory
return remotePath, ""
}
// Construct new remote name without last segment
parent, leaf = path.Split(remotePath)
if leaf == "" {
return "", ""
}
if parent != "/" {
parent = strings.TrimSuffix(parent, "/")
}
parent = remoteName + parent
if parent == "" {
parent = "."
}
return parent, leaf
return remoteName + parent, leaf
}
// NewFsSrcDstFiles creates a new src and dst fs from the arguments
@@ -200,7 +197,10 @@ func NewFsSrcDstFiles(args []string) (fsrc fs.Fs, srcFileName string, fdst fs.Fs
if srcFileName != "" {
dstRemote, dstFileName = RemoteSplit(dstRemote)
if dstRemote == "" {
log.Fatalf("Can't find parent directory for %q", args[1])
dstRemote = "."
}
if dstFileName == "" {
log.Fatalf("%q is a directory", args[1])
}
}
fdst = newFsDst(dstRemote)
@@ -247,22 +247,22 @@ func Run(Retry bool, showStats bool, cmd *cobra.Command, f func() error) {
err = f()
if !Retry || (err == nil && !fs.Stats.Errored()) {
if try > 1 {
fs.ErrorLog(nil, "Attempt %d/%d succeeded", try, *retries)
fs.Errorf(nil, "Attempt %d/%d succeeded", try, *retries)
}
break
}
if fs.IsFatalError(err) {
fs.ErrorLog(nil, "Fatal error received - not attempting retries")
fs.Errorf(nil, "Fatal error received - not attempting retries")
break
}
if fs.IsNoRetryError(err) {
fs.ErrorLog(nil, "Can't retry this error - not attempting retries")
fs.Errorf(nil, "Can't retry this error - not attempting retries")
break
}
if err != nil {
fs.ErrorLog(nil, "Attempt %d/%d failed with %d errors and: %v", try, *retries, fs.Stats.GetErrors(), err)
fs.Errorf(nil, "Attempt %d/%d failed with %d errors and: %v", try, *retries, fs.Stats.GetErrors(), err)
} else {
fs.ErrorLog(nil, "Attempt %d/%d failed with %d errors", try, *retries, fs.Stats.GetErrors())
fs.Errorf(nil, "Attempt %d/%d failed with %d errors", try, *retries, fs.Stats.GetErrors())
}
if try < *retries {
fs.Stats.ResetErrors()
@@ -274,12 +274,10 @@ func Run(Retry bool, showStats bool, cmd *cobra.Command, f func() error) {
if err != nil {
log.Fatalf("Failed to %s: %v", cmd.Name(), err)
}
if showStats && (!fs.Config.Quiet || fs.Stats.Errored() || *statsInterval > 0) {
fs.Log(nil, "%s", fs.Stats)
}
if fs.Config.Verbose {
fs.Debug(nil, "Go routines at exit %d\n", runtime.NumGoroutine())
if showStats && (fs.Stats.Errored() || *statsInterval > 0) {
fs.Infof(nil, "%s", fs.Stats)
}
fs.Debugf(nil, "Go routines at exit %d\n", runtime.NumGoroutine())
if fs.Stats.Errored() {
os.Exit(1)
}
@@ -322,30 +320,18 @@ func StartStats() chan struct{} {
// initConfig is run by cobra after initialising the flags
func initConfig() {
// Log file output
if *logFile != "" {
f, err := os.OpenFile(*logFile, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0640)
if err != nil {
log.Fatalf("Failed to open log file: %v", err)
}
_, err = f.Seek(0, os.SEEK_END)
if err != nil {
fs.ErrorLog(nil, "Failed to seek log file to end: %v", err)
}
log.SetOutput(f)
fs.DebugLogger.SetOutput(f)
redirectStderr(f)
}
// Start the logger
fs.InitLogging()
// Load the rest of the config now we have started the logger
fs.LoadConfig()
// Write the args for debug purposes
fs.Debug("rclone", "Version %q starting with parameters %q", fs.Version, os.Args)
fs.Debugf("rclone", "Version %q starting with parameters %q", fs.Version, os.Args)
// Setup CPU profiling if desired
if *cpuProfile != "" {
fs.Log(nil, "Creating CPU profile %q\n", *cpuProfile)
fs.Infof(nil, "Creating CPU profile %q\n", *cpuProfile)
f, err := os.Create(*cpuProfile)
if err != nil {
fs.Stats.Error()
@@ -356,13 +342,15 @@ func initConfig() {
fs.Stats.Error()
log.Fatal(err)
}
defer pprof.StopCPUProfile()
AtExit(func() {
pprof.StopCPUProfile()
})
}
// Setup memory profiling if desired
if *memProfile != "" {
defer func() {
fs.Log(nil, "Saving Memory profile %q\n", *memProfile)
AtExit(func() {
fs.Infof(nil, "Saving Memory profile %q\n", *memProfile)
f, err := os.Create(*memProfile)
if err != nil {
fs.Stats.Error()
@@ -378,11 +366,11 @@ func initConfig() {
fs.Stats.Error()
log.Fatal(err)
}
}()
})
}
if m, _ := regexp.MatchString("^(bits|bytes)$", *dataRateUnit); m == false {
fs.ErrorLog(nil, "Invalid unit passed to --stats-unit. Defaulting to bytes.")
fs.Errorf(nil, "Invalid unit passed to --stats-unit. Defaulting to bytes.")
fs.Config.DataRateUnit = "bytes"
} else {
fs.Config.DataRateUnit = *dataRateUnit
+13 -6
View File
@@ -1,6 +1,7 @@
package cmd
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
@@ -12,17 +13,23 @@ func TestRemoteSplit(t *testing.T) {
remote, wantParent, wantLeaf string
}{
{"", "", ""},
{"remote:", "", ""},
{"remote:", "remote:", ""},
{"remote:potato", "remote:", "potato"},
{"remote:potato/sausage", "remote:potato", "sausage"},
{"/", "", ""},
{"remote:/", "remote:/", ""},
{"remote:/potato", "remote:/", "potato"},
{"remote:/potato/potato", "remote:/potato/", "potato"},
{"remote:potato/sausage", "remote:potato/", "sausage"},
{"/", "/", ""},
{"/root", "/", "root"},
{"/a/b", "/a", "b"},
{"root", ".", "root"},
{"a/b", "a", "b"},
{"/a/b", "/a/", "b"},
{"root", "", "root"},
{"a/b", "a/", "b"},
{"root/", "root/", ""},
{"a/b/", "a/b/", ""},
} {
gotParent, gotLeaf := RemoteSplit(test.remote)
assert.Equal(t, test.wantParent, gotParent, test.remote)
assert.Equal(t, test.wantLeaf, gotLeaf, test.remote)
assert.Equal(t, test.remote, gotParent+gotLeaf, fmt.Sprintf("%s: %q + %q != %q", test.remote, gotParent, gotLeaf, test.remote))
}
}
+101
View File
@@ -0,0 +1,101 @@
package cryptcheck
import (
"github.com/ncw/rclone/cmd"
"github.com/ncw/rclone/crypt"
"github.com/ncw/rclone/fs"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)
func init() {
cmd.Root.AddCommand(commandDefintion)
}
var commandDefintion = &cobra.Command{
Use: "cryptcheck remote:path cryptedremote:path",
Short: `Cryptcheck checks the integritity of a crypted remote.`,
Long: `
rclone cryptcheck checks a remote against a crypted remote. This is
the equivalent of running rclone check, but able to check the
checksums of the crypted remote.
For it to work the underlying remote of the cryptedremote must support
some kind of checksum.
It works by reading the nonce from each file on the cryptedremote: and
using that to encrypt each file on the remote:. It then checks the
checksum of the underlying file on the cryptedremote: against the
checksum of the file it has just encrypted.
Use it like this
rclone cryptcheck /path/to/files encryptedremote:path
You can use it like this also, but that will involve downloading all
the files in remote:path.
rclone cryptcheck remote:path encryptedremote:path
After it has run it will log the status of the encryptedremote:.
`,
Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(2, 2, command, args)
fsrc, fdst := cmd.NewFsSrcDst(args)
cmd.Run(false, true, command, func() error {
return cryptCheck(fdst, fsrc)
})
},
}
// cryptCheck checks the integrity of a crypted remote
func cryptCheck(fdst, fsrc fs.Fs) error {
// Check to see fcrypt is a crypt
fcrypt, ok := fdst.(*crypt.Fs)
if !ok {
return errors.Errorf("%s:%s is not a crypt remote", fdst.Name(), fdst.Root())
}
// Find a hash to use
funderlying := fcrypt.UnWrap()
hashType := funderlying.Hashes().GetOne()
if hashType == fs.HashNone {
return errors.Errorf("%s:%s does not support any hashes", funderlying.Name(), funderlying.Root())
}
fs.Infof(nil, "Using %v for hash comparisons", hashType)
// checkIdentical checks to see if dst and src are identical
//
// it returns true if differences were found
// it also returns whether it couldn't be hashed
checkIdentical := func(dst, src fs.Object) (differ bool, noHash bool) {
cryptDst := dst.(*crypt.Object)
underlyingDst := cryptDst.UnWrap()
underlyingHash, err := underlyingDst.Hash(hashType)
if err != nil {
fs.Stats.Error()
fs.Errorf(dst, "Error reading hash from underlying %v: %v", underlyingDst, err)
return true, false
}
if underlyingHash == "" {
return false, true
}
cryptHash, err := fcrypt.ComputeHash(cryptDst, src, hashType)
if err != nil {
fs.Stats.Error()
fs.Errorf(dst, "Error computing hash: %v", err)
return true, false
}
if cryptHash == "" {
return false, true
}
if cryptHash != underlyingHash {
fs.Stats.Error()
fs.Errorf(src, "hashes differ (%s:%s) %q vs (%s:%s) %q", fdst.Name(), fdst.Root(), cryptHash, fsrc.Name(), fsrc.Root(), underlyingHash)
return true, false
}
fs.Debugf(src, "OK")
return false, false
}
return fs.CheckFn(fcrypt, fsrc, checkIdentical)
}
+2 -2
View File
@@ -29,7 +29,7 @@ When uses with the -l flag it lists the types too.
`,
Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(0, 0, command, args)
remotes := fs.ConfigFile.GetSectionList()
remotes := fs.ConfigFileSections()
sort.Strings(remotes)
maxlen := 1
for _, remote := range remotes {
@@ -39,7 +39,7 @@ When uses with the -l flag it lists the types too.
}
for _, remote := range remotes {
if listLong {
remoteType := fs.ConfigFile.MustValue(remote, "type", "UNKNOWN")
remoteType := fs.ConfigFileGet(remote, "type", "UNKNOWN")
fmt.Printf("%-*s %s\n", maxlen+1, remote+":", remoteType)
} else {
fmt.Printf("%s:\n", remote)
+1 -1
View File
@@ -14,7 +14,7 @@ func init() {
var commandDefintion = &cobra.Command{
Use: "ls remote:path",
Short: `List all the objects in the the path with size and path.`,
Short: `List all the objects in the path with size and path.`,
Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args)
fsrc := cmd.NewFsSrc(args)
+1 -1
View File
@@ -14,7 +14,7 @@ func init() {
var commandDefintion = &cobra.Command{
Use: "lsd remote:path",
Short: `List all directories/containers/buckets in the the path.`,
Short: `List all directories/containers/buckets in the path.`,
Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args)
fsrc := cmd.NewFsSrc(args)
+2 -2
View File
@@ -41,8 +41,8 @@ var commandDefintion = &cobra.Command{
runtime.GC()
runtime.ReadMemStats(&after)
usedMemory := after.Alloc - before.Alloc
fs.Log(nil, "%d objects took %d bytes, %.1f bytes/object", len(objs), usedMemory, float64(usedMemory)/float64(len(objs)))
fs.Log(nil, "System memory changed from %d to %d bytes a change of %d bytes", before.Sys, after.Sys, after.Sys-before.Sys)
fs.Logf(nil, "%d objects took %d bytes, %.1f bytes/object", len(objs), usedMemory, float64(usedMemory)/float64(len(objs)))
fs.Logf(nil, "System memory changed from %d to %d bytes a change of %d bytes", before.Sys, after.Sys, after.Sys-before.Sys)
return nil
})
},
+125 -78
View File
@@ -43,6 +43,17 @@ func newDir(f fs.Fs, fsDir *fs.Dir) *Dir {
}
}
// rename should be called after the directory is renamed
//
// Reset the directory to new state, discarding all the objects and
// reading everything again
func (d *Dir) rename(newParent *Dir, fsDir *fs.Dir) {
d.path = fsDir.Name
d.modTime = fsDir.When
d.items = nil
d.read = time.Time{}
}
// addObject adds a new object or directory to the directory
//
// note that we add new objects rather than updating old ones
@@ -70,15 +81,15 @@ func (d *Dir) readDir() error {
defer d.mu.Unlock()
when := time.Now()
if d.read.IsZero() {
fs.Debug(d.path, "Reading directory")
fs.Debugf(d.path, "Reading directory")
} else {
age := when.Sub(d.read)
if age < dirCacheTime {
return nil
}
fs.Debug(d.path, "Re-reading directory (%v old)", age)
fs.Debugf(d.path, "Re-reading directory (%v old)", age)
}
objs, dirs, err := fs.NewLister().SetLevel(1).Start(d.f, d.path).GetAll()
entries, err := fs.ListDirSorted(d.f, false, d.path)
if err == fs.ErrorDirNotFound {
// We treat directory not found as empty because we
// create directories on the fly
@@ -93,26 +104,34 @@ func (d *Dir) readDir() error {
oldItems := d.items
// Cache the items by name
d.items = make(map[string]*DirEntry, len(objs)+len(dirs))
for _, obj := range objs {
name := path.Base(obj.Remote())
d.items[name] = &DirEntry{
o: obj,
node: nil,
}
}
for _, dir := range dirs {
name := path.Base(dir.Remote())
// Use old dir value if it exists
if oldItem, ok := oldItems[name]; ok {
if _, ok := oldItem.o.(*fs.Dir); ok {
d.items[name] = oldItem
continue
d.items = make(map[string]*DirEntry, len(entries))
for _, entry := range entries {
switch item := entry.(type) {
case fs.Object:
obj := item
name := path.Base(obj.Remote())
d.items[name] = &DirEntry{
o: obj,
node: nil,
}
}
d.items[name] = &DirEntry{
o: dir,
node: nil,
case *fs.Dir:
dir := item
name := path.Base(dir.Remote())
// Use old dir value if it exists
if oldItem, ok := oldItems[name]; ok {
if _, ok := oldItem.o.(*fs.Dir); ok {
d.items[name] = oldItem
continue
}
}
d.items[name] = &DirEntry{
o: dir,
node: nil,
}
default:
err = errors.Errorf("unknown type %T", item)
fs.Errorf(d.path, "readDir error: %v", err)
return err
}
}
d.read = when
@@ -152,7 +171,6 @@ var _ fusefs.Node = (*Dir)(nil)
// Attr updates the attribes of a directory
func (d *Dir) Attr(ctx context.Context, a *fuse.Attr) error {
fs.Debug(d.path, "Dir.Attr")
a.Gid = gid
a.Uid = uid
a.Mode = os.ModeDir | dirPerms
@@ -160,7 +178,8 @@ func (d *Dir) Attr(ctx context.Context, a *fuse.Attr) error {
a.Mtime = d.modTime
a.Ctime = d.modTime
a.Crtime = d.modTime
// FIXME include Valid so get some caching? Also mtime
// FIXME include Valid so get some caching?
fs.Debugf(d.path, "Dir.Attr %+v", a)
return nil
}
@@ -186,7 +205,7 @@ func (d *Dir) lookupNode(leaf string) (item *DirEntry, err error) {
return nil, err
}
item = d.addObject(item.o, node)
return item, err
return item, nil
}
// Check interface satisfied
@@ -200,15 +219,15 @@ var _ fusefs.NodeRequestLookuper = (*Dir)(nil)
// Lookup need not to handle the names "." and "..".
func (d *Dir) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse.LookupResponse) (node fusefs.Node, err error) {
path := path.Join(d.path, req.Name)
fs.Debug(path, "Dir.Lookup")
fs.Debugf(path, "Dir.Lookup")
item, err := d.lookupNode(req.Name)
if err != nil {
if err != fuse.ENOENT {
fs.ErrorLog(path, "Dir.Lookup error: %v", err)
fs.Errorf(path, "Dir.Lookup error: %v", err)
}
return nil, err
}
fs.Debug(path, "Dir.Lookup OK")
fs.Debugf(path, "Dir.Lookup OK")
return item.node, nil
}
@@ -217,10 +236,10 @@ var _ fusefs.HandleReadDirAller = (*Dir)(nil)
// ReadDirAll reads the contents of the directory
func (d *Dir) ReadDirAll(ctx context.Context) (dirents []fuse.Dirent, err error) {
fs.Debug(d.path, "Dir.ReadDirAll")
fs.Debugf(d.path, "Dir.ReadDirAll")
err = d.readDir()
if err != nil {
fs.Debug(d.path, "Dir.ReadDirAll error: %v", err)
fs.Debugf(d.path, "Dir.ReadDirAll error: %v", err)
return nil, err
}
d.mu.RLock()
@@ -242,12 +261,12 @@ func (d *Dir) ReadDirAll(ctx context.Context) (dirents []fuse.Dirent, err error)
}
default:
err = errors.Errorf("unknown type %T", item)
fs.ErrorLog(d.path, "Dir.ReadDirAll error: %v", err)
fs.Errorf(d.path, "Dir.ReadDirAll error: %v", err)
return nil, err
}
dirents = append(dirents, dirent)
}
fs.Debug(d.path, "Dir.ReadDirAll OK with %d entries", len(dirents))
fs.Debugf(d.path, "Dir.ReadDirAll OK with %d entries", len(dirents))
return dirents, nil
}
@@ -256,16 +275,16 @@ var _ fusefs.NodeCreater = (*Dir)(nil)
// Create makes a new file
func (d *Dir) Create(ctx context.Context, req *fuse.CreateRequest, resp *fuse.CreateResponse) (fusefs.Node, fusefs.Handle, error) {
path := path.Join(d.path, req.Name)
fs.Debug(path, "Dir.Create")
fs.Debugf(path, "Dir.Create")
src := newCreateInfo(d.f, path)
// This gets added to the directory when the file is written
file := newFile(d, nil)
fh, err := newWriteFileHandle(d, file, src)
if err != nil {
fs.ErrorLog(path, "Dir.Create error: %v", err)
fs.Errorf(path, "Dir.Create error: %v", err)
return nil, nil, err
}
fs.Debug(path, "Dir.Create OK")
fs.Debugf(path, "Dir.Create OK")
return file, fh, nil
}
@@ -273,17 +292,20 @@ var _ fusefs.NodeMkdirer = (*Dir)(nil)
// Mkdir creates a new directory
func (d *Dir) Mkdir(ctx context.Context, req *fuse.MkdirRequest) (fusefs.Node, error) {
// We just pretend to have created the directory - rclone will
// actually create the directory if we write files into it
path := path.Join(d.path, req.Name)
fs.Debug(path, "Dir.Mkdir")
fs.Debugf(path, "Dir.Mkdir")
err := d.f.Mkdir(path)
if err != nil {
fs.Errorf(path, "Dir.Mkdir failed to create directory: %v", err)
return nil, err
}
fsDir := &fs.Dir{
Name: path,
When: time.Now(),
}
dir := newDir(d.f, fsDir)
d.addObject(fsDir, dir)
fs.Debug(path, "Dir.Mkdir OK")
fs.Debugf(path, "Dir.Mkdir OK")
return dir, nil
}
@@ -294,42 +316,45 @@ var _ fusefs.NodeRemover = (*Dir)(nil)
// may correspond to a file (unlink) or to a directory (rmdir).
func (d *Dir) Remove(ctx context.Context, req *fuse.RemoveRequest) error {
path := path.Join(d.path, req.Name)
fs.Debug(path, "Dir.Remove")
fs.Debugf(path, "Dir.Remove")
item, err := d.lookupNode(req.Name)
if err != nil {
fs.ErrorLog(path, "Dir.Remove error: %v", err)
fs.Errorf(path, "Dir.Remove error: %v", err)
return err
}
switch x := item.o.(type) {
case fs.Object:
err = x.Remove()
if err != nil {
fs.ErrorLog(path, "Dir.Remove file error: %v", err)
fs.Errorf(path, "Dir.Remove file error: %v", err)
return err
}
case *fs.Dir:
// Do nothing for deleting directory - rclone can't
// currently remote a random directory
//
// Check directory is empty first though
// Check directory is empty first
dir := item.node.(*Dir)
empty, err := dir.isEmpty()
if err != nil {
fs.ErrorLog(path, "Dir.Remove dir error: %v", err)
fs.Errorf(path, "Dir.Remove dir error: %v", err)
return err
}
if !empty {
// return fuse.ENOTEMPTY - doesn't exist though so use EEXIST
fs.ErrorLog(path, "Dir.Remove not empty")
fs.Errorf(path, "Dir.Remove not empty")
return fuse.EEXIST
}
// remove directory
err = d.f.Rmdir(path)
if err != nil {
fs.Errorf(path, "Dir.Remove failed to remove directory: %v", err)
return err
}
default:
fs.ErrorLog(path, "Dir.Remove unknown type %T", item)
fs.Errorf(path, "Dir.Remove unknown type %T", item)
return errors.Errorf("unknown type %T", item)
}
// Remove the item from the directory listing
d.delObject(req.Name)
fs.Debug(path, "Dir.Remove OK")
fs.Debugf(path, "Dir.Remove OK")
return nil
}
@@ -342,65 +367,87 @@ func (d *Dir) Rename(ctx context.Context, req *fuse.RenameRequest, newDir fusefs
destDir, ok := newDir.(*Dir)
if !ok {
err := errors.Errorf("Unknown Dir type %T", newDir)
fs.ErrorLog(oldPath, "Dir.Rename error: %v", err)
fs.Errorf(oldPath, "Dir.Rename error: %v", err)
return err
}
newPath := path.Join(destDir.path, req.NewName)
fs.Debug(oldPath, "Dir.Rename to %q", newPath)
fs.Debugf(oldPath, "Dir.Rename to %q", newPath)
oldItem, err := d.lookupNode(req.OldName)
if err != nil {
fs.ErrorLog(oldPath, "Dir.Rename error: %v", err)
fs.Errorf(oldPath, "Dir.Rename error: %v", err)
return err
}
var newObj fs.BasicInfo
oldNode := oldItem.node
switch x := oldItem.o.(type) {
case fs.Object:
oldObject := x
do, ok := d.f.(fs.Mover)
if !ok {
err := errors.Errorf("Fs %q can't Move files", d.f)
fs.ErrorLog(oldPath, "Dir.Rename error: %v", err)
// FIXME: could Copy then Delete if Move not available
// - though care needed if case insensitive...
doMove := d.f.Features().Move
if doMove == nil {
err := errors.Errorf("Fs %q can't rename files (no Move)", d.f)
fs.Errorf(oldPath, "Dir.Rename error: %v", err)
return err
}
newObject, err := do.Move(oldObject, newPath)
newObject, err := doMove(oldObject, newPath)
if err != nil {
fs.ErrorLog(oldPath, "Dir.Rename error: %v", err)
fs.Errorf(oldPath, "Dir.Rename error: %v", err)
return err
}
newObj = newObject
// Update the node with the new details
if oldNode != nil {
if oldFile, ok := oldNode.(*File); ok {
fs.Debugf(oldItem.o, "Updating file with %v %p", newObject, oldFile)
oldFile.rename(destDir, newObject)
}
}
case *fs.Dir:
oldDir := oldItem.node.(*Dir)
empty, err := oldDir.isEmpty()
if err != nil {
fs.ErrorLog(oldPath, "Dir.Rename dir error: %v", err)
doDirMove := d.f.Features().DirMove
if doDirMove == nil {
err := errors.Errorf("Fs %q can't rename directories (no DirMove)", d.f)
fs.Errorf(oldPath, "Dir.Rename error: %v", err)
return err
}
if !empty {
// return fuse.ENOTEMPTY - doesn't exist though so use EEXIST
fs.ErrorLog(oldPath, "Dir.Rename can't rename non empty directory")
return fuse.EEXIST
srcRemote := x.Name
dstRemote := newPath
err = doDirMove(d.f, srcRemote, dstRemote)
if err != nil {
fs.Errorf(oldPath, "Dir.Rename error: %v", err)
return err
}
newObj = &fs.Dir{
Name: newPath,
When: time.Now(),
newDir := new(fs.Dir)
*newDir = *x
newDir.Name = newPath
newObj = newDir
// Update the node with the new details
if oldNode != nil {
if oldDir, ok := oldNode.(*Dir); ok {
fs.Debugf(oldItem.o, "Updating dir with %v %p", newDir, oldDir)
oldDir.rename(destDir, newDir)
}
}
default:
err = errors.Errorf("unknown type %T", oldItem)
fs.ErrorLog(d.path, "Dir.ReadDirAll error: %v", err)
fs.Errorf(d.path, "Dir.ReadDirAll error: %v", err)
return err
}
// Show moved - delete from old dir and add to new
d.delObject(req.OldName)
destDir.addObject(newObj, nil)
destDir.addObject(newObj, oldNode)
// FIXME need to flush the dir also
fs.Debugf(newPath, "Dir.Rename renamed from %q", oldPath)
return nil
}
// FIXME use DirMover to move a directory?
// or maybe use MoveDir which can move anything
// fallback to Copy/Delete if no Move?
// if dir is empty then can move it
// Check interface satisfied
var _ fusefs.NodeFsyncer = (*Dir)(nil)
fs.ErrorLog(newPath, "Dir.Rename renamed from %q", oldPath)
// Fsync the directory
//
// Note that we don't do anything except return OK
func (d *Dir) Fsync(ctx context.Context, req *fuse.FsyncRequest) error {
return nil
}
+19 -17
View File
@@ -3,6 +3,7 @@
package mount
import (
"io/ioutil"
"os"
"testing"
@@ -70,14 +71,22 @@ func TestDirRenameFile(t *testing.T) {
run.createFile(t, "file", "potato")
run.checkDir(t, "dir/|file 6")
err := os.Rename(run.path("file"), run.path("dir/file2"))
err := os.Rename(run.path("file"), run.path("file2"))
require.NoError(t, err)
run.checkDir(t, "dir/|dir/file2 6")
run.checkDir(t, "dir/|file2 6")
err = os.Rename(run.path("dir/file2"), run.path("dir/file3"))
data, err := ioutil.ReadFile(run.path("file2"))
require.NoError(t, err)
assert.Equal(t, "potato", string(data))
err = os.Rename(run.path("file2"), run.path("dir/file3"))
require.NoError(t, err)
run.checkDir(t, "dir/|dir/file3 6")
data, err = ioutil.ReadFile(run.path("dir/file3"))
require.NoError(t, err)
assert.Equal(t, "potato", string(data))
run.rm(t, "dir/file3")
run.rmdir(t, "dir")
run.checkDir(t, "")
@@ -112,22 +121,15 @@ func TestDirRenameFullDir(t *testing.T) {
run.checkDir(t, "dir/|dir1/|dir1/potato.txt 11")
err := os.Rename(run.path("dir1"), run.path("dir/dir2"))
require.Error(t, err, "file exists")
// Can't currently rename directories with stuff in
/*
require.NoError(t, err)
run.checkDir(t, "dir/|dir/dir2/|dir/dir2/potato.txt 11")
require.NoError(t, err)
run.checkDir(t, "dir/|dir/dir2/|dir/dir2/potato.txt 11")
err = os.Rename(run.path("dir/dir2"), run.path("dir/dir3"))
require.NoError(t, err)
run.checkDir(t, "dir/|dir/dir3/|dir/dir3/potato.txt 11")
err = os.Rename(run.path("dir/dir2"), run.path("dir/dir3"))
require.NoError(t, err)
run.checkDir(t, "dir/|dir/dir3/|dir/dir3/potato.txt 11")
run.rm(t, "dir/dir3/potato.txt")
run.rmdir(t, "dir/dir3")
*/
run.rm(t, "dir1/potato.txt")
run.rmdir(t, "dir1")
run.rm(t, "dir/dir3/potato.txt")
run.rmdir(t, "dir/dir3")
run.rmdir(t, "dir")
run.checkDir(t, "")
}
+34 -12
View File
@@ -31,6 +31,14 @@ func newFile(d *Dir, o fs.Object) *File {
}
}
// rename should be called to update f.o and f.d after a rename
func (f *File) rename(d *Dir, o fs.Object) {
f.mu.Lock()
f.o = o
f.d = d
f.mu.Unlock()
}
// addWriters increments or decrements the writers
func (f *File) addWriters(n int) {
f.mu.Lock()
@@ -45,7 +53,6 @@ var _ fusefs.Node = (*File)(nil)
func (f *File) Attr(ctx context.Context, a *fuse.Attr) error {
f.mu.Lock()
defer f.mu.Unlock()
fs.Debug(f.o, "File.Attr")
a.Gid = gid
a.Uid = uid
a.Mode = filePerms
@@ -63,6 +70,7 @@ func (f *File) Attr(ctx context.Context, a *fuse.Attr) error {
}
}
a.Blocks = (a.Size + 511) / 512
fs.Debugf(f.o, "File.Attr %+v", a)
return nil
}
@@ -104,31 +112,30 @@ func (f *File) waitForValidObject() (o fs.Object, err error) {
var _ fusefs.NodeOpener = (*File)(nil)
// Open the file for read or write
func (f *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenResponse) (fusefs.Handle, error) {
func (f *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenResponse) (fh fusefs.Handle, err error) {
// if o is nil it isn't valid yet
o, err := f.waitForValidObject()
if err != nil {
return nil, err
}
fs.Debug(o, "File.Open")
fs.Debugf(o, "File.Open %v", req.Flags)
switch {
case req.Flags.IsReadOnly():
if noSeek {
resp.Flags |= fuse.OpenNonSeekable
}
return newReadFileHandle(o)
fh, err = newReadFileHandle(o)
err = errors.Wrap(err, "open for read")
case req.Flags.IsWriteOnly() || (req.Flags.IsReadWrite() && (req.Flags&fuse.OpenTruncate) != 0):
resp.Flags |= fuse.OpenNonSeekable
src := newCreateInfo(f.d.f, o.Remote())
fh, err := newWriteFileHandle(f.d, f, src)
if err != nil {
return nil, err
}
return fh, nil
fh, err = newWriteFileHandle(f.d, f, src)
err = errors.Wrap(err, "open for write")
case req.Flags.IsReadWrite():
return nil, errors.New("can't open read and write")
err = errors.New("can't open for read and write simultaneously")
default:
err = errors.Errorf("can't figure out how to open with flags %v", req.Flags)
}
/*
@@ -142,5 +149,20 @@ func (f *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenR
OpenSync OpenFlags = syscall.O_SYNC
OpenTruncate OpenFlags = syscall.O_TRUNC
*/
return nil, errors.New("can't figure out how to open")
if err != nil {
fs.Errorf(o, "File.Open failed: %v", err)
return nil, err
}
return fh, nil
}
// Check interface satisfied
var _ fusefs.NodeFsyncer = (*File)(nil)
// Fsync the file
//
// Note that we don't do anything except return OK
func (f *File) Fsync(ctx context.Context, req *fuse.FsyncRequest) error {
return nil
}
+5 -3
View File
@@ -23,7 +23,7 @@ var _ fusefs.FS = (*FS)(nil)
// Root returns the root node
func (f *FS) Root() (fusefs.Node, error) {
fs.Debug(f.f, "Root()")
fs.Debugf(f.f, "Root()")
fsDir := &fs.Dir{
Name: "",
When: time.Now(),
@@ -75,7 +75,7 @@ func mountOptions(device string) (options []fuse.MountOption) {
// returns an error, and an error channel for the serve process to
// report an error when fusermount is called.
func mount(f fs.Fs, mountpoint string) (<-chan error, error) {
fs.Debug(f, "Mounting on %q", mountpoint)
fs.Debugf(f, "Mounting on %q", mountpoint)
c, err := fuse.Mount(mountpoint, mountOptions(f.Name()+":"+f.Root())...)
if err != nil {
return nil, err
@@ -85,10 +85,12 @@ func mount(f fs.Fs, mountpoint string) (<-chan error, error) {
f: f,
}
server := fusefs.New(c, nil)
// Serve the mount point in the background returning error to errChan
errChan := make(chan error, 1)
go func() {
err := fusefs.Serve(c, filesys)
err := server.Serve(filesys)
closeErr := c.Close()
if err == nil {
err = closeErr
+3 -2
View File
@@ -71,8 +71,9 @@ func newRun() *Run {
// "RCLONE_CONFIG_PASS=hunter2" (or your password)
*fs.AskPassword = false
fs.LoadConfig()
fs.Config.Verbose = *Verbose
fs.Config.Quiet = !*Verbose
if *Verbose {
fs.Config.LogLevel = fs.LogLevelDebug
}
fs.Config.DumpHeaders = *DumpHeaders
fs.Config.DumpBodies = *DumpBodies
fs.Config.LowLevelRetries = *LowLevelRetries
+21 -12
View File
@@ -73,7 +73,7 @@ This is **EXPERIMENTAL** - use with care.
First set up your remote using ` + "`rclone config`" + `. Check it works with ` + "`rclone ls`" + ` etc.
Start the mount like this
Start the mount like this (note the & on the end to put rclone in the background).
rclone mount remote:path/to/files /path/to/local/mount &
@@ -81,23 +81,27 @@ Stop the mount with
fusermount -u /path/to/local/mount
Or if that fails try
fusermount -z -u /path/to/local/mount
Or with OS X
umount -u /path/to/local/mount
umount /path/to/local/mount
### Limitations ###
This can only write files seqentially, it can only seek when reading.
This means that many applications won't work with their files on an
rclone mount.
Rclone mount inherits rclone's directory handling. In rclone's world
directories don't really exist. This means that empty directories
will have a tendency to disappear once they fall out of the directory
cache.
The bucket based FSes (eg swift, s3, google compute storage, b2) won't
work from the root - you will need to specify a bucket, or a path
within the bucket. So ` + "`swift:`" + ` won't work whereas ` + "`swift:bucket`" + ` will
as will ` + "`swift:bucket/path`" + `.
The bucket based remotes (eg Swift, S3, Google Compute Storage, B2,
Hubic) won't work from the root - you will need to specify a bucket,
or a path within the bucket. So ` + "`swift:`" + ` won't work whereas
` + "`swift:bucket`" + ` will as will ` + "`swift:bucket/path`" + `.
None of these support the concept of directories, so empty
directories will have a tendency to disappear once they fall out of
the directory cache.
Only supported on Linux, FreeBSD and OS X at the moment.
@@ -110,6 +114,11 @@ can't use retries in the same way without making local copies of the
uploads. This might happen in the future, but for the moment rclone
mount won't do that, so will be less reliable than the rclone command.
### Filters ###
Note that all the rclone filters can be used to select a subset of the
files to be visible in the mount.
### Bugs ###
* All the remotes should work for read, but some may not for write
@@ -139,7 +148,7 @@ mount won't do that, so will be less reliable than the rclone command.
func Mount(f fs.Fs, mountpoint string) error {
if debugFUSE {
fuse.Debug = func(msg interface{}) {
fs.Debug("fuse", "%v", msg)
fs.Debugf("fuse", "%v", msg)
}
}
+70 -60
View File
@@ -20,7 +20,6 @@ type ReadFileHandle struct {
o fs.Object
readCalled bool // set if read has been called
offset int64
retries int // number of times we have retried
}
func newReadFileHandle(o fs.Object) (*ReadFileHandle, error) {
@@ -30,7 +29,7 @@ func newReadFileHandle(o fs.Object) (*ReadFileHandle, error) {
}
fh := &ReadFileHandle{
o: o,
r: fs.NewAccount(r, o), // account the transfer
r: fs.NewAccount(r, o).WithBuffer(), // account the transfer
}
fs.Stats.Transferring(fh.o.Remote())
return fh, nil
@@ -44,95 +43,106 @@ var _ fusefs.HandleReader = (*ReadFileHandle)(nil)
// seek to a new offset
//
// if reopen is true, then we won't attempt to use an io.Seeker interface
//
// Must be called with fh.mu held
func (fh *ReadFileHandle) seek(offset int64) error {
// Can we seek it directly?
func (fh *ReadFileHandle) seek(offset int64, reopen bool) (err error) {
fh.r.StopBuffering() // stop the background reading first
oldReader := fh.r.GetReader()
if do, ok := oldReader.(io.Seeker); ok {
fs.Debug(fh.o, "ReadFileHandle.seek from %d to %d (io.Seeker)", fh.offset, offset)
_, err := do.Seek(offset, 0)
r := oldReader
// Can we seek it directly?
if do, ok := oldReader.(io.Seeker); !reopen && ok {
fs.Debugf(fh.o, "ReadFileHandle.seek from %d to %d (io.Seeker)", fh.offset, offset)
_, err = do.Seek(offset, 0)
if err != nil {
fs.Debug(fh.o, "ReadFileHandle.Read io.Seeker failed: %v", err)
fs.Debugf(fh.o, "ReadFileHandle.Read io.Seeker failed: %v", err)
return err
}
} else {
fs.Debug(fh.o, "ReadFileHandle.seek from %d to %d", fh.offset, offset)
// if not re-open with a seek
r, err := fh.o.Open(&fs.SeekOption{Offset: offset})
if err != nil {
fs.Debug(fh.o, "ReadFileHandle.Read seek failed: %v", err)
return err
}
fs.Debugf(fh.o, "ReadFileHandle.seek from %d to %d", fh.offset, offset)
// close old one
err = oldReader.Close()
if err != nil {
fs.Debug(fh.o, "ReadFileHandle.Read seek close old failed: %v", err)
fs.Debugf(fh.o, "ReadFileHandle.Read seek close old failed: %v", err)
}
// re-open with a seek
r, err = fh.o.Open(&fs.SeekOption{Offset: offset})
if err != nil {
fs.Debugf(fh.o, "ReadFileHandle.Read seek failed: %v", err)
return err
}
// fh.r = fs.NewAccount(r, fh.o) // account the transfer
fh.r.UpdateReader(r)
}
fh.r.UpdateReader(r)
fh.offset = offset
return nil
}
// Read from the file handle
func (fh *ReadFileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error {
func (fh *ReadFileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) (err error) {
fh.mu.Lock()
defer fh.mu.Unlock()
fs.Debug(fh.o, "ReadFileHandle.Read size %d offset %d", req.Size, req.Offset)
fs.Debugf(fh.o, "ReadFileHandle.Read size %d offset %d", req.Size, req.Offset)
if fh.closed {
fs.ErrorLog(fh.o, "ReadFileHandle.Read error: %v", errClosedFileHandle)
fs.Errorf(fh.o, "ReadFileHandle.Read error: %v", errClosedFileHandle)
return errClosedFileHandle
}
doSeek := req.Offset != fh.offset
var err error
var n int
var newOffset int64
retries := 0
buf := make([]byte, req.Size)
doReopen := false
for {
if doSeek {
// Are we attempting to seek beyond the end of the
// file - if so just return EOF leaving the underlying
// file in an unchanged state.
if req.Offset >= fh.o.Size() {
fs.Debug(fh.o, "ReadFileHandle.Read attempt to read beyond end of file: %d > %d", req.Offset, fh.o.Size())
fs.Debugf(fh.o, "ReadFileHandle.Read attempt to read beyond end of file: %d > %d", req.Offset, fh.o.Size())
resp.Data = nil
return nil
}
err := fh.seek(req.Offset)
if err != nil {
return err
// Otherwise do the seek
err = fh.seek(req.Offset, doReopen)
} else {
err = nil
}
if err == nil {
if req.Size > 0 {
fh.readCalled = true
}
// One exception to the above is if we fail to fully populate a
// page cache page; a read into page cache is always page aligned.
// Make sure we never serve a partial read, to avoid that.
n, err = io.ReadFull(fh.r, buf)
newOffset = fh.offset + int64(n)
// if err == nil && rand.Intn(10) == 0 {
// err = errors.New("random error")
// }
if err == nil {
break
} else if (err == io.ErrUnexpectedEOF || err == io.EOF) && newOffset == fh.o.Size() {
// Have read to end of file - reset error
err = nil
break
}
}
if req.Size > 0 {
fh.readCalled = true
}
// One exception to the above is if we fail to fully populate a
// page cache page; a read into page cache is always page aligned.
// Make sure we never serve a partial read, to avoid that.
n, err = io.ReadFull(fh.r, buf)
newOffset = fh.offset + int64(n)
// if err == nil && rand.Intn(10) == 0 {
// err = errors.New("random error")
// }
if err == nil {
break
} else if (err == io.ErrUnexpectedEOF || err == io.EOF) && newOffset == fh.o.Size() {
// Read to end of file
if retries >= fs.Config.LowLevelRetries {
break
}
if fh.retries >= fs.Config.LowLevelRetries {
fs.ErrorLog(fh.o, "ReadFileHandle.Read error: %v", err)
return err
}
fh.retries++
fs.ErrorLog(fh.o, "ReadFileHandle.Read error: low level retry %d/%d: %v", fh.retries, fs.Config.LowLevelRetries, err)
retries++
fs.Errorf(fh.o, "ReadFileHandle.Read error: low level retry %d/%d: %v", retries, fs.Config.LowLevelRetries, err)
doSeek = true
doReopen = true
}
fh.retries = 0 // reset retries
resp.Data = buf[:n]
fh.offset = newOffset
fs.Debug(fh.o, "ReadFileHandle.Read OK")
return nil
if err != nil {
fs.Errorf(fh.o, "ReadFileHandle.Read error: %v", err)
} else {
resp.Data = buf[:n]
fh.offset = newOffset
fs.Debugf(fh.o, "ReadFileHandle.Read OK")
}
return err
}
// close the file handle returning errClosedFileHandle if it has been
@@ -157,7 +167,7 @@ var _ fusefs.HandleFlusher = (*ReadFileHandle)(nil)
func (fh *ReadFileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) error {
fh.mu.Lock()
defer fh.mu.Unlock()
fs.Debug(fh.o, "ReadFileHandle.Flush")
fs.Debugf(fh.o, "ReadFileHandle.Flush")
// Ignore the Flush as there is nothing we can sensibly do and
// it seems quite common for Flush to be called from
@@ -166,17 +176,17 @@ func (fh *ReadFileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) err
// If Read hasn't been called then ignore the Flush - Release
// will pick it up
if !fh.readCalled {
fs.Debug(fh.o, "ReadFileHandle.Flush ignoring flush on unread handle")
fs.Debugf(fh.o, "ReadFileHandle.Flush ignoring flush on unread handle")
return nil
}
err := fh.close()
if err != nil {
fs.ErrorLog(fh.o, "ReadFileHandle.Flush error: %v", err)
fs.Errorf(fh.o, "ReadFileHandle.Flush error: %v", err)
return err
}
}
fs.Debug(fh.o, "ReadFileHandle.Flush OK")
fs.Debugf(fh.o, "ReadFileHandle.Flush OK")
return nil
}
@@ -190,15 +200,15 @@ func (fh *ReadFileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest)
fh.mu.Lock()
defer fh.mu.Unlock()
if fh.closed {
fs.Debug(fh.o, "ReadFileHandle.Release nothing to do")
fs.Debugf(fh.o, "ReadFileHandle.Release nothing to do")
return nil
}
fs.Debug(fh.o, "ReadFileHandle.Release closing")
fs.Debugf(fh.o, "ReadFileHandle.Release closing")
err := fh.close()
if err != nil {
fs.ErrorLog(fh.o, "ReadFileHandle.Release error: %v", err)
fs.Errorf(fh.o, "ReadFileHandle.Release error: %v", err)
} else {
fs.Debug(fh.o, "ReadFileHandle.Release OK")
fs.Debugf(fh.o, "ReadFileHandle.Release OK")
}
return err
}
+72
View File
@@ -0,0 +1,72 @@
// +build ignore
// Read blocks out of a single file to time the seeking code
package main
import (
"flag"
"io"
"log"
"math/rand"
"os"
"time"
)
var (
// Flags
iterations = flag.Int("n", 25, "Iterations to try")
maxBlockSize = flag.Int("b", 1024*1024, "Max block size to read")
randSeed = flag.Int64("seed", 1, "Seed for the random number generator")
)
func randomSeekTest(size int64, in *os.File, name string) {
start := rand.Int63n(size)
blockSize := rand.Intn(*maxBlockSize)
if int64(blockSize) > size-start {
blockSize = int(size - start)
}
log.Printf("Reading %d from %d", blockSize, start)
_, err := in.Seek(start, 0)
if err != nil {
log.Fatalf("Seek failed on %q: %v", name, err)
}
buf := make([]byte, blockSize)
_, err = io.ReadFull(in, buf)
if err != nil {
log.Fatalf("Read failed on %q: %v", name, err)
}
}
func main() {
flag.Parse()
args := flag.Args()
if len(args) != 1 {
log.Fatalf("Require 1 file as argument")
}
rand.Seed(*randSeed)
name := args[0]
in, err := os.Open(name)
if err != nil {
log.Fatalf("Couldn't open %q: %v", name, err)
}
fi, err := in.Stat()
if err != nil {
log.Fatalf("Couldn't stat %q: %v", name, err)
}
start := time.Now()
for i := 0; i < *iterations; i++ {
randomSeekTest(fi.Size(), in, name)
}
dt := time.Since(start)
log.Printf("That took %v for %d iterations, %v per iteration", dt, *iterations, dt/time.Duration(*iterations))
err = in.Close()
if err != nil {
log.Fatalf("Error closing %q: %v", name, err)
}
}
+115
View File
@@ -0,0 +1,115 @@
// +build ignore
// Read two files with lots of seeking to stress test the seek code
package main
import (
"bytes"
"flag"
"io"
"io/ioutil"
"log"
"math/rand"
"os"
"time"
)
var (
// Flags
iterations = flag.Int("n", 1E6, "Iterations to try")
maxBlockSize = flag.Int("b", 1024*1024, "Max block size to read")
)
func init() {
rand.Seed(time.Now().UnixNano())
}
func randomSeekTest(size int64, in1, in2 *os.File, file1, file2 string) {
start := rand.Int63n(size)
blockSize := rand.Intn(*maxBlockSize)
if int64(blockSize) > size-start {
blockSize = int(size - start)
}
log.Printf("Reading %d from %d", blockSize, start)
_, err := in1.Seek(start, 0)
if err != nil {
log.Fatalf("Seek failed on %q: %v", file1, err)
}
_, err = in2.Seek(start, 0)
if err != nil {
log.Fatalf("Seek failed on %q: %v", file2, err)
}
buf1 := make([]byte, blockSize)
n1, err := io.ReadFull(in1, buf1)
if err != nil {
log.Fatalf("Read failed on %q: %v", file1, err)
}
buf2 := make([]byte, blockSize)
n2, err := io.ReadFull(in2, buf2)
if err != nil {
log.Fatalf("Read failed on %q: %v", file2, err)
}
if n1 != n2 {
log.Fatalf("Read different lengths %d (%q) != %d (%q)", n1, file1, n2, file2)
}
if !bytes.Equal(buf1, buf2) {
log.Printf("Dumping different blocks")
err = ioutil.WriteFile("/tmp/z1", buf1, 0777)
if err != nil {
log.Fatalf("Failed to write /tmp/z1: %v", err)
}
err = ioutil.WriteFile("/tmp/z2", buf2, 0777)
if err != nil {
log.Fatalf("Failed to write /tmp/z2: %v", err)
}
log.Fatalf("Read different contents - saved in /tmp/z1 and /tmp/z2")
}
}
func main() {
flag.Parse()
args := flag.Args()
if len(args) != 2 {
log.Fatalf("Require 2 files as argument")
}
file1, file2 := args[0], args[1]
in1, err := os.Open(file1)
if err != nil {
log.Fatalf("Couldn't open %q: %v", file1, err)
}
in2, err := os.Open(file2)
if err != nil {
log.Fatalf("Couldn't open %q: %v", file2, err)
}
fi1, err := in1.Stat()
if err != nil {
log.Fatalf("Couldn't stat %q: %v", file1, err)
}
fi2, err := in2.Stat()
if err != nil {
log.Fatalf("Couldn't stat %q: %v", file2, err)
}
if fi1.Size() != fi2.Size() {
log.Fatalf("Files not the same size")
}
for i := 0; i < *iterations; i++ {
randomSeekTest(fi1.Size(), in1, in2, file1, file2)
}
err = in1.Close()
if err != nil {
log.Fatalf("Error closing %q: %v", file1, err)
}
err = in2.Close()
if err != nil {
log.Fatalf("Error closing %q: %v", file2, err)
}
}
+129
View File
@@ -0,0 +1,129 @@
// +build ignore
// Read lots files with lots of simultaneous seeking to stress test the seek code
package main
import (
"flag"
"io"
"log"
"math/rand"
"os"
"path/filepath"
"sort"
"sync"
"time"
)
var (
// Flags
iterations = flag.Int("n", 1E6, "Iterations to try")
maxBlockSize = flag.Int("b", 1024*1024, "Max block size to read")
simultaneous = flag.Int("transfers", 16, "Number of simultaneous files to open")
seeksPerFile = flag.Int("seeks", 8, "Seeks per file")
mask = flag.Int64("mask", 0, "mask for seek, eg 0x7fff")
)
func init() {
rand.Seed(time.Now().UnixNano())
}
func seekTest(n int, file string) {
in, err := os.Open(file)
if err != nil {
log.Fatalf("Couldn't open %q: %v", file, err)
}
fi, err := in.Stat()
if err != nil {
log.Fatalf("Couldn't stat %q: %v", file, err)
}
size := fi.Size()
// FIXME make sure we try start and end
maxBlockSize := *maxBlockSize
if int64(maxBlockSize) > size {
maxBlockSize = int(size)
}
for i := 0; i < n; i++ {
start := rand.Int63n(size)
if *mask != 0 {
start &^= *mask
}
blockSize := rand.Intn(maxBlockSize)
beyondEnd := false
switch rand.Intn(10) {
case 0:
start = 0
case 1:
start = size - int64(blockSize)
case 2:
// seek beyond the end
start = size + int64(blockSize)
beyondEnd = true
default:
}
if !beyondEnd && int64(blockSize) > size-start {
blockSize = int(size - start)
}
log.Printf("%s: Reading %d from %d", file, blockSize, start)
_, err = in.Seek(start, 0)
if err != nil {
log.Fatalf("Seek failed on %q: %v", file, err)
}
buf := make([]byte, blockSize)
n, err := io.ReadFull(in, buf)
if beyondEnd && err == io.EOF {
// OK
} else if err != nil {
log.Fatalf("Read failed on %q: %v (%d)", file, err, n)
}
}
err = in.Close()
if err != nil {
log.Fatalf("Error closing %q: %v", file, err)
}
}
// Find all the files in dir
func findFiles(dir string) (files []string) {
filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
if info.Mode().IsRegular() && info.Size() > 0 {
files = append(files, path)
}
return nil
})
sort.Strings(files)
return files
}
func main() {
flag.Parse()
args := flag.Args()
if len(args) != 1 {
log.Fatalf("Require a directory as argument")
}
dir := args[0]
files := findFiles(dir)
jobs := make(chan string, *simultaneous)
var wg sync.WaitGroup
wg.Add(*simultaneous)
for i := 0; i < *simultaneous; i++ {
go func() {
defer wg.Done()
for file := range jobs {
seekTest(*seeksPerFile, file)
}
}()
}
for i := 0; i < *iterations; i++ {
i := rand.Intn(len(files))
jobs <- files[i]
//jobs <- files[i]
}
close(jobs)
wg.Wait()
}
+13 -13
View File
@@ -38,7 +38,7 @@ func newWriteFileHandle(d *Dir, f *File, src fs.ObjectInfo) (*WriteFileHandle, e
file: f,
}
fh.pipeReader, fh.pipeWriter = io.Pipe()
r := fs.NewAccountSizeName(fh.pipeReader, 0, src.Remote()) // account the transfer
r := fs.NewAccountSizeName(fh.pipeReader, 0, src.Remote()).WithBuffer() // account the transfer
go func() {
o, err := d.f.Put(r, src)
fh.o = o
@@ -54,11 +54,11 @@ var _ fusefs.HandleWriter = (*WriteFileHandle)(nil)
// Write data to the file handle
func (fh *WriteFileHandle) Write(ctx context.Context, req *fuse.WriteRequest, resp *fuse.WriteResponse) error {
fs.Debug(fh.remote, "WriteFileHandle.Write len=%d", len(req.Data))
fs.Debugf(fh.remote, "WriteFileHandle.Write len=%d", len(req.Data))
fh.mu.Lock()
defer fh.mu.Unlock()
if fh.closed {
fs.ErrorLog(fh.remote, "WriteFileHandle.Write error: %v", errClosedFileHandle)
fs.Errorf(fh.remote, "WriteFileHandle.Write error: %v", errClosedFileHandle)
return errClosedFileHandle
}
fh.writeCalled = true
@@ -67,10 +67,10 @@ func (fh *WriteFileHandle) Write(ctx context.Context, req *fuse.WriteRequest, re
resp.Size = n
fh.file.written(int64(n))
if err != nil {
fs.ErrorLog(fh.remote, "WriteFileHandle.Write error: %v", err)
fs.Errorf(fh.remote, "WriteFileHandle.Write error: %v", err)
return err
}
fs.Debug(fh.remote, "WriteFileHandle.Write OK (%d bytes written)", n)
fs.Debugf(fh.remote, "WriteFileHandle.Write OK (%d bytes written)", n)
return nil
}
@@ -119,19 +119,19 @@ var _ fusefs.HandleFlusher = (*WriteFileHandle)(nil)
func (fh *WriteFileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) error {
fh.mu.Lock()
defer fh.mu.Unlock()
fs.Debug(fh.remote, "WriteFileHandle.Flush")
fs.Debugf(fh.remote, "WriteFileHandle.Flush")
// If Write hasn't been called then ignore the Flush - Release
// will pick it up
if !fh.writeCalled {
fs.Debug(fh.remote, "WriteFileHandle.Flush ignoring flush on unwritten handle")
fs.Debugf(fh.remote, "WriteFileHandle.Flush ignoring flush on unwritten handle")
return nil
}
err := fh.close()
if err != nil {
fs.ErrorLog(fh.remote, "WriteFileHandle.Flush error: %v", err)
fs.Errorf(fh.remote, "WriteFileHandle.Flush error: %v", err)
} else {
fs.Debug(fh.remote, "WriteFileHandle.Flush OK")
fs.Debugf(fh.remote, "WriteFileHandle.Flush OK")
}
return err
}
@@ -146,15 +146,15 @@ func (fh *WriteFileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest
fh.mu.Lock()
defer fh.mu.Unlock()
if fh.closed {
fs.Debug(fh.remote, "WriteFileHandle.Release nothing to do")
fs.Debugf(fh.remote, "WriteFileHandle.Release nothing to do")
return nil
}
fs.Debug(fh.remote, "WriteFileHandle.Release closing")
fs.Debugf(fh.remote, "WriteFileHandle.Release closing")
err := fh.close()
if err != nil {
fs.ErrorLog(fh.remote, "WriteFileHandle.Release error: %v", err)
fs.Errorf(fh.remote, "WriteFileHandle.Release error: %v", err)
} else {
fs.Debug(fh.remote, "WriteFileHandle.Release OK")
fs.Debugf(fh.remote, "WriteFileHandle.Release OK")
}
return err
}
+16
View File
@@ -8,6 +8,7 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
// Test writing a file with no write()'s to it
@@ -101,3 +102,18 @@ func TestWriteFileDoubleClose(t *testing.T) {
run.rm(t, "testdoubleclose")
}
// Test Fsync
//
// NB the code for this is in file.go rather than write.go
func TestWriteFileFsync(t *testing.T) {
filepath := run.path("to be synced")
fd, err := os.Create(filepath)
require.NoError(t, err)
_, err = fd.Write([]byte("hello"))
require.NoError(t, err)
err = fd.Sync()
require.NoError(t, err)
err = fd.Close()
require.NoError(t, err)
}
+26
View File
@@ -0,0 +1,26 @@
package obscure
import (
"fmt"
"github.com/ncw/rclone/cmd"
"github.com/ncw/rclone/fs"
"github.com/spf13/cobra"
)
func init() {
cmd.Root.AddCommand(commandDefintion)
}
var commandDefintion = &cobra.Command{
Use: "obscure password",
Short: `Obscure password for use in the rclone.conf`,
Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args)
cmd.Run(false, false, command, func() error {
obscure := fs.MustObscure(args[0])
fmt.Println(obscure)
return nil
})
},
}
-10
View File
@@ -1,10 +0,0 @@
// Tests for rclone
package cmd
import (
"testing"
)
func TestFIXME(t *testing.T) {
// FIXME test something!
}
+1 -1
View File
@@ -25,7 +25,7 @@ empty directories in.
cmd.CheckArgs(1, 1, command, args)
fdst := cmd.NewFsDst(args)
cmd.Run(true, false, command, func() error {
return fs.Rmdirs(fdst)
return fs.Rmdirs(fdst, "")
})
},
}
+24 -20
View File
@@ -416,7 +416,7 @@ type encrypter struct {
}
// newEncrypter creates a new file handle encrypting on the fly
func (c *cipher) newEncrypter(in io.Reader) (*encrypter, error) {
func (c *cipher) newEncrypter(in io.Reader, nonce *nonce) (*encrypter, error) {
fh := &encrypter{
in: in,
c: c,
@@ -425,9 +425,13 @@ func (c *cipher) newEncrypter(in io.Reader) (*encrypter, error) {
bufSize: fileHeaderSize,
}
// Initialise nonce
err := fh.nonce.fromReader(c.cryptoRand)
if err != nil {
return nil, err
if nonce != nil {
fh.nonce = *nonce
} else {
err := fh.nonce.fromReader(c.cryptoRand)
if err != nil {
return nil, err
}
}
// Copy magic into buffer
copy(fh.buf, fileMagicBytes)
@@ -449,14 +453,13 @@ func (fh *encrypter) Read(p []byte) (n int, err error) {
// FIXME should overlap the reads with a go-routine and 2 buffers?
readBuf := fh.readBuf[:blockDataSize]
n, err = io.ReadFull(fh.in, readBuf)
if err == io.EOF {
// ReadFull only returns n=0 and EOF
return fh.finish(io.EOF)
} else if err == io.ErrUnexpectedEOF {
// Next read will return EOF
} else if err != nil {
if n == 0 {
// err can't be nil since:
// n == len(buf) if and only if err == nil.
return fh.finish(err)
}
// possibly err != nil here, but we will process the
// data and the next call to ReadFull will return 0, err
// Write nonce to start of block
copy(fh.buf, fh.nonce[:])
// Encrypt the block using the nonce
@@ -486,7 +489,7 @@ func (fh *encrypter) finish(err error) (int, error) {
// Encrypt data encrypts the data stream
func (c *cipher) EncryptData(in io.Reader) (io.Reader, error) {
out, err := c.newEncrypter(in)
out, err := c.newEncrypter(in, nil)
if err != nil {
return nil, err
}
@@ -563,26 +566,27 @@ func (fh *decrypter) fillBuffer() (err error) {
// FIXME should overlap the reads with a go-routine and 2 buffers?
readBuf := fh.readBuf
n, err := io.ReadFull(fh.rc, readBuf)
if err == io.EOF {
// ReadFull only returns n=0 and EOF
return io.EOF
} else if err == io.ErrUnexpectedEOF {
// Next read will return EOF
} else if err != nil {
if n == 0 {
// err can't be nil since:
// n == len(buf) if and only if err == nil.
return err
}
// possibly err != nil here, but we will process the data and
// the next call to ReadFull will return 0, err
// Check header + 1 byte exists
if n <= blockHeaderSize {
if err != nil {
return err // return pending error as it is likely more accurate
}
return ErrorEncryptedFileBadHeader
}
// Decrypt the block using the nonce
block := fh.buf
_, ok := secretbox.Open(block[:0], readBuf[:n], fh.nonce.pointer(), &fh.c.dataKey)
if !ok {
// if block wouldn't decode and got unexpected EOF
// then return that as it is probably a better error
if err != nil {
return err
return err // return pending error as it is likely more accurate
}
return ErrorEncryptedBadBlock
}
+35 -5
View File
@@ -681,7 +681,7 @@ func testEncryptDecrypt(t *testing.T, bufSize int, copySize int64) {
c.cryptoRand = &zeroes{} // zero out the nonce
buf := make([]byte, bufSize)
source := newRandomSource(copySize)
encrypted, err := c.newEncrypter(source)
encrypted, err := c.newEncrypter(source, nil)
assert.NoError(t, err)
decrypted, err := c.newDecrypter(ioutil.NopCloser(encrypted))
assert.NoError(t, err)
@@ -775,19 +775,34 @@ func TestNewEncrypter(t *testing.T) {
z := &zeroes{}
fh, err := c.newEncrypter(z)
fh, err := c.newEncrypter(z, nil)
assert.NoError(t, err)
assert.Equal(t, nonce{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18}, fh.nonce)
assert.Equal(t, []byte{'R', 'C', 'L', 'O', 'N', 'E', 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18}, fh.buf[:32])
// Test error path
c.cryptoRand = bytes.NewBufferString("123456789abcdefghijklmn")
fh, err = c.newEncrypter(z)
fh, err = c.newEncrypter(z, nil)
assert.Nil(t, fh)
assert.Error(t, err, "short read of nonce")
}
// Test the stream returning 0, io.ErrUnexpectedEOF - this used to
// cause a fatal loop
func TestNewEncrypterErrUnexpectedEOF(t *testing.T) {
c, err := newCipher(NameEncryptionStandard, "", "")
assert.NoError(t, err)
in := &errorReader{io.ErrUnexpectedEOF}
fh, err := c.newEncrypter(in, nil)
assert.NoError(t, err)
n, err := io.CopyN(ioutil.Discard, fh, 1E6)
assert.Equal(t, io.ErrUnexpectedEOF, err)
assert.Equal(t, int64(32), n)
}
type errorReader struct {
err error
}
@@ -854,6 +869,23 @@ func TestNewDecrypter(t *testing.T) {
}
}
// Test the stream returning 0, io.ErrUnexpectedEOF
func TestNewDecrypterErrUnexpectedEOF(t *testing.T) {
c, err := newCipher(NameEncryptionStandard, "", "")
assert.NoError(t, err)
in2 := &errorReader{io.ErrUnexpectedEOF}
in1 := bytes.NewBuffer(file16)
in := ioutil.NopCloser(io.MultiReader(in1, in2))
fh, err := c.newDecrypter(in)
assert.NoError(t, err)
n, err := io.CopyN(ioutil.Discard, fh, 1E6)
assert.Equal(t, io.ErrUnexpectedEOF, err)
assert.Equal(t, int64(16), n)
}
func TestNewDecrypterSeek(t *testing.T) {
c, err := newCipher(NameEncryptionStandard, "", "")
assert.NoError(t, err)
@@ -936,8 +968,6 @@ func TestDecrypterRead(t *testing.T) {
case i == fileHeaderSize:
// This would normally produce an error *except* on the first block
expectedErr = nil
case i <= fileHeaderSize+blockHeaderSize:
expectedErr = ErrorEncryptedFileBadHeader
default:
expectedErr = io.ErrUnexpectedEOF
}
+162 -45
View File
@@ -12,6 +12,12 @@ import (
"github.com/pkg/errors"
)
// Globals
var (
// Flags
cryptShowMapping = fs.BoolP("crypt-show-mapping", "", false, "For all files listed show how the names encrypt.")
)
// Register with Fs
func init() {
fs.Register(&fs.RegInfo{
@@ -48,11 +54,11 @@ func init() {
// NewFs contstructs an Fs from the path, container:path
func NewFs(name, rpath string) (fs.Fs, error) {
mode, err := NewNameEncryptionMode(fs.ConfigFile.MustValue(name, "filename_encryption", "standard"))
mode, err := NewNameEncryptionMode(fs.ConfigFileGet(name, "filename_encryption", "standard"))
if err != nil {
return nil, err
}
password := fs.ConfigFile.MustValue(name, "password", "")
password := fs.ConfigFileGet(name, "password", "")
if password == "" {
return nil, errors.New("password not set in config file")
}
@@ -60,7 +66,7 @@ func NewFs(name, rpath string) (fs.Fs, error) {
if err != nil {
return nil, errors.Wrap(err, "failed to decrypt password")
}
salt := fs.ConfigFile.MustValue(name, "password2", "")
salt := fs.ConfigFileGet(name, "password2", "")
if salt != "" {
salt, err = fs.Reveal(salt)
if err != nil {
@@ -71,7 +77,7 @@ func NewFs(name, rpath string) (fs.Fs, error) {
if err != nil {
return nil, errors.Wrap(err, "failed to make cipher")
}
remote := fs.ConfigFile.MustValue(name, "remote")
remote := fs.ConfigFileGet(name, "remote")
if strings.HasPrefix(remote, name+":") {
return nil, errors.New("can't point crypt remote at itself - check the value of the remote setting")
}
@@ -88,21 +94,30 @@ func NewFs(name, rpath string) (fs.Fs, error) {
}
f := &Fs{
Fs: wrappedFs,
cipher: cipher,
mode: mode,
name: name,
root: rpath,
cipher: cipher,
mode: mode,
}
// the features here are ones we could support, and they are
// ANDed with the ones from wrappedFs
f.features = (&fs.Features{
CaseInsensitive: mode == NameEncryptionOff,
DuplicateFiles: true,
ReadMimeType: false, // MimeTypes not supported with crypt
WriteMimeType: false,
}).Fill(f).Mask(wrappedFs)
return f, err
}
// Fs represents a wrapped fs.Fs
type Fs struct {
fs.Fs
cipher Cipher
mode NameEncryptionMode
name string
root string
name string
root string
features *fs.Features // optional features
cipher Cipher
mode NameEncryptionMode
}
// Name of the remote (as passed into NewFs)
@@ -115,6 +130,11 @@ func (f *Fs) Root() string {
return f.root
}
// Features returns the optional features of this Fs
func (f *Fs) Features() *fs.Features {
return f.features
}
// String returns a description of the FS
func (f *Fs) String() string {
return fmt.Sprintf("Encrypted %s", f.Fs.String())
@@ -177,11 +197,11 @@ func (f *Fs) Rmdir(dir string) error {
//
// Return an error if it doesn't exist
func (f *Fs) Purge() error {
do, ok := f.Fs.(fs.Purger)
if !ok {
do := f.Fs.Features().Purge
if do == nil {
return fs.ErrorCantPurge
}
return do.Purge()
return do()
}
// Copy src to this remote using server side copy operations.
@@ -194,15 +214,15 @@ func (f *Fs) Purge() error {
//
// If it isn't possible then return fs.ErrorCantCopy
func (f *Fs) Copy(src fs.Object, remote string) (fs.Object, error) {
do, ok := f.Fs.(fs.Copier)
if !ok {
do := f.Fs.Features().Copy
if do == nil {
return nil, fs.ErrorCantCopy
}
o, ok := src.(*Object)
if !ok {
return nil, fs.ErrorCantCopy
}
oResult, err := do.Copy(o.Object, f.cipher.EncryptFileName(remote))
oResult, err := do(o.Object, f.cipher.EncryptFileName(remote))
if err != nil {
return nil, err
}
@@ -219,40 +239,72 @@ func (f *Fs) Copy(src fs.Object, remote string) (fs.Object, error) {
//
// If it isn't possible then return fs.ErrorCantMove
func (f *Fs) Move(src fs.Object, remote string) (fs.Object, error) {
do, ok := f.Fs.(fs.Mover)
if !ok {
do := f.Fs.Features().Move
if do == nil {
return nil, fs.ErrorCantMove
}
o, ok := src.(*Object)
if !ok {
return nil, fs.ErrorCantMove
}
oResult, err := do.Move(o.Object, f.cipher.EncryptFileName(remote))
oResult, err := do(o.Object, f.cipher.EncryptFileName(remote))
if err != nil {
return nil, err
}
return f.newObject(oResult), nil
}
// DirMove moves src to this remote using server side move
// operations.
// 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(src fs.Fs) error {
do, ok := f.Fs.(fs.DirMover)
if !ok {
func (f *Fs) DirMove(src fs.Fs, srcRemote, dstRemote string) error {
do := f.Fs.Features().DirMove
if do == nil {
return fs.ErrorCantDirMove
}
srcFs, ok := src.(*Fs)
if !ok {
fs.Debug(srcFs, "Can't move directory - not same remote type")
fs.Debugf(srcFs, "Can't move directory - not same remote type")
return fs.ErrorCantDirMove
}
return do.DirMove(srcFs.Fs)
return do(srcFs.Fs, f.cipher.EncryptDirName(srcRemote), f.cipher.EncryptDirName(dstRemote))
}
// PutUnchecked uploads the object
//
// This will create a duplicate if we upload a new file without
// checking to see if there is one already - use Put() for that.
func (f *Fs) PutUnchecked(in io.Reader, src fs.ObjectInfo) (fs.Object, error) {
do := f.Fs.Features().PutUnchecked
if do == nil {
return nil, errors.New("can't PutUnchecked")
}
wrappedIn, err := f.cipher.EncryptData(in)
if err != nil {
return nil, err
}
o, err := do(wrappedIn, f.newObjectInfo(src))
if err != nil {
return nil, err
}
return f.newObject(o), nil
}
// CleanUp the trash in the Fs
//
// Implement this if you have a way of emptying the trash or
// otherwise cleaning up old versions of files.
func (f *Fs) CleanUp() error {
do := f.Fs.Features().CleanUp
if do == nil {
return errors.New("can't CleanUp")
}
return do()
}
// UnWrap returns the Fs that this Fs is wrapping
@@ -260,6 +312,59 @@ func (f *Fs) UnWrap() fs.Fs {
return f.Fs
}
// ComputeHash takes the nonce from o, and encrypts the contents of
// src with it, and calcuates the hash given by HashType on the fly
//
// Note that we break lots of encapsulation in this function.
func (f *Fs) ComputeHash(o *Object, src fs.Object, hashType fs.HashType) (hash string, err error) {
// Read the nonce - opening the file is sufficient to read the nonce in
in, err := o.Open()
if err != nil {
return "", errors.Wrap(err, "failed to read nonce")
}
nonce := in.(*decrypter).nonce
// fs.Debugf(o, "Read nonce % 2x", nonce)
// Check nonce isn't all zeros
isZero := true
for i := range nonce {
if nonce[i] != 0 {
isZero = false
}
}
if isZero {
fs.Errorf(o, "empty nonce read")
}
// Close in once we have read the nonce
err = in.Close()
if err != nil {
return "", errors.Wrap(err, "failed to close nonce read")
}
// Open the src for input
in, err = src.Open()
if err != nil {
return "", errors.Wrap(err, "failed to open src")
}
defer fs.CheckClose(in, &err)
// Now encrypt the src with the nonce
out, err := f.cipher.(*cipher).newEncrypter(in, &nonce)
if err != nil {
return "", errors.Wrap(err, "failed to make encrypter")
}
// pipe into hash
m := fs.NewMultiHasher()
_, err = io.Copy(m, out)
if err != nil {
return "", errors.Wrap(err, "failed to hash data")
}
return m.Sums()[hashType], nil
}
// Object describes a wrapped for being read from the Fs
//
// This decrypts the remote name and decrypts the data
@@ -293,7 +398,7 @@ func (o *Object) Remote() string {
remote := o.Object.Remote()
decryptedName, err := o.f.cipher.DecryptFileName(remote)
if err != nil {
fs.Debug(remote, "Undecryptable file name: %v", err)
fs.Debugf(remote, "Undecryptable file name: %v", err)
return remote
}
return decryptedName
@@ -303,7 +408,7 @@ func (o *Object) Remote() string {
func (o *Object) Size() int64 {
size, err := o.f.cipher.DecryptedSize(o.Object.Size())
if err != nil {
fs.Debug(o, "Bad size for decrypt: %v", err)
fs.Debugf(o, "Bad size for decrypt: %v", err)
}
return size
}
@@ -314,6 +419,11 @@ func (o *Object) Hash(hash fs.HashType) (string, error) {
return "", nil
}
// UnWrap returns the wrapped Object
func (o *Object) UnWrap() fs.Object {
return o.Object
}
// Open opens the file for read. Call Close() on the returned io.ReadCloser
func (o *Object) Open(options ...fs.OpenOption) (rc io.ReadCloser, err error) {
var offset int64
@@ -323,7 +433,7 @@ func (o *Object) Open(options ...fs.OpenOption) (rc io.ReadCloser, err error) {
offset = x.Offset
default:
if option.Mandatory() {
fs.Log(o, "Unsupported mandatory option: %v", option)
fs.Logf(o, "Unsupported mandatory option: %v", option)
}
}
}
@@ -356,7 +466,7 @@ func (f *Fs) newDir(dir *fs.Dir) *fs.Dir {
remote := dir.Name
decryptedRemote, err := f.cipher.DecryptDirName(remote)
if err != nil {
fs.Debug(remote, "Undecryptable dir name: %v", err)
fs.Debugf(remote, "Undecryptable dir name: %v", err)
} else {
new.Name = decryptedRemote
}
@@ -439,11 +549,14 @@ func (lo *ListOpts) Level() int {
// Multiple goroutines can safely add objects concurrently.
func (lo *ListOpts) Add(obj fs.Object) (abort bool) {
remote := obj.Remote()
_, err := lo.f.cipher.DecryptFileName(remote)
decryptedRemote, err := lo.f.cipher.DecryptFileName(remote)
if err != nil {
fs.Debug(remote, "Skipping undecryptable file name: %v", err)
fs.Debugf(remote, "Skipping undecryptable file name: %v", err)
return lo.ListOpts.IsFinished()
}
if *cryptShowMapping {
fs.Logf(decryptedRemote, "Encrypts to %q", remote)
}
return lo.ListOpts.Add(lo.f.newObject(obj))
}
@@ -452,11 +565,14 @@ func (lo *ListOpts) Add(obj fs.Object) (abort bool) {
// Multiple goroutines can safely add objects concurrently.
func (lo *ListOpts) AddDir(dir *fs.Dir) (abort bool) {
remote := dir.Name
_, err := lo.f.cipher.DecryptDirName(remote)
decryptedRemote, err := lo.f.cipher.DecryptDirName(remote)
if err != nil {
fs.Debug(remote, "Skipping undecryptable dir name: %v", err)
fs.Debugf(remote, "Skipping undecryptable dir name: %v", err)
return lo.ListOpts.IsFinished()
}
if *cryptShowMapping {
fs.Logf(decryptedRemote, "Encrypts to %q", remote)
}
return lo.ListOpts.AddDir(lo.f.newDir(dir))
}
@@ -465,7 +581,7 @@ func (lo *ListOpts) AddDir(dir *fs.Dir) (abort bool) {
func (lo *ListOpts) IncludeDirectory(remote string) bool {
decryptedRemote, err := lo.f.cipher.DecryptDirName(remote)
if err != nil {
fs.Debug(remote, "Not including undecryptable directory name: %v", err)
fs.Debugf(remote, "Not including undecryptable directory name: %v", err)
return false
}
return lo.ListOpts.IncludeDirectory(decryptedRemote)
@@ -473,14 +589,15 @@ func (lo *ListOpts) IncludeDirectory(remote string) bool {
// 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.PutUncheckeder = (*Fs)(nil)
_ fs.UnWrapper = (*Fs)(nil)
_ fs.ObjectInfo = (*ObjectInfo)(nil)
_ fs.Object = (*Object)(nil)
_ fs.ListOpts = (*ListOpts)(nil)
_ fs.Fs = (*Fs)(nil)
_ fs.Purger = (*Fs)(nil)
_ fs.Copier = (*Fs)(nil)
_ fs.Mover = (*Fs)(nil)
_ fs.DirMover = (*Fs)(nil)
_ fs.PutUncheckeder = (*Fs)(nil)
_ fs.CleanUpper = (*Fs)(nil)
_ fs.UnWrapper = (*Fs)(nil)
_ fs.ObjectInfo = (*ObjectInfo)(nil)
_ fs.Object = (*Object)(nil)
_ fs.ListOpts = (*ListOpts)(nil)
)
+1
View File
@@ -38,6 +38,7 @@ func TestFsListSubdir2(t *testing.T) { fstests.TestFsListSubdir(t) }
func TestFsListLevel22(t *testing.T) { fstests.TestFsListLevel2(t) }
func TestFsListFile12(t *testing.T) { fstests.TestFsListFile1(t) }
func TestFsNewObject2(t *testing.T) { fstests.TestFsNewObject(t) }
func TestFsNewObjectDir2(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsListFile1and22(t *testing.T) { fstests.TestFsListFile1and2(t) }
func TestFsCopy2(t *testing.T) { fstests.TestFsCopy(t) }
func TestFsMove2(t *testing.T) { fstests.TestFsMove(t) }
+1
View File
@@ -38,6 +38,7 @@ func TestFsListSubdir(t *testing.T) { fstests.TestFsListSubdir(t) }
func TestFsListLevel2(t *testing.T) { fstests.TestFsListLevel2(t) }
func TestFsListFile1(t *testing.T) { fstests.TestFsListFile1(t) }
func TestFsNewObject(t *testing.T) { fstests.TestFsNewObject(t) }
func TestFsNewObjectDir(t *testing.T) { fstests.TestFsNewObjectDir(t) }
func TestFsListFile1and2(t *testing.T) { fstests.TestFsListFile1and2(t) }
func TestFsCopy(t *testing.T) { fstests.TestFsCopy(t) }
func TestFsMove(t *testing.T) { fstests.TestFsMove(t) }
+11
View File
@@ -243,6 +243,17 @@ func (dc *DirCache) FindRoot(create bool) error {
return nil
}
// FindRootAndPath finds the root first if not found then finds leaf and directoryID from a path
//
// If create is set parent directories will be created if they don't exist
func (dc *DirCache) FindRootAndPath(path string, create bool) (leaf, directoryID string, err error) {
err = dc.FindRoot(create)
if err != nil {
return
}
return dc.FindPath(path, create)
}
// FoundRoot returns whether the root directory has been found yet
//
// Call this from FindLeaf or CreateDir only
+1 -1
View File
@@ -38,7 +38,7 @@ func listDir(f ListDirer, out fs.ListOpts, dirID string, path string) {
jobs, err := f.ListDir(out, job)
if err != nil {
out.SetError(err)
fs.Debug(f, "Error reading %s: %s", path, err)
fs.Debugf(f, "Error reading %s: %s", path, err)
} else {
traversing.Add(len(jobs))
go func() {
+1 -1
View File
@@ -7,7 +7,7 @@
"baseurl": "http://rclone.org",
"title": "rclone - rsync for cloud storage",
"description": "rclone - rsync for cloud storage: google drive, s3, swift, cloudfiles, dropbox, memstore...",
"canonifyurls": true,
"canonifyurls": false,
"blackfriday": {
"smartDashes": false,
"plainIDAnchors": true
+1
View File
@@ -23,6 +23,7 @@ Rclone is a command line program to sync files and directories to and from
* Hubic
* Backblaze B2
* Yandex Disk
* SFTP
* The local filesystem
Features
+25 -14
View File
@@ -31,40 +31,50 @@ Type of storage to configure.
Choose a number from below, or type in your own value
1 / Amazon Drive
\ "amazon cloud drive"
2 / Amazon S3 (also Dreamhost, Ceph)
2 / Amazon S3 (also Dreamhost, Ceph, Minio)
\ "s3"
3 / Backblaze B2
\ "b2"
4 / Dropbox
\ "dropbox"
5 / Google Cloud Storage (this is not Google Drive)
5 / Encrypt/Decrypt a remote
\ "crypt"
6 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
6 / Google Drive
7 / Google Drive
\ "drive"
7 / Hubic
8 / Hubic
\ "hubic"
8 / Local Disk
9 / Local Disk
\ "local"
9 / Microsoft OneDrive
10 / Microsoft OneDrive
\ "onedrive"
10 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
11 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
11 / Yandex Disk
12 / SSH/SFTP Connection
\ "sftp"
13 / Yandex Disk
\ "yandex"
Storage> 1
Amazon Application Client Id - leave blank normally.
client_id>
client_id>
Amazon Application Client Secret - leave blank normally.
client_secret>
client_secret>
Remote config
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine
y) Yes
n) No
y/n> 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 =
client_id =
client_secret =
token = {"access_token":"xxxxxxxxxxxxxxxxxxxxxxx","token_type":"bearer","refresh_token":"xxxxxxxxxxxxxxxxxx","expiry":"2015-09-06T16:07:39.658438471+01:00"}
--------------------
y) Yes this is OK
@@ -109,7 +119,8 @@ It does store MD5SUMs so for a more accurate sync, you can use the
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.
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 ###
@@ -172,7 +183,7 @@ larger than this will fail.
At the time of writing (Jan 2016) is in the area of 50GB per file.
This means that larger files are likely to fail.
Unfortunatly there is no way for rclone to see that this failure is
Unfortunatly 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
+11
View File
@@ -50,3 +50,14 @@ Contributors
* 0xJAKE <0xJAKE@users.noreply.github.com>
* Thibault Molleman <thibaultmol@users.noreply.github.com>
* Scott McGillivray <scott.mcgillivray@gmail.com>
* Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
* Lukas Loesche <lukas@mesosphere.io>
* emyarod <allllaboutyou@gmail.com>
* T.C. Ferguson <tcf909@gmail.com>
* Brandur <brandur@mutelight.org>
* Dario Giovannetti <dev@dariogiovannetti.net>
* Károly Oláh <okaresz@aol.com>
* Jon Yergatian <jon@macfanatic.ca>
* Jack Schmidt <github@mowsey.org>
* Dedsec1 <Dedsec1@users.noreply.github.com>
* Hisham Zarka <hzarka@gmail.com>
+14 -10
View File
@@ -30,25 +30,29 @@ Type of storage to configure.
Choose a number from below, or type in your own value
1 / Amazon Drive
\ "amazon cloud drive"
2 / Amazon S3 (also Dreamhost, Ceph)
2 / Amazon S3 (also Dreamhost, Ceph, Minio)
\ "s3"
3 / Backblaze B2
\ "b2"
4 / Dropbox
\ "dropbox"
5 / Google Cloud Storage (this is not Google Drive)
5 / Encrypt/Decrypt a remote
\ "crypt"
6 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
6 / Google Drive
7 / Google Drive
\ "drive"
7 / Hubic
8 / Hubic
\ "hubic"
8 / Local Disk
9 / Local Disk
\ "local"
9 / Microsoft OneDrive
10 / Microsoft OneDrive
\ "onedrive"
10 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
11 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
11 / Yandex Disk
12 / SSH/SFTP Connection
\ "sftp"
13 / Yandex Disk
\ "yandex"
Storage> 3
Account ID
@@ -56,13 +60,13 @@ account> 123456789abc
Application Key
key> 0123456789abcdef0123456789abcdef0123456789
Endpoint for the service - leave blank normally.
endpoint>
endpoint>
Remote config
--------------------
[remote]
account = 123456789abc
key = 0123456789abcdef0123456789abcdef0123456789
endpoint =
endpoint =
--------------------
y) Yes this is OK
e) Edit this remote
+83
View File
@@ -7,6 +7,89 @@ date: "2016-11-06"
Changelog
---------
* v1.36 - 2017-03-18
* New Features
* SFTP remote (Jack Schmidt)
* Re-implement sync routine to work a directory at a time reducing memory usage
* Logging revamped to be more inline with rsync - now much quieter
* -v only shows transfers
* -vv is for full debug
* --syslog to log to syslog on capable platforms
* Implement --backup-dir and --suffix
* Implement --track-renames (initial implementation by Bjørn Erik Pedersen)
* Add time-based bandwidth limits (Lukas Loesche)
* rclone cryptcheck: checks integrity of crypt remotes
* Allow all config file variables and options to be set from environment variables
* Add --buffer-size parameter to control buffer size for copy
* Make --delete-after the default
* Add --ignore-checksum flag (fixed by Hisham Zarka)
* rclone check: Add --download flag to check all the data, not just hashes
* rclone cat: add --head, --tail, --offset, --count and --discard
* rclone config: when choosing from a list, allow the value to be entered too
* rclone config: allow rename and copy of remotes
* rclone obscure: for generating encrypted passwords for rclone's config (T.C. Ferguson)
* Comply with XDG Base Directory specification (Dario Giovannetti)
* this moves the default location of the config file in a backwards compatible way
* Release changes
* Ubuntu snap support (Dedsec1)
* Compile with go 1.8
* MIPS/Linux big and little endian support
* Bug Fixes
* Fix copyto copying things to the wrong place if the destination dir didn't exist
* Fix parsing of remotes in moveto and copyto
* Fix --delete-before deleting files on copy
* Fix --files-from with an empty file copying everything
* Fix sync: don't update mod times if --dry-run set
* Fix MimeType propagation
* Fix filters to add ** rules to directory rules
* Local
* Implement -L, --copy-links flag to allow rclone to follow symlinks
* Open files in write only mode so rclone can write to an rclone mount
* Fix unnormalised unicode causing problems reading directories
* Fix interaction between -x flag and --max-depth
* Mount
* Implement proper directory handling (mkdir, rmdir, renaming)
* Make include and exclude filters apply to mount
* Implement read and write async buffers - control with --buffer-size
* Fix fsync on for directories
* Fix retry on network failure when reading off crypt
* Crypt
* Add --crypt-show-mapping to show encrypted file mapping
* Fix crypt writer getting stuck in a loop
* **IMPORTANT** this bug had the potential to cause data corruption when
* reading data from a network based remote and
* writing to a crypt on Google Drive
* Use the cryptcheck command to validate your data if you are concerned
* If syncing two crypt remotes, sync the unencrypted remote
* Amazon Drive
* Fix panics on Move (rename)
* Fix panic on token expiry
* B2
* Fix inconsistent listings and rclone check
* Fix uploading empty files with go1.8
* Constrain memory usage when doing multipart uploads
* Fix upload url not being refreshed properly
* Drive
* Fix Rmdir on directories with trashed files
* Fix "Ignoring unknown object" when downloading
* Add --drive-list-chunk
* Add --drive-skip-gdocs (Károly Oláh)
* OneDrive
* Implement Move
* Fix Copy
* Fix overwrite detection in Copy
* Fix waitForJob to parse errors correctly
* Use token renewer to stop auth errors on long uploads
* Fix uploading empty files with go1.8
* Google Cloud Storage
* Fix depth 1 directory listings
* Yandex
* Fix single level directory listing
* Dropbox
* Normalise the case for single level directory listings
* Fix depth 1 listing
* S3
* Added ca-central-1 region (Jon Yergatian)
* v1.35 - 2017-01-02
* New Features
* moveto and copyto commands for choosing a destination name on copy/move
+22 -7
View File
@@ -1,12 +1,12 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone"
slug: rclone
url: /commands/rclone/
---
## rclone
Sync files and directories to and from local and remote object stores - v1.35-DEV
Sync files and directories to and from local and remote object stores - v1.36
### Synopsis
@@ -57,12 +57,16 @@ rclone
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -71,6 +75,8 @@ rclone
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -84,12 +90,14 @@ rclone
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -102,6 +110,7 @@ rclone
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -112,11 +121,15 @@ rclone
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
-V, --version Print the version number
```
@@ -128,19 +141,21 @@ rclone
* [rclone config](/commands/rclone_config/) - Enter an interactive configuration session.
* [rclone copy](/commands/rclone_copy/) - Copy files from source to dest, skipping already copied
* [rclone copyto](/commands/rclone_copyto/) - Copy files from source to dest, skipping already copied
* [rclone cryptcheck](/commands/rclone_cryptcheck/) - Cryptcheck checks the integritity of a crypted remote.
* [rclone dedupe](/commands/rclone_dedupe/) - Interactively find duplicate files delete/rename them.
* [rclone delete](/commands/rclone_delete/) - Remove the contents of path.
* [rclone genautocomplete](/commands/rclone_genautocomplete/) - Output bash completion script for rclone.
* [rclone gendocs](/commands/rclone_gendocs/) - Output markdown docs for rclone to the directory supplied.
* [rclone listremotes](/commands/rclone_listremotes/) - List all the remotes in the config file.
* [rclone ls](/commands/rclone_ls/) - List all the objects in the the path with size and path.
* [rclone lsd](/commands/rclone_lsd/) - List all directories/containers/buckets in the the path.
* [rclone ls](/commands/rclone_ls/) - List all the objects in the path with size and path.
* [rclone lsd](/commands/rclone_lsd/) - List all directories/containers/buckets in the path.
* [rclone lsl](/commands/rclone_lsl/) - List all the objects path with modification time, size and path.
* [rclone md5sum](/commands/rclone_md5sum/) - Produces an md5sum file for all the objects in the path.
* [rclone mkdir](/commands/rclone_mkdir/) - Make the path if it doesn't already exist.
* [rclone mount](/commands/rclone_mount/) - Mount the remote as a mountpoint. **EXPERIMENTAL**
* [rclone move](/commands/rclone_move/) - Move files from source to dest.
* [rclone moveto](/commands/rclone_moveto/) - Move file or directory from source to dest.
* [rclone obscure](/commands/rclone_obscure/) - Obscure password for use in the rclone.conf
* [rclone purge](/commands/rclone_purge/) - Remove the path and all of its contents.
* [rclone rmdir](/commands/rclone_rmdir/) - Remove the path if empty.
* [rclone rmdirs](/commands/rclone_rmdirs/) - Remove any empty directoryies under the path.
@@ -149,4 +164,4 @@ rclone
* [rclone sync](/commands/rclone_sync/) - Make source and dest identical, modifying destination only.
* [rclone version](/commands/rclone_version/) - Show the version number.
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+18 -5
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone authorize"
slug: rclone_authorize
url: /commands/rclone_authorize/
@@ -30,12 +30,16 @@ rclone authorize
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -44,6 +48,8 @@ rclone authorize
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -57,12 +63,14 @@ rclone authorize
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -75,6 +83,7 @@ rclone authorize
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -85,14 +94,18 @@ rclone authorize
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+33 -5
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone cat"
slug: rclone_cat
url: /commands/rclone_cat/
@@ -26,11 +26,26 @@ Or like this to output any .txt files in dir or subdirectories.
rclone --include "*.txt" cat remote:path/to/dir
Use the --head flag to print characters only at the start, --tail for
the end and --offset and --count to print a section in the middle.
Note that if offset is negative it will count from the end, so
--offset -1 --count 1 is equivalent to --tail 1.
```
rclone cat remote:path
```
### Options
```
--count int Only print N characters. (default -1)
--discard Discard the output instead of printing.
--head int Only print the first N characters.
--offset int Start printing at offset N (or from end if -ve).
--tail int Only print the last N characters.
```
### Options inherited from parent commands
```
@@ -41,12 +56,16 @@ rclone cat remote:path
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -55,6 +74,8 @@ rclone cat remote:path
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -68,12 +89,14 @@ rclone cat remote:path
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -86,6 +109,7 @@ rclone cat remote:path
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -96,14 +120,18 @@ rclone cat remote:path
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+34 -9
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone check"
slug: rclone_check
url: /commands/rclone_check/
@@ -12,17 +12,29 @@ Checks the files in the source and destination match.
Checks the files in the source and destination match. It
compares sizes and MD5SUMs and prints a report of files which
don't match. It doesn't alter the source or destination.
Checks the files in the source and destination match. It compares
sizes and hashes (MD5 or SHA1) and logs a report of files which don't
match. It doesn't alter the source or destination.
`--size-only` may be used to only compare the sizes, not the MD5SUMs.
If you supply the --size-only flag, it will only compare the sizes not
the hashes as well. Use this for a quick check.
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.
```
rclone check source:path dest:path
```
### Options
```
--download Check by downloading rather than with hash.
```
### Options inherited from parent commands
```
@@ -33,12 +45,16 @@ rclone check source:path dest:path
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -47,6 +63,8 @@ rclone check source:path dest:path
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -60,12 +78,14 @@ rclone check source:path dest:path
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -78,6 +98,7 @@ rclone check source:path dest:path
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -88,14 +109,18 @@ rclone check source:path dest:path
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+18 -5
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone cleanup"
slug: rclone_cleanup
url: /commands/rclone_cleanup/
@@ -30,12 +30,16 @@ rclone cleanup remote:path
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -44,6 +48,8 @@ rclone cleanup remote:path
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -57,12 +63,14 @@ rclone cleanup remote:path
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -75,6 +83,7 @@ rclone cleanup remote:path
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -85,14 +94,18 @@ rclone cleanup remote:path
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+18 -5
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone config"
slug: rclone_config
url: /commands/rclone_config/
@@ -27,12 +27,16 @@ rclone config
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -41,6 +45,8 @@ rclone config
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -54,12 +60,14 @@ rclone config
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -72,6 +80,7 @@ rclone config
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -82,14 +91,18 @@ rclone config
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+18 -5
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone copy"
slug: rclone_copy
url: /commands/rclone_copy/
@@ -66,12 +66,16 @@ rclone copy source:path dest:path
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -80,6 +84,8 @@ rclone copy source:path dest:path
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -93,12 +99,14 @@ rclone copy source:path dest:path
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -111,6 +119,7 @@ rclone copy source:path dest:path
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -121,14 +130,18 @@ rclone copy source:path dest:path
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+18 -5
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone copyto"
slug: rclone_copyto
url: /commands/rclone_copyto/
@@ -53,12 +53,16 @@ rclone copyto source:path dest:path
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -67,6 +71,8 @@ rclone copyto source:path dest:path
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -80,12 +86,14 @@ rclone copyto source:path dest:path
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -98,6 +106,7 @@ rclone copyto source:path dest:path
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -108,14 +117,18 @@ rclone copyto source:path dest:path
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+131
View File
@@ -0,0 +1,131 @@
---
date: 2017-03-18T11:14:54Z
title: "rclone cryptcheck"
slug: rclone_cryptcheck
url: /commands/rclone_cryptcheck/
---
## rclone cryptcheck
Cryptcheck checks the integritity of a crypted remote.
### Synopsis
rclone cryptcheck checks a remote against a crypted remote. This is
the equivalent of running rclone check, but able to check the
checksums of the crypted remote.
For it to work the underlying remote of the cryptedremote must support
some kind of checksum.
It works by reading the nonce from each file on the cryptedremote: and
using that to encrypt each file on the remote:. It then checks the
checksum of the underlying file on the cryptedremote: against the
checksum of the file it has just encrypted.
Use it like this
rclone cryptcheck /path/to/files encryptedremote:path
You can use it like this also, but that will involve downloading all
the files in remote:path.
rclone cryptcheck remote:path encryptedremote:path
After it has run it will log the status of the encryptedremote:.
```
rclone cryptcheck remote:path cryptedremote:path
```
### Options inherited from parent commands
```
--acd-templink-threshold int Files >= this size will be downloaded via their tempLink. (default 9G)
--acd-upload-wait-per-gb duration Additional time per GB to wait after a failed complete upload to see if it appears. (default 3m0s)
--ask-password Allow prompt for password for encrypted configuration. (default true)
--b2-chunk-size int Upload chunk size. Must fit in memory. (default 96M)
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
--delete-excluded Delete files on dest excluded from sync
--drive-auth-owner-only Only consider files owned by the authenticated user. Requires drive-full-list.
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
-n, --dry-run Do a trial run with no permanent changes
--dump-auth Dump HTTP headers with auth info
--dump-bodies Dump HTTP headers and bodies - may contain sensitive info
--dump-filters Dump the filters to the output
--dump-headers Dump HTTP headers - may contain sensitive info
--exclude stringArray Exclude files matching pattern
--exclude-from stringArray Read exclude patterns from file
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
--max-size int Don't transfer any file larger than this in k or suffix b|k|M|G (default off)
--memprofile string Write memory profile to file
--min-age string Don't transfer any file younger than this in s or suffix ms|s|m|h|d|w|M|y
--min-size int Don't transfer any file smaller than this in k or suffix b|k|M|G (default off)
--modify-window duration Max time diff to be considered the same (default 1ns)
--no-check-certificate Do not verify the server SSL certificate. Insecure.
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
-q, --quiet Print as little stuff as possible
--retries int Retry operations this many times if they fail (default 3)
--s3-acl string Canned ACL used when creating buckets and/or storing objects in S3
--s3-storage-class string Storage class to use when uploading S3 objects (STANDARD|REDUCED_REDUNDANCY|STANDARD_IA)
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 18-Mar-2017
+18 -5
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone dedupe"
slug: rclone_dedupe
url: /commands/rclone_dedupe/
@@ -108,12 +108,16 @@ rclone dedupe [mode] remote:path
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -122,6 +126,8 @@ rclone dedupe [mode] remote:path
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -135,12 +141,14 @@ rclone dedupe [mode] remote:path
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -153,6 +161,7 @@ rclone dedupe [mode] remote:path
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -163,14 +172,18 @@ rclone dedupe [mode] remote:path
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+18 -5
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone delete"
slug: rclone_delete
url: /commands/rclone_delete/
@@ -44,12 +44,16 @@ rclone delete remote:path
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -58,6 +62,8 @@ rclone delete remote:path
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -71,12 +77,14 @@ rclone delete remote:path
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -89,6 +97,7 @@ rclone delete remote:path
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -99,14 +108,18 @@ rclone delete remote:path
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone genautocomplete"
slug: rclone_genautocomplete
url: /commands/rclone_genautocomplete/
@@ -42,12 +42,16 @@ rclone genautocomplete [output_file]
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -56,6 +60,8 @@ rclone genautocomplete [output_file]
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -69,12 +75,14 @@ rclone genautocomplete [output_file]
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -87,6 +95,7 @@ rclone genautocomplete [output_file]
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -97,14 +106,18 @@ rclone genautocomplete [output_file]
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+18 -5
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone gendocs"
slug: rclone_gendocs
url: /commands/rclone_gendocs/
@@ -30,12 +30,16 @@ rclone gendocs output_directory
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -44,6 +48,8 @@ rclone gendocs output_directory
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -57,12 +63,14 @@ rclone gendocs output_directory
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -75,6 +83,7 @@ rclone gendocs output_directory
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -85,14 +94,18 @@ rclone gendocs output_directory
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+18 -5
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone listremotes"
slug: rclone_listremotes
url: /commands/rclone_listremotes/
@@ -37,12 +37,16 @@ rclone listremotes
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -51,6 +55,8 @@ rclone listremotes
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -64,12 +70,14 @@ rclone listremotes
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -82,6 +90,7 @@ rclone listremotes
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -92,14 +101,18 @@ rclone listremotes
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+20 -7
View File
@@ -1,17 +1,17 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone ls"
slug: rclone_ls
url: /commands/rclone_ls/
---
## rclone ls
List all the objects in the the path with size and path.
List all the objects in the path with size and path.
### Synopsis
List all the objects in the the path with size and path.
List all the objects in the path with size and path.
```
rclone ls remote:path
@@ -27,12 +27,16 @@ rclone ls remote:path
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -41,6 +45,8 @@ rclone ls remote:path
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -54,12 +60,14 @@ rclone ls remote:path
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -72,6 +80,7 @@ rclone ls remote:path
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -82,14 +91,18 @@ rclone ls remote:path
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+20 -7
View File
@@ -1,17 +1,17 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone lsd"
slug: rclone_lsd
url: /commands/rclone_lsd/
---
## rclone lsd
List all directories/containers/buckets in the the path.
List all directories/containers/buckets in the path.
### Synopsis
List all directories/containers/buckets in the the path.
List all directories/containers/buckets in the path.
```
rclone lsd remote:path
@@ -27,12 +27,16 @@ rclone lsd remote:path
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -41,6 +45,8 @@ rclone lsd remote:path
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -54,12 +60,14 @@ rclone lsd remote:path
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -72,6 +80,7 @@ rclone lsd remote:path
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -82,14 +91,18 @@ rclone lsd remote:path
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+18 -5
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone lsl"
slug: rclone_lsl
url: /commands/rclone_lsl/
@@ -27,12 +27,16 @@ rclone lsl remote:path
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -41,6 +45,8 @@ rclone lsl remote:path
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -54,12 +60,14 @@ rclone lsl remote:path
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -72,6 +80,7 @@ rclone lsl remote:path
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -82,14 +91,18 @@ rclone lsl remote:path
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+18 -5
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone md5sum"
slug: rclone_md5sum
url: /commands/rclone_md5sum/
@@ -30,12 +30,16 @@ rclone md5sum remote:path
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -44,6 +48,8 @@ rclone md5sum remote:path
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -57,12 +63,14 @@ rclone md5sum remote:path
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -75,6 +83,7 @@ rclone md5sum remote:path
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -85,14 +94,18 @@ rclone md5sum remote:path
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+18 -5
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone mkdir"
slug: rclone_mkdir
url: /commands/rclone_mkdir/
@@ -27,12 +27,16 @@ rclone mkdir remote:path
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -41,6 +45,8 @@ rclone mkdir remote:path
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -54,12 +60,14 @@ rclone mkdir remote:path
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -72,6 +80,7 @@ rclone mkdir remote:path
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -82,14 +91,18 @@ rclone mkdir remote:path
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+38 -16
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone mount"
slug: rclone_mount
url: /commands/rclone_mount/
@@ -19,7 +19,7 @@ This is **EXPERIMENTAL** - use with care.
First set up your remote using `rclone config`. Check it works with `rclone ls` etc.
Start the mount like this
Start the mount like this (note the & on the end to put rclone in the background).
rclone mount remote:path/to/files /path/to/local/mount &
@@ -27,23 +27,27 @@ Stop the mount with
fusermount -u /path/to/local/mount
Or if that fails try
fusermount -z -u /path/to/local/mount
Or with OS X
umount -u /path/to/local/mount
umount /path/to/local/mount
### Limitations ###
This can only write files seqentially, it can only seek when reading.
This means that many applications won't work with their files on an
rclone mount.
Rclone mount inherits rclone's directory handling. In rclone's world
directories don't really exist. This means that empty directories
will have a tendency to disappear once they fall out of the directory
cache.
The bucket based FSes (eg swift, s3, google compute storage, b2) won't
work from the root - you will need to specify a bucket, or a path
within the bucket. So `swift:` won't work whereas `swift:bucket` will
as will `swift:bucket/path`.
The bucket based remotes (eg Swift, S3, Google Compute Storage, B2,
Hubic) won't work from the root - you will need to specify a bucket,
or a path within the bucket. So `swift:` won't work whereas
`swift:bucket` will as will `swift:bucket/path`.
None of these support the concept of directories, so empty
directories will have a tendency to disappear once they fall out of
the directory cache.
Only supported on Linux, FreeBSD and OS X at the moment.
@@ -56,6 +60,11 @@ can't use retries in the same way without making local copies of the
uploads. This might happen in the future, but for the moment rclone
mount won't do that, so will be less reliable than the rclone command.
### Filters ###
Note that all the rclone filters can be used to select a subset of the
files to be visible in the mount.
### Bugs ###
* All the remotes should work for read, but some may not for write
@@ -103,12 +112,16 @@ rclone mount remote:path /path/to/mountpoint
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -117,6 +130,8 @@ rclone mount remote:path /path/to/mountpoint
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -130,12 +145,14 @@ rclone mount remote:path /path/to/mountpoint
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -148,6 +165,7 @@ rclone mount remote:path /path/to/mountpoint
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -158,14 +176,18 @@ rclone mount remote:path /path/to/mountpoint
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+18 -5
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone move"
slug: rclone_move
url: /commands/rclone_move/
@@ -44,12 +44,16 @@ rclone move source:path dest:path
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -58,6 +62,8 @@ rclone move source:path dest:path
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -71,12 +77,14 @@ rclone move source:path dest:path
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -89,6 +97,7 @@ rclone move source:path dest:path
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -99,14 +108,18 @@ rclone move source:path dest:path
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+18 -5
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone moveto"
slug: rclone_moveto
url: /commands/rclone_moveto/
@@ -56,12 +56,16 @@ rclone moveto source:path dest:path
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -70,6 +74,8 @@ rclone moveto source:path dest:path
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -83,12 +89,14 @@ rclone moveto source:path dest:path
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -101,6 +109,7 @@ rclone moveto source:path dest:path
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -111,14 +120,18 @@ rclone moveto source:path dest:path
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+108
View File
@@ -0,0 +1,108 @@
---
date: 2017-03-18T11:14:54Z
title: "rclone obscure"
slug: rclone_obscure
url: /commands/rclone_obscure/
---
## rclone obscure
Obscure password for use in the rclone.conf
### Synopsis
Obscure password for use in the rclone.conf
```
rclone obscure password
```
### Options inherited from parent commands
```
--acd-templink-threshold int Files >= this size will be downloaded via their tempLink. (default 9G)
--acd-upload-wait-per-gb duration Additional time per GB to wait after a failed complete upload to see if it appears. (default 3m0s)
--ask-password Allow prompt for password for encrypted configuration. (default true)
--b2-chunk-size int Upload chunk size. Must fit in memory. (default 96M)
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
--delete-excluded Delete files on dest excluded from sync
--drive-auth-owner-only Only consider files owned by the authenticated user. Requires drive-full-list.
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
-n, --dry-run Do a trial run with no permanent changes
--dump-auth Dump HTTP headers with auth info
--dump-bodies Dump HTTP headers and bodies - may contain sensitive info
--dump-filters Dump the filters to the output
--dump-headers Dump HTTP headers - may contain sensitive info
--exclude stringArray Exclude files matching pattern
--exclude-from stringArray Read exclude patterns from file
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
--max-size int Don't transfer any file larger than this in k or suffix b|k|M|G (default off)
--memprofile string Write memory profile to file
--min-age string Don't transfer any file younger than this in s or suffix ms|s|m|h|d|w|M|y
--min-size int Don't transfer any file smaller than this in k or suffix b|k|M|G (default off)
--modify-window duration Max time diff to be considered the same (default 1ns)
--no-check-certificate Do not verify the server SSL certificate. Insecure.
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
-q, --quiet Print as little stuff as possible
--retries int Retry operations this many times if they fail (default 3)
--s3-acl string Canned ACL used when creating buckets and/or storing objects in S3
--s3-storage-class string Storage class to use when uploading S3 objects (STANDARD|REDUCED_REDUNDANCY|STANDARD_IA)
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 18-Mar-2017
+18 -5
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone purge"
slug: rclone_purge
url: /commands/rclone_purge/
@@ -31,12 +31,16 @@ rclone purge remote:path
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -45,6 +49,8 @@ rclone purge remote:path
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -58,12 +64,14 @@ rclone purge remote:path
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -76,6 +84,7 @@ rclone purge remote:path
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -86,14 +95,18 @@ rclone purge remote:path
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+18 -5
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone rmdir"
slug: rclone_rmdir
url: /commands/rclone_rmdir/
@@ -29,12 +29,16 @@ rclone rmdir remote:path
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -43,6 +47,8 @@ rclone rmdir remote:path
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -56,12 +62,14 @@ rclone rmdir remote:path
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -74,6 +82,7 @@ rclone rmdir remote:path
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -84,14 +93,18 @@ rclone rmdir remote:path
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+18 -5
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone rmdirs"
slug: rclone_rmdirs
url: /commands/rclone_rmdirs/
@@ -34,12 +34,16 @@ rclone rmdirs remote:path
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -48,6 +52,8 @@ rclone rmdirs remote:path
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -61,12 +67,14 @@ rclone rmdirs remote:path
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -79,6 +87,7 @@ rclone rmdirs remote:path
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -89,14 +98,18 @@ rclone rmdirs remote:path
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+18 -5
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone sha1sum"
slug: rclone_sha1sum
url: /commands/rclone_sha1sum/
@@ -30,12 +30,16 @@ rclone sha1sum remote:path
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -44,6 +48,8 @@ rclone sha1sum remote:path
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -57,12 +63,14 @@ rclone sha1sum remote:path
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -75,6 +83,7 @@ rclone sha1sum remote:path
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -85,14 +94,18 @@ rclone sha1sum remote:path
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+18 -5
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone size"
slug: rclone_size
url: /commands/rclone_size/
@@ -27,12 +27,16 @@ rclone size remote:path
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -41,6 +45,8 @@ rclone size remote:path
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -54,12 +60,14 @@ rclone size remote:path
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -72,6 +80,7 @@ rclone size remote:path
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -82,14 +91,18 @@ rclone size remote:path
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+18 -5
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone sync"
slug: rclone_sync
url: /commands/rclone_sync/
@@ -46,12 +46,16 @@ rclone sync source:path dest:path
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -60,6 +64,8 @@ rclone sync source:path dest:path
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -73,12 +79,14 @@ rclone sync source:path dest:path
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -91,6 +99,7 @@ rclone sync source:path dest:path
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -101,14 +110,18 @@ rclone sync source:path dest:path
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+18 -5
View File
@@ -1,5 +1,5 @@
---
date: 2017-01-02T15:29:14Z
date: 2017-03-18T11:14:54Z
title: "rclone version"
slug: rclone_version
url: /commands/rclone_version/
@@ -27,12 +27,16 @@ rclone version
--b2-test-mode string A flag string for X-Bz-Test-Mode header.
--b2-upload-cutoff int Cutoff for switching to chunked upload (default 190.735M)
--b2-versions Include old versions in directory listings.
--bwlimit int Bandwidth limit in kBytes/s, or use suffix b|k|M|G
--backup-dir string Make backups into hierarchy based in DIR.
--buffer-size int Buffer size when copying files. (default 16M)
--bwlimit BwTimetable Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.
--checkers int Number of checkers to run in parallel. (default 8)
-c, --checksum Skip based on checksum & size, not mod-time & size
--config string Config file. (default "/home/ncw/.rclone.conf")
--contimeout duration Connect timeout (default 1m0s)
-L, --copy-links Follow symlinks and copy the pointed to item.
--cpuprofile string Write cpu profile to file
--crypt-show-mapping For all files listed show how the names encrypt.
--delete-after When synchronizing, delete files on destination after transfering
--delete-before When synchronizing, delete files on destination before transfering
--delete-during When synchronizing, delete files during transfer (default)
@@ -41,6 +45,8 @@ rclone version
--drive-chunk-size int Upload chunk size. Must a power of 2 >= 256k. (default 8M)
--drive-formats string Comma separated list of preferred formats for downloading Google docs. (default "docx,xlsx,pptx,svg")
--drive-full-list Use a full listing for directory list. More data but usually quicker. (obsolete)
--drive-list-chunk int Size of listing chunk 100-1000. 0 to disable. (default 1000)
--drive-skip-gdocs Skip google documents in all listings.
--drive-upload-cutoff int Cutoff for switching to chunked upload (default 8M)
--drive-use-trash Send files to the trash instead of deleting permanently.
--dropbox-chunk-size int Upload chunk size. Max 150M. (default 128M)
@@ -54,12 +60,14 @@ rclone version
--files-from stringArray Read list of source-file names from file
-f, --filter stringArray Add a file-filtering rule
--filter-from stringArray Read filtering patterns from a file
--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
--include stringArray Include files matching pattern
--include-from stringArray Read include patterns from file
--log-file string Log everything to this file
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "INFO")
--low-level-retries int Number of low level retries to do. (default 10)
--max-age string Don't transfer any file older than this in s or suffix ms|s|m|h|d|w|M|y
--max-depth int If set limits the recursion depth to this. (default -1)
@@ -72,6 +80,7 @@ rclone version
--no-gzip-encoding Don't set Accept-Encoding: gzip.
--no-traverse Don't traverse destination file system on copy.
--no-update-modtime Don't update destination mod-time if files identical.
--old-sync-method Temporary flag to select old sync method
-x, --one-file-system Don't cross filesystem boundaries.
--onedrive-chunk-size int Above this size files will be chunked - must be multiple of 320k. (default 10M)
--onedrive-upload-cutoff int Cutoff for switching to chunked upload - must be <= 100MB (default 10M)
@@ -82,14 +91,18 @@ rclone version
--size-only Skip based on size only, not mod-time or checksum
--stats duration Interval between printing stats, e.g 500ms, 60s, 5m. (0 to disable) (default 1m0s)
--stats-unit string Show data rate in stats as either 'bits' or 'bytes'/s (default "bytes")
--suffix string Suffix for use with --backup-dir.
--swift-chunk-size int Above this size files will be chunked into a _segments container. (default 5G)
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, eg KERN,USER,... (default "DAEMON")
--timeout duration IO idle timeout (default 5m0s)
--track-renames When synchronizing, track file renames and do a server side move if possible
--transfers int Number of file transfers to run in parallel. (default 4)
-u, --update Skip files that are newer on the destination.
-v, --verbose Print lots more stuff
-v, --verbose count[=-1] Print lots more stuff (repeat for more)
```
### SEE ALSO
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.35-DEV
* [rclone](/commands/rclone/) - Sync files and directories to and from local and remote object stores - v1.36
###### Auto generated by spf13/cobra on 2-Jan-2017
###### Auto generated by spf13/cobra on 18-Mar-2017
+52 -2
View File
@@ -56,12 +56,14 @@ Choose a number from below, or type in your own value
\ "onedrive"
11 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
12 / Yandex Disk
12 / SSH/SFTP Connection
\ "sftp"
13 / Yandex Disk
\ "yandex"
Storage> 5
Remote to encrypt/decrypt.
Normally should contain a ':' and a path, eg "myremote:path/to/dir",
"myremote:bucket" or "myremote:"
"myremote:bucket" or maybe "myremote:" (not recommended).
remote> remote:path
How to encrypt the filenames.
Choose a number from below, or type in your own value
@@ -118,6 +120,7 @@ elsewhere it will be compatible - all the secrets used are derived
from those two passwords/passphrases.
Note that rclone does not encrypt
* file length - this can be calcuated within 16 bytes
* modification time - used for syncing
@@ -208,11 +211,13 @@ $ rclone -q ls remote:path
Here are some of the features of the file name encryption modes
Off
* doesn't hide file names or directory structure
* allows for longer file names (~246 characters)
* can use sub paths and copy single files
Standard
* file names encrypted
* file names can't be as long (~156 characters)
* can use sub paths and copy single files
@@ -236,6 +241,51 @@ depends on that.
Hashes are not stored for crypt. However the data integrity is
protected by an extremely strong crypto authenticator.
Note that you should use the `rclone cryptcheck` command to check the
integrity of a crypted remote instead of `rclone check` which can't
check the checksums properly.
### Specific options ###
Here are the command line options specific to this cloud storage
system.
#### --crypt-show-mapping ####
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.
## Backing up a crypted remote ##
If you wish to backup a crypted remote, it it recommended that you use
`rclone sync` on the encrypted files, and make sure the passwords are
the same in the new encrypted remote.
This will have the following advantages
* `rclone sync` will check the checksums while copying
* you can use `rclone check` between the encrypted remotes
* you don't decrypt and encrypt unecessarily
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 sync the two remotes you would do
rclone sync remote:crypt remote2:crypt
And to check the integrity you would do
rclone check remote:crypt remote2:crypt
## File formats ##
### File encryption ###
+289 -64
View File
@@ -8,9 +8,9 @@ Configure
---------
First you'll need to configure rclone. As the object storage systems
have quite complicated authentication these are kept in a config file
`.rclone.conf` in your home directory by default. (You can use the
`--config` option to choose a different config file.)
have quite complicated authentication these are kept in a config file.
(See the `--config` entry for how to find the config file and choose
its location.)
The easiest way to make the config is to run rclone with the config
option:
@@ -30,6 +30,7 @@ See the following for detailed instructions for
* [Hubic](/hubic/)
* [Microsoft One Drive](/onedrive/)
* [Yandex Disk](/yandex/)
* [SFTP](/sftp/)
* [Crypt](/crypt/) - to encrypt other remotes
Usage
@@ -58,24 +59,35 @@ rclone uses a system of subcommands. For example
The main rclone commands with most used first
* [rclone config](/commands/rclone_config/) - Enter an interactive configuration session.
* [rclone copy](/commands/rclone_copy/) - Copy files from source to dest, skipping already copied
* [rclone sync](/commands/rclone_sync/) - Make source and dest identical, modifying destination only.
* [rclone move](/commands/rclone_move/) - Move files from source to dest.
* [rclone delete](/commands/rclone_delete/) - Remove the contents of path.
* [rclone purge](/commands/rclone_purge/) - Remove the path and all of its contents.
* [rclone mkdir](/commands/rclone_mkdir/) - Make the path if it doesn't already exist.
* [rclone rmdir](/commands/rclone_rmdir/) - Remove the path.
* [rclone check](/commands/rclone_check/) - Checks the files in the source and destination match.
* [rclone ls](/commands/rclone_ls/) - List all the objects in the the path with size and path.
* [rclone lsd](/commands/rclone_lsd/) - List all directories/containers/buckets in the the path.
* [rclone lsl](/commands/rclone_lsl/) - List all the objects path with modification time, size and path.
* [rclone md5sum](/commands/rclone_md5sum/) - Produces an md5sum file for all the objects in the path.
* [rclone sha1sum](/commands/rclone_sha1sum/) - Produces an sha1sum file for all the objects in the path.
* [rclone size](/commands/rclone_size/) - Returns the total size and number of objects in remote:path.
* [rclone version](/commands/rclone_version/) - Show the version number.
* [rclone cleanup](/commands/rclone_cleanup/) - Clean up the remote if possible
* [rclone dedupe](/commands/rclone_dedupe/) - Interactively find duplicate files delete/rename them.
* [rclone config](/commands/rclone_config/) - Enter an interactive configuration session.
* [rclone copy](/commands/rclone_copy/) - Copy files from source to dest, skipping already copied
* [rclone sync](/commands/rclone_sync/) - Make source and dest identical, modifying destination only.
* [rclone move](/commands/rclone_move/) - Move files from source to dest.
* [rclone delete](/commands/rclone_delete/) - Remove the contents of path.
* [rclone purge](/commands/rclone_purge/) - Remove the path and all of its contents.
* [rclone mkdir](/commands/rclone_mkdir/) - Make the path if it doesn't already exist.
* [rclone rmdir](/commands/rclone_rmdir/) - Remove the path.
* [rclone rmdirs](/commands/rclone_rmdirs/) - Remove any empty directoryies under the path.
* [rclone check](/commands/rclone_check/) - Checks the files in the source and destination match.
* [rclone ls](/commands/rclone_ls/) - List all the objects in the path with size and path.
* [rclone lsd](/commands/rclone_lsd/) - List all directories/containers/buckets in the path.
* [rclone lsl](/commands/rclone_lsl/) - List all the objects path with modification time, size and path.
* [rclone md5sum](/commands/rclone_md5sum/) - Produces an md5sum file for all the objects in the path.
* [rclone sha1sum](/commands/rclone_sha1sum/) - Produces an sha1sum file for all the objects in the path.
* [rclone size](/commands/rclone_size/) - Returns the total size and number of objects in remote:path.
* [rclone version](/commands/rclone_version/) - Show the version number.
* [rclone cleanup](/commands/rclone_cleanup/) - Clean up the remote if possible
* [rclone dedupe](/commands/rclone_dedupe/) - Interactively find duplicate files delete/rename them.
* [rclone authorize](/commands/rclone_authorize/) - Remote authorization.
* [rclone cat](/commands/rclone_cat/) - Concatenates any files and sends them to stdout.
* [rclone copyto](/commands/rclone_copyto/) - Copy files from source to dest, skipping already copied
* [rclone genautocomplete](/commands/rclone_genautocomplete/) - Output bash completion script for rclone.
* [rclone gendocs](/commands/rclone_gendocs/) - Output markdown docs for rclone to the directory supplied.
* [rclone listremotes](/commands/rclone_listremotes/) - List all the remotes in the config file.
* [rclone mount](/commands/rclone_mount/) - Mount the remote as a mountpoint. **EXPERIMENTAL**
* [rclone moveto](/commands/rclone_moveto/) - Move file or directory from source to dest.
* [rclone obscure](/commands/rclone_obscure/) - Obscure password for use in the rclone.conf
* [rclone cryptcheck](/commands/rclone_cryptcheck/) - Checks the integritity of a crypted remote.
See the [commands index](/commands/) for the full list.
@@ -145,8 +157,8 @@ If you are using the root directory on its own then don't quote it
Server Side Copy
----------------
Drive, S3, Dropbox, Swift and Google Cloud Storage support server side
copy.
Most remotes (but not all - see [the
overview](/overview/#optional-features)) support server side copy.
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
@@ -159,11 +171,12 @@ Eg
Will copy the contents of `oldbucket` to `newbucket` without
downloading and re-uploading.
Remotes which don't support server side copy (eg local) **will**
download and re-upload in this case.
Remotes which don't support server side copy **will** download and
re-upload in this case.
Server side copies are used with `sync` and `copy` and will be
identified in the log when using the `-v` flag.
identified in the log when using the `-v` flag. The may also be used
with `move` if the remote doesn't support server side move.
Server side copies will only be attempted if the remote names are the
same.
@@ -188,15 +201,60 @@ for bytes, `k` for kBytes, `M` for MBytes and `G` for GBytes may be
used. These are the binary units, eg 1, 2\*\*10, 2\*\*20, 2\*\*30
respectively.
### --bwlimit=SIZE ###
### --backup-dir=DIR ###
Bandwidth limit in kBytes/s, or use suffix b|k|M|G. The default is `0`
which means to not limit bandwidth.
When using `sync`, `copy` or `move` any files which would have been
overwritten or deleted are moved in their original hierarchy into this
directory.
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.
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.
For example
rclone sync /path/to/local remote:current --backup-dir remote:old
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`.
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.
### --bwlimit=BANDWIDTH_SPEC ###
This option controls the bandwidth limit. Limits can be specified
in two ways: As a single limit, or as a timetable.
Single limits last for the duration of the session. To use a single limit,
specify the desired bandwidth in kBytes/s, or use a suffix b|k|M|G. The
default is `0` which means to not limit bandwidth.
For example to limit bandwidth usage to 10 MBytes/s use `--bwlimit 10M`
This only limits the bandwidth of the data transfer, it doesn't limit
the bandwith of the directory listings etc.
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 "HH:MM,BANDWIDTH HH:MM,BANDWITH...".
An example of a typical timetable to avoid link saturation during daytime
working hours could be:
`--bwlimit "08:00,512 12:00,10M 13:00,512 18:00,30M 23:00,off"`
In this example, the transfer bandwidth will be set to 512kBytes/sec at 8am.
At noon, it will raise to 10Mbytes/s, and drop back to 512kBytes/sec at 1pm.
At 6pm, the bandwidth limit will be set to 30MBytes/s, and at 11pm it will be
completely disabled (full speed). Anything between 11pm and 8am will remain
unlimited.
Bandwidth limits only apply to the data transfer. The don't apply to the
bandwith of the directory listings etc.
Note that the units are Bytes/s not Bits/s. Typically connections are
measured in Bits/s - to convert divide by 8. For example let's say
@@ -204,6 +262,13 @@ you have a 10 Mbit/s connection and you wish rclone to use half of it
- 5 Mbit/s. This is 5/8 = 0.625MByte/s so you would use a `--bwlimit
0.625M` parameter for rclone.
### --buffer-size=SIZE ###
Use this sized buffer to speed up file transfers. Each `--transfer`
will use this much memory for buffering.
Set to 0 to disable the buffering for the minimum memory use.
### --checkers=N ###
The number of checkers to run in parallel. Checkers do the equality
@@ -235,11 +300,18 @@ they are incorrect as it would normally.
### --config=CONFIG_FILE ###
Specify the location of the rclone config file. Normally this is in
your home directory as a file called `.rclone.conf`. If you run
`rclone -h` and look at the help for the `--config` option you will
see where the default location is for you. Use this flag to override
the config location, eg `rclone --config=".myconfig" .config`.
Specify the location of the rclone config file.
Normally the config file is in your home directory as a file called
`.config/rclone/rclone.conf` (or `.rclone.conf` if created with an
older version). If `$XDG_CONFIG_HOME` is set it will be at
`$XDG_CONFIG_HOME/rclone/rclone.conf`
If you run `rclone -h` and look at the help for the `--config` option
you will see where the default location is for you.
Use this flag to override the config location, eg `rclone
--config=".myconfig" .config`.
### --contimeout=TIME ###
@@ -260,6 +332,15 @@ 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.
### --ignore-checksum ###
Normally rclone will check that the checksums of transferred files
match, and give an error "corrupted on transfer" if they don't.
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.
### --ignore-existing ###
Using this option will make rclone unconditionally skip all files
@@ -299,6 +380,22 @@ This can be useful for tracking down problems with syncs in
combination with the `-v` flag. See the Logging section for more
info.
### --log-level LEVEL ###
This sets the log level for rclone. The default log level is `INFO`.
`DEBUG` is equivalent to `-vv`. It outputs lots of debug info - useful
for bug reports and really finding out what rclone is doing.
`INFO` is equivalent to `-v`. It outputs information about each transfer
and prints stats once a minute by default.
`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.
`ERROR` is equivalent to `-q`. It only output error messages.
### --low-level-retries NUMBER ###
This controls the number of low level retries rclone does.
@@ -415,6 +512,51 @@ equals 1,048,576 bits/s and not 1,000,000 bits/s.
The default is `bytes`.
### --suffix=SUFFIX ###
This is for use with `--backup-dir` only. If this isn't set then
`--backup-dir` will move files with their original name. If it is set
then the files will have SUFFIX added on to them.
See `--backup-dir` for more info.
### --syslog ###
On capable OSes (not Windows or Plan9) send all log output to syslog.
This can be useful for running rclone in script or `rclone mount`.
### --syslog-facility string ###
If using `--syslog` this sets the syslog facility (eg `KERN`, `USER`).
See `man syslog` for a list of possible facilities. The default
facility is `DAEMON`.
### --track-renames ###
By default rclone doesn't not 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.
If you use this flag, and the remote supports server side copy or
server side move, and the source and destination have a compatible
hash, then this will track renames during `sync`, `copy`, and `move`
operations and perform renaming server-side.
Files will be matched by size and hash - if both match then a rename
will be considered.
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.
Note that `--track-renames` is incompatible with `--no-traverse` and
that it uses extra memory to keep track of all the rename candidates.
Note also that `--track-renames` is incompatible with
`--delete-before` and will select `--delete-after` instead of
`--delete-during`.
### --delete-(before,during,after) ###
This option allows you to specify when files on your destination are
@@ -422,16 +564,21 @@ deleted when you sync folders.
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 extra memory as it
has to store the source listing before proceeding.
transfer of any new or updated files. This uses two passes through the
file systems, one for the deletions and one for the copies.
Specifying `--delete-during` (default value) will delete files while
checking and uploading files. This is usually the fastest option.
Currently this works the same as `--delete-after` but it may change in
the future.
Specifying `--delete-during` will delete files while checking and
uploading files. This is the fastest option and uses the least memory.
Specifying `--delete-after` will delay deletion of files until all new/updated
files have been successfully transfered.
Specifying `--delete-after` (the default value) will delay deletion of
files until all new/updated files have been successfully transfered.
The files to be deleted are collected in the copy pass then deleted
after the copy pass has completed sucessfully. 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`.
### --timeout=TIME ###
@@ -467,12 +614,14 @@ This can be useful when transferring to a remote which doesn't support
mod times directly as it is more accurate than a `--size-only` check
and faster than using `--checksum`.
### -v, --verbose ###
### -v, -vv, --verbose ###
If you set this flag, rclone will become very verbose telling you
about every file it considers and transfers.
With `-v` rclone will tell you about each file that is transferred and
a small number of significant events.
Very useful for debugging.
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.
### -V, --version ###
@@ -621,6 +770,8 @@ This option defaults to `false`.
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`.
If you are only copying a small number of files and/or have a large
number of files on the destination then `--no-traverse` will stop
@@ -659,37 +810,111 @@ See the [filtering section](/filtering/).
Logging
-------
rclone has 3 levels of logging, `Error`, `Info` and `Debug`.
rclone has 4 levels of logging, `Error`, `Notice`, `Info` and `Debug`.
By default rclone logs `Error` and `Info` to standard error and `Debug`
to standard output. This means you can redirect standard output and
standard error to different places.
By default rclone logs to standard error. This means you can redirect
standard error and still see the normal output of rclone commands (eg
`rclone ls`).
By default rclone will produce `Error` and `Info` level messages.
By default rclone will produce `Error` and `Notice` level messages.
If you use the `-q` flag, rclone will only produce `Error` messages.
If you use the `-v` flag, rclone will produce `Error`, `Info` and
`Debug` messages.
If you use the `-v` flag, rclone will produce `Error`, `Notice` and
`Info` messages.
If you use the `-vv` flag, rclone will produce `Error`, `Notice`,
`Info` and `Debug` messages.
You can also control the log levels with the `--log-level` flag.
If you use the `--log-file=FILE` option, rclone will redirect `Error`,
`Info` and `Debug` messages along with standard error to FILE.
If you use the `--syslog` flag then rclone will log to syslog and the
`--syslog-facility` control which facility it uses.
Rclone prefixes all log messages with their level in capitals, eg INFO
which makes it easy to grep the log file for different kinds of
information.
Exit Code
---------
If any errors occurred during the command, rclone with an exit code of
`1`. This allows scripts to detect when rclone operations have failed.
If any errors occurred during the command, rclone will exit with a
non-zero exit code. This allows scripts to detect when rclone
operations have failed.
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.
When rclone is running it will accumulate errors as it goes along, and
only exit with an non-zero exit code if (after retries) there were no
transfers with errors remaining. For every error counted there will
be a high priority log message (visibile 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.
only exit with an non-zero exit code if (after retries) there were
still failed transfers. For every error counted there will be a high
priority log message (visibile 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.
Environment Variables
---------------------
Rclone can be configured entirely using environment variables. These
can be used to set defaults for options or config file entries.
### 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.
Or to always use the trash in drive `--drive-use-trash`, set
`RCLONE_DRIVE_USE_TRASH=true`.
The same parser is used for the options and the environment variables
so they take exactly the same form.
### Config file ###
You can set defaults for values in the config file on an individual
remote basis. If you want to use this feature, you will need to
discover the name of the config items that you want. The easiest way
is to run through `rclone config` by hand, then look in the config
file to see what the values are (the config file can be found by
looking at the help for `--config` in `rclone help`).
To find the name of the environment variable, you need to set, take
`RCLONE_` + name of remote + `_` + name of config file option and make
it all uppercase.
For example to configure an S3 remote named `mys3:` without a config
file (using unix ways of setting environment variables):
```
$ 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:
```
Note that if you want to create a remote using environment variables
you must create the `..._TYPE` variable as above.
### Other environment variables ###
* 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.
+12 -5
View File
@@ -5,15 +5,16 @@ type: page
date: "2015-09-06"
---
Flowers for My Wife
===================
## <i class="fa fa-heart"></i> Flowers for My Wife ##
Rclone is a pure open source for love-not-money project. However I've
had requests for a donation page and coding it does take me away from
something else I love - my wonderful wife.
had requests for a donation page and coding rclone does take me away
from something else I love - my wonderful wife.
So if you would like to send a donation, I will use it to buy flowers
for her which will make her very happy.
(and other pretty things) for her which will make her very happy.
### Paypal ###
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
@@ -22,6 +23,12 @@ for her which will make her very happy.
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>
### Bitcoin ###
[![19j3oLUsqBcTRvZ2LSq2phVjsAAJ86xSnk](/img/ncw-bitcoin-address.png)](bitcoin:19j3oLUsqBcTRvZ2LSq2phVjsAAJ86xSnk)
[Bitcoin:](bitcoin:19j3oLUsqBcTRvZ2LSq2phVjsAAJ86xSnk) 19j3oLUsqBcTRvZ2LSq2phVjsAAJ86xSnk
If you would prefer to express your gratitude by promoting the
project, or helping with it, I'd be over the moon with that too!
+24 -22
View File
@@ -2,41 +2,43 @@
title: "Rclone downloads"
description: "Download rclone binaries for your OS."
type: page
date: "2017-01-02"
date: "2017-03-18"
---
Rclone Download v1.35
Rclone Download v1.36
=====================
* Windows
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.35-windows-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.35-windows-amd64.zip)
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.36-windows-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.36-windows-amd64.zip)
* OSX
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.35-osx-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.35-osx-amd64.zip)
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.36-osx-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.36-osx-amd64.zip)
* Linux
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.35-linux-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.35-linux-amd64.zip)
* [ARM - 32 Bit](http://downloads.rclone.org/rclone-v1.35-linux-arm.zip)
* [ARM - 64 Bit](http://downloads.rclone.org/rclone-v1.35-linux-arm64.zip)
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.36-linux-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.36-linux-amd64.zip)
* [ARM - 32 Bit](http://downloads.rclone.org/rclone-v1.36-linux-arm.zip)
* [ARM - 64 Bit](http://downloads.rclone.org/rclone-v1.36-linux-arm64.zip)
* [MIPS - Big Endian](http://downloads.rclone.org/rclone-v1.36-linux-mips.zip)
* [MIPS - Little Endian](http://downloads.rclone.org/rclone-v1.36-linux-mipsle.zip)
* FreeBSD
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.35-freebsd-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.35-freebsd-amd64.zip)
* [ARM - 32 Bit](http://downloads.rclone.org/rclone-v1.35-freebsd-arm.zip)
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.36-freebsd-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.36-freebsd-amd64.zip)
* [ARM - 32 Bit](http://downloads.rclone.org/rclone-v1.36-freebsd-arm.zip)
* NetBSD
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.35-netbsd-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.35-netbsd-amd64.zip)
* [ARM - 32 Bit](http://downloads.rclone.org/rclone-v1.35-netbsd-arm.zip)
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.36-netbsd-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.36-netbsd-amd64.zip)
* [ARM - 32 Bit](http://downloads.rclone.org/rclone-v1.36-netbsd-arm.zip)
* OpenBSD
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.35-openbsd-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.35-openbsd-amd64.zip)
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.36-openbsd-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.36-openbsd-amd64.zip)
* Plan 9
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.35-plan9-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.35-plan9-amd64.zip)
* [386 - 32 Bit](http://downloads.rclone.org/rclone-v1.36-plan9-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.36-plan9-amd64.zip)
* Solaris
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.35-solaris-amd64.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-v1.36-solaris-amd64.zip)
You can also find a [mirror of the downloads on github](https://github.com/ncw/rclone/releases/tag/v1.35).
You can also find a [mirror of the downloads on github](https://github.com/ncw/rclone/releases/tag/v1.36).
You can also download [the releases using SSL](https://downloads-rclone-org-7d7d567e.cdn.memsites.com/).
+2
View File
@@ -19,6 +19,8 @@ Rclone Download VERSION
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-VERSION-linux-amd64.zip)
* [ARM - 32 Bit](http://downloads.rclone.org/rclone-VERSION-linux-arm.zip)
* [ARM - 64 Bit](http://downloads.rclone.org/rclone-VERSION-linux-arm64.zip)
* [MIPS - Big Endian](http://downloads.rclone.org/rclone-VERSION-linux-mips.zip)
* [MIPS - Little Endian](http://downloads.rclone.org/rclone-VERSION-linux-mipsle.zip)
* FreeBSD
* [386 - 32 Bit](http://downloads.rclone.org/rclone-VERSION-freebsd-386.zip)
* [AMD64 - 64 Bit](http://downloads.rclone.org/rclone-VERSION-freebsd-amd64.zip)
+22 -14
View File
@@ -31,31 +31,35 @@ Type of storage to configure.
Choose a number from below, or type in your own value
1 / Amazon Drive
\ "amazon cloud drive"
2 / Amazon S3 (also Dreamhost, Ceph)
2 / Amazon S3 (also Dreamhost, Ceph, Minio)
\ "s3"
3 / Backblaze B2
\ "b2"
4 / Dropbox
\ "dropbox"
5 / Google Cloud Storage (this is not Google Drive)
5 / Encrypt/Decrypt a remote
\ "crypt"
6 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
6 / Google Drive
7 / Google Drive
\ "drive"
7 / Hubic
8 / Hubic
\ "hubic"
8 / Local Disk
9 / Local Disk
\ "local"
9 / Microsoft OneDrive
10 / Microsoft OneDrive
\ "onedrive"
10 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
11 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
11 / Yandex Disk
12 / SSH/SFTP Connection
\ "sftp"
13 / Yandex Disk
\ "yandex"
Storage> 6
Storage> 7
Google Application Client Id - leave blank normally.
client_id>
client_id>
Google Application Client Secret - leave blank normally.
client_secret>
client_secret>
Remote config
Use auto config?
* Say Y if not sure
@@ -69,8 +73,8 @@ Waiting for code...
Got code
--------------------
[remote]
client_id =
client_secret =
client_id =
client_secret =
token = {"AccessToken":"xxxx.x.xxxxx_xxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","RefreshToken":"1/xxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxx","Expiry":"2014-03-16T13:57:58.955387075Z","Extra":null}
--------------------
y) Yes this is OK
@@ -186,7 +190,7 @@ Here are the possible extensions with their corresponding mime types.
| epub | application/epub+zip | E-book format |
| html | text/html | An HTML Document |
| jpg | image/jpeg | A JPEG Image File |
| odp | application/vnd.oasis.opendocument.presentation | Openoffice Presentation |
| 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 |
@@ -201,6 +205,10 @@ Here are the possible extensions with their corresponding mime types.
| xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | Microsoft Office Spreadsheet |
| zip | application/zip | A ZIP file of HTML, Images CSS |
#### --drive-skip-gdocs ####
Skip google documents in all listings. If given, gdocs practically become invisible to rclone.
### Limitations ###
Drive has quite a lot of rate limiting. This causes rclone to be
+16 -12
View File
@@ -32,39 +32,43 @@ Type of storage to configure.
Choose a number from below, or type in your own value
1 / Amazon Drive
\ "amazon cloud drive"
2 / Amazon S3 (also Dreamhost, Ceph)
2 / Amazon S3 (also Dreamhost, Ceph, Minio)
\ "s3"
3 / Backblaze B2
\ "b2"
4 / Dropbox
\ "dropbox"
5 / Google Cloud Storage (this is not Google Drive)
5 / Encrypt/Decrypt a remote
\ "crypt"
6 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
6 / Google Drive
7 / Google Drive
\ "drive"
7 / Hubic
8 / Hubic
\ "hubic"
8 / Local Disk
9 / Local Disk
\ "local"
9 / Microsoft OneDrive
10 / Microsoft OneDrive
\ "onedrive"
10 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
11 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
11 / Yandex Disk
12 / SSH/SFTP Connection
\ "sftp"
13 / Yandex Disk
\ "yandex"
Storage> 4
Dropbox App Key - leave blank normally.
app_key>
app_key>
Dropbox App Secret - leave blank normally.
app_secret>
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 =
app_key =
app_secret =
token = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
--------------------
y) Yes this is OK
+40 -37
View File
@@ -30,65 +30,68 @@ Type of storage to configure.
Choose a number from below, or type in your own value
1 / Amazon Drive
\ "amazon cloud drive"
2 / Amazon S3 (also Dreamhost, Ceph)
2 / Amazon S3 (also Dreamhost, Ceph, Minio)
\ "s3"
3 / Backblaze B2
\ "b2"
4 / Dropbox
\ "dropbox"
5 / Google Cloud Storage (this is not Google Drive)
5 / Encrypt/Decrypt a remote
\ "crypt"
6 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
6 / Google Drive
7 / Google Drive
\ "drive"
7 / Hubic
8 / Hubic
\ "hubic"
8 / Local Disk
9 / Local Disk
\ "local"
9 / Microsoft OneDrive
10 / Microsoft OneDrive
\ "onedrive"
10 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
11 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
11 / Yandex Disk
12 / SSH/SFTP Connection
\ "sftp"
13 / Yandex Disk
\ "yandex"
Storage> 5
Storage> 6
Google Application Client Id - leave blank normally.
client_id>
client_id>
Google Application Client Secret - leave blank normally.
client_secret>
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>
service_account_file>
Access Control List for new objects.
Choose a number from below, or type in your own value
* Object owner gets OWNER access, and all Authenticated Users get READER access.
1) authenticatedRead
* Object owner gets OWNER access, and project team owners get OWNER access.
2) bucketOwnerFullControl
* Object owner gets OWNER access, and project team owners get READER access.
3) bucketOwnerRead
* Object owner gets OWNER access [default if left blank].
4) private
* Object owner gets OWNER access, and project team members get access according to their roles.
5) projectPrivate
* Object owner gets OWNER access, and all Users get READER access.
6) publicRead
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
* Project team owners get OWNER access, and all Authenticated Users get READER access.
1) authenticatedRead
* Project team owners get OWNER access [default if left blank].
2) private
* Project team members get access according to their roles.
3) projectPrivate
* Project team owners get OWNER access, and all Users get READER access.
4) publicRead
* Project team owners get OWNER access, and all Users get WRITER access.
5) publicReadWrite
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
Remote config
Remote config
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine or Y didn't work
@@ -102,8 +105,8 @@ Got code
--------------------
[remote]
type = google cloud storage
client_id =
client_secret =
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
+17 -13
View File
@@ -30,31 +30,35 @@ Type of storage to configure.
Choose a number from below, or type in your own value
1 / Amazon Drive
\ "amazon cloud drive"
2 / Amazon S3 (also Dreamhost, Ceph)
2 / Amazon S3 (also Dreamhost, Ceph, Minio)
\ "s3"
3 / Backblaze B2
\ "b2"
4 / Dropbox
\ "dropbox"
5 / Google Cloud Storage (this is not Google Drive)
5 / Encrypt/Decrypt a remote
\ "crypt"
6 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
6 / Google Drive
7 / Google Drive
\ "drive"
7 / Hubic
8 / Hubic
\ "hubic"
8 / Local Disk
9 / Local Disk
\ "local"
9 / Microsoft OneDrive
10 / Microsoft OneDrive
\ "onedrive"
10 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
11 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
11 / Yandex Disk
12 / SSH/SFTP Connection
\ "sftp"
13 / Yandex Disk
\ "yandex"
Storage> 7
Storage> 8
Hubic Client Id - leave blank normally.
client_id>
client_id>
Hubic Client Secret - leave blank normally.
client_secret>
client_secret>
Remote config
Use auto config?
* Say Y if not sure
@@ -68,8 +72,8 @@ Waiting for code...
Got code
--------------------
[remote]
client_id =
client_secret =
client_id =
client_secret =
token = {"access_token":"XXXXXX"}
--------------------
y) Yes this is OK
+57 -3
View File
@@ -29,9 +29,9 @@ Fetch and unpack
Copy binary file
sudo cp rclone /usr/sbin/
sudo chown root:root /usr/sbin/rclone
sudo chmod 755 /usr/sbin/rclone
sudo cp rclone /usr/bin/
sudo chown root:root /usr/bin/rclone
sudo chmod 755 /usr/bin/rclone
Install manpage
@@ -93,3 +93,57 @@ Instructions
roles:
- rclone
```
## Installation with snap ##
### Quickstart ###
* install Snapd on your distro using the instructions below
* sudo snap install rclone --classic
* Run `rclone config` to setup. See [rclone config docs](http://rclone.org/docs/) for more details.
See below for how to install snapd if it isn't already installed
#### Arch ####
sudo pacman -S snapd
enable the snapd systemd service:
sudo systemctl enable --now snapd.socket
#### Debian / Ubuntu ####
sudo apt install snapd
#### Fedora ####
sudo dnf copr enable zyga/snapcore
sudo dnf install snapd
enable the snapd systemd service:
sudo systemctl enable --now snapd.service
SELinux support is in beta, so currently:
sudo setenforce 0
to persist, edit `/etc/selinux/config` to set `SELINUX=permissive` and reboot.
#### Gentoo ####
Install the [gentoo-snappy overlay](https://github.com/zyga/gentoo-snappy).
#### OpenEmbedded/Yocto ####
Install the [snap meta layer](https://github.com/morphis/meta-snappy/blob/master/README.md).
#### openSUSE ####
sudo zypper addrepo http://download.opensuse.org/repositories/system:/snappy/openSUSE_Leap_42.2/ snappy
sudo zypper install snapd
#### OpenWrt ####
Enable the snap-openwrt feed.
+41
View File
@@ -79,6 +79,47 @@ file exceeds 258 characters on z, so only use this option if you have to.
Here are the command line options specific to local storage
#### --copy-links, -L ####
Normally rclone will ignore symlinks or junction points (which behave
like symlinks under Windows).
If you supply this flag then rclone will follow the symlink and copy
the pointed to file or directory.
This flag applies to all commands.
For example, supposing you have a directory structure like this
```
$ tree /tmp/a
/tmp/a
├── b -> ../b
├── expected -> ../expected
├── one
└── two
└── three
```
Then you can see the difference with and without the flag like this
```
$ rclone ls /tmp/a
6 one
6 two/three
```
and
```
$ rclone -L ls /tmp/a
4174 expected
6 one
6 two/three
6 b/two
6 b/one
```
#### --one-file-system, -x ####
This tells rclone to stay in the filesystem specified by the root and
+29 -25
View File
@@ -1,17 +1,17 @@
---
title: "Microsoft One Drive"
description: "Rclone docs for Microsoft One Drive"
title: "Microsoft OneDrive"
description: "Rclone docs for Microsoft OneDrive"
date: "2015-10-14"
---
<i class="fa fa-windows"></i> Microsoft One Drive
<i class="fa fa-windows"></i> Microsoft OneDrive
-----------------------------------------
Paths are specified as `remote:path`
Paths may be as deep as required, eg `remote:directory/subdirectory`.
The initial setup for One Drive involves getting a token from
The initial setup for OneDrive involves getting a token from
Microsoft which you need to do in your browser. `rclone config` walks
you through it.
@@ -31,31 +31,35 @@ Type of storage to configure.
Choose a number from below, or type in your own value
1 / Amazon Drive
\ "amazon cloud drive"
2 / Amazon S3 (also Dreamhost, Ceph)
2 / Amazon S3 (also Dreamhost, Ceph, Minio)
\ "s3"
3 / Backblaze B2
\ "b2"
4 / Dropbox
\ "dropbox"
5 / Google Cloud Storage (this is not Google Drive)
5 / Encrypt/Decrypt a remote
\ "crypt"
6 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
6 / Google Drive
7 / Google Drive
\ "drive"
7 / Hubic
8 / Hubic
\ "hubic"
8 / Local Disk
9 / Local Disk
\ "local"
9 / Microsoft OneDrive
10 / Microsoft OneDrive
\ "onedrive"
10 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
11 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
11 / Yandex Disk
12 / SSH/SFTP Connection
\ "sftp"
13 / Yandex Disk
\ "yandex"
Storage> 9
Storage> 10
Microsoft App Client Id - leave blank normally.
client_id>
client_id>
Microsoft App Client Secret - leave blank normally.
client_secret>
client_secret>
Remote config
Use auto config?
* Say Y if not sure
@@ -69,8 +73,8 @@ Waiting for code...
Got code
--------------------
[remote]
client_id =
client_secret =
client_id =
client_secret =
token = {"access_token":"XXXXXX"}
--------------------
y) Yes this is OK
@@ -90,21 +94,21 @@ 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 One Drive
List directories in top level of your OneDrive
rclone lsd remote:
List all the files in your One Drive
List all the files in your OneDrive
rclone ls remote:
To copy a local directory to an One Drive directory called backup
To copy a local directory to an OneDrive directory called backup
rclone copy /home/source remote:backup
### Modified time and hashes ###
One Drive allows modification times to be set on objects accurate to 1
OneDrive allows modification times to be set on objects accurate to 1
second. These will be used to detect whether objects need syncing or
not.
@@ -116,7 +120,7 @@ One drive supports SHA1 type hashes, so you can use `--checksum` flag.
Any files you delete with rclone will end up in the trash. Microsoft
doesn't provide an API to permanently delete files, nor to empty the
trash, so you will have to do that with one of Microsoft's apps or via
the One Drive website.
the OneDrive website.
### Specific options ###
@@ -135,14 +139,14 @@ is 10MB.
### Limitations ###
Note that One Drive is case insensitive so you can't have a
Note that OneDrive is case insensitive so you can't have a
file called "Hello.doc" and one called "hello.doc".
Rclone only supports your default One Drive, and doesn't work with One
Rclone only supports your default OneDrive, and doesn't work with One
Drive for business. Both these issues may be fixed at some point
depending on user demand!
There are quite a few characters that can't be in One Drive file
There are quite a few characters that can't be in OneDrive file
names. These can't occur on Windows platforms, but on non-Windows
platforms they are common. Rclone will map these names to and from an
identical looking unicode equivalent. For example if a file has a `?`
Loaded 100 of 490 files, more files were not shown because too many files have changed in this diff. Show more