I'm trying to copy/move/sync the files from local directory to S3 using the AWS Command-Line Interface (CLI).
I was able to successfully upload files for the very first time to the S3 bucket but when I try to run the same command again for uploading the second time it fails to upload. The command doesn't throw any error.
Here is the command which I ran for moving the files.
aws s3 mv --recursive my-directory s3://my-files/
For instance, I had files file1.pdf, file2.pdf and file3.pdf.
If I delete file2.pdf from the s3 bucket and try to copy the file again using cp or sync or mv. It won't be uploading the file back again to s3 bucket.
AWS CLI Version: aws-cli/1.15.10 Python/2.6.6 Linux/2.6.32-642.6.2.el6.x86_64 botocore/1.10.10
Any thoughts?
mvcommand copies the files, then deletes them. (It does not delete the directories, it only deletes the files.) If you were to run it a second time, there are no files to move, so nothing happens -- this should be expected. Or did you put new files inmy-directorybefore running the command again? - John Rotensteincp,mv&syncto have the file updates between the s3 and my local. I have deleted a bunch of files from the s3 bucket. When I try tocpfiles back again it would run the command successfully but doesn't copy/upload anything to s3. - Tejamv, it copies the file and then deletes the local file. If you try to move/copy it again, it isn't available locally, so there is nothing to move/copy. - John Rotenstein