#609319 s3cmd: sync always redownloads files when local destination doesn't have trailing slash

#609319#5
Date:
2011-01-08 14:10:34 UTC
From:
To:
Hi

It appears that "s3cmd sync" command will not perform md5 checks and will always re-download all files when the remote source is the root directory of the bucket and local destination path doesn't have a trailing slash.

For example, I have a S3 bucket and a local directory, both containing the same file with the same content:

$ ls -l data
total 4
-rw-r--r-- 1 avian avian 512 jan  8 14:54 foo

$ s3cmd ls s3://data111
2011-01-08 13:55       512   s3://data111/foo

The following 4 sync commands all have the same effect, except that in the first 2 cases s3cmd will always redownload the file, even when it is identical at both ends:

$ s3cmd sync s3://data111/ data
s3://data111/foo -> data/foo  [1 of 1]
 512 of 512   100% in    0s  1499.68 B/s  done
Done. Downloaded 512 bytes in 0.3 seconds, 1497.26 B/s

$ s3cmd sync s3://data111 data
s3://data111/foo -> data/foo  [1 of 1]
 512 of 512   100% in    0s  1880.70 B/s  done
Done. Downloaded 512 bytes in 0.3 seconds, 1874.49 B/s

$ s3cmd sync s3://data111/ data/

$ s3cmd sync s3://data111 data/

Best regards
Tomaž

#609319#10
Date:
2014-09-02 17:41:30 UTC
From:
To:
package s3cmd
forwarded 609319 https://github.com/s3tools/s3cmd/issues/245
thanks

This issue is open in upstream bugtracker.

Best regards,
Mikhail Gusarov.