Skip to content

Instantly share code, notes, and snippets.

View fabiop's full-sized avatar

Fabio Pedrazzoli fabiop

View GitHub Profile

Keybase proof

I hereby claim:

  • I am fabiop on github.
  • I am fabiopg (https://keybase.io/fabiopg) on keybase.
  • I have a public key ASCPdta3lRW2NZAcSoBAj8ra0wfyDqXJphtMepau-9gMYgo

To claim this, I am signing this object:

@fabiop
fabiop / gist:8298190
Last active January 2, 2016 11:39
Simple bash script to download, clean and prepare S3 logs for awstats. This is assuming you want to keep track of S3 downloads <strong>whose logs are kept in a separate bucket</strong> <strong>Careful because the script will empty the log bucket! </strong>
#!/bin/bash -e
DATE=`date +%Y-%m-%d`
S3CMD=/usr/bin/s3cmd
# S3 bucket name without the s3 url
# **** CAREFUL THIS BUCKET WILL BE EMPTIED ****
S3BUCKETNAME="my.s3.log.bucket.name"
LOGDIR=/var/log/s3/${S3BUCKETNAME}