aws s3 cp to a local file was not replacing file

Viewed 2016

I have a shell script that is running aws s3 cp s3://s3file /home/usr/localfile. The file already exists in that directory, so the cp command is essentially getting the latest copy from S3 to get the latest version.

However, I noticed today that the file was not the latest version; it didn't match the file on S3. Looking at the shell script's stdout from the last two runs, it looks like the command ran - the output is: download: s3://s3file to usr/localfile. But when I compared the copies, they didn't match. The changed timestamp on the file when I view it on the local machine via WinSCP (a file transfer client) didn't change either

I manually ran the command in a shell just now and it copied the file from S3 to the local machine and successfully got the latest copy.

Do I need to add a specific option for this, or is it typical behavior for files to not override a file after aws s3 cp?

0 Answers
Related