Search code examples
python-3.xamazon-web-servicesamazon-s3boto3

Is it possible to run aws s3 sync with boto3?


AWS CLI provides aws s3 sync command to sync data between 2 locations.

Is there an equivalent command in boto3?

I can't find this kind of command in boto3 documentation.


Solution

  • boto3 does not include s3 sync capabilities. That is only available via the AWS CLI tool.

    Interestingly, there's still an open issue at boto's Github that dates back to... 2015.

    I guess your best bet is to run the aws s3 sync from within a Python script.

    Here's a sample implementation.

    Alternatively, you might want to explore the DataSync client.