I have AWS account. I\'m using S3 to store backups from different servers. The question is there any information in the AWS console about how much disk space is in use in my
See https://serverfault.com/questions/84815/how-can-i-get-the-size-of-an-amazon-s3-bucket
Answered by Vic...
' . print_r($s3->listBuckets(), 1). '';
$totalSize = 0;
$objects = $s3->getBucket('name-of-your-bucket');
foreach ($objects as $name => $val) {
// If you want to get the size of a particular directory, you can do
// only that.
// if (strpos($name, 'directory/sub-directory') !== false)
$totalSize += $val['size'];
}
echo ($totalSize / 1024 / 1024 / 1024) . ' GB';
?>