Throttling S3 commands with aws cli

前端 未结 5 2109
甜味超标
甜味超标 2021-02-07 07:31

I\'m running a backup script using AWS CLI to perform an S3 sync command every night on my MediaTemple server. This has run without fail for months, but I updated my Plesk insta

5条回答
  •  花落未央
    2021-02-07 07:57

    If you can not make trickle work with aws s3 command like me, you may use:

    sudo apt-get install pv (or yum install pv) pv -L 1M local_filename 2>/dev/null | aws s3 cp - s3://bucket_name/remote_filename

    where -L 1M limits the bandwidth to 1M/s and the dash after cp indicate stdin

    Note: the awscli from apt-get is too old to support the stdin input, you need to upgrade it via pip

提交回复
热议问题