Commit Graph
283 Commits
Author SHA1 Message Date
Harshavardhana a83ffe321c Implement select command (#2538) 2018-09-30 23:18:33 -07:00
Anis Elleuch 87f7e65c4c Disallow copying/mirroring a folder into itself (#2553)
As unix cp command complains when you copy a directory into itself,
(such as `cp -r ~/Desktop/ ~/Desktop/sub/`), mc will follow the
same behavior with this commit.

The main reason is that copy or mirror command can be unpredictable
with the style of copy.

Example:

```
$ mc ls -r myminio/testbucket/
[2018-09-25 19:28:17 CET]     8B dir/object
[2018-09-25 19:28:40 CET]     8B object

$ mc -q cp -r myminio/testbucket/ myminio/testbucket/dir/
`myminio/testbucket/dir/object` -> `myminio/testbucket/dir/dir/object`
`myminio/testbucket/object` -> `myminio/testbucket/dir/object`

```

We can notice that `myminio/testbucket/dir/object` is both source and target
in the copy operation. The last copy operation that will occur will rule the
result of the total copy operation and `myminio/testbucket/dir/dir/object`
will have a different content in each copy operation.

Due to the unpredictability mentionned above, we will disallow copying or
mirroring a folder into itself.
2018-09-25 17:34:40 -07:00
Praveen raj Mani ab31cf97da Remove extraneous bucket on target while mirroring (#2550)
Fixes  #2527
2018-09-25 10:20:14 -07:00
Praveen raj Mani b2d2e09105 mc heal and mc mirror should respond with proper exit code (#2543)
respond with os.exit(0) incase of errors

Fixes #2534 #2474
2018-09-20 15:23:40 -07:00
kannappanr c9f33698fc Display the config in correct format when json flag is used (#2544)
Fixes #2530
2018-09-19 11:48:21 -07:00
kannappanr c352cadd4b Display restart failures in admin service restart command (#2533)
Fixes #2532
2018-09-10 16:23:17 -07:00
Harshavardhana 12627c35e4 Fix parallel upload performance issues (#2521)
Tested by transferring 29GiB data, around 246569 files
over 100Gig network.

- master branch
```
time mc mirror /root myminio/testbucket/
real	2m10s
```

- after changes
```
time mc mirror /root myminio/testbucket/
real	1m2s
```

By default runtime.NumCPU() workers are started.
2018-08-30 22:31:08 +05:30
poornas 1d5870b2a2 Fix url parsing of MC_HOSTS_ env variable (#2523) 2018-08-30 22:22:53 +05:30
Harshavardhana bc756e3dbd Fix cp crash when resuming from session (#2520)
We should make sure to handle errors properly
when reading from the session and also parsing.

Current master ignores all these situations
which leads to crash, this PR handles this to avoid
nil pointer crashes.
2018-08-27 12:03:40 -07:00
Aarushi Arya bc679788ac mirror watch: Exit on error while copying. (#2511)
mirror: exit, if copy error occurs while watching.

Fixes #2505
2018-08-23 15:58:14 -07:00
Harshavardhana 073ed250fe Update madmin API with latest server changes (#2516) 2018-08-17 18:55:05 -07:00
Harshavardhana 3b78c115f6 Remove workaround for http response tracer (#2514) 2018-08-17 17:15:03 -07:00
Harshavardhana 26f5102eae Remove/deprecate admin lock commands (#2503) 2018-08-06 12:59:13 -07:00
Ashish Kumar Sinha 9998e077df Remove error statement in mc mirror (#2500)
mc mirror complains about extra file in destination,
but this is not an error so removed the error message.

Fixes: #2470
2018-08-02 22:45:54 +05:30
Nitish Tiwari 480bc8aa2a Use randString() to generate random string for S3 sign probe (#2498)
newRandomID() func may return string with uppercase letters. Such
strings will make invalid bucket name as S3 doesn't allow
uppercase lettes in bucket names.

randString() always returns strings with lowercase letters or
numbers.

Fixes #2496
2018-07-31 20:53:39 +05:30
Ryan Boehning a8c97b467d Replace legacy httplex import with current x/net/httpguts (#2494)
The import path of the httplex package has changed.
2018-07-29 00:45:12 -07:00
Harshavardhana 7f01db2cda create bucket automatically when prefix is created (#2488) 2018-07-27 15:29:53 -07:00
Anis Elleuch d83e73b85b Pick a random bucket name when probing for signature version (#2491)
Probing buckets is a mechanism used to automatically detect supported
S3 signature version. However, it seems that probe-bucket-sign is already
used by someone, the thing that makes probing fails with 403 error. This
PR changes the code to pick a random bucket name when probing.
2018-07-24 20:19:26 -07:00
smouli 7e49e2d519 fix for mc find --ignore option (#2489) 2018-07-22 15:03:09 -07:00
ebozduman 5a962a7cf5 Vendorizing changes required for PR#6067 (#2481) 2018-07-16 08:27:22 -07:00
Harshavardhana 70dcf20d74 Pass down encrypt-key handling across command validators (#2483)
Currently even if the command supports encrypted objects,
the syntax verification would fail on them in certain
cases. Since syntax validation of source/targets doesn't
use the parsed encrypt key pairs.  This PR fixes this
behavior.
2018-07-12 11:13:51 -07:00
Harshavardhana 4ab7f30f99 Handle directories properly in cp and mirror (#2478)
Fixes #2477
2018-06-29 16:56:02 -07:00
Harshavardhana 29f2dbca6b Fix 'mc mb' to guide the user when bucket is not passed (#2476)
Additionally this PR also allows for creating
prefixes on S3 compatible object storage backends
in the following form

```
mc mb s3/harshavardhana/object/prefix/
```
2018-06-29 14:56:07 -07:00
Harshavardhana 4070902cda Allow creating directories from S3 to filesystem (#2471)
Fixes #2460
2018-06-20 17:47:26 -07:00
Harshavardhana afcfe758f3 Fix joinPath function to handle directories properly (#2459) 2018-06-06 11:29:05 +05:30
Anis Elleuch c0b89a7aec Add support of empty directories in ls/rm/find commands (#2452) 2018-06-04 17:20:07 -07:00
Harshavardhana 2d4346bfe1 Add 'mc admin' complete guide (#2456)
Fixes #2428
2018-06-01 09:16:01 +05:30
Anis Elleuch d566905d7a Properly shutdown parallel copy in cp command (#2448) 2018-05-31 12:38:22 -07:00
Harshavardhana 961c4b5dae Add total used support for mc admin info (#2449) 2018-05-23 17:44:50 -07:00
Praveen raj Mani b41b98b04d mc mirror watch fix in darwin (#2445)
The event.Path had few prefixes appended in it (only in darwin).
Instead of taking the trimmed directory path, It takes the full path, say '/private/...".
This disturbs the target URL. Which indeed inserts it as a whole '/private/{target_path}',
So trimming the prefixes in the event.path solved it.

Solves:#2443
2018-05-13 19:34:49 -07:00
Anis Elleuch 182ad295d8 Quit calculating difference for any listing error (#2440)
If we have any listing problem, we should stop comparing difference
between source & target lists because it is already so hard to know
what mc should do next. So, let's inform users and let them deal
with the problem.
2018-04-26 11:21:10 -07:00
Harshavardhana 75e9691616 Support server side copy object with progress (#2438)
Support server side copy object with progress
and also uses a more optimized version to perform
multipart server side copy operation.
2018-04-26 11:02:06 +05:30
Anis Elleuch 1ccf40d1e5 Properly stop parallel work in mirror/cp when the user clicks on Ctrl-C (#2437) 2018-04-25 11:55:07 -07:00
Harshavardhana 2dc48e9dd3 Simplified build system and move to go1.10.1 (#2431)
minio server simplified its build system, this
change borrows the same technique to `mc` as well.

This PR fixes build messages and overall behavior
of our builds on travis and appveyor.
2018-04-13 13:57:07 -07:00
Anis Elleuch 757fff7764 Simplify parallel manager implementation (#2413)
Each 5 seconds, calculate current bandwidth and add new workers as
bandwidth gets increased. Stop adding workers if it is not useful
for increasing bandwidth.
2018-04-06 18:46:35 -07:00
kannappanr 0fe4319e17 Fix display message when list and remove notifications are called (#2424) 2018-04-05 13:19:16 -07:00
poornas 18ddd3925b Config: avoid adding default configs if entries present (#2426) 2018-04-03 13:09:32 -07:00
Anis Elleuch 45b32d3985 errors: Add missing ending dot in error & fatal messages (#2418) 2018-03-23 12:22:55 +05:30
Anis Elleuch ae3c123a5c Do not exit mirroring for cannot delete/overwrite errors (#2416)
mc used to show a warning messages during mirroring when it
detects a need to overwrite or remove a remote object but no
flag is specified. This commit efeaf2ee72
changed this behavior but this commit will restablish
the old behavior.
2018-03-22 13:37:32 -07:00
poornas fe82b0381c change encryption key parsing to allow spaces in sse-c key (#2408)
Also vendoring in minio-go updates
2018-03-14 02:47:14 -07:00
poornas 0ede95b65e add encrypt option to cp, mirror,pipe,stat, cat and rm commands (#2400) 2018-03-08 17:18:41 +05:30
Nitish Tiwari ea580b0b65 Add storage-class support (#2403)
This PR adds storage-class support for mc cp and mirror command.
Storage class values are passed via the -storage-class or
--sc flag.

Fixes #1859
2018-03-03 10:28:53 -08:00
kannappanr b1dd99c94d Detect duplicate config entry in mc add event (#2402)
Fixes #2324
2018-02-26 14:28:33 -08:00
kannappanr 57bf0c0e79 Fix moving standard metadata as user defined header in s3Client's PUT method (#2401)
Standard headers like Content-Disposition, Content-Encoding,
Cache-Control, Content-Language were made part of user metadata
causing it to fail while mirroring, if the source has these headers
set.

Fixes #2358
2018-02-24 15:12:01 -08:00
ebozduman efeaf2ee72 Stops removing target bucket content when url.Error (#2377) 2018-02-21 12:22:09 +05:30
Harshavardhana 97c7984bca Large bucket support admin API Changes (#2372) 2018-02-15 18:35:05 -08:00
Aditya Manthramurthy 335a53ad29 Fix flickering in heal dashboard UI (#2391) 2018-02-14 10:15:26 -08:00
Harshavardhana d4981656d3 Remove response timeout for admin operations (#2390) 2018-02-13 15:40:46 -08:00
Harshavardhana 766e04d79d fix crashes on 32bit systems use LoadUint32() instead (#2389) 2018-02-12 10:25:06 -08:00
poornas 65e22bee24 Add api as option for mc config host add command. (#2381) 2018-02-10 14:39:12 -08:00