Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS CLI S3 : Stop/Terminate a running command

I have 40k mp3 files in my bucket's root directory(mess!). I planned to move all these mp3 files into a folder inside my bucket. I figured out a way for doing this through AWS S3 CLI.

I used a simple move command for moving my files, I tested this command on a small batch of files and it works fine:

aws s3 mv s3://mybucket/ s3://mybucket/converted/audios/ --exclude "" --include "__converted.mp3" --recursive

My Problem:

When I ran this command in Windows CMD, it keeps on running(cursor is blinking and there is no output yet). I guess it is because of large number of files. I want to terminate this action.

So, how can I terminate this command which is running ?

After surfing through AWS CLI documentation I found the Cancel command. But this requires a command_id.

Am I going in the right direction ?

like image 790
dollardhingra Avatar asked May 22 '26 20:05

dollardhingra


2 Answers

CTRL+BREAK, as Ctrl+C did not work for me.

like image 105
Andy Wrench Avatar answered May 25 '26 04:05

Andy Wrench


The AWS Command-Line Interface (CLI) runs locally.

There is no move command on AWS. Instead, the CLI is gathering a list of files and is issuing individual Copy commands to copy files from their current Key to the desired Key (Key = full path of filename). It then deletes the source files.

So, just use Ctrl+C to stop the process.

(The Cancel command you linked is to stop a Systems Manager (SSM) job running on AWS. It is not related to work done by the AWS CLI.)

like image 41
John Rotenstein Avatar answered May 25 '26 04:05

John Rotenstein