1
0
mirror of https://github.com/minio/mc.git synced 2025-11-12 01:02:26 +03:00
Commit Graph

82 Commits

Author SHA1 Message Date
Ashish Kumar Sinha
1582b1cf35 Add support for passing non-printable charachter as key (#2851) 2019-08-29 16:57:04 -07:00
Harshavardhana
7c454d8f94 Migrate to new minio/cli, fix all extra spaces across commands (#2825) 2019-07-15 19:59:28 +01:00
Harshavardhana
e978c71b7c Add staticcheck based builds (#2788)
Additionally this PR also supports
multi-platform builds to avoid cross
platform build issues.
2019-06-03 11:22:31 -07:00
ebozduman
83a9d8b91d Adds missing codebase MinIO and min.io changes (#2745) 2019-04-16 22:31:54 -07:00
poornas
8ae04b41b0 mirror: fix 0 byte files not getting mirrored (#2739)
Fixes: #2737
2019-04-03 08:15:17 -07:00
poornas
0490231b34 For non-canned policies, show policy status as custom (#2716) 2019-03-19 09:11:16 +05:30
Anis Elleuch
affc127af0 mirror: Return non-zero exit code for errors occuring during mirror (#2705)
An error, such as, `Bad Request` when copying an object without supplied
keys is not reflected in the exit code.

This commit simplifies a bit the mirror code. It makes mirror before and
after starting to send the status to mj.status.
2019-03-12 16:36:14 -07:00
Ashish Kumar Sinha
1761b338f9 OlderThan & NewerThan configured for Days, Hours and Minutes (#2614)
Previously OlderThan and NewerThan was configured for day
which has been changed to Days, Hours and minutes.

Also, changed the `flag` in `find` command to be `newer-than` and `older-than` to be consistent with other commands.
2019-03-03 20:18:34 -08:00
Sidhartha Mani
c75abbb3f9 use colorjson for all other mc outputs (#2683)
- Update to MarshalIndent instead of Marshal
- Allow unmarshalling
2019-02-28 14:33:13 -08:00
poornas
e538599e2f Add mc rb command to remove empty bucket (#2662)
Change mc rm --recursive behavior to
delete objects in bucket but not the
bucket itself.

Fixes #2635
2019-02-16 20:12:38 -08:00
Anis Elleuch
38965dd432 mirror: Proper exit when preparing diff returns an error (#2681)
A bad synchornization between startMirror() and its caller mirror() happens when preparing the difference of objects between source & target returns an error: mirror() quits when it receives an error from startMirror() without give a chance for that latter to properly stop the parallel mirror manager.

This PR will:
1. Quit mirroring when listing returns an error: this means calculating diff needs to stop and no further action needs to be taken since it can be dangerous especially when --remove flag is passed.
2. Properly stop parallel mirroring manager before quitting.
2019-02-12 14:28:38 -08:00
Praveen raj Mani
30965763d6 Support setting of custom policies from a JSON file (#2649)
Fixes #2633
2019-01-28 13:30:31 -08:00
Anis Elleuch
a5ea937df2 mirror: Fix double printing of remove object msg (#2639)
Mirror code depends on rm code which naturally prints delete messages,
this PR will make mirror uses its own delete code since it is simple
enough to do.

Also add size information to remove message
2019-01-24 07:13:46 -08:00
Harshavardhana
59ef9fe468 Support SSE without keys (#2626) 2019-01-04 11:56:43 -08:00
Praveen raj Mani
69f967b3f3 mc mirror should not stop incase of errors (#2624)
Fixes #2623
2018-12-12 10:48:48 -08:00
Harshavardhana
cb4f46854b Fix command line names and documentation (#2602) 2018-11-19 17:19:53 -08:00
kannappanr
2fc5413002 Fix: Remove local file during a mirror operation (#2593)
Fixes #2586
2018-11-09 13:31:15 -08:00
Harshavardhana
7260b0f9ea Ignore errors during mirror (#2562)
S3 lists 1000 objects in batches, but once this batch is being
processed to be copied over there is no way to lock across the
entire batch for mirroring. Due to this we introduce a scenario
when objects might have been deleted in parallel from another
application.

In such a scenario simply ignore such objects and proceed to
copy other files.

Fixes #2537
2018-10-01 15:33:18 +05:30
Praveen raj Mani
ab31cf97da Remove extraneous bucket on target while mirroring (#2550)
Fixes  #2527
2018-09-25 10:20:14 -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
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
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
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
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
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
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
ebozduman
efeaf2ee72 Stops removing target bucket content when url.Error (#2377) 2018-02-21 12:22:09 +05:30
A. Elleuch
017dddef97 Add --newer-than & --older-than flags (#2142)
Use --newer-than & --older-than to select newer or older files
in copy, remove and mirroring operations.
2018-02-01 10:32:22 -08:00
Harshavardhana
13259eea21 mirror with --watch should copy and exit for s3 endpoints (#2345)
Current code wouldn't exit unless we press CTRL+C
even if the endpoints do not support --watch, this PR
fixes this behavior.
2018-01-08 10:56:56 -08:00
A. Elleuch
5ddf9728f8 Parallelize upload/remove in cp/mirror commands (#2289)
This PR removes --parallel flag and implements a dynamic way of adding
threads to accelerate mirror/cp command.

After the calculation of objects that need to be copied/removed, mc
sends tasks (upload/remove) to a parallel manager which monitors the
progress of tasks and decide to allocate more threads to it to
accelerate the overall work.

This is very useful when we copy/mirror many relatively small files.
2017-12-07 16:20:34 -08:00
poornas
275db95170 mc: Remove MC_MULTIPART_THREADS env variable (#2326)
Remove this var as PR#2289 will manage threads automatically based on
workload to speed up mc cp/mirror operations.
2017-12-06 09:30:20 -08:00
kannappanr
1fd03fb81f Rearrange exclude code to filter source and target URLs (#2322)
Move exclude code handler to mirror-url and mirror-main

Fixes #2319
2017-12-04 15:47:29 -08:00
Harshavardhana
dfffc1e7cc mirror: Deprecate --force instead add --overwrite (#2318)
Fixes #2317
2017-11-30 16:51:17 +05:30
poornas
ab6b2a83ac Add new stat sub command (#2275) 2017-10-31 13:56:40 -07:00
poornas
a86080a0b7 Add context in Put api call for cp/mirror. (#2291) 2017-10-20 13:50:35 -07:00
kannappanr
9831612507 Add exclude option to mirror command (#2269)
Added exclude options to exclude unwanted system files.
Exclude option excludes the source files/objects that match
the passed shell file name pattern

Fixes #1903
2017-10-12 14:52:21 -07:00
A. Elleuch
8f38471e29 fix: Correct some cp/mirror help indentations (#2268) 2017-10-06 09:35:44 -07:00
poornas
224e602e59 Allow multipart threads to be configured via environment variable (#2254) 2017-10-02 19:45:08 -07:00
Aditya Manthramurthy
ca96cfc6e6 Move pkg/probe from vendor dir to package dir (#2236)
The probe package is no longer available in the Minio server
repo. This change just moves probe from the vendor directory to its
own dir under `pkg`.

This is a maintenance fix.
2017-08-14 11:13:38 -07:00
Nitish Tiwari
fed9ebe39d - Call the progress bar Finish method once all files are updated (#2165)
- Fixes https://github.com/minio/mc/issues/2161
2017-05-26 18:17:50 +01:00
Anis Elleuch
6c677e0d11 mirror: Sync empty buckets (#2160) 2017-05-22 09:21:45 -07:00
Harshavardhana
7f65ad4957 Add UTCNow() helper function (#2155)
This patch adds UTCNow() function which returns current UTC time.

This is equivalent of UTCNow() == time.Now().UTC()

Refer https://github.com/minio/minio/pull/3931
2017-05-16 18:50:54 +02:00
Anis Elleuch
e54962e17f mb: Add -p flag to ignore existing bucket/dir (#2143)
If a remote directory/bucket exists, -p will still make mb cmd
happy if the target already exists.
2017-04-28 13:13:44 -07:00
Harshavardhana
9ea42680b0 watch/events: Add eventInfo struct for brevity. (#2120) 2017-04-11 09:08:04 -07:00
Harshavardhana
b0968e29e8 watch/events: Support events on Get/Head operations as well. (#2116)
Fixes #2073
2017-04-10 11:50:52 -07:00