Files
mc/cmd
Shubhendu 5386533bb9 Use correct target path during mirroring objects (#4807)
Currently if we don't use absolute paths in mirror command, absolute path of
source gets appended to the target path and so in destination object gets
mirrored to wrong prefix / path.

For example say source object path is `/tmp/source/prefix/a.txt` and mirror
command executed from `/tmp` dir as `mc mirror --json --watch source xyz`,
the object in target gets mirrored to location `xyz/tmp/source/prefix/a.txt`.
Also any new file created gets copied properly though.

```
mc mirror --json --watch source/ xyz/
{
 "status": "success",
 "source": "/tmp/source/prefix/a.txt",
 "target": "xyz/tmp/source/prefix/a.txt",
 "size": 0,
 "totalCount": 1,
 "totalSize": 0
}
{
 "status": "success",
 "source": "/tmp/source/b.txt",
 "target": "xyz/b.txt",
 "size": 0,
 "totalCount": 2,
 "totalSize": 0
}

```

With the fix now after running the command `mc mirror --json --watch source xyz`
the object would correctly get copied to location `/tmp/xyz/prefix/a.txt` as below

```
{
 "status": "success",
 "source": "/tmp/source/prefix/a.txt",
 "target": "xyz/prefix/a.txt",
 "size": 0,
 "totalCount": 2,
 "totalSize": 0
}
{
 "status": "success",
 "source": "/tmp/source/b.txt",
 "target": "xyz/b.txt",
 "size": 0,
 "totalCount": 1,
 "totalSize": 0
}
{
 "status": "success",
 "source": "/tmp/source/c.txt",
 "target": "xyz/c.txt",
 "size": 0,
 "totalCount": 3,
 "totalSize": 0
}
```

Signed-off-by: Shubhendu Ram Tripathi <shubhendu@minio.io>
2023-12-29 12:15:29 -08:00
..
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-03-20 10:17:32 -07:00
2023-09-02 14:28:03 -07:00
2022-12-05 08:32:04 -08:00
2023-09-02 14:28:03 -07:00
2021-09-28 09:19:52 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2022-12-05 08:32:04 -08:00
2023-10-26 14:23:45 -07:00
2023-05-19 15:10:28 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-10-19 11:31:34 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-07-18 13:11:00 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00
2023-09-02 14:28:03 -07:00