mv

Moves a Storj object to another location in Storj

Usage

./uplink.exe mv SOURCE DESTINATION [flags]
./uplink.exe mv SOURCE DESTINATION [flags]

The mv command is used to move or rename objects within the same Storj 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

FlagDescription
--access stringthe serialized access, or name of the access to use
-r, --recursiveMove all objects or files under the specified prefix or directory
-p, --parallelism intControls how many objects will be moved in parallel (default 1)
--dryrunPrint what operations would happen but don't execute them
--progressShow a progress bar when possible (default true)
--help, -hhelp for mv

Global Flags

FlagDescription
--config-dir stringDirectory that stores the configuration (default "/home/user/.config/storj/uplink")
--summaryprints a summary of what commands are available
--advancedwhen used with -h, prints advanced flags help

Examples

Move an object within an existing bucket

When the mv command is used to move a file within Storj, 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:

./uplink.exe mv sj://cakes/cheesecake.jpg sj://cakes/New-York/cheesecake.jpg
./uplink.exe mv sj://cakes/cheesecake.jpg sj://cakes/New-York/cheesecake.jpg

You cannot use pattern 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.

Sample Output:

Move an object from a one bucket to another

When the mv command is used to move an object from one Storj bucket to another Storj 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.

./uplink.exe mb sj://new-recipes
./uplink.exe mb sj://new-recipes
Bucket new-recipes created
Bucket new-recipes created

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:

./uplink.exe mv sj://cakes/New-York/cheesecake.jpg sj://new-recipes/cakes/cheesecake.jpg
./uplink.exe mv sj://cakes/New-York/cheesecake.jpg sj://new-recipes/cakes/cheesecake.jpg

Sample Output:

Troubleshooting move errors

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

uplink mv sj://cakes/New-York/cheesecake.jpg sj://new-recipes/cakes/cheesecake.jpg



Error: uplink: metaclient: metabase: unable to update object: ERROR: duplicate key value violates unique constraint "primary" (SQLSTATE 23505)
uplink mv sj://cakes/New-York/cheesecake.jpg sj://new-recipes/cakes/cheesecake.jpg



Error: uplink: metaclient: metabase: unable to update object: ERROR: duplicate key value violates unique constraint "primary" (SQLSTATE 23505)

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 rm command.

Previous
meta get
Next
rb