Warning: Undefined variable $allowed_html in /home/public/wp-content/themes/uncover/inc/template-functions.php on line 118

Rotate Backups with logrotate

Why recreate the tasks available with logrotate? It’s already installed.

Say you’re backing up files something like this:

# tar czf /backups/full.tgz /

Now you can have logrotate manage rotating the old ones out, keeping the new ones in order with a quick config:

# cat /etc/logrotate.d/backups
/backups/full.tgz {
    rotate 10

The rest is automatic.