Here is a rudimentary script to backup a specific Postgres DB. Logrotate then takes care of the log rotation. As you'll see below we will keep 7 days worth of compressed files. #! /bin/bash # This script is called from logrotate /etc/logrotate.d/my-dumps # It backs up myDB every evening and logrotate takes care of compression Read More…