This is a script that gathers the mail data from docker-mailserver and uploads them to a defined S3 bucket.
This is meant to run as a cronjob repeatedly. To run this:
- Git clone this.
- Use GPG to decrypt the secrets.json.gpg file.
- Update any settings as required
- Add the python file to your root user's crontab
Monitoring is done by newrelic by gpg decrypting the newrelic.ini file and running the python script with newrelic-admin run-program
.
To encrypt: gpg --symmetric --cipher-algo AES256 filename.ext
To decrypt: gpg --decrypt filename.ext.gpg > filename.ext
Full run command: NEW_RELIC_CONFIG_FILE=newrelic.ini NEW_RELIC_SHUTDOWN_TIMEOUT=2.5 newrelic-admin run-program python backup.py