Skip to content

Instantly share code, notes, and snippets.

@westonplatter
Last active August 29, 2015 14:03
Show Gist options
  • Select an option

  • Save westonplatter/295319737c03ad7130f9 to your computer and use it in GitHub Desktop.

Select an option

Save westonplatter/295319737c03ad7130f9 to your computer and use it in GitHub Desktop.
# $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/syslog-ng.logrotate,v 1.3 2008/10/15 20:46:12 mr_bones_ Exp $
#
# Syslog-ng logrotate snippet for Gentoo Linux
# contributed by Michael Sterrett
#
/var/log/auth.log {
su root root
missingok
sharedscripts
postrotate
echo "== postrotate start"
echo "-- restart rsyslog"
service rsyslog restart
echo "-- s3 upload"
BUCKET=my-logs-bucket
INSTANCE_ID=my-machine-id
/usr/local/bin/s3cmd -m text/plain sync /var/log/auth.log.* s3://${BUCKET}/${INSTANCE_ID}/auth.log
echo "== postrotate end"
endscript
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment