Storj DCS
Search…
Storj DCS
Decentralized Cloud Storage
Resources
mv
Moves a Storj object to another location in Storj DCS

Usage

Windows
Linux
macOS
1
./uplink.exe mv SOURCE DESTINATION [flags]
Copied!
1
uplink mv SOURCE DESTINATION [flags]
Copied!
1
uplink mv SOURCE DESTINATION [flags]
Copied!
The mv command is used to move or rename objects within the same Storj DCS project. The mv command uses a server-side move (rename) method, it does not incur a fee for downloading and will be performed with no delay.

Flags

Flag
Description
--access string
the serialized access, or name of the access to use
--help, -h
help for mv

Examples

Move an object within an existing bucket

When the mv command is used to move a file within Storj DCS, the CLI will move (rename) the object using the server-side method to rename the object.
To move cheesecake.jpg within the existing bucket cakes, use the following command:
Windows
Linux
macOS
1
./uplink.exe mv sj://cakes/cheesecake.jpg sj://cakes/New-York/cheesecake.jpg
Copied!
1
uplink mv sj://cakes/cheesecake.jpg sj://cakes/New-York/cheesecake.jpg
Copied!
1
uplink mv sj://cakes/cheesecake.jpg sj://cakes/New-York/cheesecake.jpg
Copied!
You cannot use regular expressions to specify which files to copy (e.g. uplink mv sj://cakes/cheese* sj://cakes/New-York/ will not work). Also, you can only specify one source at a time (no uplink mv sj://cakes/cheesecake.jpg sj://cakes/cheesecake2.png sj://cakes)
Sample Output:

Move an object from a one bucket to another

When the mv command is used to move an object from one Storj DCS bucket to another Storj DCS bucket, the CLI will use a server-side move method.
To create a new bucket, we will use the mb command, as a move is possible only to an existing bucket.
Windows
Linux
macOS
1
./uplink.exe mb sj://new-recipes
Copied!
1
uplink mb sj://new-recipes
Copied!
1
uplink mb sj://new-recipes
Copied!
1
Bucket new-recipes created
Copied!
Nested buckets are not supported, but you can use prefixes, as they would act almost like subfolders.
To move an object from one bucket to another, use:
Windows
Linux
macOS
1
./uplink.exe mv sj://cakes/New-York/cheesecake.jpg sj://new-recipes/cakes/cheesecake.jpg
Copied!
1
uplink mv sj://cakes/New-York/cheesecake.jpg sj://new-recipes/cakes/cheesecake.jpg
Copied!
1
uplink mv sj://cakes/New-York/cheesecake.jpg sj://new-recipes/cakes/cheesecake.jpg
Copied!
Sample Output:

Troubleshooting move errors

ERROR: duplicate key value violates unique constraint "primary" (SQLSTATE 23505)

1
uplink mv sj://cakes/New-York/cheesecake.jpg sj://new-recipes/cakes/cheesecake.jpg
2
3
4
5
Error: uplink: metaclient: metabase: unable to update object: ERROR: duplicate key value violates unique constraint "primary" (SQLSTATE 23505)
Copied!
This error means that the destination object already exists. You should either use a different destination name/prefix or remove the existing object from the destination.
To remove an object, use the uplink rm command.
Last modified 1mo ago